Skip to content

fix: publish from package directory#5

Merged
Nsttt merged 1 commit intomainfrom
fix/publish-package-dir
Mar 31, 2026
Merged

fix: publish from package directory#5
Nsttt merged 1 commit intomainfrom
fix/publish-package-dir

Conversation

@Nsttt
Copy link
Copy Markdown
Member

@Nsttt Nsttt commented Mar 31, 2026

What changed

  • stop using npm ... --workspace packages/astro in the release publish workflow
  • patch prerelease versions with npm pkg set --prefix packages/astro
  • publish from packages/astro as the working directory
  • update release docs to call out that this repo uses pnpm-workspace.yaml, not root npm workspaces

Why

The publish workflow failed with:

npm error No workspaces found:
npm error   --workspace=packages/astro

This repo does not define root npm workspaces, so npm workspace flags are the wrong mechanism in CI. The package needs to be mutated and published from its directory directly.

Impact

  • release and prerelease publish steps no longer depend on npm workspace discovery
  • stable and prerelease publish paths both target packages/astro correctly

Validation

  • pnpm --filter @module-federation/astro test
  • cd packages/astro && npm publish --dry-run --access public --tag latest

@Nsttt Nsttt self-assigned this Mar 31, 2026
@Nsttt Nsttt marked this pull request as ready for review March 31, 2026 13:22
Copilot AI review requested due to automatic review settings March 31, 2026 13:22
@Nsttt Nsttt merged commit 3b9bc21 into main Mar 31, 2026
2 checks passed
Copy link
Copy Markdown

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

Updates the release publishing automation to publish @module-federation/astro directly from packages/astro (avoiding npm workspace flags) and aligns the release documentation with the repo’s pnpm-workspace.yaml setup.

Changes:

  • Switch prerelease version patching from npm ... --workspace to npm pkg set ... --prefix packages/astro.
  • Publish using working-directory: packages/astro instead of npm workspace targeting.
  • Update release docs to note publishing from the package directory and clarify pnpm workspaces vs root npm workspaces.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/RELEASING.md Updates release docs to reflect publishing from packages/astro and correct workspace expectations.
.github/workflows/publish-on-release.yml Removes reliance on npm workspace discovery by patching/publishing from packages/astro.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/RELEASING.md
Comment on lines +31 to +32
- On `prereleased` events, workflow patches `packages/astro/package.json` to `<base>-next.<N>` before publish.
- npm publish runs from `packages/astro` directly; this repo uses `pnpm-workspace.yaml`, not root npm workspaces.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The bullets under “Pre-release versioning:” are mis-indented (lines 31–32). As written, they won’t render as nested bullets under that heading, unlike the “Existing version handling” section below. Align these list items’ indentation with the other nested bullets (e.g., indent to the same level as lines 34–35).

Suggested change
- On `prereleased` events, workflow patches `packages/astro/package.json` to `<base>-next.<N>` before publish.
- npm publish runs from `packages/astro` directly; this repo uses `pnpm-workspace.yaml`, not root npm workspaces.
- On `prereleased` events, workflow patches `packages/astro/package.json` to `<base>-next.<N>` before publish.
- npm publish runs from `packages/astro` directly; this repo uses `pnpm-workspace.yaml`, not root npm workspaces.

Copilot uses AI. Check for mistakes.
Comment on lines 178 to +181
- name: Publish to npm
if: steps.publish_action.outputs.action == 'publish'
run: npm publish --provenance --tag "${{ steps.dist.outputs.dist_tag }}" --access public --workspace packages/astro
working-directory: packages/astro
run: npm publish --provenance --tag "${{ steps.dist.outputs.dist_tag }}" --access public
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This workflow no longer uses npm workspaces, but the repo still contains .github/workflows/release.yml which runs npm publish ... --workspace packages/astro (and will hit the same “No workspaces found” error described in the PR). If that workflow is still intended to be used, it should be updated similarly (publish from packages/astro or use --prefix), or removed to avoid a broken release path.

Copilot uses AI. Check for mistakes.
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