Skip to content

Commit 5982156

Browse files
chore(W-16301365): update node to v20 + bunch of deps (#606)
* chore: node update * chore: update nvmrc file * chore: some more dependencies bumps * chore: some more dependencies bumps part 2 * chore: some more dependencies bumps part 3 * chore: some more dependencies bumps part 4 - glob, jest, shell * chore: undo glob bump. ugh windows
1 parent 46ec16e commit 5982156

File tree

19 files changed

+3649
-3625
lines changed

19 files changed

+3649
-3625
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.11.0
1+
v20.17.0

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
"url": "https://github.com/forcedotcom/lightning-language-server.git"
88
},
99
"engines": {
10-
"node": ">=18.11.0"
10+
"node": ">=20.17.0"
1111
},
1212
"devDependencies": {
1313
"@commitlint/cli": "^7",
1414
"@commitlint/config-conventional": "^7",
1515
"commitizen": "^3.0.5",
1616
"cz-conventional-changelog": "^2.1.0",
17-
"@types/jest": "^27.4.0",
18-
"@types/node": "^18.11.0",
17+
"@types/jest": "^29.5.14",
18+
"@types/node": "^20.0.0",
1919
"@typescript-eslint/eslint-plugin": "^2.22.0",
2020
"@typescript-eslint/parser": "^2.22.0",
2121
"eslint": "^6.8.0",
@@ -29,7 +29,7 @@
2929
"prettier": "1.19.1",
3030
"patch-package": "^6.0.5",
3131
"rimraf": "^3.0.1",
32-
"shelljs": "^0.8.3",
32+
"shelljs": "^0.8.5",
3333
"typescript": "^5.0.4"
3434
},
3535
"scripts": {
@@ -73,6 +73,7 @@
7373
"resolutions": {
7474
"set-value": "^2.0.1",
7575
"js-yaml": "^3.13.1"
76+
7677
},
7778
"config": {
7879
"commitizen": {
+12-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
module.exports = {
22
displayName: 'unit',
33
transform: {
4-
".ts": "ts-jest"
5-
},
6-
testRegex: 'src/.*(\\.|/)(test|spec)\\.(ts|js)$',
7-
moduleFileExtensions: [
8-
"ts",
9-
"js",
10-
"json"
11-
],
12-
setupFilesAfterEnv: ["jest-extended"],
13-
testURL: "http://localhost"
4+
".ts": "ts-jest"
5+
},
6+
testRegex: 'src/.*(\\.|/)(test|spec)\\.(ts|js)$',
7+
moduleFileExtensions: [
8+
"ts",
9+
"js",
10+
"json"
11+
],
12+
setupFilesAfterEnv: ["jest-extended"],
13+
testEnvironmentOptions: {
14+
url: 'http://localhost/',
15+
}
1416
};

packages/aura-language-server/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"acorn-walk": "^6.0.0",
3434
"change-case": "^3.1.0",
3535
"enhanced-resolve": "^2.2.2",
36-
"fs-extra": "^5.0.0",
36+
"fs-extra": "^11.3.0",
3737
"line-column": "^1.0.2",
3838
"minimatch": "^3.0.4",
3939
"properties": "^1.2.1",
@@ -46,24 +46,24 @@
4646
"devDependencies": {
4747
"@jest/reporters": "^29.7.0",
4848
"@types/babel-types": "^7.0.8",
49-
"@types/fs-extra": "^5.0.4",
49+
"@types/fs-extra": "^11.0.4",
5050
"@types/glob": "^7.1.3",
51-
"@types/jest": "^29.5.0",
52-
"@types/mock-fs": "^4.10.0",
53-
"@types/node": "^18.11.0",
54-
"@types/shelljs": "^0.8.8",
51+
"@types/jest": "^29.5.14",
52+
"@types/mock-fs": "^4.13.4",
53+
"@types/node": "^20.0.0",
54+
"@types/shelljs": "^0.8.15",
5555
"babel-types": "^6.26.0",
5656
"eslint": "^7.7.0",
5757
"glob": "^7.1.6",
5858
"husky": "^4.2.5",
59-
"jest": "^29.5.0",
59+
"jest": "^29.7.0",
6060
"jest-extended": "^0.11.5",
6161
"lint-staged": "^10.2.11",
62-
"mock-fs": "^4.11.0",
62+
"mock-fs": "^5.5.0",
6363
"npm-run": "^5.0.1",
6464
"prettier": "^2.0.5",
65-
"shelljs": "^0.8.4",
66-
"ts-jest": "^29.1.0",
65+
"shelljs": "^0.8.5",
66+
"ts-jest": "^29.2.6",
6767
"tsc-transpile-only": "0.0.3",
6868
"typescript": "5.0.4"
6969
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import 'chokidar';
2+
3+
declare module 'chokidar' {
4+
interface FSWatcher {
5+
ref(): this;
6+
unref(): this;
7+
}
8+
}
+14-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
module.exports = {
2-
displayName: 'unit',
3-
transform: {
4-
".ts": "ts-jest"
5-
},
6-
testRegex: 'src/.*(\\.|/)(test|spec)\\.(ts|js)$',
7-
moduleFileExtensions: [
8-
"ts",
9-
"js",
10-
"json"
11-
],
12-
setupFilesAfterEnv: ["<rootDir>/jest/matchers.ts", "jest-extended"],
13-
testURL: "http://localhost"
2+
displayName: 'unit',
3+
transform: {
4+
".ts": "ts-jest"
5+
},
6+
testRegex: 'src/.*(\\.|/)(test|spec)\\.(ts|js)$',
7+
moduleFileExtensions: [
8+
"ts",
9+
"js",
10+
"json"
11+
],
12+
setupFilesAfterEnv: ["<rootDir>/jest/matchers.ts", "jest-extended"],
13+
testEnvironmentOptions: {
14+
url: 'http://localhost/',
15+
}
1416
};

packages/lightning-lsp-common/package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"dependencies": {
2727
"decamelize": "^2.0.0",
2828
"deep-equal": "^1.0.1",
29-
"fs-extra": "^5.0.0",
29+
"fs-extra": "^11.3.0",
3030
"glob": "^7.1.6",
3131
"jsonc-parser": "^2.2.1",
3232
"lodash.template": "^4.4.0",
@@ -39,31 +39,31 @@
3939
},
4040
"devDependencies": {
4141
"@jest/reporters": "^29.7.0",
42-
"@lwc/engine-dom": "2.37.3",
43-
"@salesforce/apex": "0.0.12",
42+
"@lwc/engine-dom": "8.16.0",
43+
"@salesforce/apex": "0.0.21",
4444
"@types/decamelize": "^1.2.0",
4545
"@types/deep-equal": "^1.0.1",
46-
"@types/fs-extra": "^5.0.4",
46+
"@types/fs-extra": "^11.0.4",
4747
"@types/glob": "^7.1.3",
48-
"@types/jest": "^29.5.0",
48+
"@types/jest": "^29.5.14",
4949
"@types/lodash": "^4.14.119",
5050
"@types/lodash.template": "^4.4.4",
51-
"@types/mock-fs": "^4.10.0",
51+
"@types/mock-fs": "^4.13.4",
5252
"@types/semver": "^5.5.0",
53-
"@types/shelljs": "^0.8.1",
53+
"@types/shelljs": "^0.8.15",
5454
"@types/tmp": "^0.1.0",
5555
"find-node-modules": "^1.0.4",
5656
"findup-sync": "^3.0.0",
5757
"husky": "^4.2.5",
58-
"jest": "^29.5.0",
58+
"jest": "^29.7.0",
5959
"jest-extended": "^0.11.5",
6060
"lint-staged": "^10.2.11",
6161
"lwc": "2.37.3",
62-
"mock-fs": "^4.11.0",
62+
"mock-fs": "^5.5.0",
6363
"prettier": "^2.0.5",
64-
"shelljs": "^0.8.3",
64+
"shelljs": "^0.8.5",
6565
"tmp": "^0.0.33",
66-
"ts-jest": "^29.1.0",
66+
"ts-jest": "^29.2.6",
6767
"typescript": "5.0.4"
6868
}
6969
}

packages/lightning-lsp-common/src/__tests__/context.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ it('configureSfdxProject()', async () => {
209209
expect(join(sfdxTypingsPath, 'engine.d.ts')).toExist();
210210
expect(join(sfdxTypingsPath, 'apex.d.ts')).toExist();
211211
const schemaContents = fs.readFileSync(join(sfdxTypingsPath, 'schema.d.ts'), 'utf8');
212-
expect(schemaContents).toContain('declare module "@salesforce/schema" {');
212+
expect(schemaContents).toContain(`declare module '@salesforce/schema' {`);
213213
const apexContents = fs.readFileSync(join(sfdxTypingsPath, 'apex.d.ts'), 'utf8');
214214
expect(apexContents).not.toContain('declare type');
215215
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import 'chokidar';
2+
3+
declare module 'chokidar' {
4+
interface FSWatcher {
5+
ref(): this;
6+
unref(): this;
7+
}
8+
}
+14-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
module.exports = {
2-
displayName: 'unit',
3-
transform: {
4-
".ts": "ts-jest"
5-
},
6-
testRegex: 'src/.*(\\.|/)(test|spec)\\.(ts|js)$',
7-
moduleFileExtensions: [
8-
"ts",
9-
"js",
10-
"json"
11-
],
12-
setupFilesAfterEnv: ["<rootDir>/jest/matchers.ts", "jest-extended"],
13-
testURL: "http://localhost"
2+
displayName: 'unit',
3+
transform: {
4+
".ts": "ts-jest"
5+
},
6+
testRegex: 'src/.*(\\.|/)(test|spec)\\.(ts|js)$',
7+
moduleFileExtensions: [
8+
"ts",
9+
"js",
10+
"json"
11+
],
12+
setupFilesAfterEnv: ["<rootDir>/jest/matchers.ts", "jest-extended"],
13+
testEnvironmentOptions: {
14+
url: 'http://localhost/',
15+
}
1416
};

packages/lwc-language-server/package.json

+17-18
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,23 @@
2626
"package": "yarn pack"
2727
},
2828
"dependencies": {
29-
"@lwc/compiler": "2.50.0",
30-
"@lwc/engine-dom": "2.50.0",
31-
"@lwc/errors": "2.50.0",
32-
"@lwc/metadata": "2.50.0-0",
33-
"@lwc/sfdc-compiler-utils": "2.50.0-0",
34-
"@lwc/template-compiler": "2.50.0",
35-
"@salesforce/apex": "0.0.12",
36-
"@salesforce/label": "0.0.12",
29+
"@lwc/compiler": "8.16.0",
30+
"@lwc/engine-dom": "8.16.0",
31+
"@lwc/metadata": "12.2.0",
32+
"@lwc/sfdc-compiler-utils": "12.2.0",
33+
"@lwc/template-compiler": "8.16.0",
34+
"@salesforce/apex": "0.0.21",
35+
"@salesforce/label": "0.0.21",
3736
"@salesforce/lightning-lsp-common": "4.12.2",
38-
"@salesforce/resourceurl": "0.0.12",
39-
"@salesforce/schema": "0.0.12",
40-
"@salesforce/user": "0.0.12",
37+
"@salesforce/resourceurl": "0.0.21",
38+
"@salesforce/schema": "0.0.21",
39+
"@salesforce/user": "0.0.21",
4140
"babel-core": "7.0.0-bridge.0",
4241
"camelcase": "^6.0.0",
4342
"change-case": "^4.1.1",
4443
"comment-parser": "^0.7.6",
45-
"fast-glob": "^3.2.4",
46-
"fs-extra": "^5.0.0",
44+
"fast-glob": "^3.3.3",
45+
"fs-extra": "^11.3.0",
4746
"normalize-path": "^3.0.0",
4847
"properties": "^1.2.1",
4948
"vscode-html-languageservice": "^3.1.0",
@@ -57,21 +56,21 @@
5756
"@komaci/types": "^246.0.10",
5857
"@lwc/old-compiler": "npm:@lwc/[email protected]",
5958
"@types/babel-types": "^7.0.8",
60-
"@types/fs-extra": "^5.0.4",
59+
"@types/fs-extra": "^11.0.4",
6160
"@types/glob": "^7.1.3",
62-
"@types/jest": "^29.5.0",
63-
"@types/node": "^18.11.0",
61+
"@types/jest": "^29.5.14",
62+
"@types/node": "^20.0.0",
6463
"@types/normalize-path": "^3.0.2",
6564
"@types/xml2js": "^0.4.5",
6665
"babel-types": "^6.26.0",
6766
"eol": "^0.9.1",
6867
"glob": "^7.1.6",
6968
"husky": "^4.2.5",
70-
"jest": "^29.5.0",
69+
"jest": "^29.7.0",
7170
"jest-extended": "^0.11.5",
7271
"lint-staged": "^10.2.11",
7372
"prettier": "^2.0.5",
74-
"ts-jest": "^29.1.0",
73+
"ts-jest": "^29.2.6",
7574
"typescript": "5.0.4"
7675
}
7776
}

packages/lwc-language-server/src/__tests__/lwc-server.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ describe('handlers', () => {
415415

416416
// Create files after initialized
417417
const watchedFilePath = path.resolve(watchedFileDir, `newlyAddedFile${ext}`);
418-
console.log(watchedFilePath);
419418
fsExtra.createFileSync(watchedFilePath);
420419

421420
const didChangeWatchedFilesParams: DidChangeWatchedFilesParams = {

packages/lwc-language-server/src/javascript/__tests__/compiler.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ it('returns empty metadata for a script without a clear main component class', a
7070

7171
it('returns metadata for a script with one component class, even when not exported', async () => {
7272
const result = await compileSource(codeWithoutDefaultExportSingleClass, 'foo.js');
73-
console.log(result);
7473
expect(result.metadata?.decorators).toHaveLength(1);
7574
expect(result.metadata?.classMembers).toHaveLength(1);
7675
expect(result.metadata?.exports).toHaveLength(0);
@@ -146,6 +145,7 @@ it('mapLwcMetadataToInternal returns expected javascript metadata', async () =>
146145
fileName: 'metadata.js',
147146
source: content,
148147
}],
148+
npmModuleMapping: {}
149149
};
150150

151151
const modernMetadata = collectBundleMetadata(options);

packages/lwc-language-server/src/javascript/__tests__/type-mapping.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ it('can map new metadata to old metadata', async () => {
2020
fileName: 'metadata.js',
2121
source: content,
2222
},
23-
],
23+
], npmModuleMapping: {}
2424
};
2525

2626
const modernMetadata = collectBundleMetadata(newMetadataOpts);
@@ -51,7 +51,7 @@ it('Should handle mapping when there is a property with only a setter', async ()
5151
fileName: 'nogetter.js',
5252
source: content,
5353
},
54-
],
54+
], npmModuleMapping: {}
5555
};
5656

5757
const modernMetadata = collectBundleMetadata(newMetadataOpts);

packages/lwc-language-server/src/javascript/compiler.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import { Diagnostic, DiagnosticSeverity, Location, Position, Range, TextDocument
55
import { URI } from 'vscode-uri';
66
import { DIAGNOSTIC_SOURCE, MAX_32BIT_INTEGER } from '../constants';
77
import { BundleConfig, ScriptFile, collectBundleMetadata } from '@lwc/metadata';
8-
import { CompilerError } from '@lwc/errors';
98
import { transformSync } from '@lwc/compiler';
109
import { mapLwcMetadataToInternal } from './type-mapping';
1110
import { ClassMember, Metadata } from '../decorators';
1211
import { AttributeInfo, Decorator as DecoratorType, MemberType } from '@salesforce/lightning-lsp-common';
1312
import commentParser from 'comment-parser';
14-
import { CompilerDiagnostic } from '@lwc/errors';
1513

1614
export interface CompilerResult {
1715
diagnostics?: Diagnostic[]; // NOTE: vscode Diagnostic, not lwc Diagnostic
@@ -149,6 +147,7 @@ export async function compileSource(source: string, fileName = 'foo.js'): Promis
149147
source,
150148
},
151149
],
150+
npmModuleMapping: {}
152151
};
153152
const modernMetadata = collectBundleMetadata(options);
154153
if (modernMetadata.diagnostics.length) {

0 commit comments

Comments
 (0)