Skip to content

fix(cli): the setup reminder, the swizzle StyleX note, and a doctor line say only what is true - #7262

Merged
josephfarina merged 6 commits into
mainfrom
setup-nudge-in-reach
Oct 20, 2026
Merged

josephfarina merged 6 commits into
mainfrom
setup-nudge-in-reach

Conversation

@josephfarina

@josephfarina josephfarina commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Three messages the CLI prints state something false.

  • The setup reminder. Every command in a project with a package.json prints "Next step: run … init to 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/core or @astryxdesign/cli prints the same reminder under the same one-folder rule. In a monorepo that ran init at 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.
  • The swizzle StyleX note. astryx swizzle on 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.
  • A doctor line. In an integration package, where the package's own manifest loads, astryx doctor says "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

  • Why the reminder misfires: it checks one folder, but coding agents read every agent doc between the repository root and the folder they work in. This repository's own agent prompt uses a different, hand-written block on purpose, so init never overwrites it.
  • Why the swizzle note misleads: it describes a runtime that does not throw; the StyleX runtime throws for every uncompiled call.
  • Why it matters: a note that is wrong on every invocation trains people to ignore it, and a note that predicts the wrong failure sends them debugging the wrong thing.

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 init yet". 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

  • Reminder, all three places it prints (every command, the CLI install script, the Core install script): inside a git repository, look for init's block in the agent docs of every folder from the project up to the repository root. Outside a repository, keep checking the project folder only. The check lives in the shared, dependency-free setup contract that both install scripts load; Core's copy is regenerated from it and stays byte-identical.
  • Commands only: when the CLI runs from its own source checkout, skip the reminder inside that checkout.
  • Swizzle note: "Without one, importing them throws "Unexpected 'stylex.create' call at runtime" and the page does not render."
  • Doctor line: the implicit-integrations check says "named in astryx.config" only for integrations the config names. When the only loaded integration is the package's own manifest, it says so and names it; when both kinds load, it says both.
  • Unchanged: --json never prints the reminder; init and agent-docs never print it; the swizzle JSON (usesStyleX) is unchanged; the doctor check keeps its id, status, and keys, and only its message text changes, in text and --json alike.

Evidence

  • Reproduction before the change: in this repository, astryx docs --index at the root, in packages/core and in apps/docsite each print the reminder. Installing either package inside a workspace package of a monorepo initialized at its root prints it too. astryx swizzle Button prints "Without one they render unstyled (no error)." astryx doctor in an integration package prints "every loaded integration is named in astryx.config", with or without a config.
  • Result after the change: none of those print the reminder; the swizzle note says importing throws and the page does not render; doctor says "None — the only loaded integration is this package's own manifest (@acme/kit)."
  • Representative unchanged path: a fresh project outside any repository still prints the reminder, and so does a monorepo package with no init block up to the repository root, for commands and installs alike.
  • Regression tests: a monorepo package with init's block at the repository root is quiet; a package with nothing up to the repository root still gets the reminder; a block above the repository root does not count; a worktree's .git file 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's node_modules and 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

  • One defect is restored: CLI messages that state something false.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Full node test project, Core's install-script tests, typecheck:strict, Core typecheck, eslint on the changed files, check:repo (including the setup-contract copy check), the CLI structure check, and Changeset coverage.

…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.
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 20, 2026 3:40am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 9, 2026
@astracat-bot

astracat-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 20, 2026, 4:05 AM UTC

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

40 of 482 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
@josephfarina josephfarina changed the title fix(cli): the setup reminder and the swizzle StyleX note say only what is true fix(cli): the setup reminder, the swizzle StyleX note, and a doctor line say only what is true Oct 10, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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."

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]

@josephfarina
josephfarina merged commit 2bb6c74 into main Oct 20, 2026
56 checks passed
@github-actions
github-actions Bot deleted the setup-nudge-in-reach branch October 20, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 808cdf7a Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant