Skip to content

Commit

Permalink
fix(core): special case projects for lerna users
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Dec 23, 2022
1 parent 8f267ed commit f0d67b5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 18 additions & 0 deletions packages/nx/src/utils/command-line-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,24 @@ describe('splitArgs', () => {
});
});

it('should split projects when it is a string', () => {
expect(
splitArgsIntoNxArgsAndOverrides(
{
projects: 'aaa,bbb',
__overrides_unparsed__: [],
$0: '',
},
'run-many',
{} as any,
{} as any
).nxArgs
).toEqual({
projects: ['aaa', 'bbb'],
skipNxCache: false,
});
});

it('should set base and head based on environment variables in affected mode, if they are not provided directly on the command', () => {
const originalNxBase = process.env.NX_BASE;
process.env.NX_BASE = 'envVarSha1';
Expand Down
7 changes: 5 additions & 2 deletions packages/nx/src/utils/command-line-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ export function splitArgsIntoNxArgsAndOverrides(
delete (nxArgs as any).__overrides_unparsed__;

if (mode === 'run-many') {
if (!nxArgs.projects) {
nxArgs.projects = [];
const args = nxArgs as any;
if (!args.projects) {
args.projects = [];
} else if (typeof args.projects === 'string') {
args.projects = args.projects.split(',');
}
}

Expand Down

1 comment on commit f0d67b5

@vercel
Copy link

@vercel vercel bot commented on f0d67b5 Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.