@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.
@@ -2,22 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunk2TOEDZ2U_cjs = require('./chunk-2TOEDZ2U.cjs');
6
- var chunk4GJEWGQN_cjs = require('./chunk-4GJEWGQN.cjs');
7
- var chunk72BWXKV4_cjs = require('./chunk-72BWXKV4.cjs');
5
+ var chunkPAAEVG63_cjs = require('./chunk-PAAEVG63.cjs');
6
+ var chunkZTR3NNAO_cjs = require('./chunk-ZTR3NNAO.cjs');
7
+ var chunkYEWLGG6A_cjs = require('./chunk-YEWLGG6A.cjs');
8
8
  var remeda = require('remeda');
9
9
 
10
10
  // src/transformers/index.ts
11
- chunk72BWXKV4_cjs.init_cjs_shims();
11
+ chunkYEWLGG6A_cjs.init_cjs_shims();
12
12
 
13
13
  // src/transformers/combineCodes.ts
14
- chunk72BWXKV4_cjs.init_cjs_shims();
14
+ chunkYEWLGG6A_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
- chunk72BWXKV4_cjs.init_cjs_shims();
20
+ chunkYEWLGG6A_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
- chunk72BWXKV4_cjs.init_cjs_shims();
32
+ chunkYEWLGG6A_cjs.init_cjs_shims();
33
33
  function escape(text) {
34
34
  return text ? text.replaceAll("`", "\\`") : "";
35
35
  }
@@ -56,13 +56,13 @@ function jsStringEscape(input) {
56
56
  }
57
57
 
58
58
  // src/transformers/indent.ts
59
- chunk72BWXKV4_cjs.init_cjs_shims();
59
+ chunkYEWLGG6A_cjs.init_cjs_shims();
60
60
  function createIndent(size) {
61
61
  return Array.from({ length: size + 1 }).join(" ");
62
62
  }
63
63
 
64
64
  // src/transformers/nameSorter.ts
