Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
- 20.x
- 22.9.0
- 22.x
- 24.x
exclude:
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.17.0
Expand All @@ -104,6 +105,8 @@ jobs:
node-version: 22.9.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 24.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
Expand Down Expand Up @@ -137,9 +140,14 @@ jobs:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test (with coverage on Node >= 24)
if: ${{ startsWith(matrix.node-version, '24') }}
run: npm run test:cover --ignore-scripts
- name: Test (on Node 20 with globbing workaround)
if: ${{ startsWith(matrix.node-version, '20') }}
run: npm run test:node20 --ignore-scripts
- name: Test
if: ${{ !startsWith(matrix.node-version, '24') && !startsWith(matrix.node-version, '20') }}
run: npm test --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/[email protected]
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -71,6 +71,7 @@ jobs:
- 20.x
- 22.9.0
- 22.x
- 24.x
exclude:
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.17.0
Expand All @@ -80,6 +81,8 @@ jobs:
node-version: 22.9.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 24.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
Expand All @@ -103,7 +106,12 @@ jobs:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test (with coverage on Node >= 24)
if: ${{ startsWith(matrix.node-version, '24') }}
run: npm run test:cover --ignore-scripts
- name: Test (on Node 20 with globbing workaround)
if: ${{ startsWith(matrix.node-version, '20') }}
run: npm run test:node20 --ignore-scripts
- name: Test
if: ${{ !startsWith(matrix.node-version, '24') && !startsWith(matrix.node-version, '20') }}
run: npm test --ignore-scripts
4 changes: 2 additions & 2 deletions .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down Expand Up @@ -119,8 +119,8 @@ jobs:
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
node-version: 24.x
check-latest: contains('24.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
Expand Down
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ const parseError = (e, txt, context = 20) => {
let errIdx
if (badIndexMatch) {
errIdx = +badIndexMatch[1]
} else /* istanbul ignore next - doesnt happen in Node 22 */ if (
} else /* node:coverage disable */ if (
// doesn't happen in Node 22+
msg.match(/^Unexpected end of JSON.*/i)
) {
errIdx = txt.length - 1
}
/* node:coverage enable */

if (errIdx == null) {
return makeParsedError(msg, `'${txt.slice(0, context * 2)}'`)
Expand Down
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
"lib/"
],
"scripts": {
"test": "tap",
"snap": "tap",
"test": "node --test './test/**/*.js'",
"snap": "node --test --test-update-snapshots './test/**/*.js'",
"lint": "npm run eslint",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run eslint -- --fix",
"posttest": "npm run lint",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"test:node20": "node --test test",
"test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'"
},
"repository": {
"type": "git",
Expand All @@ -29,22 +31,16 @@
"license": "MIT",
"devDependencies": {
"@npmcli/eslint-config": "^6.0.0",
"@npmcli/template-oss": "4.28.1",
"tap": "^16.3.0"
},
"tap": {
"check-coverage": true,
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
"@npmcli/template-oss": "4.28.1"
},
"engines": {
"node": "^20.17.0 || >=22.9.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.28.1",
"publish": true
"publish": true,
"testRunner": "node:test",
"latestCiVersion": 24
}
}
Loading
Loading