@kubb/core 3.10.6 → 3.10.8
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-D2fUBfwx.d.cts → FileManager-3ug7EyFN.d.cts} +29 -31
- package/dist/{FileManager-B14BOfNb.d.ts → FileManager-Zd55TEM3.d.ts} +29 -31
- package/dist/{chunk-PEVYXGYF.cjs → chunk-4FC3UQ2A.cjs} +49 -47
- package/dist/chunk-4FC3UQ2A.cjs.map +1 -0
- package/dist/chunk-533OTQHD.js +131 -0
- package/dist/chunk-533OTQHD.js.map +1 -0
- package/dist/chunk-56YJEKS3.cjs +155 -0
- package/dist/chunk-56YJEKS3.cjs.map +1 -0
- package/dist/{chunk-4ESUQQVB.js → chunk-7TZ5IOVL.js} +3 -4
- package/dist/chunk-7TZ5IOVL.js.map +1 -0
- package/dist/{chunk-FO6OOIML.cjs → chunk-ASNFY2P2.cjs} +13 -13
- package/dist/chunk-ASNFY2P2.cjs.map +1 -0
- package/dist/{chunk-NGF5XEJP.cjs → chunk-GGXWIE3Q.cjs} +4 -4
- package/dist/{chunk-NGF5XEJP.cjs.map → chunk-GGXWIE3Q.cjs.map} +1 -1
- package/dist/{chunk-XICDTA6N.js → chunk-IMO6IX7W.js} +5 -3
- package/dist/chunk-IMO6IX7W.js.map +1 -0
- package/dist/{chunk-5UFNQWFW.cjs → chunk-XFTBW3ZJ.cjs} +17 -17
- package/dist/{chunk-5UFNQWFW.cjs.map → chunk-XFTBW3ZJ.cjs.map} +1 -1
- package/dist/fs.cjs +37 -0
- package/dist/fs.cjs.map +1 -0
- package/dist/fs.d.cts +7 -0
- package/dist/fs.d.ts +7 -0
- package/dist/fs.js +3 -0
- package/dist/fs.js.map +1 -0
- package/dist/index.cjs +45 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +7 -6
- package/dist/logger.js +2 -1
- package/dist/mocks.cjs +10 -9
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +2 -3
- package/dist/mocks.d.ts +2 -3
- package/dist/mocks.js +2 -1
- package/dist/mocks.js.map +1 -1
- package/dist/{parser-CYKQRXlL.d.ts → parser--5gRW-zL.d.ts} +8 -8
- package/dist/{parser-fbk23k1t.d.cts → parser-t_YKG02d.d.cts} +8 -8
- package/dist/{prompt-5L3BUBG6.cjs → prompt-SB4H4DMO.cjs} +4 -4
- package/dist/{prompt-5L3BUBG6.cjs.map → prompt-SB4H4DMO.cjs.map} +1 -1
- package/dist/transformers.cjs +22 -22
- package/dist/types-CFmeCPcR.d.cts +147 -0
- package/dist/types-CFmeCPcR.d.ts +147 -0
- package/dist/utils.cjs +19 -18
- package/dist/utils.d.cts +3 -4
- package/dist/utils.d.ts +3 -4
- package/dist/utils.js +2 -1
- package/package.json +15 -5
- package/src/BarrelManager.ts +2 -2
- package/src/FileManager.ts +4 -4
- package/src/PackageManager.ts +1 -1
- package/src/PluginManager.ts +1 -1
- package/src/build.ts +3 -3
- package/src/fs/clean.ts +5 -0
- package/src/fs/index.ts +9 -0
- package/src/fs/read.ts +69 -0
- package/src/fs/types.ts +138 -0
- package/src/fs/write.ts +67 -0
- package/src/logger.ts +1 -1
- package/src/types.ts +1 -1
- package/src/utils/TreeNode.ts +1 -1
- package/src/utils/parser.ts +2 -2
- package/dist/chunk-4ESUQQVB.js.map +0 -1
- package/dist/chunk-FO6OOIML.cjs.map +0 -1
- package/dist/chunk-PEVYXGYF.cjs.map +0 -1
- package/dist/chunk-XICDTA6N.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
5
|
+
var chunkASNFY2P2_cjs = require('./chunk-ASNFY2P2.cjs');
|
|
6
|
+
var chunk4FC3UQ2A_cjs = require('./chunk-4FC3UQ2A.cjs');
|
|
7
|
+
var chunkXFTBW3ZJ_cjs = require('./chunk-XFTBW3ZJ.cjs');
|
|
8
|
+
var chunk56YJEKS3_cjs = require('./chunk-56YJEKS3.cjs');
|
|
9
|
+
var chunkGGXWIE3Q_cjs = require('./chunk-GGXWIE3Q.cjs');
|
|
10
10
|
var path3 = require('path');
|
|
11
11
|
var mod = require('module');
|
|
12
12
|
var os = require('os');
|
|
13
13
|
var url = require('url');
|
|
14
14
|
var process2 = require('process');
|
|
15
|
-
var fs
|
|
15
|
+
var fs = require('fs');
|
|
16
16
|
var semver = require('semver');
|
|
17
17
|
|
|
18
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -21,22 +21,22 @@ var path3__default = /*#__PURE__*/_interopDefault(path3);
|
|
|
21
21
|
var mod__default = /*#__PURE__*/_interopDefault(mod);
|
|
22
22
|
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
23
23
|
var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
24
|
-
var fs__default = /*#__PURE__*/_interopDefault(fs
|
|
24
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
|
-
|
|
27
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
28
28
|
|
|
29
29
|
// src/build.ts
|
|
30
|
-
|
|
30
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
31
31
|
|
|
32
32
|
// src/PluginManager.ts
|
|
33
|
-
|
|
33
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
34
34
|
|
|
35
35
|
// src/PromiseManager.ts
|
|
36
|
-
|
|
36
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
37
37
|
|
|
38
38
|
// src/utils/executeStrategies.ts
|
|
39
|
-
|
|
39
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
40
40
|
function hookSeq(promises) {
|
|
41
41
|
return promises.filter(Boolean).reduce(
|
|
42
42
|
(promise, func) => {
|
|
@@ -97,12 +97,12 @@ function isPromiseRejectedResult(result) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// src/errors.ts
|
|
100
|
-
|
|
100
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
101
101
|
var ValidationPluginError = class extends Error {
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
// src/plugin.ts
|
|
105
|
-
|
|
105
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
106
106
|
function createPlugin(factory) {
|
|
107
107
|
return (options = {}) => {
|
|
108
108
|
return factory(options);
|
|
@@ -153,7 +153,7 @@ var pluginCore = createPlugin((options) => {
|
|
|
153
153
|
var PluginManager = class {
|
|
154
154
|
plugins = /* @__PURE__ */ new Set();
|
|
155
155
|
fileManager;
|
|
156
|
-
events = new
|
|
156
|
+
events = new chunkASNFY2P2_cjs.EventEmitter();
|
|
157
157
|
config;
|
|
158
158
|
executed = [];
|
|
159
159
|
logger;
|
|
@@ -165,7 +165,7 @@ var PluginManager = class {
|
|
|
165
165
|
this.config = config;
|
|
166
166
|
this.options = options;
|
|
167
167
|
this.logger = options.logger;
|
|
168
|
-
this.fileManager = new
|
|
168
|
+
this.fileManager = new chunk4FC3UQ2A_cjs.FileManager();
|
|
169
169
|
this.#promiseManager = new PromiseManager({
|
|
170
170
|
nullCheck: (state) => !!state?.result
|
|
171
171
|
});
|
|
@@ -235,7 +235,7 @@ Falling back on the first item.
|
|
|
235
235
|
const names = this.hookForPluginSync({
|
|
236
236
|
pluginKey: params.pluginKey,
|
|
237
237
|
hookName: "resolveName",
|
|
238
|
-
parameters: [
|
|
238
|
+
parameters: [chunkXFTBW3ZJ_cjs.trim(params.name), params.type],
|
|
239
239
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
240
240
|
});
|
|
241
241
|
if (names && names?.length > 1) {
|
|
@@ -251,14 +251,14 @@ Falling back on the first item.
|
|
|
251
251
|
]
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
return
|
|
254
|
+
return chunkXFTBW3ZJ_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
255
255
|
}
|
|
256
256
|
const name = this.hookFirstSync({
|
|
257
257
|
hookName: "resolveName",
|
|
258
|
-
parameters: [
|
|
258
|
+
parameters: [chunkXFTBW3ZJ_cjs.trim(params.name), params.type],
|
|
259
259
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
260
260
|
}).result;
|
|
261
|
-
return
|
|
261
|
+
return chunkXFTBW3ZJ_cjs.transformReservedWord(name);
|
|
262
262
|
};
|
|
263
263
|
/**
|
|
264
264
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -596,7 +596,7 @@ Falling back on the first item.
|
|
|
596
596
|
}
|
|
597
597
|
#parse(plugin, pluginManager, context) {
|
|
598
598
|
const usedPluginNames = pluginManager.#usedPluginNames;
|
|
599
|
-
|
|
599
|
+
chunk4FC3UQ2A_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
600
600
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
601
601
|
if (plugin.context && typeof plugin.context === "function") {
|
|
602
602
|
return {
|
|
@@ -631,7 +631,7 @@ Falling back on the first item.
|
|
|
631
631
|
};
|
|
632
632
|
|
|
633
633
|
// src/config.ts
|
|
634
|
-
|
|
634
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
635
635
|
function defineConfig(options) {
|
|
636
636
|
return options;
|
|
637
637
|
}
|
|
@@ -642,10 +642,10 @@ async function setup(options) {
|
|
|
642
642
|
if (options.pluginManager) {
|
|
643
643
|
return options.pluginManager;
|
|
644
644
|
}
|
|
645
|
-
const { config: userConfig, logger =
|
|
645
|
+
const { config: userConfig, logger = chunkASNFY2P2_cjs.createLogger() } = options;
|
|
646
646
|
try {
|
|
647
|
-
if (isInputPath(userConfig) && !new
|
|
648
|
-
await
|
|
647
|
+
if (isInputPath(userConfig) && !new chunk4FC3UQ2A_cjs.URLPath(userConfig.input.path).isURL) {
|
|
648
|
+
await chunk56YJEKS3_cjs.read(userConfig.input.path);
|
|
649
649
|
}
|
|
650
650
|
} catch (e) {
|
|
651
651
|
if (isInputPath(userConfig)) {
|
|
@@ -672,8 +672,8 @@ async function setup(options) {
|
|
|
672
672
|
plugins: userConfig.plugins
|
|
673
673
|
};
|
|
674
674
|
if (definedConfig.output.clean) {
|
|
675
|
-
await
|
|
676
|
-
await
|
|
675
|
+
await chunk56YJEKS3_cjs.clean(definedConfig.output.path);
|
|
676
|
+
await chunk56YJEKS3_cjs.clean(path3.join(definedConfig.root, ".kubb"));
|
|
677
677
|
}
|
|
678
678
|
return new PluginManager(definedConfig, { logger });
|
|
679
679
|
}
|
|
@@ -729,7 +729,7 @@ async function safeBuild(options) {
|
|
|
729
729
|
}
|
|
730
730
|
return {
|
|
731
731
|
name: config.output.barrelType === "all" ? void 0 : [source.name],
|
|
732
|
-
path:
|
|
732
|
+
path: chunk56YJEKS3_cjs.getRelativePath(rootPath, file.path),
|
|
733
733
|
isTypeOnly: config.output.barrelType === "all" ? containsOnlyTypes : source.isTypeOnly
|
|
734
734
|
};
|
|
735
735
|
}).filter(Boolean);
|
|
@@ -740,7 +740,7 @@ async function safeBuild(options) {
|
|
|
740
740
|
if (config.output.barrelType) {
|
|
741
741
|
await pluginManager.fileManager.add(rootFile);
|
|
742
742
|
}
|
|
743
|
-
files = await
|
|
743
|
+
files = await chunk4FC3UQ2A_cjs.processFiles({
|
|
744
744
|
root: config.root,
|
|
745
745
|
extension: config.output.extension,
|
|
746
746
|
dryRun: !config.output.write,
|
|
@@ -763,7 +763,7 @@ async function safeBuild(options) {
|
|
|
763
763
|
}
|
|
764
764
|
|
|
765
765
|
// src/BaseGenerator.ts
|
|
766
|
-
|
|
766
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
767
767
|
var BaseGenerator = class {
|
|
768
768
|
#options = {};
|
|
769
769
|
#context = {};
|
|
@@ -788,22 +788,22 @@ var BaseGenerator = class {
|
|
|
788
788
|
};
|
|
789
789
|
|
|
790
790
|
// src/PackageManager.ts
|
|
791
|
-
|
|
791
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
792
792
|
|
|
793
793
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
794
|
-
|
|
794
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
795
795
|
|
|
796
796
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
797
|
-
|
|
797
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
798
798
|
|
|
799
799
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
800
|
-
|
|
800
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
801
801
|
|
|
802
802
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
803
|
-
|
|
803
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
804
804
|
|
|
805
805
|
// ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
|
|
806
|
-
|
|
806
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
807
807
|
var Node = class {
|
|
808
808
|
value;
|
|
809
809
|
next;
|
|
@@ -966,7 +966,7 @@ async function locatePath(paths, {
|
|
|
966
966
|
} = {}) {
|
|
967
967
|
checkType(type);
|
|
968
968
|
cwd = toPath(cwd);
|
|
969
|
-
const statFunction = allowSymlinks ? fs
|
|
969
|
+
const statFunction = allowSymlinks ? fs.promises.stat : fs.promises.lstat;
|
|
970
970
|
return pLocate(paths, async (path_) => {
|
|
971
971
|
try {
|
|
972
972
|
const stat = await statFunction(path3__default.default.resolve(cwd, path_));
|
|
@@ -1001,13 +1001,13 @@ function locatePathSync(paths, {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
1003
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
1004
|
-
|
|
1004
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
1005
1005
|
function toPath2(urlOrPath) {
|
|
1006
1006
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
1009
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
1010
|
-
|
|
1010
|
+
chunkGGXWIE3Q_cjs.init_cjs_shims();
|
|
1011
1011
|
|
|
1012
1012
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
1013
1013
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -1133,7 +1133,7 @@ var PackageManager = class _PackageManager {
|
|
|
1133
1133
|
if (!pkgPath) {
|
|
1134
1134
|
return void 0;
|
|
1135
1135
|
}
|
|
1136
|
-
const json = await
|
|
1136
|
+
const json = await chunk56YJEKS3_cjs.read(pkgPath);
|
|
1137
1137
|
return JSON.parse(json);
|
|
1138
1138
|
}
|
|
1139
1139
|
getPackageJSONSync() {
|
|
@@ -1143,7 +1143,7 @@ var PackageManager = class _PackageManager {
|
|
|
1143
1143
|
if (!pkgPath) {
|
|
1144
1144
|
return void 0;
|
|
1145
1145
|
}
|
|
1146
|
-
const json =
|
|
1146
|
+
const json = chunk56YJEKS3_cjs.readSync(pkgPath);
|
|
1147
1147
|
return JSON.parse(json);
|
|
1148
1148
|
}
|
|
1149
1149
|
static setVersion(dependency, version) {
|
|
@@ -1212,19 +1212,19 @@ var PackageManager = class _PackageManager {
|
|
|
1212
1212
|
|
|
1213
1213
|
Object.defineProperty(exports, "FileManager", {
|
|
1214
1214
|
enumerable: true,
|
|
1215
|
-
get: function () { return
|
|
1215
|
+
get: function () { return chunk4FC3UQ2A_cjs.FileManager; }
|
|
1216
1216
|
});
|
|
1217
1217
|
Object.defineProperty(exports, "getDefaultBanner", {
|
|
1218
1218
|
enumerable: true,
|
|
1219
|
-
get: function () { return
|
|
1219
|
+
get: function () { return chunk4FC3UQ2A_cjs.getDefaultBanner; }
|
|
1220
1220
|
});
|
|
1221
1221
|
Object.defineProperty(exports, "getSource", {
|
|
1222
1222
|
enumerable: true,
|
|
1223
|
-
get: function () { return
|
|
1223
|
+
get: function () { return chunk4FC3UQ2A_cjs.getSource; }
|
|
1224
1224
|
});
|
|
1225
1225
|
Object.defineProperty(exports, "processFiles", {
|
|
1226
1226
|
enumerable: true,
|
|
1227
|
-
get: function () { return
|
|
1227
|
+
get: function () { return chunk4FC3UQ2A_cjs.processFiles; }
|
|
1228
1228
|
});
|
|
1229
1229
|
exports.BaseGenerator = BaseGenerator;
|
|
1230
1230
|
exports.PackageManager = PackageManager;
|