@kubb/core 3.10.5 → 3.10.7

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.
Files changed (68) hide show
  1. package/dist/{FileManager-D2fUBfwx.d.cts → FileManager-3ug7EyFN.d.cts} +29 -31
  2. package/dist/{FileManager-B14BOfNb.d.ts → FileManager-Zd55TEM3.d.ts} +29 -31
  3. package/dist/chunk-533OTQHD.js +131 -0
  4. package/dist/chunk-533OTQHD.js.map +1 -0
  5. package/dist/{chunk-4ESUQQVB.js → chunk-7TZ5IOVL.js} +3 -4
  6. package/dist/chunk-7TZ5IOVL.js.map +1 -0
  7. package/dist/{chunk-NGF5XEJP.cjs → chunk-C6ZMCVRD.cjs} +4 -4
  8. package/dist/{chunk-NGF5XEJP.cjs.map → chunk-C6ZMCVRD.cjs.map} +1 -1
  9. package/dist/{chunk-PEVYXGYF.cjs → chunk-H7WBARWY.cjs} +49 -47
  10. package/dist/chunk-H7WBARWY.cjs.map +1 -0
  11. package/dist/{chunk-XICDTA6N.js → chunk-IMO6IX7W.js} +5 -3
  12. package/dist/chunk-IMO6IX7W.js.map +1 -0
  13. package/dist/{chunk-5UFNQWFW.cjs → chunk-K7NAX5WN.cjs} +17 -17
  14. package/dist/{chunk-5UFNQWFW.cjs.map → chunk-K7NAX5WN.cjs.map} +1 -1
  15. package/dist/{chunk-FO6OOIML.cjs → chunk-PLNVC6RC.cjs} +13 -13
  16. package/dist/chunk-PLNVC6RC.cjs.map +1 -0
  17. package/dist/chunk-TYHNMIVY.cjs +155 -0
  18. package/dist/chunk-TYHNMIVY.cjs.map +1 -0
  19. package/dist/fs.cjs +37 -0
  20. package/dist/fs.cjs.map +1 -0
  21. package/dist/fs.d.cts +7 -0
  22. package/dist/fs.d.ts +7 -0
  23. package/dist/fs.js +3 -0
  24. package/dist/fs.js.map +1 -0
  25. package/dist/index.cjs +45 -45
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +4 -5
  28. package/dist/index.d.ts +4 -5
  29. package/dist/index.js +4 -4
  30. package/dist/index.js.map +1 -1
  31. package/dist/logger.cjs +7 -6
  32. package/dist/logger.js +2 -1
  33. package/dist/mocks.cjs +10 -9
  34. package/dist/mocks.cjs.map +1 -1
  35. package/dist/mocks.d.cts +2 -3
  36. package/dist/mocks.d.ts +2 -3
  37. package/dist/mocks.js +2 -1
  38. package/dist/mocks.js.map +1 -1
  39. package/dist/{parser-CYKQRXlL.d.ts → parser--5gRW-zL.d.ts} +8 -8
  40. package/dist/{parser-fbk23k1t.d.cts → parser-t_YKG02d.d.cts} +8 -8
  41. package/dist/{prompt-5L3BUBG6.cjs → prompt-7UC6AUNR.cjs} +4 -4
  42. package/dist/{prompt-5L3BUBG6.cjs.map → prompt-7UC6AUNR.cjs.map} +1 -1
  43. package/dist/transformers.cjs +22 -22
  44. package/dist/types-CFmeCPcR.d.cts +147 -0
  45. package/dist/types-CFmeCPcR.d.ts +147 -0
  46. package/dist/utils.cjs +19 -18
  47. package/dist/utils.d.cts +3 -4
  48. package/dist/utils.d.ts +3 -4
  49. package/dist/utils.js +2 -1
  50. package/package.json +15 -5
  51. package/src/BarrelManager.ts +2 -2
  52. package/src/FileManager.ts +4 -4
  53. package/src/PackageManager.ts +1 -1
  54. package/src/PluginManager.ts +1 -1
  55. package/src/build.ts +3 -3
  56. package/src/fs/clean.ts +5 -0
  57. package/src/fs/index.ts +9 -0
  58. package/src/fs/read.ts +69 -0
  59. package/src/fs/types.ts +138 -0
  60. package/src/fs/write.ts +67 -0
  61. package/src/logger.ts +1 -1
  62. package/src/types.ts +1 -1
  63. package/src/utils/TreeNode.ts +1 -1
  64. package/src/utils/parser.ts +2 -2
  65. package/dist/chunk-4ESUQQVB.js.map +0 -1
  66. package/dist/chunk-FO6OOIML.cjs.map +0 -1
  67. package/dist/chunk-PEVYXGYF.cjs.map +0 -1
  68. package/dist/chunk-XICDTA6N.js.map +0 -1
