@virmator/docs 14.32.1 → 14.34.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.
@@ -16,6 +16,7 @@ export const typeDocConfig: Partial<TypeDocOptions> = {
16
16
  defaultCategory: 'MISSING CATEGORY',
17
17
  categoryOrder: [
18
18
  'Main',
19
+ 'Util',
19
20
  'Internal',
20
21
  ],
21
22
  };
package/dist/docs.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- import { type Logger, type PartialDeep } from '@augment-vir/common';
1
+ import { type Logger } from '@augment-vir/common';
2
2
  import { NpmDepType } from '@virmator/core';
3
3
  import type * as Typedoc from 'typedoc';
4
- /** A virmator plugin for checking and generating documentation. */
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
- /** Runs TypeDoc with a TypeScript config file just like `@virmator/docs` does. */
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: PartialDeep<Typedoc.TypeDocOptionMap>;
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
- /** A virmator plugin for checking and generating documentation. */
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
- /** Runs TypeDoc with a TypeScript config file just like `@virmator/docs` does. */
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.32.1",
3
+ "version": "14.34.0",
4
4
  "description": "Default TS docs plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -33,16 +33,16 @@
33
33
  "test:update": "npm test update"
34
34
  },
35
35
  "dependencies": {
36
- "@augment-vir/assert": "^32.2.3",
37
- "@augment-vir/common": "^32.2.3",
38
- "@augment-vir/node": "^32.2.3",
39
- "@virmator/core": "^14.32.1",
36
+ "@augment-vir/assert": "^32.2.4",
37
+ "@augment-vir/common": "^32.2.4",
38
+ "@augment-vir/node": "^32.2.4",
39
+ "@virmator/core": "^14.34.0",
40
40
  "mri": "^1.2.0",
41
41
  "runstorm": "^1.0.6"
42
42
  },
43
43
  "devDependencies": {
44
- "@augment-vir/test": "^32.2.3",
45
- "@types/node": "^26.2.0",
44
+ "@augment-vir/test": "^32.2.4",
45
+ "@types/node": "^26.4.0",
46
46
  "c8": "^12.0.0",
47
47
  "esbuild": "^0.28.2",
48
48
  "istanbul-smart-text-reporter": "^1.1.5",