Skip to content

Commit

Permalink
Switch to tsx (#3575)
Browse files Browse the repository at this point in the history
* Switch to tsx

* Delete node_modules on clean

* Undo node_modules deletion in clean

* Fix paths
  • Loading branch information
colinhacks authored Jun 14, 2024
1 parent 7cb50ea commit 2649112
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 396 deletions.
4 changes: 2 additions & 2 deletions .configs/tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"emitDeclarationOnly": true
},
"exclude": [
"../src/**/__tests__",
"../packages/*/tests/**/*",
"../playground.ts",
"../src/benchmarks/**/*",
"../packages/benchmarks/**/*",
"../experiments/**/*"
]
}
4 changes: 2 additions & 2 deletions benchmarks/benchUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const zNew = require("../zod/lib");
const zOld = require("../node_modules/zod/lib/index");
const zNew = require("../packages/zod/dist/cjs");
const zOld = require("./node_modules/zod/lib/index");

export function makeSchema<T>(factory: (z: typeof zNew) => T) {
return {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"private": true,
"name": "zod-benchmarks",
"devDependencies": {
"zod": "^3.0.0"
"zod": "3.23.5"
}
}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@
"husky": "^7.0.4",
"lint-staged": "^12.3.7",
"mitata": "^0.1.11",
"nodemon": "^2.0.22",
"prettier": "^3.2.5",
"rollup": "^4.18.0",
"tinybench": "^2.8.0",
"ts-morph": "^14.0.0",
"ts-node": "^10.9.2",
"tslib": "^2.3.1",
"tsx": "^4.15.4",
"typescript": "next",
"vitest": "^1.6.0"
},
Expand All @@ -49,7 +48,7 @@
"format:check": "biome check .",
"lint": "biome lint --apply .",
"lint:check": "biome lint .",
"clean": "pnpm run -r clean",
"clean": "pnpm run -r clean && rm -rf node_modules",
"build": "pnpm run -r build",
"build:deno": "pnpm run --filter zod build:deno",
"build:esm": "pnpm run --filter zod build:esm",
Expand All @@ -58,9 +57,9 @@
"test:watch": "pnpm vitest",
"test": "pnpm vitest run",
"prepublishOnly": "pnpm run test && pnpm run build && pnpm run build:deno",
"play": "nodemon -e ts,mts -w . -x ts-node playground.ts",
"play": "tsx --watch playground.ts ",
"depcruise": "depcruise -c .dependency-cruiser.js src",
"bench": "pnpm run build:cjs && ts-node benchmarks/index.ts",
"bench": "pnpm run build:cjs && tsx benchmarks/index.ts",
"prepare": "husky install"
}
}
2 changes: 1 addition & 1 deletion packages/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"build": "pnpm run clean && pnpm build:cjs && pnpm build:esm",
"build:esm": "pnpm tsc -p ./tsconfig.build.json --noEmit false --declaration --declarationMap --sourceMap --rootDir src --module esnext --outDir dist/esm",
"build:cjs": "pnpm tsc -p ./tsconfig.build.json --noEmit false --rootDir src --sourceMap --module commonjs --outDir dist/cjs",
"build:deno": "node ./deno-build.mjs && cp ../README.md ./deno/lib",
"build:deno": "node ./deno-build.mjs && cp ../../README.md ./deno/lib",
"build:rollup": "rollup --config ../../.configs/rollup.esm.mjs",
"test:watch": "pnpm vitest",
"test": "pnpm vitest run",
Expand Down
Loading

0 comments on commit 2649112

Please sign in to comment.