@angular/google-maps 19.2.6 → 19.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/google-maps",
3
- "version": "19.2.6",
3
+ "version": "19.2.7",
4
4
  "description": "Angular Google Maps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -3,7 +3,7 @@
3
3
  "migration-v19": {
4
4
  "version": "19.0.0-0",
5
5
  "description": "Updates the Angular Google Maps package to v19",
6
- "factory": "./ng-update/index_bundled#updateToV19"
6
+ "factory": "./ng-update/index#updateToV19"
7
7
  }
8
8
  }
9
9
  }
@@ -11,6 +11,6 @@ exports.default = default_1;
11
11
  function default_1() {
12
12
  // Noop schematic so the CLI doesn't throw if users try to `ng add` this package.
13
13
  // Also allows us to add more functionality in the future.
14
- return () => { };
14
+ return function () { };
15
15
  }
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvZ29vZ2xlLW1hcHMvc2NoZW1hdGljcy9uZy1hZGQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7QUFJSCw0QkFJQztBQUpEO0lBQ0UsaUZBQWlGO0lBQ2pGLDBEQUEwRDtJQUMxRCxPQUFPLEdBQUcsRUFBRSxHQUFFLENBQUMsQ0FBQztBQUNsQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuZGV2L2xpY2Vuc2VcbiAqL1xuXG5pbXBvcnQge1J1bGV9IGZyb20gJ0Bhbmd1bGFyLWRldmtpdC9zY2hlbWF0aWNzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gKCk6IFJ1bGUge1xuICAvLyBOb29wIHNjaGVtYXRpYyBzbyB0aGUgQ0xJIGRvZXNuJ3QgdGhyb3cgaWYgdXNlcnMgdHJ5IHRvIGBuZyBhZGRgIHRoaXMgcGFja2FnZS5cbiAgLy8gQWxzbyBhbGxvd3MgdXMgdG8gYWRkIG1vcmUgZnVuY3Rpb25hbGl0eSBpbiB0aGUgZnV0dXJlLlxuICByZXR1cm4gKCkgPT4ge307XG59XG4iXX0=
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAIH,4BAIC;AAJD;IACE,iFAAiF;IACjF,0DAA0D;IAC1D,OAAO,cAAO,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,10 @@
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.dev/license
7
+ */
8
+ import { Rule } from '@angular-devkit/schematics';
9
+ /** Entry point for the migration schematics with target of Angular Material v19 */
10
+ export declare function updateToV19(): Rule;
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.updateToV19 = updateToV19;
11
+ var ts = require("typescript");
12
+ /** Tag name of the clusterer component. */
13
+ var TAG_NAME = 'map-marker-clusterer';
14
+ /** Module from which the clusterer is being imported. */
15
+ var MODULE_NAME = '@angular/google-maps';
16
+ /** Old name of the clusterer class. */
17
+ var CLASS_NAME = 'MapMarkerClusterer';
18
+ /** New name of the clusterer class. */
19
+ var DEPRECATED_CLASS_NAME = 'DeprecatedMapMarkerClusterer';
20
+ /** Entry point for the migration schematics with target of Angular Material v19 */
21
+ function updateToV19() {
22
+ return function (tree) {
23
+ tree.visit(function (path) {
24
+ var _a;
25
+ if (path.includes('node_modules')) {
26
+ return;
27
+ }
28
+ if (path.endsWith('.html')) {
29
+ var content = (_a = tree.read(path)) === null || _a === void 0 ? void 0 : _a.toString();
30
+ if (content && content.includes('<' + TAG_NAME)) {
31
+ tree.overwrite(path, migrateHtml(content));
32
+ }
33
+ }
34
+ else if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {
35
+ migrateTypeScript(path, tree);
36
+ }
37
+ });
38
+ };
39
+ }
40
+ /** Migrates an HTML template from the old tag name to the new one. */
41
+ function migrateHtml(content) {
42
+ return content
43
+ .replace(/<map-marker-clusterer/g, '<deprecated-map-marker-clusterer')
44
+ .replace(/<\/map-marker-clusterer/g, '</deprecated-map-marker-clusterer');
45
+ }
46
+ /** Migrates a TypeScript file from the old tag and class names to the new ones. */
47
+ function migrateTypeScript(path, tree) {
48
+ var _a;
49
+ var content = (_a = tree.read(path)) === null || _a === void 0 ? void 0 : _a.toString();
50
+ // Exit early if none of the symbols we're looking for are mentioned.
51
+ if (!content ||
52
+ (!content.includes('<' + TAG_NAME) &&
53
+ !content.includes(MODULE_NAME) &&
54
+ !content.includes(CLASS_NAME))) {
55
+ return;
56
+ }
57
+ var sourceFile = ts.createSourceFile(path, content, ts.ScriptTarget.Latest, true);
58
+ var toMigrate = findTypeScriptNodesToMigrate(sourceFile);
59
+ if (toMigrate.length === 0) {
60
+ return;
61
+ }
62
+ var printer = ts.createPrinter();
63
+ var update = tree.beginUpdate(path);
64
+ for (var _i = 0, toMigrate_1 = toMigrate; _i < toMigrate_1.length; _i++) {
65
+ var node = toMigrate_1[_i];
66
+ var replacement = void 0;
67
+ if (ts.isStringLiteralLike(node)) {
68
+ // Strings should be migrated as if they're HTML.
69
+ if (ts.isStringLiteral(node)) {
70
+ replacement = ts.factory.createStringLiteral(migrateHtml(node.text), node.getText()[0] === "'");
71
+ }
72
+ else {
73
+ replacement = ts.factory.createNoSubstitutionTemplateLiteral(migrateHtml(node.text));
74
+ }
75
+ }
76
+ else {
77
+ // Imports/exports should preserve the old name, but import the clusterer using the new one.
78
+ var propertyName = ts.factory.createIdentifier(DEPRECATED_CLASS_NAME);
79
+ var name = node.name;
80
+ replacement = ts.isImportSpecifier(node)
81
+ ? ts.factory.updateImportSpecifier(node, node.isTypeOnly, propertyName, name)
82
+ : ts.factory.updateExportSpecifier(node, node.isTypeOnly, propertyName, name);
83
+ }
84
+ update
85
+ .remove(node.getStart(), node.getWidth())
86
+ .insertLeft(node.getStart(), printer.printNode(ts.EmitHint.Unspecified, replacement, sourceFile));
87
+ }
88
+ tree.commitUpdate(update);
89
+ }
90
+ /** Finds the TypeScript nodes that need to be migrated from a specific file. */
91
+ function findTypeScriptNodesToMigrate(sourceFile) {
92
+ var results = [];
93
+ sourceFile.forEachChild(function walk(node) {
94
+ var _a;
95
+ // Most likely a template using the clusterer.
96
+ if (ts.isStringLiteral(node) && node.text.includes('<' + TAG_NAME)) {
97
+ results.push(node);
98
+ }
99
+ else if (
100
+ // Import/export referencing the clusterer.
101
+ (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&
102
+ node.moduleSpecifier &&
103
+ ts.isStringLiteralLike(node.moduleSpecifier) &&
104
+ node.moduleSpecifier.text === MODULE_NAME) {
105
+ var bindings = ts.isImportDeclaration(node)
106
+ ? (_a = node.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings
107
+ : node.exportClause;
108
+ if (bindings && (ts.isNamedImports(bindings) || ts.isNamedExports(bindings))) {
109
+ bindings.elements.forEach(function (element) {
110
+ var symbolName = element.propertyName || element.name;
111
+ if (ts.isIdentifier(symbolName) && symbolName.text === CLASS_NAME) {
112
+ results.push(element);
113
+ }
114
+ });
115
+ }
116
+ }
117
+ else {
118
+ node.forEachChild(walk);
119
+ }
120
+ });
121
+ // Sort the results in reverse order to make applying the updates easier.
122
+ return results.sort(function (a, b) { return b.getStart() - a.getStart(); });
123
+ }
124
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmBH,kCAkBC;AAjCD,+BAAiC;AAEjC,2CAA2C;AAC3C,IAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,yDAAyD;AACzD,IAAM,WAAW,GAAG,sBAAsB,CAAC;AAE3C,uCAAuC;AACvC,IAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,uCAAuC;AACvC,IAAM,qBAAqB,GAAG,8BAA8B,CAAC;AAE7D,mFAAmF;AACnF,SAAgB,WAAW;IACzB,OAAO,UAAA,IAAI;QACT,IAAI,CAAC,KAAK,CAAC,UAAA,IAAI;;YACb,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBAClC,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC3B,IAAM,OAAO,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,0CAAE,QAAQ,EAAE,CAAC;gBAE5C,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC;oBAChD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC;iBAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC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YACL,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,yEAAyE;IACzE,OAAO,OAAO,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,EAA3B,CAA2B,CAAC,CAAC;AAC7D,CAAC"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.dev/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.default = default_1;
11
- function default_1() {
12
- // Noop schematic so the CLI doesn't throw if users try to `ng add` this package.
13
- // Also allows us to add more functionality in the future.
14
- return () => { };
15
- }
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvZ29vZ2xlLW1hcHMvc2NoZW1hdGljcy9uZy1hZGQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7QUFJSCw0QkFJQztBQUpEO0lBQ0UsaUZBQWlGO0lBQ2pGLDBEQUEwRDtJQUMxRCxPQUFPLEdBQUcsRUFBRSxHQUFFLENBQUMsQ0FBQztBQUNsQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuZGV2L2xpY2Vuc2VcbiAqL1xuXG5pbXBvcnQge1J1bGV9IGZyb20gJ0Bhbmd1bGFyLWRldmtpdC9zY2hlbWF0aWNzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gKCk6IFJ1bGUge1xuICAvLyBOb29wIHNjaGVtYXRpYyBzbyB0aGUgQ0xJIGRvZXNuJ3QgdGhyb3cgaWYgdXNlcnMgdHJ5IHRvIGBuZyBhZGRgIHRoaXMgcGFja2FnZS5cbiAgLy8gQWxzbyBhbGxvd3MgdXMgdG8gYWRkIG1vcmUgZnVuY3Rpb25hbGl0eSBpbiB0aGUgZnV0dXJlLlxuICByZXR1cm4gKCkgPT4ge307XG59XG4iXX0=
@@ -1,120 +0,0 @@
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
-
25
- // bazel-out/k8-fastbuild/bin/src/google-maps/schematics/ng-update/index.mjs
26
- var ng_update_exports = {};
27
- __export(ng_update_exports, {
28
- updateToV19: () => updateToV19
29
- });
30
- module.exports = __toCommonJS(ng_update_exports);
31
- var import_typescript = __toESM(require("typescript"), 1);
32
- var TAG_NAME = "map-marker-clusterer";
33
- var MODULE_NAME = "@angular/google-maps";
34
- var CLASS_NAME = "MapMarkerClusterer";
35
- var DEPRECATED_CLASS_NAME = "DeprecatedMapMarkerClusterer";
36
- function updateToV19() {
37
- return (tree) => {
38
- tree.visit((path) => {
39
- var _a;
40
- if (path.includes("node_modules")) {
41
- return;
42
- }
43
- if (path.endsWith(".html")) {
44
- const content = (_a = tree.read(path)) == null ? void 0 : _a.toString();
45
- if (content && content.includes("<" + TAG_NAME)) {
46
- tree.overwrite(path, migrateHtml(content));
47
- }
48
- } else if (path.endsWith(".ts") && !path.endsWith(".d.ts")) {
49
- migrateTypeScript(path, tree);
50
- }
51
- });
52
- };
53
- }
54
- function migrateHtml(content) {
55
- return content.replace(/<map-marker-clusterer/g, "<deprecated-map-marker-clusterer").replace(/<\/map-marker-clusterer/g, "</deprecated-map-marker-clusterer");
56
- }
57
- function migrateTypeScript(path, tree) {
58
- var _a;
59
- const content = (_a = tree.read(path)) == null ? void 0 : _a.toString();
60
- if (!content || !content.includes("<" + TAG_NAME) && !content.includes(MODULE_NAME) && !content.includes(CLASS_NAME)) {
61
- return;
62
- }
63
- const sourceFile = import_typescript.default.createSourceFile(path, content, import_typescript.default.ScriptTarget.Latest, true);
64
- const toMigrate = findTypeScriptNodesToMigrate(sourceFile);
65
- if (toMigrate.length === 0) {
66
- return;
67
- }
68
- const printer = import_typescript.default.createPrinter();
69
- const update = tree.beginUpdate(path);
70
- for (const node of toMigrate) {
71
- let replacement;
72
- if (import_typescript.default.isStringLiteralLike(node)) {
73
- if (import_typescript.default.isStringLiteral(node)) {
74
- replacement = import_typescript.default.factory.createStringLiteral(migrateHtml(node.text), node.getText()[0] === `'`);
75
- } else {
76
- replacement = import_typescript.default.factory.createNoSubstitutionTemplateLiteral(migrateHtml(node.text));
77
- }
78
- } else {
79
- const propertyName = import_typescript.default.factory.createIdentifier(DEPRECATED_CLASS_NAME);
80
- const name = node.name;
81
- replacement = import_typescript.default.isImportSpecifier(node) ? import_typescript.default.factory.updateImportSpecifier(node, node.isTypeOnly, propertyName, name) : import_typescript.default.factory.updateExportSpecifier(node, node.isTypeOnly, propertyName, name);
82
- }
83
- update.remove(node.getStart(), node.getWidth()).insertLeft(node.getStart(), printer.printNode(import_typescript.default.EmitHint.Unspecified, replacement, sourceFile));
84
- }
85
- tree.commitUpdate(update);
86
- }
87
- function findTypeScriptNodesToMigrate(sourceFile) {
88
- const results = [];
89
- sourceFile.forEachChild(function walk(node) {
90
- var _a;
91
- if (import_typescript.default.isStringLiteral(node) && node.text.includes("<" + TAG_NAME)) {
92
- results.push(node);
93
- } else if ((import_typescript.default.isImportDeclaration(node) || import_typescript.default.isExportDeclaration(node)) && node.moduleSpecifier && import_typescript.default.isStringLiteralLike(node.moduleSpecifier) && node.moduleSpecifier.text === MODULE_NAME) {
94
- const bindings = import_typescript.default.isImportDeclaration(node) ? (_a = node.importClause) == null ? void 0 : _a.namedBindings : node.exportClause;
95
- if (bindings && (import_typescript.default.isNamedImports(bindings) || import_typescript.default.isNamedExports(bindings))) {
96
- bindings.elements.forEach((element) => {
97
- const symbolName = element.propertyName || element.name;
98
- if (import_typescript.default.isIdentifier(symbolName) && symbolName.text === CLASS_NAME) {
99
- results.push(element);
100
- }
101
- });
102
- }
103
- } else {
104
- node.forEachChild(walk);
105
- }
106
- });
107
- return results.sort((a, b) => b.getStart() - a.getStart());
108
- }
109
- // Annotate the CommonJS export names for ESM import in node:
110
- 0 && (module.exports = {
111
- updateToV19
112
- });
113
- /**
114
- * @license
115
- * Copyright Google LLC All Rights Reserved.
116
- *
117
- * Use of this source code is governed by an MIT-style license that can be
118
- * found in the LICENSE file at https://angular.dev/license
119
- */
120
- //# sourceMappingURL=index_bundled.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../src/google-maps/schematics/ng-update/index.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.dev/license\n */\n\nimport {Path} from '@angular-devkit/core';\nimport {Rule, Tree} from '@angular-devkit/schematics';\nimport ts from 'typescript';\n\n/** Tag name of the clusterer component. */\nconst TAG_NAME = 'map-marker-clusterer';\n\n/** Module from which the clusterer is being imported. */\nconst MODULE_NAME = '@angular/google-maps';\n\n/** Old name of the clusterer class. */\nconst CLASS_NAME = 'MapMarkerClusterer';\n\n/** New name of the clusterer class. */\nconst DEPRECATED_CLASS_NAME = 'DeprecatedMapMarkerClusterer';\n\n/** Entry point for the migration schematics with target of Angular Material v19 */\nexport function updateToV19(): Rule {\n return tree => {\n tree.visit(path => {\n if (path.includes('node_modules')) {\n return;\n }\n\n if (path.endsWith('.html')) {\n const content = tree.read(path)?.toString();\n\n if (content && content.includes('<' + TAG_NAME)) {\n tree.overwrite(path, migrateHtml(content));\n }\n } else if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {\n migrateTypeScript(path, tree);\n }\n });\n };\n}\n\n/** Migrates an HTML template from the old tag name to the new one. */\nfunction migrateHtml(content: string): string {\n return content\n .replace(/<map-marker-clusterer/g, '<deprecated-map-marker-clusterer')\n .replace(/<\\/map-marker-clusterer/g, '</deprecated-map-marker-clusterer');\n}\n\n/** Migrates a TypeScript file from the old tag and class names to the new ones. */\nfunction migrateTypeScript(path: Path, tree: Tree) {\n const content = tree.read(path)?.toString();\n\n // Exit early if none of the symbols we're looking for are mentioned.\n if (\n !content ||\n (!content.includes('<' + TAG_NAME) &&\n !content.includes(MODULE_NAME) &&\n !content.includes(CLASS_NAME))\n ) {\n return;\n }\n\n const sourceFile = ts.createSourceFile(path, content, ts.ScriptTarget.Latest, true);\n const toMigrate = findTypeScriptNodesToMigrate(sourceFile);\n\n if (toMigrate.length === 0) {\n return;\n }\n\n const printer = ts.createPrinter();\n const update = tree.beginUpdate(path);\n\n for (const node of toMigrate) {\n let replacement: ts.Node;\n\n if (ts.isStringLiteralLike(node)) {\n // Strings should be migrated as if they're HTML.\n if (ts.isStringLiteral(node)) {\n replacement = ts.factory.createStringLiteral(\n migrateHtml(node.text),\n node.getText()[0] === `'`,\n );\n } else {\n replacement = ts.factory.createNoSubstitutionTemplateLiteral(migrateHtml(node.text));\n }\n } else {\n // Imports/exports should preserve the old name, but import the clusterer using the new one.\n const propertyName = ts.factory.createIdentifier(DEPRECATED_CLASS_NAME);\n const name = node.name as ts.Identifier;\n\n replacement = ts.isImportSpecifier(node)\n ? ts.factory.updateImportSpecifier(node, node.isTypeOnly, propertyName, name)\n : ts.factory.updateExportSpecifier(node, node.isTypeOnly, propertyName, name);\n }\n\n update\n .remove(node.getStart(), node.getWidth())\n .insertLeft(\n node.getStart(),\n printer.printNode(ts.EmitHint.Unspecified, replacement, sourceFile),\n );\n }\n\n tree.commitUpdate(update);\n}\n\n/** Finds the TypeScript nodes that need to be migrated from a specific file. */\nfunction findTypeScriptNodesToMigrate(sourceFile: ts.SourceFile) {\n const results: (ts.StringLiteralLike | ts.ImportSpecifier | ts.ExportSpecifier)[] = [];\n\n sourceFile.forEachChild(function walk(node) {\n // Most likely a template using the clusterer.\n if (ts.isStringLiteral(node) && node.text.includes('<' + TAG_NAME)) {\n results.push(node);\n } else if (\n // Import/export referencing the clusterer.\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&\n node.moduleSpecifier &&\n ts.isStringLiteralLike(node.moduleSpecifier) &&\n node.moduleSpecifier.text === MODULE_NAME\n ) {\n const bindings = ts.isImportDeclaration(node)\n ? node.importClause?.namedBindings\n : node.exportClause;\n\n if (bindings && (ts.isNamedImports(bindings) || ts.isNamedExports(bindings))) {\n bindings.elements.forEach(element => {\n const symbolName = element.propertyName || element.name;\n\n if (ts.isIdentifier(symbolName) && symbolName.text === CLASS_NAME) {\n results.push(element);\n }\n });\n }\n } else {\n node.forEachChild(walk);\n }\n });\n\n // Sort the results in reverse order to make applying the updates easier.\n return results.sort((a, b) => b.getStart() - a.getStart());\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAUA,wBAAe;AAGf,IAAM,WAAW;AAGjB,IAAM,cAAc;AAGpB,IAAM,aAAa;AAGnB,IAAM,wBAAwB;AAGxB,SAAU,cAAW;AACzB,SAAO,UAAO;AACZ,SAAK,MAAM,UAAO;AA3BtB;AA4BM,UAAI,KAAK,SAAS,cAAc,GAAG;AACjC;MACF;AAEA,UAAI,KAAK,SAAS,OAAO,GAAG;AAC1B,cAAM,WAAU,UAAK,KAAK,IAAI,MAAd,mBAAiB;AAEjC,YAAI,WAAW,QAAQ,SAAS,MAAM,QAAQ,GAAG;AAC/C,eAAK,UAAU,MAAM,YAAY,OAAO,CAAC;QAC3C;MACF,WAAW,KAAK,SAAS,KAAK,KAAK,CAAC,KAAK,SAAS,OAAO,GAAG;AAC1D,0BAAkB,MAAM,IAAI;MAC9B;IACF,CAAC;EACH;AACF;AAGA,SAAS,YAAY,SAAe;AAClC,SAAO,QACJ,QAAQ,0BAA0B,kCAAkC,EACpE,QAAQ,4BAA4B,mCAAmC;AAC5E;AAGA,SAAS,kBAAkB,MAAY,MAAU;AArDjD;AAsDE,QAAM,WAAU,UAAK,KAAK,IAAI,MAAd,mBAAiB;AAGjC,MACE,CAAC,WACA,CAAC,QAAQ,SAAS,MAAM,QAAQ,KAC/B,CAAC,QAAQ,SAAS,WAAW,KAC7B,CAAC,QAAQ,SAAS,UAAU,GAC9B;AACA;EACF;AAEA,QAAM,aAAa,kBAAAA,QAAG,iBAAiB,MAAM,SAAS,kBAAAA,QAAG,aAAa,QAAQ,IAAI;AAClF,QAAM,YAAY,6BAA6B,UAAU;AAEzD,MAAI,UAAU,WAAW,GAAG;AAC1B;EACF;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