Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/create-rstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions packages/create-rstack/template-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-doc-i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-node-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-react-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-solid-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-solid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-svelte-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-svelte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-vue-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/create-rstack/template-lib-vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 3 additions & 3 deletions website/docs/en/guide/api-reference.mdx
Original file line number Diff line number Diff line change
@@ -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 |
Expand All @@ -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`

Expand Down
20 changes: 10 additions & 10 deletions website/docs/en/guide/cli/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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

Expand All @@ -130,15 +130,15 @@ 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"
```

### 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
Expand All @@ -148,15 +148,15 @@ 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/
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
Expand All @@ -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:
Expand All @@ -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

Expand Down
12 changes: 6 additions & 6 deletions website/docs/en/guide/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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 |
| ----------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -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:

<PackageManagerTabs command="install -D @rspress/core" />

Expand All @@ -142,9 +142,9 @@ 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).

Expand Down
4 changes: 2 additions & 2 deletions website/docs/en/guide/formatting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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):

Expand Down
18 changes: 9 additions & 9 deletions website/docs/en/guide/monorepo.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -104,9 +104,9 @@ define.lint(async () => {

## 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

Expand Down
12 changes: 6 additions & 6 deletions website/docs/en/guide/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.

:::

Expand Down Expand Up @@ -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`:

Expand Down Expand Up @@ -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:

Expand All @@ -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:

Expand Down
Loading