From 987daf7794ad227819a7fbc2ad5d85c989b2f8e2 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 00:52:13 +0900 Subject: [PATCH 1/9] Bump required VSCode version to 1.86.1 VSCode 1.86.1 included the Electron 27 update. This comes with Node.js 18.17.1. Ref https://code.visualstudio.com/updates/v1_86 Also, this change removes the Node.js version from the CI testing matrix, following the `engines.node` field in `package.json`. --- .github/workflows/testing.yml | 22 ++++------------------ .nvmrc | 2 +- package-lock.json | 18 +++++++++--------- package.json | 6 +++--- test/e2e/jest-runner-vscode.config.js | 17 ++++++++++++++++- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index df81f64b..5baaed87 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,37 +11,23 @@ on: jobs: test: - name: Test for Stylelint ${{ matrix.stylelint }} on Node.js ${{ matrix.node-version }} and ${{ matrix.os }} + name: Test for Stylelint ${{ matrix.stylelint }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - node-version: [18] - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] stylelint: [14, 15] - include: - - stylelint: 15 - node-version: 14 # For some reason jest-runner-vscode doesn't work well with Node v18 and Windows. - os: windows-latest - - stylelint: 14 - node-version: 14 # For some reason jest-runner-vscode doesn't work well with Node v18 and Windows. - os: windows-latest steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version-file: .nvmrc cache: npm - # TODO: npm@8.4 is broken on Windows. See https://github.com/npm/cli/issues/4341 - - name: Workaround for npm installation failure on Node.js 14 and Windows - if: ${{ matrix.node-version == '14' && runner.os == 'Windows' }} - run: npm install --global npm@8.3 - - name: Install latest npm - if: ${{ matrix.node-version == '18' }} run: npm install --global npm@latest - name: Install dependencies diff --git a/.nvmrc b/.nvmrc index 5595ae1a..4a1f488b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14.17.6 +18.17.1 diff --git a/package-lock.json b/package-lock.json index d7218787..182abbec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@types/jest": "^27.0.3", "@types/path-is-inside": "^1.0.0", "@types/semver": "^7.3.9", - "@types/vscode": "1.56.0", + "@types/vscode": "1.86.0", "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.30.5", "@typescript/lib-dom": "npm:@types/web@^0.0.47", @@ -65,8 +65,8 @@ "zen-observable": "^0.8.15" }, "engines": { - "node": ">=14.16.0", - "vscode": ">=1.56.0" + "node": ">=18.17.1", + "vscode": ">=1.86.1" } }, "node_modules/@babel/code-frame": { @@ -2064,9 +2064,9 @@ "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" }, "node_modules/@types/vscode": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.56.0.tgz", - "integrity": "sha512-Q5VmQxOx+L1Y6lIJiGcJzwcyV3pQo/eiW8P+7sNLhFI16tJCwtua2DLjHRcpjbCLNVYpQM73kzfFo1Z0HyP9eQ==", + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.86.0.tgz", + "integrity": "sha512-DnIXf2ftWv+9LWOB5OJeIeaLigLHF7fdXF6atfc7X5g2w/wVZBgk0amP7b+ub5xAuW1q7qP5YcFvOcit/DtyCQ==", "dev": true }, "node_modules/@types/yargs": { @@ -12673,9 +12673,9 @@ "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" }, "@types/vscode": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.56.0.tgz", - "integrity": "sha512-Q5VmQxOx+L1Y6lIJiGcJzwcyV3pQo/eiW8P+7sNLhFI16tJCwtua2DLjHRcpjbCLNVYpQM73kzfFo1Z0HyP9eQ==", + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.86.0.tgz", + "integrity": "sha512-DnIXf2ftWv+9LWOB5OJeIeaLigLHF7fdXF6atfc7X5g2w/wVZBgk0amP7b+ub5xAuW1q7qP5YcFvOcit/DtyCQ==", "dev": true }, "@types/yargs": { diff --git a/package.json b/package.json index 453e2e8d..17b06d5f 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ }, "icon": "media/stylelint.png", "engines": { - "vscode": ">=1.56.0", - "node": ">=14.16.0" + "vscode": ">=1.86.1", + "node": ">=18.17.1" }, "galleryBanner": { "color": "#000000", @@ -225,7 +225,7 @@ "@types/jest": "^27.0.3", "@types/path-is-inside": "^1.0.0", "@types/semver": "^7.3.9", - "@types/vscode": "1.56.0", + "@types/vscode": "1.86.0", "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.30.5", "@typescript/lib-dom": "npm:@types/web@^0.0.47", diff --git a/test/e2e/jest-runner-vscode.config.js b/test/e2e/jest-runner-vscode.config.js index 319f5489..08710f16 100644 --- a/test/e2e/jest-runner-vscode.config.js +++ b/test/e2e/jest-runner-vscode.config.js @@ -2,9 +2,24 @@ const path = require('path'); +const pkg = require('../../package.json'); + +const vscodeVersion = '1.86.1'; +const requiredVscodeVersion = pkg.engines.vscode.match(/\d+\.\d+\.\d+/)?.[0]; + +if (!requiredVscodeVersion) { + throw new Error('Cannot find a VSCode version in package.json'); +} + +if (vscodeVersion !== requiredVscodeVersion) { + throw new Error( + `The VSCode version '${requiredVscodeVersion}' is required in package.json, but actually '${vscodeVersion}'`, + ); +} + /** @type {import('jest-runner-vscode').RunnerOptions} */ const config = { - version: '1.56.2', + version: vscodeVersion, launchArgs: ['--disable-extensions'], openInFolder: true, workspaceDir: path.join(__dirname, 'workspace/workspace.code-workspace'), From 13c0c77f85f7a51c62efe2de1340cabd887a3653 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:06:02 +0900 Subject: [PATCH 2/9] Fix type error in `test/e2e/jest-runner-vscode.config.js` --- test/e2e/jest-runner-vscode.config.js | 9 +++++---- test/e2e/workspace/custom-syntax/.vscode/settings.json | 2 +- test/e2e/workspace/report-disables/.vscode/settings.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/e2e/jest-runner-vscode.config.js b/test/e2e/jest-runner-vscode.config.js index 08710f16..4609373a 100644 --- a/test/e2e/jest-runner-vscode.config.js +++ b/test/e2e/jest-runner-vscode.config.js @@ -1,10 +1,11 @@ 'use strict'; -const path = require('path'); - -const pkg = require('../../package.json'); +const path = require('node:path'); +const { readFileSync } = require('node:fs'); const vscodeVersion = '1.86.1'; + +const pkg = JSON.parse(readFileSync(path.join(__dirname, '../../package.json'), 'utf8')); const requiredVscodeVersion = pkg.engines.vscode.match(/\d+\.\d+\.\d+/)?.[0]; if (!requiredVscodeVersion) { @@ -13,7 +14,7 @@ if (!requiredVscodeVersion) { if (vscodeVersion !== requiredVscodeVersion) { throw new Error( - `The VSCode version '${requiredVscodeVersion}' is required in package.json, but actually '${vscodeVersion}'`, + `The required VSCode version in package.json is '${requiredVscodeVersion}', but actually '${vscodeVersion}'`, ); } diff --git a/test/e2e/workspace/custom-syntax/.vscode/settings.json b/test/e2e/workspace/custom-syntax/.vscode/settings.json index 8e41a2fc..af7fe649 100644 --- a/test/e2e/workspace/custom-syntax/.vscode/settings.json +++ b/test/e2e/workspace/custom-syntax/.vscode/settings.json @@ -1,6 +1,6 @@ { "stylelint.customSyntax": "${workspaceFolder}/custom-syntax.js", "editor.codeActionsOnSave": { - "source.fixAll.stylelint": true + "source.fixAll.stylelint": "explicit" } } diff --git a/test/e2e/workspace/report-disables/.vscode/settings.json b/test/e2e/workspace/report-disables/.vscode/settings.json index 87958585..3713b367 100644 --- a/test/e2e/workspace/report-disables/.vscode/settings.json +++ b/test/e2e/workspace/report-disables/.vscode/settings.json @@ -2,6 +2,6 @@ "stylelint.reportInvalidScopeDisables": true, "stylelint.reportNeedlessDisables": true, "editor.codeActionsOnSave": { - "source.fixAll.stylelint": false + "source.fixAll.stylelint": "never" } } From 46606c03867a4960a4af965cb848f605a3bca9ad Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:13:18 +0900 Subject: [PATCH 3/9] Update failed `test/e2e/__tests__/__snapshots__/code-actions.ts.snap` --- test/e2e/__tests__/__snapshots__/code-actions.ts.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/__tests__/__snapshots__/code-actions.ts.snap b/test/e2e/__tests__/__snapshots__/code-actions.ts.snap index 9cb0cf8e..bf50c747 100644 --- a/test/e2e/__tests__/__snapshots__/code-actions.ts.snap +++ b/test/e2e/__tests__/__snapshots__/code-actions.ts.snap @@ -83,7 +83,7 @@ Array [ ], ], "isPreferred": undefined, - "kind": s { + "kind": Z { "value": "quickfix", }, "title": "Disable indentation for this line", @@ -112,7 +112,7 @@ Array [ ], ], "isPreferred": undefined, - "kind": s { + "kind": Z { "value": "quickfix", }, "title": "Disable indentation for the entire file", @@ -128,7 +128,7 @@ Array [ "title": "Open documentation for indentation", }, "isPreferred": undefined, - "kind": s { + "kind": Z { "value": "quickfix", }, "title": "Show documentation for indentation", From 83ebf25f0b4ebcafdd1e3d2e448032b6806f9a48 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:21:19 +0900 Subject: [PATCH 4/9] Increase test timeout --- test/e2e/__tests__/code-actions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/__tests__/code-actions.ts b/test/e2e/__tests__/code-actions.ts index 96e6a785..b150d92b 100644 --- a/test/e2e/__tests__/code-actions.ts +++ b/test/e2e/__tests__/code-actions.ts @@ -62,6 +62,8 @@ describe('Code actions', () => { }); afterEach(async () => { + jest.setTimeout(30_000); + await fs.writeFile(cssPath, css); const settingsEditor = await openDocument(settingsPath); From 5e5ba5ee4325672cd89990b84c2bcb0eb1156ec2 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:24:35 +0900 Subject: [PATCH 5/9] Revert "Increase test timeout" This reverts commit 83ebf25f0b4ebcafdd1e3d2e448032b6806f9a48. --- test/e2e/__tests__/code-actions.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/e2e/__tests__/code-actions.ts b/test/e2e/__tests__/code-actions.ts index b150d92b..96e6a785 100644 --- a/test/e2e/__tests__/code-actions.ts +++ b/test/e2e/__tests__/code-actions.ts @@ -62,8 +62,6 @@ describe('Code actions', () => { }); afterEach(async () => { - jest.setTimeout(30_000); - await fs.writeFile(cssPath, css); const settingsEditor = await openDocument(settingsPath); From cbabe0c4da711a1a67ba8ffeb26c2beed43699d8 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:31:08 +0900 Subject: [PATCH 6/9] Downgrade VSCode to 1.82.3 Ref https://code.visualstudio.com/updates/v1_82 --- .nvmrc | 2 +- package-lock.json | 18 +++++++++--------- package.json | 6 +++--- test/e2e/jest-runner-vscode.config.js | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.nvmrc b/.nvmrc index 4a1f488b..55bffd62 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.17.1 +18.15.0 diff --git a/package-lock.json b/package-lock.json index 182abbec..accc825c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "@types/jest": "^27.0.3", "@types/path-is-inside": "^1.0.0", "@types/semver": "^7.3.9", - "@types/vscode": "1.86.0", + "@types/vscode": "1.82.0", "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.30.5", "@typescript/lib-dom": "npm:@types/web@^0.0.47", @@ -65,8 +65,8 @@ "zen-observable": "^0.8.15" }, "engines": { - "node": ">=18.17.1", - "vscode": ">=1.86.1" + "node": ">=18.15.0", + "vscode": ">=1.82.3" } }, "node_modules/@babel/code-frame": { @@ -2064,9 +2064,9 @@ "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" }, "node_modules/@types/vscode": { - "version": "1.86.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.86.0.tgz", - "integrity": "sha512-DnIXf2ftWv+9LWOB5OJeIeaLigLHF7fdXF6atfc7X5g2w/wVZBgk0amP7b+ub5xAuW1q7qP5YcFvOcit/DtyCQ==", + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", "dev": true }, "node_modules/@types/yargs": { @@ -12673,9 +12673,9 @@ "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" }, "@types/vscode": { - "version": "1.86.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.86.0.tgz", - "integrity": "sha512-DnIXf2ftWv+9LWOB5OJeIeaLigLHF7fdXF6atfc7X5g2w/wVZBgk0amP7b+ub5xAuW1q7qP5YcFvOcit/DtyCQ==", + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", "dev": true }, "@types/yargs": { diff --git a/package.json b/package.json index 17b06d5f..cbd70968 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ }, "icon": "media/stylelint.png", "engines": { - "vscode": ">=1.86.1", - "node": ">=18.17.1" + "vscode": ">=1.82.3", + "node": ">=18.15.0" }, "galleryBanner": { "color": "#000000", @@ -225,7 +225,7 @@ "@types/jest": "^27.0.3", "@types/path-is-inside": "^1.0.0", "@types/semver": "^7.3.9", - "@types/vscode": "1.86.0", + "@types/vscode": "1.82.0", "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.30.5", "@typescript/lib-dom": "npm:@types/web@^0.0.47", diff --git a/test/e2e/jest-runner-vscode.config.js b/test/e2e/jest-runner-vscode.config.js index 4609373a..50edb16e 100644 --- a/test/e2e/jest-runner-vscode.config.js +++ b/test/e2e/jest-runner-vscode.config.js @@ -3,7 +3,7 @@ const path = require('node:path'); const { readFileSync } = require('node:fs'); -const vscodeVersion = '1.86.1'; +const vscodeVersion = '1.82.3'; const pkg = JSON.parse(readFileSync(path.join(__dirname, '../../package.json'), 'utf8')); const requiredVscodeVersion = pkg.engines.vscode.match(/\d+\.\d+\.\d+/)?.[0]; From 2b046fa355ee8af0f9e1037912220c1fa512bf16 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:41:12 +0900 Subject: [PATCH 7/9] Install npm 9 on CI --- .github/workflows/testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5baaed87..23f335ef 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -28,7 +28,9 @@ jobs: cache: npm - name: Install latest npm - run: npm install --global npm@latest + # TODO: npm 10 requires Node.js 18.17 or later. + # run: npm install --global npm@latest + run: npm install --global npm@9 - name: Install dependencies run: npm ci From 6a3d590e9f63cec78486c96063ac6976b7c39676 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:44:44 +0900 Subject: [PATCH 8/9] Update failed `test/e2e/__tests__/__snapshots__/code-actions.ts.snap` --- test/e2e/__tests__/__snapshots__/code-actions.ts.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/__tests__/__snapshots__/code-actions.ts.snap b/test/e2e/__tests__/__snapshots__/code-actions.ts.snap index bf50c747..286cc4c7 100644 --- a/test/e2e/__tests__/__snapshots__/code-actions.ts.snap +++ b/test/e2e/__tests__/__snapshots__/code-actions.ts.snap @@ -83,7 +83,7 @@ Array [ ], ], "isPreferred": undefined, - "kind": Z { + "kind": _ { "value": "quickfix", }, "title": "Disable indentation for this line", @@ -112,7 +112,7 @@ Array [ ], ], "isPreferred": undefined, - "kind": Z { + "kind": _ { "value": "quickfix", }, "title": "Disable indentation for the entire file", @@ -128,7 +128,7 @@ Array [ "title": "Open documentation for indentation", }, "isPreferred": undefined, - "kind": Z { + "kind": _ { "value": "quickfix", }, "title": "Show documentation for indentation", From 1c1c86f164dd1da6ca42f778b9274fbb71b0cebd Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Wed, 14 Feb 2024 08:40:42 +0900 Subject: [PATCH 9/9] Update Volta settings --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cbd70968..766e7050 100644 --- a/package.json +++ b/package.json @@ -280,7 +280,7 @@ }, "prettier": "@stylelint/prettier-config", "volta": { - "node": "14.17.6", - "npm": "8.1.3" + "node": "18.15.0", + "npm": "9.9.2" } }