Repository navigation
onsystem@0.10.0
onsystem 0.10.0 layers an app's config over the one its design-system package declares, instead of replacing it.
- An app's own
onsystem.config.jsonnow builds on its design-system package's config: itsrulesapply over the package's, rule by rule, and what it leaves out (components,importPath, docs, tokens) comes from the package, unless it setscomponentsof its own. Before, a config that only turned one rule to"warn"lost the package's components and tokens, andchecksaidNo design system foundand passed."extends": falsereads a config alone, as before. - A monorepo root's config does the same when you check from the root, so its
rulesandoverridesapply to every project without a config of its own. initno longer writes pnpm's version-named paths (node_modules/.pnpm/@acme+ui@1.0.0…) into a config, which brokecheckafter an upgrade.init --forceon a package that declares a config writes only$schema, keeps the components of an app config that names its own, and keeps atokenslist that names the app's own stylesheet beside the package's.inspectnames both configs it reads, andinspect --explainsays where the components come from.onsystem export --format design-mdkeeps each table row on one line when a comment or value wraps over lines (#237).
This can change what check reports in an app that has a config and a design-system dependency that declares one: it now gets the package's rules where its config leaves them out.
Minor Changes
-
#202
3798fb7- An app's own config builds on the config its design-system package declares, instead of replacing it. What the app's config leaves out comes from the package's, unless it setscomponentsof its own:components, with the package'simportPath,docs,elements,tokensandlibraries. A config that setscomponentsreads its tokens as before: withouttokens, from the app's own stylesheet (app/globals.css) and the ones it imports. Itsrulesapply over the package's, rule by rule, either way, and, with the package's components, itselementselement by element; the package'sexcludepatterns are added to the app's; itsoverrides,tsconfigandincludeDesignSystemare its own. Before, an app config that only turned one rule to"warn"lost the package's components and color tokens: in an app that installs the package,checksaidNo design system foundand passed.inspectnames both configs (config onsystem.config.json, over node_modules/@acme/ui/onsystem.config.json (declared by @acme/ui))."extends": falsein the app's config reads it alone, as before. This can change whatcheckreports in an app with a config of its own whose dependency declares one: it now gets the package's rules where its config leaves them out, and the package's components and tokens when it sets nocomponentsof its own. A workspace package whose"onsystem"field cannot be read is a warning in such an app, which then reads its own config alone, and still an error in an app without one.A monorepo root's config builds on a project's design-system package config the same way in
checkandinspectfrom the root, so itsrulesandoverridesapply to every project without a config of its own. Before, the config a project's design-system package declared took their place, without a word. From the project's folder, the root's config is still not read.init --forcein an app on such a package, without a config or with one whosecomponentsmatch no file outside the package, writes a config with only$schema, for the app's own rules and overrides, and keeps the package's components,importPath, tokens and rules. Before, it wrote the package's paths into the app's config, or a config that lost the package's components. In an app whose config names components of its own, it writes them again, as before.initin an app whose design system zero config reads from an installed package leavescomponentsandtokensto zero config. It wrote paths into the package's folder, which pnpm names by version (node_modules/.pnpm/@acme+ui@1.0.0_react@19.0.0/node_modules/@acme/ui/…), so after an upgradecheckfailed withToken file not found, and the component files it listed matched nothing.In a design-system package whose
filesleave out its component sources,initsays that apps installing it read its components from the type declarations it publishes, when itspackage.jsonnames some. It said they get no component checks, which holds only without type declarations.
Patch Changes
- #237
5a10990-onsystem export --format design-mdkeeps each table row on one line. A token whose comment or value the stylesheet wraps over several lines, such as a two-part--shadow-lg, broke its row: GitHub showed the rest of it as a code block and every later row in that table as a paragraph. The lines are now joined with spaces.