@arcgis/api-extractor 5.1.0-next.6 → 5.1.0-next.61
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/bin/cli.js +2 -0
- package/dist/{ApiExtractor-a7k258P9.js → ApiExtractor-JNCM-Ph9.js} +44 -41
- package/dist/ApiExtractor-zW-FaUfq.js +2664 -0
- package/dist/{apiHelpers-BYzO767m.js → apiHelpers-DWMIGwi4.js} +3 -3
- package/dist/apiJson.d.ts +7 -0
- package/dist/cli-7PX_wNxb.js +34 -0
- package/dist/cli.js +29 -11
- 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.d.ts +1 -1
- package/dist/extractor/config.js +3 -3
- package/dist/extractor/processing/links.js +1 -1
- package/dist/{typeScript-CzDhKMio.js → typeScript-CU8ez5Fg.js} +1 -1
- package/dist/typeScript-ClrSgMdp.js +64 -0
- package/dist/utils/apiHelpers.js +1 -1
- package/dist/utils/createIndex.d.ts +1 -1
- package/dist/utils/createIndex.js +46 -45
- package/dist/vite/plugin.js +41 -39
- package/dist/vite/typeScript.js +1 -1
- package/dist/{worker-BumU_fFG.js → worker-5fzUwZzH.js} +466 -461
- package/dist/worker-CYO-8-EF.js +3682 -0
- package/package.json +9 -4
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
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../typeScript-
|
|
2
|
-
import "../worker-
|
|
1
|
+
import "../typeScript-CU8ez5Fg.js";
|
|
2
|
+
import "../worker-5fzUwZzH.js";
|
|
3
3
|
import "./processing/links.js";
|
|
4
4
|
import "typescript";
|
|
5
|
-
import { A as x } from "../ApiExtractor-
|
|
5
|
+
import { A as x } from "../ApiExtractor-zW-FaUfq.js";
|
|
6
6
|
import "@arcgis/toolkit/function";
|
|
7
7
|
export {
|
|
8
8
|
x as ApiExtractor
|
|
@@ -186,7 +186,7 @@ export interface ApiExtractorTypesConfig {
|
|
|
186
186
|
* anyway, this option deduplicates work by removing the need for you to run
|
|
187
187
|
* type checking separately.
|
|
188
188
|
*
|
|
189
|
-
* @default // false if running standalone. true if running in Vite.
|
|
189
|
+
* @default // false if running standalone or in storybook. true if running in Vite.
|
|
190
190
|
*/
|
|
191
191
|
readonly fullTypeCheck?: boolean;
|
|
192
192
|
/**
|
package/dist/extractor/config.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "@arcgis/components-build-utils";
|
|
2
|
-
import "../typeScript-
|
|
3
|
-
import { l as n, m as A, r as C } from "../worker-
|
|
2
|
+
import "../typeScript-CU8ez5Fg.js";
|
|
3
|
+
import { l as n, m as A, r as C } from "../worker-5fzUwZzH.js";
|
|
4
4
|
import "./processing/links.js";
|
|
5
5
|
import "typescript";
|
|
6
6
|
import "fs/promises";
|
|
7
7
|
import "chalk";
|
|
8
8
|
import "util";
|
|
9
9
|
import "@arcgis/toolkit/string";
|
|
10
|
-
import "../apiHelpers-
|
|
10
|
+
import "../apiHelpers-DWMIGwi4.js";
|
|
11
11
|
import "@arcgis/toolkit/function";
|
|
12
12
|
import "node:fs";
|
|
13
13
|
import "node:url";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import C from "chalk";
|
|
2
|
-
import { u as a, g as P, v as w } from "../../apiHelpers-
|
|
2
|
+
import { u as a, g as P, v as w } from "../../apiHelpers-DWMIGwi4.js";
|
|
3
3
|
import { kebabToPascal as I } from "@arcgis/toolkit/string";
|
|
4
4
|
function R(e, n) {
|
|
5
5
|
if (typeof e == "string") {
|
|
@@ -2,7 +2,7 @@ import { findPath as v, path as C, toSystemPathSeparators as y } from "@arcgis/c
|
|
|
2
2
|
import t from "typescript";
|
|
3
3
|
import E, { supportsColorStderr as S } from "chalk";
|
|
4
4
|
import { styleText as w } from "util";
|
|
5
|
-
const P = "@arcgis/api-extractor", D = "5.1.0-next.
|
|
5
|
+
const P = "@arcgis/api-extractor", D = "5.1.0-next.61", N = {
|
|
6
6
|
name: P,
|
|
7
7
|
version: D
|
|
8
8
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { findPath as v, path as C, toSystemPathSeparators as y } from "@arcgis/components-build-utils";
|
|
2
|
+
import t from "typescript";
|
|
3
|
+
import E, { supportsColorStderr as S } from "chalk";
|
|
4
|
+
import { styleText as w } from "util";
|
|
5
|
+
const P = "@arcgis/api-extractor", D = "5.1.0-next.60", N = {
|
|
6
|
+
name: P,
|
|
7
|
+
version: D
|
|
8
|
+
};
|
|
9
|
+
let u;
|
|
10
|
+
function A(o) {
|
|
11
|
+
return u ??= t.createPrinter(), u.printNode(t.EmitHint.Unspecified, o, void 0);
|
|
12
|
+
}
|
|
13
|
+
function F(o, r) {
|
|
14
|
+
return o.pos !== -1 && o.end !== -1 && r !== void 0 ? o.getText(r) : A(o);
|
|
15
|
+
}
|
|
16
|
+
const p = N.name, g = {
|
|
17
|
+
getCurrentDirectory: process.cwd,
|
|
18
|
+
getCanonicalFileName: (o) => o,
|
|
19
|
+
getNewLine: () => t.sys.newLine
|
|
20
|
+
}, W = function(o, { file: r, node: n, scope: s, start: i, length: c }) {
|
|
21
|
+
this.errorCount += 1, process.exitCode = 1, i ??= n === void 0 || n.pos === -1 ? -1 : n.getStart(r, !1);
|
|
22
|
+
const a = n?.end ?? -1;
|
|
23
|
+
c ??= a === -1 ? -1 : Math.max(1, a - i);
|
|
24
|
+
const e = i >= 0 && c >= 0, d = !e && s !== void 0, f = {
|
|
25
|
+
category: t.DiagnosticCategory.Error,
|
|
26
|
+
code: e ? p : x,
|
|
27
|
+
file: d ? void 0 : r,
|
|
28
|
+
start: e ? i : 0,
|
|
29
|
+
length: e ? c : 0,
|
|
30
|
+
messageText: (d ? `${E.cyan(s)}: ` : "") + o + (e || n === void 0 ? "" : `
|
|
31
|
+
|
|
32
|
+
${F(n, r)}`)
|
|
33
|
+
}, l = t.formatDiagnosticsWithColorAndContext([f], g), m = S ? l : l.replaceAll($, ""), h = e ? m : m.replace(x.toString(), p);
|
|
34
|
+
this.config.context.logger.error(h);
|
|
35
|
+
}, x = 1490, $ = /\x1B\[[0-9;]*m/gu, J = w("cyan", `[${p}] `);
|
|
36
|
+
function U(o = process.cwd(), r, n) {
|
|
37
|
+
const s = r === void 0 ? v("tsconfig.json", o) : C.resolve(o, r);
|
|
38
|
+
if (s === void 0)
|
|
39
|
+
throw Error(
|
|
40
|
+
`Unable to find ${y(String(r))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`
|
|
41
|
+
);
|
|
42
|
+
const i = t.readConfigFile(s, t.sys.readFile);
|
|
43
|
+
if (i.error !== void 0)
|
|
44
|
+
throw Error(t.formatDiagnosticsWithColorAndContext([i.error], g));
|
|
45
|
+
const c = i.config, a = n ? c : {
|
|
46
|
+
...c,
|
|
47
|
+
include: [],
|
|
48
|
+
files: [],
|
|
49
|
+
exclude: []
|
|
50
|
+
}, e = t.parseJsonConfigFileContent(a, t.sys, C.dirname(s)), d = 18002, f = n ? e.errors : e.errors.filter((l) => l.code !== d);
|
|
51
|
+
if (f.length > 0)
|
|
52
|
+
throw Error(t.formatDiagnosticsWithColorAndContext(f, g));
|
|
53
|
+
return {
|
|
54
|
+
configPath: s,
|
|
55
|
+
config: e
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
g as a,
|
|
60
|
+
U as b,
|
|
61
|
+
W as e,
|
|
62
|
+
J as l,
|
|
63
|
+
N as p
|
|
64
|
+
};
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as s, k as r, j as o,
|
|
1
|
+
import { d as s, k as r, j as o, w as i, u as p, h as t, v as m, i as d, e as A, x as c, q as g, y as M, m as b, n as l } from "../apiHelpers-DWMIGwi4.js";
|
|
2
2
|
export {
|
|
3
3
|
s as apiTypeToImportType,
|
|
4
4
|
r as compareClassMembers,
|
|
@@ -7,7 +7,7 @@ export interface IndexedModule {
|
|
|
7
7
|
readonly apiModule: ApiModule;
|
|
8
8
|
readonly classLike?: ApiClassDeclaration | ApiCustomElementDeclaration | ApiMixinDeclaration;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Superclasses ancestors. Sorted from most immediate to furthest
|
|
11
11
|
* ancestor.
|
|
12
12
|
*
|
|
13
13
|
* The type reference may refer to a local module or an external package.
|
|
@@ -1,82 +1,83 @@
|
|
|
1
|
-
function y(
|
|
2
|
-
const
|
|
3
|
-
return k(
|
|
1
|
+
function y(t) {
|
|
2
|
+
const o = g(t.modules);
|
|
3
|
+
return k(o), o;
|
|
4
4
|
}
|
|
5
|
-
function g(
|
|
6
|
-
const
|
|
7
|
-
for (let
|
|
8
|
-
const n = s
|
|
5
|
+
function g(t) {
|
|
6
|
+
const o = /* @__PURE__ */ new Map();
|
|
7
|
+
for (let s = 0; s < t.length; ++s) {
|
|
8
|
+
const n = t[s];
|
|
9
9
|
let i;
|
|
10
10
|
for (let a = 0; a < n.declarations.length; ++a) {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
i =
|
|
11
|
+
const e = n.declarations[a];
|
|
12
|
+
if (e.kind === "class" || e.kind === "mixin") {
|
|
13
|
+
i = e;
|
|
14
14
|
break;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
o.set(n.path, {
|
|
18
18
|
apiModule: n,
|
|
19
19
|
classLike: i,
|
|
20
20
|
ancestors: void 0,
|
|
21
21
|
children: void 0
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return o;
|
|
25
25
|
}
|
|
26
|
-
function k(
|
|
27
|
-
for (const
|
|
28
|
-
p(
|
|
26
|
+
function k(t) {
|
|
27
|
+
for (const o of t.values())
|
|
28
|
+
p(o, t);
|
|
29
29
|
}
|
|
30
|
-
function p(
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
30
|
+
function p(t, o) {
|
|
31
|
+
const s = t.classLike;
|
|
32
|
+
if (s === void 0)
|
|
33
33
|
return;
|
|
34
|
-
const n =
|
|
35
|
-
if (!(
|
|
36
|
-
if (
|
|
37
|
-
for (let a =
|
|
38
|
-
|
|
39
|
-
n.superclass !== void 0 &&
|
|
34
|
+
const n = s;
|
|
35
|
+
if (!(t.ancestors !== void 0 || s.mixins === void 0 && n.superclass === void 0)) {
|
|
36
|
+
if (t.ancestors ??= [], s.mixins !== void 0)
|
|
37
|
+
for (let a = s.mixins.length - 1; a >= 0; --a)
|
|
38
|
+
f(s.mixins[a], t, o);
|
|
39
|
+
n.superclass !== void 0 && v(n.superclass, t, o);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
44
|
-
const n =
|
|
45
|
-
|
|
42
|
+
function f(t, o, s) {
|
|
43
|
+
if (t.module !== void 0 && t.package === void 0) {
|
|
44
|
+
const n = s.get(t.module);
|
|
45
|
+
if (n === void 0)
|
|
46
|
+
return;
|
|
47
|
+
p(n, s), n.children ??= [], n.children.push(o);
|
|
46
48
|
}
|
|
47
|
-
t.ancestors.push(s);
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
if (!(
|
|
51
|
-
|
|
50
|
+
function v(t, o, s) {
|
|
51
|
+
if (!(t.module !== void 0 && t.package === void 0)) {
|
|
52
|
+
o.ancestors.push(t);
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
const i =
|
|
55
|
-
p(i,
|
|
55
|
+
const i = s.get(t.module);
|
|
56
|
+
p(i, s), i.children ??= [], i.children.push(o);
|
|
56
57
|
const a = i.classLike;
|
|
57
|
-
if (a.kind === "mixin" && a.name !==
|
|
58
|
+
if (a.kind === "mixin" && a.name !== t.name && t.name !== "default") {
|
|
58
59
|
const u = i.apiModule.declarations;
|
|
59
|
-
for (let
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
const l =
|
|
60
|
+
for (let r = 0; r < u.length; ++r) {
|
|
61
|
+
const d = u[r];
|
|
62
|
+
if (d.name === t.name) {
|
|
63
|
+
const l = d;
|
|
63
64
|
for (let m = l.supertypes.length - 1; m >= 1; --m) {
|
|
64
|
-
const c = l.supertypes[m],
|
|
65
|
+
const c = l.supertypes[m], h = c.module === void 0 && c.package === void 0 ? {
|
|
65
66
|
name: c.name,
|
|
66
|
-
module:
|
|
67
|
+
module: t.module,
|
|
67
68
|
package: void 0,
|
|
68
69
|
viewUrl: c.viewUrl,
|
|
69
70
|
typeArguments: c.typeArguments
|
|
70
71
|
} : c;
|
|
71
|
-
|
|
72
|
+
f(h, o, s);
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
v(l.supertypes[0], o, s);
|
|
74
75
|
break;
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
} else
|
|
78
|
-
|
|
79
|
-
i.ancestors !== void 0 &&
|
|
79
|
+
o.ancestors.push(t);
|
|
80
|
+
i.ancestors !== void 0 && o.ancestors.push(...i.ancestors);
|
|
80
81
|
}
|
|
81
82
|
export {
|
|
82
83
|
y as createIndex
|
package/dist/vite/plugin.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import { A as
|
|
3
|
-
import { p as
|
|
4
|
-
import { writeFile as
|
|
1
|
+
import { l as O, m as J } from "../worker-5fzUwZzH.js";
|
|
2
|
+
import { A as S, w as T } from "../ApiExtractor-zW-FaUfq.js";
|
|
3
|
+
import { p as A, l as C } from "../typeScript-CU8ez5Fg.js";
|
|
4
|
+
import { writeFile as M } from "node:fs/promises";
|
|
5
5
|
import { path as w } from "@arcgis/components-build-utils";
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
let t = !1,
|
|
9
|
-
async function x(d,
|
|
10
|
-
if (
|
|
6
|
+
const N = A.name;
|
|
7
|
+
function $(s = {}) {
|
|
8
|
+
let t = !1, v = !1, e, o, c, l, E = !0, h = !1, f, m, u, y, p;
|
|
9
|
+
async function x(d, n) {
|
|
10
|
+
if (n.dtsFiles !== void 0 && u !== "") {
|
|
11
11
|
const g = w.join(w.resolve(p, u), "/");
|
|
12
|
-
await
|
|
12
|
+
await T(g, !1, d.changedDtsFiles ?? n.dtsFiles);
|
|
13
13
|
}
|
|
14
|
-
y !== "" && await
|
|
14
|
+
y !== "" && await M(
|
|
15
15
|
y,
|
|
16
|
-
d.config.context.environment === "production" ? JSON.stringify(
|
|
16
|
+
d.config.context.environment === "production" ? JSON.stringify(n.apiJson) : JSON.stringify(n.apiJson, null, 2)
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
return {
|
|
20
|
-
name:
|
|
20
|
+
name: N,
|
|
21
21
|
async configResolved(d) {
|
|
22
22
|
if (e = d, t = e.command === "build", !t && s.serve?.extract !== !0)
|
|
23
23
|
return;
|
|
24
|
-
|
|
25
|
-
const
|
|
24
|
+
v = (t ? e.build.watch : e.server.watch) !== null;
|
|
25
|
+
const n = e.resolve.conditions.includes("storybook");
|
|
26
|
+
p = e.configFile === void 0 ? e.root : w.dirname(e.configFile);
|
|
27
|
+
const g = {
|
|
26
28
|
context: {
|
|
27
29
|
// Handled by Vite
|
|
28
30
|
emptyDtsEmitPath: !1,
|
|
@@ -33,11 +35,11 @@ function V(s = {}) {
|
|
|
33
35
|
// It is desirable to type-check as part of build. Thus, we can do
|
|
34
36
|
// typed extraction essentially for free.
|
|
35
37
|
typeCheckedExtraction: !0,
|
|
36
|
-
fullTypeCheck: t,
|
|
37
|
-
afterDiagnostic(
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
throw
|
|
38
|
+
fullTypeCheck: t && !n,
|
|
39
|
+
afterDiagnostic(i) {
|
|
40
|
+
if (i.length > 0 && !v) {
|
|
41
|
+
const b = new Error("TypeScript errors reported. See error messages above");
|
|
42
|
+
throw b.stack = "", b;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
},
|
|
@@ -49,35 +51,35 @@ function V(s = {}) {
|
|
|
49
51
|
// if desired.
|
|
50
52
|
clearScreen: !1,
|
|
51
53
|
skipWritingUnchanged: d.build.emptyOutDir === !1,
|
|
52
|
-
onUpdate(
|
|
53
|
-
f =
|
|
54
|
-
x(
|
|
55
|
-
}, 250)),
|
|
54
|
+
onUpdate(i) {
|
|
55
|
+
f = i.then((a) => (c = a ?? c, f = void 0, clearTimeout(m), t && !h && a !== void 0 && (a.changedModules.length > 0 || a.removedModules.length > 0) && (m = setTimeout(() => {
|
|
56
|
+
x(o, a);
|
|
57
|
+
}, 250)), a));
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
|
-
},
|
|
59
|
-
u = t ?
|
|
60
|
-
const
|
|
61
|
-
...
|
|
60
|
+
}, P = s.configFilePath === "" ? void 0 : await O(p, s.configFilePath), F = s.unsafeConfigOverride ?? {}, D = P === void 0 ? g : J(g, P), r = F === void 0 ? D : J(D, F);
|
|
61
|
+
u = t ? r.context?.dtsEmitPath ?? e.build.outDir : "", y = t ? r.context?.apiJsonEmitPath ?? "" : "";
|
|
62
|
+
const W = r.context?.logger ?? e.logger ?? console, k = {
|
|
63
|
+
...r,
|
|
62
64
|
context: {
|
|
63
|
-
...
|
|
65
|
+
...r.context,
|
|
64
66
|
dtsEmitPath: "",
|
|
65
67
|
apiJsonEmitPath: "",
|
|
66
68
|
logger: {
|
|
67
|
-
info(
|
|
68
|
-
!t ||
|
|
69
|
+
info(i) {
|
|
70
|
+
!t || i.startsWith(`${C}Wrote `) || W.info(i);
|
|
69
71
|
},
|
|
70
|
-
error(
|
|
71
|
-
|
|
72
|
+
error(i) {
|
|
73
|
+
W.error(i);
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
},
|
|
75
77
|
types: {
|
|
76
|
-
...
|
|
77
|
-
forceProduceDts:
|
|
78
|
+
...r.types,
|
|
79
|
+
forceProduceDts: r.types?.forceProduceDts === !0 || u !== ""
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
|
-
|
|
82
|
+
o = new S(k), s.afterExtractorCreated?.(o);
|
|
81
83
|
},
|
|
82
84
|
/**
|
|
83
85
|
* TypeScript reads files directly from the file system - Vite's
|
|
@@ -87,10 +89,10 @@ function V(s = {}) {
|
|
|
87
89
|
* match what "npx tsc" would report.
|
|
88
90
|
*/
|
|
89
91
|
async buildStart() {
|
|
90
|
-
|
|
92
|
+
h = !0, clearTimeout(m), !(o === void 0 || !E) && (E = !1, v ? l = await o.watch() : c = await o.run());
|
|
91
93
|
},
|
|
92
94
|
async writeBundle() {
|
|
93
|
-
clearTimeout(m), f !== void 0 && await f,
|
|
95
|
+
clearTimeout(m), f !== void 0 && await f, o !== void 0 && c !== void 0 && await x(o, c), h = !1;
|
|
94
96
|
},
|
|
95
97
|
// Fires if dev server is closed programmatically. Ctrl+C is handled by Node
|
|
96
98
|
async closeBundle() {
|
|
@@ -103,5 +105,5 @@ function V(s = {}) {
|
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
export {
|
|
106
|
-
|
|
108
|
+
$ as useApiExtractor
|
|
107
109
|
};
|