diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a5bcabf..5102528 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,18 +10,18 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: npm i - - run: npm run lint + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 26 + - run: npm i + - run: npm run lint test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 26 - run: npm i - - run: npm t + - run: npm t -- --allow-incomplete-coverage diff --git a/.github/workflows/test-gh.yml b/.github/workflows/test-gh.yml index 9e20fe7..700d206 100644 --- a/.github/workflows/test-gh.yml +++ b/.github/workflows/test-gh.yml @@ -12,24 +12,26 @@ jobs: fail-fast: false matrix: container: - # Official Node.js images. - - node:12 - - node:14 - - node:16 - # RHEL Node.js builds are icu_small without installing the - # optional nodejs-full-i18n rpm. - - registry.access.redhat.com/ubi8/nodejs-12 - - registry.access.redhat.com/ubi8/nodejs-14 - # - registry.access.redhat.com/ubi8/nodejs-16 - - node:12-slim + # Official Node.js images. + - node:22 + - node:24 + - node:26 + # RHEL Node.js builds are icu_small without installing the + # optional nodejs-full-i18n rpm. + - registry.access.redhat.com/ubi8/nodejs-22 + - registry.access.redhat.com/ubi8/nodejs-24 + #- registry.access.redhat.com/ubi8/nodejs-26 + - node:22-slim + - node:24-slim + - node:26-slim runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 - with: - repository: nodejs/full-icu-test - path: full-icu-test - - name: Install full-icu - run: docker run --rm -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} npm i --no-package-lock --unsafe-perm - - name: Test full-icu - run: docker run --rm -e NODE_ICU_DATA=. -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} node ./full-icu-test/test.js + - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: nodejs/full-icu-test + path: full-icu-test + - name: Install full-icu + run: docker run --rm -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} npm i --no-package-lock --unsafe-perm + - name: Test full-icu + run: docker run --rm -e NODE_ICU_DATA=. -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} node ./full-icu-test/test.js diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml index c58a740..84a4eee 100644 --- a/.github/workflows/test-npm.yml +++ b/.github/workflows/test-npm.yml @@ -12,17 +12,23 @@ jobs: fail-fast: false matrix: container: - - node:12 - - node:12-slim - # Will fail on versions that aren't in icu4c-data + - node:22 + - node:22-slim + - node:24 + - node:24-slim + - node:26 + - node:26-slim + #- node:27 + #- node:27-slim + # Will fail on versions that aren't in icu4c-data runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 - with: - repository: nodejs/full-icu-test - path: full-icu-test - - name: Install full-icu - run: docker run --rm -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} env FULL_ICU_PREFER_NPM=1 npm i --no-package-lock --unsafe-perm - - name: Test full-icu - run: docker run --rm -e NODE_ICU_DATA=. -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} node ./full-icu-test/test.js + - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: nodejs/full-icu-test + path: full-icu-test + - name: Install full-icu + run: docker run --rm -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} env FULL_ICU_PREFER_NPM=1 npm i --no-package-lock --unsafe-perm + - name: Test full-icu + run: docker run --rm -e NODE_ICU_DATA=. -v $(pwd):/usr/src/app -w /usr/src/app ${{ matrix.container }} node ./full-icu-test/test.js diff --git a/.gitignore b/.gitignore index 49c9602..0710237 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ npm-debug.log /yarn.lock package-lock.json /.nyc_output +/.tap diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..0cc56a9 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,7 @@ +import globals from 'globals' +import { defineConfig } from 'eslint/config' + +export default defineConfig([ + { files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } }, + { files: ['**/*.{js,mjs,cjs}'], languageOptions: { globals: globals.node } } +]) diff --git a/full-icu.js b/full-icu.js index 2792d86..e92e551 100644 --- a/full-icu.js +++ b/full-icu.js @@ -1,7 +1,6 @@ // Copyright (C) 2015 IBM Corporation and Others. All Rights Reserved. -// var process = require('process'); -// console.dir(process.env); +// const process = require('process') const fs = require('fs') const path = require('path') diff --git a/install-gh-data.js b/install-gh-data.js index 9d13272..d89eccc 100644 --- a/install-gh-data.js +++ b/install-gh-data.js @@ -21,12 +21,13 @@ module.exports = async function installFromGithub (fullIcu, advice) { const _baseUrl = process.env.FULL_ICU_BASEURL || 'https://github.com/unicode-org/icu/releases/' const baseUrl = new URL(_baseUrl) const versionsAsHyphen = fullIcu.icuver.replace(/\./g, '-') - // ICU v67/v68 use "68.1" and "67.1" in the filename instead of 68_1 and 69_1 + // ICU v67/v68 use "68.1" and "67.1" in the filename instead of 68_1 and 67_1 + // ICU v69-v77 use underscores in the filename and hyphens in the tag + // ICU >= v78 reverted to dots in both the release tag and filename // https://unicode-org.atlassian.net/browse/ICU-21764 - // Can remove this conditional if the files are updated later. - const versionsAsUnderscore = (fullIcu.icumaj >= 69) ? fullIcu.icuver.replace(/\./g, '_') : fullIcu.icuver - const tag = `release-${versionsAsHyphen}` - const file = `icu4c-${versionsAsUnderscore}-data-bin-${icuend}.zip` + const versionInFilename = (fullIcu.icumaj >= 78) ? fullIcu.icuver : (fullIcu.icumaj >= 69) ? fullIcu.icuver.replace(/\./g, '_') : fullIcu.icuver + const tag = (fullIcu.icumaj >= 78) ? `release-${fullIcu.icuver}` : `release-${versionsAsHyphen}` + const file = `icu4c-${versionInFilename}-data-bin-${icuend}.zip` const fullUrl = new URL(`./download/${tag}/${file}`, baseUrl) console.log(fullUrl.toString()) const [srcZip, tmpd] = await myFetch(fullUrl) diff --git a/package.json b/package.json index d758487..aa2c8d0 100644 --- a/package.json +++ b/package.json @@ -28,13 +28,10 @@ "yauzl": "^2.10.0" }, "devDependencies": { - "eslint": "^8.44.0", - "eslint-config-standard": "^16.0.3", - "eslint-plugin-header": "^3.0.0", - "eslint-plugin-import": "^2.24.2", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.1.1", - "standard": "^16.0.3", - "tap": "^16.3.4" + "@eslint/js": "^10.0.1", + "eslint": "^10.5.0", + "globals": "^17.6.0", + "standard": "^17.1.2", + "tap": "^21.7.4" } }