@arcgis/codemod 5.2.0-next.98 → 6.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -33
- package/dist/chunks/actions.js +395 -0
- package/dist/chunks/cli.js +380 -0
- package/dist/{codemod-BWZ_CtnT.js → chunks/codemod.js} +3 -3
- package/dist/chunks/codemod2.js +417 -0
- package/dist/{codemod-v9PNv3xH.js → chunks/codemod3.js} +2 -2
- package/dist/chunks/codemod4.js +88 -0
- package/dist/{codemod-Bk-5zHaA.js → chunks/codemod5.js} +44 -76
- package/dist/{codemod-DgXtIN7a.js → chunks/codemod6.js} +1 -1
- package/dist/{codemod-DkEa3nwr.js → chunks/codemod7.js} +19 -18
- package/dist/{codemod-B9tWi9M_.js → chunks/codemod8.js} +3 -3
- package/dist/chunks/format.js +255 -0
- package/dist/chunks/hardcodedBehavior.js +93 -0
- package/dist/chunks/index.js +404 -0
- package/dist/chunks/index2.js +143 -0
- package/dist/chunks/log.js +11 -0
- package/dist/chunks/packageJson.js +39 -0
- package/dist/chunks/sync.js +165 -0
- package/dist/chunks/useProjectInstance.js +51 -0
- package/dist/cli.js +3 -2
- package/package.json +4 -4
- package/dist/actions-CE74rP-z.js +0 -354
- package/dist/cli-x1Uhjnb_.js +0 -269
- package/dist/useProjectInstance-BAlKm1ad.js +0 -47
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { log as g } from "@arcgis/toolkit/log";
|
|
2
|
+
import { Command as Q, InvalidArgumentError as K } from "@commander-js/extra-typings";
|
|
3
|
+
import { stat as q, realpath as B } from "node:fs/promises";
|
|
4
|
+
import { path as i, getCwd as R, toPosixPathSeparators as T } from "@arcgis/node-toolkit/path";
|
|
5
|
+
import { asyncFindPath as N, existsAsync as A } from "@arcgis/node-toolkit/file";
|
|
6
|
+
import "ts-morph";
|
|
7
|
+
import c from "typescript";
|
|
8
|
+
import { asyncRetrievePackageJson as $ } from "@arcgis/node-toolkit/packageJson";
|
|
9
|
+
import { glob as z } from "tinyglobby";
|
|
10
|
+
import { gitIgnoreFileToGlobs as H } from "@arcgis/node-toolkit/glob";
|
|
11
|
+
import { identity as _ } from "@arcgis/toolkit/function";
|
|
12
|
+
import { styleText as D } from "node:util";
|
|
13
|
+
const X = (t, e, s) => {
|
|
14
|
+
const o = t[e];
|
|
15
|
+
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((n, l) => {
|
|
16
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(l.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + e + (e.split("/").length !== s ? ". Note that variables only represent file names one level deep." : ""))));
|
|
17
|
+
});
|
|
18
|
+
}, xe = {
|
|
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
|
+
}, P = {
|
|
38
|
+
codemod: void 0,
|
|
39
|
+
codemodName: void 0,
|
|
40
|
+
projectsData: void 0,
|
|
41
|
+
project: void 0
|
|
42
|
+
};
|
|
43
|
+
async function Y() {
|
|
44
|
+
const { ignorePatterns: t, globRoot: e } = await Z(), s = await ee(e);
|
|
45
|
+
return t.push(...s), { ignorePatterns: t, globRoot: e };
|
|
46
|
+
}
|
|
47
|
+
async function Z() {
|
|
48
|
+
const t = [], e = await N(".git"), s = e === void 0 ? void 0 : i.dirname(e);
|
|
49
|
+
let o, n = R(), l = i.dirname(n);
|
|
50
|
+
do {
|
|
51
|
+
if (o = l, s !== void 0 && o !== s && !o.startsWith(`${s}/`))
|
|
52
|
+
break;
|
|
53
|
+
const w = i.join(o, ".gitignore");
|
|
54
|
+
if (await A(w)) {
|
|
55
|
+
n = i.dirname(w);
|
|
56
|
+
const y = i.relative(n, R()).split("/"), v = H(w);
|
|
57
|
+
for (const p of v) {
|
|
58
|
+
const u = p.startsWith("!") ? p.slice(1) : p, h = u.search(/[*?[]/u), x = h === -1 ? u : u.slice(0, h), r = x.split("/"), d = h !== -1 && !x.endsWith("/");
|
|
59
|
+
let a = !0;
|
|
60
|
+
const f = Math.min(y.length, r.length);
|
|
61
|
+
for (let m = 0; m < f; m++) {
|
|
62
|
+
const C = r[m];
|
|
63
|
+
if (!(d && m === r.length - 1 ? y[m].startsWith(C) : y[m] === C) && C !== "") {
|
|
64
|
+
a = !1;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
a && (p.startsWith("!") || t.push(p));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
l = i.dirname(o);
|
|
72
|
+
} while (l !== o);
|
|
73
|
+
return { ignorePatterns: t, globRoot: n };
|
|
74
|
+
}
|
|
75
|
+
async function ee(t) {
|
|
76
|
+
return (await z("**/.gitignore", {
|
|
77
|
+
cwd: R(),
|
|
78
|
+
// Gitignore files are unlikely to be symbolic links
|
|
79
|
+
followSymbolicLinks: !1,
|
|
80
|
+
// Don't look for ignore files in these places for speed:
|
|
81
|
+
ignore: [
|
|
82
|
+
// Hardcoded ignores in TypeScript
|
|
83
|
+
"**/node_modules/**",
|
|
84
|
+
"**/bower_components/**",
|
|
85
|
+
"**/jspm_packages/**",
|
|
86
|
+
// Default build output folder in bundlers
|
|
87
|
+
"**/dist/**"
|
|
88
|
+
],
|
|
89
|
+
// Not applicable for our glob pattern
|
|
90
|
+
expandDirectories: !1
|
|
91
|
+
})).flatMap((s) => {
|
|
92
|
+
const o = i.relative(t, i.dirname(s)), n = H(s), l = [];
|
|
93
|
+
for (const w of n)
|
|
94
|
+
w.startsWith("!") || l.push(i.join(o, w));
|
|
95
|
+
return l;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const te = ["js", "jsx", "mjs", "cjs"], oe = ["ts", "tsx", "mts", "cts"], se = ["json"], ie = `**/*.{${[...te, ...oe, ...se].join(",")}}`;
|
|
99
|
+
async function re(t) {
|
|
100
|
+
const e = await Y(), s = i.join(process.cwd(), ie), o = i.join(i.resolve(e.globRoot), "/"), n = (await z(s, {
|
|
101
|
+
cwd: e.globRoot,
|
|
102
|
+
ignore: e.ignorePatterns,
|
|
103
|
+
// The files we are looking for are unlikely to be symbolic links
|
|
104
|
+
followSymbolicLinks: !1,
|
|
105
|
+
// Not applicable for our glob pattern
|
|
106
|
+
expandDirectories: !1
|
|
107
|
+
// Files and folders starting with . are excluded (matches TypeScript's
|
|
108
|
+
// default behavior). If any tsconfig.json explicitly includes such files,
|
|
109
|
+
// they will still be codemodded.
|
|
110
|
+
})).filter(
|
|
111
|
+
(r) => r.endsWith(".json") || t === void 0 || o + r === t
|
|
112
|
+
);
|
|
113
|
+
let l = i.relative(e.globRoot, process.cwd());
|
|
114
|
+
l !== "" && (l += "/");
|
|
115
|
+
const w = o.length + l.length, E = [], y = [], v = /* @__PURE__ */ new Set();
|
|
116
|
+
for (const r of n) {
|
|
117
|
+
const d = o + r;
|
|
118
|
+
if (r.endsWith(".json")) {
|
|
119
|
+
const a = i.basename(r);
|
|
120
|
+
a === "package.json" ? E.push(d) : (a.startsWith("tsconfig.") || a.startsWith("jsconfig.")) && y.push(d);
|
|
121
|
+
} else {
|
|
122
|
+
const a = r.slice(l.length);
|
|
123
|
+
v.add(a);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
let p = await N("tsconfig.json", i.dirname(process.cwd()));
|
|
127
|
+
p !== void 0 && (p = T(p), y.push(p)), y.sort((r, d) => {
|
|
128
|
+
const a = d.split("/").length - r.split("/").length;
|
|
129
|
+
if (a !== 0)
|
|
130
|
+
return a;
|
|
131
|
+
const f = i.basename(r), m = i.basename(d);
|
|
132
|
+
return f === m ? 0 : f.endsWith("tsconfig.json") ? -1 : m.endsWith("tsconfig.json") ? 1 : f.endsWith("tsconfig.build.json") ? -1 : m.endsWith("tsconfig.build.json") ? 1 : f.localeCompare(m);
|
|
133
|
+
});
|
|
134
|
+
let u = await N("package.json");
|
|
135
|
+
u !== void 0 && (u = T(u));
|
|
136
|
+
const h = [], x = /* @__PURE__ */ new Set();
|
|
137
|
+
if (await Promise.all(
|
|
138
|
+
y.map(async (r) => {
|
|
139
|
+
const d = i.relative(process.cwd(), r), a = c.readConfigFile(r, c.sys.readFile);
|
|
140
|
+
if (a.error !== void 0) {
|
|
141
|
+
g(
|
|
142
|
+
"error",
|
|
143
|
+
d,
|
|
144
|
+
c.formatDiagnosticsWithColorAndContext([a.error], {
|
|
145
|
+
getCanonicalFileName: _,
|
|
146
|
+
getCurrentDirectory: c.sys.getCurrentDirectory,
|
|
147
|
+
getNewLine: () => c.sys.newLine
|
|
148
|
+
})
|
|
149
|
+
);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const f = c.parseJsonConfigFileContent(
|
|
153
|
+
a.config,
|
|
154
|
+
c.sys,
|
|
155
|
+
i.dirname(r),
|
|
156
|
+
void 0,
|
|
157
|
+
r
|
|
158
|
+
), m = 18003;
|
|
159
|
+
f.errors.filter((b) => b.code !== m).length > 0 && g(
|
|
160
|
+
"warn",
|
|
161
|
+
d,
|
|
162
|
+
c.formatDiagnosticsWithColorAndContext(f.errors, {
|
|
163
|
+
getCanonicalFileName: _,
|
|
164
|
+
getCurrentDirectory: c.sys.getCurrentDirectory,
|
|
165
|
+
getNewLine: () => c.sys.newLine
|
|
166
|
+
})
|
|
167
|
+
);
|
|
168
|
+
const M = r === p, F = f.fileNames.filter((b) => {
|
|
169
|
+
if (t !== void 0 && b !== t)
|
|
170
|
+
return !1;
|
|
171
|
+
const S = b.slice(w);
|
|
172
|
+
return v.delete(S) ? (x.add(S), !0) : x.has(S) || S.endsWith(".json") || b.includes("node_modules") ? !1 : !M;
|
|
173
|
+
});
|
|
174
|
+
if (F.length === 0)
|
|
175
|
+
return;
|
|
176
|
+
const O = i.dirname(r);
|
|
177
|
+
let j = O, k = u;
|
|
178
|
+
for (; j === e.globRoot || // Stop searching outside repository root
|
|
179
|
+
j.startsWith(`${e.globRoot}/`); ) {
|
|
180
|
+
const b = i.join(j, "package.json");
|
|
181
|
+
if (E.includes(b)) {
|
|
182
|
+
k = b;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
if (j === e.globRoot)
|
|
186
|
+
break;
|
|
187
|
+
j = i.dirname(j);
|
|
188
|
+
}
|
|
189
|
+
const L = k === void 0 ? void 0 : { filePath: k, contents: await $(i.dirname(k)) }, V = {
|
|
190
|
+
typeScriptConfig: {
|
|
191
|
+
filePath: r,
|
|
192
|
+
compilerOptions: f.options
|
|
193
|
+
},
|
|
194
|
+
packageJson: L,
|
|
195
|
+
logName: D("blue", L?.contents?.name ?? O),
|
|
196
|
+
cwd: O,
|
|
197
|
+
filePaths: F
|
|
198
|
+
};
|
|
199
|
+
h.push(V);
|
|
200
|
+
})
|
|
201
|
+
), v.size > 0) {
|
|
202
|
+
const r = u === void 0 ? void 0 : {
|
|
203
|
+
filePath: u,
|
|
204
|
+
contents: await $(i.dirname(u))
|
|
205
|
+
};
|
|
206
|
+
h.push({
|
|
207
|
+
typeScriptConfig: void 0,
|
|
208
|
+
packageJson: r,
|
|
209
|
+
cwd: process.cwd(),
|
|
210
|
+
logName: D("blue", r?.contents?.name ?? process.cwd()),
|
|
211
|
+
filePaths: Array.from(v).map((d) => i.join(process.cwd(), d))
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return h.sort((r, d) => r.cwd.localeCompare(d.cwd)), P.projectsData = h, h;
|
|
215
|
+
}
|
|
216
|
+
function ne() {
|
|
217
|
+
P.codemod.meta.needsFooter && (P.codemod.meta.needsFooter = !1, process.exitCode !== void 0 && process.exitCode !== 0 ? g(
|
|
218
|
+
"warn",
|
|
219
|
+
P.codemodName,
|
|
220
|
+
"One or more exceptions occurred during the codemod run. Please review the output above."
|
|
221
|
+
) : g(
|
|
222
|
+
"info",
|
|
223
|
+
P.codemodName,
|
|
224
|
+
`${D("green", "Codemod completed successfully.")} Recommended next steps:
|
|
225
|
+
- Review the codemod changes.
|
|
226
|
+
- If your project uses ESLint, run ESLint autofix on the changed files.
|
|
227
|
+
- If your project uses Prettier, run Prettier on the changed files.
|
|
228
|
+
- If your project uses TypeScript, run type checking to ensure there are no type errors.`
|
|
229
|
+
));
|
|
230
|
+
}
|
|
231
|
+
async function ae(t, e, s) {
|
|
232
|
+
P.codemod = t, P.codemodName = e;
|
|
233
|
+
const o = await re(s);
|
|
234
|
+
if (o.length === 0) {
|
|
235
|
+
g("error", e, `Failed to find any .js or .ts files in ${process.cwd()} to run the codemod on.`), process.exitCode = 1;
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
await t.run(o), ne();
|
|
239
|
+
}
|
|
240
|
+
const W = {
|
|
241
|
+
coreWidgets: {
|
|
242
|
+
label: "@arcgis/core widgets - high priority",
|
|
243
|
+
description: "WebGIS platform priority"
|
|
244
|
+
},
|
|
245
|
+
coreGeometryEngine: {
|
|
246
|
+
label: "@arcgis/core geometry engine - high priority",
|
|
247
|
+
description: "WebGIS platform priority"
|
|
248
|
+
},
|
|
249
|
+
codemod: {
|
|
250
|
+
label: "Codemod available - quick fix",
|
|
251
|
+
description: "A codemod is available to automate these migrations."
|
|
252
|
+
},
|
|
253
|
+
calcite: {
|
|
254
|
+
label: "Calcite components",
|
|
255
|
+
description: "This does not include visual breaking changes. See complete list in https://confluencewikidev.esri.com/spaces/Calcite/pages/464553094/Calcite+6.0+-+Breaking+Change+Release+February"
|
|
256
|
+
},
|
|
257
|
+
arcgisCoreComponents: { label: "Maps SDK for JavaScript" },
|
|
258
|
+
otherEsri: { label: "Other Esri and ArcGIS packages" },
|
|
259
|
+
coreIntl: {
|
|
260
|
+
label: "@arcgis/core translation utils",
|
|
261
|
+
description: "Use https://webgis.esri.com/references/toolkit/intl instead."
|
|
262
|
+
},
|
|
263
|
+
nonEsri: {
|
|
264
|
+
label: "Non-Esri packages and web platform - low priority",
|
|
265
|
+
description: "These deprecations do not block updating Esri packages and are not tied to an ArcGIS release."
|
|
266
|
+
}
|
|
267
|
+
}, I = new Q();
|
|
268
|
+
I.name("@arcgis/codemod").description("Codemod for migrating or refactoring usages of ArcGIS Maps SDK for JavaScript");
|
|
269
|
+
I.command("run").description("Run a single codemod").argument("<codemodName>", "Name of the transform").argument("[path]", "Directory to transform", process.cwd()).action(async (t, e) => {
|
|
270
|
+
const s = await G(e);
|
|
271
|
+
let o;
|
|
272
|
+
try {
|
|
273
|
+
o = await X(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod.js"), "./codemods/geometry-operator-renames/codemod.ts": () => import("./codemod2.js"), "./codemods/lumina-component-extras-improvements/codemod.ts": () => import("./codemod3.js"), "./codemods/lumina-toolkit/codemod.ts": () => import("./codemod4.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod5.js"), "./codemods/normalize-calcite-icon-names/codemod.ts": () => import("./codemod6.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod7.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod8.js") }), `./codemods/${t}/codemod.ts`, 4);
|
|
274
|
+
} catch (n) {
|
|
275
|
+
if (
|
|
276
|
+
// direct Node execution
|
|
277
|
+
typeof n == "object" && n !== null && "code" in n && n.code === "ERR_MODULE_NOT_FOUND" && "url" in n && typeof n.url == "string" && n.url.endsWith(`/${t}/codemod.ts`) || // Vite build execution
|
|
278
|
+
String(n).includes("Unknown variable dynamic import:")
|
|
279
|
+
) {
|
|
280
|
+
g("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
|
|
281
|
+
return;
|
|
282
|
+
} else
|
|
283
|
+
throw n;
|
|
284
|
+
}
|
|
285
|
+
if (typeof o.codemod != "object" || o.codemod === null) {
|
|
286
|
+
g("error", "@arcgis/codemod", `Can't find codemod by name "${t}".`), process.exitCode = 1;
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
await ae(o.codemod, D("blue", t), s);
|
|
290
|
+
});
|
|
291
|
+
const J = I.command("deprecations").description("Audit and report deprecated APIs");
|
|
292
|
+
J.command("audit-usages").description("Report deprecated API usages").argument("[path]", "Directory to audit", process.cwd()).option("--esri-only", "Only report usages of deprecated APIs from Esri and ArcGIS packages", !1).option(
|
|
293
|
+
"--category <category>",
|
|
294
|
+
`Only report usages in a category. Available categories: ${Object.keys(W).join(", ")}`,
|
|
295
|
+
de
|
|
296
|
+
).option("--package <package-name>", "Only report usages of deprecated APIs from this package").option(
|
|
297
|
+
"--json",
|
|
298
|
+
"Output results as JSON. Example: npx @arcgis/codemod deprecations audit-usages --json > usages.json",
|
|
299
|
+
!1
|
|
300
|
+
).option(
|
|
301
|
+
"--md",
|
|
302
|
+
"Output results as Markdown. Example: npx @arcgis/codemod deprecations audit-usages --md > usages.md",
|
|
303
|
+
!1
|
|
304
|
+
).action(async (t, e) => {
|
|
305
|
+
if (e.json && e.md) {
|
|
306
|
+
g("error", "@arcgis/codemod", "The --json and --md options cannot be used together."), process.exitCode = 1;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const s = await G(t), { auditDeprecatedUsages: o } = await import("./index.js"), n = e.md ? "md" : e.json ? "json" : "text";
|
|
310
|
+
await o(s, {
|
|
311
|
+
esriOnly: e.esriOnly,
|
|
312
|
+
outputFormat: n,
|
|
313
|
+
category: e.category,
|
|
314
|
+
packageName: e.package
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
J.command("audit-definitions").description("Report exported APIs marked as deprecated").argument("[path]", "Directory to audit", process.cwd()).option(
|
|
318
|
+
"--json",
|
|
319
|
+
"Output results as JSON. Example: npx @arcgis/codemod deprecations audit-definitions --json > definitions.json",
|
|
320
|
+
!1
|
|
321
|
+
).action(async (t, e) => {
|
|
322
|
+
const s = await G(t), { auditDeprecatedDefinitions: o } = await import("./index2.js");
|
|
323
|
+
await o(s, e.json);
|
|
324
|
+
});
|
|
325
|
+
J.command("sync-issues").description(
|
|
326
|
+
`Create or update deprecation audit issues. Requires authenticated gh cli.
|
|
327
|
+
|
|
328
|
+
Existing open issues are updated if out of date (matched by title and invisible comment inside).
|
|
329
|
+
Otherwise, a new issue is created. Assignees are determined based on CODEOWNERS.`
|
|
330
|
+
).argument(
|
|
331
|
+
"<audit-json>",
|
|
332
|
+
"Path to the JSON file as output by the --json flag in the audit-usages or audit-definitions CLI"
|
|
333
|
+
).option("--dry-run", "Print planned issue and comment changes without changing GitHub", !1).option("--offset <number>", "Skip the first number of issue plans", U, 0).option("--limit <number>", "Process at most this many issue plans", U).option(
|
|
334
|
+
"--label <label>",
|
|
335
|
+
"Label to add to newly created issues. Can be specified multiple times.",
|
|
336
|
+
ce,
|
|
337
|
+
[]
|
|
338
|
+
).action(async (t, e) => {
|
|
339
|
+
const s = i.resolve(t);
|
|
340
|
+
if (!await A(s) || !(await q(s)).isFile()) {
|
|
341
|
+
g("error", "@arcgis/codemod", `Failed to find the audit JSON file: ${t}`), process.exitCode = 1;
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
const { syncDeprecationIssues: o } = await import("./sync.js");
|
|
345
|
+
await o(
|
|
346
|
+
await B(s),
|
|
347
|
+
e.dryRun,
|
|
348
|
+
e.offset,
|
|
349
|
+
e.limit,
|
|
350
|
+
e.label
|
|
351
|
+
);
|
|
352
|
+
});
|
|
353
|
+
function ce(t, e) {
|
|
354
|
+
return [...e, t];
|
|
355
|
+
}
|
|
356
|
+
function U(t) {
|
|
357
|
+
const e = Number(t);
|
|
358
|
+
if (!Number.isSafeInteger(e) || e < 0)
|
|
359
|
+
throw new K("Expected a non-negative integer.");
|
|
360
|
+
return e;
|
|
361
|
+
}
|
|
362
|
+
function de(t) {
|
|
363
|
+
if (!Object.hasOwn(W, t))
|
|
364
|
+
throw new K(`Expected one of: ${Object.keys(W).join(", ")}.`);
|
|
365
|
+
return t;
|
|
366
|
+
}
|
|
367
|
+
async function G(t) {
|
|
368
|
+
const e = i.resolve(t);
|
|
369
|
+
await A(e) || (g("error", "@arcgis/codemod", `Failed to find the target path: ${t}`), process.exit(1));
|
|
370
|
+
const s = await B(e), o = (await q(s)).isFile();
|
|
371
|
+
return process.chdir(o ? i.dirname(s) : s), o ? s : void 0;
|
|
372
|
+
}
|
|
373
|
+
I.parse();
|
|
374
|
+
export {
|
|
375
|
+
xe as a,
|
|
376
|
+
W as d,
|
|
377
|
+
P as g,
|
|
378
|
+
ne as p,
|
|
379
|
+
ae as r
|
|
380
|
+
};
|
|
@@ -30,9 +30,9 @@ var D = (n, e, i) => {
|
|
|
30
30
|
return s();
|
|
31
31
|
};
|
|
32
32
|
import { log as y } from "@arcgis/toolkit/log";
|
|
33
|
-
import { c as V } from "./useProjectInstance
|
|
33
|
+
import { c as V } from "./useProjectInstance.js";
|
|
34
34
|
import { mergeApiExtractorConfigs as O, loadApiExtractorConfig as _ } from "@arcgis/api-extractor/extractor/config";
|
|
35
|
-
import { g as F } from "./cli
|
|
35
|
+
import { g as F } from "./cli.js";
|
|
36
36
|
import { writeFile as I, readFile as j } from "node:fs/promises";
|
|
37
37
|
import { join as W, relative as Q } from "node:path";
|
|
38
38
|
import { existsAsync as U } from "@arcgis/node-toolkit/file";
|
|
@@ -182,7 +182,7 @@ ${a}
|
|
|
182
182
|
For each added declaration, remove @public from it if it is not supposed to be public. For each removed declaration, add @public JSDoc tag if it needs to remain public.`
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
|
-
const te = "
|
|
185
|
+
const te = "1.0.0-0", ne = {
|
|
186
186
|
version: te
|
|
187
187
|
};
|
|
188
188
|
async function oe(n) {
|