@arcgis/codemod 6.0.0-next.12 → 6.0.0-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/artifact.js +36 -32
- package/dist/chunks/classification.js +83 -69
- package/dist/chunks/cli.js +237 -207
- package/dist/chunks/codemod5.js +0 -1
- package/dist/chunks/componentAudit.js +156 -111
- package/dist/chunks/format.js +92 -92
- package/dist/chunks/index.js +703 -465
- package/dist/chunks/index2.js +13 -13
- package/dist/chunks/index3.js +240 -205
- package/dist/chunks/useProjectInstance.js +18 -15
- package/package.json +5 -4
package/dist/chunks/codemod5.js
CHANGED
|
@@ -46,7 +46,6 @@ const p = "@arcgis/components-build-utils", v = {
|
|
|
46
46
|
asyncFindPath: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
47
47
|
createFileIfNotExists: { do: "rename", specifier: "@arcgis/node-toolkit/file" },
|
|
48
48
|
gitIgnoreFileToGlobs: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
49
|
-
gitIgnoreToGlob: { do: "rename", specifier: "@arcgis/node-toolkit/glob" },
|
|
50
49
|
isPosix: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
51
50
|
toPosixPathSeparators: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
52
51
|
normalizePath: { do: "rename", specifier: "@arcgis/node-toolkit/path" },
|
|
@@ -1,158 +1,203 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { findPath as v, asyncFindPath as
|
|
3
|
-
import { path as
|
|
4
|
-
import { retrievePackageJson as k, asyncRetrievePackageJson as
|
|
5
|
-
import { log as
|
|
6
|
-
import { realpath as
|
|
7
|
-
import { f as
|
|
8
|
-
import { b as
|
|
9
|
-
function
|
|
10
|
-
return typeof e == "string" ? e : e.map((
|
|
11
|
-
}
|
|
12
|
-
function
|
|
13
|
-
return e === void 0 ? void 0 :
|
|
14
|
-
}
|
|
15
|
-
function
|
|
1
|
+
import g from "typescript";
|
|
2
|
+
import { findPath as v, asyncFindPath as x } from "@arcgis/node-toolkit/file";
|
|
3
|
+
import { path as r } from "@arcgis/node-toolkit/path";
|
|
4
|
+
import { retrievePackageJson as k, asyncRetrievePackageJson as D } from "@arcgis/node-toolkit/packageJson";
|
|
5
|
+
import { log as S } from "@arcgis/toolkit/log";
|
|
6
|
+
import { realpath as h, readFile as b } from "node:fs/promises";
|
|
7
|
+
import { f as P } from "./log.js";
|
|
8
|
+
import { b as j } from "./cli.js";
|
|
9
|
+
function _(e) {
|
|
10
|
+
return typeof e == "string" ? e : e.map((n) => n.kind === g.SyntaxKind.JSDocText ? n.text : M(n.getText())).join("");
|
|
11
|
+
}
|
|
12
|
+
function A(e) {
|
|
13
|
+
return e === void 0 ? void 0 : E(g.displayPartsToString([...e]));
|
|
14
|
+
}
|
|
15
|
+
function E(e) {
|
|
16
16
|
return e.replace(
|
|
17
17
|
/\{@link(?:code|plain)?\s+([\s\S]*?)\}/gu,
|
|
18
|
-
(
|
|
18
|
+
(n, t) => w(t)
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
29
|
-
const [i, ...
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
"@arcgis/
|
|
39
|
-
"@arcgis/
|
|
40
|
-
"@arcgis/
|
|
41
|
-
"@arcgis/map-components-
|
|
42
|
-
"@arcgis/
|
|
43
|
-
"@
|
|
21
|
+
function M(e) {
|
|
22
|
+
const n = /^\{@link(?:code|plain)?\s+([\s\S]*?)\}$/u.exec(e)?.[1];
|
|
23
|
+
return n === void 0 ? e : w(n);
|
|
24
|
+
}
|
|
25
|
+
function w(e) {
|
|
26
|
+
const n = e.trim().replace(/^(\S+)\s+([/:#!.])/u, "$1$2"), t = n.indexOf("|");
|
|
27
|
+
if (t !== -1)
|
|
28
|
+
return n.slice(t + 1).trim() || n.slice(0, t).trim();
|
|
29
|
+
const [i, ...a] = n.split(/\s+/u);
|
|
30
|
+
return a.join(" ") || i;
|
|
31
|
+
}
|
|
32
|
+
function z(e, n) {
|
|
33
|
+
const t = v("package.json", e);
|
|
34
|
+
return t === void 0 ? n : k(r.dirname(t)).name ?? n;
|
|
35
|
+
}
|
|
36
|
+
const f = {
|
|
37
|
+
docsLegacyDependencyLocations: /* @__PURE__ */ new Map([
|
|
38
|
+
["@arcgis/coding-components", "packages/coding-packages/coding-components"],
|
|
39
|
+
["@arcgis/core", "packages/core-packages/core/output/npm/esm"],
|
|
40
|
+
["@arcgis/lumina", "packages/support-packages/lit"],
|
|
41
|
+
["@arcgis/map-components", "packages/map-packages/map-components"],
|
|
42
|
+
["@arcgis/toolkit", "packages/support-packages/toolkit"],
|
|
43
|
+
["@esri/calcite-components", "packages/map-packages/map-components/node_modules/@esri/calcite-components"],
|
|
44
|
+
["@esri/calcite-components-react", "packages/docs/app/node_modules/@esri/calcite-components-react"],
|
|
45
|
+
["monaco-editor", "packages/docs/app/node_modules/monaco-editor"]
|
|
44
46
|
]),
|
|
47
|
+
excludedPackageNames: /* @__PURE__ */ new Set(["@arcgis/components-build-utils"]),
|
|
48
|
+
excludedPathFragments: ["/.astro/"],
|
|
45
49
|
excludedDefinitionPathFragments: ["test-package", "packages/docs/lumina-code-samples/", "packages/starter-packages/"],
|
|
46
|
-
ignoreDeprecatedApis: [
|
|
47
|
-
ignoredDeprecationsByIncludes: [
|
|
50
|
+
ignoreDeprecatedApis: [],
|
|
51
|
+
ignoredDeprecationsByIncludes: []
|
|
48
52
|
};
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
function R(e) {
|
|
54
|
+
const n = /* @__PURE__ */ new Map(), t = {};
|
|
55
|
+
if (e?.contents.name !== "@webgis/docs")
|
|
56
|
+
return { packages: n, paths: t };
|
|
57
|
+
const i = r.dirname(e.filePath), a = r.resolve(i, "../../..");
|
|
58
|
+
if (r.relative(a, i) !== "packages/docs/app" || !g.sys.fileExists(r.join(a, "pnpm-workspace.yaml")))
|
|
59
|
+
return { packages: n, paths: t };
|
|
60
|
+
const s = new Set(
|
|
61
|
+
Object.entries({
|
|
62
|
+
...e.contents.dependencies,
|
|
63
|
+
...e.contents.devDependencies,
|
|
64
|
+
...e.contents.peerDependencies,
|
|
65
|
+
...e.contents.optionalDependencies
|
|
66
|
+
}).filter(([, o]) => o === "catalog:legacyStarshipDeps").map(([o]) => o)
|
|
55
67
|
);
|
|
68
|
+
if (s.size === 0)
|
|
69
|
+
throw Error(
|
|
70
|
+
"Didn't find any catalog:legacyStarshipDeps in @webgis/docs. Update special handling in @arcgis/codemod"
|
|
71
|
+
);
|
|
72
|
+
for (const o of s) {
|
|
73
|
+
const c = f.docsLegacyDependencyLocations.get(o);
|
|
74
|
+
if (c === void 0)
|
|
75
|
+
throw new Error(
|
|
76
|
+
`Unmapped legacy dependency ${o} in @webgis/docs. Update special handling in @arcgis/codemod.`
|
|
77
|
+
);
|
|
78
|
+
const l = r.join(a, c), p = r.join(l, "package.json");
|
|
79
|
+
if (!g.sys.fileExists(p))
|
|
80
|
+
throw new Error(
|
|
81
|
+
`Missing audit dependency ${o} at ${p}. Install dependencies and build workspace packages before auditing usages.`
|
|
82
|
+
);
|
|
83
|
+
const m = k(l);
|
|
84
|
+
n.set(o, p);
|
|
85
|
+
for (const [d, u] of Object.entries(
|
|
86
|
+
m.exports ?? { ".": m.types ?? "./index.d.ts", "./*": "./*" }
|
|
87
|
+
)) {
|
|
88
|
+
const y = typeof u == "string" ? u : u.types;
|
|
89
|
+
y !== void 0 && (t[d === "." ? o : `${o}/${d.slice(2)}`] = [r.resolve(l, y)]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return { packages: n, paths: t };
|
|
93
|
+
}
|
|
94
|
+
function K(e) {
|
|
95
|
+
return e !== void 0 && f.excludedPackageNames.has(e);
|
|
96
|
+
}
|
|
97
|
+
function N(e) {
|
|
98
|
+
return f.excludedPathFragments.some((n) => `/${e}`.includes(n));
|
|
56
99
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
100
|
+
function V(e) {
|
|
101
|
+
return N(e) || f.excludedDefinitionPathFragments.some((n) => e.includes(n));
|
|
102
|
+
}
|
|
103
|
+
function q(e, n) {
|
|
104
|
+
return f.ignoreDeprecatedApis.some((t) => t === e) || n != null && f.ignoredDeprecationsByIncludes.some((t) => n.includes(t));
|
|
105
|
+
}
|
|
106
|
+
function $(e, n, t) {
|
|
107
|
+
const i = JSON.parse(e), a = { definitions: [], components: /* @__PURE__ */ new Set() };
|
|
108
|
+
for (const s of i.modules)
|
|
109
|
+
for (const o of s.declarations ?? []) {
|
|
110
|
+
let c = function(p, m, d) {
|
|
111
|
+
d !== !0 && typeof d != "string" || a.definitions.push({
|
|
112
|
+
package: t,
|
|
113
|
+
module: s.path,
|
|
68
114
|
name: p,
|
|
69
|
-
kind:
|
|
70
|
-
memberOf:
|
|
115
|
+
kind: m,
|
|
116
|
+
memberOf: m === "element" ? void 0 : l,
|
|
71
117
|
provenance: "manifest",
|
|
72
|
-
reason: typeof
|
|
73
|
-
sourceFileName:
|
|
118
|
+
reason: typeof d == "string" ? d : void 0,
|
|
119
|
+
sourceFileName: n,
|
|
74
120
|
line: 1,
|
|
75
121
|
column: 1
|
|
76
122
|
});
|
|
77
123
|
};
|
|
78
|
-
if (!("tagName" in
|
|
124
|
+
if (!("tagName" in o) || o.tagName === void 0)
|
|
79
125
|
continue;
|
|
80
|
-
const l =
|
|
81
|
-
|
|
82
|
-
for (const [p,
|
|
126
|
+
const l = o.tagName;
|
|
127
|
+
a.components.add(l), c(l, "element", o.deprecated);
|
|
128
|
+
for (const [p, m] of [
|
|
83
129
|
["cssProperties", "css-property"],
|
|
84
130
|
["cssParts", "css-part"],
|
|
85
131
|
["cssStates", "css-state"],
|
|
86
132
|
["slots", "slot"],
|
|
87
133
|
["attributes", "attribute"]
|
|
88
134
|
])
|
|
89
|
-
for (const
|
|
90
|
-
p === "slots" &&
|
|
135
|
+
for (const d of o[p] ?? [])
|
|
136
|
+
p === "slots" && d.name === "" || c(d.name, m, d.deprecated);
|
|
91
137
|
}
|
|
92
|
-
return
|
|
138
|
+
return a;
|
|
93
139
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
96
|
-
for (const
|
|
97
|
-
for (const
|
|
98
|
-
const
|
|
99
|
-
|
|
140
|
+
function G(e) {
|
|
141
|
+
const n = e.flatMap((s) => s.definitions), t = /* @__PURE__ */ new Map();
|
|
142
|
+
for (const s of e)
|
|
143
|
+
for (const o of s.components) {
|
|
144
|
+
const c = t.get(o) ?? [];
|
|
145
|
+
c.push(s), t.set(o, c);
|
|
100
146
|
}
|
|
101
|
-
const i = /* @__PURE__ */ new Map(),
|
|
102
|
-
|
|
103
|
-
({ name:
|
|
147
|
+
const i = /* @__PURE__ */ new Map(), a = Map.groupBy(
|
|
148
|
+
n.filter(({ kind: s }) => s === "css-property"),
|
|
149
|
+
({ name: s }) => s
|
|
104
150
|
);
|
|
105
|
-
for (const [
|
|
106
|
-
new Set(
|
|
107
|
-
return { hasDeprecatedApis:
|
|
151
|
+
for (const [s, o] of a)
|
|
152
|
+
new Set(o.map((c) => c.package)).size === 1 && i.set(s, o[0]);
|
|
153
|
+
return { hasDeprecatedApis: n.length > 0, components: t, cssVariables: i };
|
|
108
154
|
}
|
|
109
|
-
function
|
|
110
|
-
const
|
|
155
|
+
function H(e = "warn", n) {
|
|
156
|
+
const t = /* @__PURE__ */ new Map();
|
|
111
157
|
return async (i) => {
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
return
|
|
115
|
-
if (
|
|
158
|
+
const a = await h(i);
|
|
159
|
+
let s = t.get(a);
|
|
160
|
+
return s === void 0 && (s = O(a).catch((o) => {
|
|
161
|
+
if (n?.(), e === "throw")
|
|
116
162
|
throw new Error(
|
|
117
|
-
`Unable to read component manifest for ${
|
|
118
|
-
{ cause:
|
|
163
|
+
`Unable to read component manifest for ${a}. Build the package before auditing definitions.`,
|
|
164
|
+
{ cause: o }
|
|
119
165
|
);
|
|
120
|
-
|
|
121
|
-
}),
|
|
166
|
+
S("warn", P(a), `Unable to read component manifest: ${String(o)}`);
|
|
167
|
+
}), t.set(a, s)), await s;
|
|
122
168
|
};
|
|
123
169
|
}
|
|
124
|
-
async function
|
|
125
|
-
const
|
|
170
|
+
async function Q(e, n, t, i) {
|
|
171
|
+
const a = /* @__PURE__ */ new Set([
|
|
126
172
|
...Object.keys(e.contents.dependencies ?? {}),
|
|
127
173
|
...Object.keys(e.contents.devDependencies ?? {}),
|
|
128
174
|
...Object.keys(e.contents.peerDependencies ?? {}),
|
|
129
175
|
...Object.keys(e.contents.optionalDependencies ?? {})
|
|
130
176
|
]), s = await Promise.all(
|
|
131
|
-
[...
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
d.dirname(e.filePath)
|
|
135
|
-
);
|
|
136
|
-
return a === void 0 ? void 0 : await t(a);
|
|
177
|
+
[...a].filter((o) => o !== e.contents.name && (!t || j(o))).map(async (o) => {
|
|
178
|
+
const c = i?.get(o) ?? await x(r.join("node_modules", o, "package.json"), r.dirname(e.filePath));
|
|
179
|
+
return c === void 0 ? void 0 : await n(c);
|
|
137
180
|
})
|
|
138
181
|
);
|
|
139
182
|
return [...new Set(s.filter((o) => o !== void 0))];
|
|
140
183
|
}
|
|
141
|
-
async function
|
|
142
|
-
const
|
|
184
|
+
async function O(e) {
|
|
185
|
+
const n = r.dirname(e), t = await D(n), i = typeof t.customElements == "string" ? t.customElements : t.customElements?.[0];
|
|
143
186
|
if (i === void 0)
|
|
144
187
|
return;
|
|
145
|
-
const
|
|
146
|
-
return
|
|
188
|
+
const a = await h(r.resolve(n, i));
|
|
189
|
+
return $(await b(a, "utf8"), a, t.name);
|
|
147
190
|
}
|
|
148
191
|
export {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
192
|
+
N as a,
|
|
193
|
+
q as b,
|
|
194
|
+
G as c,
|
|
195
|
+
z as d,
|
|
196
|
+
H as e,
|
|
197
|
+
_ as f,
|
|
155
198
|
R as g,
|
|
156
|
-
|
|
157
|
-
|
|
199
|
+
A as h,
|
|
200
|
+
V as i,
|
|
201
|
+
Q as l,
|
|
202
|
+
K as s
|
|
158
203
|
};
|
package/dist/chunks/format.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { g as
|
|
3
|
-
import { markdownTextLimit as
|
|
4
|
-
const
|
|
5
|
-
function Y(
|
|
6
|
-
const
|
|
7
|
-
return `${
|
|
1
|
+
import { h as D, k as d, l as b, m as v, d as w } from "./cli.js";
|
|
2
|
+
import { g as B, i as K, b as $, d as k } from "./classification.js";
|
|
3
|
+
import { markdownTextLimit as y, splitMarkdown as O } from "@arcgis/node-toolkit/markdown";
|
|
4
|
+
const M = `<!-- ${d} -->`, X = `<!-- ${d}`;
|
|
5
|
+
function Y(n) {
|
|
6
|
+
const e = j(n, n.findings);
|
|
7
|
+
return `${e.summary.trim().replace(/^### /u, "## ")}
|
|
8
8
|
|
|
9
|
-
${
|
|
9
|
+
${e.details}`;
|
|
10
10
|
}
|
|
11
|
-
function Z(
|
|
12
|
-
const
|
|
13
|
-
for (const
|
|
14
|
-
const s = f(
|
|
15
|
-
|
|
11
|
+
function Z(n) {
|
|
12
|
+
const e = /* @__PURE__ */ new Map();
|
|
13
|
+
for (const o of n.findings) {
|
|
14
|
+
const s = f(o.codeowners), r = s.join(","), t = e.get(r) ?? [];
|
|
15
|
+
t.push({ ...o, codeowners: s }), e.set(r, t);
|
|
16
16
|
}
|
|
17
|
-
return [...
|
|
18
|
-
const r =
|
|
17
|
+
return [...e.entries()].map(([o, s]) => {
|
|
18
|
+
const r = o === "" ? [] : o.split(","), t = L(n, s);
|
|
19
19
|
return {
|
|
20
20
|
changes: [],
|
|
21
|
-
title:
|
|
21
|
+
title: D[n.auditKind],
|
|
22
22
|
owners: r,
|
|
23
23
|
assignees: r.filter((a) => /^@[^/@\s]+$/u.test(a)).map((a) => a.slice(1)),
|
|
24
|
-
chunks: _(
|
|
24
|
+
chunks: _(t, y, G(r))
|
|
25
25
|
};
|
|
26
|
-
}).sort((
|
|
26
|
+
}).sort((o, s) => o.owners.join(",").localeCompare(s.owners.join(",")));
|
|
27
27
|
}
|
|
28
|
-
function L(
|
|
29
|
-
const
|
|
28
|
+
function L(n, e) {
|
|
29
|
+
const o = f(e.flatMap((r) => r.codeowners)).filter(
|
|
30
30
|
(r) => /^@[^/@\s]+\/[^@\s]+$/u.test(r)
|
|
31
|
-
), s =
|
|
31
|
+
), s = o.length === 0 ? "" : `
|
|
32
32
|
|
|
33
|
-
CODEOWNERS: ${
|
|
34
|
-
return U(
|
|
33
|
+
CODEOWNERS: ${o.join(", ")}`;
|
|
34
|
+
return U(n, e, s);
|
|
35
35
|
}
|
|
36
|
-
function U(
|
|
37
|
-
const s =
|
|
38
|
-
return `${s}${
|
|
36
|
+
function U(n, e, o) {
|
|
37
|
+
const s = b[n.auditKind], r = j(n, e);
|
|
38
|
+
return `${s}${o}${r.summary}
|
|
39
39
|
|
|
40
|
-
${
|
|
40
|
+
${v}
|
|
41
41
|
|
|
42
42
|
${r.details}`;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
44
|
+
function j(n, e) {
|
|
45
|
+
return n.auditKind === "usages" ? z(n, e) : E(n, e);
|
|
46
46
|
}
|
|
47
|
-
function z(
|
|
48
|
-
const
|
|
47
|
+
function z(n, e) {
|
|
48
|
+
const o = x(e, "usages"), s = B(e, (a) => a), r = s.map(({ categoryName: a, count: c, packages: m }) => {
|
|
49
49
|
const u = m.map(({ displayName: p, count: i }) => ` - \`${p}\`: ${i}`).join(`
|
|
50
50
|
`);
|
|
51
|
-
return `- **${
|
|
51
|
+
return `- **${w[a].label}**: ${c}
|
|
52
52
|
${u}`;
|
|
53
53
|
}).join(`
|
|
54
|
-
`),
|
|
55
|
-
const u = m.map(({ displayName: l, count:
|
|
56
|
-
const
|
|
57
|
-
({ items:
|
|
54
|
+
`), t = s.map(({ categoryName: a, count: c, packages: m }) => {
|
|
55
|
+
const u = m.map(({ displayName: l, count: A, apis: C }) => {
|
|
56
|
+
const P = C.flatMap(
|
|
57
|
+
({ items: R }) => I(n, R, "usages", o)
|
|
58
58
|
);
|
|
59
|
-
return `#### ${l} (${
|
|
59
|
+
return `#### ${l} (${A})
|
|
60
60
|
|
|
61
|
-
${
|
|
61
|
+
${P.join(`
|
|
62
62
|
`)}`;
|
|
63
63
|
}).join(`
|
|
64
64
|
|
|
65
|
-
`), p =
|
|
65
|
+
`), p = w[a], i = "description" in p ? `
|
|
66
66
|
|
|
67
67
|
${p.description}` : "";
|
|
68
68
|
return `### ${p.label} (${c})${i}
|
|
@@ -79,25 +79,25 @@ ${u}`;
|
|
|
79
79
|
${r}`,
|
|
80
80
|
details: `## Deprecation details
|
|
81
81
|
|
|
82
|
-
${
|
|
82
|
+
${t}`
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function x(
|
|
86
|
-
const
|
|
87
|
-
for (const s of
|
|
88
|
-
const r = $(s),
|
|
89
|
-
|
|
85
|
+
function x(n, e) {
|
|
86
|
+
const o = /* @__PURE__ */ new Map();
|
|
87
|
+
for (const s of n) {
|
|
88
|
+
const r = $(s), t = o.get(r) ?? /* @__PURE__ */ new Set();
|
|
89
|
+
t.add(`${s.package}\0${S(e, s)}`), o.set(r, t);
|
|
90
90
|
}
|
|
91
|
-
return new Set([...
|
|
91
|
+
return new Set([...o].filter(([, s]) => s.size > 1).map(([s]) => s));
|
|
92
92
|
}
|
|
93
|
-
function E(
|
|
94
|
-
const
|
|
93
|
+
function E(n, e) {
|
|
94
|
+
const o = x(e, "definitions");
|
|
95
95
|
return { summary: "", details: [...Map.groupBy(
|
|
96
|
-
|
|
97
|
-
(
|
|
98
|
-
).entries()].sort(([
|
|
99
|
-
const c = I(
|
|
100
|
-
return `#### ${
|
|
96
|
+
e,
|
|
97
|
+
(t) => K(t.package, t.module ?? g("definitions", t))
|
|
98
|
+
).entries()].sort(([t], [a]) => t.localeCompare(a)).map(([t, a]) => {
|
|
99
|
+
const c = I(n, a, "definitions", o);
|
|
100
|
+
return `#### ${t}'s deprecations
|
|
101
101
|
|
|
102
102
|
${c.join(`
|
|
103
103
|
`)}`;
|
|
@@ -105,17 +105,17 @@ ${c.join(`
|
|
|
105
105
|
|
|
106
106
|
`) };
|
|
107
107
|
}
|
|
108
|
-
function I(
|
|
109
|
-
const r = [...Map.groupBy(
|
|
110
|
-
return
|
|
111
|
-
const a = $(
|
|
112
|
-
return
|
|
108
|
+
function I(n, e, o, s) {
|
|
109
|
+
const r = [...Map.groupBy(e, (t) => S(o, t))];
|
|
110
|
+
return r.sort(([t], [a]) => t.localeCompare(a)), r.map(([, t]) => {
|
|
111
|
+
const a = $(t[0]), c = g(o, t[0]), m = c !== void 0 && s.has(a) ? `${c} ${a}` : a, u = T(t);
|
|
112
|
+
return u.sort((p, i) => p.localeCompare(i)), N(n, m, u, t, o);
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
function N(
|
|
116
|
-
const
|
|
115
|
+
function N(n, e, o, s, r) {
|
|
116
|
+
const t = o.length === 0 ? "" : ` - ${o.map(q).join(" ")}`, a = [
|
|
117
117
|
...new Set(
|
|
118
|
-
s.filter((i) => r === "usages" || i.provenance !== "manifest").toSorted((i, l) => i.file.localeCompare(l.file) || i.line - l.line).map((i) => H(
|
|
118
|
+
s.filter((i) => r === "usages" || i.provenance !== "manifest").toSorted((i, l) => i.file.localeCompare(l.file) || i.line - l.line).map((i) => H(n.repository, n.ref, i.file, i.line))
|
|
119
119
|
)
|
|
120
120
|
], c = a.length === 1 ? ` ${a[0]}` : a.map((i) => ` - ${i}`).join(`
|
|
121
121
|
`), m = s[0].kind, u = [
|
|
@@ -125,63 +125,63 @@ function N(e, t, n, s, r) {
|
|
|
125
125
|
).flatMap(({ memberOf: i }) => i === void 0 ? [] : [i])
|
|
126
126
|
)
|
|
127
127
|
].sort(), p = u.length === 0 ? "" : ` (components: ${u.map((i) => `\`<${i}>\``).join(", ")})`;
|
|
128
|
-
return `- [ ] \`${
|
|
128
|
+
return `- [ ] \`${e}\`${k(m)}${p}${t}${c === "" ? "" : `
|
|
129
129
|
${c}`}`;
|
|
130
130
|
}
|
|
131
|
-
function T(
|
|
131
|
+
function T(n) {
|
|
132
132
|
return [
|
|
133
133
|
...new Set(
|
|
134
|
-
|
|
134
|
+
n.map(({ deprecated: e }) => e).filter((e) => typeof e == "string" && e !== "")
|
|
135
135
|
)
|
|
136
136
|
];
|
|
137
137
|
}
|
|
138
|
-
function _(
|
|
139
|
-
const s = `${
|
|
140
|
-
`, r =
|
|
138
|
+
function _(n, e = y, o = M) {
|
|
139
|
+
const s = `${o}
|
|
140
|
+
`, r = e - s.length;
|
|
141
141
|
if (r < 1)
|
|
142
142
|
throw new Error("Issue content limit is too small for the managed marker.");
|
|
143
|
-
return O(
|
|
143
|
+
return O(n, r).map((t) => s + t);
|
|
144
144
|
}
|
|
145
|
-
function G(
|
|
146
|
-
return
|
|
145
|
+
function G(n) {
|
|
146
|
+
return n.length === 0 ? M : `<!-- ${d} ${f(n).join(",")} -->`;
|
|
147
147
|
}
|
|
148
|
-
function f(
|
|
149
|
-
return [...new Set(
|
|
148
|
+
function f(n) {
|
|
149
|
+
return [...new Set(n)].sort((e, o) => e.localeCompare(o));
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
return `${$(
|
|
151
|
+
function S(n, e) {
|
|
152
|
+
return `${$(e)}${k(e.kind)}\0${g(n, e) ?? ""}`;
|
|
153
153
|
}
|
|
154
|
-
function g(
|
|
155
|
-
return
|
|
154
|
+
function g(n, e) {
|
|
155
|
+
return n === "definitions" && e.provenance !== "manifest" ? W(e.file) : e.module;
|
|
156
156
|
}
|
|
157
|
-
function W(
|
|
158
|
-
const
|
|
159
|
-
return (
|
|
157
|
+
function W(n) {
|
|
158
|
+
const e = "/src/", o = "/dist/", s = n.lastIndexOf(e), r = n.lastIndexOf(o), t = Math.max(s, r), a = r > s ? o : e;
|
|
159
|
+
return (t === -1 ? n : n.slice(t + a.length)).replace(/\.(?:d\.)?(?:[cm]?ts|tsx)$/u, "");
|
|
160
160
|
}
|
|
161
|
-
function q(
|
|
162
|
-
const
|
|
161
|
+
function q(n) {
|
|
162
|
+
const e = [], o = (t) => `\0${e.push(t) - 1}\0`, r = n.replaceAll(`\r
|
|
163
163
|
`, `
|
|
164
164
|
`).replaceAll("\r", `
|
|
165
165
|
`).replace(
|
|
166
166
|
/\[([^\]\n]+)\]\((https?:\/\/(?:[^()\s]|\([^()\s]*\))+?)\)/gu,
|
|
167
|
-
(
|
|
168
|
-
).replace(/https?:\/\/[^\s<>()]+/gu, (
|
|
169
|
-
const a = /[.,;:!?]+$/u.exec(
|
|
170
|
-
return `${
|
|
167
|
+
(t, a, c) => o(`[${h(a)}](${c})`)
|
|
168
|
+
).replace(/https?:\/\/[^\s<>()]+/gu, (t) => {
|
|
169
|
+
const a = /[.,;:!?]+$/u.exec(t)?.[0] ?? "";
|
|
170
|
+
return `${o(t.slice(0, -a.length || void 0))}${a}`;
|
|
171
171
|
});
|
|
172
|
-
return
|
|
172
|
+
return h(r).replace(/\0(\d+)\0/gu, (t, a) => e[Number(a)]).replaceAll(`
|
|
173
173
|
`, `
|
|
174
174
|
`);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
return
|
|
176
|
+
function h(n) {
|
|
177
|
+
return n.replace(/^(\s*)(#{1,6})(?=\s)/gmu, "$1\\$2").replace(/#(?=\d)/gu, "# ");
|
|
178
178
|
}
|
|
179
|
-
function H(
|
|
180
|
-
const r =
|
|
181
|
-
return `https://${
|
|
179
|
+
function H(n, e, o, s) {
|
|
180
|
+
const r = e.split("/").map(encodeURIComponent).join("/"), t = o.split("/").map(encodeURIComponent).join("/");
|
|
181
|
+
return `https://${n}/blob/${r}/${t}#L${s}`;
|
|
182
182
|
}
|
|
183
183
|
export {
|
|
184
|
-
|
|
184
|
+
M as a,
|
|
185
185
|
Z as c,
|
|
186
186
|
Y as f,
|
|
187
187
|
X as i
|