@arcgis/codemod 5.2.0-next.30 → 5.2.0-next.31
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/dist/{actions-Bi-xCY7k.js → actions-DhPreNjO.js} +2 -2
- package/dist/{cli-xhj2LQ_o.js → cli-Bd8qr2gt.js} +24 -21
- package/dist/cli.js +2 -2
- package/dist/codemod-BM-syCz5.js +106 -0
- package/dist/{codemod-tn0kImof.js → codemod-Ce4JSf53.js} +3 -3
- package/dist/{codemod-Bv7_agIz.js → codemod-DPYQ1AvG.js} +42 -74
- package/dist/{codemod-B8PpfzSR.js → codemod-DyAGLMzu.js} +4 -4
- package/dist/packageJson-BLIoQkL0.js +39 -0
- package/dist/{useProjectInstance-D15JI9fN.js → useProjectInstance-Cj8A3A2H.js} +2 -2
- package/package.json +4 -4
|
@@ -1,93 +1,61 @@
|
|
|
1
|
-
var m = (o,
|
|
1
|
+
var m = (o, e) => (e = Symbol[o]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + o), d = (o) => {
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
if (
|
|
6
|
-
typeof
|
|
7
|
-
var
|
|
8
|
-
r && (
|
|
4
|
+
var g = (o, e, r) => {
|
|
5
|
+
if (e != null) {
|
|
6
|
+
typeof e != "object" && typeof e != "function" && d("Object expected");
|
|
7
|
+
var t, s;
|
|
8
|
+
r && (t = e[m("asyncDispose")]), t === void 0 && (t = e[m("dispose")], r && (s = t)), typeof t != "function" && d("Object not disposable"), s && (t = function() {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
return Promise.reject(
|
|
10
|
+
s.call(this);
|
|
11
|
+
} catch (a) {
|
|
12
|
+
return Promise.reject(a);
|
|
13
13
|
}
|
|
14
|
-
}), o.push([r,
|
|
14
|
+
}), o.push([r, t, e]);
|
|
15
15
|
} else r && o.push([r]);
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
var
|
|
19
|
-
return l = Error(c), l.name = "SuppressedError", l.error =
|
|
20
|
-
},
|
|
21
|
-
for (;
|
|
16
|
+
return e;
|
|
17
|
+
}, p = (o, e, r) => {
|
|
18
|
+
var t = typeof SuppressedError == "function" ? SuppressedError : function(i, n, c, l) {
|
|
19
|
+
return l = Error(c), l.name = "SuppressedError", l.error = i, l.suppressed = n, l;
|
|
20
|
+
}, s = (i) => e = r ? new t(i, e, "An error was suppressed during disposal") : (r = !0, i), a = (i) => {
|
|
21
|
+
for (; i = o.pop(); )
|
|
22
22
|
try {
|
|
23
|
-
var n =
|
|
24
|
-
if (
|
|
23
|
+
var n = i[1] && i[1].call(i[2]);
|
|
24
|
+
if (i[0]) return Promise.resolve(n).then(a, (c) => (s(c), a()));
|
|
25
25
|
} catch (c) {
|
|
26
|
-
|
|
26
|
+
s(c);
|
|
27
27
|
}
|
|
28
|
-
if (r) throw
|
|
28
|
+
if (r) throw e;
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return a();
|
|
31
31
|
};
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
async function L(o, i) {
|
|
38
|
-
const r = /* @__PURE__ */ new Set();
|
|
39
|
-
for (const a of o) {
|
|
40
|
-
const t = a.packageJson;
|
|
41
|
-
if (t === void 0 || r.has(t.filePath))
|
|
42
|
-
continue;
|
|
43
|
-
r.add(t.filePath);
|
|
44
|
-
const s = t.contents;
|
|
45
|
-
try {
|
|
46
|
-
const e = await i(s, t.filePath);
|
|
47
|
-
s !== e && await E(t.filePath, `${JSON.stringify(e, null, 2)}
|
|
48
|
-
`, "utf8");
|
|
49
|
-
} catch (e) {
|
|
50
|
-
process.exitCode = 1, g(
|
|
51
|
-
"error",
|
|
52
|
-
k(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 P(o, i) {
|
|
60
|
-
for (const r of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
|
|
61
|
-
const a = o[r];
|
|
62
|
-
if (a) {
|
|
63
|
-
const t = i(a, r);
|
|
64
|
-
t !== a && (o = { ...o, [r]: t });
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return o;
|
|
68
|
-
}
|
|
32
|
+
import { p as f } from "./actions-DhPreNjO.js";
|
|
33
|
+
import { f as k, a as u } from "./packageJson-BLIoQkL0.js";
|
|
34
|
+
import { c as E } from "./useProjectInstance-Cj8A3A2H.js";
|
|
35
|
+
import { p as b, g as L } from "./cli-Bd8qr2gt.js";
|
|
36
|
+
import { log as T } from "@arcgis/toolkit/log";
|
|
69
37
|
const F = {
|
|
70
38
|
meta: {
|
|
71
39
|
needsTypeInformation: !1
|
|
72
40
|
},
|
|
73
41
|
async run(o) {
|
|
74
|
-
await
|
|
42
|
+
await k(
|
|
75
43
|
o,
|
|
76
|
-
(
|
|
77
|
-
|
|
78
|
-
(
|
|
79
|
-
...
|
|
44
|
+
(a) => u(
|
|
45
|
+
a,
|
|
46
|
+
(i) => i["@arcgis/components-utils"] ? {
|
|
47
|
+
...i,
|
|
80
48
|
"@arcgis/components-utils": void 0,
|
|
81
|
-
"@arcgis/toolkit":
|
|
82
|
-
} :
|
|
49
|
+
"@arcgis/toolkit": i["@arcgis/components-utils"]
|
|
50
|
+
} : i
|
|
83
51
|
)
|
|
84
52
|
);
|
|
85
|
-
for (const
|
|
86
|
-
var
|
|
53
|
+
for (const a of o) {
|
|
54
|
+
var e = [];
|
|
87
55
|
try {
|
|
88
|
-
const
|
|
89
|
-
for (const n of
|
|
90
|
-
|
|
56
|
+
const i = g(e, E(a));
|
|
57
|
+
for (const n of i.getCodemodFiles())
|
|
58
|
+
f(n, {
|
|
91
59
|
"@arcgis/components-utils": {
|
|
92
60
|
// Deprecated
|
|
93
61
|
setFocusOnElement: [{ do: "deprecate" }, { do: "rename", specifier: "@arcgis/toolkit/dom" }],
|
|
@@ -140,14 +108,14 @@ const F = {
|
|
|
140
108
|
}
|
|
141
109
|
});
|
|
142
110
|
} catch (r) {
|
|
143
|
-
var
|
|
111
|
+
var t = r, s = !0;
|
|
144
112
|
} finally {
|
|
145
|
-
|
|
113
|
+
p(e, t, s);
|
|
146
114
|
}
|
|
147
115
|
}
|
|
148
|
-
|
|
116
|
+
b(), T(
|
|
149
117
|
"info",
|
|
150
|
-
|
|
118
|
+
L.codemodName,
|
|
151
119
|
"Next step: run npm install/pnpm install/yarn install to get @arcgis/toolkit package installed."
|
|
152
120
|
);
|
|
153
121
|
}
|
|
@@ -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-
|
|
33
|
+
import { c as V } from "./useProjectInstance-Cj8A3A2H.js";
|
|
34
34
|
import { mergeApiExtractorConfigs as O, loadApiExtractorConfig as _ } from "@arcgis/api-extractor/extractor/config";
|
|
35
|
-
import { g as F } from "./cli-
|
|
35
|
+
import { g as F } from "./cli-Bd8qr2gt.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/
|
|
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.
|
|
185
|
+
const te = "5.2.0-next.31", ne = {
|
|
186
186
|
version: te
|
|
187
187
|
};
|
|
188
188
|
async function oe(n) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { log as r } from "@arcgis/toolkit/log";
|
|
2
|
+
import { writeFile as s } from "node:fs/promises";
|
|
3
|
+
import { f } from "./actions-DhPreNjO.js";
|
|
4
|
+
async function h(n, a) {
|
|
5
|
+
const o = /* @__PURE__ */ new Set();
|
|
6
|
+
for (const i of n) {
|
|
7
|
+
const e = i.packageJson;
|
|
8
|
+
if (e === void 0 || o.has(e.filePath))
|
|
9
|
+
continue;
|
|
10
|
+
o.add(e.filePath);
|
|
11
|
+
const c = e.contents;
|
|
12
|
+
try {
|
|
13
|
+
const t = await a(c, e.filePath);
|
|
14
|
+
c !== t && await s(e.filePath, `${JSON.stringify(t, null, 2)}
|
|
15
|
+
`, "utf8");
|
|
16
|
+
} catch (t) {
|
|
17
|
+
process.exitCode = 1, r(
|
|
18
|
+
"error",
|
|
19
|
+
f(e.filePath),
|
|
20
|
+
`Error occurred while migrating: ${String(t)}`,
|
|
21
|
+
typeof t == "object" && t !== null && "stack" in t ? { detail: { stack: t.stack } } : void 0
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function u(n, a) {
|
|
27
|
+
for (const o of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
|
|
28
|
+
const i = n[o];
|
|
29
|
+
if (i) {
|
|
30
|
+
const e = a(i, o);
|
|
31
|
+
e !== i && (n = { ...n, [o]: e });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return n;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
u as a,
|
|
38
|
+
h as f
|
|
39
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Project as l } from "ts-morph";
|
|
2
2
|
import { log as f } from "@arcgis/toolkit/log";
|
|
3
|
-
import { path as p } from "@arcgis/
|
|
4
|
-
import { g as t, d } from "./cli-
|
|
3
|
+
import { path as p } from "@arcgis/node-toolkit/path";
|
|
4
|
+
import { g as t, d } from "./cli-Bd8qr2gt.js";
|
|
5
5
|
import { styleText as s } from "node:util";
|
|
6
6
|
function P(e) {
|
|
7
7
|
if (t.project !== void 0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/codemod",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.31",
|
|
4
4
|
"description": "A codemod toolkit for updating and modernizing ArcGIS Maps SDK for JavaScript codebases.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"ts-morph": "^28.0.0",
|
|
19
19
|
"tslib": "^2.8.1",
|
|
20
20
|
"typescript": "~6.0.2",
|
|
21
|
-
"@arcgis/api-extractor": "5.2.0-next.
|
|
22
|
-
"@arcgis/
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
21
|
+
"@arcgis/api-extractor": "5.2.0-next.31",
|
|
22
|
+
"@arcgis/node-toolkit": "5.2.0-next.31",
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.31"
|
|
24
24
|
}
|
|
25
25
|
}
|