@arcgis/codemod 6.0.0-next.13 → 6.0.0-next.15
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/chunks/artifact.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findPath as c } from "@arcgis/node-toolkit/file";
|
|
2
2
|
import { path as s, toPosixPathSeparators as p } from "@arcgis/node-toolkit/path";
|
|
3
3
|
import { collectOutputSync as i } from "@arcgis/node-toolkit/shell";
|
|
4
|
-
const f = "6.0.0-next.
|
|
4
|
+
const f = "6.0.0-next.15";
|
|
5
5
|
function w(o, e) {
|
|
6
6
|
return o.package.localeCompare(e.package) || o.file.localeCompare(e.file) || o.line - e.line || o.column - e.column || t(o.module, e.module) || t(o.memberOf, e.memberOf) || o.name.localeCompare(e.name) || t(o.kind, e.kind) || t(o.category, e.category) || t(o.provenance, e.provenance) || String(o.deprecated).localeCompare(String(e.deprecated));
|
|
7
7
|
}
|
package/dist/chunks/codemod5.js
CHANGED
|
@@ -46,7 +46,6 @@ const p = "@arcgis/components-build-utils", v = {
|
|
|
46
46
|
asyncFindPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
47
47
|
createFileIfNotExists: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
48
48
|
gitIgnoreFileToGlobs: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
49
|
-
gitIgnoreToGlob: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
50
49
|
isPosix: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
51
50
|
toPosixPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
52
51
|
normalizePath: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import g from "typescript";
|
|
2
2
|
import { findPath as v, asyncFindPath as x } from "@arcgis/node-toolkit/file";
|
|
3
3
|
import { path as r } from "@arcgis/node-toolkit/path";
|
|
4
|
-
import { retrievePackageJson as
|
|
5
|
-
import { log as
|
|
6
|
-
import { realpath as
|
|
4
|
+
import { retrievePackageJson as k, asyncRetrievePackageJson as D } from "@arcgis/node-toolkit/packageJson";
|
|
5
|
+
import { log as S } from "@arcgis/toolkit/log";
|
|
6
|
+
import { realpath as h, readFile as b } from "node:fs/promises";
|
|
7
7
|
import { f as P } from "./log.js";
|
|
8
8
|
import { b as j } from "./cli.js";
|
|
9
|
-
function R(e) {
|
|
10
|
-
return typeof e == "string" ? e : e.map((n) => n.kind === f.SyntaxKind.JSDocText ? n.text : M(n.getText())).join("");
|
|
11
|
-
}
|
|
12
9
|
function _(e) {
|
|
13
|
-
return e ===
|
|
10
|
+
return typeof e == "string" ? e : e.map((n) => n.kind === g.SyntaxKind.JSDocText ? n.text : M(n.getText())).join("");
|
|
11
|
+
}
|
|
12
|
+
function A(e) {
|
|
13
|
+
return e === void 0 ? void 0 : E(g.displayPartsToString([...e]));
|
|
14
14
|
}
|
|
15
15
|
function E(e) {
|
|
16
16
|
return e.replace(
|
|
@@ -26,14 +26,14 @@ function w(e) {
|
|
|
26
26
|
const n = e.trim().replace(/^(\S+)\s+([/:#!.])/u, "$1$2"), t = n.indexOf("|");
|
|
27
27
|
if (t !== -1)
|
|
28
28
|
return n.slice(t + 1).trim() || n.slice(0, t).trim();
|
|
29
|
-
const [
|
|
30
|
-
return a.join(" ") ||
|
|
29
|
+
const [i, ...a] = n.split(/\s+/u);
|
|
30
|
+
return a.join(" ") || i;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function z(e, n) {
|
|
33
33
|
const t = v("package.json", e);
|
|
34
|
-
return t === void 0 ? n :
|
|
34
|
+
return t === void 0 ? n : k(r.dirname(t)).name ?? n;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const f = {
|
|
37
37
|
docsLegacyDependencyLocations: /* @__PURE__ */ new Map([
|
|
38
38
|
["@arcgis/coding-components", "packages/coding-packages/coding-components"],
|
|
39
39
|
["@arcgis/core", "packages/core-packages/core/output/npm/esm"],
|
|
@@ -44,25 +44,18 @@ const g = {
|
|
|
44
44
|
["@esri/calcite-components-react", "packages/docs/app/node_modules/@esri/calcite-components-react"],
|
|
45
45
|
["monaco-editor", "packages/docs/app/node_modules/monaco-editor"]
|
|
46
46
|
]),
|
|
47
|
-
excludedPackageNames: /* @__PURE__ */ new Set(
|
|
48
|
-
"@arcgis/charts-components-react",
|
|
49
|
-
"@arcgis/coding-components-react",
|
|
50
|
-
"@arcgis/components-build-utils",
|
|
51
|
-
"@arcgis/map-components-react",
|
|
52
|
-
"@arcgis/portal-components-react",
|
|
53
|
-
"@arcgis-test/lit-components-react"
|
|
54
|
-
]),
|
|
47
|
+
excludedPackageNames: /* @__PURE__ */ new Set(),
|
|
55
48
|
excludedPathFragments: ["/.astro/"],
|
|
56
49
|
excludedDefinitionPathFragments: ["test-package", "packages/docs/lumina-code-samples/", "packages/starter-packages/"],
|
|
57
|
-
ignoreDeprecatedApis: [
|
|
58
|
-
ignoredDeprecationsByIncludes: [
|
|
50
|
+
ignoreDeprecatedApis: [],
|
|
51
|
+
ignoredDeprecationsByIncludes: []
|
|
59
52
|
};
|
|
60
|
-
function
|
|
53
|
+
function R(e) {
|
|
61
54
|
const n = /* @__PURE__ */ new Map(), t = {};
|
|
62
55
|
if (e?.contents.name !== "@webgis/docs")
|
|
63
56
|
return { packages: n, paths: t };
|
|
64
|
-
const
|
|
65
|
-
if (r.relative(a,
|
|
57
|
+
const i = r.dirname(e.filePath), a = r.resolve(i, "../../..");
|
|
58
|
+
if (r.relative(a, i) !== "packages/docs/app" || !g.sys.fileExists(r.join(a, "pnpm-workspace.yaml")))
|
|
66
59
|
return { packages: n, paths: t };
|
|
67
60
|
const s = new Set(
|
|
68
61
|
Object.entries({
|
|
@@ -77,52 +70,52 @@ function z(e) {
|
|
|
77
70
|
"Didn't find any catalog:legacyStarshipDeps in @webgis/docs. Update special handling in @arcgis/codemod"
|
|
78
71
|
);
|
|
79
72
|
for (const o of s) {
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
73
|
+
const c = f.docsLegacyDependencyLocations.get(o);
|
|
74
|
+
if (c === void 0)
|
|
82
75
|
throw new Error(
|
|
83
76
|
`Unmapped legacy dependency ${o} in @webgis/docs. Update special handling in @arcgis/codemod.`
|
|
84
77
|
);
|
|
85
|
-
const l = r.join(a,
|
|
86
|
-
if (!
|
|
78
|
+
const l = r.join(a, c), p = r.join(l, "package.json");
|
|
79
|
+
if (!g.sys.fileExists(p))
|
|
87
80
|
throw new Error(
|
|
88
|
-
`Missing audit dependency ${o} at ${
|
|
81
|
+
`Missing audit dependency ${o} at ${p}. Install dependencies and build workspace packages before auditing usages.`
|
|
89
82
|
);
|
|
90
|
-
const m =
|
|
91
|
-
n.set(o,
|
|
92
|
-
for (const [
|
|
83
|
+
const m = k(l);
|
|
84
|
+
n.set(o, p);
|
|
85
|
+
for (const [d, u] of Object.entries(
|
|
93
86
|
m.exports ?? { ".": m.types ?? "./index.d.ts", "./*": "./*" }
|
|
94
87
|
)) {
|
|
95
88
|
const y = typeof u == "string" ? u : u.types;
|
|
96
|
-
y !== void 0 && (t[
|
|
89
|
+
y !== void 0 && (t[d === "." ? o : `${o}/${d.slice(2)}`] = [r.resolve(l, y)]);
|
|
97
90
|
}
|
|
98
91
|
}
|
|
99
92
|
return { packages: n, paths: t };
|
|
100
93
|
}
|
|
101
94
|
function K(e) {
|
|
102
|
-
return e !== void 0 &&
|
|
95
|
+
return e !== void 0 && f.excludedPackageNames.has(e);
|
|
103
96
|
}
|
|
104
97
|
function N(e) {
|
|
105
|
-
return
|
|
98
|
+
return f.excludedPathFragments.some((n) => `/${e}`.includes(n));
|
|
106
99
|
}
|
|
107
100
|
function V(e) {
|
|
108
|
-
return N(e) ||
|
|
101
|
+
return N(e) || f.excludedDefinitionPathFragments.some((n) => e.includes(n));
|
|
109
102
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
103
|
+
function q(e, n) {
|
|
104
|
+
return f.ignoreDeprecatedApis.some((t) => t === e) || n != null && f.ignoredDeprecationsByIncludes.some((t) => n.includes(t));
|
|
112
105
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
for (const s of
|
|
106
|
+
function $(e, n, t) {
|
|
107
|
+
const i = JSON.parse(e), a = { definitions: [], components: /* @__PURE__ */ new Set() };
|
|
108
|
+
for (const s of i.modules)
|
|
116
109
|
for (const o of s.declarations ?? []) {
|
|
117
|
-
let
|
|
118
|
-
|
|
110
|
+
let c = function(p, m, d) {
|
|
111
|
+
d !== !0 && typeof d != "string" || a.definitions.push({
|
|
119
112
|
package: t,
|
|
120
113
|
module: s.path,
|
|
121
|
-
name:
|
|
114
|
+
name: p,
|
|
122
115
|
kind: m,
|
|
123
116
|
memberOf: m === "element" ? void 0 : l,
|
|
124
117
|
provenance: "manifest",
|
|
125
|
-
reason: typeof
|
|
118
|
+
reason: typeof d == "string" ? d : void 0,
|
|
126
119
|
sourceFileName: n,
|
|
127
120
|
line: 1,
|
|
128
121
|
column: 1
|
|
@@ -131,50 +124,50 @@ function O(e, n, t) {
|
|
|
131
124
|
if (!("tagName" in o) || o.tagName === void 0)
|
|
132
125
|
continue;
|
|
133
126
|
const l = o.tagName;
|
|
134
|
-
a.components.add(l),
|
|
135
|
-
for (const [
|
|
127
|
+
a.components.add(l), c(l, "element", o.deprecated);
|
|
128
|
+
for (const [p, m] of [
|
|
136
129
|
["cssProperties", "css-property"],
|
|
137
130
|
["cssParts", "css-part"],
|
|
138
131
|
["cssStates", "css-state"],
|
|
139
132
|
["slots", "slot"],
|
|
140
133
|
["attributes", "attribute"]
|
|
141
134
|
])
|
|
142
|
-
for (const
|
|
143
|
-
|
|
135
|
+
for (const d of o[p] ?? [])
|
|
136
|
+
p === "slots" && d.name === "" || c(d.name, m, d.deprecated);
|
|
144
137
|
}
|
|
145
138
|
return a;
|
|
146
139
|
}
|
|
147
|
-
function
|
|
140
|
+
function G(e) {
|
|
148
141
|
const n = e.flatMap((s) => s.definitions), t = /* @__PURE__ */ new Map();
|
|
149
142
|
for (const s of e)
|
|
150
143
|
for (const o of s.components) {
|
|
151
|
-
const
|
|
152
|
-
|
|
144
|
+
const c = t.get(o) ?? [];
|
|
145
|
+
c.push(s), t.set(o, c);
|
|
153
146
|
}
|
|
154
|
-
const
|
|
147
|
+
const i = /* @__PURE__ */ new Map(), a = Map.groupBy(
|
|
155
148
|
n.filter(({ kind: s }) => s === "css-property"),
|
|
156
149
|
({ name: s }) => s
|
|
157
150
|
);
|
|
158
151
|
for (const [s, o] of a)
|
|
159
|
-
new Set(o.map((
|
|
160
|
-
return { hasDeprecatedApis: n.length > 0, components: t, cssVariables:
|
|
152
|
+
new Set(o.map((c) => c.package)).size === 1 && i.set(s, o[0]);
|
|
153
|
+
return { hasDeprecatedApis: n.length > 0, components: t, cssVariables: i };
|
|
161
154
|
}
|
|
162
|
-
function
|
|
155
|
+
function H(e = "warn", n) {
|
|
163
156
|
const t = /* @__PURE__ */ new Map();
|
|
164
|
-
return async (
|
|
165
|
-
const a = await
|
|
157
|
+
return async (i) => {
|
|
158
|
+
const a = await h(i);
|
|
166
159
|
let s = t.get(a);
|
|
167
|
-
return s === void 0 && (s =
|
|
160
|
+
return s === void 0 && (s = O(a).catch((o) => {
|
|
168
161
|
if (n?.(), e === "throw")
|
|
169
162
|
throw new Error(
|
|
170
163
|
`Unable to read component manifest for ${a}. Build the package before auditing definitions.`,
|
|
171
164
|
{ cause: o }
|
|
172
165
|
);
|
|
173
|
-
|
|
166
|
+
S("warn", P(a), `Unable to read component manifest: ${String(o)}`);
|
|
174
167
|
}), t.set(a, s)), await s;
|
|
175
168
|
};
|
|
176
169
|
}
|
|
177
|
-
async function
|
|
170
|
+
async function Q(e, n, t, i) {
|
|
178
171
|
const a = /* @__PURE__ */ new Set([
|
|
179
172
|
...Object.keys(e.contents.dependencies ?? {}),
|
|
180
173
|
...Object.keys(e.contents.devDependencies ?? {}),
|
|
@@ -182,29 +175,29 @@ async function H(e, n, t, c) {
|
|
|
182
175
|
...Object.keys(e.contents.optionalDependencies ?? {})
|
|
183
176
|
]), s = await Promise.all(
|
|
184
177
|
[...a].filter((o) => o !== e.contents.name && (!t || j(o))).map(async (o) => {
|
|
185
|
-
const
|
|
186
|
-
return
|
|
178
|
+
const c = i?.get(o) ?? await x(r.join("node_modules", o, "package.json"), r.dirname(e.filePath));
|
|
179
|
+
return c === void 0 ? void 0 : await n(c);
|
|
187
180
|
})
|
|
188
181
|
);
|
|
189
182
|
return [...new Set(s.filter((o) => o !== void 0))];
|
|
190
183
|
}
|
|
191
|
-
async function
|
|
192
|
-
const n = r.dirname(e), t = await D(n),
|
|
193
|
-
if (
|
|
184
|
+
async function O(e) {
|
|
185
|
+
const n = r.dirname(e), t = await D(n), i = typeof t.customElements == "string" ? t.customElements : t.customElements?.[0];
|
|
186
|
+
if (i === void 0)
|
|
194
187
|
return;
|
|
195
|
-
const a = await
|
|
196
|
-
return
|
|
188
|
+
const a = await h(r.resolve(n, i));
|
|
189
|
+
return $(await b(a, "utf8"), a, t.name);
|
|
197
190
|
}
|
|
198
191
|
export {
|
|
199
192
|
N as a,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
193
|
+
q as b,
|
|
194
|
+
G as c,
|
|
195
|
+
z as d,
|
|
196
|
+
H as e,
|
|
197
|
+
_ as f,
|
|
198
|
+
R as g,
|
|
199
|
+
A as h,
|
|
207
200
|
V as i,
|
|
208
|
-
|
|
201
|
+
Q as l,
|
|
209
202
|
K as s
|
|
210
203
|
};
|
package/dist/chunks/index.js
CHANGED
|
@@ -363,7 +363,7 @@ function Ze(s, e, n) {
|
|
|
363
363
|
}
|
|
364
364
|
const et = /[:/@\\]|^\.{1,2}$|\.(?:tgz|tar(?:\.gz)?)$/iu;
|
|
365
365
|
async function tt(s, e, n) {
|
|
366
|
-
const t = JSON.parse('["@arcgis/ai-components","@arcgis/api-extractor","@arcgis/arcade-parser","@arcgis/arcade-languageservice","@arcgis/charts-components","@arcgis/
|
|
366
|
+
const t = JSON.parse('["@arcgis/ai-components","@arcgis/api-extractor","@arcgis/arcade-parser","@arcgis/arcade-languageservice","@arcgis/charts-components","@arcgis/codemod","@arcgis/coding-components","@arcgis/common-components","@arcgis/core","@arcgis/lumina-toolkit","@arcgis/create","@arcgis/eslint-config","@arcgis/languages-api-utils","@arcgis/languages-sdk-spec","@arcgis/lumina","@arcgis/lumina-compiler","@arcgis/map-components","@arcgis/node-toolkit","@arcgis/portal-components","@arcgis/toolkit"]'), o = new Set(t), r = /* @__PURE__ */ new Set([...t, "@esri/calcite-components"]), i = [...new Map(s.map((a) => [a.filePath, a])).values()], d = new Set(
|
|
367
367
|
(await Promise.all(
|
|
368
368
|
i.map(async ({ filePath: a, contents: m }) => {
|
|
369
369
|
const h = [await R(a)], x = m.publishConfig?.directory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/codemod",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.15",
|
|
4
4
|
"description": "A codemod toolkit for updating and modernizing ArcGIS Maps SDK for JavaScript codebases.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
],
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@arcgis/api-extractor": "6.0.0-next.
|
|
15
|
-
"@arcgis/node-toolkit": "6.0.0-next.
|
|
16
|
-
"@arcgis/toolkit": "6.0.0-next.
|
|
14
|
+
"@arcgis/api-extractor": "6.0.0-next.15",
|
|
15
|
+
"@arcgis/node-toolkit": "6.0.0-next.15",
|
|
16
|
+
"@arcgis/toolkit": "6.0.0-next.15",
|
|
17
17
|
"@commander-js/extra-typings": "^15.0.0",
|
|
18
18
|
"commander": "^15.0.0",
|
|
19
19
|
"semver": "^7.7.3",
|