@@ -2,90 +2,90 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunk5UFNQWFW_cjs = require('./chunk-5UFNQWFW.cjs');
6
- require('./chunk-NGF5XEJP.cjs');
5
+ var chunkK7NAX5WN_cjs = require('./chunk-K7NAX5WN.cjs');
6
+ require('./chunk-C6ZMCVRD.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "camelCase", {
11
11
  enumerable: true,
12
- get: function () { return chunk5UFNQWFW_cjs.camelCase; }
12
+ get: function () { return chunkK7NAX5WN_cjs.camelCase; }
13
13
  });
14
14
  Object.defineProperty(exports, "combineCodes", {
15
15
  enumerable: true,
16
- get: function () { return chunk5UFNQWFW_cjs.combineCodes; }
16
+ get: function () { return chunkK7NAX5WN_cjs.combineCodes; }
17
17
  });
18
18
  Object.defineProperty(exports, "createIndent", {
19
19
  enumerable: true,
20
- get: function () { return chunk5UFNQWFW_cjs.createIndent; }
20
+ get: function () { return chunkK7NAX5WN_cjs.createIndent; }
21
21
  });
22
22
  Object.defineProperty(exports, "createJSDocBlockText", {
23
23
  enumerable: true,
24
- get: function () { return chunk5UFNQWFW_cjs.createJSDocBlockText; }
24
+ get: function () { return chunkK7NAX5WN_cjs.createJSDocBlockText; }
25
25
  });
26
26
  Object.defineProperty(exports, "default", {
27
27
  enumerable: true,
28
- get: function () { return chunk5UFNQWFW_cjs.transformers_default; }
28
+ get: function () { return chunkK7NAX5WN_cjs.transformers_default; }
29
29
  });
30
30
  Object.defineProperty(exports, "escape", {
31
31
  enumerable: true,
32
- get: function () { return chunk5UFNQWFW_cjs.escape; }
32
+ get: function () { return chunkK7NAX5WN_cjs.escape; }
33
33
  });
34
34
  Object.defineProperty(exports, "isValidVarName", {
35
35
  enumerable: true,
36
- get: function () { return chunk5UFNQWFW_cjs.isValidVarName; }
36
+ get: function () { return chunkK7NAX5WN_cjs.isValidVarName; }
37
37
  });
38
38
  Object.defineProperty(exports, "jsStringEscape", {
39
39
  enumerable: true,
40
- get: function () { return chunk5UFNQWFW_cjs.jsStringEscape; }
40
+ get: function () { return chunkK7NAX5WN_cjs.jsStringEscape; }
41
41
  });
42
42
  Object.defineProperty(exports, "merge", {
43
43
  enumerable: true,
44
- get: function () { return chunk5UFNQWFW_cjs.merge; }
44
+ get: function () { return chunkK7NAX5WN_cjs.merge; }
45
45
  });
46
46
  Object.defineProperty(exports, "nameSorter", {
47
47
  enumerable: true,
48
- get: function () { return chunk5UFNQWFW_cjs.nameSorter; }
48
+ get: function () { return chunkK7NAX5WN_cjs.nameSorter; }
49
49
  });
50
50
  Object.defineProperty(exports, "orderBy", {
51
51
  enumerable: true,
52
- get: function () { return chunk5UFNQWFW_cjs.orderBy; }
52
+ get: function () { return chunkK7NAX5WN_cjs.orderBy; }
53
53
  });
54
54
  Object.defineProperty(exports, "pascalCase", {
55
55
  enumerable: true,
56
- get: function () { return chunk5UFNQWFW_cjs.pascalCase; }
56
+ get: function () { return chunkK7NAX5WN_cjs.pascalCase; }
57
57
  });
58
58
  Object.defineProperty(exports, "searchAndReplace", {
59
59
  enumerable: true,
60
- get: function () { return chunk5UFNQWFW_cjs.searchAndReplace; }
60
+ get: function () { return chunkK7NAX5WN_cjs.searchAndReplace; }
61
61
  });
