Skip to content

Commit

Permalink
feat: upgrade to node18 (#5155)
Browse files Browse the repository at this point in the history
* chore: node to 18

* chore: set useWorkspaces to true in lerna

* chore: add types in tsconfig properties

* chore: update to new style imports

* chore: add @tsconfig node18 to deps

* feat: fix compile errors for apex package

* chore: replace before with beforeEach in lightning

* chore: beforeAll, void type for resolve, timeout

* chore: replaced import in apex-debugger-adapter

* chore: upgraded import statements

* chore: fix lint error

* feat: types/jest version change

* chore: remove this.timeout()

* chore: remove non arrow function

* chore: update package-lock

* chore: update import sanitize-filename

* chore: fix import sequence

* chore: child spawn

* chore: testDone

* chore: extends node 16

* fix: childProcess spawn

* chore: remove any

* chore: compile successfully

* chore: specify npm v9

* fix: exclude babel from bundling in lwc

* chore: remove workspaces

* chore: keep the workspaces true

* chore: update packaging in packs

* chore: bump @types/node and typescript

* chore: bump jest & ts-jest for new node version

* chore: fix a visualforce LSP unit tests

* chore: remove nyc from lightning. fix snapshots

* chore: fix lang server paths for ws. fix more unit

* chore: remove unused dep and weird dup test

* chore: update unit tests in utils debug

* chore: update workflows to run on node18 only

* chore: attempt to remove prob test

* chore: remove old unit tests

* chore: remove windows unit test cache

* chore: fix some int test jest/mocha confusion

* chore: fix lint

* chore: update int test with lwc lsp location

* chore: update windows cache path

* chore: continued cache path fun

* chore: add forceExit to see if unit tests pass

* chore: turn off forceExit for some unit tests

* chore: fix some pending timers and remove forceExi

* chore: remove old unit test config again

* chore: update base jest config. remove forceExit

* chore: remove collectCoverageFrom jest setting

* chore: self review

* chore: changes from review

* chore: update ts config for failed compile

* chore: lint

* chore: update location of lsps in lwc for vsix

* chore: fix int test after vsix update

* chore: replace vsce with @vscode/vsce

* chore: finalize merge

* chore: package-lock update after merge

* chore: delete the old vscode-utils unit test !jest

* chore: mocha clean up in utils-vscode

* chore: fix test fallout

---------

Co-authored-by: Ritam Agrawal <[email protected]>
Co-authored-by: Peter Hale <[email protected]>
  • Loading branch information
3 people authored Oct 20, 2023
1 parent 46e0734 commit 6736855
Show file tree
Hide file tree
Showing 118 changed files with 7,628 additions and 18,799 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unitTestsLinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
linux-unit-tests:
strategy:
matrix:
node_version: [lts/-1, lts/*]
node_version: [lts/*]
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 20
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/unitTestsWindows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
windows-unit-tests:
strategy:
matrix:
node_version: [lts/-1, lts/*]
node_version: [lts/*]
fail-fast: false
runs-on: windows-latest
timeout-minutes: 20
Expand All @@ -24,7 +24,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: npm
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- run: npm run compile
- run: npm run test:unit
2 changes: 1 addition & 1 deletion .github/workflows/validatePR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
code-quality:
strategy:
matrix:
node_version: [lts/-1]
node_version: [lts/*]
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://docs.npmjs.com/cli/v8/using-npm/config
# https://docs.npmjs.com/cli/v9/using-npm/config

# Save dependencies to package.json with an exact version rather than using npm's default semver range operator
save-exact=true
Expand Down
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
23 changes: 20 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}/packages"],
"stopOnEntry": false,
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-visualforce",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-soql",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-lwc",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-lightning",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-core",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-apex",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-apex-replay-debugger",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-apex-debugger"
],
"sourceMaps": true,
"smartStep": true,
"outFiles": ["${workspaceFolder}/packages/*/out/src/**/*.js"],
Expand All @@ -49,7 +57,16 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}/packages"],
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-visualforce",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-soql",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-lwc",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-lightning",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-core",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-apex",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-apex-replay-debugger",
"--extensionDevelopmentPath=${workspaceFolder}/packages/salesforcedx-vscode-apex-debugger"
],
"stopOnEntry": false,
"sourceMaps": true,
"smartStep": true,
Expand Down
9 changes: 8 additions & 1 deletion config/jest.base.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
Expand All @@ -10,4 +10,11 @@ module.exports = {
],
coverageReporters: ['lcov', 'text'],
resetMocks: true
// This collectCoverageFrom will show coverage for all files in a projects, but slows down calculating coverage results.
// Can be a good tool for measuring coverage of the project as a whole locally, but shouldn't be committed at this time.
// Off:
// npm run test:unit 1231.48s user 150.82s system 1092% cpu 2:06.55 total
// On:
// npm run test:unit 2461.94s user 244.14s system 1210% cpu 3:43.47 total
// collectCoverageFrom: ['src/**/*.ts']
};
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
]
}
},
"useNx": true
"useNx": true,
"useWorkspaces": true
}
Loading

0 comments on commit 6736855

Please sign in to comment.