diff --git a/package.json b/package.json index 37adf64..737caad 100644 --- a/package.json +++ b/package.json @@ -21,23 +21,21 @@ "configure": "node scripts/configure.mjs", "prebuildify": "prebuildify --napi --tag-libc --strip", "prebuild": "run-s configure prebuildify", - "prep": "run-s clean prebuild tsc", - "tsc": "run-p tsc:*", - "tsc:esm": "tsc -p tsconfig.esm.json --noEmit", - "tsc:cjs": "tsc -p tsconfig.cjs.json --noEmit", - "tsc:types": "tsc -p tsconfig.types.json", - "posttsc:types": "mv dist/types/index.d.mts dist/types/index.d.ts", + "compile": "run-p compile:*", + "compile:esm": "tsc -p tsconfig.esm.json --noEmit", + "compile:cjs": "tsc -p tsconfig.cjs.json --noEmit", + "compile:types": "tsc -p tsconfig.types.json", + "postcompile:types": "mv dist/types/index.d.mts dist/types/index.d.ts", "watch": "tsc --watch", - "pretsup": "npm run clean:dist", - "tsup": "run-p tsup:* tsc:types", - "tsup:cjs": "tsup src/index.cts --format cjs --tsconfig tsconfig.cjs.json", - "tsup:esm": "tsup src/index.mts --format esm --tsconfig tsconfig.esm.json", + "bundle": "run-p bundle:* compile:types", + "bundle:cjs": "tsup src/index.cts --format cjs --tsconfig tsconfig.cjs.json", + "bundle:esm": "tsup src/index.mts --format esm --tsconfig tsconfig.esm.json", "docs": "typedoc --out docs src/index.ts", "jest:coverage": "jest --coverage", "jest:watch": "npm t -- --watch", "jest:clear": "jest --clearCache", - "// tests": "tsc validates the typescript compiles. lint checks for style issues. tsup bundles the code that the integration tests depend on. test:* runs the tests.", - "tests": "run-s tsc lint tsup test:*", + "// tests": "`compile` validates the typescript compiles with tsc. `lint` checks for style issues. `bundle` uses tsup to emit the CJS and ESM rollups that the integration tests depend on. `test:*` runs the tests.", + "tests": "run-s compile lint bundle test:*", "test": "npm run test:cjs", "test:cjs": "jest --config jest.config.cjs", "test:esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js --config jest.config.mjs", @@ -52,8 +50,8 @@ "fmt:json": "prettier --write \"**/*.json\"", "fmt:pkg": "npm pkg fix", "fmt:ts": "prettier --write \"**/*.(c|m)?ts\"", - "precommit": "run-s fmt prep tests", - "prepare-release": "tsup", + "precommit": "run-s fmt clean prebuild tests", + "prepare-release": "npm run bundle", "release": "release-it" }, "gypfile": true, diff --git a/tsconfig.jest-base.json b/tsconfig.jest-base.json index d38bd62..0c627fd 100644 --- a/tsconfig.jest-base.json +++ b/tsconfig.jest-base.json @@ -3,10 +3,7 @@ "noEmit": true, "types": ["node", "jest"] }, - "files": [ - "node_modules/jest-extended/types/index.d.ts", - "src/types/jest-extended.d.ts" - ], + "files": ["node_modules/jest-extended/types/index.d.ts"], "include": ["src/**/*.ts"], "exclude": ["node_modules"] } diff --git a/tsconfig.json b/tsconfig.json index e2d04fd..ab8d49f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,4 @@ { - "#": "used by `npm run watch` and vscode", - "extends": "./tsconfig.jest-esm.json", - "compilerOptions": { - "noEmit": false, - "sourceMap": true - } + "#": "used by `npm run watch` and vscode. Note that this doesn't emit anything into ./dist/", + "extends": "./tsconfig.jest-esm.json" }