65
- chunk72BWXKV4_cjs.init_cjs_shims();
65
+ chunkYEWLGG6A_cjs.init_cjs_shims();
66
66
  function nameSorter(a, b) {
67
67
  if (a.name < b.name) {
68
68
  return -1;
@@ -74,7 +74,7 @@ function nameSorter(a, b) {
74
74
  }
75
75
 
76
76
  // src/transformers/searchAndReplace.ts
77
- chunk72BWXKV4_cjs.init_cjs_shims();
77
+ chunkYEWLGG6A_cjs.init_cjs_shims();
78
78
  function searchAndReplace(options) {
79
79
  const { text, replaceBy, prefix = "", key } = options;
80
80
  const searchValues = options.searchValues?.(prefix, key) || [
@@ -92,10 +92,10 @@ function searchAndReplace(options) {
92
92
  }
93
93
 
94
94
  // src/transformers/stringify.ts
95
- chunk72BWXKV4_cjs.init_cjs_shims();
95
+ chunkYEWLGG6A_cjs.init_cjs_shims();
96
96
 
97
97
  // src/transformers/trim.ts
98
- chunk72BWXKV4_cjs.init_cjs_shims();
98
+ chunkYEWLGG6A_cjs.init_cjs_shims();
99
99
  function trim(text) {
100
100
  return text.replaceAll(/\n/g, "").trim();
101
101
  }
@@ -132,7 +132,7 @@ function stringifyObject(value) {
132
132
  }
133
133
 
134
134
  // src/transformers/toRegExp.ts
135
- chunk72BWXKV4_cjs.init_cjs_shims();
135
+ chunkYEWLGG6A_cjs.init_cjs_shims();
136
136
  function stringToRegex(text) {
137
137
  const isStartWithSlash = text.startsWith("/");
138
138
  const isEndWithSlash = text.endsWith("/");
@@ -156,7 +156,7 @@ var transformers_default = {
156
156
  escape,
157
157
  jsStringEscape,
158
158
  createIndent,
159
- transformReservedWord: chunk2TOEDZ2U_cjs.transformReservedWord,
159
+ transformReservedWord: chunkPAAEVG63_cjs.transformReservedWord,
160
160
  nameSorter,
161
161
  searchAndReplace,
162
162
  stringify,
@@ -168,32 +168,32 @@ var transformers_default = {
168
168
  JSDoc: {
169
169
  createJSDocBlockText
170
170
  },
171
- orderBy: chunk4GJEWGQN_cjs.orderBy,
171
+ orderBy: chunkZTR3NNAO_cjs.orderBy,
172
172
  merge: remeda.merge,
173
- camelCase: chunk4GJEWGQN_cjs.camelCase,
174
- pascalCase: chunk4GJEWGQN_cjs.pascalCase,
175
- pathCase: chunk4GJEWGQN_cjs.pathCase
173
+ camelCase: chunkZTR3NNAO_cjs.camelCase,
174
+ pascalCase: chunkZTR3NNAO_cjs.pascalCase,
175
+ pathCase: chunkZTR3NNAO_cjs.pathCase
176
176
  };
177
177
 
178
178
  Object.defineProperty(exports, "transformReservedWord", {
179
179
  enumerable: true,
180
- get: function () { return chunk2TOEDZ2U_cjs.transformReservedWord; }
180
+ get: function () { return chunkPAAEVG63_cjs.transformReservedWord; }
181
181
  });
182
182
  Object.defineProperty(exports, "camelCase", {
183
183
  enumerable: true,
184
- get: function () { return chunk4GJEWGQN_cjs.camelCase; }
184
+ get: function () { return chunkZTR3NNAO_cjs.camelCase; }
185
185
  });
186
186
  Object.defineProperty(exports, "orderBy", {
187
187
  enumerable: true,
188
- get: function () { return chunk4GJEWGQN_cjs.orderBy; }
188
+ get: function () { return chunkZTR3NNAO_cjs.orderBy; }
189
189
  });
190
190
  Object.defineProperty(exports, "pascalCase", {
191
191
  enumerable: true,
192
- get: function () { return chunk4GJEWGQN_cjs.pascalCase; }
192
+ get: function () { return chunkZTR3NNAO_cjs.pascalCase; }
193
193
  });
194
194
  Object.defineProperty(exports, "pathCase", {
195
195
  enumerable: true,
196
- get: function () { return chunk4GJEWGQN_cjs.pathCase; }
196
+ get: function () { return chunkZTR3NNAO_cjs.pathCase; }
197
197
  });
198
198
  Object.defineProperty(exports, "merge", {
199
199
  enumerable: true,
package/dist/utils.cjs CHANGED
@@ -1,66 +1,66 @@
1
1
  'use strict';
2
2
 
3
- var chunkSQBOUPF4_cjs = require('./chunk-SQBOUPF4.cjs');
4
- require('./chunk-4GJEWGQN.cjs');
5
- require('./chunk-72BWXKV4.cjs');
3
+ var chunkE3M4QKGT_cjs = require('./chunk-E3M4QKGT.cjs');
4
+ require('./chunk-ZTR3NNAO.cjs');
5
+ require('./chunk-YEWLGG6A.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "FunctionParams", {
10
10
  enumerable: true,
11
- get: function () { return chunkSQBOUPF4_cjs.FunctionParams; }
11
+ get: function () { return chunkE3M4QKGT_cjs.FunctionParams; }
12
12
  });
13
13
  Object.defineProperty(exports, "URLPath", {
14
14
  enumerable: true,
15
- get: function () { return chunkSQBOUPF4_cjs.URLPath; }
15
+ get: function () { return chunkE3M4QKGT_cjs.URLPath; }
16
16
  });
17
17
  Object.defineProperty(exports, "createFile", {
18
18
  enumerable: true,
19
- get: function () { return chunkSQBOUPF4_cjs.createFile; }
19
+ get: function () { return chunkE3M4QKGT_cjs.createFile; }
20
20
  });
21
21
  Object.defineProperty(exports, "createFileExport", {
22
22
  enumerable: true,
23
- get: function () { return chunkSQBOUPF4_cjs.createFileExport; }
23
+ get: function () { return chunkE3M4QKGT_cjs.createFileExport; }
24
24
  });
25
25
  Object.defineProperty(exports, "createFileImport", {
26
26
  enumerable: true,
27
- get: function () { return chunkSQBOUPF4_cjs.createFileImport; }
27
+ get: function () { return chunkE3M4QKGT_cjs.createFileImport; }
28
28
  });
29
29
  Object.defineProperty(exports, "createFileParser", {
30
30
  enumerable: true,
31
- get: function () { return chunkSQBOUPF4_cjs.createFileParser; }
31
+ get: function () { return chunkE3M4QKGT_cjs.createFileParser; }
32
32
  });
33
33
  Object.defineProperty(exports, "getFileParser", {
34
34
  enumerable: true,
35
- get: function () { return chunkSQBOUPF4_cjs.getFileParser; }
35
+ get: function () { return chunkE3M4QKGT_cjs.getFileParser; }
36
36
  });
37
37
  Object.defineProperty(exports, "getUniqueName", {
38
38
  enumerable: true,
39
- get: function () { return chunkSQBOUPF4_cjs.getUniqueName; }
39
+ get: function () { return chunkE3M4QKGT_cjs.getUniqueName; }
40
40
  });
41
41
  Object.defineProperty(exports, "isPromise", {
42
42
  enumerable: true,
43
- get: function () { return chunkSQBOUPF4_cjs.isPromise; }
43
+ get: function () { return chunkE3M4QKGT_cjs.isPromise; }
44
44
  });
45
45
  Object.defineProperty(exports, "isPromiseFulfilledResult", {
46
46
  enumerable: true,
47
- get: function () { return chunkSQBOUPF4_cjs.isPromiseFulfilledResult; }
47
+ get: function () { return chunkE3M4QKGT_cjs.isPromiseFulfilledResult; }
48
48
  });
49
49
  Object.defineProperty(exports, "isPromiseRejectedResult", {
50
50
  enumerable: true,
51
- get: function () { return chunkSQBOUPF4_cjs.isPromiseRejectedResult; }
51
+ get: function () { return chunkE3M4QKGT_cjs.isPromiseRejectedResult; }
52
52
  });
53
53
  Object.defineProperty(exports, "renderTemplate", {
54
54
  enumerable: true,
55
- get: function () { return chunkSQBOUPF4_cjs.renderTemplate; }
55
+ get: function () { return chunkE3M4QKGT_cjs.renderTemplate; }
56
56
  });
57
57
  Object.defineProperty(exports, "setUniqueName", {
58
58
  enumerable: true,
59
- get: function () { return chunkSQBOUPF4_cjs.setUniqueName; }
59
+ get: function () { return chunkE3M4QKGT_cjs.setUniqueName; }
60
60
  });
61
61
  Object.defineProperty(exports, "timeout", {
62
62
  enumerable: true,
63
- get: function () { return chunkSQBOUPF4_cjs.timeout; }
63
+ get: function () { return chunkE3M4QKGT_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-beta.3",
3
+ "version": "3.0.0-beta.5",
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.5",
87
+ "@kubb/parser-ts": "3.0.0-beta.5",
88
+ "@kubb/types": "3.0.0-beta.5"
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.5",
100
+ "@kubb/config-tsup": "3.0.0-beta.5"
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
  /**