Skip to content

Commit fcfe22a

Browse files
committed
Build/Test Tools: Remove gutenberg:verify script on postinstall.
In [61458], a `postinstall` script was introduced that ensured the source code from the `gutenberg` repository was present before attempting to run the build script. The WordPress.org Hosting Tests surfaced an edge case where the `postinstall` script was failing when `nodevenv` is used. Because it serves as a wrapper for Node.js, `NPM_CONFIG_PREFIX` is set to the virual envirnoment directory and not the actual project source directory. This removes `gutenberg:verify` from `postinstall` entirely. `gutenberg:verify` is responsible for confirming that the `gutenberg` directory exists, that the commit SHA value in `gutenberg/.gutenberg-hash` matches `gutenberg.sha` in the `package.json` file, and it downloads a fresh copy if not. While this will result in the necessary files not being present locally after running `npm install`, `gutenberg:verify` is specified as the first task executed when the `build` and `build:dev` scripts are run. Running either build script has been a requirement to run WordPress locally for some time now, so this does not introduce a new required step. It simply delays when the built asset will be retrieved from the GitHub Container Registry when necessary. `postinstall` scripts should also be avoided entirely due to their significantly insecure nature (see #64543). Follow up to [61492], [61873], and [62021]. Props jorbin, johnbillion. Fixes #64874. See #64393, #64543. git-svn-id: https://develop.svn.wordpress.org/trunk@62321 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5aca29c commit fcfe22a

2 files changed

Lines changed: 0 additions & 2 deletions

File tree

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
"wicg-inert": "3.1.3"
114114
},
115115
"scripts": {
116-
"postinstall": "npm run gutenberg:verify",
117116
"build": "grunt build",
118117
"build:dev": "grunt build --dev",
119118
"build:gutenberg": "grunt build:gutenberg",

0 commit comments

Comments
 (0)