@angular/core 19.2.0-next.3 → 19.2.0-rc.0
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 +973 -988
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +5 -5
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +4 -4
- package/index.d.ts +68 -35
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +2 -2
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/apply_import_manager-a930fcf1.js +71 -0
- package/schematics/bundles/{checker-32db85a6.js → checker-2eecc677.js} +17 -16
- package/schematics/bundles/cleanup-unused-imports.js +16 -15
- package/schematics/bundles/{compiler_host-540e221c.js → compiler_host-c280a924.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-abe29092.js +1 -1
- package/schematics/bundles/{index-d5020c9c.js → index-24a2ad1e.js} +9 -9
- package/schematics/bundles/{index-7ee8967e.js → index-3891dd55.js} +4 -4
- package/schematics/bundles/inject-migration.js +8 -7
- package/schematics/bundles/leading_space-d190b83b.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-26986908.js → migrate_ts_type_references-71b3a951.js} +20 -20
- package/schematics/bundles/{nodes-a9f0b985.js → ng_decorators-e699c081.js} +1 -14
- package/schematics/bundles/nodes-a535b2be.js +27 -0
- package/schematics/bundles/output-migration.js +21 -20
- package/schematics/bundles/pending-tasks.js +3 -3
- package/schematics/bundles/{program-507de2f1.js → program-24da9092.js} +90 -45
- package/schematics/bundles/{apply_import_manager-f4d044b2.js → project_paths-b073c4d6.js} +3 -57
- package/schematics/bundles/project_tsconfig_paths-e9ccccbf.js +1 -1
- package/schematics/bundles/property_name-7c8433f5.js +31 -0
- package/schematics/bundles/provide-initializer.js +3 -3
- package/schematics/bundles/route-lazy-loading.js +8 -12
- package/schematics/bundles/self-closing-tags-migration.js +448 -0
- package/schematics/bundles/signal-input-migration.js +20 -19
- package/schematics/bundles/signal-queries-migration.js +26 -25
- package/schematics/bundles/signals.js +7 -6
- package/schematics/bundles/standalone-migration.js +12 -11
- package/schematics/collection.json +6 -0
- package/schematics/ng-generate/self-closing-tags-migration/schema.json +14 -0
- package/testing/index.d.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -2942,10 +2942,6 @@ class Identifiers {
|
|
|
2942
2942
|
name: 'ɵɵHostDirectivesFeature',
|
|
2943
2943
|
moduleName: CORE,
|
|
2944
2944
|
};
|
|
2945
|
-
static InputTransformsFeatureFeature = {
|
|
2946
|
-
name: 'ɵɵInputTransformsFeature',
|
|
2947
|
-
moduleName: CORE,
|
|
2948
|
-
};
|
|
2949
2945
|
static ExternalStylesFeature = {
|
|
2950
2946
|
name: 'ɵɵExternalStylesFeature',
|
|
2951
2947
|
moduleName: CORE,
|
|
@@ -28747,7 +28743,6 @@ function addFeatures(definitionMap, meta) {
|
|
|
28747
28743
|
const features = [];
|
|
28748
28744
|
const providers = meta.providers;
|
|
28749
28745
|
const viewProviders = meta.viewProviders;
|
|
28750
|
-
const inputKeys = Object.keys(meta.inputs);
|
|
28751
28746
|
if (providers || viewProviders) {
|
|
28752
28747
|
const args = [providers || new LiteralArrayExpr([])];
|
|
28753
28748
|
if (viewProviders) {
|
|
@@ -28755,12 +28750,6 @@ function addFeatures(definitionMap, meta) {
|
|
|
28755
28750
|
}
|
|
28756
28751
|
features.push(importExpr(Identifiers.ProvidersFeature).callFn(args));
|
|
28757
28752
|
}
|
|
28758
|
-
for (const key of inputKeys) {
|
|
28759
|
-
if (meta.inputs[key].transformFunction !== null) {
|
|
28760
|
-
features.push(importExpr(Identifiers.InputTransformsFeatureFeature));
|
|
28761
|
-
break;
|
|
28762
|
-
}
|
|
28763
|
-
}
|
|
28764
28753
|
// Note: host directives feature needs to be inserted before the
|
|
28765
28754
|
// inheritance feature to ensure the correct execution order.
|
|
28766
28755
|
if (meta.hostDirectives?.length) {
|
|
@@ -30733,7 +30722,7 @@ function publishFacade(global) {
|
|
|
30733
30722
|
* @description
|
|
30734
30723
|
* Entry point for all public APIs of the compiler package.
|
|
30735
30724
|
*/
|
|
30736
|
-
new Version('19.2.0-
|
|
30725
|
+
new Version('19.2.0-rc.0');
|
|
30737
30726
|
|
|
30738
30727
|
const _I18N_ATTR = 'i18n';
|
|
30739
30728
|
const _I18N_ATTR_PREFIX = 'i18n-';
|
|
@@ -32141,7 +32130,7 @@ class NodeJSPathManipulation {
|
|
|
32141
32130
|
// G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
|
|
32142
32131
|
// CommonJS/ESM interop for determining the current file name and containing dir.
|
|
32143
32132
|
const isCommonJS = typeof __filename !== 'undefined';
|
|
32144
|
-
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('checker-
|
|
32133
|
+
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('checker-2eecc677.js', document.baseURI).href));
|
|
32145
32134
|
const currentFileName = isCommonJS ? __filename : url.fileURLToPath(currentFileUrl);
|
|
32146
32135
|
/**
|
|
32147
32136
|
* A wrapper around the Node.js file-system that supports readonly operations and path manipulation.
|
|
@@ -32771,6 +32760,11 @@ const patchedReferencedAliasesSymbol = Symbol('patchedReferencedAliases');
|
|
|
32771
32760
|
* that have been referenced in a value-position by the transform, such the installed patch can
|
|
32772
32761
|
* ensure that those import declarations are not elided.
|
|
32773
32762
|
*
|
|
32763
|
+
* If `null` is returned then the transform operates in an isolated context, i.e. using the
|
|
32764
|
+
* `ts.transform` API. In such scenario there is no information whether an alias declaration
|
|
32765
|
+
* is referenced, so all alias declarations are naturally preserved and explicitly registering
|
|
32766
|
+
* an alias declaration as used isn't necessary.
|
|
32767
|
+
*
|
|
32774
32768
|
* See below. Note that this uses sourcegraph as the TypeScript checker file doesn't display on
|
|
32775
32769
|
* Github.
|
|
32776
32770
|
* https://sourcegraph.com/github.com/microsoft/TypeScript@3eaa7c65f6f076a08a5f7f1946fd0df7c7430259/-/blob/src/compiler/checker.ts#L31219-31257
|
|
@@ -32782,6 +32776,11 @@ function loadIsReferencedAliasDeclarationPatch(context) {
|
|
|
32782
32776
|
throwIncompatibleTransformationContextError();
|
|
32783
32777
|
}
|
|
32784
32778
|
const emitResolver = context.getEmitResolver();
|
|
32779
|
+
if (emitResolver === undefined) {
|
|
32780
|
+
// In isolated `ts.transform` operations no emit resolver is present, return null as `isReferencedAliasDeclaration`
|
|
32781
|
+
// will never be invoked.
|
|
32782
|
+
return null;
|
|
32783
|
+
}
|
|
32785
32784
|
// The emit resolver may have been patched already, in which case we return the set of referenced
|
|
32786
32785
|
// aliases that was created when the patch was first applied.
|
|
32787
32786
|
// See https://github.com/angular/angular/issues/40276.
|
|
@@ -32907,7 +32906,7 @@ class DefaultImportTracker {
|
|
|
32907
32906
|
if (clausesToPreserve === null) {
|
|
32908
32907
|
clausesToPreserve = loadIsReferencedAliasDeclarationPatch(context);
|
|
32909
32908
|
}
|
|
32910
|
-
clausesToPreserve
|
|
32909
|
+
clausesToPreserve?.add(clause);
|
|
32911
32910
|
}
|
|
32912
32911
|
}
|
|
32913
32912
|
return sourceFile;
|
|
@@ -36104,7 +36103,9 @@ function createTsTransformForImportManager(manager, extraStatementsForFiles) {
|
|
|
36104
36103
|
// doesn't drop these thinking they are unused.
|
|
36105
36104
|
if (reusedOriginalAliasDeclarations.size > 0) {
|
|
36106
36105
|
const referencedAliasDeclarations = loadIsReferencedAliasDeclarationPatch(ctx);
|
|
36107
|
-
|
|
36106
|
+
if (referencedAliasDeclarations !== null) {
|
|
36107
|
+
reusedOriginalAliasDeclarations.forEach((aliasDecl) => referencedAliasDeclarations.add(aliasDecl));
|
|
36108
|
+
}
|
|
36108
36109
|
}
|
|
36109
36110
|
// Update the set of affected files to include files that need extra statements to be inserted.
|
|
36110
36111
|
if (extraStatementsForFiles !== undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,13 +10,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
|
|
13
|
-
var
|
|
13
|
+
var project_paths = require('./project_paths-b073c4d6.js');
|
|
14
14
|
require('os');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var checker = require('./checker-
|
|
17
|
-
var program = require('./program-
|
|
16
|
+
var checker = require('./checker-2eecc677.js');
|
|
17
|
+
var program = require('./program-24da9092.js');
|
|
18
18
|
require('path');
|
|
19
|
-
require('./index-
|
|
19
|
+
require('./index-3891dd55.js');
|
|
20
|
+
var apply_import_manager = require('./apply_import_manager-a930fcf1.js');
|
|
20
21
|
require('@angular-devkit/core');
|
|
21
22
|
require('node:path/posix');
|
|
22
23
|
require('fs');
|
|
@@ -28,7 +29,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
28
29
|
var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
|
|
29
30
|
|
|
30
31
|
/** Migration that cleans up unused imports from a project. */
|
|
31
|
-
class UnusedImportsMigration extends
|
|
32
|
+
class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
32
33
|
printer = ts__default["default"].createPrinter();
|
|
33
34
|
createProgram(tsconfigAbsPath, fs) {
|
|
34
35
|
return super.createProgram(tsconfigAbsPath, fs, {
|
|
@@ -67,10 +68,10 @@ class UnusedImportsMigration extends apply_import_manager.TsurgeFunnelMigration
|
|
|
67
68
|
}
|
|
68
69
|
this.generateReplacements(sourceFile, resolvedLocations, usageAnalysis, info, replacements);
|
|
69
70
|
});
|
|
70
|
-
return
|
|
71
|
+
return project_paths.confirmAsSerializable({ replacements, removedIdentifiers, changedFiles });
|
|
71
72
|
}
|
|
72
73
|
async migrate(globalData) {
|
|
73
|
-
return
|
|
74
|
+
return project_paths.confirmAsSerializable(globalData);
|
|
74
75
|
}
|
|
75
76
|
async combine(unitA, unitB) {
|
|
76
77
|
const combinedReplacements = [];
|
|
@@ -94,14 +95,14 @@ class UnusedImportsMigration extends apply_import_manager.TsurgeFunnelMigration
|
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
|
-
return
|
|
98
|
+
return project_paths.confirmAsSerializable({
|
|
98
99
|
replacements: combinedReplacements,
|
|
99
100
|
removedIdentifiers: combinedRemovedIdentifiers,
|
|
100
101
|
changedFiles: changedFileIds.size,
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
104
|
async globalMeta(combinedData) {
|
|
104
|
-
return
|
|
105
|
+
return project_paths.confirmAsSerializable(combinedData);
|
|
105
106
|
}
|
|
106
107
|
async stats(globalMetadata) {
|
|
107
108
|
return {
|
|
@@ -228,7 +229,7 @@ class UnusedImportsMigration extends apply_import_manager.TsurgeFunnelMigration
|
|
|
228
229
|
const importManager = new checker.ImportManager();
|
|
229
230
|
// Replace full arrays with empty ones. This allows preserves more of the user's formatting.
|
|
230
231
|
fullRemovals.forEach((node) => {
|
|
231
|
-
replacements.push(new
|
|
232
|
+
replacements.push(new project_paths.Replacement(project_paths.projectFile(sourceFile, info), new project_paths.TextUpdate({
|
|
232
233
|
position: node.getStart(),
|
|
233
234
|
end: node.getEnd(),
|
|
234
235
|
toInsert: '[]',
|
|
@@ -237,7 +238,7 @@ class UnusedImportsMigration extends apply_import_manager.TsurgeFunnelMigration
|
|
|
237
238
|
// Filter out the unused identifiers from an array.
|
|
238
239
|
partialRemovals.forEach((toRemove, node) => {
|
|
239
240
|
const newNode = ts__default["default"].factory.updateArrayLiteralExpression(node, node.elements.filter((el) => !toRemove.has(el)));
|
|
240
|
-
replacements.push(new
|
|
241
|
+
replacements.push(new project_paths.Replacement(project_paths.projectFile(sourceFile, info), new project_paths.TextUpdate({
|
|
241
242
|
position: node.getStart(),
|
|
242
243
|
end: node.getEnd(),
|
|
243
244
|
toInsert: this.printer.printNode(ts__default["default"].EmitHint.Unspecified, newNode, sourceFile),
|
|
@@ -273,7 +274,7 @@ function migrate() {
|
|
|
273
274
|
if (!buildPaths.length && !testPaths.length) {
|
|
274
275
|
throw new schematics.SchematicsException('Could not find any tsconfig file. Cannot clean up unused imports.');
|
|
275
276
|
}
|
|
276
|
-
const fs = new
|
|
277
|
+
const fs = new project_paths.DevkitMigrationFilesystem(tree);
|
|
277
278
|
checker.setFileSystem(fs);
|
|
278
279
|
const migration = new UnusedImportsMigration();
|
|
279
280
|
const unitResults = [];
|
|
@@ -287,7 +288,7 @@ function migrate() {
|
|
|
287
288
|
context.logger.info(`Scanning for unused imports using ${tsconfigPath}`);
|
|
288
289
|
unitResults.push(await migration.analyze(info));
|
|
289
290
|
}
|
|
290
|
-
const combined = await
|
|
291
|
+
const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
|
|
291
292
|
if (combined === null) {
|
|
292
293
|
context.logger.error('Schematic failed unexpectedly with no analysis data');
|
|
293
294
|
return;
|
|
@@ -295,7 +296,7 @@ function migrate() {
|
|
|
295
296
|
const globalMeta = await migration.globalMeta(combined);
|
|
296
297
|
const replacementsPerFile = new Map();
|
|
297
298
|
const { replacements } = await migration.migrate(globalMeta);
|
|
298
|
-
const changesPerFile =
|
|
299
|
+
const changesPerFile = project_paths.groupReplacementsByFile(replacements);
|
|
299
300
|
for (const [file, changes] of changesPerFile) {
|
|
300
301
|
if (!replacementsPerFile.has(file)) {
|
|
301
302
|
replacementsPerFile.set(file, changes);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
|
-
var checker = require('./checker-
|
|
10
|
+
var checker = require('./checker-2eecc677.js');
|
|
11
11
|
require('os');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,8 +10,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
|
-
var compiler_host = require('./compiler_host-
|
|
14
|
-
var checker = require('./checker-
|
|
13
|
+
var compiler_host = require('./compiler_host-c280a924.js');
|
|
14
|
+
var checker = require('./checker-2eecc677.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
16
|
require('os');
|
|
17
17
|
require('fs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
14
|
+
var compiler_host = require('./compiler_host-c280a924.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
16
|
var imports = require('./imports-abe29092.js');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
|
-
require('./checker-
|
|
18
|
+
require('./checker-2eecc677.js');
|
|
19
19
|
require('os');
|
|
20
20
|
require('fs');
|
|
21
21
|
require('module');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var program = require('./program-
|
|
11
|
+
var checker = require('./checker-2eecc677.js');
|
|
12
|
+
var program = require('./program-24da9092.js');
|
|
13
13
|
require('path');
|
|
14
|
-
var
|
|
14
|
+
var project_paths = require('./project_paths-b073c4d6.js');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
17
|
|
|
@@ -615,7 +615,7 @@ function identifyHostBindingReferences(node, programInfo, checker$1, reflector,
|
|
|
615
615
|
readAstPath: ref.readAstPath,
|
|
616
616
|
isObjectShorthandExpression: ref.isObjectShorthandExpression,
|
|
617
617
|
isWrite: ref.isWrite,
|
|
618
|
-
file:
|
|
618
|
+
file: project_paths.projectFile(ref.context.getSourceFile(), programInfo),
|
|
619
619
|
hostPropertyNode: ref.context,
|
|
620
620
|
},
|
|
621
621
|
target: ref.targetField,
|
|
@@ -715,8 +715,8 @@ function identifyTemplateReferences(programInfo, node, reflector, checker$1, eva
|
|
|
715
715
|
readAstPath: res.readAstPath,
|
|
716
716
|
node: res.context,
|
|
717
717
|
isObjectShorthandExpression: res.isObjectShorthandExpression,
|
|
718
|
-
originatingTsFile:
|
|
719
|
-
templateFile:
|
|
718
|
+
originatingTsFile: project_paths.projectFile(node.getSourceFile(), programInfo),
|
|
719
|
+
templateFile: project_paths.projectFile(checker.absoluteFrom(templateFilePath), programInfo),
|
|
720
720
|
isLikelyPartOfNarrowing: res.isLikelyNarrowed,
|
|
721
721
|
isWrite: res.isWrite,
|
|
722
722
|
},
|
|
@@ -898,7 +898,7 @@ function identifyPotentialTypeScriptReference(node, programInfo, checker, knownF
|
|
|
898
898
|
kind: exports.ReferenceKind.TsReference,
|
|
899
899
|
from: {
|
|
900
900
|
node,
|
|
901
|
-
file:
|
|
901
|
+
file: project_paths.projectFile(node.getSourceFile(), programInfo),
|
|
902
902
|
isWrite: isWriteReference,
|
|
903
903
|
isPartOfElementBinding: ts__default["default"].isBindingElement(node.parent),
|
|
904
904
|
},
|
|
@@ -962,7 +962,7 @@ function createFindAllSourceFileReferencesVisitor(programInfo, checker, reflecto
|
|
|
962
962
|
result.references.push({
|
|
963
963
|
kind: exports.ReferenceKind.TsClassTypeReference,
|
|
964
964
|
from: {
|
|
965
|
-
file:
|
|
965
|
+
file: project_paths.projectFile(partialDirectiveInCatalyst.referenceNode.getSourceFile(), programInfo),
|
|
966
966
|
node: partialDirectiveInCatalyst.referenceNode,
|
|
967
967
|
},
|
|
968
968
|
isPartialReference: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
require('os');
|
|
10
10
|
require('typescript');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
require('./program-
|
|
11
|
+
var checker = require('./checker-2eecc677.js');
|
|
12
|
+
require('./program-24da9092.js');
|
|
13
13
|
require('path');
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -17,7 +17,7 @@ require('path');
|
|
|
17
17
|
* @description
|
|
18
18
|
* Entry point for all public APIs of the compiler-cli package.
|
|
19
19
|
*/
|
|
20
|
-
new checker.Version('19.2.0-
|
|
20
|
+
new checker.Version('19.2.0-rc.0');
|
|
21
21
|
|
|
22
22
|
var LogLevel;
|
|
23
23
|
(function (LogLevel) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,12 +10,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
+
var compiler_host = require('./compiler_host-c280a924.js');
|
|
14
14
|
var ts = require('typescript');
|
|
15
|
-
var
|
|
15
|
+
var ng_decorators = require('./ng_decorators-e699c081.js');
|
|
16
16
|
var imports = require('./imports-abe29092.js');
|
|
17
|
+
var nodes = require('./nodes-a535b2be.js');
|
|
17
18
|
var leading_space = require('./leading_space-d190b83b.js');
|
|
18
|
-
require('./checker-
|
|
19
|
+
require('./checker-2eecc677.js');
|
|
19
20
|
require('os');
|
|
20
21
|
require('fs');
|
|
21
22
|
require('module');
|
|
@@ -125,7 +126,7 @@ function analyzeFile(sourceFile, localTypeChecker, options) {
|
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
else if (ts__default["default"].isClassDeclaration(node)) {
|
|
128
|
-
const decorators =
|
|
129
|
+
const decorators = ng_decorators.getAngularDecorators(localTypeChecker, ts__default["default"].getDecorators(node) || []);
|
|
129
130
|
const isAbstract = !!node.modifiers?.some((m) => m.kind === ts__default["default"].SyntaxKind.AbstractKeyword);
|
|
130
131
|
const supportsDI = decorators.some((dec) => DECORATORS_SUPPORTING_DI.has(dec.name));
|
|
131
132
|
const constructorNode = node.members.find((member) => ts__default["default"].isConstructorDeclaration(member) &&
|
|
@@ -138,7 +139,7 @@ function analyzeFile(sourceFile, localTypeChecker, options) {
|
|
|
138
139
|
if (!param.type || !UNINJECTABLE_TYPE_KINDS.has(param.type.kind)) {
|
|
139
140
|
return true;
|
|
140
141
|
}
|
|
141
|
-
return
|
|
142
|
+
return ng_decorators.getAngularDecorators(localTypeChecker, ts__default["default"].getDecorators(param) || []).some((dec) => dec.name === 'Inject' || dec.name === 'Attribute');
|
|
142
143
|
});
|
|
143
144
|
// Don't migrate abstract classes by default, because
|
|
144
145
|
// their parameters aren't guaranteed to be injectable.
|
|
@@ -822,7 +823,7 @@ function migrateParameter(node, options, localTypeChecker, printer, tracker, sup
|
|
|
822
823
|
function createInjectReplacementCall(param, options, localTypeChecker, printer, tracker) {
|
|
823
824
|
const moduleName = '@angular/core';
|
|
824
825
|
const sourceFile = param.getSourceFile();
|
|
825
|
-
const decorators =
|
|
826
|
+
const decorators = ng_decorators.getAngularDecorators(localTypeChecker, ts__default["default"].getDecorators(param) || []);
|
|
826
827
|
const literalProps = [];
|
|
827
828
|
const type = param.type;
|
|
828
829
|
let injectedType = '';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-2eecc677.js');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
12
|
var assert = require('assert');
|
|
13
|
-
var index = require('./index-
|
|
14
|
-
var
|
|
13
|
+
var index = require('./index-24a2ad1e.js');
|
|
14
|
+
var project_paths = require('./project_paths-b073c4d6.js');
|
|
15
15
|
var leading_space = require('./leading_space-d190b83b.js');
|
|
16
|
-
require('./program-
|
|
16
|
+
require('./program-24da9092.js');
|
|
17
17
|
require('path');
|
|
18
18
|
|
|
19
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -915,7 +915,7 @@ function removeFromUnionIfPossible(union, filter) {
|
|
|
915
915
|
*/
|
|
916
916
|
function insertPrecedingLine(node, info, text) {
|
|
917
917
|
const leadingSpace = leading_space.getLeadingLineWhitespaceOfNode(node);
|
|
918
|
-
return new
|
|
918
|
+
return new project_paths.Replacement(project_paths.projectFile(node.getSourceFile(), info), new project_paths.TextUpdate({
|
|
919
919
|
position: node.getStart(),
|
|
920
920
|
end: node.getStart(),
|
|
921
921
|
toInsert: `${text}\n${leadingSpace}`,
|
|
@@ -1256,20 +1256,20 @@ function createNewBlockToInsertVariable(node, file, toInsert) {
|
|
|
1256
1256
|
const contentSpace = ' '.repeat(character + 2);
|
|
1257
1257
|
return [
|
|
1258
1258
|
// Delete leading whitespace of the concise body.
|
|
1259
|
-
new
|
|
1259
|
+
new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
1260
1260
|
position: node.body.getFullStart(),
|
|
1261
1261
|
end: node.body.getStart(),
|
|
1262
1262
|
toInsert: '',
|
|
1263
1263
|
})),
|
|
1264
1264
|
// Insert leading block braces, and `toInsert` content.
|
|
1265
1265
|
// Wrap the previous expression in a return now.
|
|
1266
|
-
new
|
|
1266
|
+
new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
1267
1267
|
position: node.body.getStart(),
|
|
1268
1268
|
end: node.body.getStart(),
|
|
1269
1269
|
toInsert: ` {\n${contentSpace}${toInsert}\n${contentSpace}return `,
|
|
1270
1270
|
})),
|
|
1271
1271
|
// Add trailing brace.
|
|
1272
|
-
new
|
|
1272
|
+
new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
1273
1273
|
position: node.body.getEnd(),
|
|
1274
1274
|
end: node.body.getEnd(),
|
|
1275
1275
|
toInsert: `;\n${blockSpace}}`,
|
|
@@ -1299,7 +1299,7 @@ function migrateBindingElementInputReference(tsReferencesInBindingElements, info
|
|
|
1299
1299
|
const bindingElement = reference.parent;
|
|
1300
1300
|
const bindingDecl = index.getBindingElementDeclaration(bindingElement);
|
|
1301
1301
|
const sourceFile = bindingElement.getSourceFile();
|
|
1302
|
-
const file =
|
|
1302
|
+
const file = project_paths.projectFile(sourceFile, info);
|
|
1303
1303
|
const inputFieldName = bindingElement.propertyName ?? bindingElement.name;
|
|
1304
1304
|
assert__default["default"](!ts__default["default"].isObjectBindingPattern(inputFieldName) && !ts__default["default"].isArrayBindingPattern(inputFieldName), 'Property of binding element cannot be another pattern.');
|
|
1305
1305
|
const tmpName = nameGenerator.generate(reference.text, bindingElement);
|
|
@@ -1317,7 +1317,7 @@ function migrateBindingElementInputReference(tsReferencesInBindingElements, info
|
|
|
1317
1317
|
console.error(`Could not migrate reference ${reference.text} in ${file.rootRelativePath}`);
|
|
1318
1318
|
continue;
|
|
1319
1319
|
}
|
|
1320
|
-
replacements.push(new
|
|
1320
|
+
replacements.push(new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
1321
1321
|
position: bindingElement.getStart(),
|
|
1322
1322
|
end: bindingElement.getEnd(),
|
|
1323
1323
|
toInsert: printer.printNode(ts__default["default"].EmitHint.Unspecified, newBindingToAccessInputField, sourceFile),
|
|
@@ -1342,7 +1342,7 @@ function insertTemporaryVariableForBindingElement(expansionDecl, file, toInsert)
|
|
|
1342
1342
|
const leadingSpace = ' '.repeat(leadingSpaceCount);
|
|
1343
1343
|
const statement = parent.parent;
|
|
1344
1344
|
return [
|
|
1345
|
-
new
|
|
1345
|
+
new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
1346
1346
|
position: statement.getEnd(),
|
|
1347
1347
|
end: statement.getEnd(),
|
|
1348
1348
|
toInsert: `\n${leadingSpace}${toInsert}`,
|
|
@@ -1360,7 +1360,7 @@ function insertTemporaryVariableForBindingElement(expansionDecl, file, toInsert)
|
|
|
1360
1360
|
const leadingSpaceCount = ts__default["default"].getLineAndCharacterOfPosition(sf, spaceReferenceNode.getStart()).character + spaceOffset;
|
|
1361
1361
|
const leadingSpace = ' '.repeat(leadingSpaceCount);
|
|
1362
1362
|
return [
|
|
1363
|
-
new
|
|
1363
|
+
new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
1364
1364
|
position: bodyBlock.getStart() + 1,
|
|
1365
1365
|
end: bodyBlock.getStart() + 1,
|
|
1366
1366
|
toInsert: `\n${leadingSpace}${toInsert}`,
|
|
@@ -1761,7 +1761,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1761
1761
|
// Unwrap the signal directly.
|
|
1762
1762
|
if (recommendedNode === 'preserve') {
|
|
1763
1763
|
// Append `()` to unwrap the signal.
|
|
1764
|
-
replacements.push(new
|
|
1764
|
+
replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
|
|
1765
1765
|
position: originalNode.getEnd(),
|
|
1766
1766
|
end: originalNode.getEnd(),
|
|
1767
1767
|
toInsert: '()',
|
|
@@ -1775,7 +1775,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1775
1775
|
const toInsert = idToSharedField.get(recommendedNode);
|
|
1776
1776
|
const replaceNode = index.traverseAccess(originalNode);
|
|
1777
1777
|
assert__default["default"](toInsert, 'no shared variable yet available');
|
|
1778
|
-
replacements.push(new
|
|
1778
|
+
replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
|
|
1779
1779
|
position: replaceNode.getStart(),
|
|
1780
1780
|
end: replaceNode.getEnd(),
|
|
1781
1781
|
toInsert,
|
|
@@ -1795,7 +1795,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1795
1795
|
parent = parent.parent;
|
|
1796
1796
|
}
|
|
1797
1797
|
const replaceNode = index.traverseAccess(originalNode);
|
|
1798
|
-
const filePath =
|
|
1798
|
+
const filePath = project_paths.projectFile(sf, info);
|
|
1799
1799
|
const initializer = `${replaceNode.getText()}()`;
|
|
1800
1800
|
const fieldName = nameGenerator.generate(originalNode.text, referenceNodeInBlock);
|
|
1801
1801
|
let sharedValueAccessExpr;
|
|
@@ -1817,13 +1817,13 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1817
1817
|
}
|
|
1818
1818
|
else {
|
|
1819
1819
|
const leadingSpace = ts__default["default"].getLineAndCharacterOfPosition(sf, referenceNodeInBlock.getStart());
|
|
1820
|
-
replacements.push(new
|
|
1820
|
+
replacements.push(new project_paths.Replacement(filePath, new project_paths.TextUpdate({
|
|
1821
1821
|
position: referenceNodeInBlock.getStart(),
|
|
1822
1822
|
end: referenceNodeInBlock.getStart(),
|
|
1823
1823
|
toInsert: `${temporaryVariableStr}\n${' '.repeat(leadingSpace.character)}`,
|
|
1824
1824
|
})));
|
|
1825
1825
|
}
|
|
1826
|
-
replacements.push(new
|
|
1826
|
+
replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
|
|
1827
1827
|
position: replaceNode.getStart(),
|
|
1828
1828
|
end: replaceNode.getEnd(),
|
|
1829
1829
|
toInsert: sharedValueAccessExpr,
|
|
@@ -1932,12 +1932,12 @@ function migrateTypeScriptTypeReferences(host, references, importManager, info)
|
|
|
1932
1932
|
exportSymbolName: 'UnwrapSignalInputs',
|
|
1933
1933
|
requestedFile: sf,
|
|
1934
1934
|
});
|
|
1935
|
-
host.replacements.push(new
|
|
1935
|
+
host.replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
|
|
1936
1936
|
position: firstArg.getStart(),
|
|
1937
1937
|
end: firstArg.getStart(),
|
|
1938
1938
|
toInsert: `${host.printer.printNode(ts__default["default"].EmitHint.Unspecified, unwrapImportExpr, sf)}<`,
|
|
1939
1939
|
})));
|
|
1940
|
-
host.replacements.push(new
|
|
1940
|
+
host.replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({ position: firstArg.getEnd(), end: firstArg.getEnd(), toInsert: '>' })));
|
|
1941
1941
|
}
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.0-
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -40,17 +40,4 @@ function getAngularDecorators(typeChecker, decorators) {
|
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
/** Find the closest parent node of a particular kind. */
|
|
44
|
-
function closestNode(node, predicate) {
|
|
45
|
-
let current = node.parent;
|
|
46
|
-
while (current && !ts__default["default"].isSourceFile(current)) {
|
|
47
|
-
if (predicate(current)) {
|
|
48
|
-
return current;
|
|
49
|
-
}
|
|
50
|
-
current = current.parent;
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
exports.closestNode = closestNode;
|
|
56
43
|
exports.getAngularDecorators = getAngularDecorators;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* @license Angular v19.2.0-rc.0
|
|
4
|
+
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
var ts = require('typescript');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
|
|
14
|
+
|
|
15
|
+
/** Find the closest parent node of a particular kind. */
|
|
16
|
+
function closestNode(node, predicate) {
|
|
17
|
+
let current = node.parent;
|
|
18
|
+
while (current && !ts__default["default"].isSourceFile(current)) {
|
|
19
|
+
if (predicate(current)) {
|
|
20
|
+
return current;
|
|
21
|
+
}
|
|
22
|
+
current = current.parent;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.closestNode = closestNode;
|