Skip to content

Commit

Permalink
fix(core): add project.json to nx implicit dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Feb 3, 2022
1 parent da64519 commit 8567ca4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
3 changes: 2 additions & 1 deletion packages/workspace/presets/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"dependencies": "*",
"devDependencies": "*"
},
".eslintrc.json": "*"
".eslintrc.json": "*",
"packages/**/project.json": "*"
},
"targetDependencies": {
"build": [
Expand Down
3 changes: 2 additions & 1 deletion packages/workspace/presets/npm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"dependencies": "*",
"devDependencies": "*"
},
".eslintrc.json": "*"
".eslintrc.json": "*",
"packages/**/project.json": "*"
},
"targetDependencies": {
"build": [
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/src/command-line/run-one.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function runOne(opts: {
await connectToNxCloudUsingScan(nxArgs.scan);

const projectGraph = await createProjectGraphAsync();
const { projects, projectsMap } = getProjects(projectGraph, opts.project);
const { projects } = getProjects(projectGraph, opts.project);
const env = readEnvironment();

await runCommand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Object {
},
"implicitDependencies": Object {
".eslintrc.json": "*",
"apps/**/project.json": "*",
"libs/**/project.json": "*",
"package.json": Object {
"dependencies": "*",
"devDependencies": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"dependencies": "*",
"devDependencies": "*"
},
".eslintrc.json": "*"
".eslintrc.json": "*",
"apps/**/project.json": "*",
"libs/**/project.json": "*"
},
"tasksRunnerOptions": {
"default": {
Expand Down
30 changes: 16 additions & 14 deletions packages/workspace/src/generators/workspace/workspace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ describe('@nrwl/workspace:workspace', () => {
devDependencies: '*',
},
'.eslintrc.json': '*',
'apps/**/project.json': '*',
'libs/**/project.json': '*',
},
tasksRunnerOptions: {
default: {
Expand Down Expand Up @@ -123,14 +125,14 @@ describe('@nrwl/workspace:workspace', () => {

const { scripts } = readJson(tree, '/proj/package.json');
expect(scripts).toMatchInlineSnapshot(`
Object {
"build": "nx build",
"ng": "nx",
"postinstall": "node ./decorate-angular-cli.js",
"start": "nx serve",
"test": "nx test",
}
`);
Object {
"build": "nx build",
"ng": "nx",
"postinstall": "node ./decorate-angular-cli.js",
"start": "nx serve",
"test": "nx test",
}
`);
});

it('should not add decorate-angular-cli when used with nx cli', async () => {
Expand All @@ -145,12 +147,12 @@ Object {

const { scripts } = readJson(tree, '/proj/package.json');
expect(scripts).toMatchInlineSnapshot(`
Object {
"build": "nx build",
"start": "nx serve",
"test": "nx test",
}
`);
Object {
"build": "nx build",
"start": "nx serve",
"test": "nx test",
}
`);
});

it('should create a workspace using package layout', async () => {
Expand Down

0 comments on commit 8567ca4

Please sign in to comment.