Skip to content

ci: use pnpm publish to resolve workspace dependencies#1651

Merged
danielroe merged 1 commit intonuxt:mainfrom
ExEr7um:main
Apr 8, 2026
Merged

ci: use pnpm publish to resolve workspace dependencies#1651
danielroe merged 1 commit intonuxt:mainfrom
ExEr7um:main

Conversation

@ExEr7um
Copy link
Copy Markdown
Contributor

@ExEr7um ExEr7um commented Apr 8, 2026

🔗 Linked issue

📚 Description

The release workflow used npm publish, which doesn't understand pnpm's workspace:* protocol. This caused vitest-environment-nuxt: "workspace:*" to be published as-is to npm, breaking installation for users.

Switched to pnpm publish --no-git-checks which automatically resolves workspace:* to concrete versions during publish. I used nuxt/fonts release script as reference (https://github.com/nuxt/fonts/blob/main/.github/workflows/release.yml).

@ExEr7um ExEr7um requested a review from danielroe as a code owner April 8, 2026 15:17
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 8, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nuxt/test-utils/@nuxt/test-utils@1651
npm i https://pkg.pr.new/nuxt/test-utils/vitest-environment-nuxt@1651

commit: ae1456f

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

The release workflow in .github/workflows/release.yml was modified to use pnpm for package publishing instead of npm. The changes removed steps that configured the npm registry and updated global npm versions for trusted publishing, replacing the npm publish --access public command with pnpm publish --no-git-checks. The workflow now runs only pnpm install, pnpm dev:prepare, and the new publish command.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains why the change was made, references the linked issue, and provides implementation context.
Linked Issues check ✅ Passed The pull request directly addresses issue #1650 by replacing npm publish with pnpm publish to resolve workspace:* references.
Out of Scope Changes check ✅ Passed All changes in the workflow file are directly related to fixing the workspace dependency resolution issue in #1650.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title directly and accurately describes the main change: switching from npm publish to pnpm publish to resolve workspace dependencies, which is the core fix for the issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Line 39: The publish step currently runs "pnpm publish --no-git-checks" which
will publish a scoped package as restricted; update the publish command to
include the access flag by changing the run invocation that uses pnpm publish
(the line containing "pnpm publish --no-git-checks") to add "--access public" so
the final command is "pnpm publish --no-git-checks --access public".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a85a724e-e1b1-46c8-9ca0-95a5930fcfbc

📥 Commits

Reviewing files that changed from the base of the PR and between 8662012 and ae1456f.

📒 Files selected for processing (1)
  • .github/workflows/release.yml


- name: 📦 Release
run: npm publish --access public
run: pnpm publish --no-git-checks
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

For pnpm v10+, when publishing a scoped package, what is the default access if --access is omitted, and does pnpm follow npm’s default behavior? Please include pnpm docs and npm docs links.

💡 Result:

Default access (pnpm v10+) when --access is omitted (scoped packages)

For a scoped package (e.g. @scope/name), if you run pnpm publish without --access, the publish ends up using the registry’s default access behavior—i.e. restricted (private) for scoped packages (same as npm). pnpm documents --access only as a way to tell the registry whether the package should be public or restricted, but does not document a different pnpm-specific default. [1]

Does pnpm follow npm’s default behavior?

Yes—effectively pnpm follows npm’s default behavior here: npm’s CLI docs explicitly state the default is restricted for scoped packages (and public for unscoped). [2] npm’s scoped-package publishing docs also restate that scoped packages are private by default unless you publish with --access public. [3]

Docs links:

pnpm publish (v10.x): https://pnpm.io/cli/publish
npm publish (CLI docs): https://docs.npmjs.com/cli/v8/commands/npm-publish/
npm scoped public packages guide: https://docs.npmjs.com/creating-and-publishing-scoped-public-packages

Sources: pnpm CLI docs for pnpm publish / --access behavior [1]; npm CLI docs for npm publish default access [2]; npm scoped package publishing guide (private by default) [3].

[1] (pnpm.io)
[2] (docs.npmjs.com)
[3] (docs.npmjs.com)

Citations:


🏁 Script executed:

# Find and read package.json to verify package name and publishConfig
fd -e json -n "package.json" --max-depth 1 | head -1 | xargs cat -n

Repository: nuxt/test-utils

Length of output: 289


🏁 Script executed:

# Find and read the root package.json
find . -maxdepth 1 -name "package.json" -type f | xargs cat

Repository: nuxt/test-utils

Length of output: 5080


🏁 Script executed:

# Check the actual release.yml file around line 39 to see the context
cat -n .github/workflows/release.yml | sed -n '30,50p'

Repository: nuxt/test-utils

Length of output: 359


Add --access public to the publish command.

Line 39 must explicitly include --access public. The package @nuxt/test-utils is scoped, and pnpm (like npm) defaults scoped packages to restricted (private) when the access flag is omitted. Without this flag, the package will be published as private and unavailable on the public registry.

Required change
-      - name: 📦 Release
-        run: pnpm publish --no-git-checks
+      - name: 📦 Release
+        run: pnpm publish --access public --no-git-checks
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: pnpm publish --no-git-checks
run: pnpm publish --access public --no-git-checks
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml at line 39, The publish step currently runs
"pnpm publish --no-git-checks" which will publish a scoped package as
restricted; update the publish command to include the access flag by changing
the run invocation that uses pnpm publish (the line containing "pnpm publish
--no-git-checks") to add "--access public" so the final command is "pnpm publish
--no-git-checks --access public".

@danielroe danielroe changed the title chore(release): use pnpm publish to resolve workspace dependencies ci: use pnpm publish to resolve workspace dependencies Apr 8, 2026
@danielroe danielroe merged commit 38cfb46 into nuxt:main Apr 8, 2026
8 checks passed
@github-actions github-actions bot mentioned this pull request Apr 8, 2026
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.

Workspace dependency "vitest-environment-nuxt" not found

2 participants