From 618d79267f3cac1cfac4fd16e3e8f4a6137430d2 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 10 May 2025 19:45:30 -0500 Subject: [PATCH 1/7] support node >18 Signed-off-by: Sebastian Beltran --- .github/workflows/legacy.yml | 96 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 116 ++++++++++++++++++++++++++++++----- package.json | 5 +- 3 files changed, 199 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/legacy.yml diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml new file mode 100644 index 00000000..455e0f2a --- /dev/null +++ b/.github/workflows/legacy.yml @@ -0,0 +1,96 @@ +name: legacy + +on: + push: + branches: + - explore-new-api + paths-ignore: + - '*.md' + pull_request: + branches: + - explore-new-api + paths-ignore: + - '*.md' + +permissions: + contents: read + +# Cancel in progress workflows +# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run +concurrency: + group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + node-version: [12, 13, 14, 15, 16, 17] + # Node.js release schedule: https://nodejs.org/en/about/releases/ + + name: Node.js ${{ matrix.node-version }} - ${{matrix.os}} + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: ${{ matrix.node-version }} + + - name: Configure npm loglevel + run: | + npm config set loglevel error + shell: bash + + - name: Install dependencies + run: npm install + + - name: Output Node and NPM versions + run: | + echo "Node.js version: $(node -v)" + echo "NPM version: $(npm -v)" + + - name: Run tests + shell: bash + run: npm run test + + - name: Upload code coverage + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }} + path: ./coverage/lcov.info + retention-days: 1 + + coverage: + needs: test + runs-on: ubuntu-latest + permissions: + contents: read + checks: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Install lcov + shell: bash + run: sudo apt-get -y install lcov + + - name: Collect coverage reports + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + path: ./coverage + pattern: coverage-node-* + + - name: Merge coverage reports + shell: bash + run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info + + - name: Upload coverage report + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 + with: + file: ./lcov.info \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d240189..1068398a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,28 +1,112 @@ -name: Node CI +name: ci on: - pull_request: - branches: - - v3 push: branches: - - v3 + - explore-new-api + paths-ignore: + - '*.md' + pull_request: + branches: + - explore-new-api + paths-ignore: + - '*.md' + +permissions: + contents: read + +# Cancel in progress workflows +# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run +concurrency: + group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 'lts/*' + + - name: Install dependencies + run: npm install --ignore-scripts --include=dev + + - name: Run lint + run: npm run lint + test: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] - node: [12.20.0, 14.13.1, 16.0.0, 16, 17, 18, 19, 20, 21, 22, 23, 24] + os: [ubuntu-latest, macos-latest, windows-latest] + node-version: [18, 19, 20, 21, 22, 23, 24] + # Node.js release schedule: https://nodejs.org/en/about/releases/ + + name: Node.js ${{ matrix.node-version }} - ${{matrix.os}} + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - name: Install dependencies - run: npm install - - name: Run tests - run: npm test + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: ${{ matrix.node-version }} + + - name: Configure npm loglevel + run: | + npm config set loglevel error + shell: bash + + - name: Install dependencies + run: npm install + + - name: Output Node and NPM versions + run: | + echo "Node.js version: $(node -v)" + echo "NPM version: $(npm -v)" + + - name: Run tests + shell: bash + run: npm run test + + - name: Upload code coverage + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: coverage-node-${{ matrix.node-version }}-${{ matrix.os }} + path: ./coverage/lcov.info + retention-days: 1 + + coverage: + needs: test + runs-on: ubuntu-latest + permissions: + contents: read + checks: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Install lcov + shell: bash + run: sudo apt-get -y install lcov + + - name: Collect coverage reports + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + path: ./coverage + pattern: coverage-node-* + + - name: Merge coverage reports + shell: bash + run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info + + - name: Upload coverage report + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 + with: + file: ./lcov.info \ No newline at end of file diff --git a/package.json b/package.json index 79b0f990..b38a1681 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "testdata-w3c-json-form": "^1.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">= 18" }, "files": [ "LICENSE", @@ -49,6 +49,7 @@ "lib/" ], "scripts": { - "test": "standard && c8 --check-coverage --statements 100 mocha --exit" + "lint": "standard", + "test": "c8 --check-coverage --statements 100 mocha" } } From 309e418c1a6315cabae85e945f10f02e3024576e Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Sat, 10 May 2025 19:48:55 -0500 Subject: [PATCH 2/7] support node <13 Signed-off-by: Sebastian Beltran --- .github/workflows/legacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml index 455e0f2a..77cdfc4b 100644 --- a/.github/workflows/legacy.yml +++ b/.github/workflows/legacy.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - node-version: [12, 13, 14, 15, 16, 17] + node-version: [14, 15, 16, 17] # Node.js release schedule: https://nodejs.org/en/about/releases/ name: Node.js ${{ matrix.node-version }} - ${{matrix.os}} From d67976f361644f9d5b8b453264ab21c74b0bce2c Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Mon, 2 Jun 2025 13:52:54 -0500 Subject: [PATCH 3/7] ci: change branch name Signed-off-by: Sebastian Beltran --- .github/workflows/test.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1068398a..de724232 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,14 +3,10 @@ name: ci on: push: branches: - - explore-new-api - paths-ignore: - - '*.md' + - v3 pull_request: branches: - - explore-new-api - paths-ignore: - - '*.md' + - v3 permissions: contents: read From 17621150f9be04938e7f6aab8aca75fe406f3304 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Mon, 2 Jun 2025 14:43:06 -0500 Subject: [PATCH 4/7] ci: rename branch in legacy ci Signed-off-by: Sebastian Beltran --- .github/workflows/legacy.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml index 77cdfc4b..4efbc031 100644 --- a/.github/workflows/legacy.yml +++ b/.github/workflows/legacy.yml @@ -3,14 +3,10 @@ name: legacy on: push: branches: - - explore-new-api - paths-ignore: - - '*.md' + - v3 pull_request: branches: - - explore-new-api - paths-ignore: - - '*.md' + - v3 permissions: contents: read From 77c5f82252c90a71a6140510c73fffab88d5d365 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Mon, 2 Jun 2025 15:06:04 -0500 Subject: [PATCH 5/7] fix coverage Signed-off-by: Sebastian Beltran --- .github/workflows/legacy.yml | 2 +- .github/workflows/test.yml | 2 +- package.json | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml index 4efbc031..ea2e312b 100644 --- a/.github/workflows/legacy.yml +++ b/.github/workflows/legacy.yml @@ -54,7 +54,7 @@ jobs: - name: Run tests shell: bash - run: npm run test + run: npm run test:ci - name: Upload code coverage uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de724232..85c1713c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,7 @@ jobs: - name: Run tests shell: bash - run: npm run test + run: npm run test:ci - name: Upload code coverage uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/package.json b/package.json index b38a1681..45486ee2 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,8 @@ ], "scripts": { "lint": "standard", - "test": "c8 --check-coverage --statements 100 mocha" + "test": "mocha", + "test:ci": "c8 --reporter=lcovonly --reporter=text --check-coverage --statements 100 npm test", + "test:cov": "c8 --reporter=html --reporter=text npm test" } } From f6dd683e2e7e96c3d7f1248e5e4516d1d27fdcc9 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Tue, 3 Jun 2025 13:03:44 -0500 Subject: [PATCH 6/7] update changelog Signed-off-by: Sebastian Beltran --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2afd5291..41f74ae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## unreleased + +- Support node >=18.0.0 + ## 3.0.0-alpha.1 - 2025-05-23 - No functional changes compared to `2.0.0-rc.4`. From 4712138182af279bd9fb6230ef78c088d051a1c7 Mon Sep 17 00:00:00 2001 From: Sebastian Beltran Date: Tue, 3 Jun 2025 13:07:54 -0500 Subject: [PATCH 7/7] remove node <16 Signed-off-by: Sebastian Beltran --- .github/workflows/legacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml index ea2e312b..fe453ec9 100644 --- a/.github/workflows/legacy.yml +++ b/.github/workflows/legacy.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - node-version: [14, 15, 16, 17] + node-version: [16, 17] # Node.js release schedule: https://nodejs.org/en/about/releases/ name: Node.js ${{ matrix.node-version }} - ${{matrix.os}}