Skip to content

Commit 33344cd

Browse files
authored
feat(core): nx 17 support (#778)
BREAKING CHANGE: Drops Nx v15 support
1 parent e8a60d7 commit 33344cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+956
-703
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ jobs:
1616
with:
1717
main-branch-name: 'master'
1818
parallel-commands: |
19-
npx nx-cloud record npx nx workspace-lint
2019
npx nx-cloud record npx nx format:check
2120
npx nx-cloud record yarn documentation:check --verbose
22-
yarn nx affected --target build --exclude='*,!demo/**/*'
2321
parallel-commands-on-agents: |
24-
yarn nx affected --target lint build test --exclude='demo/**/*'
22+
yarn nx affected --target lint build test
2523
final-commands: |
2624
yarn e2e
2725

.github/workflows/pr.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818
with:
1919
main-branch-name: 'master'
2020
parallel-commands: |
21-
npx nx-cloud record yarn nx workspace-lint
2221
npx nx-cloud record yarn nx format:check
2322
npx nx-cloud record yarn documentation:check --verbose
2423
npx nx-cloud record yarn commitlint --from ${{ github.event.pull_request.base.sha }} --to HEAD --verbose
25-
yarn nx affected --target build --exclude='*,!demo/**/*'
2624
parallel-commands-on-agents: |
27-
yarn nx affected --target lint build test --exclude 'demo/**/*'
25+
yarn nx affected --target lint build test
2826
final-commands: |
2927
yarn e2e
3028

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ Thumbs.db
4646
**/bin
4747
**/obj
4848

49-
.vs
49+
.vs
50+
.nx/cache

.nx-dotnet.rc.json

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

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/dist
44
/coverage
55
.docusaurus/
6-
.yarn/
6+
.yarn/
7+
/.nx/cache

demo/apps/web-frontend/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"defaultConfiguration": "development"
6767
},
6868
"lint": {
69-
"executor": "@nx/linter:eslint",
69+
"executor": "@nx/eslint:lint",
7070
"outputs": ["{options.outputFile}"],
7171
"options": {
7272
"lintFilePatterns": ["demo/apps/web-frontend/**/*.{ts,tsx,js,jsx}"]
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@nx-dotnet/demo-libs-generated-webapi-types",
3-
"version": "0.0.1",
4-
"type": "commonjs"
3+
"version": "1.24.0-beta.1",
4+
"type": "commonjs",
5+
"private": true
56
}

demo/libs/generated/webapi-types/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
},
1616
"lint": {
17-
"executor": "@nx/linter:eslint",
17+
"executor": "@nx/eslint:lint",
1818
"outputs": ["{options.outputFile}"],
1919
"options": {
2020
"lintFilePatterns": ["demo/libs/generated/webapi-types/**/*.ts"]

e2e/core-e2e/tests/nx-dotnet.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { unlinkSync, writeFileSync } from 'fs';
2222
import { ensureDirSync } from 'fs-extra';
2323
import { join } from 'path';
2424
import { XmlDocument } from 'xmldoc';
25+
import * as logger from 'console';
2526

2627
import { readDependenciesFromNxDepGraph } from '@nx-dotnet/utils/e2e';
2728

@@ -516,7 +517,9 @@ function runNxCommandAsync(
516517
}
517518

518519
function setupWorkspace() {
520+
logger.log('Creating a sandbox project in ', e2eDir);
519521
ensureNxProject('@nx-dotnet/core', 'dist/packages/core');
522+
logger.log('✅');
520523
// TODO: Update e2e tests and plugin generators to use the new workspace layout semantics.
521524
updateFile('nx.json', (contents) => {
522525
const nxJson: NxJsonConfiguration = JSON.parse(contents);
@@ -525,5 +528,7 @@ function setupWorkspace() {
525528
nxJson.workspaceLayout.libsDir = 'libs';
526529
return JSON.stringify(nxJson, null, 2);
527530
});
531+
logger.log('Initializing git repo');
528532
initializeGitRepo(e2eDir);
533+
logger.log('✅');
529534
}

nx.json

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
11
{
22
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3-
"npmScope": "nx-dotnet",
43
"affected": {
54
"defaultBase": "master"
65
},
7-
"tasksRunnerOptions": {
8-
"default": {
9-
"runner": "nx-cloud",
10-
"options": {
11-
"cacheableOperations": [
12-
"build",
13-
"lint",
14-
"test",
15-
"e2e",
16-
"prebuild",
17-
"swagger",
18-
"codegen",
19-
"build:test"
20-
],
21-
"accessToken": "ZTMwZjcyY2ItZWRjYS00NzZjLTg3ZmQtYzdjM2Y3OGIzNDdhfHJlYWQtd3JpdGU=",
22-
"canTrackAnalytics": false,
23-
"showUsageWarnings": true,
24-
"parallel": 3,
25-
"useLightClient": true
26-
}
27-
}
28-
},
296
"workspaceLayout": {
307
"appsDir": "",
318
"libsDir": ""
329
},
33-
"plugins": ["@nx-dotnet/core"],
10+
"plugins": [
11+
{
12+
"plugin": "@nx-dotnet/core",
13+
"options": {
14+
"nugetPackages": {
15+
"Swashbuckle.AspNetCore": "6.5.0"
16+
},
17+
"inferProjects": false
18+
}
19+
}
20+
],
3421
"generators": {
3522
"@nx-dotnet/nxdoc:generate-docs": {
3623
"outputDirectory": "docs",
@@ -40,7 +27,8 @@
4027
"targetDefaults": {
4128
"build": {
4229
"dependsOn": ["^build", "prebuild", "^prebuild", "^codegen", "codegen"],
43-
"inputs": ["production", "^production"]
30+
"inputs": ["production", "^production"],
31+
"cache": true
4432
},
4533
"@nx-dotnet/core:build": {
4634
"dependsOn": ["^build", "prebuild", "^prebuild", "^codegen", "codegen"],
@@ -52,19 +40,43 @@
5240
]
5341
},
5442
"codegen": {
55-
"dependsOn": ["^swagger", "swagger"]
43+
"dependsOn": ["^swagger", "swagger"],
44+
"cache": true
5645
},
5746
"swagger": {
58-
"dependsOn": ["build"]
47+
"dependsOn": ["build"],
48+
"cache": true
5949
},
6050
"test": {
61-
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
51+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
52+
"cache": true
6253
},
6354
"smoke": {
64-
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
55+
"inputs": [
56+
"default",
57+
"^production",
58+
"{workspaceRoot}/jest.preset.js",
59+
{
60+
"runtime": "npm show nx@latest version"
61+
},
62+
{
63+
"runtime": "npm show @nx-dotnet/core@latest version"
64+
}
65+
],
66+
"cache": true
6567
},
6668
"lint": {
67-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
69+
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
70+
"cache": true
71+
},
72+
"e2e": {
73+
"cache": true
74+
},
75+
"prebuild": {
76+
"cache": true
77+
},
78+
"build:test": {
79+
"cache": true
6880
}
6981
},
7082
"namedInputs": {
@@ -84,5 +96,7 @@
8496
"!{projectRoot}/src/test-setup.[jt]s"
8597
],
8698
"projectSpecificFiles": []
87-
}
99+
},
100+
"nxCloudAccessToken": "ZTMwZjcyY2ItZWRjYS00NzZjLTg3ZmQtYzdjM2Y3OGIzNDdhfHJlYWQtd3JpdGU=",
101+
"parallel": 3
88102
}

0 commit comments

Comments
 (0)