From 7efabcb4e1dc7aa330a6a92fa562fb6cf579be24 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Thu, 19 Dec 2019 16:53:24 +0200 Subject: [PATCH] fix: pass --access to npm publish only when it is passed to pnpm --- packages/plugin-commands-recursive/src/publish.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/plugin-commands-recursive/src/publish.ts b/packages/plugin-commands-recursive/src/publish.ts index f9a477262f..d7342c7bfe 100644 --- a/packages/plugin-commands-recursive/src/publish.ts +++ b/packages/plugin-commands-recursive/src/publish.ts @@ -1,3 +1,4 @@ +import { Config } from '@pnpm/config' import createResolver from '@pnpm/npm-resolver' import { publish } from '@pnpm/plugin-commands-publishing' import { ResolveFunction } from '@pnpm/resolver-base' @@ -10,7 +11,7 @@ import pFilter = require('p-filter') export default async function ( pkgs: Array<{ dir: string, manifest: ImporterManifest }>, - opts: { + opts: Pick & { access?: 'public' | 'restricted', argv: { original: string[], @@ -56,8 +57,8 @@ export default async function ( resolve, }, pkg.manifest.name, pkg.manifest.version)) }) + const access = opts.cliOptions['access'] ? ['--access', opts.cliOptions['access']] : [] for (const pkg of pkgsToPublish) { - const access = opts.access ?? (pkg.manifest.name!.startsWith('@') ? 'restricted' : 'public') await publish.handler([pkg.dir], { argv: { original: [ @@ -67,8 +68,7 @@ export default async function ( 'pnpm-temp', '--registry', pickRegistryForPackage(opts.registries, pkg.manifest.name!), - '--access', - access, + ...access, ], }, workspaceDir: opts.workspaceDir,