62
62
  Object.defineProperty(exports, "stringify", {
63
63
  enumerable: true,
64
- get: function () { return chunk5UFNQWFW_cjs.stringify; }
64
+ get: function () { return chunkK7NAX5WN_cjs.stringify; }
65
65
  });
66
66
  Object.defineProperty(exports, "stringifyObject", {
67
67
  enumerable: true,
68
- get: function () { return chunk5UFNQWFW_cjs.stringifyObject; }
68
+ get: function () { return chunkK7NAX5WN_cjs.stringifyObject; }
69
69
  });
70
70
  Object.defineProperty(exports, "toRegExp", {
71
71
  enumerable: true,
72
- get: function () { return chunk5UFNQWFW_cjs.toRegExp; }
72
+ get: function () { return chunkK7NAX5WN_cjs.toRegExp; }
73
73
  });
74
74
  Object.defineProperty(exports, "toRegExpString", {
75
75
  enumerable: true,
76
- get: function () { return chunk5UFNQWFW_cjs.toRegExpString; }
76
+ get: function () { return chunkK7NAX5WN_cjs.toRegExpString; }
77
77
  });
78
78
  Object.defineProperty(exports, "transformReservedWord", {
79
79
  enumerable: true,
80
- get: function () { return chunk5UFNQWFW_cjs.transformReservedWord; }
80
+ get: function () { return chunkK7NAX5WN_cjs.transformReservedWord; }
81
81
  });
82
82
  Object.defineProperty(exports, "trim", {
83
83
  enumerable: true,
84
- get: function () { return chunk5UFNQWFW_cjs.trim; }
84
+ get: function () { return chunkK7NAX5WN_cjs.trim; }
85
85
  });
86
86
  Object.defineProperty(exports, "trimQuotes", {
87
87
  enumerable: true,
88
- get: function () { return chunk5UFNQWFW_cjs.trimQuotes; }
88
+ get: function () { return chunkK7NAX5WN_cjs.trimQuotes; }
89
89
  });
90
90
  //# sourceMappingURL=transformers.cjs.map
91
91
  //# sourceMappingURL=transformers.cjs.map
@@ -0,0 +1,147 @@
1
+ declare function getRelativePath(rootDir?: string | null, filePath?: string | null, platform?: 'windows' | 'mac' | 'linux'): string;
2
+ declare function read(path: string): Promise<string>;
3
+ declare function readSync(path: string): string;
4
+
5
+ type Options = {
6
+ sanity?: boolean;
7
+ };
8
+ declare function write(path: string, data: string, options?: Options): Promise<string | undefined>;
9
+
10
+ type BasePath<T extends string = string> = `${T}/`;
11
+ type Import = {
12
+ /**
13
+ * Import name to be used
14
+ * @example ["useState"]
15
+ * @example "React"
16
+ */
17
+ name: string | Array<string | {
18
+ propertyName: string;
19
+ name?: string;
20
+ }>;
21
+ /**
22
+ * Path for the import
23
+ * @example '@kubb/core'
24
+ */
25
+ path: string;
26
+ /**
27
+ * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
28
+ */
29
+ isTypeOnly?: boolean;
30
+ isNameSpace?: boolean;
31
+ /**
32
+ * When root is set it will get the path with relative getRelativePath(root, path).
33
+ */
34
+ root?: string;
35
+ };
36
+ type Source = {
37
+ name?: string;
38
+ value?: string;
39
+ isTypeOnly?: boolean;
40
+ /**
41
+ * Has const or type 'export'
42
+ * @default false
43
+ */
44
+ isExportable?: boolean;
45
+ /**
46
+ * When set, barrel generation will add this
47
+ * @default false
48
+ */
49
+ isIndexable?: boolean;
50
+ };
51
+ type Export = {
52
+ /**
53
+ * Export name to be used.
54
+ * @example ["useState"]
55
+ * @example "React"
56
+ */
57
+ name?: string | Array<string>;
58
+ /**
59
+ * Path for the import.
60
+ * @example '@kubb/core'
61
+ */
62
+ path: string;
63
+ /**
64
+ * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
65
+ */
66
+ isTypeOnly?: boolean;
67
+ /**
68
+ * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
69
+ */
70
+ asAlias?: boolean;
71
+ };
72
+ type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
73
+ type Mode = 'single' | 'split';
74
+ /**
75
+ * Name to be used to dynamicly create the baseName(based on input.path)
76
+ * Based on UNIX basename
77
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
78
+ */
79
+ type BaseName = `${string}.${string}`;
80
+ /**
81
+ * Path will be full qualified path to a specified file
82
+ */
83
+ type Path = string;
84
+ type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
85
+ type OptionalPath = Path | undefined | null;
86
+ type File<TMeta extends object = object> = {
87
+ /**
88
+ * Name to be used to create the path
89
+ * Based on UNIX basename, `${name}.extname`
90
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
91
+ */
92
+ baseName: BaseName;
93
+ /**
94
+ * Path will be full qualified path to a specified file
95
+ */
96
+ path: AdvancedPath<BaseName> | Path;
97
+ sources: Array<Source>;
98
+ imports?: Array<Import>;
99
+ exports?: Array<Export>;
100
+ /**
101
+ * This will call fileManager.add instead of fileManager.addOrAppend, adding the source when the files already exists
102
+ * This will also ignore the combinefiles utils
103
+ * @default `false`
104
+ */
105
+ override?: boolean;
106
+ /**
107
+ * Use extra meta, this is getting used to generate the barrel/index files.
108
+ */
109
+ meta?: TMeta;
110
+ banner?: string;
111
+ footer?: string;
112
+ };
113
+ type ResolvedImport = Import;
114
+ type ResolvedExport = Export;
115
+ type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
116
+ /**
117
+ * @default object-hash
118
+ */
119
+ id: string;
120
+ /**
121
+ * Contains the first part of the baseName, generated based on baseName
122
+ * @link https://nodejs.org/api/path.html#pathformatpathobject
123
+ */
124
+ name: string;
125
+ extname: Extname;
126
+ imports: Array<ResolvedImport>;
127
+ exports: Array<ResolvedExport>;
128
+ };
129
+
130
+ type types_AdvancedPath<T extends BaseName = BaseName> = AdvancedPath<T>;
131
+ type types_BaseName = BaseName;
132
+ type types_Export = Export;
133
+ type types_Extname = Extname;
134
+ type types_File<TMeta extends object = object> = File<TMeta>;
135
+ type types_Import = Import;
136
+ type types_Mode = Mode;
137
+ type types_OptionalPath = OptionalPath;
138
+ type types_Path = Path;
139
+ type types_ResolvedExport = ResolvedExport;
140
+ type types_ResolvedFile<TMeta extends object = object> = ResolvedFile<TMeta>;
141
+ type types_ResolvedImport = ResolvedImport;
142
+ type types_Source = Source;
143
+ declare namespace types {
144
+ export type { types_AdvancedPath as AdvancedPath, types_BaseName as BaseName, types_Export as Export, types_Extname as Extname, types_File as File, types_Import as Import, types_Mode as Mode, types_OptionalPath as OptionalPath, types_Path as Path, types_ResolvedExport as ResolvedExport, types_ResolvedFile as ResolvedFile, types_ResolvedImport as ResolvedImport, types_Source as Source };
145
+ }
146
+
147
+ export { type BaseName as B, type Extname as E, type File as F, type Import as I, type Mode as M, type OptionalPath as O, type Path as P, type ResolvedFile as R, type ResolvedImport as a, type Export as b, type ResolvedExport as c, readSync as d, getRelativePath as g, read as r, types as t, write as w };
@@ -0,0 +1,147 @@
1
+ declare function getRelativePath(rootDir?: string | null, filePath?: string | null, platform?: 'windows' | 'mac' | 'linux'): string;
2
+ declare function read(path: string): Promise<string>;
3
+ declare function readSync(path: string): string;
4
+
5
+ type Options = {
6
+ sanity?: boolean;
7
+ };
8
+ declare function write(path: string, data: string, options?: Options): Promise<string | undefined>;
9
+
10
+ type BasePath<T extends string = string> = `${T}/`;
11
+ type Import = {
12
+ /**
13
+ * Import name to be used
14
+ * @example ["useState"]
15
+ * @example "React"
16
+ */
17
+ name: string | Array<string | {
18
+ propertyName: string;
19
+ name?: string;
20
+ }>;
21
+ /**
22
+ * Path for the import
23
+ * @example '@kubb/core'
24
+ */
25
+ path: string;
26
+ /**
27
+ * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
28
+ */
29
+ isTypeOnly?: boolean;
30
+ isNameSpace?: boolean;
31
+ /**
32
+ * When root is set it will get the path with relative getRelativePath(root, path).
33
+ */
34
+ root?: string;
35
+ };
36
+ type Source = {
37
+ name?: string;
38
+ value?: string;
39
+ isTypeOnly?: boolean;
40
+ /**
41
+ * Has const or type 'export'
42
+ * @default false
43
+ */
44
+ isExportable?: boolean;
45
+ /**
46
+ * When set, barrel generation will add this
47
+ * @default false
48
+ */
49
+ isIndexable?: boolean;
50
+ };
51
+ type Export = {
52
+ /**
53
+ * Export name to be used.
54
+ * @example ["useState"]
55
+ * @example "React"
56
+ */
57
+ name?: string | Array<string>;
58
+ /**
59
+ * Path for the import.
60
+ * @example '@kubb/core'
61
+ */
62
+ path: string;
63
+ /**
64
+ * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
65
+ */
66
+ isTypeOnly?: boolean;
67
+ /**
68
+ * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
69
+ */
70
+ asAlias?: boolean;
71
+ };
72
+ type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
73
+ type Mode = 'single' | 'split';
74
+ /**
75
+ * Name to be used to dynamicly create the baseName(based on input.path)
76
+ * Based on UNIX basename
77
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
78
+ */
79
+ type BaseName = `${string}.${string}`;
80
+ /**
81
+ * Path will be full qualified path to a specified file
82
+ */
83
+ type Path = string;
84
+ type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
85
+ type OptionalPath = Path | undefined | null;
86
+ type File<TMeta extends object = object> = {
87
+ /**
88
+ * Name to be used to create the path
89
+ * Based on UNIX basename, `${name}.extname`
90
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
91
+ */
92
+ baseName: BaseName;
93
+ /**
94
+ * Path will be full qualified path to a specified file
95
+ */
96
+ path: AdvancedPath<BaseName> | Path;
97
+ sources: Array<Source>;
98
+ imports?: Array<Import>;
99
+ exports?: Array<Export>;
100
+ /**
101
+ * This will call fileManager.add instead of fileManager.addOrAppend, adding the source when the files already exists
102
+ * This will also ignore the combinefiles utils
103
+ * @default `false`
104
+ */
105
+ override?: boolean;
106
+ /**
107
+ * Use extra meta, this is getting used to generate the barrel/index files.
108
+ */
109
+ meta?: TMeta;
110
+ banner?: string;
111
+ footer?: string;
112
+ };
113
+ type ResolvedImport = Import;
114
+ type ResolvedExport = Export;
115
+ type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
116
+ /**
117
+ * @default object-hash
118
+ */
119
+ id: string;
120
+ /**
121
+ * Contains the first part of the baseName, generated based on baseName
122
+ * @link https://nodejs.org/api/path.html#pathformatpathobject
123
+ */
124
+ name: string;
125
+ extname: Extname;
126
+ imports: Array<ResolvedImport>;
127
+ exports: Array<ResolvedExport>;
128
+ };
129
+
130
+ type types_AdvancedPath<T extends BaseName = BaseName> = AdvancedPath<T>;
131
+ type types_BaseName = BaseName;
132
+ type types_Export = Export;
133
+ type types_Extname = Extname;
134
+ type types_File<TMeta extends object = object> = File<TMeta>;
135
+ type types_Import = Import;
136
+ type types_Mode = Mode;
137
+ type types_OptionalPath = OptionalPath;
138
+ type types_Path = Path;
139
+ type types_ResolvedExport = ResolvedExport;
140
+ type types_ResolvedFile<TMeta extends object = object> = ResolvedFile<TMeta>;
141
+ type types_ResolvedImport = ResolvedImport;
142
+ type types_Source = Source;
143
+ declare namespace types {
144
+ export type { types_AdvancedPath as AdvancedPath, types_BaseName as BaseName, types_Export as Export, types_Extname as Extname, types_File as File, types_Import as Import, types_Mode as Mode, types_OptionalPath as OptionalPath, types_Path as Path, types_ResolvedExport as ResolvedExport, types_ResolvedFile as ResolvedFile, types_ResolvedImport as ResolvedImport, types_Source as Source };
145
+ }
146
+
147
+ export { type BaseName as B, type Extname as E, type File as F, type Import as I, type Mode as M, type OptionalPath as O, type Path as P, type ResolvedFile as R, type ResolvedImport as a, type Export as b, type ResolvedExport as c, readSync as d, getRelativePath as g, read as r, types as t, write as w };
package/dist/utils.cjs CHANGED
@@ -1,70 +1,71 @@
1
1
  'use strict';
