@angular/core 15.1.0-next.3 → 15.1.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.
Files changed (74) hide show
  1. package/esm2020/src/application_ref.mjs +2 -2
  2. package/esm2020/src/di/injector_compatibility.mjs +2 -2
  3. package/esm2020/src/errors.mjs +1 -1
  4. package/esm2020/src/linker/view_ref.mjs +1 -1
  5. package/esm2020/src/render3/i18n/i18n_parse.mjs +17 -2
  6. package/esm2020/src/util/global.mjs +1 -1
  7. package/esm2020/src/version.mjs +1 -1
  8. package/esm2020/testing/src/component_fixture.mjs +1 -1
  9. package/esm2020/testing/src/logger.mjs +7 -7
  10. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  11. package/fesm2015/core.mjs +101 -1558
  12. package/fesm2015/core.mjs.map +1 -1
  13. package/fesm2015/testing.mjs +78 -1333
  14. package/fesm2015/testing.mjs.map +1 -1
  15. package/fesm2020/core.mjs +103 -1582
  16. package/fesm2020/core.mjs.map +1 -1
  17. package/fesm2020/testing.mjs +80 -1357
  18. package/fesm2020/testing.mjs.map +1 -1
  19. package/index.d.ts +3 -3
  20. package/package.json +1 -1
  21. package/schematics/migrations/relative-link-resolution/bundle.js +265 -0
  22. package/schematics/migrations/relative-link-resolution/bundle.js.map +7 -0
  23. package/schematics/migrations/relative-link-resolution/bundle_metadata.json +1 -0
  24. package/schematics/migrations/router-link-with-href/bundle.js +350 -0
  25. package/schematics/migrations/router-link-with-href/bundle.js.map +7 -0
  26. package/schematics/migrations/router-link-with-href/bundle_metadata.json +1 -0
  27. package/schematics/migrations.json +2 -2
  28. package/testing/index.d.ts +1 -1
  29. package/esm2020/src/render3/util/debug_utils.mjs +0 -40
  30. package/esm2020/testing/src/lang_utils.mjs +0 -14
  31. package/schematics/migrations/relative-link-resolution/index.d.ts +0 -10
  32. package/schematics/migrations/relative-link-resolution/index.js +0 -68
  33. package/schematics/migrations/relative-link-resolution/util.d.ts +0 -20
  34. package/schematics/migrations/relative-link-resolution/util.js +0 -82
  35. package/schematics/migrations/router-link-with-href/index.d.ts +0 -10
  36. package/schematics/migrations/router-link-with-href/index.js +0 -70
  37. package/schematics/migrations/router-link-with-href/util.d.ts +0 -19
  38. package/schematics/migrations/router-link-with-href/util.js +0 -111
  39. package/schematics/utils/import_manager.d.ts +0 -57
  40. package/schematics/utils/import_manager.js +0 -234
  41. package/schematics/utils/line_mappings.d.ts +0 -18
  42. package/schematics/utils/line_mappings.js +0 -75
  43. package/schematics/utils/load_esm.d.ts +0 -32
  44. package/schematics/utils/load_esm.js +0 -79
  45. package/schematics/utils/ng_component_template.d.ts +0 -44
  46. package/schematics/utils/ng_component_template.js +0 -131
  47. package/schematics/utils/ng_decorators.d.ts +0 -23
  48. package/schematics/utils/ng_decorators.js +0 -37
  49. package/schematics/utils/parse_html.d.ts +0 -14
  50. package/schematics/utils/parse_html.js +0 -37
  51. package/schematics/utils/project_tsconfig_paths.d.ts +0 -17
  52. package/schematics/utils/project_tsconfig_paths.js +0 -122
  53. package/schematics/utils/template_ast_visitor.d.ts +0 -55
  54. package/schematics/utils/template_ast_visitor.js +0 -73
  55. package/schematics/utils/typescript/class_declaration.d.ts +0 -15
  56. package/schematics/utils/typescript/class_declaration.js +0 -52
  57. package/schematics/utils/typescript/compiler_host.d.ts +0 -34
  58. package/schematics/utils/typescript/compiler_host.js +0 -85
  59. package/schematics/utils/typescript/decorators.d.ts +0 -11
  60. package/schematics/utils/typescript/decorators.js +0 -37
  61. package/schematics/utils/typescript/find_base_classes.d.ts +0 -14
  62. package/schematics/utils/typescript/find_base_classes.js +0 -47
  63. package/schematics/utils/typescript/functions.d.ts +0 -17
  64. package/schematics/utils/typescript/functions.js +0 -46
  65. package/schematics/utils/typescript/imports.d.ts +0 -53
  66. package/schematics/utils/typescript/imports.js +0 -128
  67. package/schematics/utils/typescript/nodes.d.ts +0 -20
  68. package/schematics/utils/typescript/nodes.js +0 -77
  69. package/schematics/utils/typescript/parse_tsconfig.d.ts +0 -10
  70. package/schematics/utils/typescript/parse_tsconfig.js +0 -66
  71. package/schematics/utils/typescript/property_name.d.ts +0 -19
  72. package/schematics/utils/typescript/property_name.js +0 -41
  73. package/schematics/utils/typescript/symbol.d.ts +0 -19
  74. package/schematics/utils/typescript/symbol.js +0 -93
