Skip to content

Add publishRoot option - #1405

Open
Elizabeth Craig (ecraig12345) wants to merge 2 commits into
mainfrom
custom-publish-root
Open

Add publishRoot option#1405
Elizabeth Craig (ecraig12345) wants to merge 2 commits into
mainfrom
custom-publish-root

Conversation

@ecraig12345

@ecraig12345 Elizabeth Craig (ecraig12345) commented Aug 26, 2026

Copy link
Copy Markdown
Member

Add an option publishRoot?: string | (({ packagePath, options }) => string) to customize the directory where npm publish/pack is run for each package.

  • If a string, it must be a relative path, and is resolved from each package root.
  • If a function, it may return either an absolute path, or a relative path from the package root.

Added as a proper fix for this patch: https://github.com/microsoft/griffel/blob/main/.yarn/patches/beachball-npm-2.65.4-4bf34ce8d5.patch

The object parameter type leaves it open to add more context (like name or full package info) if there's a proven need.

Copilot AI balanced review requested due to automatic review settings August 26, 2026 00:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds publishRoot to support publishing packages from build-output directories.

Changes:

  • Adds and validates the publishRoot configuration.
  • Applies it to npm publish with functional tests.
  • Documents the option and adds a change file.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/beachball/src/validation/validate.ts Rejects absolute string paths.
packages/beachball/src/types/BeachballOptions.ts Defines the new option.
packages/beachball/src/packageManager/packagePublish.ts Resolves the publish working directory.
packages/beachball/src/commands/configGet.ts Exposes the setting through config inspection.
packages/beachball/src/__tests__/validate/validate.test.ts Tests path validation.
packages/beachball/src/__functional__/packageManager/packagePublish.test.ts Tests string and callback forms.
packages/beachball/src/__e2e__/syncE2E.test.ts Updates test options for the expanded signature.
docs/overview/v3-migration.md Lists the new v3 feature.
docs/overview/configuration.md Documents configuration behavior.
change/beachball-69545193-97e4-4964-a332-29bfe825f8ba.json Records the minor package change.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/beachball/src/packageManager/packagePublish.ts Outdated
Copilot AI review requested due to automatic review settings August 26, 2026 00:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

? options.publishRoot({ packagePath: packageRoot, options })
: options.publishRoot;

return configuredPublishRoot ? path.resolve(packageRoot, configuredPublishRoot) : packageRoot;
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