@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.
@@ -1,272 +1,197 @@
1
- import l from "typescript";
2
- import { findPath as P, asyncFindPath as y } from "@arcgis/node-toolkit/file";
1
+ import { asyncFindPath as h } from "@arcgis/node-toolkit/file";
2
+ import { asyncRetrievePackageJson as b } from "@arcgis/node-toolkit/packageJson";
3
3
  import { path as p } from "@arcgis/node-toolkit/path";
4
- import { retrievePackageJson as w, asyncRetrievePackageJson as E } from "@arcgis/node-toolkit/packageJson";
5
- import { s as $, e as j } from "./cli.js";
6
- import { log as v } from "@arcgis/toolkit/log";
7
- import { realpath as k, readFile as b, readdir as M } from "node:fs/promises";
8
- import { f as x } from "./log.js";
9
- import { m as N } from "./classification.js";
10
- function V(e) {
11
- return typeof e == "string" ? e : e.map((n) => n.kind === l.SyntaxKind.JSDocText ? n.text : T(n.getText())).join("");
12
- }
13
- function q(e) {
14
- return e === void 0 ? void 0 : O(l.displayPartsToString([...e]));
15
- }
16
- function O(e) {
17
- return e.replace(
18
- /\{@link(?:code|plain)?\s+([\s\S]*?)\}/gu,
19
- (n, s) => D(s)
20
- );
21
- }
22
- function T(e) {
23
- const n = /^\{@link(?:code|plain)?\s+([\s\S]*?)\}$/u.exec(e)?.[1];
24
- return n === void 0 ? e : D(n);
25
- }
26
- function D(e) {
27
- const n = e.trim().replace(/^(\S+)\s+([/:#!.])/u, "$1$2"), s = n.indexOf("|");
28
- if (s !== -1)
29
- return n.slice(s + 1).trim() || n.slice(0, s).trim();
30
- const [a, ...i] = n.split(/\s+/u);
31
- return i.join(" ") || a;
32
- }
33
- function G(e, n) {
34
- const s = P("package.json", e);
35
- return s === void 0 ? n : w(p.dirname(s)).name ?? n;
36
- }
37
- const S = {
38
- docsLegacyDependencyLocations: /* @__PURE__ */ new Map([
39
- ["@arcgis/coding-components", "packages/coding-packages/coding-components"],
40
- ["@arcgis/core", "packages/core-packages/core/output/npm/esm"],
41
- ["@arcgis/lumina", "packages/support-packages/lit"],
42
- ["@arcgis/map-components", "packages/map-packages/map-components"],
43
- ["@arcgis/toolkit", "packages/support-packages/toolkit"],
44
- ["@esri/calcite-components", "packages/map-packages/map-components/node_modules/@esri/calcite-components"],
45
- ["@esri/calcite-components-react", "packages/docs/app/node_modules/@esri/calcite-components-react"],
46
- ["monaco-editor", "packages/docs/app/node_modules/monaco-editor"]
47
- ]),
48
- excludedDefinitionPathFragments: ["test-package", "packages/docs/lumina-code-samples/", "packages/starter-packages/"]
49
- };
50
- function H(e) {
51
- const n = /* @__PURE__ */ new Map(), s = {};
52
- if (e?.contents.name !== "@webgis/docs")
53
- return { packages: n, paths: s };
54
- const a = p.dirname(e.filePath), i = p.resolve(a, "../../..");
55
- if (p.relative(i, a) !== "packages/docs/app" || !l.sys.fileExists(p.join(i, "pnpm-workspace.yaml")))
56
- return { packages: n, paths: s };
57
- const o = new Set(
58
- Object.entries({
59
- ...e.contents.dependencies,
60
- ...e.contents.devDependencies,
61
- ...e.contents.peerDependencies,
62
- ...e.contents.optionalDependencies
63
- }).filter(([, t]) => t === "catalog:legacyStarshipDeps").map(([t]) => t)
64
- );
65
- if (o.size === 0)
66
- throw Error(
67
- "Didn't find any catalog:legacyStarshipDeps in @webgis/docs. Update special handling in @arcgis/codemod"
68
- );
69
- for (const t of o) {
70
- const d = S.docsLegacyDependencyLocations.get(t);
71
- if (d === void 0)
72
- throw new Error(
73
- `Unmapped legacy dependency ${t} in @webgis/docs. Update special handling in @arcgis/codemod.`
74
- );
75
- const c = p.join(i, d), r = p.join(c, "package.json");
76
- if (!l.sys.fileExists(r))
77
- throw new Error(
78
- `Missing audit dependency ${t} at ${r}. Install dependencies and build workspace packages before auditing usages.`
79
- );
80
- const f = w(c);
81
- n.set(t, r);
82
- for (const [m, u] of Object.entries(
83
- f.exports ?? { ".": f.types ?? "./index.d.ts", "./*": "./*" }
84
- )) {
85
- const h = typeof u == "string" ? u : u.types;
86
- h !== void 0 && (s[m === "." ? t : `${t}/${m.slice(2)}`] = [p.resolve(c, h)]);
87
- }
88
- }
89
- return { packages: n, paths: s };
90
- }
91
- function Q(e) {
92
- return $(e) || S.excludedDefinitionPathFragments.some((n) => e.includes(n));
93
- }
94
- function C(e, n, s, a) {
95
- const i = [];
96
- for (const o of e.events ?? [])
97
- o.deprecated !== !0 && typeof o.deprecated != "string" || i.push({
98
- package: a,
99
- module: n,
100
- name: o.name,
4
+ import { log as w } from "@arcgis/toolkit/log";
5
+ import { realpath as g, readFile as y, readdir as k } from "node:fs/promises";
6
+ import { f as v } from "./log.js";
7
+ import { e as P } from "./cli.js";
8
+ import { s as E } from "./classification.js";
9
+ import N from "typescript";
10
+ function x(n, i, o, r) {
11
+ const s = [];
12
+ for (const t of n.events ?? [])
13
+ t.deprecated !== !0 && typeof t.deprecated != "string" || s.push({
14
+ package: r,
15
+ module: i,
16
+ name: t.name,
101
17
  kind: "field",
102
- memberOf: e.name,
103
- event: { tagName: e.tagName, name: o.name },
18
+ memberOf: n.name,
19
+ event: { tagName: n.tagName, name: t.name },
104
20
  provenance: "manifest",
105
- reason: typeof o.deprecated == "string" ? o.deprecated : void 0,
106
- sourceFileName: s,
21
+ reason: typeof t.deprecated == "string" ? t.deprecated : void 0,
22
+ sourceFileName: o,
107
23
  line: 1,
108
24
  column: 1
109
25
  });
110
- return i;
26
+ return s;
111
27
  }
112
- function X(e, n, s, a) {
113
- const i = e.tagName.getText(n), o = s.components.get(i);
114
- if (o?.length === 1)
115
- for (const t of e.attributes.properties) {
116
- if (!l.isJsxAttribute(t))
28
+ function B(n, i, o, r) {
29
+ const s = n.tagName.getText(i), t = o.components.get(s);
30
+ if (t?.length === 1)
31
+ for (const e of n.attributes.properties) {
32
+ if (!N.isJsxAttribute(e))
117
33
  continue;
118
- const d = t.name.getText(n), c = o[0].definitions.find(
119
- ({ event: r }) => r?.tagName === i && (d === `on${r.name}` || d === `on${r.name[0].toUpperCase()}${r.name.slice(1)}`)
34
+ const d = e.name.getText(i), a = t[0].definitions.find(
35
+ ({ event: c }) => c?.tagName === s && (d === `on${c.name}` || d === `on${c.name[0].toUpperCase()}${c.name.slice(1)}`)
120
36
  );
121
- c !== void 0 && a(c, t.name.getStart(n), t.name.getWidth(n));
37
+ a !== void 0 && r(a, e.name.getStart(i), e.name.getWidth(i));
122
38
  }
123
39
  }
124
- function L(e, n, s) {
125
- const a = JSON.parse(e), i = { modulePaths: /* @__PURE__ */ new Map(), definitions: [], components: /* @__PURE__ */ new Set() };
126
- for (const o of a.modules) {
127
- o.sourcePath !== void 0 && i.modulePaths.set(N(o.sourcePath), o.path);
128
- for (const t of o.declarations ?? []) {
129
- let d = function(r, f, m, u) {
130
- m !== !0 && typeof m != "string" || i.definitions.push({
131
- package: s,
132
- module: o.path,
133
- name: u ?? r,
40
+ function M(n, i, o) {
41
+ const r = JSON.parse(n), s = {
42
+ modulePaths: /* @__PURE__ */ new Map(),
43
+ definitions: [],
44
+ components: /* @__PURE__ */ new Set(),
45
+ componentTypes: []
46
+ };
47
+ for (const t of r.modules) {
48
+ t.sourcePath !== void 0 && s.modulePaths.set(E(t.sourcePath), t.path);
49
+ for (const e of t.declarations ?? []) {
50
+ let d = function(c, f, m, u) {
51
+ m !== !0 && typeof m != "string" || s.definitions.push({
52
+ package: o,
53
+ module: t.path,
54
+ name: u ?? c,
134
55
  kind: u === void 0 ? f : "field",
135
- memberOf: u === void 0 ? f === "element" ? void 0 : c : t.name,
136
- ...u === void 0 ? {} : { attribute: { tagName: c, name: r } },
56
+ memberOf: u === void 0 ? f === "element" ? void 0 : a : e.name,
57
+ ...u === void 0 ? {} : { attribute: { tagName: a, name: c } },
137
58
  provenance: "manifest",
138
59
  reason: typeof m == "string" ? m : void 0,
139
- sourceFileName: n,
60
+ sourceFileName: i,
140
61
  line: 1,
141
62
  column: 1
142
63
  });
143
64
  };
144
- if (!("tagName" in t) || t.tagName === void 0)
65
+ if (!("tagName" in e) || e.tagName === void 0)
145
66
  continue;
146
- const c = t.tagName;
147
- i.components.add(c), d(c, "element", t.deprecated);
148
- for (const [r, f] of [
67
+ const a = e.tagName;
68
+ s.components.add(a), "customElement" in e && e.privacy === void 0 && !e.abstract && s.componentTypes.push({
69
+ name: e.name,
70
+ tagName: a,
71
+ pascalCaseName: e.pascalCaseName,
72
+ typeParameters: e.typeParameters,
73
+ events: e.events,
74
+ packageName: o,
75
+ manifestFileName: i,
76
+ modulePath: t.path
77
+ }), d(a, "element", e.deprecated);
78
+ for (const [c, f] of [
149
79
  ["cssProperties", "css-property"],
150
80
  ["cssParts", "css-part"],
151
81
  ["cssStates", "css-state"],
152
82
  ["slots", "slot"]
153
83
  ])
154
- for (const m of t[r] ?? [])
155
- r === "slots" && m.name === "" || d(m.name, f, m.deprecated);
156
- for (const r of t.attributes ?? [])
157
- d(r.name, "attribute", r.deprecated, r.fieldName);
158
- i.definitions.push(...C(t, o.path, n, s));
84
+ for (const m of e[c] ?? [])
85
+ c === "slots" && m.name === "" || d(m.name, f, m.deprecated);
86
+ for (const c of e.attributes ?? [])
87
+ d(c.name, "attribute", c.deprecated, c.fieldName);
88
+ s.definitions.push(...x(e, t.path, i, o));
159
89
  }
160
90
  }
161
- return i;
162
- }
163
- function Y(e) {
164
- const n = e.flatMap((o) => o.definitions), s = /* @__PURE__ */ new Map();
165
- for (const o of e)
166
- for (const t of o.components) {
167
- const d = s.get(t) ?? [];
168
- d.push(o), s.set(t, d);
91
+ return s;
92
+ }
93
+ function F(n) {
94
+ const i = n.flatMap((t) => t.definitions), o = /* @__PURE__ */ new Map();
95
+ for (const t of n)
96
+ for (const e of t.components) {
97
+ const d = o.get(e) ?? [];
98
+ d.push(t), o.set(e, d);
169
99
  }
170
- const a = /* @__PURE__ */ new Map(), i = Map.groupBy(
171
- n.filter(({ kind: o }) => o === "css-property"),
172
- ({ name: o }) => o
100
+ const r = /* @__PURE__ */ new Map(), s = Map.groupBy(
101
+ i.filter(({ kind: t }) => t === "css-property"),
102
+ ({ name: t }) => t
173
103
  );
174
- for (const [o, t] of i)
175
- new Set(t.map((d) => d.package)).size === 1 && a.set(o, t[0]);
176
- return { hasDeprecatedApis: n.length > 0, components: s, cssVariables: a };
177
- }
178
- function Z(e = "warn", n) {
179
- const s = /* @__PURE__ */ new Map();
180
- return async (a) => {
181
- const i = await k(a);
182
- let o = s.get(i);
183
- return o === void 0 && (o = J(i, n).catch((t) => {
184
- if (n?.(), e === "throw")
104
+ for (const [t, e] of s)
105
+ new Set(e.map((d) => d.package)).size === 1 && r.set(t, e[0]);
106
+ return { hasDeprecatedApis: i.length > 0, components: o, cssVariables: r };
107
+ }
108
+ function W(n = "warn", i) {
109
+ const o = /* @__PURE__ */ new Map();
110
+ return async (r) => {
111
+ const s = await g(r);
112
+ let t = o.get(s);
113
+ return t === void 0 && (t = $(s, i).catch((e) => {
114
+ if (i?.(), n === "throw")
185
115
  throw new Error(
186
- `Unable to read component manifest for ${i}. Build the package before auditing definitions.`,
187
- { cause: t }
116
+ `Unable to read component manifest for ${s}. Build the package before auditing definitions.`,
117
+ { cause: e }
188
118
  );
189
- v("warn", x(i), `Unable to read component manifest: ${String(t)}`);
190
- }), s.set(i, o)), await o;
119
+ w("warn", v(s), `Unable to read component manifest: ${String(e)}`);
120
+ }), o.set(s, t)), await t;
191
121
  };
192
122
  }
193
- async function ee(e, n, s, a) {
194
- const i = /* @__PURE__ */ new Set([
195
- ...Object.keys(e.contents.dependencies ?? {}),
196
- ...Object.keys(e.contents.devDependencies ?? {}),
197
- ...Object.keys(e.contents.peerDependencies ?? {}),
198
- ...Object.keys(e.contents.optionalDependencies ?? {})
199
- ]), o = await Promise.all(
200
- [...i].filter((t) => t !== e.contents.name && (!s || j(t))).map(async (t) => {
201
- const d = a?.get(t) ?? await y(p.join("node_modules", t, "package.json"), p.dirname(e.filePath));
123
+ async function _(n, i, o, r) {
124
+ const s = /* @__PURE__ */ new Set([
125
+ ...Object.keys(n.contents.dependencies ?? {}),
126
+ ...Object.keys(n.contents.devDependencies ?? {}),
127
+ ...Object.keys(n.contents.peerDependencies ?? {}),
128
+ ...Object.keys(n.contents.optionalDependencies ?? {})
129
+ ]), t = await Promise.all(
130
+ [...s].filter((e) => e !== n.contents.name && (!o || P(e))).map(async (e) => {
131
+ const d = r?.get(e) ?? await h(p.join("node_modules", e, "package.json"), p.dirname(n.filePath));
202
132
  if (d === void 0)
203
133
  return [];
204
- const c = await n(d), r = t === "@esri/calcite-components" ? await y(
134
+ const a = await i(d), c = e === "@esri/calcite-components" ? await h(
205
135
  "node_modules/@esri/calcite-design-tokens/package.json",
206
- p.dirname(await k(d))
136
+ p.dirname(await g(d))
207
137
  ) : void 0;
208
- return [c, r === void 0 ? void 0 : await n(r)];
138
+ return [a, c === void 0 ? void 0 : await i(c)];
209
139
  })
210
140
  );
211
- return [...new Set(o.flat().filter((t) => t !== void 0))];
141
+ return [...new Set(t.flat().filter((e) => e !== void 0))];
212
142
  }
213
- async function J(e, n) {
214
- const s = p.dirname(e), a = await E(s);
215
- if (a.name === "@esri/calcite-design-tokens")
143
+ async function $(n, i) {
144
+ const o = p.dirname(n), r = await b(o);
145
+ if (r.name === "@esri/calcite-design-tokens")
216
146
  try {
217
- return await A(s, a.name);
218
- } catch (t) {
219
- n?.(), v("error", x(s), `Calcite design tokens integration is out of date: ${String(t)}`);
147
+ return await S(o, r.name);
148
+ } catch (e) {
149
+ i?.(), w("error", v(o), `Calcite design tokens integration is out of date: ${String(e)}`);
220
150
  return;
221
151
  }
222
- const i = typeof a.customElements == "string" ? a.customElements : a.customElements?.[0];
223
- if (i === void 0)
152
+ const s = typeof r.customElements == "string" ? r.customElements : r.customElements?.[0];
153
+ if (s === void 0)
224
154
  return;
225
- const o = await k(p.resolve(s, i));
226
- return L(await b(o, "utf8"), o, a.name);
227
- }
228
- async function A(e, n) {
229
- const s = p.join(e, "dist/docs"), a = /* @__PURE__ */ new Map(), i = (await M(s)).filter((o) => o.endsWith(".json")).sort();
230
- if (i.length === 0)
231
- throw new Error(`Missing token documentation JSON files in ${s}`);
232
- for (const o of i) {
233
- const t = await k(p.join(s, o)), d = JSON.parse(await b(t, "utf8"));
234
- if (!g(d) || !Array.isArray(d.tokens))
235
- throw new Error(`Expected a tokens array in ${t}`);
236
- for (const c of d.tokens) {
237
- if (!g(c) || !g(c.attributes) || c.attributes.docs !== void 0 && typeof c.attributes.docs != "string" || c.attributes.status !== void 0 && typeof c.attributes.status != "string" || !g(c.attributes.names) || typeof c.attributes.names.css != "string" || !/^var\(--[-\w]+\)$/u.test(c.attributes.names.css))
238
- throw new Error(`Expected token attributes.docs/status and attributes.names.css in ${t}`);
239
- if (c.attributes.docs !== "deprecated" && c.attributes.status !== "deprecated")
155
+ const t = await g(p.resolve(o, s));
156
+ return M(await y(t, "utf8"), t, r.name);
157
+ }
158
+ async function S(n, i) {
159
+ const o = p.join(n, "dist/docs"), r = /* @__PURE__ */ new Map(), s = (await k(o)).filter((t) => t.endsWith(".json")).sort();
160
+ if (s.length === 0)
161
+ throw new Error(`Missing token documentation JSON files in ${o}`);
162
+ for (const t of s) {
163
+ const e = await g(p.join(o, t)), d = JSON.parse(await y(e, "utf8"));
164
+ if (!l(d) || !Array.isArray(d.tokens))
165
+ throw new Error(`Expected a tokens array in ${e}`);
166
+ for (const a of d.tokens) {
167
+ if (!l(a) || !l(a.attributes) || a.attributes.docs !== void 0 && typeof a.attributes.docs != "string" || a.attributes.status !== void 0 && typeof a.attributes.status != "string" || !l(a.attributes.names) || typeof a.attributes.names.css != "string" || !/^var\(--[-\w]+\)$/u.test(a.attributes.names.css))
168
+ throw new Error(`Expected token attributes.docs/status and attributes.names.css in ${e}`);
169
+ if (a.attributes.docs !== "deprecated" && a.attributes.status !== "deprecated")
240
170
  continue;
241
- const r = c.$description ?? c.description;
242
- if (typeof r != "string")
243
- throw new Error(`Expected a deprecated token's $description or description in ${t}`);
244
- const f = c.attributes.names.css.slice(4, -1);
245
- a.has(f) || a.set(f, {
246
- package: n,
171
+ const c = a.$description ?? a.description;
172
+ if (typeof c != "string")
173
+ throw new Error(`Expected a deprecated token's $description or description in ${e}`);
174
+ const f = a.attributes.names.css.slice(4, -1);
175
+ r.has(f) || r.set(f, {
176
+ package: i,
247
177
  name: f,
248
178
  kind: "css-property",
249
179
  provenance: "manifest",
250
- reason: r,
251
- sourceFileName: t,
180
+ reason: c,
181
+ sourceFileName: e,
252
182
  line: 1,
253
183
  column: 1
254
184
  });
255
185
  }
256
186
  }
257
- return { modulePaths: /* @__PURE__ */ new Map(), definitions: [...a.values()], components: /* @__PURE__ */ new Set() };
187
+ return { modulePaths: /* @__PURE__ */ new Map(), definitions: [...r.values()], components: /* @__PURE__ */ new Set() };
258
188
  }
259
- function g(e) {
260
- return typeof e == "object" && e !== null && !Array.isArray(e);
189
+ function l(n) {
190
+ return typeof n == "object" && n !== null && !Array.isArray(n);
261
191
  }
262
192
  export {
263
- G as a,
264
- V as b,
265
- Y as c,
266
- q as d,
267
- Z as e,
268
- Q as f,
269
- H as g,
270
- ee as l,
271
- X as s
193
+ F as a,
194
+ W as c,
195
+ _ as l,
196
+ B as s
272
197
  };
@@ -1,17 +1,18 @@
1
1
  import { j as D, k as P, l as K, d as w } from "./cli.js";
2
- import { o as h, b as B, f, h as y } from "./classification.js";
2
+ import { d as h, g as B } from "./classification.js";
3
+ import { b as f, d as y } from "./apiName.js";
3
4
  import { markdownTextLimit as M, splitMarkdown as L } from "@arcgis/node-toolkit/markdown";
4
5
  const $ = {
5
6
  usages: "arcgisCodemodAuditUsages",
6
7
  definitions: "arcgisCodemodAuditDefinitions"
7
8
  };
8
- function X(n) {
9
+ function Y(n) {
9
10
  const e = j(n, n.findings);
10
11
  return `${e.summary.trim().replace(/^### /u, "## ")}
11
12
 
12
13
  ${e.details}`;
13
14
  }
14
- function Y(n, e = () => []) {
15
+ function Z(n, e = () => []) {
15
16
  const o = /* @__PURE__ */ new Map();
16
17
  for (const s of n.findings) {
17
18
  const r = d(s.codeowners), t = r.join(","), i = o.get(t) ?? [];
@@ -156,7 +157,7 @@ function x(n, e = "usages") {
156
157
  const o = d(n).join(",");
157
158
  return `<!-- ${$[e]}${o === "" ? "" : ` owners=${o}`} -->`;
158
159
  }
159
- function Z(n) {
160
+ function F(n) {
160
161
  const e = n?.split(`
161
162
  `, 1)[0];
162
163
  if (e === void 0)
@@ -206,7 +207,7 @@ function H(n, e, o, s) {
206
207
  export {
207
208
  $ as a,
208
209
  x as b,
209
- Y as c,
210
- X as f,
211
- Z as p
210
+ Z as c,
211
+ Y as f,
212
+ F as p
212
213
  };
@@ -0,0 +1,96 @@
1
+ import a from "typescript";
2
+ import { findPath as x } from "@arcgis/node-toolkit/file";
3
+ import { path as s } from "@arcgis/node-toolkit/path";
4
+ import { retrievePackageJson as k } from "@arcgis/node-toolkit/packageJson";
5
+ import { s as D } from "./cli.js";
6
+ function $(e) {
7
+ return typeof e == "string" ? e : e.map((n) => n.kind === a.SyntaxKind.JSDocText ? n.text : w(n.getText())).join("");
8
+ }
9
+ function E(e) {
10
+ return e === void 0 ? void 0 : S(a.displayPartsToString([...e]));
11
+ }
12
+ function S(e) {
13
+ return e.replace(
14
+ /\{@link(?:code|plain)?\s+([\s\S]*?)\}/gu,
15
+ (n, t) => y(t)
16
+ );
17
+ }
18
+ function w(e) {
19
+ const n = /^\{@link(?:code|plain)?\s+([\s\S]*?)\}$/u.exec(e)?.[1];
20
+ return n === void 0 ? e : y(n);
21
+ }
22
+ function y(e) {
23
+ const n = e.trim().replace(/^(\S+)\s+([/:#!.])/u, "$1$2"), t = n.indexOf("|");
24
+ if (t !== -1)
25
+ return n.slice(t + 1).trim() || n.slice(0, t).trim();
26
+ const [i, ...c] = n.split(/\s+/u);
27
+ return c.join(" ") || i;
28
+ }
29
+ function L(e, n) {
30
+ const t = x("package.json", e);
31
+ return t === void 0 ? n : k(s.dirname(t)).name ?? n;
32
+ }
33
+ const h = {
34
+ docsLegacyDependencyLocations: /* @__PURE__ */ new Map([
35
+ ["@arcgis/coding-components", "packages/coding-packages/coding-components"],
36
+ ["@arcgis/core", "packages/core-packages/core/output/npm/esm"],
37
+ ["@arcgis/lumina", "packages/support-packages/lit"],
38
+ ["@arcgis/map-components", "packages/map-packages/map-components"],
39
+ ["@arcgis/toolkit", "packages/support-packages/toolkit"],
40
+ ["@esri/calcite-components", "packages/map-packages/map-components/node_modules/@esri/calcite-components"],
41
+ ["@esri/calcite-components-react", "packages/docs/app/node_modules/@esri/calcite-components-react"],
42
+ ["monaco-editor", "packages/docs/app/node_modules/monaco-editor"]
43
+ ]),
44
+ excludedDefinitionPathFragments: ["test-package", "packages/docs/lumina-code-samples/", "packages/starter-packages/"]
45
+ };
46
+ function O(e) {
47
+ const n = /* @__PURE__ */ new Map(), t = {};
48
+ if (e?.contents.name !== "@webgis/docs")
49
+ return { packages: n, paths: t };
50
+ const i = s.dirname(e.filePath), c = s.resolve(i, "../../..");
51
+ if (s.relative(c, i) !== "packages/docs/app" || !a.sys.fileExists(s.join(c, "pnpm-workspace.yaml")))
52
+ return { packages: n, paths: t };
53
+ const g = new Set(
54
+ Object.entries({
55
+ ...e.contents.dependencies,
56
+ ...e.contents.devDependencies,
57
+ ...e.contents.peerDependencies,
58
+ ...e.contents.optionalDependencies
59
+ }).filter(([, o]) => o === "catalog:legacyStarshipDeps").map(([o]) => o)
60
+ );
61
+ if (g.size === 0)
62
+ throw Error(
63
+ "Didn't find any catalog:legacyStarshipDeps in @webgis/docs. Update special handling in @arcgis/codemod"
64
+ );
65
+ for (const o of g) {
66
+ const l = h.docsLegacyDependencyLocations.get(o);
67
+ if (l === void 0)
68
+ throw new Error(
69
+ `Unmapped legacy dependency ${o} in @webgis/docs. Update special handling in @arcgis/codemod.`
70
+ );
71
+ const r = s.join(c, l), p = s.join(r, "package.json");
72
+ if (!a.sys.fileExists(p))
73
+ throw new Error(
74
+ `Missing audit dependency ${o} at ${p}. Install dependencies and build workspace packages before auditing usages.`
75
+ );
76
+ const m = k(r);
77
+ n.set(o, p);
78
+ for (const [u, d] of Object.entries(
79
+ m.exports ?? { ".": m.types ?? "./index.d.ts", "./*": "./*" }
80
+ )) {
81
+ const f = typeof d == "string" ? d : d.types;
82
+ f !== void 0 && (t[u === "." ? o : `${o}/${u.slice(2)}`] = [s.resolve(r, f)]);
83
+ }
84
+ }
85
+ return { packages: n, paths: t };
86
+ }
87
+ function _(e) {
88
+ return D(e) || h.excludedDefinitionPathFragments.some((n) => e.includes(n));
89
+ }
90
+ export {
91
+ L as a,
92
+ $ as b,
93
+ E as c,
94
+ O as g,
95
+ _ as s
96
+ };
@@ -1,7 +1,7 @@
1
1
  import { readFile as j } from "node:fs/promises";
2
2
  import { log as l } from "@arcgis/toolkit/log";
3
3
  import { r as M } from "./log.js";
4
- import { n as x } from "./classification.js";
4
+ import { i as x } from "./apiName.js";
5
5
  import { h as d } from "./cli.js";
6
6
  import { c as O, a as N, p as C, b as v } from "./format.js";
7
7
  import { G as R, l as T, n as I, s as z, p as B, a as D, i as G } from "./legacyCompatibility.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/codemod",
3
- "version": "6.0.0-next.43",
3
+ "version": "6.0.0-next.45",
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.43",
15
- "@arcgis/node-toolkit": "6.0.0-next.43",
16
- "@arcgis/toolkit": "6.0.0-next.43",
14
+ "@arcgis/api-extractor": "6.0.0-next.45",
15
+ "@arcgis/node-toolkit": "6.0.0-next.45",
16
+ "@arcgis/toolkit": "6.0.0-next.45",
17
17
  "@commander-js/extra-typings": "^15.1.0",
18
18
  "commander": "^15.1.0",
19
19
  "picomatch": "^4.0.4",