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