Skip to content

Commit 3524ef9

Browse files
feat(core): support nx v13 (#226)
Co-authored-by: AgentEnder <craigorycoppola@gmail.com> Co-authored-by: benpsnyder <ben@snyder.tech>
1 parent 6c75c73 commit 3524ef9

File tree

10 files changed

+3647
-5634
lines changed

10 files changed

+3647
-5634
lines changed

migrations.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

nx.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
}
2727
}
2828
},
29-
"projects": {},
3029
"workspaceLayout": {
3130
"appsDir": "",
3231
"libsDir": "packages"
@@ -38,5 +37,8 @@
3837
"projects": "dependencies"
3938
}
4039
]
40+
},
41+
"cli": {
42+
"defaultCollection": "@nrwl/workspace"
4143
}
4244
}

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
"private": false,
3939
"dependencies": {
4040
"@algolia/client-search": "^4.10.5",
41-
"@docusaurus/core": "^2.0.0-beta.1",
42-
"@docusaurus/preset-classic": "^2.0.0-beta.6",
43-
"@docusaurus/theme-search-algolia": "^2.0.0-beta.6",
41+
"@docusaurus/core": "^2.0.0-beta.8",
42+
"@docusaurus/preset-classic": "^2.0.0-beta.8",
43+
"@docusaurus/theme-search-algolia": "^2.0.0-beta.8",
4444
"@mdx-js/react": "^1.6.21",
4545
"@types/xmldoc": "^1.1.6",
4646
"chokidar": "^3.5.2",
4747
"clsx": "^1.1.1",
48-
"eslint": "^7.22.0",
48+
"eslint": "7.32.0",
4949
"glob": "^7.2.0",
5050
"inquirer": "^8.2.0",
5151
"prism-react-renderer": "^1.2.1",
@@ -60,16 +60,16 @@
6060
"@commitlint/cli": "^13.2.1",
6161
"@commitlint/config-conventional": "^13.2.0",
6262
"@commitlint/types": "^13.2.0",
63-
"@nrwl/cli": "12.9.0",
64-
"@nrwl/devkit": "12.9.0",
65-
"@nrwl/eslint-plugin-nx": "12.9.0",
66-
"@nrwl/jest": "12.9.0",
67-
"@nrwl/linter": "12.9.0",
68-
"@nrwl/node": "12.9.0",
69-
"@nrwl/nx-cloud": "12.3.14",
70-
"@nrwl/nx-plugin": "12.9.0",
71-
"@nrwl/tao": "12.9.0",
72-
"@nrwl/workspace": "12.9.0",
63+
"@nrwl/cli": "13.0.1",
64+
"@nrwl/devkit": "13.0.1",
65+
"@nrwl/eslint-plugin-nx": "13.0.1",
66+
"@nrwl/jest": "13.0.1",
67+
"@nrwl/linter": "13.0.1",
68+
"@nrwl/node": "13.0.1",
69+
"@nrwl/nx-cloud": "12.5.0",
70+
"@nrwl/nx-plugin": "13.0.1",
71+
"@nrwl/tao": "13.0.1",
72+
"@nrwl/workspace": "13.0.1",
7373
"@nx-dotnet/nxdoc": "latest",
7474
"@nx-plus/docusaurus": "^12.2.0",
7575
"@semantic-release/changelog": "^6.0.0",

packages/core/src/executors/build/executor.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('Build Executor', () => {
4040
},
4141
},
4242
},
43+
npmScope: 'unit-tests',
4344
},
4445
isVerbose: false,
4546
};

packages/core/src/executors/format/executor.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('Format Executor', () => {
4545
},
4646
},
4747
},
48+
npmScope: 'unit-tests',
4849
},
4950
isVerbose: false,
5051
};

packages/core/src/executors/publish/executor.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ describe('Publish Executor', () => {
4646
},
4747
},
4848
},
49+
npmScope: 'unit-tests',
4950
},
5051
isVerbose: false,
5152
};

packages/core/src/executors/test/executor.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe('Test Executor', () => {
3636
},
3737
},
3838
},
39+
npmScope: 'unit-tests',
3940
},
4041
isVerbose: false,
4142
};

packages/core/src/tasks/check-module-boundaries.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { appRootPath } from '@nrwl/tao/src/utils/app-root';
2-
import {
3-
ProjectConfiguration,
4-
WorkspaceJsonConfiguration,
5-
Workspaces,
6-
} from '@nrwl/tao/src/shared/workspace';
2+
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
73

84
import { ESLint } from 'eslint';
95

@@ -13,24 +9,21 @@ import {
139
readConfig,
1410
} from '@nx-dotnet/utils';
1511
import {
16-
NxJsonConfiguration,
17-
NxJsonProjectConfiguration,
12+
WorkspaceJsonConfiguration,
1813
readJsonFile,
1914
Tree,
15+
NxJsonConfiguration,
16+
ProjectConfiguration,
2017
} from '@nrwl/devkit';
21-
22-
type ExtendedWorkspaceJson = WorkspaceJsonConfiguration & {
23-
projects: Record<string, ProjectConfiguration & NxJsonProjectConfiguration>;
24-
};
18+
import { join } from 'path';
2519

2620
export async function checkModuleBoundariesForProject(
2721
project: string,
28-
workspace: ExtendedWorkspaceJson,
22+
workspace: WorkspaceJsonConfiguration,
2923
): Promise<string[]> {
3024
const projectRoot = workspace.projects[project].root;
3125
const tags = workspace.projects[project].tags ?? [];
3226
if (!tags.length) {
33-
//
3427
return [];
3528
}
3629
const configuredConstraints = await loadModuleBoundaries(projectRoot);
@@ -101,20 +94,23 @@ async function main() {
10194
},
10295
});
10396
const workspace = new Workspaces(appRootPath);
104-
const workspaceJson: ExtendedWorkspaceJson =
97+
const workspaceJson: WorkspaceJsonConfiguration =
10598
workspace.readWorkspaceConfiguration();
106-
const nxJsonProjects = readJsonFile<NxJsonConfiguration>(
107-
`${appRootPath}/nx.json`,
108-
).projects;
109-
if (nxJsonProjects) {
110-
Object.entries(nxJsonProjects).forEach(([name, config]) => {
99+
100+
// Nx v12 support
101+
const nxJson: NxJsonConfiguration & Record<string, ProjectConfiguration> =
102+
readJsonFile(join(appRootPath, 'nx.json'));
103+
if (nxJson.projects) {
104+
Object.entries(nxJson.projects).forEach(([name, config]) => {
111105
const existingTags = workspaceJson.projects[name]?.tags ?? [];
112106
workspaceJson.projects[name].tags = [
113107
...existingTags,
114108
...(config.tags ?? []),
115109
];
116110
});
117111
}
112+
// End Nx v12 support
113+
118114
console.log(`Checking module boundaries for ${project}`);
119115
const violations = await checkModuleBoundariesForProject(
120116
project,

workspace.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@
1313
"typescript": "packages/typescript",
1414
"typescript-e2e": "e2e/typescript-e2e",
1515
"utils": "packages/utils"
16-
},
17-
"cli": {
18-
"defaultCollection": "@nrwl/workspace"
1916
}
2017
}

0 commit comments

Comments
 (0)