Skip to content

Conversation

@thgaskell
Copy link
Contributor

@thgaskell thgaskell commented Jul 9, 2025

This PR allows anyone with admin repo access to publish @nmfs-radfish/radfish and @nmfs-radfish/react-radfish packages to NPM.

Simplified @nmfs-radfish/radfish package's test dependencies by migrating from Jest → Vitest. The ESM update from #691 fixed running tests from downstream applications, but caused issues when running the packages own test suite.

Also resolves #685.

When workflows require the:

  • release type (major, minor, patch)
  • whether or not it's a prerelease

This helps to determine the tags that will be created and updated when pushing to both npm and github.

Additionally, a GitHub release will be drafted to reference the [package]@[version] tag.

thgaskell added 3 commits July 9, 2025 10:00
- Add publish-radfish.yml workflow for @nmfs-radfish/radfish package
- Add publish-react-radfish.yml workflow for @nmfs-radfish/react-radfish package
- Include admin permission checks, version bumping, testing, and publishing steps
- Add rollback mechanisms for failed publishes
- Remove babel.config.js and jest.config.js
- Update package.json to use vitest instead of jest
- Replace jest imports with vitest imports in all test files
- Remove Jest-related dependencies and add vitest dependencies
- Clean up unnecessary dependencies from radfish package
- Add publishConfig for npm registry publishing
- Add React as peer dependency
- Configure package for public access
@thgaskell thgaskell requested a review from jaygiang July 9, 2025 20:12
thgaskell added 6 commits July 9, 2025 11:52
- Change tag format from @nmfs-radfish/[package]@[version] to [package]@[version]
- Update both radfish and react-radfish workflows
- Cleaner tag names since repository is already nmfs-radfish namespaced
- Add [package-name]@latest tags that get updated with each new version
- Force push latest tags to always point to the most recent release
- Provides a stable reference for the current version of each package
- For prereleases: only create/update beta tag
- For stable releases: only create/update latest tag
- Prevents latest tag from being updated by prereleases
- Allows beta tag to become stale between prerelease cycles
- For prereleases: npm publish --tag beta
- For stable releases: npm publish (defaults to latest tag)
- Ensures npm registry tags match git tag behavior
jaygiang
jaygiang previously approved these changes Jul 14, 2025
Copy link
Collaborator

@jaygiang jaygiang left a comment

Choose a reason for hiding this comment

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

LGTM ✅

- Update workflows to use github.ref instead of hardcoded main branch
- Change step name from 'Checkout main branch' to 'Checkout repository'
- Ensures workflows run against the current branch's code and dependencies
- Fixes Jest vs Vitest test runner issue when running from feature branches
thgaskell and others added 11 commits July 14, 2025 13:48
- Change from ^1.0.0 to >=1.0.0 <2.0.0 for @nmfs-radfish/radfish
- Allows independent versioning of packages within major version
- Prevents npm version bump conflicts in monorepo workspace
- Commits to semantic versioning within v1.x.x releases
- Regenerate lockfile to reflect peer dependency change from ^1.0.0 to >=1.0.0 <2.0.0
- Should resolve npm version bump conflicts in workspace
- Change from >=1.0.0 <2.0.0 to ^1.0.0-0 for @nmfs-radfish/radfish
- ^1.0.0-0 allows prereleases like 1.1.2-rc.1 while maintaining semver compatibility
- Should resolve npm version bump issues with prerelease versions
- Add --legacy-peer-deps to npm version commands in both workflows
- Resolves peer dependency conflicts when bumping prerelease versions
- Allows using standard ^1.0.0 peer dependency format
- Replace separate version + prerelease inputs with single version_type dropdown
- Remove complex conditional logic for determining version bump type
- Auto-detect prerelease status from resulting version for npm publish tags
- Remove redundant 'Navigate to package directory' steps
- Eliminate ambiguity: users now explicitly choose exact version bump behavior

Examples:
- prerelease: 1.1.2-rc.1 → 1.1.2-rc.2
- preminor: 1.1.2-rc.1 → 1.2.0-rc.1
- minor: 1.1.2 → 1.2.0
- npm version command outputs multiline content that breaks GitHub Actions
- Now run npm version to update package.json, then use jq to get clean version
- Eliminates multiline output issues and removes 'v' prefix automatically
- Results in clean version strings like '1.1.2-rc.3' instead of 'v1.1.2-rc.3\n...'
- Fixes 'Unable to process file command output successfully' error
- Workflows were failing when run on feature branches because they tried to push to 'main'
- Changed 'git push origin main' to 'git push origin HEAD' to push current branch
- Now workflows work correctly on any branch, including feature branches for testing
- Ready to run workflow with prerelease version type
- npm version prerelease will increment to 1.1.2-rc.1
- Resolves peer dependency conflicts during npm install
- react-radfish has peer dependency ^1.0.0 but workspace has 1.1.1
- --legacy-peer-deps allows npm to proceed with installation
@jaygiang jaygiang self-requested a review August 12, 2025 16:19
jaygiang
jaygiang previously approved these changes Aug 12, 2025
Copy link
Collaborator

@jaygiang jaygiang left a comment

Choose a reason for hiding this comment

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

Approved ✅

Copy link
Collaborator

@jaygiang jaygiang left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@thgaskell thgaskell merged commit b79be33 into main Aug 12, 2025
0 of 2 checks passed
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.

react dependencies

3 participants