@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.
@@ -1,73 +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 { f as h, p as P } from "./actions-CE74rP-z.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-BAlKm1ad.js";
36
- import { p as x, g as J } from "./cli-x1Uhjnb_.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]: {
32
+ import { p as k } from "./actions.js";
33
+ import { f as h, a as P } from "./packageJson.js";
34
+ import { c as u } from "./useProjectInstance.js";
35
+ import { p as y, g as x } from "./cli.js";
36
+ import { log as J } from "@arcgis/toolkit/log";
37
+ const p = "@arcgis/components-build-utils", v = {
38
+ [p]: {
71
39
  existsAsync: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
72
40
  // Command-string helpers require manual tokenization before using command-plus-args helpers.
73
41
  sh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
@@ -100,41 +68,41 @@ const d = "@arcgis/components-build-utils", S = {
100
68
  specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
101
69
  }
102
70
  }
103
- }, C = {
71
+ }, A = {
104
72
  meta: {
105
73
  needsTypeInformation: !1
106
74
  },
107
75
  async run(i) {
108
- await v(
76
+ await h(
109
77
  i,
110
- (r) => D(
78
+ (r) => P(
111
79
  r,
112
- (e) => e[d] ? {
113
- ...e,
114
- [d]: void 0,
115
- "@arcgis/node-toolkit": e[d]
116
- } : e
80
+ (o) => o[p] ? {
81
+ ...o,
82
+ [p]: void 0,
83
+ "@arcgis/node-toolkit": o[p]
84
+ } : o
117
85
  )
118
86
  );
119
87
  for (const r of i) {
120
- var o = [];
88
+ var e = [];
121
89
  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;
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;
127
95
  } finally {
128
- m(o, n, t);
96
+ f(e, a, n);
129
97
  }
130
98
  }
131
- x(), k(
99
+ y(), J(
132
100
  "info",
133
- J.codemodName,
101
+ x.codemodName,
134
102
  "Next step: run npm install/pnpm install/yarn install to get @arcgis/node-toolkit package installed."
135
103
  );
136
104
  }
137
105
  };
138
106
  export {
139
- C as codemod
107
+ A as codemod
140
108
  };
@@ -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-BAlKm1ad.js";
33
+ import { c as z } from "./useProjectInstance.js";
34
34
  const P = /* @__PURE__ */ new Map([
35
35
  ["arcgis-survey123", "arcgis-survey-123"],
36
36
  ["arrow-double-diagonal1", "arrow-double-diagonal-1"],