Merge pull request #1386 from Choices-js/update-dev-dependencies

Update dev dependencies & github workflows for node v24+
This commit is contained in:
Xon 2026-03-10 19:37:21 +08:00 committed by GitHub
commit cccdd16527
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 981 additions and 2140 deletions

View file

@ -46,62 +46,29 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm ci --no-audit
env:
HUSKY_SKIP_INSTALL: true
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- run: npx playwright install-deps
- name: Run Playwright tests
run: npx playwright test --project=${{ matrix.browser }}
- uses: actions/upload-artifact@v4
name: Upload screenshots to GitHub Actions Artifacts
if: failure()
with:
name: screenshot-${{ matrix.os }}-${{ matrix.browser }}
path: test-results/**/*.png
- uses: actions/upload-artifact@v4
if: '!cancelled()'
name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
with:
name: blob-report-${{ matrix.os }}-${{ matrix.browser }}
path: blob-report/
retention-days: 1
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: ${{ !cancelled() }}
needs: [test-e2e-playwright]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports -c test-e2e/merge.config.ts ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 30
name: playwright-report-${{ matrix.os }}-${{ matrix.browser }}
path: playwright-report/
retention-days: 30

View file

@ -27,13 +27,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm ci --no-audit
env:
HUSKY_SKIP_INSTALL: true
- run: npm run build

View file

@ -14,15 +14,12 @@ jobs:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
node-version: 24
- name: Build
run: |
npm ci
npm run build
rm -rf public/test
env:
HUSKY_SKIP_INSTALL: true
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:

View file

@ -19,6 +19,4 @@ jobs:
with:
node-version: 24
- run: npm ci
env:
HUSKY_SKIP_INSTALL: true
- run: npm publish --provenance --access public

View file

@ -41,14 +41,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm ci --no-audit
env:
HUSKY_SKIP_INSTALL: true
- name: run eslint
run: npm run lint:js

View file

@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
- name: Check Polyfills documentation and settings sync
run: node .github/actions-scripts/polyfills-sync.cjs

View file

@ -33,13 +33,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm ci --no-audit
env:
HUSKY_SKIP_INSTALL: true
- run: npm run build

View file

@ -1,6 +0,0 @@
{
"skipCI": true,
"hooks": {
"pre-commit": "lint-staged"
}
}

2
.nvmrc
View file

@ -1 +1 @@
v20.16.0
v22.17.0

View file

