Skip to content

Commit

Permalink
build: Suggest workaround if tsc --build fails (#61501)
Browse files Browse the repository at this point in the history
Following the merge of #60796, developers may face build issues that
require package types to be rebuilt. The problem is that `tsc --build`
fails somewhat silently -- or rather, there is some output, but it's not
clear in the console which stage of the `build:package-types` command
failed, and hence what the workaround should be.

This commit alleviates the issue by logging a helpful message in the
console if `tsc --build` fails:

    tsc failed. Try cleaning up first: `npm run clean:package-types`
  • Loading branch information
mcsf authored May 8, 2024
1 parent 14ecb1d commit 1eb7644
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"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 && node ./bin/packages/check-build-type-declaration-files.js",
"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",
"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

0 comments on commit 1eb7644

Please sign in to comment.