Skip to content

Conversation

Copy link

Copilot AI commented Aug 21, 2025

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#PRname or npm install auth0#commithash would get the raw source code without the built dist files, causing installation failures.

Changes Made

1. Added prepare script to package.json

  • Automatically builds the package when installed from GitHub
  • Ensures dist files are available even when installing from source
  • Only runs the build if dist directory doesn't exist (to avoid rebuilding during normal npm operations)

2. Created GitHub Actions workflow for PR builds

  • File: .github/workflows/pr-build.yml
  • Automatically builds and commits dist files to PRs
  • Runs on PR creation and updates
  • Uses a bot account to commit built files
  • Includes proper git configuration and commit messages

3. Updated .gitignore

  • Removed dist/ from gitignore for PR branches
  • Added conditional gitignore handling to allow dist files in PRs while keeping them ignored in main development

How it works

For PR installations:

  1. When a PR is created/updated, the workflow automatically builds the dist files
  2. The built files are committed to the PR branch
  3. Users can install with npm install auth0#pr-branch-name and get the built version

For commit hash installations:

  1. The prepare script ensures the package builds automatically during installation
  2. Users can install with npm install auth0#commit-hash and the build happens post-install

For regular development:

  1. dist/ remains gitignored on the main branch
  2. Normal development workflow is unchanged
  3. Published npm packages continue to include only the necessary built files

Benefits

  • ✅ Enables reliable GitHub installations for testing PRs
  • ✅ Supports commit hash installations for specific versions
  • ✅ Maintains clean development workflow
  • ✅ Ensures consistent built artifacts across environments
  • ✅ No impact on regular npm package installations

Testing

Users can now install from GitHub using:

# Install from a PR branch
npm install auth0#feature/new-feature

# Install from a specific commit
npm install auth0#abc123def456

# Install from main branch
npm install auth0#master

All installations will include the proper built dist files and work correctly in consuming applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants