@arcgis/api-extractor 5.1.0-next.1 → 5.1.0-next.10
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-DByayOhi.js → ApiExtractor-BsCYv8eU.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 +142 -0
- package/dist/diff/diffApiJson.d.ts +4 -4
- package/dist/diff/diffApiJson.js +208 -90
- 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-D4_nAmBW.js → typeScript-C42JuOpR.js} +1 -1
- package/dist/vite/plugin.js +3 -3
- package/dist/vite/typeScript.js +1 -1
- package/dist/{worker-Btg0KdqM.js → worker-DZJ5CvpK.js} +424 -420
- 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-C42JuOpR.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-DZJ5CvpK.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,142 @@
|
|
|
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], U = s.path.split("/");
|
|
9
|
+
let y = U;
|
|
10
|
+
const x = U.at(-1);
|
|
11
|
+
s.declarations.length === 1 && s.declarations[0].name === x && (y = U.slice(0, -1));
|
|
12
|
+
let w = o;
|
|
13
|
+
for (const $ of y)
|
|
14
|
+
w = L(w, $);
|
|
15
|
+
for (let $ = 0; $ < s.declarations.length; ++$) {
|
|
16
|
+
const l = s.declarations[$], S = B(l), O = l.removed === !0 ? void 0 : g(t, s.path, l, void 0), k = j(l), D = { label: S, viewUrl: O, change: k }, u = l, f = [];
|
|
17
|
+
if (u.members !== void 0)
|
|
18
|
+
for (let d = 0; d < u.members.length; ++d) {
|
|
19
|
+
const i = u.members[d], m = b(i.kind, i);
|
|
20
|
+
if (m === void 0)
|
|
21
|
+
continue;
|
|
22
|
+
const v = F(i), a = i.removed === !0 ? void 0 : g(
|
|
23
|
+
t,
|
|
24
|
+
s.path,
|
|
25
|
+
l,
|
|
26
|
+
"name" in i ? i.name : `${l.name}Properties`
|
|
27
|
+
);
|
|
28
|
+
f.push({ label: v, viewUrl: a, change: m });
|
|
29
|
+
}
|
|
30
|
+
if (u.events !== void 0)
|
|
31
|
+
for (let d = 0; d < u.events.length; ++d) {
|
|
32
|
+
const i = u.events[d], m = b("event", i);
|
|
33
|
+
if (m === void 0)
|
|
34
|
+
continue;
|
|
35
|
+
const v = i.removed === !0 ? void 0 : g(t, s.path, l, i.name);
|
|
36
|
+
f.push({ label: `@${i.name}`, viewUrl: v, change: m });
|
|
37
|
+
}
|
|
38
|
+
if (typeof u.tagName == "string") {
|
|
39
|
+
const d = u.slots, i = u.cssParts, m = u.cssProperties, v = u.cssStates;
|
|
40
|
+
if (d !== void 0)
|
|
41
|
+
for (let a = 0; a < d.length; ++a) {
|
|
42
|
+
const r = d[a], h = b("slot", r);
|
|
43
|
+
if (h === void 0)
|
|
44
|
+
continue;
|
|
45
|
+
const p = r.removed === !0 ? void 0 : g(t, s.path, l, r.name);
|
|
46
|
+
f.push({ label: r.name, viewUrl: p, change: h });
|
|
47
|
+
}
|
|
48
|
+
if (i !== void 0)
|
|
49
|
+
for (let a = 0; a < i.length; ++a) {
|
|
50
|
+
const r = i[a], h = b("css part", r);
|
|
51
|
+
if (h === void 0)
|
|
52
|
+
continue;
|
|
53
|
+
const p = r.removed === !0 ? void 0 : g(t, s.path, l, r.name);
|
|
54
|
+
f.push({ label: r.name, viewUrl: p, change: h });
|
|
55
|
+
}
|
|
56
|
+
if (m !== void 0)
|
|
57
|
+
for (let a = 0; a < m.length; ++a) {
|
|
58
|
+
const r = m[a], h = b("css property", r);
|
|
59
|
+
if (h === void 0)
|
|
60
|
+
continue;
|
|
61
|
+
const p = r.removed === !0 ? void 0 : g(t, s.path, l, r.name);
|
|
62
|
+
f.push({ label: r.name, viewUrl: p, change: h });
|
|
63
|
+
}
|
|
64
|
+
if (v !== void 0)
|
|
65
|
+
for (let a = 0; a < v.length; ++a) {
|
|
66
|
+
const r = v[a], h = b("css state", r);
|
|
67
|
+
if (h === void 0)
|
|
68
|
+
continue;
|
|
69
|
+
const p = r.removed === !0 ? void 0 : g(t, s.path, l, r.name);
|
|
70
|
+
f.push({ label: r.name, viewUrl: p, change: h });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
f.length > 0 ? E(w, D).members.push(...f) : k !== void 0 && w.members.push(D);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const c = [];
|
|
77
|
+
for (const n of o.children.values())
|
|
78
|
+
M(n, "", c);
|
|
79
|
+
return c.join(`
|
|
80
|
+
`);
|
|
81
|
+
}
|
|
82
|
+
function L(e, t) {
|
|
83
|
+
const o = e.children.get(t);
|
|
84
|
+
if (o !== void 0)
|
|
85
|
+
return o;
|
|
86
|
+
const c = { name: t, children: /* @__PURE__ */ new Map(), members: [], node: void 0 };
|
|
87
|
+
return e.children.set(t, c), c;
|
|
88
|
+
}
|
|
89
|
+
function j(e) {
|
|
90
|
+
const t = e.tagName !== void 0 ? "component" : e.kind === "interface" ? "type declaration" : e.kind;
|
|
91
|
+
return b(t, e);
|
|
92
|
+
}
|
|
93
|
+
function b(e, t) {
|
|
94
|
+
const { added: o, removed: c, deprecated: n } = t;
|
|
95
|
+
if (c) {
|
|
96
|
+
const s = `**removed** ${e}`;
|
|
97
|
+
return typeof n == "string" ? `${s} - deprecated ${N(n)}` : s;
|
|
98
|
+
}
|
|
99
|
+
if (n)
|
|
100
|
+
return typeof n == "string" ? `**deprecated** ${e} ${N(n)}` : `**deprecated** ${e}`;
|
|
101
|
+
if (o)
|
|
102
|
+
return `**added** ${e}`;
|
|
103
|
+
}
|
|
104
|
+
function B(e) {
|
|
105
|
+
const t = e.tagName;
|
|
106
|
+
return typeof t == "string" && t.length > 0 ? t : C(e.name) + (e.kind === "function" ? "()" : "");
|
|
107
|
+
}
|
|
108
|
+
function g(e, t, o, c) {
|
|
109
|
+
const n = `${e}${t}`;
|
|
110
|
+
return T(n, o.kind === "class" ? void 0 : o.name, c);
|
|
111
|
+
}
|
|
112
|
+
function E(e, t) {
|
|
113
|
+
const o = L(e, t.label);
|
|
114
|
+
return o.node = t, o;
|
|
115
|
+
}
|
|
116
|
+
function F(e) {
|
|
117
|
+
return e.kind === "constructor" ? "constructor" : e.kind === "call-signature" ? "call signature" : e.kind === "method" ? `${C(e.name)}()` : C(e.name);
|
|
118
|
+
}
|
|
119
|
+
function C(e) {
|
|
120
|
+
return e.replace(/[\\\[\]\(\)]/gu, "\\$&");
|
|
121
|
+
}
|
|
122
|
+
function N(e) {
|
|
123
|
+
return e.split(`
|
|
124
|
+
`)[0];
|
|
125
|
+
}
|
|
126
|
+
function M(e, t, o) {
|
|
127
|
+
if (e.node) {
|
|
128
|
+
const n = e.node.viewUrl === void 0 ? e.node.label : `[${e.node.label}](${e.node.viewUrl})`;
|
|
129
|
+
e.node.change ? o.push(`${t}- ${n} - ${e.node.change}`) : o.push(`${t}- ${n}`);
|
|
130
|
+
} else
|
|
131
|
+
o.push(`${t}- ${e.name}/`);
|
|
132
|
+
const c = `${t} `;
|
|
133
|
+
for (const n of e.members) {
|
|
134
|
+
const s = n.viewUrl === void 0 ? n.label : `[${n.label}](${n.viewUrl})`;
|
|
135
|
+
n.change ? o.push(`${c}- ${s} - ${n.change}`) : o.push(`${c}- ${s}`);
|
|
136
|
+
}
|
|
137
|
+
for (const n of e.children.values())
|
|
138
|
+
M(n, c, o);
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
K as apiDiffToMarkdown
|
|
142
|
+
};
|
|
@@ -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,260 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function w(n, s) {
|
|
2
|
+
if (n.compiler?.name !== "@arcgis/core:manual" || n.compiler?.version !== "4.34")
|
|
3
|
+
return;
|
|
4
|
+
const o = {};
|
|
5
|
+
return n.modules.forEach((e) => {
|
|
6
|
+
o[e.path] = e;
|
|
7
|
+
}), {
|
|
8
|
+
...s,
|
|
9
|
+
modules: s.modules.filter((e) => {
|
|
10
|
+
const r = o[e.path];
|
|
11
|
+
return e.declarations = e.declarations.filter((a) => {
|
|
12
|
+
if (a.kind === "mixin")
|
|
13
|
+
return !1;
|
|
14
|
+
if (a.kind === "interface") {
|
|
15
|
+
const i = r?.declarations.find(
|
|
16
|
+
(d) => d.name === a.name && d.kind === "interface"
|
|
17
|
+
);
|
|
18
|
+
return a.members = void 0, i !== void 0;
|
|
19
|
+
}
|
|
20
|
+
return !0;
|
|
21
|
+
}), e.declarations.length > 0;
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function A(n) {
|
|
26
|
+
const s = /* @__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
|
+
]), o = n.modules.filter((t) => s.has(t.path) ? !1 : (t.declarations = t.declarations.filter((e) => e.kind === "class" ? e.members === void 0 ? !0 : (e.members = e.members.filter((r) => !(r.kind === "constructor" || r.kind === "call-signature" || P.has(r.name))), e.members.length > 0) : !0), t.declarations.length > 0));
|
|
42
|
+
return { ...n, modules: o };
|
|
43
|
+
}
|
|
44
|
+
const P = /* @__PURE__ */ new Set([
|
|
45
|
+
// Excluded from api.json inheritance to keep file size in check
|
|
46
|
+
"addHandles",
|
|
47
|
+
"hasHandles",
|
|
48
|
+
"removeHandles",
|
|
49
|
+
// These are coming from mixins. Exclude them from the diff to reduce noise
|
|
50
|
+
// compared to more valuable new 5.0 fields.
|
|
51
|
+
// Added 77 times
|
|
52
|
+
"emit",
|
|
53
|
+
// 77
|
|
54
|
+
"hasEventListener",
|
|
55
|
+
// 73
|
|
56
|
+
"fromJSON",
|
|
57
|
+
// 72
|
|
58
|
+
"on",
|
|
59
|
+
// 71
|
|
60
|
+
"toJSON",
|
|
61
|
+
// 63
|
|
62
|
+
"declaredClass",
|
|
63
|
+
// 63
|
|
64
|
+
"getAtOrigin",
|
|
65
|
+
// 63
|
|
66
|
+
"originOf",
|
|
67
|
+
// 63
|
|
68
|
+
"revertAllToOrigin",
|
|
69
|
+
// 63
|
|
70
|
+
"revertToOrigin",
|
|
71
|
+
// 54
|
|
72
|
+
"clone",
|
|
73
|
+
// 50
|
|
74
|
+
"fromPortalItem",
|
|
75
|
+
// 49
|
|
76
|
+
"fromArcGISServerUrl",
|
|
77
|
+
// 28
|
|
78
|
+
"isFulfilled",
|
|
79
|
+
// 28
|
|
80
|
+
"isRejected",
|
|
81
|
+
// 28
|
|
82
|
+
"isResolved",
|
|
83
|
+
// 28
|
|
84
|
+
"when",
|
|
85
|
+
// 6
|
|
86
|
+
"cancelLoad",
|
|
87
|
+
// 6
|
|
88
|
+
"loadError",
|
|
89
|
+
// 6
|
|
90
|
+
"loadStatus",
|
|
91
|
+
// 6
|
|
92
|
+
"loadWarnings"
|
|
93
|
+
]);
|
|
94
|
+
function N(n, s) {
|
|
95
|
+
const o = w(n, s), t = o ?? s, e = n.compiler?.version.startsWith("4.") === !0 && t.compiler?.version.startsWith("4.") !== !0, r = new Map(
|
|
96
|
+
n.modules.map((d) => [
|
|
97
|
+
b(d, e),
|
|
98
|
+
d
|
|
99
|
+
])
|
|
100
|
+
), a = [];
|
|
101
|
+
for (const d of t.modules) {
|
|
102
|
+
const l = r.get(d.path), m = y(l, d, !0);
|
|
103
|
+
m !== void 0 && a.push(m), r.delete(d.path);
|
|
6
104
|
}
|
|
7
|
-
for (const
|
|
8
|
-
const
|
|
9
|
-
|
|
105
|
+
for (const d of r.values()) {
|
|
106
|
+
const l = y(
|
|
107
|
+
void 0,
|
|
108
|
+
e ? { ...d, path: b(d, e) } : d,
|
|
109
|
+
!1
|
|
110
|
+
);
|
|
111
|
+
l !== void 0 && a.push(l);
|
|
10
112
|
}
|
|
11
|
-
|
|
113
|
+
const i = { modules: a };
|
|
114
|
+
return o === void 0 ? i : A(i);
|
|
12
115
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
116
|
+
function b(n, s) {
|
|
117
|
+
return s ? n.declarations?.[0]?.importPath ?? n.path : n.path;
|
|
118
|
+
}
|
|
119
|
+
function y(n, s, o) {
|
|
120
|
+
const t = [], e = h(n?.declarations ?? []), r = h(s.declarations ?? []);
|
|
121
|
+
for (const a of r.values()) {
|
|
122
|
+
const i = a.at(-1), d = i.tagName, l = d ?? i.name, m = e.get(l);
|
|
123
|
+
e.delete(l);
|
|
124
|
+
const g = m === void 0 && !o ? !0 : void 0, f = (
|
|
125
|
+
// Only mark as deprecated if all overloads are deprecated
|
|
126
|
+
a.length === 1 || a.every((c) => c.deprecated !== void 0) ? i.deprecated : void 0
|
|
127
|
+
), k = !f && m === void 0 && o ? !0 : void 0;
|
|
128
|
+
if (g || k) {
|
|
21
129
|
t.push({
|
|
22
|
-
kind:
|
|
23
|
-
name:
|
|
24
|
-
tagName:
|
|
130
|
+
kind: i.kind,
|
|
131
|
+
name: i.name,
|
|
132
|
+
tagName: d,
|
|
25
133
|
members: void 0,
|
|
26
134
|
removed: g,
|
|
27
|
-
added:
|
|
28
|
-
deprecated:
|
|
135
|
+
added: k,
|
|
136
|
+
deprecated: f
|
|
29
137
|
});
|
|
30
138
|
continue;
|
|
31
|
-
} else if (!
|
|
139
|
+
} else if (!o)
|
|
32
140
|
continue;
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
kind:
|
|
36
|
-
name:
|
|
37
|
-
tagName:
|
|
38
|
-
deprecated:
|
|
141
|
+
if (d !== void 0) {
|
|
142
|
+
const c = i, u = m?.[0], v = {
|
|
143
|
+
kind: c.kind,
|
|
144
|
+
name: c.name,
|
|
145
|
+
tagName: c.tagName,
|
|
146
|
+
deprecated: f,
|
|
39
147
|
added: void 0,
|
|
40
148
|
removed: void 0,
|
|
41
|
-
members:
|
|
42
|
-
events:
|
|
43
|
-
slots:
|
|
44
|
-
cssParts:
|
|
45
|
-
cssProperties:
|
|
46
|
-
cssStates:
|
|
149
|
+
members: M(u?.members, c.members),
|
|
150
|
+
events: p(u?.events, c.events),
|
|
151
|
+
slots: p(u?.slots, c.slots),
|
|
152
|
+
cssParts: p(u?.cssParts, c.cssParts),
|
|
153
|
+
cssProperties: p(u?.cssProperties, c.cssProperties),
|
|
154
|
+
cssStates: p(u?.cssStates, c.cssStates)
|
|
47
155
|
};
|
|
48
|
-
(
|
|
49
|
-
} else if (
|
|
50
|
-
const
|
|
51
|
-
kind:
|
|
52
|
-
name:
|
|
53
|
-
deprecated:
|
|
156
|
+
(f !== void 0 || v.members !== void 0 || v.events !== void 0 || v.slots !== void 0 || v.cssParts !== void 0 || v.cssProperties !== void 0 || v.cssStates !== void 0) && t.push(v);
|
|
157
|
+
} else if (i.kind === "class" || i.kind === "interface" || i.kind === "mixin") {
|
|
158
|
+
const c = m?.[0], u = {
|
|
159
|
+
kind: i.kind,
|
|
160
|
+
name: i.name,
|
|
161
|
+
deprecated: f,
|
|
54
162
|
added: void 0,
|
|
55
163
|
removed: void 0,
|
|
56
|
-
members:
|
|
57
|
-
events: "events" in
|
|
164
|
+
members: M(c?.members, i.members),
|
|
165
|
+
events: "events" in i ? p(c?.events, i.events) : void 0
|
|
58
166
|
};
|
|
59
|
-
(
|
|
60
|
-
} else
|
|
61
|
-
kind:
|
|
62
|
-
name:
|
|
63
|
-
deprecated:
|
|
167
|
+
(f !== void 0 || u.members !== void 0 || u.events !== void 0) && t.push(u);
|
|
168
|
+
} else f !== void 0 && t.push({
|
|
169
|
+
kind: i.kind,
|
|
170
|
+
name: i.name,
|
|
171
|
+
deprecated: f,
|
|
64
172
|
added: void 0,
|
|
65
173
|
removed: void 0
|
|
66
174
|
});
|
|
67
175
|
}
|
|
68
|
-
if (
|
|
69
|
-
for (const [
|
|
176
|
+
if (o)
|
|
177
|
+
for (const [a] of e.values())
|
|
70
178
|
t.push({
|
|
71
|
-
kind:
|
|
72
|
-
name:
|
|
73
|
-
tagName:
|
|
179
|
+
kind: a.kind,
|
|
180
|
+
name: a.name,
|
|
181
|
+
tagName: a.tagName,
|
|
74
182
|
members: void 0,
|
|
75
183
|
removed: !0,
|
|
76
184
|
added: void 0,
|
|
77
|
-
deprecated:
|
|
185
|
+
deprecated: a.deprecated
|
|
78
186
|
});
|
|
79
187
|
if (t.length !== 0)
|
|
80
188
|
return {
|
|
81
|
-
path:
|
|
189
|
+
path: s.path,
|
|
82
190
|
declarations: t
|
|
83
191
|
};
|
|
84
192
|
}
|
|
85
|
-
function h(
|
|
86
|
-
const
|
|
87
|
-
for (let
|
|
88
|
-
const t =
|
|
89
|
-
|
|
193
|
+
function h(n) {
|
|
194
|
+
const s = /* @__PURE__ */ new Map();
|
|
195
|
+
for (let o = 0; o < n.length; ++o) {
|
|
196
|
+
const t = n[o], e = t.tagName ?? t.name ?? t.kind, r = s.get(e);
|
|
197
|
+
x(t.docsTags) || (r === void 0 ? s.set(e, [t]) : r.push(t));
|
|
198
|
+
}
|
|
199
|
+
return s;
|
|
200
|
+
}
|
|
201
|
+
function x(n) {
|
|
202
|
+
if (n !== void 0) {
|
|
203
|
+
for (let s = 0; s < n.length; ++s)
|
|
204
|
+
if (n[s].name === "internal")
|
|
205
|
+
return !0;
|
|
90
206
|
}
|
|
91
|
-
return
|
|
207
|
+
return !1;
|
|
92
208
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
for (const e of
|
|
97
|
-
|
|
209
|
+
function p(n, s) {
|
|
210
|
+
const o = h(n ?? []), t = [];
|
|
211
|
+
if (s !== void 0)
|
|
212
|
+
for (const e of s)
|
|
213
|
+
o.get(e.name) === void 0 ? t.push({
|
|
98
214
|
name: e.name,
|
|
99
215
|
added: !0
|
|
100
216
|
}) : e.deprecated && t.push({
|
|
101
217
|
name: e.name,
|
|
102
218
|
deprecated: e.deprecated
|
|
103
|
-
}),
|
|
104
|
-
for (const [e] of
|
|
219
|
+
}), o.delete(e.name);
|
|
220
|
+
for (const [e] of o.values())
|
|
105
221
|
t.push({
|
|
106
222
|
name: e.name,
|
|
107
|
-
removed: !0
|
|
223
|
+
removed: !0,
|
|
224
|
+
deprecated: e.deprecated
|
|
108
225
|
});
|
|
109
226
|
return t.length ? t : void 0;
|
|
110
227
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
for (const [
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
228
|
+
function M(n, s) {
|
|
229
|
+
const o = h(n ?? []), t = h(s ?? []), e = [];
|
|
230
|
+
for (const [r, a] of t.entries()) {
|
|
231
|
+
const i = a.at(-1), d = o.get(r);
|
|
232
|
+
o.delete(r);
|
|
233
|
+
const l = (
|
|
117
234
|
// Only mark as deprecated if all overloads are deprecated
|
|
118
|
-
|
|
119
|
-
),
|
|
120
|
-
|
|
121
|
-
kind:
|
|
122
|
-
name:
|
|
123
|
-
deprecated:
|
|
124
|
-
}) :
|
|
125
|
-
kind:
|
|
126
|
-
name:
|
|
235
|
+
a.length === 1 || a.every((g) => g.deprecated !== void 0) ? i.deprecated : void 0
|
|
236
|
+
), m = r === "constructor" || r === "call-signature" ? void 0 : r;
|
|
237
|
+
l ? e.push({
|
|
238
|
+
kind: i.kind,
|
|
239
|
+
name: m,
|
|
240
|
+
deprecated: l
|
|
241
|
+
}) : d === void 0 && e.push({
|
|
242
|
+
kind: i.kind,
|
|
243
|
+
name: m,
|
|
127
244
|
added: !0
|
|
128
245
|
});
|
|
129
246
|
}
|
|
130
|
-
for (const [
|
|
131
|
-
const
|
|
247
|
+
for (const [r, [a]] of o.entries()) {
|
|
248
|
+
const i = r === "constructor" || r === "call-signature" ? void 0 : r;
|
|
132
249
|
e.push({
|
|
133
|
-
kind:
|
|
134
|
-
name:
|
|
135
|
-
removed: !0
|
|
250
|
+
kind: a.kind,
|
|
251
|
+
name: i,
|
|
252
|
+
removed: !0,
|
|
253
|
+
deprecated: a.deprecated
|
|
136
254
|
});
|
|
137
255
|
}
|
|
138
256
|
return e.length ? e : void 0;
|
|
139
257
|
}
|
|
140
258
|
export {
|
|
141
|
-
|
|
259
|
+
N as diffApiJson
|
|
142
260
|
};
|
package/dist/diff/types.d.ts
CHANGED
|
@@ -26,8 +26,9 @@ export interface ApiDiffBase {
|
|
|
26
26
|
*/
|
|
27
27
|
added?: true;
|
|
28
28
|
/**
|
|
29
|
-
* Whether this declaration is deprecated in the new api.json
|
|
30
|
-
*
|
|
29
|
+
* Whether this declaration is deprecated in the new api.json. If declaration
|
|
30
|
+
* was removed, but was deprecated in the old api.json, this will show the old
|
|
31
|
+
* deprecation message as it points at the replacement API.
|
|
31
32
|
* If the value is a string, it's the reason for the deprecation.
|
|
32
33
|
* Deprecated takes precedence over added.
|
|
33
34
|
*
|