Build: Generate plugin version and make the build script plugin agnostic#72707
Build: Generate plugin version and make the build script plugin agnostic#72707youknowriad merged 3 commits intotrunkfrom
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. |
|
Flaky tests detected in 88b6f5a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18866198976
|
| /** | ||
| * Generate PHP file for version constant. | ||
| */ | ||
| async function generateVersionPhp() { |
There was a problem hiding this comment.
There's a lot of duplication between this and generateScriptRegistrationPhp. Maybe we should generalize a function for writing a file from a template with a given set of variables? (maybe some default variables)
There was a problem hiding this comment.
Agreed :) I'm planning to do some kind of cleanup PR to make things more digestible in the build tool.
|
|
||
| $git_commit = trim( shell_exec( 'git rev-parse HEAD' ) ); | ||
|
|
||
| echo "define( 'GUTENBERG_GIT_COMMIT', '$git_commit' );\n"; |
There was a problem hiding this comment.
I didn't see it used anywhere.
Related #72032
What
I noticed that the scripts auto-registration relied on a plugin version that is gutenberg specific. The build tool itself is meant to be plugin agnostic so this PR injects the version during build time. I also noticed that we already had a build tool that we only run during plugin release that did the same, so I removed that one and consolidated in the default build tool.
Testing Instructions
E2E tests should pass (scripts are used everywhere)