@arcgis/codemod 6.0.0-next.43 → 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.
@@ -0,0 +1,83 @@
1
+ var g = (t, e) => (e = Symbol[t]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + t), m = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var f = (t, e, s) => {
5
+ if (e != null) {
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
+ try {
10
+ l.call(this);
11
+ } catch (n) {
12
+ return Promise.reject(n);
13
+ }
14
+ }), t.push([s, a, e]);
15
+ } else s && t.push([s]);
16
+ return e;
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
+ try {
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
+ }
28
+ if (s) throw e;
29
+ };
30
+ return n();
31
+ };
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 = {
54
+ meta: {
55
+ includeComponentFiles: !0,
56
+ needsTypeInformation: !1
57
+ },
58
+ async run(t) {
59
+ for (const n of t) {
60
+ var e = [];
61
+ try {
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
+ }
71
+ } catch (s) {
72
+ var a = s, l = !0;
73
+ } finally {
74
+ p(e, a, l);
75
+ }
76
+ }
77
+ }
78
+ };
79
+ export {
80
+ C as codemod,
81
+ A as isComponentFile,
82
+ x as renameNextListComponents
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
+ };