@kubb/core 3.5.4 → 3.5.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.
- package/dist/{chunk-DSQCC7PM.cjs → chunk-4WJNDG3X.cjs} +17 -17
- package/dist/{chunk-DSQCC7PM.cjs.map → chunk-4WJNDG3X.cjs.map} +1 -1
- package/dist/{chunk-LIRQEU5H.cjs → chunk-7ZWCCQIK.cjs} +4 -4
- package/dist/{chunk-LIRQEU5H.cjs.map → chunk-7ZWCCQIK.cjs.map} +1 -1
- package/dist/{chunk-A5DJD2TT.cjs → chunk-BWZNO5B2.cjs} +12 -12
- package/dist/{chunk-A5DJD2TT.cjs.map → chunk-BWZNO5B2.cjs.map} +1 -1
- package/dist/{chunk-PLNJ73H7.cjs → chunk-HOFDXARN.cjs} +92 -41
- package/dist/chunk-HOFDXARN.cjs.map +1 -0
- package/dist/index.cjs +34 -34
- package/dist/logger.cjs +6 -6
- package/dist/mocks.cjs +9 -9
- package/dist/{prompt-PTBVR4VS.cjs → prompt-PLDPTBBZ.cjs} +4 -4
- package/dist/{prompt-PTBVR4VS.cjs.map → prompt-PLDPTBBZ.cjs.map} +1 -1
- package/dist/transformers.cjs +22 -22
- package/dist/utils.cjs +17 -17
- package/package.json +8 -8
- package/dist/chunk-PLNJ73H7.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 chunkBWZNO5B2_cjs = require('./chunk-BWZNO5B2.cjs');
|
|
6
|
+
var chunkHOFDXARN_cjs = require('./chunk-HOFDXARN.cjs');
|
|
7
|
+
var chunk4WJNDG3X_cjs = require('./chunk-4WJNDG3X.cjs');
|
|
8
|
+
var chunk7ZWCCQIK_cjs = require('./chunk-7ZWCCQIK.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
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
28
28
|
|
|
29
29
|
// src/build.ts
|
|
30
|
-
|
|
30
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
31
31
|
|
|
32
32
|
// src/PluginManager.ts
|
|
33
|
-
|
|
33
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
34
34
|
|
|
35
35
|
// src/PromiseManager.ts
|
|
36
|
-
|
|
36
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
37
37
|
|
|
38
38
|
// src/utils/executeStrategies.ts
|
|
39
|
-
|
|
39
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
40
40
|
function hookSeq(promises) {
|
|
41
41
|
return promises.filter(Boolean).reduce(
|
|
42
42
|
(promise, func) => {
|
|
@@ -98,12 +98,12 @@ function isPromiseRejectedResult(result) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
// src/errors.ts
|
|
101
|
-
|
|
101
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
102
102
|
var ValidationPluginError = class extends Error {
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
// src/plugin.ts
|
|
106
|
-
|
|
106
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
107
107
|
function createPlugin(factory) {
|
|
108
108
|
return (options = {}) => {
|
|
109
109
|
return factory(options);
|
|
@@ -154,7 +154,7 @@ var pluginCore = createPlugin((options) => {
|
|
|
154
154
|
var PluginManager = class {
|
|
155
155
|
plugins = /* @__PURE__ */ new Set();
|
|
156
156
|
fileManager;
|
|
157
|
-
events = new
|
|
157
|
+
events = new chunkBWZNO5B2_cjs.EventEmitter();
|
|
158
158
|
config;
|
|
159
159
|
executed = [];
|
|
160
160
|
logger;
|
|
@@ -166,7 +166,7 @@ var PluginManager = class {
|
|
|
166
166
|
this.config = config;
|
|
167
167
|
this.options = options;
|
|
168
168
|
this.logger = options.logger;
|
|
169
|
-
this.fileManager = new
|
|
169
|
+
this.fileManager = new chunkHOFDXARN_cjs.FileManager();
|
|
170
170
|
this.#promiseManager = new PromiseManager({
|
|
171
171
|
nullCheck: (state) => !!state?.result
|
|
172
172
|
});
|
|
@@ -236,7 +236,7 @@ Falling back on the first item.
|
|
|
236
236
|
const names = this.hookForPluginSync({
|
|
237
237
|
pluginKey: params.pluginKey,
|
|
238
238
|
hookName: "resolveName",
|
|
239
|
-
parameters: [
|
|
239
|
+
parameters: [chunk4WJNDG3X_cjs.trim(params.name), params.type],
|
|
240
240
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
241
241
|
});
|
|
242
242
|
if (names && names?.length > 1) {
|
|
@@ -252,14 +252,14 @@ Falling back on the first item.
|
|
|
252
252
|
]
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
return
|
|
255
|
+
return chunk4WJNDG3X_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
256
256
|
}
|
|
257
257
|
const name = this.hookFirstSync({
|
|
258
258
|
hookName: "resolveName",
|
|
259
|
-
parameters: [
|
|
259
|
+
parameters: [chunk4WJNDG3X_cjs.trim(params.name), params.type],
|
|
260
260
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
261
261
|
}).result;
|
|
262
|
-
return
|
|
262
|
+
return chunk4WJNDG3X_cjs.transformReservedWord(name);
|
|
263
263
|
};
|
|
264
264
|
/**
|
|
265
265
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -597,7 +597,7 @@ Falling back on the first item.
|
|
|
597
597
|
}
|
|
598
598
|
#parse(plugin, pluginManager, context) {
|
|
599
599
|
const usedPluginNames = pluginManager.#usedPluginNames;
|
|
600
|
-
|
|
600
|
+
chunkHOFDXARN_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
601
601
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
602
602
|
if (plugin.context && typeof plugin.context === "function") {
|
|
603
603
|
return {
|
|
@@ -632,7 +632,7 @@ Falling back on the first item.
|
|
|
632
632
|
};
|
|
633
633
|
|
|
634
634
|
// src/config.ts
|
|
635
|
-
|
|
635
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
636
636
|
function defineConfig(options) {
|
|
637
637
|
return options;
|
|
638
638
|
}
|
|
@@ -640,9 +640,9 @@ function isInputPath(result) {
|
|
|
640
640
|
return !!result && "path" in result?.input;
|
|
641
641
|
}
|
|
642
642
|
async function setup(options) {
|
|
643
|
-
const { config: userConfig, logger =
|
|
643
|
+
const { config: userConfig, logger = chunkBWZNO5B2_cjs.createLogger() } = options;
|
|
644
644
|
try {
|
|
645
|
-
if (isInputPath(userConfig) && !new
|
|
645
|
+
if (isInputPath(userConfig) && !new chunkHOFDXARN_cjs.URLPath(userConfig.input.path).isURL) {
|
|
646
646
|
await fs.read(userConfig.input.path);
|
|
647
647
|
}
|
|
648
648
|
} catch (e) {
|
|
@@ -737,7 +737,7 @@ async function safeBuild(options) {
|
|
|
737
737
|
if (config.output.barrelType) {
|
|
738
738
|
await pluginManager.fileManager.add(rootFile);
|
|
739
739
|
}
|
|
740
|
-
files = await
|
|
740
|
+
files = await chunkHOFDXARN_cjs.processFiles({
|
|
741
741
|
root: config.root,
|
|
742
742
|
extension: config.output.extension,
|
|
743
743
|
dryRun: !config.output.write,
|
|
@@ -760,7 +760,7 @@ async function safeBuild(options) {
|
|
|
760
760
|
}
|
|
761
761
|
|
|
762
762
|
// src/BaseGenerator.ts
|
|
763
|
-
|
|
763
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
764
764
|
var BaseGenerator = class {
|
|
765
765
|
#options = {};
|
|
766
766
|
#context = {};
|
|
@@ -785,22 +785,22 @@ var BaseGenerator = class {
|
|
|
785
785
|
};
|
|
786
786
|
|
|
787
787
|
// src/PackageManager.ts
|
|
788
|
-
|
|
788
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
789
789
|
|
|
790
790
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
791
|
-
|
|
791
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
792
792
|
|
|
793
793
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
794
|
-
|
|
794
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
795
795
|
|
|
796
796
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
797
|
-
|
|
797
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
798
798
|
|
|
799
799
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
800
|
-
|
|
800
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
801
801
|
|
|
802
802
|
// ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
|
|
803
|
-
|
|
803
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
804
804
|
var Node = class {
|
|
805
805
|
value;
|
|
806
806
|
next;
|
|
@@ -998,13 +998,13 @@ function locatePathSync(paths, {
|
|
|
998
998
|
}
|
|
999
999
|
|
|
1000
1000
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
1001
|
-
|
|
1001
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
1002
1002
|
function toPath2(urlOrPath) {
|
|
1003
1003
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
1006
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
1007
|
-
|
|
1007
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
1008
1008
|
|
|
1009
1009
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
1010
1010
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -1206,15 +1206,15 @@ var PackageManager = class _PackageManager {
|
|
|
1206
1206
|
|
|
1207
1207
|
Object.defineProperty(exports, "FileManager", {
|
|
1208
1208
|
enumerable: true,
|
|
1209
|
-
get: function () { return
|
|
1209
|
+
get: function () { return chunkHOFDXARN_cjs.FileManager; }
|
|
1210
1210
|
});
|
|
1211
1211
|
Object.defineProperty(exports, "getSource", {
|
|
1212
1212
|
enumerable: true,
|
|
1213
|
-
get: function () { return
|
|
1213
|
+
get: function () { return chunkHOFDXARN_cjs.getSource; }
|
|
1214
1214
|
});
|
|
1215
1215
|
Object.defineProperty(exports, "processFiles", {
|
|
1216
1216
|
enumerable: true,
|
|
1217
|
-
get: function () { return
|
|
1217
|
+
get: function () { return chunkHOFDXARN_cjs.processFiles; }
|
|
1218
1218
|
});
|
|
1219
1219
|
exports.BaseGenerator = BaseGenerator;
|
|
1220
1220
|
exports.PackageManager = PackageManager;
|
package/dist/logger.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkBWZNO5B2_cjs = require('./chunk-BWZNO5B2.cjs');
|
|
4
|
+
require('./chunk-7ZWCCQIK.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "LogMapper", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkBWZNO5B2_cjs.LogMapper; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "createLogger", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkBWZNO5B2_cjs.createLogger; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "randomCliColour", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkBWZNO5B2_cjs.randomCliColour; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "randomColour", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkBWZNO5B2_cjs.randomColour; }
|
|
23
23
|
});
|
|
24
24
|
//# sourceMappingURL=logger.cjs.map
|
|
25
25
|
//# sourceMappingURL=logger.cjs.map
|
package/dist/mocks.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkHOFDXARN_cjs = require('./chunk-HOFDXARN.cjs');
|
|
4
|
+
var chunk4WJNDG3X_cjs = require('./chunk-4WJNDG3X.cjs');
|
|
5
|
+
var chunk7ZWCCQIK_cjs = require('./chunk-7ZWCCQIK.cjs');
|
|
6
6
|
var path = require('path');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
10
10
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
11
11
|
|
|
12
12
|
// mocks/index.ts
|
|
13
|
-
|
|
13
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
14
14
|
var mockedLogger = {
|
|
15
15
|
emit(type, message) {
|
|
16
16
|
},
|
|
@@ -21,15 +21,15 @@ var mockedLogger = {
|
|
|
21
21
|
var createMockedPluginManager = (name) => ({
|
|
22
22
|
resolveName: (result) => {
|
|
23
23
|
if (result.type === "file") {
|
|
24
|
-
return
|
|
24
|
+
return chunk4WJNDG3X_cjs.camelCase(name || result.name);
|
|
25
25
|
}
|
|
26
26
|
if (result.type === "type") {
|
|
27
|
-
return
|
|
27
|
+
return chunk4WJNDG3X_cjs.pascalCase(result.name);
|
|
28
28
|
}
|
|
29
29
|
if (result.type === "function") {
|
|
30
|
-
return
|
|
30
|
+
return chunk4WJNDG3X_cjs.camelCase(result.name);
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return chunk4WJNDG3X_cjs.camelCase(result.name);
|
|
33
33
|
},
|
|
34
34
|
config: {
|
|
35
35
|
output: {
|
|
@@ -65,7 +65,7 @@ async function matchFiles(files) {
|
|
|
65
65
|
return void 0;
|
|
66
66
|
}
|
|
67
67
|
for await (const file of files) {
|
|
68
|
-
const source = await
|
|
68
|
+
const source = await chunkHOFDXARN_cjs.getSource(chunkHOFDXARN_cjs.createFile(file), { logger: mockedLogger });
|
|
69
69
|
await expect(source).toMatchFileSnapshot(path__default.default.join("__snapshots__", file.path));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7ZWCCQIK_cjs = require('./chunk-7ZWCCQIK.cjs');
|
|
4
4
|
require('util');
|
|
5
5
|
var p = require('process');
|
|
6
6
|
var f = require('readline');
|
|
@@ -12,7 +12,7 @@ var p__default = /*#__PURE__*/_interopDefault(p);
|
|
|
12
12
|
var f__default = /*#__PURE__*/_interopDefault(f);
|
|
13
13
|
|
|
14
14
|
// ../../node_modules/.pnpm/consola@3.4.0/node_modules/consola/dist/chunks/prompt.mjs
|
|
15
|
-
|
|
15
|
+
chunk7ZWCCQIK_cjs.init_cjs_shims();
|
|
16
16
|
function getDefaultExportFromCjs(x2) {
|
|
17
17
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
18
18
|
}
|
|
@@ -758,5 +758,5 @@ async function prompt(message, opts = {}) {
|
|
|
758
758
|
|
|
759
759
|
exports.kCancel = kCancel;
|
|
760
760
|
exports.prompt = prompt;
|
|
761
|
-
//# sourceMappingURL=prompt-
|
|
762
|
-
//# sourceMappingURL=prompt-
|
|
761
|
+
//# sourceMappingURL=prompt-PLDPTBBZ.cjs.map
|
|
762
|
+
//# sourceMappingURL=prompt-PLDPTBBZ.cjs.map
|