@arcgis/codemod 6.0.0-next.44 → 6.0.0-next.45
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 +73 -6
- package/dist/chunks/actions.js +261 -249
- package/dist/chunks/aggregateUsages.js +11 -10
- package/dist/chunks/apiName.js +123 -0
- package/dist/chunks/auditDefinitions.js +49 -47
- package/dist/chunks/auditUsages.js +649 -647
- package/dist/chunks/classification.js +73 -192
- package/dist/chunks/cli.js +52 -52
- package/dist/chunks/codemod.js +46 -46
- package/dist/chunks/codemod10.js +6039 -63
- package/dist/chunks/codemod11.js +54 -45
- package/dist/chunks/codemod12.js +74 -0
- package/dist/chunks/codemod9.js +218 -6017
- package/dist/chunks/componentAudit.js +141 -216
- package/dist/chunks/format.js +8 -7
- package/dist/chunks/hardcodedBehavior.js +96 -0
- package/dist/chunks/sync.js +1 -1
- package/package.json +4 -4
package/dist/chunks/codemod11.js
CHANGED
|
@@ -1,74 +1,83 @@
|
|
|
1
|
-
var
|
|
1
|
+
var g = (t, e) => (e = Symbol[t]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + t), m = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
4
|
+
var f = (t, e, s) => {
|
|
5
5
|
if (e != null) {
|
|
6
|
-
typeof e != "object" && typeof e != "function" &&
|
|
7
|
-
var
|
|
8
|
-
s && (
|
|
6
|
+
typeof e != "object" && typeof e != "function" && m("Object expected");
|
|
7
|
+
var a, l;
|
|
8
|
+
s && (a = e[g("asyncDispose")]), a === void 0 && (a = e[g("dispose")], s && (l = a)), typeof a != "function" && m("Object not disposable"), l && (a = function() {
|
|
9
9
|
try {
|
|
10
|
-
|
|
10
|
+
l.call(this);
|
|
11
11
|
} catch (n) {
|
|
12
12
|
return Promise.reject(n);
|
|
13
13
|
}
|
|
14
|
-
}), t.push([s,
|
|
14
|
+
}), t.push([s, a, e]);
|
|
15
15
|
} else s && t.push([s]);
|
|
16
16
|
return e;
|
|
17
|
-
},
|
|
18
|
-
var
|
|
19
|
-
return
|
|
20
|
-
},
|
|
21
|
-
for (;
|
|
17
|
+
}, p = (t, e, s) => {
|
|
18
|
+
var a = typeof SuppressedError == "function" ? SuppressedError : function(i, c, r, o) {
|
|
19
|
+
return o = Error(r), o.name = "SuppressedError", o.error = i, o.suppressed = c, o;
|
|
20
|
+
}, l = (i) => e = s ? new a(i, e, "An error was suppressed during disposal") : (s = !0, i), n = (i) => {
|
|
21
|
+
for (; i = t.pop(); )
|
|
22
22
|
try {
|
|
23
|
-
var
|
|
24
|
-
if (
|
|
25
|
-
} catch (
|
|
26
|
-
r
|
|
23
|
+
var c = i[1] && i[1].call(i[2]);
|
|
24
|
+
if (i[0]) return Promise.resolve(c).then(n, (r) => (l(r), n()));
|
|
25
|
+
} catch (r) {
|
|
26
|
+
l(r);
|
|
27
27
|
}
|
|
28
28
|
if (s) throw e;
|
|
29
29
|
};
|
|
30
30
|
return n();
|
|
31
31
|
};
|
|
32
|
-
import {
|
|
33
|
-
import { c as
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
import { readFile as u, writeFile as d } from "node:fs/promises";
|
|
33
|
+
import { c as L } from "./useProjectInstance.js";
|
|
34
|
+
const y = [
|
|
35
|
+
["ArcgisBasemapLayerListNext", "ArcgisBasemapLayerList"],
|
|
36
|
+
["ArcgisCatalogLayerListNext", "ArcgisCatalogLayerList"],
|
|
37
|
+
["ArcgisLayerListNext", "ArcgisLayerList"],
|
|
38
|
+
["ArcgisTableListNext", "ArcgisTableList"],
|
|
39
|
+
["arcgis-basemap-layer-list-next", "arcgis-basemap-layer-list"],
|
|
40
|
+
["arcgis-catalog-layer-list-next", "arcgis-catalog-layer-list"],
|
|
41
|
+
["arcgis-layer-list-next", "arcgis-layer-list"],
|
|
42
|
+
["arcgis-table-list-next", "arcgis-table-list"]
|
|
43
|
+
], T = [".css", ".html", ".sass", ".scss"];
|
|
44
|
+
function A(t) {
|
|
45
|
+
return T.some((e) => t.endsWith(e));
|
|
46
|
+
}
|
|
47
|
+
function x(t) {
|
|
48
|
+
let e = t;
|
|
49
|
+
for (const [s, a] of y)
|
|
50
|
+
e = e.replaceAll(s, a);
|
|
51
|
+
return e;
|
|
52
|
+
}
|
|
53
|
+
const C = {
|
|
36
54
|
meta: {
|
|
55
|
+
includeComponentFiles: !0,
|
|
37
56
|
needsTypeInformation: !1
|
|
38
57
|
},
|
|
39
|
-
run(t) {
|
|
58
|
+
async run(t) {
|
|
40
59
|
for (const n of t) {
|
|
41
60
|
var e = [];
|
|
42
61
|
try {
|
|
43
|
-
const
|
|
44
|
-
for (const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
});
|
|
62
|
+
const i = f(e, L(n));
|
|
63
|
+
for (const c of i.getCodemodFiles()) {
|
|
64
|
+
const r = c.getFullText(), o = x(r);
|
|
65
|
+
o !== r && c.replaceWithText(o);
|
|
66
|
+
}
|
|
67
|
+
for (const c of n.filePaths.filter(A)) {
|
|
68
|
+
const r = await u(c, "utf8"), o = x(r);
|
|
69
|
+
o !== r && await d(c, o);
|
|
70
|
+
}
|
|
63
71
|
} catch (s) {
|
|
64
|
-
var
|
|
72
|
+
var a = s, l = !0;
|
|
65
73
|
} finally {
|
|
66
|
-
|
|
74
|
+
p(e, a, l);
|
|
67
75
|
}
|
|
68
76
|
}
|
|
69
|
-
C();
|
|
70
77
|
}
|
|
71
78
|
};
|
|
72
79
|
export {
|
|
73
|
-
|
|
80
|
+
C as codemod,
|
|
81
|
+
A as isComponentFile,
|
|
82
|
+
x as renameNextListComponents
|
|
74
83
|
};
|
|
@@ -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.js";
|
|
33
|
+
import { c as k } from "./useProjectInstance.js";
|
|
34
|
+
import { p as C } from "./cli.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
|
+
};
|