@powerlines/plugin-typedoc 0.10.125 → 0.10.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/_virtual/rolldown_runtime.cjs +29 -1
- package/dist/index.cjs +61 -1
- package/dist/index.mjs +57 -1
- package/dist/powerlines/src/types/context.d.cts +27 -3
- package/dist/powerlines/src/types/context.d.mts +27 -3
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +6 -6
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1,61 @@
|
|
|
1
|
-
Object.defineProperty(exports
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
4
|
+
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
5
|
+
let __stryke_fs_helpers = require("@stryke/fs/helpers");
|
|
6
|
+
let __stryke_path_join = require("@stryke/path/join");
|
|
7
|
+
let defu = require("defu");
|
|
8
|
+
defu = require_rolldown_runtime.__toESM(defu);
|
|
9
|
+
let typedoc = require("typedoc");
|
|
10
|
+
|
|
11
|
+
//#region src/index.ts
|
|
12
|
+
/**
|
|
13
|
+
* A Powerlines plugin to assist in generating documentation with TypeDoc.
|
|
14
|
+
*/
|
|
15
|
+
function plugin(options = {}) {
|
|
16
|
+
return {
|
|
17
|
+
name: "typedoc",
|
|
18
|
+
async config() {
|
|
19
|
+
this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `typedoc` build plugin.");
|
|
20
|
+
return { docs: { typedoc: (0, defu.default)(options, {
|
|
21
|
+
outputPath: (0, __stryke_path_join.joinPaths)(this.config.projectRoot, "docs", "generated", "api-reference"),
|
|
22
|
+
baseUrl: "/docs/",
|
|
23
|
+
excludeExternals: true,
|
|
24
|
+
excludeInternal: true,
|
|
25
|
+
excludePrivate: true,
|
|
26
|
+
excludeProtected: true,
|
|
27
|
+
hideGenerator: true,
|
|
28
|
+
githubPages: false,
|
|
29
|
+
readme: "none",
|
|
30
|
+
gitRevision: this.workspaceConfig.branch || "main",
|
|
31
|
+
tsconfig: this.tsconfig.tsconfigFilePath,
|
|
32
|
+
plugin: options.plugin ? [] : ["typedoc-plugin-markdown"]
|
|
33
|
+
}) } };
|
|
34
|
+
},
|
|
35
|
+
async configResolved() {
|
|
36
|
+
this.typedoc = await typedoc.Application.bootstrapWithPlugins({
|
|
37
|
+
...this.config.docs.typedoc,
|
|
38
|
+
exclude: this.config.docs.typedoc.exclude ?? this.tsconfig.tsconfigJson.exclude?.filter(Boolean) ?? [],
|
|
39
|
+
out: this.config.output.outputPath,
|
|
40
|
+
entryPoints: this.entry.map((entry) => (0, __stryke_path_join.joinPaths)(this.config.projectRoot, entry.file)),
|
|
41
|
+
...this.config.docs.typedoc.override
|
|
42
|
+
}, [
|
|
43
|
+
new typedoc.TypeDocReader(),
|
|
44
|
+
new typedoc.PackageJsonReader(),
|
|
45
|
+
new typedoc.TSConfigReader()
|
|
46
|
+
]);
|
|
47
|
+
},
|
|
48
|
+
async docs() {
|
|
49
|
+
this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Generating documentation for the Powerlines application with TypeDoc.`);
|
|
50
|
+
if ((0, __stryke_fs_exists.existsSync)(this.config.docs.typedoc.outputPath)) await (0, __stryke_fs_helpers.removeDirectory)(this.config.docs.typedoc.outputPath);
|
|
51
|
+
await (0, __stryke_fs_helpers.createDirectory)(this.config.docs.typedoc.outputPath);
|
|
52
|
+
const project = await this.typedoc.convert();
|
|
53
|
+
if (project) await this.typedoc.generateDocs(project, this.config.docs.typedoc.outputPath);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
var src_default = plugin;
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
exports.default = src_default;
|
|
61
|
+
exports.plugin = plugin;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,57 @@
|
|
|
1
|
-
import{LogLevelLabel
|
|
1
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
2
|
+
import { existsSync } from "@stryke/fs/exists";
|
|
3
|
+
import { createDirectory, removeDirectory } from "@stryke/fs/helpers";
|
|
4
|
+
import { joinPaths } from "@stryke/path/join";
|
|
5
|
+
import defu from "defu";
|
|
6
|
+
import { Application, PackageJsonReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
7
|
+
|
|
8
|
+
//#region src/index.ts
|
|
9
|
+
/**
|
|
10
|
+
* A Powerlines plugin to assist in generating documentation with TypeDoc.
|
|
11
|
+
*/
|
|
12
|
+
function plugin(options = {}) {
|
|
13
|
+
return {
|
|
14
|
+
name: "typedoc",
|
|
15
|
+
async config() {
|
|
16
|
+
this.log(LogLevelLabel.TRACE, "Providing default configuration for the Powerlines `typedoc` build plugin.");
|
|
17
|
+
return { docs: { typedoc: defu(options, {
|
|
18
|
+
outputPath: joinPaths(this.config.projectRoot, "docs", "generated", "api-reference"),
|
|
19
|
+
baseUrl: "/docs/",
|
|
20
|
+
excludeExternals: true,
|
|
21
|
+
excludeInternal: true,
|
|
22
|
+
excludePrivate: true,
|
|
23
|
+
excludeProtected: true,
|
|
24
|
+
hideGenerator: true,
|
|
25
|
+
githubPages: false,
|
|
26
|
+
readme: "none",
|
|
27
|
+
gitRevision: this.workspaceConfig.branch || "main",
|
|
28
|
+
tsconfig: this.tsconfig.tsconfigFilePath,
|
|
29
|
+
plugin: options.plugin ? [] : ["typedoc-plugin-markdown"]
|
|
30
|
+
}) } };
|
|
31
|
+
},
|
|
32
|
+
async configResolved() {
|
|
33
|
+
this.typedoc = await Application.bootstrapWithPlugins({
|
|
34
|
+
...this.config.docs.typedoc,
|
|
35
|
+
exclude: this.config.docs.typedoc.exclude ?? this.tsconfig.tsconfigJson.exclude?.filter(Boolean) ?? [],
|
|
36
|
+
out: this.config.output.outputPath,
|
|
37
|
+
entryPoints: this.entry.map((entry) => joinPaths(this.config.projectRoot, entry.file)),
|
|
38
|
+
...this.config.docs.typedoc.override
|
|
39
|
+
}, [
|
|
40
|
+
new TypeDocReader(),
|
|
41
|
+
new PackageJsonReader(),
|
|
42
|
+
new TSConfigReader()
|
|
43
|
+
]);
|
|
44
|
+
},
|
|
45
|
+
async docs() {
|
|
46
|
+
this.log(LogLevelLabel.TRACE, `Generating documentation for the Powerlines application with TypeDoc.`);
|
|
47
|
+
if (existsSync(this.config.docs.typedoc.outputPath)) await removeDirectory(this.config.docs.typedoc.outputPath);
|
|
48
|
+
await createDirectory(this.config.docs.typedoc.outputPath);
|
|
49
|
+
const project = await this.typedoc.convert();
|
|
50
|
+
if (project) await this.typedoc.generateDocs(project, this.config.docs.typedoc.outputPath);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
var src_default = plugin;
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { src_default as default, plugin };
|
|
@@ -78,10 +78,18 @@ interface ParseOptions extends ParserOptions {
|
|
|
78
78
|
*/
|
|
79
79
|
allowReturnOutsideFunction?: boolean;
|
|
80
80
|
}
|
|
81
|
+
interface EmitOptions extends WriteOptions {
|
|
82
|
+
/**
|
|
83
|
+
* If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
|
|
84
|
+
*/
|
|
85
|
+
emitWithBundler?: boolean;
|
|
86
|
+
needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
|
|
87
|
+
originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
|
|
88
|
+
}
|
|
81
89
|
/**
|
|
82
90
|
* Options for emitting entry virtual files
|
|
83
91
|
*/
|
|
84
|
-
type EmitEntryOptions =
|
|
92
|
+
type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
|
|
85
93
|
/**
|
|
86
94
|
* The unresolved Powerlines context.
|
|
87
95
|
*
|
|
@@ -292,6 +300,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
292
300
|
* The Powerlines builtin virtual files
|
|
293
301
|
*/
|
|
294
302
|
getBuiltins: () => Promise<VirtualFile[]>;
|
|
303
|
+
/**
|
|
304
|
+
* Resolves a file and writes it to the VFS if it does not already exist
|
|
305
|
+
*
|
|
306
|
+
* @param code - The source code of the file
|
|
307
|
+
* @param path - The path to write the file to
|
|
308
|
+
* @param options - Additional options for writing the file
|
|
309
|
+
*/
|
|
310
|
+
emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
|
|
311
|
+
/**
|
|
312
|
+
* Synchronously resolves a file and writes it to the VFS if it does not already exist
|
|
313
|
+
*
|
|
314
|
+
* @param code - The source code of the file
|
|
315
|
+
* @param path - The path to write the file to
|
|
316
|
+
* @param options - Additional options for writing the file
|
|
317
|
+
*/
|
|
318
|
+
emitSync: (code: string, path: string, options?: EmitOptions) => void;
|
|
295
319
|
/**
|
|
296
320
|
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
297
321
|
*
|
|
@@ -300,7 +324,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
300
324
|
* @param path - An optional path to write the builtin file to
|
|
301
325
|
* @param options - Additional options for writing the builtin file
|
|
302
326
|
*/
|
|
303
|
-
emitBuiltin: (code: string, id: string, path?: string, options?:
|
|
327
|
+
emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
|
|
304
328
|
/**
|
|
305
329
|
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
306
330
|
*
|
|
@@ -309,7 +333,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
309
333
|
* @param path - An optional path to write the builtin file to
|
|
310
334
|
* @param options - Additional options for writing the builtin file
|
|
311
335
|
*/
|
|
312
|
-
emitBuiltinSync: (code: string, id: string, path?: string, options?:
|
|
336
|
+
emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
|
|
313
337
|
/**
|
|
314
338
|
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
315
339
|
*
|
|
@@ -80,10 +80,18 @@ interface ParseOptions extends ParserOptions {
|
|
|
80
80
|
*/
|
|
81
81
|
allowReturnOutsideFunction?: boolean;
|
|
82
82
|
}
|
|
83
|
+
interface EmitOptions extends WriteOptions {
|
|
84
|
+
/**
|
|
85
|
+
* If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
|
|
86
|
+
*/
|
|
87
|
+
emitWithBundler?: boolean;
|
|
88
|
+
needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
|
|
89
|
+
originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
|
|
90
|
+
}
|
|
83
91
|
/**
|
|
84
92
|
* Options for emitting entry virtual files
|
|
85
93
|
*/
|
|
86
|
-
type EmitEntryOptions =
|
|
94
|
+
type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
|
|
87
95
|
/**
|
|
88
96
|
* The unresolved Powerlines context.
|
|
89
97
|
*
|
|
@@ -294,6 +302,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
294
302
|
* The Powerlines builtin virtual files
|
|
295
303
|
*/
|
|
296
304
|
getBuiltins: () => Promise<VirtualFile[]>;
|
|
305
|
+
/**
|
|
306
|
+
* Resolves a file and writes it to the VFS if it does not already exist
|
|
307
|
+
*
|
|
308
|
+
* @param code - The source code of the file
|
|
309
|
+
* @param path - The path to write the file to
|
|
310
|
+
* @param options - Additional options for writing the file
|
|
311
|
+
*/
|
|
312
|
+
emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
|
|
313
|
+
/**
|
|
314
|
+
* Synchronously resolves a file and writes it to the VFS if it does not already exist
|
|
315
|
+
*
|
|
316
|
+
* @param code - The source code of the file
|
|
317
|
+
* @param path - The path to write the file to
|
|
318
|
+
* @param options - Additional options for writing the file
|
|
319
|
+
*/
|
|
320
|
+
emitSync: (code: string, path: string, options?: EmitOptions) => void;
|
|
297
321
|
/**
|
|
298
322
|
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
299
323
|
*
|
|
@@ -302,7 +326,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
302
326
|
* @param path - An optional path to write the builtin file to
|
|
303
327
|
* @param options - Additional options for writing the builtin file
|
|
304
328
|
*/
|
|
305
|
-
emitBuiltin: (code: string, id: string, path?: string, options?:
|
|
329
|
+
emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
|
|
306
330
|
/**
|
|
307
331
|
* Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
308
332
|
*
|
|
@@ -311,7 +335,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
311
335
|
* @param path - An optional path to write the builtin file to
|
|
312
336
|
* @param options - Additional options for writing the builtin file
|
|
313
337
|
*/
|
|
314
|
-
emitBuiltinSync: (code: string, id: string, path?: string, options?:
|
|
338
|
+
emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
|
|
315
339
|
/**
|
|
316
340
|
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
317
341
|
*
|
package/dist/types/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-typedoc",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.126",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running TypeDoc on the codebase.",
|
|
6
6
|
"repository": {
|
|
@@ -101,18 +101,18 @@
|
|
|
101
101
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@storm-software/config-tools": "^1.188.74",
|
|
104
|
-
"@stryke/fs": "^0.33.
|
|
105
|
-
"@stryke/path": "^0.24.
|
|
106
|
-
"powerlines": "^0.36.
|
|
104
|
+
"@stryke/fs": "^0.33.27",
|
|
105
|
+
"@stryke/path": "^0.24.1",
|
|
106
|
+
"powerlines": "^0.36.23",
|
|
107
107
|
"typedoc": "0.25.12",
|
|
108
108
|
"typedoc-plugin-markdown": "4.0.0-next.20"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@powerlines/nx": "^0.11.
|
|
111
|
+
"@powerlines/nx": "^0.11.49",
|
|
112
112
|
"@storm-software/tsup": "^0.2.72",
|
|
113
113
|
"@types/node": "^24.10.4",
|
|
114
114
|
"tsup": "8.4.0"
|
|
115
115
|
},
|
|
116
116
|
"publishConfig": { "access": "public" },
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "be47e546b48b9a82e460b5c5d4f02fb66e821f18"
|
|
118
118
|
}
|