chore(infra): migrate plugins to Rstack CLI - #31
Conversation
|
Warning Review limit reached
Next review available in: 57 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (70)
📝 WalkthroughWalkthroughThe 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)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 9
🧹 Nitpick comments (1)
.github/workflows/test-Windows.yml (1)
23-26: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winCheckout steps in both OS workflows persist credentials by default.
actions/checkoutkeeps the GitHub token in the local git config unlesspersist-credentials: falseis 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 tocontents: read.
.github/workflows/test-Windows.yml#L23-L26: addpersist-credentials: falseto theactions/checkoutstep..github/workflows/test-macOS.yml#L23-L26: addpersist-credentials: falseto theactions/checkoutstep.🛠️ 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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.prettierignoreAGENTS.mde2e/utils.tspackage.jsonpackages/rspress-plugin-align-image/index.spec.tspackages/rspress-plugin-align-image/package.jsonpackages/rspress-plugin-align-image/rspress.config.tspackages/rspress-plugin-align-image/rstack.config.tspackages/rspress-plugin-back-to-top/index.spec.tspackages/rspress-plugin-back-to-top/package.jsonpackages/rspress-plugin-back-to-top/rspress.config.tspackages/rspress-plugin-back-to-top/rstack.config.tspackages/rspress-plugin-back-to-top/src/index.tspackages/rspress-plugin-devkit/components/DevkitCode.tsxpackages/rspress-plugin-devkit/docs/index.mdpackages/rspress-plugin-devkit/index.spec.tspackages/rspress-plugin-devkit/package.jsonpackages/rspress-plugin-devkit/rslib.config.tspackages/rspress-plugin-devkit/rspress.config.tspackages/rspress-plugin-devkit/rstack.config.tspackages/rspress-plugin-devkit/src/NodeFactory/ESTreeNodeFactory.tspackages/rspress-plugin-directives/components/Oops.tsxpackages/rspress-plugin-directives/index.spec.tspackages/rspress-plugin-directives/package.jsonpackages/rspress-plugin-directives/rspress.config.tspackages/rspress-plugin-directives/rstack.config.tspackages/rspress-plugin-file-tree/index.spec.tspackages/rspress-plugin-file-tree/package.jsonpackages/rspress-plugin-file-tree/rspress.config.tspackages/rspress-plugin-file-tree/rstack.config.tspackages/rspress-plugin-file-tree/tests/esmImport.test.tspackages/rspress-plugin-file-tree/tests/parser.test.tspackages/rspress-plugin-gh-pages/index.spec.tspackages/rspress-plugin-gh-pages/package.jsonpackages/rspress-plugin-gh-pages/rspress.config.tspackages/rspress-plugin-gh-pages/rstack.config.tspackages/rspress-plugin-google-analytics/index.spec.tspackages/rspress-plugin-google-analytics/package.jsonpackages/rspress-plugin-google-analytics/rspress.config.tspackages/rspress-plugin-google-analytics/rstack.config.tspackages/rspress-plugin-katex/index.spec.tspackages/rspress-plugin-katex/package.jsonpackages/rspress-plugin-katex/rspress.config.tspackages/rspress-plugin-katex/rstack.config.tspackages/rspress-plugin-live2d/index.spec.tspackages/rspress-plugin-live2d/package.jsonpackages/rspress-plugin-live2d/rspress.config.tspackages/rspress-plugin-live2d/rstack.config.tspackages/rspress-plugin-mermaid/index.spec.tspackages/rspress-plugin-mermaid/package.jsonpackages/rspress-plugin-mermaid/rspress.config.tspackages/rspress-plugin-mermaid/rstack.config.tspackages/rspress-plugin-reading-time/components/ReadingTime.tsxpackages/rspress-plugin-reading-time/index.spec.tspackages/rspress-plugin-reading-time/package.jsonpackages/rspress-plugin-reading-time/rspress.config.tspackages/rspress-plugin-reading-time/rstack.config.tspackages/rspress-plugin-supersub/index.spec.tspackages/rspress-plugin-supersub/package.jsonpackages/rspress-plugin-supersub/rspress.config.tspackages/rspress-plugin-supersub/rstack.config.tspackages/rspress-plugin-vercel-analytics/index.spec.tspackages/rspress-plugin-vercel-analytics/package.jsonpackages/rspress-plugin-vercel-analytics/rspress.config.tspackages/rspress-plugin-vercel-analytics/rstack.config.tsplaywright.config.tspnpm-workspace.yamlrslint.config.tsrstack.config.tsrstest.config.tsscripts/rstack/lib.tstemplates/package.jsontemplates/rspress.config.tstemplates/rstack.config.tstsconfig.base.jsontsconfig.jsontypes/assets.d.ts
💤 Files with no reviewable changes (3)
- rstest.config.ts
- rslint.config.ts
- packages/rspress-plugin-devkit/rslib.config.ts
| 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); |
There was a problem hiding this comment.
🩺 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.
| 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 }), |
There was a problem hiding this comment.
🎯 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' || trueRepository: 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));
JSRepository: 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
| "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:" |
There was a problem hiding this comment.
🗄️ 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 confirmpnpm buildruns before the step that type-checksrspress.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: checkpackages/rspress-plugin-gh-pages/package.jsonfor 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-L3packages/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
| 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, |
There was a problem hiding this comment.
🎯 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"
doneRepository: 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
| 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', | ||
| }, |
There was a problem hiding this comment.
📐 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.
| 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
| "target": "ES2023", | ||
| "module": "ESNext", | ||
| "jsx": "preserve", | ||
| "declaration": true, | ||
| "lib": ["es2022", "esnext", "dom"], | ||
| "lib": ["ES2023", "ESNext", "DOM"], |
There was a problem hiding this comment.
📐 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\")}')
PYRepository: 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.
| "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
9faddd4 to
e72974e
Compare
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/core2.0.19. The back-to-top package compiles its Less into published CSS so consumers do not need a Less plugin.Related Links