@arcgis/api-extractor 5.1.0-next.2 → 5.1.0-next.21
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/{ApiExtractor-BAlbk5aI.js → ApiExtractor-CedoYImr.js} +6 -3
- package/dist/cli-7PX_wNxb.js +34 -0
- package/dist/cli.js +29 -10
- package/dist/diff/apiDiffToMarkdown.d.ts +9 -0
- package/dist/diff/apiDiffToMarkdown.js +140 -0
- package/dist/diff/diffApiJson.d.ts +4 -4
- package/dist/diff/diffApiJson.js +220 -97
- package/dist/diff/types.d.ts +3 -2
- package/dist/extractor/ApiExtractor.js +3 -3
- package/dist/extractor/config.js +2 -2
- package/dist/{typeScript-CWDJzPiS.js → typeScript-BDnFfwUK.js} +1 -1
- package/dist/vite/plugin.js +3 -3
- package/dist/vite/typeScript.js +1 -1
- package/dist/{worker-Dd5059jd.js → worker-D8J9SUI5.js} +424 -421
- package/package.json +7 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as H, a as se, e as Re, p as fe } from "./typeScript-
|
|
2
|
-
import { a as be, o as Me, t as Ge, b as De, c as Le, e as Oe, d as _, p as Ne, f as Be, i as me, g as We, h as Ue, j as ze, k as je, n as He, r as Je } from "./worker-
|
|
1
|
+
import { l as H, a as se, e as Re, p as fe } from "./typeScript-BDnFfwUK.js";
|
|
2
|
+
import { a as be, o as Me, t as Ge, b as De, c as Le, e as Oe, d as _, p as Ne, f as Be, i as me, g as We, h as Ue, j as ze, k as je, n as He, r as Je } from "./worker-D8J9SUI5.js";
|
|
3
3
|
import { getViewUrl as Ve, postProcessDeprecated as ee, postProcessDescription as G, postProcessDocsTags as V, resolveJsDocLink as Xe } from "./extractor/processing/links.js";
|
|
4
4
|
import E from "typescript";
|
|
5
5
|
import { path as N, toPosixPathSeparators as Ye } from "@arcgis/components-build-utils";
|
|
@@ -1734,7 +1734,10 @@ function xt(e, t) {
|
|
|
1734
1734
|
function he(e, t, i) {
|
|
1735
1735
|
if (e.package !== void 0)
|
|
1736
1736
|
return;
|
|
1737
|
-
const n = t.moduleMap.get(e.module)
|
|
1737
|
+
const n = t.moduleMap.get(e.module);
|
|
1738
|
+
if (n === void 0)
|
|
1739
|
+
return;
|
|
1740
|
+
const s = h(n), a = s.constructorPropertiesInterface;
|
|
1738
1741
|
if (a === void 0) {
|
|
1739
1742
|
const o = s.inheritance;
|
|
1740
1743
|
if (typeof o == "object" && o.hasSettableField) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { writeFile as r, readFile as d } from "node:fs/promises";
|
|
2
|
+
import { diffApiJson as m } from "./diff/diffApiJson.js";
|
|
3
|
+
async function k({
|
|
4
|
+
oldPath: t,
|
|
5
|
+
newPath: i,
|
|
6
|
+
outputPath: o,
|
|
7
|
+
docsUrlPrefix: e
|
|
8
|
+
}) {
|
|
9
|
+
const c = f(t), w = f(i), p = await c, l = await w, n = m(p, l);
|
|
10
|
+
if (typeof o == "string")
|
|
11
|
+
if (o.endsWith(".md")) {
|
|
12
|
+
const { apiDiffToMarkdown: s } = await import("./diff/apiDiffToMarkdown.js"), a = s(n, e);
|
|
13
|
+
await r(o, a, "utf-8");
|
|
14
|
+
} else
|
|
15
|
+
await r(o, JSON.stringify(n, null, 2), "utf-8");
|
|
16
|
+
else {
|
|
17
|
+
const { apiDiffToMarkdown: s } = await import("./diff/apiDiffToMarkdown.js"), a = s(n, e);
|
|
18
|
+
console.log(a);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function f(t) {
|
|
22
|
+
if (t.startsWith("http://") || t.startsWith("https://")) {
|
|
23
|
+
const i = await fetch(t);
|
|
24
|
+
if (!i.ok)
|
|
25
|
+
throw new Error(`Failed to fetch api.json: ${i.statusText}`);
|
|
26
|
+
return await i.json();
|
|
27
|
+
} else {
|
|
28
|
+
const i = await d(t, "utf-8");
|
|
29
|
+
return JSON.parse(i);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
k as diffApiCli
|
|
34
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Command as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Command as c } from "@commander-js/extra-typings";
|
|
3
|
+
const o = new c();
|
|
4
|
+
o.name("api-extractor").description("Extract public API from a TypeScript project to produce .d.ts types and api.json docs");
|
|
5
|
+
o.command("run").description("Generate .d.ts types and api.json API reference for a project").option("--cwd <arcgis-js-api>", "Path to the root of the project (default: process.cwd())").option("--dts <outputDirectory>", "Destination for the .d.ts files (example: dist/)").option("--api-json <outputLocation>", "Destination for the api.json file (example: dist/docs/api.json)").option("--environment <environment>", "Environment to run in (production or development) (default: production)").option("--type-check", "Run full type checking before the extraction (default: false)").option("--verify", "Run type checker on the emitted types (default: false)").option("--watch", "Watch for file changes and re-run the extraction automatically", !1).option(
|
|
6
6
|
"--config <configPath>",
|
|
7
7
|
"Path to the ./api-extractor.config.ts file. The provided path will be used as is in import(). The config file should export a `config` object of type ApiExtractorConfig (default: api-extractor.config.ts in the cwd)"
|
|
8
8
|
).option(
|
|
9
9
|
"--silence-broken-links",
|
|
10
10
|
"(deprecated) Do not emit errors for broken @links in JSDoc comments. Temporary option for migration period (default: false)"
|
|
11
11
|
).action(async (t) => {
|
|
12
|
-
const { loadApiExtractorConfig:
|
|
12
|
+
const { loadApiExtractorConfig: e, mergeApiExtractorConfigs: n } = await import("./extractor/config.js"), a = await e(t.cwd, t.config), r = n(a, {
|
|
13
13
|
context: {
|
|
14
14
|
dtsEmitPath: t.dts,
|
|
15
15
|
apiJsonEmitPath: t.apiJson,
|
|
@@ -23,16 +23,35 @@ e.command("run").description("Generate .d.ts types and api.json API reference fo
|
|
|
23
23
|
typeCheckTypes: t.verify,
|
|
24
24
|
detectBrokenLinks: t.silenceBrokenLinks === !0 ? !1 : void 0
|
|
25
25
|
}
|
|
26
|
-
}), { ApiExtractor:
|
|
26
|
+
}), { ApiExtractor: p } = await import("./extractor/ApiExtractor.js"), i = new p(r);
|
|
27
27
|
t.watch ? await i.watch() : await i.run();
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
o.command("diff").description("Produce a diff of two api.json files").requiredOption(
|
|
30
|
+
"--old <string>",
|
|
31
|
+
"URL or file path to the old api.json file. Example: https://unpkg.com/@arcgis/map-components@latest/dist/docs/api.json"
|
|
32
|
+
).requiredOption(
|
|
33
|
+
"--new <string>",
|
|
34
|
+
"URL or file path to the new api.json file. Example: ./packages/map-packages/map-components/dist/docs/api.json"
|
|
35
|
+
).option("--output <path>", "Path to the output .md or .json file. If not provided, will print markdown to console").option(
|
|
36
|
+
"--docs-url-prefix <string>",
|
|
37
|
+
"Base URL for documentation links. Used only if output format is Markdown",
|
|
38
|
+
"https://developers.arcgis.com/javascript/latest/references/core/"
|
|
39
|
+
).action(async (t) => {
|
|
40
|
+
const { diffApiCli: e } = await import("./cli-7PX_wNxb.js");
|
|
41
|
+
await e({
|
|
42
|
+
oldPath: t.old,
|
|
43
|
+
newPath: t.new,
|
|
44
|
+
outputPath: t.output,
|
|
45
|
+
docsUrlPrefix: t.docsUrlPrefix
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
o.command("diff-types").description("Generate a types diff summary .md file").requiredOption("--original-dts <originalTypings>", "Path to the original types folder").requiredOption("--new-dts <newTypings>", "Path to the new types folder").option("--output-md <outputMd>", "Path to the output markdown file", "types-diff.md").option("--no-truncate", "Do not truncate output if it is longer than 1000 lines", !0).action(async (t) => {
|
|
49
|
+
const { diffTypes: e } = await import("./diffTypes/index.js");
|
|
50
|
+
await e({
|
|
32
51
|
originalDtsPath: t.originalDts,
|
|
33
52
|
newDtsPath: t.newDts,
|
|
34
53
|
outputMdPath: t.outputMd,
|
|
35
54
|
truncate: t.truncate
|
|
36
55
|
});
|
|
37
56
|
});
|
|
38
|
-
|
|
57
|
+
o.parse();
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { buildViewUrl as T } from "../extractor/processing/links.js";
|
|
2
|
+
function K({ modules: e }, t) {
|
|
3
|
+
const o = {
|
|
4
|
+
children: /* @__PURE__ */ new Map(),
|
|
5
|
+
members: []
|
|
6
|
+
};
|
|
7
|
+
for (let n = 0; n < e.length; ++n) {
|
|
8
|
+
const s = e[n], w = s.path.split("/");
|
|
9
|
+
let y = w;
|
|
10
|
+
const M = w.at(-1);
|
|
11
|
+
s.declarations.length === 1 && s.declarations[0].name === M && (y = w.slice(0, -1));
|
|
12
|
+
let U = o;
|
|
13
|
+
for (const g of y)
|
|
14
|
+
U = N(U, g);
|
|
15
|
+
for (let g = 0; g < s.declarations.length; ++g) {
|
|
16
|
+
const h = s.declarations[g], S = B(h), O = h.removed === !0 ? void 0 : $(t, s.path, h, void 0), k = j(h), x = { label: S, viewUrl: O, change: k }, d = h, m = [];
|
|
17
|
+
if (d.members !== void 0)
|
|
18
|
+
for (let l = 0; l < d.members.length; ++l) {
|
|
19
|
+
const a = d.members[l], f = p(a.kind, a);
|
|
20
|
+
if (f === void 0)
|
|
21
|
+
continue;
|
|
22
|
+
const v = F(a), r = a.removed === !0 ? void 0 : $(
|
|
23
|
+
t,
|
|
24
|
+
s.path,
|
|
25
|
+
h,
|
|
26
|
+
"name" in a ? a.name : `${h.name}Properties`
|
|
27
|
+
);
|
|
28
|
+
m.push({ label: v, viewUrl: r, change: f });
|
|
29
|
+
}
|
|
30
|
+
if (d.events !== void 0)
|
|
31
|
+
for (let l = 0; l < d.events.length; ++l) {
|
|
32
|
+
const a = d.events[l], f = p("event", a);
|
|
33
|
+
if (f === void 0)
|
|
34
|
+
continue;
|
|
35
|
+
const v = a.removed === !0 ? void 0 : $(t, s.path, h, `event-${a.name}`);
|
|
36
|
+
m.push({ label: `@${a.name}`, viewUrl: v, change: f });
|
|
37
|
+
}
|
|
38
|
+
if (typeof d.tagName == "string") {
|
|
39
|
+
const l = d.slots, a = d.cssParts, f = d.cssProperties, v = d.cssStates;
|
|
40
|
+
if (l !== void 0)
|
|
41
|
+
for (let r = 0; r < l.length; ++r) {
|
|
42
|
+
const i = l[r], u = p("slot", i);
|
|
43
|
+
if (u === void 0)
|
|
44
|
+
continue;
|
|
45
|
+
const b = i.removed === !0 ? void 0 : $(t, s.path, h, `slot-${i.name}`);
|
|
46
|
+
m.push({ label: i.name, viewUrl: b, change: u });
|
|
47
|
+
}
|
|
48
|
+
if (a !== void 0)
|
|
49
|
+
for (let r = 0; r < a.length; ++r) {
|
|
50
|
+
const i = a[r], u = p("css part", i);
|
|
51
|
+
if (u === void 0)
|
|
52
|
+
continue;
|
|
53
|
+
m.push({ label: i.name, viewUrl: void 0, change: u });
|
|
54
|
+
}
|
|
55
|
+
if (f !== void 0)
|
|
56
|
+
for (let r = 0; r < f.length; ++r) {
|
|
57
|
+
const i = f[r], u = p("css property", i);
|
|
58
|
+
if (u === void 0)
|
|
59
|
+
continue;
|
|
60
|
+
const b = i.removed === !0 ? void 0 : $(t, s.path, h, i.name);
|
|
61
|
+
m.push({ label: i.name, viewUrl: b, change: u });
|
|
62
|
+
}
|
|
63
|
+
if (v !== void 0)
|
|
64
|
+
for (let r = 0; r < v.length; ++r) {
|
|
65
|
+
const i = v[r], u = p("css state", i);
|
|
66
|
+
if (u === void 0)
|
|
67
|
+
continue;
|
|
68
|
+
m.push({ label: i.name, viewUrl: void 0, change: u });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
m.length > 0 ? E(U, x).members.push(...m) : k !== void 0 && U.members.push(x);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const c = [];
|
|
75
|
+
for (const n of o.children.values())
|
|
76
|
+
L(n, "", c);
|
|
77
|
+
return c.join(`
|
|
78
|
+
`);
|
|
79
|
+
}
|
|
80
|
+
function N(e, t) {
|
|
81
|
+
const o = e.children.get(t);
|
|
82
|
+
if (o !== void 0)
|
|
83
|
+
return o;
|
|
84
|
+
const c = { name: t, children: /* @__PURE__ */ new Map(), members: [], node: void 0 };
|
|
85
|
+
return e.children.set(t, c), c;
|
|
86
|
+
}
|
|
87
|
+
function j(e) {
|
|
88
|
+
const t = e.tagName !== void 0 ? "component" : e.kind === "interface" ? "type declaration" : e.kind;
|
|
89
|
+
return p(t, e);
|
|
90
|
+
}
|
|
91
|
+
function p(e, t) {
|
|
92
|
+
const { added: o, removed: c, deprecated: n } = t;
|
|
93
|
+
if (c) {
|
|
94
|
+
const s = `**removed** ${e}`;
|
|
95
|
+
return typeof n == "string" ? `${s} - deprecated ${D(n)}` : s;
|
|
96
|
+
}
|
|
97
|
+
if (n)
|
|
98
|
+
return typeof n == "string" ? `**deprecated** ${e} ${D(n)}` : `**deprecated** ${e}`;
|
|
99
|
+
if (o)
|
|
100
|
+
return `**added** ${e}`;
|
|
101
|
+
}
|
|
102
|
+
function B(e) {
|
|
103
|
+
const t = e.tagName;
|
|
104
|
+
return typeof t == "string" && t.length > 0 ? t : C(e.name) + (e.kind === "function" ? "()" : "");
|
|
105
|
+
}
|
|
106
|
+
function $(e, t, o, c) {
|
|
107
|
+
const n = `${e}${t}/`;
|
|
108
|
+
return T(n, o.kind === "class" ? void 0 : o.name, c);
|
|
109
|
+
}
|
|
110
|
+
function E(e, t) {
|
|
111
|
+
const o = N(e, t.label);
|
|
112
|
+
return o.node = t, o;
|
|
113
|
+
}
|
|
114
|
+
function F(e) {
|
|
115
|
+
return e.kind === "constructor" ? "constructor" : e.kind === "call-signature" ? "call signature" : e.kind === "method" ? `${C(e.name)}()` : C(e.name);
|
|
116
|
+
}
|
|
117
|
+
function C(e) {
|
|
118
|
+
return e.replace(/[\\\[\]\(\)]/gu, "\\$&");
|
|
119
|
+
}
|
|
120
|
+
function D(e) {
|
|
121
|
+
return e.split(`
|
|
122
|
+
`)[0];
|
|
123
|
+
}
|
|
124
|
+
function L(e, t, o) {
|
|
125
|
+
if (e.node) {
|
|
126
|
+
const n = e.node.viewUrl === void 0 ? e.node.label : `[${e.node.label}](${e.node.viewUrl})`;
|
|
127
|
+
e.node.change ? o.push(`${t}- ${n} - ${e.node.change}`) : o.push(`${t}- ${n}`);
|
|
128
|
+
} else
|
|
129
|
+
o.push(`${t}- ${e.name}/`);
|
|
130
|
+
const c = `${t} `;
|
|
131
|
+
for (const n of e.members) {
|
|
132
|
+
const s = n.viewUrl === void 0 ? n.label : `[${n.label}](${n.viewUrl})`;
|
|
133
|
+
n.change ? o.push(`${c}- ${s} - ${n.change}`) : o.push(`${c}- ${s}`);
|
|
134
|
+
}
|
|
135
|
+
for (const n of e.children.values())
|
|
136
|
+
L(n, c, o);
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
K as apiDiffToMarkdown
|
|
140
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiJson } from "../apiJson.js";
|
|
1
|
+
import type { ApiJson, ApiJsonCompiler } from "../apiJson.js";
|
|
2
2
|
import type { ApiDiff } from "./types.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -6,8 +6,8 @@ import type { ApiDiff } from "./types.js";
|
|
|
6
6
|
* @param newApiJson
|
|
7
7
|
* @example
|
|
8
8
|
* ```js
|
|
9
|
-
* import { diffApiJson
|
|
10
|
-
* import {
|
|
9
|
+
* import { diffApiJson } from "@arcgis/api-extractor/diff/diffApiJson";
|
|
10
|
+
* import { fetchApiJsonFromNpm } from "@arcgis/api-extractor/diff/fetchApiJsonFromNpm";
|
|
11
11
|
*
|
|
12
12
|
* // Read -next api.json from file system:
|
|
13
13
|
* const apiJson = JSON.parse(
|
|
@@ -23,4 +23,4 @@ import type { ApiDiff } from "./types.js";
|
|
|
23
23
|
* writeFileSync("api-diff.json", JSON.stringify(diff, null, 2));
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export function diffApiJson(oldApiJson: Pick<ApiJson, "modules"
|
|
26
|
+
export function diffApiJson(oldApiJson: Pick<ApiJson, "modules"> & { compiler?: ApiJsonCompiler; }, newApiJson: Pick<ApiJson, "modules"> & { compiler?: ApiJsonCompiler; }): ApiDiff;
|
package/dist/diff/diffApiJson.js
CHANGED
|
@@ -1,142 +1,265 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function w(i, o) {
|
|
2
|
+
if (i.compiler?.name !== "@arcgis/core:manual" || i.compiler?.version !== "4.34")
|
|
3
|
+
return;
|
|
4
|
+
const a = {};
|
|
5
|
+
return i.modules.forEach((e) => {
|
|
6
|
+
a[e.path] = e;
|
|
7
|
+
}), {
|
|
8
|
+
...o,
|
|
9
|
+
modules: o.modules.filter((e) => {
|
|
10
|
+
const t = a[e.path];
|
|
11
|
+
return e.declarations = e.declarations.filter((s) => {
|
|
12
|
+
if (s.kind === "mixin")
|
|
13
|
+
return !1;
|
|
14
|
+
if (s.kind === "interface") {
|
|
15
|
+
const r = t?.declarations.find(
|
|
16
|
+
(d) => d.name === s.name && d.kind === "interface"
|
|
17
|
+
);
|
|
18
|
+
return s.members = void 0, r !== void 0;
|
|
19
|
+
}
|
|
20
|
+
return !0;
|
|
21
|
+
}), e.declarations.length > 0;
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function x(i) {
|
|
26
|
+
const o = /* @__PURE__ */ new Set([
|
|
27
|
+
// Fake class turned into a variable
|
|
28
|
+
"config",
|
|
29
|
+
// Wasn't visible directly before due to doc mismatch
|
|
30
|
+
"identity/IdentityManagerBase",
|
|
31
|
+
// Fake class turned into a variable
|
|
32
|
+
"identity/IdentityManager",
|
|
33
|
+
// Fake class turned into an interface
|
|
34
|
+
"views/layers/GeoRSSLayerView",
|
|
35
|
+
"views/layers/GraphicsLayerView",
|
|
36
|
+
"views/layers/KMLLayerView",
|
|
37
|
+
"views/layers/VectorTileLayerView",
|
|
38
|
+
"views/layers/PointCloudLayerView",
|
|
39
|
+
// ENUM-like objects turned into const variable + interfaces
|
|
40
|
+
"layers/support/rasterFunctionConstants"
|
|
41
|
+
]), a = i.modules.filter((n) => {
|
|
42
|
+
if (o.has(n.path))
|
|
43
|
+
return !1;
|
|
44
|
+
const e = n.path.startsWith("widgets/");
|
|
45
|
+
return n.declarations = n.declarations.filter((t) => e ? t.deprecated === void 0 && t.removed === void 0 ? !1 : ((t.kind === "class" || t.kind === "interface" || t.kind === "mixin") && (t.members = void 0), !0) : t.kind === "class" ? t.members === void 0 ? !0 : (t.members = t.members.filter((s) => !(s.kind === "constructor" || s.kind === "call-signature" || A.has(s.name))), t.members.length > 0) : !0), n.declarations.length > 0;
|
|
46
|
+
});
|
|
47
|
+
return { ...i, modules: a };
|
|
48
|
+
}
|
|
49
|
+
const A = /* @__PURE__ */ new Set([
|
|
50
|
+
// Excluded from api.json inheritance to keep file size in check
|
|
51
|
+
"addHandles",
|
|
52
|
+
"hasHandles",
|
|
53
|
+
"removeHandles",
|
|
54
|
+
// These are coming from mixins. Exclude them from the diff to reduce noise
|
|
55
|
+
// compared to more valuable new 5.0 fields.
|
|
56
|
+
// Added 77 times
|
|
57
|
+
"emit",
|
|
58
|
+
// 77
|
|
59
|
+
"hasEventListener",
|
|
60
|
+
// 73
|
|
61
|
+
"fromJSON",
|
|
62
|
+
// 72
|
|
63
|
+
"on",
|
|
64
|
+
// 71
|
|
65
|
+
"toJSON",
|
|
66
|
+
// 63
|
|
67
|
+
"declaredClass",
|
|
68
|
+
// 63
|
|
69
|
+
"getAtOrigin",
|
|
70
|
+
// 63
|
|
71
|
+
"originOf",
|
|
72
|
+
// 63
|
|
73
|
+
"revertAllToOrigin",
|
|
74
|
+
// 63
|
|
75
|
+
"revertToOrigin",
|
|
76
|
+
// 54
|
|
77
|
+
"clone",
|
|
78
|
+
// 50
|
|
79
|
+
"fromPortalItem",
|
|
80
|
+
// 49
|
|
81
|
+
"fromArcGISServerUrl",
|
|
82
|
+
// 28
|
|
83
|
+
"isFulfilled",
|
|
84
|
+
// 28
|
|
85
|
+
"isRejected",
|
|
86
|
+
// 28
|
|
87
|
+
"isResolved",
|
|
88
|
+
// 28
|
|
89
|
+
"when",
|
|
90
|
+
// 6
|
|
91
|
+
"cancelLoad",
|
|
92
|
+
// 6
|
|
93
|
+
"loadError",
|
|
94
|
+
// 6
|
|
95
|
+
"loadStatus",
|
|
96
|
+
// 6
|
|
97
|
+
"loadWarnings"
|
|
98
|
+
]);
|
|
99
|
+
function N(i, o) {
|
|
100
|
+
const a = w(i, o), n = a ?? o, e = i.compiler?.version.startsWith("4.") === !0 && n.compiler?.version.startsWith("4.") !== !0, t = new Map(
|
|
101
|
+
i.modules.map((d) => [
|
|
102
|
+
b(d, e),
|
|
103
|
+
d
|
|
104
|
+
])
|
|
105
|
+
), s = [];
|
|
106
|
+
for (const d of n.modules) {
|
|
107
|
+
const l = t.get(d.path), m = y(l, d, !0);
|
|
108
|
+
m !== void 0 && s.push(m), t.delete(d.path);
|
|
6
109
|
}
|
|
7
|
-
for (const
|
|
8
|
-
const
|
|
9
|
-
|
|
110
|
+
for (const d of t.values()) {
|
|
111
|
+
const l = y(
|
|
112
|
+
void 0,
|
|
113
|
+
e ? { ...d, path: b(d, e) } : d,
|
|
114
|
+
!1
|
|
115
|
+
);
|
|
116
|
+
l !== void 0 && s.push(l);
|
|
10
117
|
}
|
|
11
|
-
|
|
118
|
+
const r = { modules: s };
|
|
119
|
+
return a === void 0 ? r : x(r);
|
|
120
|
+
}
|
|
121
|
+
function b(i, o) {
|
|
122
|
+
return o ? i.declarations?.[0]?.importPath ?? i.path : i.path;
|
|
12
123
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
for (const
|
|
16
|
-
const
|
|
17
|
-
e.delete(
|
|
18
|
-
const g =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
124
|
+
function y(i, o, a) {
|
|
125
|
+
const n = [], e = h(i?.declarations ?? []), t = h(o.declarations ?? []);
|
|
126
|
+
for (const s of t.values()) {
|
|
127
|
+
const r = s.at(-1), d = r.tagName, l = d ?? r.name, m = e.get(l);
|
|
128
|
+
e.delete(l);
|
|
129
|
+
const g = m === void 0 && !a ? !0 : void 0, v = (
|
|
130
|
+
// Only mark as deprecated if all overloads are deprecated
|
|
131
|
+
s.length === 1 || s.every((c) => c.deprecated !== void 0) ? r.deprecated : void 0
|
|
132
|
+
), k = !v && m === void 0 && a ? !0 : void 0;
|
|
133
|
+
if (g || k) {
|
|
134
|
+
n.push({
|
|
135
|
+
kind: r.kind,
|
|
136
|
+
name: r.name,
|
|
137
|
+
tagName: d,
|
|
25
138
|
members: void 0,
|
|
26
139
|
removed: g,
|
|
27
|
-
added:
|
|
28
|
-
deprecated:
|
|
140
|
+
added: k,
|
|
141
|
+
deprecated: v
|
|
29
142
|
});
|
|
30
143
|
continue;
|
|
31
|
-
} else if (!
|
|
144
|
+
} else if (!a)
|
|
32
145
|
continue;
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
kind:
|
|
36
|
-
name:
|
|
37
|
-
tagName:
|
|
38
|
-
deprecated:
|
|
146
|
+
if (d !== void 0) {
|
|
147
|
+
const c = r, u = m?.[0], f = {
|
|
148
|
+
kind: c.kind,
|
|
149
|
+
name: c.name,
|
|
150
|
+
tagName: c.tagName,
|
|
151
|
+
deprecated: v,
|
|
39
152
|
added: void 0,
|
|
40
153
|
removed: void 0,
|
|
41
|
-
members:
|
|
42
|
-
events:
|
|
43
|
-
slots:
|
|
44
|
-
cssParts:
|
|
45
|
-
cssProperties:
|
|
46
|
-
cssStates:
|
|
154
|
+
members: M(u?.members, c.members),
|
|
155
|
+
events: p(u?.events, c.events),
|
|
156
|
+
slots: p(u?.slots, c.slots),
|
|
157
|
+
cssParts: p(u?.cssParts, c.cssParts),
|
|
158
|
+
cssProperties: p(u?.cssProperties, c.cssProperties),
|
|
159
|
+
cssStates: p(u?.cssStates, c.cssStates)
|
|
47
160
|
};
|
|
48
|
-
(
|
|
49
|
-
} else if (
|
|
50
|
-
const
|
|
51
|
-
kind:
|
|
52
|
-
name:
|
|
53
|
-
deprecated:
|
|
161
|
+
(v !== void 0 || f.members !== void 0 || f.events !== void 0 || f.slots !== void 0 || f.cssParts !== void 0 || f.cssProperties !== void 0 || f.cssStates !== void 0) && n.push(f);
|
|
162
|
+
} else if (r.kind === "class" || r.kind === "interface" || r.kind === "mixin") {
|
|
163
|
+
const c = m?.[0], u = {
|
|
164
|
+
kind: r.kind,
|
|
165
|
+
name: r.name,
|
|
166
|
+
deprecated: v,
|
|
54
167
|
added: void 0,
|
|
55
168
|
removed: void 0,
|
|
56
|
-
members:
|
|
57
|
-
events: "events" in
|
|
169
|
+
members: M(c?.members, r.members),
|
|
170
|
+
events: "events" in r ? p(c?.events, r.events) : void 0
|
|
58
171
|
};
|
|
59
|
-
(
|
|
60
|
-
} else
|
|
61
|
-
kind:
|
|
62
|
-
name:
|
|
63
|
-
deprecated:
|
|
172
|
+
(v !== void 0 || u.members !== void 0 || u.events !== void 0) && n.push(u);
|
|
173
|
+
} else v !== void 0 && n.push({
|
|
174
|
+
kind: r.kind,
|
|
175
|
+
name: r.name,
|
|
176
|
+
deprecated: v,
|
|
64
177
|
added: void 0,
|
|
65
178
|
removed: void 0
|
|
66
179
|
});
|
|
67
180
|
}
|
|
68
|
-
if (
|
|
69
|
-
for (const [
|
|
70
|
-
|
|
71
|
-
kind:
|
|
72
|
-
name:
|
|
73
|
-
tagName:
|
|
181
|
+
if (a)
|
|
182
|
+
for (const [s] of e.values())
|
|
183
|
+
n.push({
|
|
184
|
+
kind: s.kind,
|
|
185
|
+
name: s.name,
|
|
186
|
+
tagName: s.tagName,
|
|
74
187
|
members: void 0,
|
|
75
188
|
removed: !0,
|
|
76
189
|
added: void 0,
|
|
77
|
-
deprecated:
|
|
190
|
+
deprecated: s.deprecated
|
|
78
191
|
});
|
|
79
|
-
if (
|
|
192
|
+
if (n.length !== 0)
|
|
80
193
|
return {
|
|
81
|
-
path:
|
|
82
|
-
declarations:
|
|
194
|
+
path: o.path,
|
|
195
|
+
declarations: n
|
|
83
196
|
};
|
|
84
197
|
}
|
|
85
|
-
function h(
|
|
86
|
-
const
|
|
87
|
-
for (let
|
|
88
|
-
const
|
|
89
|
-
|
|
198
|
+
function h(i) {
|
|
199
|
+
const o = /* @__PURE__ */ new Map();
|
|
200
|
+
for (let a = 0; a < i.length; ++a) {
|
|
201
|
+
const n = i[a], e = n.tagName ?? n.name ?? n.kind, t = o.get(e);
|
|
202
|
+
P(n.docsTags) || (t === void 0 ? o.set(e, [n]) : t.push(n));
|
|
203
|
+
}
|
|
204
|
+
return o;
|
|
205
|
+
}
|
|
206
|
+
function P(i) {
|
|
207
|
+
if (i !== void 0) {
|
|
208
|
+
for (let o = 0; o < i.length; ++o)
|
|
209
|
+
if (i[o].name === "internal")
|
|
210
|
+
return !0;
|
|
90
211
|
}
|
|
91
|
-
return
|
|
212
|
+
return !1;
|
|
92
213
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
for (const e of
|
|
97
|
-
|
|
214
|
+
function p(i, o) {
|
|
215
|
+
const a = h(i ?? []), n = [];
|
|
216
|
+
if (o !== void 0)
|
|
217
|
+
for (const e of o)
|
|
218
|
+
a.get(e.name) === void 0 ? n.push({
|
|
98
219
|
name: e.name,
|
|
99
220
|
added: !0
|
|
100
|
-
}) : e.deprecated &&
|
|
221
|
+
}) : e.deprecated && n.push({
|
|
101
222
|
name: e.name,
|
|
102
223
|
deprecated: e.deprecated
|
|
103
|
-
}),
|
|
104
|
-
for (const [e] of
|
|
105
|
-
|
|
224
|
+
}), a.delete(e.name);
|
|
225
|
+
for (const [e] of a.values())
|
|
226
|
+
n.push({
|
|
106
227
|
name: e.name,
|
|
107
|
-
removed: !0
|
|
228
|
+
removed: !0,
|
|
229
|
+
deprecated: e.deprecated
|
|
108
230
|
});
|
|
109
|
-
return
|
|
231
|
+
return n.length ? n : void 0;
|
|
110
232
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
for (const [
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
233
|
+
function M(i, o) {
|
|
234
|
+
const a = h(i ?? []), n = h(o ?? []), e = [];
|
|
235
|
+
for (const [t, s] of n.entries()) {
|
|
236
|
+
const r = s.at(-1), d = a.get(t);
|
|
237
|
+
a.delete(t);
|
|
238
|
+
const l = (
|
|
117
239
|
// Only mark as deprecated if all overloads are deprecated
|
|
118
|
-
|
|
119
|
-
),
|
|
120
|
-
|
|
121
|
-
kind:
|
|
122
|
-
name:
|
|
123
|
-
deprecated:
|
|
124
|
-
}) :
|
|
125
|
-
kind:
|
|
126
|
-
name:
|
|
240
|
+
s.length === 1 || s.every((g) => g.deprecated !== void 0) ? r.deprecated : void 0
|
|
241
|
+
), m = t === "constructor" || t === "call-signature" ? void 0 : t;
|
|
242
|
+
l ? e.push({
|
|
243
|
+
kind: r.kind,
|
|
244
|
+
name: m,
|
|
245
|
+
deprecated: l
|
|
246
|
+
}) : d === void 0 && e.push({
|
|
247
|
+
kind: r.kind,
|
|
248
|
+
name: m,
|
|
127
249
|
added: !0
|
|
128
250
|
});
|
|
129
251
|
}
|
|
130
|
-
for (const [
|
|
131
|
-
const
|
|
252
|
+
for (const [t, [s]] of a.entries()) {
|
|
253
|
+
const r = t === "constructor" || t === "call-signature" ? void 0 : t;
|
|
132
254
|
e.push({
|
|
133
|
-
kind:
|
|
134
|
-
name:
|
|
135
|
-
removed: !0
|
|
255
|
+
kind: s.kind,
|
|
256
|
+
name: r,
|
|
257
|
+
removed: !0,
|
|
258
|
+
deprecated: s.deprecated
|
|
136
259
|
});
|
|
137
260
|
}
|
|
138
261
|
return e.length ? e : void 0;
|
|
139
262
|
}
|
|
140
263
|
export {
|
|
141
|
-
|
|
264
|
+
N as diffApiJson
|
|
142
265
|
};
|