@arcgis/api-extractor 5.2.0-next.90 → 5.2.0-next.93
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-cixc5HhK.js → ApiExtractor-C2CJZrBq.js} +1998 -1719
- package/dist/apiJson.d.ts +11 -56
- package/dist/config-D0cgQ7jF.js +191 -0
- package/dist/diff/diffApiJson.js +108 -113
- package/dist/extractor/ApiExtractor.d.ts +3 -0
- package/dist/extractor/ApiExtractor.js +3 -4
- package/dist/extractor/config.d.ts +2 -2
- package/dist/extractor/config.js +11 -185
- package/dist/extractor/processing/links.js +69 -67
- package/dist/{privateContext-CZnnBVGR.js → privateContext-CjPsSpfv.js} +6 -4
- package/dist/utils/apiHelpers.js +1 -1
- package/dist/utils/partPrinter.js +1 -1
- package/dist/vite/plugin.d.ts +3 -1
- package/dist/vite/plugin.js +9 -10
- package/package.json +3 -4
- package/dist/typeScript-D3TNAYYk.js +0 -67
- package/dist/vite/typeScript.d.ts +0 -16
- package/dist/vite/typeScript.js +0 -7
|
@@ -2,7 +2,7 @@ import type ts from "typescript";
|
|
|
2
2
|
import type { PackageJson } from "@arcgis/node-toolkit/packageJson";
|
|
3
3
|
import type { CopyDocDefinitions } from "./extractors/copyDoc.js";
|
|
4
4
|
import type { ApiExtractor } from "./ApiExtractor.js";
|
|
5
|
-
import type { TypeScriptConfigResult } from "
|
|
5
|
+
import type { TypeScriptConfigResult } from "@arcgis/node-toolkit/vite/typeScript";
|
|
6
6
|
import type { ApiModule } from "../apiJson.js";
|
|
7
7
|
import type { ApiExtractorResult } from "./types.js";
|
|
8
8
|
|
|
@@ -215,7 +215,7 @@ export interface ApiExtractorTypesConfig {
|
|
|
215
215
|
*/
|
|
216
216
|
readonly typeScriptConfigPath?: string;
|
|
217
217
|
/**
|
|
218
|
-
* A resolved config returned by
|
|
218
|
+
* A resolved config returned by \@arcgis/node-toolkit/vite/typeScript
|
|
219
219
|
* Useful if you already resolved the config for other purposes and wish to
|
|
220
220
|
* deduplicate the work.
|
|
221
221
|
*/
|
package/dist/extractor/config.js
CHANGED
|
@@ -1,187 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
function $(e) {
|
|
10
|
-
if (e.isResolvedConfig === !0)
|
|
11
|
-
return e;
|
|
12
|
-
const t = e.context, o = e.types, n = e.documentation, r = `${t?.cwd === void 0 ? E() : y.resolve(t?.cwd)}/`, s = t?.packageJson ?? U(r);
|
|
13
|
-
let c = t?.basePath ?? "src/";
|
|
14
|
-
c.endsWith("/") || (c += "/");
|
|
15
|
-
const m = "customElements" in s && "@arcgis/lumina" in (s.dependencies ?? {}), l = o?.typeCheckedExtraction ?? m, p = o?.fullTypeCheck ?? !1, a = o?.typeScriptConfig ?? (l || p ? b(r, o?.typeScriptConfigPath, !0) : {
|
|
16
|
-
configPath: "",
|
|
17
|
-
config: {
|
|
18
|
-
options: {},
|
|
19
|
-
fileNames: [],
|
|
20
|
-
errors: []
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
if (o?.typeScriptConfig?.config.fileNames.length === 0)
|
|
24
|
-
throw Error(
|
|
25
|
-
`${I.name}: Provided types.typeScriptConfig has no included files. If you used loadTypeScriptConfig, make sure to set resolveIncludedFiles to true.`
|
|
26
|
-
);
|
|
27
|
-
const h = {
|
|
28
|
-
config: {
|
|
29
|
-
...a.config,
|
|
30
|
-
options: {
|
|
31
|
-
...a.config.options,
|
|
32
|
-
...o?.compilerOptions
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
configPath: a.configPath
|
|
36
|
-
}, g = t?.dtsEmitPath === void 0 || t?.dtsEmitPath === "" ? "" : `${y.resolve(r, t.dtsEmitPath)}/`, x = g !== "", P = t?.environment ?? "production", u = P === "development", D = t?.emptyDtsEmitPath ?? (!u && x), v = n?.omitInternal ?? !1, C = o?.forceProduceDts ?? !1;
|
|
37
|
-
if (v && (x || C))
|
|
38
|
-
throw Error(
|
|
39
|
-
"omitInternal must be false if emitting .d.ts files in order to produce functional types for internal APIs."
|
|
40
|
-
);
|
|
41
|
-
return {
|
|
42
|
-
isResolvedConfig: !0,
|
|
43
|
-
context: {
|
|
44
|
-
dtsEmitPath: g,
|
|
45
|
-
emptyDtsEmitPath: D,
|
|
46
|
-
apiJsonEmitPath: t?.apiJsonEmitPath ?? "",
|
|
47
|
-
environment: P,
|
|
48
|
-
cwd: r,
|
|
49
|
-
basePath: c,
|
|
50
|
-
packageJson: s,
|
|
51
|
-
logger: t?.logger ?? {
|
|
52
|
-
// We namespace manually
|
|
53
|
-
// eslint-disable-next-line webgis/consistent-logging
|
|
54
|
-
info: console.log,
|
|
55
|
-
// eslint-disable-next-line webgis/consistent-logging
|
|
56
|
-
error: console.error
|
|
57
|
-
},
|
|
58
|
-
excludedDirectories: t?.excludedDirectories ?? /* @__PURE__ */ new Set(),
|
|
59
|
-
isLuminaMinimalExtraction: t?.isLuminaMinimalExtraction ?? !1,
|
|
60
|
-
includeLuminaPrivateComponents: t?.includeLuminaPrivateComponents ?? !1,
|
|
61
|
-
supportApplyMixinsSyntax: t?.supportApplyMixinsSyntax ?? !1
|
|
62
|
-
},
|
|
63
|
-
types: {
|
|
64
|
-
typeCheckedExtraction: l,
|
|
65
|
-
fullTypeCheck: p,
|
|
66
|
-
afterDiagnostic: o?.afterDiagnostic ?? d,
|
|
67
|
-
typeScriptInstanceCreated: o?.typeScriptInstanceCreated ?? d,
|
|
68
|
-
typeScriptConfigPath: a.configPath,
|
|
69
|
-
typeScriptConfig: h,
|
|
70
|
-
compilerOptions: h.config.options,
|
|
71
|
-
declarationTextTransformers: o?.declarationTextTransformers ?? [],
|
|
72
|
-
typeReplacements: o?.typeReplacements ?? {},
|
|
73
|
-
forceProduceDts: C
|
|
74
|
-
},
|
|
75
|
-
documentation: {
|
|
76
|
-
copyDocDefinitions: n?.copyDocDefinitions ?? {},
|
|
77
|
-
noInheritMembers: n?.noInheritMembers ?? {},
|
|
78
|
-
omitInternal: v,
|
|
79
|
-
publicStoryUrlPrefix: n?.publicStoryUrlPrefix ?? !1,
|
|
80
|
-
getComponentDocsUrl: n?.getComponentDocsUrl ?? !1,
|
|
81
|
-
getComponentDemoUrl: n?.getComponentDemoUrl ?? !1,
|
|
82
|
-
host: n?.host ?? (u ? k : T),
|
|
83
|
-
alternativeHost: n?.alternativeHost ?? (u ? T : k),
|
|
84
|
-
basePath: n?.basePath ?? w(s.name.split("/").at(-1))
|
|
85
|
-
},
|
|
86
|
-
verify: {
|
|
87
|
-
typeCheckTypes: e.verify?.typeCheckTypes ?? !1,
|
|
88
|
-
filterTypeCheckDiagnostic: e.verify?.filterTypeCheckDiagnostic ?? (() => !0),
|
|
89
|
-
detectBrokenLinks: e.verify?.detectBrokenLinks ?? !0
|
|
90
|
-
},
|
|
91
|
-
watch: {
|
|
92
|
-
onUpdate: e.watch?.onUpdate ?? d,
|
|
93
|
-
// Many reads can happen in a short time (on folder moves, or if prettier re-runs)
|
|
94
|
-
// Shorter than TypeScript's default of 250ms as we are blocked until this
|
|
95
|
-
// timeout is complete. Short timeout for unchecked extraction as it is fast,
|
|
96
|
-
// so doesn't need long debounce.
|
|
97
|
-
debounceTime: e.watch?.debounceTime ?? (l || p ? 50 : 20),
|
|
98
|
-
clearScreen: e.watch?.clearScreen ?? !1,
|
|
99
|
-
skipWritingUnchanged: D ? !1 : e.watch?.skipWritingUnchanged ?? !0
|
|
100
|
-
},
|
|
101
|
-
strict: e.strict ?? !m,
|
|
102
|
-
afterApiJsonCreate: e.afterApiJsonCreate ?? d
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
async function z(e, t) {
|
|
106
|
-
const o = t !== void 0, n = e ?? process.cwd(), i = y.resolve(n, t ?? "api-extractor.config.ts"), r = await S(i);
|
|
107
|
-
if (o && !r)
|
|
108
|
-
throw Error(`The provided config file at ${i} does not exist.`);
|
|
109
|
-
if (!r)
|
|
110
|
-
return e === void 0 ? {} : { context: { cwd: e } };
|
|
111
|
-
const s = (await import(J(i).href)).config;
|
|
112
|
-
return {
|
|
113
|
-
...s,
|
|
114
|
-
context: {
|
|
115
|
-
...s.context,
|
|
116
|
-
cwd: s.context?.cwd ?? y.dirname(i)
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function N(e, t) {
|
|
121
|
-
const o = e.context, n = t.context, i = e.types, r = t.types, s = e.documentation, c = t.documentation, m = e.verify, l = t.verify, p = e.watch, a = t.watch;
|
|
122
|
-
return {
|
|
123
|
-
isResolvedConfig: e.isResolvedConfig || t.isResolvedConfig || void 0,
|
|
124
|
-
context: {
|
|
125
|
-
dtsEmitPath: n?.dtsEmitPath ?? o?.dtsEmitPath,
|
|
126
|
-
emptyDtsEmitPath: n?.emptyDtsEmitPath ?? o?.emptyDtsEmitPath,
|
|
127
|
-
apiJsonEmitPath: n?.apiJsonEmitPath ?? o?.apiJsonEmitPath,
|
|
128
|
-
environment: n?.environment ?? o?.environment,
|
|
129
|
-
cwd: n?.cwd ?? o?.cwd,
|
|
130
|
-
basePath: n?.basePath ?? o?.basePath,
|
|
131
|
-
packageJson: n?.packageJson ?? o?.packageJson,
|
|
132
|
-
logger: n?.logger ?? o?.logger,
|
|
133
|
-
excludedDirectories: n?.excludedDirectories ?? o?.excludedDirectories,
|
|
134
|
-
isLuminaMinimalExtraction: n?.isLuminaMinimalExtraction ?? o?.isLuminaMinimalExtraction,
|
|
135
|
-
includeLuminaPrivateComponents: n?.includeLuminaPrivateComponents ?? o?.includeLuminaPrivateComponents,
|
|
136
|
-
supportApplyMixinsSyntax: n?.supportApplyMixinsSyntax ?? o?.supportApplyMixinsSyntax ?? !1
|
|
137
|
-
},
|
|
138
|
-
types: {
|
|
139
|
-
typeCheckedExtraction: r?.typeCheckedExtraction ?? i?.typeCheckedExtraction,
|
|
140
|
-
fullTypeCheck: r?.fullTypeCheck ?? i?.fullTypeCheck,
|
|
141
|
-
afterDiagnostic: f(r?.afterDiagnostic, i?.afterDiagnostic),
|
|
142
|
-
typeScriptInstanceCreated: f(
|
|
143
|
-
t?.types?.typeScriptInstanceCreated,
|
|
144
|
-
e?.types?.typeScriptInstanceCreated
|
|
145
|
-
),
|
|
146
|
-
typeScriptConfigPath: r?.typeScriptConfigPath ?? i?.typeScriptConfigPath,
|
|
147
|
-
typeScriptConfig: r?.typeScriptConfig ?? i?.typeScriptConfig,
|
|
148
|
-
compilerOptions: r?.compilerOptions ?? i?.compilerOptions,
|
|
149
|
-
declarationTextTransformers: r?.declarationTextTransformers !== void 0 && i?.declarationTextTransformers !== void 0 ? [...i.declarationTextTransformers, ...r.declarationTextTransformers] : r?.declarationTextTransformers ?? i?.declarationTextTransformers,
|
|
150
|
-
typeReplacements: r?.typeReplacements ?? i?.typeReplacements,
|
|
151
|
-
forceProduceDts: r?.forceProduceDts ?? i?.forceProduceDts
|
|
152
|
-
},
|
|
153
|
-
documentation: {
|
|
154
|
-
copyDocDefinitions: c?.copyDocDefinitions ?? s?.copyDocDefinitions,
|
|
155
|
-
noInheritMembers: c?.noInheritMembers ?? s?.noInheritMembers,
|
|
156
|
-
omitInternal: c?.omitInternal ?? s?.omitInternal,
|
|
157
|
-
publicStoryUrlPrefix: c?.publicStoryUrlPrefix ?? s?.publicStoryUrlPrefix,
|
|
158
|
-
getComponentDocsUrl: c?.getComponentDocsUrl ?? s?.getComponentDocsUrl,
|
|
159
|
-
getComponentDemoUrl: c?.getComponentDemoUrl ?? s?.getComponentDemoUrl,
|
|
160
|
-
host: c?.host ?? s?.host,
|
|
161
|
-
alternativeHost: c?.alternativeHost ?? s?.alternativeHost,
|
|
162
|
-
basePath: c?.basePath ?? s?.basePath
|
|
163
|
-
},
|
|
164
|
-
verify: {
|
|
165
|
-
typeCheckTypes: l?.typeCheckTypes ?? m?.typeCheckTypes,
|
|
166
|
-
filterTypeCheckDiagnostic: l?.filterTypeCheckDiagnostic ?? m?.filterTypeCheckDiagnostic,
|
|
167
|
-
detectBrokenLinks: l?.detectBrokenLinks ?? m?.detectBrokenLinks
|
|
168
|
-
},
|
|
169
|
-
watch: {
|
|
170
|
-
onUpdate: f(a?.onUpdate, p?.onUpdate),
|
|
171
|
-
debounceTime: a?.debounceTime ?? p?.debounceTime,
|
|
172
|
-
clearScreen: a?.clearScreen ?? p?.clearScreen,
|
|
173
|
-
skipWritingUnchanged: a?.skipWritingUnchanged ?? p?.skipWritingUnchanged
|
|
174
|
-
},
|
|
175
|
-
strict: t.strict ?? e.strict,
|
|
176
|
-
afterApiJsonCreate: f(t.afterApiJsonCreate, e.afterApiJsonCreate)
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function f(e, t) {
|
|
180
|
-
const o = t === d ? void 0 : t, n = e === d ? void 0 : e;
|
|
181
|
-
return o !== void 0 && n !== void 0 ? ((...i) => (o(...i), n(...i))) : n ?? o;
|
|
182
|
-
}
|
|
1
|
+
import "@arcgis/node-toolkit/file";
|
|
2
|
+
import "@arcgis/node-toolkit/path";
|
|
3
|
+
import "@arcgis/node-toolkit/packageJson";
|
|
4
|
+
import "@arcgis/node-toolkit/vite/typeScript";
|
|
5
|
+
import "@arcgis/toolkit/function";
|
|
6
|
+
import { l as f, m as g, r as x } from "../config-D0cgQ7jF.js";
|
|
7
|
+
import "node:url";
|
|
8
|
+
import "./processing/links.js";
|
|
183
9
|
export {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
10
|
+
f as loadApiExtractorConfig,
|
|
11
|
+
g as mergeApiExtractorConfigs,
|
|
12
|
+
x as resolveApiExtractorConfig
|
|
187
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styleText as C } from "node:util";
|
|
2
|
-
import { emitJsDocError as a, getApiNodeLabel as
|
|
3
|
-
import { c as y } from "../../privateContext-
|
|
2
|
+
import { emitJsDocError as a, getApiNodeLabel as h } from "../../utils/apiHelpers.js";
|
|
3
|
+
import { c as y } from "../../privateContext-CjPsSpfv.js";
|
|
4
4
|
import { kebabToPascal as I } from "@arcgis/toolkit/string";
|
|
5
5
|
function W(e, n) {
|
|
6
6
|
if (typeof e == "string") {
|
|
@@ -27,132 +27,134 @@ const P = "Unexpected relative markdown link. For links to API within the packag
|
|
|
27
27
|
function N(e, n, i) {
|
|
28
28
|
let d = i.indexOf(" ");
|
|
29
29
|
d === -1 && (d = i.length);
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const m = i.slice(0, d);
|
|
31
|
+
let u = i.slice(d + 1);
|
|
32
|
+
if (m.startsWith("https://"))
|
|
32
33
|
return e.config.strict ? (a(
|
|
33
34
|
"Did not expect absolute URLs in a @link tag. Please use markdown links for external links. See https://webgis.esri.com/references/api-extractor/tags-reference#link)",
|
|
34
35
|
n,
|
|
35
36
|
e
|
|
36
|
-
), "") : `[${
|
|
37
|
-
const [k,
|
|
38
|
-
if (
|
|
37
|
+
), "") : `[${u || m}](${m})`;
|
|
38
|
+
const [k, s] = m.split("#"), [c, L] = k.split("!");
|
|
39
|
+
if (c === "")
|
|
39
40
|
return a(
|
|
40
|
-
`Expected @link reference to start with a module name (before ! or #), but got: ${
|
|
41
|
+
`Expected @link reference to start with a module name (before ! or #), but got: ${m}`,
|
|
41
42
|
n,
|
|
42
43
|
e
|
|
43
44
|
), n;
|
|
44
|
-
let g = e.moduleMap.get(
|
|
45
|
+
let g = e.moduleMap.get(c);
|
|
45
46
|
if (g === void 0 && e.isComponentProject && !e.config.strict) {
|
|
46
47
|
for (const r of e.moduleMap.values())
|
|
47
|
-
if (y(r).index.class?.name ===
|
|
48
|
+
if (y(r).index.class?.name === c) {
|
|
48
49
|
g = r;
|
|
49
50
|
break;
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
if (g === void 0)
|
|
53
54
|
return e.config.verify.detectBrokenLinks ? a(
|
|
54
|
-
`Failed to find referenced module: ${C("red",
|
|
55
|
+
`Failed to find referenced module: ${C("red", c)}${c.startsWith("module:") ? '. Module name in @link does not need the "module:" prefix' : c.startsWith("esri/") ? '. Module name in @link does not need to start with the "esri/" prefix.' : ""}`,
|
|
55
56
|
n,
|
|
56
57
|
e
|
|
57
58
|
) : e.silencedBrokenLinkCount += 1, n;
|
|
58
59
|
const v = y(g), D = e.inheritedModuleName === void 0 ? e.apiModule : e.moduleMap.get(e.inheritedModuleName) ?? e.apiModule;
|
|
59
|
-
if (e.watchFiles !== void 0 &&
|
|
60
|
-
const r = y(D).file.fileName.slice(e.config.context.cwd.length),
|
|
61
|
-
e.watchFiles.get(r).docLinks.push(i), e.watchFiles.get(r).dependencies.add(
|
|
62
|
-
const
|
|
63
|
-
|
|
60
|
+
if (e.watchFiles !== void 0 && c !== D.path && y(D).isStale) {
|
|
61
|
+
const r = y(D).file.fileName.slice(e.config.context.cwd.length), t = v.file.fileName.slice(e.config.context.cwd.length);
|
|
62
|
+
e.watchFiles.get(r).docLinks.push(i), e.watchFiles.get(r).dependencies.add(t);
|
|
63
|
+
const $ = e.watchFiles.get(t).dependents;
|
|
64
|
+
$.has(r) || $.set(r, !1);
|
|
64
65
|
}
|
|
65
|
-
let
|
|
66
|
+
let b = M(g.path, L, s, e);
|
|
66
67
|
if (L !== void 0) {
|
|
67
68
|
const r = v.index.named[L];
|
|
68
69
|
return r === void 0 ? (e.config.verify.detectBrokenLinks ? a(
|
|
69
|
-
`Failed to find the referenced declaration inside the module: ${C("red", `${
|
|
70
|
+
`Failed to find the referenced declaration inside the module: ${C("red", `${c}!${L}`)}`,
|
|
70
71
|
n,
|
|
71
72
|
e
|
|
72
73
|
) : e.silencedBrokenLinkCount += 1, n) : r === v.index.class ? (a(
|
|
73
|
-
`Invalid reference syntax used. Class/mixin/custom element declarations must be referenced without specifying the class name. Expected ${C("green",
|
|
74
|
+
`Invalid reference syntax used. Class/mixin/custom element declarations must be referenced without specifying the class name. Expected ${C("green", c)}`,
|
|
74
75
|
n,
|
|
75
76
|
e
|
|
76
|
-
), n) : `[${
|
|
77
|
-
} else if (
|
|
78
|
-
const r = g.path === D.path,
|
|
79
|
-
if (
|
|
80
|
-
return v.index.named[
|
|
77
|
+
), n) : `[${u || h(r)}](${b})`;
|
|
78
|
+
} else if (s !== void 0) {
|
|
79
|
+
const r = g.path === D.path, t = v.index.class;
|
|
80
|
+
if (t === void 0)
|
|
81
|
+
return v.index.named[s] === void 0 ? e.config.verify.detectBrokenLinks ? a(
|
|
81
82
|
'Failed to find the referenced member. Class member reference syntax was used, yet current module does not expose a class/mixin/custom element? Linking to properties in interfaces is not yet supported. For event links, prefix with "event-"',
|
|
82
83
|
n,
|
|
83
84
|
e
|
|
84
85
|
) : e.silencedBrokenLinkCount += 1 : a(
|
|
85
|
-
`Invalid reference syntax used. This syntax is only permitted on modules that export a class/mixin/web component. Perhaps you meant to use ${C("red", `${
|
|
86
|
+
`Invalid reference syntax used. This syntax is only permitted on modules that export a class/mixin/web component. Perhaps you meant to use ${C("red", `${c}!${s}`)} instead? Linking to properties in interfaces is not yet supported`,
|
|
86
87
|
n,
|
|
87
88
|
e
|
|
88
89
|
), n;
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
if (
|
|
92
|
-
const o =
|
|
90
|
+
const $ = v.inheritance, p = typeof $ == "object" ? $ : void 0;
|
|
91
|
+
let f;
|
|
92
|
+
if (s.startsWith("event-")) {
|
|
93
|
+
const o = s.slice(6);
|
|
93
94
|
if (p !== void 0)
|
|
94
|
-
|
|
95
|
-
else if (
|
|
96
|
-
for (let l = 0; l <
|
|
97
|
-
const
|
|
98
|
-
if (o ===
|
|
99
|
-
|
|
95
|
+
f = p.indexedEvents?.[o];
|
|
96
|
+
else if (t.events !== void 0)
|
|
97
|
+
for (let l = 0; l < t.events.length; ++l) {
|
|
98
|
+
const w = t.events[l];
|
|
99
|
+
if (o === w.name) {
|
|
100
|
+
f = w;
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
} else if (
|
|
104
|
-
const o =
|
|
104
|
+
} else if (s.startsWith("slot-")) {
|
|
105
|
+
const o = s.slice(5);
|
|
105
106
|
if (p !== void 0)
|
|
106
|
-
|
|
107
|
-
else if (
|
|
108
|
-
for (let l = 0; l <
|
|
109
|
-
const
|
|
110
|
-
if (o ===
|
|
111
|
-
|
|
107
|
+
f = p.indexedSlots?.[o];
|
|
108
|
+
else if (t.slots !== void 0)
|
|
109
|
+
for (let l = 0; l < t.slots.length; ++l) {
|
|
110
|
+
const w = t.slots[l];
|
|
111
|
+
if (o === w.name) {
|
|
112
|
+
f = w;
|
|
112
113
|
break;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
|
|
116
|
+
f?.name === "" && (u ||= `${h(t)}.default-slot`);
|
|
117
|
+
} else if (s.startsWith("--")) {
|
|
116
118
|
if (p !== void 0)
|
|
117
|
-
|
|
118
|
-
else if (
|
|
119
|
-
for (let o = 0; o <
|
|
120
|
-
const l =
|
|
121
|
-
if (
|
|
122
|
-
|
|
119
|
+
f = p.indexedCssProperties?.[s];
|
|
120
|
+
else if (t.cssProperties !== void 0)
|
|
121
|
+
for (let o = 0; o < t.cssProperties.length; ++o) {
|
|
122
|
+
const l = t.cssProperties[o];
|
|
123
|
+
if (s === l.name) {
|
|
124
|
+
f = l;
|
|
123
125
|
break;
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
|
-
} else if (p?.indexedMembers !== void 0 && (
|
|
127
|
-
for (let o = 0; o <
|
|
128
|
-
const l =
|
|
129
|
-
if (
|
|
130
|
-
|
|
128
|
+
} else if (p?.indexedMembers !== void 0 && (f = p.indexedMembers[s] ?? p.indexedMembers[`static ${s}`]), f === void 0 && t.members !== void 0) {
|
|
129
|
+
for (let o = 0; o < t.members.length; ++o) {
|
|
130
|
+
const l = t.members[o];
|
|
131
|
+
if (s === l.name) {
|
|
132
|
+
f = l;
|
|
131
133
|
break;
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
|
-
if (
|
|
135
|
-
for (let o = 0; o <
|
|
136
|
-
const l =
|
|
137
|
-
if (
|
|
138
|
-
|
|
136
|
+
if (f === void 0 && !e.config.strict && e.isComponentProject && t.events !== void 0)
|
|
137
|
+
for (let o = 0; o < t.events.length; ++o) {
|
|
138
|
+
const l = t.events[o];
|
|
139
|
+
if (s === l.name) {
|
|
140
|
+
f = l, b = b.replace("#", "#event-");
|
|
139
141
|
break;
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
|
-
return
|
|
145
|
+
return f === void 0 ? (e.config.verify.detectBrokenLinks ? a("Failed to find the referenced class member", n, e) : e.silencedBrokenLinkCount += 1, n) : `[${u || (r ? h(f) : `${h(t)}.${h(f)}`)}](${b})`;
|
|
144
146
|
} else {
|
|
145
|
-
const r = v.index.class === void 0 ? U(
|
|
146
|
-
return `[${
|
|
147
|
+
const r = v.index.class === void 0 ? U(c) : h(v.index.class);
|
|
148
|
+
return `[${u || r}](${b})`;
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
function M(e, n, i, d) {
|
|
150
|
-
let
|
|
152
|
+
let m;
|
|
151
153
|
if (d.isComponentProject && typeof d.config.documentation.getComponentDocsUrl == "function" && e.startsWith("components/")) {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
+
const u = e.slice(11), k = u.indexOf("/"), s = k === -1 ? u : u.slice(0, k), c = d.config.documentation.getComponentDocsUrl(s, I(s));
|
|
155
|
+
c !== void 0 && (m = c + (k === -1 ? "" : u.slice(k + 1)));
|
|
154
156
|
}
|
|
155
|
-
return
|
|
157
|
+
return m ??= `${d.normalizedApiReferencePrefix}${e}/`, x(m, n, i);
|
|
156
158
|
}
|
|
157
159
|
function x(e, n, i) {
|
|
158
160
|
return n !== void 0 ? i === void 0 ? `${e}#${encodeURIComponent(n)}` : `${e}#${encodeURIComponent(n)}-${encodeURIComponent(i)}` : i !== void 0 ? `${e}#${encodeURIComponent(i)}` : e;
|
|
@@ -7,6 +7,8 @@ function s(t, o, i, n) {
|
|
|
7
7
|
importsMap: i,
|
|
8
8
|
importsText: void 0,
|
|
9
9
|
constructorPropertiesInterface: void 0,
|
|
10
|
+
componentExtrasInterfaces: void 0,
|
|
11
|
+
componentCssPropertiesInterface: void 0,
|
|
10
12
|
constructorOnlySetters: void 0,
|
|
11
13
|
constructorAutoCastType: void 0,
|
|
12
14
|
typeName: void 0,
|
|
@@ -64,19 +66,19 @@ function p(t) {
|
|
|
64
66
|
function C(t) {
|
|
65
67
|
return t[e];
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function f(t) {
|
|
68
70
|
return t[e];
|
|
69
71
|
}
|
|
70
|
-
function
|
|
72
|
+
function l(t) {
|
|
71
73
|
return t[e];
|
|
72
74
|
}
|
|
73
75
|
export {
|
|
74
|
-
|
|
76
|
+
f as a,
|
|
75
77
|
C as b,
|
|
76
78
|
v as c,
|
|
77
79
|
u as d,
|
|
78
80
|
s as e,
|
|
79
|
-
f,
|
|
81
|
+
l as f,
|
|
80
82
|
x as g,
|
|
81
83
|
p as h,
|
|
82
84
|
c as i,
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as l } from "../privateContext-
|
|
1
|
+
import { f as l } from "../privateContext-CjPsSpfv.js";
|
|
2
2
|
function m(t, r, i, e, n, o) {
|
|
3
3
|
return `${`${r ? "export default " : "export "}${t ? "abstract " : ""}`}class ${i}${c(e)}${n === void 0 ? "" : ` extends ${n}`} {${o}}`;
|
|
4
4
|
}
|
package/dist/vite/plugin.d.ts
CHANGED
|
@@ -17,8 +17,10 @@ export interface ApiExtractorPluginConfig {
|
|
|
17
17
|
* rules, Astro docs generator, and other tools. For consistent results, use
|
|
18
18
|
* the same settings everywhere.
|
|
19
19
|
*
|
|
20
|
-
* It is safe to use this for setting .
|
|
20
|
+
* It is safe to use this for setting .afterExtractorCreated() hook as long as you don't
|
|
21
21
|
* mutate the api.json in it.
|
|
22
|
+
*
|
|
23
|
+
* Overrides are higher precedence than the `api-extractor.config.ts` file.
|
|
22
24
|
*/
|
|
23
25
|
unsafeConfigOverride?: ApiExtractorConfig;
|
|
24
26
|
serve?: ApiExtractorPluginServeConfig;
|
package/dist/vite/plugin.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as
|
|
3
|
-
import { p as A, l as C } from "../typeScript-D3TNAYYk.js";
|
|
1
|
+
import { p as O, l as S, m as J } from "../config-D0cgQ7jF.js";
|
|
2
|
+
import { A as T, l as A, w as C } from "../ApiExtractor-C2CJZrBq.js";
|
|
4
3
|
import { writeFile as M } from "node:fs/promises";
|
|
5
4
|
import { path as w } from "@arcgis/node-toolkit/path";
|
|
6
|
-
const N =
|
|
7
|
-
function
|
|
5
|
+
const N = O.name;
|
|
6
|
+
function V(s = {}) {
|
|
8
7
|
let t = !1, v = !1, e, o, c, l, E = !0, h = !1, f, m, u, y, p;
|
|
9
8
|
async function x(d, n) {
|
|
10
9
|
if (n.dtsFiles !== void 0 && u !== "") {
|
|
11
10
|
const g = w.join(w.resolve(p, u), "/");
|
|
12
|
-
await
|
|
11
|
+
await C(g, !1, d.changedDtsFiles ?? n.dtsFiles);
|
|
13
12
|
}
|
|
14
13
|
y !== "" && await M(
|
|
15
14
|
y,
|
|
@@ -57,7 +56,7 @@ function $(s = {}) {
|
|
|
57
56
|
}, 250)), a));
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
}, P = s.configFilePath === "" ? void 0 : await
|
|
59
|
+
}, P = s.configFilePath === "" ? void 0 : await S(p, s.configFilePath), F = s.unsafeConfigOverride ?? {}, D = P === void 0 ? g : J(g, P), r = F === void 0 ? D : J(D, F);
|
|
61
60
|
u = t ? r.context?.dtsEmitPath ?? e.build.outDir : "", y = t ? r.context?.apiJsonEmitPath ?? "" : "";
|
|
62
61
|
const W = r.context?.logger ?? e.logger ?? console, k = {
|
|
63
62
|
...r,
|
|
@@ -67,7 +66,7 @@ function $(s = {}) {
|
|
|
67
66
|
apiJsonEmitPath: "",
|
|
68
67
|
logger: {
|
|
69
68
|
info(i) {
|
|
70
|
-
!t || i.startsWith(`${
|
|
69
|
+
!t || i.startsWith(`${A}Wrote `) || W.info(i);
|
|
71
70
|
},
|
|
72
71
|
error(i) {
|
|
73
72
|
W.error(i);
|
|
@@ -79,7 +78,7 @@ function $(s = {}) {
|
|
|
79
78
|
forceProduceDts: r.types?.forceProduceDts === !0 || u !== ""
|
|
80
79
|
}
|
|
81
80
|
};
|
|
82
|
-
o = new
|
|
81
|
+
o = new T(k), s.afterExtractorCreated?.(o);
|
|
83
82
|
},
|
|
84
83
|
/**
|
|
85
84
|
* TypeScript reads files directly from the file system - Vite's
|
|
@@ -105,5 +104,5 @@ function $(s = {}) {
|
|
|
105
104
|
};
|
|
106
105
|
}
|
|
107
106
|
export {
|
|
108
|
-
|
|
107
|
+
V as useApiExtractor
|
|
109
108
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/api-extractor",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.93",
|
|
4
4
|
"description": "Documentation engine for WebGIS SDK packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"./utils/internalTypeScriptApis": "./dist/utils/internalTypeScriptApis.js",
|
|
42
42
|
"./utils/partPrinter": "./dist/utils/partPrinter.js",
|
|
43
43
|
"./vite/plugin": "./dist/vite/plugin.js",
|
|
44
|
-
"./vite/typeScript": "./dist/vite/typeScript.js",
|
|
45
44
|
"./package.json": "./package.json"
|
|
46
45
|
},
|
|
47
46
|
"files": [
|
|
@@ -49,8 +48,8 @@
|
|
|
49
48
|
],
|
|
50
49
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
51
50
|
"dependencies": {
|
|
52
|
-
"@arcgis/node-toolkit": "5.2.0-next.
|
|
53
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
51
|
+
"@arcgis/node-toolkit": "5.2.0-next.93",
|
|
52
|
+
"@arcgis/toolkit": "5.2.0-next.93",
|
|
54
53
|
"@commander-js/extra-typings": "^15.0.0",
|
|
55
54
|
"commander": "^15.0.0",
|
|
56
55
|
"tslib": "^2.8.1"
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { findPath as E } from "@arcgis/node-toolkit/file";
|
|
2
|
-
import { path as u, toSystemPathSeparators as S } from "@arcgis/node-toolkit/path";
|
|
3
|
-
import t from "typescript";
|
|
4
|
-
import { styleText as l } from "util";
|
|
5
|
-
const w = "@arcgis/api-extractor", P = "5.2.0-next.90", D = {
|
|
6
|
-
name: w,
|
|
7
|
-
version: P
|
|
8
|
-
};
|
|
9
|
-
let x;
|
|
10
|
-
function N(o) {
|
|
11
|
-
return x ??= t.createPrinter(), x.printNode(t.EmitHint.Unspecified, o, void 0);
|
|
12
|
-
}
|
|
13
|
-
function A(o, r) {
|
|
14
|
-
return o.pos !== -1 && o.end !== -1 && r !== void 0 ? o.getText(r) : N(o);
|
|
15
|
-
}
|
|
16
|
-
let h;
|
|
17
|
-
const g = D.name, m = {
|
|
18
|
-
getCurrentDirectory: process.cwd,
|
|
19
|
-
getCanonicalFileName: (o) => o,
|
|
20
|
-
getNewLine: () => t.sys.newLine
|
|
21
|
-
}, W = function(o, { file: r, node: n, scope: i, start: s, length: c }) {
|
|
22
|
-
this.errorCount += 1, process.exitCode = 1, s ??= n === void 0 || n.pos === -1 ? -1 : n.getStart(r, !1);
|
|
23
|
-
const a = n?.end ?? -1;
|
|
24
|
-
c ??= a === -1 ? -1 : Math.max(1, a - s);
|
|
25
|
-
const e = s >= 0 && c >= 0, d = !e && i !== void 0, p = {
|
|
26
|
-
category: t.DiagnosticCategory.Error,
|
|
27
|
-
code: e ? g : v,
|
|
28
|
-
file: d ? void 0 : r,
|
|
29
|
-
start: e ? s : 0,
|
|
30
|
-
length: e ? c : 0,
|
|
31
|
-
messageText: (d ? `${l("cyan", i, { stream: process.stderr })}: ` : "") + o + (e || n === void 0 ? "" : `
|
|
32
|
-
|
|
33
|
-
${A(n, r)}`)
|
|
34
|
-
}, f = t.formatDiagnosticsWithColorAndContext([p], m);
|
|
35
|
-
h ??= process.env.CI !== void 0 || l("red", "", { stream: process.stderr }) !== "";
|
|
36
|
-
const C = h ? f : f.replaceAll(F, ""), y = e ? C : C.replace(v.toString(), g);
|
|
37
|
-
this.config.context.logger.error(y);
|
|
38
|
-
}, v = 1490, F = /\x1B\[[0-9;]*m/gu, k = l("cyan", `[${g}] `);
|
|
39
|
-
function J(o = process.cwd(), r, n) {
|
|
40
|
-
const i = r === void 0 ? E("tsconfig.json", o) : u.resolve(o, r);
|
|
41
|
-
if (i === void 0)
|
|
42
|
-
throw Error(
|
|
43
|
-
`Unable to find ${S(String(r))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`
|
|
44
|
-
);
|
|
45
|
-
const s = t.readConfigFile(i, t.sys.readFile);
|
|
46
|
-
if (s.error !== void 0)
|
|
47
|
-
throw Error(t.formatDiagnosticsWithColorAndContext([s.error], m));
|
|
48
|
-
const c = s.config, a = n ? c : {
|
|
49
|
-
...c,
|
|
50
|
-
include: [],
|
|
51
|
-
files: [],
|
|
52
|
-
exclude: []
|
|
53
|
-
}, e = t.parseJsonConfigFileContent(a, t.sys, u.dirname(i)), d = 18002, p = n ? e.errors : e.errors.filter((f) => f.code !== d);
|
|
54
|
-
if (p.length > 0)
|
|
55
|
-
throw Error(t.formatDiagnosticsWithColorAndContext(p, m));
|
|
56
|
-
return {
|
|
57
|
-
configPath: i,
|
|
58
|
-
config: e
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
m as a,
|
|
63
|
-
J as b,
|
|
64
|
-
W as e,
|
|
65
|
-
k as l,
|
|
66
|
-
D as p
|
|
67
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type ts from "typescript";
|
|
2
|
-
|
|
3
|
-
export interface TypeScriptConfigResult {
|
|
4
|
-
/** Absolute path to the resolved tsconfig.json file. */
|
|
5
|
-
configPath: string;
|
|
6
|
-
config: ts.ParsedCommandLine;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @param cwd - Defaults to process.cwd()
|
|
11
|
-
* @param configPath - Optional absolute or relative path to a tsconfig.json file.
|
|
12
|
-
* @param resolveIncludedFiles - If true, will resolve tsconfig's include, exclude,
|
|
13
|
-
* and files globs. Resolved files can be accessed via
|
|
14
|
-
* TypeScriptConfigResult.config.fileNames.
|
|
15
|
-
*/
|
|
16
|
-
export function loadTypeScriptConfig(cwd: string | undefined, configPath: string | undefined, resolveIncludedFiles: boolean): TypeScriptConfigResult;
|