@kubb/core 3.5.5 → 3.5.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.
- package/dist/{chunk-4WJNDG3X.cjs → chunk-BLL6IRIU.cjs} +31 -31
- package/dist/chunk-BLL6IRIU.cjs.map +1 -0
- package/dist/chunk-E2WLQU27.js +8 -8
- 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-7ZWCCQIK.cjs → chunk-QUYSCEF5.cjs} +4 -4
- package/dist/{chunk-7ZWCCQIK.cjs.map → chunk-QUYSCEF5.cjs.map} +1 -1
- package/dist/{chunk-HOFDXARN.cjs → chunk-UFJUTGAP.cjs} +65 -65
- package/dist/chunk-UFJUTGAP.cjs.map +1 -0
- package/dist/{chunk-BWZNO5B2.cjs → chunk-VZI3Q424.cjs} +20 -20
- package/dist/chunk-VZI3Q424.cjs.map +1 -0
- package/dist/chunk-YYMV5PIX.js +16 -16
- package/dist/chunk-YYMV5PIX.js.map +1 -1
- package/dist/index.cjs +49 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +6 -6
- package/dist/mocks.cjs +14 -14
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.js +5 -5
- package/dist/mocks.js.map +1 -1
- package/dist/{prompt-PLDPTBBZ.cjs → prompt-PMVNGJYE.cjs} +12 -12
- package/dist/prompt-PMVNGJYE.cjs.map +1 -0
- 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 +9 -9
- package/src/PluginManager.ts +1 -4
- package/src/PromiseManager.ts +0 -4
- package/src/build.ts +1 -1
- package/src/config.ts +1 -1
- package/src/utils/executeStrategies.ts +1 -10
- package/dist/chunk-4WJNDG3X.cjs.map +0 -1
- package/dist/chunk-BWZNO5B2.cjs.map +0 -1
- package/dist/chunk-HOFDXARN.cjs.map +0 -1
- package/dist/prompt-PLDPTBBZ.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 chunkVZI3Q424_cjs = require('./chunk-VZI3Q424.cjs');
|
|
6
|
+
var chunkUFJUTGAP_cjs = require('./chunk-UFJUTGAP.cjs');
|
|
7
|
+
var chunkBLL6IRIU_cjs = require('./chunk-BLL6IRIU.cjs');
|
|
8
|
+
var chunkQUYSCEF5_cjs = require('./chunk-QUYSCEF5.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
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
28
28
|
|
|
29
29
|
// src/build.ts
|
|
30
|
-
|
|
30
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
31
31
|
|
|
32
32
|
// src/PluginManager.ts
|
|
33
|
-
|
|
33
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
34
34
|
|
|
35
35
|
// src/PromiseManager.ts
|
|
36
|
-
|
|
36
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
37
37
|
|
|
38
38
|
// src/utils/executeStrategies.ts
|
|
39
|
-
|
|
39
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
40
40
|
function hookSeq(promises) {
|
|
41
41
|
return promises.filter(Boolean).reduce(
|
|
42
42
|
(promise, func) => {
|
|
@@ -60,8 +60,7 @@ function hookFirst(promises, nullCheck = (state) => state !== null) {
|
|
|
60
60
|
if (nullCheck(state)) {
|
|
61
61
|
return state;
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
return calledFunc;
|
|
63
|
+
return func(state);
|
|
65
64
|
});
|
|
66
65
|
}
|
|
67
66
|
return promise;
|
|
@@ -98,12 +97,12 @@ function isPromiseRejectedResult(result) {
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
// src/errors.ts
|
|
101
|
-
|
|
100
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
102
101
|
var ValidationPluginError = class extends Error {
|
|
103
102
|
};
|
|
104
103
|
|
|
105
104
|
// src/plugin.ts
|
|
106
|
-
|
|
105
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
107
106
|
function createPlugin(factory) {
|
|
108
107
|
return (options = {}) => {
|
|
109
108
|
return factory(options);
|
|
@@ -154,7 +153,7 @@ var pluginCore = createPlugin((options) => {
|
|
|
154
153
|
var PluginManager = class {
|
|
155
154
|
plugins = /* @__PURE__ */ new Set();
|
|
156
155
|
fileManager;
|
|
157
|
-
events = new
|
|
156
|
+
events = new chunkVZI3Q424_cjs.EventEmitter();
|
|
158
157
|
config;
|
|
159
158
|
executed = [];
|
|
160
159
|
logger;
|
|
@@ -166,7 +165,7 @@ var PluginManager = class {
|
|
|
166
165
|
this.config = config;
|
|
167
166
|
this.options = options;
|
|
168
167
|
this.logger = options.logger;
|
|
169
|
-
this.fileManager = new
|
|
168
|
+
this.fileManager = new chunkUFJUTGAP_cjs.FileManager();
|
|
170
169
|
this.#promiseManager = new PromiseManager({
|
|
171
170
|
nullCheck: (state) => !!state?.result
|
|
172
171
|
});
|
|
@@ -215,7 +214,7 @@ var PluginManager = class {
|
|
|
215
214
|
logs: [
|
|
216
215
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
217
216
|
|
|
218
|
-
Paths: ${JSON.stringify(paths,
|
|
217
|
+
Paths: ${JSON.stringify(paths, undefined, 2)}
|
|
219
218
|
|
|
220
219
|
Falling back on the first item.
|
|
221
220
|
`
|
|
@@ -236,7 +235,7 @@ Falling back on the first item.
|
|
|
236
235
|
const names = this.hookForPluginSync({
|
|
237
236
|
pluginKey: params.pluginKey,
|
|
238
237
|
hookName: "resolveName",
|
|
239
|
-
parameters: [
|
|
238
|
+
parameters: [chunkBLL6IRIU_cjs.trim(params.name), params.type],
|
|
240
239
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
241
240
|
});
|
|
242
241
|
if (names && names?.length > 1) {
|
|
@@ -245,21 +244,21 @@ Falling back on the first item.
|
|
|
245
244
|
logs: [
|
|
246
245
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
247
246
|
|
|
248
|
-
Names: ${JSON.stringify(names,
|
|
247
|
+
Names: ${JSON.stringify(names, undefined, 2)}
|
|
249
248
|
|
|
250
249
|
Falling back on the first item.
|
|
251
250
|
`
|
|
252
251
|
]
|
|
253
252
|
});
|
|
254
253
|
}
|
|
255
|
-
return
|
|
254
|
+
return chunkBLL6IRIU_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
256
255
|
}
|
|
257
256
|
const name = this.hookFirstSync({
|
|
258
257
|
hookName: "resolveName",
|
|
259
|
-
parameters: [
|
|
258
|
+
parameters: [chunkBLL6IRIU_cjs.trim(params.name), params.type],
|
|
260
259
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
261
260
|
}).result;
|
|
262
|
-
return
|
|
261
|
+
return chunkBLL6IRIU_cjs.transformReservedWord(name);
|
|
263
262
|
};
|
|
264
263
|
/**
|
|
265
264
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -434,7 +433,7 @@ Falling back on the first item.
|
|
|
434
433
|
if (plugin.pre) {
|
|
435
434
|
const isValid = plugin.pre.every((pluginName) => plugins.find((pluginToFind) => pluginToFind.name === pluginName));
|
|
436
435
|
if (!isValid) {
|
|
437
|
-
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, undefined, 2)})`);
|
|
438
437
|
}
|
|
439
438
|
}
|
|
440
439
|
return plugin;
|
|
@@ -450,7 +449,7 @@ Falling back on the first item.
|
|
|
450
449
|
}
|
|
451
450
|
getPluginByKey(pluginKey) {
|
|
452
451
|
const plugins = [...this.plugins];
|
|
453
|
-
const [searchPluginName
|
|
452
|
+
const [searchPluginName] = pluginKey;
|
|
454
453
|
return plugins.find((item) => {
|
|
455
454
|
const [name] = item.key;
|
|
456
455
|
return name === searchPluginName;
|
|
@@ -513,7 +512,7 @@ Falling back on the first item.
|
|
|
513
512
|
}
|
|
514
513
|
this.events.emit("executing", { strategy, hookName, parameters, plugin, message });
|
|
515
514
|
const promise = new Promise((resolve2) => {
|
|
516
|
-
resolve2(
|
|
515
|
+
resolve2(undefined);
|
|
517
516
|
});
|
|
518
517
|
const task = promise.then(() => {
|
|
519
518
|
if (typeof hook === "function") {
|
|
@@ -597,7 +596,7 @@ Falling back on the first item.
|
|
|
597
596
|
}
|
|
598
597
|
#parse(plugin, pluginManager, context) {
|
|
599
598
|
const usedPluginNames = pluginManager.#usedPluginNames;
|
|
600
|
-
|
|
599
|
+
chunkUFJUTGAP_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
601
600
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
602
601
|
if (plugin.context && typeof plugin.context === "function") {
|
|
603
602
|
return {
|
|
@@ -632,7 +631,7 @@ Falling back on the first item.
|
|
|
632
631
|
};
|
|
633
632
|
|
|
634
633
|
// src/config.ts
|
|
635
|
-
|
|
634
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
636
635
|
function defineConfig(options) {
|
|
637
636
|
return options;
|
|
638
637
|
}
|
|
@@ -640,9 +639,9 @@ function isInputPath(result) {
|
|
|
640
639
|
return !!result && "path" in result?.input;
|
|
641
640
|
}
|
|
642
641
|
async function setup(options) {
|
|
643
|
-
const { config: userConfig, logger =
|
|
642
|
+
const { config: userConfig, logger = chunkVZI3Q424_cjs.createLogger() } = options;
|
|
644
643
|
try {
|
|
645
|
-
if (isInputPath(userConfig) && !new
|
|
644
|
+
if (isInputPath(userConfig) && !new chunkUFJUTGAP_cjs.URLPath(userConfig.input.path).isURL) {
|
|
646
645
|
await fs.read(userConfig.input.path);
|
|
647
646
|
}
|
|
648
647
|
} catch (e) {
|
|
@@ -737,7 +736,7 @@ async function safeBuild(options) {
|
|
|
737
736
|
if (config.output.barrelType) {
|
|
738
737
|
await pluginManager.fileManager.add(rootFile);
|
|
739
738
|
}
|
|
740
|
-
files = await
|
|
739
|
+
files = await chunkUFJUTGAP_cjs.processFiles({
|
|
741
740
|
root: config.root,
|
|
742
741
|
extension: config.output.extension,
|
|
743
742
|
dryRun: !config.output.write,
|
|
@@ -760,7 +759,7 @@ async function safeBuild(options) {
|
|
|
760
759
|
}
|
|
761
760
|
|
|
762
761
|
// src/BaseGenerator.ts
|
|
763
|
-
|
|
762
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
764
763
|
var BaseGenerator = class {
|
|
765
764
|
#options = {};
|
|
766
765
|
#context = {};
|
|
@@ -785,22 +784,22 @@ var BaseGenerator = class {
|
|
|
785
784
|
};
|
|
786
785
|
|
|
787
786
|
// src/PackageManager.ts
|
|
788
|
-
|
|
787
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
789
788
|
|
|
790
789
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
791
|
-
|
|
790
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
792
791
|
|
|
793
792
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
794
|
-
|
|
793
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
795
794
|
|
|
796
795
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
797
|
-
|
|
796
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
798
797
|
|
|
799
798
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
800
|
-
|
|
799
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
801
800
|
|
|
802
801
|
// ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
|
|
803
|
-
|
|
802
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
804
803
|
var Node = class {
|
|
805
804
|
value;
|
|
806
805
|
next;
|
|
@@ -842,8 +841,8 @@ var Queue = class {
|
|
|
842
841
|
return this.#head.value;
|
|
843
842
|
}
|
|
844
843
|
clear() {
|
|
845
|
-
this.#head =
|
|
846
|
-
this.#tail =
|
|
844
|
+
this.#head = undefined;
|
|
845
|
+
this.#tail = undefined;
|
|
847
846
|
this.#size = 0;
|
|
848
847
|
}
|
|
849
848
|
get size() {
|
|
@@ -882,7 +881,7 @@ function pLimit(concurrency) {
|
|
|
882
881
|
next();
|
|
883
882
|
};
|
|
884
883
|
const enqueue = (fn, resolve2, args) => {
|
|
885
|
-
queue.enqueue(run.bind(
|
|
884
|
+
queue.enqueue(run.bind(undefined, fn, resolve2, args));
|
|
886
885
|
(async () => {
|
|
887
886
|
await Promise.resolve();
|
|
888
887
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -998,13 +997,13 @@ function locatePathSync(paths, {
|
|
|
998
997
|
}
|
|
999
998
|
|
|
1000
999
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
1001
|
-
|
|
1000
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
1002
1001
|
function toPath2(urlOrPath) {
|
|
1003
1002
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
1004
1003
|
}
|
|
1005
1004
|
|
|
1006
1005
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
1007
|
-
|
|
1006
|
+
chunkQUYSCEF5_cjs.init_cjs_shims();
|
|
1008
1007
|
|
|
1009
1008
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
1010
1009
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -1120,7 +1119,7 @@ var PackageManager = class _PackageManager {
|
|
|
1120
1119
|
return module?.default ?? module;
|
|
1121
1120
|
} catch (e) {
|
|
1122
1121
|
console.error(e);
|
|
1123
|
-
return
|
|
1122
|
+
return undefined;
|
|
1124
1123
|
}
|
|
1125
1124
|
}
|
|
1126
1125
|
async getPackageJSON() {
|
|
@@ -1128,7 +1127,7 @@ var PackageManager = class _PackageManager {
|
|
|
1128
1127
|
cwd: this.#cwd
|
|
1129
1128
|
});
|
|
1130
1129
|
if (!pkgPath) {
|
|
1131
|
-
return
|
|
1130
|
+
return undefined;
|
|
1132
1131
|
}
|
|
1133
1132
|
const json = await fs.read(pkgPath);
|
|
1134
1133
|
return JSON.parse(json);
|
|
@@ -1138,7 +1137,7 @@ var PackageManager = class _PackageManager {
|
|
|
1138
1137
|
cwd: this.#cwd
|
|
1139
1138
|
});
|
|
1140
1139
|
if (!pkgPath) {
|
|
1141
|
-
return
|
|
1140
|
+
return undefined;
|
|
1142
1141
|
}
|
|
1143
1142
|
const json = fs.readSync(pkgPath);
|
|
1144
1143
|
return JSON.parse(json);
|
|
@@ -1155,7 +1154,7 @@ var PackageManager = class _PackageManager {
|
|
|
1155
1154
|
return dependencies[dependency];
|
|
1156
1155
|
}
|
|
1157
1156
|
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
1158
|
-
return matchedDependency ? dependencies[matchedDependency] :
|
|
1157
|
+
return matchedDependency ? dependencies[matchedDependency] : undefined;
|
|
1159
1158
|
}
|
|
1160
1159
|
async getVersion(dependency) {
|
|
1161
1160
|
if (typeof dependency === "string" && _PackageManager.#cache[dependency]) {
|
|
@@ -1163,7 +1162,7 @@ var PackageManager = class _PackageManager {
|
|
|
1163
1162
|
}
|
|
1164
1163
|
const packageJSON = await this.getPackageJSON();
|
|
1165
1164
|
if (!packageJSON) {
|
|
1166
|
-
return
|
|
1165
|
+
return undefined;
|
|
1167
1166
|
}
|
|
1168
1167
|
return this.#match(packageJSON, dependency);
|
|
1169
1168
|
}
|
|
@@ -1173,7 +1172,7 @@ var PackageManager = class _PackageManager {
|
|
|
1173
1172
|
}
|
|
1174
1173
|
const packageJSON = this.getPackageJSONSync();
|
|
1175
1174
|
if (!packageJSON) {
|
|
1176
|
-
return
|
|
1175
|
+
return undefined;
|
|
1177
1176
|
}
|
|
1178
1177
|
return this.#match(packageJSON, dependency);
|
|
1179
1178
|
}
|
|
@@ -1206,15 +1205,15 @@ var PackageManager = class _PackageManager {
|
|
|
1206
1205
|
|
|
1207
1206
|
Object.defineProperty(exports, "FileManager", {
|
|
1208
1207
|
enumerable: true,
|
|
1209
|
-
get: function () { return
|
|
1208
|
+
get: function () { return chunkUFJUTGAP_cjs.FileManager; }
|
|
1210
1209
|
});
|
|
1211
1210
|
Object.defineProperty(exports, "getSource", {
|
|
1212
1211
|
enumerable: true,
|
|
1213
|
-
get: function () { return
|
|
1212
|
+
get: function () { return chunkUFJUTGAP_cjs.getSource; }
|
|
1214
1213
|
});
|
|
1215
1214
|
Object.defineProperty(exports, "processFiles", {
|
|
1216
1215
|
enumerable: true,
|
|
1217
|
-
get: function () { return
|
|
1216
|
+
get: function () { return chunkUFJUTGAP_cjs.processFiles; }
|
|
1218
1217
|
});
|
|
1219
1218
|
exports.BaseGenerator = BaseGenerator;
|
|
1220
1219
|
exports.PackageManager = PackageManager;
|