@arcgis/api-extractor 5.1.0-next.13 → 5.1.0-next.131
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/README.md +2 -2
- package/bin/cli.js +2 -0
- package/dist/{ApiExtractor-CsZw1gc4.js → ApiExtractor-BGS5EKsb.js} +533 -496
- package/dist/apiJson.d.ts +22 -7
- package/dist/cli.js +0 -1
- package/dist/diff/apiDiffToMarkdown.js +48 -48
- package/dist/extractor/ApiExtractor.js +3 -3
- package/dist/extractor/config.d.ts +12 -3
- package/dist/extractor/config.js +7 -8
- package/dist/extractor/extractors/copyDoc.d.ts +11 -5
- package/dist/extractor/processing/links.js +40 -39
- package/dist/privateContext-CB7P40up.js +86 -0
- package/dist/typeScript-A4VCaB_l.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/hydrateApiType.js +25 -24
- package/dist/utils/inferEntrypoints.js +1 -0
- package/dist/utils/partPrinter.js +29 -28
- package/dist/vite/plugin.js +41 -39
- package/dist/vite/typeScript.js +1 -1
- package/dist/worker-DgLbFKBs.js +3705 -0
- package/package.json +10 -10
- package/dist/apiHelpers-BYzO767m.js +0 -161
- package/dist/typeScript-C2M4aviw.js +0 -64
- package/dist/worker-oskaUWnO.js +0 -3680
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { findPath as E, path as u, toSystemPathSeparators as S } from "@arcgis/components-build-utils";
|
|
2
|
+
import t from "typescript";
|
|
3
|
+
import { styleText as f } from "util";
|
|
4
|
+
const w = "@arcgis/api-extractor", P = "5.1.0-next.131", D = {
|
|
5
|
+
name: w,
|
|
6
|
+
version: P
|
|
7
|
+
};
|
|
8
|
+
let x;
|
|
9
|
+
function N(o) {
|
|
10
|
+
return x ??= t.createPrinter(), x.printNode(t.EmitHint.Unspecified, o, void 0);
|
|
11
|
+
}
|
|
12
|
+
function A(o, e) {
|
|
13
|
+
return o.pos !== -1 && o.end !== -1 && e !== void 0 ? o.getText(e) : N(o);
|
|
14
|
+
}
|
|
15
|
+
let h;
|
|
16
|
+
const g = D.name, m = {
|
|
17
|
+
getCurrentDirectory: process.cwd,
|
|
18
|
+
getCanonicalFileName: (o) => o,
|
|
19
|
+
getNewLine: () => t.sys.newLine
|
|
20
|
+
}, L = function(o, { file: e, node: n, scope: i, start: s, length: c }) {
|
|
21
|
+
this.errorCount += 1, process.exitCode = 1, s ??= n === void 0 || n.pos === -1 ? -1 : n.getStart(e, !1);
|
|
22
|
+
const a = n?.end ?? -1;
|
|
23
|
+
c ??= a === -1 ? -1 : Math.max(1, a - s);
|
|
24
|
+
const r = s >= 0 && c >= 0, d = !r && i !== void 0, l = {
|
|
25
|
+
category: t.DiagnosticCategory.Error,
|
|
26
|
+
code: r ? g : v,
|
|
27
|
+
file: d ? void 0 : e,
|
|
28
|
+
start: r ? s : 0,
|
|
29
|
+
length: r ? c : 0,
|
|
30
|
+
messageText: (d ? `${f("cyan", i, { stream: process.stderr })}: ` : "") + o + (r || n === void 0 ? "" : `
|
|
31
|
+
|
|
32
|
+
${A(n, e)}`)
|
|
33
|
+
}, p = t.formatDiagnosticsWithColorAndContext([l], m);
|
|
34
|
+
h ??= process.env.CI !== void 0 || f("red", "", { stream: process.stderr }) !== "";
|
|
35
|
+
const C = h ? p : p.replaceAll(F, ""), y = r ? C : C.replace(v.toString(), g);
|
|
36
|
+
this.config.context.logger.error(y);
|
|
37
|
+
}, v = 1490, F = /\x1B\[[0-9;]*m/gu, W = f("cyan", `[${g}] `);
|
|
38
|
+
function k(o = process.cwd(), e, n) {
|
|
39
|
+
const i = e === void 0 ? E("tsconfig.json", o) : u.resolve(o, e);
|
|
40
|
+
if (i === void 0)
|
|
41
|
+
throw Error(
|
|
42
|
+
`Unable to find ${S(String(e))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`
|
|
43
|
+
);
|
|
44
|
+
const s = t.readConfigFile(i, t.sys.readFile);
|
|
45
|
+
if (s.error !== void 0)
|
|
46
|
+
throw Error(t.formatDiagnosticsWithColorAndContext([s.error], m));
|
|
47
|
+
const c = s.config, a = n ? c : {
|
|
48
|
+
...c,
|
|
49
|
+
include: [],
|
|
50
|
+
files: [],
|
|
51
|
+
exclude: []
|
|
52
|
+
}, r = t.parseJsonConfigFileContent(a, t.sys, u.dirname(i)), d = 18002, l = n ? r.errors : r.errors.filter((p) => p.code !== d);
|
|
53
|
+
if (l.length > 0)
|
|
54
|
+
throw Error(t.formatDiagnosticsWithColorAndContext(l, m));
|
|
55
|
+
return {
|
|
56
|
+
configPath: i,
|
|
57
|
+
config: r
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
m as a,
|
|
62
|
+
k as b,
|
|
63
|
+
L as e,
|
|
64
|
+
W as l,
|
|
65
|
+
D as p
|
|
66
|
+
};
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -1,17 +1,80 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as f } from "../privateContext-CB7P40up.js";
|
|
2
|
+
const g = (e) => e.kind === "method", v = (e) => e.kind === "field";
|
|
3
|
+
function h(e, n) {
|
|
4
|
+
const o = e.sourcePath, i = n.sourcePath;
|
|
5
|
+
let t = 0;
|
|
6
|
+
for (; ; ) {
|
|
7
|
+
const c = o.indexOf("/", t), s = i.indexOf("/", t);
|
|
8
|
+
if (c === -1)
|
|
9
|
+
return s === -1 ? o.slice(t) < i.slice(t) ? -1 : 1 : -1;
|
|
10
|
+
if (s === -1)
|
|
11
|
+
return 1;
|
|
12
|
+
{
|
|
13
|
+
const r = o.slice(t, c), a = i.slice(t, s);
|
|
14
|
+
if (r !== a)
|
|
15
|
+
return r < a ? -1 : 1;
|
|
16
|
+
t = c + 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const p = "global:";
|
|
21
|
+
function x(e, n, o) {
|
|
22
|
+
const i = f(o.apiModule).file, t = i.text.indexOf(n) ?? -1;
|
|
23
|
+
o.emitError(`${e}${t === -1 ? `. Found in: ${n}` : ""}`, {
|
|
24
|
+
file: i,
|
|
25
|
+
node: void 0,
|
|
26
|
+
scope: i === void 0 ? o.apiModule.sourcePath : void 0,
|
|
27
|
+
start: t,
|
|
28
|
+
length: n.length
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const l = new Intl.Collator("en", { numeric: !0 }).compare, S = (e, n) => l(e.name, n.name), M = (e, n) => e.static !== void 0 && n.static === void 0 ? -1 : n.static !== void 0 && e.static === void 0 ? 1 : e.name === void 0 ? n.name === void 0 ? 0 : -1 : n.name === void 0 || "return" in e && !("return" in n) ? 1 : "return" in n && !("return" in e) ? -1 : l(e.name, n.name), d = (e) => e.name ?? (e.kind === "constructor" ? "constructor" : "call-signature"), P = (e) => e.static === !0 ? `static ${d(e)}` : d(e), T = (e) => ("bubbles" in e ? "@" : "") + (e.tagName ?? e.name ?? (e.kind === "constructor" ? "constructor" : "")) + ("return" in e ? "()" : "");
|
|
32
|
+
function k(e, n, o = -1) {
|
|
33
|
+
"description" in n && (n.description ??= e.description), "deprecated" in n && (n.deprecated ??= e.deprecated), "return" in n && e.return !== void 0 && (n.return.description ??= e.return?.description);
|
|
34
|
+
const { docsTags: i } = e, t = n;
|
|
35
|
+
if (o !== -1 && (i === void 0 && t.docsTags.length === 1 ? t.docsTags = void 0 : t.docsTags.splice(o, 1)), i !== void 0) {
|
|
36
|
+
t.docsTags ??= [];
|
|
37
|
+
const c = /* @__PURE__ */ new Set();
|
|
38
|
+
for (let s = 0; s < t.docsTags.length; ++s)
|
|
39
|
+
c.add(t.docsTags[s].name);
|
|
40
|
+
for (let s = 0; s < i.length; ++s) {
|
|
41
|
+
const r = i[s];
|
|
42
|
+
c.has(r.name) && r.name !== "example" && r.name !== "see" || t.docsTags.push(r);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function A(e, n) {
|
|
47
|
+
let o = e.text;
|
|
48
|
+
if (e.references !== void 0)
|
|
49
|
+
for (let i = e.references.length - 1; i >= 0; i--) {
|
|
50
|
+
const t = e.references[i];
|
|
51
|
+
if (t.package === p || t.module === void 0 && t.package === void 0 && t.viewUrl === void 0)
|
|
52
|
+
continue;
|
|
53
|
+
const r = t.name === "default" ? "default" : t.name, u = `import("${t.package === void 0 ? `./${t.module ?? n}.js` : t.package + (t.module === void 0 ? "" : `/${t.module}`)}").${r}`;
|
|
54
|
+
o = o.slice(0, t.start) + u + o.slice(t.end);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
...e,
|
|
58
|
+
text: o,
|
|
59
|
+
references: void 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function N(e) {
|
|
63
|
+
return e.return.type.text.startsWith("Promise<");
|
|
64
|
+
}
|
|
2
65
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
66
|
+
A as apiTypeToImportType,
|
|
67
|
+
M as compareClassMembers,
|
|
68
|
+
S as compareNamedNodes,
|
|
69
|
+
l as compareStrings,
|
|
70
|
+
x as emitJsDocError,
|
|
71
|
+
d as getApiMemberName,
|
|
72
|
+
T as getApiNodeLabel,
|
|
73
|
+
P as getMaybeStaticApiMemberName,
|
|
74
|
+
p as globalPackageIdentifier,
|
|
75
|
+
g as isApiMethod,
|
|
76
|
+
N as isApiMethodAsync,
|
|
77
|
+
v as isApiProperty,
|
|
78
|
+
k as mergeApiNodes,
|
|
79
|
+
h as naturalSortModules
|
|
17
80
|
};
|
|
@@ -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
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { globalPackageIdentifier as h } from "./apiHelpers.js";
|
|
1
2
|
const d = {
|
|
2
3
|
// Create a null prototype object to avoid collisions with Object.prototype when doing lookups
|
|
3
4
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -13,50 +14,50 @@ const d = {
|
|
|
13
14
|
never: "https://www.typescriptlang.org/docs/handbook/2/functions.html#never",
|
|
14
15
|
any: "https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any",
|
|
15
16
|
this: "#"
|
|
16
|
-
},
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
let
|
|
17
|
+
}, g = Object.keys(d).join("|"), p = new RegExp(`(?<!["'-])\\b(?:${g})\\b(?!["'-])`, "u");
|
|
18
|
+
function v(e, l) {
|
|
19
|
+
const o = [];
|
|
20
|
+
let n = e.text.length;
|
|
20
21
|
if (e.references !== void 0)
|
|
21
|
-
for (let
|
|
22
|
-
const t = e.references[
|
|
22
|
+
for (let c = e.references.length - 1; c >= 0; c--) {
|
|
23
|
+
const t = e.references[c];
|
|
23
24
|
if (t.start === void 0 || t.end === void 0)
|
|
24
25
|
continue;
|
|
25
|
-
const r = e.text.slice(t.end,
|
|
26
|
-
r.length > 0 && i(r,
|
|
26
|
+
const r = e.text.slice(t.end, n);
|
|
27
|
+
r.length > 0 && i(r, l, o);
|
|
27
28
|
const s = e.text.slice(t.start, t.end);
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
n = t.start, t.viewUrl === void 0 ? o.push(s) : o.push(
|
|
30
|
+
l(s, t)
|
|
30
31
|
);
|
|
31
32
|
}
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
i(
|
|
33
|
+
if (n > 0) {
|
|
34
|
+
const c = e.text.slice(0, n);
|
|
35
|
+
i(c, l, o);
|
|
35
36
|
}
|
|
36
|
-
return
|
|
37
|
+
return o.reverse();
|
|
37
38
|
}
|
|
38
|
-
function i(e,
|
|
39
|
-
const
|
|
40
|
-
for (let
|
|
41
|
-
const t = e.match(
|
|
39
|
+
function i(e, l, o) {
|
|
40
|
+
const n = o.length;
|
|
41
|
+
for (let c = 0; c < e.length; ) {
|
|
42
|
+
const t = e.match(p);
|
|
42
43
|
if (t?.index === void 0)
|
|
43
44
|
break;
|
|
44
45
|
const r = e.slice(0, t.index);
|
|
45
|
-
r.length > 0 &&
|
|
46
|
+
r.length > 0 && o.splice(n, 0, r);
|
|
46
47
|
const s = t[0];
|
|
47
48
|
e = e.slice(t.index + s.length);
|
|
48
|
-
const a = d[s], b =
|
|
49
|
+
const a = d[s], b = l(s, {
|
|
49
50
|
name: s,
|
|
50
51
|
module: void 0,
|
|
51
|
-
package: s === "this" ? void 0 :
|
|
52
|
+
package: s === "this" ? void 0 : h,
|
|
52
53
|
viewUrl: a,
|
|
53
54
|
start: void 0,
|
|
54
55
|
end: void 0
|
|
55
56
|
});
|
|
56
|
-
|
|
57
|
+
o.splice(n, 0, b);
|
|
57
58
|
}
|
|
58
|
-
e.length > 0 &&
|
|
59
|
+
e.length > 0 && o.splice(n, 0, e);
|
|
59
60
|
}
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
v as hydrateApiType
|
|
62
63
|
};
|
|
@@ -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-DgLbFKBs.js";
|
|
2
|
+
import { A as S, w as T } from "../ApiExtractor-BGS5EKsb.js";
|
|
3
|
+
import { p as A, l as C } from "../typeScript-A4VCaB_l.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
|
};
|