Skip to content

Commit

Permalink
Implement live types (#3656)
Browse files Browse the repository at this point in the history
* WIP

* Add condition

* Fix formatting

* Format

* Build
  • Loading branch information
colinhacks authored Jul 19, 2024
1 parent 46423ba commit 8059ce6
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .configs/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"downlevelIteration": true,
"isolatedModules": true,

"pretty": true
"pretty": true,
"customConditions": ["@zod/source"]
}
}
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
}
},
"files": {
"ignore": ["lib", "coverage", "dist"]
"ignore": ["lib", "coverage", "dist", ".tshy", ".tshy-build"]
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"lint-staged": {
"src/*.ts": ["biome format --write", "biome lint --write"],
"*.json": ["biome format --write", "biome lint --write"],
"*.md": ["prettier --ignore-unknown --write"]
},
"scripts": {
Expand Down
17 changes: 5 additions & 12 deletions packages/effect-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@
"type": "module",
"version": "0.1.0",
"author": "Colin McDonnell <[email protected]>",
"files": [
"src",
"dist"
],
"files": ["src", "dist"],
"funding": "https://github.com/sponsors/colinhacks",
"homepage": "https://zod.dev",
"keywords": [
"typescript",
"schema",
"validation",
"type",
"inference"
],
"keywords": ["typescript", "schema", "validation", "type", "inference"],
"license": "MIT",
"sideEffects": false,
"main": "./dist/commonjs/index.js",
Expand All @@ -25,6 +16,7 @@
"./package.json": "./package.json",
".": {
"import": {
"@zod/source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
Expand All @@ -38,7 +30,8 @@
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"sourceDialects": ["@zod/source"]
},
"repository": {
"type": "git",
Expand Down
21 changes: 9 additions & 12 deletions packages/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@
"version": "3.23.8",
"author": "Colin McDonnell <[email protected]>",
"description": "TypeScript-first schema declaration and validation library with static type inference",
"files": [
"src",
"dist"
],
"files": ["src", "dist"],
"funding": "https://github.com/sponsors/colinhacks",
"homepage": "https://zod.dev",
"keywords": [
"typescript",
"schema",
"validation",
"type",
"inference"
],
"keywords": ["typescript", "schema", "validation", "type", "inference"],
"license": "MIT",
"sideEffects": false,
"main": "./dist/commonjs/index.js",
Expand All @@ -26,6 +17,7 @@
"./package.json": "./package.json",
".": {
"import": {
"@zod/source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
Expand All @@ -36,6 +28,7 @@
},
"./locales/*": {
"import": {
"@zod/source": "./src/locales/*",
"types": "./dist/esm/locales/*",
"default": "./dist/esm/locales/*"
},
Expand All @@ -50,7 +43,8 @@
"./package.json": "./package.json",
".": "./src/index.ts",
"./locales/*": "./src/locales/*"
}
},
"sourceDialects": ["@zod/source"]
},
"repository": {
"type": "git",
Expand All @@ -70,5 +64,8 @@
"test:watch": "pnpm vitest",
"test": "pnpm vitest run",
"prepublishOnly": "pnpm test && pnpm run build"
},
"dependencies": {
"effect": "^3.5.6"
}
}
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vitest.root.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type UserConfig, defineConfig } from "vitest/config";

export default defineConfig({
resolve: {
conditions: ["@zod/source"],
},
test: {
watch: false,
isolate: false,
Expand Down

0 comments on commit 8059ce6

Please sign in to comment.