Skip to content

Commit 5f68dca

Browse files
feat: improve oxc lint/fmt, add husky hooks to pre-commit and CI/CD (#386)
Co-authored-by: Julius <julius0216@outlook.com>
1 parent 9fa4da8 commit 5f68dca

File tree

28 files changed

+103
-123
lines changed

28 files changed

+103
-123
lines changed

.config/.oxlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "./node_modules/oxlint/configuration_schema.json",
2+
"$schema": "../node_modules/oxlint/configuration_schema.json",
33
"plugins": ["typescript", "import"],
44
"categories": {
55
"correctness": "warn",

.config/turbo.jsonc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
"tasks": {
55
"dev": {
66
"dependsOn": ["^dev"],
7-
"cache": false
7+
"cache": false,
88
},
99
"clean": {
10-
"cache": false
10+
"cache": false,
1111
},
1212
"build": {
1313
"dependsOn": ["^build"],
14-
"outputs": ["dist/**", ".next/**", ".nuxt"]
14+
"outputs": ["dist/**", ".next/**", ".nuxt"],
1515
},
1616
"typecheck": {
1717
"dependsOn": ["transit", "^build"],
18-
"outputs": [".cache/tsbuildinfo.json"]
18+
"outputs": [".cache/tsbuildinfo.json"],
1919
},
2020
"//#test": {
2121
"persistent": true,
22-
"outputs": []
22+
"outputs": [],
2323
},
2424
"//#test:run": {
25-
"outputs": []
25+
"outputs": [],
2626
},
2727
// Transit node in the turbo graph
2828
// no package.json scrips actually implement transit but it creates a dependency link for other tasks:
2929
// https://turbo.build/docs/crafting-your-repository/configuring-tasks#dependent-tasks-that-can-be-run-in-parallel
3030
"transit": {
31-
"dependsOn": ["^transit"]
32-
}
33-
}
31+
"dependsOn": ["^transit"],
32+
},
33+
},
3434
}

.github/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Setup Workflow
22
description: Composite action that sets up bun and installs dependencies
33
runs:
4-
using: 'composite'
4+
using: "composite"
55
steps:
66
- uses: actions/setup-node@v6
77
with:

.github/workflows/release-canary.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ jobs:
2525
- name: Checkout repo
2626
uses: actions/checkout@v6
2727
- uses: ./.github/setup
28+
- run: bun lint
29+
- run: bun fmt --check
2830

2931
- name: Build
3032
run: bun run build
3133

3234
- name: Authenticate to npm
33-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
35+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
3436

3537
- name: Publish
3638
run: bun run scripts/canary.ts

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
"oxc.fmt.configPath": ".config/.oxfmtrc.json",
2626
"typescript.tsdk": "node_modules/typescript/lib",
2727
"typescript.experimental.useTsgo": true,
28-
"typescript.enablePromptUseWorkspaceTsdk": true
28+
"typescript.enablePromptUseWorkspaceTsdk": true,
29+
"oxc.enable": true
2930
}

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ Deploying your app with invalid environment variables is a hassle. This package
2727

2828
# deno
2929
deno add jsr:@t3-oss/env-nuxt
30-
```
30+
```
3131

3232
## Usage
3333

3434
> [!NOTE]
3535
>
3636
> You may use any Standard Schema compliant validator of your choice. This example uses Zod
3737
38-
3938
This package supports the full power of Zod/Valibot etc, meaning you can use `transforms` and `default` values.
4039

4140
### Define your schema
@@ -137,7 +136,7 @@ Implement your changes, then submit a [Pull Request](https://docs.github.com/en/
137136
- Run the linters using `bun lint` (`bun lint:fix` to fix auto-fixable issues)
138137
- Run the tests using `bun run test`. Alternatively, you can use the test explorer in VSCode to target individual tests.
139138
- Commit with whatever commit message you want. We squash PRs so the individual commit messages does not matter.
140-
- For bug fixes, it's a good practise to first add a failing regression test in one commit, and then implement the fix in another. This helps the review process as it's easy to see what was failing before, and how it succeeded after your change.
139+
- For bug fixes, it's a good practise to first add a failing regression test in one commit, and then implement the fix in another. This helps the review process as it's easy to see what was failing before, and how it succeeded after your change.
141140
- Add a pull request description explaining your changes. Link any relevant issues (e.g. by including `Closes #123` in the description).
142141
- If some change might require extra consideration, a quick self-review can help maintainers more easily review your code and get it merged faster.
143142

bun.lock

Lines changed: 42 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/app/docs/customization/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ T3 Env ships the following presets out of the box, all importable from the `/pre
104104
- `railway` - Railway provided system environment variables. See full list [here](https://docs.railway.app/reference/variables#railway-provided-variables).
105105
- `fly.io` - Fly.io provided machine runtime environment variables. See full list [here](https://fly.io/docs/machines/runtime-environment/#environment-variables).
106106
- `netlify` - Netlify provided system environment variables. See full list [here](https://docs.netlify.com/configure-builds/environment-variables).
107-
- `upstashRedis` - Upstash Redis environment variables. More info [here](https://upstash.com/docs/redis/howto/connectwithupstashredis).
108-
- `coolify` - Coolify environment variables. More info [here](https://coolify.io/docs/knowledge-base/environment-variables#predefined-variables).
107+
- `upstashRedis` - Upstash Redis environment variables. More info [here](https://upstash.com/docs/redis/howto/connectwithupstashredis).
108+
- `coolify` - Coolify environment variables. More info [here](https://coolify.io/docs/knowledge-base/environment-variables#predefined-variables).
109109
- `vite` - Vite environment variables. More info [here](https://vite.dev/guide/env-and-mode).
110110
- `wxt` - WXT environment variables. More info [here](https://wxt.dev/guide/essentials/config/environment-variables.html#built-in-environment-variables).
111111

docs/src/app/docs/nextjs/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const env = createEnv({
116116

117117
<Callout type="info">
118118

119-
If you're using the `standalone` output in your `next.config.ts`, make sure to include the following:
119+
If you're using the `standalone` output in your `next.config.ts`, make sure to include the following:
120120

121121
```ts title="next.config.ts"
122122
import type { NextConfig } from "next"
@@ -150,7 +150,7 @@ export default {
150150
};
151151
```
152152
153-
We do not recommend using `next.config.ts` as it does not support loading ESM.
153+
We do not recommend using `next.config.ts` as it does not support loading ESM.
154154
155155
### Use your schema
156156

docs/src/app/docs/recipes/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ export const env = createEnv({
6161

6262
## Storybook
6363

64-
[Storybook](https://storybook.js.org/) uses its own bundler, which is otherwise
65-
unaware of `t3-env` and won't call into `runtimeEnv` to ensure that the environment
66-
variables are present. You can use Storybook's support for defining environment
67-
variables separately to ensure that all environment variables are actually
64+
[Storybook](https://storybook.js.org/) uses its own bundler, which is otherwise
65+
unaware of `t3-env` and won't call into `runtimeEnv` to ensure that the environment
66+
variables are present. You can use Storybook's support for defining environment
67+
variables separately to ensure that all environment variables are actually
6868
available for Storybook:
6969

7070
```ts

0 commit comments

Comments
 (0)