Skip to content

Commit 18cfe00

Browse files
Merge remote-tracking branch 'origin/suggest/inline-wiring' into fix/73411-f12-stacked-format-toggle
# Conflicts: # packages/editor/CHANGELOG.md
2 parents 2a0488a + 84597c9 commit 18cfe00

1,115 files changed

Lines changed: 32949 additions & 9845 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: design-system-code-review
3+
description: Use when reviewing a Gutenberg change to a WordPress Design System package or its public contract, including `@wordpress/components`, `@wordpress/ui`, or `@wordpress/theme`; do not use to implement the change or review a consumer-only application.
4+
---
5+
6+
# Review a WordPress Design System contribution
7+
8+
## Establish the review boundary
9+
10+
1. Define the changed public surface and observable behaviour.
11+
2. Scan the complete diff once, then classify it as:
12+
- **Internal:** no public contract or observable behaviour changes.
13+
- **Public:** adds, removes, renames, or changes supported behaviour.
14+
3. Read [Working with WordPress Design System packages](../../../docs/contributors/design/design-system-packages.md)
15+
and the applicable package source guidance.
16+
4. Apply the public guide's evidence precedence: the diff is the proposed
17+
post-change state, target source is its baseline, and MCP is supplementary
18+
current-design context.
19+
20+
## Review proportionally
21+
22+
For an internal change, verify contract preservation and focused coverage, then
23+
skip the public-only work below. For a public change:
24+
25+
- assess Gutenberg and external package consumers separately;
26+
- verify compatibility and migration rather than treating repository migration
27+
as sufficient;
28+
- before drafting findings for a removal, replacement, or rename, compare the
29+
old and new accepted values, semantics, states, interaction, and styling in
30+
a compact contract table; complete the comparison even after finding one
31+
valid defect;
32+
33+
For either classification, use the public guide's
34+
[package completion gate](../../../docs/contributors/design/design-system-packages.md#change-a-package-safely)
35+
and inspect only the surfaces applicable to the change.
36+
37+
Use browser evidence when source or class assertions cannot establish visual,
38+
focus, motion, or layout parity.
39+
40+
## Finding evidence gate
41+
42+
Before reporting a finding, identify the exact changed line, affected public
43+
contract or behaviour, target-source or consumer evidence, and concrete impact.
44+
Treat incomplete diff context as a verification gap unless the complete patch
45+
proves the defect. Apply the same evidence and precision standard even when
46+
another valid defect already exists.
47+
48+
## Output contract
49+
50+
Recheck every finding against the complete diff and source. Separate defects,
51+
verification gaps, and optional follow-ups. Report material findings with
52+
proportional severity and the smallest coherent direction; report no findings
53+
when the evidence exposes none.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: design-system-contribution
3+
description: Use when planning or implementing a safe `@wordpress/components`, `@wordpress/ui`, or `@wordpress/theme` change in a local Gutenberg checkout; do not use for consumer-only application changes or infer commit, push, or pull-request authority.
4+
---
5+
6+
# Contribute to the WordPress Design System
7+
8+
## Classify the change
9+
10+
1. State the requested outcome and relevant package or consumers.
11+
2. Classify the change as internal or public:
12+
- **Internal:** preserves the public contract and observable behaviour.
13+
- **Public:** adds or changes supported behaviour.
14+
3. For a public change, state the missing behaviour and audit existing public
15+
composition and similar components or tokens.
16+
4. If supported behaviour already meets the public need, recommend it and stop
17+
unless the request establishes a distinct contract.
18+
19+
Read the cross-package guide and the package-specific source guidance that
20+
matches the change:
21+
22+
- [`docs/contributors/design/design-system-packages.md`](../../../docs/contributors/design/design-system-packages.md)
23+
- [`packages/components/CONTRIBUTING.md`](../../../packages/components/CONTRIBUTING.md)
24+
- [`packages/ui/CONTRIBUTING.md`](../../../packages/ui/CONTRIBUTING.md)
25+
- [`packages/theme/README.md`](../../../packages/theme/README.md)
26+
- [`packages/theme/tokens/README.md`](../../../packages/theme/tokens/README.md)
27+
28+
Use an available WordPress Design System MCP server to learn current direction
29+
when useful, but verify implementation and compatibility against this checkout.
30+
31+
## Scale work to the contract
32+
33+
- For an internal change, preserve the public contract and run focused checks.
34+
- For a public change, define the contract and assess external consumers,
35+
compatibility, migration, documentation, and generated output.
36+
- For a replacement or rename, compare observable old and new values, states,
37+
and interaction—not only types or class names.
38+
39+
Follow current package precedents only where they apply. Do not add optional
40+
stories, public documentation, release notes, or compatibility machinery for
41+
an unchanged public capability. Still follow the repository's required package
42+
changelog policy for production code changes.
43+
44+
## Finish
45+
46+
Use the public guide's
47+
[package completion gate](../../../docs/contributors/design/design-system-packages.md#change-a-package-safely)
48+
with the applicable package source guidance. Mark each relevant contract
49+
surface complete, not applicable, or blocked.
50+
51+
Run focused tests and required lint, type, generation, or build checks. Verify
52+
interaction or CSS behaviour where source-level tests cannot establish it.
53+
54+
Stop for product or design-system agreement when a public component, token, or
55+
API lacks accepted behaviour. Include consumer evidence, alternatives,
56+
compatibility impact, and the proposed contract.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: design-system-ui-composition
3+
description: Use when building or changing a Gutenberg feature, plugin interface, or standalone application UI with public `@wordpress/components`, `@wordpress/ui`, or `@wordpress/theme` APIs, including when the code does not yet use the Design System; do not use to change package source or depend on package-private implementation details.
4+
---
5+
6+
# Compose a WordPress Design System interface
7+
8+
## Classify before searching
9+
10+
1. State the user-visible behaviour, minimum runtime and package versions,
11+
rendering owner, runtime document, and whether each Design System dependency
12+
is bundled or externalized.
13+
2. Inspect the changed surface and its nearest same-surface precedent once.
14+
3. Choose the narrowest path:
15+
- **Lightweight:** keep an existing supported component when behaviour,
16+
styling, and document setup do not change.
17+
- **Standard:** select or compose a public component or token.
18+
- **Deep:** handle custom UI, a package migration, or another rendering
19+
document such as an iframe, popup, or portal.
20+
21+
Do not reopen component selection on the lightweight path. Verify the existing
22+
contract, make the narrow change, and stop.
23+
24+
## Select for the behaviour
25+
26+
When selection is material, write the required interaction contract before
27+
choosing a component. Follow the maintained recommendation sources and
28+
target-version checks in
29+
[Working with WordPress Design System packages](../../../docs/contributors/design/design-system-packages.md#choose-a-recommended-component),
30+
then verify the selected public API in the deployed runtime or installed
31+
version, as applicable.
32+
33+
Choose the smallest public composition that owns exactly the required
34+
behaviour. Do not turn a trigger into a menu, dialog, or state owner merely
35+
because a nearby precedent does. Stop searching when one recommended option
36+
satisfies the behaviour and setup.
37+
38+
## Apply conditional setup
39+
40+
- For custom UI, first establish why public composition is insufficient.
41+
- For a migration, preserve observable interaction, styling, accessibility,
42+
and compatibility.
43+
- For a separate document, read the
44+
[cross-package document setup guidance](../../../docs/contributors/design/design-system-packages.md#setup-depends-on-the-document)
45+
before editing. Make a short per-document ledger for the packages actually
46+
used: static styles, runtime-injected styles, root theming, and overlays.
47+
Mark each applicable requirement verified or blocked; do not add setup for a
48+
package that does not render there.
49+
50+
For a planning task with no concrete host file or state owner, keep the plan
51+
actionable under explicit assumptions. When the request names a target, inspect
52+
that exact target; do not silently plan against another package or active
53+
equivalent. Treat missing context as a verification gap; block only when it
54+
prevents a safe behaviour or API decision.
55+
56+
Use the linked public documentation for API and setup facts. Do not copy its
57+
component mappings, token inventory, or implementation recipes into this
58+
skill.
59+
60+
## Finish
61+
62+
Exercise the changed interaction and run focused checks. Before declaring
63+
completion, recheck the behaviour contract and every rendering document.
64+
Report unresolved setup or parity evidence as blocked rather than silently
65+
omitting it.
66+
67+
If no public API meets the need, document the unmet behaviour and affected
68+
consumers. Route package work to `design-system-contribution` in a local
69+
Gutenberg checkout; otherwise request an upstream Design System change.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: design-system-ui-review
3+
description: Use when reviewing a Gutenberg, plugin, or application UI/UX change for correct public WordPress Design System usage and user-facing behaviour, including a component, control, visual styling, token, interaction, layout, overlay, or other user-facing interface; do not use to implement a change or review Design System package source.
4+
---
5+
6+
# Review a WordPress Design System interface
7+
8+
## Start shallow
9+
10+
1. Define the changed user-facing behaviour, affected users, runtime document,
11+
target versions, and dependency deployment boundary.
12+
2. Scan the complete diff once for semantics and accessibility, interaction
13+
and focus, styling and tokens, integration, tests, and compatibility.
14+
Account for every changed file before deep research; finding one defect
15+
does not end this pass.
16+
3. Choose the narrowest review path:
17+
- **Lightweight:** copy-only or supported-prop changes with no interaction,
18+
styling, or setup change.
19+
- **Standard:** component, custom UI, styling, or interaction changes.
20+
- **Deep:** migrations, public-contract risk, or separate documents and
21+
overlays.
22+
23+
On the lightweight path, verify the target runtime API, every changed consumer,
24+
and required changelog coverage. State what the change improves and what
25+
behaviour and semantics remain unchanged, then stop. Do not reopen component selection
26+
without evidence that the existing component is unsuitable.
27+
28+
## Deepen only material questions
29+
30+
Use the recommendation sources in
31+
[Working with WordPress Design System packages](../../../docs/contributors/design/design-system-packages.md#choose-a-recommended-component)
32+
only when component, package, prop, token, or setup selection is material.
33+
Apply that guide's evidence precedence: treat the supplied diff as the proposed
34+
post-change state, verify availability against the target version, and use MCP
35+
as current-direction context rather than target-version proof.
36+
37+
For standard and deep reviews, investigate only the dimensions made material
38+
by the first pass. Judge custom UI by demonstrated user, accessibility,
39+
consistency, or maintenance impact—not by the mere existence of a public
40+
alternative. For separate documents, verify the applicable package setup in
41+
the document that renders the interface.
42+
43+
When custom UI has a material defect, explicitly decide whether the smallest
44+
coherent fix is to repair it or replace it with a verified public component.
45+
Do not leave the implementation direction implicit.
46+
47+
## Finding evidence gate
48+
49+
Before reporting a finding, establish:
50+
51+
1. the incorrect user-observable behaviour or public contract;
52+
2. the exact changed line that causes it;
53+
3. target-version source or runtime evidence for the expected behaviour; and
54+
4. why the change is required now rather than an optional enhancement.
55+
56+
If any part is missing, resolve it, report a verification gap, or omit the
57+
finding. Treat missing context in a diff excerpt as a gap unless the complete
58+
diff proves an omission. Missing tests alone are not a defect without a
59+
demonstrated regression or repository requirement.
60+
61+
## Output contract
62+
63+
Recheck every finding against the complete diff and source. Classify each
64+
concern as a defect, verification gap, or optional follow-up. Report material
65+
findings with user impact, target evidence, and the smallest coherent
66+
direction, plus focused verification of the affected behaviour. Report no
67+
findings when the evidence exposes none. Do not prescribe package internals in
68+
a consumer review. Route package-source reviews to
69+
`design-system-code-review`, then stop.

.github/workflows/bundle-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ jobs:
7474
repo-token: '${{ secrets.GITHUB_TOKEN }}'
7575
pattern: '{build/scripts/**/*.min.js,build/styles/**/*.css,build/modules/**/*.min.js}'
7676
clean-script: 'distclean'
77-
build-script: 'build -- --skip-types'
77+
build-script: 'build'

.github/workflows/end2end-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: ./.github/setup-node
3939

4040
- name: Npm build
41-
run: npm run build -- --skip-types
41+
run: npm run build
4242

4343
# Wider than the `build*` directories, because the build also emits
4444
# generated files next to sources: the block parsers, the icon

.github/workflows/reusable-workflow-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ jobs:
5151
persist-credentials: false
5252

5353
- name: Install the latest version of uv
54-
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
54+
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
5555

5656
- name: Run zizmor
5757
run: uvx zizmor@1.24.1 --persona=regular --format=sarif --strict-collection . > results.sarif
5858
env:
5959
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6060

6161
- name: Upload SARIF file
62-
uses: github/codeql-action/upload-sarif@d1ba80a13dd99fba24a470575428917156a28b43 # v4.37.5
62+
uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
6363
with:
6464
sarif_file: results.sarif
6565
category: zizmor

.github/workflows/static-checks.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ jobs:
115115
npm run lint:css:update-suppressions
116116
117117
- name: Type checking
118+
run: npm run typecheck
119+
120+
- name: Check type declaration files
121+
# Runs against the declarations the type check just emitted;
122+
# the bundle build below skips types and with them this check.
123+
run: npm run check:type-declarations
124+
125+
- name: Build packages
118126
run: npm run build
119127

120128
- name: Validate package contents

.github/workflows/unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ jobs:
209209
uses: ./.github/setup-node
210210

211211
- name: Run build scripts
212-
run: npm run build -- --skip-types
212+
run: npm run build
213213

214214
- name: Upload built JavaScript assets
215215
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

AGENTS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ npm run wp-env-test start # Only start if not already running.
1111

1212
# Development
1313
npm start # Development with watch
14-
npm run build # Production build
15-
npm run build -- --skip-types # Faster build; skips type generation
14+
npm run build # Production build; emits types with --noCheck, does NOT type check
1615
```
1716

17+
`npm run build` never fails on type errors. After changing TypeScript or checked JS, run `npm run typecheck`.
18+
1819
### Key Directories
1920

2021
- `/packages/` - JavaScript packages (each has README.md and CHANGELOG.md)
22+
- `/routes/` - Route entry points for the admin single-page apps, one directory per route; each declares the page(s) it belongs to (the extensible site editor, the dashboard, the media editor, and others)
2123
- `/lib/` - PHP code
2224
- `/lib/compat/wordpress-X.Y/` - Version-specific features (new PHP features usually go here)
2325
- `/phpunit/` - PHP tests
@@ -41,6 +43,7 @@ Read only what your task needs, when it needs it:
4143
```bash
4244
npm run format # Fix JS formatting
4345
npm run lint:js # Check JS linting
46+
npm run typecheck # Type check sources, plus TypeScript tests and stories
4447
vendor/bin/phpcbf # Fix PHP standards
4548
vendor/bin/phpcs # Check PHP standards
4649

@@ -51,6 +54,7 @@ vendor/bin/phpcbf <path_to_php_file.php>
5154
## Architectural decisions
5255

5356
- **Package layering**: Three editor layers — `block-editor` (generic, WP-agnostic) → `editor` (WordPress post-type-aware) → `edit-post`/`edit-site` (full screens). Lower layers MUST NOT depend on higher ones.
57+
- **Site editor parity**: the site editor exists twice — `packages/edit-site` (v1) and the extensible site editor (v2: the `routes/*` entry points declaring the `site-editor-v2` page, booted by `packages/boot`, behind the `gutenberg-extensible-site-editor` experiment). Any feature or enhancement added to the site editor MUST be added to the extensible site editor in the same change, so the two do not drift. If a feature deliberately does not belong in v2, say so explicitly instead of silently skipping it.
5458
- **Block data model**: Blocks are in-memory tree structures during editing, serialized as HTML with comment delimiters (`<!-- wp:name -->`). Work with the block tree via APIs, not the serialized HTML.
5559
- **Data layer**: Uses `@wordpress/data` (Redux-like stores). Edit entities through `core-data` actions (`editEntityRecord` / `saveEditedEntityRecord`), not direct state manipulation.
5660
- **Styles system**: Three-layer merge — WordPress defaults < `theme.json` < user preferences. Use Block Supports API and CSS custom properties (`--wp--preset--*`), not hardcoded values.
@@ -69,6 +73,7 @@ For full architecture details, see `docs/explanations/architecture/`.
6973
- Never invoke WordPress's forked or local CLIs through `npx` (e.g. `npx prettier`, `npx wp-scripts`). WordPress ships its own `wp-prettier` fork, and `wp-scripts` is the bin name of `@wordpress/scripts`. A bare `npx wp-scripts` can resolve to an unrelated third-party package on the public registry, not the local tool. Use the npm scripts instead (`npm run format`, `npm run lint:js`, `npm run lint:css` and so on), which run the binaries from local `node_modules`.
7074
- PHP function and class names are renamed at build time (`gutenberg_*` prefix, `*_Gutenberg` suffix) to avoid conflicts with WordPress Core — the built names, not the source names, are what runs (and what tests must call). See `docs/contributors/code/build-system-function-prefixing.md`.
7175
- Production code changes in a package require an entry in that package's `CHANGELOG.md`. See `docs/contributors/code/managing-packages.md`.
76+
- Packages with TypeScript dev files split their configs: `tsconfig.build.json` (src only, emits `build-types`) and the default `tsconfig.json` (dev project: tests and stories, `noEmit`, jest types). Packages without dev files keep a single `tsconfig.json` build project, and a few packages deviate (a dev-only project with handwritten declarations, or specialized build projects); see the TypeScript section in `packages/README.md`. Reference a split package by `../<pkg>/tsconfig.build.json` and an unsplit one by `../<pkg>`. `npm run build` never type checks (it emits declarations with `--noCheck`); use `npm run typecheck`, and never add jest types to a build project.
7277
- A rejected `apiFetch` is not always an `Error`: a REST error arrives as a plain object (`{ code, message, data }`), `parse: false` rejects with the `Response` (which carries `status`, not `message`), an aborted request rethrows an `AbortError`, and a handler set via `setFetchHandler` can reject anything. Do not interpolate the rejection into a string (`` `${ error }` `` gives `[object Object]`) or branch on `instanceof Error`. Normalise it to a message before showing the user anything, and supply your own copy when there is none — `ensureError` in `packages/core-data/src/private-actions.js` is the reference implementation, though it is local to that file rather than exported.
7378

7479
## PR instructions

0 commit comments

Comments
 (0)