@kubb/core 2.1.6 → 2.2.1
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-DU6UHGVD.cjs → chunk-2UXXYHS6.cjs} +5 -5
- package/dist/{chunk-NWXLHLH3.js → chunk-37XMXECQ.js} +3 -3
- package/dist/chunk-5SUBV3F7.cjs +15 -0
- package/dist/{chunk-IZOYUU2C.cjs → chunk-CZFLDKR5.cjs} +6 -6
- package/dist/{chunk-WHFBT7CJ.cjs → chunk-DM53DOLW.cjs} +90 -90
- package/dist/{chunk-QDYI7RBT.js → chunk-ETA3LCRB.js} +3 -3
- package/dist/{chunk-QDYI7RBT.js.map → chunk-ETA3LCRB.js.map} +1 -1
- package/dist/{chunk-Q4BVTLXG.js → chunk-GKW5TTFV.js} +2 -2
- package/dist/{chunk-D42WMZZ7.js → chunk-HI4PB2AG.js} +7 -7
- package/dist/{chunk-HGRAENXJ.js → chunk-IQBEGX4Z.js} +2 -2
- package/dist/{chunk-DQ3TMDDK.cjs → chunk-JSJ3NRBQ.cjs} +7 -7
- package/dist/{chunk-CDC7AOGD.cjs → chunk-KAA3L7N6.cjs} +3 -3
- package/dist/{chunk-CDC7AOGD.cjs.map → chunk-KAA3L7N6.cjs.map} +1 -1
- package/dist/{chunk-65JU7D5L.cjs → chunk-KXP7HD6Z.cjs} +3 -3
- package/dist/{chunk-OCZMQ7SF.js → chunk-MASAFU3G.js} +2 -2
- package/dist/{chunk-DAZBGE47.js → chunk-MYC5HIA5.js} +2 -2
- package/dist/{chunk-BOAROBF4.cjs → chunk-OI2AOR2F.cjs} +28 -19
- package/dist/chunk-OI2AOR2F.cjs.map +1 -0
- package/dist/{chunk-6TTDLGHW.cjs → chunk-OYDUQYAK.cjs} +220 -220
- package/dist/{chunk-34RQN4Y6.js → chunk-V6AVJEQC.js} +3 -3
- package/dist/{chunk-PTGWQCIU.cjs → chunk-XX56SVPB.cjs} +5 -5
- package/dist/{chunk-SR5FEIHD.js → chunk-YUTCMBUY.js} +2 -2
- package/dist/{chunk-XHS5C5AW.js → chunk-YW33IVCC.js} +2 -2
- package/dist/fs.cjs +10 -10
- package/dist/fs.js +4 -4
- package/dist/index.cjs +102 -102
- package/dist/index.js +11 -11
- package/dist/logger.cjs +7 -7
- package/dist/logger.js +3 -3
- package/dist/mocks.cjs +10 -10
- package/dist/mocks.js +8 -8
- package/dist/transformers.cjs +21 -21
- package/dist/transformers.js +5 -5
- package/dist/utils.cjs +13 -13
- package/dist/utils.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-BOAROBF4.cjs.map +0 -1
- package/dist/chunk-BYGMREPJ.cjs +0 -15
- /package/dist/{chunk-DU6UHGVD.cjs.map → chunk-2UXXYHS6.cjs.map} +0 -0
- /package/dist/{chunk-IZOYUU2C.cjs.map → chunk-37XMXECQ.js.map} +0 -0
- /package/dist/{chunk-BYGMREPJ.cjs.map → chunk-5SUBV3F7.cjs.map} +0 -0
- /package/dist/{chunk-NWXLHLH3.js.map → chunk-CZFLDKR5.cjs.map} +0 -0
- /package/dist/{chunk-WHFBT7CJ.cjs.map → chunk-DM53DOLW.cjs.map} +0 -0
- /package/dist/{chunk-Q4BVTLXG.js.map → chunk-GKW5TTFV.js.map} +0 -0
- /package/dist/{chunk-D42WMZZ7.js.map → chunk-HI4PB2AG.js.map} +0 -0
- /package/dist/{chunk-HGRAENXJ.js.map → chunk-IQBEGX4Z.js.map} +0 -0
- /package/dist/{chunk-34RQN4Y6.js.map → chunk-JSJ3NRBQ.cjs.map} +0 -0
- /package/dist/{chunk-65JU7D5L.cjs.map → chunk-KXP7HD6Z.cjs.map} +0 -0
- /package/dist/{chunk-OCZMQ7SF.js.map → chunk-MASAFU3G.js.map} +0 -0
- /package/dist/{chunk-DAZBGE47.js.map → chunk-MYC5HIA5.js.map} +0 -0
- /package/dist/{chunk-6TTDLGHW.cjs.map → chunk-OYDUQYAK.cjs.map} +0 -0
- /package/dist/{chunk-DQ3TMDDK.cjs.map → chunk-V6AVJEQC.js.map} +0 -0
- /package/dist/{chunk-PTGWQCIU.cjs.map → chunk-XX56SVPB.cjs.map} +0 -0
- /package/dist/{chunk-SR5FEIHD.js.map → chunk-YUTCMBUY.js.map} +0 -0
- /package/dist/{chunk-XHS5C5AW.js.map → chunk-YW33IVCC.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { writeLog } from './chunk-
|
|
2
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { writeLog } from './chunk-MYC5HIA5.js';
|
|
2
|
+
import { init_esm_shims } from './chunk-ETA3LCRB.js';
|
|
3
3
|
import seedrandom from 'seedrandom';
|
|
4
4
|
import { isatty } from 'tty';
|
|
5
5
|
|
|
@@ -149,4 +149,4 @@ function randomCliColour(text, colors = defaultColours) {
|
|
|
149
149
|
|
|
150
150
|
export { LogLevel, createLogger, p2 as p, randomCliColour, randomColour };
|
|
151
151
|
//# sourceMappingURL=out.js.map
|
|
152
|
-
//# sourceMappingURL=chunk-
|
|
152
|
+
//# sourceMappingURL=chunk-V6AVJEQC.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDM53DOLW_cjs = require('./chunk-DM53DOLW.cjs');
|
|
4
|
+
var chunkKAA3L7N6_cjs = require('./chunk-KAA3L7N6.cjs');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var jsRuntime = require('js-runtime');
|
|
7
7
|
|
|
8
8
|
// src/fs/read.ts
|
|
9
|
-
|
|
10
|
-
var import_fs_extra =
|
|
9
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
10
|
+
var import_fs_extra = chunkKAA3L7N6_cjs.__toESM(chunkDM53DOLW_cjs.require_lib(), 1);
|
|
11
11
|
function slash(path, platform = "linux") {
|
|
12
12
|
const isWindowsPath = /^\\\\\?\\/.test(path);
|
|
13
13
|
if (["linux", "mac"].includes(platform) && !isWindowsPath) {
|
|
@@ -60,4 +60,4 @@ exports.getRelativePath = getRelativePath;
|
|
|
60
60
|
exports.read = read;
|
|
61
61
|
exports.readSync = readSync;
|
|
62
62
|
//# sourceMappingURL=out.js.map
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# sourceMappingURL=chunk-XX56SVPB.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-ETA3LCRB.js';
|
|
2
2
|
import { relative, basename, extname } from 'path';
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
4
|
import { switcher } from 'js-runtime';
|
|
@@ -55,4 +55,4 @@ function readSync(path) {
|
|
|
55
55
|
|
|
56
56
|
export { getRelativePath, read, readSync };
|
|
57
57
|
//# sourceMappingURL=out.js.map
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-YUTCMBUY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-ETA3LCRB.js';
|
|
2
2
|
|
|
3
3
|
// src/utils/uniqueName.ts
|
|
4
4
|
init_esm_shims();
|
|
@@ -23,4 +23,4 @@ function setUniqueName(originalName, data) {
|
|
|
23
23
|
|
|
24
24
|
export { getUniqueName, setUniqueName };
|
|
25
25
|
//# sourceMappingURL=out.js.map
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-YW33IVCC.js.map
|
package/dist/fs.cjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunk5SUBV3F7_cjs = require('./chunk-5SUBV3F7.cjs');
|
|
4
|
+
var chunkXX56SVPB_cjs = require('./chunk-XX56SVPB.cjs');
|
|
5
|
+
var chunkDM53DOLW_cjs = require('./chunk-DM53DOLW.cjs');
|
|
6
|
+
var chunkKAA3L7N6_cjs = require('./chunk-KAA3L7N6.cjs');
|
|
7
7
|
|
|
8
8
|
// src/fs/index.ts
|
|
9
|
-
|
|
9
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "clean", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk5SUBV3F7_cjs.clean; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "getRelativePath", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkXX56SVPB_cjs.getRelativePath; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "read", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkXX56SVPB_cjs.read; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "readSync", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkXX56SVPB_cjs.readSync; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "write", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkDM53DOLW_cjs.write; }
|
|
30
30
|
});
|
|
31
31
|
//# sourceMappingURL=out.js.map
|
|
32
32
|
//# sourceMappingURL=fs.cjs.map
|
package/dist/fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { clean } from './chunk-
|
|
2
|
-
export { getRelativePath, read, readSync } from './chunk-
|
|
3
|
-
export { write } from './chunk-
|
|
4
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
export { clean } from './chunk-IQBEGX4Z.js';
|
|
2
|
+
export { getRelativePath, read, readSync } from './chunk-YUTCMBUY.js';
|
|
3
|
+
export { write } from './chunk-MYC5HIA5.js';
|
|
4
|
+
import { init_esm_shims } from './chunk-ETA3LCRB.js';
|
|
5
5
|
|
|
6
6
|
// src/fs/index.ts
|
|
7
7
|
init_esm_shims();
|
package/dist/index.cjs
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
14
|
-
var
|
|
5
|
+
var chunkCZFLDKR5_cjs = require('./chunk-CZFLDKR5.cjs');
|
|
6
|
+
var chunk5SUBV3F7_cjs = require('./chunk-5SUBV3F7.cjs');
|
|
7
|
+
var chunkOYDUQYAK_cjs = require('./chunk-OYDUQYAK.cjs');
|
|
8
|
+
require('./chunk-2UXXYHS6.cjs');
|
|
9
|
+
require('./chunk-KXP7HD6Z.cjs');
|
|
10
|
+
require('./chunk-OI2AOR2F.cjs');
|
|
11
|
+
var chunkJSJ3NRBQ_cjs = require('./chunk-JSJ3NRBQ.cjs');
|
|
12
|
+
var chunkXX56SVPB_cjs = require('./chunk-XX56SVPB.cjs');
|
|
13
|
+
require('./chunk-DM53DOLW.cjs');
|
|
14
|
+
var chunkKAA3L7N6_cjs = require('./chunk-KAA3L7N6.cjs');
|
|
15
15
|
var mod = require('module');
|
|
16
16
|
var os = require('os');
|
|
17
17
|
var url = require('url');
|
|
@@ -29,13 +29,13 @@ var process__default = /*#__PURE__*/_interopDefault(process);
|
|
|
29
29
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
30
30
|
|
|
31
31
|
// src/index.ts
|
|
32
|
-
|
|
32
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
33
33
|
|
|
34
34
|
// src/build.ts
|
|
35
|
-
|
|
35
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
36
36
|
|
|
37
37
|
// src/config.ts
|
|
38
|
-
|
|
38
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
39
39
|
function defineConfig(options) {
|
|
40
40
|
return options;
|
|
41
41
|
}
|
|
@@ -48,16 +48,16 @@ async function transformReducer(_previousCode, result, _plugin) {
|
|
|
48
48
|
return result;
|
|
49
49
|
}
|
|
50
50
|
async function setup(options) {
|
|
51
|
-
const { config, logger =
|
|
51
|
+
const { config, logger = chunkJSJ3NRBQ_cjs.createLogger({ logLevel: chunkJSJ3NRBQ_cjs.LogLevel.silent }) } = options;
|
|
52
52
|
let count = 0;
|
|
53
53
|
try {
|
|
54
|
-
if (isInputPath(config) && !new
|
|
55
|
-
await
|
|
54
|
+
if (isInputPath(config) && !new chunkCZFLDKR5_cjs.URLPath(config.input.path).isURL) {
|
|
55
|
+
await chunkXX56SVPB_cjs.read(config.input.path);
|
|
56
56
|
}
|
|
57
57
|
} catch (e) {
|
|
58
58
|
if (isInputPath(config)) {
|
|
59
59
|
throw new Error(
|
|
60
|
-
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " +
|
|
60
|
+
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + chunkJSJ3NRBQ_cjs.p.dim(config.input.path),
|
|
61
61
|
{
|
|
62
62
|
cause: e
|
|
63
63
|
}
|
|
@@ -65,19 +65,19 @@ async function setup(options) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
if (config.output.clean) {
|
|
68
|
-
await
|
|
68
|
+
await chunk5SUBV3F7_cjs.clean(config.output.path);
|
|
69
69
|
}
|
|
70
70
|
const task = async (file) => {
|
|
71
71
|
const { path: path3 } = file;
|
|
72
|
-
let source =
|
|
72
|
+
let source = chunkOYDUQYAK_cjs.FileManager.getSource(file);
|
|
73
73
|
const { result: loadedResult } = await pluginManager.hookFirst({
|
|
74
74
|
hookName: "load",
|
|
75
75
|
parameters: [path3]
|
|
76
76
|
});
|
|
77
|
-
if (loadedResult &&
|
|
77
|
+
if (loadedResult && chunkOYDUQYAK_cjs.isPromise(loadedResult)) {
|
|
78
78
|
source = await loadedResult;
|
|
79
79
|
}
|
|
80
|
-
if (loadedResult && !
|
|
80
|
+
if (loadedResult && !chunkOYDUQYAK_cjs.isPromise(loadedResult)) {
|
|
81
81
|
source = loadedResult;
|
|
82
82
|
}
|
|
83
83
|
if (source) {
|
|
@@ -105,13 +105,13 @@ async function setup(options) {
|
|
|
105
105
|
source: source || ""
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
-
const pluginManager = new
|
|
108
|
+
const pluginManager = new chunkOYDUQYAK_cjs.PluginManager(config, { logger, task });
|
|
109
109
|
pluginManager.on("execute", (executer) => {
|
|
110
110
|
const { hookName, parameters, plugin } = executer;
|
|
111
111
|
if (hookName === "writeFile" && logger.spinner) {
|
|
112
112
|
const [code] = parameters;
|
|
113
|
-
if (logger.logLevel ===
|
|
114
|
-
logger.debug(`PluginKey ${
|
|
113
|
+
if (logger.logLevel === chunkJSJ3NRBQ_cjs.LogLevel.debug) {
|
|
114
|
+
logger.debug(`PluginKey ${chunkJSJ3NRBQ_cjs.p.dim(JSON.stringify(plugin.key))}
|
|
115
115
|
with source
|
|
116
116
|
|
|
117
117
|
${code}`);
|
|
@@ -119,7 +119,7 @@ ${code}`);
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
pluginManager.queue.on("add", () => {
|
|
122
|
-
if (logger.logLevel !==
|
|
122
|
+
if (logger.logLevel !== chunkJSJ3NRBQ_cjs.LogLevel.info) {
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
if (logger.spinner && count === 0) {
|
|
@@ -127,32 +127,32 @@ ${code}`);
|
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
pluginManager.queue.on("active", () => {
|
|
130
|
-
if (logger.logLevel !==
|
|
130
|
+
if (logger.logLevel !== chunkJSJ3NRBQ_cjs.LogLevel.info) {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
if (logger.spinner && pluginManager.queue.size > 0) {
|
|
134
134
|
const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
|
|
135
|
-
logger.spinner.suffixText =
|
|
135
|
+
logger.spinner.suffixText = chunkJSJ3NRBQ_cjs.p.dim(text);
|
|
136
136
|
}
|
|
137
137
|
++count;
|
|
138
138
|
});
|
|
139
139
|
pluginManager.queue.on("completed", () => {
|
|
140
|
-
if (logger.logLevel !==
|
|
140
|
+
if (logger.logLevel !== chunkJSJ3NRBQ_cjs.LogLevel.info) {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
if (logger.spinner) {
|
|
144
144
|
const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
|
|
145
|
-
logger.spinner.suffixText =
|
|
145
|
+
logger.spinner.suffixText = chunkJSJ3NRBQ_cjs.p.dim(text);
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
pluginManager.on("executed", (executer) => {
|
|
149
149
|
const { hookName, plugin, output, parameters } = executer;
|
|
150
|
-
if (logger.logLevel ===
|
|
150
|
+
if (logger.logLevel === chunkJSJ3NRBQ_cjs.LogLevel.debug) {
|
|
151
151
|
const logs = [
|
|
152
|
-
`${
|
|
153
|
-
parameters && `${
|
|
152
|
+
`${chunkJSJ3NRBQ_cjs.randomCliColour(plugin.name)} Executing ${hookName}`,
|
|
153
|
+
parameters && `${chunkJSJ3NRBQ_cjs.p.bgWhite(`Parameters`)} ${chunkJSJ3NRBQ_cjs.randomCliColour(plugin.name)} ${hookName}`,
|
|
154
154
|
JSON.stringify(parameters, void 0, 2),
|
|
155
|
-
output && `${
|
|
155
|
+
output && `${chunkJSJ3NRBQ_cjs.p.bgWhite("Output")} ${chunkJSJ3NRBQ_cjs.randomCliColour(plugin.name)} ${hookName}`,
|
|
156
156
|
output
|
|
157
157
|
].filter(Boolean);
|
|
158
158
|
logger.debug(logs.join("\n"));
|
|
@@ -168,11 +168,11 @@ async function build(options) {
|
|
|
168
168
|
parameters: [options.config]
|
|
169
169
|
});
|
|
170
170
|
await pluginManager.hookParallel({ hookName: "buildEnd" });
|
|
171
|
-
if (logger.logLevel ===
|
|
171
|
+
if (logger.logLevel === chunkJSJ3NRBQ_cjs.LogLevel.info && logger.spinner) {
|
|
172
172
|
logger.spinner.suffixText = "";
|
|
173
173
|
logger.spinner.succeed(`\u{1F4BE} Writing completed`);
|
|
174
174
|
}
|
|
175
|
-
return { files: fileManager.files.map((file) => ({ ...file, source:
|
|
175
|
+
return { files: fileManager.files.map((file) => ({ ...file, source: chunkOYDUQYAK_cjs.FileManager.getSource(file) })), pluginManager };
|
|
176
176
|
}
|
|
177
177
|
async function safeBuild(options) {
|
|
178
178
|
const pluginManager = await setup(options);
|
|
@@ -183,106 +183,106 @@ async function safeBuild(options) {
|
|
|
183
183
|
parameters: [options.config]
|
|
184
184
|
});
|
|
185
185
|
await pluginManager.hookParallel({ hookName: "buildEnd" });
|
|
186
|
-
if (logger.logLevel ===
|
|
186
|
+
if (logger.logLevel === chunkJSJ3NRBQ_cjs.LogLevel.info && logger.spinner) {
|
|
187
187
|
logger.spinner.suffixText = "";
|
|
188
188
|
logger.spinner.succeed(`\u{1F4BE} Writing completed`);
|
|
189
189
|
}
|
|
190
190
|
} catch (e) {
|
|
191
|
-
return { files: fileManager.files.map((file) => ({ ...file, source:
|
|
191
|
+
return { files: fileManager.files.map((file) => ({ ...file, source: chunkOYDUQYAK_cjs.FileManager.getSource(file) })), pluginManager, error: e };
|
|
192
192
|
}
|
|
193
|
-
return { files: fileManager.files.map((file) => ({ ...file, source:
|
|
193
|
+
return { files: fileManager.files.map((file) => ({ ...file, source: chunkOYDUQYAK_cjs.FileManager.getSource(file) })), pluginManager };
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
// src/Generator.ts
|
|
197
|
-
|
|
197
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
198
198
|
var _options, _context;
|
|
199
199
|
var Generator = class {
|
|
200
200
|
constructor(options, context) {
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _options, {});
|
|
202
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _context, {});
|
|
203
203
|
if (context) {
|
|
204
|
-
|
|
204
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _context, context);
|
|
205
205
|
}
|
|
206
206
|
if (options) {
|
|
207
|
-
|
|
207
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _options, options);
|
|
208
208
|
}
|
|
209
209
|
return this;
|
|
210
210
|
}
|
|
211
211
|
get options() {
|
|
212
|
-
return
|
|
212
|
+
return chunkKAA3L7N6_cjs.__privateGet(this, _options);
|
|
213
213
|
}
|
|
214
214
|
get context() {
|
|
215
|
-
return
|
|
215
|
+
return chunkKAA3L7N6_cjs.__privateGet(this, _context);
|
|
216
216
|
}
|
|
217
217
|
set options(options) {
|
|
218
|
-
|
|
218
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _options, { ...chunkKAA3L7N6_cjs.__privateGet(this, _options), ...options });
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
221
|
_options = new WeakMap();
|
|
222
222
|
_context = new WeakMap();
|
|
223
223
|
|
|
224
224
|
// src/PackageManager.ts
|
|
225
|
-
|
|
225
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
226
226
|
|
|
227
227
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
228
|
-
|
|
228
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
229
229
|
|
|
230
230
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
231
|
-
|
|
231
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
232
232
|
|
|
233
233
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
234
|
-
|
|
234
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
235
235
|
|
|
236
236
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
237
|
-
|
|
237
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
238
238
|
|
|
239
239
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
240
|
-
|
|
240
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
241
241
|
var Node = class {
|
|
242
242
|
constructor(value) {
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
chunkKAA3L7N6_cjs.__publicField(this, "value");
|
|
244
|
+
chunkKAA3L7N6_cjs.__publicField(this, "next");
|
|
245
245
|
this.value = value;
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
248
|
var _head, _tail, _size;
|
|
249
249
|
var Queue = class {
|
|
250
250
|
constructor() {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _head, void 0);
|
|
252
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _tail, void 0);
|
|
253
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _size, void 0);
|
|
254
254
|
this.clear();
|
|
255
255
|
}
|
|
256
256
|
enqueue(value) {
|
|
257
257
|
const node = new Node(value);
|
|
258
|
-
if (
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
if (chunkKAA3L7N6_cjs.__privateGet(this, _head)) {
|
|
259
|
+
chunkKAA3L7N6_cjs.__privateGet(this, _tail).next = node;
|
|
260
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _tail, node);
|
|
261
261
|
} else {
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _head, node);
|
|
263
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _tail, node);
|
|
264
264
|
}
|
|
265
|
-
|
|
265
|
+
chunkKAA3L7N6_cjs.__privateWrapper(this, _size)._++;
|
|
266
266
|
}
|
|
267
267
|
dequeue() {
|
|
268
|
-
const current =
|
|
268
|
+
const current = chunkKAA3L7N6_cjs.__privateGet(this, _head);
|
|
269
269
|
if (!current) {
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _head, chunkKAA3L7N6_cjs.__privateGet(this, _head).next);
|
|
273
|
+
chunkKAA3L7N6_cjs.__privateWrapper(this, _size)._--;
|
|
274
274
|
return current.value;
|
|
275
275
|
}
|
|
276
276
|
clear() {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _head, void 0);
|
|
278
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _tail, void 0);
|
|
279
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _size, 0);
|
|
280
280
|
}
|
|
281
281
|
get size() {
|
|
282
|
-
return
|
|
282
|
+
return chunkKAA3L7N6_cjs.__privateGet(this, _size);
|
|
283
283
|
}
|
|
284
284
|
*[Symbol.iterator]() {
|
|
285
|
-
let current =
|
|
285
|
+
let current = chunkKAA3L7N6_cjs.__privateGet(this, _head);
|
|
286
286
|
while (current) {
|
|
287
287
|
yield current.value;
|
|
288
288
|
current = current.next;
|
|
@@ -433,13 +433,13 @@ function locatePathSync(paths, {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
436
|
-
|
|
436
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
437
437
|
function toPath2(urlOrPath) {
|
|
438
438
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
442
|
-
|
|
442
|
+
chunkKAA3L7N6_cjs.init_cjs_shims();
|
|
443
443
|
|
|
444
444
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
445
445
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -518,30 +518,30 @@ function findUpSync(name, options = {}) {
|
|
|
518
518
|
var _cache, _cwd, _SLASHES, _match, match_fn;
|
|
519
519
|
var _PackageManager = class _PackageManager {
|
|
520
520
|
constructor(workspace) {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
521
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _match);
|
|
522
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _cwd, void 0);
|
|
523
|
+
chunkKAA3L7N6_cjs.__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
|
|
524
524
|
if (workspace) {
|
|
525
|
-
|
|
525
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _cwd, workspace);
|
|
526
526
|
}
|
|
527
527
|
return this;
|
|
528
528
|
}
|
|
529
529
|
set workspace(workspace) {
|
|
530
|
-
|
|
530
|
+
chunkKAA3L7N6_cjs.__privateSet(this, _cwd, workspace);
|
|
531
531
|
}
|
|
532
532
|
get workspace() {
|
|
533
|
-
return
|
|
533
|
+
return chunkKAA3L7N6_cjs.__privateGet(this, _cwd);
|
|
534
534
|
}
|
|
535
535
|
normalizeDirectory(directory) {
|
|
536
|
-
if (!
|
|
536
|
+
if (!chunkKAA3L7N6_cjs.__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
|
|
537
537
|
return `${directory}/`;
|
|
538
538
|
}
|
|
539
539
|
return directory;
|
|
540
540
|
}
|
|
541
541
|
getLocation(path3) {
|
|
542
542
|
let location = path3;
|
|
543
|
-
if (
|
|
544
|
-
const require2 = mod__default.default.createRequire(this.normalizeDirectory(
|
|
543
|
+
if (chunkKAA3L7N6_cjs.__privateGet(this, _cwd)) {
|
|
544
|
+
const require2 = mod__default.default.createRequire(this.normalizeDirectory(chunkKAA3L7N6_cjs.__privateGet(this, _cwd)));
|
|
545
545
|
location = require2.resolve(path3);
|
|
546
546
|
}
|
|
547
547
|
return location;
|
|
@@ -561,46 +561,46 @@ var _PackageManager = class _PackageManager {
|
|
|
561
561
|
}
|
|
562
562
|
async getPackageJSON() {
|
|
563
563
|
const pkgPath = await findUp(["package.json"], {
|
|
564
|
-
cwd:
|
|
564
|
+
cwd: chunkKAA3L7N6_cjs.__privateGet(this, _cwd)
|
|
565
565
|
});
|
|
566
566
|
if (!pkgPath) {
|
|
567
567
|
return void 0;
|
|
568
568
|
}
|
|
569
|
-
const json = await
|
|
569
|
+
const json = await chunkXX56SVPB_cjs.read(pkgPath);
|
|
570
570
|
return JSON.parse(json);
|
|
571
571
|
}
|
|
572
572
|
getPackageJSONSync() {
|
|
573
573
|
const pkgPath = findUpSync(["package.json"], {
|
|
574
|
-
cwd:
|
|
574
|
+
cwd: chunkKAA3L7N6_cjs.__privateGet(this, _cwd)
|
|
575
575
|
});
|
|
576
576
|
if (!pkgPath) {
|
|
577
577
|
return void 0;
|
|
578
578
|
}
|
|
579
|
-
const json =
|
|
579
|
+
const json = chunkXX56SVPB_cjs.readSync(pkgPath);
|
|
580
580
|
return JSON.parse(json);
|
|
581
581
|
}
|
|
582
582
|
static setVersion(dependency, version) {
|
|
583
|
-
|
|
583
|
+
chunkKAA3L7N6_cjs.__privateGet(_PackageManager, _cache)[dependency] = version;
|
|
584
584
|
}
|
|
585
585
|
async getVersion(dependency) {
|
|
586
|
-
if (typeof dependency === "string" &&
|
|
587
|
-
return
|
|
586
|
+
if (typeof dependency === "string" && chunkKAA3L7N6_cjs.__privateGet(_PackageManager, _cache)[dependency]) {
|
|
587
|
+
return chunkKAA3L7N6_cjs.__privateGet(_PackageManager, _cache)[dependency];
|
|
588
588
|
}
|
|
589
589
|
const packageJSON = await this.getPackageJSON();
|
|
590
590
|
if (!packageJSON) {
|
|
591
591
|
return void 0;
|
|
592
592
|
}
|
|
593
|
-
return
|
|
593
|
+
return chunkKAA3L7N6_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
594
594
|
}
|
|
595
595
|
getVersionSync(dependency) {
|
|
596
|
-
if (typeof dependency === "string" &&
|
|
597
|
-
return
|
|
596
|
+
if (typeof dependency === "string" && chunkKAA3L7N6_cjs.__privateGet(_PackageManager, _cache)[dependency]) {
|
|
597
|
+
return chunkKAA3L7N6_cjs.__privateGet(_PackageManager, _cache)[dependency];
|
|
598
598
|
}
|
|
599
599
|
const packageJSON = this.getPackageJSONSync();
|
|
600
600
|
if (!packageJSON) {
|
|
601
601
|
return void 0;
|
|
602
602
|
}
|
|
603
|
-
return
|
|
603
|
+
return chunkKAA3L7N6_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
604
604
|
}
|
|
605
605
|
async isValid(dependency, version) {
|
|
606
606
|
const packageVersion = await this.getVersion(dependency);
|
|
@@ -643,7 +643,7 @@ match_fn = function(packageJSON, dependency) {
|
|
|
643
643
|
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
644
644
|
return matchedDependency ? dependencies[matchedDependency] : void 0;
|
|
645
645
|
};
|
|
646
|
-
|
|
646
|
+
chunkKAA3L7N6_cjs.__privateAdd(_PackageManager, _cache, {});
|
|
647
647
|
var PackageManager = _PackageManager;
|
|
648
648
|
|
|
649
649
|
// src/index.ts
|
|
@@ -651,35 +651,35 @@ var src_default = build;
|
|
|
651
651
|
|
|
652
652
|
Object.defineProperty(exports, "FileManager", {
|
|
653
653
|
enumerable: true,
|
|
654
|
-
get: function () { return
|
|
654
|
+
get: function () { return chunkOYDUQYAK_cjs.FileManager; }
|
|
655
655
|
});
|
|
656
656
|
Object.defineProperty(exports, "KubbFile", {
|
|
657
657
|
enumerable: true,
|
|
658
|
-
get: function () { return
|
|
658
|
+
get: function () { return chunkOYDUQYAK_cjs.KubbFile; }
|
|
659
659
|
});
|
|
660
660
|
Object.defineProperty(exports, "PluginManager", {
|
|
661
661
|
enumerable: true,
|
|
662
|
-
get: function () { return
|
|
662
|
+
get: function () { return chunkOYDUQYAK_cjs.PluginManager; }
|
|
663
663
|
});
|
|
664
664
|
Object.defineProperty(exports, "PromiseManager", {
|
|
665
665
|
enumerable: true,
|
|
666
|
-
get: function () { return
|
|
666
|
+
get: function () { return chunkOYDUQYAK_cjs.PromiseManager; }
|
|
667
667
|
});
|
|
668
668
|
Object.defineProperty(exports, "Warning", {
|
|
669
669
|
enumerable: true,
|
|
670
|
-
get: function () { return
|
|
670
|
+
get: function () { return chunkOYDUQYAK_cjs.Warning; }
|
|
671
671
|
});
|
|
672
672
|
Object.defineProperty(exports, "createPlugin", {
|
|
673
673
|
enumerable: true,
|
|
674
|
-
get: function () { return
|
|
674
|
+
get: function () { return chunkOYDUQYAK_cjs.createPlugin; }
|
|
675
675
|
});
|
|
676
676
|
Object.defineProperty(exports, "name", {
|
|
677
677
|
enumerable: true,
|
|
678
|
-
get: function () { return
|
|
678
|
+
get: function () { return chunkOYDUQYAK_cjs.pluginName; }
|
|
679
679
|
});
|
|
680
680
|
Object.defineProperty(exports, "pluginName", {
|
|
681
681
|
enumerable: true,
|
|
682
|
-
get: function () { return
|
|
682
|
+
get: function () { return chunkOYDUQYAK_cjs.pluginName; }
|
|
683
683
|
});
|
|
684
684
|
exports.Generator = Generator;
|
|
685
685
|
exports.PackageManager = PackageManager;
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { URLPath } from './chunk-
|
|
2
|
-
import { clean } from './chunk-
|
|
3
|
-
import { FileManager, PluginManager, isPromise } from './chunk-
|
|
4
|
-
export { FileManager, KubbFile, PluginManager, PromiseManager, Warning, createPlugin, pluginName as name, pluginName } from './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import { LogLevel, createLogger, p, randomCliColour } from './chunk-
|
|
9
|
-
import { read, readSync } from './chunk-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import { init_esm_shims, __privateAdd, __privateSet, __privateGet, __privateMethod } from './chunk-
|
|
1
|
+
import { URLPath } from './chunk-37XMXECQ.js';
|
|
2
|
+
import { clean } from './chunk-IQBEGX4Z.js';
|
|
3
|
+
import { FileManager, PluginManager, isPromise } from './chunk-HI4PB2AG.js';
|
|
4
|
+
export { FileManager, KubbFile, PluginManager, PromiseManager, Warning, createPlugin, pluginName as name, pluginName } from './chunk-HI4PB2AG.js';
|
|
5
|
+
import './chunk-GKW5TTFV.js';
|
|
6
|
+
import './chunk-YW33IVCC.js';
|
|
7
|
+
import './chunk-MASAFU3G.js';
|
|
8
|
+
import { LogLevel, createLogger, p, randomCliColour } from './chunk-V6AVJEQC.js';
|
|
9
|
+
import { read, readSync } from './chunk-YUTCMBUY.js';
|
|
10
|
+
import './chunk-MYC5HIA5.js';
|
|
11
|
+
import { init_esm_shims, __privateAdd, __privateSet, __privateGet, __privateMethod } from './chunk-ETA3LCRB.js';
|
|
12
12
|
import mod from 'module';
|
|
13
13
|
import os from 'os';
|
|
14
14
|
import { pathToFileURL } from 'url';
|