Repository navigation
fix: run astro check only in Astro packages, and point rr tsc doctor at the packages rr tsc checks - #285
Merged
Conversation
… Astro In a monorepo `rr tsc` hands its single typecheck provider every package with a tsconfig.json, and the astro plugin ran `astro check` in all of them. In a plain TypeScript package that booted Astro, printed Vite warnings and wrote `.astro/` into the package. The plugin now runs `astro check` only in an Astro package, one with an `astro.config.*` or with `astro` in its own dependencies, devDependencies or peerDependencies, and `tsc --noEmit --pretty` in any other. A package without Astro needs only `typescript`, and doctor checks `tsc` there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZVC7xzzsEmByszmfff4u2
`rr tsc doctor` ran the typecheck provider's doctor once, at the
directory rr was started from. In a monorepo that is the workspace root,
which `rr tsc` never checks, so the astro plugin looked for
@astrojs/check there and reported it missing while `rr tsc` passed.
The plugin contract's `doctor` takes an optional `{ cwd }`
(`DoctorOptions`), which `ToolService` spawns in and `StaticCheckService`
forwards. `rr tsc doctor` goes through a new `tscDoctorAction` that
shares `rr tsc`'s target selection: one row per workspace package with a
tsconfig.json in a monorepo, else the single row. The other doctor
subcommands and `rr doctor` run in the package they report on. The
astro plugin is the only one that overrides `doctor`; it now checks the
package it is given.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZVC7xzzsEmByszmfff4u2
🦋 Changeset detectedLatest commit: c99c5a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Preview releaseLatest commit: Some packages have been released:
Note Use the PR number as tag to install any package. For instance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two monorepo targeting bugs in
rr tsc, one commit each.1.
@rrlab/astro-pluginranastro checkin every package with atsconfig.json. In a plain TS package that booted Astro, printed Vite warnings and wrote.astro/into it.AstroCheckService.check({ cwd }) + if not isAstroProject(cwd) // no astro.config.*, no astro in deps/devDeps/peerDeps + return tsc --noEmit --pretty // keep type-checking it; ts() can't sit next to astro() astro check2.
rr tsc doctorran once at the process cwd, usually the workspace root, whichrr tscnever checks.doctor(options?: DoctorOptions), withDoctorOptions = { cwd?: string }. The change is additive and optional.ToolService.doctorspawns atcwd.StaticCheckServiceforwards the option. Of the official plugins, only astro-plugin overridesdoctor; it now checks@astrojs/checkonly in Astro packages.doctorcommands and top-levelrr doctornow run in the package they report on (appPkg).rr doctorstill shows one row per tool and doesn't fan out over the workspace. That's a known limitation: at an Astro monorepo root, its astro row checks the root.@rrlab/climinor (the new optional parameter),@rrlab/astro-pluginpatch.Evidence
Non-TTY e2e with the worktree's packed
@rrlab/cliand@rrlab/astro-plugin: a pnpm workspace withapps/site(Astro 7.4) andpackages/lib(plain TS), set up withrr plugins add biomeandrr plugins add astro.rr tscrunsastro checkinlibtoo:[WARN] Missing pages directory: src/pages, andpackages/lib/.astro/is created.After:
tsc (astro) · 2 packages ✔ site ($ astro check) ✔ lib ($ tsc --noEmit --pretty), and there is no.astro/in lib.packages/libgivesrr tscexit 1 withsrc/bad.ts:1:14 - error TS2322. With it removed,rr checkpasses.rr tsc doctorat the root is one row, run at the root, and reports@astrojs/checkmissing.After:
doctor (astro) · 2 packages ✔ site ($ astro --help) ✔ lib ($ tsc --help). Frompackages/liband frompackages/lib/srcit gives✔ doctor (astro) · lib. A single package still gets one row.check.test.tstests, including "runs tsc, not astro check, in a package without Astro". The new cli unit and integration tests fail without commit 2.Merge Danger
Door: two-way
Blast Radius: medium
doctorcommands now spawn in the package directory instead of the process cwd. That's the same directory unless you runrrfrom a subdirectory. The contract change is optional and additive, so a plugin built against an older CLI keeps working.🤖 Generated with Claude Code
https://claude.ai/code/session_01EZVC7xzzsEmByszmfff4u2