-
Notifications
You must be signed in to change notification settings - Fork 6
Overhaul internal structure and improve typesafety #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5d90caf
fix: improve type stability and address deep instantiation errors by …
yamcodes 6ddab5d
feat: introduce `@repo/scope` and `@repo/keywords` internal packages,…
yamcodes 4993d8b
[autofix.ci] apply automated fixes
autofix-ci[bot] 87c020f
chore: Update arktype peer dependency to catalog reference
yamcodes 0ec00a4
refactor: remove redundant `as never` and `as any` type assertions in…
yamcodes c990b84
refactor: Rename `envSchema` to `Env` and remove redundant type annot…
yamcodes 70193a4
feat: Add `@repo/scope` dependency and integrate its type into `EnvSc…
yamcodes e185e6c
chore: remove explicit sourcemap disabling from tsdown config
yamcodes 71dea7e
test: remove unnecessary `as never` type assertion from createEnv err…
yamcodes 69c592a
feat: Add `arkenv#test` task configuration with build and transit dep…
yamcodes 8f70b56
[autofix.ci] apply automated fixes
autofix-ci[bot] 4dfe2ef
Merge branch 'main' into 501-improve-input-types
yamcodes abf3516
refactor: Rename `arkenv#test` task to `test` in turbo.json.
yamcodes e48acea
chore: Consolidate and update test pipeline dependencies in turbo.jso…
yamcodes 644e1f4
chore: Add build step to CI test workflow and simplify turbo test dep…
yamcodes aa0027f
Merge branch 'main' into 501-improve-input-types
yamcodes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@arkenv/vite-plugin": patch | ||
| "@arkenv/bun-plugin": patch | ||
| --- | ||
|
|
||
| #### Improve internal types | ||
|
|
||
| Fixed "Type instantiation is excessively deep and possibly infinite" errors when using the plugins with complex ArkType schemas. This change improves type stability during the build process by optimizing how generics are passed to the validation logic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@repo/types": patch | ||
| --- | ||
|
|
||
| #### Add Schema types | ||
|
|
||
| Add Schema types to internal types package, including `EnvSchemaWithType` and `SchemaShape`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,3 +41,6 @@ pnpm-debug.log* | |
|
|
||
| # coverage | ||
| coverage/ | ||
|
|
||
| # size-limit | ||
| esbuild-why*.html | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| import { $ } from "./scope"; | ||
| import { $ } from "@repo/scope"; | ||
|
|
||
| export const type = $.type; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # `@repo/keywords` | ||
|
|
||
| Internal keywords for ArkEnv. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "name": "@repo/keywords", | ||
| "private": true, | ||
| "type": "module", | ||
| "version": "0.0.0", | ||
| "main": "./dist/index.cjs", | ||
| "module": "./dist/index.js", | ||
| "types": "./dist/index.d.ts", | ||
| "description": "ArkEnv keywords (internal usage)", | ||
| "exports": { | ||
| "types": "./dist/index.d.ts", | ||
| "import": "./dist/index.js", | ||
| "require": "./dist/index.cjs" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsdown", | ||
| "size": "size-limit", | ||
| "typecheck": "tsc --noEmit", | ||
| "clean": "rimraf dist node_modules", | ||
| "test": "vitest", | ||
| "fix": "pnpm -w run fix" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "keywords": [ | ||
| "keywords" | ||
| ], | ||
| "license": "MIT", | ||
| "homepage": "https://arkenv.js.org", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/yamcodes/arkenv.git" | ||
| }, | ||
| "author": "Yam Borodetsky <yam@yam.codes>", | ||
| "devDependencies": { | ||
| "arktype": "catalog:", | ||
| "tsdown": "catalog:", | ||
| "typescript": "catalog:" | ||
| }, | ||
| "peerDependencies": { | ||
| "arktype": "catalog:" | ||
| } | ||
| } | ||
2 changes: 1 addition & 1 deletion
2
packages/arkenv/src/types.test.ts → packages/internal/keywords/src/index.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "es2020", | ||
| "module": "preserve", | ||
| "strict": true, | ||
| "esModuleInterop": true, | ||
| "moduleResolution": "bundler", | ||
| "skipLibCheck": true, | ||
| "exactOptionalPropertyTypes": true, | ||
| "noImplicitAny": true, | ||
| "noEmit": true, | ||
| "outDir": "dist", | ||
| "resolveJsonModule": true, | ||
| "rootDir": "src", | ||
| "declaration": true, | ||
| "declarationMap": true | ||
| }, | ||
| "include": ["src"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { defineConfig } from "tsdown"; | ||
|
|
||
| export default defineConfig({ | ||
| format: ["esm", "cjs"], | ||
| minify: true, | ||
| fixedExtension: false, | ||
| dts: { | ||
| resolve: ["@repo/types"], | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "extends": ["//"], | ||
| "tasks": { | ||
| // Defined here and not in the root turbo.json to avoid building all packages when running `turbo run size`. | ||
| "size": { | ||
| "dependsOn": ["build"], | ||
| "cache": false | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { defineProject } from "vitest/config"; | ||
|
|
||
| export default defineProject({ | ||
| test: { | ||
| name: "@repo/keywords", | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # `@repo/scope` | ||
|
|
||
| Internal scope for ArkEnv. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.