Skip to content

Commit

Permalink
chore: separate build and dev tsconfigs
Browse files Browse the repository at this point in the history
  • Loading branch information
bowheart committed Sep 5, 2024
1 parent 577efd9 commit 25b8c89
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 35 deletions.
2 changes: 1 addition & 1 deletion bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"bench": "esbuild src/index.ts --external:v8-natives --bundle --format=cjs --platform=node | node --allow-natives-syntax",
"bench": "esbuild src/index.ts --tsconfig=tsconfig.json --external:v8-natives --bundle --format=cjs --platform=node | node --allow-natives-syntax",
"debug": "DEBUG=true node --allow-natives-syntax --inspect-brk -r ts-node/register src/index.ts",
"test": "vitest"
},
Expand Down
2 changes: 1 addition & 1 deletion bench/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function main() {
const rl = createInterface({ input: process.stdin, output: process.stdout })

const response =
(await rl.question('Finished benchmarks. Rerun? [Y/n]')) || 'y'
(await rl.question('Finished benchmarks. Rerun? [Y/n] ')) || 'y'

if (response.toLowerCase().startsWith('y')) {
main()
Expand Down
10 changes: 9 additions & 1 deletion packages/atoms/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm",
"paths": {
"@zedux/atoms": ["./packages/atoms/src"],
"@zedux/atoms/*": ["./packages/atoms/src/*"]
}
},
"include": ["./src", "../../global.d.ts"]
}
7 changes: 1 addition & 6 deletions packages/atoms/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm",
"paths": {
"@zedux/atoms": ["./packages/atoms/src"],
"@zedux/atoms/*": ["./packages/atoms/src/*"]
}
"lib": ["DOM", "ESNext"]
},
"include": ["./src", "./test", "../../global.d.ts"]
}
9 changes: 8 additions & 1 deletion packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"outDir": "./dist/esm",
"paths": {
"@zedux/core": ["./packages/core/src"],
"@zedux/core/*": ["./packages/core/src/*"]
}
},
"include": ["./src", "../../global.d.ts"]
}
8 changes: 0 additions & 8 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["ESNext"],
"outDir": "./dist/esm",
"paths": {
"@zedux/core": ["./packages/core/src"],
"@zedux/core/*": ["./packages/core/src/*"]
}
},
"include": ["./src", "./test", "../../global.d.ts"]
}
6 changes: 5 additions & 1 deletion packages/immer/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm"
},
"include": ["./src", "../../global.d.ts"]
}
3 changes: 1 addition & 2 deletions packages/immer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm"
"lib": ["DOM", "ESNext"]
},
"include": ["./src", "../../global.d.ts"]
}
10 changes: 9 additions & 1 deletion packages/machines/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm",
"paths": {
"@zedux/machines": ["./packages/machines/src"],
"@zedux/machines/*": ["./packages/machines/src/*"]
}
},
"include": ["./src", "../../global.d.ts"]
}
7 changes: 1 addition & 6 deletions packages/machines/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm",
"paths": {
"@zedux/machines": ["./packages/machines/src"],
"@zedux/machines/*": ["./packages/machines/src/*"]
}
"lib": ["DOM", "ESNext"]
},
"include": ["./src", "./test", "../../global.d.ts"]
}
10 changes: 9 additions & 1 deletion packages/react/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm",
"paths": {
"@zedux/react": ["./packages/react/src"],
"@zedux/react/*": ["./packages/react/src/*"]
}
},
"include": ["./src", "../../global.d.ts"]
}
7 changes: 1 addition & 6 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "ESNext"],
"outDir": "./dist/esm",
"paths": {
"@zedux/react": ["./packages/react/src"],
"@zedux/react/*": ["./packages/react/src/*"]
}
"lib": ["DOM", "ESNext"]
},
"include": ["./src", "./test", "../../global.d.ts"]
}
19 changes: 19 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["ESNext"],
"module": "ESNext",
"moduleResolution": "node",
"noImplicitAny": true,
"outDir": "./dist",
"resolveJsonModule": true,
"strict": true,
"target": "ES2015"
},
"exclude": ["**/dist", "node_modules"],
"include": ["./packages", "global.d.ts"]
}
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
"moduleResolution": "node",
"noImplicitAny": true,
"outDir": "./dist",
"paths": {
"@zedux/atoms": ["./packages/atoms/src"],
"@zedux/atoms/*": ["./packages/atoms/src/*"],
"@zedux/core": ["./packages/core/src"],
"@zedux/core/*": ["./packages/core/src/*"],
"@zedux/immer": ["./packages/immer/src"],
"@zedux/immer/*": ["./packages/immer/src/*"],
"@zedux/machines": ["./packages/machines/src"],
"@zedux/machines/*": ["./packages/machines/src/*"],
"@zedux/react": ["./packages/react/src"],
"@zedux/react/*": ["./packages/react/src/*"]
},
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
Expand Down

0 comments on commit 25b8c89

Please sign in to comment.