[WIP] Enable GitHub installs with built dist files for PRs and commits #1160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Coding agent has begun work on Enable GitHub installs with built dist files for PRs and commits and will replace this description as work progresses.
See problem context
This PR addresses the issue where users installing the package directly from GitHub using
npm install auth0#PRnameornpm install auth0#commithashwould get the raw source code without the builtdistfiles, causing installation failures.Changes Made
1. Added
preparescript to package.jsondistfiles are available even when installing from sourcedistdirectory doesn't exist (to avoid rebuilding during normal npm operations)2. Created GitHub Actions workflow for PR builds
.github/workflows/pr-build.yml3. Updated .gitignore
dist/from gitignore for PR branchesHow it works
For PR installations:
npm install auth0#pr-branch-nameand get the built versionFor commit hash installations:
preparescript ensures the package builds automatically during installationnpm install auth0#commit-hashand the build happens post-installFor regular development:
dist/remains gitignored on the main branchBenefits
Testing
Users can now install from GitHub using:
All installations will include the proper built
distfiles and work correctly in consuming applications.