@arcgis/codemod 5.2.0-next.9 → 5.2.0-next.91

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/LICENSE.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # Licensing
2
2
 
3
- COPYRIGHT © Esri
3
+ COPYRIGHT Esri
4
4
 
5
5
  All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
6
6
 
7
- This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
7
+ This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement.
8
8
  You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
9
9
 
10
+ See use restrictions at https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf.
11
+
10
12
  For additional information, contact:
11
13
  Environmental Systems Research Institute, Inc.
12
14
  Attn: Contracts and Legal Services Department
package/README.md CHANGED
@@ -8,6 +8,7 @@ This package provides automated refactors to help migrate away from deprecated o
8
8
 
9
9
  - Automated refactor to remove `__esri` namespace usage
10
10
  - Converts global namespace types to explicit `@arcgis/core` imports
11
+ - Normalizes legacy Calcite icon names
11
12
  - Detects edge cases and warns when changes can’t be safely automated
12
13
  - Respects `.gitignore` by default
13
14
 
@@ -17,9 +18,18 @@ This package provides automated refactors to help migrate away from deprecated o
17
18
  - A project using the ArcGIS Maps SDK for JavaScript
18
19
  - This codemod operates exclusively on TypeScript files. Do not need to run this tool, if the project does not use TypeScript.
19
20
 
21
+ ## Before you begin
22
+
23
+ If your project uses **ESLint, Prettier, or other formatters/linters**, run them after the codemod to ensure consistent formatting.
24
+
25
+ > [!Note]
26
+ > This codemod modifies files in place and does not provide an interactive dry-run mode. We recommend running it in a project that is under version control (Git) so you can review changes using `git diff` or your IDE’s diff tools. If your project is not under version control, create a backup before running the codemod.
27
+
20
28
  ## Usage
21
29
 
22
- The codemod replaces `__esri` types with explicit imports from @arcgis/core.
30
+ ### Refactor out the `__esri` namespace
31
+
32
+ The `refactor-out-esri-namespace` codemod replaces `__esri` types with explicit imports from `@arcgis/core`.
23
33
 
24
34
  > Note: Before running the codemod, update all `@arcgis/*` packages in your `package.json` to the most recent version.
25
35
 
@@ -36,7 +46,7 @@ You can manually run it on a different directory by providing an argument:
36
46
  npx @arcgis/codemod run refactor-out-esri-namespace target-directory
37
47
  ```
38
48
 
39
- ### What codemod does
49
+ #### What the codemod does
40
50
 
41
51
  **Before:**
42
52
 
@@ -56,7 +66,7 @@ let geometry: Geometry;
56
66
  let featureSet: FeatureSet;
57
67
  ```
58
68
 
59
- ### Warnings (Manual review required)
69
+ #### Warnings (manual review required)
60
70
 
61
71
  The codemod will emit warnings for cases it cannot safely rewrite, including:
62
72
 
@@ -65,11 +75,36 @@ The codemod will emit warnings for cases it cannot safely rewrite, including:
65
75
  - Unresolvable symbols
66
76
 
67
77
  These will be reported in the console, manually review all changes before committing.
68
- If your project uses **ESLint, Prettier, or other formatters/linters**, run them after the codemod to ensure consistent formatting.
69
78
 
70
- > Note: This codemod modifies files in place and does not provide an interactive dry-run mode. We recommend running it in a project that is under version control (Git) so you can review changes using `git diff` or your IDE’s diff tools. If your project is not under version control, create a backup before running the codemod.
79
+ ### Normalize Calcite icon names
80
+
81
+ The `normalize-calcite-icon-names` codemod updates camelCase and legacy Calcite icon names to their normalized kebab-case equivalents. It handles icon attributes on Calcite components and traces icon values through variables, properties, assignments, function returns, and forwarded component properties. This helps prepare for [calcite-design-system#14967](https://github.com/Esri/calcite-design-system/issues/14967) and [calcite-design-system#14966](https://github.com/Esri/calcite-design-system/issues/14966).
82
+
83
+ Run it in the root of your project:
84
+
85
+ ```sh
86
+ npx @arcgis/codemod run normalize-calcite-icon-names
87
+ ```
88
+
89
+ You can also provide a target directory:
90
+
91
+ ```sh
92
+ npx @arcgis/codemod run normalize-calcite-icon-names target-directory
93
+ ```
94
+
95
+ **Before:**
96
+
97
+ ```tsx
98
+ <calcite-button iconStart="i3dGlasses" iconEnd="arrowLeft10" />
99
+ ```
100
+
101
+ **After:**
102
+
103
+ ```tsx
104
+ <calcite-button iconStart="3d-glasses" iconEnd="arrow-left-10" />
105
+ ```
71
106
 
72
107
  ## License
73
108
 
74
- This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.1/LICENSE.txt.
75
- For third party notices, see https://js.arcgis.com/5.1/third-party-notices.txt.
109
+ This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.2/LICENSE.txt.
110
+ For third party notices, see https://js.arcgis.com/5.2/third-party-notices.txt.
@@ -1,6 +1,6 @@
1
- import { path as T } from "@arcgis/components-build-utils";
1
+ import { path as T } from "@arcgis/node-toolkit/path";
2
2
  import { SyntaxKind as g } from "ts-morph";
3
- import { g as x } from "./cli-DPzs7oKq.js";
3
+ import { g as x } from "./cli-DJQ7NdBK.js";
4
4
  import { ModuleResolutionKind as D } from "typescript";
5
5
  import { capitalize as S } from "@arcgis/toolkit/string";
6
6
  import { log as q } from "@arcgis/toolkit/log";
@@ -0,0 +1,269 @@
1
+ import { log as y } from "@arcgis/toolkit/log";
2
+ import { Command as U } from "@commander-js/extra-typings";
3
+ import { statSync as B } from "node:fs";
4
+ import { getCwd as k, path as e, toPosixPathSeparators as W } from "@arcgis/node-toolkit/path";
5
+ import "ts-morph";
6
+ import c from "typescript";
7
+ import { existsAsync as q, asyncFindPath as M } from "@arcgis/node-toolkit/file";
8
+ import { asyncRetrievePackageJson as L } from "@arcgis/node-toolkit/packageJson";
9
+ import { glob as $ } from "tinyglobby";
10
+ import { gitIgnoreFileToGlobs as A } from "@arcgis/node-toolkit/glob";
11
+ import { identity as _ } from "@arcgis/toolkit/function";
12
+ import { styleText as F } from "node:util";
13
+ const z = (t, o, n) => {
14
+ const r = t[o];
15
+ return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((l, i) => {
16
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(i.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + o + (o.split("/").length !== n ? ". Note that variables only represent file names one level deep." : ""))));
17
+ });
18
+ }, ye = {
19
+ allowImportingTsExtensions: !0,
20
+ allowJs: !0,
21
+ allowArbitraryExtensions: !0,
22
+ allowSyntheticDefaultImports: !0,
23
+ checkJs: !0,
24
+ experimentalDecorators: !0,
25
+ forceConsistentCasingInFileNames: !1,
26
+ isolatedModules: !1,
27
+ isolatedDeclarations: !1,
28
+ jsx: c.JsxEmit.Preserve,
29
+ lib: ["lib.esnext.d.ts", "lib.dom.d.ts"],
30
+ module: c.ModuleKind.ESNext,
31
+ moduleResolution: c.ModuleResolutionKind.Bundler,
32
+ moduleDetection: c.ModuleDetectionKind.Auto,
33
+ strict: !1,
34
+ target: c.ScriptTarget.ESNext,
35
+ resolveJsonModule: !0,
36
+ esModuleInterop: !0
37
+ }, j = {
38
+ codemod: void 0,
39
+ codemodName: void 0,
40
+ projectsData: void 0,
41
+ project: void 0
42
+ };
43
+ async function H() {
44
+ const { ignorePatterns: t, globRoot: o } = await Q(), n = await V(o);
45
+ return t.push(...n), { ignorePatterns: t, globRoot: o };
46
+ }
47
+ async function Q() {
48
+ const t = [];
49
+ let o, n = k(), r = e.dirname(n);
50
+ do {
51
+ o = r;
52
+ const l = e.join(o, ".gitignore");
53
+ if (await q(l)) {
54
+ n = e.dirname(l);
55
+ const g = e.relative(n, k()).split("/"), P = A(l);
56
+ for (const u of P) {
57
+ const h = u.startsWith("!") ? u.slice(1) : u, p = h.search(/[*?[]/u), w = p === -1 ? h : h.slice(0, p), v = w.split("/"), s = p !== -1 && !w.endsWith("/");
58
+ let a = !0;
59
+ const d = Math.min(g.length, v.length);
60
+ for (let m = 0; m < d; m++) {
61
+ const f = v[m];
62
+ if (!(s && m === v.length - 1 ? g[m].startsWith(f) : g[m] === f) && f !== "") {
63
+ a = !1;
64
+ break;
65
+ }
66
+ }
67
+ a && (u.startsWith("!") || t.push(u));
68
+ }
69
+ }
70
+ r = e.dirname(o);
71
+ } while (r !== o);
72
+ return { ignorePatterns: t, globRoot: n };
73
+ }
74
+ async function V(t) {
75
+ return (await $("**/.gitignore", {
76
+ cwd: k(),
77
+ // Gitignore files are unlikely to be symbolic links
78
+ followSymbolicLinks: !1,
79
+ // Don't look for ignore files in these places for speed:
80
+ ignore: [
81
+ // Hardcoded ignores in TypeScript
82
+ "**/node_modules/**",
83
+ "**/bower_components/**",
84
+ "**/jspm_packages/**",
85
+ // Default build output folder in bundlers
86
+ "**/dist/**"
87
+ ],
88
+ // Not applicable for our glob pattern
89
+ expandDirectories: !1
90
+ })).flatMap((n) => {
91
+ const r = e.relative(t, e.dirname(n)), l = A(n), i = [];
92
+ for (const g of l)
93
+ g.startsWith("!") || i.push(e.join(r, g));
94
+ return i;
95
+ });
96
+ }
97
+ const X = ["js", "jsx", "mjs", "cjs"], Y = ["ts", "tsx", "mts", "cts"], Z = ["json"], ee = `**/*.{${[...X, ...Y, ...Z].join(",")}}`;
98
+ async function te() {
99
+ const t = await H(), o = e.join(process.cwd(), ee), n = await $(o, {
100
+ cwd: t.globRoot,
101
+ ignore: t.ignorePatterns,
102
+ // The files we are looking for are unlikely to be symbolic links
103
+ followSymbolicLinks: !1,
104
+ // Not applicable for our glob pattern
105
+ expandDirectories: !1
106
+ // Files and folders starting with . are excluded (matches TypeScript's
107
+ // default behavior). If any tsconfig.json explicitly includes such files,
108
+ // they will still be codemodded.
109
+ });
110
+ let r = e.relative(t.globRoot, process.cwd());
111
+ r !== "" && (r += "/");
112
+ const l = e.join(e.resolve(t.globRoot), "/"), i = l.length + r.length, g = [], P = [], u = /* @__PURE__ */ new Set();
113
+ for (const s of n) {
114
+ const a = l + s;
115
+ if (s.endsWith(".json")) {
116
+ const d = e.basename(s);
117
+ d === "package.json" ? g.push(a) : (d.startsWith("tsconfig.") || d.startsWith("jsconfig.")) && P.push(a);
118
+ } else {
119
+ const d = s.slice(r.length);
120
+ u.add(d);
121
+ }
122
+ }
123
+ let h = await M("tsconfig.json", e.dirname(process.cwd()));
124
+ h !== void 0 && (h = W(h), P.push(h)), P.sort((s, a) => {
125
+ const d = a.split("/").length - s.split("/").length;
126
+ if (d !== 0)
127
+ return d;
128
+ const m = e.basename(s), f = e.basename(a);
129
+ return m === f ? 0 : m.endsWith("tsconfig.json") ? -1 : f.endsWith("tsconfig.json") ? 1 : m.endsWith("tsconfig.build.json") ? -1 : f.endsWith("tsconfig.build.json") ? 1 : m.localeCompare(f);
130
+ });
131
+ let p = await M("package.json");
132
+ p !== void 0 && (p = W(p));
133
+ const w = [], v = /* @__PURE__ */ new Set();
134
+ if (await Promise.all(
135
+ P.map(async (s) => {
136
+ const a = e.relative(process.cwd(), s), d = c.readConfigFile(s, c.sys.readFile);
137
+ if (d.error !== void 0) {
138
+ y(
139
+ "error",
140
+ a,
141
+ c.formatDiagnosticsWithColorAndContext([d.error], {
142
+ getCanonicalFileName: _,
143
+ getCurrentDirectory: c.sys.getCurrentDirectory,
144
+ getNewLine: () => c.sys.newLine
145
+ })
146
+ );
147
+ return;
148
+ }
149
+ const m = e.basename(a), f = c.parseJsonConfigFileContent(
150
+ d.config,
151
+ c.sys,
152
+ e.dirname(s),
153
+ void 0,
154
+ m
155
+ ), R = 18003;
156
+ f.errors.filter((b) => b.code !== R).length > 0 && y(
157
+ "warn",
158
+ a,
159
+ c.formatDiagnosticsWithColorAndContext(f.errors, {
160
+ getCanonicalFileName: _,
161
+ getCurrentDirectory: c.sys.getCurrentDirectory,
162
+ getNewLine: () => c.sys.newLine
163
+ })
164
+ );
165
+ const E = s === h, O = a === m, N = f.fileNames.filter((b) => {
166
+ const D = b.slice(i);
167
+ return u.delete(D) ? (v.add(D), !0) : v.has(D) || D.endsWith(".json") || b.includes("node_modules") ? !1 : !E;
168
+ });
169
+ if (N.length === 0)
170
+ return;
171
+ P.length === 1 && (E || O) && u.clear();
172
+ const S = e.dirname(s);
173
+ let x = S, C = p;
174
+ do {
175
+ const b = e.join(x, "package.json");
176
+ if (g.includes(b)) {
177
+ C = b;
178
+ break;
179
+ }
180
+ } while (x !== t.globRoot && (x = e.dirname(x)));
181
+ const J = C === void 0 ? void 0 : { filePath: C, contents: await L(e.dirname(C)) }, K = {
182
+ typeScriptConfig: {
183
+ filePath: s,
184
+ compilerOptions: f.options
185
+ },
186
+ packageJson: J,
187
+ logName: F("blue", J?.contents?.name ?? S),
188
+ cwd: S,
189
+ filePaths: N
190
+ };
191
+ w.push(K);
192
+ })
193
+ ), u.size > 0) {
194
+ const s = p === void 0 ? void 0 : {
195
+ filePath: p,
196
+ contents: await L(e.dirname(p))
197
+ };
198
+ w.push({
199
+ typeScriptConfig: void 0,
200
+ packageJson: s,
201
+ cwd: process.cwd(),
202
+ logName: F("blue", s?.contents?.name ?? process.cwd()),
203
+ filePaths: Array.from(u).map((a) => e.join(process.cwd(), a))
204
+ });
205
+ }
206
+ return w.sort((s, a) => s.cwd.localeCompare(a.cwd)), j.projectsData = w, w;
207
+ }
208
+ let T = !1;
209
+ function oe() {
210
+ T || (T = !0, process.exitCode !== void 0 && process.exitCode !== 0 ? y(
211
+ "warn",
212
+ j.codemodName,
213
+ "One or more exceptions occurred during the codemod run. Please review the output above."
214
+ ) : y(
215
+ "info",
216
+ j.codemodName,
217
+ `${F("green", "Codemod completed successfully.")} Recommended next steps:
218
+ - Review the codemod changes.
219
+ - If your project uses ESLint, run ESLint autofix on the changed files.
220
+ - If your project uses Prettier, run Prettier on the changed files.
221
+ - If your project uses TypeScript, run type checking to ensure there are no type errors.`
222
+ ));
223
+ }
224
+ async function se(t, o) {
225
+ j.codemod = t, j.codemodName = o;
226
+ const n = await te();
227
+ if (n.length === 0) {
228
+ y("error", o, `Failed to find any .js or .ts files in ${process.cwd()} to run the codemod on.`), process.exitCode = 1;
229
+ return;
230
+ }
231
+ await t.run(n), oe();
232
+ }
233
+ const I = new U();
234
+ I.name("@arcgis/codemod").description("Codemod for migrating or refactoring usages of ArcGIS Maps SDK for JavaScript");
235
+ I.command("run").description("Run a single codemod").argument("<codemodName>", "Name of the transform").argument("[path]", "Directory to transform", process.cwd()).action(ne);
236
+ async function ne(t, o) {
237
+ const n = B(o, { throwIfNoEntry: !1 });
238
+ if (n === void 0) {
239
+ y("error", "@arcgis/codemod", `Failed to find the target path: ${o}`), process.exitCode = 1;
240
+ return;
241
+ }
242
+ const r = n.isFile();
243
+ process.chdir(r ? e.dirname(o) : o);
244
+ let l;
245
+ try {
246
+ l = await z(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod-CUdF3oIK.js"), "./codemods/lumina-component-extras-improvements/codemod.ts": () => import("./codemod-CPBSioID.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod-ByVDKNVh.js"), "./codemods/normalize-calcite-icon-names/codemod.ts": () => import("./codemod-TKeUnFf8.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod-CDDi4e40.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod-DgA0GL73.js") }), `./codemods/${t}/codemod.ts`, 4);
247
+ } catch (i) {
248
+ if (
249
+ // direct Node execution
250
+ typeof i == "object" && i !== null && "code" in i && i.code === "ERR_MODULE_NOT_FOUND" && "url" in i && typeof i.url == "string" && i.url.endsWith(`${e.sep}${t}${e.sep}codemod.ts`) || // Vite build execution
251
+ String(i).includes("Unknown variable dynamic import:")
252
+ ) {
253
+ y("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
254
+ return;
255
+ } else
256
+ throw i;
257
+ }
258
+ if (typeof l.codemod != "object" || l.codemod === null) {
259
+ y("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
260
+ return;
261
+ }
262
+ await se(l.codemod, F("blue", t));
263
+ }
264
+ I.parse();
265
+ export {
266
+ ye as d,
267
+ j as g,
268
+ oe as p
269
+ };
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
- import "./cli-DPzs7oKq.js";
1
+ import "./cli-DJQ7NdBK.js";
2
2
  import "@arcgis/toolkit/log";
3
3
  import "@commander-js/extra-typings";
4
4
  import "node:fs";
5
- import "@arcgis/components-build-utils";
5
+ import "@arcgis/node-toolkit/path";
6
6
  import "node:util";
@@ -0,0 +1,140 @@
1
+ var p = (i, o) => (o = Symbol[i]) ? o : /* @__PURE__ */ Symbol.for("Symbol." + i), f = (i) => {
2
+ throw TypeError(i);
3
+ };
4
+ var g = (i, o, a) => {
5
+ if (o != null) {
6
+ typeof o != "object" && typeof o != "function" && f("Object expected");
7
+ var n, t;
8
+ a && (n = o[p("asyncDispose")]), n === void 0 && (n = o[p("dispose")], a && (t = n)), typeof n != "function" && f("Object not disposable"), t && (n = function() {
9
+ try {
10
+ t.call(this);
11
+ } catch (r) {
12
+ return Promise.reject(r);
13
+ }
14
+ }), i.push([a, n, o]);
15
+ } else a && i.push([a]);
16
+ return o;
17
+ }, m = (i, o, a) => {
18
+ var n = typeof SuppressedError == "function" ? SuppressedError : function(e, s, c, l) {
19
+ return l = Error(c), l.name = "SuppressedError", l.error = e, l.suppressed = s, l;
20
+ }, t = (e) => o = a ? new n(e, o, "An error was suppressed during disposal") : (a = !0, e), r = (e) => {
21
+ for (; e = i.pop(); )
22
+ try {
23
+ var s = e[1] && e[1].call(e[2]);
24
+ if (e[0]) return Promise.resolve(s).then(r, (c) => (t(c), r()));
25
+ } catch (c) {
26
+ t(c);
27
+ }
28
+ if (a) throw o;
29
+ };
30
+ return r();
31
+ };
32
+ import { f as h, p as P } from "./actions-Cc94nYsB.js";
33
+ import { log as k } from "@arcgis/toolkit/log";
34
+ import { writeFile as u } from "node:fs/promises";
35
+ import { c as y } from "./useProjectInstance-PcBD3mbo.js";
36
+ import { p as x, g as J } from "./cli-DJQ7NdBK.js";
37
+ async function v(i, o) {
38
+ const a = /* @__PURE__ */ new Set();
39
+ for (const n of i) {
40
+ const t = n.packageJson;
41
+ if (t === void 0 || a.has(t.filePath))
42
+ continue;
43
+ a.add(t.filePath);
44
+ const r = t.contents;
45
+ try {
46
+ const e = await o(r, t.filePath);
47
+ r !== e && await u(t.filePath, `${JSON.stringify(e, null, 2)}
48
+ `, "utf8");
49
+ } catch (e) {
50
+ process.exitCode = 1, k(
51
+ "error",
52
+ h(t.filePath),
53
+ `Error occurred while migrating: ${String(e)}`,
54
+ typeof e == "object" && e !== null && "stack" in e ? { detail: { stack: e.stack } } : void 0
55
+ );
56
+ }
57
+ }
58
+ }
59
+ function D(i, o) {
60
+ for (const a of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
61
+ const n = i[a];
62
+ if (n) {
63
+ const t = o(n, a);
64
+ t !== n && (i = { ...i, [a]: t });
65
+ }
66
+ }
67
+ return i;
68
+ }
69
+ const d = "@arcgis/components-build-utils", S = {
70
+ [d]: {
71
+ existsAsync: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
72
+ // Command-string helpers require manual tokenization before using command-plus-args helpers.
73
+ sh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
74
+ // sp was removed from node-toolkit; collectOutputSync is the closest return-value replacement.
75
+ sp: { do: "rename", name: "collectOutputSync", specifier: "@arcgis/node-toolkit/shell" },
76
+ asyncSh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
77
+ findPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
78
+ asyncFindPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
79
+ createFileIfNotExists: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
80
+ gitIgnoreFileToGlobs: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
81
+ gitIgnoreToGlob: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
82
+ isPosix: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
83
+ toPosixPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
84
+ normalizePath: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
85
+ toSystemPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
86
+ getCwd: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
87
+ path: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
88
+ PackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
89
+ retrievePackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
90
+ asyncRetrievePackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
91
+ fetchPackageLocation: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
92
+ detectPackageManager: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
93
+ DependencyManagementOptions: {
94
+ do: "rename",
95
+ specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
96
+ },
97
+ vitePresetPlugin: { do: "rename", specifier: "@arcgis/node-toolkit/vite/presetPlugin" },
98
+ externalizeDependencies: {
99
+ do: "rename",
100
+ specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
101
+ }
102
+ }
103
+ }, C = {
104
+ meta: {
105
+ needsTypeInformation: !1
106
+ },
107
+ async run(i) {
108
+ await v(
109
+ i,
110
+ (r) => D(
111
+ r,
112
+ (e) => e[d] ? {
113
+ ...e,
114
+ [d]: void 0,
115
+ "@arcgis/node-toolkit": e[d]
116
+ } : e
117
+ )
118
+ );
119
+ for (const r of i) {
120
+ var o = [];
121
+ try {
122
+ const e = g(o, y(r));
123
+ for (const s of e.getCodemodFiles())
124
+ P(s, S);
125
+ } catch (a) {
126
+ var n = a, t = !0;
127
+ } finally {
128
+ m(o, n, t);
129
+ }
130
+ }
131
+ x(), k(
132
+ "info",
133
+ J.codemodName,
134
+ "Next step: run npm install/pnpm install/yarn install to get @arcgis/node-toolkit package installed."
135
+ );
136
+ }
137
+ };
138
+ export {
139
+ C as codemod
140
+ };