@kubb/core 3.0.0-beta.3 → 3.0.0-beta.5
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-C9aZTwst.d.ts → FileManager-Cn8nSj1H.d.ts} +17 -16
- package/dist/{FileManager-ibNoWwHN.d.cts → FileManager-DKZ30qz_.d.cts} +17 -16
- package/dist/{chunk-KXT7F2WS.cjs → chunk-2JGRDU6N.cjs} +8 -8
- package/dist/{chunk-KXT7F2WS.cjs.map → chunk-2JGRDU6N.cjs.map} +1 -1
- package/dist/{chunk-SQBOUPF4.cjs → chunk-E3M4QKGT.cjs} +33 -33
- package/dist/{chunk-SQBOUPF4.cjs.map → chunk-E3M4QKGT.cjs.map} +1 -1
- package/dist/{chunk-MVWRVN66.cjs → chunk-LTK4CURY.cjs} +10 -10
- package/dist/{chunk-MVWRVN66.cjs.map → chunk-LTK4CURY.cjs.map} +1 -1
- package/dist/{chunk-2TOEDZ2U.cjs → chunk-PAAEVG63.cjs} +4 -4
- package/dist/{chunk-2TOEDZ2U.cjs.map → chunk-PAAEVG63.cjs.map} +1 -1
- package/dist/{chunk-72BWXKV4.cjs → chunk-YEWLGG6A.cjs} +4 -4
- package/dist/{chunk-72BWXKV4.cjs.map → chunk-YEWLGG6A.cjs.map} +1 -1
- package/dist/{chunk-4GJEWGQN.cjs → chunk-ZTR3NNAO.cjs} +6 -6
- package/dist/{chunk-4GJEWGQN.cjs.map → chunk-ZTR3NNAO.cjs.map} +1 -1
- package/dist/index.cjs +34 -34
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- 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-FODZPXQF.cjs → prompt-NXAVVYGK.cjs} +62 -62
- package/dist/{prompt-FODZPXQF.cjs.map → prompt-NXAVVYGK.cjs.map} +1 -1
- package/dist/transformers.cjs +23 -23
- package/dist/utils.cjs +17 -17
- package/package.json +6 -6
- package/src/types.ts +17 -18
|
@@ -111,34 +111,34 @@ declare class PluginManager {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
* Config used in `kubb.config.
|
|
114
|
+
* Config used in `kubb.config.ts`
|
|
115
115
|
*
|
|
116
|
-
* @example
|
|
116
|
+
* @example
|
|
117
|
+
* import { defineConfig } from '@kubb/core'
|
|
117
118
|
* export default defineConfig({
|
|
118
119
|
* ...
|
|
119
120
|
* })
|
|
120
121
|
*/
|
|
121
122
|
type UserConfig = Omit<Config, 'root' | 'plugins'> & {
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
-
* the location of the config file itself.
|
|
124
|
+
* The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.
|
|
125
125
|
* @default process.cwd()
|
|
126
126
|
*/
|
|
127
127
|
root?: string;
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
129
|
+
* An array of Kubb plugins used for generation. Each plugin may have additional configurable options (defined within the plugin itself). If a plugin relies on another plugin, an error will occur if the required dependency is missing. Refer to “pre” for more details.
|
|
130
130
|
*/
|
|
131
131
|
plugins?: Array<Omit<UnknownUserPlugin, 'context'>>;
|
|
132
132
|
};
|
|
133
133
|
type InputPath = {
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
135
|
+
* Specify your Swagger/OpenAPI file, either as an absolute path or a path relative to the root.
|
|
136
136
|
*/
|
|
137
137
|
path: string;
|
|
138
138
|
};
|
|
139
139
|
type InputData = {
|
|
140
140
|
/**
|
|
141
|
-
* `string` or `object`
|
|
141
|
+
* A `string` or `object` that contains your Swagger/OpenAPI data.
|
|
142
142
|
*/
|
|
143
143
|
data: string | unknown;
|
|
144
144
|
};
|
|
@@ -149,21 +149,22 @@ type BarrelType = 'all' | 'named';
|
|
|
149
149
|
*/
|
|
150
150
|
type Config<TInput = Input> = {
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* The name to display in the CLI output.
|
|
153
153
|
*/
|
|
154
154
|
name?: string;
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
156
|
+
* The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.
|
|
157
157
|
* @default process.cwd()
|
|
158
158
|
*/
|
|
159
159
|
root: string;
|
|
160
160
|
/**
|
|
161
|
-
* You can use `input.path` or `input.data
|
|
161
|
+
* You can use either `input.path` or `input.data`, depending on your specific needs.
|
|
162
162
|
*/
|
|
163
163
|
input: TInput;
|
|
164
164
|
output: {
|
|
165
165
|
/**
|
|
166
|
-
* The path where all generated files will be exported.
|
|
166
|
+
* The path where all generated files will be exported.
|
|
167
|
+
* This can be an absolute path or a path relative to the specified root option.
|
|
167
168
|
*/
|
|
168
169
|
path: string;
|
|
169
170
|
/**
|
|
@@ -176,13 +177,13 @@ type Config<TInput = Input> = {
|
|
|
176
177
|
*/
|
|
177
178
|
write?: boolean;
|
|
178
179
|
/**
|
|
179
|
-
* Override the extension to the generated imports and exports, by default
|
|
180
|
-
* @default
|
|
180
|
+
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
181
|
+
* @default { '.ts': '.ts'}
|
|
181
182
|
*/
|
|
182
183
|
extension?: Record<KubbFile.Extname, KubbFile.Extname>;
|
|
183
184
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @default
|
|
185
|
+
* Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
|
|
186
|
+
* @default 'named'
|
|
186
187
|
*/
|
|
187
188
|
barrelType?: BarrelType | false;
|
|
188
189
|
};
|
|
@@ -368,7 +369,7 @@ type Output = {
|
|
|
368
369
|
path: string;
|
|
369
370
|
/**
|
|
370
371
|
* Define what needs to be exported, here you can also disable the export of barrel files
|
|
371
|
-
* @default
|
|
372
|
+
* @default 'named'
|
|
372
373
|
*/
|
|
373
374
|
barrelType?: BarrelType | false;
|
|
374
375
|
/**
|
|
@@ -111,34 +111,34 @@ declare class PluginManager {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
* Config used in `kubb.config.
|
|
114
|
+
* Config used in `kubb.config.ts`
|
|
115
115
|
*
|
|
116
|
-
* @example
|
|
116
|
+
* @example
|
|
117
|
+
* import { defineConfig } from '@kubb/core'
|
|
117
118
|
* export default defineConfig({
|
|
118
119
|
* ...
|
|
119
120
|
* })
|
|
120
121
|
*/
|
|
121
122
|
type UserConfig = Omit<Config, 'root' | 'plugins'> & {
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
-
* the location of the config file itself.
|
|
124
|
+
* The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.
|
|
125
125
|
* @default process.cwd()
|
|
126
126
|
*/
|
|
127
127
|
root?: string;
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
129
|
+
* An array of Kubb plugins used for generation. Each plugin may have additional configurable options (defined within the plugin itself). If a plugin relies on another plugin, an error will occur if the required dependency is missing. Refer to “pre” for more details.
|
|
130
130
|
*/
|
|
131
131
|
plugins?: Array<Omit<UnknownUserPlugin, 'context'>>;
|
|
132
132
|
};
|
|
133
133
|
type InputPath = {
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
135
|
+
* Specify your Swagger/OpenAPI file, either as an absolute path or a path relative to the root.
|
|
136
136
|
*/
|
|
137
137
|
path: string;
|
|
138
138
|
};
|
|
139
139
|
type InputData = {
|
|
140
140
|
/**
|
|
141
|
-
* `string` or `object`
|
|
141
|
+
* A `string` or `object` that contains your Swagger/OpenAPI data.
|
|
142
142
|
*/
|
|
143
143
|
data: string | unknown;
|
|
144
144
|
};
|
|
@@ -149,21 +149,22 @@ type BarrelType = 'all' | 'named';
|
|
|
149
149
|
*/
|
|
150
150
|
type Config<TInput = Input> = {
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* The name to display in the CLI output.
|
|
153
153
|
*/
|
|
154
154
|
name?: string;
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
156
|
+
* The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.
|
|
157
157
|
* @default process.cwd()
|
|
158
158
|
*/
|
|
159
159
|
root: string;
|
|
160
160
|
/**
|
|
161
|
-
* You can use `input.path` or `input.data
|
|
161
|
+
* You can use either `input.path` or `input.data`, depending on your specific needs.
|
|
162
162
|
*/
|
|
163
163
|
input: TInput;
|
|
164
164
|
output: {
|
|
165
165
|
/**
|
|
166
|
-
* The path where all generated files will be exported.
|
|
166
|
+
* The path where all generated files will be exported.
|
|
167
|
+
* This can be an absolute path or a path relative to the specified root option.
|
|
167
168
|
*/
|
|
168
169
|
path: string;
|
|
169
170
|
/**
|
|
@@ -176,13 +177,13 @@ type Config<TInput = Input> = {
|
|
|
176
177
|
*/
|
|
177
178
|
write?: boolean;
|
|
178
179
|
/**
|
|
179
|
-
* Override the extension to the generated imports and exports, by default
|
|
180
|
-
* @default
|
|
180
|
+
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
181
|
+
* @default { '.ts': '.ts'}
|
|
181
182
|
*/
|
|
182
183
|
extension?: Record<KubbFile.Extname, KubbFile.Extname>;
|
|
183
184
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @default
|
|
185
|
+
* Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
|
|
186
|
+
* @default 'named'
|
|
186
187
|
*/
|
|
187
188
|
barrelType?: BarrelType | false;
|
|
188
189
|
};
|
|
@@ -368,7 +369,7 @@ type Output = {
|
|
|
368
369
|
path: string;
|
|
369
370
|
/**
|
|
370
371
|
* Define what needs to be exported, here you can also disable the export of barrel files
|
|
371
|
-
* @default
|
|
372
|
+
* @default 'named'
|
|
372
373
|
*/
|
|
373
374
|
barrelType?: BarrelType | false;
|
|
374
375
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYEWLGG6A_cjs = require('./chunk-YEWLGG6A.cjs');
|
|
4
4
|
var util = require('util');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var tty = require('tty');
|
|
@@ -30,7 +30,7 @@ var tty__namespace = /*#__PURE__*/_interopNamespace(tty);
|
|
|
30
30
|
var process$1__default = /*#__PURE__*/_interopDefault(process$1);
|
|
31
31
|
|
|
32
32
|
// ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/core.mjs
|
|
33
|
-
|
|
33
|
+
chunkYEWLGG6A_cjs.init_cjs_shims();
|
|
34
34
|
var LogLevels = {
|
|
35
35
|
silent: Number.NEGATIVE_INFINITY,
|
|
36
36
|
fatal: 0,
|
|
@@ -433,7 +433,7 @@ function createConsola(options = {}) {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
// ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.06ad8a64.mjs
|
|
436
|
-
|
|
436
|
+
chunkYEWLGG6A_cjs.init_cjs_shims();
|
|
437
437
|
function parseStack(stack) {
|
|
438
438
|
const cwd = process.cwd() + path.sep;
|
|
439
439
|
const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
@@ -491,7 +491,7 @@ var BasicReporter = class {
|
|
|
491
491
|
};
|
|
492
492
|
|
|
493
493
|
// ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/utils.mjs
|
|
494
|
-
|
|
494
|
+
chunkYEWLGG6A_cjs.init_cjs_shims();
|
|
495
495
|
var {
|
|
496
496
|
env = {},
|
|
497
497
|
argv = [],
|
|
@@ -723,7 +723,7 @@ function box(text, _opts = {}) {
|
|
|
723
723
|
}
|
|
724
724
|
|
|
725
725
|
// ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs
|
|
726
|
-
|
|
726
|
+
chunkYEWLGG6A_cjs.init_cjs_shims();
|
|
727
727
|
var providers = [
|
|
728
728
|
["APPVEYOR"],
|
|
729
729
|
["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
|
|
@@ -1061,7 +1061,7 @@ function createConsola2(options = {}) {
|
|
|
1061
1061
|
defaults: { level },
|
|
1062
1062
|
stdout: process.stdout,
|
|
1063
1063
|
stderr: process.stderr,
|
|
1064
|
-
prompt: (...args) => import('./prompt-
|
|
1064
|
+
prompt: (...args) => import('./prompt-NXAVVYGK.cjs').then((m) => m.prompt(...args)),
|
|
1065
1065
|
reporters: options.reporters || [
|
|
1066
1066
|
options.fancy ?? !(isCI2 || isTest) ? new FancyReporter() : new BasicReporter()
|
|
1067
1067
|
],
|
|
@@ -1084,5 +1084,5 @@ exports.colors = colors;
|
|
|
1084
1084
|
exports.createConsola = createConsola2;
|
|
1085
1085
|
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
1086
1086
|
exports.isUnicodeSupported = isUnicodeSupported;
|
|
1087
|
-
//# sourceMappingURL=chunk-
|
|
1088
|
-
//# sourceMappingURL=chunk-
|
|
1087
|
+
//# sourceMappingURL=chunk-2JGRDU6N.cjs.map
|
|
1088
|
+
//# sourceMappingURL=chunk-2JGRDU6N.cjs.map
|