@kubb/core 3.6.0 → 3.6.2
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/chunk-E2WLQU27.js +9 -13
- package/dist/chunk-E2WLQU27.js.map +1 -1
- package/dist/chunk-O5ASNFB7.js +14 -14
- package/dist/chunk-O5ASNFB7.js.map +1 -1
- package/dist/{chunk-CGWZQZJF.cjs → chunk-SD6UC23P.cjs} +4 -4
- package/dist/{chunk-CGWZQZJF.cjs.map → chunk-SD6UC23P.cjs.map} +1 -1
- package/dist/{chunk-OSNPTN3U.cjs → chunk-SG5E2M6I.cjs} +65 -65
- package/dist/{chunk-OSNPTN3U.cjs.map → chunk-SG5E2M6I.cjs.map} +1 -1
- package/dist/{chunk-WUEIS5RI.cjs → chunk-WSW653MY.cjs} +31 -31
- package/dist/{chunk-WUEIS5RI.cjs.map → chunk-WSW653MY.cjs.map} +1 -1
- package/dist/{chunk-GWUWH5FS.cjs → chunk-XV4UXIWI.cjs} +20 -24
- package/dist/chunk-XV4UXIWI.cjs.map +1 -0
- package/dist/chunk-YYMV5PIX.js +16 -16
- package/dist/chunk-YYMV5PIX.js.map +1 -1
- package/dist/index.cjs +47 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +6 -6
- package/dist/mocks.cjs +11 -11
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.js +2 -2
- package/dist/mocks.js.map +1 -1
- package/dist/{prompt-YAN5XLN7.cjs → prompt-NUMBDLXI.cjs} +12 -12
- package/dist/{prompt-YAN5XLN7.cjs.map → prompt-NUMBDLXI.cjs.map} +1 -1
- package/dist/prompt-RQXXVSD5.js +8 -8
- package/dist/prompt-RQXXVSD5.js.map +1 -1
- package/dist/transformers.cjs +22 -22
- package/dist/utils.cjs +17 -17
- package/package.json +10 -10
- package/dist/chunk-GWUWH5FS.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunkXV4UXIWI_cjs = require('./chunk-XV4UXIWI.cjs');
|
|
6
|
+
var chunkSG5E2M6I_cjs = require('./chunk-SG5E2M6I.cjs');
|
|
7
|
+
var chunkWSW653MY_cjs = require('./chunk-WSW653MY.cjs');
|
|
8
|
+
var chunkSD6UC23P_cjs = require('./chunk-SD6UC23P.cjs');
|
|
9
9
|
var fs = require('@kubb/fs');
|
|
10
10
|
var path3 = require('path');
|
|
11
11
|
var mod = require('module');
|
|
@@ -24,19 +24,19 @@ var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
|
24
24
|
var fs__default = /*#__PURE__*/_interopDefault(fs$1);
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
|
-
|
|
27
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
28
28
|
|
|
29
29
|
// src/build.ts
|
|
30
|
-
|
|
30
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
31
31
|
|
|
32
32
|
// src/PluginManager.ts
|
|
33
|
-
|
|
33
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
34
34
|
|
|
35
35
|
// src/PromiseManager.ts
|
|
36
|
-
|
|
36
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
37
37
|
|
|
38
38
|
// src/utils/executeStrategies.ts
|
|
39
|
-
|
|
39
|
+
chunkSD6UC23P_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
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
101
101
|
var ValidationPluginError = class extends Error {
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
// src/plugin.ts
|
|
105
|
-
|
|
105
|
+
chunkSD6UC23P_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 chunkXV4UXIWI_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 chunkSG5E2M6I_cjs.FileManager();
|
|
169
169
|
this.#promiseManager = new PromiseManager({
|
|
170
170
|
nullCheck: (state) => !!state?.result
|
|
171
171
|
});
|
|
@@ -214,7 +214,7 @@ var PluginManager = class {
|
|
|
214
214
|
logs: [
|
|
215
215
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
216
216
|
|
|
217
|
-
Paths: ${JSON.stringify(paths,
|
|
217
|
+
Paths: ${JSON.stringify(paths, void 0, 2)}
|
|
218
218
|
|
|
219
219
|
Falling back on the first item.
|
|
220
220
|
`
|
|
@@ -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: [chunkWSW653MY_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) {
|
|
@@ -244,21 +244,21 @@ Falling back on the first item.
|
|
|
244
244
|
logs: [
|
|
245
245
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
246
246
|
|
|
247
|
-
Names: ${JSON.stringify(names,
|
|
247
|
+
Names: ${JSON.stringify(names, void 0, 2)}
|
|
248
248
|
|
|
249
249
|
Falling back on the first item.
|
|
250
250
|
`
|
|
251
251
|
]
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
return
|
|
254
|
+
return chunkWSW653MY_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
255
255
|
}
|
|
256
256
|
const name = this.hookFirstSync({
|
|
257
257
|
hookName: "resolveName",
|
|
258
|
-
parameters: [
|
|
258
|
+
parameters: [chunkWSW653MY_cjs.trim(params.name), params.type],
|
|
259
259
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
260
260
|
}).result;
|
|
261
|
-
return
|
|
261
|
+
return chunkWSW653MY_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.
|
|
@@ -433,7 +433,7 @@ Falling back on the first item.
|
|
|
433
433
|
if (plugin.pre) {
|
|
434
434
|
const isValid = plugin.pre.every((pluginName) => plugins.find((pluginToFind) => pluginToFind.name === pluginName));
|
|
435
435
|
if (!isValid) {
|
|
436
|
-
throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre,
|
|
436
|
+
throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, void 0, 2)})`);
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
return plugin;
|
|
@@ -512,7 +512,7 @@ Falling back on the first item.
|
|
|
512
512
|
}
|
|
513
513
|
this.events.emit("executing", { strategy, hookName, parameters, plugin, message });
|
|
514
514
|
const promise = new Promise((resolve2) => {
|
|
515
|
-
resolve2(
|
|
515
|
+
resolve2(void 0);
|
|
516
516
|
});
|
|
517
517
|
const task = promise.then(() => {
|
|
518
518
|
if (typeof hook === "function") {
|
|
@@ -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
|
+
chunkSG5E2M6I_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
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
635
635
|
function defineConfig(options) {
|
|
636
636
|
return options;
|
|
637
637
|
}
|
|
@@ -639,9 +639,9 @@ function isInputPath(result) {
|
|
|
639
639
|
return !!result && "path" in result?.input;
|
|
640
640
|
}
|
|
641
641
|
async function setup(options) {
|
|
642
|
-
const { config: userConfig, logger =
|
|
642
|
+
const { config: userConfig, logger = chunkXV4UXIWI_cjs.createLogger() } = options;
|
|
643
643
|
try {
|
|
644
|
-
if (isInputPath(userConfig) && !new
|
|
644
|
+
if (isInputPath(userConfig) && !new chunkSG5E2M6I_cjs.URLPath(userConfig.input.path).isURL) {
|
|
645
645
|
await fs.read(userConfig.input.path);
|
|
646
646
|
}
|
|
647
647
|
} catch (e) {
|
|
@@ -736,7 +736,7 @@ async function safeBuild(options) {
|
|
|
736
736
|
if (config.output.barrelType) {
|
|
737
737
|
await pluginManager.fileManager.add(rootFile);
|
|
738
738
|
}
|
|
739
|
-
files = await
|
|
739
|
+
files = await chunkSG5E2M6I_cjs.processFiles({
|
|
740
740
|
root: config.root,
|
|
741
741
|
extension: config.output.extension,
|
|
742
742
|
dryRun: !config.output.write,
|
|
@@ -759,7 +759,7 @@ async function safeBuild(options) {
|
|
|
759
759
|
}
|
|
760
760
|
|
|
761
761
|
// src/BaseGenerator.ts
|
|
762
|
-
|
|
762
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
763
763
|
var BaseGenerator = class {
|
|
764
764
|
#options = {};
|
|
765
765
|
#context = {};
|
|
@@ -784,22 +784,22 @@ var BaseGenerator = class {
|
|
|
784
784
|
};
|
|
785
785
|
|
|
786
786
|
// src/PackageManager.ts
|
|
787
|
-
|
|
787
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
788
788
|
|
|
789
789
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
790
|
-
|
|
790
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
791
791
|
|
|
792
792
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
793
|
-
|
|
793
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
794
794
|
|
|
795
795
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
796
|
-
|
|
796
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
797
797
|
|
|
798
798
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
799
|
-
|
|
799
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
800
800
|
|
|
801
801
|
// ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
|
|
802
|
-
|
|
802
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
803
803
|
var Node = class {
|
|
804
804
|
value;
|
|
805
805
|
next;
|
|
@@ -841,8 +841,8 @@ var Queue = class {
|
|
|
841
841
|
return this.#head.value;
|
|
842
842
|
}
|
|
843
843
|
clear() {
|
|
844
|
-
this.#head =
|
|
845
|
-
this.#tail =
|
|
844
|
+
this.#head = void 0;
|
|
845
|
+
this.#tail = void 0;
|
|
846
846
|
this.#size = 0;
|
|
847
847
|
}
|
|
848
848
|
get size() {
|
|
@@ -881,7 +881,7 @@ function pLimit(concurrency) {
|
|
|
881
881
|
next();
|
|
882
882
|
};
|
|
883
883
|
const enqueue = (fn, resolve2, args) => {
|
|
884
|
-
queue.enqueue(run.bind(
|
|
884
|
+
queue.enqueue(run.bind(void 0, fn, resolve2, args));
|
|
885
885
|
(async () => {
|
|
886
886
|
await Promise.resolve();
|
|
887
887
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -997,13 +997,13 @@ function locatePathSync(paths, {
|
|
|
997
997
|
}
|
|
998
998
|
|
|
999
999
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
1000
|
-
|
|
1000
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
1001
1001
|
function toPath2(urlOrPath) {
|
|
1002
1002
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
1003
1003
|
}
|
|
1004
1004
|
|
|
1005
1005
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
1006
|
-
|
|
1006
|
+
chunkSD6UC23P_cjs.init_cjs_shims();
|
|
1007
1007
|
|
|
1008
1008
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
1009
1009
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -1119,7 +1119,7 @@ var PackageManager = class _PackageManager {
|
|
|
1119
1119
|
return module?.default ?? module;
|
|
1120
1120
|
} catch (e) {
|
|
1121
1121
|
console.error(e);
|
|
1122
|
-
return
|
|
1122
|
+
return void 0;
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
async getPackageJSON() {
|
|
@@ -1127,7 +1127,7 @@ var PackageManager = class _PackageManager {
|
|
|
1127
1127
|
cwd: this.#cwd
|
|
1128
1128
|
});
|
|
1129
1129
|
if (!pkgPath) {
|
|
1130
|
-
return
|
|
1130
|
+
return void 0;
|
|
1131
1131
|
}
|
|
1132
1132
|
const json = await fs.read(pkgPath);
|
|
1133
1133
|
return JSON.parse(json);
|
|
@@ -1137,7 +1137,7 @@ var PackageManager = class _PackageManager {
|
|
|
1137
1137
|
cwd: this.#cwd
|
|
1138
1138
|
});
|
|
1139
1139
|
if (!pkgPath) {
|
|
1140
|
-
return
|
|
1140
|
+
return void 0;
|
|
1141
1141
|
}
|
|
1142
1142
|
const json = fs.readSync(pkgPath);
|
|
1143
1143
|
return JSON.parse(json);
|
|
@@ -1154,7 +1154,7 @@ var PackageManager = class _PackageManager {
|
|
|
1154
1154
|
return dependencies[dependency];
|
|
1155
1155
|
}
|
|
1156
1156
|
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
1157
|
-
return matchedDependency ? dependencies[matchedDependency] :
|
|
1157
|
+
return matchedDependency ? dependencies[matchedDependency] : void 0;
|
|
1158
1158
|
}
|
|
1159
1159
|
async getVersion(dependency) {
|
|
1160
1160
|
if (typeof dependency === "string" && _PackageManager.#cache[dependency]) {
|
|
@@ -1162,7 +1162,7 @@ var PackageManager = class _PackageManager {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
const packageJSON = await this.getPackageJSON();
|
|
1164
1164
|
if (!packageJSON) {
|
|
1165
|
-
return
|
|
1165
|
+
return void 0;
|
|
1166
1166
|
}
|
|
1167
1167
|
return this.#match(packageJSON, dependency);
|
|
1168
1168
|
}
|
|
@@ -1172,7 +1172,7 @@ var PackageManager = class _PackageManager {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
const packageJSON = this.getPackageJSONSync();
|
|
1174
1174
|
if (!packageJSON) {
|
|
1175
|
-
return
|
|
1175
|
+
return void 0;
|
|
1176
1176
|
}
|
|
1177
1177
|
return this.#match(packageJSON, dependency);
|
|
1178
1178
|
}
|
|
@@ -1205,15 +1205,15 @@ var PackageManager = class _PackageManager {
|
|
|
1205
1205
|
|
|
1206
1206
|
Object.defineProperty(exports, "FileManager", {
|
|
1207
1207
|
enumerable: true,
|
|
1208
|
-
get: function () { return
|
|
1208
|
+
get: function () { return chunkSG5E2M6I_cjs.FileManager; }
|
|
1209
1209
|
});
|
|
1210
1210
|
Object.defineProperty(exports, "getSource", {
|
|
1211
1211
|
enumerable: true,
|
|
1212
|
-
get: function () { return
|
|
1212
|
+
get: function () { return chunkSG5E2M6I_cjs.getSource; }
|
|
1213
1213
|
});
|
|
1214
1214
|
Object.defineProperty(exports, "processFiles", {
|
|
1215
1215
|
enumerable: true,
|
|
1216
|
-
get: function () { return
|
|
1216
|
+
get: function () { return chunkSG5E2M6I_cjs.processFiles; }
|
|
1217
1217
|
});
|
|
1218
1218
|
exports.BaseGenerator = BaseGenerator;
|
|
1219
1219
|
exports.PackageManager = PackageManager;
|