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.
11 changes: 1 addition & 10 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,9 @@ runs:
NPM_PREFIX=$(cygpath -u "$(npm config get prefix)")
export PATH="$NPM_PREFIX:$PATH"
fi
PNPM_VERSION=$(node -p "require('./package.json').packageManager.replace('pnpm@', '')")
npm install -g corepack@0.31.0 --force
echo "Corepack version: $(corepack --version)"
if [[ "${{ inputs.node-version }}" == 20* ]]; then
# Node 20's bundled module loader crashes when invoking pnpm 11 via the
# corepack shim (ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING). Enable only the
# yarn shim from corepack and install pnpm as a standalone binary.
corepack enable yarn
npm install -g "@pnpm/exe@$PNPM_VERSION" --force
else
corepack enable
fi
corepack enable
pnpm --version

- name: yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
components: rustfmt
cache: false
- run: cargo fmt --all -- --check
- run: pnpm run prettier:ci
- run: pnpm run check
- run: pnpm exec taplo format --check

lint:
Expand Down Expand Up @@ -196,8 +196,8 @@ jobs:
- ubuntu-latest
- macos-14
node:
- 20
- 22
- 24
Comment thread
chenjiahan marked this conversation as resolved.
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: 1
Expand Down
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

32 changes: 0 additions & 32 deletions .prettierrc.js

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
Comment thread
chenjiahan marked this conversation as resolved.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"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"
}
9 changes: 0 additions & 9 deletions lint-staged.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion napi/__test__/resolver.test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dirname, join, normalize } from "node:path";
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";

let ResolverFactory;

Expand Down
2 changes: 1 addition & 1 deletion napi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @ts-nocheck
/* auto-generated by NAPI-RS */

const { readFileSync } = require('node:fs')
const { readFileSync } = require('node:fs');
let nativeBinding = null;
const loadErrors = [];

Expand Down
2 changes: 1 addition & 1 deletion napi/resolver.wasi.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/* auto-generated by NAPI-RS */

const __nodeFs = require('node:fs')
const __nodeFs = require('node:fs');
const __nodePath = require("node:path");
const { WASI: __nodeWASI } = require("node:wasi");
const { Worker } = require("node:worker_threads");
Expand Down
2 changes: 1 addition & 1 deletion napi/tests/browserField.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/exportsField.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/extension-alias.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/extensions.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/importsField.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/incorrect-description-file.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/options.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/resolve.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/restrictions.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/roots.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/scoped-packages.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
2 changes: 1 addition & 1 deletion napi/tests/tsconfig-paths.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@rstest/core";
import { describe, it, expect } from "rstack/test";
import { ResolverFactory } from "../index.js";
import * as path from "node:path";

Expand Down
18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
"build:binding:profiling": "napi build --platform --profile profiling --package-json-path npm/package.json --manifest-path napi/Cargo.toml",
"build:binding:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml",
"prepublishOnly": "napi pre-publish -t npm --package-json-path npm/package.json --npm-dir bindings",
"test": "pnpm run test:resolver && pnpm run test:enhanced-resolve-compatible",
"test:resolver": "rstest run -c rstest.config.resolver.mjs",
"test:enhanced-resolve-compatible": "rstest run -c rstest.config.mjs",
"test": "rs test",
"test:resolver": "rs test run --project resolver",
"test:enhanced-resolve-compatible": "rs test run --project enhanced-resolve-compatible",
"postbuild": "npm run format",
"prettier": "prettier --check .",
"prettier:ci": "prettier --list-different .",
"format": "prettier --write .",
"prepare": "husky",
"check": "rs fmt --check",
"format": "rs fmt",
"prepare": "rs hooks",
"setup:fixtures": "cd fixtures/pnp && yarn && cd ../pnp-global-cache-enabled && yarn"
},
"devDependencies": {
"@actions/core": "^3.0.1",
"@rstest/core": "^0.10.3",
"@emnapi/core": "1.10.0",
"@emnapi/runtime": "1.10.0",
"@napi-rs/cli": "3.6.2",
Expand All @@ -30,9 +28,7 @@
"commander": "^14.0.3",
"emnapi": "1.10.0",
"enhanced-resolve": "^5.23.0",
"husky": "^9.1.7",
"lint-staged": "^17.0.7",
"prettier": "^3.8.4",
"rstack": "^0.7.2",
"semver": "^7.7.1",
"typescript": "^6.0.3",
"zx": "^8.8.5"
Expand Down
Loading
Loading