Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
run: echo "PUBLISH_PLEASE_DISABLE_PROMPT=true" >> $GITHUB_ENV
- run: npm install --ignore-scripts
- run: npm run test
- run: npm run test-types-nodenext
- uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"scripts": {
"test": "c8 --reporter=lcov --reporter=text jasmine spec/*spec.js",
"test-types": "tsc --noEmit spec/typings/typings-test.ts",
"test-types-nodenext": "tsc --noEmit -p spec/typings/tsconfig.nodenext.json",
"unit": "jasmine",
"coverage": "nyc report --reporter html --reporter text -t .nyc_output --report-dir .nyc_output/summary",
"perf": "node ./benchmark/perfTest3.js",
Expand Down
10 changes: 10 additions & 0 deletions spec/typings/nodenext-import-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Regression for GH-808: ESM declaration must use NodeNext-valid relative specifiers
* (e.g. `./pem.js` → resolves to `pem.d.ts`) so consumers with `moduleResolution: "NodeNext"`
* and `skipLibCheck: false` do not hit TS2834.
*
* Resolves the same entry as the package `import` types (`./src/fxp.d.ts`).
*/
import type { XMLParser } from "../../src/fxp.js";

type _Smoke = XMLParser;
11 changes: 11 additions & 0 deletions spec/typings/tsconfig.nodenext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"skipLibCheck": false,
"noEmit": true,
"types": []
},
"include": ["nodenext-import-test.ts"]
}
2 changes: 1 addition & 1 deletion src/fxp.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Expression, ReadonlyMatcher } from './pem';
import type { Expression, ReadonlyMatcher } from './pem.js';

// jPath: true → string
// jPath: false → ReadonlyMatcher
Expand Down