feat(cli): one config#5099
Conversation
🦋 Changeset detectedLatest commit: f9cb8f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Preview deployments for this pull request: storybook - |
8c4a325 to
734281a
Compare
📦 Snapshot release publishedPublished at
Install with: npm install @digdir/designsystemet-css@testnpm install @digdir/designsystemet-react@testnpm install @digdir/designsystemet-types@testnpm install @digdir/designsystemet-web@testnpm install @digdir/designsystemet@test |
There was a problem hiding this comment.
Pull request overview
Introduces a unified CLI config flow so running designsystemet (default command) reads designsystemet.config.(json|jsonc) and executes configured outputs (design-tokens and/or CSS), while also evolving the config schema to support defaults and a “next” output-based schema.
Changes:
- Adds a default
configcommand to the CLI that parses/validates config and runs a sortedoutput[]pipeline (design-tokens before CSS). - Updates schema handling: applies defaults for
typography/borderRadius, and generates a newconfig-next.schema.json. - Updates repository scripts/config to use the unified CLI config (
update:themeanddesignsystemet.config.json).
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/css/package.json | Removes theme-generation step from CSS package build script (expects unified CLI to generate theme). |
| packages/cli/src/tokens/process/platform.ts | Moves tailwind option to shared token processing options. |
| packages/cli/src/tokens/generate-config.ts | Adjusts generated config typing to use pre-validation input shape. |
| packages/cli/src/tokens/format.ts | Changes theme formatting API to return output files and optionally include Tailwind outputs. |
| packages/cli/src/tokens/build.ts | Minor log output tweak. |
| packages/cli/src/scripts/update-preview-tokens.ts | Validates config through schema to apply defaults before generating preview tokens. |
| packages/cli/src/scripts/createJsonSchema.ts | Generates JSON schema using io: 'input' so optional/defaulted fields validate correctly. |
| packages/cli/src/scripts/create-json-schema-next.ts | Adds generation of config-next.schema.json for the new config format. |
| packages/cli/src/schemas/v1.1/schema.ts | Adds defaults for theme typography/border radius; introduces CreateConfigSchemaInput. |
| packages/cli/src/schemas/v1.1/defaults.ts | Centralizes default constants to avoid circular deps. |
| packages/cli/src/schemas/next/schema.ts | Adds “next” schema with output[] union (design-tokens/css). |
| packages/cli/src/schemas/helpers.ts | Minor doc/comment adjustments. |
| packages/cli/package.json | Updates build script to generate both schemas. |
| packages/cli/bin/designsystemet.ts | Adds default config command and refactors token/css build/create flows around config outputs. |
| package.json | Switches update:theme to run designsystemet (default config command). |
| designsystemet.config.json | Migrates config to config-next.schema.json and output[] configuration; removes explicit typography/borderRadius. |
| .changeset/ninety-dolls-start.md | Adds release note about defaults being optional. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| // return [key, undefined]; | ||
| // }), | ||
| // ); | ||
| // } |
There was a problem hiding this comment.
Skal dette fortsatt ligge her?
eirikbacker
left a comment
There was a problem hiding this comment.
Great start on this nicer-config-journey 🤗
resolves #4567
Landed the groundwork for how output could be handled.
Disabled the command to be run under
designsystemetfor now since we need more testing and assessment for direction to go.Framework for "next" version of cli is there and other improvements for how cli handles default values so putting this to review.
Will continue this work after summer break