-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up packages build-types when cleaning types #61939
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. |
package.json
Outdated
@@ -272,7 +272,7 @@ | |||
"prebuild:packages": "npm run clean:packages && lerna run build", | |||
"build:packages": "npm run --silent build:package-types && node ./bin/packages/build.js", | |||
"build:plugin-zip": "bash ./bin/build-plugin-zip.sh", | |||
"clean:package-types": "tsc --build --clean", | |||
"clean:package-types": "tsc --build --clean; rm -rf packages/*/build-types", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the order matter? Just asking because you suggested running rm -rf packages/*/build-types
before this command to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it shouldn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -rf
does not work on Windows OS. Probably not many contributors are building Gutenberg on a Windows host OS, but is there a way to change the command to work on Windows/Mac/Linux all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that rimraf
is already added as a dependency. We can use this library. This library works in a cross-platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I used rm -rf
because I noticed it already in another script.
Size Change: -3 kB (-0.17%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both scripts clean:package-types
and clean:packages
seem to work on Windows OS if we apply the changes in this comment.
However, it may be an issue with my environment, but the latest Gutenberg seems to cause the build to fail on the Windows host OS 🤔 However, this problem is limited and Windows developers should be fine as long as they use WSL.
…on-for-progressbar * trunk: Update Changelog for 18.4.1 Remove package build-types directories when cleaning (#61939) Bump plugin version to 18.4.1
@sirreal I am concerned that this PR may have caused two problems.
|
This should not have added |
Stale generated types can be left sitting around the repo which can cause build issues. Gutenberg recommends using the `clean:package-types` command to clean types and fix this problem, but the generated declaration files remain. This can cause issues with builds that are resolved by removing the stale declaration files (put in the build-types directories) and getting a fresh build. --- Co-authored-by: sirreal <jonsurrell@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Stale generated types can be left sitting around the repo which can cause build issues. Gutenberg recommends using the `clean:package-types` command to clean types and fix this problem, but the generated declaration files remain. This can cause issues with builds that are resolved by removing the stale declaration files (put in the build-types directories) and getting a fresh build. --- Co-authored-by: sirreal <jonsurrell@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
What?
Stale generated types can be left sitting around the repo which can cause build issues. Gutenberg recommends using the
clean:package-types
command to clean types and fix this problem, but the generated declaration files remain.This can cause issues with builds that are resolved by removing the stale declaration files (put in the
build-types
directories) and getting a fresh build.Why?
It can break the types builds.
How?
By removing all the stale generated files.
Testing Instructions
After running
No packages should have
build-types
directories.