Repository navigation
feat(cli): add the check command and fail builds on errors - #344
Merged
alexgrozav merged 6 commits intoOct 21, 2026
Merged
Conversation
A reference to a missing token in a recipe or a utility value built silently and emitted a var() that is never declared, and a misspelled theme override or a duplicate variable lost a value without a word. validate(instance) walks the finished instance and returns every problem in one pass: unresolved-reference, undefined-theme-override and duplicate-variable, each with the path that made it and the closest token name within two edits. transpile() runs it once and returns the diagnostics beside files, or throws one error listing them all under the new strict option. variable() and the utility namespace fallback keep a record on the root of what the finished tree no longer holds. Nested at-rules keep hyphenated names, so @starting-style and @font-feature-values emit as written. The theme gains z-index.tooltip, which the tooltip recipe already used, and the xs chip indicator stops referencing the undefined font-size.4xs. The transpiler and barrel peer on the core release that ships validate(). The theme typecheck builds again without the duplicate wcagContrast declaration.
A plain @token string in a selector or theme still throws when it's defined, so the docs and changeset now say which references validate() reports. The default z-index output blocks list the tooltip level, and a namespace fallback whose variable was defined later says so instead of claiming no variable exists.
`styleframe build` logged a failed build and exited 0, so neither CI nor an agent could trust it. It now prints one warning line per diagnostic that `validate()` finds, exits 1 under `strict: true` without writing files, and exits 1 when the build fails. The new `styleframe check [--json]` reports the same diagnostics without writing anything, and exits 1 on any. The plugin logs each diagnostic once per build, although it transpiles up to three times, and under `strict` the debounced type generation in the dev server sends its failure to the error overlay instead of only logging. Core gains `inspect(instance)`, a JSON-serialisable snapshot of the variables, themes, utilities, modifiers and recipes an instance defines.
…406' into add-check-command-uxf-411
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
`styleframe check` on an entry that doesn't exist reported a clean config, because the loader falls back to an empty instance. It now prints "Config file not found" on stderr and exits 1. The plugin keyed logged diagnostics on code and path, so a second unresolved reference in the same value was never logged. It now keys on the message too. The check tests now run in a temporary working directory with every consola level on, so a written file or a stray stdout line fails them.
`check` resolved the entry with `path.resolve`, which drops a trailing slash and collapses `..` by text, so an entry the loader can't find, like `styleframe.config.ts/`, still loaded an empty instance and passed. It now builds the path with `path.join`, as the loader does.
alexgrozav
merged commit Oct 21, 2026
3b0fa98
into
styleframe-agent-ergonomics-uxf-406
2 of 3 checks passed
8 of 13 tasks
This branch was successfully deployed
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.
Description
styleframe buildlogged a failed build and exited with0, so neither CI nor an agent could trust its exit code. This PR makes the CLI and the bundler plugin report whatvalidate()finds, and adds a command that checks a configuration without building it.styleframe buildprints one warning line per diagnostic (code, path, message with the did-you-mean), exits with1understrict: truewithout writing any files, and exits with1when the build fails.styleframe check [entry] [--json]runsvalidate()on the configuration, writes nothing, and exits with1on any diagnostic or when the entry file doesn't exist. With--json, it prints one{ "ok", "diagnostics" }document on stdout and nothing else.@styleframe/pluginlogs each diagnostic once per build, although it transpiles up to three times, and fails the build understrict. In the dev server, the debounced type generation sends a strict failure to the error overlay instead of only logging it.inspect(instance)in@styleframe/corereturns a JSON-serialisable snapshot of the root variables (with the custom property and value they emit), themes, utilities (values, class names, modifiers), modifiers and recipes (variant options and defaults).The CLI inlines
@styleframe/coreinto itsdist, as it already does, so itspackage.jsondoesn't change.Related issue
Builds on #343.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passespnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scopeNotes / screenshots
This PR targets the integration branch, which collects the remaining layers of this work before one PR to
main. Builds through the plugin, Inkline's included, will start showing the warnings, which the changeset says.