diff --git a/.agents/skills/migrate-to-rstack-cli/SKILL.md b/.agents/skills/migrate-to-rstack-cli/SKILL.md index 917de99c..06d61983 100644 --- a/.agents/skills/migrate-to-rstack-cli/SKILL.md +++ b/.agents/skills/migrate-to-rstack-cli/SKILL.md @@ -53,13 +53,21 @@ define.test({ }); ``` -Prefer async config functions and dynamic imports for runtime plugins and presets: +Use dynamic imports in async config functions only for external plugins, presets, and other dependencies: ```ts -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; +define.app(async () => { + const { pluginReact } = await import('@rsbuild/plugin-react'); + return { + plugins: [pluginReact()], + }; }); ``` +`define.lint` provides `@rslint/core` APIs to its config factory, so no manual import is needed: + +```ts +define.lint(({ js }) => [js.configs.recommended]); +``` + Rstack loads TypeScript configs as native ESM. Preserve runtime-resolvable file extensions, replace CommonJS globals such as `__dirname`. diff --git a/.agents/skills/migrate-to-rstack-cli/references/rslint.md b/.agents/skills/migrate-to-rstack-cli/references/rslint.md index 96b31d59..41037e8b 100644 --- a/.agents/skills/migrate-to-rstack-cli/references/rslint.md +++ b/.agents/skills/migrate-to-rstack-cli/references/rslint.md @@ -5,22 +5,20 @@ Read this reference when the project uses `@rslint/core`, `rslint.config.*`, `rs ## Steps 1. Replace the `rslint` executable prefix with `rs lint`. For example, replace `rslint --fix` with `rs lint --fix`. -2. Move the old config into `define.lint`, replacing Rslint's `defineConfig()` wrapper and import. Dynamically import presets from `rstack/lint` inside an async config function. -3. Replace direct config/API imports from `@rslint/core` with exports from `rstack/lint` where available. -4. Replace custom `--config` paths with the migrated `rstack.config.*` path. -5. Remove `@rslint/core` only when no uncovered direct runtime API remains. Delete `rslint.config.*`. +2. Move the old config into `define.lint`, replacing Rslint's `defineConfig()` wrapper and import. Receive `@rslint/core` exports from the factory parameter. +3. Replace custom `--config` paths with the migrated `rstack.config.*` path. +4. Remove `@rslint/core` only when no uncovered direct runtime API remains. Delete `rslint.config.*`. ## Config Pattern ```ts import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); ``` +Preserve existing presets and rules during migration. + ## Script Pattern If a script also runs Prettier, migrate its formatting command as described in [prettier.md](prettier.md). diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a00db11..6d0ae0dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,5 +69,10 @@ jobs: run: git diff --exit-code -- packages/rstack/binding.cjs packages/rstack/binding.d.cts - name: Run Test - if: steps.changes.outputs.changed == 'true' + if: steps.changes.outputs.changed == 'true' && runner.os != 'Windows' run: node --run test + + # Run package tests serially on Windows to avoid resource contention between nested test workers. + - name: Run Test (Windows) + if: steps.changes.outputs.changed == 'true' && runner.os == 'Windows' + run: pnpm --workspace-concurrency=1 --filter "./packages/**" test diff --git a/examples/app-react/rstack.config.ts b/examples/app-react/rstack.config.ts index 4d23b13c..960e215b 100644 --- a/examples/app-react/rstack.config.ts +++ b/examples/app-react/rstack.config.ts @@ -12,12 +12,9 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - return [ - js.configs.recommended, - ts.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); diff --git a/examples/app-vanilla/rstack.config.ts b/examples/app-vanilla/rstack.config.ts index 3504d640..9707fbda 100644 --- a/examples/app-vanilla/rstack.config.ts +++ b/examples/app-vanilla/rstack.config.ts @@ -6,7 +6,4 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommended]); diff --git a/examples/documentation/rstack.config.ts b/examples/documentation/rstack.config.ts index f73f1863..10c5a9ad 100644 --- a/examples/documentation/rstack.config.ts +++ b/examples/documentation/rstack.config.ts @@ -7,12 +7,9 @@ define.doc({ title: 'My Site', }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - return [ - js.configs.recommended, - ts.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); diff --git a/examples/lib-node/rstack.config.ts b/examples/lib-node/rstack.config.ts index ccafc8da..ed274a80 100644 --- a/examples/lib-node/rstack.config.ts +++ b/examples/lib-node/rstack.config.ts @@ -6,7 +6,4 @@ define.lib({ syntax: ['node 22'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommended]); diff --git a/examples/lib-react/rstack.config.ts b/examples/lib-react/rstack.config.ts index 31913350..fd97fdae 100644 --- a/examples/lib-react/rstack.config.ts +++ b/examples/lib-react/rstack.config.ts @@ -22,12 +22,9 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - return [ - js.configs.recommended, - ts.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); diff --git a/packages/create-rstack/README.md b/packages/create-rstack/README.md index fcac4ec4..42c07e2c 100644 --- a/packages/create-rstack/README.md +++ b/packages/create-rstack/README.md @@ -53,7 +53,7 @@ npx create-rstack --dir my-project --template app-vanilla-ts --no-git ## Documentation -See the [Rstack documentation](https://rstack.rs). +See the [Rstack CLI documentation](https://rstack.rs). ## License diff --git a/packages/create-rstack/package.json b/packages/create-rstack/package.json index 3624d1b0..84e08d10 100644 --- a/packages/create-rstack/package.json +++ b/packages/create-rstack/package.json @@ -1,6 +1,6 @@ { "name": "create-rstack", - "version": "3.2.0", + "version": "3.2.1", "description": "Create a new Rstack project", "homepage": "https://rstack.rs", "bugs": { diff --git a/packages/create-rstack/template-app-lit-ts/package.json b/packages/create-rstack/template-app-lit-ts/package.json index 61684891..df58ecf0 100644 --- a/packages/create-rstack/template-app-lit-ts/package.json +++ b/packages/create-rstack/template-app-lit-ts/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-lit-ts/rstack.config.ts b/packages/create-rstack/template-app-lit-ts/rstack.config.ts index 1dac3261..84681d01 100644 --- a/packages/create-rstack/template-app-lit-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-lit-ts/rstack.config.ts @@ -16,11 +16,10 @@ define.test({ testEnvironment: 'happy-dom', }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-lit/package.json b/packages/create-rstack/template-app-lit/package.json index 21399993..3e3f3b90 100644 --- a/packages/create-rstack/template-app-lit/package.json +++ b/packages/create-rstack/template-app-lit/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "happy-dom": "^20.11.2", - "rstack": "^0.6.0" + "rstack": "^0.6.1" } } diff --git a/packages/create-rstack/template-app-lit/rstack.config.js b/packages/create-rstack/template-app-lit/rstack.config.js index d09e1329..5b863543 100644 --- a/packages/create-rstack/template-app-lit/rstack.config.js +++ b/packages/create-rstack/template-app-lit/rstack.config.js @@ -17,11 +17,7 @@ define.test({ testEnvironment: 'happy-dom', }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-preact-ts/package.json b/packages/create-rstack/template-app-preact-ts/package.json index 56aac06a..0764ec7f 100644 --- a/packages/create-rstack/template-app-preact-ts/package.json +++ b/packages/create-rstack/template-app-preact-ts/package.json @@ -22,7 +22,7 @@ "@testing-library/preact": "^3.2.4", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-preact-ts/rstack.config.ts b/packages/create-rstack/template-app-preact-ts/rstack.config.ts index 8bf4f073..ee37cab6 100644 --- a/packages/create-rstack/template-app-preact-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-preact-ts/rstack.config.ts @@ -13,16 +13,12 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts, reactHooksPlugin, reactPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - ts.configs.recommendedTypeChecked, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactHooksPlugin, reactPlugin }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-preact/package.json b/packages/create-rstack/template-app-preact/package.json index 272497e0..5a72ed4b 100644 --- a/packages/create-rstack/template-app-preact/package.json +++ b/packages/create-rstack/template-app-preact/package.json @@ -21,6 +21,6 @@ "@testing-library/jest-dom": "^7.0.1", "@testing-library/preact": "^3.2.4", "happy-dom": "^20.11.2", - "rstack": "^0.6.0" + "rstack": "^0.6.1" } } diff --git a/packages/create-rstack/template-app-preact/rstack.config.js b/packages/create-rstack/template-app-preact/rstack.config.js index e2b64e47..7959e79f 100644 --- a/packages/create-rstack/template-app-preact/rstack.config.js +++ b/packages/create-rstack/template-app-preact/rstack.config.js @@ -14,15 +14,11 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js, reactHooksPlugin, reactPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, reactHooksPlugin, reactPlugin }) => [ + js.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-react-ts/package.json b/packages/create-rstack/template-app-react-ts/package.json index 0fbcb93d..dd7ea8c4 100644 --- a/packages/create-rstack/template-app-react-ts/package.json +++ b/packages/create-rstack/template-app-react-ts/package.json @@ -26,7 +26,7 @@ "@types/react": "^19.2.18", "@types/react-dom": "^19.2.4", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-react-ts/rstack.config.ts b/packages/create-rstack/template-app-react-ts/rstack.config.ts index 1cbfbf46..76da1357 100644 --- a/packages/create-rstack/template-app-react-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-react-ts/rstack.config.ts @@ -13,16 +13,12 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - ts.configs.recommendedTypeChecked, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-react/package.json b/packages/create-rstack/template-app-react/package.json index 4f0a81e6..803c4abb 100644 --- a/packages/create-rstack/template-app-react/package.json +++ b/packages/create-rstack/template-app-react/package.json @@ -23,6 +23,6 @@ "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.2", "happy-dom": "^20.11.2", - "rstack": "^0.6.0" + "rstack": "^0.6.1" } } diff --git a/packages/create-rstack/template-app-react/rstack.config.js b/packages/create-rstack/template-app-react/rstack.config.js index ddd9f056..9469b706 100644 --- a/packages/create-rstack/template-app-react/rstack.config.js +++ b/packages/create-rstack/template-app-react/rstack.config.js @@ -14,15 +14,11 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js, reactHooksPlugin, reactPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, reactHooksPlugin, reactPlugin }) => [ + js.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-solid-ts/package.json b/packages/create-rstack/template-app-solid-ts/package.json index b15f3a66..b223ec74 100644 --- a/packages/create-rstack/template-app-solid-ts/package.json +++ b/packages/create-rstack/template-app-solid-ts/package.json @@ -23,7 +23,7 @@ "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-solid-ts/rstack.config.ts b/packages/create-rstack/template-app-solid-ts/rstack.config.ts index 6aac365b..0c2e91b5 100644 --- a/packages/create-rstack/template-app-solid-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-solid-ts/rstack.config.ts @@ -19,11 +19,10 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-solid/package.json b/packages/create-rstack/template-app-solid/package.json index d1964a8c..ff10813d 100644 --- a/packages/create-rstack/template-app-solid/package.json +++ b/packages/create-rstack/template-app-solid/package.json @@ -22,6 +22,6 @@ "@solidjs/testing-library": "^0.8.10", "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", - "rstack": "^0.6.0" + "rstack": "^0.6.1" } } diff --git a/packages/create-rstack/template-app-solid/rstack.config.js b/packages/create-rstack/template-app-solid/rstack.config.js index 80b7b6f7..ac5ced95 100644 --- a/packages/create-rstack/template-app-solid/rstack.config.js +++ b/packages/create-rstack/template-app-solid/rstack.config.js @@ -20,11 +20,7 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-svelte-ts/package.json b/packages/create-rstack/template-app-svelte-ts/package.json index c705ed07..63910506 100644 --- a/packages/create-rstack/template-app-svelte-ts/package.json +++ b/packages/create-rstack/template-app-svelte-ts/package.json @@ -23,7 +23,7 @@ "@types/node": "^24.13.3", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "svelte-check": "^4.7.5", "typescript": "^6.0.3" } diff --git a/packages/create-rstack/template-app-svelte-ts/rstack.config.ts b/packages/create-rstack/template-app-svelte-ts/rstack.config.ts index e834b53d..b09e259c 100644 --- a/packages/create-rstack/template-app-svelte-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-svelte-ts/rstack.config.ts @@ -13,11 +13,10 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ plugins: ['prettier-plugin-svelte'], diff --git a/packages/create-rstack/template-app-svelte/package.json b/packages/create-rstack/template-app-svelte/package.json index e5abceee..e48dff5e 100644 --- a/packages/create-rstack/template-app-svelte/package.json +++ b/packages/create-rstack/template-app-svelte/package.json @@ -22,6 +22,6 @@ "@testing-library/svelte": "^5.4.2", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.6.0" + "rstack": "^0.6.1" } } diff --git a/packages/create-rstack/template-app-svelte/rstack.config.js b/packages/create-rstack/template-app-svelte/rstack.config.js index 742edde8..6450bb86 100644 --- a/packages/create-rstack/template-app-svelte/rstack.config.js +++ b/packages/create-rstack/template-app-svelte/rstack.config.js @@ -14,11 +14,7 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ plugins: ['prettier-plugin-svelte'], diff --git a/packages/create-rstack/template-app-vanilla-ts/package.json b/packages/create-rstack/template-app-vanilla-ts/package.json index 19f80fa9..1992286f 100644 --- a/packages/create-rstack/template-app-vanilla-ts/package.json +++ b/packages/create-rstack/template-app-vanilla-ts/package.json @@ -18,7 +18,7 @@ "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts b/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts index 5476c2c8..6e755422 100644 --- a/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-vanilla-ts/rstack.config.ts @@ -9,11 +9,10 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-vanilla/package.json b/packages/create-rstack/template-app-vanilla/package.json index 6e4dd119..ad5a99fb 100644 --- a/packages/create-rstack/template-app-vanilla/package.json +++ b/packages/create-rstack/template-app-vanilla/package.json @@ -17,6 +17,6 @@ "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", - "rstack": "^0.6.0" + "rstack": "^0.6.1" } } diff --git a/packages/create-rstack/template-app-vanilla/rstack.config.js b/packages/create-rstack/template-app-vanilla/rstack.config.js index 23e75fdf..a9f27d77 100644 --- a/packages/create-rstack/template-app-vanilla/rstack.config.js +++ b/packages/create-rstack/template-app-vanilla/rstack.config.js @@ -10,11 +10,7 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-vue-ts/package.json b/packages/create-rstack/template-app-vue-ts/package.json index fcd61816..2ca2e7a4 100644 --- a/packages/create-rstack/template-app-vue-ts/package.json +++ b/packages/create-rstack/template-app-vue-ts/package.json @@ -22,7 +22,7 @@ "@types/node": "^24.13.3", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^6.0.3", "vue-tsc": "^3.3.9" } diff --git a/packages/create-rstack/template-app-vue-ts/rstack.config.ts b/packages/create-rstack/template-app-vue-ts/rstack.config.ts index 12ea8e76..e1133986 100644 --- a/packages/create-rstack/template-app-vue-ts/rstack.config.ts +++ b/packages/create-rstack/template-app-vue-ts/rstack.config.ts @@ -13,11 +13,10 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-app-vue/package.json b/packages/create-rstack/template-app-vue/package.json index 7cd20a99..508b72b5 100644 --- a/packages/create-rstack/template-app-vue/package.json +++ b/packages/create-rstack/template-app-vue/package.json @@ -21,6 +21,6 @@ "@testing-library/jest-dom": "^7.0.1", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.6.0" + "rstack": "^0.6.1" } } diff --git a/packages/create-rstack/template-app-vue/rstack.config.js b/packages/create-rstack/template-app-vue/rstack.config.js index b67b85e1..199e7340 100644 --- a/packages/create-rstack/template-app-vue/rstack.config.js +++ b/packages/create-rstack/template-app-vue/rstack.config.js @@ -14,11 +14,7 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-common/README.md b/packages/create-rstack/template-common/README.md index abd777a3..f1777fb0 100644 --- a/packages/create-rstack/template-common/README.md +++ b/packages/create-rstack/template-common/README.md @@ -21,5 +21,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) -- [Rstack GitHub repository](https://github.com/rstackjs/rstack-cli) +- [Rstack CLI documentation](https://rstack.rs) +- [Rstack CLI GitHub repository](https://github.com/rstackjs/rstack-cli) diff --git a/packages/create-rstack/template-doc-i18n/README.md b/packages/create-rstack/template-doc-i18n/README.md index ba4906ab..8e0f4ae9 100644 --- a/packages/create-rstack/template-doc-i18n/README.md +++ b/packages/create-rstack/template-doc-i18n/README.md @@ -19,5 +19,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rspress documentation](https://rspress.rs) diff --git a/packages/create-rstack/template-doc-i18n/package.json b/packages/create-rstack/template-doc-i18n/package.json index b002b2a2..99653b4d 100644 --- a/packages/create-rstack/template-doc-i18n/package.json +++ b/packages/create-rstack/template-doc-i18n/package.json @@ -18,7 +18,7 @@ "@types/react-dom": "^19.2.4", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-doc-i18n/rstack.config.ts b/packages/create-rstack/template-doc-i18n/rstack.config.ts index 8e1f8435..e3185a0d 100644 --- a/packages/create-rstack/template-doc-i18n/rstack.config.ts +++ b/packages/create-rstack/template-doc-i18n/rstack.config.ts @@ -23,16 +23,12 @@ define.doc({ ], }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - ts.configs.recommendedTypeChecked, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-doc/README.md b/packages/create-rstack/template-doc/README.md index cd9ac929..84ca63bc 100644 --- a/packages/create-rstack/template-doc/README.md +++ b/packages/create-rstack/template-doc/README.md @@ -19,5 +19,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rspress documentation](https://rspress.rs) diff --git a/packages/create-rstack/template-doc/package.json b/packages/create-rstack/template-doc/package.json index f11dce21..72785a93 100644 --- a/packages/create-rstack/template-doc/package.json +++ b/packages/create-rstack/template-doc/package.json @@ -18,7 +18,7 @@ "@types/react-dom": "^19.2.4", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" } } diff --git a/packages/create-rstack/template-doc/rstack.config.ts b/packages/create-rstack/template-doc/rstack.config.ts index 77378cff..99bf9d0d 100644 --- a/packages/create-rstack/template-doc/rstack.config.ts +++ b/packages/create-rstack/template-doc/rstack.config.ts @@ -7,16 +7,12 @@ define.doc({ title: 'My Site', }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - ts.configs.recommendedTypeChecked, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-node-ts/README.md b/packages/create-rstack/template-lib-node-ts/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-node-ts/README.md +++ b/packages/create-rstack/template-lib-node-ts/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-node-ts/package.json b/packages/create-rstack/template-lib-node-ts/package.json index 0249c11b..95e1ff92 100644 --- a/packages/create-rstack/template-lib-node-ts/package.json +++ b/packages/create-rstack/template-lib-node-ts/package.json @@ -25,7 +25,7 @@ }, "devDependencies": { "@types/node": "^24.13.3", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" }, "engines": { diff --git a/packages/create-rstack/template-lib-node-ts/rstack.config.ts b/packages/create-rstack/template-lib-node-ts/rstack.config.ts index dc33795b..28d8d881 100644 --- a/packages/create-rstack/template-lib-node-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-node-ts/rstack.config.ts @@ -10,11 +10,10 @@ define.test({ // Configure Rstest }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-node/README.md b/packages/create-rstack/template-lib-node/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-node/README.md +++ b/packages/create-rstack/template-lib-node/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-node/package.json b/packages/create-rstack/template-lib-node/package.json index 32cec902..34fc835d 100644 --- a/packages/create-rstack/template-lib-node/package.json +++ b/packages/create-rstack/template-lib-node/package.json @@ -22,7 +22,7 @@ "test:watch": "rs test --watch" }, "devDependencies": { - "rstack": "^0.6.0" + "rstack": "^0.6.1" }, "engines": { "node": ">=22.12.0" diff --git a/packages/create-rstack/template-lib-node/rstack.config.js b/packages/create-rstack/template-lib-node/rstack.config.js index 3f62051d..f193d432 100644 --- a/packages/create-rstack/template-lib-node/rstack.config.js +++ b/packages/create-rstack/template-lib-node/rstack.config.js @@ -10,11 +10,7 @@ define.test({ // Configure Rstest }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-react-ts/README.md b/packages/create-rstack/template-lib-react-ts/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-react-ts/README.md +++ b/packages/create-rstack/template-lib-react-ts/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-react-ts/package.json b/packages/create-rstack/template-lib-react-ts/package.json index 2f6db0e9..2ad075e2 100644 --- a/packages/create-rstack/template-lib-react-ts/package.json +++ b/packages/create-rstack/template-lib-react-ts/package.json @@ -33,7 +33,7 @@ "happy-dom": "^20.11.2", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^7.0.2" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-react-ts/rstack.config.ts b/packages/create-rstack/template-lib-react-ts/rstack.config.ts index b131e4a8..a6ef9b74 100644 --- a/packages/create-rstack/template-lib-react-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-react-ts/rstack.config.ts @@ -23,16 +23,12 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - ts.configs.recommendedTypeChecked, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-react/README.md b/packages/create-rstack/template-lib-react/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-react/README.md +++ b/packages/create-rstack/template-lib-react/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-react/package.json b/packages/create-rstack/template-lib-react/package.json index 72e2c7a2..f91d1744 100644 --- a/packages/create-rstack/template-lib-react/package.json +++ b/packages/create-rstack/template-lib-react/package.json @@ -29,7 +29,7 @@ "happy-dom": "^20.11.2", "react": "^19.2.8", "react-dom": "^19.2.8", - "rstack": "^0.6.0" + "rstack": "^0.6.1" }, "peerDependencies": { "react": ">=18.0.0", diff --git a/packages/create-rstack/template-lib-react/rstack.config.js b/packages/create-rstack/template-lib-react/rstack.config.js index 3ef9c799..663d1744 100644 --- a/packages/create-rstack/template-lib-react/rstack.config.js +++ b/packages/create-rstack/template-lib-react/rstack.config.js @@ -23,15 +23,11 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js, reactHooksPlugin, reactPlugin } = await import('rstack/lint'); - - return [ - js.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, reactHooksPlugin, reactPlugin }) => [ + js.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-solid-ts/README.md b/packages/create-rstack/template-lib-solid-ts/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-solid-ts/README.md +++ b/packages/create-rstack/template-lib-solid-ts/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-solid-ts/package.json b/packages/create-rstack/template-lib-solid-ts/package.json index f40e43bd..fa98fcbb 100644 --- a/packages/create-rstack/template-lib-solid-ts/package.json +++ b/packages/create-rstack/template-lib-solid-ts/package.json @@ -30,7 +30,7 @@ "@testing-library/jest-dom": "^7.0.1", "@types/node": "^24.13.3", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "solid-js": "^1.9.14", "typescript": "^7.0.2" }, diff --git a/packages/create-rstack/template-lib-solid-ts/rstack.config.ts b/packages/create-rstack/template-lib-solid-ts/rstack.config.ts index 02bc776f..04122368 100644 --- a/packages/create-rstack/template-lib-solid-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-solid-ts/rstack.config.ts @@ -75,11 +75,10 @@ define.test(async () => { }; }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-solid/README.md b/packages/create-rstack/template-lib-solid/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-solid/README.md +++ b/packages/create-rstack/template-lib-solid/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-solid/package.json b/packages/create-rstack/template-lib-solid/package.json index 3f8a1e54..836fec38 100644 --- a/packages/create-rstack/template-lib-solid/package.json +++ b/packages/create-rstack/template-lib-solid/package.json @@ -27,7 +27,7 @@ "@solidjs/testing-library": "^0.8.10", "@testing-library/jest-dom": "^7.0.1", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "solid-js": "^1.9.14" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-solid/rstack.config.js b/packages/create-rstack/template-lib-solid/rstack.config.js index 75f1d03e..b1eb7d49 100644 --- a/packages/create-rstack/template-lib-solid/rstack.config.js +++ b/packages/create-rstack/template-lib-solid/rstack.config.js @@ -75,11 +75,7 @@ define.test(async () => { }; }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-svelte-ts/README.md b/packages/create-rstack/template-lib-svelte-ts/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-svelte-ts/README.md +++ b/packages/create-rstack/template-lib-svelte-ts/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-svelte-ts/package.json b/packages/create-rstack/template-lib-svelte-ts/package.json index faea65d7..4241ba47 100644 --- a/packages/create-rstack/template-lib-svelte-ts/package.json +++ b/packages/create-rstack/template-lib-svelte-ts/package.json @@ -27,7 +27,7 @@ "@types/node": "^24.13.3", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "svelte": "^5.56.8", "svelte-check": "^4.7.5", "svelte2tsx": "^0.7.60", diff --git a/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts b/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts index 0844c4e2..71f23a4a 100644 --- a/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-svelte-ts/rstack.config.ts @@ -23,11 +23,10 @@ define.test({ testEnvironment: 'happy-dom', }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ plugins: ['prettier-plugin-svelte'], diff --git a/packages/create-rstack/template-lib-svelte/README.md b/packages/create-rstack/template-lib-svelte/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-svelte/README.md +++ b/packages/create-rstack/template-lib-svelte/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-svelte/package.json b/packages/create-rstack/template-lib-svelte/package.json index e64f4746..b03e95af 100644 --- a/packages/create-rstack/template-lib-svelte/package.json +++ b/packages/create-rstack/template-lib-svelte/package.json @@ -24,7 +24,7 @@ "@rsbuild/plugin-svelte": "^2.0.1", "happy-dom": "^20.11.2", "prettier-plugin-svelte": "^4.1.1", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "svelte": "^5.56.8" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-svelte/rstack.config.js b/packages/create-rstack/template-lib-svelte/rstack.config.js index b7d7ba0f..7b7c5f3c 100644 --- a/packages/create-rstack/template-lib-svelte/rstack.config.js +++ b/packages/create-rstack/template-lib-svelte/rstack.config.js @@ -23,11 +23,7 @@ define.test({ testEnvironment: 'happy-dom', }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ plugins: ['prettier-plugin-svelte'], diff --git a/packages/create-rstack/template-lib-vue-ts/README.md b/packages/create-rstack/template-lib-vue-ts/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-vue-ts/README.md +++ b/packages/create-rstack/template-lib-vue-ts/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-vue-ts/package.json b/packages/create-rstack/template-lib-vue-ts/package.json index a1932615..3b5f7930 100644 --- a/packages/create-rstack/template-lib-vue-ts/package.json +++ b/packages/create-rstack/template-lib-vue-ts/package.json @@ -28,7 +28,7 @@ "@types/node": "^24.13.3", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "typescript": "^6.0.3", "vue": "^3.5.41", "vue-tsc": "^3.3.9" diff --git a/packages/create-rstack/template-lib-vue-ts/rstack.config.ts b/packages/create-rstack/template-lib-vue-ts/rstack.config.ts index a372eb1d..a70a064d 100644 --- a/packages/create-rstack/template-lib-vue-ts/rstack.config.ts +++ b/packages/create-rstack/template-lib-vue-ts/rstack.config.ts @@ -22,11 +22,10 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommendedTypeChecked]; -}); +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, +]); define.fmt({ singleQuote: true, diff --git a/packages/create-rstack/template-lib-vue/README.md b/packages/create-rstack/template-lib-vue/README.md index 93e8a06e..5d6dbbef 100644 --- a/packages/create-rstack/template-lib-vue/README.md +++ b/packages/create-rstack/template-lib-vue/README.md @@ -20,5 +20,5 @@ Install the dependencies: ## Learn more -- [Rstack documentation](https://rstack.rs) +- [Rstack CLI documentation](https://rstack.rs) - [Rslib documentation](https://rslib.rs) diff --git a/packages/create-rstack/template-lib-vue/package.json b/packages/create-rstack/template-lib-vue/package.json index abbff2c4..d22c4278 100644 --- a/packages/create-rstack/template-lib-vue/package.json +++ b/packages/create-rstack/template-lib-vue/package.json @@ -25,7 +25,7 @@ "@testing-library/jest-dom": "^7.0.1", "@vue/test-utils": "^2.4.11", "happy-dom": "^20.11.2", - "rstack": "^0.6.0", + "rstack": "^0.6.1", "vue": "^3.5.41" }, "peerDependencies": { diff --git a/packages/create-rstack/template-lib-vue/rstack.config.js b/packages/create-rstack/template-lib-vue/rstack.config.js index 09a3de03..db019b91 100644 --- a/packages/create-rstack/template-lib-vue/rstack.config.js +++ b/packages/create-rstack/template-lib-vue/rstack.config.js @@ -23,11 +23,7 @@ define.test({ setupFiles: ['./tests/rstest.setup.js'], }); -define.lint(async () => { - const { js } = await import('rstack/lint'); - - return [js.configs.recommended]; -}); +define.lint(({ js }) => [js.configs.recommended]); define.fmt({ singleQuote: true, diff --git a/packages/rstack/binding.cjs b/packages/rstack/binding.cjs index 8ee733a0..6c7528a3 100644 --- a/packages/rstack/binding.cjs +++ b/packages/rstack/binding.cjs @@ -77,8 +77,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-android-arm64') const bindingPackageVersion = require('@rstackjs/cli-android-arm64/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -93,8 +93,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-android-arm-eabi') const bindingPackageVersion = require('@rstackjs/cli-android-arm-eabi/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -114,8 +114,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-x64-gnu') const bindingPackageVersion = require('@rstackjs/cli-win32-x64-gnu/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -130,8 +130,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-x64-msvc') const bindingPackageVersion = require('@rstackjs/cli-win32-x64-msvc/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -147,8 +147,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-ia32-msvc') const bindingPackageVersion = require('@rstackjs/cli-win32-ia32-msvc/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -163,8 +163,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-win32-arm64-msvc') const bindingPackageVersion = require('@rstackjs/cli-win32-arm64-msvc/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -182,8 +182,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-darwin-universal') const bindingPackageVersion = require('@rstackjs/cli-darwin-universal/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -198,8 +198,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-darwin-x64') const bindingPackageVersion = require('@rstackjs/cli-darwin-x64/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -214,8 +214,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-darwin-arm64') const bindingPackageVersion = require('@rstackjs/cli-darwin-arm64/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -234,8 +234,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-freebsd-x64') const bindingPackageVersion = require('@rstackjs/cli-freebsd-x64/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -250,8 +250,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-freebsd-arm64') const bindingPackageVersion = require('@rstackjs/cli-freebsd-arm64/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -271,8 +271,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-x64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-x64-musl/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -287,8 +287,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-x64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-x64-gnu/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -305,8 +305,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-arm64-musl/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -321,8 +321,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-arm64-gnu/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -339,8 +339,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm-musleabihf') const bindingPackageVersion = require('@rstackjs/cli-linux-arm-musleabihf/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -355,8 +355,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-arm-gnueabihf') const bindingPackageVersion = require('@rstackjs/cli-linux-arm-gnueabihf/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -373,8 +373,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-loong64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-loong64-musl/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -389,8 +389,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-loong64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-loong64-gnu/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -407,8 +407,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-riscv64-musl') const bindingPackageVersion = require('@rstackjs/cli-linux-riscv64-musl/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -423,8 +423,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-riscv64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-riscv64-gnu/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -440,8 +440,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-ppc64-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-ppc64-gnu/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -456,8 +456,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-linux-s390x-gnu') const bindingPackageVersion = require('@rstackjs/cli-linux-s390x-gnu/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -476,8 +476,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-openharmony-arm64') const bindingPackageVersion = require('@rstackjs/cli-openharmony-arm64/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -492,8 +492,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-openharmony-x64') const bindingPackageVersion = require('@rstackjs/cli-openharmony-x64/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -508,8 +508,8 @@ function requireNative() { try { const binding = require('@rstackjs/cli-openharmony-arm') const bindingPackageVersion = require('@rstackjs/cli-openharmony-arm/package.json').version - if (bindingPackageVersion !== '0.6.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -648,8 +648,8 @@ if (!nativeBinding || forceWasi) { if (!candidateFailed) { if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { const bindingPackageVersion = require('@rstackjs/cli-wasm32-wasi/package.json').version - if (bindingPackageVersion !== '0.6.0') { - throw new Error(`WASI binding package version mismatch, expected 0.6.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + if (bindingPackageVersion !== '0.6.1') { + throw new Error(`WASI binding package version mismatch, expected 0.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } } wasiBinding = require('@rstackjs/cli-wasm32-wasi') diff --git a/packages/rstack/package.json b/packages/rstack/package.json index 5936624f..df58a421 100644 --- a/packages/rstack/package.json +++ b/packages/rstack/package.json @@ -1,6 +1,6 @@ { "name": "rstack", - "version": "0.6.0", + "version": "0.6.1", "description": "One CLI for JavaScript development, powered by Rstack.", "homepage": "https://rstack.rs", "bugs": { diff --git a/packages/rstack/rslib.config.ts b/packages/rstack/rslib.config.ts index a2662b13..70b66090 100644 --- a/packages/rstack/rslib.config.ts +++ b/packages/rstack/rslib.config.ts @@ -54,16 +54,4 @@ export default defineConfig({ ], }, }, - tools: { - rspack: { - module: { - parser: { - javascript: { - // @rstest/adapter-rslib resolves extended tsconfig paths from a runtime base. - createRequire: false, - }, - }, - }, - }, - }, }); diff --git a/packages/rstack/src/config.ts b/packages/rstack/src/config.ts index f977f6fc..0bf3bc52 100644 --- a/packages/rstack/src/config.ts +++ b/packages/rstack/src/config.ts @@ -11,6 +11,10 @@ import type { StagedConfig } from './staged.ts'; export type RslintConfigDefinition = RslintConfig | (() => Promise); export type RspressConfigDefinition = UserConfig | UserConfigAsyncFn; +type RslintConfigFactory = ( + lint: typeof import('@rslint/core'), +) => RslintConfig | Promise; + export type Configs = { app?: RsbuildConfigDefinition; lib?: RslibConfigDefinition; @@ -125,10 +129,11 @@ type Define = { * Defines the Rslint config for linting. * * This config is used by the `rs lint` command. + * A config factory receives the exports from `rstack/lint`. * * @see {@link https://rstack.rs/config | Rstack configuration guide} */ - lint: (config: RslintConfig | (() => Promise)) => void; + lint: (config: RslintConfig | RslintConfigFactory) => void; /** * Defines the Prettier config for formatting. * @@ -165,7 +170,11 @@ export const define: Define = { lib: (config) => setConfig('lib', config), doc: (config) => setConfig('doc', config), test: (config) => setConfig('test', config), - lint: (config) => setConfig('lint', config), + lint: (config) => + setConfig( + 'lint', + typeof config === 'function' ? async () => config(await import('@rslint/core')) : config, + ), fmt: (config) => setConfig('fmt', config), staged: (config) => setConfig('staged', config), }; diff --git a/packages/rstack/src/fmt/cacheStore.ts b/packages/rstack/src/fmt/cacheStore.ts index 0dcf3292..71622c62 100644 --- a/packages/rstack/src/fmt/cacheStore.ts +++ b/packages/rstack/src/fmt/cacheStore.ts @@ -57,7 +57,10 @@ const createEmptyCache = (namespace: string): ParsedFmtCacheFile => ({ optionsUseCounts: [], }); -const parseCacheFile = (content: string): ParsedFmtCacheFile | undefined => { +const parseCacheFile = ( + content: string, + expectedNamespace: string, +): ParsedFmtCacheFile | undefined => { let value: unknown; try { value = JSON.parse(content); @@ -73,7 +76,7 @@ const parseCacheFile = (content: string): ParsedFmtCacheFile | undefined => { const { version, namespace, options, files } = cache; if ( version !== fmtCacheVersion || - typeof namespace !== 'string' || + namespace !== expectedNamespace || !Array.isArray(options) || !Array.isArray(files) || files.length % fileEntryWidth !== 0 @@ -199,33 +202,34 @@ class FmtCacheStoreImpl implements FmtCacheStore { return index; } + /** Removes unreferenced option hashes and remaps file entries to the compacted indexes. */ #compactUnusedOptions(): void { if (!this.#optionsUseCounts.includes(0)) { return; } const { files, options } = this.#cache; - const nextOptions: string[] = []; - const nextUseCounts: number[] = []; - const remappedIndexes = new Int32Array(options.length).fill(-1); + const counts = this.#optionsUseCounts; + const remap = new Int32Array(options.length).fill(-1); + let nextIndex = 0; + this.#optionsIndexes.clear(); for (let index = 0; index < options.length; index++) { - const useCount = this.#optionsUseCounts[index]; - if (useCount > 0) { - remappedIndexes[index] = nextOptions.length; - nextOptions.push(options[index]); - nextUseCounts.push(useCount); + const count = counts[index]; + if (count > 0) { + const option = options[index]; + remap[index] = nextIndex; + options[nextIndex] = option; + counts[nextIndex] = count; + this.#optionsIndexes.set(option, nextIndex); + nextIndex++; } } - for (let offset = 0; offset < files.length; offset += fileEntryWidth) { - const currentIndex = files[offset + optionsIndexOffset] as number; - files[offset + optionsIndexOffset] = remappedIndexes[currentIndex]; - } + options.length = nextIndex; + counts.length = nextIndex; - options.splice(0, options.length, ...nextOptions); - this.#optionsUseCounts.splice(0, this.#optionsUseCounts.length, ...nextUseCounts); - this.#optionsIndexes.clear(); - for (let index = 0; index < options.length; index++) { - this.#optionsIndexes.set(options[index], index); + for (let offset = 0; offset < files.length; offset += fileEntryWidth) { + const index = files[offset + optionsIndexOffset] as number; + files[offset + optionsIndexOffset] = remap[index]; } } @@ -262,14 +266,12 @@ const loadFmtCacheStore = async (filePath: string, namespace: string): Promise = loadRstackConfig(loadOptions); const configs: Configs = {}; @@ -26,9 +27,10 @@ void configs; void createRsbuild({ config: appConfig }); define.app(appConfig); define.lib(libConfig); +define.lint(lintConfig); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); define.doc({}); define.test({}); -define.lint([js.configs.recommended, ts.configs.recommended]); define.staged({}); importedTest('exposes the Rstest APIs', () => { diff --git a/packages/rstack/tests/types/resolution-nodenext/index.ts b/packages/rstack/tests/types/resolution-nodenext/index.ts index 4b8d3f0a..8853c64e 100644 --- a/packages/rstack/tests/types/resolution-nodenext/index.ts +++ b/packages/rstack/tests/types/resolution-nodenext/index.ts @@ -1,4 +1,4 @@ -// This folder checks Rstack's exports and APIs with NodeNext resolution. +// This folder checks Rstack's exports and APIs with bundler resolution. import 'rstack/test/globals'; import 'rstack/test/importMeta'; import 'rstack/types'; @@ -11,11 +11,12 @@ import { type LoadRstackConfigOptions, } from 'rstack/config'; import { defineConfig as defineLibConfig } from 'rstack/lib'; -import { js, ts } from 'rstack/lint'; +import { defineConfig as defineLintConfig } from 'rstack/lint'; import { expect as importedExpect, test as importedTest } from 'rstack/test'; const appConfig = defineAppConfig({}); const libConfig = defineLibConfig({}); +const lintConfig = defineLintConfig([]); const loadOptions: LoadRstackConfigOptions = { configFilePath: 'rstack.config.ts' }; const loadedConfig: Promise = loadRstackConfig(loadOptions); const configs: Configs = {}; @@ -26,9 +27,10 @@ void configs; void createRsbuild({ config: appConfig }); define.app(appConfig); define.lib(libConfig); +define.lint(lintConfig); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); define.doc({}); define.test({}); -define.lint([js.configs.recommended, ts.configs.recommended]); define.staged({}); importedTest('exposes the Rstest APIs', () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be9b0d6c..014fe63a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,8 +20,8 @@ catalogs: specifier: ^2.0.1 version: 2.0.1 '@rslib/core': - specifier: ~1.0.0-beta.2 - version: 1.0.0-beta.2 + specifier: ~1.0.0-beta.3 + version: 1.0.0-beta.3 '@rslint/core': specifier: ~0.8.0 version: 0.8.0 @@ -189,7 +189,7 @@ importers: devDependencies: '@rsbuild/plugin-react': specifier: 'catalog:' - version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) + version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.10) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 @@ -277,7 +277,7 @@ importers: devDependencies: '@rsbuild/plugin-react': specifier: 'catalog:' - version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) + version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.10) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 @@ -320,7 +320,7 @@ importers: devDependencies: '@rsbuild/plugin-react': specifier: 'catalog:' - version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) + version: 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.10) '@testing-library/dom': specifier: 'catalog:' version: 10.4.1 @@ -369,7 +369,7 @@ importers: version: 2.1.11 '@rslib/core': specifier: 'catalog:' - version: 1.0.0-beta.2(typescript@7.0.2) + version: 1.0.0-beta.3(typescript@7.0.2) '@rslint/core': specifier: 'catalog:' version: 0.8.0 @@ -403,7 +403,7 @@ importers: version: 0.11.6(@rsbuild/core@2.1.11)(@rstest/core@0.11.6) '@rstest/adapter-rslib': specifier: 'catalog:' - version: 0.11.6(@rslib/core@1.0.0-beta.2)(@rstest/core@0.11.6)(typescript@7.0.2) + version: 0.11.6(@rslib/core@1.0.0-beta.3)(@rstest/core@0.11.6)(typescript@7.0.2) '@types/micromatch': specifier: 'catalog:' version: 4.0.10 @@ -1291,6 +1291,16 @@ packages: core-js: optional: true + '@rsbuild/core@2.1.12': + resolution: {integrity: sha512-xRqNHj/svDqeUzXPahmN4BdxEFCU1rxnVdjxyVV7WgsFfH+L3yAoQMJtIXVGhr00IQseDKkc3eonMF3NGrFj2Q==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + core-js: '>= 3.0.0' + peerDependenciesMeta: + core-js: + optional: true + '@rsbuild/plugin-react@2.1.0': resolution: {integrity: sha512-RQTIAWB/CwPjoWt9iAl+8HixeQVgZ7kEIBrWPCixfITyHdiD84h0YpUTpEUuz6kGHw1KXT9mHZ3Rwy6WG7aRDA==} peerDependencies: @@ -1307,8 +1317,8 @@ packages: '@rsbuild/core': optional: true - '@rslib/core@1.0.0-beta.2': - resolution: {integrity: sha512-A0j3MBP8Kga8Qrh7znO2UKf00Sga37PJCiTGUqVVBHb+u58fNoGXZtFAgeH6qKjf5eU1wYt4WptXX/1blOAfRw==} + '@rslib/core@1.0.0-beta.3': + resolution: {integrity: sha512-OtfmaBoGlHo1KYvQ3+B0ZLy3zUsAdoRZfWieaxoJMJ9uKAws2//afFgvUqeSDkkSJDlp8TDdgt4hib+QaFOaGQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -1373,6 +1383,11 @@ packages: cpu: [x64] os: [win32] + '@rspack/binding-darwin-arm64@2.1.10': + resolution: {integrity: sha512-DZlcTpbIb2mjeS1aSG4k01UH33Zj7T+k8ZylPK6HmsKs4JvK4wgpWFC78WVv3p/Aj3MZS6DwtDLwpZ2Ihj/fpg==} + cpu: [arm64] + os: [darwin] + '@rspack/binding-darwin-arm64@2.1.8': resolution: {integrity: sha512-kia+eWtyWPvR4ntg1bWYoVU8nLPbUg2fG3zgBEocsTcsh5ZENSiEPxEKymDgMyIMONUqj611E0775cdUBoNmqw==} cpu: [arm64] @@ -1383,6 +1398,11 @@ packages: cpu: [arm64] os: [darwin] + '@rspack/binding-darwin-x64@2.1.10': + resolution: {integrity: sha512-my/0h2LwxCRT6cg3oDDC2e0ZOxQLVajAdIcv0fqnQk5JRNvVuL89PuTutitnSqie1A0/JSL8OQz5XHwmoS3kow==} + cpu: [x64] + os: [darwin] + '@rspack/binding-darwin-x64@2.1.8': resolution: {integrity: sha512-08pBkFhlD3Y3Qzh94w/Fc3skaIE3e96kl2P14m8+tnYTcglpOfpA2OwS3iHt9fOqy0HjoAVe6/MW3cBgs5iabA==} cpu: [x64] @@ -1393,6 +1413,12 @@ packages: cpu: [x64] os: [darwin] + '@rspack/binding-linux-arm64-gnu@2.1.10': + resolution: {integrity: sha512-laevn9g+E5PAUEGqiKe6Ju5KApsuQYp+bPI17XS3Lkl8eqL5pS/BmHYU7QMlst4GzV8+wlruVTMh//+st6Vqzg==} + cpu: [arm64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-arm64-gnu@2.1.8': resolution: {integrity: sha512-KLniMc9GzhKpVqhPzaJo3KJwzdAllXVVqZIk/uL1QipXOxs57fgM4u7IexKPFVla0o/u1PQG/Ah2YLDmda24Ow==} cpu: [arm64] @@ -1405,6 +1431,12 @@ packages: os: [linux] libc: [glibc] + '@rspack/binding-linux-arm64-musl@2.1.10': + resolution: {integrity: sha512-V71+Qz5G72+ROZXrJn5zxOszdG1AEbO8pcC/itXXtf4yRR6a3bVHKNKGhipBNxb8eI6cnD/01FH1h3ZG655jLw==} + cpu: [arm64] + os: [linux] + libc: [musl] + '@rspack/binding-linux-arm64-musl@2.1.8': resolution: {integrity: sha512-yUKAxHNGnICtw5RnxFWu4dHtsz/tdt7rbeFcsINNVre9HcrRxf5XP+FbOGL/SMxd9oM9XCo10paU2WckTKwbEA==} cpu: [arm64] @@ -1417,12 +1449,24 @@ packages: os: [linux] libc: [musl] + '@rspack/binding-linux-ppc64-gnu@2.1.10': + resolution: {integrity: sha512-U7HlNzHcDtZ+LYOtOJmtx67kHEybZzUUAaP7aEXjGYO5WTCgh/176sW2UYP0rmZLrgUNFUuzn+B98RLaClNaVg==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-ppc64-gnu@2.1.9': resolution: {integrity: sha512-xK90IHipRDgxvDF9n90HRNklci0G2Amk0ZMsM3t3YX+/8jIJNcuEPk6hJ1hlY6KZu7U9enqGbNQ7Fe0StBeLVA==} cpu: [ppc64] os: [linux] libc: [glibc] + '@rspack/binding-linux-riscv64-gnu@2.1.10': + resolution: {integrity: sha512-GMGTJpy9/ecE+5F5IfxZH4bXv0Wx/b2TiehTlCbTksbL+pKpLHYy0rwGdjWDKbmBkhxMMqPiC7PDnn9LbdnnLA==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-riscv64-gnu@2.1.8': resolution: {integrity: sha512-gg4S1jaitwYPHR9HZ3zNGH1EK2GXINm66p4kEpOP1gbc+akyOouVF/dMcu9NGPlRg58FbEhVRZYKu7Z/zcpKHg==} cpu: [riscv64] @@ -1435,6 +1479,12 @@ packages: os: [linux] libc: [glibc] + '@rspack/binding-linux-riscv64-musl@2.1.10': + resolution: {integrity: sha512-rkurnAWc04vIbzG1QCrPBWSJadZvaOt1mazFH3EdiJO8VUiu0I1T9zdiwuDOPrd50lOKIZlcTXbd5aaAkWEnvQ==} + cpu: [riscv64] + os: [linux] + libc: [musl] + '@rspack/binding-linux-riscv64-musl@2.1.8': resolution: {integrity: sha512-b/aU5j1h368SLNyz5u+flqpZVhzSZ1UIslaj9sZJuAvqkGWv3xsjc/28/PTo/RYXCxd0FNVAxTxWHKvRiAAS8w==} cpu: [riscv64] @@ -1447,12 +1497,24 @@ packages: os: [linux] libc: [musl] + '@rspack/binding-linux-s390x-gnu@2.1.10': + resolution: {integrity: sha512-X+DyxkriZEAF/wihI7ERDv+CAS0mbMv36aEuQ+vXzTlvS6cSmpou/r29AHbvIF3NlG1UeAbDVlOs9QrMBZjpUQ==} + cpu: [s390x] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-s390x-gnu@2.1.9': resolution: {integrity: sha512-rGmeME3Pd8k/55txP+19ceZJxhVN2mtC8TLzB1ycTrhy8U+ZnN7J8rZSl89LYrZGYewd1UmOcY0QKKy05FS3FA==} cpu: [s390x] os: [linux] libc: [glibc] + '@rspack/binding-linux-x64-gnu@2.1.10': + resolution: {integrity: sha512-Fat09V6jUuyo9qG7Wyj9cQ31VDfLmokXyBtGqKxY5OvSWHereB7QUub5btbPXHwbp6Iq4aAQyUbbLTzvR1YaBw==} + cpu: [x64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-x64-gnu@2.1.8': resolution: {integrity: sha512-EyegohSx0BJRqieCg9f/caCqFARRWkqI5hwJt6k530MoOTLeq8I3vsbeg24/2MktwIC1dmJi8bl0+WhPKQs4eQ==} cpu: [x64] @@ -1465,6 +1527,12 @@ packages: os: [linux] libc: [glibc] + '@rspack/binding-linux-x64-musl@2.1.10': + resolution: {integrity: sha512-lhHOnIJ4ClpIlA1f1L8aoxEZivYLjnjq5A6jKKz7BKsm+cHK8kqqEm6lO5KqA5xQT0Lonq1o28bmKHEj6JHInw==} + cpu: [x64] + os: [linux] + libc: [musl] + '@rspack/binding-linux-x64-musl@2.1.8': resolution: {integrity: sha512-I6E+goN+UQ297q4r1qdbiAyNCI3t0+a5Y0xDIAPOZfRDRxDTnH/LF8/y65gjsJoKRKyn7zxRC0T/NURTkRNQ9A==} cpu: [x64] @@ -1477,6 +1545,10 @@ packages: os: [linux] libc: [musl] + '@rspack/binding-wasm32-wasi@2.1.10': + resolution: {integrity: sha512-KY5YbWbuvYcoaLXnV+vzZOvGRCeb6jt4EpVpKdph1h1IJjwX/ju15EQ+GOe3iecZEdf0OttQcNVcwBkLkFT9ag==} + cpu: [wasm32] + '@rspack/binding-wasm32-wasi@2.1.8': resolution: {integrity: sha512-om7GAKWAU3lcSvbCon2m7mzw8v9OTrO2LW2MZ1lGe/uVJJmwGGkl9HVoXFyWFLrN6YVFyx8iP+AkN4owDWB9Cw==} cpu: [wasm32] @@ -1485,6 +1557,11 @@ packages: resolution: {integrity: sha512-TF6oZRU23x6vHzGuvRFszvEnmC5Yn8PHbKmeZWsUHj4Mtv4tDdDGVdlxj6Kq3pySS6sRknv8gzpRMhXqHD3I5g==} cpu: [wasm32] + '@rspack/binding-win32-arm64-msvc@2.1.10': + resolution: {integrity: sha512-z4GWzMLofaDGpAt9Z+MlN88LlUBDm+zM6R2GdOOPM6/4g/h3/+47OP7casmSL3AwTGYBEJqogwt08sRSosB6Cg==} + cpu: [arm64] + os: [win32] + '@rspack/binding-win32-arm64-msvc@2.1.8': resolution: {integrity: sha512-WDnsP/SUb9zbxyGX9XjPw5AXrX86u5oidn0MDdfJduOOqdCSpHwmRjlQ8NUJhbBq9WqVJMFlcab7NwZVWX/yyg==} cpu: [arm64] @@ -1495,6 +1572,11 @@ packages: cpu: [arm64] os: [win32] + '@rspack/binding-win32-ia32-msvc@2.1.10': + resolution: {integrity: sha512-7qcWdsZ+GuGtzKjqgy7wTN7Dso/ezIY8yhx1r2yIbcczdmXj4FhaEampMDp/25HwtKwIGBBoh6HHSt3JWxpTUg==} + cpu: [ia32] + os: [win32] + '@rspack/binding-win32-ia32-msvc@2.1.8': resolution: {integrity: sha512-QiMQMPNDiY3dhhaIdaFPzcPDC06cEYkNY89ea+EmDvNVgZq6V+2mFS/WnzZVMeEbGAYJCjsv/ABhhLT1hlYMvg==} cpu: [ia32] @@ -1505,6 +1587,11 @@ packages: cpu: [ia32] os: [win32] + '@rspack/binding-win32-x64-msvc@2.1.10': + resolution: {integrity: sha512-pgp23pLrzfhGnKycxzr7ifP17lAbWZEfnx1bX8gXtYrnpJ66DRNyTKSzxB6sa/HBWjS1L8PX5TjMZ44WfPydqQ==} + cpu: [x64] + os: [win32] + '@rspack/binding-win32-x64-msvc@2.1.8': resolution: {integrity: sha512-b7sA5eB64vo2mbsuc//MOYzVLeCKHPn0dfP/GmNEoHdWbhRgZ/orZLWurYMQj04ELTLW6YCJEy59g5KRzNYHfw==} cpu: [x64] @@ -1515,12 +1602,27 @@ packages: cpu: [x64] os: [win32] + '@rspack/binding@2.1.10': + resolution: {integrity: sha512-vnu/UP5HnrND15lO9+VeG6eUrbTyycHNQNQ3XEiRiFojuoiGZkIZC3Hbzr8qQH44C6vScPODEPvvIVvLcO2LpQ==} + '@rspack/binding@2.1.8': resolution: {integrity: sha512-tmAyHzDbPiy8V7HvQqtuPsbs6dPgwV0YjzW5XrPRV9gzf+Hdm7pvsZJKE1QKO9WV5RuvGYav98xIX6O+abZxzQ==} '@rspack/binding@2.1.9': resolution: {integrity: sha512-0ZZj+RE62/jFRwX5czqjjGiMGgzSK0hm7/66PtCKjyZjb2tNAg3WGyWv+ref7684ZAjtbHHpZ+EOGswQYBjklA==} + '@rspack/core@2.1.10': + resolution: {integrity: sha512-YSS2/Xxz8uiG/KXDkqOoA3dTetNo/vysk7bAexQOrU8iuq7JuzDTTAwLKvWZnwmvME8M8m5wcM4YvfIwYmidHA==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 + '@swc/helpers': ^0.5.23 + peerDependenciesMeta: + '@module-federation/runtime-tools': + optional: true + '@swc/helpers': + optional: true + '@rspack/core@2.1.8': resolution: {integrity: sha512-na1kyA6Mj8/LWw9O3A8NsrG9rNKN3Iq2WiXrEuIwsU5r/Nl/evm3hO7bWKHxgsRyydI6W7okwx3MXgf8rzel6g==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2819,8 +2921,8 @@ packages: remark-stringify@11.0.0: resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} - rsbuild-plugin-dts@1.0.0-beta.2: - resolution: {integrity: sha512-xOYa/kw/y29kKFFNjd+CIemlq+CB8E7LhqNkIzg7HT9dYNBVBpZvnnL6OEsOgjeuqzKpGSCRgZN/dDoVOk4VhQ==} + rsbuild-plugin-dts@1.0.0-beta.3: + resolution: {integrity: sha512-Q8x/yyOsy8sNR8sHn0xuZsul7ErT5kXkTmDwCIxQ8esiMCW7QKjfyXDa4kvTxWn7oSQ5NP/O6qZM2vEA07thKw==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: '@microsoft/api-extractor': ^7 @@ -3879,9 +3981,16 @@ snapshots: transitivePeerDependencies: - '@module-federation/runtime-tools' - '@rsbuild/plugin-react@2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9)': + '@rsbuild/core@2.1.12': + dependencies: + '@rspack/core': 2.1.10(@swc/helpers@0.5.23) + '@swc/helpers': 0.5.23 + transitivePeerDependencies: + - '@module-federation/runtime-tools' + + '@rsbuild/plugin-react@2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.10)': dependencies: - '@rspack/plugin-react-refresh': 2.0.2(@rspack/core@2.1.9)(react-refresh@0.18.0) + '@rspack/plugin-react-refresh': 2.0.2(@rspack/core@2.1.10)(react-refresh@0.18.0) react-refresh: 0.18.0 optionalDependencies: '@rsbuild/core': 2.1.10 @@ -3898,10 +4007,10 @@ snapshots: optionalDependencies: '@rsbuild/core': 2.1.10 - '@rslib/core@1.0.0-beta.2(typescript@7.0.2)': + '@rslib/core@1.0.0-beta.3(typescript@7.0.2)': dependencies: - '@rsbuild/core': 2.1.11 - rsbuild-plugin-dts: 1.0.0-beta.2(@rsbuild/core@2.1.11)(typescript@7.0.2) + '@rsbuild/core': 2.1.12 + rsbuild-plugin-dts: 1.0.0-beta.3(@rsbuild/core@2.1.12)(typescript@7.0.2) optionalDependencies: typescript: 7.0.2 transitivePeerDependencies: @@ -3945,60 +4054,97 @@ snapshots: '@rslint/native-win32-x64-msvc@0.8.0': optional: true + '@rspack/binding-darwin-arm64@2.1.10': + optional: true + '@rspack/binding-darwin-arm64@2.1.8': optional: true '@rspack/binding-darwin-arm64@2.1.9': optional: true + '@rspack/binding-darwin-x64@2.1.10': + optional: true + '@rspack/binding-darwin-x64@2.1.8': optional: true '@rspack/binding-darwin-x64@2.1.9': optional: true + '@rspack/binding-linux-arm64-gnu@2.1.10': + optional: true + '@rspack/binding-linux-arm64-gnu@2.1.8': optional: true '@rspack/binding-linux-arm64-gnu@2.1.9': optional: true + '@rspack/binding-linux-arm64-musl@2.1.10': + optional: true + '@rspack/binding-linux-arm64-musl@2.1.8': optional: true '@rspack/binding-linux-arm64-musl@2.1.9': optional: true + '@rspack/binding-linux-ppc64-gnu@2.1.10': + optional: true + '@rspack/binding-linux-ppc64-gnu@2.1.9': optional: true + '@rspack/binding-linux-riscv64-gnu@2.1.10': + optional: true + '@rspack/binding-linux-riscv64-gnu@2.1.8': optional: true '@rspack/binding-linux-riscv64-gnu@2.1.9': optional: true + '@rspack/binding-linux-riscv64-musl@2.1.10': + optional: true + '@rspack/binding-linux-riscv64-musl@2.1.8': optional: true '@rspack/binding-linux-riscv64-musl@2.1.9': optional: true + '@rspack/binding-linux-s390x-gnu@2.1.10': + optional: true + '@rspack/binding-linux-s390x-gnu@2.1.9': optional: true + '@rspack/binding-linux-x64-gnu@2.1.10': + optional: true + '@rspack/binding-linux-x64-gnu@2.1.8': optional: true '@rspack/binding-linux-x64-gnu@2.1.9': optional: true + '@rspack/binding-linux-x64-musl@2.1.10': + optional: true + '@rspack/binding-linux-x64-musl@2.1.8': optional: true '@rspack/binding-linux-x64-musl@2.1.9': optional: true + '@rspack/binding-wasm32-wasi@2.1.10': + dependencies: + '@emnapi/core': 1.11.3 + '@emnapi/runtime': 1.11.3 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) + optional: true + '@rspack/binding-wasm32-wasi@2.1.8': dependencies: '@emnapi/core': 1.11.3 @@ -4013,24 +4159,50 @@ snapshots: '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) optional: true + '@rspack/binding-win32-arm64-msvc@2.1.10': + optional: true + '@rspack/binding-win32-arm64-msvc@2.1.8': optional: true '@rspack/binding-win32-arm64-msvc@2.1.9': optional: true + '@rspack/binding-win32-ia32-msvc@2.1.10': + optional: true + '@rspack/binding-win32-ia32-msvc@2.1.8': optional: true '@rspack/binding-win32-ia32-msvc@2.1.9': optional: true + '@rspack/binding-win32-x64-msvc@2.1.10': + optional: true + '@rspack/binding-win32-x64-msvc@2.1.8': optional: true '@rspack/binding-win32-x64-msvc@2.1.9': optional: true + '@rspack/binding@2.1.10': + optionalDependencies: + '@rspack/binding-darwin-arm64': 2.1.10 + '@rspack/binding-darwin-x64': 2.1.10 + '@rspack/binding-linux-arm64-gnu': 2.1.10 + '@rspack/binding-linux-arm64-musl': 2.1.10 + '@rspack/binding-linux-ppc64-gnu': 2.1.10 + '@rspack/binding-linux-riscv64-gnu': 2.1.10 + '@rspack/binding-linux-riscv64-musl': 2.1.10 + '@rspack/binding-linux-s390x-gnu': 2.1.10 + '@rspack/binding-linux-x64-gnu': 2.1.10 + '@rspack/binding-linux-x64-musl': 2.1.10 + '@rspack/binding-wasm32-wasi': 2.1.10 + '@rspack/binding-win32-arm64-msvc': 2.1.10 + '@rspack/binding-win32-ia32-msvc': 2.1.10 + '@rspack/binding-win32-x64-msvc': 2.1.10 + '@rspack/binding@2.1.8': optionalDependencies: '@rspack/binding-darwin-arm64': 2.1.8 @@ -4063,6 +4235,12 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 2.1.9 '@rspack/binding-win32-x64-msvc': 2.1.9 + '@rspack/core@2.1.10(@swc/helpers@0.5.23)': + dependencies: + '@rspack/binding': 2.1.10 + optionalDependencies: + '@swc/helpers': 0.5.23 + '@rspack/core@2.1.8(@swc/helpers@0.5.23)': dependencies: '@rspack/binding': 2.1.8 @@ -4075,18 +4253,18 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.23 - '@rspack/plugin-react-refresh@2.0.2(@rspack/core@2.1.9)(react-refresh@0.18.0)': + '@rspack/plugin-react-refresh@2.0.2(@rspack/core@2.1.10)(react-refresh@0.18.0)': dependencies: react-refresh: 0.18.0 optionalDependencies: - '@rspack/core': 2.1.9(@swc/helpers@0.5.23) + '@rspack/core': 2.1.10(@swc/helpers@0.5.23) '@rspress/core@2.0.19(micromark-util-types@2.0.2)(micromark@4.0.2)(supports-color@8.1.1)': dependencies: '@mdx-js/mdx': 3.1.1(supports-color@8.1.1) '@mdx-js/react': 3.1.1(@types/react@19.2.18)(react@19.2.8) '@rsbuild/core': 2.1.10 - '@rsbuild/plugin-react': 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.9) + '@rsbuild/plugin-react': 2.1.0(@rsbuild/core@2.1.10)(@rspack/core@2.1.10) '@rspress/shared': 2.0.19(supports-color@8.1.1) '@shikijs/rehype': 4.3.1 '@types/mdast': 4.0.4 @@ -4139,7 +4317,7 @@ snapshots: '@rspress/shared@2.0.19(supports-color@8.1.1)': dependencies: - '@rsbuild/core': 2.1.10 + '@rsbuild/core': 2.1.11 '@shikijs/rehype': 4.3.1 '@types/react': 19.2.18 mdast-util-mdx-jsx: 3.2.0(supports-color@8.1.1) @@ -4164,9 +4342,9 @@ snapshots: '@rsbuild/core': 2.1.11 '@rstest/core': 0.11.6(happy-dom@20.11.2) - '@rstest/adapter-rslib@0.11.6(@rslib/core@1.0.0-beta.2)(@rstest/core@0.11.6)(typescript@7.0.2)': + '@rstest/adapter-rslib@0.11.6(@rslib/core@1.0.0-beta.3)(@rstest/core@0.11.6)(typescript@7.0.2)': dependencies: - '@rslib/core': 1.0.0-beta.2(typescript@7.0.2) + '@rslib/core': 1.0.0-beta.3(typescript@7.0.2) '@rstest/core': 0.11.6(happy-dom@20.11.2) optionalDependencies: typescript: 7.0.2 @@ -5636,10 +5814,10 @@ snapshots: mdast-util-to-markdown: 2.1.2 unified: 11.0.5 - rsbuild-plugin-dts@1.0.0-beta.2(@rsbuild/core@2.1.11)(typescript@7.0.2): + rsbuild-plugin-dts@1.0.0-beta.3(@rsbuild/core@2.1.12)(typescript@7.0.2): dependencies: '@ast-grep/napi': 0.37.0 - '@rsbuild/core': 2.1.11 + '@rsbuild/core': 2.1.12 optionalDependencies: typescript: 7.0.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 720da26e..8bf766d0 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -16,7 +16,7 @@ catalog: '@rsbuild/core': '~2.1.11' '@rsbuild/plugin-react': '^2.1.0' '@rsbuild/plugin-sass': '^2.0.1' - '@rslib/core': '~1.0.0-beta.2' + '@rslib/core': '~1.0.0-beta.3' '@rslint/core': '~0.8.0' '@rspress/core': '^2.0.19' '@rspress/plugin-client-redirects': '^2.0.19' diff --git a/rstack.config.ts b/rstack.config.ts index d6d1bce2..3e20de09 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -1,9 +1,8 @@ // Rstack configuration guide: https://rstack.rs/config import { define } from 'rstack'; -define.lint(async () => { +define.lint(async ({ js, ts }) => { const { default: globals } = await import('globals'); - const { js, ts } = await import('rstack/lint'); return [ js.configs.recommended, ts.configs.recommendedTypeChecked, diff --git a/website/docs/en/guide/api-reference.mdx b/website/docs/en/guide/api-reference.mdx index 8c61e7fc..dd2eba08 100644 --- a/website/docs/en/guide/api-reference.mdx +++ b/website/docs/en/guide/api-reference.mdx @@ -1,12 +1,12 @@ # API reference -Rstack provides a unified configuration API and re-exports the public APIs of Rsbuild, Rslib, Rstest, and Rslint through dedicated subpaths. Prefer these subpaths to direct imports from each tool's core package so that dependency entry points and tool versions remain aligned with Rstack. +Rstack CLI provides a unified configuration API and re-exports the public APIs of Rsbuild, Rslib, Rstest, and Rslint through dedicated subpaths. Prefer these subpaths to direct imports from each tool's core package so that dependency entry points stay unified and APIs match the tool versions integrated by Rstack CLI. ## Import paths | Import path | Contents | Use case | | ------------------------ | ------------------------------------------------- | --------------------------------------- | -| `rstack` | Rstack configuration API | Register tool configurations | +| `rstack` | Rstack CLI configuration API | Register tool configurations | | `rstack/app` | Public APIs from `@rsbuild/core` | Build applications and extend Rsbuild | | `rstack/lib` | Public APIs from `@rslib/core` | Build libraries and extend Rslib | | `rstack/test` | Public APIs from `@rstest/core` | Write tests and configure test projects | @@ -23,7 +23,7 @@ Import `define` from `rstack` to register tool configurations in `rstack.config. ## Re-exports -The tool-specific subpaths below re-export the public APIs from their corresponding core packages. Using these Rstack entry points keeps dependency entry points and tool versions aligned with the toolchain integrated by Rstack. +The tool-specific subpaths below re-export the public APIs from their corresponding core packages. Using these entry points keeps imports unified and APIs aligned with the tool versions integrated by Rstack CLI. ### `rstack/app` diff --git a/website/docs/en/guide/cli/lint.mdx b/website/docs/en/guide/cli/lint.mdx index 07b15922..e007abb3 100644 --- a/website/docs/en/guide/cli/lint.mdx +++ b/website/docs/en/guide/cli/lint.mdx @@ -29,14 +29,10 @@ rs lint --type-check ## Configuration -Configure linting through [`define.lint()`](../configuration#define-lint) in the [Rstack configuration file](/guide/configuration#configuration-file). It accepts the standard [Rslint configuration](https://rslint.rs/config/). Presets and plugins can be imported from `rstack/lint` on demand: +Configure linting through [`define.lint()`](../configuration#define-lint) in the [Rstack configuration file](/guide/configuration#configuration-file). It accepts the standard [Rslint configuration](https://rslint.rs/config/). A configuration function receives all exports from `rstack/lint`, so presets and plugins do not need to be imported manually: ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); ``` diff --git a/website/docs/en/guide/cli/setup.mdx b/website/docs/en/guide/cli/setup.mdx index e61403d4..2ea8bbe9 100644 --- a/website/docs/en/guide/cli/setup.mdx +++ b/website/docs/en/guide/cli/setup.mdx @@ -99,7 +99,7 @@ Files next to `_` are repository hook scripts. The `_` directory contains genera ## Supported hooks -Rstack supports these client-side Git hooks: +Rstack CLI supports these client-side Git hooks: - `pre-commit` - `pre-merge-commit` @@ -120,7 +120,7 @@ Create a file with the matching name next to the `_` directory. ## Hook runtime -Rstack runs hook scripts with POSIX `sh -e`, forwards Git's arguments and standard input, and returns the hook's exit code. Before running a hook, it changes to the project that installed the hooks and prepends that project's `node_modules/.bin` to `PATH`. +Rstack CLI runs hook scripts with POSIX `sh -e`, forwards Git's arguments and standard input, and returns the hook's exit code. Before running a hook, it changes to the project that installed the hooks and prepends that project's `node_modules/.bin` to `PATH`. ### Disable and debug @@ -130,7 +130,7 @@ Set `RSTACK_HOOKS=0` to skip installation or hook execution: RSTACK_HOOKS=0 git commit -m "Skip hooks" ``` -Set `RSTACK_HOOKS=2` to trace Rstack's hook runtime, including how it invokes the hook script and handles its exit code; to trace commands inside the hook script, add `set -x` to the script: +Set `RSTACK_HOOKS=2` to trace the Rstack CLI hook runtime, including how it invokes the hook script and handles its exit code; to trace commands inside the hook script, add `set -x` to the script: ```bash RSTACK_HOOKS=2 git commit -m "Trace hooks" @@ -138,7 +138,7 @@ RSTACK_HOOKS=2 git commit -m "Trace hooks" ### Configure the hook environment -Before running a hook script, Rstack loads this optional POSIX shell file: +Before running a hook script, Rstack CLI loads this optional POSIX shell file: ```text ${XDG_CONFIG_HOME:-$HOME/.config}/rstack/hooks-init.sh @@ -148,7 +148,7 @@ Use it to initialize a Node.js version manager, update `PATH`, or set `RSTACK_HO ## Monorepo -In a monorepo, the project that provides Rstack may be located in a subdirectory such as `frontend/`. Running `rs setup` from that directory still installs hooks at the Git repository root: +In a monorepo, the project that provides Rstack CLI may be located in a subdirectory such as `frontend/`. Running `rs setup` from that directory still installs hooks at the Git repository root: ```text repo/.rstack/hooks/ @@ -156,7 +156,7 @@ repo/.rstack/hooks/_/ core.hooksPath=.rstack/hooks/_ ``` -Rstack records `frontend` as the project that owns the hooks. Hook scripts remain at the repository root, but run from `frontend`, so they can use its configuration and dependencies without an explicit `cd`: +Rstack CLI records `frontend` as the project that owns the hooks. Hook scripts remain at the repository root, but run from `frontend`, so they can use its configuration and dependencies without an explicit `cd`: ```sh title=".rstack/hooks/pre-commit" rs staged @@ -168,7 +168,7 @@ To change the owner, remove `rs setup` from the previous project's `prepare` scr ## Remove hooks -To remove Rstack-managed hooks: +To remove hooks managed by Rstack CLI: 1. Remove `rs setup` from the `prepare` script. 2. Unset the repository's hooks path: @@ -188,13 +188,13 @@ To remove Rstack-managed hooks: - Rerun `rs setup` to restore generated files and executable permissions. - Check that `RSTACK_HOOKS` is not set to `0` in the environment or initialization file. - If another hooks setup is reported, migrate or remove the conflicting setup before rerunning the command. -- If another Rstack owner is reported, follow the ownership transfer steps in [Monorepo](#monorepo). +- If another project is reported as the hooks owner, follow the ownership transfer steps in [Monorepo](#monorepo). -Hook scripts do not need to be executable because Rstack runs them with `sh`. +Hook scripts do not need to be executable because Rstack CLI runs them with `sh`. ### Command not found -For exit code 127, Rstack prints the effective `PATH`. If a GUI Git client cannot find Node.js or the package manager, initialize them in `hooks-init.sh`. +For exit code 127, Rstack CLI prints the effective `PATH`. If a GUI Git client cannot find Node.js or the package manager, initialize them in `hooks-init.sh`. ### Windows and Yarn diff --git a/website/docs/en/guide/configuration.mdx b/website/docs/en/guide/configuration.mdx index e9db58fe..49d110f6 100644 --- a/website/docs/en/guide/configuration.mdx +++ b/website/docs/en/guide/configuration.mdx @@ -2,7 +2,7 @@ import { PackageManagerTabs } from '@rspress/core/theme'; -Rstack centralizes the configuration for your project's tools in a single file. Define only the configurations your project needs with the `define.*()` APIs. +Rstack CLI centralizes the configuration for your project's tools in a single file. Define only the configurations your project needs with the `define.*()` APIs. ## Configuration file @@ -31,7 +31,7 @@ define.fmt({ The configuration file does not require a default export. Each `define.*()` API can be called at most once; defining the same configuration type more than once throws an error. -By default, Rstack looks for a file with one of the following names: +By default, Rstack CLI looks for a file with one of the following names: - `rstack.config.ts` - `rstack.config.js` @@ -64,7 +64,7 @@ define.app(async () => { ## Configuration APIs -Configuration options follow the formats of the underlying tools. When using APIs and helpers that Rstack re-exports, prefer the `rstack/app`, `rstack/lib`, `rstack/test`, and `rstack/lint` entry points. +Configuration options follow the formats of the underlying tools. When using APIs and helpers that Rstack CLI re-exports, prefer the `rstack/app`, `rstack/lib`, `rstack/test`, and `rstack/lint` entry points. | API | Tool | Commands | | ----------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------- | @@ -121,7 +121,7 @@ define.doc({ }); ``` -`@rspress/core` is an optional dependency of Rstack. Install it in every project that uses the `rs doc` command: +`@rspress/core` is an optional dependency of Rstack CLI. Install it in every project that uses the `rs doc` command: @@ -142,24 +142,20 @@ define.test({ }); ``` -When `extends` is omitted, Rstack automatically connects the test configuration to `define.app()` through the Rsbuild adapter. If no application configuration is defined, it falls back to `define.lib()` through the Rslib adapter. The application configuration takes precedence when both are defined. Set `extends` explicitly to opt out of this automatic inheritance. +When `extends` is omitted, Rstack CLI automatically connects the test configuration to `define.app()` through the Rsbuild adapter. If no application configuration is defined, it falls back to `define.lib()` through the Rslib adapter. The application configuration takes precedence when both are defined. Set `extends` explicitly to opt out of this automatic inheritance. -If the root test configuration does not define `extends` and contains `projects`, Rstack applies automatic inheritance to each inline project that omits its own `extends`. A function-based application or library configuration is resolved once and shared by those projects. String project entries are passed to Rstest unchanged; they load their external configurations independently and do not inherit the current application or library configuration. +If the root test configuration does not define `extends` and contains `projects`, Rstack CLI applies automatic inheritance to each inline project that omits its own `extends`. A function-based application or library configuration is resolved once and shared by those projects. String project entries are passed to Rstest unchanged; they load their external configurations independently and do not inherit the current application or library configuration. > For more guidance on testing, see [Testing](./testing). ### `define.lint()` \{#define-lint} -Defines the [Rslint configuration](https://rslint.rs/config/). Pass the configuration directly, or use an async function to load presets and plugins from `rstack/lint` on demand. +Defines the [Rslint configuration](https://rslint.rs/config/). Pass the configuration directly, or use a synchronous or asynchronous function. The function receives all exports from `rstack/lint`, so presets and plugins do not need to be imported manually. ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); ``` ### `define.fmt()` \{#define-fmt} diff --git a/website/docs/en/guide/formatting.mdx b/website/docs/en/guide/formatting.mdx index 9090f666..c1c3a1ce 100644 --- a/website/docs/en/guide/formatting.mdx +++ b/website/docs/en/guide/formatting.mdx @@ -43,7 +43,7 @@ define.fmt({ }); ``` -In addition to Prettier options and `overrides`, Rstack provides two options: +In addition to Prettier options and `overrides`, Rstack CLI provides two options: - [`ignorePatterns`](#ignore-files): exclude files with Gitignore-compatible patterns. - [`sortPackageJson`](#sort-package-json): sort fields in `package.json` files. The default value is `false`. @@ -196,7 +196,7 @@ You can safely delete `.rstack/cache` to clear cached results. Do not treat the ## Prettier plugins -To add formatting capabilities that are not built into Rstack, install the corresponding [Prettier plugin](https://prettier.io/docs/plugins) and add it to `plugins`. Plugins can be referenced by package name, file path, or URL. Package names and relative paths are resolved from the directory containing the Rstack configuration file. +To add formatting capabilities that are not built into Rstack CLI, install the corresponding [Prettier plugin](https://prettier.io/docs/plugins) and add it to `plugins`. Plugins can be referenced by package name, file path, or URL. Package names and relative paths are resolved from the directory containing the Rstack configuration file. Because `rs fmt` loads plugins in workers, plugin objects cannot be passed directly. Reference each plugin by package name, path, or URL instead. For example, install and enable [`prettier-plugin-tailwindcss`](https://github.com/tailwindlabs/prettier-plugin-tailwindcss): diff --git a/website/docs/en/guide/monorepo.mdx b/website/docs/en/guide/monorepo.mdx index d8b4d501..152b8ddc 100644 --- a/website/docs/en/guide/monorepo.mdx +++ b/website/docs/en/guide/monorepo.mdx @@ -1,18 +1,18 @@ --- -description: 'Configure shared Rstack checks, formatting, staged tasks, and project workflows in a monorepo.' +description: 'Use Rstack CLI to configure shared checks, formatting, staged tasks, and project workflows in a monorepo.' --- # Monorepo This guide explains how to use Rstack CLI in a monorepo, including how it works with task orchestrators such as [Turborepo](https://turborepo.com/docs) and [Nx](https://nx.dev/docs/getting-started/intro). -It covers managing Rstack dependencies, configuring lint, formatting, and staged-file tasks at the root, and defining separate configurations for web applications and libraries. +It covers managing the Rstack CLI dependency, configuring lint, formatting, and staged-file tasks at the root, and defining separate configurations for web applications and libraries. ## Project structure The recommended setup has two levels: -- The root manages the shared Rstack version, lint and formatting rules, and staged-file tasks. +- The root manages the shared Rstack CLI version, lint and formatting rules, and staged-file tasks. - Each application or library has its own [Rstack configuration](./configuration) for build, test, or documentation configuration. ```text @@ -29,13 +29,13 @@ The recommended setup has two levels: └── rstack.config.ts ``` -This structure keeps the Rstack version in one place while keeping build and test configuration close to the project that uses it. +This structure keeps the Rstack CLI version in one place while keeping build and test configuration close to the project that uses it. -## Rstack dependency management +## Rstack CLI dependency management \{#rstack-dependency-management} -Declare Rstack in the root `package.json` so projects use one version by default. See [Quick start](./quick-start#install-rstack) for installation instructions. +Declare the `rstack` package in the root `package.json` so projects use one Rstack CLI version by default. See [Quick start](./quick-start#install-rstack) for installation instructions. -If a project needs a different Rstack version from the root, declare that version as a dependency of the project. +If a project needs a different Rstack CLI version from the root, declare that version as a dependency of the project. Project-specific dependencies, such as Rsbuild plugins and testing libraries, should be declared in the projects that use them. @@ -46,11 +46,7 @@ Use [`define.lint()`](./configuration#define-lint), [`define.fmt()`](./configura ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); define.fmt({ singleQuote: true, @@ -86,27 +82,23 @@ If some projects need different lint rules, use [`files`](https://rslint.rs/conf ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [ - js.configs.recommended, - ts.configs.recommended, - { - files: ['apps/web/**/*.{ts,tsx}'], - rules: { - '@typescript-eslint/no-explicit-any': 'off', - }, +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, + { + files: ['apps/web/**/*.{ts,tsx}'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', }, - ]; -}); + }, +]); ``` ## Project configuration -For each project that uses [Rstack commands](./quick-start#cli-commands), create a [`rstack.config.ts`](./configuration#configuration-file) and register only the configuration that project needs. +For each project that uses [Rstack CLI commands](./quick-start#cli-commands), create a [`rstack.config.ts`](./configuration#configuration-file) and register only the configuration that project needs. -Rstack loads the configuration from the current working directory. It does not merge a project's configuration with the root configuration. +Rstack CLI loads the configuration from the current working directory. It does not merge a project's configuration with the root configuration. ### Web application diff --git a/website/docs/en/guide/quick-start.mdx b/website/docs/en/guide/quick-start.mdx index cadaf016..902be45d 100644 --- a/website/docs/en/guide/quick-start.mdx +++ b/website/docs/en/guide/quick-start.mdx @@ -6,11 +6,11 @@ description: 'Create a Rstack project or add Rstack CLI to an existing project a import { PackageManagerTabs } from '@rspress/core/theme'; -Rstack CLI brings the Rstack toolchain together with one CLI and one configuration file. This guide shows how to create a new Rstack project or add Rstack to an existing project, and introduces the available workflows. +Rstack CLI brings the Rstack toolchain together with one CLI and one configuration file. This guide shows how to create a new Rstack project or add Rstack CLI to an existing project, and introduces the available workflows. ## Environment preparation -Rstack supports using [Node.js](https://nodejs.org/), [Deno](https://deno.com/), or [Bun](https://bun.sh/) as the JavaScript runtime. +Rstack CLI supports using [Node.js](https://nodejs.org/), [Deno](https://deno.com/), or [Bun](https://bun.sh/) as the JavaScript runtime. Use one of the following installation guides to set up a runtime: @@ -20,7 +20,7 @@ Use one of the following installation guides to set up a runtime: :::tip Version requirements -Rstack requires Node.js 22.12.0 or higher when using Node.js as the runtime. +Rstack CLI requires Node.js 22.12.0 or higher when using Node.js as the runtime. ::: @@ -104,7 +104,7 @@ Options: Available templates: app-vanilla, app-vanilla-ts, app-react, app-react-ts, app-preact, app-preact-ts, app-vue, app-vue-ts, app-lit, app-lit-ts, app-svelte, app-svelte-ts, app-solid, app-solid-ts, lib-node, lib-node-ts, lib-react, lib-react-ts, lib-vue, lib-vue-ts, lib-svelte, lib-svelte-ts, lib-solid, lib-solid-ts, doc, doc-i18n ``` -## Install Rstack +## Install Rstack CLI \{#install-rstack} Install [`rstack`](https://www.npmjs.com/package/rstack) as a development dependency in a project that has a `package.json`: @@ -135,7 +135,7 @@ Add the commands your project needs to the `scripts` field in `package.json`. Fo } ``` -Package scripts use the project-local `rs` binary, so Rstack does not need to be installed globally. +Package scripts use the project-local `rs` binary, so Rstack CLI does not need to be installed globally. The following commands are available: @@ -151,7 +151,7 @@ The following commands are available: - [`rs setup`](./cli/setup): Install repository-level Git hooks. - [`rs staged`](./cli/staged): Run tasks against files staged in Git with lint-staged. -## Configure Rstack +## Configure Rstack CLI \{#configure-rstack} Create `rstack.config.ts` in the project root and register the configurations your project needs. The following is a minimal example for an application with testing and linting: diff --git a/website/docs/en/guide/testing.mdx b/website/docs/en/guide/testing.mdx index 39e494bf..aa4a442a 100644 --- a/website/docs/en/guide/testing.mdx +++ b/website/docs/en/guide/testing.mdx @@ -1,6 +1,6 @@ # Testing -Rstack uses [Rstest](https://rstest.rs/) to run tests. +Rstack CLI uses [Rstest](https://rstest.rs/) to run tests. ```bash rs test @@ -44,7 +44,7 @@ define.test({ }); ``` -When `extends` is omitted, Rstack uses the Rsbuild adapter to extend the test configuration from `define.app()`. If no application configuration is defined, it uses the Rslib adapter with `define.lib()` instead. `define.app()` takes precedence when both are defined. +When `extends` is omitted, Rstack CLI uses the Rsbuild adapter to extend the test configuration from `define.app()`. If no application configuration is defined, it uses the Rslib adapter with `define.lib()` instead. `define.app()` takes precedence when both are defined. ## Multiple projects @@ -78,7 +78,7 @@ define.test({ }); ``` -Rstack applies the corresponding adapter to each inline project that omits `extends`. A function-based `define.app()` or `define.lib()` configuration is resolved once, then shared by those inline projects. +Rstack CLI applies the corresponding adapter to each inline project that omits `extends`. A function-based `define.app()` or `define.lib()` configuration is resolved once, then shared by those inline projects. Run one project by name: @@ -100,7 +100,7 @@ define.test({ }); ``` -Rstack passes string entries to Rstest unchanged. External projects load their own configuration and do not inherit the current `define.app()` or `define.lib()` configuration. Use external projects when each project manages its configuration independently. +Rstack CLI passes string entries to Rstest unchanged. External projects load their own configuration and do not inherit the current `define.app()` or `define.lib()` configuration. Use external projects when each project manages its configuration independently. ## Customize inheritance diff --git a/website/docs/zh/guide/api-reference.mdx b/website/docs/zh/guide/api-reference.mdx index 0f7a2dc3..d61ebb1b 100644 --- a/website/docs/zh/guide/api-reference.mdx +++ b/website/docs/zh/guide/api-reference.mdx @@ -1,12 +1,12 @@ # API 参考 \{#api-reference} -Rstack 提供统一的配置 API,并通过专用子路径重导出 Rsbuild、Rslib、Rstest 和 Rslint 的公开 API。建议优先从这些子路径导入,以统一依赖入口,并确保 API 与 Rstack 集成的工具版本保持一致。 +Rstack CLI 提供统一的配置 API,并通过专用子路径重导出 Rsbuild、Rslib、Rstest 和 Rslint 的公开 API。建议优先从这些子路径导入,而不是直接从各工具的 core 包导入,以统一依赖入口,并确保 API 与 Rstack CLI 集成的工具版本匹配。 ## 导入路径 \{#import-paths} | 导入路径 | 内容 | 使用场景 | | ------------------------ | ----------------------------------------- | ------------------------ | -| `rstack` | Rstack 配置 API | 注册各项工具配置 | +| `rstack` | Rstack CLI 配置 API | 注册各项工具配置 | | `rstack/app` | `@rsbuild/core` 的公开 API | 构建应用及扩展 Rsbuild | | `rstack/lib` | `@rslib/core` 的公开 API | 构建库及扩展 Rslib | | `rstack/test` | `@rstest/core` 的公开 API | 编写测试及配置测试项目 | @@ -23,7 +23,7 @@ Rstack 提供统一的配置 API,并通过专用子路径重导出 Rsbuild、R ## 重导出 \{#re-exports} -以下工具子路径均会重导出对应 core 包的公开 API。通过这些 Rstack 入口导入,可以让依赖入口和工具版本与 Rstack 集成的工具链保持一致。 +以下工具子路径均会重导出对应 core 包的公开 API。通过这些入口导入,可以统一依赖入口,并确保 API 与 Rstack CLI 集成的工具版本匹配。 ### `rstack/app` diff --git a/website/docs/zh/guide/cli/lint.mdx b/website/docs/zh/guide/cli/lint.mdx index 658ddb8a..48011c5e 100644 --- a/website/docs/zh/guide/cli/lint.mdx +++ b/website/docs/zh/guide/cli/lint.mdx @@ -29,14 +29,10 @@ rs lint --type-check ## 配置 \{#configuration} -在 [Rstack 配置文件](/guide/configuration#configuration-file)中通过 [`define.lint()`](../configuration#define-lint) 配置代码检查。该 API 支持标准的 [Rslint 配置](https://rslint.rs/config/)。预设和插件可以从 `rstack/lint` 按需导入: +在 [Rstack 配置文件](/guide/configuration#configuration-file)中通过 [`define.lint()`](../configuration#define-lint) 配置代码检查。该 API 支持标准的 [Rslint 配置](https://rslint.rs/config/)。配置函数会接收 `rstack/lint` 的全部导出,因此无需手动导入预设和插件: ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); ``` diff --git a/website/docs/zh/guide/cli/setup.mdx b/website/docs/zh/guide/cli/setup.mdx index 4144e9b6..ea39d804 100644 --- a/website/docs/zh/guide/cli/setup.mdx +++ b/website/docs/zh/guide/cli/setup.mdx @@ -99,7 +99,7 @@ rs setup --help ## 支持的 hooks \{#supported-hooks} -Rstack 支持以下客户端 Git hooks: +Rstack CLI 支持以下客户端 Git hooks: - `pre-commit` - `pre-merge-commit` @@ -120,7 +120,7 @@ Rstack 支持以下客户端 Git hooks: ## Hook 运行时 \{#hook-runtime} -Rstack 使用 POSIX `sh -e` 运行 hook 脚本,并转发 Git 提供的参数和标准输入,同时返回 hook 的退出码。运行 hook 前,Rstack 会切换到安装 hooks 的项目,并将该项目的 `node_modules/.bin` 添加到 `PATH` 开头。 +Rstack CLI 使用 POSIX `sh -e` 运行 hook 脚本,并转发 Git 提供的参数和标准输入,同时返回 hook 的退出码。运行 hook 前,Rstack CLI 会切换到安装 hooks 的项目,并将该项目的 `node_modules/.bin` 添加到 `PATH` 开头。 ### 禁用与调试 \{#disable-and-debug} @@ -130,7 +130,7 @@ Rstack 使用 POSIX `sh -e` 运行 hook 脚本,并转发 Git 提供的参数 RSTACK_HOOKS=0 git commit -m "Skip hooks" ``` -将 `RSTACK_HOOKS` 设为 `2`,可以跟踪 Rstack hook 运行时,包括调用 hook 脚本和处理退出码等步骤;如需跟踪 hook 脚本内部的命令,请在脚本中添加 `set -x`: +将 `RSTACK_HOOKS` 设为 `2`,可以跟踪 Rstack CLI 的 hook 运行时,包括调用 hook 脚本和处理退出码等步骤;如需跟踪 hook 脚本内部的命令,请在脚本中添加 `set -x`: ```bash RSTACK_HOOKS=2 git commit -m "Trace hooks" @@ -138,7 +138,7 @@ RSTACK_HOOKS=2 git commit -m "Trace hooks" ### 配置 hook 运行环境 \{#configure-the-hook-environment} -运行 hook 脚本前,Rstack 会加载以下可选的 POSIX shell 文件: +运行 hook 脚本前,Rstack CLI 会加载以下可选的 POSIX shell 文件: ```text ${XDG_CONFIG_HOME:-$HOME/.config}/rstack/hooks-init.sh @@ -148,7 +148,7 @@ ${XDG_CONFIG_HOME:-$HOME/.config}/rstack/hooks-init.sh ## Monorepo \{#monorepo} -在 monorepo 中,提供 Rstack 的项目可能位于 `frontend/` 等子目录。从该目录运行 `rs setup` 时,hooks 仍会安装到 Git 仓库根目录: +在 monorepo 中,提供 Rstack CLI 的项目可能位于 `frontend/` 等子目录。从该目录运行 `rs setup` 时,hooks 仍会安装到 Git 仓库根目录: ```text repo/.rstack/hooks/ @@ -156,7 +156,7 @@ repo/.rstack/hooks/_/ core.hooksPath=.rstack/hooks/_ ``` -Rstack 会将 `frontend` 记录为负责管理 hooks 的项目。hook 脚本仍位于仓库根目录,但会从 `frontend` 目录运行,因此可以直接使用其中的配置和依赖,无需显式执行 `cd`: +Rstack CLI 会将 `frontend` 记录为负责管理 hooks 的项目。hook 脚本仍位于仓库根目录,但会从 `frontend` 目录运行,因此可以直接使用其中的配置和依赖,无需显式执行 `cd`: ```sh title=".rstack/hooks/pre-commit" rs staged @@ -168,7 +168,7 @@ rs staged ## 移除 hooks \{#remove-hooks} -如需移除由 Rstack 管理的 hooks: +如需移除由 Rstack CLI 管理的 hooks: 1. 从 `prepare` 脚本中移除 `rs setup`。 2. 删除仓库的 hooks 路径配置: @@ -188,13 +188,13 @@ rs staged - 重新运行 `rs setup`,恢复生成文件及其可执行权限。 - 检查环境变量或初始化文件中是否设置了 `RSTACK_HOOKS=0`。 - 如果命令提示存在其他 hooks 配置,请先迁移或移除冲突配置,再重新运行该命令。 -- 如果命令提示存在其他 Rstack owner,请按照 [Monorepo](#monorepo) 中的步骤转移 owner。 +- 如果命令提示其他项目是 hooks owner,请按照 [Monorepo](#monorepo) 中的步骤转移 owner。 -hook 脚本不需要可执行权限,因为 Rstack 会使用 `sh` 运行它。 +hook 脚本不需要可执行权限,因为 Rstack CLI 会使用 `sh` 运行它。 ### 找不到命令 \{#command-not-found} -退出码为 127 时,Rstack 会打印实际生效的 `PATH`。如果 GUI Git 客户端找不到 Node.js 或包管理器,请在 `hooks-init.sh` 中初始化相关环境。 +退出码为 127 时,Rstack CLI 会打印实际生效的 `PATH`。如果 GUI Git 客户端找不到 Node.js 或包管理器,请在 `hooks-init.sh` 中初始化相关环境。 ### Windows 与 Yarn \{#windows-and-yarn} diff --git a/website/docs/zh/guide/configuration.mdx b/website/docs/zh/guide/configuration.mdx index f4cbf631..4f370874 100644 --- a/website/docs/zh/guide/configuration.mdx +++ b/website/docs/zh/guide/configuration.mdx @@ -2,7 +2,7 @@ import { PackageManagerTabs } from '@rspress/core/theme'; -Rstack 将项目所用工具的配置集中到一份文件中。通过 `define.*()` API 定义项目实际需要的配置即可。 +Rstack CLI 将项目所用工具的配置集中到一份文件中。通过 `define.*()` API 定义项目实际需要的配置即可。 ## 配置文件 \{#configuration-file} @@ -31,7 +31,7 @@ define.fmt({ 配置文件无需默认导出。每个 `define.*()` API 最多调用一次;重复定义同一类型的配置会抛出错误。 -Rstack 默认会查找使用以下任一文件名的配置文件: +Rstack CLI 默认会查找使用以下任一文件名的配置文件: - `rstack.config.ts` - `rstack.config.js` @@ -46,7 +46,7 @@ rs build --config ./configs/rstack.config.ts ## 按需加载依赖 \{#loading-dependencies-on-demand} -每次执行 `rs` 命令时,Rstack 都会加载并执行配置文件,然后只解析当前命令需要的配置函数。 +每次执行 `rs` 命令时,Rstack CLI 都会加载并执行配置文件,然后只解析当前命令需要的配置函数。 如果配置需要导入插件或其他工具专属依赖,请使用异步配置函数,并在函数内通过动态 `import()` 加载这些依赖。这样只有解析该配置时才会加载相关依赖。 @@ -64,7 +64,7 @@ define.app(async () => { ## 配置 API \{#configuration-apis} -各 API 沿用底层工具的配置格式。使用 Rstack 已重导出的 API 和辅助函数时,推荐从 `rstack/app`、`rstack/lib`、`rstack/test` 和 `rstack/lint` 入口导入。 +各 API 沿用底层工具的配置格式。使用 Rstack CLI 已重导出的 API 和辅助函数时,推荐从 `rstack/app`、`rstack/lib`、`rstack/test` 和 `rstack/lint` 入口导入。 | API | 底层工具 | 对应命令 | | ----------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------- | @@ -121,7 +121,7 @@ define.doc({ }); ``` -`@rspress/core` 是 Rstack 的可选依赖。每个使用 `rs doc` 命令的项目都需要安装该依赖: +`@rspress/core` 是 Rstack CLI 的可选依赖。每个使用 `rs doc` 命令的项目都需要安装该依赖: @@ -142,24 +142,20 @@ define.test({ }); ``` -未设置 `extends` 时,Rstack 会通过 Rsbuild 适配器让测试配置自动继承 `define.app()`;如果未定义应用配置,则通过 Rslib 适配器回退到 `define.lib()`。二者同时存在时,应用配置的优先级更高。显式设置 `extends` 可关闭自动继承。 +未设置 `extends` 时,Rstack CLI 会通过 Rsbuild 适配器让测试配置自动继承 `define.app()`;如果未定义应用配置,则通过 Rslib 适配器回退到 `define.lib()`。二者同时存在时,应用配置的优先级更高。显式设置 `extends` 可关闭自动继承。 -如果测试根配置未定义 `extends` 且包含 `projects`,Rstack 会为每个未自行设置 `extends` 的内联项目应用自动继承。函数形式的应用或库配置只会解析一次,并由这些项目共享。字符串形式的项目会原样传给 Rstest;它们会独立加载外部配置,不继承当前应用或库的配置。 +如果测试根配置未定义 `extends` 且包含 `projects`,Rstack CLI 会为每个未自行设置 `extends` 的内联项目应用自动继承。函数形式的应用或库配置只会解析一次,并由这些项目共享。字符串形式的项目会原样传给 Rstest;它们会独立加载外部配置,不继承当前应用或库的配置。 > 如需了解更多测试相关用法,请参阅[测试](./testing)。 ### `define.lint()` \{#define-lint} -定义 [Rslint 配置](https://rslint.rs/config/)。可以直接传入配置,也可以使用异步函数,按需从 `rstack/lint` 加载预设和插件。 +定义 [Rslint 配置](https://rslint.rs/config/)。可以直接传入配置,也可以传入同步或异步函数。函数会接收 `rstack/lint` 的全部导出,因此无需手动导入预设和插件。 ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); ``` ### `define.fmt()` \{#define-fmt} diff --git a/website/docs/zh/guide/formatting.mdx b/website/docs/zh/guide/formatting.mdx index 7f2f8b7b..157bd54c 100644 --- a/website/docs/zh/guide/formatting.mdx +++ b/website/docs/zh/guide/formatting.mdx @@ -43,7 +43,7 @@ define.fmt({ }); ``` -除了 Prettier 选项和 `overrides`,Rstack 还提供两个选项: +除了 Prettier 选项和 `overrides`,Rstack CLI 还提供两个选项: - [`ignorePatterns`](#ignore-files):使用兼容 Gitignore 的模式排除文件。 - [`sortPackageJson`](#sort-package-json):对 `package.json` 中的字段排序,默认值为 `false`。 @@ -167,7 +167,7 @@ define.fmt({ ### 合并顺序 \{#merge-order} -如果同一文件匹配多条 override 规则,Rstack 会按声明顺序合并配置,后面的值优先。下面的 `README.md` 会同时匹配两条规则,因此最终的 `printWidth` 为 `80`: +如果同一文件匹配多条 override 规则,Rstack CLI 会按声明顺序合并配置,后面的值优先。下面的 `README.md` 会同时匹配两条规则,因此最终的 `printWidth` 为 `80`: ```ts define.fmt({ @@ -196,7 +196,7 @@ rs fmt --no-cache ## Prettier 插件 \{#prettier-plugins} -如果需要使用 Rstack 未内置的格式化能力,可以安装相应的 [Prettier 插件](https://prettier.io/docs/plugins),并添加到 `plugins` 中。插件支持通过包名、文件路径或 URL 引用,其中包名和相对路径基于 Rstack 配置文件所在的目录解析。 +如果需要使用 Rstack CLI 未内置的格式化能力,可以安装相应的 [Prettier 插件](https://prettier.io/docs/plugins),并添加到 `plugins` 中。插件支持通过包名、文件路径或 URL 引用,其中包名和相对路径基于 Rstack 配置文件所在的目录解析。 由于 `rs fmt` 会在 worker 中加载插件,因此不支持直接传入插件对象。请通过包名、路径或 URL 引用插件。例如,安装并启用 [`prettier-plugin-tailwindcss`](https://github.com/tailwindlabs/prettier-plugin-tailwindcss): diff --git a/website/docs/zh/guide/monorepo.mdx b/website/docs/zh/guide/monorepo.mdx index ea1c5ea6..ae93fee3 100644 --- a/website/docs/zh/guide/monorepo.mdx +++ b/website/docs/zh/guide/monorepo.mdx @@ -1,18 +1,18 @@ --- -description: '在 Monorepo 中配置共享的 Rstack 检查、格式化、暂存文件任务和项目工作流。' +description: '在 Monorepo 中使用 Rstack CLI 配置共享检查、格式化、暂存文件任务和项目工作流。' --- # Monorepo 本指南介绍如何在 Monorepo 中使用 Rstack CLI,以及如何让它与 [Turborepo](https://turborepo.com/docs)、[Nx](https://nx.dev/docs/getting-started/intro) 等任务编排工具协同工作。 -主要内容包括管理 Rstack 依赖、在根目录统一配置代码检查、格式化和暂存文件任务,以及为 Web 应用和库项目定义独立配置。 +主要内容包括管理 Rstack CLI 依赖、在根目录统一配置代码检查、格式化和暂存文件任务,以及为 Web 应用和库项目定义独立配置。 ## 目录结构 \{#project-structure} 推荐使用两层配置: -- 根目录统一管理 Rstack 版本、lint 和格式化规则,以及暂存文件任务。 +- 根目录统一管理 Rstack CLI 版本、lint 和格式化规则,以及暂存文件任务。 - 每个应用或库使用自己的 [Rstack 配置](./configuration),定义构建、测试或文档配置。 ```text @@ -29,13 +29,13 @@ description: '在 Monorepo 中配置共享的 Rstack 检查、格式化、暂存 └── rstack.config.ts ``` -这种结构既能统一 Rstack 版本,也能让构建和测试配置靠近实际使用它们的项目。 +这种结构既能统一 Rstack CLI 版本,也能让构建和测试配置靠近实际使用它们的项目。 -## Rstack 依赖管理 \{#rstack-dependency-management} +## Rstack CLI 依赖管理 \{#rstack-dependency-management} -在根目录的 `package.json` 中声明 Rstack,让各个项目默认使用同一个版本。安装方法请参考[快速上手](./quick-start#install-rstack)。 +在根目录的 `package.json` 中声明 `rstack` 包,让各个项目默认使用同一个 Rstack CLI 版本。安装方法请参考[快速上手](./quick-start#install-rstack)。 -如果子项目需要使用与根目录不同版本的 `rstack`,可以在该项目中单独声明对应版本的 `rstack` 依赖。 +如果子项目需要使用与根目录不同版本的 Rstack CLI,可以在该项目中单独声明对应版本的 `rstack` 依赖。 Rsbuild 插件、测试库等项目专属依赖,建议定义在实际使用它们的子项目中。 @@ -46,11 +46,7 @@ Rsbuild 插件、测试库等项目专属依赖,建议定义在实际使用它 ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]); define.fmt({ singleQuote: true, @@ -86,27 +82,23 @@ define.staged({ ```ts title="rstack.config.ts" import { define } from 'rstack'; -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - - return [ - js.configs.recommended, - ts.configs.recommended, - { - files: ['apps/web/**/*.{ts,tsx}'], - rules: { - '@typescript-eslint/no-explicit-any': 'off', - }, +define.lint(({ js, ts }) => [ + js.configs.recommended, + ts.configs.recommendedTypeChecked, + { + files: ['apps/web/**/*.{ts,tsx}'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', }, - ]; -}); + }, +]); ``` ## 子项目配置 \{#project-configuration} -为每个使用 [Rstack 命令](./quick-start#cli-commands)的子项目创建 [`rstack.config.ts`](./configuration#configuration-file),并且只配置该项目需要的功能。 +为每个使用 [Rstack CLI 命令](./quick-start#cli-commands)的子项目创建 [`rstack.config.ts`](./configuration#configuration-file),并且只配置该项目需要的功能。 -Rstack 会加载当前工作目录中的配置,不会将子项目配置与根配置自动合并。 +Rstack CLI 会加载当前工作目录中的配置,不会将子项目配置与根配置自动合并。 ### Web 应用 \{#web-application} diff --git a/website/docs/zh/guide/quick-start.mdx b/website/docs/zh/guide/quick-start.mdx index 1c6aaa6c..aa7352a7 100644 --- a/website/docs/zh/guide/quick-start.mdx +++ b/website/docs/zh/guide/quick-start.mdx @@ -6,11 +6,11 @@ description: '创建 Rstack 项目,或在现有项目中安装 Rstack CLI 并 import { PackageManagerTabs } from '@rspress/core/theme'; -Rstack CLI 通过统一的命令行和配置文件整合 Rstack 工具链。本指南将介绍如何创建新的 Rstack 项目或在现有项目中添加 Rstack,以及可以使用的工作流。 +Rstack CLI 通过统一的命令行和配置文件整合 Rstack 工具链。本指南将介绍如何创建新的 Rstack 项目或在现有项目中添加 Rstack CLI,以及可以使用的工作流。 ## 环境准备 \{#environment-preparation} -Rstack 支持使用 [Node.js](https://nodejs.org/)、[Deno](https://deno.com/) 或 [Bun](https://bun.sh/) 作为 JavaScript 运行时。 +Rstack CLI 支持使用 [Node.js](https://nodejs.org/)、[Deno](https://deno.com/) 或 [Bun](https://bun.sh/) 作为 JavaScript 运行时。 参考以下安装指南,选择一种运行时: @@ -20,7 +20,7 @@ Rstack 支持使用 [Node.js](https://nodejs.org/)、[Deno](https://deno.com/) :::tip 版本要求 -使用 Node.js 作为运行时时,Rstack 要求 Node.js 版本为 22.12.0 或更高版本。 +使用 Node.js 作为运行时时,Rstack CLI 要求 Node.js 版本为 22.12.0 或更高版本。 ::: @@ -104,7 +104,7 @@ Options: Available templates: app-vanilla, app-vanilla-ts, app-react, app-react-ts, app-preact, app-preact-ts, app-vue, app-vue-ts, app-lit, app-lit-ts, app-svelte, app-svelte-ts, app-solid, app-solid-ts, lib-node, lib-node-ts, lib-react, lib-react-ts, lib-vue, lib-vue-ts, lib-svelte, lib-svelte-ts, lib-solid, lib-solid-ts, doc, doc-i18n ``` -## 安装 Rstack \{#install-rstack} +## 安装 Rstack CLI \{#install-rstack} 在已有 `package.json` 的项目中,将 [`rstack`](https://www.npmjs.com/package/rstack) 安装为开发依赖: @@ -135,9 +135,9 @@ Available templates: app-vanilla, app-vanilla-ts, app-react, app-react-ts, app-p } ``` -package scripts 会使用项目本地安装的 `rs` 命令,因此无需全局安装 Rstack。 +package scripts 会使用项目本地安装的 `rs` 命令,因此无需全局安装 Rstack CLI。 -Rstack 提供以下命令: +Rstack CLI 提供以下命令: - [`rs dev`](./cli/dev):启动应用开发服务器。 - [`rs build`](./cli/build):构建应用的生产版本。 @@ -151,7 +151,7 @@ Rstack 提供以下命令: - [`rs setup`](./cli/setup):安装仓库级 Git hooks。 - [`rs staged`](./cli/staged):使用 lint-staged 对 Git 暂存区中的文件运行任务。 -## 配置 Rstack \{#configure-rstack} +## 配置 Rstack CLI \{#configure-rstack} 在项目根目录创建 `rstack.config.ts`,并注册项目所需的配置。以下是一个包含应用、测试和代码检查的最小示例: diff --git a/website/docs/zh/guide/testing.mdx b/website/docs/zh/guide/testing.mdx index ed89dc71..9c629635 100644 --- a/website/docs/zh/guide/testing.mdx +++ b/website/docs/zh/guide/testing.mdx @@ -1,6 +1,6 @@ # 测试 \{#testing} -Rstack 使用 [Rstest](https://rstest.rs/zh/) 运行测试。 +Rstack CLI 使用 [Rstest](https://rstest.rs/zh/) 运行测试。 ```bash rs test @@ -44,7 +44,7 @@ define.test({ }); ``` -未设置 `extends` 时,Rstack 会通过 Rsbuild 适配器让测试配置继承 `define.app()`。如果没有应用配置,则通过 Rslib 适配器回退到 `define.lib()`。同时定义两者时,`define.app()` 的优先级更高。 +未设置 `extends` 时,Rstack CLI 会通过 Rsbuild 适配器让测试配置继承 `define.app()`。如果没有应用配置,则通过 Rslib 适配器回退到 `define.lib()`。同时定义两者时,`define.app()` 的优先级更高。 ## 多项目 \{#multiple-projects} @@ -78,7 +78,7 @@ define.test({ }); ``` -Rstack 会将对应的适配器应用到每个未设置 `extends` 的内联项目。函数形式的 `define.app()` 或 `define.lib()` 配置只会解析一次,再由这些内联项目共享。 +Rstack CLI 会将对应的适配器应用到每个未设置 `extends` 的内联项目。函数形式的 `define.app()` 或 `define.lib()` 配置只会解析一次,再由这些内联项目共享。 按项目名称运行单个项目: @@ -100,7 +100,7 @@ define.test({ }); ``` -Rstack 会将字符串形式的项目原样传给 Rstest。外部项目会加载自己的配置,不会继承当前的 `define.app()` 或 `define.lib()` 配置。每个项目需要独立管理配置时,请使用外部项目。 +Rstack CLI 会将字符串形式的项目原样传给 Rstest。外部项目会加载自己的配置,不会继承当前的 `define.app()` 或 `define.lib()` 配置。每个项目需要独立管理配置时,请使用外部项目。 ## 自定义继承 \{#customize-inheritance} diff --git a/website/rstack.config.ts b/website/rstack.config.ts index 79821ca1..338cad02 100644 --- a/website/rstack.config.ts +++ b/website/rstack.config.ts @@ -21,7 +21,7 @@ define.doc(async () => { return { root: path.join(import.meta.dirname, 'docs'), title, - icon: 'https://assets.rspack.rs/rspack/favicon-128x128.png', + icon: 'https://assets.rspack.rs/rspack/rspack-claw-logo.svg', logoText: title, description, lang: 'en', @@ -57,6 +57,20 @@ define.doc(async () => { pluginFontOpenSans(), pluginSitemap({ siteUrl }), ], + locales: [ + { + lang: 'en', + label: 'English', + title, + description, + }, + { + lang: 'zh', + label: '简体中文', + title, + description: descriptionZh, + }, + ], themeConfig: { llmsUI: { injectLlmsHint, @@ -76,20 +90,6 @@ define.doc(async () => { editLink: { docRepoBaseUrl: 'https://github.com/rstackjs/rstack-cli/tree/main/website/docs', }, - locales: [ - { - lang: 'en', - label: 'English', - title, - description, - }, - { - lang: 'zh', - label: '简体中文', - title, - description: descriptionZh, - }, - ], }, builderConfig: { plugins: [ diff --git a/website/theme/index.scss b/website/theme/index.scss index 4de65755..e9b4f959 100644 --- a/website/theme/index.scss +++ b/website/theme/index.scss @@ -1,11 +1,5 @@ :root { - --rp-c-brand: #ff5e00; - --rp-c-brand-dark: var(--rp-c-brand); - --rp-c-brand-darker: #ff704d; - --rp-c-brand-light: #ff7524; - --rp-c-brand-lighter: #ff7524; - --rp-c-link: var(--rp-c-brand); - --rp-c-brand-tint: rgba(255, 94, 0, 0.07); + --rp-c-text-code: var(--rp-c-text-1); } .dark { @@ -18,3 +12,31 @@ width: 10vw !important; } } + +.rp-doc { + .rp-link, + .rp-link code { + color: inherit; + text-decoration-line: underline; + text-underline-offset: 2px; + text-decoration-color: rgba(0, 0, 0, 0.25); + + &:hover { + opacity: 1; + text-decoration-color: currentColor; + border-bottom: none !important; + } + } +} + +.dark { + .rp-doc { + .rp-link { + text-decoration-color: rgba(255, 255, 255, 0.5); + + &:hover { + text-decoration-color: currentColor; + } + } + } +}