Repository navigation
feat: add @rrlab/astro-plugin, which runs astro check for rr tsc and rr check - #270
Conversation
🦋 Changeset detectedLatest commit: f854273 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 |
|
Publish preview fails, and the fix is on npm, not in this branch. The job fails with Before merging, create |
…rr check The plugin provides the typecheck capability through `astro check`, which checks .astro files and plain .ts files alike. It fails before running astro when @astrojs/check or typescript can't be resolved from the project root: astro would otherwise prompt to install them, which hangs under rr's captured run, or exits 0 having checked nothing when stdin is closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S4ufXKrCxJ4ZzpevL2fkEH
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S4ufXKrCxJ4ZzpevL2fkEH
…version astro 7 requires Node >=22.22.0, above the repo's 22.18.0 floor that CI now tests. On the floor, the tests that start astro are skipped; the missing-dependency tests never start it and still run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S4ufXKrCxJ4ZzpevL2fkEH
20da4b9 to
f854273
Compare
Preview releaseLatest commit: Some packages have been released:
Note Use the PR number as tag to install any package. For instance: |
Summary
A new official plugin,
@rrlab/astro-plugin, providestypecheckby runningastro check. In an Astro project,rr tscandrr checkthen type-check.astrofiles, so www can drop its separatepnpm astro checkCI step.run-run/ +├── astro-plugin/ # AstroCheckService → `astro check`; install adds @astrojs/check + typescript └── cli/src/lib/plugin/ └── directory.ts # + astro: { capabilities: ["typecheck"] }astro checkchecks plain.tsfiles too (verified on www), so in an Astro project it replacests. Only one plugin can providetypecheck. If two do, the registry raises the usualMultipleProvidersError, and you narrow one withonly.Guard against a silent pass. When
@astrojs/checkortypescriptcan't be resolved from the project root,astro checkprompts to install it instead of checking. Under rr's captured run that prompt hangs. With stdin closed, astro exits 0 having checked nothing. The plugin resolves both packages first, with astro's own lookup (require.resolve(pkg, { paths: [root] })). If one is missing, it fails the row withrr plugins add astroand never starts astro.Reviewable choices:
installadds:@astrojs/checkandtypescript, neverastro, since the host owns its framework version.uninstallremoves the same two.astro >=5.0.0,@astrojs/check >=0.9.0,typescript ^5 || ^6. Thetypescriptrange matches@astrojs/check's own, and astro check refuses TS 7.engines.nodeis>=22.18.0, like every published package since fix: require Node 22.18.0, test it in CI, and check the docs' plugin list #272. astro 7 needs>=22.22.0itself and says so when it starts.vitest.config.tsis not the one-liner the checklist asks for. pnpm's bin shim puts its virtual store onNODE_PATH, which lets the tmp Astro projects incheck.test.tsresolve packages they don't have. The config dropsNODE_PATHbefore the workers fork.arch-criticconsultation, not one per plugin, and this plugin reuses an existing capability with no kernel change.Known limitations, not addressed here:
rr tscrunsastro checkin every package with atsconfig.json, whether or not it is an Astro project.rr tsc doctorresolves the deps from the invocation directory. At a monorepo root whose deps live only inapps/www, it would report them missing.Evidence
Tests:
run-run/astro-plugin/src/__tests__/check.test.tsruns the realastro checkon a tmp Astro project:Before (guard removed): the missing-dep test hangs until the 5 s timeout, because astro is waiting on its install prompt.
After: 14/14 pass on Node 24. On the 22.18.0 floor that CI also runs, the 4 tests that start astro are skipped, because astro 7 requires Node >=22.22.0, and 10/14 pass.
pnpm build,pnpm testandpnpm rr checkare green on both Node versions; on the floor the tests ran withturbo --force, without cache.www, end to end. I packed
@rrlab/cliand@rrlab/astro-pluginfrom this branch as tarballs and installed them into an isolated copy of www, with no source link. I addedastro()torun-run.config.mtsby hand.Merge Danger
Door: two-way
This adds a new package and one entry to
PLUGINS_DIRECTORY. No existing plugin and no kernel behavior changes.Blast Radius: contained
pnpm-lock.yamlgrows by about 2.5k lines fromastroand@astrojs/check, which are only devDependencies of the plugin.pnpm auditreports 0 advisories, as on main after fix(deps): clear known vulnerabilities and add a weekly dependency audit #273.@rrlab/climinor (new directory entry and README row) and@rrlab/astro-pluginminor (0.0.0 → 0.1.0). Under ADR 011, a CLI minor doesn't bump the other plugins.rr plugins add astro, it must move to the released@rrlab/climinor. The plugin's peer publishes as^<that version>, and www's current1.3.2doesn't know theastroalias.🤖 Generated with Claude Code
https://claude.ai/code/session_01S4ufXKrCxJ4ZzpevL2fkEH