diff --git a/package.json b/package.json index 47b6ba8a..bf1cf8ce 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "docker:deno": "docker compose -f ./test/docker/playground/deno/docker-compose.yml up --build", "clear": "shx rm -rf ./lib ./ci ./coverage", "prebuild": "npm run clear", - "build": "tsc && tsc -p tsconfig.test.json", + "build": "tsc && shx rm -rf ./lib/@types && tsc -p tsconfig.types.json && tsc -p tsconfig.test.json", "postbuild": "tsx ./tools/compatibility/node.ts && shx cp fixtures/server/package.json ci/fixtures/server/package.json && npm run build:deno && shx chmod +x lib/bin/index.js", "build:deno": "esbuild src/polyfills/deno.mts --outfile=lib/polyfills/deno.mjs --format=esm", "eslint:checker": "eslint . --ext .js,.ts", diff --git a/src/modules/assert-promise.ts b/src/modules/assert-promise.ts index babfa835..7c7538b6 100644 --- a/src/modules/assert-promise.ts +++ b/src/modules/assert-promise.ts @@ -1,6 +1,6 @@ /* c8 ignore next */ import type { ParseAssertionOptions } from '../@types/assert.js'; -import nodeAssert from 'node:assert'; +import * as nodeAssert from 'node:assert'; import { parseAssertion } from '../helpers/parse-assertion.js'; import { nodeVersion } from '../helpers/get-runtime.js'; diff --git a/src/modules/assert.ts b/src/modules/assert.ts index 73b62fa2..19c652e9 100644 --- a/src/modules/assert.ts +++ b/src/modules/assert.ts @@ -1,6 +1,6 @@ /* c8 ignore next */ import type { ParseAssertionOptions } from '../@types/assert.js'; -import nodeAssert from 'node:assert'; +import * as nodeAssert from 'node:assert'; import { parseAssertion } from '../helpers/parse-assertion.js'; import { nodeVersion } from '../helpers/get-runtime.js'; diff --git a/tsconfig.json b/tsconfig.json index 529f7955..4b792018 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "include": ["src"], - "exclude": ["test", "tools"], + "exclude": ["test", "tools", "src/@types"], "compilerOptions": { "target": "ES2015", "lib": ["ES2015"], diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100755 index 00000000..0654f747 --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/@types"], + "exclude": ["test", "tools"], + "compilerOptions": { + "outDir": "lib/@types", + "emitDeclarationOnly": true + } +}