From aaaf64dc1bc0eb5399106ab23af3b2ae87a52b15 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 10 Aug 2026 14:22:17 +0800 Subject: [PATCH 1/2] refactor: move package docs outside dist --- .agents/skills/rstack-cli-best-practices/SKILL.md | 2 +- .gitignore | 1 + packages/create-rstack/template-common/AGENTS.md | 2 +- packages/rstack/package.json | 1 + scripts/prepare-release.js | 8 ++++++-- website/docs/en/guide/ai.mdx | 2 +- website/docs/zh/guide/ai.mdx | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.agents/skills/rstack-cli-best-practices/SKILL.md b/.agents/skills/rstack-cli-best-practices/SKILL.md index 21940ca7..b614601f 100644 --- a/.agents/skills/rstack-cli-best-practices/SKILL.md +++ b/.agents/skills/rstack-cli-best-practices/SKILL.md @@ -16,7 +16,7 @@ Before any Rstack work, find and read the relevant Markdown documentation shippe 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/dist/docs/llms.txt`, then read only the linked pages relevant to the task before proposing or making changes. +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 -h` when supported. diff --git a/.gitignore b/.gitignore index b827929d..f97dd4ad 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ node_modules dist/ dist-*/ +/packages/rstack/docs/ test-results doc_build diff --git a/packages/create-rstack/template-common/AGENTS.md b/packages/create-rstack/template-common/AGENTS.md index f4d863e4..6f0dd873 100644 --- a/packages/create-rstack/template-common/AGENTS.md +++ b/packages/create-rstack/template-common/AGENTS.md @@ -2,6 +2,6 @@ This project uses Rstack CLI as its JavaScript toolchain. -- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/dist/docs/llms.txt`, then read only the linked pages relevant to the task. +- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/docs/llms.txt`, then read only the linked pages relevant to the task. - For command details, use `rs -h` or `rs -h`. - If the local documentation is unavailable, use https://rstack.rs/llms.txt and `rs -h`. diff --git a/packages/rstack/package.json b/packages/rstack/package.json index 0bf8fe1e..28cea6bc 100644 --- a/packages/rstack/package.json +++ b/packages/rstack/package.json @@ -59,6 +59,7 @@ "binding.cjs", "binding.d.cts", "dist", + "docs", "types", "THIRD_PARTY_NOTICES.md" ], diff --git a/scripts/prepare-release.js b/scripts/prepare-release.js index 0cdec3b7..c90a34b9 100644 --- a/scripts/prepare-release.js +++ b/scripts/prepare-release.js @@ -6,7 +6,8 @@ import path from 'node:path'; const rootDir = path.resolve(import.meta.dirname, '..'); const websiteDir = path.join(rootDir, 'website'); const websiteDistDir = path.join(websiteDir, 'doc_build'); -const packageDocsDir = path.join(rootDir, 'packages/rstack/dist/docs'); +const packageDocsDir = path.join(rootDir, 'packages/rstack/docs'); +const legacyPackageDocsDir = path.join(rootDir, 'packages/rstack/dist/docs'); const run = (command, args) => new Promise((resolve, reject) => { @@ -63,7 +64,10 @@ if (markdownFiles.length === 0) { throw new Error(`No English Markdown files found in ${websiteDistDir}.`); } -await rm(packageDocsDir, { recursive: true, force: true }); +await Promise.all([ + rm(packageDocsDir, { recursive: true, force: true }), + rm(legacyPackageDocsDir, { recursive: true, force: true }), +]); for (const relativePath of markdownFiles) { const destination = path.join(packageDocsDir, relativePath); diff --git a/website/docs/en/guide/ai.mdx b/website/docs/en/guide/ai.mdx index 0bb7f0b2..80ef7217 100644 --- a/website/docs/en/guide/ai.mdx +++ b/website/docs/en/guide/ai.mdx @@ -22,7 +22,7 @@ You can also copy the following content into your own `AGENTS.md`: ```markdown wrapCode title="AGENTS.md" This project uses Rstack CLI as its JavaScript toolchain. -- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/dist/docs/llms.txt`, then read only the linked pages relevant to the task. +- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/docs/llms.txt`, then read only the linked pages relevant to the task. - For command details, use `rs -h` or `rs -h`. - If the local documentation is unavailable, use https://rstack.rs/llms.txt and `rs -h`. ``` diff --git a/website/docs/zh/guide/ai.mdx b/website/docs/zh/guide/ai.mdx index ce909a44..a9ab69f1 100644 --- a/website/docs/zh/guide/ai.mdx +++ b/website/docs/zh/guide/ai.mdx @@ -22,7 +22,7 @@ import { PackageManagerTabs } from '@rspress/core/theme'; ```markdown wrapCode title="AGENTS.md" This project uses Rstack CLI as its JavaScript toolchain. -- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/dist/docs/llms.txt`, then read only the linked pages relevant to the task. +- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/docs/llms.txt`, then read only the linked pages relevant to the task. - For command details, use `rs -h` or `rs -h`. - If the local documentation is unavailable, use https://rstack.rs/llms.txt and `rs -h`. ``` From 267c47d22b102c2457bedae1cb8e810e9def9ccf Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 10 Aug 2026 14:24:09 +0800 Subject: [PATCH 2/2] refactor: simplify package docs cleanup --- scripts/prepare-release.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/prepare-release.js b/scripts/prepare-release.js index c90a34b9..cab8f15b 100644 --- a/scripts/prepare-release.js +++ b/scripts/prepare-release.js @@ -7,7 +7,6 @@ const rootDir = path.resolve(import.meta.dirname, '..'); const websiteDir = path.join(rootDir, 'website'); const websiteDistDir = path.join(websiteDir, 'doc_build'); const packageDocsDir = path.join(rootDir, 'packages/rstack/docs'); -const legacyPackageDocsDir = path.join(rootDir, 'packages/rstack/dist/docs'); const run = (command, args) => new Promise((resolve, reject) => { @@ -64,10 +63,7 @@ if (markdownFiles.length === 0) { throw new Error(`No English Markdown files found in ${websiteDistDir}.`); } -await Promise.all([ - rm(packageDocsDir, { recursive: true, force: true }), - rm(legacyPackageDocsDir, { recursive: true, force: true }), -]); +await rm(packageDocsDir, { recursive: true, force: true }); for (const relativePath of markdownFiles) { const destination = path.join(packageDocsDir, relativePath);