2
2
 
3
- var chunkPEVYXGYF_cjs = require('./chunk-PEVYXGYF.cjs');
4
- require('./chunk-5UFNQWFW.cjs');
5
- require('./chunk-NGF5XEJP.cjs');
3
+ var chunkH7WBARWY_cjs = require('./chunk-H7WBARWY.cjs');
4
+ require('./chunk-K7NAX5WN.cjs');
5
+ require('./chunk-TYHNMIVY.cjs');
6
+ require('./chunk-C6ZMCVRD.cjs');
6
7
 
7
8
 
8
9
 
9
10
  Object.defineProperty(exports, "FunctionParams", {
10
11
  enumerable: true,
11
- get: function () { return chunkPEVYXGYF_cjs.FunctionParams; }
12
+ get: function () { return chunkH7WBARWY_cjs.FunctionParams; }
12
13
  });
13
14
  Object.defineProperty(exports, "URLPath", {
14
15
  enumerable: true,
15
- get: function () { return chunkPEVYXGYF_cjs.URLPath; }
16
+ get: function () { return chunkH7WBARWY_cjs.URLPath; }
16
17
  });
17
18
  Object.defineProperty(exports, "createFile", {
18
19
  enumerable: true,
19
- get: function () { return chunkPEVYXGYF_cjs.createFile; }
20
+ get: function () { return chunkH7WBARWY_cjs.createFile; }
20
21
  });
21
22
  Object.defineProperty(exports, "createFileExport", {
22
23
  enumerable: true,
23
- get: function () { return chunkPEVYXGYF_cjs.createFileExport; }
24
+ get: function () { return chunkH7WBARWY_cjs.createFileExport; }
24
25
  });
25
26
  Object.defineProperty(exports, "createFileImport", {
26
27
  enumerable: true,
27
- get: function () { return chunkPEVYXGYF_cjs.createFileImport; }
28
+ get: function () { return chunkH7WBARWY_cjs.createFileImport; }
28
29
  });
29
30
  Object.defineProperty(exports, "createFileParser", {
30
31
  enumerable: true,
31
- get: function () { return chunkPEVYXGYF_cjs.createFileParser; }
32
+ get: function () { return chunkH7WBARWY_cjs.createFileParser; }
32
33
  });
33
34
  Object.defineProperty(exports, "getDefaultBanner", {
34
35
  enumerable: true,
35
- get: function () { return chunkPEVYXGYF_cjs.getDefaultBanner; }
36
+ get: function () { return chunkH7WBARWY_cjs.getDefaultBanner; }
36
37
  });
37
38
  Object.defineProperty(exports, "getFileParser", {
38
39
  enumerable: true,
39
- get: function () { return chunkPEVYXGYF_cjs.getFileParser; }
40
+ get: function () { return chunkH7WBARWY_cjs.getFileParser; }
40
41
  });
41
42
  Object.defineProperty(exports, "getUniqueName", {
42
43
  enumerable: true,
43
- get: function () { return chunkPEVYXGYF_cjs.getUniqueName; }
44
+ get: function () { return chunkH7WBARWY_cjs.getUniqueName; }
44
45
  });
45
46
  Object.defineProperty(exports, "isPromise", {
46
47
  enumerable: true,
47
- get: function () { return chunkPEVYXGYF_cjs.isPromise; }
48
+ get: function () { return chunkH7WBARWY_cjs.isPromise; }
48
49
  });
49
50
  Object.defineProperty(exports, "isPromiseFulfilledResult", {
50
51
  enumerable: true,
51
- get: function () { return chunkPEVYXGYF_cjs.isPromiseFulfilledResult; }
52
+ get: function () { return chunkH7WBARWY_cjs.isPromiseFulfilledResult; }
52
53
  });
53
54
  Object.defineProperty(exports, "isPromiseRejectedResult", {
54
55
  enumerable: true,
55
- get: function () { return chunkPEVYXGYF_cjs.isPromiseRejectedResult; }
56
+ get: function () { return chunkH7WBARWY_cjs.isPromiseRejectedResult; }
56
57
  });
57
58
  Object.defineProperty(exports, "renderTemplate", {
58
59
  enumerable: true,
59
- get: function () { return chunkPEVYXGYF_cjs.renderTemplate; }
60
+ get: function () { return chunkH7WBARWY_cjs.renderTemplate; }
60
61
  });
