Repository navigation
[fix] Template and build tell you what the template needs that your project lacks - #7183
Conversation
…roject lacks When astryx template scaffolds a file that imports packages the project does not have (heroicons, recharts, lucide-react, etc.), the receipt now includes a ready-to-run install command with version ranges from the CLI workspace. astryx build shows the same notes on its start template. When the template uses StyleX and the project has no compiler plugin, the receipt warns and points to astryx docs styling-overview. The agent-docs block stops saying "do not use xstyle" flat-out and acknowledges that some templates need it. detectStylingSystem now covers @stylexjs/rollup-plugin, webpack-plugin, and nextjs-plugin alongside the existing entries.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Thanks — the setup notes themselves work as described. I reproduced the examples locally: table-filter in a fresh project now reports the lucide-react install command (with the workspace version range) plus the StyleX compiler note, dashboard-scorecard reports recharts/@heroicons/react, and a project that already has everything gets no notes. Targeted template/build/agent-docs tests and the JSON-API typecheck pass.
Two changes are needed before this can be approved:
- Document the new response fields for consumers.
notes,missingPackages, andinstallCommand(and the build start's optionalnotes) are now part of stable JSON responses, but the consumer-facing descriptions that enumerate those receipts — inresponse-types.doc.mjs,template.doc.mjs, andbuild.doc.mjs— still list only the old fields. Please name the new fields there so JSON consumers can discover them; the type files alone don't reach that audience. - Don't report Node builtins as installable packages. A template importing
node:fsorpathcurrently yieldsnpm install node:fs path. No built-in template does this today, but excludingnode:specifiers and builtin module names (with a small test) keeps the advice trustworthy for integration templates.
Everything else checks out, including the additive shape of the JSON changes and the adapter routing on the build side.
[Automated review]
- Name notes, missingPackages, installCommand (and BuildStart notes) in response-types.doc.mjs, template.doc.mjs, build.doc.mjs. - Exclude node: prefixed imports and builtinModules from the package scanner, with tests for both and for subpath-to-root mapping. - Regenerate README tables.
|
Both addressed in 656efa8:
|
# Conflicts: # packages/cli/README.md
There was a problem hiding this comment.
Both items from the last review are addressed; one thing from the merge needs fixing before approval.
- The new fields are now described where JSON consumers look:
response-types.doc.mjsandtemplate.doc.mjsnamenotes,missingPackagesandinstallCommand, andbuild.doc.mjsnames the start template's optionalnotes. - Node builtins are excluded:
node:fs,pathandfs/promisesno longer appear inmissingPackages(checked withextractImportedPackageson this head;recharts,@heroicons/reactand@astryxdesign/corestill do). The template-needs and agent-docs suites pass 116/116. - Fix the
packages/cli/README.mdmerge resolution. The merge frommainconflicted in the generated README and was resolved to this branch's copy, which drops the[DEPRECATED: DEP-0006 …]marker thatmainadded to thelayoutcommand row (#7175).pnpm -F @astryxdesign/cli readme --checkfails at this head, and CI does not run that check, so it would land as-is. Runpnpm -F @astryxdesign/cli readmeon the merged tree and commit the result; the response-types rows are already right.
The Changeset reads accurately for the shipped behavior.
[Automated review]
There was a problem hiding this comment.
Approving. The README is regenerated on the merged tree, and that is the only change since the last review.
generate-cli-readme.mjs --checkpasses at this head ("README generated tables are in sync"); thelayoutcommand row carries the DEP-0006 deprecation marker frommainagain, and thetemplate.copyrow names the new fields. The diff from d0988c3 ispackages/cli/README.mdonly (18 lines changed).- Everything verified on the previous head stands: the new JSON fields are described in
response-types.doc.mjs,template.doc.mjsandbuild.doc.mjs; Node builtins (node:specifiers and builtin module names) are excluded frommissingPackages; template-needs and agent-docs suites pass 116/116; the fields are additive beside existing ones and build reads project deps through its adapter.
[Automated review]
When
astryx templatescaffolds a file that imports packages the project does not have, the receipt now says what is missing and prints a ready-to-run install command.Before: scaffolding
table-filterinto a fresh Vite app with no extra deps gives no hint thatlucide-reactis needed or that StyleX requires a compiler plugin. The template crashes at runtime.After: the scaffold output includes:
Install missing dependencies: npm install lucide-react@"^1.18.0"This template uses StyleX. Your project needs a StyleX compiler plugin — see astryx docs styling-overview for setup steps.astryx buildshows the same notes on its start template. Projects that already have everything installed see no change.What changed
template copybuild kitagent-docsstyling-overview.detectStylingSystem@stylexjs/rollup-plugin,webpack-plugin, andnextjs-pluginthe setup doc recommends.styling-overviewdocJSON
template.copyreceipt gainsnotes: string[],missingPackages: string[],installCommand: string | null. All additive, always present.BuildStartgains optionalnotes?: string[](AST-048 DEC-5: additive JSON). No existing field changes shape.Tests
template-needs(import extraction, missing-package detection, StyleX compiler, package-manager detection).Proof
Fresh Vite React app with only react + core installed:
astryx template table-filter→ notes: lucide-react install + StyleX warningastryx template dashboard-scorecard→ notes: recharts + heroicons install + StyleX warning@stylexjs/rollup-plugin→ notes: emptyBase: 9613feb