Skip to content
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

build:package-types: Run silently to reduce user confusion #61530

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
"scripts": {
"build": "npm run build:packages && wp-scripts build",
"build:analyze-bundles": "npm run build -- --webpack-bundle-analyzer",
"build:package-types": "node ./bin/packages/validate-typescript-version.js && ( tsc --build || ( echo 'tsc failed. Try cleaning up first: `npm run clean:package-types`'; exit 1 ) ) && node ./bin/packages/check-build-type-declaration-files.js",
"build:package-types": "npm run --silent build:package-types:verbose",
"build:package-types:verbose": "node ./bin/packages/validate-typescript-version.js && ( tsc --build || ( echo 'tsc failed. Try cleaning up first: `npm run clean:package-types`'; exit 1 ) ) && node ./bin/packages/check-build-type-declaration-files.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need two scripts, can we just keep one by default have an option to make it verbose or silent?

Copy link
Member

Choose a reason for hiding this comment

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

Alternatively, printing the failure could go in another script:

tsc --build || npm run print-typescript-clean-suggestion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we really need two scripts, can we just keep one by default have an option to make it verbose or silent?

If you don't have an issue with the delegation of responsibilities, I could keep just one script and modify the flags at the caller:

-		"build:packages": "npm run build:package-types && node ./bin/packages/build.js",
+		"build:packages": "npm run --silent build:package-types && node ./bin/packages/build.js",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"prebuild:packages": "npm run clean:packages && lerna run build",
"build:packages": "npm run build:package-types && node ./bin/packages/build.js",
"build:plugin-zip": "bash ./bin/build-plugin-zip.sh",
Expand Down
Loading