@arcgis/codemod 5.2.0-next.119 → 5.2.0-next.120

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 x } from "@arcgis/node-toolkit/path";
2
2
  import { SyntaxKind as I } from "ts-morph";
3
- import { g as D } from "./cli-C-HhqWfY.js";
3
+ import { g as D } from "./cli-DfAgo-jb.js";
4
4
  import { ModuleResolutionKind as K } from "typescript";
5
5
  import { a as w } from "./log-B76HBvov.js";
6
6
  import { capitalize as A } from "@arcgis/toolkit/string";
@@ -54,7 +54,7 @@ async function Z() {
54
54
  s = n.dirname(a);
55
55
  const P = n.relative(s, E()).split("/"), j = B(a);
56
56
  for (const l of j) {
57
- const g = l.startsWith("!") ? l.slice(1) : l, h = g.search(/[*?[]/u), f = h === -1 ? g : g.slice(0, h), w = f.split("/"), x = h !== -1 && !f.endsWith("/");
57
+ const g = l.startsWith("!") ? l.slice(1) : l, h = g.search(/[*?[]/u), p = h === -1 ? g : g.slice(0, h), w = p.split("/"), x = h !== -1 && !p.endsWith("/");
58
58
  let i = !0;
59
59
  const c = Math.min(P.length, w.length);
60
60
  for (let r = 0; r < c; r++) {
@@ -127,11 +127,11 @@ async function ie(t) {
127
127
  const r = c.split("/").length - i.split("/").length;
128
128
  if (r !== 0)
129
129
  return r;
130
- const m = n.basename(i), p = n.basename(c);
131
- return m === p ? 0 : m.endsWith("tsconfig.json") ? -1 : p.endsWith("tsconfig.json") ? 1 : m.endsWith("tsconfig.build.json") ? -1 : p.endsWith("tsconfig.build.json") ? 1 : m.localeCompare(p);
130
+ const m = n.basename(i), f = n.basename(c);
131
+ 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);
132
132
  });
133
- let f = await T("package.json");
134
- f !== void 0 && (f = M(f));
133
+ let p = await T("package.json");
134
+ p !== void 0 && (p = M(p));
135
135
  const w = [], x = /* @__PURE__ */ new Set();
136
136
  if (await Promise.all(
137
137
  l.map(async (i) => {
@@ -148,23 +148,23 @@ async function ie(t) {
148
148
  );
149
149
  return;
150
150
  }
151
- const m = n.basename(c), p = d.parseJsonConfigFileContent(
151
+ const m = n.basename(c), f = d.parseJsonConfigFileContent(
152
152
  r.config,
153
153
  d.sys,
154
154
  n.dirname(i),
155
155
  void 0,
156
156
  m
157
157
  ), O = 18003;
158
- p.errors.filter((b) => b.code !== O).length > 0 && y(
158
+ f.errors.filter((b) => b.code !== O).length > 0 && y(
159
159
  "warn",
160
160
  c,
161
- d.formatDiagnosticsWithColorAndContext(p.errors, {
161
+ d.formatDiagnosticsWithColorAndContext(f.errors, {
162
162
  getCanonicalFileName: G,
163
163
  getCurrentDirectory: d.sys.getCurrentDirectory,
164
164
  getNewLine: () => d.sys.newLine
165
165
  })
166
166
  );
167
- const W = i === h, z = c === m, A = p.fileNames.filter((b) => {
167
+ const W = i === h, z = c === m, A = f.fileNames.filter((b) => {
168
168
  if (t !== void 0 && b !== t)
169
169
  return !1;
170
170
  const S = b.slice(P);
@@ -174,7 +174,7 @@ async function ie(t) {
174
174
  return;
175
175
  l.length === 1 && (W || z) && g.clear();
176
176
  const F = n.dirname(i);
177
- let C = F, D = f;
177
+ let C = F, D = p;
178
178
  do {
179
179
  const b = n.join(C, "package.json");
180
180
  if (j.includes(b)) {
@@ -185,7 +185,7 @@ async function ie(t) {
185
185
  const L = D === void 0 ? void 0 : { filePath: D, contents: await _(n.dirname(D)) }, H = {
186
186
  typeScriptConfig: {
187
187
  filePath: i,
188
- compilerOptions: p.options
188
+ compilerOptions: f.options
189
189
  },
190
190
  packageJson: L,
191
191
  logName: I("blue", L?.contents?.name ?? F),
@@ -195,9 +195,9 @@ async function ie(t) {
195
195
  w.push(H);
196
196
  })
197
197
  ), g.size > 0) {
198
- const i = f === void 0 ? void 0 : {
199
- filePath: f,
200
- contents: await _(n.dirname(f))
198
+ const i = p === void 0 ? void 0 : {
199
+ filePath: p,
200
+ contents: await _(n.dirname(p))
201
201
  };
202
202
  w.push({
203
203
  typeScriptConfig: void 0,
@@ -239,7 +239,7 @@ k.command("run").description("Run a single codemod").argument("<codemodName>", "
239
239
  const s = await J(e);
240
240
  let o;
241
241
  try {
242
- o = await X(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod-DsvACPpG.js"), "./codemods/geometry-operator-renames/codemod.ts": () => import("./codemod-CVM-ahrt.js"), "./codemods/lumina-component-extras-improvements/codemod.ts": () => import("./codemod-lXphX6G6.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod-BhxEZX2B.js"), "./codemods/normalize-calcite-icon-names/codemod.ts": () => import("./codemod-BaP5d7QD.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod-DzUJHZc4.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod-DlxIx0fk.js") }), `./codemods/${t}/codemod.ts`, 4);
242
+ o = await X(/* @__PURE__ */ Object.assign({ "./codemods/api-extractor-strict-mode/codemod.ts": () => import("./codemod-BpcMVaZX.js"), "./codemods/geometry-operator-renames/codemod.ts": () => import("./codemod-DTsG5_YU.js"), "./codemods/lumina-component-extras-improvements/codemod.ts": () => import("./codemod-eprC1jEo.js"), "./codemods/lumina-toolkit/codemod.ts": () => import("./codemod-DryX37eS.js"), "./codemods/node-toolkit/codemod.ts": () => import("./codemod-YgioOfc7.js"), "./codemods/normalize-calcite-icon-names/codemod.ts": () => import("./codemod-DHO2ieDH.js"), "./codemods/refactor-out-esri-namespace/codemod.ts": () => import("./codemod-lZGspJIz.js"), "./codemods/toolkit-5.2-renames/codemod.ts": () => import("./codemod-HRcnKq-i.js") }), `./codemods/${t}/codemod.ts`, 4);
243
243
  } catch (a) {
244
244
  if (
245
245
  // direct Node execution
@@ -263,7 +263,7 @@ R.command("audit-usages").description("Report deprecated API usages").argument("
263
263
  "Output results as JSON. Example: npx @arcgis/codemod deprecations audit-usages --json > usages.json",
264
264
  !1
265
265
  ).action(async (t, e) => {
266
- const s = await J(t), { auditDeprecatedUsages: o } = await import("./index-G3qil5yu.js");
266
+ const s = await J(t), { auditDeprecatedUsages: o } = await import("./index-2_o7gSlk.js");
267
267
  await o(s, e.esriOnly, e.json);
268
268
  });
269
269
  R.command("audit-definitions").description("Report exported APIs marked as deprecated").argument("[path]", "Directory to audit", process.cwd()).option(
@@ -271,7 +271,7 @@ R.command("audit-definitions").description("Report exported APIs marked as depre
271
271
  "Output results as JSON. Example: npx @arcgis/codemod deprecations audit-definitions --json > definitions.json",
272
272
  !1
273
273
  ).action(async (t, e) => {
274
- const s = await J(t), { auditDeprecatedDefinitions: o } = await import("./index-BYkl918U.js");
274
+ const s = await J(t), { auditDeprecatedDefinitions: o } = await import("./index-DomCHjnu.js");
275
275
  await o(s, e.json);
276
276
  });
277
277
  R.command("sync-issues").description(
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./cli-C-HhqWfY.js";
1
+ import "./cli-DfAgo-jb.js";
2
2
  import "@arcgis/toolkit/log";
3
3
  import "@commander-js/extra-typings";
4
4
  import "node:fs/promises";
@@ -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-BqEY3afe.js";
33
+ import { c as V } from "./useProjectInstance-DtWpxhlT.js";
34
34
  import { mergeApiExtractorConfigs as O, loadApiExtractorConfig as _ } from "@arcgis/api-extractor/extractor/config";
35
- import { g as F } from "./cli-C-HhqWfY.js";
35
+ import { g as F } from "./cli-DfAgo-jb.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";
@@ -30,7 +30,7 @@ var A = (t, e, n) => {
30
30
  return a();
31
31
  };
32
32
  import { SyntaxKind as d, Node as i } from "ts-morph";
33
- import { c as z } from "./useProjectInstance-BqEY3afe.js";
33
+ import { c as z } from "./useProjectInstance-DtWpxhlT.js";
34
34
  const P = /* @__PURE__ */ new Map([
35
35
  ["arcgis-survey123", "arcgis-survey-123"],
36
36
  ["arrow-double-diagonal1", "arrow-double-diagonal-1"],
@@ -29,9 +29,9 @@ var d = (o, e, a) => {
29
29
  };
30
30
  return m();
31
31
  };
32
- import { p as y } from "./cli-C-HhqWfY.js";
33
- import { c as x } from "./useProjectInstance-BqEY3afe.js";
34
- import { p as v } from "./actions-pyK_bLYZ.js";
32
+ import { p as y } from "./cli-DfAgo-jb.js";
33
+ import { c as x } from "./useProjectInstance-DtWpxhlT.js";
34
+ import { p as v } from "./actions-LEFiI8Xk.js";
35
35
  const l = {
36
36
  "@arcgis/core/geometry/operators/affineTransformOperator": {
37
37
  execute: { do: "rename", name: "affineTransformExecute" },
@@ -0,0 +1,88 @@
1
+ var l = (e, o) => (o = Symbol[e]) ? o : /* @__PURE__ */ Symbol.for("Symbol." + e), d = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var p = (e, o, i) => {
5
+ if (o != null) {
6
+ typeof o != "object" && typeof o != "function" && d("Object expected");
7
+ var s, t;
8
+ i && (s = o[l("asyncDispose")]), s === void 0 && (s = o[l("dispose")], i && (t = s)), typeof s != "function" && d("Object not disposable"), t && (s = function() {
9
+ try {
10
+ t.call(this);
11
+ } catch (n) {
12
+ return Promise.reject(n);
13
+ }
14
+ }), e.push([i, s, o]);
15
+ } else i && e.push([i]);
16
+ return o;
17
+ }, f = (e, o, i) => {
18
+ var s = typeof SuppressedError == "function" ? SuppressedError : function(r, a, c, m) {
19
+ return m = Error(c), m.name = "SuppressedError", m.error = r, m.suppressed = a, m;
20
+ }, t = (r) => o = i ? new s(r, o, "An error was suppressed during disposal") : (i = !0, r), n = (r) => {
21
+ for (; r = e.pop(); )
22
+ try {
23
+ var a = r[1] && r[1].call(r[2]);
24
+ if (r[0]) return Promise.resolve(a).then(n, (c) => (t(c), n()));
25
+ } catch (c) {
26
+ t(c);
27
+ }
28
+ if (i) throw o;
29
+ };
30
+ return n();
31
+ };
32
+ import { p as v } from "./actions-LEFiI8Xk.js";
33
+ import { f as C } from "./packageJson-sf04hyfN.js";
34
+ import { c as P } from "./useProjectInstance-DtWpxhlT.js";
35
+ import { p as h } from "./cli-DfAgo-jb.js";
36
+ const g = "@arcgis/lumina/controllers/accessor", u = "@arcgis/lumina-toolkit", E = {
37
+ [g]: {
38
+ AccessorController: { do: "rename", specifier: "@arcgis/lumina-toolkit/useAccessor" },
39
+ AccessorControllerRequires: { do: "rename", specifier: "@arcgis/lumina-toolkit/useAccessor" },
40
+ ObservableMap: { do: "rename", specifier: "@arcgis/lumina-toolkit/store" },
41
+ createLegacyStore: { do: "rename", specifier: "@arcgis/lumina-toolkit/store" },
42
+ createStore: { do: "rename", specifier: "@arcgis/lumina-toolkit/store" },
43
+ getAccessorControllerBoundProperties: { do: "rename", specifier: "@arcgis/lumina-toolkit/useAccessor" },
44
+ makeAccessorController: { do: "rename", specifier: "@arcgis/lumina-toolkit/useAccessor" },
45
+ makeBinderProxy: { do: "rename", specifier: "@arcgis/lumina-toolkit/useAccessor" },
46
+ reCreateAccessor: { do: "rename", specifier: "@arcgis/lumina-toolkit/useAccessor" },
47
+ reEmitEvent: { do: "rename", specifier: "@arcgis/lumina-toolkit/reEmitEvent" }
48
+ }
49
+ }, j = {
50
+ meta: {
51
+ needsTypeInformation: !1
52
+ },
53
+ async run(e) {
54
+ const o = /* @__PURE__ */ new Set();
55
+ for (const r of e) {
56
+ var i = [];
57
+ try {
58
+ const a = p(i, P(r));
59
+ for (const c of a.getCodemodFiles())
60
+ c.getImportDeclarations().some((k) => k.getModuleSpecifierValue() === g) && (v(c, E), r.packageJson !== void 0 && o.add(r.packageJson.filePath));
61
+ } catch (s) {
62
+ var t = s, n = !0;
63
+ } finally {
64
+ f(i, t, n);
65
+ }
66
+ }
67
+ await C(
68
+ e,
69
+ (r, a) => o.has(a) ? A(r) : r
70
+ ), h();
71
+ }
72
+ }, A = (e) => {
73
+ if (e.dependencies?.[u] !== void 0)
74
+ return e;
75
+ const o = e.dependencies?.["@arcgis/lumina"] ?? e.peerDependencies?.["@arcgis/lumina"] ?? e.devDependencies?.["@arcgis/lumina"];
76
+ return o === void 0 ? e : {
77
+ ...e,
78
+ dependencies: Object.fromEntries(
79
+ Object.entries({ ...e.dependencies, [u]: o }).sort(
80
+ ([i], [s]) => i.localeCompare(s)
81
+ )
82
+ )
83
+ };
84
+ }, D = { addLuminaToolkitDependency: A };
85
+ export {
86
+ j as codemod,
87
+ D as exportsForTests
88
+ };
@@ -29,9 +29,9 @@ var g = (t, e, s) => {
29
29
  };
30
30
  return n();
31
31
  };
32
- import { p } from "./actions-pyK_bLYZ.js";
33
- import { c as k } from "./useProjectInstance-BqEY3afe.js";
34
- import { p as C } from "./cli-C-HhqWfY.js";
32
+ import { p } from "./actions-LEFiI8Xk.js";
33
+ import { c as k } from "./useProjectInstance-DtWpxhlT.js";
34
+ import { p as C } from "./cli-DfAgo-jb.js";
35
35
  const j = {
36
36
  meta: {
37
37
  needsTypeInformation: !1
@@ -1,74 +1,41 @@
1
- var p = (i, o) => (o = Symbol[i]) ? o : /* @__PURE__ */ Symbol.for("Symbol." + i), f = (i) => {
1
+ var d = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), g = (i) => {
2
2
  throw TypeError(i);
3
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() {
4
+ var m = (i, e, t) => {
5
+ if (e != null) {
6
+ typeof e != "object" && typeof e != "function" && g("Object expected");
7
+ var a, n;
8
+ t && (a = e[d("asyncDispose")]), a === void 0 && (a = e[d("dispose")], t && (n = a)), typeof a != "function" && g("Object not disposable"), n && (a = function() {
9
9
  try {
10
- t.call(this);
10
+ n.call(this);
11
11
  } catch (r) {
12
12
  return Promise.reject(r);
13
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(); )
14
+ }), i.push([t, a, e]);
15
+ } else t && i.push([t]);
16
+ return e;
17
+ }, f = (i, e, t) => {
18
+ var a = typeof SuppressedError == "function" ? SuppressedError : function(o, s, c, l) {
19
+ return l = Error(c), l.name = "SuppressedError", l.error = o, l.suppressed = s, l;
20
+ }, n = (o) => e = t ? new a(o, e, "An error was suppressed during disposal") : (t = !0, o), r = (o) => {
21
+ for (; o = i.pop(); )
22
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()));
23
+ var s = o[1] && o[1].call(o[2]);
24
+ if (o[0]) return Promise.resolve(s).then(r, (c) => (n(c), r()));
25
25
  } catch (c) {
26
- t(c);
26
+ n(c);
27
27
  }
28
- if (a) throw o;
28
+ if (t) throw e;
29
29
  };
30
30
  return r();
31
31
  };
32
- import { p as h } from "./actions-pyK_bLYZ.js";
33
- import { log as k } from "@arcgis/toolkit/log";
34
- import { writeFile as P } from "node:fs/promises";
35
- import { f as u } from "./log-B76HBvov.js";
36
- import { c as y } from "./useProjectInstance-BqEY3afe.js";
37
- import { p as x, g as J } from "./cli-C-HhqWfY.js";
38
- async function v(i, o) {
39
- const a = /* @__PURE__ */ new Set();
40
- for (const n of i) {
41
- const t = n.packageJson;
42
- if (t === void 0 || a.has(t.filePath))
43
- continue;
44
- a.add(t.filePath);
45
- const r = t.contents;
46
- try {
47
- const e = await o(r, t.filePath);
48
- r !== e && await P(t.filePath, `${JSON.stringify(e, null, 2)}
49
- `, "utf8");
50
- } catch (e) {
51
- process.exitCode = 1, k(
52
- "error",
53
- u(t.filePath),
54
- `Error occurred while migrating: ${String(e)}`,
55
- typeof e == "object" && e !== null && "stack" in e ? { detail: { stack: e.stack } } : void 0
56
- );
57
- }
58
- }
59
- }
60
- function D(i, o) {
61
- for (const a of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
62
- const n = i[a];
63
- if (n) {
64
- const t = o(n, a);
65
- t !== n && (i = { ...i, [a]: t });
66
- }
67
- }
68
- return i;
69
- }
70
- const d = "@arcgis/components-build-utils", S = {
71
- [d]: {
32
+ import { p as k } from "./actions-LEFiI8Xk.js";
33
+ import { f as h, a as P } from "./packageJson-sf04hyfN.js";
34
+ import { c as u } from "./useProjectInstance-DtWpxhlT.js";
35
+ import { p as y, g as x } from "./cli-DfAgo-jb.js";
36
+ import { log as J } from "@arcgis/toolkit/log";
37
+ const p = "@arcgis/components-build-utils", v = {
38
+ [p]: {
72
39
  existsAsync: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
73
40
  // Command-string helpers require manual tokenization before using command-plus-args helpers.
74
41
  sh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
@@ -101,41 +68,41 @@ const d = "@arcgis/components-build-utils", S = {
101
68
  specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
102
69
  }
103
70
  }
104
- }, E = {
71
+ }, A = {
105
72
  meta: {
106
73
  needsTypeInformation: !1
107
74
  },
108
75
  async run(i) {
109
- await v(
76
+ await h(
110
77
  i,
111
- (r) => D(
78
+ (r) => P(
112
79
  r,
113
- (e) => e[d] ? {
114
- ...e,
115
- [d]: void 0,
116
- "@arcgis/node-toolkit": e[d]
117
- } : e
80
+ (o) => o[p] ? {
81
+ ...o,
82
+ [p]: void 0,
83
+ "@arcgis/node-toolkit": o[p]
84
+ } : o
118
85
  )
119
86
  );
120
87
  for (const r of i) {
121
- var o = [];
88
+ var e = [];
122
89
  try {
123
- const e = g(o, y(r));
124
- for (const s of e.getCodemodFiles())
125
- h(s, S);
126
- } catch (a) {
127
- var n = a, t = !0;
90
+ const o = m(e, u(r));
91
+ for (const s of o.getCodemodFiles())
92
+ k(s, v);
93
+ } catch (t) {
94
+ var a = t, n = !0;
128
95
  } finally {
129
- m(o, n, t);
96
+ f(e, a, n);
130
97
  }
131
98
  }
132
- x(), k(
99
+ y(), J(
133
100
  "info",
134
- J.codemodName,
101
+ x.codemodName,
135
102
  "Next step: run npm install/pnpm install/yarn install to get @arcgis/node-toolkit package installed."
136
103
  );
137
104
  }
138
105
  };
139
106
  export {
140
- E as codemod
107
+ A as codemod
141
108
  };
@@ -29,8 +29,8 @@ var T = (t, s, e) => {
29
29
  };
30
30
  return i();
31
31
  };
32
- import { c as N } from "./useProjectInstance-BqEY3afe.js";
33
- import { g as B } from "./cli-C-HhqWfY.js";
32
+ import { c as N } from "./useProjectInstance-DtWpxhlT.js";
33
+ import { g as B } from "./cli-DfAgo-jb.js";
34
34
  import { SyntaxKind as f } from "ts-morph";
35
35
  import { existsAsync as S } from "@arcgis/node-toolkit/file";
36
36
  import { readFile as J, writeFile as K } from "node:fs/promises";
@@ -30,10 +30,10 @@ var k = (e, o, i) => {
30
30
  return l();
31
31
  };
32
32
  import { SyntaxKind as s } from "ts-morph";
33
- import { p as y, u as G } from "./actions-pyK_bLYZ.js";
33
+ import { p as y, u as G } from "./actions-LEFiI8Xk.js";
34
34
  import { log as L } from "@arcgis/toolkit/log";
35
- import { c as W } from "./useProjectInstance-BqEY3afe.js";
36
- import { g as N } from "./cli-C-HhqWfY.js";
35
+ import { c as W } from "./useProjectInstance-DtWpxhlT.js";
36
+ import { g as N } from "./cli-DfAgo-jb.js";
37
37
  import { a as E } from "./log-B76HBvov.js";
38
38
  import { styleText as M } from "node:util";
39
39
  import { readFile as z, writeFile as q } from "node:fs/promises";
@@ -29,8 +29,8 @@ var C = (t, n, e) => {
29
29
  };
30
30
  return a();
31
31
  };
32
- import { c as j } from "./useProjectInstance-BqEY3afe.js";
33
- import { r as U } from "./cli-C-HhqWfY.js";
32
+ import { c as j } from "./useProjectInstance-DtWpxhlT.js";
33
+ import { r as U } from "./cli-DfAgo-jb.js";
34
34
  import { f as h } from "./log-B76HBvov.js";
35
35
  import { path as g, toPosixPathSeparators as W } from "@arcgis/node-toolkit/path";
36
36
  import { log as S } from "@arcgis/toolkit/log";
@@ -34,8 +34,8 @@ import { path as S } from "@arcgis/node-toolkit/path";
34
34
  import { styleText as $ } from "node:util";
35
35
  import P from "typescript";
36
36
  import { f as g } from "./log-B76HBvov.js";
37
- import { r as v } from "./cli-C-HhqWfY.js";
38
- import { c as x } from "./useProjectInstance-BqEY3afe.js";
37
+ import { r as v } from "./cli-DfAgo-jb.js";
38
+ import { c as x } from "./useProjectInstance-DtWpxhlT.js";
39
39
  import { g as C, s as T, e as R, a as y, b, p as j, l as E, f as F } from "./codeowners-CarwYwHK.js";
40
40
  async function U(e, o) {
41
41
  await v(
@@ -0,0 +1,39 @@
1
+ import { log as r } from "@arcgis/toolkit/log";
2
+ import { writeFile as s } from "node:fs/promises";
3
+ import { f } from "./log-B76HBvov.js";
4
+ async function h(n, a) {
5
+ const o = /* @__PURE__ */ new Set();
6
+ for (const i of n) {
7
+ const e = i.packageJson;
8
+ if (e === void 0 || o.has(e.filePath))
9
+ continue;
10
+ o.add(e.filePath);
11
+ const c = e.contents;
12
+ try {
13
+ const t = await a(c, e.filePath);
14
+ c !== t && await s(e.filePath, `${JSON.stringify(t, null, 2)}
15
+ `, "utf8");
16
+ } catch (t) {
17
+ process.exitCode = 1, r(
18
+ "error",
19
+ f(e.filePath),
20
+ `Error occurred while migrating: ${String(t)}`,
21
+ typeof t == "object" && t !== null && "stack" in t ? { detail: { stack: t.stack } } : void 0
22
+ );
23
+ }
24
+ }
25
+ }
26
+ function u(n, a) {
27
+ for (const o of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
28
+ const i = n[o];
29
+ if (i) {
30
+ const e = a(i, o);
31
+ e !== i && (n = { ...n, [o]: e });
32
+ }
33
+ }
34
+ return n;
35
+ }
36
+ export {
37
+ u as a,
38
+ h as f
39
+ };
@@ -1,7 +1,7 @@
1
1
  import { Project as p } from "ts-morph";
2
2
  import { log as d } from "@arcgis/toolkit/log";
3
3
  import { path as f } from "@arcgis/node-toolkit/path";
4
- import { g as i, d as m } from "./cli-C-HhqWfY.js";
4
+ import { g as i, d as m } from "./cli-DfAgo-jb.js";
5
5
  import { styleText as s } from "node:util";
6
6
  function y(e, c = !0) {
7
7
  if (i.project !== void 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/codemod",
3
- "version": "5.2.0-next.119",
3
+ "version": "5.2.0-next.120",
4
4
  "description": "A codemod toolkit for updating and modernizing ArcGIS Maps SDK for JavaScript codebases.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -11,9 +11,9 @@
11
11
  ],
12
12
  "license": "SEE LICENSE IN LICENSE.md",
13
13
  "dependencies": {
14
- "@arcgis/api-extractor": "5.2.0-next.119",
15
- "@arcgis/node-toolkit": "5.2.0-next.119",
16
- "@arcgis/toolkit": "5.2.0-next.119",
14
+ "@arcgis/api-extractor": "5.2.0-next.120",
15
+ "@arcgis/node-toolkit": "5.2.0-next.120",
16
+ "@arcgis/toolkit": "5.2.0-next.120",
17
17
  "@commander-js/extra-typings": "^15.0.0",
18
18
  "commander": "^15.0.0",
19
19
  "picomatch": "^4.0.4",