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

Added nodejs-npm-engine Buildpack #623

Merged
merged 14 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
356 changes: 327 additions & 29 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ members = [
"buildpacks/nodejs-engine",
"buildpacks/nodejs-corepack",
"buildpacks/nodejs-function-invoker",
"buildpacks/nodejs-npm-engine",
"buildpacks/nodejs-pnpm-install",
"buildpacks/nodejs-yarn",
"common/nodejs-utils",
Expand All @@ -16,6 +17,7 @@ edition = "2021"
publish = false

[workspace.dependencies]
commons = { git = "https://github.com/heroku/buildpacks-ruby", branch = "schneems/logging-state-machine-continued" }
heroku-nodejs-utils = { path = "./common/nodejs-utils" }
indoc = "2"
# libcnb has a much bigger impact on buildpack behaviour than any other dependencies,
Expand Down
3 changes: 2 additions & 1 deletion README.md

Large diffs are not rendered by default.

85 changes: 1 addition & 84 deletions buildpacks/nodejs-npm-engine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,87 +7,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Added npm version 9.9.0.
- Added npm version 10.2.0.
- Added npm version 10.1.0.
- Added npm version 10.0.0.
- Added npm version 9.8.1.
- Added npm version 9.8.0.
- Added npm version 9.7.2.
- Added npm version 9.7.1.
- Added npm version 9.7.0.
- Added npm version 9.6.7.
- Added npm version 9.6.4.
- Added npm version 9.6.3.
- Added npm version 9.6.2.
- Added npm version 9.5.1.
- Added npm version 9.4.1.
- Added npm version 9.4.0.
- Added npm version 9.3.0.
- Added npm version 9.2.0.
- Added npm version 9.1.2.
- Added npm version 9.0.1.
- Added npm version 9.0.0.
- Added npm version 8.19.4.
- Added npm version 8.19.3.
- Added npm version 8.19.2.
- Added npm version 8.19.1.
- Added npm version 8.19.0.
- Added npm version 8.18.0.
- Added npm version 8.15.1.
- Added npm version 8.14.0.
- Added npm version 8.13.2.
- Added npm version 8.13.0.
- Added npm version 8.12.2.
- Added npm version 8.12.1.
- Added npm version 8.11.0.
- Added npm version 8.10.0.
- Added npm version 8.9.0.
- Added npm version 8.8.0.
- Added npm version 8.6.0.
- Added npm version 8.5.4.
- Added npm version 8.5.3.
- Added npm version 8.5.2.
- Added npm version 8.4.1.
- Added npm version 8.3.2.
- Added npm version 8.1.4.
- Added npm version 8.1.3.
- Added npm version 8.1.2.
- Added npm version 8.1.1.
- Added npm version 8.1.0.
- Added npm version 8.17.0.
- Added npm version 9.5.0.
- Added npm version 8.5.0.
- Added npm version 8.2.0.
- Added npm version 8.7.0.
- Added npm version 8.12.0.
- Added npm version 9.3.1.
- Added npm version 8.13.1.
- Added npm version 9.6.6.
- Added npm version 8.0.0.
- Added npm version 9.4.2.
- Added npm version 8.4.0.
- Added npm version 8.5.5.
- Added npm version 8.3.1.
- Added npm version 9.1.0.
- Added npm version 8.5.1.
- Added npm version 9.6.1.
- Added npm version 9.1.3.
- Added npm version 8.15.0.
- Added npm version 9.1.1.
- Added npm version 8.16.0.
- Added npm version 9.6.5.
- Added npm version 9.6.0.
- Added npm version 8.3.0.
- Added npm version 9.6.6.
- Added npm version 8.12.0.
- Added npm version 9.1.3.
- Added npm version 8.3.0.
- Added npm version 8.5.5.
- Added npm version 9.6.5.
- Added npm version 9.5.0.
- Added npm version 9.3.1.
- Added npm version 8.7.0.
- Added npm version 8.17.0.
- Added npm version 8.16.0.
- Added npm version 8.4.0.
- Initial release
22 changes: 22 additions & 0 deletions buildpacks/nodejs-npm-engine/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "heroku-npm-engine-buildpack"
description = "Heroku Node.js npm Engine Cloud Native Buildpack"
version.workspace = true
rust-version.workspace = true
edition.workspace = true
publish.workspace = true

[dependencies]
commons.workspace = true
heroku-nodejs-utils.workspace = true
libcnb.workspace = true
libherokubuildpack.workspace = true
serde.workspace = true
indoc.workspace = true
tempfile.workspace = true
toml.workspace = true

[dev-dependencies]
libcnb-test.workspace = true
serde_json.workspace = true
test_support.workspace = true
50 changes: 50 additions & 0 deletions buildpacks/nodejs-npm-engine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Heroku Cloud Native npm Engine Buildpack

[![CI][CI BADGE]][CI LINK] [![Registry][Registry BADGE]][Registry LINK]

Heroku's official Cloud Native Buildpack for installing a specific version of `npm`.

## How it works

The buildpack will pass detection if:

- A `package.json` file is found at the root of the application source.
- The `package.json` file contains an `engines` entry for `npm` that specifies a version range.

### Step 1: Resolve `npm` version

The npm version range specified in `package.json` will be used to determine an exact version of [npm][npm] to install.

> [!Note]
> This list of supported [npm][npm] versions can be found in the [inventory](./inventory.toml) file included with this buildpack.

### Step 2: Install `npm`

Once a valid npm version is determined, [npm][npm] will be installed and its commands will be available on the path.

## Build Plan

### Requires

| Name | Description |
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `node` | To install `npm` a [Node.js][Node.js] runtime is required. It can be provided by the [`heroku/nodejs-engine`][heroku/nodejs-engine] buildpack. |
| `npm` | To install a different version of `npm` the default [npm][npm] package manager that comes with [Node.js][Node.js] is used. It can be provided by the [`heroku/nodejs-engine`][heroku/nodejs-engine]. |

### Provides

| Name | Description |
|-------|--------------------------------------------------------------------------------------|
| `npm` | Allows other buildpacks that require [npm][npm] tooling to depend on this buildpack. |

## License

See [LICENSE](../../LICENSE) file.

[CI BADGE]: https://github.com/heroku/buildpacks-nodejs/actions/workflows/ci.yml/badge.svg
[CI LINK]: https://github.com/heroku/buildpacks-nodejs/actions/workflows/ci.yml
[Registry BADGE]: https://img.shields.io/badge/dynamic/json?url=https://registry.buildpacks.io/api/v1/buildpacks/heroku/nodejs-npm-engine&label=version&query=$.latest.version&color=DF0A6B&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAACSVJREFUaAXtWQ1sFMcVnp/9ub3zHT7AOEkNOMYYp4CQQFBLpY1TN05DidI2NSTF0CBFQAOBNrTlp0a14sipSBxIG6UYHKCO2ka4SXD4SUuaCqmoJJFMCapBtcGYGqMkDgQ4++52Z2e3b87es+/s+wNHVSUPsnZv9s2b97335v0MCI2NMQ2MaeD/WgP4FqQnX//2K4tVWfa0X+9+q/N4dfgWeESXPPjUUd+cu+5cYmMcPvzawQOtrdVG9GMaLxkD+OZDex6WVeUgwhiZnH1g62bNX4+sPpLGXvEkdPNzLd93e9y/cCnabIQJCnz+2Q9rNs9tjCdM9ltK9nGkb5jYxYjIyDJDSCLSV0yFHCr/XsObvQH92X+8u/b0SGvi5zZUn1joc/u2qapajglB4XAfUlQPoqpyRzxtqt8ZA+AIcQnZEb6WZSKCMSZUfSTLg8vv/86e3b03AztO/u3p7pE2fvInfy70TpiwRVKU5YqqygbTEWL9lISaiDFujbQu2VzGAIYzs5HFDUQo8WKibMzy0Yr7Ht5Td/Nyd0NLS3VQ0FesOjDurtwvPaWp6gZVc080TR2FQn0xrAgxkWVkLD8aBQD9cti2hWwAQimdImHpJTplcmXppF11hcV3Z/n92RsVVbuHc4bCod4YwZ0fHACYCCyS4Rg1AM6+ts2R+JOpNF/Okl/PyvLCeQc/j9O4Q+88hQWY/j+0gCOI84ycD0oRNxnSAVCqgYUFgDbTMeoWiBeAcRNRm8ZPD/uNCYfIZg6bTzXxxQKw4YCboH3SH7WSCRNxIQCb6fhiAYA0JgAgaQAQFhC0mY6MAYAzUIj9KN3jZoJbUEhWqQYBAJxZqX0tjlHGACyLtzKmM0pl2YKwmHzYcIjB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J01eOs2jaU+D03508cK/9iHUkm6F4LBI+hTlc9m0BSsVSufcCBkvzu7afSHpgrGPYxoY00BEA/8FOPrYBqYsE44AAAAASUVORK5CYII=&labelColor=white
[Registry LINK]: https://registry.buildpacks.io/buildpacks/heroku/nodejs-npm-engine
[Node.js]: https://nodejs.org/
[npm]: https://docs.npmjs.com/
[heroku/nodejs-engine]: ../nodejs-engine/README.md
28 changes: 28 additions & 0 deletions buildpacks/nodejs-npm-engine/buildpack.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
api = "0.9"

[buildpack]
id = "heroku/nodejs-npm-engine"
version = "1.1.7"
name = "Heroku Node.js npm Engine Buildpack"
homepage = "https://github.com/heroku/buildpacks-nodejs"
keywords = ["node", "node.js", "nodejs", "javascript", "js", "npm", "engine"]

[[buildpack.licenses]]
type = "MIT"

[[stacks]]
id = "*"

[[stacks]]
id = "heroku-20"

[[stacks]]
id = "heroku-22"

[[stacks]]
id = "io.buildpacks.stacks.bionic"

[metadata]
[metadata.release]
[metadata.release.docker]
repository = "docker.io/heroku/buildpack-nodejs-npm-engine"
Loading