fix(yarn): sub package use root npmrc

This commit is contained in:
Rhys Arkins 2021-05-22 15:24:35 +02:00
parent 7eb2c09b6e
commit 3de02c37e4
3 changed files with 7 additions and 0 deletions

View file

@ -168,6 +168,8 @@ Array [
exports[`manager/npm/extract/monorepo .extractPackageFile() uses yarn workspaces package settings without lerna 1`] = `
Array [
Object {
"npmrc": "@org:registry=//registry.some.org
",
"packageFile": "package.json",
"yarnWorkspacesPackages": "packages/*",
},
@ -178,6 +180,8 @@ Array [
"lernaJsonFile": undefined,
},
"npmLock": undefined,
"npmrc": "@org:registry=//registry.some.org
",
"packageFile": "packages/a/package.json",
"packageJsonName": "@org/a",
"yarnLock": "yarn.lock",

View file

@ -139,6 +139,7 @@ describe(getName(), () => {
const packageFiles = [
{
packageFile: 'package.json',
npmrc: '@org:registry=//registry.some.org\n',
yarnWorkspacesPackages: 'packages/*',
},
{

View file

@ -17,6 +17,7 @@ export async function detectMonorepos(
packageFile,
npmLock,
yarnLock,
npmrc,
managerData = {},
lernaClient,
lernaPackages,
@ -52,6 +53,7 @@ export async function detectMonorepos(
subPackage.npmLock = subPackage.npmLock || npmLock;
if (subPackage.yarnLock) {
subPackage.hasYarnWorkspaces = !!yarnWorkspacesPackages;
subPackage.npmrc = subPackage.npmrc || npmrc;
}
if (!updateInternalDeps) {
subPackage.deps?.forEach((dep) => {