@kubb/core 3.16.1 → 3.16.3
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/FileManager-Dk759iZ3.js +918 -0
- package/dist/FileManager-Dk759iZ3.js.map +1 -0
- package/dist/FileManager-DsRjYJa_.cjs +1031 -0
- package/dist/FileManager-DsRjYJa_.cjs.map +1 -0
- package/dist/PluginManager-1jPxuyQK.d.ts +511 -0
- package/dist/PluginManager-Cvj5AlsU.d.cts +511 -0
- package/dist/chunk-DWy1uDak.cjs +39 -0
- package/dist/chunk-DbvY3SJr.js +33 -0
- package/dist/fs-BacxV1CO.js +87 -0
- package/dist/fs-BacxV1CO.js.map +1 -0
- package/dist/fs-BazSaf2y.cjs +129 -0
- package/dist/fs-BazSaf2y.cjs.map +1 -0
- package/dist/fs.cjs +15 -39
- package/dist/fs.d.cts +2 -19
- package/dist/fs.d.ts +2 -19
- package/dist/fs.js +4 -3
- package/dist/index-BKHQGQVq.d.ts +140 -0
- package/dist/index-BfD6z1P5.d.cts +141 -0
- package/dist/index-Cb4pChs8.d.ts +180 -0
- package/dist/index-D2ptHzfn.d.cts +180 -0
- package/dist/index.cjs +1000 -1028
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -89
- package/dist/index.d.ts +107 -89
- package/dist/index.js +1020 -864
- package/dist/index.js.map +1 -1
- package/dist/logger-BxvJpQMX.cjs +1115 -0
- package/dist/logger-BxvJpQMX.cjs.map +1 -0
- package/dist/logger-Cs45J4yy.js +1085 -0
- package/dist/logger-Cs45J4yy.js.map +1 -0
- package/dist/logger-OWS6fqk0.d.cts +69 -0
- package/dist/logger-xcdTETKy.d.ts +69 -0
- package/dist/logger.cjs +6 -24
- package/dist/logger.d.cts +2 -3
- package/dist/logger.d.ts +2 -3
- package/dist/logger.js +4 -4
- package/dist/mocks.cjs +49 -65
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +6 -6
- package/dist/mocks.d.ts +6 -6
- package/dist/mocks.js +48 -59
- package/dist/mocks.js.map +1 -1
- package/dist/prompt-DwEAzq0q.js +853 -0
- package/dist/prompt-DwEAzq0q.js.map +1 -0
- package/dist/prompt-qiwl6Be9.cjs +855 -0
- package/dist/prompt-qiwl6Be9.cjs.map +1 -0
- package/dist/transformers-B3CHtwuB.cjs +948 -0
- package/dist/transformers-B3CHtwuB.cjs.map +1 -0
- package/dist/transformers-CJqBQFIl.js +829 -0
- package/dist/transformers-CJqBQFIl.js.map +1 -0
- package/dist/transformers.cjs +33 -88
- package/dist/transformers.d.cts +75 -54
- package/dist/transformers.d.ts +75 -54
- package/dist/transformers.js +4 -3
- package/dist/utils.cjs +20 -73
- package/dist/utils.d.cts +5 -126
- package/dist/utils.d.ts +5 -126
- package/dist/utils.js +6 -5
- package/dist/write-CLTPlucv.js +42 -0
- package/dist/write-CLTPlucv.js.map +1 -0
- package/dist/write-l_NzIqyy.cjs +48 -0
- package/dist/write-l_NzIqyy.cjs.map +1 -0
- package/package.json +28 -35
- package/src/BarrelManager.ts +1 -0
- package/src/PromiseManager.ts +1 -7
- package/src/build.ts +9 -11
- package/src/index.ts +5 -5
- package/src/logger.ts +10 -10
- package/src/utils/FunctionParams.ts +3 -1
- package/src/utils/TreeNode.ts +3 -1
- package/dist/PluginManager-E3SghPP9.d.cts +0 -458
- package/dist/PluginManager-PDmRCu9k.d.ts +0 -458
- package/dist/chunk-4V7HK7PT.js +0 -1199
- package/dist/chunk-4V7HK7PT.js.map +0 -1
- package/dist/chunk-BHSTNFNQ.cjs +0 -701
- package/dist/chunk-BHSTNFNQ.cjs.map +0 -1
- package/dist/chunk-CAZ37TGB.js +0 -918
- package/dist/chunk-CAZ37TGB.js.map +0 -1
- package/dist/chunk-E4XLCCPK.cjs +0 -170
- package/dist/chunk-E4XLCCPK.cjs.map +0 -1
- package/dist/chunk-GBYHPDPK.js +0 -595
- package/dist/chunk-GBYHPDPK.js.map +0 -1
- package/dist/chunk-MCNA6SYG.cjs +0 -1231
- package/dist/chunk-MCNA6SYG.cjs.map +0 -1
- package/dist/chunk-QR7CQIA3.cjs +0 -943
- package/dist/chunk-QR7CQIA3.cjs.map +0 -1
- package/dist/chunk-YRPOID7E.js +0 -157
- package/dist/chunk-YRPOID7E.js.map +0 -1
- package/dist/fs.cjs.map +0 -1
- package/dist/fs.js.map +0 -1
- package/dist/logger-BWq-oJU_.d.cts +0 -63
- package/dist/logger-BWq-oJU_.d.ts +0 -63
- package/dist/logger.cjs.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/parser-C1vOjVEd.d.ts +0 -41
- package/dist/parser-D6vU1kA9.d.cts +0 -41
- package/dist/prompt-ELTHGQK6.js +0 -753
- package/dist/prompt-ELTHGQK6.js.map +0 -1
- package/dist/prompt-U7M5G25C.cjs +0 -761
- package/dist/prompt-U7M5G25C.cjs.map +0 -1
- package/dist/transformers.cjs.map +0 -1
- package/dist/transformers.js.map +0 -1
- package/dist/types-CA8nQKwM.d.cts +0 -132
- package/dist/types-CA8nQKwM.d.ts +0 -132
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js.map +0 -1
package/dist/utils.cjs
CHANGED
|
@@ -1,74 +1,21 @@
|
|
|
1
|
-
'
|
|
1
|
+
require('./fs-BazSaf2y.cjs');
|
|
2
|
+
require('./write-l_NzIqyy.cjs');
|
|
3
|
+
require('./transformers-B3CHtwuB.cjs');
|
|
4
|
+
const require_FileManager = require('./FileManager-DsRjYJa_.cjs');
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
get: function () { return chunkQR7CQIA3_cjs.URLPath; }
|
|
20
|
-
});
|
|
21
|
-
Object.defineProperty(exports, "createFile", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () { return chunkQR7CQIA3_cjs.createFile; }
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "createFileExport", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () { return chunkQR7CQIA3_cjs.createFileExport; }
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(exports, "createFileImport", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () { return chunkQR7CQIA3_cjs.createFileImport; }
|
|
32
|
-
});
|
|
33
|
-
Object.defineProperty(exports, "createFileParser", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () { return chunkQR7CQIA3_cjs.createFileParser; }
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "getDefaultBanner", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () { return chunkQR7CQIA3_cjs.getDefaultBanner; }
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(exports, "getFileParser", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function () { return chunkQR7CQIA3_cjs.getFileParser; }
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(exports, "getUniqueName", {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function () { return chunkQR7CQIA3_cjs.getUniqueName; }
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(exports, "isPromise", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function () { return chunkQR7CQIA3_cjs.isPromise; }
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(exports, "isPromiseFulfilledResult", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
get: function () { return chunkQR7CQIA3_cjs.isPromiseFulfilledResult; }
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(exports, "isPromiseRejectedResult", {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function () { return chunkQR7CQIA3_cjs.isPromiseRejectedResult; }
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(exports, "renderTemplate", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () { return chunkQR7CQIA3_cjs.renderTemplate; }
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(exports, "setUniqueName", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () { return chunkQR7CQIA3_cjs.setUniqueName; }
|
|
68
|
-
});
|
|
69
|
-
Object.defineProperty(exports, "timeout", {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function () { return chunkQR7CQIA3_cjs.timeout; }
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=utils.cjs.map
|
|
74
|
-
//# sourceMappingURL=utils.cjs.map
|
|
6
|
+
exports.Cache = require_FileManager.Cache;
|
|
7
|
+
exports.FunctionParams = require_FileManager.FunctionParams;
|
|
8
|
+
exports.URLPath = require_FileManager.URLPath;
|
|
9
|
+
exports.createFile = require_FileManager.createFile;
|
|
10
|
+
exports.createFileExport = require_FileManager.createFileExport;
|
|
11
|
+
exports.createFileImport = require_FileManager.createFileImport;
|
|
12
|
+
exports.createFileParser = require_FileManager.createFileParser;
|
|
13
|
+
exports.getDefaultBanner = require_FileManager.getDefaultBanner;
|
|
14
|
+
exports.getFileParser = require_FileManager.getFileParser;
|
|
15
|
+
exports.getUniqueName = require_FileManager.getUniqueName;
|
|
16
|
+
exports.isPromise = require_FileManager.isPromise;
|
|
17
|
+
exports.isPromiseFulfilledResult = require_FileManager.isPromiseFulfilledResult;
|
|
18
|
+
exports.isPromiseRejectedResult = require_FileManager.isPromiseRejectedResult;
|
|
19
|
+
exports.renderTemplate = require_FileManager.renderTemplate;
|
|
20
|
+
exports.setUniqueName = require_FileManager.setUniqueName;
|
|
21
|
+
exports.timeout = require_FileManager.timeout;
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,126 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import 'consola';
|
|
7
|
-
|
|
8
|
-
type FunctionParamsASTWithoutType = {
|
|
9
|
-
name?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
/**
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
required?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @default true
|
|
17
|
-
*/
|
|
18
|
-
enabled?: boolean;
|
|
19
|
-
default?: string;
|
|
20
|
-
};
|
|
21
|
-
type FunctionParamsASTWithType = {
|
|
22
|
-
name?: never;
|
|
23
|
-
type: string;
|
|
24
|
-
/**
|
|
25
|
-
* @default true
|
|
26
|
-
*/
|
|
27
|
-
required?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @default true
|
|
30
|
-
*/
|
|
31
|
-
enabled?: boolean;
|
|
32
|
-
default?: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
37
|
-
type FunctionParamsAST = FunctionParamsASTWithoutType | FunctionParamsASTWithType;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated
|
|
40
|
-
*/
|
|
41
|
-
declare class FunctionParams {
|
|
42
|
-
#private;
|
|
43
|
-
constructor();
|
|
44
|
-
get items(): FunctionParamsAST[];
|
|
45
|
-
add(item: FunctionParamsAST | Array<FunctionParamsAST | FunctionParamsAST[] | undefined> | undefined): FunctionParams;
|
|
46
|
-
static toObject(items: FunctionParamsAST[]): FunctionParamsAST;
|
|
47
|
-
static toString(items: (FunctionParamsAST | FunctionParamsAST[])[]): string;
|
|
48
|
-
toObject(): FunctionParamsAST;
|
|
49
|
-
toString(): string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare function isPromise<T>(result: PossiblePromise<T>): result is Promise<T>;
|
|
53
|
-
declare function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T>;
|
|
54
|
-
declare function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & {
|
|
55
|
-
reason: T;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
declare function renderTemplate<TData extends Record<string, unknown> = Record<string, unknown>>(template: string, data?: TData | undefined): string;
|
|
59
|
-
|
|
60
|
-
declare function timeout(ms: number): Promise<unknown>;
|
|
61
|
-
|
|
62
|
-
declare function getUniqueName(originalName: string, data: Record<string, number>): string;
|
|
63
|
-
declare function setUniqueName(originalName: string, data: Record<string, number>): string;
|
|
64
|
-
|
|
65
|
-
type URLObject = {
|
|
66
|
-
url: string;
|
|
67
|
-
params?: Record<string, string>;
|
|
68
|
-
};
|
|
69
|
-
type ObjectOptions = {
|
|
70
|
-
type?: 'path' | 'template';
|
|
71
|
-
replacer?: (pathParam: string) => string;
|
|
72
|
-
stringify?: boolean;
|
|
73
|
-
};
|
|
74
|
-
type Options = {
|
|
75
|
-
casing?: 'camelcase';
|
|
76
|
-
};
|
|
77
|
-
declare class URLPath {
|
|
78
|
-
#private;
|
|
79
|
-
path: string;
|
|
80
|
-
constructor(path: string, options?: Options);
|
|
81
|
-
/**
|
|
82
|
-
* Convert Swagger path to URLPath(syntax of Express)
|
|
83
|
-
* @example /pet/{petId} => /pet/:petId
|
|
84
|
-
*/
|
|
85
|
-
get URL(): string;
|
|
86
|
-
get isURL(): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
89
|
-
* @example /pet/{petId} => `/pet/${petId}`
|
|
90
|
-
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
91
|
-
* @example /account/userID => `/account/${userId}`
|
|
92
|
-
*/
|
|
93
|
-
get template(): string;
|
|
94
|
-
get object(): URLObject | string;
|
|
95
|
-
get params(): Record<string, string> | undefined;
|
|
96
|
-
toObject({ type, replacer, stringify }?: ObjectOptions): URLObject | string;
|
|
97
|
-
/**
|
|
98
|
-
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
99
|
-
* @example /pet/{petId} => `/pet/${petId}`
|
|
100
|
-
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
101
|
-
* @example /account/userID => `/account/${userId}`
|
|
102
|
-
*/
|
|
103
|
-
toTemplateString({ prefix, replacer }?: {
|
|
104
|
-
prefix?: string;
|
|
105
|
-
replacer?: (pathParam: string) => string;
|
|
106
|
-
}): string;
|
|
107
|
-
getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* Convert Swagger path to URLPath(syntax of Express)
|
|
110
|
-
* @example /pet/{petId} => /pet/:petId
|
|
111
|
-
*/
|
|
112
|
-
toURLPath(): string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
declare class Cache<T> {
|
|
116
|
-
#private;
|
|
117
|
-
get(key: string): Promise<T | null>;
|
|
118
|
-
set(key: string, value: T): Promise<void>;
|
|
119
|
-
delete(key: string): Promise<void>;
|
|
120
|
-
clear(): Promise<void>;
|
|
121
|
-
keys(): Promise<string[]>;
|
|
122
|
-
values(): Promise<T[]>;
|
|
123
|
-
flush(): Promise<void>;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export { Cache, FunctionParams, type FunctionParamsAST, type URLObject, URLPath, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
|
1
|
+
import "./index-BfD6z1P5.cjs";
|
|
2
|
+
import "./logger-OWS6fqk0.cjs";
|
|
3
|
+
import "./PluginManager-Cvj5AlsU.cjs";
|
|
4
|
+
import { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./index-D2ptHzfn.cjs";
|
|
5
|
+
export { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,126 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import 'consola';
|
|
7
|
-
|
|
8
|
-
type FunctionParamsASTWithoutType = {
|
|
9
|
-
name?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
/**
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
required?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @default true
|
|
17
|
-
*/
|
|
18
|
-
enabled?: boolean;
|
|
19
|
-
default?: string;
|
|
20
|
-
};
|
|
21
|
-
type FunctionParamsASTWithType = {
|
|
22
|
-
name?: never;
|
|
23
|
-
type: string;
|
|
24
|
-
/**
|
|
25
|
-
* @default true
|
|
26
|
-
*/
|
|
27
|
-
required?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @default true
|
|
30
|
-
*/
|
|
31
|
-
enabled?: boolean;
|
|
32
|
-
default?: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
37
|
-
type FunctionParamsAST = FunctionParamsASTWithoutType | FunctionParamsASTWithType;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated
|
|
40
|
-
*/
|
|
41
|
-
declare class FunctionParams {
|
|
42
|
-
#private;
|
|
43
|
-
constructor();
|
|
44
|
-
get items(): FunctionParamsAST[];
|
|
45
|
-
add(item: FunctionParamsAST | Array<FunctionParamsAST | FunctionParamsAST[] | undefined> | undefined): FunctionParams;
|
|
46
|
-
static toObject(items: FunctionParamsAST[]): FunctionParamsAST;
|
|
47
|
-
static toString(items: (FunctionParamsAST | FunctionParamsAST[])[]): string;
|
|
48
|
-
toObject(): FunctionParamsAST;
|
|
49
|
-
toString(): string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare function isPromise<T>(result: PossiblePromise<T>): result is Promise<T>;
|
|
53
|
-
declare function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T>;
|
|
54
|
-
declare function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & {
|
|
55
|
-
reason: T;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
declare function renderTemplate<TData extends Record<string, unknown> = Record<string, unknown>>(template: string, data?: TData | undefined): string;
|
|
59
|
-
|
|
60
|
-
declare function timeout(ms: number): Promise<unknown>;
|
|
61
|
-
|
|
62
|
-
declare function getUniqueName(originalName: string, data: Record<string, number>): string;
|
|
63
|
-
declare function setUniqueName(originalName: string, data: Record<string, number>): string;
|
|
64
|
-
|
|
65
|
-
type URLObject = {
|
|
66
|
-
url: string;
|
|
67
|
-
params?: Record<string, string>;
|
|
68
|
-
};
|
|
69
|
-
type ObjectOptions = {
|
|
70
|
-
type?: 'path' | 'template';
|
|
71
|
-
replacer?: (pathParam: string) => string;
|
|
72
|
-
stringify?: boolean;
|
|
73
|
-
};
|
|
74
|
-
type Options = {
|
|
75
|
-
casing?: 'camelcase';
|
|
76
|
-
};
|
|
77
|
-
declare class URLPath {
|
|
78
|
-
#private;
|
|
79
|
-
path: string;
|
|
80
|
-
constructor(path: string, options?: Options);
|
|
81
|
-
/**
|
|
82
|
-
* Convert Swagger path to URLPath(syntax of Express)
|
|
83
|
-
* @example /pet/{petId} => /pet/:petId
|
|
84
|
-
*/
|
|
85
|
-
get URL(): string;
|
|
86
|
-
get isURL(): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
89
|
-
* @example /pet/{petId} => `/pet/${petId}`
|
|
90
|
-
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
91
|
-
* @example /account/userID => `/account/${userId}`
|
|
92
|
-
*/
|
|
93
|
-
get template(): string;
|
|
94
|
-
get object(): URLObject | string;
|
|
95
|
-
get params(): Record<string, string> | undefined;
|
|
96
|
-
toObject({ type, replacer, stringify }?: ObjectOptions): URLObject | string;
|
|
97
|
-
/**
|
|
98
|
-
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
99
|
-
* @example /pet/{petId} => `/pet/${petId}`
|
|
100
|
-
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
101
|
-
* @example /account/userID => `/account/${userId}`
|
|
102
|
-
*/
|
|
103
|
-
toTemplateString({ prefix, replacer }?: {
|
|
104
|
-
prefix?: string;
|
|
105
|
-
replacer?: (pathParam: string) => string;
|
|
106
|
-
}): string;
|
|
107
|
-
getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* Convert Swagger path to URLPath(syntax of Express)
|
|
110
|
-
* @example /pet/{petId} => /pet/:petId
|
|
111
|
-
*/
|
|
112
|
-
toURLPath(): string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
declare class Cache<T> {
|
|
116
|
-
#private;
|
|
117
|
-
get(key: string): Promise<T | null>;
|
|
118
|
-
set(key: string, value: T): Promise<void>;
|
|
119
|
-
delete(key: string): Promise<void>;
|
|
120
|
-
clear(): Promise<void>;
|
|
121
|
-
keys(): Promise<string[]>;
|
|
122
|
-
values(): Promise<T[]>;
|
|
123
|
-
flush(): Promise<void>;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export { Cache, FunctionParams, type FunctionParamsAST, type URLObject, URLPath, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
|
1
|
+
import "./index-BKHQGQVq.js";
|
|
2
|
+
import "./logger-xcdTETKy.js";
|
|
3
|
+
import "./PluginManager-1jPxuyQK.js";
|
|
4
|
+
import { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./index-Cb4pChs8.js";
|
|
5
|
+
export { Cache, FunctionParams, FunctionParamsAST, ParserModule, URLObject, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
package/dist/utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import "./fs-BacxV1CO.js";
|
|
2
|
+
import "./write-CLTPlucv.js";
|
|
3
|
+
import "./transformers-CJqBQFIl.js";
|
|
4
|
+
import { Cache, FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from "./FileManager-Dk759iZ3.js";
|
|
5
|
+
|
|
6
|
+
export { Cache, FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { switcher } from "js-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/fs/write.ts
|
|
6
|
+
const writer = switcher({
|
|
7
|
+
node: async (path$1, data, { sanity }) => {
|
|
8
|
+
try {
|
|
9
|
+
const oldContent = await fs.readFile(resolve(path$1), { encoding: "utf-8" });
|
|
10
|
+
if (oldContent?.toString() === data?.toString()) return;
|
|
11
|
+
} catch (_err) {}
|
|
12
|
+
await fs.outputFile(resolve(path$1), data, { encoding: "utf-8" });
|
|
13
|
+
if (sanity) {
|
|
14
|
+
const savedData = await fs.readFile(resolve(path$1), { encoding: "utf-8" });
|
|
15
|
+
if (savedData?.toString() !== data?.toString()) throw new Error(`Sanity check failed for ${path$1}\n\nData[${data.length}]:\n${data}\n\nSaved[${savedData.length}]:\n${savedData}\n`);
|
|
16
|
+
return savedData;
|
|
17
|
+
}
|
|
18
|
+
return data;
|
|
19
|
+
},
|
|
20
|
+
bun: async (path$1, data, { sanity }) => {
|
|
21
|
+
try {
|
|
22
|
+
await Bun.write(resolve(path$1), data);
|
|
23
|
+
if (sanity) {
|
|
24
|
+
const file = Bun.file(resolve(path$1));
|
|
25
|
+
const savedData = await file.text();
|
|
26
|
+
if (savedData?.toString() !== data?.toString()) throw new Error(`Sanity check failed for ${path$1}\n\nData[${path$1.length}]:\n${path$1}\n\nSaved[${savedData.length}]:\n${savedData}\n`);
|
|
27
|
+
return savedData;
|
|
28
|
+
}
|
|
29
|
+
return data;
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.error(e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, "node");
|
|
35
|
+
async function write(path$1, data, options = {}) {
|
|
36
|
+
if (data.trim() === "") return void 0;
|
|
37
|
+
return writer(path$1, data.trim(), options);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { write };
|
|
42
|
+
//# sourceMappingURL=write-CLTPlucv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-CLTPlucv.js","names":["path: string","data: string","path","options: Options"],"sources":["../src/fs/write.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\ntype Options = { sanity?: boolean }\n\nconst writer = switcher(\n {\n node: async (path: string, data: string, { sanity }: Options) => {\n try {\n const oldContent = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n if (oldContent?.toString() === data?.toString()) {\n return\n }\n } catch (_err) {\n /* empty */\n }\n\n await fs.outputFile(resolve(path), data, { encoding: 'utf-8' })\n\n if (sanity) {\n const savedData = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${data.length}]:\\n${data}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n },\n bun: async (path: string, data: string, { sanity }: Options) => {\n try {\n await Bun.write(resolve(path), data)\n\n if (sanity) {\n const file = Bun.file(resolve(path))\n const savedData = await file.text()\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${path.length}]:\\n${path}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n } catch (e) {\n console.error(e)\n }\n },\n },\n 'node',\n)\n\nexport async function write(path: string, data: string, options: Options = {}): Promise<string | undefined> {\n if (data.trim() === '') {\n return undefined\n }\n return writer(path, data.trim(), options)\n}\n"],"mappings":";;;;;AAOA,MAAM,SAAS,SACb;CACE,MAAM,OAAOA,QAAcC,MAAc,EAAE,QAAiB,KAAK;AAC/D,MAAI;GACF,MAAM,aAAa,MAAM,GAAG,SAAS,QAAQC,OAAK,EAAE,EAClD,UAAU,QACX,EAAC;AACF,OAAI,YAAY,UAAU,KAAK,MAAM,UAAU,CAC7C;EAEH,SAAQ,MAAM,CAEd;EAED,MAAM,GAAG,WAAW,QAAQA,OAAK,EAAE,MAAM,EAAE,UAAU,QAAS,EAAC;AAE/D,MAAI,QAAQ;GACV,MAAM,YAAY,MAAM,GAAG,SAAS,QAAQA,OAAK,EAAE,EACjD,UAAU,QACX,EAAC;AAEF,OAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,CAAC,wBAAwB,EAAEA,OAAK,SAAS,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,UAAU,EAAE,UAAU,OAAO,IAAI,EAAE,UAAU,EAAE,CAAC;AAGpI,UAAO;EACR;AAED,SAAO;CACR;CACD,KAAK,OAAOF,QAAcC,MAAc,EAAE,QAAiB,KAAK;AAC9D,MAAI;GACF,MAAM,IAAI,MAAM,QAAQC,OAAK,EAAE,KAAK;AAEpC,OAAI,QAAQ;IACV,MAAM,OAAO,IAAI,KAAK,QAAQA,OAAK,CAAC;IACpC,MAAM,YAAY,MAAM,KAAK,MAAM;AAEnC,QAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,CAAC,wBAAwB,EAAEA,OAAK,SAAS,EAAEA,OAAK,OAAO,IAAI,EAAEA,OAAK,UAAU,EAAE,UAAU,OAAO,IAAI,EAAE,UAAU,EAAE,CAAC;AAGpI,WAAO;GACR;AAED,UAAO;EACR,SAAQ,GAAG;GACV,QAAQ,MAAM,EAAE;EACjB;CACF;AACF,GACD,OACD;AAED,eAAsB,MAAMF,QAAcC,MAAcE,UAAmB,CAAE,GAA+B;AAC1G,KAAI,KAAK,MAAM,KAAK,GAClB,QAAO;AAET,QAAO,OAAOD,QAAM,KAAK,MAAM,EAAE,QAAQ;AAC1C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
|
+
const node_path = require_chunk.__toESM(require("node:path"));
|
|
3
|
+
const fs_extra = require_chunk.__toESM(require("fs-extra"));
|
|
4
|
+
const js_runtime = require_chunk.__toESM(require("js-runtime"));
|
|
5
|
+
|
|
6
|
+
//#region src/fs/write.ts
|
|
7
|
+
const writer = (0, js_runtime.switcher)({
|
|
8
|
+
node: async (path, data, { sanity }) => {
|
|
9
|
+
try {
|
|
10
|
+
const oldContent = await fs_extra.default.readFile((0, node_path.resolve)(path), { encoding: "utf-8" });
|
|
11
|
+
if (oldContent?.toString() === data?.toString()) return;
|
|
12
|
+
} catch (_err) {}
|
|
13
|
+
await fs_extra.default.outputFile((0, node_path.resolve)(path), data, { encoding: "utf-8" });
|
|
14
|
+
if (sanity) {
|
|
15
|
+
const savedData = await fs_extra.default.readFile((0, node_path.resolve)(path), { encoding: "utf-8" });
|
|
16
|
+
if (savedData?.toString() !== data?.toString()) throw new Error(`Sanity check failed for ${path}\n\nData[${data.length}]:\n${data}\n\nSaved[${savedData.length}]:\n${savedData}\n`);
|
|
17
|
+
return savedData;
|
|
18
|
+
}
|
|
19
|
+
return data;
|
|
20
|
+
},
|
|
21
|
+
bun: async (path, data, { sanity }) => {
|
|
22
|
+
try {
|
|
23
|
+
await Bun.write((0, node_path.resolve)(path), data);
|
|
24
|
+
if (sanity) {
|
|
25
|
+
const file = Bun.file((0, node_path.resolve)(path));
|
|
26
|
+
const savedData = await file.text();
|
|
27
|
+
if (savedData?.toString() !== data?.toString()) throw new Error(`Sanity check failed for ${path}\n\nData[${path.length}]:\n${path}\n\nSaved[${savedData.length}]:\n${savedData}\n`);
|
|
28
|
+
return savedData;
|
|
29
|
+
}
|
|
30
|
+
return data;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
console.error(e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, "node");
|
|
36
|
+
async function write(path, data, options = {}) {
|
|
37
|
+
if (data.trim() === "") return void 0;
|
|
38
|
+
return writer(path, data.trim(), options);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
Object.defineProperty(exports, 'write', {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return write;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=write-l_NzIqyy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-l_NzIqyy.cjs","names":["path: string","data: string","fs","options: Options"],"sources":["../src/fs/write.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\ntype Options = { sanity?: boolean }\n\nconst writer = switcher(\n {\n node: async (path: string, data: string, { sanity }: Options) => {\n try {\n const oldContent = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n if (oldContent?.toString() === data?.toString()) {\n return\n }\n } catch (_err) {\n /* empty */\n }\n\n await fs.outputFile(resolve(path), data, { encoding: 'utf-8' })\n\n if (sanity) {\n const savedData = await fs.readFile(resolve(path), {\n encoding: 'utf-8',\n })\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${data.length}]:\\n${data}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n },\n bun: async (path: string, data: string, { sanity }: Options) => {\n try {\n await Bun.write(resolve(path), data)\n\n if (sanity) {\n const file = Bun.file(resolve(path))\n const savedData = await file.text()\n\n if (savedData?.toString() !== data?.toString()) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${path.length}]:\\n${path}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n\n return savedData\n }\n\n return data\n } catch (e) {\n console.error(e)\n }\n },\n },\n 'node',\n)\n\nexport async function write(path: string, data: string, options: Options = {}): Promise<string | undefined> {\n if (data.trim() === '') {\n return undefined\n }\n return writer(path, data.trim(), options)\n}\n"],"mappings":";;;;;;AAOA,MAAM,kCACJ;CACE,MAAM,OAAOA,MAAcC,MAAc,EAAE,QAAiB,KAAK;AAC/D,MAAI;GACF,MAAM,aAAa,MAAMC,iBAAG,gCAAiB,KAAK,EAAE,EAClD,UAAU,QACX,EAAC;AACF,OAAI,YAAY,UAAU,KAAK,MAAM,UAAU,CAC7C;EAEH,SAAQ,MAAM,CAEd;EAED,MAAMA,iBAAG,kCAAmB,KAAK,EAAE,MAAM,EAAE,UAAU,QAAS,EAAC;AAE/D,MAAI,QAAQ;GACV,MAAM,YAAY,MAAMA,iBAAG,gCAAiB,KAAK,EAAE,EACjD,UAAU,QACX,EAAC;AAEF,OAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,CAAC,wBAAwB,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,UAAU,EAAE,UAAU,OAAO,IAAI,EAAE,UAAU,EAAE,CAAC;AAGpI,UAAO;EACR;AAED,SAAO;CACR;CACD,KAAK,OAAOF,MAAcC,MAAc,EAAE,QAAiB,KAAK;AAC9D,MAAI;GACF,MAAM,IAAI,6BAAc,KAAK,EAAE,KAAK;AAEpC,OAAI,QAAQ;IACV,MAAM,OAAO,IAAI,4BAAa,KAAK,CAAC;IACpC,MAAM,YAAY,MAAM,KAAK,MAAM;AAEnC,QAAI,WAAW,UAAU,KAAK,MAAM,UAAU,CAC5C,OAAM,IAAI,MAAM,CAAC,wBAAwB,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,UAAU,EAAE,UAAU,OAAO,IAAI,EAAE,UAAU,EAAE,CAAC;AAGpI,WAAO;GACR;AAED,UAAO;EACR,SAAQ,GAAG;GACV,QAAQ,MAAM,EAAE;EACjB;CACF;AACF,GACD,OACD;AAED,eAAsB,MAAMD,MAAcC,MAAcE,UAAmB,CAAE,GAA+B;AAC1G,KAAI,KAAK,MAAM,KAAK,GAClB,QAAO;AAET,QAAO,OAAO,MAAM,KAAK,MAAM,EAAE,QAAQ;AAC1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/core",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.3",
|
|
4
4
|
"description": "Core functionality for Kubb's plugin-based code generation system, providing the foundation for transforming OpenAPI specifications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -24,40 +24,33 @@
|
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
26
|
"import": "./dist/index.js",
|
|
27
|
-
"require": "./dist/index.cjs"
|
|
28
|
-
"default": "./dist/index.cjs"
|
|
29
|
-
},
|
|
30
|
-
"./utils": {
|
|
31
|
-
"import": "./dist/utils.js",
|
|
32
|
-
"require": "./dist/utils.cjs",
|
|
33
|
-
"default": "./dist/utils.cjs"
|
|
34
|
-
},
|
|
35
|
-
"./transformers": {
|
|
36
|
-
"import": "./dist/transformers.js",
|
|
37
|
-
"require": "./dist/transformers.cjs",
|
|
38
|
-
"default": "./dist/transformers.cjs"
|
|
27
|
+
"require": "./dist/index.cjs"
|
|
39
28
|
},
|
|
40
29
|
"./fs": {
|
|
41
30
|
"import": "./dist/fs.js",
|
|
42
|
-
"require": "./dist/fs.cjs"
|
|
43
|
-
"default": "./dist/fs.cjs"
|
|
31
|
+
"require": "./dist/fs.cjs"
|
|
44
32
|
},
|
|
45
33
|
"./logger": {
|
|
46
34
|
"import": "./dist/logger.js",
|
|
47
|
-
"require": "./dist/logger.cjs"
|
|
48
|
-
"default": "./dist/logger.cjs"
|
|
35
|
+
"require": "./dist/logger.cjs"
|
|
49
36
|
},
|
|
50
37
|
"./mocks": {
|
|
51
38
|
"import": "./dist/mocks.js",
|
|
52
|
-
"require": "./dist/mocks.cjs"
|
|
53
|
-
|
|
39
|
+
"require": "./dist/mocks.cjs"
|
|
40
|
+
},
|
|
41
|
+
"./transformers": {
|
|
42
|
+
"import": "./dist/transformers.js",
|
|
43
|
+
"require": "./dist/transformers.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./utils": {
|
|
46
|
+
"import": "./dist/utils.js",
|
|
47
|
+
"require": "./dist/utils.cjs"
|
|
54
48
|
},
|
|
55
|
-
"./package.json": "./package.json"
|
|
56
|
-
"./*": "./*"
|
|
49
|
+
"./package.json": "./package.json"
|
|
57
50
|
},
|
|
58
|
-
"main": "dist/index.cjs",
|
|
59
|
-
"module": "dist/index.js",
|
|
60
|
-
"types": "./dist/index.d.
|
|
51
|
+
"main": "./dist/index.cjs",
|
|
52
|
+
"module": "./dist/index.js",
|
|
53
|
+
"types": "./dist/index.d.cts",
|
|
61
54
|
"typesVersions": {
|
|
62
55
|
"*": {
|
|
63
56
|
"utils": [
|
|
@@ -89,15 +82,16 @@
|
|
|
89
82
|
"dependencies": {
|
|
90
83
|
"camelcase": "^8.0.0",
|
|
91
84
|
"find-up": "^7.0.0",
|
|
92
|
-
"fs-extra": "^11.3.
|
|
85
|
+
"fs-extra": "^11.3.1",
|
|
93
86
|
"js-runtime": "^0.0.8",
|
|
94
87
|
"natural-orderby": "^5.0.0",
|
|
95
88
|
"object-hash": "^3.0.0",
|
|
96
|
-
"p-limit": "^
|
|
97
|
-
"
|
|
89
|
+
"p-limit": "^7.0.0",
|
|
90
|
+
"picocolors": "^1.1.1",
|
|
91
|
+
"remeda": "^2.30.0",
|
|
98
92
|
"seedrandom": "^3.0.5",
|
|
99
93
|
"semver": "^7.7.2",
|
|
100
|
-
"@kubb/parser-ts": "3.16.
|
|
94
|
+
"@kubb/parser-ts": "3.16.3"
|
|
101
95
|
},
|
|
102
96
|
"devDependencies": {
|
|
103
97
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -106,10 +100,9 @@
|
|
|
106
100
|
"@types/semver": "^7.7.0",
|
|
107
101
|
"consola": "^3.4.2",
|
|
108
102
|
"prettier": "^3.6.2",
|
|
109
|
-
"
|
|
110
|
-
"typescript": "^5.
|
|
111
|
-
"@kubb/config-ts": "3.16.
|
|
112
|
-
"@kubb/config-tsup": "3.16.1"
|
|
103
|
+
"tsdown": "^0.14.1",
|
|
104
|
+
"typescript": "^5.9.2",
|
|
105
|
+
"@kubb/config-ts": "3.16.3"
|
|
113
106
|
},
|
|
114
107
|
"engines": {
|
|
115
108
|
"node": ">=20"
|
|
@@ -119,13 +112,13 @@
|
|
|
119
112
|
"registry": "https://registry.npmjs.org/"
|
|
120
113
|
},
|
|
121
114
|
"scripts": {
|
|
122
|
-
"build": "
|
|
115
|
+
"build": "tsdown",
|
|
123
116
|
"clean": "npx rimraf ./dist",
|
|
124
117
|
"lint": "bun biome lint .",
|
|
125
|
-
"lint:fix": "bun biome lint--fix --unsafe .",
|
|
118
|
+
"lint:fix": "bun biome lint --fix --unsafe .",
|
|
126
119
|
"release": "pnpm publish --no-git-check",
|
|
127
120
|
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
|
|
128
|
-
"start": "
|
|
121
|
+
"start": "tsdown --watch",
|
|
129
122
|
"test": "vitest --passWithNoTests",
|
|
130
123
|
"typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
|
|
131
124
|
}
|
package/src/BarrelManager.ts
CHANGED
package/src/PromiseManager.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { hookFirst, hookParallel, hookSeq } from './utils/executeStrategies.ts'
|
|
2
|
-
|
|
3
|
-
import type { PossiblePromise } from './utils/types.ts'
|
|
4
1
|
import type { Strategy, StrategySwitch } from './utils/executeStrategies.ts'
|
|
2
|
+
import { hookFirst, hookParallel, hookSeq } from './utils/executeStrategies.ts'
|
|
5
3
|
|
|
6
4
|
type PromiseFunc<T = unknown, T2 = never> = () => T2 extends never ? Promise<T> : Promise<T> | T2
|
|
7
5
|
|
|
@@ -39,10 +37,6 @@ export class PromiseManager<TState = any> {
|
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
export function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {
|
|
43
|
-
return !!result && typeof (result as Promise<unknown>)?.then === 'function'
|
|
44
|
-
}
|
|
45
|
-
|
|
46
40
|
export function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {
|
|
47
41
|
return result.status === 'rejected'
|
|
48
42
|
}
|
package/src/build.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { clean, exists, getRelativePath } from './fs/index.ts'
|
|
2
|
-
import type { KubbFile } from './fs/index.ts'
|
|
3
|
-
import { PluginManager } from './PluginManager.ts'
|
|
4
|
-
import { isInputPath } from './config.ts'
|
|
5
|
-
import { createLogger } from './logger.ts'
|
|
6
|
-
import { URLPath } from './utils/URLPath.ts'
|
|
7
|
-
|
|
8
1
|
import { join, resolve } from 'node:path'
|
|
2
|
+
import pc from 'picocolors'
|
|
3
|
+
import { isDeepEqual } from 'remeda'
|
|
4
|
+
import { isInputPath } from './config.ts'
|
|
5
|
+
import type { KubbFile } from './fs/index.ts'
|
|
6
|
+
import { clean, exists, getRelativePath } from './fs/index.ts'
|
|
9
7
|
import type { Logger } from './logger.ts'
|
|
8
|
+
import { createLogger } from './logger.ts'
|
|
9
|
+
import { PluginManager } from './PluginManager.ts'
|
|
10
10
|
import type { Config, Output, UserConfig } from './types.ts'
|
|
11
|
-
import
|
|
12
|
-
import { colors } from 'consola/utils'
|
|
13
|
-
import { isDeepEqual } from 'remeda'
|
|
11
|
+
import { URLPath } from './utils/URLPath.ts'
|
|
14
12
|
|
|
15
13
|
type BuildOptions = {
|
|
16
14
|
config: UserConfig
|
|
@@ -38,7 +36,7 @@ export async function setup(options: BuildOptions): Promise<PluginManager> {
|
|
|
38
36
|
const { config: userConfig, logger = createLogger() } = options
|
|
39
37
|
|
|
40
38
|
if (Array.isArray(userConfig.input)) {
|
|
41
|
-
|
|
39
|
+
console.warn(pc.yellow('This feature is still under development — use with caution'))
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
try {
|