Add publishPath option to publish a workspace from a subfolder - #146
Merged
Conversation
Allow an individual workspace to be published from a subdirectory (e.g. `dist`) by setting a `publishPath` field on its `package.json`. When present, the publish command runs from `<package>/<publishPath>` instead of the package root. The version bump is still written to the workspace's own `package.json`, so the build that produces the published folder is responsible for including an up-to-date manifest. Originally proposed in #102 by @thivi. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scalvert
force-pushed
the
feat/publish-path
branch
from
June 18, 2026 02:13
7930a15 to
6b8b5c7
Compare
rwjblue-glean
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplements and rebases #102 (original work by @thivi) onto current master.
What it does
Adds an optional
publishPathfield on a workspace's ownpackage.json. When set, that workspace publishes from the given subfolder — e.g."publishPath": "dist"runsnpm publish ./packages/foo/distinstead of./packages/foo. Useful when a build emits a ready-to-publish package into a subdirectory. It's the per-package analog of the existing project-wideworkspaces: ["dist/packages/*"]option.Notes from the rebase
findAdditionalManifests(the version/dependency-update path); the publishing logic now lives ingetWorkspaces, so the change was applied there. Confirmed against the PR's own expected output (npm publish ./packages/bar/dist).package.json, so a "publish from dist" build must copy an up-to-datepackage.jsoninto the publish dir.Supersedes #102.
npm testgreen: lint + 41/41.🤖 Generated with Claude Code