@arcgis/api-extractor 5.0.0-next.136 → 5.0.0-next.137
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-BwOcUvPV.js +2644 -0
- package/dist/apiJson.d.ts +706 -760
- package/dist/cli.js +26 -2
- package/dist/compilerHints.d.ts +62 -0
- package/dist/diff/diffApiJson.d.ts +6 -3
- package/dist/diff/diffApiJson.js +142 -0
- package/dist/diff/fetchApiJsonFromNpm.d.ts +5 -2
- package/dist/diff/fetchApiJsonFromNpm.js +9 -0
- package/dist/diff/types.d.ts +70 -56
- package/dist/diffTypes/index.d.ts +20 -23
- package/dist/diffTypes/index.js +4 -2
- package/dist/extractor/ApiExtractor.d.ts +72 -137
- package/dist/extractor/ApiExtractor.js +9 -0
- package/dist/extractor/config.d.ts +425 -39
- package/dist/extractor/config.js +17 -0
- package/dist/extractor/extractors/copyDoc.d.ts +25 -0
- package/dist/extractor/privateContext.d.ts +19 -0
- package/dist/extractor/privateContext.js +84 -0
- package/dist/extractor/processing/links.d.ts +12 -0
- package/dist/extractor/processing/links.js +177 -0
- package/dist/extractor/types.d.ts +40 -0
- package/dist/extractor/webComponent/findComponents.d.ts +19 -0
- package/dist/extractor/webComponent/findComponents.js +36 -0
- package/dist/extractor/webComponent/pathMapping.d.ts +11 -0
- package/dist/extractor/webComponent/pathMapping.js +44 -0
- package/dist/index.d.ts +164 -12
- package/dist/index.js +3 -841
- package/dist/typeScript-CzUTFiYO.js +64 -0
- package/dist/uiUtils/index.d.ts +10 -19
- package/dist/uiUtils/index.js +3 -55
- package/dist/utils/apiHelpers.d.ts +28 -61
- package/dist/utils/apiHelpers.js +80 -0
- package/dist/utils/astHelpers.d.ts +22 -21
- package/dist/utils/astHelpers.js +67 -0
- package/dist/utils/hydrateApiType.d.ts +26 -0
- package/dist/utils/hydrateApiType.js +62 -0
- package/dist/utils/inferEntrypoints.d.ts +17 -0
- package/dist/utils/inferEntrypoints.js +26 -0
- package/dist/utils/internalTypeScriptApis.d.ts +92 -0
- package/dist/utils/internalTypeScriptApis.js +58 -0
- package/dist/utils/partPrinter.d.ts +25 -19
- package/dist/utils/partPrinter.js +82 -0
- package/dist/vite/plugin.d.ts +53 -0
- package/dist/vite/plugin.js +107 -0
- package/dist/vite/typeScript.d.ts +16 -0
- package/dist/vite/typeScript.js +6 -0
- package/dist/worker-CULPfolw.js +3599 -0
- package/package.json +40 -9
- package/dist/cli.d.ts +0 -2
- package/dist/config/typeReferences/docLinkAdditions.d.ts +0 -51
- package/dist/config/typeReferences/globals.d.ts +0 -11
- package/dist/config/typeReferences/stringDocLinkAdditions.d.ts +0 -17
- package/dist/config/typeReferences/typeScriptGlobals.json.d.ts +0 -3
- package/dist/diff/index.d.ts +0 -3
- package/dist/diff/index.js +0 -149
- package/dist/ensureCemCompatibility.d.ts +0 -1
- package/dist/internalTypeScriptApis.d.ts +0 -31
- package/dist/types.d.ts +0 -22
- package/dist/utils/error.d.ts +0 -17
- package/dist/utils/jsDocHelpers.d.ts +0 -2
- package/dist/utils/jsDocParser.d.ts +0 -46
- package/dist/utils/jsDocPrinter.d.ts +0 -13
- package/dist/utils/print.d.ts +0 -6
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Command as
|
|
3
|
-
const e = new
|
|
2
|
+
import { Command as p } from "@commander-js/extra-typings";
|
|
3
|
+
const e = new p();
|
|
4
4
|
e.name("api-extractor").description("Extract public API from a TypeScript project to produce .d.ts types and api.json docs");
|
|
5
|
+
e.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
|
+
"--config <configPath>",
|
|
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
|
+
).option(
|
|
9
|
+
"--silence-broken-links",
|
|
10
|
+
"(deprecated) Do not emit errors for broken @links in JSDoc comments. Temporary option for migration period (default: false)"
|
|
11
|
+
).action(async (t) => {
|
|
12
|
+
const { loadApiExtractorConfig: o, mergeApiExtractorConfigs: n } = await import("./extractor/config.js"), a = await o(t.cwd, t.config), r = n(a, {
|
|
13
|
+
context: {
|
|
14
|
+
dtsEmitPath: t.dts,
|
|
15
|
+
apiJsonEmitPath: t.apiJson,
|
|
16
|
+
environment: t.environment === "development" ? "development" : void 0,
|
|
17
|
+
cwd: t.cwd
|
|
18
|
+
},
|
|
19
|
+
types: {
|
|
20
|
+
fullTypeCheck: t.typeCheck
|
|
21
|
+
},
|
|
22
|
+
verify: {
|
|
23
|
+
typeCheckTypes: t.verify,
|
|
24
|
+
detectBrokenLinks: t.silenceBrokenLinks === !0 ? !1 : void 0
|
|
25
|
+
}
|
|
26
|
+
}), { ApiExtractor: c } = await import("./extractor/ApiExtractor.js"), i = new c(r);
|
|
27
|
+
t.watch ? await i.watch() : await i.run();
|
|
28
|
+
});
|
|
5
29
|
e.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) => {
|
|
6
30
|
const { diffTypes: o } = await import("./diffTypes/index.js");
|
|
7
31
|
await o({
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We try to keep public and private types close to keep the API more
|
|
3
|
+
* maintainable. However, occasionally we must diverge to hide some private
|
|
4
|
+
* details from the public API.
|
|
5
|
+
*
|
|
6
|
+
* Use this type helper when public TypeScript type must diverge from the
|
|
7
|
+
* private type.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* type ActionType = PublicApiNarrowType<
|
|
12
|
+
* "create" | "update" | "delete",
|
|
13
|
+
* "create" | "delete"
|
|
14
|
+
* >;
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* In private types, the 1st type parameter will be used for type checking,
|
|
18
|
+
* making the effective type `"create" | "update" | "delete"`.
|
|
19
|
+
*
|
|
20
|
+
* But in public `.d.ts` and public docs, the above will appear like this:
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* type ActionType = "create" | "delete";
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Remember that properties without `public` tag are not publicly exposed.
|
|
27
|
+
* Thus, in practice, `PublicApiNarrowType` is most commonly needed to hide
|
|
28
|
+
* private union members.
|
|
29
|
+
*
|
|
30
|
+
* To ensure public type does not get out of date, `PublicApiNarrowType`
|
|
31
|
+
* requires that the public type extends the private type (or in other words, a
|
|
32
|
+
* subset of the private type). If that restriction is too tight, use
|
|
33
|
+
* `PublicApiRelaxType` instead.
|
|
34
|
+
*/
|
|
35
|
+
export type PublicApiNarrowType<PrivateType, _PublicType extends PrivateType> = PrivateType;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Most of the time, when the public type must diverge from the private type,
|
|
39
|
+
* the public type is a subset of the private type - in such cases use
|
|
40
|
+
* `PublicApiNarrowType`.
|
|
41
|
+
*
|
|
42
|
+
* Occasionally, the public type may need to be a superset of the private type
|
|
43
|
+
* or even an unrelated type. For those cases, use `PublicApiRelaxType`.
|
|
44
|
+
*
|
|
45
|
+
* Keep usages of `PublicApiRelaxType` at minimum as it disables type
|
|
46
|
+
* checking between public and private types.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* type EditableLayers = FeatureLayer | ...;
|
|
51
|
+
* class MyClass {
|
|
52
|
+
* // Layer is a superset of EditableLayers, not subset,
|
|
53
|
+
* // so we must use PublicApiRelaxType.
|
|
54
|
+
* layer: PublicApiRelaxType<EditableLayers, Layer>;
|
|
55
|
+
*
|
|
56
|
+
* // StrictNumberType is a branded type that is incompatible
|
|
57
|
+
* // with regular number type.
|
|
58
|
+
* jobId: PublicApiRelaxType<StrictNumberType<"JobId">, number>;
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export type PublicApiRelaxType<PrivateType, _PublicType> = PrivateType;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ApiJson } from
|
|
2
|
-
import { ApiDiff } from
|
|
1
|
+
import type { ApiJson } from "../apiJson.js";
|
|
2
|
+
import type { ApiDiff } from "./types.js";
|
|
3
|
+
|
|
3
4
|
/**
|
|
5
|
+
* @param oldApiJson
|
|
6
|
+
* @param newApiJson
|
|
4
7
|
* @example
|
|
5
8
|
* ```js
|
|
6
9
|
* import { diffApiJson, fetchApiJsonFromNpm } from "@arcgis/api-extractor/diff";
|
|
@@ -20,4 +23,4 @@ import { ApiDiff } from './types.ts';
|
|
|
20
23
|
* writeFileSync("api-diff.json", JSON.stringify(diff, null, 2));
|
|
21
24
|
* ```
|
|
22
25
|
*/
|
|
23
|
-
export
|
|
26
|
+
export function diffApiJson(oldApiJson: Pick<ApiJson, "modules">, newApiJson: Pick<ApiJson, "modules">): ApiDiff;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
function M(r, a) {
|
|
2
|
+
const n = new Map(r.modules.map((e) => [e.path, e])), t = [];
|
|
3
|
+
for (const e of a.modules) {
|
|
4
|
+
const s = n.get(e.path), i = k(s, e, !0);
|
|
5
|
+
i !== void 0 && t.push(i), n.delete(e.path);
|
|
6
|
+
}
|
|
7
|
+
for (const e of n.values()) {
|
|
8
|
+
const s = k(void 0, e, !1);
|
|
9
|
+
s !== void 0 && t.push(s);
|
|
10
|
+
}
|
|
11
|
+
return { modules: t };
|
|
12
|
+
}
|
|
13
|
+
function k(r, a, n) {
|
|
14
|
+
const t = [], e = h(r?.declarations ?? []), s = h(a.declarations ?? []);
|
|
15
|
+
for (const i of s.values()) {
|
|
16
|
+
const o = i.at(-1), p = o.tagName, u = p ?? o.name, f = e.get(u);
|
|
17
|
+
e.delete(u);
|
|
18
|
+
const g = f === void 0 && !n ? !0 : void 0, m = n && // Only mark as deprecated if all overloads are deprecated
|
|
19
|
+
(i.length === 1 || i.every((d) => d.deprecated !== void 0)) ? o.deprecated : void 0, D = !m && f === void 0 && n ? !0 : void 0;
|
|
20
|
+
if (g || D) {
|
|
21
|
+
t.push({
|
|
22
|
+
kind: o.kind,
|
|
23
|
+
name: o.name,
|
|
24
|
+
tagName: p,
|
|
25
|
+
members: void 0,
|
|
26
|
+
removed: g,
|
|
27
|
+
added: D,
|
|
28
|
+
deprecated: m
|
|
29
|
+
});
|
|
30
|
+
continue;
|
|
31
|
+
} else if (!n)
|
|
32
|
+
continue;
|
|
33
|
+
if (p !== void 0) {
|
|
34
|
+
const d = o, c = f?.[0], l = {
|
|
35
|
+
kind: d.kind,
|
|
36
|
+
name: d.name,
|
|
37
|
+
tagName: d.tagName,
|
|
38
|
+
deprecated: m,
|
|
39
|
+
added: void 0,
|
|
40
|
+
removed: void 0,
|
|
41
|
+
members: b(c?.members, d.members),
|
|
42
|
+
events: v(c?.events, d.events),
|
|
43
|
+
slots: v(c?.slots, d.slots),
|
|
44
|
+
cssParts: v(c?.cssParts, d.cssParts),
|
|
45
|
+
cssProperties: v(c?.cssProperties, d.cssProperties),
|
|
46
|
+
cssStates: v(c?.cssStates, d.cssStates)
|
|
47
|
+
};
|
|
48
|
+
(m !== void 0 || l.members !== void 0 || l.events !== void 0 || l.slots !== void 0 || l.cssParts !== void 0 || l.cssProperties !== void 0 || l.cssStates !== void 0) && t.push(l);
|
|
49
|
+
} else if (o.kind === "class" || o.kind === "interface" || o.kind === "mixin") {
|
|
50
|
+
const d = f?.[0], c = {
|
|
51
|
+
kind: o.kind,
|
|
52
|
+
name: o.name,
|
|
53
|
+
deprecated: m,
|
|
54
|
+
added: void 0,
|
|
55
|
+
removed: void 0,
|
|
56
|
+
members: b(d?.members, o.members),
|
|
57
|
+
events: "events" in o ? v(d?.events, o.events) : void 0
|
|
58
|
+
};
|
|
59
|
+
(m !== void 0 || c.members !== void 0 || c.events !== void 0) && t.push(c);
|
|
60
|
+
} else m !== void 0 && t.push({
|
|
61
|
+
kind: o.kind,
|
|
62
|
+
name: o.name,
|
|
63
|
+
deprecated: m,
|
|
64
|
+
added: void 0,
|
|
65
|
+
removed: void 0
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (n)
|
|
69
|
+
for (const [i] of e.values())
|
|
70
|
+
t.push({
|
|
71
|
+
kind: i.kind,
|
|
72
|
+
name: i.name,
|
|
73
|
+
tagName: i.tagName,
|
|
74
|
+
members: void 0,
|
|
75
|
+
removed: !0,
|
|
76
|
+
added: void 0,
|
|
77
|
+
deprecated: void 0
|
|
78
|
+
});
|
|
79
|
+
if (t.length !== 0)
|
|
80
|
+
return {
|
|
81
|
+
path: a.path,
|
|
82
|
+
declarations: t
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function h(r) {
|
|
86
|
+
const a = /* @__PURE__ */ new Map();
|
|
87
|
+
for (let n = 0; n < r.length; ++n) {
|
|
88
|
+
const t = r[n], e = t.tagName ?? t.name ?? t.kind, s = a.get(e);
|
|
89
|
+
s === void 0 ? a.set(e, [t]) : s.push(t);
|
|
90
|
+
}
|
|
91
|
+
return a;
|
|
92
|
+
}
|
|
93
|
+
function v(r, a) {
|
|
94
|
+
const n = h(r ?? []), t = [];
|
|
95
|
+
if (a !== void 0)
|
|
96
|
+
for (const e of a)
|
|
97
|
+
n.get(e.name) === void 0 ? t.push({
|
|
98
|
+
name: e.name,
|
|
99
|
+
added: !0
|
|
100
|
+
}) : e.deprecated && t.push({
|
|
101
|
+
name: e.name,
|
|
102
|
+
deprecated: e.deprecated
|
|
103
|
+
}), n.delete(e.name);
|
|
104
|
+
for (const [e] of n.values())
|
|
105
|
+
t.push({
|
|
106
|
+
name: e.name,
|
|
107
|
+
removed: !0
|
|
108
|
+
});
|
|
109
|
+
return t.length ? t : void 0;
|
|
110
|
+
}
|
|
111
|
+
function b(r, a) {
|
|
112
|
+
const n = h(r ?? []), t = h(a ?? []), e = [];
|
|
113
|
+
for (const [s, i] of t.entries()) {
|
|
114
|
+
const o = i.at(-1), p = n.get(s);
|
|
115
|
+
n.delete(s);
|
|
116
|
+
const u = (
|
|
117
|
+
// Only mark as deprecated if all overloads are deprecated
|
|
118
|
+
i.length === 1 || i.every((g) => g.deprecated !== void 0) ? o.deprecated : void 0
|
|
119
|
+
), f = s === "constructor" || s === "call-signature" ? void 0 : s;
|
|
120
|
+
u ? e.push({
|
|
121
|
+
kind: o.kind,
|
|
122
|
+
name: f,
|
|
123
|
+
deprecated: u
|
|
124
|
+
}) : p === void 0 && e.push({
|
|
125
|
+
kind: o.kind,
|
|
126
|
+
name: f,
|
|
127
|
+
added: !0
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
for (const [s, [i]] of n.entries()) {
|
|
131
|
+
const o = s === "constructor" || s === "call-signature" ? void 0 : s;
|
|
132
|
+
e.push({
|
|
133
|
+
kind: i.kind,
|
|
134
|
+
name: o,
|
|
135
|
+
removed: !0
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return e.length ? e : void 0;
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
M as diffApiJson
|
|
142
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { ApiJson } from
|
|
1
|
+
import type { ApiJson } from "../apiJson.js";
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Read dist/docs/api.json for a given NPM package.
|
|
4
5
|
*
|
|
6
|
+
* @param packageName
|
|
7
|
+
* @param semverVersion
|
|
5
8
|
* @example fetchApiJsonFromNpm("@arcgis/map-components", "latest");
|
|
6
9
|
*/
|
|
7
|
-
export
|
|
10
|
+
export function fetchApiJsonFromNpm(packageName: string, semverVersion: string): Promise<ApiJson>;
|
package/dist/diff/types.d.ts
CHANGED
|
@@ -1,83 +1,97 @@
|
|
|
1
|
-
import { ApiClassCallSignature, ApiClassConstructor, ApiClassDeclaration, ApiClassField, ApiClassMethod, ApiCustomElementDeclaration, ApiFunctionDeclaration, ApiInterfaceDeclaration, ApiMixinDeclaration, ApiModule, ApiVariableDeclaration } from
|
|
1
|
+
import type { ApiClassCallSignature, ApiClassConstructor, ApiClassDeclaration, ApiClassField, ApiClassMethod, ApiCustomElementDeclaration, ApiFunctionDeclaration, ApiInterfaceDeclaration, ApiMixinDeclaration, ApiModule, ApiVariableDeclaration } from "../apiJson.js";
|
|
2
|
+
|
|
2
3
|
export interface ApiDiff {
|
|
3
|
-
|
|
4
|
+
modules: ApiModuleDiff[];
|
|
4
5
|
}
|
|
6
|
+
|
|
5
7
|
export interface ApiModuleDiff {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
path: ApiModule["path"];
|
|
9
|
+
declarations: ApiDeclarationDiff[];
|
|
8
10
|
}
|
|
11
|
+
|
|
9
12
|
export interface ApiDiffBase {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* True if this declaration was removed in the new api.json.
|
|
16
|
+
* If class is removed, members are not listed.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
removed?: true;
|
|
21
|
+
/**
|
|
22
|
+
* True if this declaration was added in the new api.json.
|
|
23
|
+
* If class is added, members are not listed.
|
|
24
|
+
*
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
added?: true;
|
|
28
|
+
/**
|
|
29
|
+
* Whether this declaration is deprecated in the new api.json, regardless of
|
|
30
|
+
* whether it was deprecated in the old api.json.
|
|
31
|
+
* If the value is a string, it's the reason for the deprecation.
|
|
32
|
+
* Deprecated takes precedence over added.
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
deprecated?: boolean | string;
|
|
33
37
|
}
|
|
38
|
+
|
|
34
39
|
export type ApiDeclarationDiff = ApiClassDeclarationDiff | ApiCustomElementDeclarationDiff | ApiFunctionDeclarationDiff | ApiInterfaceDeclarationDiff | ApiMixinDeclarationDiff | ApiVariableDeclarationDiff;
|
|
40
|
+
|
|
35
41
|
export interface ApiClassDeclarationDiff extends ApiDiffBase {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
kind: ApiClassDeclaration["kind"];
|
|
43
|
+
/**
|
|
44
|
+
* Inherited members are not included in the diff.
|
|
45
|
+
* Also, if entire class is added/removed, members are not included in the diff.
|
|
46
|
+
*/
|
|
47
|
+
members?: ApiClassMemberDiff[];
|
|
48
|
+
events?: ApiDiffBase[];
|
|
43
49
|
}
|
|
50
|
+
|
|
44
51
|
export interface ApiInterfaceDeclarationDiff extends ApiDiffBase {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
kind: ApiInterfaceDeclaration["kind"];
|
|
53
|
+
/**
|
|
54
|
+
* Inherited members are not included in the diff.
|
|
55
|
+
* Also, if entire class is added/removed, members are not included in the diff.
|
|
56
|
+
*/
|
|
57
|
+
members?: ApiClassMemberDiff[];
|
|
51
58
|
}
|
|
59
|
+
|
|
52
60
|
export interface ApiMixinDeclarationDiff extends Omit<ApiClassDeclarationDiff, "kind"> {
|
|
53
|
-
|
|
61
|
+
kind: ApiMixinDeclaration["kind"];
|
|
54
62
|
}
|
|
63
|
+
|
|
55
64
|
export interface ApiCustomElementDeclarationDiff extends ApiClassDeclarationDiff {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
cssProperties?: ApiDiffBase[];
|
|
63
|
-
cssStates?: ApiDiffBase[];
|
|
65
|
+
/** Attributes diff is not included as attributes are based on members. */
|
|
66
|
+
tagName: ApiCustomElementDeclaration["tagName"];
|
|
67
|
+
slots?: ApiDiffBase[];
|
|
68
|
+
cssParts?: ApiDiffBase[];
|
|
69
|
+
cssProperties?: ApiDiffBase[];
|
|
70
|
+
cssStates?: ApiDiffBase[];
|
|
64
71
|
}
|
|
72
|
+
|
|
65
73
|
export type ApiClassMemberDiff = ApiClassCallSignatureDiff | ApiClassConstructorDiff | ApiClassFieldDiff | ApiClassMethodDiff;
|
|
74
|
+
|
|
66
75
|
export interface ApiClassFieldDiff extends ApiDiffBase {
|
|
67
|
-
|
|
76
|
+
kind: ApiClassField["kind"];
|
|
68
77
|
}
|
|
78
|
+
|
|
69
79
|
export interface ApiClassMethodDiff extends ApiDiffBase {
|
|
70
|
-
|
|
80
|
+
kind: ApiClassMethod["kind"];
|
|
71
81
|
}
|
|
82
|
+
|
|
72
83
|
export interface ApiClassConstructorDiff extends Omit<ApiDiffBase, "name"> {
|
|
73
|
-
|
|
84
|
+
kind: ApiClassConstructor["kind"];
|
|
74
85
|
}
|
|
86
|
+
|
|
75
87
|
export interface ApiClassCallSignatureDiff extends Omit<ApiDiffBase, "name"> {
|
|
76
|
-
|
|
88
|
+
kind: ApiClassCallSignature["kind"];
|
|
77
89
|
}
|
|
90
|
+
|
|
78
91
|
export interface ApiFunctionDeclarationDiff extends ApiDiffBase {
|
|
79
|
-
|
|
92
|
+
kind: ApiFunctionDeclaration["kind"];
|
|
80
93
|
}
|
|
94
|
+
|
|
81
95
|
export interface ApiVariableDeclarationDiff extends ApiDiffBase {
|
|
82
|
-
|
|
83
|
-
}
|
|
96
|
+
kind: ApiVariableDeclaration["kind"];
|
|
97
|
+
}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
interface DiffTypesOptions {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* @default true
|
|
20
|
-
*/
|
|
21
|
-
truncate?: boolean;
|
|
1
|
+
export interface DiffTypesOptions {
|
|
2
|
+
/** Path to the original types folder. */
|
|
3
|
+
originalDtsPath: string;
|
|
4
|
+
/** Path to the new types folder. */
|
|
5
|
+
newDtsPath: string;
|
|
6
|
+
/**
|
|
7
|
+
* Path to the output markdown file.
|
|
8
|
+
*
|
|
9
|
+
* @default "types-diff.md"
|
|
10
|
+
*/
|
|
11
|
+
outputMdPath: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to truncate output if the diff is longer than 1000 lines.
|
|
14
|
+
*
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
truncate?: boolean;
|
|
22
18
|
}
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
|
|
20
|
+
/** @param options */
|
|
21
|
+
export function diffTypes(options: DiffTypesOptions): Promise<void>;
|
package/dist/diffTypes/index.js
CHANGED
|
@@ -21,7 +21,9 @@ async function b({
|
|
|
21
21
|
|
|
22
22
|
🧐 please verify that the changes to the public API/doc below are intentional.
|
|
23
23
|
🟥 If removing/changing APIs, remember the semver promise.
|
|
24
|
-
🟩 If adding APIs, add to release notes
|
|
24
|
+
🟩 If adding APIs, add to release notes.
|
|
25
|
+
|
|
26
|
+
`;
|
|
25
27
|
let f = g(r.split(`
|
|
26
28
|
`), n);
|
|
27
29
|
i && f.length > l && (o += `> [!WARNING]
|
|
@@ -34,7 +36,7 @@ async function b({
|
|
|
34
36
|
await m(s.dirname(e), { recursive: !0 }), await d(e, o);
|
|
35
37
|
}
|
|
36
38
|
function g(t, n) {
|
|
37
|
-
for (let e = 0; e < t.length; e
|
|
39
|
+
for (let e = 0; e < t.length; ++e) {
|
|
38
40
|
const i = t[e];
|
|
39
41
|
if (
|
|
40
42
|
// Make diff smaller by excluding the `diff ...` lines
|