Skip to content
Open
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 .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": true,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
64 changes: 36 additions & 28 deletions .github/workflows/test-Windows.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,58 @@
name: Test (Windows)

concurrency:
group: windows-test-${{ github.head_ref }}
cancel-in-progress: true

on:
pull_request:
branches: [main]

merge_group:

workflow_dispatch:

permissions: {}

concurrency:
group: test-windows-${{ github.ref }}
cancel-in-progress: true

jobs:
test-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [22.x]
os: [windows-latest]
runs-on: windows-latest
timeout-minutes: 30
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1

- name: Install Pnpm
run: |
npm install -g corepack@latest --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.18.0
package-manager-cache: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
run_install: false

- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Build packages
run: pnpm build

- name: Lint
run: pnpm lint

- name: Install Dependencies
run: pnpm install
- name: Build docs
run: pnpm docs:build

- name: Build Docs
run: pnpm run docs:build
- name: Unit test
run: pnpm test

- name: Unit Test
run: pnpm run test
- name: Install Playwright
run: pnpm exec playwright install --with-deps chromium

- name: E2E Test
run: pnpm playwright install --with-deps chromium && pnpm run e2e
- name: E2E test
run: pnpm e2e
64 changes: 36 additions & 28 deletions .github/workflows/test-macOS.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,58 @@
name: Test (macOS)

concurrency:
group: macos-test-${{ github.head_ref }}
cancel-in-progress: true

on:
pull_request:
branches: [main]

merge_group:

workflow_dispatch:

permissions: {}

concurrency:
group: test-macos-${{ github.ref }}
cancel-in-progress: true

jobs:
test-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [22.x]
os: [macos-14] # M1 Mac
runs-on: macos-14
timeout-minutes: 30
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1

- name: Install Pnpm
run: |
npm install -g corepack@latest --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.18.0
package-manager-cache: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
run_install: false

- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Build packages
run: pnpm build

- name: Lint
run: pnpm lint

- name: Install Dependencies
run: pnpm install
- name: Build docs
run: pnpm docs:build

- name: Build Docs
run: pnpm run docs:build
- name: Unit test
run: pnpm test

- name: Unit Test
run: pnpm run test
- name: Install Playwright
run: pnpm exec playwright install --with-deps chromium

- name: E2E Test
run: pnpm playwright install --with-deps chromium && pnpm run e2e
- name: E2E test
run: pnpm e2e
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# dependencies
node_modules/
.rslib/
**/.rslib/
# production
.docusaurus/
build/
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.18.0
4 changes: 1 addition & 3 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
shamefully-hoist=false
enable-pre-post-scripts=true
registry=https://registry.npmjs.org/
registry=https://registry.npmjs.org/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ build
coverage
playwright-report
test-results
.rslib
**/.rslib
pnpm-lock.yaml
19 changes: 11 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,35 @@

## Stack

- Node.js via the repository CI matrix
- `pnpm` workspace with packages under `packages/*`
- Node.js 24.18.0 in CI; Rstack CLI requires Node.js 22.12+
- pnpm 11 workspace with packages under `packages/*`
- Rspress plugin packages published as TypeScript ESM packages
- Build: mostly `tsc`, with `rspress-plugin-file-tree` using Rslib
- Unit tests: Rstest
- Build, lint, tests, and Git hooks: Rstack CLI
- Build: shared Rslib v1 configuration, with package-specific entries only when required
- Unit tests: Rstest through `rs test`
- E2E tests: Playwright
- Lint and format: Rslint and Prettier
- Lint and format: `rs lint --type-check` and Prettier

## Commands (run early)

```bash
# setup
corepack enable && pnpm install
# setup (also installs Rstack-managed Git hooks and builds packages)
corepack enable
pnpm install

# checks
pnpm lint
pnpm test

# build / package validation
pnpm run build
pnpm build
```

## Project structure

