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

Add function to get version from package.json #10

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

mhdawson
Copy link
Member

@mhdawson mhdawson commented May 3, 2023

package_json_parser needs to parse version to be
re-used in npm-install buildpack.

Summary

Add parsing version in package.json helpers so that shared code
can be reused in npm-install

Use Cases

reduce duplicated code and centralize knowledge of constants

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).

package_json_parser needs to parse version to be
re-used in npm-install buildpack.

Signed-off-by: Michael Dawson <[email protected]>
@mhdawson mhdawson requested a review from a team as a code owner May 3, 2023 01:19
@mhdawson mhdawson requested review from ryanmoran and thitch97 and removed request for a team May 3, 2023 01:19
@mhdawson
Copy link
Member Author

mhdawson commented May 3, 2023

This is the change to make npm-install use the new functioality. Will submit a PR on paketo-buildpacks/npm-install once this PR lands and there is a new version of libnodejs - mhdawson/npm-install@6a25e53

@mhdawson
Copy link
Member Author

@thitch97 any chance you could take a look?

@sophiewigmore sophiewigmore requested a review from a team May 30, 2023 19:26

context("ParseVersion", func() {
it.Before(func() {
Expect(os.WriteFile(filePath, []byte(`{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhdawson Each time the file is written, can it be deleted to keep things clean? (it.After)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure will look at doing that in next few days.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed commit do do cleanup

Copy link

@TisVictress TisVictress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine but I'm worried about lingering files.

@mhdawson
Copy link
Member Author

mhdawson commented Jun 1, 2023

@TisVictress pushed commit to add cleanup of workingDir after every test. All files are written to that workingDir so that should makes sure that all files writen are deleted after the test completes.

@mhdawson
Copy link
Member Author

@TisVictress ping

@thitch97 thitch97 added semver:minor A change requiring a minor version bump semver:patch A change requiring a patch version bump and removed semver:patch A change requiring a patch version bump labels Jun 29, 2023
@TisVictress TisVictress merged commit 8bac97c into paketo-buildpacks:main Jun 29, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants