@arcgis/codemod 5.2.0-next.99 → 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-9ma2OBf2.js → chunks/codemod.js} +3 -3
- package/dist/chunks/codemod2.js +417 -0
- package/dist/{codemod-B9crq0f8.js → chunks/codemod3.js} +2 -2
- package/dist/chunks/codemod4.js +88 -0
- package/dist/{codemod-DQoynDMb.js → chunks/codemod5.js} +44 -76
- package/dist/{codemod-sCTKGZH5.js → chunks/codemod6.js} +1 -1
- package/dist/{codemod-BHe32YFS.js → chunks/codemod7.js} +19 -18
- package/dist/{codemod-c_Plzm3N.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-BlP1-i98.js +0 -354
- package/dist/cli-CVcbnQEH.js +0 -269
- package/dist/useProjectInstance-Gg734qHH.js +0 -47
|
@@ -1,73 +1,41 @@
|
|
|
1
|
-
var
|
|
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
|
|
5
|
-
if (
|
|
6
|
-
typeof
|
|
7
|
-
var
|
|
8
|
-
|
|
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
|
-
|
|
10
|
+
n.call(this);
|
|
11
11
|
} catch (r) {
|
|
12
12
|
return Promise.reject(r);
|
|
13
13
|
}
|
|
14
|
-
}), i.push([
|
|
15
|
-
} else
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
var
|
|
19
|
-
return l = Error(c), l.name = "SuppressedError", l.error =
|
|
20
|
-
},
|
|
21
|
-
for (;
|
|
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 =
|
|
24
|
-
if (
|
|
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
|
-
|
|
26
|
+
n(c);
|
|
27
27
|
}
|
|
28
|
-
if (
|
|
28
|
+
if (t) throw e;
|
|
29
29
|
};
|
|
30
30
|
return r();
|
|
31
31
|
};
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
},
|
|
71
|
+
}, A = {
|
|
104
72
|
meta: {
|
|
105
73
|
needsTypeInformation: !1
|
|
106
74
|
},
|
|
107
75
|
async run(i) {
|
|
108
|
-
await
|
|
76
|
+
await h(
|
|
109
77
|
i,
|
|
110
|
-
(r) =>
|
|
78
|
+
(r) => P(
|
|
111
79
|
r,
|
|
112
|
-
(
|
|
113
|
-
...
|
|
114
|
-
[
|
|
115
|
-
"@arcgis/node-toolkit":
|
|
116
|
-
} :
|
|
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
|
|
88
|
+
var e = [];
|
|
121
89
|
try {
|
|
122
|
-
const
|
|
123
|
-
for (const s of
|
|
124
|
-
|
|
125
|
-
} catch (
|
|
126
|
-
var
|
|
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
|
-
|
|
96
|
+
f(e, a, n);
|
|
129
97
|
}
|
|
130
98
|
}
|
|
131
|
-
|
|
99
|
+
y(), J(
|
|
132
100
|
"info",
|
|
133
|
-
|
|
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
|
-
|
|
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
|
|
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"],
|