Skip to content

feat(meta): publish @node-core/* packages #7776

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

avivkeller
Copy link
Member

The current vote on importing @node-core/* into api-docs-tooling stands at 8/0/0 in favor of publishing the @node-core/* packages. Given the lack of opposition in broader discussions, this outcome is unlikely to change.

As a result, this PR publishes the following packages to the npm registry:

  • @node-core/ui-components
  • @node-core/website-i18n
  • @node-core/rehype-shiki
  • Any future packages in the packages/ directory

These packages will be published on any commit that modifies their directories, provided the following conditions are met:

  • The commit passes the "Linting and Tests" check on push to main, or the workflow is manually triggered.
  • The commit was merged via the queue (i.e., not force-pushed to main).

Publishing requires a publish secrets.NPM_TOKEN for the @node-core scope, similar to the one used for Caritat.

@Copilot Copilot AI review requested due to automatic review settings May 23, 2025 20:25
@avivkeller avivkeller requested a review from a team as a code owner May 23, 2025 20:25
Copy link

vercel bot commented May 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 24, 2025 6:55pm

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.34%. Comparing base (39e3ae1) to head (a8235b4).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7776      +/-   ##
==========================================
+ Coverage   75.31%   75.34%   +0.02%     
==========================================
  Files          96       96              
  Lines        7856     7861       +5     
  Branches      192      192              
==========================================
+ Hits         5917     5923       +6     
+ Misses       1938     1937       -1     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a GitHub Actions workflow to automatically detect, verify, and publish any @node-core/* packages in the packages/ directory when changes are merged to main or manually triggered.

  • Introduces .github/workflows/publish-packages.yml
  • Detects which packages changed (or a specific package via input)
  • Verifies commit authenticity and merge-queue origin before publishing via pnpm
Comments suppressed due to low confidence (1)

.github/workflows/publish-packages.yml:38

  • [nitpick] Parsing ls output can break on directories with spaces or unexpected files. Consider using find packages -maxdepth 1 -type d -printf '%f\n' or verifying each folder contains a package.json.
PACKAGES=$(ls -d packages/* | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')

@AugustinMauroy
Copy link
Member

we should add doc about

  • how to release as collaborator
  • why release package on npm registry

@avivkeller
Copy link
Member Author

I've updated the PR with:

  • More comments on the workflow
  • A slack notification on manual publish
  • Docs

@AugustinMauroy
Copy link
Member

we need a npm token ?

@avivkeller
Copy link
Member Author

Publishing requires a publish secrets.NPM_TOKEN for the @node-core scope, similar to the one used for Caritat.

# This ensures we can publish multiple times from the same codebase with unique versions
npm version --no-git-tag-version 0.0.0-$COMMIT_SHA
# Publish the package to the npm registry with public access flag
pnpm publish --access public
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to generate changelogs too? With Conventional Changelogs?

I think we should publish git-tags and versions here based on our commits. We already use (or somewhat use) conventional commits.

We can do this in a follow-up PR, so feel free to open an issue to address that.

- name: Publish
working-directory: packages/${{ matrix.package }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

Did you get the token already or do you still need a token?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't request one, no.

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM

env:
PACKAGE: ${{ github.event.inputs.package }}
EVENT_NAME: ${{ github.event_name }}
run: |
Copy link
Member

Choose a reason for hiding this comment

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

Nice

@ovflowd
Copy link
Member

ovflowd commented May 25, 2025

I've opened this issue: nodejs/admin#971

And thanks, @avivkeller for the work here <3

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.

4 participants