Skip to content

chore(infra): migrate plugins to Rstack CLI - #31

Open
SoonIter wants to merge 1 commit into
mainfrom
chore/repo-infrastructure-update
Open

chore(infra): migrate plugins to Rstack CLI#31
SoonIter wants to merge 1 commit into
mainfrom
chore/repo-infrastructure-update

Conversation

@SoonIter

@SoonIter SoonIter commented Jul 31, 2026

Copy link
Copy Markdown
Member

This PR standardizes all 13 plugin packages on shared Rstack CLI workflows for builds, docs, linting, tests, and Git hooks, while retaining package-specific Rslib configuration only where required.

It aligns CI and the workspace on Node.js 24.18.0, pnpm 11, Rslib v1, TypeScript 6, and the latest @rspress/core 2.0.19. The back-to-top package compiles its Less into published CSS so consumers do not need a Less plugin.

Related Links

Copilot AI review requested due to automatic review settings July 31, 2026 08:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SoonIter, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 32654cf5-ce21-4b68-81a8-5fb660b53fc8

📥 Commits

Reviewing files that changed from the base of the PR and between 51e4b80 and e72974e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (70)
  • .changeset/config.json
  • .gitattributes
  • .github/workflows/test-Windows.yml
  • .github/workflows/test-macOS.yml
  • .gitignore
  • .node-version
  • .npmrc
  • .prettierignore
  • AGENTS.md
  • e2e/utils.ts
  • package.json
  • packages/rspress-plugin-align-image/package.json
  • packages/rspress-plugin-align-image/rspress.config.ts
  • packages/rspress-plugin-align-image/rstack.config.ts
  • packages/rspress-plugin-back-to-top/package.json
  • packages/rspress-plugin-back-to-top/rspress.config.ts
  • packages/rspress-plugin-back-to-top/rstack.config.ts
  • packages/rspress-plugin-back-to-top/src/index.ts
  • packages/rspress-plugin-devkit/components/DevkitCode.tsx
  • packages/rspress-plugin-devkit/docs/index.md
  • packages/rspress-plugin-devkit/package.json
  • packages/rspress-plugin-devkit/rslib.config.ts
  • packages/rspress-plugin-devkit/rspress.config.ts
  • packages/rspress-plugin-devkit/rstack.config.ts
  • packages/rspress-plugin-devkit/src/NodeFactory/ESTreeNodeFactory.ts
  • packages/rspress-plugin-directives/components/Oops.tsx
  • packages/rspress-plugin-directives/package.json
  • packages/rspress-plugin-directives/rspress.config.ts
  • packages/rspress-plugin-directives/rstack.config.ts
  • packages/rspress-plugin-file-tree/package.json
  • packages/rspress-plugin-file-tree/rspress.config.ts
  • packages/rspress-plugin-file-tree/rstack.config.ts
  • packages/rspress-plugin-file-tree/tests/esmImport.test.ts
  • packages/rspress-plugin-file-tree/tests/parser.test.ts
  • packages/rspress-plugin-gh-pages/package.json
  • packages/rspress-plugin-gh-pages/rspress.config.ts
  • packages/rspress-plugin-gh-pages/rstack.config.ts
  • packages/rspress-plugin-google-analytics/package.json
  • packages/rspress-plugin-google-analytics/rspress.config.ts
  • packages/rspress-plugin-google-analytics/rstack.config.ts
  • packages/rspress-plugin-katex/package.json
  • packages/rspress-plugin-katex/rspress.config.ts
  • packages/rspress-plugin-katex/rstack.config.ts
  • packages/rspress-plugin-live2d/package.json
  • packages/rspress-plugin-live2d/rspress.config.ts
  • packages/rspress-plugin-live2d/rstack.config.ts
  • packages/rspress-plugin-mermaid/package.json
  • packages/rspress-plugin-mermaid/rspress.config.ts
  • packages/rspress-plugin-mermaid/rstack.config.ts
  • packages/rspress-plugin-reading-time/components/ReadingTime.tsx
  • packages/rspress-plugin-reading-time/package.json
  • packages/rspress-plugin-reading-time/rspress.config.ts
  • packages/rspress-plugin-reading-time/rstack.config.ts
  • packages/rspress-plugin-supersub/package.json
  • packages/rspress-plugin-supersub/rspress.config.ts
  • packages/rspress-plugin-supersub/rstack.config.ts
  • packages/rspress-plugin-vercel-analytics/package.json
  • packages/rspress-plugin-vercel-analytics/rspress.config.ts
  • packages/rspress-plugin-vercel-analytics/rstack.config.ts
  • pnpm-workspace.yaml
  • rslint.config.ts
  • rstack.config.ts
  • rstest.config.ts
  • scripts/rstack/lib.ts
  • templates/package.json
  • templates/rspress.config.ts
  • templates/rstack.config.ts
  • tsconfig.base.json
  • tsconfig.json
  • types/assets.d.ts
