@arcgis/codemod 5.2.0-next.8 → 5.2.0-next.84
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 +4 -2
- package/README.md +2 -2
- package/dist/actions-CakrAPrI.js +354 -0
- package/dist/{cli-mQ3ZNyiH.js → cli-3BztOTDV.js} +92 -82
- package/dist/cli.js +3 -2
- package/dist/codemod-8GvQmmZV.js +140 -0
- package/dist/codemod-Bz1NfItD.js +436 -0
- package/dist/codemod-CzsItZhZ.js +74 -0
- package/dist/{codemod-ul_pPsIY.js → codemod-Xx_q11AP.js} +5 -4
- package/dist/useProjectInstance-DiZc_C2o.js +50 -0
- package/package.json +11 -8
- package/dist/codemod-wiEaN6_r.js +0 -156
- package/dist/useProjectInstance-BeTuT4eH.js +0 -398
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { log as h } from "@arcgis/toolkit/log";
|
|
2
|
-
import { Command as
|
|
3
|
-
import { statSync as
|
|
4
|
-
import { getCwd as
|
|
2
|
+
import { Command as K } from "@commander-js/extra-typings";
|
|
3
|
+
import { statSync as U } from "node:fs";
|
|
4
|
+
import { getCwd as F, path as e, toPosixPathSeparators as J } from "@arcgis/node-toolkit/path";
|
|
5
5
|
import "ts-morph";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import a from "typescript";
|
|
7
|
+
import { existsAsync as B, asyncFindPath as W } from "@arcgis/node-toolkit/file";
|
|
8
|
+
import { asyncRetrievePackageJson as M } from "@arcgis/node-toolkit/packageJson";
|
|
9
|
+
import { glob as T } from "tinyglobby";
|
|
10
|
+
import { gitIgnoreFileToGlobs as $ } from "@arcgis/node-toolkit/glob";
|
|
11
|
+
import { identity as L } from "@arcgis/toolkit/function";
|
|
12
|
+
import { styleText as S } from "node:util";
|
|
10
13
|
const q = (t, o, n) => {
|
|
11
14
|
const r = t[o];
|
|
12
|
-
return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((
|
|
13
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
15
|
+
return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((c, 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." : ""))));
|
|
14
17
|
});
|
|
15
|
-
},
|
|
18
|
+
}, ye = {
|
|
16
19
|
allowImportingTsExtensions: !0,
|
|
17
20
|
allowJs: !0,
|
|
18
21
|
allowArbitraryExtensions: !0,
|
|
@@ -22,13 +25,13 @@ const q = (t, o, n) => {
|
|
|
22
25
|
forceConsistentCasingInFileNames: !1,
|
|
23
26
|
isolatedModules: !1,
|
|
24
27
|
isolatedDeclarations: !1,
|
|
25
|
-
jsx:
|
|
28
|
+
jsx: a.JsxEmit.Preserve,
|
|
26
29
|
lib: ["lib.esnext.d.ts", "lib.dom.d.ts"],
|
|
27
|
-
module:
|
|
28
|
-
moduleResolution:
|
|
29
|
-
moduleDetection:
|
|
30
|
+
module: a.ModuleKind.ESNext,
|
|
31
|
+
moduleResolution: a.ModuleResolutionKind.Bundler,
|
|
32
|
+
moduleDetection: a.ModuleDetectionKind.Auto,
|
|
30
33
|
strict: !1,
|
|
31
|
-
target:
|
|
34
|
+
target: a.ScriptTarget.ESNext,
|
|
32
35
|
resolveJsonModule: !0,
|
|
33
36
|
esModuleInterop: !0
|
|
34
37
|
}, j = {
|
|
@@ -43,13 +46,13 @@ async function z() {
|
|
|
43
46
|
}
|
|
44
47
|
async function H() {
|
|
45
48
|
const t = [];
|
|
46
|
-
let o, n =
|
|
49
|
+
let o, n = F(), r = e.dirname(n);
|
|
47
50
|
do {
|
|
48
51
|
o = r;
|
|
49
|
-
const
|
|
50
|
-
if (await
|
|
51
|
-
n = e.dirname(
|
|
52
|
-
const w = e.relative(n,
|
|
52
|
+
const c = e.join(o, ".gitignore");
|
|
53
|
+
if (await B(c)) {
|
|
54
|
+
n = e.dirname(c);
|
|
55
|
+
const w = e.relative(n, F()).split("/"), y = $(c);
|
|
53
56
|
for (const f of y) {
|
|
54
57
|
const m = (f.startsWith("!") ? f.slice(1) : f).split("*")[0].split("/");
|
|
55
58
|
let p = !0;
|
|
@@ -66,7 +69,8 @@ async function H() {
|
|
|
66
69
|
return { ignorePatterns: t, globRoot: n };
|
|
67
70
|
}
|
|
68
71
|
async function Q(t) {
|
|
69
|
-
return (await
|
|
72
|
+
return (await T("**/.gitignore", {
|
|
73
|
+
cwd: F(),
|
|
70
74
|
// Gitignore files are unlikely to be symbolic links
|
|
71
75
|
followSymbolicLinks: !1,
|
|
72
76
|
// Don't look for ignore files in these places for speed:
|
|
@@ -81,15 +85,15 @@ async function Q(t) {
|
|
|
81
85
|
// Not applicable for our glob pattern
|
|
82
86
|
expandDirectories: !1
|
|
83
87
|
})).flatMap((n) => {
|
|
84
|
-
const r = e.relative(t, e.dirname(n)),
|
|
85
|
-
for (const w of
|
|
86
|
-
w.startsWith("!") ||
|
|
87
|
-
return
|
|
88
|
+
const r = e.relative(t, e.dirname(n)), c = $(n), i = [];
|
|
89
|
+
for (const w of c)
|
|
90
|
+
w.startsWith("!") || i.push(e.join(r, w));
|
|
91
|
+
return i;
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
94
|
const V = ["js", "jsx", "mjs", "cjs"], X = ["ts", "tsx", "mts", "cts"], Y = ["json"], Z = `**/*.{${[...V, ...X, ...Y].join(",")}}`;
|
|
91
95
|
async function ee() {
|
|
92
|
-
const t = await z(), o = e.join(process.cwd(), Z), n = await
|
|
96
|
+
const t = await z(), o = e.join(process.cwd(), Z), n = await T(o, {
|
|
93
97
|
cwd: t.globRoot,
|
|
94
98
|
ignore: t.ignorePatterns,
|
|
95
99
|
// The files we are looking for are unlikely to be symbolic links
|
|
@@ -102,9 +106,9 @@ async function ee() {
|
|
|
102
106
|
});
|
|
103
107
|
let r = e.relative(t.globRoot, process.cwd());
|
|
104
108
|
r !== "" && (r += "/");
|
|
105
|
-
const
|
|
109
|
+
const c = e.join(e.resolve(t.globRoot), "/"), i = c.length + r.length, w = [], y = [], f = /* @__PURE__ */ new Set();
|
|
106
110
|
for (const s of n) {
|
|
107
|
-
const l =
|
|
111
|
+
const l = c + s;
|
|
108
112
|
if (s.endsWith(".json")) {
|
|
109
113
|
const d = e.basename(s);
|
|
110
114
|
d === "package.json" ? w.push(l) : (d.startsWith("tsconfig.") || d.startsWith("jsconfig.")) && y.push(l);
|
|
@@ -113,57 +117,57 @@ async function ee() {
|
|
|
113
117
|
f.add(d);
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
|
-
let v = await
|
|
117
|
-
v !== void 0 && (v =
|
|
120
|
+
let v = await W("tsconfig.json", e.dirname(process.cwd()));
|
|
121
|
+
v !== void 0 && (v = J(v), y.push(v)), y.sort((s, l) => {
|
|
118
122
|
const d = l.split("/").length - s.split("/").length;
|
|
119
123
|
if (d !== 0)
|
|
120
124
|
return d;
|
|
121
125
|
const b = e.basename(s), u = e.basename(l);
|
|
122
126
|
return b === u ? 0 : b.endsWith("tsconfig.json") ? -1 : u.endsWith("tsconfig.json") ? 1 : b.endsWith("tsconfig.build.json") ? -1 : u.endsWith("tsconfig.build.json") ? 1 : b.localeCompare(u);
|
|
123
127
|
});
|
|
124
|
-
let m = await
|
|
125
|
-
m !== void 0 && (m =
|
|
128
|
+
let m = await W("package.json");
|
|
129
|
+
m !== void 0 && (m = J(m));
|
|
126
130
|
const p = [], g = /* @__PURE__ */ new Set();
|
|
127
|
-
|
|
131
|
+
if (await Promise.all(
|
|
128
132
|
y.map(async (s) => {
|
|
129
|
-
const l = e.relative(process.cwd(), s), d =
|
|
133
|
+
const l = e.relative(process.cwd(), s), d = a.readConfigFile(s, a.sys.readFile);
|
|
130
134
|
if (d.error !== void 0) {
|
|
131
135
|
h(
|
|
132
136
|
"error",
|
|
133
137
|
l,
|
|
134
|
-
|
|
135
|
-
getCanonicalFileName:
|
|
136
|
-
getCurrentDirectory:
|
|
137
|
-
getNewLine: () =>
|
|
138
|
+
a.formatDiagnosticsWithColorAndContext([d.error], {
|
|
139
|
+
getCanonicalFileName: L,
|
|
140
|
+
getCurrentDirectory: a.sys.getCurrentDirectory,
|
|
141
|
+
getNewLine: () => a.sys.newLine
|
|
138
142
|
})
|
|
139
143
|
);
|
|
140
144
|
return;
|
|
141
145
|
}
|
|
142
|
-
const b = e.basename(l), u =
|
|
146
|
+
const b = e.basename(l), u = a.parseJsonConfigFileContent(
|
|
143
147
|
d.config,
|
|
144
|
-
|
|
148
|
+
a.sys,
|
|
145
149
|
e.dirname(s),
|
|
146
150
|
void 0,
|
|
147
151
|
b
|
|
148
|
-
),
|
|
149
|
-
u.errors.filter((P) => P.code !==
|
|
152
|
+
), A = 18003;
|
|
153
|
+
u.errors.filter((P) => P.code !== A).length > 0 && h(
|
|
150
154
|
"warn",
|
|
151
155
|
l,
|
|
152
|
-
|
|
153
|
-
getCanonicalFileName:
|
|
154
|
-
getCurrentDirectory:
|
|
155
|
-
getNewLine: () =>
|
|
156
|
+
a.formatDiagnosticsWithColorAndContext(u.errors, {
|
|
157
|
+
getCanonicalFileName: L,
|
|
158
|
+
getCurrentDirectory: a.sys.getCurrentDirectory,
|
|
159
|
+
getNewLine: () => a.sys.newLine
|
|
156
160
|
})
|
|
157
161
|
);
|
|
158
|
-
const
|
|
159
|
-
const D = P.slice(
|
|
160
|
-
return f.delete(D) ? (g.add(D), !0) : g.has(D) || D.endsWith(".json") || P.includes("node_modules") ? !1 : !
|
|
162
|
+
const I = s === v, G = l === b, N = u.fileNames.filter((P) => {
|
|
163
|
+
const D = P.slice(i);
|
|
164
|
+
return f.delete(D) ? (g.add(D), !0) : g.has(D) || D.endsWith(".json") || P.includes("node_modules") ? !1 : !I;
|
|
161
165
|
});
|
|
162
|
-
if (
|
|
166
|
+
if (N.length === 0)
|
|
163
167
|
return;
|
|
164
|
-
y.length === 1 && (
|
|
165
|
-
const
|
|
166
|
-
let C =
|
|
168
|
+
y.length === 1 && (I || G) && f.clear();
|
|
169
|
+
const k = e.dirname(s);
|
|
170
|
+
let C = k, x = m;
|
|
167
171
|
do {
|
|
168
172
|
const P = e.join(C, "package.json");
|
|
169
173
|
if (w.includes(P)) {
|
|
@@ -171,37 +175,43 @@ async function ee() {
|
|
|
171
175
|
break;
|
|
172
176
|
}
|
|
173
177
|
} while (C !== t.globRoot && (C = e.dirname(C)));
|
|
174
|
-
const
|
|
178
|
+
const E = x === void 0 ? void 0 : { filePath: x, contents: await M(e.dirname(x)) }, O = {
|
|
175
179
|
typeScriptConfig: {
|
|
176
180
|
filePath: s,
|
|
177
181
|
compilerOptions: u.options
|
|
178
182
|
},
|
|
179
|
-
packageJson:
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
packageJson: E,
|
|
184
|
+
logName: S("blue", E?.contents?.name ?? k),
|
|
185
|
+
cwd: k,
|
|
186
|
+
filePaths: N
|
|
182
187
|
};
|
|
183
188
|
p.push(O);
|
|
184
189
|
})
|
|
185
|
-
), f.size > 0
|
|
186
|
-
|
|
187
|
-
packageJson: m === void 0 ? void 0 : {
|
|
190
|
+
), f.size > 0) {
|
|
191
|
+
const s = m === void 0 ? void 0 : {
|
|
188
192
|
filePath: m,
|
|
189
|
-
contents: await
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
contents: await M(e.dirname(m))
|
|
194
|
+
};
|
|
195
|
+
p.push({
|
|
196
|
+
typeScriptConfig: void 0,
|
|
197
|
+
packageJson: s,
|
|
198
|
+
cwd: process.cwd(),
|
|
199
|
+
logName: S("blue", s?.contents?.name ?? process.cwd()),
|
|
200
|
+
filePaths: Array.from(f).map((l) => e.join(process.cwd(), l))
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
return p.sort((s, l) => s.cwd.localeCompare(l.cwd)), j.projectsData = p, p;
|
|
194
204
|
}
|
|
195
|
-
let
|
|
205
|
+
let _ = !1;
|
|
196
206
|
function te() {
|
|
197
|
-
|
|
207
|
+
_ || (_ = !0, process.exitCode !== void 0 && process.exitCode !== 0 ? h(
|
|
198
208
|
"warn",
|
|
199
209
|
j.codemodName,
|
|
200
210
|
"One or more exceptions occurred during the codemod run. Please review the output above."
|
|
201
211
|
) : h(
|
|
202
212
|
"info",
|
|
203
213
|
j.codemodName,
|
|
204
|
-
`${
|
|
214
|
+
`${S("green", "Codemod completed successfully.")} Recommended next steps:
|
|
205
215
|
- Review the codemod changes.
|
|
206
216
|
- If your project uses ESLint, run ESLint autofix on the changed files.
|
|
207
217
|
- If your project uses Prettier, run Prettier on the changed files.
|
|
@@ -217,40 +227,40 @@ async function oe(t, o) {
|
|
|
217
227
|
}
|
|
218
228
|
await t.run(n), te();
|
|
219
229
|
}
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
230
|
+
const R = new K();
|
|
231
|
+
R.name("@arcgis/codemod").description("Codemod for migrating or refactoring usages of ArcGIS Maps SDK for JavaScript");
|
|
232
|
+
R.command("run").description("Run a single codemod").argument("<codemodName>", "Name of the transform").argument("[path]", "Directory to transform", process.cwd()).action(ne);
|
|
223
233
|
async function ne(t, o) {
|
|
224
|
-
const n =
|
|
234
|
+
const n = U(o, { throwIfNoEntry: !1 });
|
|
225
235
|
if (n === void 0) {
|
|
226
236
|
h("error", "@arcgis/codemod", `Failed to find the target path: ${o}`), process.exitCode = 1;
|
|
227
237
|
return;
|
|
228
238
|
}
|
|
229
239
|
const r = n.isFile();
|
|
230
240
|
process.chdir(r ? e.dirname(o) : o);
|
|
231
|
-
let
|
|
241
|
+
let c;
|
|
232
242
|
try {
|
|
233
|
-
|
|
234
|
-
} catch (
|
|
243
|
+
c = await q(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod-Bz1NfItD.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod-8GvQmmZV.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod-Xx_q11AP.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod-CzsItZhZ.js") }), `./codemods/${t}/codemod.ts`, 4);
|
|
244
|
+
} catch (i) {
|
|
235
245
|
if (
|
|
236
246
|
// direct Node execution
|
|
237
|
-
typeof
|
|
238
|
-
String(
|
|
247
|
+
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
|
|
248
|
+
String(i).includes("Unknown variable dynamic import:")
|
|
239
249
|
) {
|
|
240
250
|
h("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
|
|
241
251
|
return;
|
|
242
252
|
} else
|
|
243
|
-
throw
|
|
253
|
+
throw i;
|
|
244
254
|
}
|
|
245
|
-
if (typeof
|
|
255
|
+
if (typeof c.codemod != "object" || c.codemod === null) {
|
|
246
256
|
h("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
|
|
247
257
|
return;
|
|
248
258
|
}
|
|
249
|
-
await oe(
|
|
259
|
+
await oe(c.codemod, S("blue", t));
|
|
250
260
|
}
|
|
251
|
-
|
|
261
|
+
R.parse();
|
|
252
262
|
export {
|
|
253
|
-
|
|
263
|
+
ye as d,
|
|
254
264
|
j as g,
|
|
255
265
|
te as p
|
|
256
266
|
};
|
package/dist/cli.js
CHANGED
|
@@ -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-CakrAPrI.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-DiZc_C2o.js";
|
|
36
|
+
import { p as x, g as J } from "./cli-3BztOTDV.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
|
+
};
|