Repository navigation
feat(cli): add the inspect command and a config type check - #346
Merged
alexgrozav merged 3 commits intoOct 21, 2026
Merged
Conversation
An agent had no way to list what a configuration registers short of reading its source or the generated CSS. `styleframe inspect [entry] [section] [--json]` prints the snapshot `inspect()` returns, all of it or one section, as readable lists or as one JSON document on stdout. `styleframe check --typecheck` runs the project's own `tsc` on the entry file, through a temporary tsconfig outside the project that extends the nearest `tsconfig.json`, and reports each type error as a `typescript` diagnostic beside the ones `validate()` finds. TypeScript 7 ships no JavaScript compiler API, so it spawns the `tsc` binary, and `typescript` becomes an optional peer of the CLI.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The temporary tsconfig that `check --typecheck` writes lived in the OS temp directory, so TypeScript resolved `types` entries like `node` or `vite/client` from there and reported a false TS2688. It now lives in the project's `node_modules/.cache`, which resolves the same packages as the project, and is removed afterwards. An inherited `incremental` or `composite` made `tsc --noEmit` write build info into the project, overwriting its `.tsbuildinfo` or leaving files in its `outDir`. The temporary config turns both off.
Turning `composite` off for every project dropped the `declaration` it implies, so a project with `declarationMap` or `emitDeclarationOnly` failed `check --typecheck` with TS5069. Keeping `composite` on instead rejects any local file the config imports with TS6307. The type check now asks `tsc --showConfig` for the resolved options and, only for a composite project, turns `composite` off and `declaration` on. Creating the temporary directory in a read-only `node_modules`, like under Nix or in a root-owned image, threw a raw EACCES stack trace. It now falls back to the system's temporary directory.
alexgrozav
merged commit Oct 21, 2026
4c74470
into
styleframe-agent-ergonomics-uxf-406
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
Adds
styleframe inspect [entry] [section] [--json], which prints the snapshotinspect()returns: the variables, themes, utilities, modifiers and recipes a configuration registers, all of them or one section, as readable lists or as one JSON document on stdout. An agent can now see the token names, the themes a preset adds, a utility's class names and a recipe's variant options without reading the source or the generated CSS.The
checkcommand gains--typecheck. It resolves thetscof the TypeScript the entry file's project installs (TypeScript 7'stypescriptpackage ships no JavaScript compiler API), writes a temporary tsconfig that extends the nearesttsconfig.jsonwithfiles: [<entry>]andinclude: [], runstsc --noEmiton it and reports each type error as a diagnostic with the codetypescript, itsTSnumber in the message andfile:lineas its path. The temporary tsconfig sits in the project'snode_modules/.cache, sotypesand@typesresolve as they do for the project, and it's removed afterwards. Whennode_modulesis read-only, it goes in the system's temporary directory instead. It turnsincrementaloff, and for acompositeproject it turnscompositeoff and keepsdeclarationon, so the check writes no build info and accepts local imports. Without a resolvable TypeScript it prints one line and exits with1.typescriptbecomes an optional peer dependency of@styleframe/cli.Related issue
None.
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 for the agent ergonomics work, on top of the
checkcommand, notmain. The fixtures with deliberate type errors are.mtsfiles, so the CLI package's owntsc, which includessrc/**/*.ts, leaves them alone.