Repository navigation
fix(cli): the setup reminder, the swizzle StyleX note, and a doctor line say only what is true - #7262
Conversation
…t is true The "run init to finish setup" reminder checked only the folder a command ran in for init's block, so every package of a monorepo initialized at its root got it on every command, and so did this repository, whose own agent prompt uses a different block. Inside a git repository it now looks in the agent docs of every folder from the project up to the repository root, the docs coding agents read. Outside a repository it checks the project folder as before. Running the CLI from its own source checkout skips the reminder inside that checkout. `astryx swizzle` said StyleX components render unstyled with no error without a StyleX compiler. The StyleX runtime throws on the first uncompiled `stylex.create` call, so the page does not render; the note now says so, and a test checks the runtime still throws what the note quotes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression40 of 482 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 20 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
The CLI and Core install scripts printed the same "run init to finish setup" reminder under the one-folder check, so installing either package inside a workspace package of a monorepo initialized at its root still printed it. isAstryxPromptInReach now lives in the dependency-free setup contract both scripts load, Core's copy is regenerated from it, and both scripts call it. Tests install each script with its contract under a temporary monorepo's node_modules and run it the way npm does.
There was a problem hiding this comment.
Thanks — both notes now say what actually happens. The repository-root reach check lives in the shared dependency-free setup contract, Core's generated copy is regenerated from it, and the per-command hook and both postinstall reminders all use it, so a workspace package in a root-initialized monorepo is quiet at install time and on commands alike. The still-reminded paths also read correctly: no block up to the repository root still nudges, a project outside a repository is checked in its own folder, and --json output is unchanged. Running the CLI from its own source checkout stays quiet there, while an installed CLI under node_modules is unaffected.
The swizzle correction is equally well pinned: the note now states that importing uncompiled StyleX throws the quoted stylex.create runtime error (pinned by a test against the runtime Core resolves), which sends people to their build setup rather than to a styling problem that does not exist.
No public API, command, option, exit behavior, or JSON shape changes, and the patch classification for both @astryxdesign/cli and @astryxdesign/core matches the victim-free correction. I have no blocking findings.
[Automated review]
…onfig names In a package with no astryx.config that loads its own integration manifest, the implicit-integrations check said every loaded integration is named in astryx.config. The one loaded integration is the package itself. The check now names the package's own manifest in that case, and both kinds when configured integrations load beside it. The configured-only wording is unchanged.
There was a problem hiding this comment.
Thanks for making these notes say what actually happens — the repository-root reach model in the shared setup contract (with Core's copy regenerated and both postinstall reminders using it), the source-checkout quietness, the corrected StyleX wording pinned against the runtime, and the doctor line that now names the package's own manifest instead of inventing a config entry all read as the right restorations. The still-reminded paths (no block up to the repository root, outside a repository, --json) also hold up.
One blocker before the swizzle fix is true end to end: the guide the corrected note sends people to still teaches the old symptom. The styling overview says a swizzled component that "renders with no styles and no error" almost always means a missing compiler, and the StyleX Build Setup section says without one the component "renders completely unstyled: no error, no warning" (including in its symptom list). After this change the note correctly says importing throws and the page does not render, so following its pointer lands on the opposite diagnosis.
Smallest path to done: reword those three guide sentences (styling overview; StyleX Build Setup prose and symptom bullet) to the import-throw fact, keeping the bundler and Next.js guidance as-is. Nothing else in the change needs rework — the reminder layers, doctor line, and patch classification for both packages are ready.
[Automated review]
There was a problem hiding this comment.
Thanks — the setup reminder, the swizzle StyleX note and the doctor line now describe what actually happens, and the reminder still nudges wherever no init block is in reach; one doctor case needs a change before this is ready. When a package's own astryx.integration.* fails to load, describeNoImplicit (packages/cli/api/doctor/doctor.mjs:365) still counts it as loaded, so astryx doctor prints “None - the only loaded integration is this package's own manifest (@acme/kit).” right beside the line reporting that @acme/kit could not be loaded. Leaving records that carry __loadError out of that sentence (falling back to the existing None loaded. wording) and adding a checkImplicitIntegrations case for a failed own manifest would resolve it; nothing else needs rework.
[Automated review]
| * @returns {string} | ||
| */ | ||
| function describeNoImplicit(integrations) { | ||
| const own = integrations.filter(integration => integration.__local); |
There was a problem hiding this comment.
A manifest that fails to load still reaches this filter: the project keeps a __local record carrying __loadError, so with a syntax error in astryx.integration.mjs doctor prints “None - the only loaded integration is this package's own manifest (@acme/kit).” next to the line saying @acme/kit could not be loaded. One way to keep the sentence true:
const own = integrations.filter(integration => integration.__local && !integration.__loadError);
const configured = integrations.filter(integration => !integration.__local).length;
if (own.length === 0 && configured === 0) return 'None loaded.';plus a checkImplicitIntegrations case with {__local: true, __loadError: 'boom', name: '@acme/kit'}.
…loaded A package's own manifest (or a configured one) that fails to load keeps a record carrying its load error. The implicit-integrations line now leaves those records out, so doctor no longer says the only loaded integration is the package's own manifest right beside the line reporting it could not be loaded; with nothing loaded it says "None loaded."
There was a problem hiding this comment.
Thanks — the setup reminder, the swizzle StyleX note and doctor's implicit-integrations line now say what actually happens, and an integration manifest that fails to load now gets “None loaded.” with a test pinning it. The reminder still reaches every project with no init block up to its repository root, and --json output, exit codes and check ids are unchanged. Nothing blocks this; one optional touch-up is a Changeset sentence noting that an app whose only configured integration fails to load now also sees “None loaded.”.
[Automated review]
User impact
Three messages the CLI prints state something false.
package.jsonprints "Next step: run… initto finish setup and install the Astryx agent prompt." unless init's block is in the agent docs of the exact folder the command runs in. Installing@astryxdesign/coreor@astryxdesign/cliprints the same reminder under the same one-folder rule. In a monorepo that raninitat its root, every package gets the reminder on every command and every install, although its agents already read the root's prompt. Inside this repository it prints on every command at the root and in every workspace package.astryx swizzleon a StyleX component says that without a StyleX compiler the components "render unstyled (no error)". StyleX's runtime throws instead: importing the swizzled source fails with "Unexpected 'stylex.create' call at runtime. Styles must be compiled by '@stylexjs/babel-plugin'.", so the page does not render. Someone told to expect "unstyled but working" looks for the problem in the wrong place.astryx doctorsays "None — every loaded integration is named in astryx.config." With no config there is no file to name it; with a config, the package's own manifest still loads as itself, not because the config names it.Problem and solution fit
initnever overwrites it.The reminder keeps its job for projects that have not run
init; only its detection changes. The swizzle note keeps the same structure and link, and states what actually happens.Expected behavior and authority
The reminder's own contract in the CLI and in both install scripts: it appears "if this project hasn't run
astryx inityet". The swizzle note's purpose is to tell the user what happens without a compiler; the StyleX runtime that Core depends on defines that, and a test now checks it.Smallest restoration
--jsonnever prints the reminder;initandagent-docsnever print it; the swizzle JSON (usesStyleX) is unchanged; the doctor check keeps its id, status, and keys, and only itsmessagetext changes, in text and--jsonalike.Evidence
astryx docs --indexat the root, inpackages/coreand inapps/docsiteeach print the reminder. Installing either package inside a workspace package of a monorepo initialized at its root prints it too.astryx swizzle Buttonprints "Without one they render unstyled (no error)."astryx doctorin an integration package prints "every loaded integration is named in astryx.config", with or without a config..gitfile marks the root; a project inside the source checkout is quiet while the same project in the temp folder is not. Each install script is copied with its contract into a temporary monorepo'snode_modulesand run the way npm runs it, quiet and nudging cases both. A test calls Core's StyleX runtime and checks the error the swizzle note quotes. Doctor tests pin the own-manifest and mixed cases, and the configured-only case keeps its wording. Reverting any one of the reminder changes fails a test.Scope
Testing
typecheck:strict, Coretypecheck, eslint on the changed files,check:repo(including the setup-contract copy check), the CLI structure check, and Changeset coverage.