@typespec/tspd 0.47.0-dev.0
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/LICENSE +21 -0
- package/cmd/tspd.js +2 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +99 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/ref-doc/api-docs.d.ts +4 -0
- package/dist/src/ref-doc/api-docs.d.ts.map +1 -0
- package/dist/src/ref-doc/api-docs.js +71 -0
- package/dist/src/ref-doc/api-docs.js.map +1 -0
- package/dist/src/ref-doc/emitters/docusaurus.d.ts +24 -0
- package/dist/src/ref-doc/emitters/docusaurus.d.ts.map +1 -0
- package/dist/src/ref-doc/emitters/docusaurus.js +232 -0
- package/dist/src/ref-doc/emitters/docusaurus.js.map +1 -0
- package/dist/src/ref-doc/emitters/markdown.d.ts +32 -0
- package/dist/src/ref-doc/emitters/markdown.d.ts.map +1 -0
- package/dist/src/ref-doc/emitters/markdown.js +229 -0
- package/dist/src/ref-doc/emitters/markdown.js.map +1 -0
- package/dist/src/ref-doc/experimental.d.ts +9 -0
- package/dist/src/ref-doc/experimental.d.ts.map +1 -0
- package/dist/src/ref-doc/experimental.js +63 -0
- package/dist/src/ref-doc/experimental.js.map +1 -0
- package/dist/src/ref-doc/extractor.d.ts +11 -0
- package/dist/src/ref-doc/extractor.d.ts.map +1 -0
- package/dist/src/ref-doc/extractor.js +497 -0
- package/dist/src/ref-doc/extractor.js.map +1 -0
- package/dist/src/ref-doc/index.d.ts +5 -0
- package/dist/src/ref-doc/index.d.ts.map +1 -0
- package/dist/src/ref-doc/index.js +5 -0
- package/dist/src/ref-doc/index.js.map +1 -0
- package/dist/src/ref-doc/lib.d.ts +63 -0
- package/dist/src/ref-doc/lib.d.ts.map +1 -0
- package/dist/src/ref-doc/lib.js +24 -0
- package/dist/src/ref-doc/lib.js.map +1 -0
- package/dist/src/ref-doc/types.d.ts +109 -0
- package/dist/src/ref-doc/types.d.ts.map +1 -0
- package/dist/src/ref-doc/types.js +2 -0
- package/dist/src/ref-doc/types.js.map +1 -0
- package/dist/src/ref-doc/utils/markdown.d.ts +27 -0
- package/dist/src/ref-doc/utils/markdown.d.ts.map +1 -0
- package/dist/src/ref-doc/utils/markdown.js +70 -0
- package/dist/src/ref-doc/utils/markdown.js.map +1 -0
- package/dist/src/ref-doc/utils/type-signature.d.ts +5 -0
- package/dist/src/ref-doc/utils/type-signature.d.ts.map +1 -0
- package/dist/src/ref-doc/utils/type-signature.js +136 -0
- package/dist/src/ref-doc/utils/type-signature.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import { compile, compilerAssert, createDiagnosticCollector, getDoc, getLocationContext, getSourceLocation, getTypeName, isDeclaredType, isTemplateDeclaration, joinPaths, navigateProgram, navigateTypesInNamespace, NodeHost, NoTarget, resolvePath, SyntaxKind, } from "@typespec/compiler";
|
|
2
|
+
import { readFile } from "fs/promises";
|
|
3
|
+
import { pathToFileURL } from "url";
|
|
4
|
+
import { reportDiagnostic } from "./lib.js";
|
|
5
|
+
import { getQualifier, getTypeSignature } from "./utils/type-signature.js";
|
|
6
|
+
export async function extractLibraryRefDocs(libraryPath) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
const diagnostics = createDiagnosticCollector();
|
|
9
|
+
const pkgJson = await readPackageJson(libraryPath);
|
|
10
|
+
const refDoc = {
|
|
11
|
+
name: pkgJson.name,
|
|
12
|
+
description: pkgJson.description,
|
|
13
|
+
packageJson: pkgJson,
|
|
14
|
+
namespaces: [],
|
|
15
|
+
};
|
|
16
|
+
if (pkgJson.tspMain) {
|
|
17
|
+
const main = resolvePath(libraryPath, pkgJson.tspMain);
|
|
18
|
+
const program = await compile(NodeHost, main, {
|
|
19
|
+
parseOptions: { comments: true, docs: true },
|
|
20
|
+
});
|
|
21
|
+
refDoc.namespaces = diagnostics.pipe(extractRefDocs(program)).namespaces;
|
|
22
|
+
for (const diag of (_a = program.diagnostics) !== null && _a !== void 0 ? _a : []) {
|
|
23
|
+
diagnostics.add(diag);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (pkgJson.main) {
|
|
27
|
+
const entrypoint = await import(pathToFileURL(resolvePath(libraryPath, pkgJson.main)).href);
|
|
28
|
+
const lib = entrypoint.$lib;
|
|
29
|
+
if ((_b = lib === null || lib === void 0 ? void 0 : lib.emitter) === null || _b === void 0 ? void 0 : _b.options) {
|
|
30
|
+
refDoc.emitter = {
|
|
31
|
+
options: extractEmitterOptionsRefDoc(lib.emitter.options),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
35
|
+
const linter = (_c = entrypoint.$linter) !== null && _c !== void 0 ? _c : lib === null || lib === void 0 ? void 0 : lib.linter;
|
|
36
|
+
if (lib && linter) {
|
|
37
|
+
refDoc.linter = extractLinterRefDoc(lib.name, linter);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return diagnostics.wrap(refDoc);
|
|
41
|
+
}
|
|
42
|
+
async function readPackageJson(libraryPath) {
|
|
43
|
+
const buffer = await readFile(joinPaths(libraryPath, "package.json"));
|
|
44
|
+
return JSON.parse(buffer.toString());
|
|
45
|
+
}
|
|
46
|
+
function resolveNamespaces(program, options) {
|
|
47
|
+
var _a;
|
|
48
|
+
const diagnostics = createDiagnosticCollector();
|
|
49
|
+
let namespaceTypes = [];
|
|
50
|
+
const { include, exclude } = (_a = options === null || options === void 0 ? void 0 : options.namespaces) !== null && _a !== void 0 ? _a : {};
|
|
51
|
+
if (include) {
|
|
52
|
+
namespaceTypes = include
|
|
53
|
+
.map((x) => diagnostics.pipe(program.resolveTypeReference(x)))
|
|
54
|
+
.filter((x) => x !== undefined);
|
|
55
|
+
}
|
|
56
|
+
navigateProgram(program, {
|
|
57
|
+
namespace(namespace) {
|
|
58
|
+
if (getLocationContext(program, namespace).type !== "project") {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (namespace.name === "Private") {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
namespaceTypes.push(namespace);
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
if (exclude !== undefined) {
|
|
68
|
+
namespaceTypes = namespaceTypes.filter((x) => {
|
|
69
|
+
return exclude.includes(getTypeName(x));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return diagnostics.wrap(namespaceTypes);
|
|
73
|
+
}
|
|
74
|
+
export function extractRefDocs(program, options = {}) {
|
|
75
|
+
const diagnostics = createDiagnosticCollector();
|
|
76
|
+
const namespaceTypes = diagnostics.pipe(resolveNamespaces(program, options));
|
|
77
|
+
const refDoc = {
|
|
78
|
+
namespaces: [],
|
|
79
|
+
};
|
|
80
|
+
for (const namespace of namespaceTypes) {
|
|
81
|
+
const namespaceDoc = {
|
|
82
|
+
id: getTypeName(namespace),
|
|
83
|
+
decorators: [],
|
|
84
|
+
operations: [],
|
|
85
|
+
interfaces: [],
|
|
86
|
+
models: [],
|
|
87
|
+
enums: [],
|
|
88
|
+
unions: [],
|
|
89
|
+
scalars: [],
|
|
90
|
+
};
|
|
91
|
+
refDoc.namespaces.push(namespaceDoc);
|
|
92
|
+
navigateTypesInNamespace(namespace, {
|
|
93
|
+
decorator(dec) {
|
|
94
|
+
namespaceDoc.decorators.push(extractDecoratorRefDoc(program, dec));
|
|
95
|
+
},
|
|
96
|
+
operation(operation) {
|
|
97
|
+
if (!isDeclaredType(operation)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (operation.interface === undefined) {
|
|
101
|
+
namespaceDoc.operations.push(extractOperationRefDoc(program, operation, undefined));
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
interface(iface) {
|
|
105
|
+
if (!isDeclaredType(iface)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
namespaceDoc.interfaces.push(extractInterfaceRefDocs(program, iface));
|
|
109
|
+
},
|
|
110
|
+
model(model) {
|
|
111
|
+
if (!isDeclaredType(model)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (model.name === "") {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
namespaceDoc.models.push(extractModelRefDocs(program, model));
|
|
118
|
+
},
|
|
119
|
+
enum(e) {
|
|
120
|
+
if (!isDeclaredType(e)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
namespaceDoc.enums.push(extractEnumRefDoc(program, e));
|
|
124
|
+
},
|
|
125
|
+
union(union) {
|
|
126
|
+
if (!isDeclaredType(union)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (union.name !== undefined) {
|
|
130
|
+
namespaceDoc.unions.push(extractUnionRefDocs(program, union));
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
scalar(scalar) {
|
|
134
|
+
namespaceDoc.scalars.push(extractScalarRefDocs(program, scalar));
|
|
135
|
+
},
|
|
136
|
+
}, { includeTemplateDeclaration: true, skipSubNamespaces: true });
|
|
137
|
+
}
|
|
138
|
+
sort(refDoc.namespaces);
|
|
139
|
+
for (const namespace of refDoc.namespaces) {
|
|
140
|
+
sort(namespace.decorators);
|
|
141
|
+
sort(namespace.enums);
|
|
142
|
+
sort(namespace.interfaces);
|
|
143
|
+
sort(namespace.models);
|
|
144
|
+
sort(namespace.operations);
|
|
145
|
+
sort(namespace.unions);
|
|
146
|
+
sort(namespace.scalars);
|
|
147
|
+
}
|
|
148
|
+
function sort(arr) {
|
|
149
|
+
arr.sort((a, b) => a.id.localeCompare(b.id, "en"));
|
|
150
|
+
}
|
|
151
|
+
return diagnostics.wrap(refDoc);
|
|
152
|
+
}
|
|
153
|
+
function extractTemplateParameterDocs(program, type) {
|
|
154
|
+
if (isTemplateDeclaration(type)) {
|
|
155
|
+
const templateParamsDocs = getTemplateParameterDocs(type);
|
|
156
|
+
return type.node.templateParameters.map((x) => {
|
|
157
|
+
var _a, _b;
|
|
158
|
+
const doc = templateParamsDocs.get(x.id.sv);
|
|
159
|
+
if (doc === undefined || doc === "") {
|
|
160
|
+
reportDiagnostic(program, {
|
|
161
|
+
code: "documentation-missing",
|
|
162
|
+
messageId: "templateParam",
|
|
163
|
+
format: { name: (_a = type.name) !== null && _a !== void 0 ? _a : "", param: x.id.sv },
|
|
164
|
+
target: NoTarget,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
name: x.id.sv,
|
|
169
|
+
doc: (_b = templateParamsDocs.get(x.id.sv)) !== null && _b !== void 0 ? _b : "",
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function extractInterfaceRefDocs(program, iface) {
|
|
178
|
+
var _a;
|
|
179
|
+
const doc = extractMainDoc(program, iface);
|
|
180
|
+
if (doc === undefined || doc === "") {
|
|
181
|
+
reportDiagnostic(program, {
|
|
182
|
+
code: "documentation-missing",
|
|
183
|
+
messageId: "interface",
|
|
184
|
+
format: { name: (_a = iface.name) !== null && _a !== void 0 ? _a : "" },
|
|
185
|
+
target: NoTarget,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
id: getNamedTypeId(iface),
|
|
190
|
+
name: iface.name,
|
|
191
|
+
signature: getTypeSignature(iface),
|
|
192
|
+
type: iface,
|
|
193
|
+
templateParameters: extractTemplateParameterDocs(program, iface),
|
|
194
|
+
interfaceOperations: [...iface.operations.values()].map((x) => extractOperationRefDoc(program, x, iface.name)),
|
|
195
|
+
doc: doc,
|
|
196
|
+
examples: extractExamples(iface),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function extractOperationRefDoc(program, operation, interfaceName) {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
const doc = extractMainDoc(program, operation);
|
|
202
|
+
if (doc === undefined || doc === "") {
|
|
203
|
+
if (operation.interface !== undefined) {
|
|
204
|
+
reportDiagnostic(program, {
|
|
205
|
+
code: "documentation-missing",
|
|
206
|
+
messageId: "interfaceOperation",
|
|
207
|
+
format: { name: (_a = `${operation.interface.name}.${operation.name}`) !== null && _a !== void 0 ? _a : "" },
|
|
208
|
+
target: NoTarget,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
reportDiagnostic(program, {
|
|
213
|
+
code: "documentation-missing",
|
|
214
|
+
messageId: "operation",
|
|
215
|
+
format: { name: (_b = operation.name) !== null && _b !== void 0 ? _b : "" },
|
|
216
|
+
target: NoTarget,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
id: getNamedTypeId(operation),
|
|
222
|
+
name: interfaceName ? `${interfaceName}.${operation.name}` : operation.name,
|
|
223
|
+
signature: getTypeSignature(operation),
|
|
224
|
+
type: operation,
|
|
225
|
+
templateParameters: extractTemplateParameterDocs(program, operation),
|
|
226
|
+
doc: doc,
|
|
227
|
+
examples: extractExamples(operation),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function extractDecoratorRefDoc(program, decorator) {
|
|
231
|
+
var _a;
|
|
232
|
+
const paramDoc = getParmeterDocs(decorator);
|
|
233
|
+
const parameters = decorator.parameters.map((x) => {
|
|
234
|
+
var _a;
|
|
235
|
+
const docVal = paramDoc.get(x.name);
|
|
236
|
+
if (docVal === undefined || docVal === "") {
|
|
237
|
+
reportDiagnostic(program, {
|
|
238
|
+
code: "documentation-missing",
|
|
239
|
+
messageId: "decoratorParam",
|
|
240
|
+
format: { name: decorator.name, param: x.name },
|
|
241
|
+
target: NoTarget,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
type: x,
|
|
246
|
+
doc: (_a = paramDoc.get(x.name)) !== null && _a !== void 0 ? _a : "",
|
|
247
|
+
name: x.name,
|
|
248
|
+
optional: x.optional,
|
|
249
|
+
rest: x.rest,
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
const examples = extractExamples(decorator);
|
|
253
|
+
const mainDoc = extractMainDoc(program, decorator);
|
|
254
|
+
if (mainDoc === undefined || mainDoc === "") {
|
|
255
|
+
reportDiagnostic(program, {
|
|
256
|
+
code: "documentation-missing",
|
|
257
|
+
messageId: "decorator",
|
|
258
|
+
format: { name: decorator.name },
|
|
259
|
+
target: NoTarget,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
id: getNamedTypeId(decorator),
|
|
264
|
+
name: decorator.name,
|
|
265
|
+
type: decorator,
|
|
266
|
+
signature: getTypeSignature(decorator),
|
|
267
|
+
doc: mainDoc,
|
|
268
|
+
parameters,
|
|
269
|
+
examples,
|
|
270
|
+
otherTags: [],
|
|
271
|
+
target: {
|
|
272
|
+
type: decorator.target,
|
|
273
|
+
doc: (_a = paramDoc.get(decorator.target.name)) !== null && _a !== void 0 ? _a : "",
|
|
274
|
+
name: decorator.target.name,
|
|
275
|
+
optional: decorator.target.optional,
|
|
276
|
+
rest: decorator.target.rest,
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function extractModelRefDocs(program, type) {
|
|
281
|
+
var _a;
|
|
282
|
+
const doc = extractMainDoc(program, type);
|
|
283
|
+
if (doc === undefined || doc === "") {
|
|
284
|
+
reportDiagnostic(program, {
|
|
285
|
+
code: "documentation-missing",
|
|
286
|
+
messageId: "model",
|
|
287
|
+
format: { name: (_a = type.name) !== null && _a !== void 0 ? _a : "" },
|
|
288
|
+
target: NoTarget,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
id: getNamedTypeId(type),
|
|
293
|
+
name: type.name,
|
|
294
|
+
signature: getTypeSignature(type),
|
|
295
|
+
type,
|
|
296
|
+
templateParameters: extractTemplateParameterDocs(program, type),
|
|
297
|
+
doc: doc,
|
|
298
|
+
examples: extractExamples(type),
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function extractEnumRefDoc(program, type) {
|
|
302
|
+
var _a;
|
|
303
|
+
const doc = extractMainDoc(program, type);
|
|
304
|
+
if (doc === undefined || doc === "") {
|
|
305
|
+
reportDiagnostic(program, {
|
|
306
|
+
code: "documentation-missing",
|
|
307
|
+
messageId: "enum",
|
|
308
|
+
format: { name: (_a = type.name) !== null && _a !== void 0 ? _a : "" },
|
|
309
|
+
target: NoTarget,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
id: getNamedTypeId(type),
|
|
314
|
+
name: type.name,
|
|
315
|
+
signature: getTypeSignature(type),
|
|
316
|
+
type,
|
|
317
|
+
doc: doc,
|
|
318
|
+
examples: extractExamples(type),
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
function extractUnionRefDocs(program, type) {
|
|
322
|
+
var _a;
|
|
323
|
+
const doc = extractMainDoc(program, type);
|
|
324
|
+
if (doc === undefined || doc === "") {
|
|
325
|
+
reportDiagnostic(program, {
|
|
326
|
+
code: "documentation-missing",
|
|
327
|
+
messageId: "union",
|
|
328
|
+
format: { name: (_a = type.name) !== null && _a !== void 0 ? _a : "" },
|
|
329
|
+
target: NoTarget,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
id: getNamedTypeId(type),
|
|
334
|
+
name: type.name,
|
|
335
|
+
signature: getTypeSignature(type),
|
|
336
|
+
type,
|
|
337
|
+
templateParameters: extractTemplateParameterDocs(program, type),
|
|
338
|
+
doc: doc,
|
|
339
|
+
examples: extractExamples(type),
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
function extractScalarRefDocs(program, type) {
|
|
343
|
+
var _a;
|
|
344
|
+
const doc = extractMainDoc(program, type);
|
|
345
|
+
if (doc === undefined || doc === "") {
|
|
346
|
+
reportDiagnostic(program, {
|
|
347
|
+
code: "documentation-missing",
|
|
348
|
+
messageId: "scalar",
|
|
349
|
+
format: { name: (_a = type.name) !== null && _a !== void 0 ? _a : "" },
|
|
350
|
+
target: NoTarget,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
id: getNamedTypeId(type),
|
|
355
|
+
name: type.name,
|
|
356
|
+
signature: getTypeSignature(type),
|
|
357
|
+
type,
|
|
358
|
+
doc: doc,
|
|
359
|
+
examples: extractExamples(type),
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function extractMainDoc(program, type) {
|
|
363
|
+
var _a, _b, _c;
|
|
364
|
+
let mainDoc = "";
|
|
365
|
+
for (const doc of (_b = (_a = type.node) === null || _a === void 0 ? void 0 : _a.docs) !== null && _b !== void 0 ? _b : []) {
|
|
366
|
+
for (const dContent of doc.content) {
|
|
367
|
+
mainDoc += dContent.text + "\n";
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return mainDoc !== "" ? mainDoc : (_c = getDoc(program, type)) !== null && _c !== void 0 ? _c : "";
|
|
371
|
+
}
|
|
372
|
+
function extractExamples(type) {
|
|
373
|
+
var _a, _b;
|
|
374
|
+
const examples = [];
|
|
375
|
+
for (const doc of (_b = (_a = type.node) === null || _a === void 0 ? void 0 : _a.docs) !== null && _b !== void 0 ? _b : []) {
|
|
376
|
+
for (const dTag of doc.tags) {
|
|
377
|
+
if (dTag.kind === SyntaxKind.DocUnknownTag) {
|
|
378
|
+
if (dTag.tagName.sv === "example") {
|
|
379
|
+
examples.push(extractExample(dTag));
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return examples;
|
|
385
|
+
}
|
|
386
|
+
function getNamedTypeId(type) {
|
|
387
|
+
var _a;
|
|
388
|
+
switch (type.kind) {
|
|
389
|
+
case "Decorator":
|
|
390
|
+
return getDecoratorId(type);
|
|
391
|
+
case "Operation":
|
|
392
|
+
return getQualifier((_a = type.interface) !== null && _a !== void 0 ? _a : type.namespace) + type.name;
|
|
393
|
+
default:
|
|
394
|
+
return "namespace" in type ? getQualifier(type.namespace) + type.name : type.name;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function getDecoratorId(decorator) {
|
|
398
|
+
return "@" + getQualifier(decorator.namespace) + decorator.name.slice(1);
|
|
399
|
+
}
|
|
400
|
+
function checkIfTagHasDocOnSameLine(tag) {
|
|
401
|
+
var _a, _b;
|
|
402
|
+
const start = (_a = tag.content[0]) === null || _a === void 0 ? void 0 : _a.pos;
|
|
403
|
+
const end = (_b = tag.content[0]) === null || _b === void 0 ? void 0 : _b.end;
|
|
404
|
+
const file = getSourceLocation(tag.content[0]).file;
|
|
405
|
+
let hasFirstLine = false;
|
|
406
|
+
for (let i = start; i < end; i++) {
|
|
407
|
+
const ch = file.text[i];
|
|
408
|
+
if (ch === "\n") {
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
// Todo reuse compiler whitespace logic or have a way to get this info from the parser.
|
|
412
|
+
if (ch !== " ") {
|
|
413
|
+
hasFirstLine = true;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return hasFirstLine;
|
|
417
|
+
}
|
|
418
|
+
function extractExample(tag) {
|
|
419
|
+
const content = getDocContent(tag.content);
|
|
420
|
+
const hasInfoOnFirstLine = checkIfTagHasDocOnSameLine(tag);
|
|
421
|
+
if (hasInfoOnFirstLine) {
|
|
422
|
+
const [title, ...contents] = content.split("\n");
|
|
423
|
+
return { title, content: contents.join("\n") };
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
return { content };
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
function getParmeterDocs(type) {
|
|
430
|
+
var _a, _b;
|
|
431
|
+
const map = new Map();
|
|
432
|
+
for (const d of (_b = (_a = type === null || type === void 0 ? void 0 : type.node) === null || _a === void 0 ? void 0 : _a.docs) !== null && _b !== void 0 ? _b : []) {
|
|
433
|
+
for (const tag of d.tags) {
|
|
434
|
+
if (tag.kind === SyntaxKind.DocParamTag) {
|
|
435
|
+
map.set(tag.paramName.sv, getDocContent(tag.content));
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return map;
|
|
440
|
+
}
|
|
441
|
+
function getTemplateParameterDocs(type) {
|
|
442
|
+
var _a, _b;
|
|
443
|
+
const map = new Map();
|
|
444
|
+
for (const d of (_b = (_a = type === null || type === void 0 ? void 0 : type.node) === null || _a === void 0 ? void 0 : _a.docs) !== null && _b !== void 0 ? _b : []) {
|
|
445
|
+
for (const tag of d.tags) {
|
|
446
|
+
if (tag.kind === SyntaxKind.DocTemplateTag) {
|
|
447
|
+
map.set(tag.paramName.sv, getDocContent(tag.content));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return map;
|
|
452
|
+
}
|
|
453
|
+
function getDocContent(content) {
|
|
454
|
+
const docs = [];
|
|
455
|
+
for (const node of content) {
|
|
456
|
+
compilerAssert(node.kind === SyntaxKind.DocText, "No other doc content node kinds exist yet. Update this code appropriately when more are added.");
|
|
457
|
+
docs.push(node.text);
|
|
458
|
+
}
|
|
459
|
+
return docs.join("");
|
|
460
|
+
}
|
|
461
|
+
function extractEmitterOptionsRefDoc(options) {
|
|
462
|
+
return Object.entries(options.properties).map(([name, value]) => {
|
|
463
|
+
var _a;
|
|
464
|
+
return {
|
|
465
|
+
name,
|
|
466
|
+
type: value.enum
|
|
467
|
+
? value.enum.map((x) => (typeof x === "string" ? `"${x}"` : x)).join(" | ")
|
|
468
|
+
: value.type,
|
|
469
|
+
doc: (_a = value.description) !== null && _a !== void 0 ? _a : "",
|
|
470
|
+
};
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
function extractLinterRefDoc(libName, linter) {
|
|
474
|
+
return {
|
|
475
|
+
ruleSets: linter.ruleSets && extractLinterRuleSetsRefDoc(libName, linter.ruleSets),
|
|
476
|
+
rules: linter.rules.map((rule) => extractLinterRuleRefDoc(libName, rule)),
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
function extractLinterRuleSetsRefDoc(libName, ruleSets) {
|
|
480
|
+
return Object.entries(ruleSets).map(([name, ruleSet]) => {
|
|
481
|
+
const fullName = `${libName}/${name}`;
|
|
482
|
+
return {
|
|
483
|
+
id: fullName,
|
|
484
|
+
name: fullName,
|
|
485
|
+
ruleSet,
|
|
486
|
+
};
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
function extractLinterRuleRefDoc(libName, rule) {
|
|
490
|
+
const fullName = `${libName}/${rule.name}`;
|
|
491
|
+
return {
|
|
492
|
+
id: fullName,
|
|
493
|
+
name: fullName,
|
|
494
|
+
rule,
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
//# sourceMappingURL=extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/ref-doc/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EACd,yBAAyB,EAMzB,MAAM,EACN,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EAEX,cAAc,EACd,qBAAqB,EACrB,SAAS,EAOT,eAAe,EACf,wBAAwB,EACxB,QAAQ,EAER,QAAQ,EAGR,WAAW,EAEX,UAAU,GAKX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAmB5C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAAmB;;IAEnB,MAAM,WAAW,GAAG,yBAAyB,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,CAAC;IACnD,MAAM,MAAM,GAA0B;QACpC,IAAI,EAAE,OAAO,CAAC,IAAI;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C,CAAC,CAAC;AACL,CAAC;AACD,SAAS,uBAAuB,CAC9B,OAAe,EACf,IAAoC;IAEpC,MAAM,QAAQ,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;IAC3C,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ref-doc/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ref-doc/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const libDef: {
|
|
2
|
+
readonly name: "@typespec/tspd";
|
|
3
|
+
readonly diagnostics: {
|
|
4
|
+
readonly "documentation-missing": {
|
|
5
|
+
readonly severity: "warning";
|
|
6
|
+
readonly messages: {
|
|
7
|
+
readonly decorator: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
8
|
+
readonly decoratorParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
9
|
+
readonly templateParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
10
|
+
readonly model: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
11
|
+
readonly union: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
12
|
+
readonly enum: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
13
|
+
readonly interface: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
14
|
+
readonly interfaceOperation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
15
|
+
readonly operation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
16
|
+
readonly scalar: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
22
|
+
"documentation-missing": {
|
|
23
|
+
readonly decorator: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
24
|
+
readonly decoratorParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
25
|
+
readonly templateParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
26
|
+
readonly model: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
27
|
+
readonly union: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
28
|
+
readonly enum: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
29
|
+
readonly interface: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
30
|
+
readonly interfaceOperation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
31
|
+
readonly operation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
32
|
+
readonly scalar: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
33
|
+
};
|
|
34
|
+
}, Record<string, any>, never>;
|
|
35
|
+
export declare const reportDiagnostic: <C extends "documentation-missing", M extends keyof {
|
|
36
|
+
"documentation-missing": {
|
|
37
|
+
readonly decorator: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
38
|
+
readonly decoratorParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
39
|
+
readonly templateParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
40
|
+
readonly model: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
41
|
+
readonly union: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
42
|
+
readonly enum: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
43
|
+
readonly interface: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
44
|
+
readonly interfaceOperation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
45
|
+
readonly operation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
46
|
+
readonly scalar: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
47
|
+
};
|
|
48
|
+
}[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{
|
|
49
|
+
"documentation-missing": {
|
|
50
|
+
readonly decorator: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
51
|
+
readonly decoratorParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
52
|
+
readonly templateParam: import("@typespec/compiler").CallableMessage<["name", "param"]>;
|
|
53
|
+
readonly model: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
54
|
+
readonly union: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
55
|
+
readonly enum: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
56
|
+
readonly interface: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
57
|
+
readonly interfaceOperation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
58
|
+
readonly operation: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
59
|
+
readonly scalar: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
60
|
+
};
|
|
61
|
+
}, C, M>) => void, createStateSymbol: (name: string) => symbol;
|
|
62
|
+
export type RefDocLibrary = typeof $lib;
|
|
63
|
+
//# sourceMappingURL=lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/ref-doc/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;CAmBT,CAAC;AAEX,eAAO,MAAM,IAAI;;;;;;;;;;;;;8BAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,iBAAiB,0BAAS,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,OAAO,IAAI,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
|
|
2
|
+
export const libDef = {
|
|
3
|
+
name: "@typespec/tspd",
|
|
4
|
+
diagnostics: {
|
|
5
|
+
"documentation-missing": {
|
|
6
|
+
severity: "warning",
|
|
7
|
+
messages: {
|
|
8
|
+
decorator: paramMessage `Missing documentation for decorator '${"name"}'.`,
|
|
9
|
+
decoratorParam: paramMessage `Missing documentation for decorator parameter '${"name"}.${"param"}'.`,
|
|
10
|
+
templateParam: paramMessage `Missing documentation for template parameter '${"name"}.${"param"}'.`,
|
|
11
|
+
model: paramMessage `Missing documentation for model '${"name"}'.`,
|
|
12
|
+
union: paramMessage `Missing documentation for union '${"name"}'.`,
|
|
13
|
+
enum: paramMessage `Missing documentation for enum '${"name"}'.`,
|
|
14
|
+
interface: paramMessage `Missing documentation for interface '${"name"}'.`,
|
|
15
|
+
interfaceOperation: paramMessage `Missing documentation for interface operation '${"name"}'.`,
|
|
16
|
+
operation: paramMessage `Missing documentation for operation '${"name"}'.`,
|
|
17
|
+
scalar: paramMessage `Missing documentation for scalar '${"name"}'.`,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const $lib = createTypeSpecLibrary(libDef);
|
|
23
|
+
export const { reportDiagnostic, createStateSymbol } = $lib;
|
|
24
|
+
//# sourceMappingURL=lib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/ref-doc/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;QACX,uBAAuB,EAAE;YACvB,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,SAAS,EAAE,YAAY,CAAA,wCAAwC,MAAM,IAAI;gBACzE,cAAc,EAAE,YAAY,CAAA,kDAAkD,MAAM,IAAI,OAAO,IAAI;gBACnG,aAAa,EAAE,YAAY,CAAA,iDAAiD,MAAM,IAAI,OAAO,IAAI;gBACjG,KAAK,EAAE,YAAY,CAAA,oCAAoC,MAAM,IAAI;gBACjE,KAAK,EAAE,YAAY,CAAA,oCAAoC,MAAM,IAAI;gBACjE,IAAI,EAAE,YAAY,CAAA,mCAAmC,MAAM,IAAI;gBAC/D,SAAS,EAAE,YAAY,CAAA,wCAAwC,MAAM,IAAI;gBACzE,kBAAkB,EAAE,YAAY,CAAA,kDAAkD,MAAM,IAAI;gBAC5F,SAAS,EAAE,YAAY,CAAA,wCAAwC,MAAM,IAAI;gBACzE,MAAM,EAAE,YAAY,CAAA,qCAAqC,MAAM,IAAI;aACpE;SACF;KACF;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC"}
|