-
Notifications
You must be signed in to change notification settings - Fork 5
Add AllowedKeys typing to Bun plugin
#814
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
Changes from all commits
642baa7
3661601
278d2c0
14dc398
3061eae
4371087
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,22 @@ | ||
| --- | ||
| "@arkenv/bun-plugin": minor | ||
| "@arkenv/bun-plugin": patch | ||
| --- | ||
|
|
||
| Include the `NODE_ENV` environment variable as one of the publicly exposed environment variables so it's possible to type it. Bun already exposes `process.env.NODE_ENV` to the frontend and now it's possible to get it correctly typed. | ||
| #### Support `NODE_ENV` in schema | ||
|
|
||
| When `NODE_ENV` is included in your schema, it is now validated at startup and correctly typed. | ||
|
|
||
| ```ts | ||
| // src/env.ts | ||
| import { type } from "arkenv"; | ||
|
|
||
| export default type({ | ||
| BUN_PUBLIC_API_URL: "string.url", | ||
| NODE_ENV: "'development' | 'production' | 'test'", | ||
| }); | ||
| ``` | ||
|
|
||
| ```tsx | ||
| // process.env.NODE_ENV is now typed as "development" | "production" | "test" | ||
| <p>Mode: {process.env.NODE_ENV}</p> | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| BUN_PUBLIC_API_URL=https://api.example.com | ||
| BUN_PUBLIC_DEBUG=true | ||
| NODE_ENV=development |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| BUN_PUBLIC_API_URL=https://api.example.com | ||
| BUN_PUBLIC_DEBUG=true | ||
| NODE_ENV=development |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.