@virmator/docs 14.32.1 → 14.33.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/configs/typedoc.config.ts +1 -0
- package/dist/docs.d.ts +12 -4
- package/dist/docs.js +35 -2
- package/package.json +2 -2
package/dist/docs.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { type Logger
|
|
1
|
+
import { type Logger } from '@augment-vir/common';
|
|
2
2
|
import { NpmDepType } from '@virmator/core';
|
|
3
3
|
import type * as Typedoc from 'typedoc';
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A virmator plugin for checking and generating documentation.
|
|
6
|
+
*
|
|
7
|
+
* @category Main
|
|
8
|
+
*/
|
|
5
9
|
export declare const virmatorDocsPlugin: Readonly<Readonly<{
|
|
6
10
|
name: string;
|
|
7
11
|
cliCommands: NoInfer<{
|
|
@@ -129,10 +133,14 @@ export declare const virmatorDocsPlugin: Readonly<Readonly<{
|
|
|
129
133
|
};
|
|
130
134
|
}>>;
|
|
131
135
|
}>;
|
|
132
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Runs TypeDoc with a TypeScript config file just like `@virmator/docs` does.
|
|
138
|
+
*
|
|
139
|
+
* @category Util
|
|
140
|
+
*/
|
|
133
141
|
export declare function runTypedoc({ config, packageDir, checkOnly, log, }: {
|
|
134
142
|
/** Full typedoc options object. */
|
|
135
|
-
config:
|
|
143
|
+
config: Partial<Typedoc.TypeDocOptions>;
|
|
136
144
|
/**
|
|
137
145
|
* Path to the npm package which is running typedoc. This should be a path to a directory that
|
|
138
146
|
* directly contains a `package.json` file.
|
package/dist/docs.js
CHANGED
|
@@ -6,7 +6,11 @@ import mri from 'mri';
|
|
|
6
6
|
import { basename, join } from 'node:path';
|
|
7
7
|
import { pathToFileURL } from 'node:url';
|
|
8
8
|
import { createCommandLogPrefix } from 'runstorm';
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A virmator plugin for checking and generating documentation.
|
|
11
|
+
*
|
|
12
|
+
* @category Main
|
|
13
|
+
*/
|
|
10
14
|
export const virmatorDocsPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
11
15
|
name: 'Docs',
|
|
12
16
|
cliCommands: {
|
|
@@ -165,7 +169,11 @@ export const virmatorDocsPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
165
169
|
});
|
|
166
170
|
}
|
|
167
171
|
});
|
|
168
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* Runs TypeDoc with a TypeScript config file just like `@virmator/docs` does.
|
|
174
|
+
*
|
|
175
|
+
* @category Util
|
|
176
|
+
*/
|
|
169
177
|
export async function runTypedoc({ config, packageDir, checkOnly = false, log = logImport, }) {
|
|
170
178
|
// dynamic imports are not branches
|
|
171
179
|
/* node:coverage ignore next */
|
|
@@ -191,6 +199,13 @@ async function runTypedocInternal(options, typeDoc, log) {
|
|
|
191
199
|
new typeDoc.PackageJsonReader(),
|
|
192
200
|
new typeDoc.TSConfigReader(),
|
|
193
201
|
]);
|
|
202
|
+
app.on(typeDoc.Application.EVENT_VALIDATE_PROJECT, (project) => {
|
|
203
|
+
validatePublicExportCategories({
|
|
204
|
+
app,
|
|
205
|
+
project,
|
|
206
|
+
typeDoc,
|
|
207
|
+
});
|
|
208
|
+
});
|
|
194
209
|
if (app.options.getValue('version')) {
|
|
195
210
|
log.plain(app.toString());
|
|
196
211
|
return true;
|
|
@@ -242,3 +257,21 @@ async function runTypedocInternal(options, typeDoc, log) {
|
|
|
242
257
|
}
|
|
243
258
|
return true;
|
|
244
259
|
}
|
|
260
|
+
function validatePublicExportCategories({ app, project, typeDoc, }) {
|
|
261
|
+
(project.children || [])
|
|
262
|
+
.filter((reflection) => {
|
|
263
|
+
return ![
|
|
264
|
+
reflection.comment,
|
|
265
|
+
...reflection.getNonIndexSignatures().map((signature) => {
|
|
266
|
+
return signature.comment;
|
|
267
|
+
}),
|
|
268
|
+
].some((comment) => {
|
|
269
|
+
return comment?.getTags('@category').some((tag) => {
|
|
270
|
+
return typeDoc.Comment.combineDisplayParts(tag.content).trim().length;
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
})
|
|
274
|
+
.forEach((reflection) => {
|
|
275
|
+
app.logger.validationWarning(`Export '${reflection.getFriendlyFullName()}' is missing a non-empty @category tag.`);
|
|
276
|
+
});
|
|
277
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/docs",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.33.0",
|
|
4
4
|
"description": "Default TS docs plugin for virmator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"virmator",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@augment-vir/assert": "^32.2.3",
|
|
37
37
|
"@augment-vir/common": "^32.2.3",
|
|
38
38
|
"@augment-vir/node": "^32.2.3",
|
|
39
|
-
"@virmator/core": "^14.
|
|
39
|
+
"@virmator/core": "^14.33.0",
|
|
40
40
|
"mri": "^1.2.0",
|
|
41
41
|
"runstorm": "^1.0.6"
|
|
42
42
|
},
|