61
62
  Object.defineProperty(exports, "setUniqueName", {
62
63
  enumerable: true,
63
- get: function () { return chunkPEVYXGYF_cjs.setUniqueName; }
64
+ get: function () { return chunkH7WBARWY_cjs.setUniqueName; }
64
65
  });
65
66
  Object.defineProperty(exports, "timeout", {
66
67
  enumerable: true,
67
- get: function () { return chunkPEVYXGYF_cjs.timeout; }
68
+ get: function () { return chunkH7WBARWY_cjs.timeout; }
68
69
  });
69
70
  //# sourceMappingURL=utils.cjs.map
70
71
  //# sourceMappingURL=utils.cjs.map
package/dist/utils.d.cts CHANGED
@@ -1,7 +1,6 @@
1
- import { a as PossiblePromise } from './FileManager-D2fUBfwx.cjs';
2
- export { P as ParserModule, d as createFile, b as createFileExport, c as createFileImport, e as createFileParser, g as getDefaultBanner, a as getFileParser } from './parser-fbk23k1t.cjs';
3
- import '@kubb/fs';
4
- import '@kubb/fs/types';
1
+ import { a as PossiblePromise } from './FileManager-3ug7EyFN.cjs';
2
+ export { P as ParserModule, d as createFile, b as createFileExport, c as createFileImport, e as createFileParser, g as getDefaultBanner, a as getFileParser } from './parser-t_YKG02d.cjs';
3
+ import './types-CFmeCPcR.cjs';
5
4
  import './logger-BWq-oJU_.cjs';
6
5
  import 'consola/utils';
7
6
  import 'consola';
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { a as PossiblePromise } from './FileManager-B14BOfNb.js';
2
- export { P as ParserModule, d as createFile, b as createFileExport, c as createFileImport, e as createFileParser, g as getDefaultBanner, a as getFileParser } from './parser-CYKQRXlL.js';
3
- import '@kubb/fs';
4
- import '@kubb/fs/types';
1
+ import { a as PossiblePromise } from './FileManager-Zd55TEM3.js';
2
+ export { P as ParserModule, d as createFile, b as createFileExport, c as createFileImport, e as createFileParser, g as getDefaultBanner, a as getFileParser } from './parser--5gRW-zL.js';
3
+ import './types-CFmeCPcR.js';
5
4
  import './logger-BWq-oJU_.js';
6
5
  import 'consola/utils';
7
6
  import 'consola';
package/dist/utils.js CHANGED
@@ -1,4 +1,5 @@
1
- export { FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from './chunk-XICDTA6N.js';
1
+ export { FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getDefaultBanner, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from './chunk-IMO6IX7W.js';
2
2
  import './chunk-O5ASNFB7.js';
3
+ import './chunk-533OTQHD.js';
3
4
  //# sourceMappingURL=utils.js.map
4
5
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/core",
3
- "version": "3.10.5",
3
+ "version": "3.10.7",
4
4
  "description": "Generator core",
5
5
  "keywords": [
6
6
  "typescript",
@@ -33,6 +33,11 @@
33
33
  "require": "./dist/transformers.cjs",
34
34
  "default": "./dist/transformers.cjs"
35
35
  },
36
+ "./fs": {
37
+ "import": "./dist/fs.js",
38
+ "require": "./dist/fs.cjs",
39
+ "default": "./dist/fs.cjs"
40
+ },
36
41
  "./logger": {
37
42
  "import": "./dist/logger.js",
38
43
  "require": "./dist/logger.cjs",
@@ -62,6 +67,9 @@
62
67
  ],
63
68
  "mocks": [
64
69
  "./dist/mocks.d.ts"
70
+ ],
71
+ "fs": [
72
+ "./dist/fs.d.ts"
65
73
  ]
66
74
  }
67
75
  },
@@ -77,16 +85,18 @@
77
85
  "dependencies": {
78
86
  "camelcase": "^8.0.0",
79
87
  "find-up": "^7.0.0",
88
+ "fs-extra": "^11.3.0",
89
+ "js-runtime": "^0.0.8",
80
90
  "natural-orderby": "^5.0.0",
81
91
  "object-hash": "^3.0.0",
82
92
  "p-queue": "^8.1.0",
83
93
  "remeda": "^2.21.3",
84
94
  "seedrandom": "^3.0.5",
85
95
  "semver": "^7.7.1",
86
- "@kubb/fs": "3.10.5",
87
- "@kubb/parser-ts": "3.10.5"
96
+ "@kubb/parser-ts": "3.10.7"
88
97
  },
