Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure build is run on prepack #167

Merged
merged 1 commit into from
Jul 29, 2023
Merged

Ensure build is run on prepack #167

merged 1 commit into from
Jul 29, 2023

Conversation

frederikprijck
Copy link
Member

@frederikprijck frederikprijck commented Jul 29, 2023

Description

Ensure to build before running npm pack or npm publish.

References

See: #151 (comment)

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@frederikprijck frederikprijck requested a review from a team as a code owner July 29, 2023 10:37
@frederikprijck frederikprijck mentioned this pull request Jul 29, 2023
4 tasks
@frederikprijck
Copy link
Member Author

Force merging this to fix the broken beta release.

@frederikprijck frederikprijck merged commit e44a24d into beta Jul 29, 2023
@frederikprijck frederikprijck deleted the fix/publish branch July 29, 2023 10:42
@jonkoops
Copy link
Contributor

Any particular reason why prepack was used rather than prepublishOnly? The reason I am asking is that prepack will not run on npm publish, so I imagine the publishing process does not make use of this command?

@frederikprijck
Copy link
Member Author

frederikprijck commented Jul 29, 2023

It does, we use npm publish (see: https://github.com/auth0/jwt-decode/blob/beta/.circleci/config.yml#L39), and prepack solved it (it's what's we use on all SDKs, no particular reason). See https://docs.npmjs.com/cli/v9/using-npm/scripts#life-cycle-operation-order

@frederikprijck
Copy link
Member Author

The main benefit is it also runs on npm pack, which we use to try the tarball locally, so just a little bit of convenience over prePublishOnly

@jonkoops
Copy link
Contributor

Strange, when I run npm publish --dry-run locally, the prepack step never runs:

image

I'm on NPM 9.8.0, not sure if this has changed between versions.

@frederikprijck
Copy link
Member Author

The page mentions that prepare isnt executed when adding --dry-run. Prepack is done before, and postpack after prepare. So i assume its expected with --dry-run.

@jonkoops
Copy link
Contributor

I'd still expect it to run either way, even if I omit --dry-run I am still not seeing prepack being run. But perhaps it's something about my NPM setup 🤷‍♂️

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants