@kubb/core 3.0.0-alpha.26 → 3.0.0-alpha.28
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-A7X6ELER.cjs → chunk-6KGAP5LO.cjs} +4 -4
- package/dist/{chunk-A7X6ELER.cjs.map → chunk-6KGAP5LO.cjs.map} +1 -1
- package/dist/{chunk-F2DRWFZG.cjs → chunk-BQ5EEZ3C.cjs} +6 -6
- package/dist/{chunk-F2DRWFZG.cjs.map → chunk-BQ5EEZ3C.cjs.map} +1 -1
- package/dist/{chunk-GX2TYGYS.cjs → chunk-E3LZA47U.cjs} +8 -8
- package/dist/{chunk-GX2TYGYS.cjs.map → chunk-E3LZA47U.cjs.map} +1 -1
- package/dist/{chunk-I3BSE2DS.cjs → chunk-P655QOG5.cjs} +4 -4
- package/dist/{chunk-I3BSE2DS.cjs.map → chunk-P655QOG5.cjs.map} +1 -1
- package/dist/{chunk-PBZUIPXL.cjs → chunk-YKBUGVEZ.cjs} +10 -10
- package/dist/{chunk-PBZUIPXL.cjs.map → chunk-YKBUGVEZ.cjs.map} +1 -1
- package/dist/{chunk-667CXVCV.cjs → chunk-YZITPSOO.cjs} +33 -33
- package/dist/{chunk-667CXVCV.cjs.map → chunk-YZITPSOO.cjs.map} +1 -1
- package/dist/index.cjs +34 -34
- package/dist/logger.cjs +7 -7
- package/dist/mocks.cjs +9 -9
- package/dist/{prompt-UOXFE7WX.cjs → prompt-2EVJOUVT.cjs} +62 -62
- package/dist/{prompt-UOXFE7WX.cjs.map → prompt-2EVJOUVT.cjs.map} +1 -1
- package/dist/transformers.cjs +23 -23
- package/dist/utils.cjs +17 -17
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
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
|
-
var
|
|
5
|
+
var chunkP655QOG5_cjs = require('./chunk-P655QOG5.cjs');
|
|
6
|
+
var chunkYKBUGVEZ_cjs = require('./chunk-YKBUGVEZ.cjs');
|
|
7
|
+
var chunkYZITPSOO_cjs = require('./chunk-YZITPSOO.cjs');
|
|
8
|
+
require('./chunk-BQ5EEZ3C.cjs');
|
|
9
|
+
require('./chunk-E3LZA47U.cjs');
|
|
10
|
+
var chunk6KGAP5LO_cjs = require('./chunk-6KGAP5LO.cjs');
|
|
11
11
|
var fs = require('@kubb/fs');
|
|
12
12
|
var path3 = require('path');
|
|
13
13
|
var mod = require('module');
|
|
@@ -26,19 +26,19 @@ var process__default = /*#__PURE__*/_interopDefault(process);
|
|
|
26
26
|
var fs__default = /*#__PURE__*/_interopDefault(fs$1);
|
|
27
27
|
|
|
28
28
|
// src/index.ts
|
|
29
|
-
|
|
29
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
30
30
|
|
|
31
31
|
// src/build.ts
|
|
32
|
-
|
|
32
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
33
33
|
|
|
34
34
|
// src/PluginManager.ts
|
|
35
|
-
|
|
35
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
36
36
|
|
|
37
37
|
// src/PromiseManager.ts
|
|
38
|
-
|
|
38
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
39
39
|
|
|
40
40
|
// src/utils/executeStrategies.ts
|
|
41
|
-
|
|
41
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
42
42
|
function hookSeq(promises) {
|
|
43
43
|
return promises.filter(Boolean).reduce(
|
|
44
44
|
(promise, func) => {
|
|
@@ -100,12 +100,12 @@ function isPromiseRejectedResult(result) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
// src/errors.ts
|
|
103
|
-
|
|
103
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
104
104
|
var ValidationPluginError = class extends Error {
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
// src/plugin.ts
|
|
108
|
-
|
|
108
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
109
109
|
function createPlugin(factory) {
|
|
110
110
|
return (options = {}) => {
|
|
111
111
|
return factory(options);
|
|
@@ -156,7 +156,7 @@ var pluginCore = createPlugin((options) => {
|
|
|
156
156
|
var PluginManager = class {
|
|
157
157
|
plugins = /* @__PURE__ */ new Set();
|
|
158
158
|
fileManager;
|
|
159
|
-
events = new
|
|
159
|
+
events = new chunkYKBUGVEZ_cjs.EventEmitter();
|
|
160
160
|
config;
|
|
161
161
|
executed = [];
|
|
162
162
|
logger;
|
|
@@ -168,7 +168,7 @@ var PluginManager = class {
|
|
|
168
168
|
this.config = config;
|
|
169
169
|
this.options = options;
|
|
170
170
|
this.logger = options.logger;
|
|
171
|
-
this.fileManager = new
|
|
171
|
+
this.fileManager = new chunkYZITPSOO_cjs.FileManager();
|
|
172
172
|
this.#promiseManager = new PromiseManager({
|
|
173
173
|
nullCheck: (state) => !!state?.result
|
|
174
174
|
});
|
|
@@ -254,14 +254,14 @@ Falling back on the first item.
|
|
|
254
254
|
]
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
return
|
|
257
|
+
return chunkP655QOG5_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
258
258
|
}
|
|
259
259
|
const name = this.hookFirstSync({
|
|
260
260
|
hookName: "resolveName",
|
|
261
261
|
parameters: [params.name, params.type],
|
|
262
262
|
message: `Resolving name '${params.name}' and type '${params.type}'`
|
|
263
263
|
}).result;
|
|
264
|
-
return
|
|
264
|
+
return chunkP655QOG5_cjs.transformReservedWord(name);
|
|
265
265
|
};
|
|
266
266
|
/**
|
|
267
267
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -617,7 +617,7 @@ Falling back on the first item.
|
|
|
617
617
|
}
|
|
618
618
|
#parse(plugin, pluginManager, context) {
|
|
619
619
|
const usedPluginNames = pluginManager.#usedPluginNames;
|
|
620
|
-
|
|
620
|
+
chunkYZITPSOO_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
621
621
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
622
622
|
if (plugin.context && typeof plugin.context === "function") {
|
|
623
623
|
return {
|
|
@@ -652,7 +652,7 @@ Falling back on the first item.
|
|
|
652
652
|
};
|
|
653
653
|
|
|
654
654
|
// src/config.ts
|
|
655
|
-
|
|
655
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
656
656
|
function defineConfig(options) {
|
|
657
657
|
return options;
|
|
658
658
|
}
|
|
@@ -660,9 +660,9 @@ function isInputPath(result) {
|
|
|
660
660
|
return !!result && "path" in result?.input;
|
|
661
661
|
}
|
|
662
662
|
async function setup(options) {
|
|
663
|
-
const { config, logger =
|
|
663
|
+
const { config, logger = chunkYKBUGVEZ_cjs.createLogger() } = options;
|
|
664
664
|
try {
|
|
665
|
-
if (isInputPath(config) && !new
|
|
665
|
+
if (isInputPath(config) && !new chunkYZITPSOO_cjs.URLPath(config.input.path).isURL) {
|
|
666
666
|
await fs.read(config.input.path);
|
|
667
667
|
}
|
|
668
668
|
} catch (e) {
|
|
@@ -726,7 +726,7 @@ async function safeBuild(options) {
|
|
|
726
726
|
if (options2.output?.exportType === false) {
|
|
727
727
|
return void 0;
|
|
728
728
|
}
|
|
729
|
-
if (
|
|
729
|
+
if (chunkYZITPSOO_cjs.FileManager.getMode(options2.output?.path) === "single") {
|
|
730
730
|
return void 0;
|
|
731
731
|
}
|
|
732
732
|
return {
|
|
@@ -742,7 +742,7 @@ async function safeBuild(options) {
|
|
|
742
742
|
if (options.config.output.exportType) {
|
|
743
743
|
await pluginManager.fileManager.add(rootFile);
|
|
744
744
|
}
|
|
745
|
-
files = await
|
|
745
|
+
files = await chunkYZITPSOO_cjs.processFiles({
|
|
746
746
|
config: options.config,
|
|
747
747
|
dryRun: !options.config.output.write,
|
|
748
748
|
files: pluginManager.fileManager.files,
|
|
@@ -764,7 +764,7 @@ async function safeBuild(options) {
|
|
|
764
764
|
}
|
|
765
765
|
|
|
766
766
|
// src/BaseGenerator.ts
|
|
767
|
-
|
|
767
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
768
768
|
var BaseGenerator = class {
|
|
769
769
|
#options = {};
|
|
770
770
|
#context = {};
|
|
@@ -789,22 +789,22 @@ var BaseGenerator = class {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
// src/PackageManager.ts
|
|
792
|
-
|
|
792
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
793
793
|
|
|
794
794
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
795
|
-
|
|
795
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
796
796
|
|
|
797
797
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
798
|
-
|
|
798
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
799
799
|
|
|
800
800
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
801
|
-
|
|
801
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
802
802
|
|
|
803
803
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
804
|
-
|
|
804
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
805
805
|
|
|
806
806
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
807
|
-
|
|
807
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
808
808
|
var Node = class {
|
|
809
809
|
value;
|
|
810
810
|
next;
|
|
@@ -996,13 +996,13 @@ function locatePathSync(paths, {
|
|
|
996
996
|
}
|
|
997
997
|
|
|
998
998
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
999
|
-
|
|
999
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
1000
1000
|
function toPath2(urlOrPath) {
|
|
1001
1001
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
1004
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
1005
|
-
|
|
1005
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
1006
1006
|
|
|
1007
1007
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
1008
1008
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -1204,11 +1204,11 @@ var PackageManager = class _PackageManager {
|
|
|
1204
1204
|
|
|
1205
1205
|
Object.defineProperty(exports, "FileManager", {
|
|
1206
1206
|
enumerable: true,
|
|
1207
|
-
get: function () { return
|
|
1207
|
+
get: function () { return chunkYZITPSOO_cjs.FileManager; }
|
|
1208
1208
|
});
|
|
1209
1209
|
Object.defineProperty(exports, "getSource", {
|
|
1210
1210
|
enumerable: true,
|
|
1211
|
-
get: function () { return
|
|
1211
|
+
get: function () { return chunkYZITPSOO_cjs.getSource; }
|
|
1212
1212
|
});
|
|
1213
1213
|
exports.BaseGenerator = BaseGenerator;
|
|
1214
1214
|
exports.PackageManager = PackageManager;
|
package/dist/logger.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkYKBUGVEZ_cjs = require('./chunk-YKBUGVEZ.cjs');
|
|
4
|
+
require('./chunk-E3LZA47U.cjs');
|
|
5
|
+
require('./chunk-6KGAP5LO.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "LogMapper", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkYKBUGVEZ_cjs.LogMapper; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "createLogger", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkYKBUGVEZ_cjs.createLogger; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "randomCliColour", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkYKBUGVEZ_cjs.randomCliColour; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "randomColour", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkYKBUGVEZ_cjs.randomColour; }
|
|
24
24
|
});
|
|
25
25
|
//# sourceMappingURL=logger.cjs.map
|
|
26
26
|
//# 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 chunkYZITPSOO_cjs = require('./chunk-YZITPSOO.cjs');
|
|
4
|
+
var chunkBQ5EEZ3C_cjs = require('./chunk-BQ5EEZ3C.cjs');
|
|
5
|
+
var chunk6KGAP5LO_cjs = require('./chunk-6KGAP5LO.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
|
+
chunk6KGAP5LO_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 chunkBQ5EEZ3C_cjs.camelCase(name || result.name);
|
|
25
25
|
}
|
|
26
26
|
if (result.type === "type") {
|
|
27
|
-
return
|
|
27
|
+
return chunkBQ5EEZ3C_cjs.pascalCase(result.name);
|
|
28
28
|
}
|
|
29
29
|
if (result.type === "function") {
|
|
30
|
-
return
|
|
30
|
+
return chunkBQ5EEZ3C_cjs.camelCase(result.name);
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return chunkBQ5EEZ3C_cjs.camelCase(result.name);
|
|
33
33
|
},
|
|
34
34
|
config: {
|
|
35
35
|
output: {
|
|
@@ -62,7 +62,7 @@ async function matchFiles(files) {
|
|
|
62
62
|
return void 0;
|
|
63
63
|
}
|
|
64
64
|
for (const file of files) {
|
|
65
|
-
const source = await
|
|
65
|
+
const source = await chunkYZITPSOO_cjs.getSource(chunkYZITPSOO_cjs.createFile(file), { logger: mockedLogger });
|
|
66
66
|
expect(source).toMatchFileSnapshot(path__default.default.join("__snapshots__", file.path));
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkE3LZA47U_cjs = require('./chunk-E3LZA47U.cjs');
|
|
4
|
+
var chunk6KGAP5LO_cjs = require('./chunk-6KGAP5LO.cjs');
|
|
5
5
|
var process$1 = require('process');
|
|
6
6
|
var f = require('readline');
|
|
7
7
|
var require$$0 = require('tty');
|
|
@@ -14,7 +14,7 @@ var f__default = /*#__PURE__*/_interopDefault(f);
|
|
|
14
14
|
var require$$0__default = /*#__PURE__*/_interopDefault(require$$0);
|
|
15
15
|
|
|
16
16
|
// ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
|
|
17
|
-
|
|
17
|
+
chunk6KGAP5LO_cjs.init_cjs_shims();
|
|
18
18
|
var ESC = "\x1B";
|
|
19
19
|
var CSI = `${ESC}[`;
|
|
20
20
|
var beep = "\x07";
|
|
@@ -109,7 +109,7 @@ var createColors = (enabled = isColorSupported) => ({
|
|
|
109
109
|
picocolors.exports = createColors();
|
|
110
110
|
picocolors.exports.createColors = createColors;
|
|
111
111
|
var picocolorsExports = picocolors.exports;
|
|
112
|
-
var l = /* @__PURE__ */
|
|
112
|
+
var l = /* @__PURE__ */ chunkE3LZA47U_cjs.getDefaultExportFromCjs(picocolorsExports);
|
|
113
113
|
function z({ onlyFirst: t = false } = {}) {
|
|
114
114
|
const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
115
115
|
return new RegExp(u, t ? void 0 : "g");
|
|
@@ -475,7 +475,7 @@ var oD = class extends h {
|
|
|
475
475
|
return this._cursor;
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
|
-
var unicode =
|
|
478
|
+
var unicode = chunkE3LZA47U_cjs.isUnicodeSupported();
|
|
479
479
|
var s = (c2, fallback) => unicode ? c2 : fallback;
|
|
480
480
|
var S_STEP_ACTIVE = s("\u276F", ">");
|
|
481
481
|
var S_STEP_CANCEL = s("\u25A0", "x");
|
|
@@ -492,16 +492,16 @@ var symbol = (state) => {
|
|
|
492
492
|
switch (state) {
|
|
493
493
|
case "initial":
|
|
494
494
|
case "active": {
|
|
495
|
-
return
|
|
495
|
+
return chunkE3LZA47U_cjs.colors.cyan(S_STEP_ACTIVE);
|
|
496
496
|
}
|
|
497
497
|
case "cancel": {
|
|
498
|
-
return
|
|
498
|
+
return chunkE3LZA47U_cjs.colors.red(S_STEP_CANCEL);
|
|
499
499
|
}
|
|
500
500
|
case "error": {
|
|
501
|
-
return
|
|
501
|
+
return chunkE3LZA47U_cjs.colors.yellow(S_STEP_ERROR);
|
|
502
502
|
}
|
|
503
503
|
case "submit": {
|
|
504
|
-
return
|
|
504
|
+
return chunkE3LZA47U_cjs.colors.green(S_STEP_SUBMIT);
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
};
|
|
@@ -512,35 +512,35 @@ var text = (opts) => {
|
|
|
512
512
|
defaultValue: opts.defaultValue,
|
|
513
513
|
initialValue: opts.initialValue,
|
|
514
514
|
render() {
|
|
515
|
-
const title = `${
|
|
515
|
+
const title = `${chunkE3LZA47U_cjs.colors.gray(S_BAR)}
|
|
516
516
|
${symbol(this.state)} ${opts.message}
|
|
517
517
|
`;
|
|
518
|
-
const placeholder = opts.placeholder ?
|
|
518
|
+
const placeholder = opts.placeholder ? chunkE3LZA47U_cjs.colors.inverse(opts.placeholder[0]) + chunkE3LZA47U_cjs.colors.dim(opts.placeholder.slice(1)) : chunkE3LZA47U_cjs.colors.inverse(chunkE3LZA47U_cjs.colors.hidden("_"));
|
|
519
519
|
const value = this.value ? this.valueWithCursor : placeholder;
|
|
520
520
|
switch (this.state) {
|
|
521
521
|
case "error": {
|
|
522
522
|
return `${title.trim()}
|
|
523
|
-
${
|
|
523
|
+
${chunkE3LZA47U_cjs.colors.yellow(
|
|
524
524
|
S_BAR
|
|
525
525
|
)} ${value}
|
|
526
|
-
${
|
|
526
|
+
${chunkE3LZA47U_cjs.colors.yellow(S_BAR_END)} ${chunkE3LZA47U_cjs.colors.yellow(
|
|
527
527
|
this.error
|
|
528
528
|
)}
|
|
529
529
|
`;
|
|
530
530
|
}
|
|
531
531
|
case "submit": {
|
|
532
|
-
return `${title}${
|
|
532
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${chunkE3LZA47U_cjs.colors.dim(
|
|
533
533
|
this.value || opts.placeholder
|
|
534
534
|
)}`;
|
|
535
535
|
}
|
|
536
536
|
case "cancel": {
|
|
537
|
-
return `${title}${
|
|
538
|
-
|
|
539
|
-
)}${this.value?.trim() ? "\n" +
|
|
537
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${chunkE3LZA47U_cjs.colors.strikethrough(
|
|
538
|
+
chunkE3LZA47U_cjs.colors.dim(this.value ?? "")
|
|
539
|
+
)}${this.value?.trim() ? "\n" + chunkE3LZA47U_cjs.colors.gray(S_BAR) : ""}`;
|
|
540
540
|
}
|
|
541
541
|
default: {
|
|
542
|
-
return `${title}${
|
|
543
|
-
${
|
|
542
|
+
return `${title}${chunkE3LZA47U_cjs.colors.cyan(S_BAR)} ${value}
|
|
543
|
+
${chunkE3LZA47U_cjs.colors.cyan(
|
|
544
544
|
S_BAR_END
|
|
545
545
|
)}
|
|
546
546
|
`;
|
|
@@ -557,23 +557,23 @@ var confirm = (opts) => {
|
|
|
557
557
|
inactive,
|
|
558
558
|
initialValue: opts.initialValue ?? true,
|
|
559
559
|
render() {
|
|
560
|
-
const title = `${
|
|
560
|
+
const title = `${chunkE3LZA47U_cjs.colors.gray(S_BAR)}
|
|
561
561
|
${symbol(this.state)} ${opts.message}
|
|
562
562
|
`;
|
|
563
563
|
const value = this.value ? active : inactive;
|
|
564
564
|
switch (this.state) {
|
|
565
565
|
case "submit": {
|
|
566
|
-
return `${title}${
|
|
566
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${chunkE3LZA47U_cjs.colors.dim(value)}`;
|
|
567
567
|
}
|
|
568
568
|
case "cancel": {
|
|
569
|
-
return `${title}${
|
|
570
|
-
|
|
569
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${chunkE3LZA47U_cjs.colors.strikethrough(
|
|
570
|
+
chunkE3LZA47U_cjs.colors.dim(value)
|
|
571
571
|
)}
|
|
572
|
-
${
|
|
572
|
+
${chunkE3LZA47U_cjs.colors.gray(S_BAR)}`;
|
|
573
573
|
}
|
|
574
574
|
default: {
|
|
575
|
-
return `${title}${
|
|
576
|
-
${
|
|
575
|
+
return `${title}${chunkE3LZA47U_cjs.colors.cyan(S_BAR)} ${this.value ? `${chunkE3LZA47U_cjs.colors.green(S_RADIO_ACTIVE)} ${active}` : `${chunkE3LZA47U_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkE3LZA47U_cjs.colors.dim(active)}`} ${chunkE3LZA47U_cjs.colors.dim("/")} ${this.value ? `${chunkE3LZA47U_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkE3LZA47U_cjs.colors.dim(inactive)}` : `${chunkE3LZA47U_cjs.colors.green(S_RADIO_ACTIVE)} ${inactive}`}
|
|
576
|
+
${chunkE3LZA47U_cjs.colors.cyan(S_BAR_END)}
|
|
577
577
|
`;
|
|
578
578
|
}
|
|
579
579
|
}
|
|
@@ -585,44 +585,44 @@ var select = (opts) => {
|
|
|
585
585
|
const label = option.label ?? String(option.value);
|
|
586
586
|
switch (state) {
|
|
587
587
|
case "active": {
|
|
588
|
-
return `${
|
|
588
|
+
return `${chunkE3LZA47U_cjs.colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? chunkE3LZA47U_cjs.colors.dim(`(${option.hint})`) : ""}`;
|
|
589
589
|
}
|
|
590
590
|
case "selected": {
|
|
591
|
-
return `${
|
|
591
|
+
return `${chunkE3LZA47U_cjs.colors.dim(label)}`;
|
|
592
592
|
}
|
|
593
593
|
case "cancelled": {
|
|
594
|
-
return `${
|
|
594
|
+
return `${chunkE3LZA47U_cjs.colors.strikethrough(chunkE3LZA47U_cjs.colors.dim(label))}`;
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
return `${
|
|
597
|
+
return `${chunkE3LZA47U_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkE3LZA47U_cjs.colors.dim(label)}`;
|
|
598
598
|
};
|
|
599
599
|
return new ED({
|
|
600
600
|
options: opts.options,
|
|
601
601
|
initialValue: opts.initialValue,
|
|
602
602
|
render() {
|
|
603
|
-
const title = `${
|
|
603
|
+
const title = `${chunkE3LZA47U_cjs.colors.gray(S_BAR)}
|
|
604
604
|
${symbol(this.state)} ${opts.message}
|
|
605
605
|
`;
|
|
606
606
|
switch (this.state) {
|
|
607
607
|
case "submit": {
|
|
608
|
-
return `${title}${
|
|
608
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${opt(
|
|
609
609
|
this.options[this.cursor],
|
|
610
610
|
"selected"
|
|
611
611
|
)}`;
|
|
612
612
|
}
|
|
613
613
|
case "cancel": {
|
|
614
|
-
return `${title}${
|
|
614
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${opt(
|
|
615
615
|
this.options[this.cursor],
|
|
616
616
|
"cancelled"
|
|
617
617
|
)}
|
|
618
|
-
${
|
|
618
|
+
${chunkE3LZA47U_cjs.colors.gray(S_BAR)}`;
|
|
619
619
|
}
|
|
620
620
|
default: {
|
|
621
|
-
return `${title}${
|
|
621
|
+
return `${title}${chunkE3LZA47U_cjs.colors.cyan(S_BAR)} ${this.options.map(
|
|
622
622
|
(option, i) => opt(option, i === this.cursor ? "active" : "inactive")
|
|
623
623
|
).join(`
|
|
624
|
-
${
|
|
625
|
-
${
|
|
624
|
+
${chunkE3LZA47U_cjs.colors.cyan(S_BAR)} `)}
|
|
625
|
+
${chunkE3LZA47U_cjs.colors.cyan(S_BAR_END)}
|
|
626
626
|
`;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
@@ -634,22 +634,22 @@ var multiselect = (opts) => {
|
|
|
634
634
|
const label = option.label ?? String(option.value);
|
|
635
635
|
switch (state) {
|
|
636
636
|
case "active": {
|
|
637
|
-
return `${
|
|
637
|
+
return `${chunkE3LZA47U_cjs.colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? chunkE3LZA47U_cjs.colors.dim(`(${option.hint})`) : ""}`;
|
|
638
638
|
}
|
|
639
639
|
case "selected": {
|
|
640
|
-
return `${
|
|
640
|
+
return `${chunkE3LZA47U_cjs.colors.green(S_CHECKBOX_SELECTED)} ${chunkE3LZA47U_cjs.colors.dim(label)}`;
|
|
641
641
|
}
|
|
642
642
|
case "cancelled": {
|
|
643
|
-
return `${
|
|
643
|
+
return `${chunkE3LZA47U_cjs.colors.strikethrough(chunkE3LZA47U_cjs.colors.dim(label))}`;
|
|
644
644
|
}
|
|
645
645
|
case "active-selected": {
|
|
646
|
-
return `${
|
|
646
|
+
return `${chunkE3LZA47U_cjs.colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? chunkE3LZA47U_cjs.colors.dim(`(${option.hint})`) : ""}`;
|
|
647
647
|
}
|
|
648
648
|
case "submitted": {
|
|
649
|
-
return `${
|
|
649
|
+
return `${chunkE3LZA47U_cjs.colors.dim(label)}`;
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
return `${
|
|
652
|
+
return `${chunkE3LZA47U_cjs.colors.dim(S_CHECKBOX_INACTIVE)} ${chunkE3LZA47U_cjs.colors.dim(label)}`;
|
|
653
653
|
};
|
|
654
654
|
return new iD({
|
|
655
655
|
options: opts.options,
|
|
@@ -659,35 +659,35 @@ var multiselect = (opts) => {
|
|
|
659
659
|
validate(selected) {
|
|
660
660
|
if (this.required && selected.length === 0) {
|
|
661
661
|
return `Please select at least one option.
|
|
662
|
-
${
|
|
663
|
-
|
|
664
|
-
`Press ${
|
|
665
|
-
|
|
666
|
-
)} to select, ${
|
|
667
|
-
|
|
662
|
+
${chunkE3LZA47U_cjs.colors.reset(
|
|
663
|
+
chunkE3LZA47U_cjs.colors.dim(
|
|
664
|
+
`Press ${chunkE3LZA47U_cjs.colors.gray(
|
|
665
|
+
chunkE3LZA47U_cjs.colors.bgWhite(chunkE3LZA47U_cjs.colors.inverse(" space "))
|
|
666
|
+
)} to select, ${chunkE3LZA47U_cjs.colors.gray(
|
|
667
|
+
chunkE3LZA47U_cjs.colors.bgWhite(chunkE3LZA47U_cjs.colors.inverse(" enter "))
|
|
668
668
|
)} to submit`
|
|
669
669
|
)
|
|
670
670
|
)}`;
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
673
|
render() {
|
|
674
|
-
const title = `${
|
|
674
|
+
const title = `${chunkE3LZA47U_cjs.colors.gray(S_BAR)}
|
|
675
675
|
${symbol(this.state)} ${opts.message}
|
|
676
676
|
`;
|
|
677
677
|
switch (this.state) {
|
|
678
678
|
case "submit": {
|
|
679
|
-
return `${title}${
|
|
679
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(chunkE3LZA47U_cjs.colors.dim(", ")) || chunkE3LZA47U_cjs.colors.dim("none")}`;
|
|
680
680
|
}
|
|
681
681
|
case "cancel": {
|
|
682
|
-
const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(
|
|
683
|
-
return `${title}${
|
|
684
|
-
${
|
|
682
|
+
const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(chunkE3LZA47U_cjs.colors.dim(", "));
|
|
683
|
+
return `${title}${chunkE3LZA47U_cjs.colors.gray(S_BAR)} ${label.trim() ? `${label}
|
|
684
|
+
${chunkE3LZA47U_cjs.colors.gray(S_BAR)}` : ""}`;
|
|
685
685
|
}
|
|
686
686
|
case "error": {
|
|
687
687
|
const footer = this.error.split("\n").map(
|
|
688
|
-
(ln, i) => i === 0 ? `${
|
|
688
|
+
(ln, i) => i === 0 ? `${chunkE3LZA47U_cjs.colors.yellow(S_BAR_END)} ${chunkE3LZA47U_cjs.colors.yellow(ln)}` : ` ${ln}`
|
|
689
689
|
).join("\n");
|
|
690
|
-
return title +
|
|
690
|
+
return title + chunkE3LZA47U_cjs.colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
|
|
691
691
|
const selected = this.value.includes(option.value);
|
|
692
692
|
const active = i === this.cursor;
|
|
693
693
|
if (active && selected) {
|
|
@@ -698,10 +698,10 @@ ${chunkGX2TYGYS_cjs.colors.gray(S_BAR)}` : ""}`;
|
|
|
698
698
|
}
|
|
699
699
|
return opt(option, active ? "active" : "inactive");
|
|
700
700
|
}).join(`
|
|
701
|
-
${
|
|
701
|
+
${chunkE3LZA47U_cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
|
|
702
702
|
}
|
|
703
703
|
default: {
|
|
704
|
-
return `${title}${
|
|
704
|
+
return `${title}${chunkE3LZA47U_cjs.colors.cyan(S_BAR)} ${this.options.map((option, i) => {
|
|
705
705
|
const selected = this.value.includes(option.value);
|
|
706
706
|
const active = i === this.cursor;
|
|
707
707
|
if (active && selected) {
|
|
@@ -712,8 +712,8 @@ ${chunkGX2TYGYS_cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
|
|
|
712
712
|
}
|
|
713
713
|
return opt(option, active ? "active" : "inactive");
|
|
714
714
|
}).join(`
|
|
715
|
-
${
|
|
716
|
-
${
|
|
715
|
+
${chunkE3LZA47U_cjs.colors.cyan(S_BAR)} `)}
|
|
716
|
+
${chunkE3LZA47U_cjs.colors.cyan(S_BAR_END)}
|
|
717
717
|
`;
|
|
718
718
|
}
|
|
719
719
|
}
|
|
@@ -756,5 +756,5 @@ async function prompt(message, opts = {}) {
|
|
|
756
756
|
}
|
|
757
757
|
|
|
758
758
|
exports.prompt = prompt;
|
|
759
|
-
//# sourceMappingURL=prompt-
|
|
760
|
-
//# sourceMappingURL=prompt-
|
|
759
|
+
//# sourceMappingURL=prompt-2EVJOUVT.cjs.map
|
|
760
|
+
//# sourceMappingURL=prompt-2EVJOUVT.cjs.map
|