-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow participating buildpacks to opt-out of Node.js build scripts #928
Conversation
The buildpacks that performs installation for each of the supported package managers (npm, pnpm, Yarn) will execute a preset list of scripts from `package.json` if present: - `heroku-prebuild` - `heroku-build` or `build` - `heroku-postbuild` This PR adds a new Buildpack Plan called `node_build_scripts` to the package manager installation buildpacks that can be configured by later buildpacks that require it with the following: ```toml [[requires]] name = "node_build_scripts" [requires.metadata] enabled = <bool> ```
The buildpacks that performs installation for each of the supported package managers (npm, pnpm, Yarn) will execute a preset list of scripts from `package.json` if present: - `heroku-prebuild` - `heroku-build` or `build` - `heroku-postbuild` This PR adds a new Buildpack Plan called `node_build_scripts` to the package manager installation buildpacks that can be configured by later buildpacks that require it with the following: ```toml [[requires]] name = "node_build_scripts" [requires.metadata] enabled = <bool> ```
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.
Love the new Build Plan docs! This looks great to me, regardless of the Build Plan precedence decision.
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.
My understanding is that this is here to prevent double builds, when other processes run npm build
inside of the resulting container. I think I actually prefer the double build scenario -- the npm build
artifacts end up as part of the image, which means it will run as customers expect without having to use volumes or run another process.
I don't have any issue with the API, really, other than the non-determinism mentioned in my other comment.
Not necessarily… for Static Web Apps, this can mean that the image defaults to serving the wrong or broken version of the site. Ideally with release-build configured, artifacts will only be generated by release-build. |
…ildplan # Conflicts: # Cargo.lock # buildpacks/nodejs-npm-install/CHANGELOG.md # buildpacks/nodejs-pnpm-install/CHANGELOG.md # buildpacks/nodejs-yarn/CHANGELOG.md
## heroku/nodejs ### Changed - Updated `heroku/nodejs-corepack` to `3.2.16`. - Updated `heroku/nodejs-engine` to `3.2.16`. - Updated `heroku/nodejs-npm-engine` to `3.2.16`. - Updated `heroku/nodejs-npm-install` to `3.2.16`. - Updated `heroku/nodejs-pnpm-engine` to `3.2.16`. - Updated `heroku/nodejs-pnpm-install` to `3.2.16`. - Updated `heroku/nodejs-yarn` to `3.2.16`. ## heroku/nodejs-corepack - No changes. ## heroku/nodejs-engine ### Added - 23.0.0 (linux-amd64, linux-arm64) - 22.10.0 (linux-amd64, linux-arm64) ## heroku/nodejs-function ### Changed - Updated `heroku/nodejs-engine` to `3.2.16`. - Updated `heroku/nodejs-function-invoker` to `3.2.16`. - Updated `heroku/nodejs-npm` to `3.2.16`. ## heroku/nodejs-function-invoker - No changes. ## heroku/nodejs-npm - No changes. ## heroku/nodejs-npm-engine - No changes. ## heroku/nodejs-npm-install ### Added - Allow configuration of build script behavior through the `node_build_scripts` build plan. ([#928](heroku/buildpacks-nodejs#928)) ## heroku/nodejs-pnpm-engine - No changes. ## heroku/nodejs-pnpm-install ### Added - Allow configuration of build script behavior through the `node_build_scripts` build plan. ([#928](heroku/buildpacks-nodejs#928)) ## heroku/nodejs-yarn ### Added - Allow configuration of build script behavior through the `node_build_scripts` build plan. ([#928](heroku/buildpacks-nodejs#928)) - Added Yarn version 4.5.1. - Added Yarn version 3.8.6. Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
## heroku/nodejs ### Changed - Updated `heroku/nodejs-corepack` to `3.2.16`. - Updated `heroku/nodejs-engine` to `3.2.16`. - Updated `heroku/nodejs-npm-engine` to `3.2.16`. - Updated `heroku/nodejs-npm-install` to `3.2.16`. - Updated `heroku/nodejs-pnpm-engine` to `3.2.16`. - Updated `heroku/nodejs-pnpm-install` to `3.2.16`. - Updated `heroku/nodejs-yarn` to `3.2.16`. ## heroku/nodejs-corepack - No changes. ## heroku/nodejs-engine ### Added - 23.0.0 (linux-amd64, linux-arm64) - 22.10.0 (linux-amd64, linux-arm64) ## heroku/nodejs-function ### Changed - Updated `heroku/nodejs-engine` to `3.2.16`. - Updated `heroku/nodejs-function-invoker` to `3.2.16`. - Updated `heroku/nodejs-npm` to `3.2.16`. ## heroku/nodejs-function-invoker - No changes. ## heroku/nodejs-npm - No changes. ## heroku/nodejs-npm-engine - No changes. ## heroku/nodejs-npm-install ### Added - Allow configuration of build script behavior through the `node_build_scripts` build plan. ([heroku#928](heroku#928)) ## heroku/nodejs-pnpm-engine - No changes. ## heroku/nodejs-pnpm-install ### Added - Allow configuration of build script behavior through the `node_build_scripts` build plan. ([heroku#928](heroku#928)) ## heroku/nodejs-yarn ### Added - Allow configuration of build script behavior through the `node_build_scripts` build plan. ([heroku#928](heroku#928)) - Added Yarn version 4.5.1. - Added Yarn version 3.8.6. Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
The buildpacks that performs installation for each of the supported package managers (npm, pnpm, Yarn) will execute a preset list of scripts from
package.json
if present:heroku-prebuild
heroku-build
orbuild
heroku-postbuild
This PR adds a new Buildpack Plan called
node_build_scripts
to these package manager installation buildpacks that can be configured by later buildpacks that require it. For example, the scripts can be prevented from running with the following: