Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/stylelint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Internal

- Load design token Stylelint plugins from `@wordpress/theme-build-tools` instead of `@wordpress/theme` ([#83568](https://github.com/WordPress/gutenberg/pull/83568)).
- Declare `@wordpress/theme` as an optional peer dependency, so the design token Stylelint plugins use the version the consumer installs ([#85388](https://github.com/WordPress/gutenberg/pull/85388)).

## 27.0.0 (2026-10-20)

Expand Down
7 changes: 7 additions & 0 deletions packages/stylelint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,21 @@
},
"devDependencies": {
"@wordpress/npm-package-json-lint-config": "file:../npm-package-json-lint-config",
"@wordpress/theme": "file:../theme",
"stylelint": "^17.14.1",
"stylelint-scss": "^7.2.0",
"vitest": "^5.0.3"
},
"peerDependencies": {
"@wordpress/theme": "^3.0.0 || ^4.0.0",
"stylelint": "^17.14.1",
"stylelint-scss": "^7.2.0"
},
"peerDependenciesMeta": {
"@wordpress/theme": {
"optional": true
}
},
"npmpackagejsonlint": {
"extends": "@wordpress/npm-package-json-lint-config",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion packages/theme-build-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Unreleased

- Initial release, with the build and Stylelint plugins moved from `@wordpress/theme` ([#83568](https://github.com/WordPress/gutenberg/pull/83568)).
- Initial release, with the build and Stylelint plugins moved from `@wordpress/theme` ([#83568](https://github.com/WordPress/gutenberg/pull/83568), [#85388](https://github.com/WordPress/gutenberg/pull/85388)).
Comment thread
simison marked this conversation as resolved.
Resolved
4 changes: 2 additions & 2 deletions packages/theme-build-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Build plugins and Stylelint plugins for the WordPress Design System design token
- The [Stylelint plugins](#stylelint-plugins) validate `--wpds-*` design token usage in CSS.
- The [build plugins](#build-plugins) inject the generated fallback values into `var(--wpds-*)` references, for PostCSS, Lightning CSS, esbuild, and Vite.

The token names and fallback values come from the `@wordpress/theme` package, which this package depends on, so they match the design tokens stylesheet it ships.
The token names and fallback values come from the `@wordpress/theme` package, which is an optional peer dependency, so they match the design tokens stylesheet of the version you installed. If `@wordpress/theme` is not installed, the plugins do nothing: the build plugins leave `var(--wpds-*)` references unchanged, and `no-unknown-ds-tokens` reports nothing.

## Installation

```sh
npm install @wordpress/theme-build-tools --save-dev
npm install @wordpress/theme-build-tools @wordpress/theme --save-dev
```

Install the tool you use the plugins with (`stylelint`, `postcss`, `lightningcss`, `esbuild`, or `vite`) as well; they are optional peer dependencies.
Expand Down
6 changes: 5 additions & 1 deletion packages/theme-build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@
"@babel/types": "^7.29.7",
"@jridgewell/remapping": "^2.3.5",
"@jridgewell/trace-mapping": "^0.3.31",
"@wordpress/theme": "file:../theme",
"magic-string": "^0.30.21"
},
"devDependencies": {
"@types/node": "^24.13.3",
"@wordpress/theme": "file:../theme",
"@wordpress/validation-tools": "file:../../tools/validation",
"esbuild": "^0.27.2",
"lightningcss": "^1.33.0",
Expand All @@ -89,13 +89,17 @@
"vitest": "^5.0.3"
},
"peerDependencies": {
"@wordpress/theme": "^3.0.0 || ^4.0.0",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

It looks like npm still auto-installs the theme through this package, despite the optional declarations in build and stylelint-config.

One way to fix that would be to add @wordpress/theme to peerDependenciesMeta with optional: true, WDYT ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, I think so. It's a bit annoying how many places now have this so we'll definetely need linting/automation to catch incomplete ranges in future.

"esbuild": ">=0.27.2 <1.0.0",
"lightningcss": ">=1.33.0 <2.0.0",
"postcss": "^8.0.0",
"stylelint": "^16 || ^17",
"vite": "^7 || ^8"
},
"peerDependenciesMeta": {
"@wordpress/theme": {
"optional": true
},
"esbuild": {
"optional": true
},
Expand Down
3 changes: 2 additions & 1 deletion packages/wp-build/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
### Internal

- Bundle and transpile with Rolldown instead of esbuild ([#85476](https://github.com/WordPress/gutenberg/pull/85476)).
- Load design token fallback plugins from the new `@wordpress/theme-build-tools` dependency instead of the optional `@wordpress/theme` peer dependency, so fallbacks no longer require installing `@wordpress/theme` ([#83568](https://github.com/WordPress/gutenberg/pull/83568)).
- Load design token fallback plugins from the new `@wordpress/theme-build-tools` dependency instead of the `@wordpress/theme` entry points ([#83568](https://github.com/WordPress/gutenberg/pull/83568)).
- Declare `@wordpress/theme` as an optional peer dependency again, so the fallback plugins use the version the consumer installs ([#85388](https://github.com/WordPress/gutenberg/pull/85388)).
- Point the page templates' preload comments at the TypeScript `entities.ts` in `@wordpress/core-data` ([#85070](https://github.com/WordPress/gutenberg/pull/85070)).

## 0.26.0 (2026-10-20)
Expand Down
9 changes: 9 additions & 0 deletions packages/wp-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@
},
"devDependencies": {
"@types/node": "^24.13.3",
"@wordpress/theme": "file:../theme",
"vitest": "^5.0.3"
},
"peerDependencies": {
"@wordpress/theme": "^3.0.0 || ^4.0.0"
},
"peerDependenciesMeta": {
"@wordpress/theme": {
"optional": true
}
},
"publishConfig": {
"access": "public"
}
Expand Down
Loading