@angular/core 19.0.0-next.10 → 19.0.0-next.11
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/fesm2022/core.mjs +13205 -11798
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +8 -6
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +72 -4
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +4 -4
- package/index.d.ts +527 -51
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +3 -1
- package/rxjs-interop/index.d.ts +32 -1
- package/schematics/bundles/{checker-77660732.js → checker-51c08a1b.js} +112 -97
- package/schematics/bundles/{compiler_host-81f430d9.js → compiler_host-d7f120f0.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/explicit-standalone-flag.js +6 -4
- package/schematics/bundles/imports-4ac08251.js +1 -1
- package/schematics/bundles/{group_replacements-1f48eff7.js → index-f7b283e6.js} +247 -1649
- package/schematics/bundles/inject-migration.js +7 -6
- package/schematics/bundles/leading_space-d190b83b.js +1 -1
- package/schematics/bundles/migrate_ts_type_references-b2b55f62.js +1448 -0
- package/schematics/bundles/{nodes-0e7d45ca.js → ng_decorators-4579dec6.js} +1 -14
- package/schematics/bundles/nodes-a535b2be.js +27 -0
- package/schematics/bundles/output-migration.js +7295 -0
- package/schematics/bundles/pending-tasks.js +3 -3
- package/schematics/bundles/{program-1413936a.js → program-6e6520d8.js} +40 -18
- package/schematics/bundles/project_tsconfig_paths-e9ccccbf.js +1 -1
- package/schematics/bundles/provide-initializer.js +190 -0
- package/schematics/bundles/route-lazy-loading.js +3 -3
- package/schematics/bundles/signal-input-migration.js +73 -60
- package/schematics/bundles/signal-queries-migration.js +119 -90
- package/schematics/bundles/signals.js +54 -0
- package/schematics/bundles/standalone-migration.js +12 -11
- package/schematics/collection.json +11 -0
- package/schematics/migrations.json +7 -1
- package/schematics/ng-generate/output-migration/schema.json +19 -0
- package/schematics/ng-generate/signals/schema.json +65 -0
- package/testing/index.d.ts +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* @license Angular v19.0.0-next.11
|
|
4
|
+
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
|
+
|
|
11
|
+
var schematics = require('@angular-devkit/schematics');
|
|
12
|
+
var signalQueriesMigration = require('./signal-queries-migration.js');
|
|
13
|
+
var signalInputMigration = require('./signal-input-migration.js');
|
|
14
|
+
var outputMigration = require('./output-migration.js');
|
|
15
|
+
require('./project_tsconfig_paths-e9ccccbf.js');
|
|
16
|
+
require('@angular-devkit/core');
|
|
17
|
+
require('./index-f7b283e6.js');
|
|
18
|
+
require('node:path/posix');
|
|
19
|
+
require('os');
|
|
20
|
+
require('typescript');
|
|
21
|
+
require('./checker-51c08a1b.js');
|
|
22
|
+
require('fs');
|
|
23
|
+
require('module');
|
|
24
|
+
require('path');
|
|
25
|
+
require('url');
|
|
26
|
+
require('./program-6e6520d8.js');
|
|
27
|
+
require('assert');
|
|
28
|
+
require('./migrate_ts_type_references-b2b55f62.js');
|
|
29
|
+
require('./leading_space-d190b83b.js');
|
|
30
|
+
|
|
31
|
+
function migrate(options) {
|
|
32
|
+
// The migrations are independent so we can run them in any order, but we sort them here
|
|
33
|
+
// alphabetically so we get a consistent execution order in case of issue reports.
|
|
34
|
+
const migrations = options.migrations.slice().sort();
|
|
35
|
+
const rules = [];
|
|
36
|
+
for (const migration of migrations) {
|
|
37
|
+
switch (migration) {
|
|
38
|
+
case "inputs" /* SupportedMigrations.inputs */:
|
|
39
|
+
rules.push(signalInputMigration.migrate(options));
|
|
40
|
+
break;
|
|
41
|
+
case "outputs" /* SupportedMigrations.outputs */:
|
|
42
|
+
rules.push(outputMigration.migrate(options));
|
|
43
|
+
break;
|
|
44
|
+
case "queries" /* SupportedMigrations.queries */:
|
|
45
|
+
rules.push(signalQueriesMigration.migrate(options));
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
throw new schematics.SchematicsException(`Unsupported migration "${migration}"`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return schematics.chain(rules);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports.migrate = migrate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.0.0-next.
|
|
3
|
+
* @license Angular v19.0.0-next.11
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11,13 +11,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
require('os');
|
|
13
13
|
var ts = require('typescript');
|
|
14
|
-
var checker = require('./checker-
|
|
15
|
-
var program = require('./program-
|
|
14
|
+
var checker = require('./checker-51c08a1b.js');
|
|
15
|
+
var program = require('./program-6e6520d8.js');
|
|
16
16
|
var p = require('path');
|
|
17
17
|
var fs = require('fs');
|
|
18
|
-
var compiler_host = require('./compiler_host-
|
|
18
|
+
var compiler_host = require('./compiler_host-d7f120f0.js');
|
|
19
19
|
var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
|
|
20
|
-
var
|
|
20
|
+
var ng_decorators = require('./ng_decorators-4579dec6.js');
|
|
21
|
+
var nodes = require('./nodes-a535b2be.js');
|
|
21
22
|
var imports = require('./imports-4ac08251.js');
|
|
22
23
|
require('module');
|
|
23
24
|
require('url');
|
|
@@ -32,7 +33,7 @@ var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
|
|
|
32
33
|
* @description
|
|
33
34
|
* Entry point for all public APIs of the compiler-cli package.
|
|
34
35
|
*/
|
|
35
|
-
new checker.Version('19.0.0-next.
|
|
36
|
+
new checker.Version('19.0.0-next.11');
|
|
36
37
|
|
|
37
38
|
function createProgram({ rootNames, options, host, oldProgram, }) {
|
|
38
39
|
return new program.NgtscProgram(rootNames, options, host, oldProgram);
|
|
@@ -652,7 +653,7 @@ function findNgModuleClassesToMigrate(sourceFile, typeChecker) {
|
|
|
652
653
|
if (imports.getImportSpecifier(sourceFile, '@angular/core', 'NgModule')) {
|
|
653
654
|
sourceFile.forEachChild(function walk(node) {
|
|
654
655
|
if (ts__default["default"].isClassDeclaration(node)) {
|
|
655
|
-
const decorator =
|
|
656
|
+
const decorator = ng_decorators.getAngularDecorators(typeChecker, ts__default["default"].getDecorators(node) || []).find((current) => current.name === 'NgModule');
|
|
656
657
|
const metadata = decorator ? extractMetadataLiteral(decorator.node) : null;
|
|
657
658
|
if (metadata) {
|
|
658
659
|
const declarations = findLiteralProperty(metadata, 'declarations');
|
|
@@ -849,7 +850,7 @@ function analyzeTestingModules(testObjects, typeChecker) {
|
|
|
849
850
|
if (seenDeclarations.has(decl)) {
|
|
850
851
|
continue;
|
|
851
852
|
}
|
|
852
|
-
const [decorator] =
|
|
853
|
+
const [decorator] = ng_decorators.getAngularDecorators(typeChecker, ts__default["default"].getDecorators(decl) || []);
|
|
853
854
|
if (decorator) {
|
|
854
855
|
seenDeclarations.add(decl);
|
|
855
856
|
decorators.push(decorator);
|
|
@@ -1323,7 +1324,7 @@ function addRemovalTodos(nodes, tracker) {
|
|
|
1323
1324
|
}
|
|
1324
1325
|
/** Finds the `NgModule` decorator in a class, if it exists. */
|
|
1325
1326
|
function findNgModuleDecorator(node, typeChecker) {
|
|
1326
|
-
const decorators =
|
|
1327
|
+
const decorators = ng_decorators.getAngularDecorators(typeChecker, ts__default["default"].getDecorators(node) || []);
|
|
1327
1328
|
return decorators.find((decorator) => decorator.name === 'NgModule') || null;
|
|
1328
1329
|
}
|
|
1329
1330
|
/**
|
|
@@ -1399,7 +1400,7 @@ function analyzeBootstrapCall(call, typeChecker, templateTypeChecker) {
|
|
|
1399
1400
|
if (!declaration) {
|
|
1400
1401
|
return null;
|
|
1401
1402
|
}
|
|
1402
|
-
const decorator =
|
|
1403
|
+
const decorator = ng_decorators.getAngularDecorators(typeChecker, ts__default["default"].getDecorators(declaration) || []).find((decorator) => decorator.name === 'NgModule');
|
|
1403
1404
|
if (!decorator ||
|
|
1404
1405
|
decorator.node.expression.arguments.length === 0 ||
|
|
1405
1406
|
!ts__default["default"].isObjectLiteralExpression(decorator.node.expression.arguments[0])) {
|
|
@@ -1588,7 +1589,7 @@ function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, imports
|
|
|
1588
1589
|
: element;
|
|
1589
1590
|
const classDeclaration = findClassDeclaration(target, typeChecker);
|
|
1590
1591
|
const decorators = classDeclaration
|
|
1591
|
-
?
|
|
1592
|
+
? ng_decorators.getAngularDecorators(typeChecker, ts__default["default"].getDecorators(classDeclaration) || [])
|
|
1592
1593
|
: undefined;
|
|
1593
1594
|
if (!decorators ||
|
|
1594
1595
|
decorators.length === 0 ||
|
|
@@ -35,6 +35,17 @@
|
|
|
35
35
|
"factory": "./bundles/signal-queries-migration#migrate",
|
|
36
36
|
"schema": "./ng-generate/signal-queries-migration/schema.json",
|
|
37
37
|
"aliases": ["signal-queries", "signal-query", "signal-query-migration"]
|
|
38
|
+
},
|
|
39
|
+
"output-migration": {
|
|
40
|
+
"description": "Updates @output declarations to the functional equivalent, while also migrating all relevant references.",
|
|
41
|
+
"factory": "./bundles/output-migration#migrate",
|
|
42
|
+
"schema": "./ng-generate/output-migration/schema.json",
|
|
43
|
+
"aliases": ["outputs"]
|
|
44
|
+
},
|
|
45
|
+
"signals": {
|
|
46
|
+
"description": "Combines all signals-related migrations into a single migration",
|
|
47
|
+
"factory": "./bundles/signals#migrate",
|
|
48
|
+
"schema": "./ng-generate/signals/schema.json"
|
|
38
49
|
}
|
|
39
50
|
}
|
|
40
51
|
}
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
"schematics": {
|
|
3
3
|
"explicit-standalone-flag": {
|
|
4
4
|
"version": "19.0.0",
|
|
5
|
-
"description": "Updates non-standalone Directives, Component and Pipes to standalone:false",
|
|
5
|
+
"description": "Updates non-standalone Directives, Component and Pipes to 'standalone:false' and removes 'standalone:true' from those who are standalone",
|
|
6
6
|
"factory": "./bundles/explicit-standalone-flag#migrate"
|
|
7
7
|
},
|
|
8
8
|
"pending-tasks": {
|
|
9
9
|
"version": "19.0.0",
|
|
10
10
|
"description": "Updates ExperimentalPendingTasks to PendingTasks",
|
|
11
11
|
"factory": "./bundles/pending-tasks#migrate"
|
|
12
|
+
},
|
|
13
|
+
"provide-initializer": {
|
|
14
|
+
"version": "19.0.0",
|
|
15
|
+
"description": "Replaces `APP_INITIALIZER`, 'ENVIRONMENT_INITIALIZER' & 'PLATFORM_INITIALIZER' respectively with `provideAppInitializer`, `provideEnvironmentInitializer` & `providePlatormInitializer`.",
|
|
16
|
+
"factory": "./bundles/provide-initializer#migrate",
|
|
17
|
+
"optional": true
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "AngularOutputMigration",
|
|
4
|
+
"title": "Angular Output migration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"path": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Path to the directory where all outputs should be migrated.",
|
|
10
|
+
"x-prompt": "Which directory do you want to migrate?",
|
|
11
|
+
"default": "./"
|
|
12
|
+
},
|
|
13
|
+
"analysisDir": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Path to the directory that should be analyzed. References to migrated outputs are migrated based on this folder. Useful for larger projects if the analysis takes too long and the analysis scope can be narrowed.",
|
|
16
|
+
"default": "./"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "AngularSignalMigration",
|
|
4
|
+
"title": "Angular Signals migration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"migrations": {
|
|
8
|
+
"type": "array",
|
|
9
|
+
"default": [
|
|
10
|
+
"inputs",
|
|
11
|
+
"queries"
|
|
12
|
+
],
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": [
|
|
16
|
+
"inputs",
|
|
17
|
+
"outputs",
|
|
18
|
+
"queries"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"description": "Signals-related migrations that should be run",
|
|
22
|
+
"x-prompt": {
|
|
23
|
+
"message": "Which migrations do you want to run?",
|
|
24
|
+
"type": "list",
|
|
25
|
+
"multiselect": true,
|
|
26
|
+
"items": [
|
|
27
|
+
{
|
|
28
|
+
"value": "inputs",
|
|
29
|
+
"label": "Convert `@Input` to the signal-based `input`"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"value": "outputs",
|
|
33
|
+
"label": "Convert `@Output` to the new `output` function"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"value": "queries",
|
|
37
|
+
"label": "Convert `@ViewChild`/`@ViewChildren` and `@ContentChild`/`@ContentChildren` to the signal-based `viewChild`/`viewChildren` and `contentChild`/`contentChildren`"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"path": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "Path to the directory that should be migrated.",
|
|
45
|
+
"x-prompt": "Which directory do you want to migrate?",
|
|
46
|
+
"default": "./"
|
|
47
|
+
},
|
|
48
|
+
"analysisDir": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Path to the directory that should be analyzed. Useful for larger projects if the analysis takes too long and the analysis scope can be narrowed.",
|
|
51
|
+
"default": "./"
|
|
52
|
+
},
|
|
53
|
+
"bestEffortMode": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"description": "Whether to eagerly migrate as much as possible, ignoring problematic patterns that would otherwise prevent migration.",
|
|
56
|
+
"x-prompt": "Do you want to migrate as much as possible, even if it may break your build?",
|
|
57
|
+
"default": false
|
|
58
|
+
},
|
|
59
|
+
"insertTodos": {
|
|
60
|
+
"type": "boolean",
|
|
61
|
+
"description": "Whether the migration should add TODOs for code that could not be migrated",
|
|
62
|
+
"default": false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
package/testing/index.d.ts
CHANGED