Skip to content

Commit 9723aab

Browse files
authored
chore: migrate to nx 17.3.2 (#40)
* chore: migrate to nx 17-3-2 * chore: run nx migrations * fix: normalize tsconfig.lib.json exclude patterns * fix: add missing packages ts path mappings * chore: update @nx/js patches * change files
1 parent ca2ba06 commit 9723aab

19 files changed

+1391
-842
lines changed

.yarn/patches/@nx-js-npm-17.0.0-2dff13d39a.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
diff --git a/src/executors/tsc/tsc.impl.js b/src/executors/tsc/tsc.impl.js
2+
index ebaf0575224dda78fcedaf4be33f6bb9fe98c33d..b7e654761c1af75e534f322a9f1ad1414ad5fef8 100644
3+
--- a/src/executors/tsc/tsc.impl.js
4+
+++ b/src/executors/tsc/tsc.impl.js
5+
@@ -17,7 +17,11 @@ function determineModuleFormatFromTsConfig(absolutePathToTsConfig) {
6+
if (tsConfig.options.module === ts.ModuleKind.ES2015 ||
7+
tsConfig.options.module === ts.ModuleKind.ES2020 ||
8+
tsConfig.options.module === ts.ModuleKind.ES2022 ||
9+
- tsConfig.options.module === ts.ModuleKind.ESNext) {
10+
+ tsConfig.options.module === ts.ModuleKind.ESNext ||
11+
+
12+
+ // in order to make tsc executor resolve to ESM, we need to force it against node16/nodenext - in reality this is dangeours operation as node16/nodenext provides no guarantees if shipped code is commonjs or esm
13+
+ tsConfig.options.module === ts.ModuleKind.Node16 ||
14+
+ tsConfig.options.module === ts.ModuleKind.NodeNext) {
15+
return 'esm';
16+
}
17+
else {
18+
diff --git a/src/utils/buildable-libs-utils.js b/src/utils/buildable-libs-utils.js
19+
index 79a0eba5b4df41e7996f1afed183c4f2df9b3cf9..f95d9b4587ad57774a9e430136f7d11d9b7bba1c 100644
20+
--- a/src/utils/buildable-libs-utils.js
21+
+++ b/src/utils/buildable-libs-utils.js
22+
@@ -246,7 +246,7 @@ function checkDependentProjectsHaveBeenBuilt(root, projectName, targetName, proj
23+
${missing.map((x) => ` - ${x.node.name}`).join('\n')}
24+
25+
You might be missing a "targetDefaults" configuration in your root nx.json (https://nx.dev/reference/project-configuration#target-defaults),
26+
- or "dependsOn" configured in ${projectName}'s project.json (https://nx.dev/reference/project-configuration#dependson)
27+
+ or "dependsOn" configured in ${projectName}'s project.json (https://nx.dev/reference/project-configuration#dependson)
28+
`);
29+
return false;
30+
}
31+
@@ -277,7 +277,13 @@ function updatePaths(dependencies, paths) {
32+
// If there are outputs
33+
if (dep.outputs && dep.outputs.length > 0) {
34+
// Directly map the dependency name to the output paths (dist/packages/..., etc.)
35+
- paths[dep.name] = dep.outputs;
36+
+ // paths[dep.name] = dep.outputs;
37+
+
38+
+ // Force Nx to resolve to .mts
39+
+ // - if node16/nodeNext is enabled, TS won't follow standard algorithm (if path alias points to directory - nx case) to resolve package.json#types
40+
+ // - thus we need to explicitly point path alias to .d.mts
41+
+ paths[dep.name] = dep.outputs.map(out => out + '/src/index.d.mts');
42+
+
43+
// check for secondary entrypoints
44+
// For each registered path
45+
for (const path of pathsKeys) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "fix: normalize tsconfig.lib.json exclude patterns",
4+
"packageName": "monosize",
5+
"email": "hochelmartin@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "fix: normalize tsconfig.lib.json exclude patterns",
4+
"packageName": "monosize-storage-azure",
5+
"email": "hochelmartin@gmail.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "fix: normalize tsconfig.lib.json exclude patterns",
4+
"packageName": "monosize-storage-upstash",
5+
"email": "hochelmartin@gmail.com",
6+
"dependentChangeType": "none"
7+
}

migrations.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"migrations": [
3+
{
4+
"cli": "nx",
5+
"version": "17.3.0-beta.6",
6+
"description": "Updates the nx wrapper.",
7+
"implementation": "./src/migrations/update-17-3-0/update-nxw",
8+
"package": "nx",
9+
"name": "17.3.0-update-nx-wrapper"
10+
},
11+
{
12+
"version": "17.1.0-beta.1",
13+
"description": "Updates for @typescript-utils/utils v6.9.1+",
14+
"implementation": "./src/migrations/update-17-1-0/update-typescript-eslint",
15+
"package": "@nx/eslint",
16+
"name": "update-typescript-eslint"
17+
},
18+
{
19+
"version": "17.2.0-beta.0",
20+
"description": "Simplify eslintFilePatterns",
21+
"implementation": "./src/migrations/update-17-2-0/simplify-eslint-patterns",
22+
"package": "@nx/eslint",
23+
"name": "simplify-eslint-patterns"
24+
},
25+
{
26+
"version": "17.2.9",
27+
"description": "Move executor options to target defaults",
28+
"implementation": "./src/migrations/update-17-2-9/move-options-to-target-defaults",
29+
"package": "@nx/eslint",
30+
"name": "move-options-to-target-defaults"
31+
},
32+
{
33+
"cli": "nx",
34+
"version": "17.0.2",
35+
"description": "Remove deprecated build options",
36+
"implementation": "./src/migrations/update-17-0-0/remove-deprecated-build-options",
37+
"package": "@nx/js",
38+
"name": "update-17-0-0-remove-deprecated-build-options"
39+
},
40+
{
41+
"version": "17.1.0-beta.2",
42+
"description": "Move target defaults",
43+
"implementation": "./src/migrations/update-17-1-0/move-target-defaults",
44+
"package": "@nx/vite",
45+
"name": "move-target-defaults"
46+
},
47+
{
48+
"version": "17.2.0-beta.10",
49+
"description": "Update vite config.",
50+
"implementation": "./src/migrations/update-17-2-0/update-vite-config",
51+
"package": "@nx/vite",
52+
"name": "update-vite-config"
53+
},
54+
{
55+
"version": "17.3.0-beta.0",
56+
"description": "Move the vitest coverage thresholds in their own object if exists and add reporters.",
57+
"implementation": "./src/migrations/update-17-3-0/vitest-coverage-and-reporters",
58+
"package": "@nx/vite",
59+
"name": "vitest-coverage-and-reporters"
60+
}
61+
]
62+
}

nx.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
"build": {
44
"cache": true
55
},
6-
"lint": {
6+
"@nx/eslint:lint": {
77
"cache": true,
88
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
99
},
10-
"test": {
10+
"@nx/vite:test": {
1111
"cache": true,
1212
"inputs": ["default", "^default"]
13-
},
14-
"e2e": {
15-
"cache": true
1613
}
1714
},
1815
"extends": "@nx/workspace/presets/core.json",

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,38 @@
2222
},
2323
"packageManager": "yarn@3.2.0",
2424
"devDependencies": {
25-
"@nx/eslint": "17.0.0",
26-
"@nx/eslint-plugin": "17.0.0",
27-
"@nx/js": "17.0.0",
28-
"@nx/vite": "17.0.0",
29-
"@nx/workspace": "17.0.0",
25+
"@nx/eslint": "17.3.2",
26+
"@nx/eslint-plugin": "17.3.2",
27+
"@nx/js": "17.3.2",
28+
"@nx/vite": "17.3.2",
29+
"@nx/workspace": "17.3.2",
3030
"@swc-node/register": "~1.6.7",
3131
"@swc/core": "~1.3.85",
3232
"@types/babel__core": "7.20.5",
3333
"@types/glob": "8.0.0",
34-
"@types/node": "16.18.3",
34+
"@types/node": "18.19.24",
3535
"@types/prettier": "^2.7.3",
3636
"@types/tmp": "0.2.3",
3737
"@types/yargs": "17.0.32",
3838
"@typescript-eslint/eslint-plugin": "5.62.0",
3939
"@typescript-eslint/parser": "5.62.0",
40-
"@vitest/coverage-v8": "~0.32.0",
41-
"@vitest/ui": "~0.32.0",
40+
"@vitest/coverage-v8": "0.34.6",
41+
"@vitest/ui": "0.34.7",
4242
"beachball": "2.31.5",
43-
"eslint": "8.46.0",
43+
"eslint": "8.48.0",
4444
"eslint-config-prettier": "9.0.0",
4545
"eslint-import-resolver-typescript": "3.6.1",
4646
"eslint-plugin-import": "2.28.1",
4747
"eslint-plugin-unicorn": "48.0.1",
4848
"nano-staged": "0.8.0",
49-
"nx": "17.0.0",
49+
"nx": "17.3.2",
5050
"prettier": "2.8.8",
5151
"simple-git-hooks": "2.9.0",
5252
"syncpack": "11.2.1",
5353
"ts-node": "10.9.1",
54-
"typescript": "5.1.6",
55-
"vite": "~4.5.2",
56-
"vitest": "~0.32.0"
54+
"typescript": "5.3.3",
55+
"vite": "5.1.6",
56+
"vitest": "0.34.6"
5757
},
5858
"dependencies": {
5959
"@azure/data-tables": "^13.0.0",
@@ -78,6 +78,6 @@
7878
},
7979
"resolutions": {
8080
"beachball@2.31.5": "patch:beachball@npm:2.31.5#.yarn/patches/beachball-npm-2.31.5-0e84ec4233.patch",
81-
"@nx/js@17.0.0": "patch:@nx/js@npm:17.0.0#.yarn/patches/@nx-js-npm-17.0.0-2dff13d39a.patch"
81+
"@nx/js@17.3.2": "patch:@nx/js@npm:17.3.2#.yarn/patches/@nx-js-npm-17.3.2-1594e3f16f.patch"
8282
}
8383
}

packages/monosize-storage-azure/project.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
},
2525
"lint": {
2626
"executor": "@nx/eslint:lint",
27-
"outputs": ["{options.outputFile}"],
28-
"options": {
29-
"lintFilePatterns": ["packages/monosize-storage-azure/**/*.mts"]
30-
}
27+
"outputs": ["{options.outputFile}"]
3128
},
3229
"test": {
3330
"executor": "@nx/vite:test",

packages/monosize-storage-azure/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"types": ["environment", "node"]
77
},
88
"include": ["**/*.mts"],
9-
"exclude": ["**/*.test.mts", "vite.config.mts"]
9+
"exclude": ["**/*.test.mts", "vite.config.mts", "**/__fixture__/", "**/__mocks__/"]
1010
}

0 commit comments

Comments
 (0)