Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| "rootDir": "bin", | ||
| "rootDir": ".", | ||
| "noEmit": true, | ||
| "allowImportingTsExtensions": true | ||
| }, | ||
| "include": [ "bin" ], | ||
| "include": [ "bin", "terrazzo.config.ts" ], |
There was a problem hiding this comment.
Changes needed because the new bin script references a file in the root package directory, and TypeScript complains about referencing files outside rootDir.
| if ( shouldInline ) { | ||
| // Track this token for inlining | ||
| inlineMap[ id ] = []; | ||
| inlineMap[ id ] ??= []; |
There was a problem hiding this comment.
This isn't strictly needed, but was something that started erroring in the default behavior before adding alphabetize: false. The previous logic relies on primitives being defined before any alias references, which is only true if we disable alphabetization and maintain this convention in the source token files. This change makes it a bit more flexible.
| export default defineConfig( config, { | ||
| cwd: new URL( './', import.meta.url ), | ||
| } ); |
There was a problem hiding this comment.
I didn't see this mentioned in the migration guide or package release notes, but the code itself errors if cwd is not specified.
There was a problem hiding this comment.
This looks like a lot of changes, but it's basically just shifting the description comment from end-of-line to preceding-line.
Otherwise "not all code paths return a value" TypeScript error. The function types specify `undefined` as a return type, but not `void`.
|
|
||
| return undefined; |
There was a problem hiding this comment.
This is needed because the function return types allow undefined but not void. Apparently in my fix proposal I originally included it but later reverted it. I'm not sure why I reverted it 😅
|
Size Change: -36 B (0%) Total Size: 7.75 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 638444a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24566013034
|
mirka
left a comment
There was a problem hiding this comment.
Thanks for the thorough contextual comments! Looks good to go 🚀
| `Built ${ outputFiles.length } files to ${ relative( | ||
| resolve( configDir, '../..' ), | ||
| outDir |
There was a problem hiding this comment.
Nit: If anyone moves the script, the printed path will silently go wrong. Could compute relative to process.cwd() instead, or just drop it.
There was a problem hiding this comment.
Good point, I don't think this output is particularly necessary so let's just drop it.
* Theme: Update Terrazzo packages to 2.0 * Use exported members from Node packages * Return explicit undefined in transform function Otherwise "not all code paths return a value" TypeScript error. The function types specify `undefined` as a return type, but not `void`. * Remove build logging from design tokens script Co-authored-by: aduth <aduth@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
What?
Closes #76630
Updates Terrazzo dependencies used in
@wordpress/themefrom 0.x to 2.0.Related migration guide: https://terrazzo.app/docs/guides/migrating-v2/
Why?
General maintenance to reduce drift and take advantage of features and bug fixes.
Specifically, this includes at least one bug fix we previously had to work-around in plugin typings (terrazzoapp/terrazzo#632).
How?
Some issues / behavior changes to note:
@terrazzo/clinow includes Vite 8 as a dependency, which has a huge dependency chain. To avoid this, I opted to remove this dependency and write a thin wrapper script instead. Since we used very few features of the CLI, this seems like a simpler option (see also removed net negative lines of code on the pull request, largely from removed dependencies).Testing Instructions
Ensure that the build behavior works without errors and produces identical output (i.e. no changes on working branch after run):
Use of AI Tools
Cursor + Claude Opus 4.6 & 4.7 for both research and implementation. Several rounds of manual revisions and post-processing.