Skip to content

chore: migrate to Rstack CLI - #84

Merged
chenjiahan merged 1 commit into
mainfrom
chore/migrate-to-rstack-cli
Sep 1, 2026
Merged

chenjiahan merged 1 commit into
mainfrom
chore/migrate-to-rstack-cli

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

Migrates the toolchain to Rstack CLI — the unified rstack package and rs commands. Four standalone configs collapse into one rstack.config.ts, and five dev dependencies collapse into one.

Follows the same approach already used in rsbuild-plugin-type-check, with scripts matching rsbuild-plugin-template.

Changes

  • Config consolidated into rstack.config.ts via define.lib / define.test / define.fmt / define.staged / define.lint, replacing rslib.config.ts, rslint.config.ts, rstest.config.ts, .prettierrc and .prettierignore. Existing behavior is preserved, including output.target: 'node' and the globals.browser / globals.rstest lint overrides (now provided by the define.lint factory, so the globals import is gone).
  • Dependencies: @rslib/core, @rslint/core, @rstest/core, prettier and simple-git-hooks replaced by a single rstack dev dependency. They remain available as transitive rstack dependencies.
  • Scripts: rs lib, rs lib -w, rs test, rs lint, rs fmt, plus a new check script (rs check = rs lint && rs fmt --check).
  • Git hooks: simple-git-hooks replaced by rs hooks, with rs staged in .rstack/hooks/pre-commit. The corresponding pnpm allowBuilds entry is dropped.
  • Playground: ported to define.app in playground/rstack.config.ts, with rs build / rs dev scripts.
  • VS Code: recommends the unified rstack.rstack extension instead of rstack.rslint + esbenp.prettier-vscode.

Verification

Check Result
pnpm build (rs lib) esm + cjs + dts built
pnpm run check Lint 0 errors, formatting clean
pnpm run test (rs test) 4/4 passing
pnpm dev (rs lib -w) watch rebuild works
playground rs build / rs dev HTTPS 200, self-signed cert served
pre-commit hook rs staged ran lint + fmt, exit 0
pnpm install --frozen-lockfile passes, no peer warnings

Build output is byte-identical to before the migration — dist/index.js, dist/index.cjs, dist/index.d.ts and dist/util.d.ts all match the pre-migration baseline exactly, so published consumers see no change. Lint and tests hold their pre-migration baseline (0 errors, 4/4).

Notes for reviewers

  • package.json field order changed slightly (repository now after bugs) because define.fmt enables sortPackageJson. Cosmetic only.
  • Playground imports ../dist/index.js rather than ../src. Rstack loads configs as native ESM, which cannot resolve this package's TypeScript ./util.js import convention from source. Switching source to ./util.ts fixed loading but broke declaration generation, and would have required loosening the published tsconfig.json, so the playground uses the built output instead — which also exercises the real published entry point. src/ is unchanged.
  • prepare may warn Git hooks setup skipped for anyone with an existing core.hooksPath (e.g. a global hook manager). Hooks still run through that path; making Rstack the owner needs a one-time rs hooks --force, intentionally not done here.
  • .agents/skills/rstack-cli-docs/ is added as a version-matched docs Skill for coding agents, mirroring rsbuild-plugin-type-check.

Migrate the toolchain to the unified `rstack` package and `rs` commands.

- Consolidate rslib/rslint/rstest/prettier/staged config into `rstack.config.ts`
- Replace `@rslib/core`, `@rslint/core`, `@rstest/core`, `prettier` and
  `simple-git-hooks` with a single `rstack` dev dependency
- Migrate scripts to `rs lib`, `rs test`, `rs lint`, `rs check` and `rs fmt`,
  and switch Git hooks to `rs hooks` with `rs staged` in `.rstack/hooks/pre-commit`
- Port the playground to `define.app` in `playground/rstack.config.ts`
- Recommend the unified `rstack.rstack` VS Code extension

Build output is byte-identical to before the migration, and lint and tests
keep their pre-migration baseline.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chenjiahan
chenjiahan merged commit 33c6d83 into main Sep 1, 2026
5 checks passed
@chenjiahan
chenjiahan deleted the chore/migrate-to-rstack-cli branch September 1, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant