@nx/angular 21.2.0-beta.2 → 21.2.0-beta.3
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/migrations.json +108 -29
- package/ng-package.json +3 -17
- package/package.json +9 -9
- package/src/generators/add-linting/add-linting.js +0 -8
- package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -3
- package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +4 -6
- package/src/generators/stories/stories.d.ts +2 -2
- package/src/generators/stories/stories.js +0 -9
- package/src/migrations/update-21-2-0/replace-provide-server-routing.js +22 -9
- package/src/migrations/update-21-2-0/update-angular-cli.d.ts +1 -1
- package/src/migrations/update-21-2-0/update-angular-cli.js +1 -1
- package/src/utils/versions.d.ts +6 -6
- package/src/utils/versions.js +6 -6
package/migrations.json
CHANGED
@@ -303,43 +303,43 @@
|
|
303
303
|
"description": "Change the data persistence operator imports to '@ngrx/router-store/data-persistence'.",
|
304
304
|
"factory": "./src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence"
|
305
305
|
},
|
306
|
-
"update-angular-cli-version-20-0-0
|
306
|
+
"update-angular-cli-version-20-0-0": {
|
307
307
|
"cli": "nx",
|
308
|
-
"version": "21.2.0-beta.
|
308
|
+
"version": "21.2.0-beta.3",
|
309
309
|
"requires": {
|
310
|
-
"@angular/core": ">=20.0.0
|
310
|
+
"@angular/core": ">=20.0.0"
|
311
311
|
},
|
312
|
-
"description": "Update the @angular/cli package version to 20.0.0
|
312
|
+
"description": "Update the @angular/cli package version to ~20.0.0.",
|
313
313
|
"factory": "./src/migrations/update-21-2-0/update-angular-cli"
|
314
314
|
},
|
315
315
|
"migrate-provide-server-rendering-import": {
|
316
|
-
"version": "21.2.0-beta.
|
316
|
+
"version": "21.2.0-beta.3",
|
317
317
|
"requires": {
|
318
|
-
"@angular/core": ">=20.0.0
|
318
|
+
"@angular/core": ">=20.0.0"
|
319
319
|
},
|
320
320
|
"description": "Migrate imports of `provideServerRendering` from `@angular/platform-server` to `@angular/ssr`.",
|
321
321
|
"factory": "./src/migrations/update-21-2-0/migrate-provide-server-rendering-import"
|
322
322
|
},
|
323
323
|
"replace-provide-server-routing": {
|
324
|
-
"version": "21.2.0-beta.
|
324
|
+
"version": "21.2.0-beta.3",
|
325
325
|
"requires": {
|
326
|
-
"@angular/core": ">=20.0.0
|
326
|
+
"@angular/core": ">=20.0.0"
|
327
327
|
},
|
328
|
-
"description": "Replace `provideServerRouting` with `provideServerRendering` using `withRoutes`.",
|
328
|
+
"description": "Replace `provideServerRouting` and `provideServerRoutesConfig` with `provideServerRendering` using `withRoutes`.",
|
329
329
|
"factory": "./src/migrations/update-21-2-0/replace-provide-server-routing"
|
330
330
|
},
|
331
331
|
"set-generator-defaults-for-previous-style-guide": {
|
332
|
-
"version": "21.2.0-beta.
|
332
|
+
"version": "21.2.0-beta.3",
|
333
333
|
"requires": {
|
334
|
-
"@angular/core": ">=20.0.0
|
334
|
+
"@angular/core": ">=20.0.0"
|
335
335
|
},
|
336
336
|
"description": "Update the generator defaults to maintain the previous style guide behavior.",
|
337
337
|
"factory": "./src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide"
|
338
338
|
},
|
339
339
|
"update-module-resolution": {
|
340
|
-
"version": "21.2.0-beta.
|
340
|
+
"version": "21.2.0-beta.3",
|
341
341
|
"requires": {
|
342
|
-
"@angular/core": ">=20.0.0
|
342
|
+
"@angular/core": ">=20.0.0"
|
343
343
|
},
|
344
344
|
"description": "Update 'moduleResolution' to 'bundler' in TypeScript configurations. You can read more about this here: https://www.typescriptlang.org/tsconfig/#moduleResolution.",
|
345
345
|
"factory": "./src/migrations/update-21-2-0/update-module-resolution"
|
@@ -1667,66 +1667,145 @@
|
|
1667
1667
|
}
|
1668
1668
|
},
|
1669
1669
|
"21.2.0": {
|
1670
|
-
"version": "21.2.0-beta.
|
1670
|
+
"version": "21.2.0-beta.3",
|
1671
1671
|
"x-prompt": "Do you want to update the Angular version to v20?",
|
1672
1672
|
"requires": {
|
1673
|
-
"@angular/core": ">=19.2.0 <20.0.0
|
1673
|
+
"@angular/core": ">=19.2.0 <20.0.0"
|
1674
1674
|
},
|
1675
1675
|
"packages": {
|
1676
1676
|
"@angular-devkit/build-angular": {
|
1677
|
-
"version": "20.0.0
|
1677
|
+
"version": "~20.0.0",
|
1678
1678
|
"alwaysAddToPackageJson": false
|
1679
1679
|
},
|
1680
1680
|
"@angular-devkit/core": {
|
1681
|
-
"version": "20.0.0
|
1681
|
+
"version": "~20.0.0",
|
1682
1682
|
"alwaysAddToPackageJson": false
|
1683
1683
|
},
|
1684
1684
|
"@angular-devkit/schematics": {
|
1685
|
-
"version": "20.0.0
|
1685
|
+
"version": "~20.0.0",
|
1686
1686
|
"alwaysAddToPackageJson": false
|
1687
1687
|
},
|
1688
1688
|
"@angular/build": {
|
1689
|
-
"version": "20.0.0
|
1689
|
+
"version": "~20.0.0",
|
1690
1690
|
"alwaysAddToPackageJson": false
|
1691
1691
|
},
|
1692
1692
|
"@angular/pwa": {
|
1693
|
-
"version": "20.0.0
|
1693
|
+
"version": "~20.0.0",
|
1694
1694
|
"alwaysAddToPackageJson": false
|
1695
1695
|
},
|
1696
1696
|
"@angular/ssr": {
|
1697
|
-
"version": "20.0.0
|
1697
|
+
"version": "~20.0.0",
|
1698
1698
|
"alwaysAddToPackageJson": false
|
1699
1699
|
},
|
1700
1700
|
"@schematics/angular": {
|
1701
|
-
"version": "20.0.0
|
1701
|
+
"version": "~20.0.0",
|
1702
1702
|
"alwaysAddToPackageJson": false
|
1703
1703
|
},
|
1704
1704
|
"@angular-devkit/architect": {
|
1705
|
-
"version": "0.2000.0
|
1705
|
+
"version": "~0.2000.0",
|
1706
1706
|
"alwaysAddToPackageJson": false
|
1707
1707
|
},
|
1708
1708
|
"@angular-devkit/build-webpack": {
|
1709
|
-
"version": "0.2000.0
|
1709
|
+
"version": "~0.2000.0",
|
1710
1710
|
"alwaysAddToPackageJson": false
|
1711
1711
|
},
|
1712
1712
|
"@angular/core": {
|
1713
|
-
"version": "20.0.0
|
1713
|
+
"version": "~20.0.0",
|
1714
1714
|
"alwaysAddToPackageJson": true
|
1715
1715
|
},
|
1716
1716
|
"@angular/material": {
|
1717
|
-
"version": "20.0.0
|
1717
|
+
"version": "~20.0.0",
|
1718
1718
|
"alwaysAddToPackageJson": false
|
1719
1719
|
},
|
1720
1720
|
"@angular/cdk": {
|
1721
|
-
"version": "20.0.0
|
1721
|
+
"version": "~20.0.0",
|
1722
1722
|
"alwaysAddToPackageJson": false
|
1723
1723
|
},
|
1724
1724
|
"@angular/google-maps": {
|
1725
|
-
"version": "20.0.0
|
1725
|
+
"version": "~20.0.0",
|
1726
1726
|
"alwaysAddToPackageJson": false
|
1727
1727
|
},
|
1728
1728
|
"ng-packagr": {
|
1729
|
-
"version": "20.0.0
|
1729
|
+
"version": "~20.0.0",
|
1730
|
+
"alwaysAddToPackageJson": false
|
1731
|
+
}
|
1732
|
+
}
|
1733
|
+
},
|
1734
|
+
"21.2.0-angular-eslint": {
|
1735
|
+
"version": "21.2.0-beta.3",
|
1736
|
+
"requires": {
|
1737
|
+
"@angular/core": ">= 20.0.0 < 21.0.0",
|
1738
|
+
"typescript-eslint": "^8.0.0",
|
1739
|
+
"eslint": "^8.57.0 || ^9.0.0"
|
1740
|
+
},
|
1741
|
+
"packages": {
|
1742
|
+
"angular-eslint": {
|
1743
|
+
"version": "^20.0.0",
|
1744
|
+
"alwaysAddToPackageJson": false
|
1745
|
+
}
|
1746
|
+
}
|
1747
|
+
},
|
1748
|
+
"21.2.0-@angular-eslint": {
|
1749
|
+
"version": "21.2.0-beta.3",
|
1750
|
+
"requires": {
|
1751
|
+
"@angular/core": ">= 20.0.0 < 21.0.0",
|
1752
|
+
"eslint": "^8.57.0 || ^9.0.0"
|
1753
|
+
},
|
1754
|
+
"packages": {
|
1755
|
+
"@angular-eslint/eslint-plugin": {
|
1756
|
+
"version": "^20.0.0",
|
1757
|
+
"alwaysAddToPackageJson": false
|
1758
|
+
},
|
1759
|
+
"@angular-eslint/eslint-plugin-template": {
|
1760
|
+
"version": "^20.0.0",
|
1761
|
+
"alwaysAddToPackageJson": false
|
1762
|
+
},
|
1763
|
+
"@angular-eslint/template-parser": {
|
1764
|
+
"version": "^20.0.0",
|
1765
|
+
"alwaysAddToPackageJson": false
|
1766
|
+
},
|
1767
|
+
"@angular-eslint/utils": {
|
1768
|
+
"version": "^20.0.0",
|
1769
|
+
"alwaysAddToPackageJson": false
|
1770
|
+
},
|
1771
|
+
"@angular-eslint/schematics": {
|
1772
|
+
"version": "^20.0.0",
|
1773
|
+
"alwaysAddToPackageJson": false
|
1774
|
+
},
|
1775
|
+
"@angular-eslint/test-utils": {
|
1776
|
+
"version": "^20.0.0",
|
1777
|
+
"alwaysAddToPackageJson": false
|
1778
|
+
},
|
1779
|
+
"@angular-eslint/builder": {
|
1780
|
+
"version": "^20.0.0",
|
1781
|
+
"alwaysAddToPackageJson": false
|
1782
|
+
},
|
1783
|
+
"@angular-eslint/bundled-angular-compiler": {
|
1784
|
+
"version": "^20.0.0",
|
1785
|
+
"alwaysAddToPackageJson": false
|
1786
|
+
}
|
1787
|
+
}
|
1788
|
+
},
|
1789
|
+
"21.2.0-angular-rspack": {
|
1790
|
+
"version": "21.2.0-beta.3",
|
1791
|
+
"packages": {
|
1792
|
+
"@nx/angular-rspack": {
|
1793
|
+
"version": "^21.1.0",
|
1794
|
+
"alwaysAddToPackageJson": false
|
1795
|
+
}
|
1796
|
+
}
|
1797
|
+
},
|
1798
|
+
"21.2.0-jest": {
|
1799
|
+
"version": "21.2.0-beta.3",
|
1800
|
+
"requires": {
|
1801
|
+
"@angular/compiler-cli": ">=15.0.0 <21.0.0",
|
1802
|
+
"@angular/core": ">=15.0.0 <21.0.0",
|
1803
|
+
"@angular/platform-browser-dynamic": ">=15.0.0 <21.0.0",
|
1804
|
+
"jest": "^29.0.0"
|
1805
|
+
},
|
1806
|
+
"packages": {
|
1807
|
+
"jest-preset-angular": {
|
1808
|
+
"version": "~14.6.0",
|
1730
1809
|
"alwaysAddToPackageJson": false
|
1731
1810
|
}
|
1732
1811
|
}
|
package/ng-package.json
CHANGED
@@ -7,28 +7,14 @@
|
|
7
7
|
"deleteDestPath": false,
|
8
8
|
"allowedNonPeerDependencies": [
|
9
9
|
"@nx/",
|
10
|
-
"@angular-devkit",
|
11
|
-
"@angular-eslint/",
|
12
|
-
"@module-federation/enhanced",
|
13
|
-
"@schematics",
|
14
10
|
"@phenomnomnominal/tsquery",
|
15
11
|
"@typescript-eslint/",
|
12
|
+
"enquirer",
|
13
|
+
"magic-string",
|
16
14
|
"picocolors",
|
17
|
-
"ignore",
|
18
15
|
"picomatch",
|
19
|
-
"rxjs-for-await",
|
20
|
-
"webpack-merge",
|
21
|
-
"ts-node",
|
22
|
-
"tsconfig-paths",
|
23
16
|
"semver",
|
24
|
-
"webpack"
|
25
|
-
"express",
|
26
|
-
"http-proxy-middleware",
|
27
|
-
"http-server",
|
28
|
-
"magic-string",
|
29
|
-
"enquirer",
|
30
|
-
"find-cache-dir",
|
31
|
-
"webpack"
|
17
|
+
"webpack-merge"
|
32
18
|
],
|
33
19
|
"keepLifecycleScripts": true
|
34
20
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/angular",
|
3
|
-
"version": "21.2.0-beta.
|
3
|
+
"version": "21.2.0-beta.3",
|
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": {
|
@@ -58,14 +58,14 @@
|
|
58
58
|
"migrations": "./migrations.json"
|
59
59
|
},
|
60
60
|
"dependencies": {
|
61
|
-
"@nx/devkit": "21.2.0-beta.
|
62
|
-
"@nx/eslint": "21.2.0-beta.
|
63
|
-
"@nx/js": "21.2.0-beta.
|
64
|
-
"@nx/module-federation": "21.2.0-beta.
|
65
|
-
"@nx/rspack": "21.2.0-beta.
|
66
|
-
"@nx/web": "21.2.0-beta.
|
67
|
-
"@nx/webpack": "21.2.0-beta.
|
68
|
-
"@nx/workspace": "21.2.0-beta.
|
61
|
+
"@nx/devkit": "21.2.0-beta.3",
|
62
|
+
"@nx/eslint": "21.2.0-beta.3",
|
63
|
+
"@nx/js": "21.2.0-beta.3",
|
64
|
+
"@nx/module-federation": "21.2.0-beta.3",
|
65
|
+
"@nx/rspack": "21.2.0-beta.3",
|
66
|
+
"@nx/web": "21.2.0-beta.3",
|
67
|
+
"@nx/webpack": "21.2.0-beta.3",
|
68
|
+
"@nx/workspace": "21.2.0-beta.3",
|
69
69
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
70
70
|
"@typescript-eslint/type-utils": "^8.0.0",
|
71
71
|
"enquirer": "~2.3.6",
|
@@ -55,10 +55,6 @@ async function addLintingGenerator(tree, options) {
|
|
55
55
|
style: 'kebab-case',
|
56
56
|
},
|
57
57
|
],
|
58
|
-
// Temporary disable these rules until Angular ESLint recommended
|
59
|
-
// rules are updated with the new Style Guide
|
60
|
-
'@angular-eslint/component-class-suffix': 'off',
|
61
|
-
'@angular-eslint/directive-class-suffix': 'off',
|
62
58
|
},
|
63
59
|
});
|
64
60
|
(0, eslint_file_1.addOverrideToLintConfig)(tree, options.projectRoot, {
|
@@ -99,10 +95,6 @@ async function addLintingGenerator(tree, options) {
|
|
99
95
|
style: 'kebab-case',
|
100
96
|
},
|
101
97
|
],
|
102
|
-
// Temporary disable these rules until Angular ESLint recommended
|
103
|
-
// rules are updated with the new Style Guide
|
104
|
-
'@angular-eslint/component-class-suffix': 'off',
|
105
|
-
'@angular-eslint/directive-class-suffix': 'off',
|
106
98
|
},
|
107
99
|
},
|
108
100
|
{
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import { TestBed } from '@angular/core/testing';
|
2
2
|
import { App<%= componentType %> } from './app<%= componentFileSuffix %>';<% if(!minimal) { %>
|
3
|
-
import { NxWelcome<%= componentType %> } from './nx-welcome<%= componentFileSuffix %>';<% }
|
4
|
-
import { RouterModule } from '@angular/router';<% } %>
|
3
|
+
import { NxWelcome<%= componentType %> } from './nx-welcome<%= componentFileSuffix %>';<% } %>
|
5
4
|
|
6
5
|
describe('App<%= componentType %>', () => {
|
7
6
|
beforeEach(async () => {
|
8
7
|
await TestBed.configureTestingModule({
|
9
|
-
imports: [App<%= componentType %><% if(!minimal) { %>, NxWelcome<%= componentType %><% }
|
8
|
+
imports: [App<%= componentType %><% if(!minimal) { %>, NxWelcome<%= componentType %><% } %>],
|
10
9
|
}).compileComponents();
|
11
10
|
});
|
12
11
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/angular';
|
2
2
|
import { <%=componentName%> } from './<%=componentFileName%>';
|
3
3
|
<%_ if ( interactionTests ) { _%>
|
4
|
-
import {
|
5
|
-
import { expect } from '@storybook/jest';
|
4
|
+
import { expect } from 'storybook/test';
|
6
5
|
<%_ } _%>
|
7
6
|
|
8
7
|
const meta: Meta<<%= componentName %>> = {
|
@@ -23,9 +22,8 @@ export const Heading: Story = {
|
|
23
22
|
args: {<% for (let prop of props) { %>
|
24
23
|
<%= prop.name %>: <%- prop.defaultValue %>,<% } %>
|
25
24
|
},
|
26
|
-
play: async ({
|
27
|
-
|
28
|
-
expect(canvas.getByText(/<%=componentNameSimple%> works!/gi)).toBeTruthy();
|
25
|
+
play: async ({ canvas }) => {
|
26
|
+
await expect(canvas.getByText(/<%=componentNameSimple%> works!/gi)).toBeTruthy();
|
29
27
|
},
|
30
28
|
};
|
31
|
-
<%_ } _%>
|
29
|
+
<%_ } _%>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { Tree } from '@nx/devkit';
|
2
2
|
import type { StoriesGeneratorOptions } from './schema';
|
3
|
-
export declare function angularStoriesGenerator(tree: Tree, options: StoriesGeneratorOptions): Promise<
|
3
|
+
export declare function angularStoriesGenerator(tree: Tree, options: StoriesGeneratorOptions): Promise<void>;
|
4
4
|
export default angularStoriesGenerator;
|
@@ -8,7 +8,6 @@ const component_info_1 = require("../utils/storybook-ast/component-info");
|
|
8
8
|
const entry_point_1 = require("../utils/storybook-ast/entry-point");
|
9
9
|
const module_info_1 = require("../utils/storybook-ast/module-info");
|
10
10
|
const picomatch = require("picomatch");
|
11
|
-
const versions_1 = require("../../utils/versions");
|
12
11
|
async function angularStoriesGenerator(tree, options) {
|
13
12
|
const entryPoints = (0, entry_point_1.getProjectEntryPoints)(tree, options.name);
|
14
13
|
const componentsInfo = [];
|
@@ -33,16 +32,8 @@ async function angularStoriesGenerator(tree, options) {
|
|
33
32
|
skipFormat: true,
|
34
33
|
});
|
35
34
|
}
|
36
|
-
const tasks = [];
|
37
|
-
if (options.interactionTests) {
|
38
|
-
const { interactionTestsDependencies, addInteractionsInAddons } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
|
39
|
-
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, options.name);
|
40
|
-
addInteractionsInAddons(tree, projectConfiguration);
|
41
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, interactionTestsDependencies()));
|
42
|
-
}
|
43
35
|
if (!options.skipFormat) {
|
44
36
|
await (0, devkit_1.formatFiles)(tree);
|
45
37
|
}
|
46
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
47
38
|
}
|
48
39
|
exports.default = angularStoriesGenerator;
|
@@ -26,15 +26,22 @@ async function default_1(tree) {
|
|
26
26
|
}
|
27
27
|
function processFile(tree, filePath) {
|
28
28
|
const content = tree.read(filePath, 'utf-8');
|
29
|
-
if (!content.includes('provideServerRouting')
|
29
|
+
if ((!content.includes('provideServerRouting') &&
|
30
|
+
!content.includes('provideServerRoutesConfig')) ||
|
30
31
|
!content.includes('@angular/ssr')) {
|
31
32
|
return;
|
32
33
|
}
|
33
34
|
const sourceFile = tsquery_1.tsquery.ast(content);
|
34
|
-
const providersArray = tsquery_1.tsquery.query(sourceFile, 'PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression
|
35
|
+
const providersArray = tsquery_1.tsquery.query(sourceFile, 'PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression', { visitAllChildren: true })[0];
|
35
36
|
if (!providersArray) {
|
36
37
|
return;
|
37
38
|
}
|
39
|
+
if (!providersArray.elements.some((el) => ts.isCallExpression(el) &&
|
40
|
+
ts.isIdentifier(el.expression) &&
|
41
|
+
(el.expression.getText() === 'provideServerRouting' ||
|
42
|
+
el.expression.getText() === 'provideServerRoutesConfig'))) {
|
43
|
+
return;
|
44
|
+
}
|
38
45
|
const recorder = new file_change_recorder_1.FileChangeRecorder(tree, filePath);
|
39
46
|
const printer = ts.createPrinter({
|
40
47
|
newLine: ts.NewLineKind.LineFeed,
|
@@ -46,18 +53,21 @@ function processFile(tree, filePath) {
|
|
46
53
|
if (node.expression.getText() === 'provideServerRendering') {
|
47
54
|
provideServerRenderingCall = node;
|
48
55
|
}
|
49
|
-
else if (node.expression.getText() === 'provideServerRouting'
|
56
|
+
else if (node.expression.getText() === 'provideServerRouting' ||
|
57
|
+
node.expression.getText() === 'provideServerRoutesConfig') {
|
50
58
|
provideServerRoutingCall = node;
|
51
59
|
}
|
52
60
|
}
|
53
61
|
const withRoutesCall = ts.factory.createCallExpression(ts.factory.createIdentifier('withRoutes'), undefined, [provideServerRoutingCall.arguments.at(0)]);
|
54
62
|
let updatedProvidersArray;
|
55
63
|
if (provideServerRenderingCall) {
|
56
|
-
// remove the "provideServerRouting"
|
64
|
+
// remove the "provideServerRouting" and "provideServerRoutesConfig"
|
65
|
+
// calls and update the existing "provideServerRendering" call
|
57
66
|
updatedProvidersArray = ts.factory.updateArrayLiteralExpression(providersArray, providersArray.elements
|
58
67
|
.filter((el) => !(ts.isCallExpression(el) &&
|
59
68
|
ts.isIdentifier(el.expression) &&
|
60
|
-
el.expression.text === 'provideServerRouting'
|
69
|
+
(el.expression.text === 'provideServerRouting' ||
|
70
|
+
el.expression.text === 'provideServerRoutesConfig')))
|
61
71
|
.map((el) => {
|
62
72
|
if (ts.isCallExpression(el) &&
|
63
73
|
ts.isIdentifier(el.expression) &&
|
@@ -68,11 +78,13 @@ function processFile(tree, filePath) {
|
|
68
78
|
}));
|
69
79
|
}
|
70
80
|
else {
|
71
|
-
// replace the "provideServerRouting"
|
81
|
+
// replace the "provideServerRouting" and "provideServerRoutesConfig"
|
82
|
+
// calls with the new "provideServerRendering" call
|
72
83
|
updatedProvidersArray = ts.factory.updateArrayLiteralExpression(providersArray, providersArray.elements.map((el) => {
|
73
84
|
if (ts.isCallExpression(el) &&
|
74
85
|
ts.isIdentifier(el.expression) &&
|
75
|
-
el.expression.text === 'provideServerRouting'
|
86
|
+
(el.expression.text === 'provideServerRouting' ||
|
87
|
+
el.expression.text === 'provideServerRoutesConfig')) {
|
76
88
|
return ts.factory.createCallExpression(ts.factory.createIdentifier('provideServerRendering'), undefined, [withRoutesCall, ...provideServerRoutingCall.arguments.slice(1)]);
|
77
89
|
}
|
78
90
|
return el;
|
@@ -85,11 +97,12 @@ function processFile(tree, filePath) {
|
|
85
97
|
if (importDecl?.importClause?.namedBindings) {
|
86
98
|
const namedBindings = importDecl?.importClause.namedBindings;
|
87
99
|
if (ts.isNamedImports(namedBindings)) {
|
88
|
-
// remove the "provideServerRouting"
|
100
|
+
// remove the "provideServerRouting" and "provideServerRoutesConfig"
|
101
|
+
// imports and ensure we have the "withRoutes" import
|
89
102
|
const updatedElementNames = new Set([
|
90
103
|
...namedBindings.elements
|
91
104
|
.map((el) => el.getText())
|
92
|
-
.filter((x) => x !== 'provideServerRouting'),
|
105
|
+
.filter((x) => x !== 'provideServerRouting' && x !== 'provideServerRoutesConfig'),
|
93
106
|
'withRoutes',
|
94
107
|
]);
|
95
108
|
const updatedNamedBindings = ts.factory.updateNamedImports(namedBindings, Array.from(updatedElementNames).map((name) => ts.factory.createImportSpecifier(false, undefined, ts.factory.createIdentifier(name))));
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularCliVersion = void 0;
|
4
4
|
exports.default = default_1;
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
6
|
-
exports.angularCliVersion = '20.0.0
|
6
|
+
exports.angularCliVersion = '~20.0.0';
|
7
7
|
async function default_1(tree) {
|
8
8
|
let shouldFormat = false;
|
9
9
|
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
package/src/utils/versions.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
export declare const nxVersion: any;
|
2
|
-
export declare const angularVersion = "20.0.0
|
3
|
-
export declare const angularDevkitVersion = "20.0.0
|
4
|
-
export declare const ngPackagrVersion = "20.0.0
|
5
|
-
export declare const angularRspackVersion = "^21.0
|
2
|
+
export declare const angularVersion = "~20.0.0";
|
3
|
+
export declare const angularDevkitVersion = "~20.0.0";
|
4
|
+
export declare const ngPackagrVersion = "~20.0.0";
|
5
|
+
export declare const angularRspackVersion = "^21.1.0";
|
6
6
|
export declare const ngrxVersion = "^19.0.0";
|
7
7
|
export declare const rxjsVersion = "~7.8.0";
|
8
8
|
export declare const zoneJsVersion = "~0.15.0";
|
@@ -16,14 +16,14 @@ export declare const browserSyncVersion = "^3.0.0";
|
|
16
16
|
export declare const moduleFederationNodeVersion = "^2.6.26";
|
17
17
|
export declare const moduleFederationEnhancedVersion = "^0.9.0";
|
18
18
|
export declare const webpackMergeVersion = "^5.8.0";
|
19
|
-
export declare const angularEslintVersion = "^
|
19
|
+
export declare const angularEslintVersion = "^20.0.0";
|
20
20
|
export declare const typescriptEslintVersion = "^7.16.0";
|
21
21
|
export declare const tailwindVersion = "^3.0.2";
|
22
22
|
export declare const postcssVersion = "^8.4.5";
|
23
23
|
export declare const postcssUrlVersion = "~10.1.3";
|
24
24
|
export declare const autoprefixerVersion = "^10.4.0";
|
25
25
|
export declare const tsNodeVersion = "10.9.1";
|
26
|
-
export declare const jestPresetAngularVersion = "~14.
|
26
|
+
export declare const jestPresetAngularVersion = "~14.6.0";
|
27
27
|
export declare const typesNodeVersion = "18.16.9";
|
28
28
|
export declare const jasmineMarblesVersion = "^0.9.2";
|
29
29
|
export declare const jsoncEslintParserVersion = "^2.1.0";
|
package/src/utils/versions.js
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularRspackVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
5
|
-
exports.angularVersion = '20.0.0
|
6
|
-
exports.angularDevkitVersion = '20.0.0
|
7
|
-
exports.ngPackagrVersion = '20.0.0
|
8
|
-
exports.angularRspackVersion = '^21.0
|
5
|
+
exports.angularVersion = '~20.0.0';
|
6
|
+
exports.angularDevkitVersion = '~20.0.0';
|
7
|
+
exports.ngPackagrVersion = '~20.0.0';
|
8
|
+
exports.angularRspackVersion = '^21.1.0';
|
9
9
|
exports.ngrxVersion = '^19.0.0';
|
10
10
|
exports.rxjsVersion = '~7.8.0';
|
11
11
|
exports.zoneJsVersion = '~0.15.0';
|
@@ -19,14 +19,14 @@ exports.browserSyncVersion = '^3.0.0';
|
|
19
19
|
exports.moduleFederationNodeVersion = '^2.6.26';
|
20
20
|
exports.moduleFederationEnhancedVersion = '^0.9.0';
|
21
21
|
exports.webpackMergeVersion = '^5.8.0';
|
22
|
-
exports.angularEslintVersion = '^
|
22
|
+
exports.angularEslintVersion = '^20.0.0';
|
23
23
|
exports.typescriptEslintVersion = '^7.16.0';
|
24
24
|
exports.tailwindVersion = '^3.0.2';
|
25
25
|
exports.postcssVersion = '^8.4.5';
|
26
26
|
exports.postcssUrlVersion = '~10.1.3';
|
27
27
|
exports.autoprefixerVersion = '^10.4.0';
|
28
28
|
exports.tsNodeVersion = '10.9.1';
|
29
|
-
exports.jestPresetAngularVersion = '~14.
|
29
|
+
exports.jestPresetAngularVersion = '~14.6.0';
|
30
30
|
exports.typesNodeVersion = '18.16.9';
|
31
31
|
exports.jasmineMarblesVersion = '^0.9.2';
|
32
32
|
exports.jsoncEslintParserVersion = '^2.1.0';
|