@kubb/core 3.0.0-alpha.19 → 3.0.0-alpha.20
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-B4cpHcmd.d.ts → FileManager-DQtWE_rp.d.ts} +0 -2
- package/dist/{FileManager-WLbm4oGD.d.cts → FileManager-qZTz0oZl.d.cts} +0 -2
- package/dist/{chunk-GTJDREOE.cjs → chunk-253UUWI5.cjs} +4 -4
- package/dist/{chunk-GTJDREOE.cjs.map → chunk-253UUWI5.cjs.map} +1 -1
- package/dist/{chunk-6VRWO4MS.cjs → chunk-7O42P6ET.cjs} +8 -8
- package/dist/{chunk-6VRWO4MS.cjs.map → chunk-7O42P6ET.cjs.map} +1 -1
- package/dist/{chunk-L2EWYS6N.cjs → chunk-HRJU3XOH.cjs} +10 -10
- package/dist/{chunk-L2EWYS6N.cjs.map → chunk-HRJU3XOH.cjs.map} +1 -1
- package/dist/{chunk-2QXTZSV2.cjs → chunk-OAGN4FY6.cjs} +4 -4
- package/dist/{chunk-2QXTZSV2.cjs.map → chunk-OAGN4FY6.cjs.map} +1 -1
- package/dist/{chunk-YLNKHIBG.cjs → chunk-P37BU33L.cjs} +33 -33
- package/dist/{chunk-YLNKHIBG.cjs.map → chunk-P37BU33L.cjs.map} +1 -1
- package/dist/{chunk-AJJTLSA2.cjs → chunk-U3S2ZR6C.cjs} +6 -6
- package/dist/{chunk-AJJTLSA2.cjs.map → chunk-U3S2ZR6C.cjs.map} +1 -1
- package/dist/index.cjs +38 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +7 -7
- package/dist/mocks.cjs +9 -9
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/{prompt-PFSNR2XA.cjs → prompt-TK4KVZVL.cjs} +62 -62
- package/dist/{prompt-PFSNR2XA.cjs.map → prompt-TK4KVZVL.cjs.map} +1 -1
- package/dist/transformers.cjs +23 -23
- package/dist/utils.cjs +17 -17
- package/package.json +6 -6
- package/src/build.ts +5 -4
- package/src/config.ts +1 -1
- package/src/types.ts +0 -2
package/dist/transformers.cjs
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunk253UUWI5_cjs = require('./chunk-253UUWI5.cjs');
|
|
6
|
+
var chunkU3S2ZR6C_cjs = require('./chunk-U3S2ZR6C.cjs');
|
|
7
|
+
var chunkOAGN4FY6_cjs = require('./chunk-OAGN4FY6.cjs');
|
|
8
8
|
var remeda = require('remeda');
|
|
9
9
|
|
|
10
10
|
// src/transformers/index.ts
|
|
11
|
-
|
|
11
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
12
12
|
|
|
13
13
|
// src/transformers/combineCodes.ts
|
|
14
|
-
|
|
14
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
15
15
|
function combineCodes(codes) {
|
|
16
16
|
return codes.join("\n");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// src/transformers/createJSDocBlockText.ts
|
|
20
|
-
|
|
20
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
21
21
|
function createJSDocBlockText({ comments }) {
|
|
22
22
|
const filteredComments = comments.filter(Boolean);
|
|
23
23
|
if (!filteredComments.length) {
|
|
@@ -29,7 +29,7 @@ function createJSDocBlockText({ comments }) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// src/transformers/escape.ts
|
|
32
|
-
|
|
32
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
33
33
|
function escape(text) {
|
|
34
34
|
return text ? text.replaceAll("`", "\\`") : "";
|
|
35
35
|
}
|
|
@@ -55,13 +55,13 @@ function jsStringEscape(input) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// src/transformers/indent.ts
|
|
58
|
-
|
|
58
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
59
59
|
function createIndent(size) {
|
|
60
60
|
return Array.from({ length: size + 1 }).join(" ");
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// src/transformers/nameSorter.ts
|
|
64
|
-
|
|
64
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
65
65
|
function nameSorter(a, b) {
|
|
66
66
|
if (a.name < b.name) {
|
|
67
67
|
return -1;
|
|
@@ -73,7 +73,7 @@ function nameSorter(a, b) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// src/transformers/searchAndReplace.ts
|
|
76
|
-
|
|
76
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
77
77
|
function searchAndReplace(options) {
|
|
78
78
|
const { text, replaceBy, prefix = "", key } = options;
|
|
79
79
|
const searchValues = options.searchValues?.(prefix, key) || [
|
|
@@ -91,10 +91,10 @@ function searchAndReplace(options) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// src/transformers/stringify.ts
|
|
94
|
-
|
|
94
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
95
95
|
|
|
96
96
|
// src/transformers/trim.ts
|
|
97
|
-
|
|
97
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
98
98
|
function trim(text) {
|
|
99
99
|
return text.replaceAll(/\n/g, "").trim();
|
|
100
100
|
}
|
|
@@ -131,7 +131,7 @@ function stringifyObject(value) {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
// src/transformers/toRegExp.ts
|
|
134
|
-
|
|
134
|
+
chunkOAGN4FY6_cjs.init_cjs_shims();
|
|
135
135
|
function stringToRegex(text) {
|
|
136
136
|
const isStartWithSlash = text.startsWith("/");
|
|
137
137
|
const isEndWithSlash = text.endsWith("/");
|
|
@@ -155,7 +155,7 @@ var transformers_default = {
|
|
|
155
155
|
escape,
|
|
156
156
|
jsStringEscape,
|
|
157
157
|
createIndent,
|
|
158
|
-
transformReservedWord:
|
|
158
|
+
transformReservedWord: chunk253UUWI5_cjs.transformReservedWord,
|
|
159
159
|
nameSorter,
|
|
160
160
|
searchAndReplace,
|
|
161
161
|
stringify,
|
|
@@ -167,32 +167,32 @@ var transformers_default = {
|
|
|
167
167
|
JSDoc: {
|
|
168
168
|
createJSDocBlockText
|
|
169
169
|
},
|
|
170
|
-
orderBy:
|
|
170
|
+
orderBy: chunkU3S2ZR6C_cjs.orderBy,
|
|
171
171
|
merge: remeda.merge,
|
|
172
|
-
camelCase:
|
|
173
|
-
pascalCase:
|
|
174
|
-
pathCase:
|
|
172
|
+
camelCase: chunkU3S2ZR6C_cjs.camelCase,
|
|
173
|
+
pascalCase: chunkU3S2ZR6C_cjs.pascalCase,
|
|
174
|
+
pathCase: chunkU3S2ZR6C_cjs.pathCase
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
Object.defineProperty(exports, "transformReservedWord", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunk253UUWI5_cjs.transformReservedWord; }
|
|
180
180
|
});
|
|
181
181
|
Object.defineProperty(exports, "camelCase", {
|
|
182
182
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunkU3S2ZR6C_cjs.camelCase; }
|
|
184
184
|
});
|
|
185
185
|
Object.defineProperty(exports, "orderBy", {
|
|
186
186
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunkU3S2ZR6C_cjs.orderBy; }
|
|
188
188
|
});
|
|
189
189
|
Object.defineProperty(exports, "pascalCase", {
|
|
190
190
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunkU3S2ZR6C_cjs.pascalCase; }
|
|
192
192
|
});
|
|
193
193
|
Object.defineProperty(exports, "pathCase", {
|
|
194
194
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunkU3S2ZR6C_cjs.pathCase; }
|
|
196
196
|
});
|
|
197
197
|
Object.defineProperty(exports, "merge", {
|
|
198
198
|
enumerable: true,
|
package/dist/utils.cjs
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkP37BU33L_cjs = require('./chunk-P37BU33L.cjs');
|
|
4
|
+
require('./chunk-U3S2ZR6C.cjs');
|
|
5
|
+
require('./chunk-OAGN4FY6.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "FunctionParams", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkP37BU33L_cjs.FunctionParams; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "URLPath", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkP37BU33L_cjs.URLPath; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createFile", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkP37BU33L_cjs.createFile; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "createFileExport", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkP37BU33L_cjs.createFileExport; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "createFileImport", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkP37BU33L_cjs.createFileImport; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "createFileParser", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkP37BU33L_cjs.createFileParser; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "getFileParser", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkP37BU33L_cjs.getFileParser; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "getUniqueName", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkP37BU33L_cjs.getUniqueName; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "isPromise", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkP37BU33L_cjs.isPromise; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "isPromiseFulfilledResult", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkP37BU33L_cjs.isPromiseFulfilledResult; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "isPromiseRejectedResult", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkP37BU33L_cjs.isPromiseRejectedResult; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "renderTemplate", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkP37BU33L_cjs.renderTemplate; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "setUniqueName", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkP37BU33L_cjs.setUniqueName; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "timeout", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkP37BU33L_cjs.timeout; }
|
|
64
64
|
});
|
|
65
65
|
//# sourceMappingURL=utils.cjs.map
|
|
66
66
|
//# sourceMappingURL=utils.cjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.20",
|
|
4
4
|
"description": "Generator core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"remeda": "^2.12.1",
|
|
84
84
|
"seedrandom": "^3.0.5",
|
|
85
85
|
"semver": "^7.6.3",
|
|
86
|
-
"@kubb/fs": "3.0.0-alpha.
|
|
87
|
-
"@kubb/parser-ts": "3.0.0-alpha.
|
|
88
|
-
"@kubb/types": "3.0.0-alpha.
|
|
86
|
+
"@kubb/fs": "3.0.0-alpha.20",
|
|
87
|
+
"@kubb/parser-ts": "3.0.0-alpha.20",
|
|
88
|
+
"@kubb/types": "3.0.0-alpha.20"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@types/object-hash": "^3.0.6",
|
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
"tinyrainbow": "^1.2.0",
|
|
97
97
|
"tsup": "^8.2.4",
|
|
98
98
|
"typescript": "^5.6.2",
|
|
99
|
-
"@kubb/config-ts": "3.0.0-alpha.
|
|
100
|
-
"@kubb/config-tsup": "3.0.0-alpha.
|
|
99
|
+
"@kubb/config-ts": "3.0.0-alpha.20",
|
|
100
|
+
"@kubb/config-tsup": "3.0.0-alpha.20"
|
|
101
101
|
},
|
|
102
102
|
"engines": {
|
|
103
103
|
"node": ">=20"
|
package/src/build.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { URLPath } from './utils/URLPath.ts'
|
|
|
9
9
|
import { join, resolve } from 'node:path'
|
|
10
10
|
import { getRelativePath } from '@kubb/fs'
|
|
11
11
|
import type { Logger } from './logger.ts'
|
|
12
|
-
import type { PluginContext } from './types.ts'
|
|
12
|
+
import type { Output, PluginContext } from './types.ts'
|
|
13
13
|
|
|
14
14
|
type BuildOptions = {
|
|
15
15
|
config: PluginContext['config']
|
|
@@ -108,16 +108,17 @@ export async function safeBuild(options: BuildOptions): Promise<BuildOutput> {
|
|
|
108
108
|
const meta = file.meta as any
|
|
109
109
|
return item.key === meta?.pluginKey
|
|
110
110
|
})
|
|
111
|
+
const options = (plugin?.options as { output?: Output }) ?? {}
|
|
111
112
|
|
|
112
|
-
if (
|
|
113
|
+
if (options.output?.exportType === false) {
|
|
113
114
|
return undefined
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
if (FileManager.getMode(
|
|
117
|
+
if (FileManager.getMode(options.output?.path) === 'single') {
|
|
117
118
|
return undefined
|
|
118
119
|
}
|
|
119
120
|
return {
|
|
120
|
-
name: options.
|
|
121
|
+
name: options.output?.exportType === 'barrel' ? undefined : [source.name],
|
|
121
122
|
path: getRelativePath(rootPath, file.path),
|
|
122
123
|
isTypeOnly: source.isTypeOnly,
|
|
123
124
|
} as KubbFile.Export
|
package/src/config.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -144,7 +144,6 @@ export type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOpti
|
|
|
144
144
|
* @example @kubb/typescript
|
|
145
145
|
*/
|
|
146
146
|
name: TOptions['name']
|
|
147
|
-
output?: Output
|
|
148
147
|
/**
|
|
149
148
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
150
149
|
*/
|
|
@@ -181,7 +180,6 @@ export type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
181
180
|
* @private
|
|
182
181
|
*/
|
|
183
182
|
key: TOptions['key']
|
|
184
|
-
output?: Output
|
|
185
183
|
/**
|
|
186
184
|
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
|
|
187
185
|
* Can be used to validate dependent plugins.
|