@arcgis/codemod 5.2.0-next.90 → 5.2.0-next.93
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/dist/{actions-ACvjOtUF.js → actions-Dk0H5GL7.js} +1 -1
- package/dist/cli-BG_bddFb.js +269 -0
- package/dist/cli.js +1 -1
- package/dist/{codemod-CJvMRUCq.js → codemod-BL-hF1sl.js} +3 -3
- package/dist/codemod-BsJsUWX-.js +240 -0
- package/dist/{codemod-BSrbZ8nr.js → codemod-CE3IeY9A.js} +3 -3
- package/dist/{codemod-BNhkoGgL.js → codemod-Ct065XZR.js} +4 -4
- package/dist/codemod-D0WPk--E.js +311 -0
- package/dist/{codemod-3QuC4SaX.js → codemod-DVCFvVWI.js} +3 -3
- package/dist/{useProjectInstance-5uuenLkM.js → useProjectInstance-JISA7BBD.js} +13 -16
- package/package.json +4 -4
- package/dist/actions-CKBQcIhe.js +0 -354
- package/dist/actions-CakrAPrI.js +0 -354
- package/dist/actions-CtxXjpuZ.js +0 -354
- package/dist/cli-3BztOTDV.js +0 -266
- package/dist/cli-BIg5ZLTm.js +0 -266
- package/dist/cli-BJ6P_2T-.js +0 -266
- package/dist/cli-CJfbqFa-.js +0 -266
- package/dist/codemod-8GvQmmZV.js +0 -140
- package/dist/codemod-BD9n1ra2.js +0 -74
- package/dist/codemod-BWZBr6IZ.js +0 -140
- package/dist/codemod-Bz1NfItD.js +0 -436
- package/dist/codemod-CRHygcg2.js +0 -74
- package/dist/codemod-CXiJ129U.js +0 -436
- package/dist/codemod-CzsItZhZ.js +0 -74
- package/dist/codemod-DOOtgv8R.js +0 -436
- package/dist/codemod-Dc4LGHgd.js +0 -6080
- package/dist/codemod-UDMxoQjk.js +0 -6080
- package/dist/codemod-Xx_q11AP.js +0 -6080
- package/dist/codemod-urnOPYsG.js +0 -140
- package/dist/useProjectInstance-CGaAin_6.js +0 -50
- package/dist/useProjectInstance-DiZc_C2o.js +0 -50
- package/dist/useProjectInstance-DixfNjtt.js +0 -50
package/dist/cli-CJfbqFa-.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { log as h } from "@arcgis/toolkit/log";
|
|
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
|
-
import "ts-morph";
|
|
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";
|
|
13
|
-
const q = (t, o, n) => {
|
|
14
|
-
const r = t[o];
|
|
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." : ""))));
|
|
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: a.JsxEmit.Preserve,
|
|
29
|
-
lib: ["lib.esnext.d.ts", "lib.dom.d.ts"],
|
|
30
|
-
module: a.ModuleKind.ESNext,
|
|
31
|
-
moduleResolution: a.ModuleResolutionKind.Bundler,
|
|
32
|
-
moduleDetection: a.ModuleDetectionKind.Auto,
|
|
33
|
-
strict: !1,
|
|
34
|
-
target: a.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 z() {
|
|
44
|
-
const { ignorePatterns: t, globRoot: o } = await H(), n = await Q(o);
|
|
45
|
-
return t.push(...n), { ignorePatterns: t, globRoot: o };
|
|
46
|
-
}
|
|
47
|
-
async function H() {
|
|
48
|
-
const t = [];
|
|
49
|
-
let o, n = F(), r = e.dirname(n);
|
|
50
|
-
do {
|
|
51
|
-
o = r;
|
|
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);
|
|
56
|
-
for (const f of y) {
|
|
57
|
-
const m = (f.startsWith("!") ? f.slice(1) : f).split("*")[0].split("/");
|
|
58
|
-
let p = !0;
|
|
59
|
-
for (let g = 0; g < m.length; g++)
|
|
60
|
-
if (w[g] !== m[g] && m[g] !== "") {
|
|
61
|
-
p = !1;
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
p && (f.startsWith("!") || t.push(f));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
r = e.dirname(o);
|
|
68
|
-
} while (r !== o);
|
|
69
|
-
return { ignorePatterns: t, globRoot: n };
|
|
70
|
-
}
|
|
71
|
-
async function Q(t) {
|
|
72
|
-
return (await T("**/.gitignore", {
|
|
73
|
-
cwd: F(),
|
|
74
|
-
// Gitignore files are unlikely to be symbolic links
|
|
75
|
-
followSymbolicLinks: !1,
|
|
76
|
-
// Don't look for ignore files in these places for speed:
|
|
77
|
-
ignore: [
|
|
78
|
-
// Hardcoded ignores in TypeScript
|
|
79
|
-
"**/node_modules/**",
|
|
80
|
-
"**/bower_components/**",
|
|
81
|
-
"**/jspm_packages/**",
|
|
82
|
-
// Default build output folder in bundlers
|
|
83
|
-
"**/dist/**"
|
|
84
|
-
],
|
|
85
|
-
// Not applicable for our glob pattern
|
|
86
|
-
expandDirectories: !1
|
|
87
|
-
})).flatMap((n) => {
|
|
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;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
const V = ["js", "jsx", "mjs", "cjs"], X = ["ts", "tsx", "mts", "cts"], Y = ["json"], Z = `**/*.{${[...V, ...X, ...Y].join(",")}}`;
|
|
95
|
-
async function ee() {
|
|
96
|
-
const t = await z(), o = e.join(process.cwd(), Z), n = await T(o, {
|
|
97
|
-
cwd: t.globRoot,
|
|
98
|
-
ignore: t.ignorePatterns,
|
|
99
|
-
// The files we are looking for are unlikely to be symbolic links
|
|
100
|
-
followSymbolicLinks: !1,
|
|
101
|
-
// Not applicable for our glob pattern
|
|
102
|
-
expandDirectories: !1
|
|
103
|
-
// Files and folders starting with . are excluded (matches TypeScript's
|
|
104
|
-
// default behavior). If any tsconfig.json explicitly includes such files,
|
|
105
|
-
// they will still be codemodded.
|
|
106
|
-
});
|
|
107
|
-
let r = e.relative(t.globRoot, process.cwd());
|
|
108
|
-
r !== "" && (r += "/");
|
|
109
|
-
const c = e.join(e.resolve(t.globRoot), "/"), i = c.length + r.length, w = [], y = [], f = /* @__PURE__ */ new Set();
|
|
110
|
-
for (const s of n) {
|
|
111
|
-
const l = c + s;
|
|
112
|
-
if (s.endsWith(".json")) {
|
|
113
|
-
const d = e.basename(s);
|
|
114
|
-
d === "package.json" ? w.push(l) : (d.startsWith("tsconfig.") || d.startsWith("jsconfig.")) && y.push(l);
|
|
115
|
-
} else {
|
|
116
|
-
const d = s.slice(r.length);
|
|
117
|
-
f.add(d);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
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) => {
|
|
122
|
-
const d = l.split("/").length - s.split("/").length;
|
|
123
|
-
if (d !== 0)
|
|
124
|
-
return d;
|
|
125
|
-
const b = e.basename(s), u = e.basename(l);
|
|
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);
|
|
127
|
-
});
|
|
128
|
-
let m = await W("package.json");
|
|
129
|
-
m !== void 0 && (m = J(m));
|
|
130
|
-
const p = [], g = /* @__PURE__ */ new Set();
|
|
131
|
-
if (await Promise.all(
|
|
132
|
-
y.map(async (s) => {
|
|
133
|
-
const l = e.relative(process.cwd(), s), d = a.readConfigFile(s, a.sys.readFile);
|
|
134
|
-
if (d.error !== void 0) {
|
|
135
|
-
h(
|
|
136
|
-
"error",
|
|
137
|
-
l,
|
|
138
|
-
a.formatDiagnosticsWithColorAndContext([d.error], {
|
|
139
|
-
getCanonicalFileName: L,
|
|
140
|
-
getCurrentDirectory: a.sys.getCurrentDirectory,
|
|
141
|
-
getNewLine: () => a.sys.newLine
|
|
142
|
-
})
|
|
143
|
-
);
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const b = e.basename(l), u = a.parseJsonConfigFileContent(
|
|
147
|
-
d.config,
|
|
148
|
-
a.sys,
|
|
149
|
-
e.dirname(s),
|
|
150
|
-
void 0,
|
|
151
|
-
b
|
|
152
|
-
), A = 18003;
|
|
153
|
-
u.errors.filter((P) => P.code !== A).length > 0 && h(
|
|
154
|
-
"warn",
|
|
155
|
-
l,
|
|
156
|
-
a.formatDiagnosticsWithColorAndContext(u.errors, {
|
|
157
|
-
getCanonicalFileName: L,
|
|
158
|
-
getCurrentDirectory: a.sys.getCurrentDirectory,
|
|
159
|
-
getNewLine: () => a.sys.newLine
|
|
160
|
-
})
|
|
161
|
-
);
|
|
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;
|
|
165
|
-
});
|
|
166
|
-
if (N.length === 0)
|
|
167
|
-
return;
|
|
168
|
-
y.length === 1 && (I || G) && f.clear();
|
|
169
|
-
const k = e.dirname(s);
|
|
170
|
-
let C = k, x = m;
|
|
171
|
-
do {
|
|
172
|
-
const P = e.join(C, "package.json");
|
|
173
|
-
if (w.includes(P)) {
|
|
174
|
-
x = P;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
} while (C !== t.globRoot && (C = e.dirname(C)));
|
|
178
|
-
const E = x === void 0 ? void 0 : { filePath: x, contents: await M(e.dirname(x)) }, O = {
|
|
179
|
-
typeScriptConfig: {
|
|
180
|
-
filePath: s,
|
|
181
|
-
compilerOptions: u.options
|
|
182
|
-
},
|
|
183
|
-
packageJson: E,
|
|
184
|
-
logName: S("blue", E?.contents?.name ?? k),
|
|
185
|
-
cwd: k,
|
|
186
|
-
filePaths: N
|
|
187
|
-
};
|
|
188
|
-
p.push(O);
|
|
189
|
-
})
|
|
190
|
-
), f.size > 0) {
|
|
191
|
-
const s = m === void 0 ? void 0 : {
|
|
192
|
-
filePath: m,
|
|
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;
|
|
204
|
-
}
|
|
205
|
-
let _ = !1;
|
|
206
|
-
function te() {
|
|
207
|
-
_ || (_ = !0, process.exitCode !== void 0 && process.exitCode !== 0 ? h(
|
|
208
|
-
"warn",
|
|
209
|
-
j.codemodName,
|
|
210
|
-
"One or more exceptions occurred during the codemod run. Please review the output above."
|
|
211
|
-
) : h(
|
|
212
|
-
"info",
|
|
213
|
-
j.codemodName,
|
|
214
|
-
`${S("green", "Codemod completed successfully.")} Recommended next steps:
|
|
215
|
-
- Review the codemod changes.
|
|
216
|
-
- If your project uses ESLint, run ESLint autofix on the changed files.
|
|
217
|
-
- If your project uses Prettier, run Prettier on the changed files.
|
|
218
|
-
- If your project uses TypeScript, run type checking to ensure there are no type errors.`
|
|
219
|
-
));
|
|
220
|
-
}
|
|
221
|
-
async function oe(t, o) {
|
|
222
|
-
j.codemod = t, j.codemodName = o;
|
|
223
|
-
const n = await ee();
|
|
224
|
-
if (n.length === 0) {
|
|
225
|
-
h("error", o, `Failed to find any .js or .ts files in ${process.cwd()} to run the codemod on.`), process.exitCode = 1;
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
await t.run(n), te();
|
|
229
|
-
}
|
|
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);
|
|
233
|
-
async function ne(t, o) {
|
|
234
|
-
const n = U(o, { throwIfNoEntry: !1 });
|
|
235
|
-
if (n === void 0) {
|
|
236
|
-
h("error", "@arcgis/codemod", `Failed to find the target path: ${o}`), process.exitCode = 1;
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
const r = n.isFile();
|
|
240
|
-
process.chdir(r ? e.dirname(o) : o);
|
|
241
|
-
let c;
|
|
242
|
-
try {
|
|
243
|
-
c = await q(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod-BNhkoGgL.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod-BWZBr6IZ.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod-Dc4LGHgd.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod-CRHygcg2.js") }), `./codemods/${t}/codemod.ts`, 4);
|
|
244
|
-
} catch (i) {
|
|
245
|
-
if (
|
|
246
|
-
// direct Node execution
|
|
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:")
|
|
249
|
-
) {
|
|
250
|
-
h("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
|
|
251
|
-
return;
|
|
252
|
-
} else
|
|
253
|
-
throw i;
|
|
254
|
-
}
|
|
255
|
-
if (typeof c.codemod != "object" || c.codemod === null) {
|
|
256
|
-
h("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
await oe(c.codemod, S("blue", t));
|
|
260
|
-
}
|
|
261
|
-
R.parse();
|
|
262
|
-
export {
|
|
263
|
-
ye as d,
|
|
264
|
-
j as g,
|
|
265
|
-
te as p
|
|
266
|
-
};
|
package/dist/codemod-8GvQmmZV.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/codemod-BD9n1ra2.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var c = (t, e) => (e = Symbol[t]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + t), d = (t) => {
|
|
2
|
-
throw TypeError(t);
|
|
3
|
-
};
|
|
4
|
-
var g = (t, e, s) => {
|
|
5
|
-
if (e != null) {
|
|
6
|
-
typeof e != "object" && typeof e != "function" && d("Object expected");
|
|
7
|
-
var i, r;
|
|
8
|
-
s && (i = e[c("asyncDispose")]), i === void 0 && (i = e[c("dispose")], s && (r = i)), typeof i != "function" && d("Object not disposable"), r && (i = function() {
|
|
9
|
-
try {
|
|
10
|
-
r.call(this);
|
|
11
|
-
} catch (n) {
|
|
12
|
-
return Promise.reject(n);
|
|
13
|
-
}
|
|
14
|
-
}), t.push([s, i, e]);
|
|
15
|
-
} else s && t.push([s]);
|
|
16
|
-
return e;
|
|
17
|
-
}, f = (t, e, s) => {
|
|
18
|
-
var i = typeof SuppressedError == "function" ? SuppressedError : function(o, a, l, m) {
|
|
19
|
-
return m = Error(l), m.name = "SuppressedError", m.error = o, m.suppressed = a, m;
|
|
20
|
-
}, r = (o) => e = s ? new i(o, e, "An error was suppressed during disposal") : (s = !0, o), n = (o) => {
|
|
21
|
-
for (; o = t.pop(); )
|
|
22
|
-
try {
|
|
23
|
-
var a = o[1] && o[1].call(o[2]);
|
|
24
|
-
if (o[0]) return Promise.resolve(a).then(n, (l) => (r(l), n()));
|
|
25
|
-
} catch (l) {
|
|
26
|
-
r(l);
|
|
27
|
-
}
|
|
28
|
-
if (s) throw e;
|
|
29
|
-
};
|
|
30
|
-
return n();
|
|
31
|
-
};
|
|
32
|
-
import { p } from "./actions-CtxXjpuZ.js";
|
|
33
|
-
import { c as k } from "./useProjectInstance-CGaAin_6.js";
|
|
34
|
-
import { p as C } from "./cli-BIg5ZLTm.js";
|
|
35
|
-
const j = {
|
|
36
|
-
meta: {
|
|
37
|
-
needsTypeInformation: !1
|
|
38
|
-
},
|
|
39
|
-
run(t) {
|
|
40
|
-
for (const n of t) {
|
|
41
|
-
var e = [];
|
|
42
|
-
try {
|
|
43
|
-
const o = g(e, k(n));
|
|
44
|
-
for (const a of o.getCodemodFiles())
|
|
45
|
-
p(a, {
|
|
46
|
-
"@arcgis/toolkit/intl": {
|
|
47
|
-
getElementLocale: { do: "rename", specifier: "@arcgis/toolkit/intl/dom" },
|
|
48
|
-
startLocaleObserver: { do: "rename", specifier: "@arcgis/toolkit/intl/dom" },
|
|
49
|
-
LocaleObserverResult: { do: "rename", specifier: "@arcgis/toolkit/intl/dom" }
|
|
50
|
-
},
|
|
51
|
-
"@arcgis/toolkit/dom": {
|
|
52
|
-
slotChangeHasContent: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
53
|
-
slotChangeGetTextContent: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
54
|
-
slotChangeHasTextContent: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
55
|
-
slotChangeHasAssignedNode: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
56
|
-
slotChangeGetAssignedNodes: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
57
|
-
slotChangeHasAssignedElement: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
58
|
-
slotChangeGetAssignedElements: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
59
|
-
getSlotAssignedElements: { do: "rename", specifier: "@arcgis/toolkit/dom/slots" },
|
|
60
|
-
resolveReferenceElement: { do: "rename", specifier: "@arcgis/toolkit/dom/referenceElement" }
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
} catch (s) {
|
|
64
|
-
var i = s, r = !0;
|
|
65
|
-
} finally {
|
|
66
|
-
f(e, i, r);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
C();
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
export {
|
|
73
|
-
j as codemod
|
|
74
|
-
};
|
package/dist/codemod-BWZBr6IZ.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
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-ACvjOtUF.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-DixfNjtt.js";
|
|
36
|
-
import { p as x, g as J } from "./cli-CJfbqFa-.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
|
-
};
|