{"id":13716432,"url":"https://github.com/heroku/nodejs-engine-buildpack","last_synced_at":"2025-05-07T05:33:05.499Z","repository":{"id":38406323,"uuid":"200092828","full_name":"heroku/nodejs-engine-buildpack","owner":"heroku","description":"Heroku Cloud Native Buildpack for Node.js runtime","archived":true,"fork":false,"pushed_at":"2021-04-14T17:05:51.000Z","size":208,"stargazers_count":7,"open_issues_count":4,"forks_count":8,"subscribers_count":63,"default_branch":"main","last_synced_at":"2024-12-27T05:06:36.089Z","etag":null,"topics":["buildpack","cloud-native-buildpacks","heroku-buildpack","nodejs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heroku.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-08-01T17:28:33.000Z","updated_at":"2024-11-20T16:06:54.000Z","dependencies_parsed_at":"2022-08-26T23:01:09.382Z","dependency_job_id":null,"html_url":"https://github.com/heroku/nodejs-engine-buildpack","commit_stats":null,"previous_names":["heroku/node-js-cnb"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fnodejs-engine-buildpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fnodejs-engine-buildpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fnodejs-engine-buildpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fnodejs-engine-buildpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heroku","download_url":"https://codeload.github.com/heroku/nodejs-engine-buildpack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823423,"owners_count":21809704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buildpack","cloud-native-buildpacks","heroku-buildpack","nodejs"],"created_at":"2024-08-03T00:01:10.431Z","updated_at":"2025-05-07T05:33:05.230Z","avatar_url":"https://github.com/heroku.png","language":"Go","funding_links":[],"categories":["[Heroku Buildpacks](https://devcenter.heroku.com/)"],"sub_categories":["Provides buildpacks for:"],"readme":"# Node.js Cloud Native Buildpack (MOVED)\n\nThis repo has moved to https://github.com/heroku/buildpacks-node.\n\nCloud Native Buildpacks are buildpacks that turn source code into OCI images. They follow a 4-step process (detect, analyze, build, and export) that outputs an image. The spec can be read about in detail [here](https://github.com/buildpack/spec/blob/main/buildpack.md).\n\n## Usage\n\n### Install pack\n\nUsing `brew` (assuming development is done on MacOS), install `pack`.\n\n```sh\nbrew tap buildpack/tap\nbrew install pack\n```\n\nIf you're using Windows or Linux, follow instructions [here](https://buildpacks.io/docs/install-pack/).\n\n### Install shpec (optional)\n\nThis buildpack uses `shpec` for unit tests, so to run them locally, you'll need to install the package.\n\n```sh\ncurl -sLo- http://get.bpkg.sh | bash\nbpkg install rylnd/shpec\n```\n\n### Clone the buildpack\n\nRight now, we are prototyping with a local version of the buildpack. Clone it to your machine.\n\n```sh\ngit clone git@github.com:heroku/nodejs-engine-buildpack.git\n```\n\n### Build the image\n\nUsing pack, you're ready to create an image from the buildpack and source code. You will need to add flags that point to the path of the buildpack (`--buildpack`) and the path of the source code (`--path`).\n\n```sh\ncd nodejs-engine-buildpack\npack build TEST_IMAGE_NAME --buildpack ../nodejs-engine-buildpack --path ../TEST_REPO_PATH\n```\n\n### Local development\n\nThe buildpack uses a Golang binary to parse the engine versions from the `package.json`. It's better to create the binaries once locally, so they don't have to be downloaded and rebuilt with every build.\n\n```\nmake build\n```\n\nThis builds the binaries specific for the Docker image. The binaries are in the `.gitignore`, so they won't be committed or ever exist in the remote source code.\n\nIf you need them for a MacOS, run:\n\n```\nmake build-local\n```\n\n## Testing\n\nThe complete test suite needs Docker to run. Make sure to [install Docker first](https://hub.docker.com/search?type=edition\u0026offering=community).\n\n```sh\nmake test\n```\n\nIf you want to run individual test suites, that's available too.\n\n**Unit Tests**\n\nTo run the tests on the local host, [make sure `shpec` is installed](#install-shpec-optional).\n\n```sh\nmake unit-test\n```\n\n**Binary Tests**\n\n```sh\nmake binary-tests\n```\n\n### Unit tests in Docker\n\nRunning the `shpec` aren't ideal since the test scripts read and write to the local buildpack directory, so Docker may be preferred.\n\nAs suggested above, install [Docker](#testing). Next, run the tests with the Make script:\n\n```sh\nmake docker-unit-test\n```\n\n### Debugging tests\n\nTo debug, make changes from the code and rerun with the make command. To see what is happening, I suggest wrapping code blocks in question with `set -x`/`set +x`. It would look like this in the shpec file:\n\n```sh\nset -x\nit \"creates a toolbox.toml\"\n  install_or_reuse_toolbox \"$layers_dir/toolbox\"\n\n  assert file_present \"$layers_dir/toolbox.toml\"\nend\nset +x\n```\n\n## Contributing\n\n1. Open a pull request.\n2. Make update to `CHANGELOG.md` under `main` with a description (PR title is fine) of the change, the PR number and link to PR.\n3. Let the tests run on CI. When tests pass and PR is approved, the branch is ready to be merged.\n4. Merge branch to `main`.\n\n### Release\n\nNote: if you're not a contributor to this project, a contributor will have to make the release for you.\n\n1. Create a new branch (ie. `1.14.2-release`).\n2. Update the version in the `buildpack.toml`.\n3. Move the changes from `main` to a new header with the version and date (ie. `1.14.2 (2020-02-30)`) in the `CHANGELOG.md`.\n4. Open a pull request.\n5. Let the tests run on CI. When tests pass and PR is approved, the branch is ready to be merged.\n6. Merge branch to `main` on GitHub.\n7. Pull down `main` to local machine.\n8. Tag the current `main` with the version. (`git tag v1.14.2`)\n9. Push up to GitHub. (`git push origin main --tags`) CI will run the suite and create a new release on successful run.\n\n## Glossary\n\n- buildpacks: provide framework and a runtime for source code. Read more [here](https://buildpacks.io).\n- OCI image: [OCI (Open Container Initiative)](https://www.opencontainers.org/) is a project to create open sourced standards for OS-level virtualization, most importantly in Linux containers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheroku%2Fnodejs-engine-buildpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheroku%2Fnodejs-engine-buildpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheroku%2Fnodejs-engine-buildpack/lists"}