📝 Walkthrough

Walkthrough

The repository migrates package builds, documentation builds, linting, testing, and CI workflows to Rstack tooling. Package metadata now uses explicit distribution paths, export maps, catalog dependencies, and published plugin imports. Shared E2E server management replaces manual process handling. Playwright coverage expands across plugin examples. Node.js, pnpm, TypeScript, workspace, and package template configuration are updated.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: migrating plugin infrastructure to the Rstack CLI.
Description check ✅ Passed The description accurately covers the Rstack migration, version alignment, CI updates, and added Playwright coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/repo-infrastructure-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (1)
.github/workflows/test-Windows.yml (1)

23-26: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Checkout steps in both OS workflows persist credentials by default. actions/checkout keeps the GitHub token in the local git config unless persist-credentials: false is set. Both workflows run lint, build, and test commands against dependency code after checkout, so disabling persistence reduces the credential's exposure window as defense-in-depth, even though the job token is already scoped to contents: read.

  • .github/workflows/test-Windows.yml#L23-L26: add persist-credentials: false to the actions/checkout step.
  • .github/workflows/test-macOS.yml#L23-L26: add persist-credentials: false to the actions/checkout step.
🛠️ Proposed fix (apply to both files)
       - name: Checkout
         uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
         with:
           fetch-depth: 1
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-Windows.yml around lines 23 - 26, Update the
actions/checkout step in .github/workflows/test-Windows.yml (lines 23-26) and
.github/workflows/test-macOS.yml (lines 23-26) to set persist-credentials to
false, leaving the existing checkout configuration unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/utils.ts`:
- Around line 74-89: Update the waitForServer rejection handler in runDevCommand
to terminate childProcess before rejecting, ensuring startup failures clean up
the spawned process even when useRstackDocServer has not assigned devProcess
yet. Apply the same cleanup behavior to the corresponding startup path around
the later referenced block.

In `@packages/rspress-plugin-align-image/rspress.config.ts`:
- Line 3: Make the in-workspace imports resolve during clean type checking:
update the TypeScript path/package resolution or lint build order for
packages/rspress-plugin-align-image/rspress.config.ts and
packages/rspress-plugin-back-to-top/rspress.config.ts so their package names
resolve to source files or generated dist entrypoints before rs lint
--type-check runs; apply the same resolution fix to both sites.

In `@packages/rspress-plugin-devkit/rspress.config.ts`:
- Around line 3-13: Update the import of
RemarkCodeBlockToGlobalComponentPluginFactory in rspress.config.ts to reference
the package’s source index export instead of the package root, ensuring CI
resolves the factory before distribution build output is available and preserves
strict-safe typing for propsProvider.

In `@packages/rspress-plugin-file-tree/package.json`:
- Around line 43-55: Add the package’s own workspace package as a devDependency
in packages/rspress-plugin-file-tree/package.json, and apply the same
self-referencing dependency fix in
packages/rspress-plugin-gh-pages/package.json. Ensure the build runs before
type-checking the published-name imports in
packages/rspress-plugin-file-tree/rspress.config.ts and
packages/rspress-plugin-gh-pages/rspress.config.ts; those config files require
no direct change.

In `@packages/rspress-plugin-google-analytics/rspress.config.ts`:
- Around line 3-11: Make the self-package import in rspress.config.ts resolvable
before the package is built by configuring the development typecheck path to
target the package’s src/index.ts, or ensure the package build generates
dist/index.d.ts before this config is checked. Update the relevant package or
workspace TypeScript/build configuration while preserving the existing
rspress-plugin-google-analytics import.

In `@packages/rspress-plugin-katex/rspress.config.ts`:
- Line 3: Resolve the local plugin self-imports before documentation
configuration typechecking by using a resolvable source entry or adding an
appropriate source export condition. Apply the same fix to the imports in
packages/rspress-plugin-katex/rspress.config.ts:3-3,
packages/rspress-plugin-live2d/rspress.config.ts:3-3, and
packages/rspress-plugin-mermaid/rspress.config.ts:3-3 so Rstack and TypeScript
resolve each plugin before its built exports and declarations exist.

In `@packages/rspress-plugin-reading-time/rspress.config.ts`:
- Line 3: Make the self-references for rspress-plugin-reading-time,
rspress-plugin-supersub, and rspress-plugin-vercel-analytics resolvable during
docs type checks by adding appropriate source mappings in each package
manifest/exports, or ensure rs lib runs before config validation. Apply the
change at packages/rspress-plugin-reading-time/rspress.config.ts:3,
packages/rspress-plugin-supersub/rspress.config.ts:3, and
packages/rspress-plugin-vercel-analytics/rspress.config.ts:3; all three sites
require the same resolution fix.

In `@rstack.config.ts`:
- Around line 28-33: Remove the global '`@typescript-eslint/no-explicit-any`':
'off' entry from the rules configuration in rstack.config.ts so the
repository-wide lint command enforces the strict-safe TypeScript guideline. If
an exception is required, scope it to only the specific files or patterns that
genuinely need it rather than disabling the rule for all packages.

In `@tsconfig.base.json`:
- Around line 3-7: Enable full TypeScript strict mode by adding "strict": true
to the shared compiler options in tsconfig.base.json, alongside the existing
target and module settings. Review every tsconfig that extends this base
configuration and resolve any type-checking issues introduced by the stricter
checks.

---

Nitpick comments:
In @.github/workflows/test-Windows.yml:
- Around line 23-26: Update the actions/checkout step in
.github/workflows/test-Windows.yml (lines 23-26) and
.github/workflows/test-macOS.yml (lines 23-26) to set persist-credentials to
false, leaving the existing checkout configuration unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d81d423d-b4a7-419b-a487-86caa4523e30

📥 Commits

Reviewing files that changed from the base of the PR and between a59a167 and 51e4b80.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (83)
  • .changeset/config.json
  • .github/workflows/test-Windows.yml
  • .github/workflows/test-macOS.yml
  • .gitignore
  • .node-version
  • .npmrc
  • .prettierignore
  • AGENTS.md
  • e2e/utils.ts
  • package.json
  • packages/rspress-plugin-align-image/index.spec.ts
  • packages/rspress-plugin-align-image/package.json
  • packages/rspress-plugin-align-image/rspress.config.ts
  • packages/rspress-plugin-align-image/rstack.config.ts
  • packages/rspress-plugin-back-to-top/index.spec.ts
  • packages/rspress-plugin-back-to-top/package.json
  • packages/rspress-plugin-back-to-top/rspress.config.ts
  • packages/rspress-plugin-back-to-top/rstack.config.ts
  • packages/rspress-plugin-back-to-top/src/index.ts
  • packages/rspress-plugin-devkit/components/DevkitCode.tsx
  • packages/rspress-plugin-devkit/docs/index.md
  • packages/rspress-plugin-devkit/index.spec.ts
  • packages/rspress-plugin-devkit/package.json
  • packages/rspress-plugin-devkit/rslib.config.ts
  • packages/rspress-plugin-devkit/rspress.config.ts
  • packages/rspress-plugin-devkit/rstack.config.ts
  • packages/rspress-plugin-devkit/src/NodeFactory/ESTreeNodeFactory.ts
  • packages/rspress-plugin-directives/components/Oops.tsx
  • packages/rspress-plugin-directives/index.spec.ts
  • packages/rspress-plugin-directives/package.json
  • packages/rspress-plugin-directives/rspress.config.ts
  • packages/rspress-plugin-directives/rstack.config.ts
  • packages/rspress-plugin-file-tree/index.spec.ts
  • packages/rspress-plugin-file-tree/package.json
  • packages/rspress-plugin-file-tree/rspress.config.ts
  • packages/rspress-plugin-file-tree/rstack.config.ts
  • packages/rspress-plugin-file-tree/tests/esmImport.test.ts
  • packages/rspress-plugin-file-tree/tests/parser.test.ts
  • packages/rspress-plugin-gh-pages/index.spec.ts
  • packages/rspress-plugin-gh-pages/package.json
  • packages/rspress-plugin-gh-pages/rspress.config.ts
  • packages/rspress-plugin-gh-pages/rstack.config.ts
  • packages/rspress-plugin-google-analytics/index.spec.ts
  • packages/rspress-plugin-google-analytics/package.json
  • packages/rspress-plugin-google-analytics/rspress.config.ts
  • packages/rspress-plugin-google-analytics/rstack.config.ts
  • packages/rspress-plugin-katex/index.spec.ts
  • packages/rspress-plugin-katex/package.json
  • packages/rspress-plugin-katex/rspress.config.ts
  • packages/rspress-plugin-katex/rstack.config.ts
  • packages/rspress-plugin-live2d/index.spec.ts
  • packages/rspress-plugin-live2d/package.json
  • packages/rspress-plugin-live2d/rspress.config.ts
  • packages/rspress-plugin-live2d/rstack.config.ts
  • packages/rspress-plugin-mermaid/index.spec.ts
  • packages/rspress-plugin-mermaid/package.json
  • packages/rspress-plugin-mermaid/rspress.config.ts
  • packages/rspress-plugin-mermaid/rstack.config.ts
  • packages/rspress-plugin-reading-time/components/ReadingTime.tsx
  • packages/rspress-plugin-reading-time/index.spec.ts
  • packages/rspress-plugin-reading-time/package.json
  • packages/rspress-plugin-reading-time/rspress.config.ts
  • packages/rspress-plugin-reading-time/rstack.config.ts
  • packages/rspress-plugin-supersub/index.spec.ts
  • packages/rspress-plugin-supersub/package.json
  • packages/rspress-plugin-supersub/rspress.config.ts
  • packages/rspress-plugin-supersub/rstack.config.ts
  • packages/rspress-plugin-vercel-analytics/index.spec.ts
  • packages/rspress-plugin-vercel-analytics/package.json
  • packages/rspress-plugin-vercel-analytics/rspress.config.ts
  • packages/rspress-plugin-vercel-analytics/rstack.config.ts
  • playwright.config.ts
  • pnpm-workspace.yaml
  • rslint.config.ts
  • rstack.config.ts
  • rstest.config.ts
  • scripts/rstack/lib.ts
  • templates/package.json
  • templates/rspress.config.ts
  • templates/rstack.config.ts
  • tsconfig.base.json
  • tsconfig.json
  • types/assets.d.ts
💤 Files with no reviewable changes (3)
  • rstest.config.ts
  • rslint.config.ts
  • packages/rspress-plugin-devkit/rslib.config.ts

Comment thread e2e/utils.ts Outdated
Comment on lines +74 to +89
let starting = false;
childProcess.stdout?.on('data', (data) => {
const output = data.toString();
// Rspress dev server started
if (output.includes('http://localhost') && !resolved) {
resolved = true;
resolve({
process: childProcess,
url: `http://localhost:${targetPort}`,
});
if (output.includes('http://localhost') && !resolved && !starting) {
starting = true;
const url = `http://localhost:${targetPort}`;
waitForServer(url)
.then(() => {
resolved = true;
resolve({
process: childProcess,
url,
});
})
.catch(reject);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Spawned dev server process leaks when waitForServer times out.

When waitForServer rejects, runDevCommand's promise rejects through .catch(reject), but childProcess is never killed. In useRstackDocServer, devProcess is only assigned after runDevCommand resolves, so a rejection leaves devProcess undefined. afterAll's if (devProcess) guard then skips killProcess, and the spawned pnpm rs doc process keeps running.

Kill the process before rejecting.

🛠️ Proposed fix to kill the process on startup failure
         waitForServer(url)
           .then(() => {
             resolved = true;
             resolve({
               process: childProcess,
               url,
             });
           })
-          .catch(reject);
+          .catch((error) => {
+            void killProcess(childProcess).finally(() => reject(error));
+          });

Also applies to: 109-125

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/utils.ts` around lines 74 - 89, Update the waitForServer rejection
handler in runDevCommand to terminate childProcess before rejecting, ensuring
startup failures clean up the spawned process even when useRstackDocServer has
not assigned devProcess yet. Apply the same cleanup behavior to the
corresponding startup path around the later referenced block.

Comment thread packages/rspress-plugin-align-image/rspress.config.ts
Comment on lines +3 to +13
import { RemarkCodeBlockToGlobalComponentPluginFactory } from 'rspress-plugin-devkit';

const codeBlock = new RemarkCodeBlockToGlobalComponentPluginFactory({
components: [
{
lang: 'devkit',
componentPath: path.join(
import.meta.dirname,
'components/DevkitCode.tsx',
),
propsProvider: (code) => ({ code }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== repo files matching rspress.config and package manifests =="
git ls-files | rg '(^|/)rspress\.config\.ts$|packages/rspress-plugin-devkit/(package\.json|tsconfig|.*\.ts)$|packages/.*/package\.json$|.*\.ya?ml$' || true

echo
echo "== target file =="
if [ -f packages/rspress-plugin-devkit/rspress.config.ts ]; then
  cat -n packages/rspress-plugin-devkit/rspress.config.ts
fi

echo
echo "== package manifest exports/default =="
package_json=packages/rspress-plugin-devkit/package.json
if [ -f "$package_json" ]; then
  cat -n "$package_json"
fi

echo
echo "== imports/usages of RemarkCodeBlockToGlobalComponentPluginFactory =="
rg -n "RemarkCodeBlockToGlobalComponentPluginFactory|rspress-plugin-devkit" . --glob '*.ts' --glob '*.tsx' --glob '*.md*' --glob '*.json' || true

echo
echo "== CI config mentions type check/ts/eslint/rspress =="
git ls-files | rg '(^|/)(workflow-templates|\.github/workflows)|\.yml$|rspress|eslint|tsc|typescript|verify|ci' || true

Repository: rstackjs/rspress-plugins

Length of output: 23280


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow files =="
for f in .github/workflows/test-Windows.yml .github/workflows/test-macOS.yml; do
  echo "--- $f ---"
  cat -n "$f"
done

echo
echo "== root/tsconfig =="
cat -n tsconfig.json
for f in packages/rspress-plugin-devkit/tsconfig.json packages/rspress-plugin-devkit/rstack.config.ts packages/rspress-plugin-devkit/manifests/tsconfig.json 2>/dev/null; do
  [ -f "$f" ] && { echo "--- $f ---"; cat -n "$f"; }
done

echo
echo "== package tsconfig manifests =="
git ls-files | rg 'packages/rspress-plugin-devkit/manifests|tsconfig\.json$' | sed -n '1,120p'

Repository: rstackjs/rspress-plugins

Length of output: 4092


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== devkit config and source exports =="
cat -n packages/rspress-plugin-devkit/rstack.config.ts
echo "---"
cat -n packages/rspress-plugin-devkit/tsconfig.json
echo "---"
cat -n packages/rspress-plugin-devkit/src/index.ts
echo "---"
sed -n '1,80p' packages/rspress-plugin-devkit/src/RemarkPluginFactory/CodeBlock2GlobalComponent.ts | cat -n

echo
echo "== package scripts =="
node - <<'JS'
const pkg = require('./packages/rspress-plugin-devkit/package.json');
console.log(JSON.stringify(pkg.scripts, null, 2));
JS

echo
echo "== root package scripts =="
node - <<'JS'
const pkg = require('./package.json');
console.log(JSON.stringify(pkg.scripts, null, 2));
JS

Repository: rstackjs/rspress-plugins

Length of output: 4886


Import the devkit factory from source exports.

packages/rspress-plugin-devkit/rspress.config.ts imports rspress-plugin-devkit, but that package only points its local exports to dist. CI runs a package build before docs build, so use the source import from packages/rspress-plugin-devkit/src/index.ts to make RemarkCodeBlockToGlobalComponentPluginFactory resolvable and restore strict-safe typing for propsProvider.

🧰 Tools
🪛 GitHub Actions: Test (macOS) / 0_test-macos.txt

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-devkit' or its corresponding type declarations.


[error] 13-13: TypeScript TS7006: Parameter 'code' implicitly has an 'any' type.

🪛 GitHub Actions: Test (macOS) / test-macos

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-devkit' or its corresponding type declarations.


[error] 13-13: TypeScript TS7006: Parameter 'code' implicitly has an 'any' type.

🪛 GitHub Actions: Test (Windows) / 0_test-windows.txt

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-devkit' or its corresponding type declarations.


[error] 13-13: TypeScript TS7006: Parameter 'code' implicitly has an 'any' type.

🪛 GitHub Actions: Test (Windows) / test-windows

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-devkit' or its corresponding type declarations.


[error] 13-13: TypeScript TS7006: Parameter 'code' implicitly has an 'any' type.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/rspress-plugin-devkit/rspress.config.ts` around lines 3 - 13, Update
the import of RemarkCodeBlockToGlobalComponentPluginFactory in rspress.config.ts
to reference the package’s source index export instead of the package root,
ensuring CI resolves the factory before distribution build output is available
and preserves strict-safe typing for propsProvider.

Sources: Coding guidelines, Pipeline failures

Comment on lines 43 to +55
"dependencies": {
"rspress-plugin-devkit": "workspace:^"
},
"devDependencies": {
"@rsbuild/plugin-less": "^2.0.0",
"@rsbuild/plugin-react": "^2.1.0",
"@rslib/core": "^0.23.0",
"@types/node": "^20.12.5",
"@types/react": "^18.2.74",
"@typescript/native-preview": "7.0.0-dev.20260622.1",
"@rsbuild/plugin-less": "catalog:",
"@rsbuild/plugin-react": "catalog:",
"@rspress/core": "catalog:",
"@types/node": "catalog:",
"@types/react": "catalog:",
"material-icon-theme": "^5.30.0",
"rsbuild-plugin-publint": "^1.0.0",
"typescript": "^6.0.3"
"react": "catalog:",
"react-dom": "catalog:",
"typescript": "catalog:"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win

Self-importing plugin packages fail with TS2307 in CI. Both rspress-plugin-file-tree and rspress-plugin-gh-pages import their own published package name in their example rspress.config.ts, and both fail with TS2307: Cannot find module on macOS and Windows CI per the pipeline logs. The shared root cause is that these packages are missing the self-referencing workspace dependency (or the type-check/test step runs before build generates dist/), so the published-name import cannot resolve.

  • packages/rspress-plugin-file-tree/package.json#L43-L55: add a self-referencing devDependency (for example "rspress-plugin-file-tree": "workspace:*"), and confirm pnpm build runs before the step that type-checks rspress.config.ts.
  • packages/rspress-plugin-file-tree/rspress.config.ts#L3-L3: this import fails until the package.json fix above is applied.
  • packages/rspress-plugin-gh-pages/rspress.config.ts#L3-L3: check packages/rspress-plugin-gh-pages/package.json for the same missing self-dependency and apply the same fix.
📍 Affects 3 files
  • packages/rspress-plugin-file-tree/package.json#L43-L55 (this comment)
  • packages/rspress-plugin-file-tree/rspress.config.ts#L3-L3
  • packages/rspress-plugin-gh-pages/rspress.config.ts#L3-L3
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/rspress-plugin-file-tree/package.json` around lines 43 - 55, Add the
package’s own workspace package as a devDependency in
packages/rspress-plugin-file-tree/package.json, and apply the same
self-referencing dependency fix in
packages/rspress-plugin-gh-pages/package.json. Ensure the build runs before
type-checking the published-name imports in
packages/rspress-plugin-file-tree/rspress.config.ts and
packages/rspress-plugin-gh-pages/rspress.config.ts; those config files require
no direct change.

Source: Pipeline failures

Comment on lines +3 to +11
import ga from 'rspress-plugin-google-analytics';

export default defineConfig({
root: path.join(__dirname, 'docs'),
root: path.join(import.meta.dirname, 'docs'),
title: 'Rspress x GA Example',
plugins: [
ga({
id: 'G-E47ZZ8QFC1',
id: ['G-E2EPRIMARY', 'G-E2ESECONDARY'],
anonymizeIP: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

package_file='packages/rspress-plugin-google-analytics/package.json'

# Inspect the package self-reference and its published declaration target.
jq '{name, types, exports}' "$package_file"

# Inspect TypeScript resolution settings that can map the package name to source.
rg -n -C 3 --glob 'tsconfig*.json' '"baseUrl"|"paths"|"moduleResolution"' .

# Check whether the exported declaration exists before documentation type checking.
test -f packages/rspress-plugin-google-analytics/dist/index.d.ts \
  && echo 'dist declaration exists' \
  || echo 'dist declaration is absent'

Repository: rstackjs/rspress-plugins

Length of output: 2293


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- tsconfig files ---'
git ls-files 'tsconfig*.json' 'packages/rspress-plugin-google-analytics/**' -z | tr '\0' '\n'

echo '--- root/package config files ---'
git ls-files 'package.json' '*.json5' '*.config.*' 'tsconfig*.json' | sed -n '1,120p'

echo '--- relevant package sources ---'
fd -a . packages/rspress-plugin-google-analytics 2>/dev/null | sed 's#^\./##' | sed -n '1,120p'

echo '--- package metadata ---'
jq '{name, description, type, main, module, types, exports, scripts, dependencies, devDependencies}' package.json packages/rspress-plugin-google-analytics/package.json

echo '--- workflows mentioning install/build/check/typecheck/rsbuild ---'
git ls-files .github/workflows | xargs -r rg -n 'pnpm|npm|yarn|build|typecheck|tsconfig|watch|rsbuild|dist|tsup|vite' -C 2

echo '--- go-analytics config package.json/package and tsconfig if any ---'
if [ -f packages/rspress-plugin-google-analytics/package.json ]; then jq -r . packages/rspress-plugin-google-analytics/package.json; fi
fd -a 'tsconfig.json|package.json|rspress.config.ts' packages/rspress-plugin-google-analytics 2>/dev/null | sed 's#^\./##' | while read -r f; do
  echo "### $f"
  sed -n '1,160p' "$f"
done

Repository: rstackjs/rspress-plugins

Length of output: 12759


Make the self-package import resolvable in types.

packages/rspress-plugin-google-analytics/package.json points types and exports['.'].types to ./dist/index.d.ts, and dist/index.d.ts is absent. Typecheck order can hit rspress.config.ts before pnpm build, so use a source-targeted dev mode/paths mapping to src/index.ts or build dist/index.d.ts before this configuration is typechecked.

🧰 Tools
🪛 GitHub Actions: Test (macOS) / 0_test-macos.txt

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-google-analytics' or its corresponding type declarations.

🪛 GitHub Actions: Test (macOS) / test-macos

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-google-analytics' or its corresponding type declarations.

🪛 GitHub Actions: Test (Windows) / 0_test-windows.txt

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-google-analytics' or its corresponding type declarations.

🪛 GitHub Actions: Test (Windows) / test-windows

[error] 3-3: TypeScript TS2307: Cannot find module 'rspress-plugin-google-analytics' or its corresponding type declarations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/rspress-plugin-google-analytics/rspress.config.ts` around lines 3 -
11, Make the self-package import in rspress.config.ts resolvable before the
package is built by configuring the development typecheck path to target the
package’s src/index.ts, or ensure the package build generates dist/index.d.ts
before this config is checked. Update the relevant package or workspace
TypeScript/build configuration while preserving the existing
rspress-plugin-google-analytics import.

Source: Pipeline failures

Comment thread packages/rspress-plugin-katex/rspress.config.ts
Comment thread packages/rspress-plugin-reading-time/rspress.config.ts
Comment thread rstack.config.ts
Comment on lines +28 to +33
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Disabling no-explicit-any conflicts with the repository's strict-safe guideline.

This lint config turns off @typescript-eslint/no-explicit-any for every package under rs lint. The repository's own coding guideline requires strict-safe TypeScript and forbids any. Disabling the rule removes automated enforcement across all 13 packages.

Re-enable the rule, or scope the exception to specific files/patterns that genuinely need it.

🛠️ Proposed fix to keep `no-explicit-any` enforced
       rules: {
         '`@typescript-eslint/ban-ts-comment`': 'off',
         '`@typescript-eslint/no-empty-object-type`': 'off',
-        '`@typescript-eslint/no-explicit-any`': 'off',
         '`@typescript-eslint/no-unused-vars`': 'off',
       },

As per coding guidelines, **/*.{ts,tsx}: "Keep TypeScript code strict-safe and avoid using any."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
rules: {
'`@typescript-eslint/ban-ts-comment`': 'off',
'`@typescript-eslint/no-empty-object-type`': 'off',
'`@typescript-eslint/no-unused-vars`': 'off',
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rstack.config.ts` around lines 28 - 33, Remove the global
'`@typescript-eslint/no-explicit-any`': 'off' entry from the rules configuration
in rstack.config.ts so the repository-wide lint command enforces the strict-safe
TypeScript guideline. If an exception is required, scope it to only the specific
files or patterns that genuinely need it rather than disabling the rule for all
packages.

Source: Coding guidelines

Comment thread tsconfig.base.json
Comment on lines +3 to +7
"target": "ES2023",
"module": "ESNext",
"jsx": "preserve",
"declaration": true,
"lib": ["es2022", "esnext", "dom"],
"lib": ["ES2023", "ESNext", "DOM"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Files named tsconfig*.json:\n'
fd '^tsconfig.*\.json$' . -t f

printf '\ntsconfig.base.json:\n'
cat -n tsconfig.base.json

printf '\nPackage/script references to type-check/lint:\n'
for f in $(fd '(^package\.json$|.*workspace.*\.json$)' . -t f); do
  echo "---- $f ----"
  jq '.scripts // empty' "$f" 2>/dev/null || true
  rg -n '"[^"]*(type-check|lint|check|tsc)"|rs lint --type-check' "$f" || true
done

printf '\nAll tsconfig extends references:\n'
rg -n '"extends"\s*:\s*"tsconfig\.base\.json"|tsconfig\.base\.json' -g 'tsconfig*.json' .

Repository: rstackjs/rspress-plugins

Length of output: 6224


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, os, fnmatch
from pathlib import Path

if not Path('tsconfig.base.json').exists():
    raise SystemExit('tsconfig.base.json not found')
base = json.loads(Path('tsconfig.base.json').read_text())
oo = base.get('compilerOptions', {})
print('compilerOptions.strict:', oo.get('strict'))
print('compilerOptions.strictNullChecks:', oo.get('strictNullChecks'))
print('all strict-related true/false flags:', {k:v for k,v in oo.items() if any(s in k.lower() for s in ['strict','noImplicit','noUnchecked'])})

configs = list(Path('.').rglob('tsconfig*.json'))
print(f'\ntotal tsconfig*.json: {len(configs)}')
for p in configs:
    try:
        data = json.loads(p.read_text())
    except Exception as e:
        print(f'{p}: parse error {e}')
        continue
    extends = data.get('extends')
    oo = data.get('compilerOptions', {})
    inher = extends == 'tsconfig.base.json'
    print(f'{p}: extends={extends!r} inherits_base={inher} strict={oo.get(\"strict\")} strictNullChecks={oo.get(\"strictNullChecks\")}')
PY

Repository: rstackjs/rspress-plugins

Length of output: 527


Enable full TypeScript strict mode.

strictNullChecks alone permits implicit any and disables other strict checks. Add "strict": true before treating rs lint --type-check as strict-safe. Verify all tsconfig files that extend tsconfig.base.json after this change.

Proposed fix
  "compilerOptions": {
+   "strict": true,
    "target": "ES2023",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"target": "ES2023",
"module": "ESNext",
"jsx": "preserve",
"declaration": true,
"lib": ["es2022", "esnext", "dom"],
"lib": ["ES2023", "ESNext", "DOM"],
"strict": true,
"target": "ES2023",
"module": "ESNext",
"jsx": "preserve",
"declaration": true,
"lib": ["ES2023", "ESNext", "DOM"],
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tsconfig.base.json` around lines 3 - 7, Enable full TypeScript strict mode by
adding "strict": true to the shared compiler options in tsconfig.base.json,
alongside the existing target and module settings. Review every tsconfig that
extends this base configuration and resolve any type-checking issues introduced
by the stricter checks.

Source: Coding guidelines

@SoonIter
SoonIter force-pushed the chore/repo-infrastructure-update branch from 9faddd4 to e72974e Compare July 31, 2026 09:55
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.

2 participants