Add @hawk.so/core to npm publish #185
Conversation
There was a problem hiding this comment.
Pull request overview
Extends the npm publish GitHub Actions workflow to publish @hawk.so/core alongside @hawk.so/javascript, and updates @hawk.so/javascript to depend on @hawk.so/core at runtime (reverting the temporary approach from #180).
Changes:
- Move
@hawk.so/corefromdevDependenciestodependenciesinpackages/javascript. - Publish
@hawk.so/coreto npm in.github/workflows/npm-publish.ymlbefore publishing@hawk.so/javascript. - Bump
actions/checkoutfromv2tov4in the publish + notify jobs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/javascript/package.json | Makes @hawk.so/core a runtime dependency of @hawk.so/javascript. |
| .github/workflows/npm-publish.yml | Publishes @hawk.so/core in CI and updates checkout action version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - run: yarn | ||
| - run: yarn lint-test | ||
| - run: yarn build:all | ||
| - run: yarn workspace @hawk.so/core npm publish --access=public |
There was a problem hiding this comment.
The workflow now always attempts to publish @hawk.so/core on every push to master. After the first successful publish, subsequent runs will fail if packages/core/package.json version hasn’t been bumped (npm rejects republishing the same version), which would block publishing @hawk.so/javascript as well.
Consider making the core publish step conditional/idempotent (e.g., skip if the version already exists on npm, or only run when packages/core changed / its version changed). Alternatively, publish via a tool/process that handles multi-package releases and versioning consistently.
| - run: yarn workspace @hawk.so/core npm publish --access=public | |
| - name: Check whether @hawk.so/core version is already published | |
| id: core_publish_check | |
| run: | | |
| PACKAGE_NAME=$(node -p "require('./packages/core/package.json').name") | |
| PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version") | |
| if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version >/dev/null 2>&1; then | |
| echo "should_publish=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "should_publish=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - if: steps.core_publish_check.outputs.should_publish == 'true' | |
| run: yarn workspace @hawk.so/core npm publish --access=public |
There was a problem hiding this comment.
Added version auto-bump on PR. Bump level determined by commit message.
4859524 to
ec27a3f
Compare
Added CI workflows that check if versions of packages core and javascript should be bumped. Bump level depends on commit message: - major - '!' after type or body contains 'BREAKING CHANGES' string - minor - commit of type 'feat' - patch - otherwise
Extends the CI publish workflow to publish
@hawk.so/coreto npm alongside@hawk.so/javascript.Also bumps
actions/checkoutfromv2tov4in both workflow jobs.Also moves
@hawk.so/corefrom a dev dependency to a runtime dependency in@hawk.so/javascript(see #180).