@kubb/core 3.0.0-beta.3 → 3.0.0-beta.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.
@@ -111,34 +111,34 @@ declare class PluginManager {
111
111
  }
112
112
 
113
113
  /**
114
- * Config used in `kubb.config.js`
114
+ * Config used in `kubb.config.ts`
115
115
  *
116
- * @example import { defineConfig } from '@kubb/core'
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
- * Project root directory. Can be an absolute path, or a path relative from
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
- * Plugin type should be a Kubb plugin
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
- * Define your Swagger/OpenAPI file. This can be an absolute path or a path relative to the `root`.
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` containing your Swagger/OpenAPI data.
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
- * Optional config name to show in CLI output
152
+ * The name to display in the CLI output.
153
153
  */
154
154
  name?: string;
155
155
  /**
156
- * Project root directory. This can be an absolute path or a path relative to the location of your `kubb.config.ts` file.
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` depending on the needs you have.
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. This can be an absolute path or a path relative to the specified root option.
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 the plugin will add an extension
180
- * @default `{ '.ts': '.ts'}`
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
- * Define what needs to exported, here you can also disable the export of barrel files.
185
- * @default `'named'`
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 `'named'`
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.js`
114
+ * Config used in `kubb.config.ts`
115
115
  *
116
- * @example import { defineConfig } from '@kubb/core'
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
- * Project root directory. Can be an absolute path, or a path relative from
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
- * Plugin type should be a Kubb plugin
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
- * Define your Swagger/OpenAPI file. This can be an absolute path or a path relative to the `root`.
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` containing your Swagger/OpenAPI data.
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
- * Optional config name to show in CLI output
152
+ * The name to display in the CLI output.
153
153
  */
154
154
  name?: string;
155
155
  /**
156
- * Project root directory. This can be an absolute path or a path relative to the location of your `kubb.config.ts` file.
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` depending on the needs you have.
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. This can be an absolute path or a path relative to the specified root option.
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 the plugin will add an extension
180
- * @default `{ '.ts': '.ts'}`
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
- * Define what needs to exported, here you can also disable the export of barrel files.
185
- * @default `'named'`
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 `'named'`
372
+ * @default 'named'
372
373
  */
373
374
  barrelType?: BarrelType | false;
374
375
  /**
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-ibNoWwHN.cjs';
2
- export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-ibNoWwHN.cjs';
1
+ import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-DKZ30qz_.cjs';
2
+ export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-DKZ30qz_.cjs';
3
3
  import { L as Logger } from './logger-DvbHXjIO.cjs';
4
4
  import { PossiblePromise } from '@kubb/types';
5
5
  import '@kubb/fs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-C9aZTwst.js';
2
- export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-C9aZTwst.js';
1
+ import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-Cn8nSj1H.js';
2
+ export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-Cn8nSj1H.js';
3
3
  import { L as Logger } from './logger-DvbHXjIO.js';
4
4
  import { PossiblePromise } from '@kubb/types';
5
5
  import '@kubb/fs';
package/dist/mocks.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ResolvedFile, File } from '@kubb/fs/types';
2
- import { a as PluginManager } from './FileManager-ibNoWwHN.cjs';
2
+ import { a as PluginManager } from './FileManager-DKZ30qz_.cjs';
3
3
  import { L as Logger } from './logger-DvbHXjIO.cjs';
4
4
  import '@kubb/fs';
5
5
  import '@kubb/types';
package/dist/mocks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ResolvedFile, File } from '@kubb/fs/types';
2
- import { a as PluginManager } from './FileManager-C9aZTwst.js';
2
+ import { a as PluginManager } from './FileManager-Cn8nSj1H.js';
3
3
  import { L as Logger } from './logger-DvbHXjIO.js';
4
4
  import '@kubb/fs';
5
5
  import '@kubb/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Generator core",
5
5
  "keywords": [
6
6
  "typescript",
@@ -83,9 +83,9 @@
83
83
  "remeda": "^2.14.0",
84
84
  "seedrandom": "^3.0.5",
85
85
  "semver": "^7.6.3",
86
- "@kubb/fs": "3.0.0-beta.3",
87
- "@kubb/parser-ts": "3.0.0-beta.3",
88
- "@kubb/types": "3.0.0-beta.3"
86
+ "@kubb/fs": "3.0.0-beta.4",
87
+ "@kubb/parser-ts": "3.0.0-beta.4",
88
+ "@kubb/types": "3.0.0-beta.4"
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.3.0",
98
98
  "typescript": "^5.6.2",
99
- "@kubb/config-ts": "3.0.0-beta.3",
100
- "@kubb/config-tsup": "3.0.0-beta.3"
99
+ "@kubb/config-ts": "3.0.0-beta.4",
100
+ "@kubb/config-tsup": "3.0.0-beta.4"
101
101
  },
102
102
  "engines": {
103
103
  "node": ">=20"
package/src/types.ts CHANGED
@@ -4,39 +4,37 @@ import type { FileManager } from './FileManager.ts'
4
4
  import type { PluginManager } from './PluginManager.ts'
5
5
  import type { Logger } from './logger.ts'
6
6
 
7
- // config
8
-
9
7
  /**
10
- * Config used in `kubb.config.js`
8
+ * Config used in `kubb.config.ts`
11
9
  *
12
- * @example import { defineConfig } from '@kubb/core'
10
+ * @example
11
+ * import { defineConfig } from '@kubb/core'
13
12
  * export default defineConfig({
14
13
  * ...
15
14
  * })
16
15
  */
