From 80e3c93c1509418a3ae74e8a894a31551f4243be Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Thu, 18 Jul 2024 17:46:36 -0700 Subject: [PATCH 1/5] WIP --- .configs/tsconfig.base.json | 3 ++- packages/effect-plugin/package.json | 5 ++++- packages/zod/package.json | 8 +++++++- pnpm-lock.yaml | 6 +++++- vitest.root.mts | 3 +++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.configs/tsconfig.base.json b/.configs/tsconfig.base.json index 3e6b66b75..6bdb4e2b6 100644 --- a/.configs/tsconfig.base.json +++ b/.configs/tsconfig.base.json @@ -27,6 +27,7 @@ "downlevelIteration": true, "isolatedModules": true, - "pretty": true + "pretty": true, + "customConditions": ["@zod/source"] } } diff --git a/packages/effect-plugin/package.json b/packages/effect-plugin/package.json index 29d2ecd18..3903ec0ce 100644 --- a/packages/effect-plugin/package.json +++ b/packages/effect-plugin/package.json @@ -38,7 +38,10 @@ "exports": { "./package.json": "./package.json", ".": "./src/index.ts" - } + }, + "sourceDialects": [ + "@zod/source" + ] }, "repository": { "type": "git", diff --git a/packages/zod/package.json b/packages/zod/package.json index 8214da82c..066117f2b 100644 --- a/packages/zod/package.json +++ b/packages/zod/package.json @@ -50,7 +50,10 @@ "./package.json": "./package.json", ".": "./src/index.ts", "./locales/*": "./src/locales/*" - } + }, + "sourceDialects": [ + "@zod/source" + ] }, "repository": { "type": "git", @@ -70,5 +73,8 @@ "test:watch": "pnpm vitest", "test": "pnpm vitest run", "prepublishOnly": "pnpm test && pnpm run build" + }, + "dependencies": { + "effect": "^3.5.6" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49f228887..a6b09a657 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,7 +100,11 @@ importers: specifier: ^3.0.0 version: link:../zod - packages/zod: {} + packages/zod: + dependencies: + effect: + specifier: ^3.5.6 + version: 3.5.6 packages: diff --git a/vitest.root.mts b/vitest.root.mts index 912a49daa..44b96efcc 100644 --- a/vitest.root.mts +++ b/vitest.root.mts @@ -1,6 +1,9 @@ import { type UserConfig, defineConfig } from "vitest/config"; export default defineConfig({ + resolve: { + conditions: ["@zod/source"], + }, test: { watch: false, isolate: false, From 1738f015328fb589aefd774cc6ac969f4b6509ca Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 19 Jul 2024 01:07:09 -0700 Subject: [PATCH 2/5] Add condition --- packages/zod/package.json | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/zod/package.json b/packages/zod/package.json index 066117f2b..71a2762a3 100644 --- a/packages/zod/package.json +++ b/packages/zod/package.json @@ -4,19 +4,10 @@ "version": "3.23.8", "author": "Colin McDonnell ", "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", @@ -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" }, @@ -36,6 +28,7 @@ }, "./locales/*": { "import": { + "@zod/source": "./src/locales/*", "types": "./dist/esm/locales/*", "default": "./dist/esm/locales/*" }, @@ -51,9 +44,7 @@ ".": "./src/index.ts", "./locales/*": "./src/locales/*" }, - "sourceDialects": [ - "@zod/source" - ] + "sourceDialects": ["@zod/source"] }, "repository": { "type": "git", From 7010c244d62bc239ea4364abc73ea6d59f245fe9 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 19 Jul 2024 01:12:43 -0700 Subject: [PATCH 3/5] Fix formatting --- biome.jsonc | 2 +- packages/effect-plugin/package.json | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index b2e134784..076b95f61 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -32,6 +32,6 @@ } }, "files": { - "ignore": ["lib", "coverage", "dist"] + "ignore": ["lib", "coverage", "dist", ".tshy", ".tshy-build"] } } diff --git a/packages/effect-plugin/package.json b/packages/effect-plugin/package.json index 3903ec0ce..717066b13 100644 --- a/packages/effect-plugin/package.json +++ b/packages/effect-plugin/package.json @@ -3,19 +3,10 @@ "type": "module", "version": "0.1.0", "author": "Colin McDonnell ", - "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", @@ -39,9 +30,7 @@ "./package.json": "./package.json", ".": "./src/index.ts" }, - "sourceDialects": [ - "@zod/source" - ] + "sourceDialects": ["@zod/source"] }, "repository": { "type": "git", From 1be7703f013e8e9c676ded3585ec6fe604cd8e4a Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 19 Jul 2024 01:14:30 -0700 Subject: [PATCH 4/5] Format --- package.json | 1 + packages/effect-plugin/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/package.json b/package.json index f1a52dfea..d44801c4d 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/packages/effect-plugin/package.json b/packages/effect-plugin/package.json index 717066b13..d9b9b001b 100644 --- a/packages/effect-plugin/package.json +++ b/packages/effect-plugin/package.json @@ -12,6 +12,7 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "exports": { "./package.json": "./package.json", ".": { From 3e74da25de7a0d2fd86a2214df75c18a985f89ec Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 19 Jul 2024 01:16:06 -0700 Subject: [PATCH 5/5] Build --- packages/effect-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/effect-plugin/package.json b/packages/effect-plugin/package.json index d9b9b001b..ca00a1cd3 100644 --- a/packages/effect-plugin/package.json +++ b/packages/effect-plugin/package.json @@ -12,11 +12,11 @@ "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", - "exports": { "./package.json": "./package.json", ".": { "import": { + "@zod/source": "./src/index.ts", "types": "./dist/esm/index.d.ts", "default": "./dist/esm/index.js" },