@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.
@@ -1 +1,29 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
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,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@storm-software/config-tools/types`),n=require(`@stryke/fs/exists`),r=require(`@stryke/fs/helpers`),i=require(`@stryke/path/join`),a=require(`defu`);a=e.__toESM(a);let o=require(`typedoc`);function s(e={}){return{name:`typedoc`,async config(){return this.log(t.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `typedoc` build plugin."),{docs:{typedoc:(0,a.default)(e,{outputPath:(0,i.joinPaths)(this.config.projectRoot,`docs`,`generated`,`api-reference`),baseUrl:`/docs/`,excludeExternals:!0,excludeInternal:!0,excludePrivate:!0,excludeProtected:!0,hideGenerator:!0,githubPages:!1,readme:`none`,gitRevision:this.workspaceConfig.branch||`main`,tsconfig:this.tsconfig.tsconfigFilePath,plugin:e.plugin?[]:[`typedoc-plugin-markdown`]})}}},async configResolved(){this.typedoc=await o.Application.bootstrapWithPlugins({...this.config.docs.typedoc,exclude:this.config.docs.typedoc.exclude??this.tsconfig.tsconfigJson.exclude?.filter(Boolean)??[],out:this.config.output.outputPath,entryPoints:this.entry.map(e=>(0,i.joinPaths)(this.config.projectRoot,e.file)),...this.config.docs.typedoc.override},[new o.TypeDocReader,new o.PackageJsonReader,new o.TSConfigReader])},async docs(){this.log(t.LogLevelLabel.TRACE,`Generating documentation for the Powerlines application with TypeDoc.`),(0,n.existsSync)(this.config.docs.typedoc.outputPath)&&await(0,r.removeDirectory)(this.config.docs.typedoc.outputPath),await(0,r.createDirectory)(this.config.docs.typedoc.outputPath);let e=await this.typedoc.convert();e&&await this.typedoc.generateDocs(e,this.config.docs.typedoc.outputPath)}}}var c=s;exports.default=c,exports.plugin=s;
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 as e}from"@storm-software/config-tools/types";import{existsSync as t}from"@stryke/fs/exists";import{createDirectory as n,removeDirectory as r}from"@stryke/fs/helpers";import{joinPaths as i}from"@stryke/path/join";import a from"defu";import{Application as o,PackageJsonReader as s,TSConfigReader as c,TypeDocReader as l}from"typedoc";function u(u={}){return{name:`typedoc`,async config(){return this.log(e.TRACE,"Providing default configuration for the Powerlines `typedoc` build plugin."),{docs:{typedoc:a(u,{outputPath:i(this.config.projectRoot,`docs`,`generated`,`api-reference`),baseUrl:`/docs/`,excludeExternals:!0,excludeInternal:!0,excludePrivate:!0,excludeProtected:!0,hideGenerator:!0,githubPages:!1,readme:`none`,gitRevision:this.workspaceConfig.branch||`main`,tsconfig:this.tsconfig.tsconfigFilePath,plugin:u.plugin?[]:[`typedoc-plugin-markdown`]})}}},async configResolved(){this.typedoc=await o.bootstrapWithPlugins({...this.config.docs.typedoc,exclude:this.config.docs.typedoc.exclude??this.tsconfig.tsconfigJson.exclude?.filter(Boolean)??[],out:this.config.output.outputPath,entryPoints:this.entry.map(e=>i(this.config.projectRoot,e.file)),...this.config.docs.typedoc.override},[new l,new s,new c])},async docs(){this.log(e.TRACE,`Generating documentation for the Powerlines application with TypeDoc.`),t(this.config.docs.typedoc.outputPath)&&await r(this.config.docs.typedoc.outputPath),await n(this.config.docs.typedoc.outputPath);let i=await this.typedoc.convert();i&&await this.typedoc.generateDocs(i,this.config.docs.typedoc.outputPath)}}}var d=u;export{d as default,u as plugin};
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 = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
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?: WriteOptions) => Promise<void>;
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?: WriteOptions) => void;
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 = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
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?: WriteOptions) => Promise<void>;
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?: WriteOptions) => void;
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
  *
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -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.125",
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.26",
105
- "@stryke/path": "^0.24.0",
106
- "powerlines": "^0.36.22",
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.48",
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": "f88fe8eb30f96536b83fc9af884972d48e31e63a"
117
+ "gitHead": "be47e546b48b9a82e460b5c5d4f02fb66e821f18"
118
118
  }