@arcgis/codemod 5.2.0-next.94 → 5.2.0-next.95

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.
@@ -1,140 +0,0 @@
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-BH4cN_p7.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-9qPLRrHD.js";
36
- import { p as x, g as J } from "./cli-BzG3c735.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
- };