Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump required VSCode version to 1.82.3 #503

Merged
merged 10 commits into from
Feb 13, 2024
26 changes: 7 additions & 19 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,29 @@ 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
timeout-minutes: 30
permissions:
contents: read
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: [email protected] 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 [email protected]

- name: Install latest npm
if: ${{ matrix.node-version == '18' }}
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
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.17.6
18.15.0
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
},
"icon": "media/stylelint.png",
"engines": {
"vscode": ">=1.56.0",
"node": ">=14.16.0"
"vscode": ">=1.82.3",
"node": ">=18.15.0"
},
"galleryBanner": {
"color": "#000000",
Expand Down Expand Up @@ -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.82.0",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.30.5",
"@typescript/lib-dom": "npm:@types/web@^0.0.47",
Expand Down Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions test/e2e/__tests__/__snapshots__/code-actions.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Array [
],
],
"isPreferred": undefined,
"kind": s {
"kind": _ {
"value": "quickfix",
},
"title": "Disable indentation for this line",
Expand Down Expand Up @@ -112,7 +112,7 @@ Array [
],
],
"isPreferred": undefined,
"kind": s {
"kind": _ {
"value": "quickfix",
},
"title": "Disable indentation for the entire file",
Expand All @@ -128,7 +128,7 @@ Array [
"title": "Open documentation for indentation",
},
"isPreferred": undefined,
"kind": s {
"kind": _ {
"value": "quickfix",
},
"title": "Show documentation for indentation",
Expand Down
20 changes: 18 additions & 2 deletions test/e2e/jest-runner-vscode.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
'use strict';

const path = require('path');
const path = require('node:path');
const { readFileSync } = require('node:fs');

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];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[note] This file is used as a cache key on CI. So, we must update this file when bumping the VSCode version.

key: ${{ runner.os }}-vscode-${{ hashFiles('test/e2e/jest-runner-vscode.config.js') }}


if (!requiredVscodeVersion) {
throw new Error('Cannot find a VSCode version in package.json');
}

if (vscodeVersion !== requiredVscodeVersion) {
throw new Error(
`The required VSCode version in package.json is '${requiredVscodeVersion}', 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'),
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/workspace/custom-syntax/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"stylelint.customSyntax": "${workspaceFolder}/custom-syntax.js",
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
"source.fixAll.stylelint": "explicit"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[note] See also #492

}
}
2 changes: 1 addition & 1 deletion test/e2e/workspace/report-disables/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"stylelint.reportInvalidScopeDisables": true,
"stylelint.reportNeedlessDisables": true,
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": false
"source.fixAll.stylelint": "never"
}
}
Loading