@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.
@@ -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 u from "typescript";
2
- import { findPath as v, asyncFindPath as y } from "@arcgis/node-toolkit/file";
3
- import { path as d } from "@arcgis/node-toolkit/path";
4
- import { retrievePackageJson as k, asyncRetrievePackageJson as x } from "@arcgis/node-toolkit/packageJson";
5
- import { log as w } from "@arcgis/toolkit/log";
6
- import { realpath as g, readFile as S } from "node:fs/promises";
7
- import { f as D } from "./log.js";
8
- import { b as P } from "./cli.js";
9
- function L(e) {
10
- return typeof e == "string" ? e : e.map((t) => t.kind === u.SyntaxKind.JSDocText ? t.text : J(t.getText())).join("");
11
- }
12
- function $(e) {
13
- return e === void 0 ? void 0 : b(u.displayPartsToString([...e]));
14
- }
15
- function b(e) {
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
- (t, n) => h(n)
18
+ (n, t) => w(t)
19
19
  );
20
20
  }
21
- function J(e) {
22
- const t = /^\{@link(?:code|plain)?\s+([\s\S]*?)\}$/u.exec(e)?.[1];
23
- return t === void 0 ? e : h(t);
24
- }
25
- function h(e) {
26
- const t = e.trim().replace(/^(\S+)\s+([/:#!.])/u, "$1$2"), n = t.indexOf("|");
27
- if (n !== -1)
28
- return t.slice(n + 1).trim() || t.slice(0, n).trim();
29
- const [i, ...s] = t.split(/\s+/u);
30
- return s.join(" ") || i;
31
- }
32
- function R(e, t) {
33
- const n = v("package.json", e);
34
- return n === void 0 ? t : k(d.dirname(n)).name ?? t;
35
- }
36
- const m = {
37
- excludedPackageNames: /* @__PURE__ */ new Set([
38
- "@arcgis/charts-components-react",
39
- "@arcgis/coding-components-react",
40
- "@arcgis/components-build-utils",
41
- "@arcgis/map-components-react",
42
- "@arcgis/portal-components-react",
43
- "@arcgis-test/lit-components-react"
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: ["getReactWrapperOptions"],
47
- ignoredDeprecationsByIncludes: ["React wrappers are not needed in React 19 or above"]
50
+ ignoreDeprecatedApis: [],
51
+ ignoredDeprecationsByIncludes: []
48
52
  };
49
- function U(e) {
50
- return e !== void 0 && m.excludedPackageNames.has(e);
51
- }
52
- function A(e) {
53
- return m.excludedDefinitionPathFragments.some(
54
- (t) => e.includes(t)
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 z(e, t) {
58
- return m.ignoreDeprecatedApis.some((n) => n === e) || t != null && m.ignoredDeprecationsByIncludes.some((n) => t.includes(n));
59
- }
60
- function N(e, t, n) {
61
- const i = JSON.parse(e), s = { definitions: [], components: /* @__PURE__ */ new Set() };
62
- for (const o of i.modules)
63
- for (const a of o.declarations ?? []) {
64
- let r = function(p, f, c) {
65
- c !== !0 && typeof c != "string" || s.definitions.push({
66
- package: n,
67
- module: o.path,
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: f,
70
- memberOf: f === "element" ? void 0 : l,
115
+ kind: m,
116
+ memberOf: m === "element" ? void 0 : l,
71
117
  provenance: "manifest",
72
- reason: typeof c == "string" ? c : void 0,
73
- sourceFileName: t,
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 a) || a.tagName === void 0)
124
+ if (!("tagName" in o) || o.tagName === void 0)
79
125
  continue;
80
- const l = a.tagName;
81
- s.components.add(l), r(l, "element", a.deprecated);
82
- for (const [p, f] of [
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 c of a[p] ?? [])
90
- p === "slots" && c.name === "" || r(c.name, f, c.deprecated);
135
+ for (const d of o[p] ?? [])
136
+ p === "slots" && d.name === "" || c(d.name, m, d.deprecated);
91
137
  }
92
- return s;
138
+ return a;
93
139
  }
94
- function _(e) {
95
- const t = e.flatMap((o) => o.definitions), n = /* @__PURE__ */ new Map();
96
- for (const o of e)
97
- for (const a of o.components) {
98
- const r = n.get(a) ?? [];
99
- r.push(o), n.set(a, r);
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(), s = Map.groupBy(
102
- t.filter(({ kind: o }) => o === "css-property"),
103
- ({ name: o }) => o
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 [o, a] of s)
106
- new Set(a.map((r) => r.package)).size === 1 && i.set(o, a[0]);
107
- return { hasDeprecatedApis: t.length > 0, components: n, cssVariables: i };
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 K(e = "warn", t) {
110
- const n = /* @__PURE__ */ new Map();
155
+ function H(e = "warn", n) {
156
+ const t = /* @__PURE__ */ new Map();
111
157
  return async (i) => {
112
- const s = await g(i);
113
- let o = n.get(s);
114
- return o === void 0 && (o = j(s).catch((a) => {
115
- if (t?.(), e === "throw")
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 ${s}. Build the package before auditing definitions.`,
118
- { cause: a }
163
+ `Unable to read component manifest for ${a}. Build the package before auditing definitions.`,
164
+ { cause: o }
119
165
  );
120
- w("warn", D(s), `Unable to read component manifest: ${String(a)}`);
121
- }), n.set(s, o)), await o;
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 V(e, t, n) {
125
- const i = /* @__PURE__ */ new Set([
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
- [...i].filter((o) => o !== e.contents.name && (!n || P(o))).map(async (o) => {
132
- const a = await y(
133
- d.join("node_modules", o, "package.json"),
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 j(e) {
142
- const t = d.dirname(e), n = await x(t), i = typeof n.customElements == "string" ? n.customElements : n.customElements?.[0];
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 s = await g(d.resolve(t, i));
146
- return N(await S(s, "utf8"), s, n.name);
188
+ const a = await h(r.resolve(n, i));
189
+ return $(await b(a, "utf8"), a, t.name);
147
190
  }
148
191
  export {
149
- z as a,
150
- K as b,
151
- _ as c,
152
- L as d,
153
- $ as e,
154
- A as f,
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
- V as l,
157
- U as s
199
+ A as h,
200
+ V as i,
201
+ Q as l,
202
+ K as s
158
203
  };
@@ -1,68 +1,68 @@
1
- import { h as R, k as d, l as D, m as b, d as h } from "./cli.js";
2
- import { g as v, i as B, b as $, d as K } from "./classification.js";
3
- import { markdownTextLimit as k, splitMarkdown as O } from "@arcgis/node-toolkit/markdown";
4
- const y = `<!-- ${d} -->`, X = `<!-- ${d}`;
5
- function Y(e) {
6
- const t = M(e, e.findings);
7
- return `${t.summary.trim().replace(/^### /u, "## ")}
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
- ${t.details}`;
9
+ ${e.details}`;
10
10
  }
11
- function Z(e) {
12
- const t = /* @__PURE__ */ new Map();
13
- for (const n of e.findings) {
14
- const s = f(n.codeowners), r = s.join(","), o = t.get(r) ?? [];
15
- o.push({ ...n, codeowners: s }), t.set(r, o);
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 [...t.entries()].map(([n, s]) => {
18
- const r = n === "" ? [] : n.split(","), o = L(e, s);
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: R[e.auditKind],
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: _(o, k, G(r))
24
+ chunks: _(t, y, G(r))
25
25
  };
26
- }).sort((n, s) => n.title.localeCompare(s.title));
26
+ }).sort((o, s) => o.owners.join(",").localeCompare(s.owners.join(",")));
27
27
  }
28
- function L(e, t) {
29
- const n = f(t.flatMap((r) => r.codeowners)).filter(
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 = n.length === 0 ? "" : `
31
+ ), s = o.length === 0 ? "" : `
32
32
 
33
- CODEOWNERS: ${n.join(", ")}`;
34
- return U(e, t, s);
33
+ CODEOWNERS: ${o.join(", ")}`;
34
+ return U(n, e, s);
35
35
  }
36
- function U(e, t, n) {
37
- const s = D[e.auditKind], r = M(e, t);
38
- return `${s}${n}${r.summary}
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
- ${b}
40
+ ${v}
41
41
 
42
42
  ${r.details}`;
43
43
  }
44
- function M(e, t) {
45
- return e.auditKind === "usages" ? z(e, t) : E(e, t);
44
+ function j(n, e) {
45
+ return n.auditKind === "usages" ? z(n, e) : E(n, e);
46
46
  }
47
- function z(e, t) {
48
- const n = x(t, "usages"), s = v(t, (a) => a), r = s.map(({ categoryName: a, count: c, packages: m }) => {
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 `- **${h[a].label}**: ${c}
51
+ return `- **${w[a].label}**: ${c}
52
52
  ${u}`;
53
53
  }).join(`
54
- `), o = s.map(({ categoryName: a, count: c, packages: m }) => {
55
- const u = m.map(({ displayName: l, count: S, apis: A }) => {
56
- const C = A.flatMap(
57
- ({ items: P }) => I(e, P, "usages", n)
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} (${S})
59
+ return `#### ${l} (${A})
60
60
 
61
- ${C.join(`
61
+ ${P.join(`
62
62
  `)}`;
63
63
  }).join(`
64
64
 
65
- `), p = h[a], i = "description" in 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
- ${o}`
82
+ ${t}`
83
83
  };
84
84
  }
85
- function x(e, t) {
86
- const n = /* @__PURE__ */ new Map();
87
- for (const s of e) {
88
- const r = $(s), o = n.get(r) ?? /* @__PURE__ */ new Set();
89
- o.add(`${s.package}\0${j(t, s)}`), n.set(r, o);
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([...n].filter(([, s]) => s.size > 1).map(([s]) => s));
91
+ return new Set([...o].filter(([, s]) => s.size > 1).map(([s]) => s));
92
92
  }
93
- function E(e, t) {
94
- const n = x(t, "definitions");
93
+ function E(n, e) {
94
+ const o = x(e, "definitions");
95
95
  return { summary: "", details: [...Map.groupBy(
96
- t,
97
- (o) => B(o.package, o.module ?? g("definitions", o))
98
- ).entries()].sort(([o], [a]) => o.localeCompare(a)).map(([o, a]) => {
99
- const c = I(e, a, "definitions", n);
100
- return `#### ${o}'s deprecations
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(e, t, n, s) {
109
- const r = [...Map.groupBy(t, (o) => j(n, o))];
110
- return n === "definitions" && r.sort(([o], [a]) => o.localeCompare(a)), r.map(([, o]) => {
111
- const a = $(o[0]), c = g(n, o[0]), m = c !== void 0 && s.has(a) ? `${c} ${a}` : a, u = T(o);
112
- return n === "usages" && u.sort((p, i) => p.localeCompare(i)), N(e, m, u, o, n);
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(e, t, n, s, r) {
116
- const o = n.length === 0 ? "" : ` - ${n.map(q).join(" ")}`, a = [
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(e.repository, e.ref, i.file, i.line))
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 `- [ ] \`${t}\`${K(m)}${p}${o}${c === "" ? "" : `
128
+ return `- [ ] \`${e}\`${k(m)}${p}${t}${c === "" ? "" : `
129
129
  ${c}`}`;
130
130
  }
131
- function T(e) {
131
+ function T(n) {
132
132
  return [
133
133
  ...new Set(
134
- e.map(({ deprecated: t }) => t).filter((t) => typeof t == "string" && t !== "")
134
+ n.map(({ deprecated: e }) => e).filter((e) => typeof e == "string" && e !== "")
135
135
  )
136
136
  ];
137
137
  }
138
- function _(e, t = k, n = y) {
139
- const s = `${n}
140
- `, r = t - s.length;
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(e, r).map((o) => s + o);
143
+ return O(n, r).map((t) => s + t);
144
144
  }
145
- function G(e) {
146
- return e.length === 0 ? y : `<!-- ${d} ${f(e).join(",")} -->`;
145
+ function G(n) {
146
+ return n.length === 0 ? M : `<!-- ${d} ${f(n).join(",")} -->`;
147
147
  }
148
- function f(e) {
149
- return [...new Set(e)].sort((t, n) => t.localeCompare(n));
148
+ function f(n) {
149
+ return [...new Set(n)].sort((e, o) => e.localeCompare(o));
150
150
  }
151
- function j(e, t) {
152
- return `${$(t)}\0${g(e, t) ?? ""}`;
151
+ function S(n, e) {
152
+ return `${$(e)}${k(e.kind)}\0${g(n, e) ?? ""}`;
153
153
  }
154
- function g(e, t) {
155
- return e === "definitions" && t.provenance !== "manifest" ? W(t.file) : t.module;
154
+ function g(n, e) {
155
+ return n === "definitions" && e.provenance !== "manifest" ? W(e.file) : e.module;
156
156
  }
157
- function W(e) {
158
- const t = "/src/", n = "/dist/", s = e.lastIndexOf(t), r = e.lastIndexOf(n), o = Math.max(s, r), a = r > s ? n : t;
159
- return (o === -1 ? e : e.slice(o + a.length)).replace(/\.(?:d\.)?(?:[cm]?ts|tsx)$/u, "");
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(e) {
162
- const t = [], n = (o) => `\0${t.push(o) - 1}\0`, r = e.replaceAll(`\r
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
- (o, a, c) => n(`[${w(a)}](${c})`)
168
- ).replace(/https?:\/\/[^\s<>()]+/gu, (o) => {
169
- const a = /[.,;:!?]+$/u.exec(o)?.[0] ?? "";
170
- return `${n(o.slice(0, -a.length || void 0))}${a}`;
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 w(r).replace(/\0(\d+)\0/gu, (o, a) => t[Number(a)]).replaceAll(`
172
+ return h(r).replace(/\0(\d+)\0/gu, (t, a) => e[Number(a)]).replaceAll(`
173
173
  `, `
174
174
  `);
175
175
  }
176
- function w(e) {
177
- return e.replace(/^(\s*)(#{1,6})(?=\s)/gmu, "$1\\$2").replace(/#(?=\d)/gu, "# ");
176
+ function h(n) {
177
+ return n.replace(/^(\s*)(#{1,6})(?=\s)/gmu, "$1\\$2").replace(/#(?=\d)/gu, "# ");
178
178
  }
179
- function H(e, t, n, s) {
180
- const r = t.split("/").map(encodeURIComponent).join("/"), o = n.split("/").map(encodeURIComponent).join("/");
181
- return `https://${e}/blob/${r}/${o}#L${s}`;
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
- y as a,
184
+ M as a,
185
185
  Z as c,
186
186
  Y as f,
187
187
  X as i