Skip to content

Add publishPath option to publish a workspace from a subfolder - #146

Merged
rwjblue-glean merged 1 commit into
masterfrom
feat/publish-path
Jun 18, 2026
Merged

Add publishPath option to publish a workspace from a subfolder#146
rwjblue-glean merged 1 commit into
masterfrom
feat/publish-path

Conversation

@scalvert

Copy link
Copy Markdown
Collaborator

Reimplements and rebases #102 (original work by @thivi) onto current master.

What it does

Adds an optional publishPath field on a workspace's own package.json. When set, that workspace publishes from the given subfolder — e.g. "publishPath": "dist" runs npm publish ./packages/foo/dist instead 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-wide workspaces: ["dist/packages/*"] option.

Notes from the rebase

  • The original 2023 diff targeted findAdditionalManifests (the version/dependency-update path); the publishing logic now lives in getWorkspaces, so the change was applied there. Confirmed against the PR's own expected output (npm publish ./packages/bar/dist).
  • Tests rewritten for the current async harness.
  • README documents that the version bump is written to the workspace's own package.json, so a "publish from dist" build must copy an up-to-date package.json into the publish dir.

Supersedes #102. npm test green: lint + 41/41.

🤖 Generated with Claude Code

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
scalvert force-pushed the feat/publish-path branch from 7930a15 to 6b8b5c7 Compare June 18, 2026 02:13
@rwjblue-glean
rwjblue-glean merged commit 82a0fd7 into master Jun 18, 2026
6 checks passed
@rwjblue-glean
rwjblue-glean deleted the feat/publish-path branch June 18, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants