@arcgis/api-extractor 5.2.0-next.124 → 5.2.0-next.126
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-CvENLVIq.js → chunks/ApiExtractor.js} +1865 -1930
- package/dist/{cli-7PX_wNxb.js → chunks/cli.js} +3 -3
- package/dist/{config-C9uAPo7G.js → chunks/config.js} +53 -51
- package/dist/chunks/links.js +412 -0
- package/dist/{privateContext-DR6YTcm2.js → chunks/privateContext.js} +6 -6
- package/dist/cli.js +1 -1
- package/dist/diff/apiDiffToMarkdown.js +1 -1
- package/dist/extractor/ApiExtractor.js +3 -3
- package/dist/extractor/config.d.ts +18 -1
- package/dist/extractor/config.js +2 -2
- package/dist/extractor/processing/links.js +12 -173
- package/dist/utils/apiHelpers.js +1 -1
- package/dist/utils/partPrinter.js +1 -1
- package/dist/vite/plugin.js +2 -2
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { writeFile as r, readFile as d } from "node:fs/promises";
|
|
2
|
-
import { diffApiJson as m } from "
|
|
2
|
+
import { diffApiJson as m } from "../diff/diffApiJson.js";
|
|
3
3
|
async function k({
|
|
4
4
|
oldPath: t,
|
|
5
5
|
newPath: i,
|
|
@@ -9,12 +9,12 @@ async function k({
|
|
|
9
9
|
const c = f(t), w = f(i), p = await c, l = await w, n = m(p, l);
|
|
10
10
|
if (typeof o == "string")
|
|
11
11
|
if (o.endsWith(".md")) {
|
|
12
|
-
const { apiDiffToMarkdown: s } = await import("
|
|
12
|
+
const { apiDiffToMarkdown: s } = await import("../diff/apiDiffToMarkdown.js"), a = s(n, e);
|
|
13
13
|
await r(o, a, "utf-8");
|
|
14
14
|
} else
|
|
15
15
|
await r(o, JSON.stringify(n, null, 2), "utf-8");
|
|
16
16
|
else {
|
|
17
|
-
const { apiDiffToMarkdown: s } = await import("
|
|
17
|
+
const { apiDiffToMarkdown: s } = await import("../diff/apiDiffToMarkdown.js"), a = s(n, e);
|
|
18
18
|
console.log(a);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -4,18 +4,18 @@ import { retrievePackageJson as U } from "@arcgis/node-toolkit/packageJson";
|
|
|
4
4
|
import { loadTypeScriptConfig as b } from "@arcgis/node-toolkit/vite/typeScript";
|
|
5
5
|
import { identity as d } from "@arcgis/toolkit/function";
|
|
6
6
|
import { pathToFileURL as I } from "node:url";
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
9
|
-
name:
|
|
10
|
-
version:
|
|
11
|
-
},
|
|
7
|
+
import { g as J } from "./links.js";
|
|
8
|
+
const L = "@arcgis/api-extractor", w = "1.0.0-0", A = {
|
|
9
|
+
name: L,
|
|
10
|
+
version: w
|
|
11
|
+
}, C = "developers.arcgis.com", k = "next.gha.afd.arcgis.com";
|
|
12
12
|
function N(e) {
|
|
13
13
|
if (e.isResolvedConfig === !0)
|
|
14
14
|
return e;
|
|
15
|
-
const t = e.context,
|
|
15
|
+
const t = e.context, n = e.types, o = e.documentation, r = `${t?.cwd === void 0 ? E() : y.resolve(t?.cwd)}/`, s = t?.packageJson ?? U(r);
|
|
16
16
|
let c = t?.basePath ?? "src/";
|
|
17
17
|
c.endsWith("/") || (c += "/");
|
|
18
|
-
const m = "customElements" in s && "@arcgis/lumina" in (s.dependencies ?? {}),
|
|
18
|
+
const m = "customElements" in s && "@arcgis/lumina" in (s.dependencies ?? {}), p = n?.typeCheckedExtraction ?? m, l = n?.fullTypeCheck ?? !1, a = n?.typeScriptConfig ?? (p || l ? b(r, n?.typeScriptConfigPath, !0) : {
|
|
19
19
|
configPath: "",
|
|
20
20
|
config: {
|
|
21
21
|
options: {},
|
|
@@ -23,7 +23,7 @@ function N(e) {
|
|
|
23
23
|
errors: []
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
if (
|
|
26
|
+
if (n?.typeScriptConfig?.config.fileNames.length === 0)
|
|
27
27
|
throw Error(
|
|
28
28
|
`${A.name}: Provided types.typeScriptConfig has no included files. If you used loadTypeScriptConfig, make sure to set resolveIncludedFiles to true.`
|
|
29
29
|
);
|
|
@@ -32,12 +32,12 @@ function N(e) {
|
|
|
32
32
|
...a.config,
|
|
33
33
|
options: {
|
|
34
34
|
...a.config.options,
|
|
35
|
-
...
|
|
35
|
+
...n?.compilerOptions
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
configPath: a.configPath
|
|
39
|
-
}, g = t?.dtsEmitPath === void 0 || t?.dtsEmitPath === "" ? "" : `${y.resolve(r, t.dtsEmitPath)}/`, x = g !== "", P = t?.environment ?? "production", u = P === "development", v = t?.emptyDtsEmitPath ?? (!u && x), D =
|
|
40
|
-
if (D && (x ||
|
|
39
|
+
}, g = t?.dtsEmitPath === void 0 || t?.dtsEmitPath === "" ? "" : `${y.resolve(r, t.dtsEmitPath)}/`, x = g !== "", P = t?.environment ?? "production", u = P === "development", v = t?.emptyDtsEmitPath ?? (!u && x), D = o?.omitInternal ?? !1, T = n?.forceProduceDts ?? !1;
|
|
40
|
+
if (D && (x || T))
|
|
41
41
|
throw Error(
|
|
42
42
|
"omitInternal must be false if emitting .d.ts files in order to produce functional types for internal APIs."
|
|
43
43
|
);
|
|
@@ -64,31 +64,32 @@ function N(e) {
|
|
|
64
64
|
supportApplyMixinsSyntax: t?.supportApplyMixinsSyntax ?? !1
|
|
65
65
|
},
|
|
66
66
|
types: {
|
|
67
|
-
typeCheckedExtraction:
|
|
68
|
-
fullTypeCheck:
|
|
69
|
-
afterDiagnostic:
|
|
70
|
-
typeScriptInstanceCreated:
|
|
67
|
+
typeCheckedExtraction: p,
|
|
68
|
+
fullTypeCheck: l,
|
|
69
|
+
afterDiagnostic: n?.afterDiagnostic ?? d,
|
|
70
|
+
typeScriptInstanceCreated: n?.typeScriptInstanceCreated ?? d,
|
|
71
71
|
typeScriptConfigPath: a.configPath,
|
|
72
72
|
typeScriptConfig: h,
|
|
73
73
|
compilerOptions: h.config.options,
|
|
74
|
-
declarationTextTransformers:
|
|
75
|
-
typeReplacements:
|
|
76
|
-
forceProduceDts:
|
|
74
|
+
declarationTextTransformers: n?.declarationTextTransformers ?? [],
|
|
75
|
+
typeReplacements: n?.typeReplacements ?? {},
|
|
76
|
+
forceProduceDts: T
|
|
77
77
|
},
|
|
78
78
|
documentation: {
|
|
79
|
-
copyDocDefinitions:
|
|
80
|
-
noInheritMembers:
|
|
79
|
+
copyDocDefinitions: o?.copyDocDefinitions ?? {},
|
|
80
|
+
noInheritMembers: o?.noInheritMembers ?? {},
|
|
81
81
|
omitInternal: D,
|
|
82
|
-
publicStoryUrlPrefix:
|
|
83
|
-
getComponentDocsUrl:
|
|
84
|
-
getComponentDemoUrl:
|
|
85
|
-
host:
|
|
86
|
-
alternativeHost:
|
|
87
|
-
basePath:
|
|
82
|
+
publicStoryUrlPrefix: o?.publicStoryUrlPrefix ?? !1,
|
|
83
|
+
getComponentDocsUrl: o?.getComponentDocsUrl ?? !1,
|
|
84
|
+
getComponentDemoUrl: o?.getComponentDemoUrl ?? !1,
|
|
85
|
+
host: o?.host ?? (u ? k : C),
|
|
86
|
+
alternativeHost: o?.alternativeHost ?? (u ? C : k),
|
|
87
|
+
basePath: o?.basePath ?? J(s.name.split("/").at(-1))
|
|
88
88
|
},
|
|
89
89
|
verify: {
|
|
90
90
|
typeCheckTypes: e.verify?.typeCheckTypes ?? !1,
|
|
91
91
|
filterTypeCheckDiagnostic: e.verify?.filterTypeCheckDiagnostic ?? (() => !0),
|
|
92
|
+
filterUnreferencedType: e.verify?.filterUnreferencedType ?? (() => !0),
|
|
92
93
|
detectBrokenLinks: e.verify?.detectBrokenLinks ?? !0
|
|
93
94
|
},
|
|
94
95
|
watch: {
|
|
@@ -97,7 +98,7 @@ function N(e) {
|
|
|
97
98
|
// Shorter than TypeScript's default of 250ms as we are blocked until this
|
|
98
99
|
// timeout is complete. Short timeout for unchecked extraction as it is fast,
|
|
99
100
|
// so doesn't need long debounce.
|
|
100
|
-
debounceTime: e.watch?.debounceTime ?? (
|
|
101
|
+
debounceTime: e.watch?.debounceTime ?? (p || l ? 50 : 20),
|
|
101
102
|
clearScreen: e.watch?.clearScreen ?? !1,
|
|
102
103
|
skipWritingUnchanged: v ? !1 : e.watch?.skipWritingUnchanged ?? !0
|
|
103
104
|
},
|
|
@@ -106,8 +107,8 @@ function N(e) {
|
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
109
|
async function V(e, t) {
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
110
|
+
const n = t !== void 0, o = e ?? process.cwd(), i = y.resolve(o, t ?? "api-extractor.config.ts"), r = await S(i);
|
|
111
|
+
if (n && !r)
|
|
111
112
|
throw Error(`The provided config file at ${i} does not exist.`);
|
|
112
113
|
if (!r)
|
|
113
114
|
return e === void 0 ? {} : { context: { cwd: e } };
|
|
@@ -121,22 +122,22 @@ async function V(e, t) {
|
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
124
|
function j(e, t) {
|
|
124
|
-
const
|
|
125
|
+
const n = e.context, o = t.context, i = e.types, r = t.types, s = e.documentation, c = t.documentation, m = e.verify, p = t.verify, l = e.watch, a = t.watch;
|
|
125
126
|
return {
|
|
126
127
|
isResolvedConfig: e.isResolvedConfig || t.isResolvedConfig || void 0,
|
|
127
128
|
context: {
|
|
128
|
-
dtsEmitPath:
|
|
129
|
-
emptyDtsEmitPath:
|
|
130
|
-
apiJsonEmitPath:
|
|
131
|
-
environment:
|
|
132
|
-
cwd:
|
|
133
|
-
basePath:
|
|
134
|
-
packageJson:
|
|
135
|
-
logger:
|
|
136
|
-
excludedDirectories:
|
|
137
|
-
isLuminaMinimalExtraction:
|
|
138
|
-
includeLuminaPrivateComponents:
|
|
139
|
-
supportApplyMixinsSyntax:
|
|
129
|
+
dtsEmitPath: o?.dtsEmitPath ?? n?.dtsEmitPath,
|
|
130
|
+
emptyDtsEmitPath: o?.emptyDtsEmitPath ?? n?.emptyDtsEmitPath,
|
|
131
|
+
apiJsonEmitPath: o?.apiJsonEmitPath ?? n?.apiJsonEmitPath,
|
|
132
|
+
environment: o?.environment ?? n?.environment,
|
|
133
|
+
cwd: o?.cwd ?? n?.cwd,
|
|
134
|
+
basePath: o?.basePath ?? n?.basePath,
|
|
135
|
+
packageJson: o?.packageJson ?? n?.packageJson,
|
|
136
|
+
logger: o?.logger ?? n?.logger,
|
|
137
|
+
excludedDirectories: o?.excludedDirectories ?? n?.excludedDirectories,
|
|
138
|
+
isLuminaMinimalExtraction: o?.isLuminaMinimalExtraction ?? n?.isLuminaMinimalExtraction,
|
|
139
|
+
includeLuminaPrivateComponents: o?.includeLuminaPrivateComponents ?? n?.includeLuminaPrivateComponents,
|
|
140
|
+
supportApplyMixinsSyntax: o?.supportApplyMixinsSyntax ?? n?.supportApplyMixinsSyntax ?? !1
|
|
140
141
|
},
|
|
141
142
|
types: {
|
|
142
143
|
typeCheckedExtraction: r?.typeCheckedExtraction ?? i?.typeCheckedExtraction,
|
|
@@ -165,23 +166,24 @@ function j(e, t) {
|
|
|
165
166
|
basePath: c?.basePath ?? s?.basePath
|
|
166
167
|
},
|
|
167
168
|
verify: {
|
|
168
|
-
typeCheckTypes:
|
|
169
|
-
filterTypeCheckDiagnostic:
|
|
170
|
-
|
|
169
|
+
typeCheckTypes: p?.typeCheckTypes ?? m?.typeCheckTypes,
|
|
170
|
+
filterTypeCheckDiagnostic: p?.filterTypeCheckDiagnostic ?? m?.filterTypeCheckDiagnostic,
|
|
171
|
+
filterUnreferencedType: p?.filterUnreferencedType ?? m?.filterUnreferencedType,
|
|
172
|
+
detectBrokenLinks: p?.detectBrokenLinks ?? m?.detectBrokenLinks
|
|
171
173
|
},
|
|
172
174
|
watch: {
|
|
173
|
-
onUpdate: f(a?.onUpdate,
|
|
174
|
-
debounceTime: a?.debounceTime ??
|
|
175
|
-
clearScreen: a?.clearScreen ??
|
|
176
|
-
skipWritingUnchanged: a?.skipWritingUnchanged ??
|
|
175
|
+
onUpdate: f(a?.onUpdate, l?.onUpdate),
|
|
176
|
+
debounceTime: a?.debounceTime ?? l?.debounceTime,
|
|
177
|
+
clearScreen: a?.clearScreen ?? l?.clearScreen,
|
|
178
|
+
skipWritingUnchanged: a?.skipWritingUnchanged ?? l?.skipWritingUnchanged
|
|
177
179
|
},
|
|
178
180
|
strict: t.strict ?? e.strict,
|
|
179
181
|
afterApiJsonCreate: f(t.afterApiJsonCreate, e.afterApiJsonCreate)
|
|
180
182
|
};
|
|
181
183
|
}
|
|
182
184
|
function f(e, t) {
|
|
183
|
-
const
|
|
184
|
-
return
|
|
185
|
+
const n = t === d ? void 0 : t, o = e === d ? void 0 : e;
|
|
186
|
+
return n !== void 0 && o !== void 0 ? ((...i) => (n(...i), o(...i))) : o ?? n;
|
|
185
187
|
}
|
|
186
188
|
export {
|
|
187
189
|
V as l,
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { styleText as D } from "node:util";
|
|
2
|
+
import { emitJsDocError as g, getApiNodeLabel as T } from "../utils/apiHelpers.js";
|
|
3
|
+
import { b as A, e as W, d as S, g as L } from "./privateContext.js";
|
|
4
|
+
import { kebabToPascal as M } from "@arcgis/toolkit/string";
|
|
5
|
+
import R from "typescript";
|
|
6
|
+
function q(e, i, n) {
|
|
7
|
+
return N(e, i, n) ?? void 0;
|
|
8
|
+
}
|
|
9
|
+
function z(e, i, n, t) {
|
|
10
|
+
const s = N(e, i, n);
|
|
11
|
+
return s === void 0 ? t : s ?? void 0;
|
|
12
|
+
}
|
|
13
|
+
function N(e, i, n) {
|
|
14
|
+
const t = R.getLeadingCommentRanges(n.file.text, e.pos);
|
|
15
|
+
if (t === void 0)
|
|
16
|
+
return;
|
|
17
|
+
let s;
|
|
18
|
+
for (const l of t) {
|
|
19
|
+
const d = n.file.text.slice(l.pos, l.end);
|
|
20
|
+
d.startsWith("/**") && (s !== void 0 && n.config.strict && n.emitError(
|
|
21
|
+
`Found multiple JSDoc comments for the same node. This is not allowed.
|
|
22
|
+
If one of these was meant to be a file-level comment, read the documentation: https://webgis.esri.com/references/api-extractor/api-node-kinds#module-level-documentation
|
|
23
|
+
If this is meant to be a function overload, read the documentation: https://webgis.esri.com/references/api-extractor/api-node-kinds#function-overloads`,
|
|
24
|
+
{
|
|
25
|
+
file: n.file,
|
|
26
|
+
node: e
|
|
27
|
+
}
|
|
28
|
+
), s = d);
|
|
29
|
+
}
|
|
30
|
+
if (s === void 0)
|
|
31
|
+
return;
|
|
32
|
+
const o = n.config.documentation.omitInternal;
|
|
33
|
+
return J(s, i, o, n);
|
|
34
|
+
}
|
|
35
|
+
function J(e, i, n, t) {
|
|
36
|
+
if (i && !e.includes("* @public") && (n || !e.includes("* @internal")))
|
|
37
|
+
return null;
|
|
38
|
+
const s = e.length - 2;
|
|
39
|
+
let o = 3, l = "";
|
|
40
|
+
const d = [];
|
|
41
|
+
let r, k, h = !1;
|
|
42
|
+
for (; o < s; ) {
|
|
43
|
+
let v = e.indexOf(`
|
|
44
|
+
`, o);
|
|
45
|
+
v === -1 && (v = s);
|
|
46
|
+
let f = e.slice(o, v).trim();
|
|
47
|
+
if (o = v + 1, f === "*" ? f = "" : f.startsWith("*") && (f[1] === " " ? f = f.slice(2) : t.config.strict ? t.emitError(
|
|
48
|
+
`For consistency, include a space character after '*' in JSDoc. Did not find it in "${e}"`,
|
|
49
|
+
{
|
|
50
|
+
file: t.file,
|
|
51
|
+
node: void 0
|
|
52
|
+
}
|
|
53
|
+
) : f = f.slice(1)), f.startsWith("@")) {
|
|
54
|
+
r !== void 0 && !h && d.push(
|
|
55
|
+
y[r] ?? {
|
|
56
|
+
name: r,
|
|
57
|
+
text: k.trim().replaceAll("\\@", "@") || void 0
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
const b = f.indexOf(" "), c = b === -1 ? f.slice(1) : f.slice(1, b);
|
|
61
|
+
if (c === "internal") {
|
|
62
|
+
if (n)
|
|
63
|
+
return null;
|
|
64
|
+
i = !1;
|
|
65
|
+
} else c === "public" ? (i = !1, h = !0) : h = c === "privateRemarks";
|
|
66
|
+
const a = b === -1 ? "" : f.slice(b + 1);
|
|
67
|
+
r = c, k = a;
|
|
68
|
+
} else r !== void 0 ? k = `${k}
|
|
69
|
+
${f}` : l += `${f}
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
return i ? null : (r !== void 0 && !h && d.push(
|
|
73
|
+
y[r] ?? {
|
|
74
|
+
name: r,
|
|
75
|
+
text: k.trim().replaceAll("\\@", "@") || void 0
|
|
76
|
+
}
|
|
77
|
+
), {
|
|
78
|
+
description: l.trim().replaceAll("\\@", "@") || void 0,
|
|
79
|
+
docsTags: d
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function G(e, i) {
|
|
83
|
+
for (let n = 0; n < i.docsTags.length; ++n) {
|
|
84
|
+
const t = i.docsTags[n], { name: s, text: o } = t;
|
|
85
|
+
s === "deprecated" ? e.deprecated = o || !0 : (e.docsTags ??= [], e.docsTags.push(t));
|
|
86
|
+
}
|
|
87
|
+
e.description = i.description;
|
|
88
|
+
}
|
|
89
|
+
function K(e, i) {
|
|
90
|
+
for (let n = 0; n < i.docsTags.length; ++n) {
|
|
91
|
+
const t = i.docsTags[n], { name: s, text: o } = t;
|
|
92
|
+
if (s === "deprecated")
|
|
93
|
+
e.deprecated = o || !0;
|
|
94
|
+
else if (t === y.private)
|
|
95
|
+
e.privacy = "private";
|
|
96
|
+
else if (s === "csspart")
|
|
97
|
+
e.cssParts ??= [], e.cssParts.push(w(o));
|
|
98
|
+
else if (s === "cssstate")
|
|
99
|
+
e.cssStates ??= [], e.cssStates.push(w(o));
|
|
100
|
+
else if (s === "slot")
|
|
101
|
+
e.slots ??= [], e.slots.push(w(o));
|
|
102
|
+
else if (s === "esriCompatibilityName") {
|
|
103
|
+
const l = A(e);
|
|
104
|
+
l.esriCompatibilityNames ??= [], l.esriCompatibilityNames.push(o ?? "");
|
|
105
|
+
} else s === "readonly" || (e.docsTags ??= [], e.docsTags.push(t));
|
|
106
|
+
}
|
|
107
|
+
e.description = i.description;
|
|
108
|
+
}
|
|
109
|
+
function Q(e, i) {
|
|
110
|
+
const n = e, t = [];
|
|
111
|
+
for (let s = 0; s < i.docsTags.length; ++s) {
|
|
112
|
+
const o = i.docsTags[s], { name: l, text: d } = o;
|
|
113
|
+
if (l === "deprecated")
|
|
114
|
+
e.deprecated = d || !0;
|
|
115
|
+
else if (o === y.private)
|
|
116
|
+
e.privacy = "private";
|
|
117
|
+
else if (l === "param")
|
|
118
|
+
t.push(o);
|
|
119
|
+
else if (l === "returns")
|
|
120
|
+
n.return.description = o.text;
|
|
121
|
+
else if (l === "esriCompatibilityName") {
|
|
122
|
+
const r = S(e);
|
|
123
|
+
r.esriCompatibilityNames ??= [], r.esriCompatibilityNames.push(d ?? "");
|
|
124
|
+
} else
|
|
125
|
+
e.docsTags ??= [], e.docsTags.push(o);
|
|
126
|
+
}
|
|
127
|
+
return e.description = i.description, t;
|
|
128
|
+
}
|
|
129
|
+
function X(e, i) {
|
|
130
|
+
for (let n = 0; n < i.docsTags.length; ++n) {
|
|
131
|
+
const t = i.docsTags[n], { name: s, text: o } = t;
|
|
132
|
+
s === "deprecated" ? e.deprecated = o || !0 : s === "default" ? e.default = o : t === y.readonly ? e.readonly = !0 : t === y.private ? e.privacy = "private" : (e.docsTags ??= [], e.docsTags.push(t));
|
|
133
|
+
}
|
|
134
|
+
e.description = i.description;
|
|
135
|
+
}
|
|
136
|
+
function Y(e, i) {
|
|
137
|
+
for (let n = 0; n < i.docsTags.length; ++n) {
|
|
138
|
+
const t = i.docsTags[n], { name: s, text: o } = t;
|
|
139
|
+
if (s === "deprecated")
|
|
140
|
+
e.deprecated = o || !0;
|
|
141
|
+
else if (s === "default")
|
|
142
|
+
e.default = o;
|
|
143
|
+
else if (s !== "readonly") if (s === "esriCompatibilityName") {
|
|
144
|
+
const l = W(e);
|
|
145
|
+
l.esriCompatibilityNames ??= [], l.esriCompatibilityNames.push(o ?? "");
|
|
146
|
+
} else
|
|
147
|
+
e.docsTags ??= [], e.docsTags.push(t);
|
|
148
|
+
}
|
|
149
|
+
e.description = i.description;
|
|
150
|
+
}
|
|
151
|
+
function Z(e, i) {
|
|
152
|
+
for (let n = 0; n < i.docsTags.length; ++n) {
|
|
153
|
+
const t = i.docsTags[n], { name: s, text: o } = t;
|
|
154
|
+
s === "deprecated" ? e.deprecated = o || !0 : t === y.private ? e.privacy = "private" : (e.docsTags ??= [], e.docsTags.push(t));
|
|
155
|
+
}
|
|
156
|
+
e.description = i.description;
|
|
157
|
+
}
|
|
158
|
+
function w(e) {
|
|
159
|
+
if (e === void 0)
|
|
160
|
+
return {
|
|
161
|
+
name: "",
|
|
162
|
+
deprecated: void 0,
|
|
163
|
+
summary: void 0,
|
|
164
|
+
description: void 0,
|
|
165
|
+
docsTags: void 0,
|
|
166
|
+
type: void 0,
|
|
167
|
+
syntax: void 0,
|
|
168
|
+
default: void 0
|
|
169
|
+
};
|
|
170
|
+
const i = e.indexOf(" - ");
|
|
171
|
+
if (i === -1)
|
|
172
|
+
return e.startsWith("- ") ? {
|
|
173
|
+
name: "",
|
|
174
|
+
deprecated: void 0,
|
|
175
|
+
summary: void 0,
|
|
176
|
+
description: e.slice(2),
|
|
177
|
+
docsTags: void 0,
|
|
178
|
+
type: void 0,
|
|
179
|
+
syntax: void 0,
|
|
180
|
+
default: void 0
|
|
181
|
+
} : {
|
|
182
|
+
name: e,
|
|
183
|
+
deprecated: void 0,
|
|
184
|
+
summary: void 0,
|
|
185
|
+
description: void 0,
|
|
186
|
+
docsTags: void 0,
|
|
187
|
+
type: void 0,
|
|
188
|
+
syntax: void 0,
|
|
189
|
+
default: void 0
|
|
190
|
+
};
|
|
191
|
+
let n, t = e.slice(0, i);
|
|
192
|
+
if (t.startsWith("[") && t.endsWith("]")) {
|
|
193
|
+
const o = t.slice(1, -1), l = o.indexOf("=");
|
|
194
|
+
t = o.slice(0, l), n = o.slice(l + 1);
|
|
195
|
+
}
|
|
196
|
+
const s = e.slice(i + 3);
|
|
197
|
+
return {
|
|
198
|
+
name: t,
|
|
199
|
+
deprecated: void 0,
|
|
200
|
+
summary: void 0,
|
|
201
|
+
description: s,
|
|
202
|
+
docsTags: void 0,
|
|
203
|
+
type: void 0,
|
|
204
|
+
syntax: void 0,
|
|
205
|
+
default: n
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const y = {
|
|
209
|
+
// Create a null prototype object to avoid collisions with Object.prototype when doing lookups
|
|
210
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
211
|
+
__proto__: null,
|
|
212
|
+
internal: { name: "internal", text: void 0 },
|
|
213
|
+
private: { name: "private", text: void 0 },
|
|
214
|
+
copyDoc: { name: "copyDoc", text: void 0 },
|
|
215
|
+
beta: { name: "beta", text: void 0 },
|
|
216
|
+
experimental: { name: "experimental", text: void 0 },
|
|
217
|
+
readonly: { name: "readonly", text: void 0 },
|
|
218
|
+
required: { name: "required", text: void 0 }
|
|
219
|
+
}, ee = {
|
|
220
|
+
description: void 0,
|
|
221
|
+
docsTags: []
|
|
222
|
+
}, ie = {
|
|
223
|
+
description: void 0,
|
|
224
|
+
docsTags: [y.private]
|
|
225
|
+
};
|
|
226
|
+
function ne(e, i) {
|
|
227
|
+
if (typeof e == "string") {
|
|
228
|
+
const n = e.replaceAll(F, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host);
|
|
229
|
+
return e.includes("](.") && g(I, e, i), n;
|
|
230
|
+
}
|
|
231
|
+
return e;
|
|
232
|
+
}
|
|
233
|
+
function te(e, i) {
|
|
234
|
+
if (e) {
|
|
235
|
+
const n = e.replaceAll(F, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host);
|
|
236
|
+
return n.includes("](.") && g(I, n, i), n;
|
|
237
|
+
}
|
|
238
|
+
return e;
|
|
239
|
+
}
|
|
240
|
+
function se(e, i) {
|
|
241
|
+
if (e !== void 0 && i.inheritedModuleName === void 0)
|
|
242
|
+
for (let n = 0; n < e.length; ++n) {
|
|
243
|
+
const t = e[n];
|
|
244
|
+
t.text && (t.text = t.text.replaceAll(F, i.resolveJsDocLink).replaceAll(i.config.documentation.alternativeHost, i.config.documentation.host), t.text.includes("](.") && g(I, t.text, i));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const I = "Unexpected relative markdown link. For links to API within the package use {@link}. For all other links, use absolute markdown. Documentation: https://webgis.esri.com/references/api-extractor/tags-reference#link)", F = /\{@link +([^}]+)\}/gu;
|
|
248
|
+
function oe(e, i, n) {
|
|
249
|
+
let t = n.indexOf(" ");
|
|
250
|
+
t === -1 && (t = n.length);
|
|
251
|
+
const s = n.slice(0, t);
|
|
252
|
+
let o = n.slice(t + 1);
|
|
253
|
+
if (s.startsWith("https://"))
|
|
254
|
+
return e.config.strict ? (g(
|
|
255
|
+
"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)",
|
|
256
|
+
i,
|
|
257
|
+
e
|
|
258
|
+
), "") : `[${o || s}](${s})`;
|
|
259
|
+
const [l, d] = s.split("#"), [r, k] = l.split("!");
|
|
260
|
+
if (r === "")
|
|
261
|
+
return g(
|
|
262
|
+
`Expected @link reference to start with a module name (before ! or #), but got: ${s}`,
|
|
263
|
+
i,
|
|
264
|
+
e
|
|
265
|
+
), i;
|
|
266
|
+
let h = e.moduleMap.get(r);
|
|
267
|
+
if (h === void 0 && e.isComponentProject && !e.config.strict) {
|
|
268
|
+
for (const c of e.moduleMap.values())
|
|
269
|
+
if (L(c).index.class?.name === r) {
|
|
270
|
+
h = c;
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (h === void 0)
|
|
275
|
+
return e.config.verify.detectBrokenLinks ? g(
|
|
276
|
+
`Failed to find referenced module: ${D("red", r)}${r.startsWith("module:") ? '. Module name in @link does not need the "module:" prefix' : r.startsWith("esri/") ? '. Module name in @link does not need to start with the "esri/" prefix.' : ""}`,
|
|
277
|
+
i,
|
|
278
|
+
e
|
|
279
|
+
) : e.silencedBrokenLinkCount += 1, i;
|
|
280
|
+
const v = L(h), f = e.inheritedModuleName === void 0 ? e.apiModule : e.moduleMap.get(e.inheritedModuleName) ?? e.apiModule;
|
|
281
|
+
if (e.watchFiles !== void 0 && r !== f.path && L(f).isStale) {
|
|
282
|
+
const c = L(f).file.fileName.slice(e.config.context.cwd.length), a = v.file.fileName.slice(e.config.context.cwd.length);
|
|
283
|
+
e.watchFiles.get(c).docLinks.push(n), e.watchFiles.get(c).dependencies.add(a);
|
|
284
|
+
const $ = e.watchFiles.get(a).dependents;
|
|
285
|
+
$.has(c) || $.set(c, !1);
|
|
286
|
+
}
|
|
287
|
+
let b = O(h.path, k, d, e);
|
|
288
|
+
if (k !== void 0) {
|
|
289
|
+
const c = v.index.named[k];
|
|
290
|
+
return c === void 0 ? (e.config.verify.detectBrokenLinks ? g(
|
|
291
|
+
`Failed to find the referenced declaration inside the module: ${D("red", `${r}!${k}`)}`,
|
|
292
|
+
i,
|
|
293
|
+
e
|
|
294
|
+
) : e.silencedBrokenLinkCount += 1, i) : c === v.index.class ? (g(
|
|
295
|
+
`Invalid reference syntax used. Class/mixin/custom element declarations must be referenced without specifying the class name. Expected ${D("green", r)}`,
|
|
296
|
+
i,
|
|
297
|
+
e
|
|
298
|
+
), i) : (P(e, i, c), `[${o || T(c)}](${b})`);
|
|
299
|
+
} else if (d !== void 0) {
|
|
300
|
+
const c = h.path === f.path, a = v.index.class;
|
|
301
|
+
if (a === void 0)
|
|
302
|
+
return v.index.named[d] === void 0 ? e.config.verify.detectBrokenLinks ? g(
|
|
303
|
+
'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-"',
|
|
304
|
+
i,
|
|
305
|
+
e
|
|
306
|
+
) : e.silencedBrokenLinkCount += 1 : g(
|
|
307
|
+
`Invalid reference syntax used. This syntax is only permitted on modules that export a class/mixin/web component. Perhaps you meant to use ${D("red", `${r}!${d}`)} instead? Linking to properties in interfaces is not yet supported`,
|
|
308
|
+
i,
|
|
309
|
+
e
|
|
310
|
+
), i;
|
|
311
|
+
const $ = v.inheritance, x = typeof $ == "object" ? $ : void 0;
|
|
312
|
+
let m;
|
|
313
|
+
if (d.startsWith("event-")) {
|
|
314
|
+
const u = d.slice(6);
|
|
315
|
+
if (x !== void 0)
|
|
316
|
+
m = x.indexedEvents?.[u];
|
|
317
|
+
else if (a.events !== void 0)
|
|
318
|
+
for (let p = 0; p < a.events.length; ++p) {
|
|
319
|
+
const C = a.events[p];
|
|
320
|
+
if (u === C.name) {
|
|
321
|
+
m = C;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
} else if (d.startsWith("slot-")) {
|
|
326
|
+
const u = d.slice(5);
|
|
327
|
+
if (x !== void 0)
|
|
328
|
+
m = x.indexedSlots?.[u];
|
|
329
|
+
else if (a.slots !== void 0)
|
|
330
|
+
for (let p = 0; p < a.slots.length; ++p) {
|
|
331
|
+
const C = a.slots[p];
|
|
332
|
+
if (u === C.name) {
|
|
333
|
+
m = C;
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
m?.name === "" && (o ||= `${T(a)}.default-slot`);
|
|
338
|
+
} else if (d.startsWith("--")) {
|
|
339
|
+
if (x !== void 0)
|
|
340
|
+
m = x.indexedCssProperties?.[d];
|
|
341
|
+
else if (a.cssProperties !== void 0)
|
|
342
|
+
for (let u = 0; u < a.cssProperties.length; ++u) {
|
|
343
|
+
const p = a.cssProperties[u];
|
|
344
|
+
if (d === p.name) {
|
|
345
|
+
m = p;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
} else if (x?.indexedMembers !== void 0 && (m = x.indexedMembers[d] ?? x.indexedMembers[`static ${d}`]), m === void 0 && a.members !== void 0) {
|
|
350
|
+
for (let u = 0; u < a.members.length; ++u) {
|
|
351
|
+
const p = a.members[u];
|
|
352
|
+
if (d === p.name) {
|
|
353
|
+
m = p;
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (m === void 0 && !e.config.strict && e.isComponentProject && a.events !== void 0)
|
|
358
|
+
for (let u = 0; u < a.events.length; ++u) {
|
|
359
|
+
const p = a.events[u];
|
|
360
|
+
if (d === p.name) {
|
|
361
|
+
m = p, b = b.replace("#", "#event-");
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return m === void 0 ? (e.config.verify.detectBrokenLinks ? g("Failed to find the referenced class member", i, e) : e.silencedBrokenLinkCount += 1, i) : (P(e, i, m), `[${o || (c ? T(m) : `${T(a)}.${T(m)}`)}](${b})`);
|
|
367
|
+
} else {
|
|
368
|
+
P(e, i, v.index.class);
|
|
369
|
+
const c = v.index.class === void 0 ? B(r) : T(v.index.class);
|
|
370
|
+
return `[${o || c}](${b})`;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function O(e, i, n, t) {
|
|
374
|
+
let s;
|
|
375
|
+
if (t.isComponentProject && typeof t.config.documentation.getComponentDocsUrl == "function" && e.startsWith("components/")) {
|
|
376
|
+
const o = e.slice(11), l = o.indexOf("/"), d = l === -1 ? o : o.slice(0, l), r = t.config.documentation.getComponentDocsUrl(d, M(d));
|
|
377
|
+
r !== void 0 && (s = r + (l === -1 ? "" : o.slice(l + 1)));
|
|
378
|
+
}
|
|
379
|
+
return s ??= `${t.normalizedApiReferencePrefix}${e}/`, U(s, i, n);
|
|
380
|
+
}
|
|
381
|
+
function U(e, i, n) {
|
|
382
|
+
return i !== void 0 ? n === void 0 ? `${e}#${encodeURIComponent(i)}` : `${e}#${encodeURIComponent(i)}-${encodeURIComponent(n)}` : n !== void 0 ? `${e}#${encodeURIComponent(n)}` : e;
|
|
383
|
+
}
|
|
384
|
+
function B(e) {
|
|
385
|
+
const i = e.lastIndexOf("/");
|
|
386
|
+
return i === -1 ? e : e.slice(i + 1);
|
|
387
|
+
}
|
|
388
|
+
const de = (e) => `/javascript/latest/references/${e}/`;
|
|
389
|
+
function P(e, i, n) {
|
|
390
|
+
const t = e.typeVerifier?.linkSource;
|
|
391
|
+
t === void 0 || n?.docsTags?.includes(y.internal) !== !0 || t.docsTags?.includes(y.internal) !== !0 && g("@public API must not link to @internal API - leads to 404 in public doc", i, e);
|
|
392
|
+
}
|
|
393
|
+
export {
|
|
394
|
+
O as a,
|
|
395
|
+
U as b,
|
|
396
|
+
q as c,
|
|
397
|
+
Z as d,
|
|
398
|
+
Q as e,
|
|
399
|
+
X as f,
|
|
400
|
+
de as g,
|
|
401
|
+
K as h,
|
|
402
|
+
z as i,
|
|
403
|
+
ee as j,
|
|
404
|
+
Y as k,
|
|
405
|
+
y as l,
|
|
406
|
+
G as m,
|
|
407
|
+
ne as n,
|
|
408
|
+
te as o,
|
|
409
|
+
ie as p,
|
|
410
|
+
se as q,
|
|
411
|
+
oe as r
|
|
412
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -36,7 +36,7 @@ o.command("diff").description("Produce a diff of two api.json files").requiredOp
|
|
|
36
36
|
"Base URL for documentation links. Used only if output format is Markdown",
|
|
37
37
|
"https://developers.arcgis.com/javascript/latest/references/core/"
|
|
38
38
|
).action(async (t) => {
|
|
39
|
-
const { diffApiCli: e } = await import("./cli
|
|
39
|
+
const { diffApiCli: e } = await import("./chunks/cli.js");
|
|
40
40
|
await e({
|
|
41
41
|
oldPath: t.old,
|
|
42
42
|
newPath: t.new,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../config
|
|
2
|
-
import "
|
|
1
|
+
import "../chunks/config.js";
|
|
2
|
+
import "../chunks/links.js";
|
|
3
3
|
import "typescript";
|
|
4
|
-
import { A as x } from "../ApiExtractor
|
|
4
|
+
import { A as x } from "../chunks/ApiExtractor.js";
|
|
5
5
|
import "@arcgis/toolkit/function";
|
|
6
6
|
import "@arcgis/node-toolkit/workspace";
|
|
7
7
|
export {
|