@arcgis/codemod 5.2.0-next.9 → 5.2.0-next.90

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,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-CakrAPrI.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-DiZc_C2o.js";
36
+ import { p as x, g as J } from "./cli-3BztOTDV.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,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-CtxXjpuZ.js";
33
+ import { c as k } from "./useProjectInstance-CGaAin_6.js";
34
+ import { p as C } from "./cli-BIg5ZLTm.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
+ };
@@ -30,12 +30,12 @@ var D = (n, e, i) => {
30
30
  return s();
31
31
  };
32
32
  import { log as y } from "@arcgis/toolkit/log";
33
- import { c as V } from "./useProjectInstance-CiX-mY1O.js";
33
+ import { c as V } from "./useProjectInstance-DixfNjtt.js";
34
34
  import { mergeApiExtractorConfigs as O, loadApiExtractorConfig as _ } from "@arcgis/api-extractor/extractor/config";
35
- import { g as F } from "./cli-DPzs7oKq.js";
35
+ import { g as F } from "./cli-CJfbqFa-.js";
36
36
  import { writeFile as I, readFile as j } from "node:fs/promises";
37
37
  import { join as W, relative as Q } from "node:path";
38
- import { existsAsync as U } from "@arcgis/components-build-utils";
38
+ import { existsAsync as U } from "@arcgis/node-toolkit/file";
39
39
  import { ApiExtractor as Y } from "@arcgis/api-extractor/extractor/ApiExtractor";
40
40
  import { SyntaxKind as f } from "ts-morph";
41
41
  import { getApiMemberName as q } from "@arcgis/api-extractor/utils/apiHelpers";
@@ -182,7 +182,7 @@ ${a}
182
182
  For each added declaration, remove @public from it if it is not supposed to be public. For each removed declaration, add @public JSDoc tag if it needs to remain public.`
183
183
  );
184
184
  }
185
- const te = "5.2.0-next.9", ne = {
185
+ const te = "5.2.0-next.79", ne = {
186
186
  version: te
187
187
  };
188
188
  async function oe(n) {