Skip to content

Commit

Permalink
Merge branch 'main' into postBenefitAssignment
Browse files Browse the repository at this point in the history
  • Loading branch information
peternhale authored Mar 11, 2024
2 parents d097c1b + 418bfcf commit cc6cc11
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.15.1
v18.11.0
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "4.7.2"
"version": "4.7.4"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"url": "https://github.com/forcedotcom/lightning-language-server.git"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.11.0"
},
"devDependencies": {
"@commitlint/cli": "^7",
"@commitlint/config-conventional": "^7",
"commitizen": "^3.0.5",
"cz-conventional-changelog": "^2.1.0",
"@types/jest": "^27.4.0",
"@types/node": "^16.0.0",
"@types/node": "^18.11.0",
"@typescript-eslint/eslint-plugin": "^2.22.0",
"@typescript-eslint/parser": "^2.22.0",
"eslint": "^6.8.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/aura-language-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/aura-language-server",
"version": "4.7.2",
"version": "4.7.4",
"description": "Language server for Aura components.",
"main": "lib/aura-indexer/indexer.js",
"typings": "lib/shared.d.ts",
Expand All @@ -27,7 +27,7 @@
"package": "yarn pack"
},
"dependencies": {
"@salesforce/lightning-lsp-common": "4.7.2",
"@salesforce/lightning-lsp-common": "4.7.4",
"acorn": "^6.0.0",
"acorn-loose": "^6.0.0",
"acorn-walk": "^6.0.0",
Expand All @@ -50,7 +50,7 @@
"@types/glob": "^7.1.3",
"@types/jest": "^29.5.0",
"@types/mock-fs": "^4.10.0",
"@types/node": "^16.0.0",
"@types/node": "^18.11.0",
"@types/shelljs": "^0.8.8",
"babel-types": "^6.26.0",
"eslint": "^7.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/lightning-lsp-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/lightning-lsp-common",
"version": "4.7.2",
"version": "4.7.4",
"description": "Common components for lwc-language-server and aura-language-server.",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
9 changes: 8 additions & 1 deletion packages/lightning-lsp-common/src/__tests__/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,27 @@ it('configureCoreMulti()', async () => {
const jsconfigPathGlobal = context.workspaceRoots[1] + '/modules/jsconfig.json';
const codeWorkspacePath = CORE_ALL_ROOT + '/core.code-workspace';
const launchPath = CORE_ALL_ROOT + '/.vscode/launch.json';
const tsconfigPathForce = context.workspaceRoots[0] + '/tsconfig.json';

// make sure no generated files are there from previous runs
fs.removeSync(jsconfigPathGlobal);
fs.removeSync(jsconfigPathForce);
fs.removeSync(codeWorkspacePath);
fs.removeSync(launchPath);
fs.removeSync(tsconfigPathForce);

fs.createFileSync(tsconfigPathForce);

// configure and verify typings/jsconfig after configuration:
await context.configureProject();

// verify newly created jsconfig.json
verifyJsconfigCore(jsconfigPathGlobal);
verifyJsconfigCore(jsconfigPathForce);
// verify jsconfig.json is not created when there is a tsconfig.json
expect(fs.existsSync(tsconfigPathForce)).not.toExist();
verifyTypingsCore();

fs.removeSync(tsconfigPathForce);
});

it('configureCoreAll()', async () => {
Expand Down
23 changes: 19 additions & 4 deletions packages/lightning-lsp-common/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ export class WorkspaceContext {
}
}

/**
* @param modulesDir
* @returns whether a tsconfig.json file exists in the same directory of modulesDir
*/
private hasTSConfigOnCore(modulesDir: string): boolean {
const tsConfigFile = path.join(modulesDir, '..', 'tsconfig.json');
return fs.pathExistsSync(tsConfigFile);
}

/**
* Writes to and updates Jsconfig files and ES Lint files of WorkspaceRoots, optimizing by type
*/
Expand All @@ -419,16 +428,22 @@ export class WorkspaceContext {
jsConfigTemplate = await fs.readFile(utils.getCoreResource('jsconfig-core.json'), 'utf8');
jsConfigContent = this.processTemplate(jsConfigTemplate, { project_root: '../..' });
for (const modulesDir of modulesDirs) {
const jsConfigPath = path.join(modulesDir, 'jsconfig.json');
this.updateConfigFile(jsConfigPath, jsConfigContent);
// only writes jsconfig.json if there is no tsconfig.json on core
if (!this.hasTSConfigOnCore(modulesDir)) {
const jsConfigPath = path.join(modulesDir, 'jsconfig.json');
this.updateConfigFile(jsConfigPath, jsConfigContent);
}
}
break;
case WorkspaceType.CORE_PARTIAL:
jsConfigTemplate = await fs.readFile(utils.getCoreResource('jsconfig-core.json'), 'utf8');
jsConfigContent = this.processTemplate(jsConfigTemplate, { project_root: '../..' });
for (const modulesDir of modulesDirs) {
const jsConfigPath = path.join(modulesDir, 'jsconfig.json');
this.updateConfigFile(jsConfigPath, jsConfigContent); // no workspace reference yet, that comes in update config file
// only writes jsconfig.json if there is no tsconfig.json on core
if (!this.hasTSConfigOnCore(modulesDir)) {
const jsConfigPath = path.join(modulesDir, 'jsconfig.json');
this.updateConfigFile(jsConfigPath, jsConfigContent); // no workspace reference yet, that comes in update config file
}
}
break;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/lwc-language-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/lwc-language-server",
"version": "4.7.2",
"version": "4.7.4",
"description": "Language server for Lightning Web Components.",
"main": "lib/indexer.js",
"license": "BSD-3-Clause",
Expand Down Expand Up @@ -34,7 +34,7 @@
"@lwc/template-compiler": "2.50.0",
"@salesforce/apex": "0.0.12",
"@salesforce/label": "0.0.12",
"@salesforce/lightning-lsp-common": "4.7.2",
"@salesforce/lightning-lsp-common": "4.7.4",
"@salesforce/resourceurl": "0.0.12",
"@salesforce/schema": "0.0.12",
"@salesforce/user": "0.0.12",
Expand All @@ -60,7 +60,7 @@
"@types/fs-extra": "^5.0.4",
"@types/glob": "^7.1.3",
"@types/jest": "^29.5.0",
"@types/node": "^16.0.0",
"@types/node": "^18.11.0",
"@types/normalize-path": "^3.0.0",
"@types/xml2js": "^0.4.5",
"babel-types": "^6.26.0",
Expand Down
15 changes: 11 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2994,10 +2994,12 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.7.tgz#1628e6461ba8cc9b53196dfeaeec7b07fa6eea99"
integrity sha512-Uo4chgKbnPNlxQwoFmYIwctkQVkMMmsAoGGU4JKwLuvBefF0pCq4FybNSnfkfRCpC7ZW7kttcC/TrRtAJsvGtg==

"@types/node@^16.0.0":
version "16.18.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.3.tgz#d7f7ba828ad9e540270f01ce00d391c54e6e0abc"
integrity sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==
"@types/node@^18.11.0":
version "18.18.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.13.tgz#ae0f76c0bfe79d8fad0f910b78ae3e59b333c6e8"
integrity sha512-vXYZGRrSCreZmq1rEjMRLXJhiy8MrIeVasx+PCVlP414N7CJLHnMf+juVvjdprHyH+XRy3zKZLHeNueOpJCn0g==
dependencies:
undici-types "~5.26.4"

"@types/node@^6.0.46":
version "6.14.13"
Expand Down Expand Up @@ -11713,6 +11715,11 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2"

undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==

unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
Expand Down

0 comments on commit cc6cc11

Please sign in to comment.