@arcgis/codemod 5.2.0-next.86 → 5.2.0-next.87
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 +40 -5
- package/dist/{actions-CtxXjpuZ.js → actions-8PIadCgg.js} +1 -1
- package/dist/actions-D_zMP7bV.js +354 -0
- package/dist/{cli-BIg5ZLTm.js → cli-COx17UK8.js} +36 -36
- package/dist/cli-qKUUieac.js +266 -0
- package/dist/cli.js +1 -1
- package/dist/{codemod-CJvMRUCq.js → codemod-BcgYxPxD.js} +3 -3
- package/dist/{codemod-DOOtgv8R.js → codemod-BnKQVsF8.js} +2 -2
- package/dist/{codemod-UDMxoQjk.js → codemod-BwRmX2eo.js} +3 -3
- package/dist/codemod-CJUchJW_.js +6080 -0
- package/dist/codemod-CTd7n0lD.js +140 -0
- package/dist/codemod-Ce_Kk0Ir.js +240 -0
- package/dist/codemod-CjvNjSDv.js +240 -0
- package/dist/{codemod-BD9n1ra2.js → codemod-D77Br2SQ.js} +3 -3
- package/dist/codemod-DPXaddAw.js +436 -0
- package/dist/codemod-Q9pmw-JU.js +74 -0
- package/dist/{useProjectInstance-CGaAin_6.js → useProjectInstance-B86v8eX5.js} +13 -16
- package/dist/useProjectInstance-evHsM1li.js +47 -0
- package/package.json +5 -5
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var p = (i, o) => (o = Symbol[i]) ? o : /* @__PURE__ */ Symbol.for("Symbol." + i), f = (i) => {
|
|
2
|
+
throw TypeError(i);
|
|
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() {
|
|
9
|
+
try {
|
|
10
|
+
t.call(this);
|
|
11
|
+
} catch (r) {
|
|
12
|
+
return Promise.reject(r);
|
|
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(); )
|
|
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()));
|
|
25
|
+
} catch (c) {
|
|
26
|
+
t(c);
|
|
27
|
+
}
|
|
28
|
+
if (a) throw o;
|
|
29
|
+
};
|
|
30
|
+
return r();
|
|
31
|
+
};
|
|
32
|
+
import { f as h, p as P } from "./actions-8PIadCgg.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-evHsM1li.js";
|
|
36
|
+
import { p as x, g as J } from "./cli-COx17UK8.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]: {
|
|
71
|
+
existsAsync: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
72
|
+
// Command-string helpers require manual tokenization before using command-plus-args helpers.
|
|
73
|
+
sh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
|
|
74
|
+
// sp was removed from node-toolkit; collectOutputSync is the closest return-value replacement.
|
|
75
|
+
sp: { do: "rename", name: "collectOutputSync", specifier: "@arcgis/node-toolkit/shell" },
|
|
76
|
+
asyncSh: { do: "rename", specifier: "@arcgis/node-toolkit/shell" },
|
|
77
|
+
findPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
78
|
+
asyncFindPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
79
|
+
createFileIfNotExists: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
80
|
+
gitIgnoreFileToGlobs: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
81
|
+
gitIgnoreToGlob: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
82
|
+
isPosix: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
83
|
+
toPosixPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
84
|
+
normalizePath: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
85
|
+
toSystemPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
86
|
+
getCwd: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
87
|
+
path: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
88
|
+
PackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
89
|
+
retrievePackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
90
|
+
asyncRetrievePackageJson: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
91
|
+
fetchPackageLocation: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
92
|
+
detectPackageManager: { do: "rename", specifier: "@arcgis/node-toolkit/packageJson" },
|
|
93
|
+
DependencyManagementOptions: {
|
|
94
|
+
do: "rename",
|
|
95
|
+
specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
|
|
96
|
+
},
|
|
97
|
+
vitePresetPlugin: { do: "rename", specifier: "@arcgis/node-toolkit/vite/presetPlugin" },
|
|
98
|
+
externalizeDependencies: {
|
|
99
|
+
do: "rename",
|
|
100
|
+
specifier: "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, C = {
|
|
104
|
+
meta: {
|
|
105
|
+
needsTypeInformation: !1
|
|
106
|
+
},
|
|
107
|
+
async run(i) {
|
|
108
|
+
await v(
|
|
109
|
+
i,
|
|
110
|
+
(r) => D(
|
|
111
|
+
r,
|
|
112
|
+
(e) => e[d] ? {
|
|
113
|
+
...e,
|
|
114
|
+
[d]: void 0,
|
|
115
|
+
"@arcgis/node-toolkit": e[d]
|
|
116
|
+
} : e
|
|
117
|
+
)
|
|
118
|
+
);
|
|
119
|
+
for (const r of i) {
|
|
120
|
+
var o = [];
|
|
121
|
+
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;
|
|
127
|
+
} finally {
|
|
128
|
+
m(o, n, t);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
x(), k(
|
|
132
|
+
"info",
|
|
133
|
+
J.codemodName,
|
|
134
|
+
"Next step: run npm install/pnpm install/yarn install to get @arcgis/node-toolkit package installed."
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
export {
|
|
139
|
+
C as codemod
|
|
140
|
+
};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
var N = (t, e) => (e = Symbol[t]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + t), x = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
|
+
};
|
|
4
|
+
var A = (t, e, n) => {
|
|
5
|
+
if (e != null) {
|
|
6
|
+
typeof e != "object" && typeof e != "function" && x("Object expected");
|
|
7
|
+
var r, o;
|
|
8
|
+
n && (r = e[N("asyncDispose")]), r === void 0 && (r = e[N("dispose")], n && (o = r)), typeof r != "function" && x("Object not disposable"), o && (r = function() {
|
|
9
|
+
try {
|
|
10
|
+
o.call(this);
|
|
11
|
+
} catch (a) {
|
|
12
|
+
return Promise.reject(a);
|
|
13
|
+
}
|
|
14
|
+
}), t.push([n, r, e]);
|
|
15
|
+
} else n && t.push([n]);
|
|
16
|
+
return e;
|
|
17
|
+
}, y = (t, e, n) => {
|
|
18
|
+
var r = typeof SuppressedError == "function" ? SuppressedError : function(s, c, l, u) {
|
|
19
|
+
return u = Error(l), u.name = "SuppressedError", u.error = s, u.suppressed = c, u;
|
|
20
|
+
}, o = (s) => e = n ? new r(s, e, "An error was suppressed during disposal") : (n = !0, s), a = (s) => {
|
|
21
|
+
for (; s = t.pop(); )
|
|
22
|
+
try {
|
|
23
|
+
var c = s[1] && s[1].call(s[2]);
|
|
24
|
+
if (s[0]) return Promise.resolve(c).then(a, (l) => (o(l), a()));
|
|
25
|
+
} catch (l) {
|
|
26
|
+
o(l);
|
|
27
|
+
}
|
|
28
|
+
if (n) throw e;
|
|
29
|
+
};
|
|
30
|
+
return a();
|
|
31
|
+
};
|
|
32
|
+
import { SyntaxKind as d, Node as i } from "ts-morph";
|
|
33
|
+
import { c as z } from "./useProjectInstance-evHsM1li.js";
|
|
34
|
+
const P = /* @__PURE__ */ new Map([
|
|
35
|
+
["arcgis-survey123", "arcgis-survey-123"],
|
|
36
|
+
["arrow-double-diagonal1", "arrow-double-diagonal-1"],
|
|
37
|
+
["arrow-double-diagonal2", "arrow-double-diagonal-2"],
|
|
38
|
+
["arrow-left10", "arrow-left-10"],
|
|
39
|
+
["arrow-right10", "arrow-right-10"],
|
|
40
|
+
["battery1", "battery-1"],
|
|
41
|
+
["battery2", "battery-2"],
|
|
42
|
+
["battery3", "battery-3"],
|
|
43
|
+
["battery4", "battery-4"],
|
|
44
|
+
["graph-bar100-stacked", "graph-bar-100-stacked"],
|
|
45
|
+
["hexagon2", "hexagon-2"],
|
|
46
|
+
["hexagon2-inset-large", "hexagon-2-inset-large"],
|
|
47
|
+
["hexagon2-inset-medium", "hexagon-2-inset-medium"],
|
|
48
|
+
["hexagon2-inset-small", "hexagon-2-inset-small"],
|
|
49
|
+
["i12x", "1-2x"],
|
|
50
|
+
["i14x", "1-4x"],
|
|
51
|
+
["i18x", "1-8x"],
|
|
52
|
+
["i1x", "1x"],
|
|
53
|
+
["i2d", "2d"],
|
|
54
|
+
["i2d-explore", "2d-explore"],
|
|
55
|
+
["i2x", "2-x"],
|
|
56
|
+
["i360-view", "360-view"],
|
|
57
|
+
["i3d", "3d"],
|
|
58
|
+
["i3d-building", "3d-building"],
|
|
59
|
+
["i3d-building-parameter", "3d-building-parameter"],
|
|
60
|
+
["i3d-glasses", "3d-glasses"],
|
|
61
|
+
["i3d-search", "3d-search"],
|
|
62
|
+
["i4x", "4-x"],
|
|
63
|
+
["i8x", "8-x"],
|
|
64
|
+
["language2", "language-2"],
|
|
65
|
+
["launch2", "launch-2"],
|
|
66
|
+
["layer3d", "layer-3d"],
|
|
67
|
+
["merge2", "merge-2"],
|
|
68
|
+
["number-circle1", "number-circle-1"],
|
|
69
|
+
["number-circle1f", "number-circle-1-f"],
|
|
70
|
+
["number-circle2", "number-circle-2"],
|
|
71
|
+
["number-circle2f", "number-circle-2-f"],
|
|
72
|
+
["number-circle3", "number-circle-3"],
|
|
73
|
+
["number-circle3f", "number-circle-3-f"],
|
|
74
|
+
["number-circle4", "number-circle-4"],
|
|
75
|
+
["number-circle4f", "number-circle-4-f"],
|
|
76
|
+
["number-circle5", "number-circle-5"],
|
|
77
|
+
["number-circle5f", "number-circle-5-f"],
|
|
78
|
+
["number-circle6", "number-circle-6"],
|
|
79
|
+
["number-circle6f", "number-circle-6-f"],
|
|
80
|
+
["number-circle7", "number-circle-7"],
|
|
81
|
+
["number-circle7f", "number-circle-7-f"],
|
|
82
|
+
["number-circle8", "number-circle-8"],
|
|
83
|
+
["number-circle8f", "number-circle-8-f"],
|
|
84
|
+
["number-circle9", "number-circle-9"],
|
|
85
|
+
["number-circle9f", "number-circle-9-f"],
|
|
86
|
+
["person2", "person-2"],
|
|
87
|
+
["pop-up1", "pop-up-1"],
|
|
88
|
+
["satellite0", "satellite-0"],
|
|
89
|
+
["satellite0f", "satellite-0-f"],
|
|
90
|
+
["satellite1", "satellite-1"],
|
|
91
|
+
["satellite1f", "satellite-1-f"],
|
|
92
|
+
["satellite2", "satellite-2"],
|
|
93
|
+
["satellite2f", "satellite-2-f"],
|
|
94
|
+
["satellite3", "satellite-3"],
|
|
95
|
+
["satellite3f", "satellite-3-f"],
|
|
96
|
+
["shapes2d3d", "shapes-2d-3d"],
|
|
97
|
+
["subheading1", "subheading-1"],
|
|
98
|
+
["subheading1-rtl", "subheading-1-rtl"],
|
|
99
|
+
["subheading2", "subheading-2"],
|
|
100
|
+
["subheading2-rtl", "subheading-2-rtl"],
|
|
101
|
+
["subheading3", "subheading-3"],
|
|
102
|
+
["subheading3-rtl", "subheading-3-rtl"],
|
|
103
|
+
["subheading4", "subheading-4"],
|
|
104
|
+
["subheading4-rtl", "subheading-4-rtl"],
|
|
105
|
+
["subheading5", "subheading-5"],
|
|
106
|
+
["subheading5-rtl", "subheading-5-rtl"],
|
|
107
|
+
["summarize-center-and-dispersion1", "summarize-center-and-dispersion-1"],
|
|
108
|
+
["summarize-center-and-dispersion2", "summarize-center-and-dispersion-2"],
|
|
109
|
+
["summarize-center-and-dispersion3", "summarize-center-and-dispersion-3"]
|
|
110
|
+
]), T = /* @__PURE__ */ new Set(["icon", "icon-end", "icon-start", "iconEnd", "iconStart"]), D = /[A-Z]/u, B = /^i\d/u, L = /([A-Z]+)([A-Z][a-z])/gu, I = /([a-z\d])([A-Z])/gu;
|
|
111
|
+
function C(t) {
|
|
112
|
+
let e = t;
|
|
113
|
+
return D.test(e) && (B.test(e) && (e = e.slice(1)), e = e.replace(L, "$1-$2").replace(I, "$1-$2").toLowerCase()), P.get(e) ?? e;
|
|
114
|
+
}
|
|
115
|
+
function w(t) {
|
|
116
|
+
const e = t.getLiteralValue(), n = C(e);
|
|
117
|
+
n !== e && t.setLiteralValue(n);
|
|
118
|
+
}
|
|
119
|
+
function E(t, e) {
|
|
120
|
+
const n = t.getInitializer();
|
|
121
|
+
i.isStringLiteral(n) ? w(n) : i.isJsxExpression(n) && g(n.getExpression(), e);
|
|
122
|
+
}
|
|
123
|
+
function F(t, e) {
|
|
124
|
+
const n = t.getBody();
|
|
125
|
+
i.isExpression(n) ? g(n, e) : n?.getDescendantsOfKind(d.ReturnStatement).forEach((r) => g(r.getExpression(), e));
|
|
126
|
+
}
|
|
127
|
+
function J(t, e) {
|
|
128
|
+
for (const n of t.findReferencesAsNodes()) {
|
|
129
|
+
const r = n.getParent(), o = i.isPropertyAccessExpression(r) ? r : n, a = o.getParent();
|
|
130
|
+
i.isBinaryExpression(a) && a.getLeft() === o && a.getOperatorToken().isKind(d.EqualsToken) ? g(a.getRight(), e) : i.isJsxAttribute(a) && a.getNameNode() === n && E(a, e);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function h(t, e) {
|
|
134
|
+
if (!(t === void 0 || e.has(t))) {
|
|
135
|
+
e.add(t);
|
|
136
|
+
for (const n of t.getDeclarations())
|
|
137
|
+
if (i.isVariableDeclaration(n) || i.isPropertyDeclaration(n) || i.isParameterDeclaration(n) || i.isBindingElement(n) || i.isPropertyAssignment(n)) {
|
|
138
|
+
g(n.getInitializer(), e);
|
|
139
|
+
const r = n.getNameNode();
|
|
140
|
+
i.isIdentifier(r) && J(r, e);
|
|
141
|
+
} else (i.isFunctionDeclaration(n) || i.isMethodDeclaration(n) || i.isFunctionExpression(n) || i.isArrowFunction(n) || i.isGetAccessorDeclaration(n)) && F(n, e);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function g(t, e) {
|
|
145
|
+
if (t !== void 0)
|
|
146
|
+
if (i.isStringLiteral(t) || i.isNoSubstitutionTemplateLiteral(t))
|
|
147
|
+
w(t);
|
|
148
|
+
else if (i.isConditionalExpression(t))
|
|
149
|
+
g(t.getWhenTrue(), e), g(t.getWhenFalse(), e);
|
|
150
|
+
else if (i.isBinaryExpression(t)) {
|
|
151
|
+
const n = t.getOperatorToken().getKind();
|
|
152
|
+
(n === d.BarBarToken || n === d.QuestionQuestionToken) && (g(t.getLeft(), e), g(t.getRight(), e));
|
|
153
|
+
} else i.isParenthesizedExpression(t) || i.isAsExpression(t) || i.isSatisfiesExpression(t) || i.isTypeAssertion(t) || i.isNonNullExpression(t) || i.isAwaitExpression(t) ? g(t.getExpression(), e) : i.isArrayLiteralExpression(t) ? t.getElements().forEach((n) => {
|
|
154
|
+
i.isExpression(n) && g(n, e);
|
|
155
|
+
}) : i.isObjectLiteralExpression(t) ? t.getProperties().forEach((n) => {
|
|
156
|
+
i.isPropertyAssignment(n) ? g(n.getInitializer(), e) : i.isShorthandPropertyAssignment(n) ? h(n.getNameNode().getSymbol(), e) : i.isSpreadAssignment(n) && g(n.getExpression(), e);
|
|
157
|
+
}) : i.isCallExpression(t) ? h(t.getExpression().getSymbol(), e) : i.isElementAccessExpression(t) ? g(t.getExpression(), e) : (i.isIdentifier(t) || i.isPropertyAccessExpression(t)) && h(t.getSymbol(), e);
|
|
158
|
+
}
|
|
159
|
+
function K(t) {
|
|
160
|
+
const e = /* @__PURE__ */ new Map();
|
|
161
|
+
for (const n of t)
|
|
162
|
+
for (const r of n.getDescendantsOfKind(d.JsxAttribute)) {
|
|
163
|
+
const o = r.getFirstAncestor(
|
|
164
|
+
(u) => i.isJsxOpeningElement(u) || i.isJsxSelfClosingElement(u)
|
|
165
|
+
);
|
|
166
|
+
if (!i.isJsxOpeningElement(o) && !i.isJsxSelfClosingElement(o))
|
|
167
|
+
continue;
|
|
168
|
+
const a = o.getTagNameNode().getText(), s = r.getNameNode().getText(), c = e.get(a) ?? /* @__PURE__ */ new Map(), l = c.get(s) ?? [];
|
|
169
|
+
l.push(r), c.set(s, l), e.set(a, c);
|
|
170
|
+
}
|
|
171
|
+
return e;
|
|
172
|
+
}
|
|
173
|
+
function O(t) {
|
|
174
|
+
const e = /* @__PURE__ */ new Map();
|
|
175
|
+
for (const n of t)
|
|
176
|
+
for (const r of n.getDescendantsOfKind(d.InterfaceDeclaration))
|
|
177
|
+
if (r.getName() === "DeclareElements")
|
|
178
|
+
for (const o of r.getProperties()) {
|
|
179
|
+
const a = o.getNameNode(), s = o.getTypeNode()?.getText();
|
|
180
|
+
if (!i.isStringLiteral(a) || s === void 0)
|
|
181
|
+
continue;
|
|
182
|
+
const c = a.getLiteralValue(), l = e.get(c) ?? /* @__PURE__ */ new Set();
|
|
183
|
+
l.add(s), e.set(c, l);
|
|
184
|
+
}
|
|
185
|
+
return e;
|
|
186
|
+
}
|
|
187
|
+
function R(t, e, n) {
|
|
188
|
+
const r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
189
|
+
for (const a of n)
|
|
190
|
+
for (const s of a.getDeclarations()) {
|
|
191
|
+
if (!i.isPropertyDeclaration(s))
|
|
192
|
+
continue;
|
|
193
|
+
const c = s.getFirstAncestorByKind(d.ClassDeclaration)?.getName();
|
|
194
|
+
if (c === void 0)
|
|
195
|
+
continue;
|
|
196
|
+
const l = s.getName(), u = `${c}.${l}`;
|
|
197
|
+
if (r.has(u))
|
|
198
|
+
continue;
|
|
199
|
+
r.add(u);
|
|
200
|
+
let m = o.get(c);
|
|
201
|
+
if (m === void 0) {
|
|
202
|
+
const b = new RegExp(`\\b${c}\\b`, "u");
|
|
203
|
+
m = [...e].filter(
|
|
204
|
+
([, f]) => [...f].some((p) => b.test(p))
|
|
205
|
+
).map(([f]) => f), o.set(c, m);
|
|
206
|
+
}
|
|
207
|
+
for (const b of m)
|
|
208
|
+
for (const f of t.get(b)?.get(l) ?? [])
|
|
209
|
+
E(f, n);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const j = {
|
|
213
|
+
meta: {
|
|
214
|
+
needsTypeInformation: !0
|
|
215
|
+
},
|
|
216
|
+
run(t) {
|
|
217
|
+
for (const a of t) {
|
|
218
|
+
var e = [];
|
|
219
|
+
try {
|
|
220
|
+
const s = A(e, z(a));
|
|
221
|
+
const c = /* @__PURE__ */ new Set();
|
|
222
|
+
const l = s.getCodemodFiles();
|
|
223
|
+
const u = K(l);
|
|
224
|
+
for (const [m, b] of u)
|
|
225
|
+
if (m.startsWith("calcite-"))
|
|
226
|
+
for (const f of T)
|
|
227
|
+
for (const p of b.get(f) ?? [])
|
|
228
|
+
E(p, c);
|
|
229
|
+
R(u, O(l), c);
|
|
230
|
+
} catch (n) {
|
|
231
|
+
var r = n, o = !0;
|
|
232
|
+
} finally {
|
|
233
|
+
y(e, r, o);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
export {
|
|
239
|
+
j as codemod
|
|
240
|
+
};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
var N = (t, e) => (e = Symbol[t]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + t), x = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
|
+
};
|
|
4
|
+
var A = (t, e, n) => {
|
|
5
|
+
if (e != null) {
|
|
6
|
+
typeof e != "object" && typeof e != "function" && x("Object expected");
|
|
7
|
+
var r, o;
|
|
8
|
+
n && (r = e[N("asyncDispose")]), r === void 0 && (r = e[N("dispose")], n && (o = r)), typeof r != "function" && x("Object not disposable"), o && (r = function() {
|
|
9
|
+
try {
|
|
10
|
+
o.call(this);
|
|
11
|
+
} catch (a) {
|
|
12
|
+
return Promise.reject(a);
|
|
13
|
+
}
|
|
14
|
+
}), t.push([n, r, e]);
|
|
15
|
+
} else n && t.push([n]);
|
|
16
|
+
return e;
|
|
17
|
+
}, y = (t, e, n) => {
|
|
18
|
+
var r = typeof SuppressedError == "function" ? SuppressedError : function(s, c, l, u) {
|
|
19
|
+
return u = Error(l), u.name = "SuppressedError", u.error = s, u.suppressed = c, u;
|
|
20
|
+
}, o = (s) => e = n ? new r(s, e, "An error was suppressed during disposal") : (n = !0, s), a = (s) => {
|
|
21
|
+
for (; s = t.pop(); )
|
|
22
|
+
try {
|
|
23
|
+
var c = s[1] && s[1].call(s[2]);
|
|
24
|
+
if (s[0]) return Promise.resolve(c).then(a, (l) => (o(l), a()));
|
|
25
|
+
} catch (l) {
|
|
26
|
+
o(l);
|
|
27
|
+
}
|
|
28
|
+
if (n) throw e;
|
|
29
|
+
};
|
|
30
|
+
return a();
|
|
31
|
+
};
|
|
32
|
+
import { SyntaxKind as d, Node as i } from "ts-morph";
|
|
33
|
+
import { c as z } from "./useProjectInstance-B86v8eX5.js";
|
|
34
|
+
const P = /* @__PURE__ */ new Map([
|
|
35
|
+
["arcgis-survey123", "arcgis-survey-123"],
|
|
36
|
+
["arrow-double-diagonal1", "arrow-double-diagonal-1"],
|
|
37
|
+
["arrow-double-diagonal2", "arrow-double-diagonal-2"],
|
|
38
|
+
["arrow-left10", "arrow-left-10"],
|
|
39
|
+
["arrow-right10", "arrow-right-10"],
|
|
40
|
+
["battery1", "battery-1"],
|
|
41
|
+
["battery2", "battery-2"],
|
|
42
|
+
["battery3", "battery-3"],
|
|
43
|
+
["battery4", "battery-4"],
|
|
44
|
+
["graph-bar100-stacked", "graph-bar-100-stacked"],
|
|
45
|
+
["hexagon2", "hexagon-2"],
|
|
46
|
+
["hexagon2-inset-large", "hexagon-2-inset-large"],
|
|
47
|
+
["hexagon2-inset-medium", "hexagon-2-inset-medium"],
|
|
48
|
+
["hexagon2-inset-small", "hexagon-2-inset-small"],
|
|
49
|
+
["i12x", "1-2x"],
|
|
50
|
+
["i14x", "1-4x"],
|
|
51
|
+
["i18x", "1-8x"],
|
|
52
|
+
["i1x", "1x"],
|
|
53
|
+
["i2d", "2d"],
|
|
54
|
+
["i2d-explore", "2d-explore"],
|
|
55
|
+
["i2x", "2-x"],
|
|
56
|
+
["i360-view", "360-view"],
|
|
57
|
+
["i3d", "3d"],
|
|
58
|
+
["i3d-building", "3d-building"],
|
|
59
|
+
["i3d-building-parameter", "3d-building-parameter"],
|
|
60
|
+
["i3d-glasses", "3d-glasses"],
|
|
61
|
+
["i3d-search", "3d-search"],
|
|
62
|
+
["i4x", "4-x"],
|
|
63
|
+
["i8x", "8-x"],
|
|
64
|
+
["language2", "language-2"],
|
|
65
|
+
["launch2", "launch-2"],
|
|
66
|
+
["layer3d", "layer-3d"],
|
|
67
|
+
["merge2", "merge-2"],
|
|
68
|
+
["number-circle1", "number-circle-1"],
|
|
69
|
+
["number-circle1f", "number-circle-1-f"],
|
|
70
|
+
["number-circle2", "number-circle-2"],
|
|
71
|
+
["number-circle2f", "number-circle-2-f"],
|
|
72
|
+
["number-circle3", "number-circle-3"],
|
|
73
|
+
["number-circle3f", "number-circle-3-f"],
|
|
74
|
+
["number-circle4", "number-circle-4"],
|
|
75
|
+
["number-circle4f", "number-circle-4-f"],
|
|
76
|
+
["number-circle5", "number-circle-5"],
|
|
77
|
+
["number-circle5f", "number-circle-5-f"],
|
|
78
|
+
["number-circle6", "number-circle-6"],
|
|
79
|
+
["number-circle6f", "number-circle-6-f"],
|
|
80
|
+
["number-circle7", "number-circle-7"],
|
|
81
|
+
["number-circle7f", "number-circle-7-f"],
|
|
82
|
+
["number-circle8", "number-circle-8"],
|
|
83
|
+
["number-circle8f", "number-circle-8-f"],
|
|
84
|
+
["number-circle9", "number-circle-9"],
|
|
85
|
+
["number-circle9f", "number-circle-9-f"],
|
|
86
|
+
["person2", "person-2"],
|
|
87
|
+
["pop-up1", "pop-up-1"],
|
|
88
|
+
["satellite0", "satellite-0"],
|
|
89
|
+
["satellite0f", "satellite-0-f"],
|
|
90
|
+
["satellite1", "satellite-1"],
|
|
91
|
+
["satellite1f", "satellite-1-f"],
|
|
92
|
+
["satellite2", "satellite-2"],
|
|
93
|
+
["satellite2f", "satellite-2-f"],
|
|
94
|
+
["satellite3", "satellite-3"],
|
|
95
|
+
["satellite3f", "satellite-3-f"],
|
|
96
|
+
["shapes2d3d", "shapes-2d-3d"],
|
|
97
|
+
["subheading1", "subheading-1"],
|
|
98
|
+
["subheading1-rtl", "subheading-1-rtl"],
|
|
99
|
+
["subheading2", "subheading-2"],
|
|
100
|
+
["subheading2-rtl", "subheading-2-rtl"],
|
|
101
|
+
["subheading3", "subheading-3"],
|
|
102
|
+
["subheading3-rtl", "subheading-3-rtl"],
|
|
103
|
+
["subheading4", "subheading-4"],
|
|
104
|
+
["subheading4-rtl", "subheading-4-rtl"],
|
|
105
|
+
["subheading5", "subheading-5"],
|
|
106
|
+
["subheading5-rtl", "subheading-5-rtl"],
|
|
107
|
+
["summarize-center-and-dispersion1", "summarize-center-and-dispersion-1"],
|
|
108
|
+
["summarize-center-and-dispersion2", "summarize-center-and-dispersion-2"],
|
|
109
|
+
["summarize-center-and-dispersion3", "summarize-center-and-dispersion-3"]
|
|
110
|
+
]), T = /* @__PURE__ */ new Set(["icon", "icon-end", "icon-start", "iconEnd", "iconStart"]), D = /[A-Z]/u, B = /^i\d/u, L = /([A-Z]+)([A-Z][a-z])/gu, I = /([a-z\d])([A-Z])/gu;
|
|
111
|
+
function C(t) {
|
|
112
|
+
let e = t;
|
|
113
|
+
return D.test(e) && (B.test(e) && (e = e.slice(1)), e = e.replace(L, "$1-$2").replace(I, "$1-$2").toLowerCase()), P.get(e) ?? e;
|
|
114
|
+
}
|
|
115
|
+
function w(t) {
|
|
116
|
+
const e = t.getLiteralValue(), n = C(e);
|
|
117
|
+
n !== e && t.setLiteralValue(n);
|
|
118
|
+
}
|
|
119
|
+
function E(t, e) {
|
|
120
|
+
const n = t.getInitializer();
|
|
121
|
+
i.isStringLiteral(n) ? w(n) : i.isJsxExpression(n) && g(n.getExpression(), e);
|
|
122
|
+
}
|
|
123
|
+
function F(t, e) {
|
|
124
|
+
const n = t.getBody();
|
|
125
|
+
i.isExpression(n) ? g(n, e) : n?.getDescendantsOfKind(d.ReturnStatement).forEach((r) => g(r.getExpression(), e));
|
|
126
|
+
}
|
|
127
|
+
function J(t, e) {
|
|
128
|
+
for (const n of t.findReferencesAsNodes()) {
|
|
129
|
+
const r = n.getParent(), o = i.isPropertyAccessExpression(r) ? r : n, a = o.getParent();
|
|
130
|
+
i.isBinaryExpression(a) && a.getLeft() === o && a.getOperatorToken().isKind(d.EqualsToken) ? g(a.getRight(), e) : i.isJsxAttribute(a) && a.getNameNode() === n && E(a, e);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function h(t, e) {
|
|
134
|
+
if (!(t === void 0 || e.has(t))) {
|
|
135
|
+
e.add(t);
|
|
136
|
+
for (const n of t.getDeclarations())
|
|
137
|
+
if (i.isVariableDeclaration(n) || i.isPropertyDeclaration(n) || i.isParameterDeclaration(n) || i.isBindingElement(n) || i.isPropertyAssignment(n)) {
|
|
138
|
+
g(n.getInitializer(), e);
|
|
139
|
+
const r = n.getNameNode();
|
|
140
|
+
i.isIdentifier(r) && J(r, e);
|
|
141
|
+
} else (i.isFunctionDeclaration(n) || i.isMethodDeclaration(n) || i.isFunctionExpression(n) || i.isArrowFunction(n) || i.isGetAccessorDeclaration(n)) && F(n, e);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function g(t, e) {
|
|
145
|
+
if (t !== void 0)
|
|
146
|
+
if (i.isStringLiteral(t) || i.isNoSubstitutionTemplateLiteral(t))
|
|
147
|
+
w(t);
|
|
148
|
+
else if (i.isConditionalExpression(t))
|
|
149
|
+
g(t.getWhenTrue(), e), g(t.getWhenFalse(), e);
|
|
150
|
+
else if (i.isBinaryExpression(t)) {
|
|
151
|
+
const n = t.getOperatorToken().getKind();
|
|
152
|
+
(n === d.BarBarToken || n === d.QuestionQuestionToken) && (g(t.getLeft(), e), g(t.getRight(), e));
|
|
153
|
+
} else i.isParenthesizedExpression(t) || i.isAsExpression(t) || i.isSatisfiesExpression(t) || i.isTypeAssertion(t) || i.isNonNullExpression(t) || i.isAwaitExpression(t) ? g(t.getExpression(), e) : i.isArrayLiteralExpression(t) ? t.getElements().forEach((n) => {
|
|
154
|
+
i.isExpression(n) && g(n, e);
|
|
155
|
+
}) : i.isObjectLiteralExpression(t) ? t.getProperties().forEach((n) => {
|
|
156
|
+
i.isPropertyAssignment(n) ? g(n.getInitializer(), e) : i.isShorthandPropertyAssignment(n) ? h(n.getNameNode().getSymbol(), e) : i.isSpreadAssignment(n) && g(n.getExpression(), e);
|
|
157
|
+
}) : i.isCallExpression(t) ? h(t.getExpression().getSymbol(), e) : i.isElementAccessExpression(t) ? g(t.getExpression(), e) : (i.isIdentifier(t) || i.isPropertyAccessExpression(t)) && h(t.getSymbol(), e);
|
|
158
|
+
}
|
|
159
|
+
function K(t) {
|
|
160
|
+
const e = /* @__PURE__ */ new Map();
|
|
161
|
+
for (const n of t)
|
|
162
|
+
for (const r of n.getDescendantsOfKind(d.JsxAttribute)) {
|
|
163
|
+
const o = r.getFirstAncestor(
|
|
164
|
+
(u) => i.isJsxOpeningElement(u) || i.isJsxSelfClosingElement(u)
|
|
165
|
+
);
|
|
166
|
+
if (!i.isJsxOpeningElement(o) && !i.isJsxSelfClosingElement(o))
|
|
167
|
+
continue;
|
|
168
|
+
const a = o.getTagNameNode().getText(), s = r.getNameNode().getText(), c = e.get(a) ?? /* @__PURE__ */ new Map(), l = c.get(s) ?? [];
|
|
169
|
+
l.push(r), c.set(s, l), e.set(a, c);
|
|
170
|
+
}
|
|
171
|
+
return e;
|
|
172
|
+
}
|
|
173
|
+
function O(t) {
|
|
174
|
+
const e = /* @__PURE__ */ new Map();
|
|
175
|
+
for (const n of t)
|
|
176
|
+
for (const r of n.getDescendantsOfKind(d.InterfaceDeclaration))
|
|
177
|
+
if (r.getName() === "DeclareElements")
|
|
178
|
+
for (const o of r.getProperties()) {
|
|
179
|
+
const a = o.getNameNode(), s = o.getTypeNode()?.getText();
|
|
180
|
+
if (!i.isStringLiteral(a) || s === void 0)
|
|
181
|
+
continue;
|
|
182
|
+
const c = a.getLiteralValue(), l = e.get(c) ?? /* @__PURE__ */ new Set();
|
|
183
|
+
l.add(s), e.set(c, l);
|
|
184
|
+
}
|
|
185
|
+
return e;
|
|
186
|
+
}
|
|
187
|
+
function R(t, e, n) {
|
|
188
|
+
const r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
189
|
+
for (const a of n)
|
|
190
|
+
for (const s of a.getDeclarations()) {
|
|
191
|
+
if (!i.isPropertyDeclaration(s))
|
|
192
|
+
continue;
|
|
193
|
+
const c = s.getFirstAncestorByKind(d.ClassDeclaration)?.getName();
|
|
194
|
+
if (c === void 0)
|
|
195
|
+
continue;
|
|
196
|
+
const l = s.getName(), u = `${c}.${l}`;
|
|
197
|
+
if (r.has(u))
|
|
198
|
+
continue;
|
|
199
|
+
r.add(u);
|
|
200
|
+
let m = o.get(c);
|
|
201
|
+
if (m === void 0) {
|
|
202
|
+
const b = new RegExp(`\\b${c}\\b`, "u");
|
|
203
|
+
m = [...e].filter(
|
|
204
|
+
([, f]) => [...f].some((p) => b.test(p))
|
|
205
|
+
).map(([f]) => f), o.set(c, m);
|
|
206
|
+
}
|
|
207
|
+
for (const b of m)
|
|
208
|
+
for (const f of t.get(b)?.get(l) ?? [])
|
|
209
|
+
E(f, n);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const j = {
|
|
213
|
+
meta: {
|
|
214
|
+
needsTypeInformation: !0
|
|
215
|
+
},
|
|
216
|
+
run(t) {
|
|
217
|
+
for (const a of t) {
|
|
218
|
+
var e = [];
|
|
219
|
+
try {
|
|
220
|
+
const s = A(e, z(a));
|
|
221
|
+
const c = /* @__PURE__ */ new Set();
|
|
222
|
+
const l = s.getCodemodFiles();
|
|
223
|
+
const u = K(l);
|
|
224
|
+
for (const [m, b] of u)
|
|
225
|
+
if (m.startsWith("calcite-"))
|
|
226
|
+
for (const f of T)
|
|
227
|
+
for (const p of b.get(f) ?? [])
|
|
228
|
+
E(p, c);
|
|
229
|
+
R(u, O(l), c);
|
|
230
|
+
} catch (n) {
|
|
231
|
+
var r = n, o = !0;
|
|
232
|
+
} finally {
|
|
233
|
+
y(e, r, o);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
export {
|
|
239
|
+
j as codemod
|
|
240
|
+
};
|
|
@@ -29,9 +29,9 @@ var g = (t, e, s) => {
|
|
|
29
29
|
};
|
|
30
30
|
return n();
|
|
31
31
|
};
|
|
32
|
-
import { p } from "./actions-
|
|
33
|
-
import { c as k } from "./useProjectInstance-
|
|
34
|
-
import { p as C } from "./cli-
|
|
32
|
+
import { p } from "./actions-8PIadCgg.js";
|
|
33
|
+
import { c as k } from "./useProjectInstance-evHsM1li.js";
|
|
34
|
+
import { p as C } from "./cli-COx17UK8.js";
|
|
35
35
|
const j = {
|
|
36
36
|
meta: {
|
|
37
37
|
needsTypeInformation: !1
|