Skip to content

Commit 22104e4

Browse files
authored
chore: remove @microsoft/applicationinsights-common dependency (#255)
* chore: remove @microsoft/applicationinsights-common dependency * fix: import BreezeChannelIdentifier from applicationinsights-core-js * fix: add npm override to deduplicate @microsoft/applicationinsights-core-js Both @microsoft/1ds-post-js@4.4.1 and @microsoft/1ds-core-js@4.4.1 pin @microsoft/applicationinsights-core-js to exactly 3.4.1, while the top-level dependency resolves to 3.4.2. npm installs nested duplicate copies, causing TypeScript to see structurally distinct but incompatible IXHROverride types from different module resolution paths. Adding the npm override forces all packages to use the same version, eliminating duplicate nested copies and fixing the TS2345 compile error. * fix: bump 1ds packages to 4.4.2 to fix applicationinsights-core-js duplicate @microsoft/1ds-core-js@4.4.2 and @microsoft/1ds-post-js@4.4.2 updated their pinned dependency on @microsoft/applicationinsights-core-js from 3.4.1 to 3.4.2, matching the top-level version. npm can now naturally deduplicate to a single copy, eliminating the TypeScript type mismatch without needing the override workaround. * chore: remove deprecated @microsoft/1ds-core-js package @microsoft/1ds-core-js is deprecated; its functionality has been merged into @microsoft/applicationinsights-core-js. Update 1dsClientFactory.ts to import AppInsightsCore and IExtendedConfiguration directly from @microsoft/applicationinsights-core-js and remove the 1ds-core-js dependency from package.json. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 09b228a commit 22104e4

4 files changed

Lines changed: 12 additions & 73 deletions

File tree

package-lock.json

Lines changed: 7 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
"lint": "eslint src"
2323
},
2424
"dependencies": {
25-
"@microsoft/1ds-core-js": "^4.4.1",
26-
"@microsoft/1ds-post-js": "^4.4.1",
27-
"@microsoft/applicationinsights-common": "^3.4.2",
25+
"@microsoft/1ds-post-js": "^4.4.2",
2826
"@microsoft/applicationinsights-core-js": "^3.4.2",
2927
"@microsoft/applicationinsights-web-basic": "^3.4.2"
3028
},

src/common/1dsClientFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import type { AppInsightsCore, IExtendedConfiguration } from "@microsoft/1ds-core-js";
6+
import type { AppInsightsCore, IExtendedConfiguration } from "@microsoft/applicationinsights-core-js";
77
import type { IChannelConfiguration, IXHROverride, PostChannel } from "@microsoft/1ds-post-js";
88
import type * as vscode from "vscode";
99
import type { BaseTelemetryClient } from "./baseTelemetrySender";
@@ -16,7 +16,7 @@ import { SenderData } from "./baseTelemetryReporter";
1616
* @returns The AI core object
1717
*/
1818
const getAICore = async (key: string, vscodeAPI: typeof vscode, xhrOverride?: IXHROverride): Promise<AppInsightsCore> => {
19-
const oneDs = await import(/* webpackMode: "eager" */ "@microsoft/1ds-core-js");
19+
const oneDs = await import(/* webpackMode: "eager" */ "@microsoft/applicationinsights-core-js");
2020
const postPlugin = await import(/* webpackMode: "eager" */ "@microsoft/1ds-post-js");
2121
const appInsightsCore = new oneDs.AppInsightsCore();
2222
const collectorChannelPlugin: PostChannel = new postPlugin.PostChannel();

src/common/appInsightsClientFactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import type { IXHROverride } from "@microsoft/applicationinsights-core-js";
7+
import { BreezeChannelIdentifier } from "@microsoft/applicationinsights-core-js";
78
import type { ApplicationInsights } from "@microsoft/applicationinsights-web-basic";
8-
import { BreezeChannelIdentifier } from "@microsoft/applicationinsights-common";
9+
910
import { ReplacementOption, SenderData } from "./baseTelemetryReporter";
1011
import { BaseTelemetryClient } from "./baseTelemetrySender";
1112
import { TelemetryUtil } from "./util";

0 commit comments

Comments
 (0)