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

Enable support for node & yarn detection #216

Merged
merged 8 commits into from
Feb 25, 2023
Merged

Enable support for node & yarn detection #216

merged 8 commits into from
Feb 25, 2023

Conversation

pivotal-david-osullivan
Copy link
Contributor

Enable support for node & yarn detection

Alternative to #215

Summary

This PR adds support for detection of a package.json or yarn.lock, which will cause the following buildpacks/dependencies to be required as part of the build:

  • yarn.lock - requires install of yarn and node dependencies (can be provided by the yarn & node-engine buildpacks)
  • package.json - requires install of node dependency (can be provided by the node-engine buildpack)

To enable support for detection of these files, users should set the environment variable BP_JAVA_INSTALL_NODE to true (defaults to false to prevent false-positive node builds).

The buildpack will check the application root for the package.json or yarn.lock file. Users can set variables supported by the NodeEngine buildpack, such as BP_NODE_PROJECT_PATH, which can contain a sub-directory within the app root to search for these files.

Full implementation will require both the Yarn and NodeEngine buildpacks to be added to the Java composite order group as optional.

Use Cases

Enables projects which build frontend/javascript code to run commands such as 'yarn' to build alongside Java code. See paketo-buildpacks/java#651.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

Enable support for node & yarn detection
@pivotal-david-osullivan pivotal-david-osullivan added semver:minor A change requiring a minor version bump type:enhancement A general enhancement labels Feb 15, 2023
@pivotal-david-osullivan pivotal-david-osullivan requested a review from a team as a code owner February 15, 2023 14:45
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
gradle/detect.go Outdated Show resolved Hide resolved
gradle/detect.go Show resolved Hide resolved
buildpack.toml Show resolved Hide resolved
gradle/detect.go Outdated Show resolved Hide resolved
Co-authored-by: Daniel Mikusa <dan@mikusa.com>
Co-authored-by: Daniel Mikusa <dan@mikusa.com>
Co-authored-by: Daniel Mikusa <dan@mikusa.com>
@TisVictress
Copy link

Bump 🙂
I'm happy to help or answer questions regarding node

@dmikusa dmikusa merged commit aaef138 into main Feb 25, 2023
@dmikusa dmikusa deleted the js-detection-2 branch February 25, 2023 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants