Skip to content

Commit

Permalink
feat: publishConfig.registry
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Jul 13, 2023
1 parent 48829ed commit cb07dcc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/angry-goats-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@pnpm/plugin-commands-publishing": minor
"@pnpm/types": minor
"pnpm": minor
---

Support `publishConfig.registry` in `package.json` for publishing [#6775](https://github.com/pnpm/pnpm/issues/6775).
1 change: 1 addition & 0 deletions packages/types/src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface PublishConfig extends Record<string, unknown> {
directory?: string
linkDirectory?: boolean
executableFiles?: string[]
registry?: string
}

type Version = string
Expand Down
3 changes: 2 additions & 1 deletion releasing/plugin-commands-publishing/src/recursivePublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export async function recursivePublish (
const publishResults = await Promise.all(chunk.map(async (pkgDir) => {
if (!publishedPkgDirs.has(pkgDir)) return null
const pkg = opts.selectedProjectsGraph[pkgDir].package
const registry = pkg.manifest.publishConfig?.registry ?? pickRegistryForPackage(opts.registries, pkg.manifest.name!)
const publishResult = await publish({
...opts,
dir: pkg.dir,
Expand All @@ -114,7 +115,7 @@ export async function recursivePublish (
'--tag',
tag,
'--registry',
pickRegistryForPackage(opts.registries, pkg.manifest.name!),
registry,
...appendedArgs,
],
},
Expand Down

0 comments on commit cb07dcc

Please sign in to comment.