@zthun/janitor-build-config 19.1.0 → 19.1.2
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/typedoc/typedoc-config-builder.d.mts +1 -1
- package/dist/typedoc.cjs +80 -107
- package/dist/typedoc.cjs.map +1 -1
- package/dist/typedoc.js +81 -104
- package/dist/typedoc.js.map +1 -1
- package/dist/vite/vite-config-builder.d.mts +9 -2
- package/dist/vite.cjs +217 -428
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js +221 -425
- package/dist/vite.js.map +1 -1
- package/package.json +3 -2
- /package/dist/typedoc/{index.d.ts → index.d.mts} +0 -0
- /package/dist/vite/{index.d.ts → index.d.mts} +0 -0
|
@@ -4,7 +4,7 @@ import { EntryPointStrategy, TypeDocOptions } from 'typedoc';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class ZTypedocConfigBuilder {
|
|
6
6
|
static readonly OutputDist = "./dist";
|
|
7
|
-
static readonly EntryPointIndex = "./src/index.
|
|
7
|
+
static readonly EntryPointIndex = "./src/index.mts";
|
|
8
8
|
private typedoc;
|
|
9
9
|
/**
|
|
10
10
|
* Sets the output directory for the documentation.
|
package/dist/typedoc.cjs
CHANGED
|
@@ -1,37 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
writable: true
|
|
14
|
-
});
|
|
15
|
-
} else {
|
|
16
|
-
obj[key] = value;
|
|
17
|
-
}
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A builder for TypeDoc configurations.
|
|
22
|
-
*/ class ZTypedocConfigBuilder {
|
|
23
|
-
/**
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const lodashEs = require("lodash-es");
|
|
4
|
+
const _ZTypedocConfigBuilder = class _ZTypedocConfigBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.typedoc = {};
|
|
7
|
+
this.dist = this.out.bind(this, _ZTypedocConfigBuilder.OutputDist);
|
|
8
|
+
this.index = this.entry.bind(this, _ZTypedocConfigBuilder.EntryPointIndex);
|
|
9
|
+
this.resolve = this.entryPointStrategy.bind(this, "resolve");
|
|
10
|
+
this.packages = this.entryPointStrategy.bind(this, "packages");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
24
13
|
* Sets the output directory for the documentation.
|
|
25
14
|
*
|
|
26
15
|
* @param path -
|
|
27
16
|
* The output directory path.
|
|
28
17
|
* @returns
|
|
29
18
|
* This object.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
*/
|
|
20
|
+
out(path) {
|
|
21
|
+
this.typedoc.out = path;
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
35
25
|
* Adds a list of entry point glob to the existing entry points.
|
|
36
26
|
*
|
|
37
27
|
* @param glob -
|
|
@@ -39,12 +29,13 @@ function _define_property(obj, key, value) {
|
|
|
39
29
|
*
|
|
40
30
|
* @returns
|
|
41
31
|
* This object.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
*/
|
|
33
|
+
entry(glob) {
|
|
34
|
+
const entry = this.typedoc.entryPoints || [];
|
|
35
|
+
this.typedoc.entryPoints = entry.concat(glob);
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
48
39
|
* Sets the entry point strategy.
|
|
49
40
|
*
|
|
50
41
|
* See {@link https://typedoc.org/api/enums/EntryPointStrategy.html | EntryPointStrategy}
|
|
@@ -55,29 +46,32 @@ function _define_property(obj, key, value) {
|
|
|
55
46
|
*
|
|
56
47
|
* @returns
|
|
57
48
|
* This object.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
*/
|
|
50
|
+
entryPointStrategy(strategy) {
|
|
51
|
+
this.typedoc.entryPointStrategy = strategy;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
63
55
|
* Sets the excludeNotDocumented flag.
|
|
64
56
|
*
|
|
65
57
|
* @returns
|
|
66
58
|
* This object.
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
*/
|
|
60
|
+
excludeNotDocumented() {
|
|
61
|
+
this.typedoc.excludeNotDocumented = true;
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
72
65
|
* Sets the categorizeByGroup flag.
|
|
73
66
|
*
|
|
74
67
|
* @returns
|
|
75
68
|
* This object.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
*/
|
|
70
|
+
categorizeByGroup() {
|
|
71
|
+
this.typedoc.categorizeByGroup = true;
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
81
75
|
* Sets the name of the project.
|
|
82
76
|
*
|
|
83
77
|
* @param name -
|
|
@@ -85,11 +79,12 @@ function _define_property(obj, key, value) {
|
|
|
85
79
|
*
|
|
86
80
|
* @returns
|
|
87
81
|
* This object.
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
*/
|
|
83
|
+
name(name) {
|
|
84
|
+
this.typedoc.name = name;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
93
88
|
* Sets the favicon for the project.
|
|
94
89
|
*
|
|
95
90
|
* @param path -
|
|
@@ -97,11 +92,12 @@ function _define_property(obj, key, value) {
|
|
|
97
92
|
*
|
|
98
93
|
* @returns
|
|
99
94
|
* This object.
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
*/
|
|
96
|
+
favicon(path) {
|
|
97
|
+
this.typedoc.favicon = path;
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
105
101
|
* Adds a single exclude glob to the existing excludes.
|
|
106
102
|
*
|
|
107
103
|
* @param glob -
|
|
@@ -109,12 +105,13 @@ function _define_property(obj, key, value) {
|
|
|
109
105
|
*
|
|
110
106
|
* @returns
|
|
111
107
|
* This object.
|
|
112
|
-
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
*/
|
|
109
|
+
exclude(glob) {
|
|
110
|
+
const excludes = this.typedoc.exclude || [];
|
|
111
|
+
this.typedoc.exclude = excludes.concat(glob);
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
118
115
|
* Sets the typedoc configuration to be used for an individual project.
|
|
119
116
|
*
|
|
120
117
|
* An individual project typedoc does not output any documentation by itself,
|
|
@@ -122,10 +119,11 @@ function _define_property(obj, key, value) {
|
|
|
122
119
|
*
|
|
123
120
|
* @returns
|
|
124
121
|
* This object.
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
*/
|
|
123
|
+
project() {
|
|
124
|
+
return this.resolve().dist();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
129
127
|
* Sets the typedoc configuration to be used a web project that outputs
|
|
130
128
|
* final documentation for a monorepo of packages.
|
|
131
129
|
*
|
|
@@ -135,47 +133,22 @@ function _define_property(obj, key, value) {
|
|
|
135
133
|
*
|
|
136
134
|
* @returns
|
|
137
135
|
* This object.
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
*/
|
|
137
|
+
web() {
|
|
138
|
+
return this.packages().excludeNotDocumented().categorizeByGroup().dist().exclude("./");
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
142
141
|
* Builds the final typedoc configuration object.
|
|
143
142
|
*
|
|
144
143
|
* @returns
|
|
145
144
|
* The final typedoc configuration object.
|
|
146
|
-
*/
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
* @returns
|
|
155
|
-
* This object.
|
|
156
|
-
*/ _define_property(this, "dist", this.out.bind(this, ZTypedocConfigBuilder.OutputDist));
|
|
157
|
-
/**
|
|
158
|
-
* Adds an entry point for './src/index.ts'.
|
|
159
|
-
*
|
|
160
|
-
* @returns
|
|
161
|
-
* This object.
|
|
162
|
-
*/ _define_property(this, "index", this.entry.bind(this, ZTypedocConfigBuilder.EntryPointIndex));
|
|
163
|
-
/**
|
|
164
|
-
* Sets the entry point strategy to "resolve".
|
|
165
|
-
*
|
|
166
|
-
* @returns
|
|
167
|
-
* This object.
|
|
168
|
-
*/ _define_property(this, "resolve", this.entryPointStrategy.bind(this, "resolve"));
|
|
169
|
-
/**
|
|
170
|
-
* Sets the entry point strategy to "packages".
|
|
171
|
-
*
|
|
172
|
-
* @returns
|
|
173
|
-
* This object.
|
|
174
|
-
*/ _define_property(this, "packages", this.entryPointStrategy.bind(this, "packages"));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
_define_property(ZTypedocConfigBuilder, "OutputDist", "./dist");
|
|
178
|
-
_define_property(ZTypedocConfigBuilder, "EntryPointIndex", "./src/index.ts");
|
|
179
|
-
|
|
145
|
+
*/
|
|
146
|
+
build() {
|
|
147
|
+
return lodashEs.cloneDeep(this.typedoc);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
_ZTypedocConfigBuilder.OutputDist = "./dist";
|
|
151
|
+
_ZTypedocConfigBuilder.EntryPointIndex = "./src/index.mts";
|
|
152
|
+
let ZTypedocConfigBuilder = _ZTypedocConfigBuilder;
|
|
180
153
|
exports.ZTypedocConfigBuilder = ZTypedocConfigBuilder;
|
|
181
154
|
//# sourceMappingURL=typedoc.cjs.map
|
package/dist/typedoc.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedoc.cjs","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.
|
|
1
|
+
{"version":3,"file":"typedoc.cjs","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.mts\";\n\n private typedoc: TypeDocOptions = {};\n\n /**\n * Sets the output directory for the documentation.\n *\n * @param path -\n * The output directory path.\n * @returns\n * This object.\n */\n public out(path: string) {\n this.typedoc.out = path;\n return this;\n }\n\n /**\n * Sets the output directory to \"./dist\".\n *\n * @returns\n * This object.\n */\n public dist = this.out.bind(this, ZTypedocConfigBuilder.OutputDist);\n\n /**\n * Adds a list of entry point glob to the existing entry points.\n *\n * @param glob -\n * The entry point glob pattern.\n *\n * @returns\n * This object.\n */\n public entry(glob: string | string) {\n const entry = this.typedoc.entryPoints || [];\n this.typedoc.entryPoints = entry.concat(glob);\n return this;\n }\n\n /**\n * Adds an entry point for './src/index.ts'.\n *\n * @returns\n * This object.\n */\n public index = this.entry.bind(this, ZTypedocConfigBuilder.EntryPointIndex);\n\n /**\n * Sets the entry point strategy.\n *\n * See {@link https://typedoc.org/api/enums/EntryPointStrategy.html | EntryPointStrategy}\n * for more details.\n *\n * @param strategy -\n * The entry point strategy to use.\n *\n * @returns\n * This object.\n */\n public entryPointStrategy(strategy: EntryPointStrategy) {\n this.typedoc.entryPointStrategy = strategy;\n return this;\n }\n\n /**\n * Sets the entry point strategy to \"resolve\".\n *\n * @returns\n * This object.\n */\n public resolve = this.entryPointStrategy.bind(this, \"resolve\");\n\n /**\n * Sets the entry point strategy to \"packages\".\n *\n * @returns\n * This object.\n */\n public packages = this.entryPointStrategy.bind(this, \"packages\");\n\n /**\n * Sets the excludeNotDocumented flag.\n *\n * @returns\n * This object.\n */\n public excludeNotDocumented() {\n this.typedoc.excludeNotDocumented = true;\n return this;\n }\n\n /**\n * Sets the categorizeByGroup flag.\n *\n * @returns\n * This object.\n */\n public categorizeByGroup() {\n this.typedoc.categorizeByGroup = true;\n return this;\n }\n\n /**\n * Sets the name of the project.\n *\n * @param name -\n * The name of the project.\n *\n * @returns\n * This object.\n */\n public name(name: string) {\n this.typedoc.name = name;\n return this;\n }\n\n /**\n * Sets the favicon for the project.\n *\n * @param path -\n * The path to the favicon file.\n *\n * @returns\n * This object.\n */\n public favicon(path: string) {\n this.typedoc.favicon = path;\n return this;\n }\n\n /**\n * Adds a single exclude glob to the existing excludes.\n *\n * @param glob -\n * The exclude glob pattern.\n *\n * @returns\n * This object.\n */\n public exclude(glob: string | string[]) {\n const excludes = this.typedoc.exclude || [];\n this.typedoc.exclude = excludes.concat(glob);\n return this;\n }\n\n /**\n * Sets the typedoc configuration to be used for an individual project.\n *\n * An individual project typedoc does not output any documentation by itself,\n * but is part of a larger project that does.\n *\n * @returns\n * This object.\n */\n public project() {\n return this.resolve().dist();\n }\n\n /**\n * Sets the typedoc configuration to be used a web project that outputs\n * final documentation for a monorepo of packages.\n *\n * Normally, your monorepo will have a single web or doc project that outputs\n * the typescript for every package in the monorepo. Use this configuration\n * for that project.\n *\n * @returns\n * This object.\n */\n public web() {\n return this.packages()\n .excludeNotDocumented()\n .categorizeByGroup()\n .dist()\n .exclude(\"./\");\n }\n\n /**\n * Builds the final typedoc configuration object.\n *\n * @returns\n * The final typedoc configuration object.\n */\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AAAA;AAAA;AAAA;AAAA,EAYF,QAAQ,MAAc;AAC3B,SAAK,QAAQ,UAAU;AAChB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,QAAQ,MAAyB;AACtC,UAAM,WAAW,KAAK,QAAQ,WAAW,CAAC;AAC1C,SAAK,QAAQ,UAAU,SAAS,OAAO,IAAI;AACpC,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,UAAU;AACR,WAAA,KAAK,QAAQ,EAAE,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EActB,MAAM;AACJ,WAAA,KAAK,SAAS,EAClB,qBAAqB,EACrB,oBACA,KAAA,EACA,QAAQ,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASV,QAAQ;AACN,WAAAA,SAAA,UAAU,KAAK,OAAO;AAAA,EAAA;AAEjC;AA5LE,uBAAuB,aAAa;AACpC,uBAAuB,kBAAkB;AAFpC,IAAM,wBAAN;;"}
|
package/dist/typedoc.js
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
|
-
import { cloneDeep } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} else {
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return obj;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* A builder for TypeDoc configurations.
|
|
18
|
-
*/ class ZTypedocConfigBuilder {
|
|
19
|
-
/**
|
|
1
|
+
import { cloneDeep } from "lodash-es";
|
|
2
|
+
const _ZTypedocConfigBuilder = class _ZTypedocConfigBuilder {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.typedoc = {};
|
|
5
|
+
this.dist = this.out.bind(this, _ZTypedocConfigBuilder.OutputDist);
|
|
6
|
+
this.index = this.entry.bind(this, _ZTypedocConfigBuilder.EntryPointIndex);
|
|
7
|
+
this.resolve = this.entryPointStrategy.bind(this, "resolve");
|
|
8
|
+
this.packages = this.entryPointStrategy.bind(this, "packages");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
20
11
|
* Sets the output directory for the documentation.
|
|
21
12
|
*
|
|
22
13
|
* @param path -
|
|
23
14
|
* The output directory path.
|
|
24
15
|
* @returns
|
|
25
16
|
* This object.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
*/
|
|
18
|
+
out(path) {
|
|
19
|
+
this.typedoc.out = path;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
31
23
|
* Adds a list of entry point glob to the existing entry points.
|
|
32
24
|
*
|
|
33
25
|
* @param glob -
|
|
@@ -35,12 +27,13 @@ function _define_property(obj, key, value) {
|
|
|
35
27
|
*
|
|
36
28
|
* @returns
|
|
37
29
|
* This object.
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
*/
|
|
31
|
+
entry(glob) {
|
|
32
|
+
const entry = this.typedoc.entryPoints || [];
|
|
33
|
+
this.typedoc.entryPoints = entry.concat(glob);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
44
37
|
* Sets the entry point strategy.
|
|
45
38
|
*
|
|
46
39
|
* See {@link https://typedoc.org/api/enums/EntryPointStrategy.html | EntryPointStrategy}
|
|
@@ -51,29 +44,32 @@ function _define_property(obj, key, value) {
|
|
|
51
44
|
*
|
|
52
45
|
* @returns
|
|
53
46
|
* This object.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
*/
|
|
48
|
+
entryPointStrategy(strategy) {
|
|
49
|
+
this.typedoc.entryPointStrategy = strategy;
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
59
53
|
* Sets the excludeNotDocumented flag.
|
|
60
54
|
*
|
|
61
55
|
* @returns
|
|
62
56
|
* This object.
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
*/
|
|
58
|
+
excludeNotDocumented() {
|
|
59
|
+
this.typedoc.excludeNotDocumented = true;
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
68
63
|
* Sets the categorizeByGroup flag.
|
|
69
64
|
*
|
|
70
65
|
* @returns
|
|
71
66
|
* This object.
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
*/
|
|
68
|
+
categorizeByGroup() {
|
|
69
|
+
this.typedoc.categorizeByGroup = true;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
77
73
|
* Sets the name of the project.
|
|
78
74
|
*
|
|
79
75
|
* @param name -
|
|
@@ -81,11 +77,12 @@ function _define_property(obj, key, value) {
|
|
|
81
77
|
*
|
|
82
78
|
* @returns
|
|
83
79
|
* This object.
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
*/
|
|
81
|
+
name(name) {
|
|
82
|
+
this.typedoc.name = name;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
89
86
|
* Sets the favicon for the project.
|
|
90
87
|
*
|
|
91
88
|
* @param path -
|
|
@@ -93,11 +90,12 @@ function _define_property(obj, key, value) {
|
|
|
93
90
|
*
|
|
94
91
|
* @returns
|
|
95
92
|
* This object.
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
*/
|
|
94
|
+
favicon(path) {
|
|
95
|
+
this.typedoc.favicon = path;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
101
99
|
* Adds a single exclude glob to the existing excludes.
|
|
102
100
|
*
|
|
103
101
|
* @param glob -
|
|
@@ -105,12 +103,13 @@ function _define_property(obj, key, value) {
|
|
|
105
103
|
*
|
|
106
104
|
* @returns
|
|
107
105
|
* This object.
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
*/
|
|
107
|
+
exclude(glob) {
|
|
108
|
+
const excludes = this.typedoc.exclude || [];
|
|
109
|
+
this.typedoc.exclude = excludes.concat(glob);
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
114
113
|
* Sets the typedoc configuration to be used for an individual project.
|
|
115
114
|
*
|
|
116
115
|
* An individual project typedoc does not output any documentation by itself,
|
|
@@ -118,10 +117,11 @@ function _define_property(obj, key, value) {
|
|
|
118
117
|
*
|
|
119
118
|
* @returns
|
|
120
119
|
* This object.
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
*/
|
|
121
|
+
project() {
|
|
122
|
+
return this.resolve().dist();
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
125
|
* Sets the typedoc configuration to be used a web project that outputs
|
|
126
126
|
* final documentation for a monorepo of packages.
|
|
127
127
|
*
|
|
@@ -131,47 +131,24 @@ function _define_property(obj, key, value) {
|
|
|
131
131
|
*
|
|
132
132
|
* @returns
|
|
133
133
|
* This object.
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
*/
|
|
135
|
+
web() {
|
|
136
|
+
return this.packages().excludeNotDocumented().categorizeByGroup().dist().exclude("./");
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
138
139
|
* Builds the final typedoc configuration object.
|
|
139
140
|
*
|
|
140
141
|
* @returns
|
|
141
142
|
* The final typedoc configuration object.
|
|
142
|
-
*/
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Adds an entry point for './src/index.ts'.
|
|
155
|
-
*
|
|
156
|
-
* @returns
|
|
157
|
-
* This object.
|
|
158
|
-
*/ _define_property(this, "index", this.entry.bind(this, ZTypedocConfigBuilder.EntryPointIndex));
|
|
159
|
-
/**
|
|
160
|
-
* Sets the entry point strategy to "resolve".
|
|
161
|
-
*
|
|
162
|
-
* @returns
|
|
163
|
-
* This object.
|
|
164
|
-
*/ _define_property(this, "resolve", this.entryPointStrategy.bind(this, "resolve"));
|
|
165
|
-
/**
|
|
166
|
-
* Sets the entry point strategy to "packages".
|
|
167
|
-
*
|
|
168
|
-
* @returns
|
|
169
|
-
* This object.
|
|
170
|
-
*/ _define_property(this, "packages", this.entryPointStrategy.bind(this, "packages"));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
_define_property(ZTypedocConfigBuilder, "OutputDist", "./dist");
|
|
174
|
-
_define_property(ZTypedocConfigBuilder, "EntryPointIndex", "./src/index.ts");
|
|
175
|
-
|
|
176
|
-
export { ZTypedocConfigBuilder };
|
|
143
|
+
*/
|
|
144
|
+
build() {
|
|
145
|
+
return cloneDeep(this.typedoc);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
_ZTypedocConfigBuilder.OutputDist = "./dist";
|
|
149
|
+
_ZTypedocConfigBuilder.EntryPointIndex = "./src/index.mts";
|
|
150
|
+
let ZTypedocConfigBuilder = _ZTypedocConfigBuilder;
|
|
151
|
+
export {
|
|
152
|
+
ZTypedocConfigBuilder
|
|
153
|
+
};
|
|
177
154
|
//# sourceMappingURL=typedoc.js.map
|
package/dist/typedoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedoc.js","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.
|
|
1
|
+
{"version":3,"file":"typedoc.js","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.mts\";\n\n private typedoc: TypeDocOptions = {};\n\n /**\n * Sets the output directory for the documentation.\n *\n * @param path -\n * The output directory path.\n * @returns\n * This object.\n */\n public out(path: string) {\n this.typedoc.out = path;\n return this;\n }\n\n /**\n * Sets the output directory to \"./dist\".\n *\n * @returns\n * This object.\n */\n public dist = this.out.bind(this, ZTypedocConfigBuilder.OutputDist);\n\n /**\n * Adds a list of entry point glob to the existing entry points.\n *\n * @param glob -\n * The entry point glob pattern.\n *\n * @returns\n * This object.\n */\n public entry(glob: string | string) {\n const entry = this.typedoc.entryPoints || [];\n this.typedoc.entryPoints = entry.concat(glob);\n return this;\n }\n\n /**\n * Adds an entry point for './src/index.ts'.\n *\n * @returns\n * This object.\n */\n public index = this.entry.bind(this, ZTypedocConfigBuilder.EntryPointIndex);\n\n /**\n * Sets the entry point strategy.\n *\n * See {@link https://typedoc.org/api/enums/EntryPointStrategy.html | EntryPointStrategy}\n * for more details.\n *\n * @param strategy -\n * The entry point strategy to use.\n *\n * @returns\n * This object.\n */\n public entryPointStrategy(strategy: EntryPointStrategy) {\n this.typedoc.entryPointStrategy = strategy;\n return this;\n }\n\n /**\n * Sets the entry point strategy to \"resolve\".\n *\n * @returns\n * This object.\n */\n public resolve = this.entryPointStrategy.bind(this, \"resolve\");\n\n /**\n * Sets the entry point strategy to \"packages\".\n *\n * @returns\n * This object.\n */\n public packages = this.entryPointStrategy.bind(this, \"packages\");\n\n /**\n * Sets the excludeNotDocumented flag.\n *\n * @returns\n * This object.\n */\n public excludeNotDocumented() {\n this.typedoc.excludeNotDocumented = true;\n return this;\n }\n\n /**\n * Sets the categorizeByGroup flag.\n *\n * @returns\n * This object.\n */\n public categorizeByGroup() {\n this.typedoc.categorizeByGroup = true;\n return this;\n }\n\n /**\n * Sets the name of the project.\n *\n * @param name -\n * The name of the project.\n *\n * @returns\n * This object.\n */\n public name(name: string) {\n this.typedoc.name = name;\n return this;\n }\n\n /**\n * Sets the favicon for the project.\n *\n * @param path -\n * The path to the favicon file.\n *\n * @returns\n * This object.\n */\n public favicon(path: string) {\n this.typedoc.favicon = path;\n return this;\n }\n\n /**\n * Adds a single exclude glob to the existing excludes.\n *\n * @param glob -\n * The exclude glob pattern.\n *\n * @returns\n * This object.\n */\n public exclude(glob: string | string[]) {\n const excludes = this.typedoc.exclude || [];\n this.typedoc.exclude = excludes.concat(glob);\n return this;\n }\n\n /**\n * Sets the typedoc configuration to be used for an individual project.\n *\n * An individual project typedoc does not output any documentation by itself,\n * but is part of a larger project that does.\n *\n * @returns\n * This object.\n */\n public project() {\n return this.resolve().dist();\n }\n\n /**\n * Sets the typedoc configuration to be used a web project that outputs\n * final documentation for a monorepo of packages.\n *\n * Normally, your monorepo will have a single web or doc project that outputs\n * the typescript for every package in the monorepo. Use this configuration\n * for that project.\n *\n * @returns\n * This object.\n */\n public web() {\n return this.packages()\n .excludeNotDocumented()\n .categorizeByGroup()\n .dist()\n .exclude(\"./\");\n }\n\n /**\n * Builds the final typedoc configuration object.\n *\n * @returns\n * The final typedoc configuration object.\n */\n public build() {\n return cloneDeep(this.typedoc);\n }\n}\n"],"names":[],"mappings":";AAMO,MAAM,yBAAN,MAAM,uBAAsB;AAAA,EAA5B,cAAA;AAIL,SAAQ,UAA0B,CAAC;AAqBnC,SA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,EAYF,QAAQ,MAAyB;AACtC,UAAM,WAAW,KAAK,QAAQ,WAAW,CAAC;AAC1C,SAAK,QAAQ,UAAU,SAAS,OAAO,IAAI;AACpC,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,UAAU;AACR,WAAA,KAAK,QAAQ,EAAE,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EActB,MAAM;AACJ,WAAA,KAAK,SAAS,EAClB,qBAAqB,EACrB,oBACA,KAAA,EACA,QAAQ,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASV,QAAQ;AACN,WAAA,UAAU,KAAK,OAAO;AAAA,EAAA;AAEjC;AA5LE,uBAAuB,aAAa;AACpC,uBAAuB,kBAAkB;AAFpC,IAAM,wBAAN;"}
|
|
@@ -66,6 +66,13 @@ export declare class ZViteConfigBuilder {
|
|
|
66
66
|
* This object.
|
|
67
67
|
*/
|
|
68
68
|
plugin(option?: PluginOption | PluginOption[]): this;
|
|
69
|
+
/**
|
|
70
|
+
* Adds the swc plugin.
|
|
71
|
+
*
|
|
72
|
+
* This is mostly for nest projects as nest requires
|
|
73
|
+
* swc to support decorators.
|
|
74
|
+
*/
|
|
75
|
+
swc(): this;
|
|
69
76
|
/**
|
|
70
77
|
* Sets whether to generate source maps.
|
|
71
78
|
*
|
|
@@ -133,12 +140,12 @@ export declare class ZViteConfigBuilder {
|
|
|
133
140
|
*/
|
|
134
141
|
web(): this;
|
|
135
142
|
/**
|
|
136
|
-
*
|
|
143
|
+
* Constructs the config to compile a react application.
|
|
137
144
|
*
|
|
138
145
|
* @returns
|
|
139
146
|
* This object.
|
|
140
147
|
*/
|
|
141
|
-
react
|
|
148
|
+
react(): this;
|
|
142
149
|
/**
|
|
143
150
|
* Constructs the config to be for testing.
|
|
144
151
|
*
|