Skip to content

Commit

Permalink
feat!: core7, node17 modules
Browse files Browse the repository at this point in the history
BREAKING CHANGE: core imports from top-level, core7
  • Loading branch information
mshanemc committed Apr 10, 2024
1 parent 8671dcd commit 420c422
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 258 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"!lib/**/*.map"
],
"dependencies": {
"@salesforce/core": "^6.7.6",
"@salesforce/core": "^7.0.0",
"@salesforce/kit": "^3.1.0",
"applicationinsights": "^2.9.5",
"got": "^11",
Expand Down
4 changes: 2 additions & 2 deletions src/appInsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import * as os from 'node:os';
import { Logger } from '@salesforce/core';
import { Logger } from '@salesforce/core/logger';
import { AsyncCreatable, Env } from '@salesforce/kit';
import * as appInsights from 'applicationinsights';

Expand Down Expand Up @@ -33,7 +33,7 @@ export type TelemetryOptions = {
userId?: string;
sessionId?: string;
waitForConnection?: boolean;
}
};

export function getPlatformVersion(): string {
return (os.release() || '').replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/, '$1$2$3');
Expand Down
4 changes: 2 additions & 2 deletions src/enabledCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

// deep imports to avoid requiring the ENTIRE package (which will also pull in jsforce) until we get ESM done
import { ConfigAggregator } from '@salesforce/core/lib/config/configAggregator';
import { SfConfigProperties } from '@salesforce/core/lib/config/config';
import { ConfigAggregator } from '@salesforce/core/configAggregator';
import { SfConfigProperties } from '@salesforce/core/config';

// store the result to reduce checks
let enabled: boolean | undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/telemetryReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AsyncCreatable, env } from '@salesforce/kit';
import got from 'got';
import { ProxyAgent } from 'proxy-agent';
import { AppInsights, type Attributes, type Properties, type TelemetryOptions } from './appInsights';
import { TelemetryClient } from './exported';
import { TelemetryClient } from './appInsights';
import { isEnabled } from './enabledCheck';

export { TelemetryOptions, Attributes, Properties, TelemetryClient } from './appInsights';
Expand Down
4 changes: 3 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"include": ["unit/**/*.ts", "../node_modules/@types/**/*.d.ts"],
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
"skipLibCheck": true,
"moduleResolution": "Node16",
"module": "Node16"
}
}
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "@salesforce/dev-config/tsconfig-strict",
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "Node16",
"module": "Node16",
"outDir": "./lib",
"rootDir": "src",
"baseUrl": "."
Expand Down
Loading

0 comments on commit 420c422

Please sign in to comment.