Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,21 @@ npx giget gh:rstackjs/rstack-examples/rspack/basic my-app
# Enter the my-app example directory
cd my-app

# Download the Rstack dependency catalogs used by the example
curl -fsSL https://raw.githubusercontent.com/rstackjs/rstack-examples/main/pnpm-workspace.yaml -o pnpm-workspace.yaml

# Install the dependencies
pnpm i
```

The second argument is the output directory. Pass it explicitly so the example is
created with a clear local folder name.

Examples use pnpm catalogs, so keep the downloaded `pnpm-workspace.yaml` next to
`package.json` when using an example outside this repository. Download both from
the same branch or revision. Use the Node.js version in [`.nvmrc`](./.nvmrc) and
the pnpm version in [`package.json`](./package.json).

You can clone any other example by replacing the path and output directory:

```bash
Expand All @@ -62,7 +70,7 @@ git clone [email protected]:rstackjs/rstack-examples.git
cd rsbuild/react
```

3. Install the dependencies using `pnpm` or other package manager, then start the project:
3. Install the dependencies using `pnpm`, then start the project:

```bash
# Use corepack to enable pnpm
Expand All @@ -72,3 +80,23 @@ pnpm run dev
```

4. You can fork the current project or copy the code from the current project to use it.

### Manage dependency versions

Rstack product and official plugin versions are centralized in
[`pnpm-workspace.yaml`](./pnpm-workspace.yaml) for shared upgrades. Catalogs cover
`@rspack/*`, `@rsbuild/*`, `@rslib/*`, `@rspress/*`, `@rstest/*`, `@rsdoctor/*`,
and these packages maintained by [rstackjs](https://github.com/rstackjs):
`rstack`, `eslint-rspack-plugin`, `rspack-manifest-plugin`, `rspack-vue-loader`,
`ts-checker-rspack-plugin`, `worker-rspack-loader`, `storybook-addon-rslib`,
`storybook-react-rsbuild`, and `storybook-vue3-rsbuild`.

Most Rstack dependencies use `catalog:`. The `alternate` catalog preserves existing
range or version differences, and `rsbuild-tilde` preserves the third `@rsbuild/core`
range. Edit the relevant catalog entry and run `pnpm install` to update the lockfile.
The existing `pnpm bump` command also understands catalogs through Taze and keeps
its configured package filter.

Other dependencies, including React, Vue, TypeScript, SWC, and Module Federation,
keep their versions in each example's `package.json`. Peer dependency ranges,
local `workspace:` links, and npm aliases also remain there.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"cross-env": "10.1.0",
"rstack": "^0.8.3",
"rstack": "catalog:",
"taze": "^21.3.0"
},
"packageManager": "[email protected]"
Expand Down
Loading
Loading