@arcgis/codemod 5.2.0-next.38 → 5.2.0-next.39

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.
@@ -1,6 +1,6 @@
1
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-DaELQGrl.js";
3
+ import { g as x } from "./cli-BHF6hwOe.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";
@@ -1,7 +1,7 @@
1
1
  import { log as h } from "@arcgis/toolkit/log";
2
2
  import { Command as K } from "@commander-js/extra-typings";
3
3
  import { statSync as U } from "node:fs";
4
- import { getCwd as E, path as e, toPosixPathSeparators as J } from "@arcgis/node-toolkit/path";
4
+ import { getCwd as F, path as e, toPosixPathSeparators as J } from "@arcgis/node-toolkit/path";
5
5
  import "ts-morph";
6
6
  import a from "typescript";
7
7
  import { existsAsync as B, asyncFindPath as W } from "@arcgis/node-toolkit/file";
@@ -46,13 +46,13 @@ async function z() {
46
46
  }
47
47
  async function H() {
48
48
  const t = [];
49
- let o, n = E(), r = e.dirname(n);
49
+ let o, n = F(), r = e.dirname(n);
50
50
  do {
51
51
  o = r;
52
52
  const c = e.join(o, ".gitignore");
53
53
  if (await B(c)) {
54
54
  n = e.dirname(c);
55
- const w = e.relative(n, E()).split("/"), y = $(c);
55
+ const w = e.relative(n, F()).split("/"), y = $(c);
56
56
  for (const f of y) {
57
57
  const m = (f.startsWith("!") ? f.slice(1) : f).split("*")[0].split("/");
58
58
  let p = !0;
@@ -70,6 +70,7 @@ async function H() {
70
70
  }
71
71
  async function Q(t) {
72
72
  return (await T("**/.gitignore", {
73
+ cwd: F(),
73
74
  // Gitignore files are unlikely to be symbolic links
74
75
  followSymbolicLinks: !1,
75
76
  // Don't look for ignore files in these places for speed:
@@ -158,13 +159,13 @@ async function ee() {
158
159
  getNewLine: () => a.sys.newLine
159
160
  })
160
161
  );
161
- const R = s === v, G = l === b, I = u.fileNames.filter((P) => {
162
+ const I = s === v, G = l === b, N = u.fileNames.filter((P) => {
162
163
  const D = P.slice(i);
163
- return f.delete(D) ? (g.add(D), !0) : g.has(D) || D.endsWith(".json") || P.includes("node_modules") ? !1 : !R;
164
+ return f.delete(D) ? (g.add(D), !0) : g.has(D) || D.endsWith(".json") || P.includes("node_modules") ? !1 : !I;
164
165
  });
165
- if (I.length === 0)
166
+ if (N.length === 0)
166
167
  return;
167
- y.length === 1 && (R || G) && f.clear();
168
+ y.length === 1 && (I || G) && f.clear();
168
169
  const k = e.dirname(s);
169
170
  let C = k, x = m;
170
171
  do {
@@ -174,15 +175,15 @@ async function ee() {
174
175
  break;
175
176
  }
176
177
  } while (C !== t.globRoot && (C = e.dirname(C)));
177
- const N = x === void 0 ? void 0 : { filePath: x, contents: await M(e.dirname(x)) }, O = {
178
+ const E = x === void 0 ? void 0 : { filePath: x, contents: await M(e.dirname(x)) }, O = {
178
179
  typeScriptConfig: {
179
180
  filePath: s,
180
181
  compilerOptions: u.options
181
182
  },
182
- packageJson: N,
183
- logName: S("blue", N?.contents?.name ?? k),
183
+ packageJson: E,
184
+ logName: S("blue", E?.contents?.name ?? k),
184
185
  cwd: k,
185
- filePaths: I
186
+ filePaths: N
186
187
  };
187
188
  p.push(O);
188
189
  })
@@ -226,9 +227,9 @@ async function oe(t, o) {
226
227
  }
227
228
  await t.run(n), te();
228
229
  }
229
- const F = new K();
230
- F.name("@arcgis/codemod").description("Codemod for migrating or refactoring usages of ArcGIS Maps SDK for JavaScript");
231
- F.command("run").description("Run a single codemod").argument("<codemodName>", "Name of the transform").argument("[path]", "Directory to transform", process.cwd()).action(ne);
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);
232
233
  async function ne(t, o) {
233
234
  const n = U(o, { throwIfNoEntry: !1 });
234
235
  if (n === void 0) {
@@ -239,7 +240,7 @@ async function ne(t, o) {
239
240
  process.chdir(r ? e.dirname(o) : o);
240
241
  let c;
241
242
  try {
242
- c = await q(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod-CF9Uovkp.js"), "./codemods/arcgis-toolkit/codemod.ts": () => import("./codemod-CkEiw2R0.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod-DdSog4Ph.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod-BXBmL9y_.js") }), `./codemods/${t}/codemod.ts`, 4);
243
+ c = await q(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod-D7IuwLde.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod-adfCq5ed.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod-Df00B5_g.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod-DAht3PVH.js") }), `./codemods/${t}/codemod.ts`, 4);
243
244
  } catch (i) {
244
245
  if (
245
246
  // direct Node execution
@@ -257,7 +258,7 @@ async function ne(t, o) {
257
258
  }
258
259
  await oe(c.codemod, S("blue", t));
259
260
  }
260
- F.parse();
261
+ R.parse();
261
262
  export {
262
263
  ye as d,
263
264
  j as g,
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./cli-DaELQGrl.js";
1
+ import "./cli-BHF6hwOe.js";
2
2
  import "@arcgis/toolkit/log";
3
3
  import "@commander-js/extra-typings";
4
4
  import "node:fs";
@@ -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-BFu9xXOC.js";
33
+ import { c as V } from "./useProjectInstance-BCvcfoQ5.js";
34
34
  import { mergeApiExtractorConfigs as O, loadApiExtractorConfig as _ } from "@arcgis/api-extractor/extractor/config";
35
- import { g as F } from "./cli-DaELQGrl.js";
35
+ import { g as F } from "./cli-BHF6hwOe.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 = "5.2.0-next.38", ne = {
185
+ const te = "5.2.0-next.39", ne = {
186
186
  version: te
187
187
  };
188
188
  async function oe(n) {
@@ -0,0 +1,74 @@
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-CoNL8Vi9.js";
33
+ import { c as k } from "./useProjectInstance-BCvcfoQ5.js";
34
+ import { p as C } from "./cli-BHF6hwOe.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
+ };