Repository navigation
v0.8.0
Summary
Vanity's layer order now travels with its CSS. Component rules keep their intended precedence even when their stylesheet arrives before the system stylesheet. Configured layer roots also work in Nuxt, and development edits retire old Vite stylesheets after each page installs their replacements. Overlapping saves avoid errors from outdated system inputs, while genuine failures stay visible and repair reliably.
Fixed
- Repository tooling typechecks from a clean checkout before the SDK is built.
- Component rules retain their rank above lower system layers, such as a reset, regardless of stylesheet delivery order. This includes Nuxt development, where stylesheets for other routes can arrive first.
compiler.layerOrdertakes effect in Nuxt development and builds.- Development edits that reorder layers or remove rules take effect after replacement CSS is installed. Compatible edits keep the page and runtime state; application-imported runtime identity changes, root-order changes, and configured-system recovery retain the reload boundary.
- Repairing a failed configured system reloads the page once, after all replacement CSS is ready.
- Overlapping system and stylesheet saves use the latest system, avoiding spurious missing-token errors and stale exported values. Genuine failures remain visible and identify any retained CSS as excluding the failed edit.
- Repairing overlapping failures installs current CSS for every consumer, including stylesheets an earlier failed update had already compiled.
- System edits update stylesheets previously requested only by SSR without Vite's misleading “outdated pre-bundle” error.
- Complete layer headers survive repeated compilation through cached systems, including independently bundled authoring code.
- Invalid layer or axis names, repeated CSS identities, and axes sharing a generated control attribute fail locally with an authored diagnostic instead of silently losing rules or coupling controls.
- Escaped axis names generate matching CSS selectors and DOM/SSR attributes, including native color-scheme controls and quoted names. Authored keys stay intact.
- Axis and mode keys such as
constructorand__proto__survive composition, token branches, native JSON, and restored runtime selection as own data. Independent systems keep independent branch data. - Direct and detached axis configurations preserve
derivecallbacks andnativepolicy, with contextual callback parameters and inferred branches. Authored mode values still win over derivations. - Axis types expose only capabilities their configuration guarantees. Optional derivations and callbacks returning
undefinedremain usable without promising an absent branch. - Reused plugin instances keep the correct layer-order asset across successive Vite HTML builds. Builds without listed layers skip asset-owner lookup, including overlapping builds on Vite 6.
- Token rename stays within its originating graph, including builder keys whose literal spelling also appears in unrelated graphs or types.
- Accepting the editor’s type-only declaration import clears its ambient-source notice; unrelated imports leave the notice intact.
- Authoring tests run through the application’s mounted Vite configuration on Vitest 5.
$case()preserves the selected case's value type in build and runtime handles. Dynamic addresses retain their possible values, reservations remainundefined, and extra address keys are rejected.- Extracted case selectors can be exported by declaration-emitting libraries. Runtime projection types share token identities across the core and runtime entrypoints, preserving cases and setters.
- Runtime custom-property helpers accept typed values created through the core entrypoint.
bindPort()accepts narrow ports and preserves their declaration types. - Token hovers show resolved public traits without repeating the system's token-definition and axis configuration types.
- Constructor, explicit-unit, composition, recipe, anatomy, port and runtime-control documentation survives native member completion, including published declarations. Port guidance describes
dec()and the actual metadata behavior. - Incompatible calculation sums name the dimensions and suggest compatible operands at the offending value; signature help explains the active operand. Known unions with a possible incompatible dimension require narrowing before the sum.
- Agent-context field documentation explains semantic paths, emitted contexts, portability and defaults. The guide distinguishes focused explanation from complete token-vocabulary context.
Added
VANITY_SYSTEM_INVALID_LAYERidentifies invalid system layer names, including empty entries inpolicies.layerOrder.
Changed
- Repository spike experiments share the workspace dependency catalog and lockfile, including Selenita 0.3 and Vitest 5. Version-specific Vite 6 host evidence keeps an explicit host pin.
- Compiler dependencies are refreshed, including OXC’s TypeScript parser fixes. Ordinary styling peer ranges are unchanged; editor-DX testing now uses Selenita 0.3.
compiler.layerOrderentries must be complete CSS identifiers with unique decoded identities. Equivalent escape spellings name one layer; omitted configured roots follow in configuration order.- Without
compiler.layerOrder, plain Vite adds no document-first root-order stylesheet. Vanity's rank among other layered CSS follows stylesheet order. - The linked layer-order stylesheet is content-hashed under
build.assetsDir. - Every Vanity stylesheet opens with the layer statements it needs to preserve system and host-root order.
VanityOpenAxisConfigandVanityAxisConfigrequirecontrolandderivewhen their type arguments guarantee those capabilities. Optional fields and derivations that may omit results guarantee no activation or branch.- The testing kit returns reusable Selenita configuration through
createVanityProjectConfig(), composed with Selenita’sdefineProject()orcreateProject(). Fixture helpers come directly from Selenita.
Upgrade notes
- If your application mixes Vanity with other layered CSS and relies on their relative rank, list those roots in
compiler.layerOrder, for example['app', 'theme', 'base', 'components', 'utilities']. - Rename rejected layer or axis names and remove repeated CSS identities. Empty
policies.layerOrderentries now reportVANITY_SYSTEM_INVALID_LAYERinstead ofVANITY_POLICY_INVALID. - Rename one axis if two names generate the same control attribute, such as
colorSchemeandcolor-scheme. - Regenerate portable artifacts for escaped axis names: their generated attributes and identities now reflect the decoded name.
- Regenerate artifacts for axis/mode keys previously lost to inherited JavaScript members: restoring their own metadata can change compatibility and runtime identities.
- Regenerate artifacts for direct configurations whose
deriveornativefield was ignored: preserving those fields can change CSS, compatibility, and runtime identities. Ordinary names and already-preserved configurations retain their identity bytes. - Supply
controlorderivewhen explicitly annotating known capabilities. Inference orsatisfiespreserves supplied fields and callback results. Author a mode value or narrow its derivation before treating an optional branch as guaranteed. - TypeScript still counts inherited members as structure. A sparse literal that omits a declared
constructorortoStringcan fail assignability even though it is valid at runtime. - Remove a Nuxt
app.headlayer statement added as a workaround and usecompiler.layerOrder. - For editor-DX tests, update to Selenita 0.3 and Vitest 5. Replace
defineVanityProject(options)withdefineProject(createVanityProjectConfig(options)), importingdefineProjectfrom@mszr/selenita/vitest. Standalone tools use corecreateProject()and own disposal. The testing-kit guide shows setup and lifecycle. - Import
cursor,mark,snippetand the project constructor from the same Selenita entrypoint; the testing kit no longer re-exports fixture helpers. - Replace old completion matchers with
toSuggest()/toSuggestOnly(), and groups with scoped snippets plusatEach(). A negatedtoSuggest()list rejects every listed name. Selenita supplies its own TypeScript 6 editor backend, independently of Vanity’s compiler tooling.