@arcgis/api-extractor 5.1.0-next.9 → 5.1.0-next.91
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-n7bNNfky.js → ApiExtractor-eQY5NhCx.js} +223 -222
- package/dist/apiJson.d.ts +10 -3
- package/dist/cli.js +0 -1
- package/dist/diff/apiDiffToMarkdown.js +65 -67
- package/dist/diff/diffApiJson.js +107 -102
- package/dist/extractor/ApiExtractor.js +3 -3
- package/dist/extractor/config.d.ts +10 -1
- package/dist/extractor/config.js +7 -8
- package/dist/extractor/extractors/copyDoc.d.ts +1 -1
- package/dist/extractor/processing/links.js +65 -64
- package/dist/privateContext-CB7P40up.js +86 -0
- package/dist/typeScript-H1XCuOU6.js +66 -0
- package/dist/utils/apiHelpers.js +78 -15
- package/dist/utils/createIndex.d.ts +1 -1
- package/dist/utils/createIndex.js +46 -45
- package/dist/utils/partPrinter.js +29 -28
- package/dist/vite/plugin.js +41 -39
- package/dist/vite/typeScript.js +1 -1
- package/dist/worker-CzYU5Yle.js +3684 -0
- package/package.json +7 -7
- package/dist/apiHelpers-BYzO767m.js +0 -161
- package/dist/typeScript-CInYutJl.js +0 -64
- package/dist/worker-CkQr9LFy.js +0 -3681
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { d as l } from "../privateContext-CB7P40up.js";
|
|
2
|
+
function m(t, r, i, e, n, o) {
|
|
2
3
|
return `${`${r ? "export default " : "export "}${t ? "abstract " : ""}`}class ${i}${f(e)}${n === void 0 ? "" : ` extends ${n}`} {${o}}`;
|
|
3
4
|
}
|
|
4
5
|
function f(t) {
|
|
@@ -11,31 +12,31 @@ function f(t) {
|
|
|
11
12
|
}
|
|
12
13
|
return r += ">", r;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function v(t, r, i, e, n) {
|
|
15
16
|
const o = t ? "export default " : "export ";
|
|
16
17
|
let $ = "";
|
|
17
18
|
if (e !== void 0) {
|
|
18
19
|
$ = " extends ";
|
|
19
20
|
for (let c = 0; c < e.length; ++c)
|
|
20
|
-
$ += e[c], c < e.length - 1 && ($ += ", ");
|
|
21
|
+
$ += l(e[c]), c < e.length - 1 && ($ += ", ");
|
|
21
22
|
}
|
|
22
23
|
return `${o}interface ${r}${f(i)}${$} {${n}}`;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
const s = `${t ? "protected " : ""}${r ? "abstract " : ""}${i ? "static " : ""}`,
|
|
26
|
-
return `${s}${n === "" ? "" : d(n)}${e ? "?" : ""}${f(o)}(${
|
|
25
|
+
function g(t, r, i, e, n, o, $, c) {
|
|
26
|
+
const s = `${t ? "protected " : ""}${r ? "abstract " : ""}${i ? "static " : ""}`, x = c === void 0 ? "" : `: ${c}`;
|
|
27
|
+
return `${s}${n === "" ? "" : d(n)}${e ? "?" : ""}${f(o)}(${a($)})${x};`;
|
|
27
28
|
}
|
|
28
29
|
function d(t) {
|
|
29
|
-
return
|
|
30
|
+
return u.test(t) || t.startsWith("[") ? t : `"${t.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
33
|
-
return `${t ? "export default " : "export "}function ${r}${f(i)}(${
|
|
32
|
+
const h = (t) => !u.test(t) && !t.startsWith("["), u = /^[A-Za-z_$][A-Za-z0-9_$]*$/u;
|
|
33
|
+
function b(t, r, i, e, n) {
|
|
34
|
+
return `${t ? "export default " : "export "}function ${r}${f(i)}(${a(e)}): ${n};`;
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
return `${f(t.typeParameters)}(${
|
|
36
|
+
function A(t) {
|
|
37
|
+
return `${f(t.typeParameters)}(${a(t.parameters)}): ${t.return.type.text}`;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function a(t) {
|
|
39
40
|
if (t === void 0)
|
|
40
41
|
return "";
|
|
41
42
|
let r = "";
|
|
@@ -45,38 +46,38 @@ function u(t) {
|
|
|
45
46
|
}
|
|
46
47
|
return r;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function P(t, r, i, e, n, o, $, c) {
|
|
49
50
|
return `${`${t ? "protected " : ""}${r ? "abstract " : i ? "static " : ""}${e ? "readonly " : n ? "accessor " : ""}`}${d($)}${o ? "?" : ""}: ${c};`;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function N(t, r, i, e, n, o) {
|
|
52
53
|
const $ = `${t ? "protected " : ""}${r ? "abstract " : ""}${i ? "static " : ""}`, c = d(e), s = o === void 0 ? "" : `
|
|
53
54
|
${$}set ${c}(value: ${o});`;
|
|
54
55
|
return `${$}get ${c}(): ${n};${s}`;
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function z(t, r, i) {
|
|
57
58
|
const n = `${t ? "declare " : "export "}const ${r}: ${i};`;
|
|
58
59
|
return t ? `${n}
|
|
59
60
|
export default ${r};` : n;
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function R(t, r, i, e) {
|
|
62
63
|
let n = `export type ${t}${f(r)} = `;
|
|
63
64
|
if (i !== void 0)
|
|
64
65
|
for (let o = 0; o < i.length; ++o)
|
|
65
|
-
n += i[o], (o < i.length - 1 || e !== void 0) && (n += `
|
|
66
|
+
n += l(i[o]), (o < i.length - 1 || e !== void 0) && (n += `
|
|
66
67
|
& `);
|
|
67
68
|
return e !== void 0 && (n += e), n += ";", n;
|
|
68
69
|
}
|
|
69
70
|
export {
|
|
70
|
-
|
|
71
|
+
h as isPropertyEscapeNeeded,
|
|
71
72
|
d as maybeEscapePropertyName,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
m as printClass,
|
|
74
|
+
b as printFunction,
|
|
75
|
+
N as printGetterSetter,
|
|
76
|
+
v as printInterface,
|
|
77
|
+
g as printMethod,
|
|
78
|
+
P as printProperty,
|
|
79
|
+
A as printSignature,
|
|
80
|
+
R as printTypeAlias,
|
|
80
81
|
f as printTypeParameters,
|
|
81
|
-
|
|
82
|
+
z as printVariable
|
|
82
83
|
};
|
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-CzYU5Yle.js";
|
|
2
|
+
import { A as S, w as T } from "../ApiExtractor-eQY5NhCx.js";
|
|
3
|
+
import { p as A, l as C } from "../typeScript-H1XCuOU6.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
|
};
|