@kubb/core 2.18.3 → 2.18.4
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/{chunk-J7SXH3YG.js → chunk-6NMPKKGV.js} +2 -2
- package/dist/{chunk-J7SXH3YG.js.map → chunk-6NMPKKGV.js.map} +1 -1
- package/dist/{chunk-KSXPJNIA.cjs → chunk-7PBKI3OR.cjs} +293 -293
- package/dist/chunk-7PBKI3OR.cjs.map +1 -0
- package/dist/{chunk-U2XQEWRF.cjs → chunk-AQJCCWPW.cjs} +7 -7
- package/dist/{chunk-CURDPCUG.cjs → chunk-GG3XRJX3.cjs} +23 -16
- package/dist/chunk-GG3XRJX3.cjs.map +1 -0
- package/dist/{chunk-WNT5FJKX.cjs → chunk-GRBLCGB5.cjs} +5 -5
- package/dist/{chunk-I6K57NKM.cjs → chunk-NP7GXHZS.cjs} +18 -18
- package/dist/{chunk-JLT7YQF5.js → chunk-TIYJPVUG.js} +9 -2
- package/dist/chunk-TIYJPVUG.js.map +1 -0
- package/dist/{chunk-RPDYCQHF.cjs → chunk-X5IJHUXJ.cjs} +90 -90
- package/dist/{chunk-SJLROYQM.cjs → chunk-XUCU53HT.cjs} +3 -3
- package/dist/{chunk-SJLROYQM.cjs.map → chunk-XUCU53HT.cjs.map} +1 -1
- package/dist/{chunk-LSRMKE3Q.cjs → chunk-YTLMG2AN.cjs} +29 -29
- package/dist/fs.cjs +5 -5
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +29 -28
- package/dist/index.d.ts +29 -28
- package/dist/index.js +2 -2
- package/dist/{logger-Cskfrvra.d.cts → logger-DChjnJMn.d.cts} +10 -2
- package/dist/{logger-Cskfrvra.d.ts → logger-DChjnJMn.d.ts} +10 -2
- package/dist/logger.cjs +6 -4
- package/dist/logger.d.cts +2 -1
- package/dist/logger.d.ts +2 -1
- package/dist/logger.js +3 -1
- package/dist/mocks.cjs +12 -12
- package/dist/mocks.d.cts +2 -1
- package/dist/mocks.d.ts +2 -1
- package/dist/mocks.js +2 -2
- package/dist/transformers.cjs +4 -4
- package/dist/utils.cjs +4 -4
- package/package.json +8 -7
- package/src/config.ts +29 -2
- package/src/logger.ts +11 -2
- package/src/types.ts +1 -28
- package/dist/chunk-CURDPCUG.cjs.map +0 -1
- package/dist/chunk-JLT7YQF5.js.map +0 -1
- package/dist/chunk-KSXPJNIA.cjs.map +0 -1
- /package/dist/{chunk-U2XQEWRF.cjs.map → chunk-AQJCCWPW.cjs.map} +0 -0
- /package/dist/{chunk-WNT5FJKX.cjs.map → chunk-GRBLCGB5.cjs.map} +0 -0
- /package/dist/{chunk-I6K57NKM.cjs.map → chunk-NP7GXHZS.cjs.map} +0 -0
- /package/dist/{chunk-RPDYCQHF.cjs.map → chunk-X5IJHUXJ.cjs.map} +0 -0
- /package/dist/{chunk-LSRMKE3Q.cjs.map → chunk-YTLMG2AN.cjs.map} +0 -0
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkGRBLCGB5cjs = require('./chunk-GRBLCGB5.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkXUCU53HTcjs = require('./chunk-XUCU53HT.cjs');
|
|
11
11
|
|
|
12
12
|
// src/utils/index.ts
|
|
13
|
-
|
|
13
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
14
14
|
|
|
15
15
|
// src/utils/FunctionParams.ts
|
|
16
|
-
|
|
16
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
17
17
|
var _items, _orderItems, orderItems_fn, _addParams, addParams_fn;
|
|
18
18
|
var _FunctionParams = class _FunctionParams {
|
|
19
19
|
constructor() {
|
|
20
|
-
|
|
20
|
+
_chunkXUCU53HTcjs.__privateAdd.call(void 0, this, _items, []);
|
|
21
21
|
return this;
|
|
22
22
|
}
|
|
23
23
|
get items() {
|
|
24
|
-
return
|
|
24
|
+
return _chunkXUCU53HTcjs.__privateGet.call(void 0, this, _items).flat();
|
|
25
25
|
}
|
|
26
26
|
add(item) {
|
|
27
27
|
if (!item) {
|
|
28
28
|
return this;
|
|
29
29
|
}
|
|
30
30
|
if (Array.isArray(item)) {
|
|
31
|
-
item.filter(Boolean).forEach((it) =>
|
|
31
|
+
item.filter(Boolean).forEach((it) => _chunkXUCU53HTcjs.__privateGet.call(void 0, this, _items).push(it));
|
|
32
32
|
return this;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
_chunkXUCU53HTcjs.__privateGet.call(void 0, this, _items).push(item);
|
|
35
35
|
return this;
|
|
36
36
|
}
|
|
37
37
|
static toObject(items) {
|
|
@@ -41,9 +41,9 @@ var _FunctionParams = class _FunctionParams {
|
|
|
41
41
|
const required = _nullishCoalesce(items.every((item) => item.required), () => ( true));
|
|
42
42
|
items.forEach((item) => {
|
|
43
43
|
var _a, _b;
|
|
44
|
-
name =
|
|
44
|
+
name = _chunkXUCU53HTcjs.__privateMethod.call(void 0, _a = _FunctionParams, _addParams, addParams_fn).call(_a, name, { ...item, type: void 0 });
|
|
45
45
|
if (items.some((item2) => item2.type)) {
|
|
46
|
-
type =
|
|
46
|
+
type = _chunkXUCU53HTcjs.__privateMethod.call(void 0, _b = _FunctionParams, _addParams, addParams_fn).call(_b, type, item);
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
return {
|
|
@@ -55,35 +55,35 @@ var _FunctionParams = class _FunctionParams {
|
|
|
55
55
|
}
|
|
56
56
|
static toString(items) {
|
|
57
57
|
var _a;
|
|
58
|
-
const sortedData =
|
|
58
|
+
const sortedData = _chunkXUCU53HTcjs.__privateMethod.call(void 0, _a = _FunctionParams, _orderItems, orderItems_fn).call(_a, items);
|
|
59
59
|
return sortedData.reduce((acc, item) => {
|
|
60
60
|
var _a2, _b, _c;
|
|
61
61
|
if (Array.isArray(item)) {
|
|
62
62
|
if (item.length <= 0) {
|
|
63
63
|
return acc;
|
|
64
64
|
}
|
|
65
|
-
const subItems =
|
|
65
|
+
const subItems = _chunkXUCU53HTcjs.__privateMethod.call(void 0, _a2 = _FunctionParams, _orderItems, orderItems_fn).call(_a2, item);
|
|
66
66
|
const objectItem = _FunctionParams.toObject(subItems);
|
|
67
|
-
return
|
|
67
|
+
return _chunkXUCU53HTcjs.__privateMethod.call(void 0, _b = _FunctionParams, _addParams, addParams_fn).call(_b, acc, objectItem);
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return _chunkXUCU53HTcjs.__privateMethod.call(void 0, _c = _FunctionParams, _addParams, addParams_fn).call(_c, acc, item);
|
|
70
70
|
}, []).join(", ");
|
|
71
71
|
}
|
|
72
72
|
toObject() {
|
|
73
73
|
var _a;
|
|
74
|
-
const items =
|
|
74
|
+
const items = _chunkXUCU53HTcjs.__privateMethod.call(void 0, _a = _FunctionParams, _orderItems, orderItems_fn).call(_a, _chunkXUCU53HTcjs.__privateGet.call(void 0, this, _items)).flat();
|
|
75
75
|
return _FunctionParams.toObject(items);
|
|
76
76
|
}
|
|
77
77
|
toString() {
|
|
78
78
|
var _a;
|
|
79
|
-
const items =
|
|
79
|
+
const items = _chunkXUCU53HTcjs.__privateMethod.call(void 0, _a = _FunctionParams, _orderItems, orderItems_fn).call(_a, _chunkXUCU53HTcjs.__privateGet.call(void 0, this, _items));
|
|
80
80
|
return _FunctionParams.toString(items);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
_items = new WeakMap();
|
|
84
84
|
_orderItems = new WeakSet();
|
|
85
85
|
orderItems_fn = function(items) {
|
|
86
|
-
return
|
|
86
|
+
return _chunkGRBLCGB5cjs.orderBy.call(void 0,
|
|
87
87
|
items.filter(Boolean),
|
|
88
88
|
[
|
|
89
89
|
(v) => {
|
|
@@ -112,7 +112,7 @@ addParams_fn = function(acc, item) {
|
|
|
112
112
|
acc.push(`${type}${rest.default ? ` = ${rest.default}` : ""}`);
|
|
113
113
|
return acc;
|
|
114
114
|
}
|
|
115
|
-
const parameterName = name.startsWith("{") ? name :
|
|
115
|
+
const parameterName = name.startsWith("{") ? name : _chunkGRBLCGB5cjs.camelCase.call(void 0, name);
|
|
116
116
|
if (type) {
|
|
117
117
|
if (required) {
|
|
118
118
|
acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ""}`);
|
|
@@ -124,12 +124,12 @@ addParams_fn = function(acc, item) {
|
|
|
124
124
|
}
|
|
125
125
|
return acc;
|
|
126
126
|
};
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
_chunkXUCU53HTcjs.__privateAdd.call(void 0, _FunctionParams, _orderItems);
|
|
128
|
+
_chunkXUCU53HTcjs.__privateAdd.call(void 0, _FunctionParams, _addParams);
|
|
129
129
|
var FunctionParams = _FunctionParams;
|
|
130
130
|
|
|
131
131
|
// src/utils/promise.ts
|
|
132
|
-
|
|
132
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
133
133
|
function isPromise(result) {
|
|
134
134
|
return !!result && typeof _optionalChain([result, 'optionalAccess', _4 => _4.then]) === "function";
|
|
135
135
|
}
|
|
@@ -141,7 +141,7 @@ function isPromiseRejectedResult(result) {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
// src/utils/renderTemplate.ts
|
|
144
|
-
|
|
144
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
145
145
|
function renderTemplate(template, data = void 0) {
|
|
146
146
|
if (!data || !Object.keys(data).length) {
|
|
147
147
|
return template.replace(/{{(.*?)}}/g, "");
|
|
@@ -166,7 +166,7 @@ function renderTemplate(template, data = void 0) {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// src/utils/timeout.ts
|
|
169
|
-
|
|
169
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
170
170
|
async function timeout(ms) {
|
|
171
171
|
return new Promise((resolve) => {
|
|
172
172
|
setTimeout(() => {
|
|
@@ -176,7 +176,7 @@ async function timeout(ms) {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
// src/utils/uniqueName.ts
|
|
179
|
-
|
|
179
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
180
180
|
function getUniqueName(originalName, data) {
|
|
181
181
|
let used = data[originalName] || 0;
|
|
182
182
|
if (used) {
|
|
@@ -197,7 +197,7 @@ function setUniqueName(originalName, data) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// src/utils/URLPath.ts
|
|
200
|
-
|
|
200
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
201
201
|
var URLPath = class {
|
|
202
202
|
constructor(path) {
|
|
203
203
|
this.path = path;
|
|
@@ -264,7 +264,7 @@ var URLPath = class {
|
|
|
264
264
|
let newPath = this.path.replaceAll("{", "${");
|
|
265
265
|
if (found) {
|
|
266
266
|
newPath = found.reduce((prev, curr) => {
|
|
267
|
-
const pathParam = replacer ? replacer(
|
|
267
|
+
const pathParam = replacer ? replacer(_chunkGRBLCGB5cjs.camelCase.call(void 0, curr)) : _chunkGRBLCGB5cjs.camelCase.call(void 0, curr);
|
|
268
268
|
const replacement = `\${${pathParam}}`;
|
|
269
269
|
return prev.replace(curr, replacement);
|
|
270
270
|
}, this.path);
|
|
@@ -280,7 +280,7 @@ var URLPath = class {
|
|
|
280
280
|
const params = {};
|
|
281
281
|
found.forEach((item) => {
|
|
282
282
|
item = item.replaceAll("{", "").replaceAll("}", "");
|
|
283
|
-
const pathParam = replacer ? replacer(
|
|
283
|
+
const pathParam = replacer ? replacer(_chunkGRBLCGB5cjs.camelCase.call(void 0, item)) : _chunkGRBLCGB5cjs.camelCase.call(void 0, item);
|
|
284
284
|
params[pathParam] = pathParam;
|
|
285
285
|
}, this.path);
|
|
286
286
|
return params;
|
|
@@ -295,7 +295,7 @@ var URLPath = class {
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
// src/utils/getParser.ts
|
|
298
|
-
|
|
298
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
299
299
|
async function getParser(language) {
|
|
300
300
|
let modulePromise;
|
|
301
301
|
switch (language) {
|
|
@@ -319,4 +319,4 @@ async function getParser(language) {
|
|
|
319
319
|
|
|
320
320
|
|
|
321
321
|
exports.FunctionParams = FunctionParams; exports.isPromise = isPromise; exports.isPromiseFulfilledResult = isPromiseFulfilledResult; exports.isPromiseRejectedResult = isPromiseRejectedResult; exports.renderTemplate = renderTemplate; exports.timeout = timeout; exports.getUniqueName = getUniqueName; exports.setUniqueName = setUniqueName; exports.URLPath = URLPath; exports.getParser = getParser;
|
|
322
|
-
//# sourceMappingURL=chunk-
|
|
322
|
+
//# sourceMappingURL=chunk-YTLMG2AN.cjs.map
|
package/dist/fs.cjs
CHANGED
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkAQJCCWPWcjs = require('./chunk-AQJCCWPW.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkX5IJHUXJcjs = require('./chunk-X5IJHUXJ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkXUCU53HTcjs = require('./chunk-XUCU53HT.cjs');
|
|
13
13
|
|
|
14
14
|
// src/fs/index.ts
|
|
15
|
-
|
|
15
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
exports.clean =
|
|
22
|
+
exports.clean = _chunkAQJCCWPWcjs.clean; exports.getRelativePath = _chunkAQJCCWPWcjs.getRelativePath; exports.read = _chunkAQJCCWPWcjs.read; exports.readSync = _chunkAQJCCWPWcjs.readSync; exports.write = _chunkX5IJHUXJcjs.write;
|
|
23
23
|
//# sourceMappingURL=fs.cjs.map
|
package/dist/index.cjs
CHANGED
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
require('./chunk-
|
|
17
|
-
require('./chunk-
|
|
18
|
-
require('./chunk-
|
|
19
|
-
require('./chunk-
|
|
20
|
-
require('./chunk-
|
|
21
|
-
require('./chunk-
|
|
22
|
-
require('./chunk-
|
|
15
|
+
var _chunk7PBKI3ORcjs = require('./chunk-7PBKI3OR.cjs');
|
|
16
|
+
require('./chunk-NP7GXHZS.cjs');
|
|
17
|
+
require('./chunk-YTLMG2AN.cjs');
|
|
18
|
+
require('./chunk-GRBLCGB5.cjs');
|
|
19
|
+
require('./chunk-GG3XRJX3.cjs');
|
|
20
|
+
require('./chunk-AQJCCWPW.cjs');
|
|
21
|
+
require('./chunk-X5IJHUXJ.cjs');
|
|
22
|
+
require('./chunk-XUCU53HT.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -35,5 +35,5 @@ require('./chunk-SJLROYQM.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.FileManager =
|
|
38
|
+
exports.FileManager = _chunk7PBKI3ORcjs.FileManager; exports.Generator = _chunk7PBKI3ORcjs.Generator; exports.Kubb = _chunk7PBKI3ORcjs.kubb_exports; exports.KubbFile = _chunk7PBKI3ORcjs.KubbFile; exports.PackageManager = _chunk7PBKI3ORcjs.PackageManager; exports.PluginManager = _chunk7PBKI3ORcjs.PluginManager; exports.PromiseManager = _chunk7PBKI3ORcjs.PromiseManager; exports.Warning = _chunk7PBKI3ORcjs.Warning; exports.build = _chunk7PBKI3ORcjs.build; exports.createPlugin = _chunk7PBKI3ORcjs.createPlugin; exports.default = _chunk7PBKI3ORcjs.build; exports.defineConfig = _chunk7PBKI3ORcjs.defineConfig; exports.isInputPath = _chunk7PBKI3ORcjs.isInputPath; exports.safeBuild = _chunk7PBKI3ORcjs.safeBuild;
|
|
39
39
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,8 @@ import PQueue from 'p-queue';
|
|
|
2
2
|
import { w as write, r as read } from './write-CN8f7bYv.cjs';
|
|
3
3
|
import { PossiblePromise, TupleToUnion, ObjValueTuple, GreaterThan } from '@kubb/types';
|
|
4
4
|
import { DirectoryTreeOptions } from 'directory-tree';
|
|
5
|
-
import { E as EventEmitter, L as Logger
|
|
5
|
+
import { E as EventEmitter, L as Logger } from './logger-DChjnJMn.cjs';
|
|
6
|
+
import 'consola';
|
|
6
7
|
import 'ora';
|
|
7
8
|
|
|
8
9
|
type BarrelManagerOptions = {
|
|
@@ -237,31 +238,6 @@ type Config<TInput = Input> = {
|
|
|
237
238
|
done?: string | Array<string>;
|
|
238
239
|
};
|
|
239
240
|
};
|
|
240
|
-
type CLIOptions = {
|
|
241
|
-
/**
|
|
242
|
-
* Path to `kubb.config.js`
|
|
243
|
-
*/
|
|
244
|
-
config?: string;
|
|
245
|
-
/**
|
|
246
|
-
* Watch changes on input
|
|
247
|
-
*/
|
|
248
|
-
watch?: string;
|
|
249
|
-
/**
|
|
250
|
-
* Log level to report when using the CLI
|
|
251
|
-
*
|
|
252
|
-
* `silent` will hide all information that is not relevant
|
|
253
|
-
*
|
|
254
|
-
* `info` will show all information possible(not related to the PluginManager)
|
|
255
|
-
*
|
|
256
|
-
* `debug` will show all information possible(related to the PluginManager), handy for seeing logs
|
|
257
|
-
* @default `silent`
|
|
258
|
-
*/
|
|
259
|
-
logLevel?: LogLevel;
|
|
260
|
-
/**
|
|
261
|
-
* Run Kubb with Bun
|
|
262
|
-
*/
|
|
263
|
-
bun?: boolean;
|
|
264
|
-
};
|
|
265
241
|
type UnionPlugins = PluginUnion;
|
|
266
242
|
type ObjectPlugin = keyof OptionsPlugins;
|
|
267
243
|
type PluginFactoryOptions<
|
|
@@ -626,6 +602,31 @@ type BuildOutput = {
|
|
|
626
602
|
declare function build(options: BuildOptions): Promise<BuildOutput>;
|
|
627
603
|
declare function safeBuild(options: BuildOptions): Promise<BuildOutput>;
|
|
628
604
|
|
|
605
|
+
type Args = {
|
|
606
|
+
/**
|
|
607
|
+
* Path to `kubb.config.js`
|
|
608
|
+
*/
|
|
609
|
+
config?: string;
|
|
610
|
+
/**
|
|
611
|
+
* Watch changes on input
|
|
612
|
+
*/
|
|
613
|
+
watch?: boolean;
|
|
614
|
+
/**
|
|
615
|
+
* Log level to report when using the CLI
|
|
616
|
+
*
|
|
617
|
+
* `silent` will hide all information that is not relevant
|
|
618
|
+
*
|
|
619
|
+
* `info` will show all information possible(not related to the PluginManager)
|
|
620
|
+
*
|
|
621
|
+
* `debug` will show all information possible(related to the PluginManager), handy for seeing logs
|
|
622
|
+
* @default `silent`
|
|
623
|
+
*/
|
|
624
|
+
logLevel?: string;
|
|
625
|
+
/**
|
|
626
|
+
* Run Kubb with Bun
|
|
627
|
+
*/
|
|
628
|
+
bun?: boolean;
|
|
629
|
+
};
|
|
629
630
|
/**
|
|
630
631
|
* Type helper to make it easier to use kubb.config.js
|
|
631
632
|
* accepts a direct {@link Config} object, or a function that returns it.
|
|
@@ -633,7 +634,7 @@ declare function safeBuild(options: BuildOptions): Promise<BuildOutput>;
|
|
|
633
634
|
*/
|
|
634
635
|
declare function defineConfig(options: PossiblePromise<UserConfig | Array<UserConfig>> | ((
|
|
635
636
|
/** The options derived from the CLI flags */
|
|
636
|
-
|
|
637
|
+
args: Args) => PossiblePromise<UserConfig | Array<UserConfig>>)): typeof options;
|
|
637
638
|
declare function isInputPath(result: Config | undefined): result is Config<InputPath>;
|
|
638
639
|
|
|
639
640
|
/**
|
|
@@ -706,4 +707,4 @@ declare class PromiseManager<TState = any> {
|
|
|
706
707
|
interface _Register {
|
|
707
708
|
}
|
|
708
709
|
|
|
709
|
-
export { type
|
|
710
|
+
export { type Config, FileManager, Generator, type GetPluginFactoryOptions, type InputData, type InputPath, kubb as Kubb, KubbFile, type ObjectPlugin, PackageManager, type Plugin, type PluginCache, type PluginContext, type PluginFactoryOptions, type PluginKey, type PluginLifecycle, type PluginLifecycleHooks, PluginManager, type PluginParameter, type PluginWithLifeCycle, PromiseManager, type ResolveNameParams, type ResolvePathParams, type TransformResult, type UnionPlugins, type UserConfig, type UserPlugin, type UserPluginWithLifeCycle, Warning, type _Register, build, createPlugin, build as default, defineConfig, isInputPath, safeBuild };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import PQueue from 'p-queue';
|
|
|
2
2
|
import { w as write, r as read } from './write-CN8f7bYv.js';
|
|
3
3
|
import { PossiblePromise, TupleToUnion, ObjValueTuple, GreaterThan } from '@kubb/types';
|
|
4
4
|
import { DirectoryTreeOptions } from 'directory-tree';
|
|
5
|
-
import { E as EventEmitter, L as Logger
|
|
5
|
+
import { E as EventEmitter, L as Logger } from './logger-DChjnJMn.js';
|
|
6
|
+
import 'consola';
|
|
6
7
|
import 'ora';
|
|
7
8
|
|
|
8
9
|
type BarrelManagerOptions = {
|
|
@@ -237,31 +238,6 @@ type Config<TInput = Input> = {
|
|
|
237
238
|
done?: string | Array<string>;
|
|
238
239
|
};
|
|
239
240
|
};
|
|
240
|
-
type CLIOptions = {
|
|
241
|
-
/**
|
|
242
|
-
* Path to `kubb.config.js`
|
|
243
|
-
*/
|
|
244
|
-
config?: string;
|
|
245
|
-
/**
|
|
246
|
-
* Watch changes on input
|
|
247
|
-
*/
|
|
248
|
-
watch?: string;
|
|
249
|
-
/**
|
|
250
|
-
* Log level to report when using the CLI
|
|
251
|
-
*
|
|
252
|
-
* `silent` will hide all information that is not relevant
|
|
253
|
-
*
|
|
254
|
-
* `info` will show all information possible(not related to the PluginManager)
|
|
255
|
-
*
|
|
256
|
-
* `debug` will show all information possible(related to the PluginManager), handy for seeing logs
|
|
257
|
-
* @default `silent`
|
|
258
|
-
*/
|
|
259
|
-
logLevel?: LogLevel;
|
|
260
|
-
/**
|
|
261
|
-
* Run Kubb with Bun
|
|
262
|
-
*/
|
|
263
|
-
bun?: boolean;
|
|
264
|
-
};
|
|
265
241
|
type UnionPlugins = PluginUnion;
|
|
266
242
|
type ObjectPlugin = keyof OptionsPlugins;
|
|
267
243
|
type PluginFactoryOptions<
|
|
@@ -626,6 +602,31 @@ type BuildOutput = {
|
|
|
626
602
|
declare function build(options: BuildOptions): Promise<BuildOutput>;
|
|
627
603
|
declare function safeBuild(options: BuildOptions): Promise<BuildOutput>;
|
|
628
604
|
|
|
605
|
+
type Args = {
|
|
606
|
+
/**
|
|
607
|
+
* Path to `kubb.config.js`
|
|
608
|
+
*/
|
|
609
|
+
config?: string;
|
|
610
|
+
/**
|
|
611
|
+
* Watch changes on input
|
|
612
|
+
*/
|
|
613
|
+
watch?: boolean;
|
|
614
|
+
/**
|
|
615
|
+
* Log level to report when using the CLI
|
|
616
|
+
*
|
|
617
|
+
* `silent` will hide all information that is not relevant
|
|
618
|
+
*
|
|
619
|
+
* `info` will show all information possible(not related to the PluginManager)
|
|
620
|
+
*
|
|
621
|
+
* `debug` will show all information possible(related to the PluginManager), handy for seeing logs
|
|
622
|
+
* @default `silent`
|
|
623
|
+
*/
|
|
624
|
+
logLevel?: string;
|
|
625
|
+
/**
|
|
626
|
+
* Run Kubb with Bun
|
|
627
|
+
*/
|
|
628
|
+
bun?: boolean;
|
|
629
|
+
};
|
|
629
630
|
/**
|
|
630
631
|
* Type helper to make it easier to use kubb.config.js
|
|
631
632
|
* accepts a direct {@link Config} object, or a function that returns it.
|
|
@@ -633,7 +634,7 @@ declare function safeBuild(options: BuildOptions): Promise<BuildOutput>;
|
|
|
633
634
|
*/
|
|
634
635
|
declare function defineConfig(options: PossiblePromise<UserConfig | Array<UserConfig>> | ((
|
|
635
636
|
/** The options derived from the CLI flags */
|
|
636
|
-
|
|
637
|
+
args: Args) => PossiblePromise<UserConfig | Array<UserConfig>>)): typeof options;
|
|
637
638
|
declare function isInputPath(result: Config | undefined): result is Config<InputPath>;
|
|
638
639
|
|
|
639
640
|
/**
|
|
@@ -706,4 +707,4 @@ declare class PromiseManager<TState = any> {
|
|
|
706
707
|
interface _Register {
|
|
707
708
|
}
|
|
708
709
|
|
|
709
|
-
export { type
|
|
710
|
+
export { type Config, FileManager, Generator, type GetPluginFactoryOptions, type InputData, type InputPath, kubb as Kubb, KubbFile, type ObjectPlugin, PackageManager, type Plugin, type PluginCache, type PluginContext, type PluginFactoryOptions, type PluginKey, type PluginLifecycle, type PluginLifecycleHooks, PluginManager, type PluginParameter, type PluginWithLifeCycle, PromiseManager, type ResolveNameParams, type ResolvePathParams, type TransformResult, type UnionPlugins, type UserConfig, type UserPlugin, type UserPluginWithLifeCycle, Warning, type _Register, build, createPlugin, build as default, defineConfig, isInputPath, safeBuild };
|
package/dist/index.js
CHANGED
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
isInputPath,
|
|
13
13
|
kubb_exports,
|
|
14
14
|
safeBuild
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6NMPKKGV.js";
|
|
16
16
|
import "./chunk-UCKFXEKM.js";
|
|
17
17
|
import "./chunk-FRT5NM5I.js";
|
|
18
18
|
import "./chunk-4X5FFJPJ.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-TIYJPVUG.js";
|
|
20
20
|
import "./chunk-MDO6MCFJ.js";
|
|
21
21
|
import "./chunk-2F7E62RD.js";
|
|
22
22
|
import "./chunk-Z4BLTVTB.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConsolaInstance } from 'consola';
|
|
1
2
|
import { Ora } from 'ora';
|
|
2
3
|
|
|
3
4
|
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
@@ -9,6 +10,11 @@ declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
|
9
10
|
removeAll(): void;
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
declare const LogMapper: {
|
|
14
|
+
readonly silent: number;
|
|
15
|
+
readonly info: 3;
|
|
16
|
+
readonly debug: 4;
|
|
17
|
+
};
|
|
12
18
|
declare const LogLevel: {
|
|
13
19
|
readonly silent: "silent";
|
|
14
20
|
readonly info: "info";
|
|
@@ -29,6 +35,7 @@ type Logger = {
|
|
|
29
35
|
name?: string;
|
|
30
36
|
logLevel: LogLevel;
|
|
31
37
|
spinner?: Ora;
|
|
38
|
+
consola?: ConsolaInstance;
|
|
32
39
|
on: EventEmitter<Events>['on'];
|
|
33
40
|
emit: EventEmitter<Events>['emit'];
|
|
34
41
|
};
|
|
@@ -36,9 +43,10 @@ type Props = {
|
|
|
36
43
|
name?: string;
|
|
37
44
|
logLevel: LogLevel;
|
|
38
45
|
spinner?: Ora;
|
|
46
|
+
consola?: ConsolaInstance;
|
|
39
47
|
};
|
|
40
|
-
declare function createLogger({ logLevel, name, spinner }: Props): Logger;
|
|
48
|
+
declare function createLogger({ logLevel, name, spinner, consola }: Props): Logger;
|
|
41
49
|
declare function randomColour(text?: string, colours?: readonly ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"]): string;
|
|
42
50
|
declare function randomCliColour(text?: string, colors?: readonly ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"]): string;
|
|
43
51
|
|
|
44
|
-
export { EventEmitter as E, type Logger as L, LogLevel as a,
|
|
52
|
+
export { EventEmitter as E, type Logger as L, LogLevel as a, LogMapper as b, createLogger as c, randomCliColour as d, randomColour as r };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConsolaInstance } from 'consola';
|
|
1
2
|
import { Ora } from 'ora';
|
|
2
3
|
|
|
3
4
|
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
@@ -9,6 +10,11 @@ declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
|
9
10
|
removeAll(): void;
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
declare const LogMapper: {
|
|
14
|
+
readonly silent: number;
|
|
15
|
+
readonly info: 3;
|
|
16
|
+
readonly debug: 4;
|
|
17
|
+
};
|
|
12
18
|
declare const LogLevel: {
|
|
13
19
|
readonly silent: "silent";
|
|
14
20
|
readonly info: "info";
|
|
@@ -29,6 +35,7 @@ type Logger = {
|
|
|
29
35
|
name?: string;
|
|
30
36
|
logLevel: LogLevel;
|
|
31
37
|
spinner?: Ora;
|
|
38
|
+
consola?: ConsolaInstance;
|
|
32
39
|
on: EventEmitter<Events>['on'];
|
|
33
40
|
emit: EventEmitter<Events>['emit'];
|
|
34
41
|
};
|
|
@@ -36,9 +43,10 @@ type Props = {
|
|
|
36
43
|
name?: string;
|
|
37
44
|
logLevel: LogLevel;
|
|
38
45
|
spinner?: Ora;
|
|
46
|
+
consola?: ConsolaInstance;
|
|
39
47
|
};
|
|
40
|
-
declare function createLogger({ logLevel, name, spinner }: Props): Logger;
|
|
48
|
+
declare function createLogger({ logLevel, name, spinner, consola }: Props): Logger;
|
|
41
49
|
declare function randomColour(text?: string, colours?: readonly ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"]): string;
|
|
42
50
|
declare function randomCliColour(text?: string, colors?: readonly ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"]): string;
|
|
43
51
|
|
|
44
|
-
export { EventEmitter as E, type Logger as L, LogLevel as a,
|
|
52
|
+
export { EventEmitter as E, type Logger as L, LogLevel as a, LogMapper as b, createLogger as c, randomCliColour as d, randomColour as r };
|
package/dist/logger.cjs
CHANGED
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkCURDPCUGcjs = require('./chunk-CURDPCUG.cjs');
|
|
7
|
-
require('./chunk-RPDYCQHF.cjs');
|
|
8
|
-
require('./chunk-SJLROYQM.cjs');
|
|
9
6
|
|
|
7
|
+
var _chunkGG3XRJX3cjs = require('./chunk-GG3XRJX3.cjs');
|
|
8
|
+
require('./chunk-X5IJHUXJ.cjs');
|
|
9
|
+
require('./chunk-XUCU53HT.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.LogLevel = _chunkGG3XRJX3cjs.LogLevel; exports.LogMapper = _chunkGG3XRJX3cjs.LogMapper; exports.createLogger = _chunkGG3XRJX3cjs.createLogger; exports.randomCliColour = _chunkGG3XRJX3cjs.randomCliColour; exports.randomColour = _chunkGG3XRJX3cjs.randomColour;
|
|
15
17
|
//# sourceMappingURL=logger.cjs.map
|
package/dist/logger.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { a as LogLevel, L as Logger, c as createLogger,
|
|
1
|
+
export { a as LogLevel, b as LogMapper, L as Logger, c as createLogger, d as randomCliColour, r as randomColour } from './logger-DChjnJMn.cjs';
|
|
2
|
+
import 'consola';
|
|
2
3
|
import 'ora';
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { a as LogLevel, L as Logger, c as createLogger,
|
|
1
|
+
export { a as LogLevel, b as LogMapper, L as Logger, c as createLogger, d as randomCliColour, r as randomColour } from './logger-DChjnJMn.js';
|
|
2
|
+
import 'consola';
|
|
2
3
|
import 'ora';
|
package/dist/logger.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LogLevel,
|
|
3
|
+
LogMapper,
|
|
3
4
|
createLogger,
|
|
4
5
|
randomCliColour,
|
|
5
6
|
randomColour
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TIYJPVUG.js";
|
|
7
8
|
import "./chunk-2F7E62RD.js";
|
|
8
9
|
import "./chunk-Z4BLTVTB.js";
|
|
9
10
|
export {
|
|
10
11
|
LogLevel,
|
|
12
|
+
LogMapper,
|
|
11
13
|
createLogger,
|
|
12
14
|
randomCliColour,
|
|
13
15
|
randomColour
|
package/dist/mocks.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunk7PBKI3ORcjs = require('./chunk-7PBKI3OR.cjs');
|
|
4
|
+
require('./chunk-NP7GXHZS.cjs');
|
|
5
|
+
require('./chunk-YTLMG2AN.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
8
|
+
var _chunkGRBLCGB5cjs = require('./chunk-GRBLCGB5.cjs');
|
|
9
|
+
require('./chunk-GG3XRJX3.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkAQJCCWPWcjs = require('./chunk-AQJCCWPW.cjs');
|
|
13
|
+
require('./chunk-X5IJHUXJ.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkXUCU53HTcjs = require('./chunk-XUCU53HT.cjs');
|
|
17
17
|
|
|
18
18
|
// mocks/index.ts
|
|
19
|
-
|
|
19
|
+
_chunkXUCU53HTcjs.init_cjs_shims.call(void 0, );
|
|
20
20
|
var mockedPluginManager = {
|
|
21
21
|
resolveName: ({ name, type }) => {
|
|
22
22
|
if (type === "type") {
|
|
23
|
-
return
|
|
23
|
+
return _chunkGRBLCGB5cjs.pascalCase.call(void 0, name);
|
|
24
24
|
}
|
|
25
25
|
return name;
|
|
26
26
|
},
|
|
@@ -37,7 +37,7 @@ var mockedPluginManager = {
|
|
|
37
37
|
const baseName = `${name}${extName}`;
|
|
38
38
|
let source = "";
|
|
39
39
|
try {
|
|
40
|
-
source =
|
|
40
|
+
source = _chunkAQJCCWPWcjs.readSync.call(void 0, baseName);
|
|
41
41
|
} catch (_e) {
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
@@ -52,7 +52,7 @@ var mockedPluginManager = {
|
|
|
52
52
|
};
|
|
53
53
|
async function matchFiles(files) {
|
|
54
54
|
for (const file of files) {
|
|
55
|
-
const source = await
|
|
55
|
+
const source = await _chunk7PBKI3ORcjs.FileManager.getSource(file);
|
|
56
56
|
expect(source).toMatchSnapshot();
|
|
57
57
|
}
|
|
58
58
|
}
|
package/dist/mocks.d.cts
CHANGED
package/dist/mocks.d.ts
CHANGED