@@ -0,0 +1,350 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
+ mod
22
+ ));
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var __async = (__this, __arguments, generator) => {
25
+ return new Promise((resolve2, reject) => {
26
+ var fulfilled = (value) => {
27
+ try {
28
+ step(generator.next(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var rejected = (value) => {
34
+ try {
35
+ step(generator.throw(value));
36
+ } catch (e) {
37
+ reject(e);
38
+ }
39
+ };
40
+ var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
41
+ step((generator = generator.apply(__this, __arguments)).next());
42
+ });
43
+ };
44
+
45
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/index.mjs
46
+ var router_link_with_href_exports = {};
47
+ __export(router_link_with_href_exports, {
48
+ default: () => router_link_with_href_default
49
+ });
50
+ module.exports = __toCommonJS(router_link_with_href_exports);
51
+ var import_schematics = require("@angular-devkit/schematics");
52
+ var import_path2 = require("path");
53
+
54
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
55
+ var import_core = require("@angular-devkit/core");
56
+ function getProjectTsConfigPaths(tree) {
57
+ return __async(this, null, function* () {
58
+ const buildPaths = /* @__PURE__ */ new Set();
59
+ const testPaths = /* @__PURE__ */ new Set();
60
+ const workspace = yield getWorkspace(tree);
61
+ for (const [, project] of workspace.projects) {
62
+ for (const [name, target] of project.targets) {
63
+ if (name !== "build" && name !== "test") {
64
+ continue;
65
+ }
66
+ for (const [, options] of allTargetOptions(target)) {
67
+ const tsConfig = options.tsConfig;
68
+ if (typeof tsConfig !== "string" || !tree.exists(tsConfig)) {
69
+ continue;
70
+ }
71
+ if (name === "build") {
72
+ buildPaths.add((0, import_core.normalize)(tsConfig));
73
+ } else {
74
+ testPaths.add((0, import_core.normalize)(tsConfig));
75
+ }
76
+ }
77
+ }
78
+ }
79
+ return {
80
+ buildPaths: [...buildPaths],
81
+ testPaths: [...testPaths]
82
+ };
83
+ });
84
+ }
85
+ function* allTargetOptions(target) {
86
+ if (target.options) {
87
+ yield [void 0, target.options];
88
+ }
89
+ if (!target.configurations) {
90
+ return;
91
+ }
92
+ for (const [name, options] of Object.entries(target.configurations)) {
93
+ if (options) {
94
+ yield [name, options];
95
+ }
96
+ }
97
+ }
98
+ function createHost(tree) {
99
+ return {
100
+ readFile(path2) {
101
+ return __async(this, null, function* () {
102
+ const data = tree.read(path2);
103
+ if (!data) {
104
+ throw new Error("File not found.");
105
+ }
106
+ return import_core.virtualFs.fileBufferToString(data);
107
+ });
108
+ },
109
+ writeFile(path2, data) {
110
+ return __async(this, null, function* () {
111
+ return tree.overwrite(path2, data);
112
+ });
113
+ },
114
+ isDirectory(path2) {
115
+ return __async(this, null, function* () {
116
+ return !tree.exists(path2) && tree.getDir(path2).subfiles.length > 0;
117
+ });
118
+ },
119
+ isFile(path2) {
120
+ return __async(this, null, function* () {
121
+ return tree.exists(path2);
122
+ });
123
+ }
124
+ };
125
+ }
126
+ function getWorkspace(tree) {
127
+ return __async(this, null, function* () {
128
+ const host = createHost(tree);
129
+ const { workspace } = yield import_core.workspaces.readWorkspace("/", host);
130
+ return workspace;
131
+ });
132
+ }
133
+
134
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
135
+ var import_path = require("path");
136
+ var import_typescript2 = __toESM(require("typescript"), 1);
137
+
138
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
139
+ var path = __toESM(require("path"), 1);
140
+ var import_typescript = __toESM(require("typescript"), 1);
141
+ function parseTsconfigFile(tsconfigPath, basePath) {
142
+ const { config } = import_typescript.default.readConfigFile(tsconfigPath, import_typescript.default.sys.readFile);
143
+ const parseConfigHost = {
144
+ useCaseSensitiveFileNames: import_typescript.default.sys.useCaseSensitiveFileNames,
145
+ fileExists: import_typescript.default.sys.fileExists,
146
+ readDirectory: import_typescript.default.sys.readDirectory,
147
+ readFile: import_typescript.default.sys.readFile
148
+ };
149
+ if (!path.isAbsolute(basePath)) {
150
+ throw Error("Unexpected relative base path has been specified.");
151
+ }
152
+ return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
153
+ }
154
+
155
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
156
+ function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
157
+ tsconfigPath = (0, import_path.resolve)(basePath, tsconfigPath);
158
+ const parsed = parseTsconfigFile(tsconfigPath, (0, import_path.dirname)(tsconfigPath));
159
+ const host = createMigrationCompilerHost(tree, parsed.options, basePath, fakeFileRead);
160
+ const program = import_typescript2.default.createProgram(parsed.fileNames.concat(additionalFiles || []), parsed.options, host);
161
+ return { parsed, host, program };
162
+ }
163
+ function createMigrationCompilerHost(tree, options, basePath, fakeRead) {
164
+ const host = import_typescript2.default.createCompilerHost(options, true);
165
+ const defaultReadFile = host.readFile;
166
+ host.readFile = (fileName) => {
167
+ var _a;
168
+ const treeRelativePath = (0, import_path.relative)(basePath, fileName);
169
+ let result = fakeRead == null ? void 0 : fakeRead(treeRelativePath);
170
+ if (result === void 0) {
171
+ result = treeRelativePath.startsWith("..") ? defaultReadFile.call(host, fileName) : (_a = tree.read(treeRelativePath)) == null ? void 0 : _a.toString();
172
+ }
173
+ return result ? result.replace(/^\uFEFF/, "") : void 0;
174
+ };
175
+ return host;
176
+ }
177
+ function canMigrateFile(basePath, sourceFile, program) {
178
+ if (sourceFile.isDeclarationFile || program.isSourceFileFromExternalLibrary(sourceFile)) {
179
+ return false;
180
+ }
181
+ return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
182
+ }
183
+
184
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/util.mjs
185
+ var import_typescript5 = __toESM(require("typescript"), 1);
186
+
187
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
188
+ var import_typescript3 = __toESM(require("typescript"), 1);
189
+ function getImportOfIdentifier(typeChecker, node) {
190
+ const symbol = typeChecker.getSymbolAtLocation(node);
191
+ if (!symbol || symbol.declarations === void 0 || !symbol.declarations.length) {
192
+ return null;
193
+ }
194
+ const decl = symbol.declarations[0];
195
+ if (!import_typescript3.default.isImportSpecifier(decl)) {
196
+ return null;
197
+ }
198
+ const importDecl = decl.parent.parent.parent;
199
+ if (!import_typescript3.default.isStringLiteral(importDecl.moduleSpecifier)) {
200
+ return null;
201
+ }
202
+ return {
203
+ name: decl.propertyName ? decl.propertyName.text : decl.name.text,
204
+ importModule: importDecl.moduleSpecifier.text,
205
+ node: importDecl
206
+ };
207
+ }
208
+ function getImportSpecifier(sourceFile, moduleName, specifierName) {
209
+ for (const node of sourceFile.statements) {
210
+ if (import_typescript3.default.isImportDeclaration(node) && import_typescript3.default.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === moduleName) {
211
+ const namedBindings = node.importClause && node.importClause.namedBindings;
212
+ if (namedBindings && import_typescript3.default.isNamedImports(namedBindings)) {
213
+ const match = findImportSpecifier(namedBindings.elements, specifierName);
214
+ if (match) {
215
+ return match;
216
+ }
217
+ }
218
+ }
219
+ }
220
+ return null;
221
+ }
222
+ function removeSymbolFromNamedImports(node, symbol) {
223
+ return import_typescript3.default.factory.updateNamedImports(node, [
224
+ ...node.elements.filter((current) => current !== symbol)
225
+ ]);
226
+ }
227
+ function findImportSpecifier(nodes, specifierName) {
228
+ return nodes.find((element) => {
229
+ const { name, propertyName } = element;
230
+ return propertyName ? propertyName.text === specifierName : name.text === specifierName;
231
+ });
232
+ }
233
+
234
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs
235
+ var import_typescript4 = __toESM(require("typescript"), 1);
236
+ function closestNode(node, kind) {
237
+ let current = node;
238
+ while (current && !import_typescript4.default.isSourceFile(current)) {
239
+ if (current.kind === kind) {
240
+ return current;
241
+ }
242
+ current = current.parent;
243
+ }
244
+ return null;
245
+ }
246
+
247
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/util.mjs
248
+ var routerLink = "RouterLink";
249
+ var routerLinkWithHref = "RouterLinkWithHref";
250
+ var routerModule = "@angular/router";
251
+ function migrateFile(sourceFile, typeChecker, rewrite) {
252
+ const routerLinkWithHrefSpec = getImportSpecifier(sourceFile, routerModule, routerLinkWithHref);
253
+ if (routerLinkWithHrefSpec === null)
254
+ return;
255
+ let rewrites = findUsages(sourceFile, typeChecker);
256
+ const routerLinkSpec = getImportSpecifier(sourceFile, routerModule, routerLink);
257
+ if (routerLinkSpec) {
258
+ const routerLinkNamedImports = routerLinkWithHrefSpec ? closestNode(routerLinkWithHrefSpec, import_typescript5.default.SyntaxKind.NamedImports) : null;
259
+ if (routerLinkNamedImports !== null) {
260
+ const rewrittenNamedImports = removeSymbolFromNamedImports(routerLinkNamedImports, routerLinkWithHrefSpec);
261
+ const printer = import_typescript5.default.createPrinter();
262
+ const replacement = printer.printNode(import_typescript5.default.EmitHint.Unspecified, rewrittenNamedImports, sourceFile);
263
+ rewrites.push({
264
+ startPos: routerLinkNamedImports.getStart(),
265
+ width: routerLinkNamedImports.getWidth(),
266
+ replacement
267
+ });
268
+ }
269
+ } else {
270
+ rewrites.push({
271
+ startPos: routerLinkWithHrefSpec.getStart(),
272
+ width: routerLinkWithHrefSpec.getWidth(),
273
+ replacement: routerLink
274
+ });
275
+ }
276
+ rewrites = sortByStartPosDescending(rewrites);
277
+ for (const usage of rewrites) {
278
+ rewrite(usage.startPos, usage.width, usage.replacement);
279
+ }
280
+ }
281
+ function findUsages(sourceFile, typeChecker) {
282
+ const usages = [];
283
+ const visitNode = (node) => {
284
+ if (import_typescript5.default.isImportSpecifier(node)) {
285
+ return;
286
+ }
287
+ if (import_typescript5.default.isIdentifier(node)) {
288
+ const importIdentifier = getImportOfIdentifier(typeChecker, node);
289
+ if ((importIdentifier == null ? void 0 : importIdentifier.importModule) === routerModule && importIdentifier.name === routerLinkWithHref) {
290
+ usages.push({
291
+ startPos: node.getStart(),
292
+ width: node.getWidth(),
293
+ replacement: routerLink
294
+ });
295
+ }
296
+ }
297
+ import_typescript5.default.forEachChild(node, visitNode);
298
+ };
299
+ import_typescript5.default.forEachChild(sourceFile, visitNode);
300
+ return usages;
301
+ }
302
+ function sortByStartPosDescending(rewrites) {
303
+ return rewrites.sort((entityA, entityB) => entityB.startPos - entityA.startPos);
304
+ }
305
+
306
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/index.mjs
307
+ function router_link_with_href_default() {
308
+ return (tree) => __async(this, null, function* () {
309
+ const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
310
+ const basePath = process.cwd();
311
+ const allPaths = [...buildPaths, ...testPaths];
312
+ if (!allPaths.length) {
313
+ throw new import_schematics.SchematicsException("Could not find any tsconfig file. Cannot run the `RouterLinkWithHref` migration.");
314
+ }
315
+ for (const tsconfigPath of allPaths) {
316
+ runRouterLinkWithHrefMigration(tree, tsconfigPath, basePath);
317
+ }
318
+ });
319
+ }
320
+ function runRouterLinkWithHrefMigration(tree, tsconfigPath, basePath) {
321
+ const { program } = createMigrationProgram(tree, tsconfigPath, basePath);
322
+ const typeChecker = program.getTypeChecker();
323
+ const sourceFiles = program.getSourceFiles().filter((sourceFile) => canMigrateFile(basePath, sourceFile, program));
324
+ for (const sourceFile of sourceFiles) {
325
+ let update = null;
326
+ const rewriter = (startPos, width, text) => {
327
+ if (update === null) {
328
+ update = tree.beginUpdate((0, import_path2.relative)(basePath, sourceFile.fileName));
329
+ }
330
+ update.remove(startPos, width);
331
+ if (text !== null) {
332
+ update.insertLeft(startPos, text);
333
+ }
334
+ };
335
+ migrateFile(sourceFile, typeChecker, rewriter);
336
+ if (update !== null) {
337
+ tree.commitUpdate(update);
338
+ }
339
+ }
340
+ }
341
+ // Annotate the CommonJS export names for ESM import in node:
342
+ 0 && (module.exports = {});
343
+ /**
344
+ * @license
345
+ * Copyright Google LLC All Rights Reserved.
346
+ *
347
+ * Use of this source code is governed by an MIT-style license that can be
348
+ * found in the LICENSE file at https://angular.io/license
349
+ */
350
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../packages/core/schematics/migrations/router-link-with-href/index.ts", "../../../../../../../../packages/core/schematics/utils/project_tsconfig_paths.ts", "../../../../../../../../packages/core/schematics/utils/typescript/compiler_host.ts", "../../../../../../../../packages/core/schematics/utils/typescript/parse_tsconfig.ts", "../../../../../../../../packages/core/schematics/migrations/router-link-with-href/util.ts", "../../../../../../../../packages/core/schematics/utils/typescript/imports.ts", "../../../../../../../../packages/core/schematics/utils/typescript/nodes.ts"],
4
+ "sourcesContent": ["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Rule, SchematicsException, Tree, UpdateRecorder} from '@angular-devkit/schematics';\nimport {relative} from 'path';\n\nimport {getProjectTsConfigPaths} from '../../utils/project_tsconfig_paths';\nimport {canMigrateFile, createMigrationProgram} from '../../utils/typescript/compiler_host';\n\nimport {migrateFile} from './util';\n\nexport default function(): Rule {\n return async (tree: Tree) => {\n const {buildPaths, testPaths} = await getProjectTsConfigPaths(tree);\n const basePath = process.cwd();\n const allPaths = [...buildPaths, ...testPaths];\n\n if (!allPaths.length) {\n throw new SchematicsException(\n 'Could not find any tsconfig file. Cannot run the `RouterLinkWithHref` migration.');\n }\n\n for (const tsconfigPath of allPaths) {\n runRouterLinkWithHrefMigration(tree, tsconfigPath, basePath);\n }\n };\n}\n\nfunction runRouterLinkWithHrefMigration(tree: Tree, tsconfigPath: string, basePath: string) {\n const {program} = createMigrationProgram(tree, tsconfigPath, basePath);\n const typeChecker = program.getTypeChecker();\n const sourceFiles =\n program.getSourceFiles().filter(sourceFile => canMigrateFile(basePath, sourceFile, program));\n\n for (const sourceFile of sourceFiles) {\n let update: UpdateRecorder|null = null;\n\n const rewriter = (startPos: number, width: number, text: string|null) => {\n if (update === null) {\n // Lazily initialize update, because most files will not require migration.\n update = tree.beginUpdate(relative(basePath, sourceFile.fileName));\n }\n update.remove(startPos, width);\n if (text !== null) {\n update.insertLeft(startPos, text);\n }\n };\n\n migrateFile(sourceFile, typeChecker, rewriter);\n\n if (update !== null) {\n tree.commitUpdate(update);\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {json, normalize, virtualFs, workspaces} from '@angular-devkit/core';\nimport {Tree} from '@angular-devkit/schematics';\n\n/**\n * Gets all tsconfig paths from a CLI project by reading the workspace configuration\n * and looking for common tsconfig locations.\n */\nexport async function getProjectTsConfigPaths(tree: Tree):\n Promise<{buildPaths: string[]; testPaths: string[];}> {\n // Start with some tsconfig paths that are generally used within CLI projects. Note\n // that we are not interested in IDE-specific tsconfig files (e.g. /tsconfig.json)\n const buildPaths = new Set<string>();\n const testPaths = new Set<string>();\n\n const workspace = await getWorkspace(tree);\n for (const [, project] of workspace.projects) {\n for (const [name, target] of project.targets) {\n if (name !== 'build' && name !== 'test') {\n continue;\n }\n\n for (const [, options] of allTargetOptions(target)) {\n const tsConfig = options.tsConfig;\n // Filter out tsconfig files that don't exist in the CLI project.\n if (typeof tsConfig !== 'string' || !tree.exists(tsConfig)) {\n continue;\n }\n\n if (name === 'build') {\n buildPaths.add(normalize(tsConfig));\n } else {\n testPaths.add(normalize(tsConfig));\n }\n }\n }\n }\n\n return {\n buildPaths: [...buildPaths],\n testPaths: [...testPaths],\n };\n}\n\n/** Get options for all configurations for the passed builder target. */\nfunction*\n allTargetOptions(target: workspaces.TargetDefinition):\n Iterable<[string | undefined, Record<string, json.JsonValue|undefined>]> {\n if (target.options) {\n yield [undefined, target.options];\n }\n\n if (!target.configurations) {\n return;\n }\n\n for (const [name, options] of Object.entries(target.configurations)) {\n if (options) {\n yield [name, options];\n }\n }\n}\n\nfunction createHost(tree: Tree): workspaces.WorkspaceHost {\n return {\n async readFile(path: string): Promise<string> {\n const data = tree.read(path);\n if (!data) {\n throw new Error('File not found.');\n }\n\n return virtualFs.fileBufferToString(data);\n },\n async writeFile(path: string, data: string): Promise<void> {\n return tree.overwrite(path, data);\n },\n async isDirectory(path: string): Promise<boolean> {\n // Approximate a directory check.\n // We don't need to consider empty directories and hence this is a good enough approach.\n // This is also per documentation, see:\n // https://angular.io/guide/schematics-for-libraries#get-the-project-configuration\n return !tree.exists(path) && tree.getDir(path).subfiles.length > 0;\n },\n async isFile(path: string): Promise<boolean> {\n return tree.exists(path);\n },\n };\n}\n\nasync function getWorkspace(tree: Tree): Promise<workspaces.WorkspaceDefinition> {\n const host = createHost(tree);\n const {workspace} = await workspaces.readWorkspace('/', host);\n\n return workspace;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Tree} from '@angular-devkit/schematics';\nimport {dirname, relative, resolve} from 'path';\nimport ts from 'typescript';\nimport {parseTsconfigFile} from './parse_tsconfig';\n\nexport type FakeReadFileFn = (fileName: string) => string|undefined;\n\n/**\n * Creates a TypeScript program instance for a TypeScript project within\n * the virtual file system tree.\n * @param tree Virtual file system tree that contains the source files.\n * @param tsconfigPath Virtual file system path that resolves to the TypeScript project.\n * @param basePath Base path for the virtual file system tree.\n * @param fakeFileRead Optional file reader function. Can be used to overwrite files in\n * the TypeScript program, or to add in-memory files (e.g. to add global types).\n * @param additionalFiles Additional file paths that should be added to the program.\n */\nexport function createMigrationProgram(\n tree: Tree, tsconfigPath: string, basePath: string, fakeFileRead?: FakeReadFileFn,\n additionalFiles?: string[]) {\n // Resolve the tsconfig path to an absolute path. This is needed as TypeScript otherwise\n // is not able to resolve root directories in the given tsconfig. More details can be found\n // in the following issue: https://github.com/microsoft/TypeScript/issues/37731.\n tsconfigPath = resolve(basePath, tsconfigPath);\n const parsed = parseTsconfigFile(tsconfigPath, dirname(tsconfigPath));\n const host = createMigrationCompilerHost(tree, parsed.options, basePath, fakeFileRead);\n const program =\n ts.createProgram(parsed.fileNames.concat(additionalFiles || []), parsed.options, host);\n return {parsed, host, program};\n}\n\nexport function createMigrationCompilerHost(\n tree: Tree, options: ts.CompilerOptions, basePath: string,\n fakeRead?: FakeReadFileFn): ts.CompilerHost {\n const host = ts.createCompilerHost(options, true);\n const defaultReadFile = host.readFile;\n\n // We need to overwrite the host \"readFile\" method, as we want the TypeScript\n // program to be based on the file contents in the virtual file tree. Otherwise\n // if we run multiple migrations we might have intersecting changes and\n // source files.\n host.readFile = fileName => {\n const treeRelativePath = relative(basePath, fileName);\n let result: string|undefined = fakeRead?.(treeRelativePath);\n\n if (result === undefined) {\n // If the relative path resolved to somewhere outside of the tree, fall back to\n // TypeScript's default file reading function since the `tree` will throw an error.\n result = treeRelativePath.startsWith('..') ? defaultReadFile.call(host, fileName) :\n tree.read(treeRelativePath)?.toString();\n }\n\n // Strip BOM as otherwise TSC methods (Ex: getWidth) will return an offset,\n // which breaks the CLI UpdateRecorder.\n // See: https://github.com/angular/angular/pull/30719\n return result ? result.replace(/^\\uFEFF/, '') : undefined;\n };\n\n return host;\n}\n\n/**\n * Checks whether a file can be migrate by our automated migrations.\n * @param basePath Absolute path to the project.\n * @param sourceFile File being checked.\n * @param program Program that includes the source file.\n */\nexport function canMigrateFile(\n basePath: string, sourceFile: ts.SourceFile, program: ts.Program): boolean {\n // We shouldn't migrate .d.ts files or files from an external library.\n if (sourceFile.isDeclarationFile || program.isSourceFileFromExternalLibrary(sourceFile)) {\n return false;\n }\n\n // Our migrations are set up to create a `Program` from the project's tsconfig and to migrate all\n // the files within the program. This can include files that are outside of the Angular CLI\n // project. We can't migrate files outside of the project, because our file system interactions\n // go through the CLI's `Tree` which assumes that all files are within the project. See:\n // https://github.com/angular/angular-cli/blob/0b0961c9c233a825b6e4bb59ab7f0790f9b14676/packages/angular_devkit/schematics/src/tree/host-tree.ts#L131\n return !relative(basePath, sourceFile.fileName).startsWith('..');\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport * as path from 'path';\nimport ts from 'typescript';\n\nexport function parseTsconfigFile(tsconfigPath: string, basePath: string): ts.ParsedCommandLine {\n const {config} = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n const parseConfigHost = {\n useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,\n fileExists: ts.sys.fileExists,\n readDirectory: ts.sys.readDirectory,\n readFile: ts.sys.readFile,\n };\n\n // Throw if incorrect arguments are passed to this function. Passing relative base paths\n // results in root directories not being resolved and in later type checking runtime errors.\n // More details can be found here: https://github.com/microsoft/TypeScript/issues/37731.\n if (!path.isAbsolute(basePath)) {\n throw Error('Unexpected relative base path has been specified.');\n }\n\n return ts.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport ts from 'typescript';\n\nimport {getImportOfIdentifier, getImportSpecifier, removeSymbolFromNamedImports} from '../../utils/typescript/imports';\nimport {closestNode} from '../../utils/typescript/nodes';\n\nexport const routerLink = 'RouterLink';\nexport const routerLinkWithHref = 'RouterLinkWithHref';\nexport const routerModule = '@angular/router';\n\nexport interface RewriteEntity {\n startPos: number;\n width: number;\n replacement: string;\n}\n\nexport type RewriteFn = (startPos: number, width: number, text: string) => void;\n\nexport function migrateFile(\n sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker, rewrite: RewriteFn) {\n const routerLinkWithHrefSpec = getImportSpecifier(sourceFile, routerModule, routerLinkWithHref);\n\n // No `RouterLinkWithHref` found, nothing to migrate, exit early.\n if (routerLinkWithHrefSpec === null) return;\n\n let rewrites = findUsages(sourceFile, typeChecker);\n\n // There are some usages of the `RouterLinkWithHref` symbol, which need to\n // be rewritten to `RouterLink` instead. Let's check if the `RouterLink` is\n // already imported.\n const routerLinkSpec = getImportSpecifier(sourceFile, routerModule, routerLink);\n\n if (routerLinkSpec) {\n // The `RouterLink` symbol is already imported, just drop the `RouterLinkWithHref` one.\n const routerLinkNamedImports = routerLinkWithHrefSpec ?\n closestNode<ts.NamedImports>(routerLinkWithHrefSpec, ts.SyntaxKind.NamedImports) :\n null;\n if (routerLinkNamedImports !== null) {\n // Given an original import like this one:\n // ```\n // import {RouterModule, RouterLinkWithHref, RouterLink} from '@angular/router';\n // ```\n // The code below removes the `RouterLinkWithHref` from the named imports section\n // (i.e. `{RouterModule, RouterLinkWithHref, RouterLink}`) and prints an updated\n // version (`{RouterModule, RouterLink}`) to a string, which is used as a\n // replacement.\n const rewrittenNamedImports =\n removeSymbolFromNamedImports(routerLinkNamedImports, routerLinkWithHrefSpec);\n const printer = ts.createPrinter();\n const replacement =\n printer.printNode(ts.EmitHint.Unspecified, rewrittenNamedImports, sourceFile);\n rewrites.push({\n startPos: routerLinkNamedImports.getStart(),\n width: routerLinkNamedImports.getWidth(),\n replacement: replacement,\n });\n }\n } else {\n // The `RouterLink` symbol is not imported, but the `RouterLinkWithHref` is imported,\n // so rewrite `RouterLinkWithHref` -> `RouterLink`.\n rewrites.push({\n startPos: routerLinkWithHrefSpec.getStart(),\n width: routerLinkWithHrefSpec.getWidth(),\n replacement: routerLink,\n });\n }\n\n // Process rewrites last-to-first (based on start pos) to avoid offset shifts during rewrites.\n rewrites = sortByStartPosDescending(rewrites);\n for (const usage of rewrites) {\n rewrite(usage.startPos, usage.width, usage.replacement);\n }\n}\n\nfunction findUsages(sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker): RewriteEntity[] {\n const usages: RewriteEntity[] = [];\n const visitNode = (node: ts.Node) => {\n if (ts.isImportSpecifier(node)) {\n // Skip this node and all of its children; imports are a special case.\n return;\n }\n if (ts.isIdentifier(node)) {\n const importIdentifier = getImportOfIdentifier(typeChecker, node);\n if (importIdentifier?.importModule === routerModule &&\n importIdentifier.name === routerLinkWithHref) {\n usages.push({\n startPos: node.getStart(),\n width: node.getWidth(),\n replacement: routerLink,\n });\n }\n }\n ts.forEachChild(node, visitNode);\n };\n ts.forEachChild(sourceFile, visitNode);\n return usages;\n}\n\n/**\n * Sort all found usages based on their start positions in the source file in descending order (i.e.\n * last usage goes first on the list, etc). This is needed to avoid shifting offsets in the source\n * file (in case there are multiple usages) as we rewrite symbols.\n */\nfunction sortByStartPosDescending(rewrites: RewriteEntity[]): RewriteEntity[] {\n return rewrites.sort((entityA, entityB) => entityB.startPos - entityA.startPos);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport ts from 'typescript';\n\nexport type Import = {\n name: string,\n importModule: string,\n node: ts.ImportDeclaration\n};\n\n/** Gets import information about the specified identifier by using the Type checker. */\nexport function getImportOfIdentifier(typeChecker: ts.TypeChecker, node: ts.Identifier): Import|\n null {\n const symbol = typeChecker.getSymbolAtLocation(node);\n\n if (!symbol || symbol.declarations === undefined || !symbol.declarations.length) {\n return null;\n }\n\n const decl = symbol.declarations[0];\n\n if (!ts.isImportSpecifier(decl)) {\n return null;\n }\n\n const importDecl = decl.parent.parent.parent;\n\n if (!ts.isStringLiteral(importDecl.moduleSpecifier)) {\n return null;\n }\n\n return {\n // Handles aliased imports: e.g. \"import {Component as myComp} from ...\";\n name: decl.propertyName ? decl.propertyName.text : decl.name.text,\n importModule: importDecl.moduleSpecifier.text,\n node: importDecl\n };\n}\n\n\n/**\n * Gets a top-level import specifier with a specific name that is imported from a particular module.\n * E.g. given a file that looks like:\n *\n * ```\n * import { Component, Directive } from '@angular/core';\n * import { Foo } from './foo';\n * ```\n *\n * Calling `getImportSpecifier(sourceFile, '@angular/core', 'Directive')` will yield the node\n * referring to `Directive` in the top import.\n *\n * @param sourceFile File in which to look for imports.\n * @param moduleName Name of the import's module.\n * @param specifierName Original name of the specifier to look for. Aliases will be resolved to\n * their original name.\n */\nexport function getImportSpecifier(\n sourceFile: ts.SourceFile, moduleName: string, specifierName: string): ts.ImportSpecifier|null {\n for (const node of sourceFile.statements) {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier) &&\n node.moduleSpecifier.text === moduleName) {\n const namedBindings = node.importClause && node.importClause.namedBindings;\n if (namedBindings && ts.isNamedImports(namedBindings)) {\n const match = findImportSpecifier(namedBindings.elements, specifierName);\n if (match) {\n return match;\n }\n }\n }\n }\n\n return null;\n}\n\n\n/**\n * Replaces an import inside a named imports node with a different one.\n *\n * @param node Node that contains the imports.\n * @param existingImport Import that should be replaced.\n * @param newImportName Import that should be inserted.\n */\nexport function replaceImport(\n node: ts.NamedImports, existingImport: string, newImportName: string) {\n const isAlreadyImported = findImportSpecifier(node.elements, newImportName);\n if (isAlreadyImported) {\n return node;\n }\n\n const existingImportNode = findImportSpecifier(node.elements, existingImport);\n if (!existingImportNode) {\n return node;\n }\n\n const importPropertyName =\n existingImportNode.propertyName ? ts.factory.createIdentifier(newImportName) : undefined;\n const importName = existingImportNode.propertyName ? existingImportNode.name :\n ts.factory.createIdentifier(newImportName);\n\n return ts.factory.updateNamedImports(node, [\n ...node.elements.filter(current => current !== existingImportNode),\n // Create a new import while trying to preserve the alias of the old one.\n ts.factory.createImportSpecifier(false, importPropertyName, importName)\n ]);\n}\n\n/**\n * Removes a symbol from the named imports and updates a node\n * that represents a given named imports.\n *\n * @param node Node that contains the imports.\n * @param symbol Symbol that should be removed.\n * @returns An updated node (ts.NamedImports).\n */\nexport function removeSymbolFromNamedImports(node: ts.NamedImports, symbol: ts.ImportSpecifier) {\n return ts.factory.updateNamedImports(node, [\n ...node.elements.filter(current => current !== symbol),\n ]);\n}\n\n/** Finds an import specifier with a particular name. */\nexport function findImportSpecifier(\n nodes: ts.NodeArray<ts.ImportSpecifier>, specifierName: string): ts.ImportSpecifier|undefined {\n return nodes.find(element => {\n const {name, propertyName} = element;\n return propertyName ? propertyName.text === specifierName : name.text === specifierName;\n });\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport ts from 'typescript';\n\n/** Checks whether the given TypeScript node has the specified modifier set. */\nexport function hasModifier(node: ts.Node, modifierKind: ts.SyntaxKind) {\n return !!node.modifiers && node.modifiers.some(m => m.kind === modifierKind);\n}\n\n/** Find the closest parent node of a particular kind. */\nexport function closestNode<T extends ts.Node>(node: ts.Node, kind: ts.SyntaxKind): T|null {\n let current: ts.Node = node;\n\n while (current && !ts.isSourceFile(current)) {\n if (current.kind === kind) {\n return current as T;\n }\n current = current.parent;\n }\n\n return null;\n}\n\n/**\n * Checks whether a particular node is part of a null check. E.g. given:\n * `foo.bar ? foo.bar.value : null` the null check would be `foo.bar`.\n */\nexport function isNullCheck(node: ts.Node): boolean {\n if (!node.parent) {\n return false;\n }\n\n // `foo.bar && foo.bar.value` where `node` is `foo.bar`.\n if (ts.isBinaryExpression(node.parent) && node.parent.left === node) {\n return true;\n }\n\n // `foo.bar && foo.bar.parent && foo.bar.parent.value`\n // where `node` is `foo.bar`.\n if (node.parent.parent && ts.isBinaryExpression(node.parent.parent) &&\n node.parent.parent.left === node.parent) {\n return true;\n }\n\n // `if (foo.bar) {...}` where `node` is `foo.bar`.\n if (ts.isIfStatement(node.parent) && node.parent.expression === node) {\n return true;\n }\n\n // `foo.bar ? foo.bar.value : null` where `node` is `foo.bar`.\n if (ts.isConditionalExpression(node.parent) && node.parent.condition === node) {\n return true;\n }\n\n return false;\n}\n\n/** Checks whether a property access is safe (e.g. `foo.parent?.value`). */\nexport function isSafeAccess(node: ts.Node): boolean {\n return node.parent != null && ts.isPropertyAccessExpression(node.parent) &&\n node.parent.expression === node && node.parent.questionDotToken != null;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAQA,wBAA8D;AAC9D,IAAAA,eAAuB;;;ACDvB,kBAAqD;AAOrD,SAAsB,wBAAwB,MAAU;;AAItD,UAAM,aAAa,oBAAI,IAAG;AAC1B,UAAM,YAAY,oBAAI,IAAG;AAEzB,UAAM,YAAY,MAAM,aAAa,IAAI;AACzC,eAAW,CAAC,EAAE,OAAO,KAAK,UAAU,UAAU;AAC5C,iBAAW,CAAC,MAAM,MAAM,KAAK,QAAQ,SAAS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SAAqB;AACtE,UAAI,WAAW,MAAM;AAEnB,iBAAS,KAAK,gBAAY,uBAAS,UAAU,WAAW,QAAQ,CAAC;;AAEnE,aAAO,OAAO,UAAU,KAAK;AAC7B,UAAI,SAAS,MAAM;AACjB,eAAO,WAAW,UAAU,IAAI;;IAEpC;AAEA,gBAAY,YAAY,aAAa,QAAQ;AAE7C,QAAI,WAAW,MAAM;AACnB,WAAK,aAAa,MAAM;;;AAG9B;",
6
+ "names": ["import_path", "path", "import_typescript", "ts", "ts", "import_typescript", "import_typescript", "ts", "ts", "import_typescript", "ts", "ts"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs":{"bytes":10701,"imports":[]},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs":{"bytes":3789,"imports":[]},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs":{"bytes":12420,"imports":[{"path":"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs","kind":"import-statement"}]},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs":{"bytes":14180,"imports":[]},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs":{"bytes":7202,"imports":[]},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/util.mjs":{"bytes":13955,"imports":[{"path":"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs","kind":"import-statement"},{"path":"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs","kind":"import-statement"}]},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/index.mjs":{"bytes":7157,"imports":[{"path":"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs","kind":"import-statement"},{"path":"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs","kind":"import-statement"},{"path":"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/util.mjs","kind":"import-statement"}]}},"outputs":{"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/bundle.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":28707},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/bundle.js":{"imports":[],"exports":[],"entryPoint":"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/index.mjs","inputs":{"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/index.mjs":{"bytesInOutput":1659},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs":{"bytesInOutput":2237},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs":{"bytesInOutput":1527},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs":{"bytesInOutput":779},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/router-link-with-href/util.mjs":{"bytesInOutput":2429},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs":{"bytesInOutput":1762},"bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs":{"bytesInOutput":302}},"bytes":13693}}}
@@ -3,12 +3,12 @@
3
3
  "migration-v15-router-link-with-href": {
4
4
  "version": "15.0.0",
5
5
  "description": "Since Angular v15, the `RouterLink` contains the logic of the `RouterLinkWithHref` directive. This migration replaces all `RouterLinkWithHref` references with `RouterLink`.",
6
- "factory": "./migrations/router-link-with-href/index"
6
+ "factory": "./migrations/router-link-with-href/bundle"
7
7
  },
8
8
  "migration-v15-relative-link-resolution": {
9
9
  "version": "15.0.0",
10
10
  "description": "In Angular version 15, the deprecated `relativeLinkResolution` config parameter of the Router is removed. This migration removes all `relativeLinkResolution` fields from the Router config objects.",
11
- "factory": "./migrations/relative-link-resolution/index"
11
+ "factory": "./migrations/relative-link-resolution/bundle"
12
12
  }
13
13
  }
14
14
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.1.0-next.3
2
+ * @license Angular v15.1.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,40 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- /**
9
- * Patch a `debug` property on top of the existing object.
10
- *
11
- * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
12
- *
13
- * @param obj Object to patch
14
- * @param debug Value to patch
15
- */
16
- export function attachDebugObject(obj, debug) {
17
- if (ngDevMode) {
18
- Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
19
- }
20
- else {
21
- throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
22
- }
23
- }
24
- /**
25
- * Patch a `debug` property getter on top of the existing object.
26
- *
27
- * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
28
- *
29
- * @param obj Object to patch
30
- * @param debugGetter Getter returning a value to patch
31
- */
32
- export function attachDebugGetter(obj, debugGetter) {
33
- if (ngDevMode) {
34
- Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
35
- }
36
- else {
37
- throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
38
- }
39
- }
40
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVidWdfdXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYW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BvcnQgZnVuY3Rpb24gYXR0YWNoRGVidWdHZXR0ZXI8VD4ob2JqOiBULCBkZWJ1Z0dldHRlcjogKHRoaXM6IFQpID0+IGFueSk6IHZvaWQge1xuICBpZiAobmdEZXZNb2RlKSB7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG9iaiwgJ2RlYnVnJywge2dldDogZGVidWdHZXR0ZXIsIGVudW1lcmFibGU6IGZhbHNlfSk7XG4gIH0gZWxzZSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAnVGhpcyBtZXRob2Qgc2hvdWxkIGJlIGd1YXJkZWQgd2l0aCBgbmdEZXZNb2RlYCBzbyB0aGF0IGl0IGNhbiBiZSB0cmVlIHNoYWtlbiBpbiBwcm9kdWN0aW9uIScpO1xuICB9XG59XG4iXX0=
@@ -1,14 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- export function getTypeOf(instance /** TODO #9100 */) {
9
- return instance.constructor;
10
- }
11
- export function instantiateType(type, params = []) {
12
- return new type(...params);
13
- }
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZ191dGlscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvdGVzdGluZy9zcmMvbGFuZ191dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxNQUFNLFVBQVUsU0FBUyxDQUFDLFFBQWEsQ0FBQyxpQkFBaUI7SUFDdkQsT0FBTyxRQUFRLENBQUMsV0FBVyxDQUFDO0FBQzlCLENBQUM7QUFFRCxNQUFNLFVBQVUsZUFBZSxDQUFDLElBQWMsRUFBRSxTQUFnQixFQUFFO0lBQ2hFLE9BQU8sSUFBVSxJQUFLLENBQUMsR0FBRyxNQUFNLENBQUMsQ0FBQztBQUNwQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRUeXBlT2YoaW5zdGFuY2U6IGFueSAvKiogVE9ETyAjOTEwMCAqLykge1xuICByZXR1cm4gaW5zdGFuY2UuY29uc3RydWN0b3I7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBpbnN0YW50aWF0ZVR5cGUodHlwZTogRnVuY3Rpb24sIHBhcmFtczogYW55W10gPSBbXSkge1xuICByZXR1cm4gbmV3ICg8YW55PnR5cGUpKC4uLnBhcmFtcyk7XG59XG4iXX0=
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- /// <amd-module name="@angular/core/schematics/migrations/relative-link-resolution" />
9
- import { Rule } from '@angular-devkit/schematics';
10
- export default function (): Rule;
@@ -1,68 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
- return new (P || (P = Promise))(function (resolve, reject) {
11
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
- step((generator = generator.apply(thisArg, _arguments || [])).next());
15
- });
16
- };
17
- (function (factory) {
18
- if (typeof module === "object" && typeof module.exports === "object") {
19
- var v = factory(require, exports);
20
- if (v !== undefined) module.exports = v;
21
- }
22
- else if (typeof define === "function" && define.amd) {
23
- define("@angular/core/schematics/migrations/relative-link-resolution", ["require", "exports", "@angular-devkit/schematics", "path", "@angular/core/schematics/utils/project_tsconfig_paths", "@angular/core/schematics/utils/typescript/compiler_host", "@angular/core/schematics/migrations/relative-link-resolution/util"], factory);
24
- }
25
- })(function (require, exports) {
26
- "use strict";
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- const schematics_1 = require("@angular-devkit/schematics");
29
- const path_1 = require("path");
30
- const project_tsconfig_paths_1 = require("@angular/core/schematics/utils/project_tsconfig_paths");
31
- const compiler_host_1 = require("@angular/core/schematics/utils/typescript/compiler_host");
32
- const util_1 = require("@angular/core/schematics/migrations/relative-link-resolution/util");
33
- function default_1() {
34
- return (tree) => __awaiter(this, void 0, void 0, function* () {
35
- const { buildPaths, testPaths } = yield (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
36
- const basePath = process.cwd();
37
- const allPaths = [...buildPaths, ...testPaths];
38
- if (!allPaths.length) {
39
- throw new schematics_1.SchematicsException('Could not find any tsconfig file. ' +
40
- 'Cannot run a migration to cleanup the deprecated `relativeLinkResolution` config option.');
41
- }
42
- for (const tsconfigPath of allPaths) {
43
- runRelativeLinkResolutionMigration(tree, tsconfigPath, basePath);
44
- }
45
- });
46
- }
47
- exports.default = default_1;
48
- function runRelativeLinkResolutionMigration(tree, tsconfigPath, basePath) {
49
- const { program } = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
50
- const sourceFiles = program.getSourceFiles().filter(sourceFile => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
51
- for (const sourceFile of sourceFiles) {
52
- let update = null;
53
- const rewriter = (startPos, origLength, text) => {
54
- if (update === null) {
55
- // Lazily initialize update, because most files will not require migration.
56
- update = tree.beginUpdate((0, path_1.relative)(basePath, sourceFile.fileName));
57
- }
58
- update.remove(startPos, origLength);
59
- update.insertLeft(startPos, text);
60
- };
61
- (0, util_1.migrateFile)(sourceFile, rewriter);
62
- if (update !== null) {
63
- tree.commitUpdate(update);
64
- }
65
- }
66
- }
67
- });
68
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NjaGVtYXRpY3MvbWlncmF0aW9ucy9yZWxhdGl2ZS1saW5rLXJlc29sdXRpb24vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFFSCwyREFBMkY7SUFDM0YsK0JBQThCO0lBRTlCLGtHQUEyRTtJQUMzRSwyRkFBNEY7SUFFNUYsNEZBQW1DO0lBRW5DO1FBQ0UsT0FBTyxDQUFPLElBQVUsRUFBRSxFQUFFO1lBQzFCLE1BQU0sRUFBQyxVQUFVLEVBQUUsU0FBUyxFQUFDLEdBQUcsTUFBTSxJQUFBLGdEQUF1QixFQUFDLElBQUksQ0FBQyxDQUFDO1lBQ3BFLE1BQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQztZQUMvQixNQUFNLFFBQVEsR0FBRyxDQUFDLEdBQUcsVUFBVSxFQUFFLEdBQUcsU0FBUyxDQUFDLENBQUM7WUFFL0MsSUFBSSxDQUFDLFFBQVEsQ0FBQyxNQUF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AgICAgIHByb2dyYW0uZ2V0U291cmNlRmlsZXMoKS5maWx0ZXIoc291cmNlRmlsZSA9PiBjYW5NaWdyYXRlRmlsZShiYXNlUGF0aCwgc291cmNlRmlsZSwgcHJvZ3JhbSkpO1xuXG4gIGZvciAoY29uc3Qgc291cmNlRmlsZSBvZiBzb3VyY2VGaWxlcykge1xuICAgIGxldCB1cGRhdGU6IFVwZGF0ZVJlY29yZGVyfG51bGwgPSBudWxsO1xuXG4gICAgY29uc3QgcmV3cml0ZXIgPSAoc3RhcnRQb3M6IG51bWJlciwgb3JpZ0xlbmd0aDogbnVtYmVyLCB0ZXh0OiBzdHJpbmcpID0+IHtcbiAgICAgIGlmICh1cGRhdGUgPT09IG51bGwpIHtcbiAgICAgICAgLy8gTGF6aWx5IGluaXRpYWxpemUgdXBkYXRlLCBiZWNhdXNlIG1vc3QgZmlsZXMgd2lsbCBub3QgcmVxdWlyZSBtaWdyYXRpb24uXG4gICAgICAgIHVwZGF0ZSA9IHRyZWUuYmVnaW5VcGRhdGUocmVsYXRpdmUoYmFzZVBhdGgsIHNvdXJjZUZpbGUuZmlsZU5hbWUpKTtcbiAgICAgIH1cbiAgICAgIHVwZGF0ZS5yZW1vdmUoc3RhcnRQb3MsIG9yaWdMZW5ndGgpO1xuICAgICAgdXBkYXRlLmluc2VydExlZnQoc3RhcnRQb3MsIHRleHQpO1xuICAgIH07XG5cbiAgICBtaWdyYXRlRmlsZShzb3VyY2VGaWxlLCByZXdyaXRlcik7XG5cbiAgICBpZiAodXBkYXRlICE9PSBudWxsKSB7XG4gICAgICB0cmVlLmNvbW1pdFVwZGF0ZSh1cGRhdGUpO1xuICAgIH1cbiAgfVxufVxuIl19
@@ -1,20 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- /// <amd-module name="@angular/core/schematics/migrations/relative-link-resolution/util" />
9
- import ts from 'typescript';
10
- export interface RewriteEntity {
11
- startPos: number;
12
- width: number;
13
- replacement: string;
14
- }
15
- export interface MigratableNode {
16
- objectLiteral: ts.ObjectLiteralExpression;
17
- property: ts.ObjectLiteralElementLike;
18
- }
19
- export type RewriteFn = (startPos: number, origLength: number, text: string) => void;
20
- export declare function migrateFile(sourceFile: ts.SourceFile, rewriteFn: RewriteFn): void;