Skip to content

Commit

Permalink
fix: refactor build scripts for clarity and consistency, and borkenat…
Browse files Browse the repository at this point in the history
…ed prepare-release script.
  • Loading branch information
mceachen committed Dec 22, 2024
1 parent 02c895f commit edbaee5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.jest-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
8 changes: 2 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit edbaee5

Please sign in to comment.