Skip to content

feat(cli): one config#5099

Open
mimarz wants to merge 19 commits into
mainfrom
feat/cli-main-config
Open

feat(cli): one config#5099
mimarz wants to merge 19 commits into
mainfrom
feat/cli-main-config

Conversation

@mimarz

@mimarz mimarz commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

resolves #4567

Landed the groundwork for how output could be handled.
Disabled the command to be run under designsystemet for 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

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f9cb8f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@digdir/designsystemet Patch
@digdir/designsystemet-css Patch
@digdir/designsystemet-types Patch
@digdir/designsystemet-react Patch
@digdir/designsystemet-web Patch

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

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Preview deployments for this pull request:

storybook - 17. Jul 2026 - 11:42

@mimarz
mimarz force-pushed the feat/cli-main-config branch from 8c4a325 to 734281a Compare July 16, 2026 11:29
@github-actions

Copy link
Copy Markdown
Contributor

📦 Snapshot release published

Published at 16.07.2026 16:01:04 to npm with tag test:

Install with:

npm install @digdir/designsystemet-css@test
npm install @digdir/designsystemet-react@test
npm install @digdir/designsystemet-types@test
npm install @digdir/designsystemet-web@test
npm install @digdir/designsystemet@test

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 config command to the CLI that parses/validates config and runs a sorted output[] pipeline (design-tokens before CSS).
  • Updates schema handling: applies defaults for typography/borderRadius, and generates a new config-next.schema.json.
  • Updates repository scripts/config to use the unified CLI config (update:theme and designsystemet.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.

Comment thread packages/cli/src/schemas/v1.1/schema.ts
Comment thread packages/cli/src/tokens/format.ts
Comment thread packages/cli/src/schemas/next/schema.ts Outdated
Comment thread .changeset/ninety-dolls-start.md
Comment thread .changeset/ninety-dolls-start.md Outdated
mimarz and others added 6 commits July 16, 2026 16:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mimarz
mimarz marked this pull request as ready for review July 17, 2026 09:42
// return [key, undefined];
// }),
// );
// }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skal dette fortsatt ligge her? ☺️

@eirikbacker eirikbacker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start on this nicer-config-journey 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unified CLI config for build, output etc.

3 participants