17
16
  export type UserConfig = Omit<Config, 'root' | 'plugins'> & {
18
17
  /**
19
- * Project root directory. Can be an absolute path, or a path relative from
20
- * the location of the config file itself.
18
+ * The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.
21
19
  * @default process.cwd()
22
20
  */
23
21
  root?: string
24
22
  /**
25
- * Plugin type should be a Kubb plugin
23
+ * 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.
26
24
  */
27
25
  plugins?: Array<Omit<UnknownUserPlugin, 'context'>>
28
26
  }
29
27
 
30
28
  export type InputPath = {
31
29
  /**
32
- * Define your Swagger/OpenAPI file. This can be an absolute path or a path relative to the `root`.
30
+ * Specify your Swagger/OpenAPI file, either as an absolute path or a path relative to the root.
33
31
  */
34
32
  path: string
35
33
  }
36
34
 
37
35
  export type InputData = {
38
36
  /**
39
- * `string` or `object` containing your Swagger/OpenAPI data.
37
+ * A `string` or `object` that contains your Swagger/OpenAPI data.
40
38
  */
41
39
  data: string | unknown
42
40
  }
@@ -50,21 +48,22 @@ export type BarrelType = 'all' | 'named'
50
48
  */
51
49
  export type Config<TInput = Input> = {
52
50
  /**
53
- * Optional config name to show in CLI output
51
+ * The name to display in the CLI output.
54
52
  */
55
53
  name?: string
56
54
  /**
57
- * Project root directory. This can be an absolute path or a path relative to the location of your `kubb.config.ts` file.
55
+ * The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.
58
56
  * @default process.cwd()
59
57
  */
60
58
  root: string
61
59
  /**
62
- * You can use `input.path` or `input.data` depending on the needs you have.
60
+ * You can use either `input.path` or `input.data`, depending on your specific needs.
63
61
  */
64
62
  input: TInput
65
63
  output: {
66
64
  /**
67
- * The path where all generated files will be exported. This can be an absolute path or a path relative to the specified root option.
65
+ * The path where all generated files will be exported.
66
+ * This can be an absolute path or a path relative to the specified root option.
68
67
  */
69
68
  path: string
70
69
  /**
@@ -78,13 +77,13 @@ export type Config<TInput = Input> = {
78
77
  write?: boolean
79
78
 
80
79
  /**
81
- * Override the extension to the generated imports and exports, by default the plugin will add an extension
82
- * @default `{ '.ts': '.ts'}`
80
+ * Override the extension to the generated imports and exports, by default each plugin will add an extension
81
+ * @default { '.ts': '.ts'}
83
82
  */
84
83
  extension?: Record<KubbFile.Extname, KubbFile.Extname>
85
84
  /**
86
- * Define what needs to exported, here you can also disable the export of barrel files.
87
- * @default `'named'`
85
+ * 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`.
86
+ * @default 'named'
88
87
  */
89
88
  barrelType?: BarrelType | false
90
89
  }
@@ -299,7 +298,7 @@ export type Output = {
299
298
  path: string
300
299
  /**
301
300
  * Define what needs to be exported, here you can also disable the export of barrel files
302
- * @default `'named'`
301
+ * @default 'named'
303
302
  */
304
303
  barrelType?: BarrelType | false
305
304
  /**