@ -29,7 +29,6 @@
// associations for some files this project is using
"files.associations": {
".browserslistrc": "gitignore",
".huskyrc": "jsonc",
".npmrc": "ini"
},
// We use NPM as package manager
@ -38,11 +37,6 @@
"npm.fetchOnlinePackageInfo": true,
"eslint.packageManager": "npm",
"json.schemas": [
// Husky config file
{
"fileMatch": [".huskyrc"],
"url": "http://json.schemastore.org/huskyrc"
},
// Prettier config
{
"fileMatch": [".prettierrc.json"],

View file

@ -1,4 +1,4 @@
# Choices.js [![Actions Status](https://github.com/jshjohnson/Choices/workflows/Build%20and%20test/badge.svg)](https://github.com/jshjohnson/Choices/actions) [![Actions Status](https://github.com/jshjohnson/Choices/workflows/Bundle%20size%20checks/badge.svg)](https://github.com/jshjohnson/Choices/actions) [![npm](https://img.shields.io/npm/v/choices.js.svg)](https://www.npmjs.com/package/choices.js)
# Choices.js [![Actions Status](https://github.com/Choices-js/Choices/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/Choices-js/Choices/actions) [![Actions Status](https://github.com/Choices-js/Choices/actions/workflows/bundlesize.yml/badge.svg)](https://github.com/Choices-js/Choices/actions) [![npm](https://img.shields.io/npm/v/choices.js.svg)](https://www.npmjs.com/package/choices.js)
A vanilla, lightweight (~20kb gzipped 🎉), configurable select box/text input plugin. Similar to Select2 and Selectize but without the jQuery dependency.
@ -727,7 +727,7 @@ const example = new Choices(element, {
**Input types affected:** `text`, `select-one`, `select-multiple`
**Usage:** The text that is shown when a user has inputted a new item but has not pressed the enter key. To access the current input value, pass a function with a `value` argument (see the [default config](https://github.com/jshjohnson/Choices#setup) for an example), otherwise pass a string.
**Usage:** The text that is shown when a user has inputted a new item but has not pressed the enter key. To access the current input value, pass a function with a `value` argument (see the [default config](https://github.com/Choices-js/Choices#setup) for an example), otherwise pass a string.
Return type must be safe to insert into HTML (ie use the 1st argument which is sanitised)
@ -737,7 +737,7 @@ Return type must be safe to insert into HTML (ie use the 1st argument which is s
**Input types affected:** `text`, `select-one`, `select-multiple`
**Usage:** The text/icon for the remove button. To access the item's value, pass a function with a `value` argument (see the **default config** [https://github.com/jshjohnson/Choices#setup] for an example), otherwise pass a string.
**Usage:** The text/icon for the remove button. To access the item's value, pass a function with a `value` argument (see the **default config** [https://github.com/Choices-js/Choices#setup] for an example), otherwise pass a string.
To access the item's label, use the 3rd argument. *Note*; this label is not escaped.
Return type must be safe to insert into HTML (ie use the 1st argument which is sanitised)
@ -748,7 +748,7 @@ Return type must be safe to insert into HTML (ie use the 1st argument which is s
**Input types affected:** `text`, `select-one`, `select-multiple`
**Usage:** The text for the remove button's aria label. To access the item's value, pass a function with a `value` argument (see the **default config** [https://github.com/jshjohnson/Choices#setup] for an example), otherwise pass a string.
**Usage:** The text for the remove button's aria label. To access the item's value, pass a function with a `value` argument (see the **default config** [https://github.com/Choices-js/Choices#setup] for an example), otherwise pass a string.
To access the item's label, use the 3rd argument. *Note*; this label is not escaped.
Return type must be safe to insert into HTML (ie use the 1st argument which is sanitised)
@ -759,7 +759,7 @@ Return type must be safe to insert into HTML (ie use the 1st argument which is s
**Input types affected:** `text`
**Usage:** The text that is shown when a user has focus on the input but has already reached the [max item count](https://github.com/jshjohnson/Choices#maxitemcount). To access the max item count, pass a function with a `maxItemCount` argument (see the [default config](https://github.com/jshjohnson/Choices#setup) for an example), otherwise pass a string.
**Usage:** The text that is shown when a user has focus on the input but has already reached the [max item count](https://github.com/Choices-js/Choices#maxitemcount). To access the max item count, pass a function with a `maxItemCount` argument (see the [default config](https://github.com/Choices-js/Choices#setup) for an example), otherwise pass a string.
### valueComparer
@ -846,7 +846,7 @@ classNames: {
**Input types affected:** `text`, `select-one`, `select-multiple`
**Usage:** Function to run on template creation. Through this callback it is possible to provide custom templates for the various components of Choices (see terminology). For Choices to work with custom templates, it is important you maintain the various data attributes defined [here](https://github.com/Choices-js/Choices/blob/master/src/scripts/templates.ts).
**Usage:** Function to run on template creation. Through this callback it is possible to provide custom templates for the various components of Choices (see terminology). For Choices to work with custom templates, it is important you maintain the various data attributes defined [here](https://github.com/Choices-js/Choices/blob/main/src/scripts/templates.ts).
If you want just extend a little original template then you may use `Choices.defaults.templates` to get access to
original template function.
@ -1294,7 +1294,7 @@ example.setChoiceByValue('Two'); // Choice with value of 'Two' has now been sele
## Browser compatibility
Choices is compiled using [Babel](https://babeljs.io/) targeting browsers [with more than 1% of global usage](https://github.com/jshjohnson/Choices/blob/master/.browserslistrc) and expecting that features [listed below](https://github.com/jshjohnson/Choices/blob/master/.eslintrc.json#L62) are available or polyfilled in browser.
Choices is compiled using [Babel](https://babeljs.io/) targeting browsers [with more than 1% of global usage](https://github.com/Choices-js/Choices/blob/main/.browserslistrc) and expecting that features [listed below](https://github.com/Choices-js/Choices/blob/main/.eslintrc.json#L62) are available or polyfilled in browser.
You may see exact list of target browsers by running `npm exec browserslist` within this repository folder.
If you need to support a browser that does not have one of the features listed below,
I suggest including a polyfill from [cdnjs.cloudflare.com/polyfill](https://cdnjs.cloudflare.com/polyfill):

2845
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -101,10 +101,9 @@
"@babel/preset-typescript": "^7.24.7",
"@playwright/test": "^1.46.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-eslint": "^9.0.5",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-terser": "^1.0.0",
"@rollup/plugin-typescript": "^11.1.6",
"@types/chai": "^4.3.17",
"@types/node": "^22.12.0",
@ -112,7 +111,7 @@
"@types/sinon-chai": "^3.2.12",
"@vitest/coverage-v8": "^3.2.4",
"autoprefixer": "^10.4.20",
"bundlesize": "^0.18.2",
"bundlesize2": "^0.0.35",
"chai": "^5.1.1",
"cross-process-lock": "^2.1.1",
"csso-cli": "^4.0.2",
@ -125,9 +124,7 @@
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-sort-class-members": "^1.20.0",
"eslint-plugin-tree-shaking": "^1.12.2",
"husky": "^9.1.4",
"jsdom": "^24.1.1",
"lint-staged": "^15.2.7",
"nodemon": "^3.1.4",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.41",
@ -142,7 +139,7 @@
"stylelint-config-standard": "^36.0.1",
"stylelint-config-standard-scss": "^13.1.0",
"tslib": "^2.6.3",
"typescript": "^5.5.4",
"typescript": "5.5.x",
"typescript-eslint": "^8.0.1",
"vitest": "^3.2.4"
},

View file

@ -24,7 +24,7 @@ const config: PlaywrightTestConfig = {
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI ? [['dot'], ['blob']] : 'line',
reporter: process.env.CI ? [['github'], ['html', { open: 'never' }]] : 'line',
timeout: process.env.CI ? 5000 : 1000,
expect : {
timeout: process.env.CI ? 1000 : 500,

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
/******************************************************************************
Copyright (c) Microsoft Corporation.

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
/******************************************************************************
Copyright (c) Microsoft Corporation.

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
/******************************************************************************
Copyright (c) Microsoft Corporation.

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.2.0 | © 2026 Josh Johnson | https://github.com/Choices-js/Choices#readme */
/******************************************************************************
Copyright (c) Microsoft Corporation.

View file

@ -59,7 +59,7 @@
<body>
<div class="container">
<div class="section">
<a href="https://github.com/jshjohnson/Choices" class="logo">
<a href="https://github.com/Choices-js/Choices" class="logo">
<picture style="display: flex">
<source media="(prefers-color-scheme: dark)" srcset="assets/images/logo--dark.svg" class="logo-img source-dark">
<source media="(prefers-color-scheme: light)" srcset="assets/images/logo.svg" class="logo-img source-light">
@ -74,7 +74,7 @@
</p>
<p>
For all config options, visit the
<a href="https://github.com/jshjohnson/Choices">GitHub repo</a>.
<a href="https://github.com/Choices-js/Choices">GitHub repo</a>.
</p>
<hr />

View file

@ -1,4 +0,0 @@
export default {
testDir: 'e2e',
reporter: [['html', { open: 'never' }]],
};