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