@nx/angular 21.0.0-beta.0 → 21.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators.json +5 -0
- package/migrations.json +175 -0
- package/ng-package.json +1 -1
- package/package.json +11 -9
- package/src/builders/dev-server/dev-server.impl.js +2 -3
- package/src/builders/dev-server/lib/normalize-options.js +1 -0
- package/src/builders/dev-server/schema.d.ts +1 -0
- package/src/builders/dev-server/schema.json +8 -3
- package/src/builders/webpack-browser/schema.d.ts +3 -1
- package/src/builders/webpack-browser/schema.json +5 -0
- package/src/builders/webpack-browser/webpack-browser.impl.js +3 -2
- package/src/executors/delegate-build/delegate-build.impl.d.ts +1 -3
- package/src/executors/delegate-build/delegate-build.impl.js +0 -3
- package/src/executors/package/package.impl.js +1 -4
- package/src/generators/add-linting/add-linting.js +1 -16
- package/src/generators/add-linting/schema.d.ts +1 -0
- package/src/generators/application/application.js +14 -1
- package/src/generators/application/lib/add-e2e.js +2 -2
- package/src/generators/application/lib/add-linting.js +1 -0
- package/src/generators/application/lib/add-unit-test-runner.js +2 -0
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +9 -2
- package/src/generators/application/schema.d.ts +2 -1
- package/src/generators/application/schema.json +1 -1
- package/src/generators/component-test/component-test.js +1 -1
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts +4 -0
- package/src/generators/convert-to-rspack/convert-to-rspack.js +319 -0
- package/src/generators/convert-to-rspack/lib/create-config.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/create-config.js +48 -0
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +6 -0
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +75 -0
- package/src/generators/convert-to-rspack/lib/update-tsconfig.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/update-tsconfig.js +26 -0
- package/src/generators/convert-to-rspack/lib/validate-supported-executor.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/validate-supported-executor.js +14 -0
- package/src/generators/convert-to-rspack/schema.d.ts +5 -0
- package/src/generators/convert-to-rspack/schema.json +30 -0
- package/src/generators/host/host.js +1 -1
- package/src/generators/library/lib/add-project.d.ts +1 -1
- package/src/generators/library/lib/add-project.js +7 -1
- package/src/generators/library/lib/normalize-options.js +1 -1
- package/src/generators/library/library.js +5 -1
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +2 -2
- package/src/generators/ngrx-feature-store/schema.d.ts +1 -1
- package/src/generators/remote/remote.js +1 -1
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/__rootModuleFileName__ +2 -2
- package/src/generators/setup-ssr/files/v19+/application-builder/server/__serverFileName__ +1 -1
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +2 -2
- package/src/generators/setup-ssr/files/v19+/application-builder-common-engine/server/__serverFileName__ +2 -0
- package/src/generators/setup-ssr/lib/generate-files.js +12 -1
- package/src/generators/stories/stories.js +2 -2
- package/src/generators/utils/add-jest.d.ts +1 -0
- package/src/generators/utils/add-jest.js +2 -2
- package/src/generators/utils/add-vitest.d.ts +1 -0
- package/src/generators/utils/add-vitest.js +1 -1
- package/src/generators/utils/ensure-angular-dependencies.js +0 -1
- package/src/migrations/update-19-6-0/turn-off-dts-by-default.js +2 -2
- package/src/migrations/update-20-5-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-20-5-0/update-angular-cli.js +23 -0
- package/src/utils/backward-compatible-versions.js +2 -0
- package/src/utils/versions.d.ts +7 -6
- package/src/utils/versions.js +8 -7
package/generators.json
CHANGED
@@ -38,6 +38,11 @@
|
|
38
38
|
"schema": "./src/generators/convert-to-application-executor/schema.json",
|
39
39
|
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder."
|
40
40
|
},
|
41
|
+
"convert-to-rspack": {
|
42
|
+
"factory": "./src/generators/convert-to-rspack/convert-to-rspack",
|
43
|
+
"schema": "./src/generators/convert-to-rspack/schema.json",
|
44
|
+
"description": "Converts Angular Webpack projects to use Rspack."
|
45
|
+
},
|
41
46
|
"directive": {
|
42
47
|
"factory": "./src/generators/directive/directive",
|
43
48
|
"schema": "./src/generators/directive/schema.json",
|
package/migrations.json
CHANGED
@@ -347,6 +347,15 @@
|
|
347
347
|
},
|
348
348
|
"description": "Update the @angular/cli package version to ~19.1.0.",
|
349
349
|
"factory": "./src/migrations/update-20-4-0/update-angular-cli"
|
350
|
+
},
|
351
|
+
"update-angular-cli-version-19-2-0": {
|
352
|
+
"cli": "nx",
|
353
|
+
"version": "20.5.0-beta.5",
|
354
|
+
"requires": {
|
355
|
+
"@angular/core": ">=19.2.0"
|
356
|
+
},
|
357
|
+
"description": "Update the @angular/cli package version to ~19.2.0.",
|
358
|
+
"factory": "./src/migrations/update-20-5-0/update-angular-cli"
|
350
359
|
}
|
351
360
|
},
|
352
361
|
"packageJsonUpdates": {
|
@@ -1049,6 +1058,22 @@
|
|
1049
1058
|
"@angular-eslint/utils": {
|
1050
1059
|
"version": "^18.0.1",
|
1051
1060
|
"alwaysAddToPackageJson": false
|
1061
|
+
},
|
1062
|
+
"@angular-eslint/schematics": {
|
1063
|
+
"version": "^18.0.1",
|
1064
|
+
"alwaysAddToPackageJson": false
|
1065
|
+
},
|
1066
|
+
"@angular-eslint/test-utils": {
|
1067
|
+
"version": "^18.0.1",
|
1068
|
+
"alwaysAddToPackageJson": false
|
1069
|
+
},
|
1070
|
+
"@angular-eslint/builder": {
|
1071
|
+
"version": "^18.0.1",
|
1072
|
+
"alwaysAddToPackageJson": false
|
1073
|
+
},
|
1074
|
+
"@angular-eslint/bundled-angular-compiler": {
|
1075
|
+
"version": "^18.0.1",
|
1076
|
+
"alwaysAddToPackageJson": false
|
1052
1077
|
}
|
1053
1078
|
}
|
1054
1079
|
},
|
@@ -1316,6 +1341,10 @@
|
|
1316
1341
|
"version": "~19.0.0",
|
1317
1342
|
"alwaysAddToPackageJson": false
|
1318
1343
|
},
|
1344
|
+
"@angular/google-maps": {
|
1345
|
+
"version": "~19.0.0",
|
1346
|
+
"alwaysAddToPackageJson": false
|
1347
|
+
},
|
1319
1348
|
"ng-packagr": {
|
1320
1349
|
"version": "~19.0.0",
|
1321
1350
|
"alwaysAddToPackageJson": false
|
@@ -1368,6 +1397,22 @@
|
|
1368
1397
|
"@angular-eslint/utils": {
|
1369
1398
|
"version": "^19.0.0",
|
1370
1399
|
"alwaysAddToPackageJson": false
|
1400
|
+
},
|
1401
|
+
"@angular-eslint/schematics": {
|
1402
|
+
"version": "^19.0.0",
|
1403
|
+
"alwaysAddToPackageJson": false
|
1404
|
+
},
|
1405
|
+
"@angular-eslint/test-utils": {
|
1406
|
+
"version": "^19.0.0",
|
1407
|
+
"alwaysAddToPackageJson": false
|
1408
|
+
},
|
1409
|
+
"@angular-eslint/builder": {
|
1410
|
+
"version": "^19.0.0",
|
1411
|
+
"alwaysAddToPackageJson": false
|
1412
|
+
},
|
1413
|
+
"@angular-eslint/bundled-angular-compiler": {
|
1414
|
+
"version": "^19.0.0",
|
1415
|
+
"alwaysAddToPackageJson": false
|
1371
1416
|
}
|
1372
1417
|
}
|
1373
1418
|
},
|
@@ -1410,6 +1455,22 @@
|
|
1410
1455
|
"@angular-eslint/utils": {
|
1411
1456
|
"version": "^19.0.2",
|
1412
1457
|
"alwaysAddToPackageJson": false
|
1458
|
+
},
|
1459
|
+
"@angular-eslint/schematics": {
|
1460
|
+
"version": "^19.0.2",
|
1461
|
+
"alwaysAddToPackageJson": false
|
1462
|
+
},
|
1463
|
+
"@angular-eslint/test-utils": {
|
1464
|
+
"version": "^19.0.2",
|
1465
|
+
"alwaysAddToPackageJson": false
|
1466
|
+
},
|
1467
|
+
"@angular-eslint/builder": {
|
1468
|
+
"version": "^19.0.2",
|
1469
|
+
"alwaysAddToPackageJson": false
|
1470
|
+
},
|
1471
|
+
"@angular-eslint/bundled-angular-compiler": {
|
1472
|
+
"version": "^19.0.2",
|
1473
|
+
"alwaysAddToPackageJson": false
|
1413
1474
|
}
|
1414
1475
|
}
|
1415
1476
|
},
|
@@ -1480,11 +1541,125 @@
|
|
1480
1541
|
"version": "~19.1.0",
|
1481
1542
|
"alwaysAddToPackageJson": false
|
1482
1543
|
},
|
1544
|
+
"@angular/google-maps": {
|
1545
|
+
"version": "~19.1.0",
|
1546
|
+
"alwaysAddToPackageJson": false
|
1547
|
+
},
|
1483
1548
|
"ng-packagr": {
|
1484
1549
|
"version": "~19.1.0",
|
1485
1550
|
"alwaysAddToPackageJson": false
|
1486
1551
|
}
|
1487
1552
|
}
|
1553
|
+
},
|
1554
|
+
"20.5.0": {
|
1555
|
+
"version": "20.5.0-beta.5",
|
1556
|
+
"x-prompt": "Do you want to update the Angular version to v19.2?",
|
1557
|
+
"requires": {
|
1558
|
+
"@angular/core": ">=19.1.0 <19.2.0"
|
1559
|
+
},
|
1560
|
+
"packages": {
|
1561
|
+
"@angular-devkit/build-angular": {
|
1562
|
+
"version": "~19.2.0",
|
1563
|
+
"alwaysAddToPackageJson": false
|
1564
|
+
},
|
1565
|
+
"@angular-devkit/core": {
|
1566
|
+
"version": "~19.2.0",
|
1567
|
+
"alwaysAddToPackageJson": false
|
1568
|
+
},
|
1569
|
+
"@angular-devkit/schematics": {
|
1570
|
+
"version": "~19.2.0",
|
1571
|
+
"alwaysAddToPackageJson": false
|
1572
|
+
},
|
1573
|
+
"@angular/build": {
|
1574
|
+
"version": "~19.2.0",
|
1575
|
+
"alwaysAddToPackageJson": false
|
1576
|
+
},
|
1577
|
+
"@angular/pwa": {
|
1578
|
+
"version": "~19.2.0",
|
1579
|
+
"alwaysAddToPackageJson": false
|
1580
|
+
},
|
1581
|
+
"@angular/ssr": {
|
1582
|
+
"version": "~19.2.0",
|
1583
|
+
"alwaysAddToPackageJson": false
|
1584
|
+
},
|
1585
|
+
"@schematics/angular": {
|
1586
|
+
"version": "~19.2.0",
|
1587
|
+
"alwaysAddToPackageJson": false
|
1588
|
+
},
|
1589
|
+
"@angular-devkit/architect": {
|
1590
|
+
"version": "~0.1902.0",
|
1591
|
+
"alwaysAddToPackageJson": false
|
1592
|
+
},
|
1593
|
+
"@angular-devkit/build-webpack": {
|
1594
|
+
"version": "~0.1902.0",
|
1595
|
+
"alwaysAddToPackageJson": false
|
1596
|
+
},
|
1597
|
+
"@angular/core": {
|
1598
|
+
"version": "~19.2.0",
|
1599
|
+
"alwaysAddToPackageJson": true
|
1600
|
+
},
|
1601
|
+
"@angular/material": {
|
1602
|
+
"version": "~19.2.1",
|
1603
|
+
"alwaysAddToPackageJson": false
|
1604
|
+
},
|
1605
|
+
"@angular/cdk": {
|
1606
|
+
"version": "~19.2.1",
|
1607
|
+
"alwaysAddToPackageJson": false
|
1608
|
+
},
|
1609
|
+
"@angular/google-maps": {
|
1610
|
+
"version": "~19.2.1",
|
1611
|
+
"alwaysAddToPackageJson": false
|
1612
|
+
},
|
1613
|
+
"ng-packagr": {
|
1614
|
+
"version": "~19.2.0",
|
1615
|
+
"alwaysAddToPackageJson": false
|
1616
|
+
}
|
1617
|
+
}
|
1618
|
+
},
|
1619
|
+
"20.5.0-angular-eslint": {
|
1620
|
+
"version": "20.5.0-rc.1",
|
1621
|
+
"requires": {
|
1622
|
+
"eslint": "^8.57.0 || ^9.0.0",
|
1623
|
+
"@angular/core": ">= 19.0.0 < 20.0.0"
|
1624
|
+
},
|
1625
|
+
"packages": {
|
1626
|
+
"angular-eslint": {
|
1627
|
+
"version": "^19.2.0",
|
1628
|
+
"alwaysAddToPackageJson": false
|
1629
|
+
},
|
1630
|
+
"@angular-eslint/eslint-plugin": {
|
1631
|
+
"version": "^19.2.0",
|
1632
|
+
"alwaysAddToPackageJson": false
|
1633
|
+
},
|
1634
|
+
"@angular-eslint/eslint-plugin-template": {
|
1635
|
+
"version": "^19.2.0",
|
1636
|
+
"alwaysAddToPackageJson": false
|
1637
|
+
},
|
1638
|
+
"@angular-eslint/template-parser": {
|
1639
|
+
"version": "^19.2.0",
|
1640
|
+
"alwaysAddToPackageJson": false
|
1641
|
+
},
|
1642
|
+
"@angular-eslint/utils": {
|
1643
|
+
"version": "^19.2.0",
|
1644
|
+
"alwaysAddToPackageJson": false
|
1645
|
+
},
|
1646
|
+
"@angular-eslint/schematics": {
|
1647
|
+
"version": "^19.2.0",
|
1648
|
+
"alwaysAddToPackageJson": false
|
1649
|
+
},
|
1650
|
+
"@angular-eslint/test-utils": {
|
1651
|
+
"version": "^19.2.0",
|
1652
|
+
"alwaysAddToPackageJson": false
|
1653
|
+
},
|
1654
|
+
"@angular-eslint/builder": {
|
1655
|
+
"version": "^19.2.0",
|
1656
|
+
"alwaysAddToPackageJson": false
|
1657
|
+
},
|
1658
|
+
"@angular-eslint/bundled-angular-compiler": {
|
1659
|
+
"version": "^19.2.0",
|
1660
|
+
"alwaysAddToPackageJson": false
|
1661
|
+
}
|
1662
|
+
}
|
1488
1663
|
}
|
1489
1664
|
}
|
1490
1665
|
}
|
package/ng-package.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/angular",
|
3
|
-
"version": "21.0.0-beta.
|
3
|
+
"version": "21.0.0-beta.2",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
6
6
|
"repository": {
|
@@ -65,19 +65,21 @@
|
|
65
65
|
"dependencies": {
|
66
66
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
67
67
|
"@typescript-eslint/type-utils": "^8.0.0",
|
68
|
+
"enquirer": "~2.3.6",
|
68
69
|
"picocolors": "^1.1.0",
|
70
|
+
"picomatch": "4.0.2",
|
69
71
|
"magic-string": "~0.30.2",
|
70
|
-
"minimatch": "9.0.3",
|
71
72
|
"semver": "^7.5.3",
|
72
73
|
"tslib": "^2.3.0",
|
73
74
|
"webpack-merge": "^5.8.0",
|
74
|
-
"@nx/devkit": "21.0.0-beta.
|
75
|
-
"@nx/js": "21.0.0-beta.
|
76
|
-
"@nx/eslint": "21.0.0-beta.
|
77
|
-
"@nx/webpack": "21.0.0-beta.
|
78
|
-
"@nx/
|
79
|
-
"@nx/
|
80
|
-
"@nx/
|
75
|
+
"@nx/devkit": "21.0.0-beta.2",
|
76
|
+
"@nx/js": "21.0.0-beta.2",
|
77
|
+
"@nx/eslint": "21.0.0-beta.2",
|
78
|
+
"@nx/webpack": "21.0.0-beta.2",
|
79
|
+
"@nx/rspack": "21.0.0-beta.2",
|
80
|
+
"@nx/module-federation": "21.0.0-beta.2",
|
81
|
+
"@nx/web": "21.0.0-beta.2",
|
82
|
+
"@nx/workspace": "21.0.0-beta.2",
|
81
83
|
"piscina": "^4.4.0"
|
82
84
|
},
|
83
85
|
"peerDependencies": {
|
@@ -118,9 +118,7 @@ function executeDevServerBuilder(rawOptions, context) {
|
|
118
118
|
// run the target for all projects.
|
119
119
|
// This will occur when workspaceDependencies = []
|
120
120
|
if (workspaceDependencies.length > 0) {
|
121
|
-
baseWebpackConfig.plugins.push(
|
122
|
-
// @ts-expect-error - difference between angular and webpack plugin definitions bc of webpack versions
|
123
|
-
new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${parsedBuildTarget.target} --projects=${workspaceDependencies.join(',')}`));
|
121
|
+
baseWebpackConfig.plugins.push(new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${parsedBuildTarget.target} --projects=${workspaceDependencies.join(',')}`, { skipWatchingDeps: !options.watchDependencies }));
|
124
122
|
}
|
125
123
|
}
|
126
124
|
if (!pathToWebpackConfig) {
|
@@ -151,6 +149,7 @@ function getDelegateBuilderOptions(options) {
|
|
151
149
|
}
|
152
150
|
// delete extra option not supported by the delegate builder
|
153
151
|
delete delegateBuilderOptions.buildLibsFromSource;
|
152
|
+
delete delegateBuilderOptions.watchDependencies;
|
154
153
|
return delegateBuilderOptions;
|
155
154
|
}
|
156
155
|
async function loadIndexHtmlFileTransformer(pathToIndexFileTransformer, tsConfig, context, isUsingWebpackBuilder) {
|
@@ -78,11 +78,11 @@
|
|
78
78
|
},
|
79
79
|
"publicHost": {
|
80
80
|
"type": "string",
|
81
|
-
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
|
81
|
+
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies. This option has no effect when using the 'application' or other esbuild-based builders."
|
82
82
|
},
|
83
83
|
"allowedHosts": {
|
84
84
|
"type": "array",
|
85
|
-
"description": "List of hosts that are allowed to access the dev server.",
|
85
|
+
"description": "List of hosts that are allowed to access the dev server. This option has no effect when using the 'application' or other esbuild-based builders in Angular versions lower than 19.2.0.",
|
86
86
|
"default": [],
|
87
87
|
"items": {
|
88
88
|
"type": "string"
|
@@ -94,7 +94,7 @@
|
|
94
94
|
},
|
95
95
|
"disableHostCheck": {
|
96
96
|
"type": "boolean",
|
97
|
-
"description": "Don't verify connected clients are part of allowed hosts.",
|
97
|
+
"description": "Don't verify connected clients are part of allowed hosts. This option has no effect when using the 'application' or other esbuild-based builders in Angular versions lower than 19.2.0.",
|
98
98
|
"default": false
|
99
99
|
},
|
100
100
|
"hmr": {
|
@@ -156,6 +156,11 @@
|
|
156
156
|
"type": "string",
|
157
157
|
"description": "The path to the middleware function. Relative to the workspace root."
|
158
158
|
}
|
159
|
+
},
|
160
|
+
"watchDependencies": {
|
161
|
+
"type": "boolean",
|
162
|
+
"description": "Watch buildable dependencies and rebuild when they change.",
|
163
|
+
"default": true
|
159
164
|
}
|
160
165
|
},
|
161
166
|
"additionalProperties": false,
|
@@ -6,8 +6,10 @@ export type BrowserBuilderSchema = Schema & {
|
|
6
6
|
};
|
7
7
|
indexHtmlTransformer?: string;
|
8
8
|
buildLibsFromSource?: boolean;
|
9
|
+
watchDependencies?: boolean;
|
10
|
+
|
9
11
|
/**
|
10
|
-
* @deprecated Use `indexHtmlTransformer` instead. It will be removed in Nx
|
12
|
+
* @deprecated Use `indexHtmlTransformer` instead. It will be removed in Nx 21.
|
11
13
|
*/
|
12
14
|
indexFileTransformer?: string;
|
13
15
|
};
|
@@ -464,6 +464,11 @@
|
|
464
464
|
"type": "boolean",
|
465
465
|
"description": "Read buildable libraries from source instead of building them separately.",
|
466
466
|
"default": true
|
467
|
+
},
|
468
|
+
"watchDependencies": {
|
469
|
+
"type": "boolean",
|
470
|
+
"description": "Watch buildable dependencies and rebuild when they change.",
|
471
|
+
"default": true
|
467
472
|
}
|
468
473
|
},
|
469
474
|
"additionalProperties": false,
|
@@ -25,7 +25,8 @@ function shouldSkipInitialTargetRun(projectGraph, project, target) {
|
|
25
25
|
}
|
26
26
|
function executeWebpackBrowserBuilder(options, context) {
|
27
27
|
options.buildLibsFromSource ??= true;
|
28
|
-
|
28
|
+
options.watchDependencies ??= true;
|
29
|
+
const { buildLibsFromSource, customWebpackConfig, indexHtmlTransformer, indexFileTransformer, watchDependencies, ...delegateBuilderOptions } = options;
|
29
30
|
process.env.NX_BUILD_LIBS_FROM_SOURCE = `${buildLibsFromSource}`;
|
30
31
|
process.env.NX_BUILD_TARGET = (0, devkit_1.targetToTargetString)({ ...context.target });
|
31
32
|
const pathToWebpackConfig = customWebpackConfig?.path &&
|
@@ -61,7 +62,7 @@ function executeWebpackBrowserBuilder(options, context) {
|
|
61
62
|
const skipInitialRun = shouldSkipInitialTargetRun(projectGraph, context.target.project, context.target.target);
|
62
63
|
baseWebpackConfig.plugins.push(
|
63
64
|
// @ts-expect-error - difference between angular and webpack plugin definitions bc of webpack versions
|
64
|
-
new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${context.target.target} --projects=${workspaceDependencies.join(',')}`, skipInitialRun));
|
65
|
+
new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${context.target.target} --projects=${workspaceDependencies.join(',')}`, { skipInitialRun, skipWatchingDeps: !watchDependencies }));
|
65
66
|
}
|
66
67
|
}
|
67
68
|
if (!pathToWebpackConfig) {
|
@@ -2,7 +2,5 @@ import type { ExecutorContext } from '@nx/devkit';
|
|
2
2
|
import type { DelegateBuildExecutorSchema } from './schema';
|
3
3
|
export declare function delegateBuildExecutor(options: DelegateBuildExecutorSchema, context: ExecutorContext): AsyncGenerator<{
|
4
4
|
success: boolean;
|
5
|
-
},
|
6
|
-
success: boolean;
|
7
|
-
}, any>;
|
5
|
+
}, void, any>;
|
8
6
|
export default delegateBuildExecutor;
|
@@ -6,9 +6,6 @@ const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
6
6
|
async function* delegateBuildExecutor(options, context) {
|
7
7
|
const { target, dependencies } = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, context.targetName, context.configurationName);
|
8
8
|
options.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)((0, devkit_1.joinPathFragments)(context.root, options.tsConfig), context.root, target.data.root, dependencies);
|
9
|
-
if (!(0, buildable_libs_utils_1.checkDependentProjectsHaveBeenBuilt)(context.root, context.projectName, context.targetName, dependencies)) {
|
10
|
-
return { success: false };
|
11
|
-
}
|
12
9
|
const { buildTarget, ...targetOptions } = options;
|
13
10
|
const delegateTarget = (0, devkit_1.parseTargetString)(buildTarget, context);
|
14
11
|
yield* await (0, devkit_1.runExecutor)(delegateTarget, targetOptions, context);
|
@@ -31,10 +31,7 @@ function createLibraryExecutor(initializeNgPackagr) {
|
|
31
31
|
if (angularMajorVersion < 18 && options.poll !== undefined) {
|
32
32
|
throw new Error(`The "poll" option requires Angular version 18.0.0 or greater. You are currently using version ${angularVersion}.`);
|
33
33
|
}
|
34
|
-
const {
|
35
|
-
if (!(0, buildable_libs_utils_1.checkDependentProjectsHaveBeenBuilt)(context.root, context.projectName, context.targetName, dependencies)) {
|
36
|
-
return Promise.resolve({ success: false });
|
37
|
-
}
|
34
|
+
const { dependencies } = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, context.targetName, context.configurationName);
|
38
35
|
if (options.watch) {
|
39
36
|
return yield* (0, rxjs_for_await_1.eachValueFrom)((0, rxjs_1.from)(initializeNgPackagr(options, context, dependencies)).pipe((0, operators_1.switchMap)((packagr) => packagr.watch()), (0, operators_1.mapTo)({ success: true })));
|
40
37
|
}
|
@@ -22,7 +22,7 @@ async function addLintingGenerator(tree, options) {
|
|
22
22
|
setParserOptionsProject: options.setParserOptionsProject,
|
23
23
|
skipFormat: true,
|
24
24
|
rootProject: rootProject,
|
25
|
-
addPlugin: false,
|
25
|
+
addPlugin: options.addPlugin ?? false,
|
26
26
|
addExplicitTargets: true,
|
27
27
|
skipPackageJson: options.skipPackageJson,
|
28
28
|
});
|
@@ -61,21 +61,6 @@ async function addLintingGenerator(tree, options) {
|
|
61
61
|
files: ['*.html'],
|
62
62
|
rules: {},
|
63
63
|
});
|
64
|
-
if ((0, buildable_project_1.isBuildableLibraryProject)(tree, options.projectName)) {
|
65
|
-
(0, eslint_file_1.addOverrideToLintConfig)(tree, '', {
|
66
|
-
files: ['*.json'],
|
67
|
-
parser: 'jsonc-eslint-parser',
|
68
|
-
rules: {
|
69
|
-
'@nx/dependency-checks': [
|
70
|
-
'error',
|
71
|
-
{
|
72
|
-
// With flat configs, we don't want to include imports in the eslint js/cjs/mjs files to be checked
|
73
|
-
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
|
74
|
-
},
|
75
|
-
],
|
76
|
-
},
|
77
|
-
});
|
78
|
-
}
|
79
64
|
}
|
80
65
|
else {
|
81
66
|
(0, eslint_file_1.replaceOverridesInLintConfig)(tree, options.projectRoot, [
|
@@ -6,13 +6,18 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
|
|
6
6
|
const js_1 = require("@nx/js");
|
7
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
8
8
|
const init_1 = require("../init/init");
|
9
|
+
const convert_to_rspack_1 = require("../convert-to-rspack/convert-to-rspack");
|
9
10
|
const setup_ssr_1 = require("../setup-ssr/setup-ssr");
|
10
11
|
const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
|
11
12
|
const ensure_angular_dependencies_1 = require("../utils/ensure-angular-dependencies");
|
12
13
|
const lib_1 = require("./lib");
|
13
14
|
async function applicationGenerator(tree, schema) {
|
14
15
|
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'angular', 'application');
|
15
|
-
const
|
16
|
+
const isRspack = schema.bundler === 'rspack';
|
17
|
+
if (isRspack) {
|
18
|
+
schema.bundler = 'webpack';
|
19
|
+
}
|
20
|
+
const options = await (0, lib_1.normalizeOptions)(tree, schema, isRspack);
|
16
21
|
const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
|
17
22
|
await (0, js_1.initGenerator)(tree, {
|
18
23
|
...options,
|
@@ -23,6 +28,7 @@ async function applicationGenerator(tree, schema) {
|
|
23
28
|
await (0, init_1.angularInitGenerator)(tree, {
|
24
29
|
...options,
|
25
30
|
skipFormat: true,
|
31
|
+
addPlugin: options.addPlugin,
|
26
32
|
});
|
27
33
|
if (!options.skipPackageJson) {
|
28
34
|
(0, ensure_angular_dependencies_1.ensureAngularDependencies)(tree);
|
@@ -64,6 +70,13 @@ async function applicationGenerator(tree, schema) {
|
|
64
70
|
serverRouting: options.serverRouting,
|
65
71
|
});
|
66
72
|
}
|
73
|
+
if (isRspack) {
|
74
|
+
await (0, convert_to_rspack_1.convertToRspack)(tree, {
|
75
|
+
project: options.name,
|
76
|
+
skipInstall: options.skipPackageJson,
|
77
|
+
skipFormat: true,
|
78
|
+
});
|
79
|
+
}
|
67
80
|
if (!options.skipFormat) {
|
68
81
|
await (0, devkit_1.formatFiles)(tree);
|
69
82
|
}
|
@@ -7,8 +7,8 @@ const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaul
|
|
7
7
|
async function addE2e(tree, options) {
|
8
8
|
// since e2e are separate projects, default to adding plugins
|
9
9
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
10
|
-
const addPlugin =
|
11
|
-
|
10
|
+
const addPlugin = nxJson['useInferencePlugins'] !== false &&
|
11
|
+
process.env.NX_ADD_PLUGINS !== 'false';
|
12
12
|
const e2eWebServerInfo = getAngularE2EWebServerInfo(tree, options.name, options.port);
|
13
13
|
if (options.e2eTestRunner === 'cypress') {
|
14
14
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
@@ -12,6 +12,7 @@ async function addUnitTestRunner(host, options) {
|
|
12
12
|
projectRoot: options.appProjectRoot,
|
13
13
|
skipPackageJson: options.skipPackageJson,
|
14
14
|
strict: options.strict,
|
15
|
+
addPlugin: options.addPlugin,
|
15
16
|
});
|
16
17
|
break;
|
17
18
|
case test_runners_1.UnitTestRunner.Vitest:
|
@@ -20,6 +21,7 @@ async function addUnitTestRunner(host, options) {
|
|
20
21
|
projectRoot: options.appProjectRoot,
|
21
22
|
skipPackageJson: options.skipPackageJson,
|
22
23
|
strict: options.strict,
|
24
|
+
addPlugin: options.addPlugin,
|
23
25
|
});
|
24
26
|
break;
|
25
27
|
}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
2
2
|
import type { Schema } from '../schema';
|
3
3
|
import type { NormalizedSchema } from './normalized-schema';
|
4
|
-
export declare function normalizeOptions(host: Tree, options: Partial<Schema
|
4
|
+
export declare function normalizeOptions(host: Tree, options: Partial<Schema>, isRspack?: boolean): Promise<NormalizedSchema>;
|
@@ -5,8 +5,13 @@ const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
6
6
|
const eslint_1 = require("@nx/eslint");
|
7
7
|
const test_runners_1 = require("../../../utils/test-runners");
|
8
|
-
|
9
|
-
|
8
|
+
function arePluginsExplicitlyDisabled(host) {
|
9
|
+
const { useInferencePlugins } = (0, devkit_1.readNxJson)(host);
|
10
|
+
const addPluginEnvVar = process.env.NX_ADD_PLUGINS;
|
11
|
+
return useInferencePlugins === false || addPluginEnvVar === 'false';
|
12
|
+
}
|
13
|
+
async function normalizeOptions(host, options, isRspack) {
|
14
|
+
await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
|
10
15
|
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
11
16
|
name: options.name,
|
12
17
|
projectType: 'application',
|
@@ -20,8 +25,10 @@ async function normalizeOptions(host, options) {
|
|
20
25
|
? options.tags.split(',').map((s) => s.trim())
|
21
26
|
: [];
|
22
27
|
const bundler = options.bundler ?? 'esbuild';
|
28
|
+
const addPlugin = options.addPlugin ?? (!arePluginsExplicitlyDisabled(host) && isRspack);
|
23
29
|
// Set defaults and then overwrite with user options
|
24
30
|
return {
|
31
|
+
addPlugin,
|
25
32
|
style: 'css',
|
26
33
|
routing: true,
|
27
34
|
inlineStyle: false,
|
@@ -27,8 +27,9 @@ export interface Schema {
|
|
27
27
|
standalone?: boolean;
|
28
28
|
rootProject?: boolean;
|
29
29
|
minimal?: boolean;
|
30
|
-
bundler?: 'webpack' | 'esbuild';
|
30
|
+
bundler?: 'webpack' | 'esbuild' | 'rspack';
|
31
31
|
ssr?: boolean;
|
32
32
|
serverRouting?: boolean;
|
33
33
|
nxCloudToken?: string;
|
34
|
+
addPlugin?: boolean;
|
34
35
|
}
|
@@ -171,7 +171,7 @@
|
|
171
171
|
"bundler": {
|
172
172
|
"description": "Bundler to use to build the application.",
|
173
173
|
"type": "string",
|
174
|
-
"enum": ["esbuild", "webpack"],
|
174
|
+
"enum": ["esbuild", "rspack", "webpack"],
|
175
175
|
"default": "esbuild",
|
176
176
|
"x-prompt": "Which bundler do you want to use to build the application?",
|
177
177
|
"x-priority": "important"
|
@@ -6,7 +6,7 @@ const versions_1 = require("../../utils/versions");
|
|
6
6
|
const storybook_inputs_1 = require("../utils/storybook-ast/storybook-inputs");
|
7
7
|
async function componentTestGenerator(tree, options) {
|
8
8
|
(0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
9
|
-
const { assertMinimumCypressVersion } = require('@nx/cypress/src/utils/
|
9
|
+
const { assertMinimumCypressVersion } = require('@nx/cypress/src/utils/versions');
|
10
10
|
assertMinimumCypressVersion(10);
|
11
11
|
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
12
12
|
const componentDirPath = (0, devkit_1.joinPathFragments)(root, options.componentDir);
|