89
98
  "devDependencies": {
99
+ "@types/fs-extra": "^11.0.4",
90
100
  "@types/object-hash": "^3.0.6",
91
101
  "@types/seedrandom": "^3.0.8",
92
102
  "@types/semver": "^7.7.0",
@@ -94,8 +104,8 @@
94
104
  "prettier": "^3.5.3",
95
105
  "tsup": "^8.4.0",
96
106
  "typescript": "^5.8.3",
97
- "@kubb/config-ts": "3.10.5",
98
- "@kubb/config-tsup": "3.10.5"
107
+ "@kubb/config-ts": "3.10.7",
108
+ "@kubb/config-tsup": "3.10.7"
99
109
  },
100
110
  "engines": {
101
111
  "node": ">=20"
@@ -2,8 +2,8 @@ import { join } from 'node:path'
2
2
 
3
3
  import { TreeNode } from './utils/TreeNode.ts'
4
4
 
5
- import { getRelativePath } from '@kubb/fs'
6
- import type * as KubbFile from '@kubb/fs/types'
5
+ import { getRelativePath } from './fs/index.ts'
6
+ import type { KubbFile } from './fs/index.ts'
7
7
  import type { FileMetaBase } from './FileManager.ts'
8
8
  import type { Logger } from './logger.ts'
9
9
 
@@ -3,13 +3,13 @@ import { extname, join, relative } from 'node:path'
3
3
  import { orderBy } from 'natural-orderby'
4
4
  import { isDeepEqual } from 'remeda'
5
5
 
6
- import { read, write } from '@kubb/fs'
6
+ import { read, write } from './fs/index.ts'
7
7
  import { BarrelManager } from './BarrelManager.ts'
8
8
 
9
- import type * as KubbFile from '@kubb/fs/types'
9
+ import type { KubbFile } from './fs/index.ts'
10
10
 
11
- import { trimExtName } from '@kubb/fs'
12
- import type { ResolvedFile } from '@kubb/fs/types'
11
+ import { trimExtName } from './fs/index.ts'
12
+ import type { ResolvedFile } from './fs/types.ts'
13
13
  import type { GreaterThan } from './utils/types.ts'
14
14
  import PQueue from 'p-queue'
15
15
  import type { Logger } from './logger.ts'
@@ -5,7 +5,7 @@ import { pathToFileURL } from 'node:url'
5
5
  import { findUp, findUpSync } from 'find-up'
6
6
  import { coerce, satisfies } from 'semver'
7
7
 
8
- import { read, readSync } from '@kubb/fs'
8
+ import { read, readSync } from './fs/index.ts'
9
9
 
10
10
  type PackageJSON = {
11
11
  dependencies?: Record<string, string>
@@ -7,7 +7,7 @@ import { transformReservedWord } from './transformers/transformReservedWord.ts'
7
7
  import { EventEmitter } from './utils/EventEmitter.ts'
8
8
  import { setUniqueName } from './utils/uniqueName.ts'
9
9
 
10
- import type * as KubbFile from '@kubb/fs/types'
10
+ import type { KubbFile } from './fs/index.ts'
11
11
  import type { Logger } from './logger.ts'
12
12
  import type { PluginCore } from './plugin.ts'
13
13
  import { trim } from './transformers/trim.ts'
package/src/build.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { clean, read } from '@kubb/fs'
2
- import type * as KubbFile from '@kubb/fs/types'
1
+ import { clean, read } from './fs/index.ts'
2
+ import type { KubbFile } from './fs/index.ts'
3
3
  import { type FileManager, processFiles } from './FileManager.ts'
4
4
  import { PluginManager } from './PluginManager.ts'
5
5
  import { isInputPath } from './config.ts'
@@ -7,7 +7,7 @@ import { createLogger } from './logger.ts'
7
7
  import { URLPath } from './utils/URLPath.ts'
8
8
 
9
9
  import { join, resolve } from 'node:path'
10
- import { getRelativePath } from '@kubb/fs'
10
+ import { getRelativePath } from './fs/index.ts'
11
11
  import type { Logger } from './logger.ts'
12
12
  import type { Config, Output, UserConfig } from './types.ts'
13
13
 
@@ -0,0 +1,5 @@
1
+ import fs from 'fs-extra'
2
+
3
+ export async function clean(path: string): Promise<void> {
4
+ return fs.remove(path)
5
+ }