@arcgis/codemod 6.0.0-next.15 → 6.0.0-next.16

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,23 +1,23 @@
1
- var Z = (s, e) => (e = Symbol[s]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + s), ee = (s) => {
1
+ var ee = (s, e) => (e = Symbol[s]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + s), te = (s) => {
2
2
  throw TypeError(s);
3
3
  };
4
- var te = (s, e, n) => {
4
+ var ne = (s, e, t) => {
5
5
  if (e != null) {
6
- typeof e != "object" && typeof e != "function" && ee("Object expected");
7
- var t, o;
8
- n && (t = e[Z("asyncDispose")]), t === void 0 && (t = e[Z("dispose")], n && (o = t)), typeof t != "function" && ee("Object not disposable"), o && (t = function() {
6
+ typeof e != "object" && typeof e != "function" && te("Object expected");
7
+ var n, o;
8
+ t && (n = e[ee("asyncDispose")]), n === void 0 && (n = e[ee("dispose")], t && (o = n)), typeof n != "function" && te("Object not disposable"), o && (n = function() {
9
9
  try {
10
10
  o.call(this);
11
11
  } catch (r) {
12
12
  return Promise.reject(r);
13
13
  }
14
- }), s.push([n, t, e]);
15
- } else n && s.push([n]);
14
+ }), s.push([t, n, e]);
15
+ } else t && s.push([t]);
16
16
  return e;
17
- }, ne = (s, e, n) => {
18
- var t = typeof SuppressedError == "function" ? SuppressedError : function(i, d, l, p) {
19
- return p = Error(l), p.name = "SuppressedError", p.error = i, p.suppressed = d, p;
20
- }, o = (i) => e = n ? new t(i, e, "An error was suppressed during disposal") : (n = !0, i), r = (i) => {
17
+ }, se = (s, e, t) => {
18
+ var n = typeof SuppressedError == "function" ? SuppressedError : function(i, d, l, c) {
19
+ return c = Error(l), c.name = "SuppressedError", c.error = i, c.suppressed = d, c;
20
+ }, o = (i) => e = t ? new n(i, e, "An error was suppressed during disposal") : (t = !0, i), r = (i) => {
21
21
  for (; i = s.pop(); )
22
22
  try {
23
23
  var d = i[1] && i[1].call(i[2]);
@@ -25,145 +25,146 @@ var te = (s, e, n) => {
25
25
  } catch (l) {
26
26
  o(l);
27
27
  }
28
- if (n) throw e;
28
+ if (t) throw e;
29
29
  };
30
30
  return r();
31
31
  };
32
- import { c as Se } from "./useProjectInstance.js";
33
- import { d as F, r as be, i as Ne, a as ke, b as Ae } from "./cli.js";
34
- import { f as M } from "./log.js";
35
- import { path as D, toPosixPathSeparators as Pe } from "@arcgis/node-toolkit/path";
36
- import { log as U } from "@arcgis/toolkit/log";
37
- import { forEachWithConcurrency as pe } from "@arcgis/toolkit/promise";
38
- import c from "typescript";
39
- import { s as De, g as I, a as $e, c as Ce, p as Oe } from "./artifact.js";
40
- import { loadCodeowners as de } from "@arcgis/node-toolkit/codeowners";
41
- import { c as se, s as J, g as Ee, a as ie, l as Te, b as me, d as ue, e as Le, f as Ie, h as Me } from "./componentAudit.js";
42
- import { g as Je, a as W, c as ge, b as Re, d as je, e as z, f as oe, h as Fe } from "./classification.js";
43
- import { styleText as V } from "node:util";
44
- import { f as fe } from "./format.js";
45
- import { realpath as R, readFile as B } from "node:fs/promises";
46
- import O from "semver";
47
- import { asyncFindPath as ze } from "@arcgis/node-toolkit/file";
48
- import { asyncRetrievePackageJson as Ue } from "@arcgis/node-toolkit/packageJson";
49
- function We(s, e, n) {
32
+ import { c as be } from "./useProjectInstance.js";
33
+ import { d as V, r as ke, i as Ae, a as Pe, b as De } from "./cli.js";
34
+ import { f as I } from "./log.js";
35
+ import { path as $, toPosixPathSeparators as $e } from "@arcgis/node-toolkit/path";
36
+ import { log as R } from "@arcgis/toolkit/log";
37
+ import { forEachWithConcurrency as me } from "@arcgis/toolkit/promise";
38
+ import a from "typescript";
39
+ import { s as Ce, g as J, a as Ee, c as Le, p as Te } from "./artifact.js";
40
+ import { loadCodeowners as ue } from "@arcgis/node-toolkit/codeowners";
41
+ import { c as ie, s as U, g as Oe, a as oe, l as Fe, b as ge, d as fe, e as Ie, f as Me, h as Je } from "./componentAudit.js";
42
+ import { g as je, a as K, c as he, b as Re, d as ze, e as B, f as ae, h as Ue } from "./classification.js";
43
+ import { styleText as q } from "node:util";
44
+ import { f as ve } from "./format.js";
45
+ import { realpath as j, readFile as z } from "node:fs/promises";
46
+ import L from "semver";
47
+ import { asyncFindPath as ye } from "@arcgis/node-toolkit/file";
48
+ import { asyncRetrievePackageJson as We } from "@arcgis/node-toolkit/packageJson";
49
+ import { LineCounter as Ve, parseDocument as Be, isMap as Ke, isScalar as re } from "yaml";
50
+ function qe(s, e, t) {
50
51
  if (e === "json") {
51
- if (n !== void 0) {
52
- process.stdout.write(`${JSON.stringify(n, void 0, 2)}
52
+ if (t !== void 0) {
53
+ process.stdout.write(`${JSON.stringify(t, void 0, 2)}
53
54
  `);
54
55
  return;
55
56
  }
56
- const t = I();
57
- process.stdout.write(`${qe(s, de(), t)}
57
+ const n = J();
58
+ process.stdout.write(`${Xe(s, ue(), n)}
58
59
  `);
59
60
  return;
60
61
  }
61
62
  if (e === "md") {
62
63
  process.stdout.write(
63
- `${n === void 0 ? Ge(s) : fe(n)}
64
+ `${t === void 0 ? Ye(s) : ve(t)}
64
65
  `
65
66
  );
66
67
  return;
67
68
  }
68
- process.stdout.write(`${Ve(s)}
69
+ process.stdout.write(`${He(s)}
69
70
  `);
70
71
  }
71
- function Ve(s) {
72
- const e = he(s), n = e.reduce((o, r) => o + r.count, 0), t = [ae("Deprecation summary", n)];
72
+ function He(s) {
73
+ const e = xe(s), t = e.reduce((o, r) => o + r.count, 0), n = [ce("Deprecation summary", t)];
73
74
  for (const { categoryName: o, count: r, packages: i } of e) {
74
- t.push(`${F[o].label} (${r})`);
75
+ n.push(`${V[o].label} (${r})`);
75
76
  for (const { displayName: d, count: l } of i)
76
- t.push(` ${re(d)} (${l})`);
77
+ n.push(` ${le(d)} (${l})`);
77
78
  }
78
- t.push("", "", ae("Deprecation details", n));
79
+ n.push("", "", ce("Deprecation details", t));
79
80
  for (const { categoryName: o, count: r, packages: i } of e) {
80
- const d = F[o];
81
- t.push("", `${d.label} (${r})`), "description" in d && t.push(` ${d.description}`);
82
- for (const { displayName: l, count: p, apis: f } of i) {
83
- t.push("", ` ${re(l)} (${p})`);
84
- for (const { name: a, reasons: m, items: h } of f) {
85
- const x = h[0].usage, g = Re({ name: a, memberOf: x.memberOf, kind: x.kind });
86
- t.push(` ${Be(g)}${je(x.kind)} (${h.length})`);
87
- for (const w of m)
88
- t.push(Ke(w, 6));
89
- for (const { sourceFileName: w, usage: N } of Qe(h))
90
- t.push(` ${M(w)}:${N.line}:${N.column}`);
81
+ const d = V[o];
82
+ n.push("", `${d.label} (${r})`), "description" in d && n.push(` ${d.description}`);
83
+ for (const { displayName: l, count: c, apis: f } of i) {
84
+ n.push("", ` ${le(l)} (${c})`);
85
+ for (const { name: g, reasons: p, items: m } of f) {
86
+ const y = m[0].usage, h = Re({ name: g, memberOf: y.memberOf, kind: y.kind });
87
+ n.push(` ${Qe(h)}${ze(y.kind)} (${m.length})`);
88
+ for (const v of p)
89
+ n.push(Ge(v, 6));
90
+ for (const { sourceFileName: v, usage: w } of _e(m))
91
+ n.push(` ${I(v)}:${w.line}:${w.column}`);
91
92
  }
92
93
  }
93
94
  }
94
- return t.join(`
95
+ return n.join(`
95
96
  `);
96
97
  }
97
- function he(s) {
98
+ function xe(s) {
98
99
  const e = [...s].flatMap(
99
- ([n, t]) => t.map((o) => ({ ...o, packageName: n }))
100
+ ([t, n]) => n.map((o) => ({ ...o, packageName: t }))
100
101
  );
101
- return Je(e, ({ packageName: n, usage: t }) => ({
102
- package: n,
103
- name: t.name,
104
- kind: t.kind,
105
- category: t.category,
106
- memberOf: t.memberOf,
107
- module: t.module ?? W(t.originFileNames, n),
108
- deprecated: t.reason ?? !0
102
+ return je(e, ({ packageName: t, usage: n }) => ({
103
+ package: t,
104
+ name: n.name,
105
+ kind: n.kind,
106
+ category: n.category,
107
+ memberOf: n.memberOf,
108
+ module: n.module ?? K(n.originFileNames, t),
109
+ deprecated: n.reason ?? !0
109
110
  }));
110
111
  }
111
- function ae(s, e) {
112
- return V(["bold", "yellow"], `${s} (${e})`);
112
+ function ce(s, e) {
113
+ return q(["bold", "yellow"], `${s} (${e})`);
113
114
  }
114
- function re(s) {
115
- return V("blue", s);
115
+ function le(s) {
116
+ return q("blue", s);
116
117
  }
117
- function Be(s) {
118
- return V(["bold", "white"], s);
118
+ function Qe(s) {
119
+ return q(["bold", "white"], s);
119
120
  }
120
- function Ke(s, e) {
121
- const n = " ".repeat(e);
122
- return s.split(/\r?\n/u).map((t) => `${n}${t}`).join(`
121
+ function Ge(s, e) {
122
+ const t = " ".repeat(e);
123
+ return s.split(/\r?\n/u).map((n) => `${t}${n}`).join(`
123
124
  `);
124
125
  }
125
- function Qe(s) {
126
+ function _e(s) {
126
127
  return s.toSorted(
127
- (e, n) => e.sourceFileName.localeCompare(n.sourceFileName) || e.usage.line - n.usage.line || e.usage.column - n.usage.column
128
+ (e, t) => e.sourceFileName.localeCompare(t.sourceFileName) || e.usage.line - t.usage.line || e.usage.column - t.usage.column
128
129
  );
129
130
  }
130
- function qe(s, e, n = I()) {
131
- return JSON.stringify(K(s, e, n), void 0, 2);
131
+ function Xe(s, e, t = J()) {
132
+ return JSON.stringify(H(s, e, t), void 0, 2);
132
133
  }
133
- function Ge(s, e = I()) {
134
- return fe(K(s, void 0, e));
134
+ function Ye(s, e = J()) {
135
+ return ve(H(s, void 0, e));
135
136
  }
136
- function K(s, e, n, t) {
137
- const o = he(s);
137
+ function H(s, e, t, n) {
138
+ const o = xe(s);
138
139
  return {
139
140
  auditKind: "usages",
140
- repository: n.repository,
141
- ref: n.ref,
142
- branch: n.branch,
143
- scannerVersion: De,
141
+ repository: t.repository,
142
+ ref: t.ref,
143
+ branch: t.branch,
144
+ scannerVersion: Ce,
144
145
  scanDate: Date.now(),
145
- ...t === void 0 ? {} : { complete: t },
146
+ ...n === void 0 ? {} : { complete: n },
146
147
  summary: {
147
148
  total: o.reduce((i, { count: d }) => i + d, 0),
148
149
  categories: o.map(({ categoryName: i, count: d, packages: l }) => ({
149
150
  category: i,
150
- label: F[i].label,
151
+ label: V[i].label,
151
152
  count: d,
152
- packages: l.map(({ packageName: p, displayName: f, count: a }) => ({
153
- package: p,
154
- ...f === p ? {} : { displayName: f },
155
- count: a
153
+ packages: l.map(({ packageName: c, displayName: f, count: g }) => ({
154
+ package: c,
155
+ ...f === c ? {} : { displayName: f },
156
+ count: g
156
157
  }))
157
158
  }))
158
159
  },
159
- findings: _e(s, e, n)
160
+ findings: Ze(s, e, t)
160
161
  };
161
162
  }
162
- function _e(s, e, n) {
163
+ function Ze(s, e, t) {
163
164
  return [...s].flatMap(
164
- ([t, o]) => o.map((r) => {
165
- const i = r.usage.module ?? W(r.usage.originFileNames, t), d = {
166
- package: t,
165
+ ([n, o]) => o.map((r) => {
166
+ const i = r.usage.module ?? K(r.usage.originFileNames, n), d = {
167
+ package: n,
167
168
  name: r.usage.name,
168
169
  category: r.usage.category,
169
170
  memberOf: r.usage.memberOf,
@@ -172,287 +173,428 @@ function _e(s, e, n) {
172
173
  };
173
174
  return {
174
175
  ...d,
175
- category: ge(d),
176
+ category: he(d),
176
177
  kind: r.usage.kind,
177
178
  memberOf: r.usage.memberOf,
178
- file: $e(r.sourceFileName, n.repositoryRoot),
179
+ file: Ee(r.sourceFileName, t.repositoryRoot),
179
180
  line: r.usage.line,
180
181
  column: r.usage.column,
181
182
  codeowners: e?.getOwners(r.sourceFileName) ?? []
182
183
  };
183
184
  })
184
- ).sort(Ce);
185
+ ).sort(Le);
185
186
  }
186
- function ce(s, e, n) {
187
- if (!e.hasDeprecatedApis)
187
+ function pe(s, e, t) {
188
+ const n = $.extname(s.fileName).slice(1).toLowerCase();
189
+ if (!e.hasDeprecatedApis && t === void 0 && n !== "html")
188
190
  return [];
189
- const t = "getLineAndCharacterOfPosition" in s ? (a) => s.getLineAndCharacterOfPosition(a) : He(s.text), o = /* @__PURE__ */ new Map();
190
- for (const [a, m] of e.cssVariables)
191
- for (let h = s.text.indexOf(a); h !== -1; h = s.text.indexOf(a, h + a.length))
192
- i(m, h, a.length);
193
- const r = D.extname(s.fileName).slice(1).toLowerCase();
194
- return r === "html" ? Ze(
195
- s.text,
196
- (a, m, h) => {
197
- l(
198
- a,
199
- m,
200
- h.map(({ name: x, start: g }) => ({ name: x, start: g }))
201
- );
202
- },
203
- (a, m) => le(a, m, p)
204
- ) : r === "css" || r === "scss" || r === "sass" ? le(s.text, 0, p, r !== "css") : "kind" in s && f(s, s), [...o.values()].sort((a, m) => a.usage.start - m.usage.start);
205
- function i(a, m, h) {
206
- const { line: x, character: g } = t(m);
207
- o.set(JSON.stringify([a.package, a.kind, a.memberOf, a.name, m]), {
208
- packageName: a.package,
191
+ const o = "getLineAndCharacterOfPosition" in s ? (p) => s.getLineAndCharacterOfPosition(p) : nt(s.text), r = /* @__PURE__ */ new Map(), i = /\bdefine\s*(?:\.\s*amd\b|\[\s*(?:"amd"|'amd')\s*\])/u.test(s.text);
192
+ for (const p of s.text.matchAll(/(?<![-\w\u0080-\uFFFF])--[-\w\u0080-\uFFFF]+/gu)) {
193
+ const m = e.cssVariables.get(p[0]);
194
+ m !== void 0 && d(m, p.index, p[0].length);
195
+ }
196
+ if (n === "html") {
197
+ const p = /* @__PURE__ */ new Map();
198
+ if (ot({
199
+ contents: s.text,
200
+ scanElement: (m, y, h) => {
201
+ c(
202
+ m,
203
+ y,
204
+ h.map(({ name: v, start: w }) => ({ name: v, start: w }))
205
+ );
206
+ },
207
+ scanStyle: (m, y) => de(m, y, f),
208
+ scanScript: (m, y, h) => {
209
+ const v = h.find(({ name: N }) => N === "type")?.value?.trim().toLowerCase() ?? "";
210
+ if (h.some(({ name: N }) => N === "src") || ![
211
+ "",
212
+ "module",
213
+ "text/javascript",
214
+ "application/javascript",
215
+ "text/ecmascript",
216
+ "application/ecmascript"
217
+ ].includes(v.split(";")[0]))
218
+ return;
219
+ const w = `${s.fileName}.script-${p.size}.js`;
220
+ p.set(w, {
221
+ source: a.createSourceFile(
222
+ w,
223
+ v === "module" ? `${m}
224
+ export {};` : m,
225
+ a.ScriptTarget.Latest,
226
+ !0,
227
+ a.ScriptKind.JS
228
+ ),
229
+ offset: y
230
+ });
231
+ }
232
+ }), p.size > 0) {
233
+ const m = {
234
+ allowJs: !0,
235
+ noLib: !0,
236
+ noResolve: !0,
237
+ types: [],
238
+ target: a.ScriptTarget.Latest
239
+ }, h = a.createProgram([...p.keys()], m, {
240
+ ...a.createCompilerHost(m),
241
+ getSourceFile: (v) => p.get(v)?.source
242
+ }).getTypeChecker();
243
+ for (const { source: v, offset: w } of p.values())
244
+ g({ node: v, jsxSourceFile: v, typeChecker: h, offset: w });
245
+ }
246
+ } else n === "css" || n === "scss" || n === "sass" ? de(s.text, 0, f, n !== "css") : "kind" in s && g({ node: s, jsxSourceFile: s, typeChecker: t });
247
+ return [...r.values()].sort((p, m) => p.usage.start - m.usage.start);
248
+ function d(p, m, y) {
249
+ const { line: h, character: v } = o(m);
250
+ r.set(JSON.stringify([p.package, p.kind, p.memberOf, p.name, m]), {
251
+ packageName: p.package,
209
252
  sourceFileName: s.fileName,
210
253
  usage: {
211
- name: a.name,
212
- kind: a.kind,
213
- memberOf: a.kind === "css-property" ? void 0 : a.memberOf,
214
- module: a.module,
215
- reason: a.reason,
216
- originFileNames: [a.sourceFileName],
254
+ name: p.name,
255
+ kind: p.kind,
256
+ memberOf: p.kind === "css-property" ? void 0 : p.memberOf,
257
+ module: p.module,
258
+ reason: p.reason,
259
+ originFileNames: [p.sourceFileName],
217
260
  start: m,
218
- length: h,
219
- line: x + 1,
220
- column: g + 1
261
+ length: y,
262
+ line: h + 1,
263
+ column: v + 1
221
264
  }
222
265
  });
223
266
  }
224
- function d(a, m, h) {
225
- const x = e.components.get(a);
226
- return x?.length === 1 ? x[0].definitions.find(
227
- (g) => g.kind === m && g.name === h && (m === "element" || g.memberOf === a)
228
- ) : void 0;
267
+ function l(p, m, y) {
268
+ const h = e.components.get(p);
269
+ if (h?.length === 1)
270
+ return h[0].definitions.find((v) => et({ entry: v, tag: p, kind: m, name: y }));
229
271
  }
230
- function l(a, m, h) {
231
- const x = d(a, "element", a);
232
- x !== void 0 && i(x, m, a.length);
233
- for (const g of h) {
234
- const w = d(a, "attribute", g.name);
235
- w !== void 0 && i(w, g.start, g.name.length);
272
+ function c(p, m, y) {
273
+ const h = l(p, "element", p);
274
+ h !== void 0 && d(h, m, p.length);
275
+ for (const v of y) {
276
+ const w = l(p, "attribute", v.name);
277
+ w !== void 0 && d(w, v.start, v.name.length);
236
278
  }
237
279
  }
238
- function p(a, m, h, x) {
239
- const g = d(a, m, h);
240
- g !== void 0 && i(g, x, h.length);
280
+ function f(p, m, y, h) {
281
+ const v = l(p, m, y);
282
+ v !== void 0 && d(v, h, y.length);
241
283
  }
242
- function f(a, m) {
243
- if (c.isJsxOpeningElement(a) || c.isJsxSelfClosingElement(a)) {
244
- const h = a.tagName.getText(m), x = a.attributes.properties.filter(c.isJsxAttribute);
245
- if (l(
246
- h,
247
- a.tagName.getStart(m),
248
- x.map((g) => ({
249
- name: g.name.getText(m),
250
- start: g.name.getStart(m)
284
+ function g({
285
+ node: p,
286
+ jsxSourceFile: m,
287
+ typeChecker: y,
288
+ offset: h = 0
289
+ }) {
290
+ const v = tt({ node: p, checker: y });
291
+ if (v !== void 0 && (v.text !== "define" || !i)) {
292
+ const w = h + v.getStart(m), { line: N, character: b } = o(w);
293
+ r.set(`amd:${w}`, {
294
+ packageName: "@arcgis/core",
295
+ sourceFileName: s.fileName,
296
+ usage: {
297
+ name: v.text,
298
+ kind: "function",
299
+ module: "amd",
300
+ reason: "require/define is deprecated. Use $arcgis.import() or ESM instead. See https://developers.arcgis.com/javascript/latest/get-started/",
301
+ originFileNames: [],
302
+ start: w,
303
+ length: v.getWidth(m),
304
+ line: N + 1,
305
+ column: b + 1
306
+ }
307
+ });
308
+ }
309
+ if (a.isJsxOpeningElement(p) || a.isJsxSelfClosingElement(p)) {
310
+ const w = p.tagName.getText(m), N = p.attributes.properties.filter(a.isJsxAttribute);
311
+ if (c(
312
+ w,
313
+ p.tagName.getStart(m),
314
+ N.map((b) => ({
315
+ name: b.name.getText(m),
316
+ start: b.name.getStart(m)
251
317
  }))
252
- ), /^[a-z][\w-]*$/u.test(h)) {
253
- const g = x.find((S) => S.name.getText(m) === "slot"), w = g?.initializer, N = w !== void 0 && c.isJsxExpression(w) ? w.expression : w, b = g === void 0 ? -1 : a.attributes.properties.indexOf(g), A = a.attributes.properties.slice(b + 1).some(c.isJsxSpreadAttribute);
254
- if (N !== void 0 && (c.isStringLiteral(N) || c.isNoSubstitutionTemplateLiteral(N)) && !A) {
255
- const S = Xe(c.isJsxOpeningElement(a) ? a.parent : a, n), u = S === void 0 ? void 0 : d(S, "slot", N.text);
256
- u !== void 0 && i(u, N.getStart(m) + 1, N.getWidth(m) - 2);
318
+ ), /^[a-z][\w-]*$/u.test(w)) {
319
+ const b = N.find((A) => A.name.getText(m) === "slot"), k = b?.initializer, u = k !== void 0 && a.isJsxExpression(k) ? k.expression : k, x = b === void 0 ? -1 : p.attributes.properties.indexOf(b), S = p.attributes.properties.slice(x + 1).some(a.isJsxSpreadAttribute);
320
+ if (u !== void 0 && (a.isStringLiteral(u) || a.isNoSubstitutionTemplateLiteral(u)) && !S) {
321
+ const A = st(a.isJsxOpeningElement(p) ? p.parent : p, y), C = A === void 0 ? void 0 : l(A, "slot", u.text);
322
+ C !== void 0 && d(C, u.getStart(m) + 1, u.getWidth(m) - 2);
257
323
  }
258
324
  }
259
325
  }
260
- c.forEachChild(a, (h) => f(h, m));
326
+ a.forEachChild(p, (w) => g({ node: w, jsxSourceFile: m, typeChecker: y, offset: h }));
261
327
  }
262
328
  }
263
- function He(s) {
329
+ function et({
330
+ entry: s,
331
+ tag: e,
332
+ kind: t,
333
+ name: n
334
+ }) {
335
+ const o = s.attribute;
336
+ if (t === "attribute" && o !== void 0) {
337
+ const r = o.tagName === e, i = o.name === n;
338
+ return r && i;
339
+ }
340
+ return s.kind !== t || s.name !== n ? !1 : t === "element" ? !0 : s.memberOf === e;
341
+ }
342
+ function tt({
343
+ node: s,
344
+ checker: e
345
+ }) {
346
+ if (e === void 0 || !a.isCallExpression(s))
347
+ return;
348
+ const t = s.expression;
349
+ let n, o;
350
+ if (a.isIdentifier(t))
351
+ n = t, o = t;
352
+ else if (a.isPropertyAccessExpression(t) && a.isIdentifier(t.name) && a.isIdentifier(t.expression) && ["window", "opener", "globalThis"].includes(t.expression.text))
353
+ n = t.name, o = t.expression;
354
+ else
355
+ return;
356
+ if (n.text !== "define" && n.text !== "require")
357
+ return;
358
+ if (n.text === "require") {
359
+ const i = s.arguments[0];
360
+ if (!(i !== void 0 && a.isArrayLiteralExpression(i)) && s.getSourceFile().fileName.toLowerCase().endsWith(".cjs") || i !== void 0 && a.isStringLiteralLike(i) && !i.text.startsWith("esri/"))
361
+ return;
362
+ }
363
+ return (e.getSymbolAtLocation(o)?.declarations ?? []).every(
364
+ (i) => a.isPropertyAccessExpression(t) && i.getSourceFile().isDeclarationFile
365
+ ) ? n : void 0;
366
+ }
367
+ function nt(s) {
264
368
  const e = [
265
369
  0,
266
- ...Array.from(s.matchAll(/\r\n|[\r\n\u2028\u2029]/gu), (n) => n.index + n[0].length)
370
+ ...Array.from(s.matchAll(/\r\n|[\r\n\u2028\u2029]/gu), (t) => t.index + t[0].length)
267
371
  ];
268
- return (n) => {
269
- let t = 0, o = e.length;
270
- for (; t + 1 < o; ) {
271
- const r = Math.floor((t + o) / 2);
272
- e[r] <= n ? t = r : o = r;
372
+ return (t) => {
373
+ let n = 0, o = e.length;
374
+ for (; n + 1 < o; ) {
375
+ const r = Math.floor((n + o) / 2);
376
+ e[r] <= t ? n = r : o = r;
273
377
  }
274
- return { line: t, character: n - e[t] };
378
+ return { line: n, character: t - e[n] };
275
379
  };
276
380
  }
277
- function Xe(s, e) {
278
- let n = s;
279
- for (let t = n.parent; t !== void 0; n = t, t = t.parent) {
280
- if (c.isJsxElement(t))
281
- return t.openingElement.tagName.getText();
282
- if (!(c.isJsxFragment(t) || c.isJsxExpression(t) || c.isParenthesizedExpression(t)) && !(c.isConditionalExpression(t) && n !== t.condition) && !(c.isBinaryExpression(t) && (t.operatorToken.kind === c.SyntaxKind.AmpersandAmpersandToken && n === t.right || t.operatorToken.kind === c.SyntaxKind.BarBarToken || t.operatorToken.kind === c.SyntaxKind.QuestionQuestionToken))) {
283
- if (c.isReturnStatement(t)) {
284
- const o = c.findAncestor(t, c.isFunctionLike);
285
- if (o === void 0 || !c.isArrowFunction(o) && !c.isFunctionExpression(o))
381
+ function st(s, e) {
382
+ let t = s;
383
+ for (let n = t.parent; n !== void 0; t = n, n = n.parent) {
384
+ if (a.isJsxElement(n))
385
+ return n.openingElement.tagName.getText();
386
+ if (!(a.isJsxFragment(n) || a.isJsxExpression(n) || a.isParenthesizedExpression(n)) && !(a.isConditionalExpression(n) && t !== n.condition) && !(a.isBinaryExpression(n) && (n.operatorToken.kind === a.SyntaxKind.AmpersandAmpersandToken && t === n.right || n.operatorToken.kind === a.SyntaxKind.BarBarToken || n.operatorToken.kind === a.SyntaxKind.QuestionQuestionToken))) {
387
+ if (a.isReturnStatement(n)) {
388
+ const o = a.findAncestor(n, a.isFunctionLike);
389
+ if (o === void 0 || !a.isArrowFunction(o) && !a.isFunctionExpression(o))
286
390
  return;
287
- n = o.body, t = o;
391
+ t = o.body, n = o;
288
392
  }
289
- if ((c.isArrowFunction(t) || c.isFunctionExpression(t)) && n === t.body) {
290
- const o = t.parent;
291
- if (!c.isCallExpression(o) || o.arguments[0] !== t || !c.isPropertyAccessExpression(o.expression) || o.expression.name.text !== "map")
393
+ if ((a.isArrowFunction(n) || a.isFunctionExpression(n)) && t === n.body) {
394
+ const o = n.parent;
395
+ if (!a.isCallExpression(o) || o.arguments[0] !== n || !a.isPropertyAccessExpression(o.expression) || o.expression.name.text !== "map")
292
396
  return;
293
397
  const r = o.expression.expression, i = e?.getTypeAtLocation(r);
294
- if (!c.isArrayLiteralExpression(r) && (i === void 0 || !e.isArrayType(i) && !e.isTupleType(i)))
398
+ if (!a.isArrayLiteralExpression(r) && (i === void 0 || !e.isArrayType(i) && !e.isTupleType(i)))
295
399
  return;
296
- n = t, t = o;
400
+ t = n, n = o;
297
401
  continue;
298
402
  }
299
403
  return;
300
404
  }
301
405
  }
302
406
  }
303
- function le(s, e, n, t = !1) {
304
- const o = t ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, r = s.replace(o, (p) => p.replace(/[^\r\n]/gu, " ")), i = [];
407
+ function de(s, e, t, n = !1) {
408
+ const o = n ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, r = s.replace(o, (c) => c.replace(/[^\r\n]/gu, " ")), i = [];
305
409
  let d = 0, l = 0;
306
- for (const p of r.matchAll(/[{};]/gu)) {
307
- const f = p.index;
410
+ for (const c of r.matchAll(/[{};]/gu)) {
411
+ const f = c.index;
308
412
  if (l > 0) {
309
- l += p[0] === "{" ? 1 : p[0] === "}" ? -1 : 0, d = f + 1;
413
+ l += c[0] === "{" ? 1 : c[0] === "}" ? -1 : 0, d = f + 1;
310
414
  continue;
311
415
  }
312
- if (p[0] === "}")
416
+ if (c[0] === "}")
313
417
  i.pop();
314
- else if (p[0] === "{") {
315
- const a = r.slice(d, f), m = i.at(-1) ?? [];
316
- if (/^\s*--[\w-]+\s*:/u.test(a))
418
+ else if (c[0] === "{") {
419
+ const g = r.slice(d, f), p = i.at(-1) ?? [];
420
+ if (/^\s*--[\w-]+\s*:/u.test(g))
317
421
  l = 1;
318
- else if (a.trimStart().startsWith("@"))
319
- i.push(m);
422
+ else if (g.trimStart().startsWith("@"))
423
+ i.push(p);
320
424
  else {
321
- const x = a.split(",").map((g) => g.trim()).flatMap(
322
- (g) => m.length === 0 ? [g] : m.map(
323
- (w) => g.includes("&") ? g.replaceAll("&", w) : `${w} ${g}`
425
+ const y = g.split(",").map((h) => h.trim()).flatMap(
426
+ (h) => p.length === 0 ? [h] : p.map(
427
+ (v) => h.includes("&") ? h.replaceAll("&", v) : `${v} ${h}`
324
428
  )
325
429
  );
326
- for (const g of a.matchAll(/::part\(\s*([\w\s-]+?)\s*\)|:state\(\s*([\w-]+)\s*\)/gu)) {
327
- const w = a.lastIndexOf(",", g.index) + 1, N = a.slice(w, g.index), A = (m.length === 0 ? [N] : m.map(
328
- (y) => N.includes("&") ? N.replaceAll("&", y) : `${y} ${N}`
329
- )).map(Ye);
330
- if (A.includes(void 0) || new Set(A).size !== 1)
430
+ for (const h of g.matchAll(/::part\(\s*([\w\s-]+?)\s*\)|:state\(\s*([\w-]+)\s*\)/gu)) {
431
+ const v = g.lastIndexOf(",", h.index) + 1, w = g.slice(v, h.index), b = (p.length === 0 ? [w] : p.map(
432
+ (S) => w.includes("&") ? w.replaceAll("&", S) : `${S} ${w}`
433
+ )).map(it);
434
+ if (b.includes(void 0) || new Set(b).size !== 1)
331
435
  continue;
332
- const S = g[1] === void 0 ? "css-state" : "css-part", u = g[1] ?? g[2], v = g.index + g[0].indexOf(u);
333
- for (const y of u.matchAll(/[\w-]+/gu))
334
- n(A[0], S, y[0], e + d + v + y.index);
436
+ const k = h[1] === void 0 ? "css-state" : "css-part", u = h[1] ?? h[2], x = h.index + h[0].indexOf(u);
437
+ for (const S of u.matchAll(/[\w-]+/gu))
438
+ t(b[0], k, S[0], e + d + x + S.index);
335
439
  }
336
- i.push(x);
440
+ i.push(y);
337
441
  }
338
442
  }
339
443
  d = f + 1;
340
444
  }
341
445
  }
342
- function Ye(s) {
446
+ function it(s) {
343
447
  const e = s.replace(/:state\([\w-]+\)/gu, "").trimStart();
344
448
  return /(?:^|[\s>+~])([a-z][\w-]*)(?:[.#:][\w-]+|\[[^\]]*\])*$/iu.exec(e)?.[1]?.toLowerCase();
345
449
  }
346
- function Ze(s, e, n) {
347
- const t = /<!--[\s\S]*?(?:-->|$)|<![^>]*>|<\/?([a-z][\w:-]*)\b((?:"[^"]*"|'[^']*'|[^'">])*)>/giu;
348
- for (let o = t.exec(s); o !== null; o = t.exec(s)) {
349
- if (o[1] === void 0 || o[0].startsWith("</"))
450
+ function ot({
451
+ contents: s,
452
+ scanElement: e,
453
+ scanStyle: t,
454
+ scanScript: n
455
+ }) {
456
+ const o = /<!--[\s\S]*?(?:-->|$)|<![^>]*>|<\/?([a-z][\w:-]*)\b((?:"[^"]*"|'[^']*'|[^'">])*)>/giu;
457
+ for (let r = o.exec(s); r !== null; r = o.exec(s)) {
458
+ if (r[1] === void 0 || r[0].startsWith("</"))
350
459
  continue;
351
- const r = o[1].toLowerCase(), i = o.index + 1 + o[1].length, d = [...o[2].matchAll(/([^\s"'<>/=]+)(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?/gu)].map(
352
- (l) => ({ name: l[1].toLowerCase(), start: i + l.index })
460
+ const i = r[1].toLowerCase(), d = r.index + 1 + r[1].length, l = [...r[2].matchAll(/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gu)].map(
461
+ (c) => ({
462
+ name: c[1].toLowerCase(),
463
+ start: d + c.index,
464
+ value: c[2] ?? c[3] ?? c[4]
465
+ })
353
466
  );
354
- if (e(r, o.index + 1, d), r === "plaintext")
467
+ if (e(i, r.index + 1, l), i === "plaintext")
355
468
  break;
356
- if (["script", "style", "textarea", "title", "xmp", "iframe", "noembed", "noframes"].includes(r)) {
357
- const l = new RegExp(`</${r}\\s*>`, "giu");
358
- l.lastIndex = t.lastIndex;
359
- const p = l.exec(s);
360
- r === "style" && n(s.slice(t.lastIndex, p?.index ?? s.length), t.lastIndex), t.lastIndex = p === null ? s.length : l.lastIndex;
469
+ if (["script", "style", "textarea", "title", "xmp", "iframe", "noembed", "noframes"].includes(i)) {
470
+ const c = new RegExp(`</${i}\\s*>`, "giu");
471
+ c.lastIndex = o.lastIndex;
472
+ const f = c.exec(s);
473
+ i === "style" ? t(s.slice(o.lastIndex, f?.index ?? s.length), o.lastIndex) : i === "script" && n?.(s.slice(o.lastIndex, f?.index ?? s.length), o.lastIndex, l), o.lastIndex = f === null ? s.length : c.lastIndex;
361
474
  }
362
475
  }
363
476
  }
364
- const et = /[:/@\\]|^\.{1,2}$|\.(?:tgz|tar(?:\.gz)?)$/iu;
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/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(
477
+ const at = /[:/@\\]|^\.{1,2}$|\.(?:tgz|tar(?:\.gz)?)$/iu;
478
+ async function rt(s, e, t) {
479
+ const n = 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(n), r = /* @__PURE__ */ new Set([...n, "@esri/calcite-components"]), i = [...new Map(s.map((g) => [g.filePath, g])).values()], d = new Set(
367
480
  (await Promise.all(
368
- i.map(async ({ filePath: a, contents: m }) => {
369
- const h = [await R(a)], x = m.publishConfig?.directory;
370
- if (typeof x == "string") {
371
- const g = D.resolve(D.dirname(a), x, "package.json");
372
- c.sys.fileExists(g) && h.push(await R(g));
481
+ i.map(async ({ filePath: g, contents: p }) => {
482
+ const m = [await j(g)], y = p.publishConfig?.directory;
483
+ if (typeof y == "string") {
484
+ const h = $.resolve($.dirname(g), y, "package.json");
485
+ a.sys.fileExists(h) && m.push(await j(h));
373
486
  }
374
- return h;
487
+ return m;
375
488
  })
376
489
  )).flat()
377
- ), l = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), f = [];
378
- await pe(i, 4, async (a) => {
379
- let m;
380
- const h = [], x = {
381
- ...a.contents.peerDependencies,
382
- ...a.contents.optionalDependencies,
383
- ...a.contents.devDependencies,
384
- ...a.contents.dependencies
490
+ ), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = [];
491
+ await me(i, 4, async (g) => {
492
+ let p;
493
+ const m = [], y = {
494
+ ...g.contents.peerDependencies,
495
+ ...g.contents.optionalDependencies,
496
+ ...g.contents.devDependencies,
497
+ ...g.contents.dependencies
385
498
  };
386
- for (const [b, A] of Object.entries(x)) {
387
- const S = A.replace(/^npm:/u, "");
388
- if (!r.has(b) || !A.startsWith("catalog:") && et.test(S))
499
+ for (const [N, b] of Object.entries(y)) {
500
+ const k = b.replace(/^npm:/u, "");
501
+ if (!r.has(N) || !b.startsWith("catalog:") && at.test(k))
389
502
  continue;
390
- const u = await ze(
391
- D.join("node_modules", b, "package.json"),
392
- D.dirname(a.filePath)
503
+ const u = await ye(
504
+ $.join("node_modules", N, "package.json"),
505
+ $.dirname(g.filePath)
393
506
  );
394
507
  if (u === void 0) {
395
- (e === void 0 || b === e) && f.push(`${b} (${a.contents.name ?? a.filePath})`);
508
+ (e === void 0 || N === e) && f.push(`${N} (${g.contents.name ?? g.filePath})`);
396
509
  continue;
397
510
  }
398
- if (d.has(await R(u)))
511
+ if (d.has(await j(u)))
399
512
  continue;
400
- const v = await Ue(D.dirname(u));
401
- !v.name || !v.version || !r.has(v.name) || h.push({ declared: A, location: u, name: v.name, version: v.version });
513
+ const x = await We($.dirname(u));
514
+ !x.name || !x.version || !r.has(x.name) || m.push({ declared: b, location: u, name: x.name, version: x.version });
402
515
  }
403
- const g = Map.groupBy(
404
- h.filter(({ name: b }) => o.has(b)),
405
- ({ version: b }) => b
406
- ), w = O.maxSatisfying([...g.keys()], "*", {
516
+ const h = Map.groupBy(
517
+ m.filter(({ name: N }) => o.has(N)),
518
+ ({ version: N }) => N
519
+ ), v = L.maxSatisfying([...h.keys()], "*", {
407
520
  includePrerelease: !0
408
- }), N = [...g].sort(([b], [A]) => b.localeCompare(A)).map(
409
- ([b, A]) => `${b}: ${A.map(({ name: S }) => `\`${S}\``).sort().join(", ")}`
521
+ }), w = [...h].sort(([N], [b]) => N.localeCompare(b)).map(
522
+ ([N, b]) => `${N}: ${b.map(({ name: k }) => `\`${k}\``).sort().join(", ")}`
410
523
  ).join("; ");
411
- for (const { declared: b, location: A, name: S, version: u } of h) {
412
- if (e !== void 0 && S !== e)
524
+ for (const { declared: N, location: b, name: k, version: u } of m) {
525
+ if (e !== void 0 && k !== e)
413
526
  continue;
414
- let v = l.get(S);
415
- v === void 0 && (v = nt(S), l.set(S, v));
416
- const y = await v;
417
- y === void 0 && n?.();
418
- const P = y === void 0 ? void 0 : it(u, y), $ = [];
419
- P !== void 0 && $.push({
527
+ let x = l.get(k);
528
+ x === void 0 && (x = lt(k), l.set(k, x));
529
+ const S = await x;
530
+ S === void 0 && t?.();
531
+ const A = S === void 0 ? void 0 : dt(u, S), C = [];
532
+ A !== void 0 && C.push({
420
533
  category: "outdatedDependencies",
421
- targetVersion: P.expected,
422
- reason: `Update to ${P.expected} (declared ${b}). ${P.reason}`
423
- }), o.has(S) && w !== null && O.lt(u, w) && $.push({
534
+ targetVersion: A.expected,
535
+ reason: `Update to ${A.expected} (declared ${N}). ${A.reason}`
536
+ }), o.has(k) && v !== null && L.lt(u, v) && C.push({
424
537
  category: "mismatchedDependencies",
425
- targetVersion: w,
426
- reason: `Web GIS SDK packages within the same package.json must use the same exact version (found ${N}).`
538
+ targetVersion: v,
539
+ reason: `Web GIS SDK packages within the same package.json must use the same exact version (found ${w}).`
427
540
  });
428
- for (const { category: E, targetVersion: T, reason: k } of $) {
429
- m ??= c.parseJsonText(a.filePath, await B(a.filePath, "utf8"));
430
- const C = p.get(S) ?? [];
431
- C.push({
432
- sourceFileName: a.filePath,
541
+ for (const { category: E, targetVersion: T, reason: P } of C) {
542
+ let D;
543
+ if (E === "outdatedDependencies" && N.startsWith("catalog:"))
544
+ try {
545
+ D = await ct(g.filePath, k, N);
546
+ } catch (O) {
547
+ t?.(), R(
548
+ "warn",
549
+ I(g.filePath),
550
+ `Unable to locate dependency catalog: ${String(O)}`
551
+ );
552
+ }
553
+ D === void 0 && (p ??= a.parseJsonText(g.filePath, await z(g.filePath, "utf8")));
554
+ const F = c.get(k) ?? [];
555
+ D !== void 0 && F.some(
556
+ (O) => O.sourceFileName === D.sourceFileName && O.usage.start === D.location.start && O.usage.category === E
557
+ ) || (F.push({
558
+ sourceFileName: D?.sourceFileName ?? g.filePath,
433
559
  usage: {
434
560
  name: `${u} => ${T}`,
435
561
  category: E,
436
- module: "package.json",
437
- originFileNames: [A],
438
- reason: k,
439
- ...st(m, S, b)
562
+ module: D === void 0 ? "package.json" : "pnpm-workspace.yaml",
563
+ originFileNames: [b],
564
+ reason: P,
565
+ ...D?.location ?? pt(p, k, N)
440
566
  }
441
- }), p.set(S, C);
567
+ }), c.set(k, F));
442
568
  }
443
569
  }
444
570
  });
445
- for (const a of p.values())
446
- a.sort(
447
- (m, h) => m.sourceFileName.localeCompare(h.sourceFileName) || m.usage.start - h.usage.start
571
+ for (const g of c.values())
572
+ g.sort(
573
+ (p, m) => p.sourceFileName.localeCompare(m.sourceFileName) || p.usage.start - m.usage.start
448
574
  );
449
- return f.length > 0 && (n?.(), f.sort(), U(
575
+ return f.length > 0 && (t?.(), f.sort(), R(
450
576
  "warn",
451
577
  "dependency-versions",
452
578
  `Failed to find installed locations for ${f.length} dependencies: ${f.slice(0, 15).join(", ")}${f.length > 15 ? `, and ${f.length - 15} more` : ""}.`
453
- )), p;
579
+ )), c;
454
580
  }
455
- async function nt(s) {
581
+ async function ct(s, e, t) {
582
+ const n = await ye("pnpm-workspace.yaml", $.dirname(s));
583
+ if (n === void 0)
584
+ throw new Error(`Missing pnpm-workspace.yaml for ${t}`);
585
+ const o = await j(n), r = new Ve(), i = Be(await z(o, "utf8"), { lineCounter: r });
586
+ if (i.errors.length > 0)
587
+ throw i.errors[0];
588
+ const d = t.slice(8), l = i.getIn(
589
+ d === "" || d === "default" ? ["catalog"] : ["catalogs", d],
590
+ !0
591
+ ), c = Ke(l) ? l.items.find(({ key: y }) => re(y) && y.value === e)?.key : void 0;
592
+ if (!re(c) || c.range === void 0)
593
+ throw new Error(`Missing ${e} in ${t} in ${o}`);
594
+ const [f, g] = c.range, { line: p, col: m } = r.linePos(f);
595
+ return { sourceFileName: o, location: { start: f, length: g - f, line: p, column: m } };
596
+ }
597
+ async function lt(s) {
456
598
  try {
457
599
  const e = await fetch(`https://registry.npmjs.org/-/package/${encodeURIComponent(s)}/dist-tags`, {
458
600
  signal: AbortSignal.timeout(5e3),
@@ -460,103 +602,103 @@ async function nt(s) {
460
602
  });
461
603
  if (!e.ok)
462
604
  throw new Error(`Registry returned HTTP ${e.status}`);
463
- const n = await e.json();
464
- if (typeof n != "object" || n === null || Array.isArray(n))
605
+ const t = await e.json();
606
+ if (typeof t != "object" || t === null || Array.isArray(t))
465
607
  throw new Error("Invalid registry dist-tags response");
466
- const t = {};
467
- for (const [o, r] of Object.entries(n))
468
- ["latest", "rc", "next"].includes(o) && typeof r == "string" && O.valid(r) !== null && (t[o] = r);
469
- if (Object.keys(t).length === 0)
608
+ const n = {};
609
+ for (const [o, r] of Object.entries(t))
610
+ ["latest", "rc", "next"].includes(o) && typeof r == "string" && L.valid(r) !== null && (n[o] = r);
611
+ if (Object.keys(n).length === 0)
470
612
  throw new Error("Registry returned no supported release tags");
471
- return t;
613
+ return n;
472
614
  } catch (e) {
473
- U("warn", s, `Dependency freshness unavailable: ${String(e)}`);
615
+ R("warn", s, `Dependency freshness unavailable: ${String(e)}`);
474
616
  return;
475
617
  }
476
618
  }
477
- function st(s, e, n) {
478
- const t = c.forEachChild(s, d), o = t.getStart(s), { line: r, character: i } = s.getLineAndCharacterOfPosition(o);
479
- return { start: o, length: t.getWidth(s), line: r + 1, column: i + 1 };
619
+ function pt(s, e, t) {
620
+ const n = a.forEachChild(s, d), o = n.getStart(s), { line: r, character: i } = s.getLineAndCharacterOfPosition(o);
621
+ return { start: o, length: n.getWidth(s), line: r + 1, column: i + 1 };
480
622
  function d(l) {
481
- return c.isPropertyAssignment(l) && c.isStringLiteral(l.name) && ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"].includes(l.name.text) && c.isObjectLiteralExpression(l.initializer) ? l.initializer.properties.find(
482
- (p) => c.isPropertyAssignment(p) && c.isStringLiteral(p.name) && p.name.text === e && c.isStringLiteral(p.initializer) && p.initializer.text === n
483
- )?.name : c.forEachChild(l, d);
623
+ return a.isPropertyAssignment(l) && a.isStringLiteral(l.name) && ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"].includes(l.name.text) && a.isObjectLiteralExpression(l.initializer) ? l.initializer.properties.find(
624
+ (c) => a.isPropertyAssignment(c) && a.isStringLiteral(c.name) && c.name.text === e && a.isStringLiteral(c.initializer) && c.initializer.text === t
625
+ )?.name : a.forEachChild(l, d);
484
626
  }
485
627
  }
486
- function it(s, e) {
487
- const n = O.parse(s), t = O.parse(e.latest ?? "");
488
- if (n === null)
628
+ function dt(s, e) {
629
+ const t = L.parse(s), n = L.parse(e.latest ?? "");
630
+ if (t === null)
489
631
  return;
490
632
  if (
491
633
  // Permit packages without latest dist-tag
492
- t !== null && // Permit installed to be newer than latest
493
- O.lt(n, t) && // Require using stable over prerelease
494
- (n.prerelease.length > 0 || // Forbid major being behind stable
495
- n.major !== t.major || // Forbid minor being behind stable
496
- n.minor !== t.minor)
634
+ n !== null && // Permit installed to be newer than latest
635
+ L.lt(t, n) && // Require using stable over prerelease
636
+ (t.prerelease.length > 0 || // Forbid major being behind stable
637
+ t.major !== n.major || // Forbid minor being behind stable
638
+ t.minor !== n.minor)
497
639
  )
498
640
  return {
499
- expected: t.version,
641
+ expected: n.version,
500
642
  reason: "A newer stable release is available. Prerelease versions are deprecated."
501
643
  };
502
644
  if (
503
645
  // Enforce policy only for next.N prereleases
504
- n.prerelease.length !== 2 || // Only enforce policy for -next
505
- n.prerelease[0] !== "next"
646
+ t.prerelease.length !== 2 || // Only enforce policy for -next
647
+ t.prerelease[0] !== "next"
506
648
  )
507
649
  return;
508
- const o = n.prerelease[1];
650
+ const o = t.prerelease[1];
509
651
  if (typeof o != "number")
510
652
  return;
511
653
  const i = [e.next, e.rc].flatMap((d) => {
512
- const l = O.parse(d ?? "");
654
+ const l = L.parse(d ?? "");
513
655
  return l !== null && // Support packages without latest dist-tag
514
- (t === null || // Ignore rc dist-tag if it is behind latest
515
- O.gt(l, t)) && // Require same major.minor.patch for -next version comparison
516
- l.major === n.major && l.minor === n.minor && l.patch === n.patch && // Require next.N format for comparison
656
+ (n === null || // Ignore rc dist-tag if it is behind latest
657
+ L.gt(l, n)) && // Require same major.minor.patch for -next version comparison
658
+ l.major === t.major && l.minor === t.minor && l.patch === t.patch && // Require next.N format for comparison
517
659
  l.prerelease.length === 2 && l.prerelease[0] === "next" && typeof l.prerelease[1] == "number" ? [l] : [];
518
- }).sort(O.rcompare).at(0);
660
+ }).sort(L.rcompare).at(0);
519
661
  if (i !== void 0 && Number(i.prerelease[1]) - o >= 30)
520
662
  return {
521
663
  expected: i.version,
522
664
  reason: "Installed -next is significantly behind the most recent -next build."
523
665
  };
524
666
  }
525
- const ot = /* @__PURE__ */ new Set(["none", "amd", "umd", "system", "systemjs", "node", "node10", "legacy"]), at = /* @__PURE__ */ new Set(["node", "node10", "classic"]);
526
- async function rt(s) {
527
- const e = "es2024", n = [];
528
- for (const t of [...new Set(s)].sort()) {
529
- const o = c.parseJsonText(t, await B(t, "utf8"));
530
- n.push(...ct(o, e));
667
+ const mt = /* @__PURE__ */ new Set(["none", "amd", "umd", "system", "systemjs", "node", "node10", "legacy"]), ut = /* @__PURE__ */ new Set(["node", "node10", "classic"]);
668
+ async function gt(s) {
669
+ const e = "es2024", t = [];
670
+ for (const n of [...new Set(s)].sort()) {
671
+ const o = a.parseJsonText(n, await z(n, "utf8"));
672
+ t.push(...ft(o, e));
531
673
  }
532
- return n;
674
+ return t;
533
675
  }
534
- function ct(s, e) {
535
- const n = s.statements[0];
536
- if (n === void 0 || !c.isExpressionStatement(n) || !c.isObjectLiteralExpression(n.expression))
676
+ function ft(s, e) {
677
+ const t = s.statements[0];
678
+ if (t === void 0 || !a.isExpressionStatement(t) || !a.isObjectLiteralExpression(t.expression))
537
679
  return [];
538
- const t = n.expression.properties.find(
539
- (i) => c.isPropertyAssignment(i) && c.isStringLiteral(i.name) && i.name.text === "compilerOptions"
680
+ const n = t.expression.properties.find(
681
+ (i) => a.isPropertyAssignment(i) && a.isStringLiteral(i.name) && i.name.text === "compilerOptions"
540
682
  );
541
- if (t === void 0 || !c.isObjectLiteralExpression(t.initializer))
683
+ if (n === void 0 || !a.isObjectLiteralExpression(n.initializer))
542
684
  return [];
543
- const o = c.convertCompilerOptionsFromJson({ target: e }, ".").options.target, r = [];
544
- for (const i of t.initializer.properties) {
545
- if (!c.isPropertyAssignment(i) || !c.isStringLiteral(i.name))
685
+ const o = a.convertCompilerOptionsFromJson({ target: e }, ".").options.target, r = [];
686
+ for (const i of n.initializer.properties) {
687
+ if (!a.isPropertyAssignment(i) || !a.isStringLiteral(i.name))
546
688
  continue;
547
- const d = i.name.text, l = c.isStringLiteral(i.initializer) ? i.initializer.text.toLowerCase() : void 0;
548
- let p;
549
- if (d === "module" && l !== void 0 && ot.has(l))
550
- p = `The ${l} module setting is legacy or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
551
- else if (d === "moduleResolution" && l !== void 0 && at.has(l))
552
- p = `The ${l} module resolution setting is deprecated or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
689
+ const d = i.name.text, l = a.isStringLiteral(i.initializer) ? i.initializer.text.toLowerCase() : void 0;
690
+ let c;
691
+ if (d === "module" && l !== void 0 && mt.has(l))
692
+ c = `The ${l} module setting is legacy or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
693
+ else if (d === "moduleResolution" && l !== void 0 && ut.has(l))
694
+ c = `The ${l} module resolution setting is deprecated or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
553
695
  else if (d === "target" && l !== void 0) {
554
- const h = c.convertCompilerOptionsFromJson({ target: l }, ".").options.target;
555
- h !== void 0 && h < o && (p = `Targets below ${e} are older than Maps SDK's for JavaScript supported targets. See https://next.gha.afd.arcgis.com/javascript/latest/system-requirements/.`);
556
- } else d === "ignoreDeprecations" && (p = "Address deprecations that were suppressed by ignoreDeprecations.");
557
- if (p === void 0)
696
+ const m = a.convertCompilerOptionsFromJson({ target: l }, ".").options.target;
697
+ m !== void 0 && m < o && (c = `Targets below ${e} are older than Maps SDK's for JavaScript supported targets. See https://next.gha.afd.arcgis.com/javascript/latest/system-requirements/.`);
698
+ } else d === "ignoreDeprecations" && (c = "Address deprecations that were suppressed by ignoreDeprecations.");
699
+ if (c === void 0)
558
700
  continue;
559
- const f = i.name.getStart(s), { line: a, character: m } = s.getLineAndCharacterOfPosition(f);
701
+ const f = i.name.getStart(s), { line: g, character: p } = s.getLineAndCharacterOfPosition(f);
560
702
  r.push({
561
703
  sourceFileName: s.fileName,
562
704
  usage: {
@@ -564,24 +706,24 @@ function ct(s, e) {
564
706
  category: "outdatedTypeScriptConfig",
565
707
  module: "tsconfig.json",
566
708
  originFileNames: [],
567
- reason: p,
709
+ reason: c,
568
710
  start: f,
569
711
  length: i.name.getWidth(s),
570
- line: a + 1,
571
- column: m + 1
712
+ line: g + 1,
713
+ column: p + 1
572
714
  }
573
715
  });
574
716
  }
575
717
  return r;
576
718
  }
577
- async function Rt(s, e) {
719
+ async function Kt(s, e) {
578
720
  if (e.reportingUrl && (s || e.esriOnly || e.category || e.packageName))
579
721
  throw new Error("Reporting requires a complete, unfiltered repository scan.");
580
- const n = e.outputFormat === "json" || e.reportingUrl ? process.cwd() === I().repositoryRoot : !1;
581
- if (e.reportingUrl && !n)
722
+ const t = e.outputFormat === "json" || e.reportingUrl ? process.cwd() === J().repositoryRoot : !1;
723
+ if (e.reportingUrl && !t)
582
724
  throw new Error("Reporting requires scanning from the Git repository root.");
583
- let t = !s && !e.esriOnly && !e.category && !e.packageName;
584
- (e.outputFormat === "json" || e.reportingUrl) && (t &&= n), await be(
725
+ let n = !s && !e.esriOnly && !e.category && !e.packageName;
726
+ (e.outputFormat === "json" || e.reportingUrl) && (n &&= t), await ke(
585
727
  {
586
728
  meta: {
587
729
  needsTypeInformation: !0,
@@ -590,338 +732,339 @@ async function Rt(s, e) {
590
732
  includeTsConfigFiles: !0
591
733
  },
592
734
  async run(o) {
593
- await lt(o, e, t, s);
735
+ await ht(o, e, n, s);
594
736
  }
595
737
  },
596
738
  "deprecations audit-usages",
597
739
  s
598
740
  );
599
741
  }
600
- async function lt(s, e, n, t) {
601
- const o = /* @__PURE__ */ new Map(), r = Le("warn", () => {
602
- n = !1;
603
- }), i = /* @__PURE__ */ new Map(), d = se([]), l = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), f = [
742
+ async function ht(s, e, t, n) {
743
+ const o = /* @__PURE__ */ new Map(), r = Ie("warn", () => {
744
+ t = !1;
745
+ }), i = /* @__PURE__ */ new Map(), d = ie([]), l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), f = [
604
746
  ...new Map(
605
747
  s.flatMap(({ packageJson: u }) => {
606
- const v = u === void 0 ? void 0 : D.dirname(u.filePath), y = u?.contents.name;
607
- return v !== void 0 && y !== void 0 && L(v, process.cwd()) ? [[v, { root: v, name: y }]] : [];
748
+ const x = u === void 0 ? void 0 : $.dirname(u.filePath), S = u?.contents.name;
749
+ return x !== void 0 && S !== void 0 && M(x, process.cwd()) ? [[x, { root: x, name: S }]] : [];
608
750
  })
609
751
  ).values()
610
- ].toSorted((u, v) => v.root.length - u.root.length);
752
+ ].toSorted((u, x) => x.root.length - u.root.length);
611
753
  for (const u of s) {
612
- var N = [];
754
+ var w = [];
613
755
  try {
614
- if (J(u.packageJson?.contents.name)) {
615
- const k = u.packageJson?.filePath;
616
- k !== void 0 && !p.has(k) && (p.add(k), U(
756
+ if (U(u.packageJson?.contents.name)) {
757
+ const P = u.packageJson?.filePath;
758
+ P !== void 0 && !c.has(P) && (c.add(P), R(
617
759
  "warn",
618
- M(k),
760
+ I(P),
619
761
  `Skipping excluded package \`${u.packageJson?.contents.name ?? u.cwd}\`.`
620
762
  ));
621
763
  continue;
622
764
  }
623
765
  if (u.filePaths.length === 0)
624
766
  continue;
625
- const v = Ee(u.packageJson);
626
- const y = await g(u.packageJson, v.packages);
627
- const P = u.packageJson === void 0 ? void 0 : D.dirname(u.packageJson.filePath);
628
- const $ = te(N, u.filePaths.some(Ne) ? Se(u, !1, {
629
- paths: { ...u.typeScriptConfig?.compilerOptions.paths, ...v.paths }
767
+ const x = Oe(u.packageJson);
768
+ const S = await h(u.packageJson, x.packages);
769
+ const A = u.packageJson === void 0 ? void 0 : $.dirname(u.packageJson.filePath);
770
+ const C = ne(w, u.filePaths.some(Ae) ? be(u, !1, {
771
+ paths: { ...u.typeScriptConfig?.compilerOptions.paths, ...x.paths }
630
772
  }) : void 0);
631
- const E = $?.tsMorph.getLanguageService().compilerObject;
773
+ const E = C?.tsMorph.getLanguageService().compilerObject;
632
774
  const T = E?.getProgram()?.getTypeChecker();
633
- for (const k of $?.getCodemodFiles() ?? []) {
634
- const C = k.compilerNode;
635
- if (!ie(C.fileName)) {
775
+ for (const P of C?.getCodemodFiles() ?? []) {
776
+ const D = P.compilerNode;
777
+ if (!oe(D.fileName)) {
636
778
  if (E !== void 0 && T !== void 0) {
637
- const we = dt(
638
- C,
779
+ const F = yt(
780
+ D,
639
781
  E,
640
782
  T,
641
- P,
783
+ A,
642
784
  e.esriOnly
643
785
  );
644
- for (const H of we) {
645
- const X = yt(H.originFileNames, f, P), Y = o.get(X) ?? [];
646
- Y.push({ sourceFileName: C.fileName, usage: H }), o.set(X, Y);
786
+ for (const O of F) {
787
+ const Y = At(O.originFileNames, f, A), Z = o.get(Y) ?? [];
788
+ Z.push({ sourceFileName: D.fileName, usage: O }), o.set(Y, Z);
647
789
  }
648
790
  }
649
- w(ce(C, y, T)), l.add(C.fileName);
791
+ v(pe(D, S, T)), l.add(D.fileName);
650
792
  }
651
793
  }
652
- y.hasDeprecatedApis && await pe(u.filePaths, 8, async (k) => {
653
- if (l.has(k) || ie(k))
794
+ await me(u.filePaths, 8, async (P) => {
795
+ const D = P.toLowerCase().endsWith(".html");
796
+ if (l.has(P) || oe(P) || !S.hasDeprecatedApis && !D)
654
797
  return;
655
- const C = await B(k, "utf8");
656
- w(ce({ fileName: k, text: C }, y)), l.add(k);
798
+ const F = await z(P, "utf8");
799
+ v(pe({ fileName: P, text: F }, S)), l.add(P);
657
800
  });
658
- } catch (b) {
659
- var A = b, S = !0;
801
+ } catch (N) {
802
+ var b = N, k = !0;
660
803
  } finally {
661
- ne(N, A, S);
804
+ se(w, b, k);
662
805
  }
663
806
  }
664
- const a = await tt(
807
+ const g = await rt(
665
808
  s.flatMap(
666
- ({ packageJson: u }) => u === void 0 || J(u.contents.name) ? [] : [u]
809
+ ({ packageJson: u }) => u === void 0 || U(u.contents.name) ? [] : [u]
667
810
  ),
668
811
  e.packageName,
669
812
  () => {
670
- n = !1;
813
+ t = !1;
671
814
  }
672
815
  );
673
- for (const [u, v] of a)
674
- o.set(u, [...o.get(u) ?? [], ...v]);
816
+ for (const [u, x] of g)
817
+ o.set(u, [...o.get(u) ?? [], ...x]);
675
818
  if (!e.esriOnly && (e.packageName === void 0 || e.packageName === "typescript") && (e.category === void 0 || e.category === "outdatedTypeScriptConfig")) {
676
819
  const u = s.flatMap(
677
- ({ typeScriptConfig: y, packageJson: P }) => y !== void 0 && !J(P?.contents.name) && L(y.filePath, process.cwd()) && (t === void 0 || t === y.filePath) ? [y.filePath] : []
678
- ), v = await rt(u);
679
- v.length > 0 && o.set("typescript", [...o.get("typescript") ?? [], ...v]);
820
+ ({ typeScriptConfig: S, packageJson: A }) => S !== void 0 && !U(A?.contents.name) && M(S.filePath, process.cwd()) && (n === void 0 || n === S.filePath) ? [S.filePath] : []
821
+ ), x = await gt(u);
822
+ x.length > 0 && o.set("typescript", [...o.get("typescript") ?? [], ...x]);
680
823
  }
681
- const m = pt(o, e), h = e.reportingUrl || e.outputFormat === "json" ? K(m, de(), I(), n) : void 0;
682
- We(m, e.outputFormat, h);
683
- const x = [...m.values()].flat();
684
- Oe(
824
+ const p = vt(o, e), m = e.reportingUrl || e.outputFormat === "json" ? H(p, ue(), J(), t) : void 0;
825
+ qe(p, e.outputFormat, m);
826
+ const y = [...p.values()].flat();
827
+ Te(
685
828
  "usages",
686
- x.length,
687
- new Set(x.map(({ sourceFileName: u }) => u)).size,
688
- m.size
689
- ), e.reportingUrl && h !== void 0 && await ke(h, e.reportingUrl);
690
- async function g(u, v) {
829
+ y.length,
830
+ new Set(y.map(({ sourceFileName: u }) => u)).size,
831
+ p.size
832
+ ), e.reportingUrl && m !== void 0 && await Pe(m, e.reportingUrl);
833
+ async function h(u, x) {
691
834
  if (u === void 0)
692
835
  return d;
693
- let y = i.get(u.filePath);
694
- return y === void 0 && (y = se(
695
- await Te(u, r, e.esriOnly, v)
696
- ), i.set(u.filePath, y)), y;
836
+ let S = i.get(u.filePath);
837
+ return S === void 0 && (S = ie(
838
+ await Fe(u, r, e.esriOnly, x)
839
+ ), i.set(u.filePath, S)), S;
697
840
  }
698
- function w(u) {
699
- for (const { packageName: v, sourceFileName: y, usage: P } of u) {
700
- if (me(P.name, P.reason))
841
+ function v(u) {
842
+ for (const { packageName: x, sourceFileName: S, usage: A } of u) {
843
+ if (ge(A.name, A.reason))
701
844
  continue;
702
- const $ = o.get(v) ?? [], E = $.findIndex(
703
- (k) => k.sourceFileName === y && k.usage.start === P.start && k.usage.length === P.length
704
- ), T = { sourceFileName: y, usage: P };
705
- E === -1 ? $.push(T) : $[E] = T, o.set(v, $);
845
+ const C = o.get(x) ?? [], E = C.findIndex(
846
+ (P) => P.sourceFileName === S && P.usage.start === A.start && P.usage.length === A.length
847
+ ), T = { sourceFileName: S, usage: A };
848
+ E === -1 ? C.push(T) : C[E] = T, o.set(x, C);
706
849
  }
707
850
  }
708
851
  }
709
- function pt(s, e) {
710
- const n = /* @__PURE__ */ new Map();
711
- for (const [t, o] of s) {
712
- if (e.packageName !== void 0 && t !== e.packageName)
852
+ function vt(s, e) {
853
+ const t = /* @__PURE__ */ new Map();
854
+ for (const [n, o] of s) {
855
+ if (e.packageName !== void 0 && n !== e.packageName)
713
856
  continue;
714
857
  const r = o.filter(
715
- ({ usage: i }) => e.category === void 0 || ge({
716
- package: t,
858
+ ({ usage: i }) => e.category === void 0 || he({
859
+ package: n,
717
860
  name: i.name,
718
861
  category: i.category,
719
862
  memberOf: i.memberOf,
720
- module: i.module ?? W(i.originFileNames, t),
863
+ module: i.module ?? K(i.originFileNames, n),
721
864
  deprecated: i.reason ?? !0
722
865
  }) === e.category
723
866
  );
724
- r.length > 0 && n.set(t, r);
867
+ r.length > 0 && t.set(n, r);
725
868
  }
726
- return n;
869
+ return t;
727
870
  }
728
- function dt(s, e, n, t, o = !1) {
871
+ function yt(s, e, t, n, o = !1) {
729
872
  const r = /* @__PURE__ */ new Map();
730
873
  for (const i of e.getSuggestionDiagnostics(s.fileName)) {
731
874
  if (i.reportsDeprecated === void 0)
732
875
  continue;
733
- const d = ve(s, i.start, i.start + i.length);
876
+ const d = we(s, i.start, i.start + i.length);
734
877
  if (
735
878
  // Don't report for imports, only for usages
736
- c.findAncestor(d, c.isImportDeclaration) !== void 0 || // Don't report closing JSX - only for opening
737
- c.findAncestor(d, c.isJsxClosingElement) !== void 0
879
+ a.findAncestor(d, a.isImportDeclaration) !== void 0 || // Don't report closing JSX - only for opening
880
+ a.findAncestor(d, a.isJsxClosingElement) !== void 0
738
881
  )
739
882
  continue;
740
- const l = gt(d, n), p = l.reason === void 0 ? [] : Q(l.symbol), f = p.length > 0 ? void 0 : e.getDefinitionAtPosition(s.fileName, i.start), a = p.length > 0 ? p : [...new Set(f?.map(({ fileName: m }) => m))];
741
- G(a, o, t) && q(r, s, {
883
+ const l = St(d, t), c = l.reason === void 0 ? [] : Q(l.symbol), f = c.length > 0 ? void 0 : e.getDefinitionAtPosition(s.fileName, i.start), g = c.length > 0 ? c : [...new Set(f?.map(({ fileName: p }) => p))];
884
+ _(g, o, n) && G(r, s, {
742
885
  start: i.start,
743
886
  length: i.length,
744
- ...ft(d, l, n, e, f?.[0]),
745
- originFileNames: a,
746
- reason: vt(e, s.fileName, i.start) ?? l.reason
887
+ ...Nt(d, l, t, e, f?.[0]),
888
+ originFileNames: g,
889
+ reason: kt(e, s.fileName, i.start) ?? l.reason
747
890
  });
748
891
  }
749
- return mt(s, n, r, t, o), [...r.values()].toSorted((i, d) => i.start - d.start);
892
+ return xt(s, t, r, n, o), [...r.values()].toSorted((i, d) => i.start - d.start);
750
893
  }
751
- function mt(s, e, n, t, o) {
894
+ function xt(s, e, t, n, o) {
752
895
  function r(i) {
753
- c.isNewExpression(i) && ut(i, e, n, t, o);
896
+ a.isNewExpression(i) && wt(i, e, t, n, o);
754
897
  let d, l;
755
- if (c.isJsxAttribute(i) && c.isIdentifier(i.name)) {
756
- const p = i.parent.parent;
757
- (c.isJsxOpeningElement(p) || c.isJsxSelfClosingElement(p)) && (l = e.getContextualType(p.tagName)?.getProperty(i.name.text), d = i.name);
758
- } else if ((c.isPropertyAssignment(i) || c.isShorthandPropertyAssignment(i) || c.isMethodDeclaration(i)) && c.isObjectLiteralExpression(i.parent)) {
759
- const p = c.isComputedPropertyName(i.name) ? j(i.name.expression, e) : i.name.text, f = e.getContextualType(i.parent);
760
- l = p === void 0 || f === void 0 ? void 0 : e.getNonNullableType(f).getProperty(p), d = i.name;
761
- } else if (c.isPropertyAccessExpression(i))
898
+ if (a.isJsxAttribute(i) && a.isIdentifier(i.name)) {
899
+ const c = i.parent.parent;
900
+ (a.isJsxOpeningElement(c) || a.isJsxSelfClosingElement(c)) && (l = e.getContextualType(c.tagName)?.getProperty(i.name.text), d = i.name);
901
+ } else if ((a.isPropertyAssignment(i) || a.isShorthandPropertyAssignment(i) || a.isMethodDeclaration(i)) && a.isObjectLiteralExpression(i.parent)) {
902
+ const c = a.isComputedPropertyName(i.name) ? W(i.name.expression, e) : i.name.text, f = e.getContextualType(i.parent);
903
+ l = c === void 0 || f === void 0 ? void 0 : e.getNonNullableType(f).getProperty(c), d = i.name;
904
+ } else if (a.isPropertyAccessExpression(i))
762
905
  l = e.getSymbolAtLocation(i.name), d = i.name;
763
- else if (c.isElementAccessExpression(i)) {
764
- const p = j(i.argumentExpression, e);
765
- l = p === void 0 ? void 0 : e.getTypeAtLocation(i.expression).getProperty(p), d = i.argumentExpression;
766
- } else if (c.isBindingElement(i) && c.isObjectBindingPattern(i.parent) && i.dotDotDotToken === void 0) {
767
- const p = i.propertyName ?? (c.isIdentifier(i.name) ? i.name : void 0), f = p === void 0 ? void 0 : c.isComputedPropertyName(p) ? j(p.expression, e) : p.text;
768
- l = f === void 0 ? void 0 : e.getTypeAtLocation(i.parent).getProperty(f), d = p;
906
+ else if (a.isElementAccessExpression(i)) {
907
+ const c = W(i.argumentExpression, e);
908
+ l = c === void 0 ? void 0 : e.getTypeAtLocation(i.expression).getProperty(c), d = i.argumentExpression;
909
+ } else if (a.isBindingElement(i) && a.isObjectBindingPattern(i.parent) && i.dotDotDotToken === void 0) {
910
+ const c = i.propertyName ?? (a.isIdentifier(i.name) ? i.name : void 0), f = c === void 0 ? void 0 : a.isComputedPropertyName(c) ? W(c.expression, e) : c.text;
911
+ l = f === void 0 ? void 0 : e.getTypeAtLocation(i.parent).getProperty(f), d = c;
769
912
  }
770
- if ((c.isPropertyAccessExpression(i) || c.isElementAccessExpression(i) || c.isBindingElement(i)) && !l?.declarations?.some(
771
- (p) => c.isGetAccessorDeclaration(p) || c.isSetAccessorDeclaration(p)
913
+ if ((a.isPropertyAccessExpression(i) || a.isElementAccessExpression(i) || a.isBindingElement(i)) && !l?.declarations?.some(
914
+ (c) => a.isGetAccessorDeclaration(c) || a.isSetAccessorDeclaration(c)
772
915
  ) && (l = void 0), l !== void 0 && d !== void 0) {
773
- const p = xe(l, e), f = Q(l);
774
- p !== void 0 && G(f, o, t) && q(n, s, {
916
+ const c = Ne(l, e), f = Q(l);
917
+ c !== void 0 && _(f, o, n) && G(t, s, {
775
918
  start: d.getStart(s),
776
919
  length: d.getWidth(s),
777
920
  name: l.getName(),
778
- ...z(l.declarations?.[0]),
921
+ ...B(l.declarations?.[0]),
779
922
  originFileNames: f,
780
- reason: p
923
+ reason: c
781
924
  });
782
925
  }
783
- c.forEachChild(i, r);
926
+ a.forEachChild(i, r);
784
927
  }
785
928
  r(s);
786
929
  }
787
- function ut(s, e, n, t, o) {
788
- const r = e.getTypeAtLocation(s).getSymbol(), i = r?.declarations?.[0], d = i !== void 0 && (c.isClassDeclaration(i) || c.isInterfaceDeclaration(i)) ? i.name?.text : void 0, l = d === void 0 ? void 0 : Fe.get(d);
930
+ function wt(s, e, t, n, o) {
931
+ const r = e.getTypeAtLocation(s).getSymbol(), i = r?.declarations?.[0], d = i !== void 0 && (a.isClassDeclaration(i) || a.isInterfaceDeclaration(i)) ? i.name?.text : void 0, l = d === void 0 ? void 0 : Ue.get(d);
789
932
  if (l === void 0 || d === void 0)
790
933
  return;
791
- const p = Q(r);
792
- if (!p.some(
793
- (m) => (_(m) ?? ue(D.dirname(m), "")) === "@arcgis/core"
794
- ) || !G(p, o, t))
934
+ const c = Q(r);
935
+ if (!c.some(
936
+ (p) => (X(p) ?? fe($.dirname(p), "")) === "@arcgis/core"
937
+ ) || !_(c, o, n))
795
938
  return;
796
- const f = c.isPropertyAccessExpression(s.expression) ? s.expression.name : s.expression, a = s.getSourceFile();
797
- q(n, a, {
798
- start: f.getStart(a),
799
- length: f.getWidth(a),
939
+ const f = a.isPropertyAccessExpression(s.expression) ? s.expression.name : s.expression, g = s.getSourceFile();
940
+ G(t, g, {
941
+ start: f.getStart(g),
942
+ length: f.getWidth(g),
800
943
  name: d,
801
944
  kind: "class",
802
945
  category: "coreViews",
803
- originFileNames: p,
946
+ originFileNames: c,
804
947
  reason: `Direct construction with new ${d}() is discouraged. Use \`<${l}>\` instead. In 6.0, directly constructed views will no longer include .ui; use component slots for UI.`
805
948
  });
806
949
  }
807
- function j(s, e) {
808
- const n = e.getTypeAtLocation(s);
809
- return n.isStringLiteral() || n.isNumberLiteral() ? String(n.value) : void 0;
950
+ function W(s, e) {
951
+ const t = e.getTypeAtLocation(s);
952
+ return t.isStringLiteral() || t.isNumberLiteral() ? String(t.value) : void 0;
810
953
  }
811
- function gt(s, e) {
812
- let n = e.getSymbolAtLocation(s);
813
- for (; n !== void 0 && (n.flags & c.SymbolFlags.Alias) !== 0; ) {
814
- const t = xe(n, e);
815
- if (t !== void 0)
816
- return { symbol: n, reason: t };
817
- n = n.declarations === void 0 ? void 0 : e.getImmediateAliasedSymbol(n);
954
+ function St(s, e) {
955
+ let t = e.getSymbolAtLocation(s);
956
+ for (; t !== void 0 && (t.flags & a.SymbolFlags.Alias) !== 0; ) {
957
+ const n = Ne(t, e);
958
+ if (n !== void 0)
959
+ return { symbol: t, reason: n };
960
+ t = t.declarations === void 0 ? void 0 : e.getImmediateAliasedSymbol(t);
818
961
  }
819
- return { symbol: n, reason: void 0 };
962
+ return { symbol: t, reason: void 0 };
820
963
  }
821
964
  function Q(s) {
822
965
  return [...new Set(s?.declarations?.map((e) => e.getSourceFile().fileName))];
823
966
  }
824
- function ft(s, e, n, t, o) {
967
+ function Nt(s, e, t, n, o) {
825
968
  if (e.reason !== void 0)
826
969
  return {
827
- name: oe(e.symbol.declarations?.[0], e.symbol.getName()),
828
- ...z(e.symbol.declarations?.[0])
970
+ name: ae(e.symbol.declarations?.[0], e.symbol.getName()),
971
+ ...B(e.symbol.declarations?.[0])
829
972
  };
830
- const r = o === void 0 ? void 0 : t.getProgram()?.getSourceFile(o.fileName), i = o === void 0 || r === void 0 ? void 0 : ve(
973
+ const r = o === void 0 ? void 0 : n.getProgram()?.getSourceFile(o.fileName), i = o === void 0 || r === void 0 ? void 0 : we(
831
974
  r,
832
975
  o.textSpan.start,
833
976
  o.textSpan.start + o.textSpan.length
834
- ), d = (i === void 0 ? void 0 : n.getSymbolAtLocation(i)?.declarations?.[0]) ?? e.symbol?.declarations?.[0], l = o?.name;
977
+ ), d = (i === void 0 ? void 0 : t.getSymbolAtLocation(i)?.declarations?.[0]) ?? e.symbol?.declarations?.[0], l = o?.name;
835
978
  return {
836
- name: l === void 0 ? ht(s) : oe(d, l),
837
- ...z(d)
979
+ name: l === void 0 ? bt(s) : ae(d, l),
980
+ ...B(d)
838
981
  };
839
982
  }
840
- function L(s, e) {
841
- const n = D.relative(e, s);
842
- return n !== "" && !n.startsWith("../") && !D.isAbsolute(n) && n !== "node_modules" && !n.startsWith("node_modules/");
983
+ function M(s, e) {
984
+ const t = $.relative(e, s);
985
+ return t !== "" && !t.startsWith("../") && !$.isAbsolute(t) && t !== "node_modules" && !t.startsWith("node_modules/");
843
986
  }
844
- function ve(s, e, n) {
845
- let t = s;
987
+ function we(s, e, t) {
988
+ let n = s;
846
989
  for (; ; ) {
847
990
  let o;
848
- if (c.forEachChild(t, (r) => {
849
- o === void 0 && r.getStart(s) <= e && r.getEnd() >= n && (o = r);
991
+ if (a.forEachChild(n, (r) => {
992
+ o === void 0 && r.getStart(s) <= e && r.getEnd() >= t && (o = r);
850
993
  }), o === void 0)
851
- return t;
852
- t = o;
994
+ return n;
995
+ n = o;
853
996
  }
854
997
  }
855
- function ht(s) {
856
- return c.isIdentifier(s) || c.isPrivateIdentifier(s) || c.isStringLiteralLike(s) || c.isNumericLiteral(s) ? s.text : s.getText();
998
+ function bt(s) {
999
+ return a.isIdentifier(s) || a.isPrivateIdentifier(s) || a.isStringLiteralLike(s) || a.isNumericLiteral(s) ? s.text : s.getText();
857
1000
  }
858
- function ye(s) {
859
- const e = s?.find(({ name: n }) => n === "deprecated");
860
- return e === void 0 ? void 0 : Me(e.text) ?? "";
1001
+ function Se(s) {
1002
+ const e = s?.find(({ name: t }) => t === "deprecated");
1003
+ return e === void 0 ? void 0 : Je(e.text) ?? "";
861
1004
  }
862
- function vt(s, e, n) {
1005
+ function kt(s, e, t) {
863
1006
  try {
864
- return ye(s.getQuickInfoAtPosition(e, n)?.tags);
1007
+ return Se(s.getQuickInfoAtPosition(e, t)?.tags);
865
1008
  } catch {
866
1009
  return;
867
1010
  }
868
1011
  }
869
- function xe(s, e) {
1012
+ function Ne(s, e) {
870
1013
  try {
871
- const n = ye(s?.getJsDocTags(e));
872
- if (n !== void 0)
873
- return n;
874
- const t = s?.declarations?.filter((o) => c.isGetAccessorDeclaration(o) || c.isSetAccessorDeclaration(o)).map((o) => c.getJSDocDeprecatedTag(o)).find((o) => o !== void 0);
875
- return t === void 0 ? void 0 : t.comment === void 0 ? "" : Ie(t.comment);
1014
+ const t = Se(s?.getJsDocTags(e));
1015
+ if (t !== void 0)
1016
+ return t;
1017
+ const n = s?.declarations?.filter((o) => a.isGetAccessorDeclaration(o) || a.isSetAccessorDeclaration(o)).map((o) => a.getJSDocDeprecatedTag(o)).find((o) => o !== void 0);
1018
+ return n === void 0 ? void 0 : n.comment === void 0 ? "" : Me(n.comment);
876
1019
  } catch {
877
1020
  return;
878
1021
  }
879
1022
  }
880
- function q(s, e, n) {
881
- if (me(n.name, n.reason))
1023
+ function G(s, e, t) {
1024
+ if (ge(t.name, t.reason))
882
1025
  return;
883
- const { line: t, character: o } = e.getLineAndCharacterOfPosition(n.start);
884
- s.set(`${n.start}:${n.length}`, {
885
- ...n,
886
- line: t + 1,
1026
+ const { line: n, character: o } = e.getLineAndCharacterOfPosition(t.start);
1027
+ s.set(`${t.start}:${t.length}`, {
1028
+ ...t,
1029
+ line: n + 1,
887
1030
  column: o + 1
888
1031
  });
889
1032
  }
890
- function G(s, e, n) {
891
- return s.some((t) => n !== void 0 && L(t, n)) ? !1 : !e || s.some((t) => {
892
- const o = _(t);
893
- return o === void 0 ? n === void 0 || !L(t, n) : Ae(o);
1033
+ function _(s, e, t) {
1034
+ return s.some((n) => t !== void 0 && M(n, t)) ? !1 : !e || s.some((n) => {
1035
+ const o = X(n);
1036
+ return o === void 0 ? t === void 0 || !M(n, t) : De(o);
894
1037
  });
895
1038
  }
896
- function _(s) {
897
- const e = Pe(s), n = "/node_modules/", t = e.lastIndexOf(n);
898
- if (t === -1)
1039
+ function X(s) {
1040
+ const e = $e(s), t = "/node_modules/", n = e.lastIndexOf(t);
1041
+ if (n === -1)
899
1042
  return;
900
- const [o, r] = e.slice(t + n.length).split("/");
1043
+ const [o, r] = e.slice(n + t.length).split("/");
901
1044
  return o.startsWith("@") ? `${o}/${r}` : o;
902
1045
  }
903
- function yt(s, e = [], n) {
904
- const t = s[0];
905
- if (t === void 0)
1046
+ function At(s, e = [], t) {
1047
+ const n = s[0];
1048
+ if (n === void 0)
906
1049
  return "unknown package";
907
- const o = _(t);
1050
+ const o = X(n);
908
1051
  if (o !== void 0)
909
1052
  return o;
910
- const r = e.find(({ root: a }) => L(t, a));
1053
+ const r = e.find(({ root: g }) => M(n, g));
911
1054
  if (r !== void 0)
912
1055
  return r.name;
913
- const i = D.dirname(M(t)), d = ue(D.dirname(t), i);
1056
+ const i = $.dirname(I(n)), d = fe($.dirname(n), i);
914
1057
  if (d !== i)
915
1058
  return d;
916
- if (n === void 0)
1059
+ if (t === void 0)
917
1060
  return i;
918
- const p = D.relative(n, t).split("/"), f = p.findIndex((a) => a !== "..");
919
- return f < 1 ? D.dirname(M(t)) : p.slice(0, f * 2).join("/");
1061
+ const c = $.relative(t, n).split("/"), f = c.findIndex((g) => g !== "..");
1062
+ return f < 1 ? $.dirname(I(n)) : c.slice(0, f * 2).join("/");
920
1063
  }
921
1064
  export {
922
- Rt as auditDeprecatedUsages,
923
- dt as collectDeprecatedApiUsages,
924
- yt as getDeprecationOriginLabel,
925
- _ as getNodeModulesPackageName,
926
- G as shouldIncludeDeprecation
1065
+ Kt as auditDeprecatedUsages,
1066
+ yt as collectDeprecatedApiUsages,
1067
+ At as getDeprecationOriginLabel,
1068
+ X as getNodeModulesPackageName,
1069
+ _ as shouldIncludeDeprecation
927
1070
  };