@arcgis/api-extractor 5.2.0-next.125 → 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/chunks/ApiExtractor.js +1925 -2101
- package/dist/chunks/config.js +22 -22
- package/dist/chunks/links.js +412 -0
- package/dist/chunks/privateContext.js +6 -6
- package/dist/diff/apiDiffToMarkdown.js +1 -1
- package/dist/extractor/ApiExtractor.js +1 -1
- package/dist/extractor/config.js +1 -1
- package/dist/extractor/processing/links.js +12 -173
- package/dist/utils/apiHelpers.js +1 -1
- package/package.json +3 -3
|
@@ -1,175 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
if (typeof e == "string") {
|
|
7
|
-
const i = e.replaceAll(F, n.resolveJsDocLink).replaceAll(n.config.documentation.alternativeHost, n.config.documentation.host);
|
|
8
|
-
return e.includes("](.") && a(P, e, n), i;
|
|
9
|
-
}
|
|
10
|
-
return e;
|
|
11
|
-
}
|
|
12
|
-
function j(e, n) {
|
|
13
|
-
if (e) {
|
|
14
|
-
const i = e.replaceAll(F, n.resolveJsDocLink).replaceAll(n.config.documentation.alternativeHost, n.config.documentation.host);
|
|
15
|
-
return i.includes("](.") && a(P, i, n), i;
|
|
16
|
-
}
|
|
17
|
-
return e;
|
|
18
|
-
}
|
|
19
|
-
function J(e, n) {
|
|
20
|
-
if (e !== void 0 && n.inheritedModuleName === void 0)
|
|
21
|
-
for (let i = 0; i < e.length; ++i) {
|
|
22
|
-
const d = e[i];
|
|
23
|
-
d.text && (d.text = d.text.replaceAll(F, n.resolveJsDocLink).replaceAll(n.config.documentation.alternativeHost, n.config.documentation.host), d.text.includes("](.") && a(P, d.text, n));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const P = "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;
|
|
27
|
-
function N(e, n, i) {
|
|
28
|
-
let d = i.indexOf(" ");
|
|
29
|
-
d === -1 && (d = i.length);
|
|
30
|
-
const m = i.slice(0, d);
|
|
31
|
-
let u = i.slice(d + 1);
|
|
32
|
-
if (m.startsWith("https://"))
|
|
33
|
-
return e.config.strict ? (a(
|
|
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)",
|
|
35
|
-
n,
|
|
36
|
-
e
|
|
37
|
-
), "") : `[${u || m}](${m})`;
|
|
38
|
-
const [k, s] = m.split("#"), [c, L] = k.split("!");
|
|
39
|
-
if (c === "")
|
|
40
|
-
return a(
|
|
41
|
-
`Expected @link reference to start with a module name (before ! or #), but got: ${m}`,
|
|
42
|
-
n,
|
|
43
|
-
e
|
|
44
|
-
), n;
|
|
45
|
-
let g = e.moduleMap.get(c);
|
|
46
|
-
if (g === void 0 && e.isComponentProject && !e.config.strict) {
|
|
47
|
-
for (const r of e.moduleMap.values())
|
|
48
|
-
if (y(r).index.class?.name === c) {
|
|
49
|
-
g = r;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (g === void 0)
|
|
54
|
-
return e.config.verify.detectBrokenLinks ? a(
|
|
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.' : ""}`,
|
|
56
|
-
n,
|
|
57
|
-
e
|
|
58
|
-
) : e.silencedBrokenLinkCount += 1, n;
|
|
59
|
-
const v = y(g), D = e.inheritedModuleName === void 0 ? e.apiModule : e.moduleMap.get(e.inheritedModuleName) ?? e.apiModule;
|
|
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);
|
|
65
|
-
}
|
|
66
|
-
let b = M(g.path, L, s, e);
|
|
67
|
-
if (L !== void 0) {
|
|
68
|
-
const r = v.index.named[L];
|
|
69
|
-
return r === void 0 ? (e.config.verify.detectBrokenLinks ? a(
|
|
70
|
-
`Failed to find the referenced declaration inside the module: ${C("red", `${c}!${L}`)}`,
|
|
71
|
-
n,
|
|
72
|
-
e
|
|
73
|
-
) : e.silencedBrokenLinkCount += 1, n) : r === v.index.class ? (a(
|
|
74
|
-
`Invalid reference syntax used. Class/mixin/custom element declarations must be referenced without specifying the class name. Expected ${C("green", c)}`,
|
|
75
|
-
n,
|
|
76
|
-
e
|
|
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(
|
|
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-"',
|
|
83
|
-
n,
|
|
84
|
-
e
|
|
85
|
-
) : e.silencedBrokenLinkCount += 1 : a(
|
|
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`,
|
|
87
|
-
n,
|
|
88
|
-
e
|
|
89
|
-
), n;
|
|
90
|
-
const $ = v.inheritance, p = typeof $ == "object" ? $ : void 0;
|
|
91
|
-
let f;
|
|
92
|
-
if (s.startsWith("event-")) {
|
|
93
|
-
const o = s.slice(6);
|
|
94
|
-
if (p !== void 0)
|
|
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;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
} else if (s.startsWith("slot-")) {
|
|
105
|
-
const o = s.slice(5);
|
|
106
|
-
if (p !== void 0)
|
|
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;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
f?.name === "" && (u ||= `${h(t)}.default-slot`);
|
|
117
|
-
} else if (s.startsWith("--")) {
|
|
118
|
-
if (p !== void 0)
|
|
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;
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
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;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
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-");
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
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})`;
|
|
146
|
-
} else {
|
|
147
|
-
const r = v.index.class === void 0 ? U(c) : h(v.index.class);
|
|
148
|
-
return `[${u || r}](${b})`;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function M(e, n, i, d) {
|
|
152
|
-
let m;
|
|
153
|
-
if (d.isComponentProject && typeof d.config.documentation.getComponentDocsUrl == "function" && e.startsWith("components/")) {
|
|
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)));
|
|
156
|
-
}
|
|
157
|
-
return m ??= `${d.normalizedApiReferencePrefix}${e}/`, x(m, n, i);
|
|
158
|
-
}
|
|
159
|
-
function x(e, n, i) {
|
|
160
|
-
return n !== void 0 ? i === void 0 ? `${e}#${encodeURIComponent(n)}` : `${e}#${encodeURIComponent(n)}-${encodeURIComponent(i)}` : i !== void 0 ? `${e}#${encodeURIComponent(i)}` : e;
|
|
161
|
-
}
|
|
162
|
-
function U(e) {
|
|
163
|
-
const n = e.lastIndexOf("/");
|
|
164
|
-
return n === -1 ? e : e.slice(n + 1);
|
|
165
|
-
}
|
|
166
|
-
const E = (e) => `/javascript/latest/references/${e}/`;
|
|
1
|
+
import "node:util";
|
|
2
|
+
import "../../utils/apiHelpers.js";
|
|
3
|
+
import "../../chunks/privateContext.js";
|
|
4
|
+
import "@arcgis/toolkit/string";
|
|
5
|
+
import { b as i, g as p, a as c, n as l, o as m, q as D, r as g } from "../../chunks/links.js";
|
|
167
6
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
7
|
+
i as buildViewUrl,
|
|
8
|
+
p as getDefaultBasePath,
|
|
9
|
+
c as getViewUrl,
|
|
10
|
+
l as postProcessDeprecated,
|
|
11
|
+
m as postProcessDescription,
|
|
12
|
+
D as postProcessDocsTags,
|
|
13
|
+
g as resolveJsDocLink
|
|
175
14
|
};
|
package/dist/utils/apiHelpers.js
CHANGED
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.126",
|
|
4
4
|
"description": "Documentation engine for WebGIS SDK packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
],
|
|
49
49
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@arcgis/node-toolkit": "5.2.0-next.
|
|
52
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
51
|
+
"@arcgis/node-toolkit": "5.2.0-next.126",
|
|
52
|
+
"@arcgis/toolkit": "5.2.0-next.126",
|
|
53
53
|
"@commander-js/extra-typings": "^15.0.0",
|
|
54
54
|
"commander": "^15.0.0",
|
|
55
55
|
"tslib": "^2.8.1"
|