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
25 changes: 25 additions & 0 deletions .agents/skills/rstack-cli-docs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: rstack-cli-docs
description: Consult installed, version-matched Rstack docs only for user-facing `rs` command behavior, `rstack.config.*` semantics, or public `rstack` APIs. Do not use for purely internal implementation, tests, performance, or repository maintenance.
---

# Rstack CLI docs

Rstack CLI is the `rstack` package, exposed through the `rs` binaries. It provides one CLI, one
config file, and a consistent workflow for the Rstack JavaScript toolchain.

It covers web app, library, docs, test, lint, formatting, Git hook, and staged-file workflows.

## Read installed docs when this skill applies

When this skill applies, find and read the relevant Markdown documentation shipped with the installed `rstack` package.

Model knowledge can be outdated; the installed documentation is the source of truth for the project's Rstack version.

1. Start with `node_modules/rstack/docs/llms.txt`, then read only the linked pages relevant to the task before proposing or making changes.

2. For exact CLI flags and behavior, also run `rs -h` or `rs <command> -h` when supported.

If the bundled docs are not available at that path, locate the installed `rstack` package.

If they are still unavailable, verify that `rstack` is installed, and use CLI help plus the online [Rstack documentation](https://rstack.rs/) as a fallback.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
with:
run_install: true

- name: Run lint
run: pnpm lint

- name: Build Packages
run: pnpm build

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint

on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: 24.19.0
package-manager-cache: false

- name: Install Pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
run_install: true

- name: Run Check
run: node --run check
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions .rstack/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rs staged
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["rstack.rslint"]
"recommendations": ["rstack.rstack"]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"search.useIgnoreFiles": true,
"editor.defaultFormatter": "rstack.rstack"
}
22 changes: 14 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
# Repository Guidelines

## Project Structure & Module Organization

- `src/` hosts all TypeScript sources (`index.ts`, `prebundle.ts`, helpers, shared `types.ts`); export public symbols through `src/index.ts`.
- `dist/` holds `rslib` output and must stay generated-only, while `compiled/` stores bundled dependencies produced by the CLI; never edit either manually.
- `bin.js` is the CAC-based CLI entry; root configs (`prebundle.config.ts`, `rslib.config.ts`, `tsconfig.json`) govern build targets and should evolve together.
- `tests/` contains `@rstest/core` suites plus fixture configs under `tests/fixtures/` used to exercise the CLI.
- `dist/` holds `rs lib` output and must stay generated-only, while `compiled/` stores bundled dependencies produced by the CLI; never edit either manually.
- `bin.js` is the CAC-based CLI entry; root configs (`prebundle.config.ts`, `rstack.config.ts`, `tsconfig.json`) govern build targets and should evolve together.
- `tests/` contains `rstack/test` suites plus fixture configs under `tests/fixtures/` used to exercise the CLI.

## Build, Test, and Development Commands

- `pnpm install` respects `pnpm-lock.yaml`; mixing package managers is forbidden to avoid dependency drift.
- `pnpm dev` runs `rslib -w` for tight feedback while hacking on `src/`.
- `pnpm build` generates production artifacts and doubles as a pre-publish smoke test; run it before every PR or release.
- `pnpm test` triggers `pnpm build && rstest`, which runs the CLI integration suite.
- `pnpm dev` runs `rs lib -w` for tight feedback while hacking on `src/`.
- `pnpm build` runs `rs lib` to generate production artifacts and doubles as a pre-publish smoke test; run it before every PR or release.
- `pnpm check` runs Rstack lint and formatting checks; `pnpm format` writes formatting changes.
- `pnpm test` runs the Rstack CLI test command and executes the CLI integration suite.
- `pnpm prebundle [pkg1 pkg2 ...] --config path/to/config` executes the CLI for all configured dependencies or a filtered subset; use `--config` to point at custom fixtures.
- `pnpm bump` wraps `npx bumpp` for releases; only call after `dist/` and configs are committed.

## Coding Style & Naming Conventions

- The repo is pure ESM (`type: module`), so keep relative imports with explicit `.js` extensions that mirror emitted files.
- Apply `Prettier` defaults (2-space indent, single quotes, trailing commas) before committing; configure your editor to format on save.
- Apply the Rstack formatter defaults (2-space indent, single quotes, trailing commas) with `pnpm format` before committing; configure your editor to format on save.
- Prefer `camelCase` for functions, `PascalCase` for types/interfaces, and SCREAMING_SNAKE_CASE for constants stored in `constant.ts`.
- Keep modules focused; common utilities belong in `helper.ts`, and shared configuration goes through `src/types.ts` for better type inference.

## Testing Guidelines
- Automated coverage uses `@rstest/core` in `tests/prebundle.test.ts` to snapshot bundled output and execute the emitted modules; add new cases there or create additional suites under `tests/`.

- Automated coverage uses `rstack/test` in `tests/prebundle.test.ts` to verify bundled output and execute the emitted modules; add new cases there or create additional suites under `tests/`.
- Prefer end-to-end checks that run `bin.js --config <fixture>` so the CLI path stays covered across platforms.
- When adding manual validation steps (e.g., testing new dependencies), document the exact `pnpm prebundle ...` invocation and observed artifacts in the PR description.

## Commit & Pull Request Guidelines

- Follow Conventional Commits mirroring existing history (`feat:`, `fix(deps):`, `chore:`); add scopes like `feat(cli):` when touching a specific module.
- Each PR should describe the motivation, list the commands you ran (`pnpm build`, `pnpm prebundle commander`, etc.), and reference related issues.
- Separate mechanical refactors from behavior changes to keep diffs reviewable, and ensure CI or manual checks are linked before requesting review.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
"compiled"
],
"scripts": {
"build": "rslib",
"dev": "rslib -w",
"lint": "rslint",
"lint:write": "rslint --fix",
"prebundle": "node ./bin.js",
"build": "rs lib",
"bump": "npx bumpp",
"test": "rstest"
"check": "rs check",
"dev": "rs lib -w",
"format": "rs fmt",
"lint": "rs lint",
"prebundle": "node ./bin.js",
"prepare": "rs hooks",
"test": "rs test"
},
"dependencies": {
"@vercel/ncc": "0.45.0",
Expand All @@ -34,16 +36,14 @@
},
"devDependencies": {
"@astrojs/sitemap": "^3.7.3",
"@rslib/core": "0.23.2",
"@rslint/core": "^0.9.0",
"@rstackjs/test-utils": "^0.2.0",
"@rstest/core": "^0.11.11",
"@types/fs-extra": "^11.0.4",
"@types/node": "24.13.3",
"chalk": "^6.0.0",
"fast-glob": "^3.3.3",
"fs-extra": "^11.4.0",
"rslog": "^2.3.0",
"rstack": "^0.7.1",
"typescript": "^6.0.3"
},
"packageManager": "pnpm@11.24.0",
Expand Down
Loading