@angular/core 19.2.4 → 19.2.6
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/{event_dispatcher.d-pVP0-wST.d.ts → event_dispatcher.d-DlbccpYq.d.ts} +3 -2
- package/fesm2022/core.mjs +103 -88
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +3 -3
- package/fesm2022/rxjs-interop.mjs +4 -3
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +148 -97
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/{untracked-CS7WUAzb.mjs → untracked-BKcld_ew.mjs} +3 -3
- package/fesm2022/{untracked-CS7WUAzb.mjs.map → untracked-BKcld_ew.mjs.map} +1 -1
- package/index.d.ts +23 -7
- package/{navigation_types.d-DgDrF5rp.d.ts → navigation_types.d-fAxd92YV.d.ts} +3 -2
- package/package.json +1 -1
- package/primitives/di/index.d.ts +3 -2
- package/primitives/event-dispatch/index.d.ts +3 -3
- package/primitives/signals/index.d.ts +5 -4
- package/rxjs-interop/index.d.ts +4 -3
- package/schematics/bundles/{apply_import_manager-BynuozbO.js → apply_import_manager-DFADpdFu.js} +3 -3
- package/schematics/bundles/{checker-DP-zos5Q.js → checker-DoX_7XCa.js} +20 -13
- package/schematics/bundles/cleanup-unused-imports.js +42 -64
- package/schematics/bundles/{compiler_host-DzM2hemp.js → compiler_host-BUKEE1cA.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/explicit-standalone-flag.js +3 -3
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{program-BmLi-Vxz.js → index-B4b0V0Vo.js} +52 -26
- package/schematics/bundles/{index-CPpyW--c.js → index-CpZKzrqM.js} +6 -6
- package/schematics/bundles/inject-migration.js +25 -8
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Ri-K4P_1.js → migrate_ts_type_references-DQVDid4G.js} +5 -5
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +115 -81
- package/schematics/bundles/pending-tasks.js +3 -3
- package/schematics/bundles/{project_paths-CXXqWSoY.js → project_paths-C3etOlgT.js} +88 -13
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
- package/schematics/bundles/provide-initializer.js +3 -3
- package/schematics/bundles/route-lazy-loading.js +3 -3
- package/schematics/bundles/self-closing-tags-migration.js +39 -64
- package/schematics/bundles/signal-input-migration.js +64 -87
- package/schematics/bundles/signal-queries-migration.js +82 -93
- package/schematics/bundles/signals.js +11 -11
- package/schematics/bundles/standalone-migration.js +5 -6
- package/testing/index.d.ts +7 -22
- package/{weak_ref.d-Bp6cSy-X.d.ts → weak_ref.d-DWHPG08n.d.ts} +3 -2
- package/schematics/bundles/index-BPqwMr5d.js +0 -30
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.6
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var schematics = require('@angular-devkit/schematics');
|
|
10
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
11
|
-
var project_paths = require('./project_paths-CXXqWSoY.js');
|
|
12
|
-
require('os');
|
|
13
9
|
var ts = require('typescript');
|
|
14
|
-
|
|
15
|
-
require('./
|
|
10
|
+
require('os');
|
|
11
|
+
var checker = require('./checker-DoX_7XCa.js');
|
|
12
|
+
require('./index-B4b0V0Vo.js');
|
|
16
13
|
require('path');
|
|
14
|
+
var project_paths = require('./project_paths-C3etOlgT.js');
|
|
17
15
|
var ng_decorators = require('./ng_decorators-DznZ5jMl.js');
|
|
18
16
|
var property_name = require('./property_name-BBwFuqMe.js');
|
|
19
17
|
require('@angular-devkit/core');
|
|
@@ -21,6 +19,8 @@ require('node:path/posix');
|
|
|
21
19
|
require('fs');
|
|
22
20
|
require('module');
|
|
23
21
|
require('url');
|
|
22
|
+
require('@angular-devkit/schematics');
|
|
23
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
24
24
|
require('./imports-CIX-JgAN.js');
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -393,65 +393,40 @@ function removeDuplicateReplacements(replacements) {
|
|
|
393
393
|
|
|
394
394
|
function migrate(options) {
|
|
395
395
|
return async (tree, context) => {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
396
|
+
await project_paths.runMigrationInDevkit({
|
|
397
|
+
tree,
|
|
398
|
+
getMigration: (fs) => new SelfClosingTagsMigration({
|
|
399
|
+
shouldMigrate: (file) => {
|
|
400
|
+
return (file.rootRelativePath.startsWith(fs.normalize(options.path)) &&
|
|
401
|
+
!/(^|\/)node_modules\//.test(file.rootRelativePath));
|
|
402
|
+
},
|
|
403
|
+
}),
|
|
404
|
+
beforeProgramCreation: (tsconfigPath, stage) => {
|
|
405
|
+
if (stage === project_paths.MigrationStage.Analysis) {
|
|
406
|
+
context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
context.logger.info(`Running migration for: ${tsconfigPath}...`);
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
beforeUnitAnalysis: (tsconfigPath) => {
|
|
413
|
+
context.logger.info(`Scanning for component tags: ${tsconfigPath}...`);
|
|
414
|
+
},
|
|
415
|
+
afterAllAnalyzed: () => {
|
|
416
|
+
context.logger.info(``);
|
|
417
|
+
context.logger.info(`Processing analysis data between targets...`);
|
|
418
|
+
context.logger.info(``);
|
|
419
|
+
},
|
|
420
|
+
afterAnalysisFailure: () => {
|
|
421
|
+
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
422
|
+
},
|
|
423
|
+
whenDone: ({ counters }) => {
|
|
424
|
+
const { touchedFilesCount, replacementCount } = counters;
|
|
425
|
+
context.logger.info('');
|
|
426
|
+
context.logger.info(`Successfully migrated to self-closing tags 🎉`);
|
|
427
|
+
context.logger.info(` -> Migrated ${replacementCount} components to self-closing tags in ${touchedFilesCount} component files.`);
|
|
406
428
|
},
|
|
407
429
|
});
|
|
408
|
-
const unitResults = [];
|
|
409
|
-
const programInfos = [...buildPaths, ...testPaths].map((tsconfigPath) => {
|
|
410
|
-
context.logger.info(`Preparing analysis for: ${tsconfigPath}..`);
|
|
411
|
-
const baseInfo = migration.createProgram(tsconfigPath, fs);
|
|
412
|
-
const info = migration.prepareProgram(baseInfo);
|
|
413
|
-
return { info, tsconfigPath };
|
|
414
|
-
});
|
|
415
|
-
// Analyze phase. Treat all projects as compilation units as
|
|
416
|
-
// this allows us to support references between those.
|
|
417
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
418
|
-
context.logger.info(`Scanning for component tags: ${tsconfigPath}..`);
|
|
419
|
-
unitResults.push(await migration.analyze(info));
|
|
420
|
-
}
|
|
421
|
-
context.logger.info(``);
|
|
422
|
-
context.logger.info(`Processing analysis data between targets..`);
|
|
423
|
-
context.logger.info(``);
|
|
424
|
-
const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
|
|
425
|
-
if (combined === null) {
|
|
426
|
-
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
const globalMeta = await migration.globalMeta(combined);
|
|
430
|
-
const replacementsPerFile = new Map();
|
|
431
|
-
for (const { tsconfigPath } of programInfos) {
|
|
432
|
-
context.logger.info(`Migrating: ${tsconfigPath}..`);
|
|
433
|
-
const { replacements } = await migration.migrate(globalMeta);
|
|
434
|
-
const changesPerFile = project_paths.groupReplacementsByFile(replacements);
|
|
435
|
-
for (const [file, changes] of changesPerFile) {
|
|
436
|
-
if (!replacementsPerFile.has(file)) {
|
|
437
|
-
replacementsPerFile.set(file, changes);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
context.logger.info(`Applying changes..`);
|
|
442
|
-
for (const [file, changes] of replacementsPerFile) {
|
|
443
|
-
const recorder = tree.beginUpdate(file);
|
|
444
|
-
for (const c of changes) {
|
|
445
|
-
recorder
|
|
446
|
-
.remove(c.data.position, c.data.end - c.data.position)
|
|
447
|
-
.insertLeft(c.data.position, c.data.toInsert);
|
|
448
|
-
}
|
|
449
|
-
tree.commitUpdate(recorder);
|
|
450
|
-
}
|
|
451
|
-
const { counters: { touchedFilesCount, replacementCount }, } = await migration.stats(globalMeta);
|
|
452
|
-
context.logger.info('');
|
|
453
|
-
context.logger.info(`Successfully migrated to self-closing tags 🎉`);
|
|
454
|
-
context.logger.info(` -> Migrated ${replacementCount} components to self-closing tags in ${touchedFilesCount} component files.`);
|
|
455
430
|
};
|
|
456
431
|
}
|
|
457
432
|
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.6
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-Ri-K4P_1.js');
|
|
9
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-DQVDid4G.js');
|
|
11
10
|
var ts = require('typescript');
|
|
12
11
|
require('os');
|
|
13
|
-
var checker = require('./checker-
|
|
14
|
-
var
|
|
12
|
+
var checker = require('./checker-DoX_7XCa.js');
|
|
13
|
+
var index$1 = require('./index-B4b0V0Vo.js');
|
|
15
14
|
require('path');
|
|
16
|
-
var project_paths = require('./project_paths-
|
|
17
|
-
var index = require('./index-
|
|
15
|
+
var project_paths = require('./project_paths-C3etOlgT.js');
|
|
16
|
+
var index = require('./index-CpZKzrqM.js');
|
|
18
17
|
var assert = require('assert');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
20
|
-
|
|
18
|
+
var apply_import_manager = require('./apply_import_manager-DFADpdFu.js');
|
|
19
|
+
require('@angular-devkit/core');
|
|
20
|
+
require('node:path/posix');
|
|
21
21
|
require('./leading_space-D9nQ8UQC.js');
|
|
22
22
|
require('fs');
|
|
23
23
|
require('module');
|
|
24
24
|
require('url');
|
|
25
|
-
require('@angular-devkit/
|
|
26
|
-
require('
|
|
25
|
+
require('@angular-devkit/schematics');
|
|
26
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Class that holds information about a given directive and its input fields.
|
|
@@ -275,8 +275,8 @@ function prepareAnalysisInfo(userProgram, compiler, programAbsoluteRootPaths) {
|
|
|
275
275
|
}
|
|
276
276
|
const typeChecker = userProgram.getTypeChecker();
|
|
277
277
|
const reflector = new checker.TypeScriptReflectionHost(typeChecker);
|
|
278
|
-
const evaluator = new
|
|
279
|
-
const dtsMetadataReader = new
|
|
278
|
+
const evaluator = new index$1.PartialEvaluator(reflector, typeChecker, null);
|
|
279
|
+
const dtsMetadataReader = new index$1.DtsMetadataReader(typeChecker, reflector);
|
|
280
280
|
return {
|
|
281
281
|
metaRegistry: metaReader,
|
|
282
282
|
dtsMetadataReader,
|
|
@@ -1433,82 +1433,59 @@ function createMigrationHost(info, config) {
|
|
|
1433
1433
|
|
|
1434
1434
|
function migrate(options) {
|
|
1435
1435
|
return async (tree, context) => {
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1436
|
+
await project_paths.runMigrationInDevkit({
|
|
1437
|
+
tree,
|
|
1438
|
+
getMigration: (fs) => new SignalInputMigration({
|
|
1439
|
+
bestEffortMode: options.bestEffortMode,
|
|
1440
|
+
insertTodosForSkippedFields: options.insertTodos,
|
|
1441
|
+
shouldMigrateInput: (input) => {
|
|
1442
|
+
return (input.file.rootRelativePath.startsWith(fs.normalize(options.path)) &&
|
|
1443
|
+
!/(^|\/)node_modules\//.test(input.file.rootRelativePath));
|
|
1444
|
+
},
|
|
1445
|
+
}),
|
|
1446
|
+
beforeProgramCreation: (tsconfigPath, stage) => {
|
|
1447
|
+
if (stage === project_paths.MigrationStage.Analysis) {
|
|
1448
|
+
context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
|
|
1449
|
+
}
|
|
1450
|
+
else {
|
|
1451
|
+
context.logger.info(`Running migration for: ${tsconfigPath}...`);
|
|
1452
|
+
}
|
|
1448
1453
|
},
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
const info = migration.prepareProgram(baseInfo);
|
|
1456
|
-
// Support restricting the analysis to subfolders for larger projects.
|
|
1457
|
-
if (analysisPath !== '/') {
|
|
1458
|
-
info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1459
|
-
info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1460
|
-
}
|
|
1461
|
-
return { info, tsconfigPath };
|
|
1462
|
-
});
|
|
1463
|
-
// Analyze phase. Treat all projects as compilation units as
|
|
1464
|
-
// this allows us to support references between those.
|
|
1465
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
1466
|
-
context.logger.info(`Scanning for inputs: ${tsconfigPath}..`);
|
|
1467
|
-
unitResults.push(await migration.analyze(info));
|
|
1468
|
-
}
|
|
1469
|
-
context.logger.info(``);
|
|
1470
|
-
context.logger.info(`Processing analysis data between targets..`);
|
|
1471
|
-
context.logger.info(``);
|
|
1472
|
-
const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
|
|
1473
|
-
if (combined === null) {
|
|
1474
|
-
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
1475
|
-
return;
|
|
1476
|
-
}
|
|
1477
|
-
const globalMeta = await migration.globalMeta(combined);
|
|
1478
|
-
const replacementsPerFile = new Map();
|
|
1479
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
1480
|
-
context.logger.info(`Migrating: ${tsconfigPath}..`);
|
|
1481
|
-
const { replacements } = await migration.migrate(globalMeta, info);
|
|
1482
|
-
const changesPerFile = project_paths.groupReplacementsByFile(replacements);
|
|
1483
|
-
for (const [file, changes] of changesPerFile) {
|
|
1484
|
-
if (!replacementsPerFile.has(file)) {
|
|
1485
|
-
replacementsPerFile.set(file, changes);
|
|
1454
|
+
afterProgramCreation: (info, fs) => {
|
|
1455
|
+
const analysisPath = fs.resolve(options.analysisDir);
|
|
1456
|
+
// Support restricting the analysis to subfolders for larger projects.
|
|
1457
|
+
if (analysisPath !== '/') {
|
|
1458
|
+
info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1459
|
+
info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1486
1460
|
}
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1461
|
+
},
|
|
1462
|
+
beforeUnitAnalysis: (tsconfigPath) => {
|
|
1463
|
+
context.logger.info(`Scanning for inputs: ${tsconfigPath}...`);
|
|
1464
|
+
},
|
|
1465
|
+
afterAllAnalyzed: () => {
|
|
1466
|
+
context.logger.info(``);
|
|
1467
|
+
context.logger.info(`Processing analysis data between targets...`);
|
|
1468
|
+
context.logger.info(``);
|
|
1469
|
+
},
|
|
1470
|
+
afterAnalysisFailure: () => {
|
|
1471
|
+
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
1472
|
+
},
|
|
1473
|
+
whenDone: ({ counters }) => {
|
|
1474
|
+
const { sourceInputs, incompatibleInputs } = counters;
|
|
1475
|
+
const migratedInputs = sourceInputs - incompatibleInputs;
|
|
1476
|
+
context.logger.info('');
|
|
1477
|
+
context.logger.info(`Successfully migrated to signal inputs 🎉`);
|
|
1478
|
+
context.logger.info(` -> Migrated ${migratedInputs}/${sourceInputs} inputs.`);
|
|
1479
|
+
if (incompatibleInputs > 0 && !options.insertTodos) {
|
|
1480
|
+
context.logger.warn(`To see why ${incompatibleInputs} inputs couldn't be migrated`);
|
|
1481
|
+
context.logger.warn(`consider re-running with "--insert-todos" or "--best-effort-mode".`);
|
|
1482
|
+
}
|
|
1483
|
+
if (options.bestEffortMode) {
|
|
1484
|
+
context.logger.warn(`You ran with best effort mode. Manually verify all code ` +
|
|
1485
|
+
`works as intended, and fix where necessary.`);
|
|
1486
|
+
}
|
|
1487
|
+
},
|
|
1488
|
+
});
|
|
1512
1489
|
};
|
|
1513
1490
|
}
|
|
1514
1491
|
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.6
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
11
|
-
var project_paths = require('./project_paths-CXXqWSoY.js');
|
|
12
|
-
require('os');
|
|
9
|
+
var checker = require('./checker-DoX_7XCa.js');
|
|
13
10
|
var ts = require('typescript');
|
|
14
|
-
|
|
15
|
-
var
|
|
11
|
+
require('os');
|
|
12
|
+
var index$1 = require('./index-B4b0V0Vo.js');
|
|
16
13
|
require('path');
|
|
17
|
-
var
|
|
18
|
-
var
|
|
14
|
+
var project_paths = require('./project_paths-C3etOlgT.js');
|
|
15
|
+
var apply_import_manager = require('./apply_import_manager-DFADpdFu.js');
|
|
16
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-DQVDid4G.js');
|
|
19
17
|
var assert = require('assert');
|
|
20
|
-
var index = require('./index-
|
|
18
|
+
var index = require('./index-CpZKzrqM.js');
|
|
21
19
|
require('@angular-devkit/core');
|
|
22
20
|
require('node:path/posix');
|
|
23
21
|
require('fs');
|
|
24
22
|
require('module');
|
|
25
23
|
require('url');
|
|
24
|
+
require('@angular-devkit/schematics');
|
|
25
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
26
26
|
require('./leading_space-D9nQ8UQC.js');
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -215,7 +215,14 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
215
215
|
// original type explicitly as generic. Otherwise, query API is smart
|
|
216
216
|
// enough to always infer.
|
|
217
217
|
resolvedReadType === null && type !== undefined ? [type] : undefined, args);
|
|
218
|
-
const
|
|
218
|
+
const accessibilityModifier = getAccessibilityModifier(node);
|
|
219
|
+
let modifiers = [
|
|
220
|
+
ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword),
|
|
221
|
+
];
|
|
222
|
+
if (accessibilityModifier) {
|
|
223
|
+
modifiers = [accessibilityModifier, ...modifiers];
|
|
224
|
+
}
|
|
225
|
+
const updated = ts.factory.createPropertyDeclaration(modifiers, node.name, undefined, undefined, call);
|
|
219
226
|
return [
|
|
220
227
|
new project_paths.Replacement(project_paths.projectFile(node.getSourceFile(), info), new project_paths.TextUpdate({
|
|
221
228
|
position: node.getStart(),
|
|
@@ -224,6 +231,11 @@ function computeReplacementsToMigrateQuery(node, metadata, importManager, info,
|
|
|
224
231
|
})),
|
|
225
232
|
];
|
|
226
233
|
}
|
|
234
|
+
function getAccessibilityModifier(node) {
|
|
235
|
+
return node.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.PublicKeyword ||
|
|
236
|
+
mod.kind === ts.SyntaxKind.PrivateKeyword ||
|
|
237
|
+
mod.kind === ts.SyntaxKind.ProtectedKeyword);
|
|
238
|
+
}
|
|
227
239
|
|
|
228
240
|
/**
|
|
229
241
|
* Attempts to get a class field descriptor if the given symbol
|
|
@@ -726,10 +738,10 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
726
738
|
if (templateTypeChecker !== null) {
|
|
727
739
|
templateTypeChecker.generateAllTypeCheckBlocks();
|
|
728
740
|
}
|
|
729
|
-
const { sourceFiles, program
|
|
730
|
-
const checker$1 = program
|
|
741
|
+
const { sourceFiles, program } = info;
|
|
742
|
+
const checker$1 = program.getTypeChecker();
|
|
731
743
|
const reflector = new checker.TypeScriptReflectionHost(checker$1);
|
|
732
|
-
const evaluator = new
|
|
744
|
+
const evaluator = new index$1.PartialEvaluator(reflector, checker$1, null);
|
|
733
745
|
const res = {
|
|
734
746
|
knownQueryFields: {},
|
|
735
747
|
potentialProblematicQueries: {},
|
|
@@ -914,10 +926,10 @@ class SignalQueriesMigration extends project_paths.TsurgeComplexMigration {
|
|
|
914
926
|
metaReader: null,
|
|
915
927
|
};
|
|
916
928
|
const resourceLoader = info.ngCompiler?.['resourceManager'] ?? null;
|
|
917
|
-
const { program
|
|
918
|
-
const checker$1 = program
|
|
929
|
+
const { program, sourceFiles } = info;
|
|
930
|
+
const checker$1 = program.getTypeChecker();
|
|
919
931
|
const reflector = new checker.TypeScriptReflectionHost(checker$1);
|
|
920
|
-
const evaluator = new
|
|
932
|
+
const evaluator = new index$1.PartialEvaluator(reflector, checker$1, null);
|
|
921
933
|
const replacements = [];
|
|
922
934
|
const importManager = new checker.ImportManager();
|
|
923
935
|
const printer = ts.createPrinter();
|
|
@@ -1106,84 +1118,61 @@ function updateFileState(stateMap, node, queryType) {
|
|
|
1106
1118
|
|
|
1107
1119
|
function migrate(options) {
|
|
1108
1120
|
return async (tree, context) => {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
+
await project_paths.runMigrationInDevkit({
|
|
1122
|
+
tree,
|
|
1123
|
+
getMigration: (fs) => new SignalQueriesMigration({
|
|
1124
|
+
bestEffortMode: options.bestEffortMode,
|
|
1125
|
+
insertTodosForSkippedFields: options.insertTodos,
|
|
1126
|
+
shouldMigrateQuery: (_query, file) => {
|
|
1127
|
+
return (file.rootRelativePath.startsWith(fs.normalize(options.path)) &&
|
|
1128
|
+
!/(^|\/)node_modules\//.test(file.rootRelativePath));
|
|
1129
|
+
},
|
|
1130
|
+
}),
|
|
1131
|
+
beforeProgramCreation: (tsconfigPath, stage) => {
|
|
1132
|
+
if (stage === project_paths.MigrationStage.Analysis) {
|
|
1133
|
+
context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
|
|
1134
|
+
}
|
|
1135
|
+
else {
|
|
1136
|
+
context.logger.info(`Running migration for: ${tsconfigPath}...`);
|
|
1137
|
+
}
|
|
1121
1138
|
},
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
const info = migration.prepareProgram(baseInfo);
|
|
1129
|
-
// Support restricting the analysis to subfolders for larger projects.
|
|
1130
|
-
if (analysisPath !== '/') {
|
|
1131
|
-
info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1132
|
-
info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1133
|
-
}
|
|
1134
|
-
return { info, tsconfigPath };
|
|
1135
|
-
});
|
|
1136
|
-
// Analyze phase. Treat all projects as compilation units as
|
|
1137
|
-
// this allows us to support references between those.
|
|
1138
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
1139
|
-
context.logger.info(`Scanning for queries: ${tsconfigPath}..`);
|
|
1140
|
-
unitResults.push(await migration.analyze(info));
|
|
1141
|
-
}
|
|
1142
|
-
context.logger.info(``);
|
|
1143
|
-
context.logger.info(`Processing analysis data between targets..`);
|
|
1144
|
-
context.logger.info(``);
|
|
1145
|
-
const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
|
|
1146
|
-
if (combined === null) {
|
|
1147
|
-
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
1148
|
-
return;
|
|
1149
|
-
}
|
|
1150
|
-
const globalMeta = await migration.globalMeta(combined);
|
|
1151
|
-
const replacementsPerFile = new Map();
|
|
1152
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
1153
|
-
context.logger.info(`Migrating: ${tsconfigPath}..`);
|
|
1154
|
-
const { replacements } = await migration.migrate(globalMeta, info);
|
|
1155
|
-
const changesPerFile = project_paths.groupReplacementsByFile(replacements);
|
|
1156
|
-
for (const [file, changes] of changesPerFile) {
|
|
1157
|
-
if (!replacementsPerFile.has(file)) {
|
|
1158
|
-
replacementsPerFile.set(file, changes);
|
|
1139
|
+
afterProgramCreation: (info, fs) => {
|
|
1140
|
+
const analysisPath = fs.resolve(options.analysisDir);
|
|
1141
|
+
// Support restricting the analysis to subfolders for larger projects.
|
|
1142
|
+
if (analysisPath !== '/') {
|
|
1143
|
+
info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1144
|
+
info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
1159
1145
|
}
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1146
|
+
},
|
|
1147
|
+
beforeUnitAnalysis: (tsconfigPath) => {
|
|
1148
|
+
context.logger.info(`Scanning for queries: ${tsconfigPath}...`);
|
|
1149
|
+
},
|
|
1150
|
+
afterAnalysisFailure: () => {
|
|
1151
|
+
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
1152
|
+
},
|
|
1153
|
+
afterAllAnalyzed: () => {
|
|
1154
|
+
context.logger.info(``);
|
|
1155
|
+
context.logger.info(`Processing analysis data between targets...`);
|
|
1156
|
+
context.logger.info(``);
|
|
1157
|
+
},
|
|
1158
|
+
whenDone: ({ counters }) => {
|
|
1159
|
+
context.logger.info('');
|
|
1160
|
+
context.logger.info(`Successfully migrated to signal queries 🎉`);
|
|
1161
|
+
const { queriesCount, incompatibleQueries } = counters;
|
|
1162
|
+
const migratedQueries = queriesCount - incompatibleQueries;
|
|
1163
|
+
context.logger.info('');
|
|
1164
|
+
context.logger.info(`Successfully migrated to signal queries 🎉`);
|
|
1165
|
+
context.logger.info(` -> Migrated ${migratedQueries}/${queriesCount} queries.`);
|
|
1166
|
+
if (incompatibleQueries > 0 && !options.insertTodos) {
|
|
1167
|
+
context.logger.warn(`To see why ${incompatibleQueries} queries couldn't be migrated`);
|
|
1168
|
+
context.logger.warn(`consider re-running with "--insert-todos" or "--best-effort-mode".`);
|
|
1169
|
+
}
|
|
1170
|
+
if (options.bestEffortMode) {
|
|
1171
|
+
context.logger.warn(`You ran with best effort mode. Manually verify all code ` +
|
|
1172
|
+
`works as intended, and fix where necessary.`);
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
});
|
|
1187
1176
|
};
|
|
1188
1177
|
}
|
|
1189
1178
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.6
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,22 +10,22 @@ var schematics = require('@angular-devkit/schematics');
|
|
|
10
10
|
var signalQueriesMigration = require('./signal-queries-migration.js');
|
|
11
11
|
var signalInputMigration = require('./signal-input-migration.js');
|
|
12
12
|
var outputMigration = require('./output-migration.js');
|
|
13
|
-
require('./
|
|
14
|
-
require('@angular-devkit/core');
|
|
15
|
-
require('./project_paths-CXXqWSoY.js');
|
|
16
|
-
require('node:path/posix');
|
|
17
|
-
require('os');
|
|
13
|
+
require('./checker-DoX_7XCa.js');
|
|
18
14
|
require('typescript');
|
|
19
|
-
require('
|
|
15
|
+
require('os');
|
|
20
16
|
require('fs');
|
|
21
17
|
require('module');
|
|
22
18
|
require('path');
|
|
23
19
|
require('url');
|
|
24
|
-
require('./
|
|
25
|
-
require('./
|
|
26
|
-
require('
|
|
20
|
+
require('./index-B4b0V0Vo.js');
|
|
21
|
+
require('./project_paths-C3etOlgT.js');
|
|
22
|
+
require('@angular-devkit/core');
|
|
23
|
+
require('node:path/posix');
|
|
24
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
25
|
+
require('./apply_import_manager-DFADpdFu.js');
|
|
26
|
+
require('./migrate_ts_type_references-DQVDid4G.js');
|
|
27
27
|
require('assert');
|
|
28
|
-
require('./index-
|
|
28
|
+
require('./index-CpZKzrqM.js');
|
|
29
29
|
require('./leading_space-D9nQ8UQC.js');
|
|
30
30
|
|
|
31
31
|
function migrate(options) {
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.6
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
|
-
require('./index-
|
|
10
|
+
var index = require('./index-B4b0V0Vo.js');
|
|
11
11
|
var fs = require('fs');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
var ts = require('typescript');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
14
|
+
var compiler_host = require('./compiler_host-BUKEE1cA.js');
|
|
15
15
|
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
16
16
|
var ng_decorators = require('./ng_decorators-DznZ5jMl.js');
|
|
17
17
|
var nodes = require('./nodes-B16H9JUd.js');
|
|
18
18
|
var imports = require('./imports-CIX-JgAN.js');
|
|
19
|
-
var checker = require('./checker-
|
|
19
|
+
var checker = require('./checker-DoX_7XCa.js');
|
|
20
20
|
require('os');
|
|
21
|
-
var program = require('./program-BmLi-Vxz.js');
|
|
22
21
|
require('@angular-devkit/core');
|
|
23
22
|
require('module');
|
|
24
23
|
require('url');
|
|
25
24
|
|
|
26
25
|
function createProgram({ rootNames, options, host, oldProgram, }) {
|
|
27
|
-
return new
|
|
26
|
+
return new index.NgtscProgram(rootNames, options, host, oldProgram);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/** Checks whether a node is referring to a specific import specifier. */
|