Skip to content

Commit d38ea54

Browse files
feat: migrate to Nx 17 (#189)
* feat: migrate to Nx 17 Migrate workspace to Nx 17, and migrate nx-python to use NxPluginV2 API BREAKING CHANGE: The entire workspace needs to be migrated to Nx 17. re #188
1 parent 9b87665 commit d38ea54

File tree

32 files changed

+5394
-5889
lines changed

32 files changed

+5394
-5889
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- uses: nrwl/nx-set-shas@v3
2424
- run: npm ci
2525

26-
- run: npx nx workspace-lint
2726
- run: npx nx format:check
2827
- run: npx nx affected --target=lint --parallel=3
2928
- run: npx nx affected --target=test --parallel=3 --ci --code-coverage --silent

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ Thumbs.db
4040

4141
# Reports
4242
reports/
43+
44+
.nx/cache

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22

33
/dist
44
/coverage
5+
6+
/.nx/cache

e2e/data-migration-e2e/project.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88
"executor": "@nx/jest:jest",
99
"options": {
1010
"jestConfig": "e2e/data-migration-e2e/jest.config.ts",
11-
"runInBand": true
11+
"runInBand": true,
12+
"passWithNoTests": false
1213
},
1314
"dependsOn": ["data-migration:build"]
1415
},
1516
"lint": {
16-
"executor": "@nx/linter:eslint",
17-
"outputs": ["{options.outputFile}"],
18-
"options": {
19-
"lintFilePatterns": ["e2e/data-migration-e2e/**/*.ts"]
20-
}
17+
"executor": "@nx/eslint:lint",
18+
"outputs": ["{options.outputFile}"]
2119
}
2220
},
2321
"tags": [],

e2e/nx-python-e2e/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"executor": "@nx/jest:jest",
99
"options": {
1010
"jestConfig": "e2e/nx-python-e2e/jest.config.ts",
11-
"runInBand": true
11+
"runInBand": true,
12+
"passWithNoTests": false
1213
},
1314
"dependsOn": ["nx-python:build"]
1415
}

e2e/nx-python-e2e/tests/__snapshots__/nx-python.spec.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ readme = "README.md"
1616
python = ">=3.9,<3.11"
1717
1818
[tool.poetry.dependencies.app1]
19-
path = "apps/app1"
19+
path = "app1"
2020
develop = true
2121
2222
[tool.poetry.dependencies.lib1]
23-
path = "libs/lib1"
23+
path = "lib1"
2424
develop = true
2525
2626
[tool.poetry.dependencies.lib2]
27-
path = "libs/lib2"
27+
path = "lib2"
2828
develop = true
2929
3030
[tool.poetry.group.dev.dependencies]
@@ -57,15 +57,15 @@ readme = "README.md"
5757
python = ">=3.9,<3.11"
5858
5959
[tool.poetry.dependencies.app1]
60-
path = "apps/app1"
60+
path = "app1"
6161
develop = true
6262
6363
[tool.poetry.dependencies.lib1]
64-
path = "libs/lib1"
64+
path = "lib1"
6565
develop = true
6666
6767
[tool.poetry.dependencies.lib2]
68-
path = "libs/lib2"
68+
path = "lib2"
6969
develop = true
7070
7171
[tool.poetry.group.dev.dependencies]

e2e/nx-python-e2e/tests/nx-python.spec.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ describe('nx-python e2e', () => {
3535

3636
expect(() =>
3737
checkFilesExist(
38-
`apps/${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
39-
`apps/${app1}/dist/${app1}-1.0.0.tar.gz`
38+
`${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
39+
`${app1}/dist/${app1}-1.0.0.tar.gz`
4040
)
4141
).not.toThrow();
4242
}, 3000000);
@@ -69,8 +69,8 @@ describe('nx-python e2e', () => {
6969

7070
expect(() =>
7171
checkFilesExist(
72-
`apps/${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
73-
`apps/${app1}/dist/${app1}-1.0.0.tar.gz`
72+
`${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
73+
`${app1}/dist/${app1}-1.0.0.tar.gz`
7474
)
7575
).not.toThrow();
7676
}, 3000000);
@@ -100,8 +100,6 @@ describe('nx-python e2e', () => {
100100
'src/app1',
101101
'--linter',
102102
'ruff',
103-
'--projectNameAndRootFormat',
104-
'as-provided',
105103
].join(' ')
106104
);
107105

@@ -120,8 +118,6 @@ describe('nx-python e2e', () => {
120118
'src/lib1',
121119
'--linter',
122120
'ruff',
123-
'--projectNameAndRootFormat',
124-
'as-provided',
125121
].join(' ')
126122
);
127123

@@ -175,8 +171,8 @@ describe('nx-python e2e', () => {
175171

176172
expect(() =>
177173
checkFilesExist(
178-
`apps/${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
179-
`apps/${app1}/dist/${app1}-1.0.0.tar.gz`
174+
`${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
175+
`${app1}/dist/${app1}-1.0.0.tar.gz`
180176
)
181177
).not.toThrow();
182178
}, 3000000);
@@ -218,8 +214,8 @@ describe('nx-python e2e', () => {
218214

219215
expect(() =>
220216
checkFilesExist(
221-
`apps/${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
222-
`apps/${app1}/dist/${app1}-1.0.0.tar.gz`
217+
`${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
218+
`${app1}/dist/${app1}-1.0.0.tar.gz`
223219
)
224220
).not.toThrow();
225221

@@ -264,8 +260,8 @@ describe('nx-python e2e', () => {
264260

265261
expect(() =>
266262
checkFilesExist(
267-
`apps/${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
268-
`apps/${app1}/dist/${app1}-1.0.0.tar.gz`
263+
`${app1}/dist/${app1.replace('-', '_')}-1.0.0-py3-none-any.whl`,
264+
`${app1}/dist/${app1}-1.0.0.tar.gz`
269265
)
270266
).not.toThrow();
271267

nx.json

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
{
22
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3-
"tasksRunnerOptions": {
4-
"default": {
5-
"runner": "nx/tasks-runners/default",
6-
"options": {
7-
"cacheableOperations": ["build", "lint", "test", "e2e"]
8-
}
9-
}
10-
},
113
"targetDefaults": {
124
"build": {
135
"dependsOn": ["^build"],
14-
"inputs": ["production", "^production"]
6+
"inputs": ["production", "^production"],
7+
"cache": true
158
},
169
"lint": {
17-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
10+
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
11+
"cache": true
1812
},
19-
"test": {
20-
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"]
13+
"@nx/jest:jest": {
14+
"cache": true,
15+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
16+
"options": {
17+
"passWithNoTests": true
18+
},
19+
"configurations": {
20+
"ci": {
21+
"ci": true,
22+
"codeCoverage": true
23+
}
24+
}
2125
}
2226
},
2327
"workspaceLayout": {
@@ -27,6 +31,6 @@
2731
"namedInputs": {
2832
"default": ["{projectRoot}/**/*", "sharedGlobals"],
2933
"sharedGlobals": ["{workspaceRoot}/release.base.config.js"],
30-
"production": ["default"]
34+
"production": ["default", "!{projectRoot}/src/test-setup.[jt]s"]
3135
}
3236
}

0 commit comments

Comments
 (0)