Skip to content

Commit bcd3d76

Browse files
authored
chore(docs): make typedoc resolve node Buffer type via tsconfig.docs.json (#458)
The docs build started failing on master after the TypeScript v6 upgrade (#425) with: ``` index.d.ts:147:24 - error TS2591: Cannot find name 'Buffer'. ``` TS6 no longer accepts an unresolved `Buffer` global. The `docs` script ran typedoc without a tsconfig, so `@types/node` (already a devDependency) was not picked up. Adds a minimal `impit-node/tsconfig.docs.json` that pins `types: ["node"]` and scopes the program to `index.d.ts`, and passes it to typedoc via `--tsconfig`. Verified locally — docs now generate without error.
1 parent 31f5b46 commit bcd3d76

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

impit-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"artifacts": "napi artifacts --output-dir ../artifacts --npm-dir npm",
4747
"build": "napi build --platform --release --no-const-enum",
4848
"build:debug": "napi build --platform --no-const-enum",
49-
"docs": "pnpm build:debug && typedoc --plugin typedoc-plugin-mdn-links ./index.d.ts --out ./docs",
49+
"docs": "pnpm build:debug && typedoc --plugin typedoc-plugin-mdn-links --tsconfig ./tsconfig.docs.json ./index.d.ts --out ./docs",
5050
"prepublishOnly": "napi prepublish -t npm --no-gh-release",
5151
"test": "vitest --retry=3 && node ./test/e2e/run-e2e-tests.mjs",
5252
"universal": "napi universal",

impit-node/tsconfig.docs.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"types": ["node"]
4+
},
5+
"files": ["index.d.ts"]
6+
}

0 commit comments

Comments
 (0)