```text
packages/ # published Rspress plugin packages
scripts/ # shared Rstack library configuration
templates/ # plugin template sources
e2e/ # Playwright end-to-end tests
```
Expand Down
6 changes: 3 additions & 3 deletions e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const runDevCommand = async (
const targetPort = port || (await getRandomPort());
const childProcess = spawn(
'pnpm',
['rspress', 'dev', '--port', targetPort.toString()],
['rs', 'doc', '--port', targetPort.toString()],
{
cwd: root,
stdio: 'pipe',
Expand Down Expand Up @@ -81,7 +81,7 @@ export const runDevCommand = async (

export const runBuildCommand = async (root: string) => {
return new Promise<void>((resolve, reject) => {
const childProcess = spawn('pnpm', ['rspress', 'build'], {
const childProcess = spawn('pnpm', ['rs', 'doc', 'build'], {
cwd: root,
stdio: 'ignore',
env: {
Expand All @@ -107,7 +107,7 @@ export const runPreviewCommand = async (
const targetPort = port || (await getRandomPort());
const childProcess = spawn(
'npx',
['rspress', 'preview', '--port', targetPort.toString()],
['rs', 'doc', 'preview', '--port', targetPort.toString()],
{
cwd: root,
stdio: 'pipe',
Expand Down
66 changes: 28 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@
"packages/*"
],
"scripts": {
"prepare": "npm run packages:build",
"clean": "rm -rf ./packages/**/{dist,build}",
"build": "pnpm run clean && pnpm packages:build",
"prepare": "rs setup && pnpm packages:build",
"build": "pnpm packages:build",
"commit": "git add -A && czg",
"packages:build": "pnpm -r --filter=./packages/**/* run build",
"packages:build:p": "pnpm --parallel --filter=./packages/**/* run build",
"docs:build": "pnpm -r --filter=./packages/**/* run docs:build",
"lint": "rslint && prettier --check .",
"lint:write": "rslint --fix && prettier --write .",
"test": "rstest",
"testu": "rstest --update",
"packages:build": "pnpm --filter=./packages/* -r run build",
"docs:build": "pnpm --filter=./packages/* --filter=!rspress-plugin-gh-pages -r run docs:build",
"lint": "rs lint --type-check && prettier --check .",
"lint:write": "rs lint --type-check --fix && prettier --write .",
"test": "rs test",
"testu": "rs test --update",
"e2e": "playwright test",
"test:cov": "rstest --coverage",
"test:cov": "rs test --coverage",
"version": "changeset version && pnpm install --frozen-lockfile",
"version:beta": "changeset pre enter beta && changeset version",
"release": "pnpm build && changeset publish",
Expand All @@ -31,37 +29,29 @@
}
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@playwright/test": "^1.57.0",
"@rslint/core": "^0.6.2",
"@rstest/core": "0.10.6",
"@rstest/coverage-v8": "0.10.6",
"@changesets/cli": "^2.31.1",
"@microsoft/api-extractor": "^7.58.12",
"@playwright/test": "1.61.1",
"@rspress/core": "catalog:",
"@rstest/coverage-v8": "0.11.4",
"@types/cross-spawn": "^6.0.6",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.0",
"@types/pacote": "^11.1.8",
"cac": "^6.7.14",
"chalk": "^5.3.0",
"clipboardy": "^4.0.0",
"clsx": "^2.1.0",
"consola": "^3.2.3",
"@types/node": "catalog:",
"@types/react": "catalog:",
"cross-spawn": "^7.0.6",
"czg": "^1.9.1",
"eslint": "^9.0.0",
"execa": "^8.0.1",
"fs-extra": "^11.3.6",
"get-port": "^7.1.0",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"p-try": "^3.0.0",
"playwright": "^1.57.0",
"prettier": "^3.8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"stylelint": "^16.3.1",
"prettier": "^3.9.6",
"react": "catalog:",
"react-dom": "catalog:",
"rsbuild-plugin-publint": "^1.0.0",
"rstack": "^0.2.0",
"tree-kill": "^1.2.2",
"typescript": "^6.0.3",
"util-ts-types": "^1.0.0"
"typescript": "catalog:"
},
"packageManager": "pnpm@8.15.4+sha256.cea6d0bdf2de3a0549582da3983c70c92ffc577ff4410cbf190817ddc35137c2"
"engines": {
"node": ">=22.12.0",
"pnpm": ">=11.0.0"
},
"packageManager": "pnpm@11.15.0"
}
Loading