Skip to content

Commit

Permalink
set workspaces experimental flag true
Browse files Browse the repository at this point in the history
Closes #473
  • Loading branch information
rarkins committed Aug 24, 2017
1 parent 3917fc6 commit 5c95299
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
16 changes: 10 additions & 6 deletions lib/workers/branch/yarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ async function generateLockFile(
let result = {};
try {
await fs.outputFile(path.join(tmpDir, 'package.json'), newPackageJson);
logger.debug('Wrote package.json');
if (npmrcContent) {
await fs.outputFile(path.join(tmpDir, '.npmrc'), npmrcContent);
logger.debug('Wrote .npmrc');
}
if (yarnrcContent) {
const filteredYarnrc = yarnrcContent.replace(
'--install.pure-lockfile true',
''
);
await fs.outputFile(path.join(tmpDir, '.yarnrc'), filteredYarnrc);
let yarnrc = yarnrcContent || '';
if (JSON.parse(newPackageJson).workspaces) {
logger.debug('adding workspaces');
yarnrc = `workspaces-experimental true\n${yarnrc}`;
}
yarnrc = yarnrc.replace('--install.pure-lockfile true', '');
if (yarnrc !== '') {
await fs.outputFile(path.join(tmpDir, '.yarnrc'), yarnrc);
}
await fs.remove(path.join(tmpDir, 'yarn.lock'));
logger.debug(`Spawning yarn install to create ${tmpDir}/yarn.lock`);
Expand Down
1 change: 1 addition & 0 deletions lib/workers/package-file/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function renovatePackageFile(packageFileConfig) {

// Warn if workspaces found
if (config.content.workspaces) {
config.hasWorkspaces = true;
logger.warn('Found workspaces');
const warn = { ...config };
warn.depName = 'workspaces';
Expand Down
2 changes: 1 addition & 1 deletion test/workers/branch/yarn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('generateLockFile', () => {
it('generates lock files', async () => {
const yarnLock = await yarnHelper.generateLockFile(
tmpDir.name,
{},
'{ "workspaces": [] }',
'npmrc-contents',
'yarnrc-contents',
logger
Expand Down

0 comments on commit 5c95299

Please sign in to comment.