@kubb/core 3.0.0-beta.4 → 3.0.0-beta.6
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-4GJEWGQN.cjs → chunk-77XFD7YW.cjs} +6 -6
- package/dist/{chunk-4GJEWGQN.cjs.map → chunk-77XFD7YW.cjs.map} +1 -1
- package/dist/{chunk-KXT7F2WS.cjs → chunk-E5J6HBRC.cjs} +8 -8
- package/dist/{chunk-KXT7F2WS.cjs.map → chunk-E5J6HBRC.cjs.map} +1 -1
- package/dist/{chunk-MVWRVN66.cjs → chunk-EPETJSWI.cjs} +10 -10
- package/dist/{chunk-MVWRVN66.cjs.map → chunk-EPETJSWI.cjs.map} +1 -1
- package/dist/{chunk-72BWXKV4.cjs → chunk-FQD6NNEM.cjs} +4 -4
- package/dist/{chunk-72BWXKV4.cjs.map → chunk-FQD6NNEM.cjs.map} +1 -1
- package/dist/{chunk-2TOEDZ2U.cjs → chunk-JB5SLYIO.cjs} +4 -4
- package/dist/{chunk-2TOEDZ2U.cjs.map → chunk-JB5SLYIO.cjs.map} +1 -1
- package/dist/{chunk-SQBOUPF4.cjs → chunk-QDGZOVPT.cjs} +33 -33
- package/dist/{chunk-SQBOUPF4.cjs.map → chunk-QDGZOVPT.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-FODZPXQF.cjs → prompt-RHUB7H4Z.cjs} +62 -62
- package/dist/{prompt-FODZPXQF.cjs.map → prompt-RHUB7H4Z.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 chunkJB5SLYIO_cjs = require('./chunk-JB5SLYIO.cjs');
|
|
6
|
+
var chunkEPETJSWI_cjs = require('./chunk-EPETJSWI.cjs');
|
|
7
|
+
var chunkQDGZOVPT_cjs = require('./chunk-QDGZOVPT.cjs');
|
|
8
|
+
require('./chunk-77XFD7YW.cjs');
|
|
9
|
+
require('./chunk-E5J6HBRC.cjs');
|
|
10
|
+
var chunkFQD6NNEM_cjs = require('./chunk-FQD6NNEM.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
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
30
30
|
|
|
31
31
|
// src/build.ts
|
|
32
|
-
|
|
32
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
33
33
|
|
|
34
34
|
// src/PluginManager.ts
|
|
35
|
-
|
|
35
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
36
36
|
|
|
37
37
|
// src/PromiseManager.ts
|
|
38
|
-
|
|
38
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
39
39
|
|
|
40
40
|
// src/utils/executeStrategies.ts
|
|
41
|
-
|
|
41
|
+
chunkFQD6NNEM_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
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
104
104
|
var ValidationPluginError = class extends Error {
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
// src/plugin.ts
|
|
108
|
-
|
|
108
|
+
chunkFQD6NNEM_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 chunkEPETJSWI_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 chunkQDGZOVPT_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 chunkJB5SLYIO_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 chunkJB5SLYIO_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.
|
|
@@ -591,7 +591,7 @@ Falling back on the first item.
|
|
|
591
591
|
}
|
|
592
592
|
#parse(plugin, pluginManager, context) {
|
|
593
593
|
const usedPluginNames = pluginManager.#usedPluginNames;
|
|
594
|
-
|
|
594
|
+
chunkQDGZOVPT_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
595
595
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
596
596
|
if (plugin.context && typeof plugin.context === "function") {
|
|
597
597
|
return {
|
|
@@ -626,7 +626,7 @@ Falling back on the first item.
|
|
|
626
626
|
};
|
|
627
627
|
|
|
628
628
|
// src/config.ts
|
|
629
|
-
|
|
629
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
630
630
|
function defineConfig(options) {
|
|
631
631
|
return options;
|
|
632
632
|
}
|
|
@@ -634,9 +634,9 @@ function isInputPath(result) {
|
|
|
634
634
|
return !!result && "path" in result?.input;
|
|
635
635
|
}
|
|
636
636
|
async function setup(options) {
|
|
637
|
-
const { config, logger =
|
|
637
|
+
const { config, logger = chunkEPETJSWI_cjs.createLogger() } = options;
|
|
638
638
|
try {
|
|
639
|
-
if (isInputPath(config) && !new
|
|
639
|
+
if (isInputPath(config) && !new chunkQDGZOVPT_cjs.URLPath(config.input.path).isURL) {
|
|
640
640
|
await fs.read(config.input.path);
|
|
641
641
|
}
|
|
642
642
|
} catch (e) {
|
|
@@ -700,7 +700,7 @@ async function safeBuild(options) {
|
|
|
700
700
|
if (pluginOptions.output?.barrelType === false) {
|
|
701
701
|
return void 0;
|
|
702
702
|
}
|
|
703
|
-
if (
|
|
703
|
+
if (chunkQDGZOVPT_cjs.FileManager.getMode(pluginOptions.output?.path) === "single") {
|
|
704
704
|
return void 0;
|
|
705
705
|
}
|
|
706
706
|
return {
|
|
@@ -716,7 +716,7 @@ async function safeBuild(options) {
|
|
|
716
716
|
if (options.config.output.barrelType) {
|
|
717
717
|
await pluginManager.fileManager.add(rootFile);
|
|
718
718
|
}
|
|
719
|
-
files = await
|
|
719
|
+
files = await chunkQDGZOVPT_cjs.processFiles({
|
|
720
720
|
config: options.config,
|
|
721
721
|
dryRun: !options.config.output.write,
|
|
722
722
|
files: pluginManager.fileManager.files,
|
|
@@ -738,7 +738,7 @@ async function safeBuild(options) {
|
|
|
738
738
|
}
|
|
739
739
|
|
|
740
740
|
// src/BaseGenerator.ts
|
|
741
|
-
|
|
741
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
742
742
|
var BaseGenerator = class {
|
|
743
743
|
#options = {};
|
|
744
744
|
#context = {};
|
|
@@ -763,22 +763,22 @@ var BaseGenerator = class {
|
|
|
763
763
|
};
|
|
764
764
|
|
|
765
765
|
// src/PackageManager.ts
|
|
766
|
-
|
|
766
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
767
767
|
|
|
768
768
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
769
|
-
|
|
769
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
770
770
|
|
|
771
771
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
772
|
-
|
|
772
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
773
773
|
|
|
774
774
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
775
|
-
|
|
775
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
776
776
|
|
|
777
777
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
778
|
-
|
|
778
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
779
779
|
|
|
780
780
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
781
|
-
|
|
781
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
782
782
|
var Node = class {
|
|
783
783
|
value;
|
|
784
784
|
next;
|
|
@@ -970,13 +970,13 @@ function locatePathSync(paths, {
|
|
|
970
970
|
}
|
|
971
971
|
|
|
972
972
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
973
|
-
|
|
973
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
974
974
|
function toPath2(urlOrPath) {
|
|
975
975
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
976
976
|
}
|
|
977
977
|
|
|
978
978
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
979
|
-
|
|
979
|
+
chunkFQD6NNEM_cjs.init_cjs_shims();
|
|
980
980
|
|
|
981
981
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
982
982
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -1178,11 +1178,11 @@ var PackageManager = class _PackageManager {
|
|
|
1178
1178
|
|
|
1179
1179
|
Object.defineProperty(exports, "FileManager", {
|
|
1180
1180
|
enumerable: true,
|
|
1181
|
-
get: function () { return
|
|
1181
|
+
get: function () { return chunkQDGZOVPT_cjs.FileManager; }
|
|
1182
1182
|
});
|
|
1183
1183
|
Object.defineProperty(exports, "getSource", {
|
|
1184
1184
|
enumerable: true,
|
|
1185
|
-
get: function () { return
|
|
1185
|
+
get: function () { return chunkQDGZOVPT_cjs.getSource; }
|
|
1186
1186
|
});
|
|
1187
1187
|
exports.BaseGenerator = BaseGenerator;
|
|
1188
1188
|
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 chunkEPETJSWI_cjs = require('./chunk-EPETJSWI.cjs');
|
|
4
|
+
require('./chunk-E5J6HBRC.cjs');
|
|
5
|
+
require('./chunk-FQD6NNEM.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 chunkEPETJSWI_cjs.LogMapper; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "createLogger", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkEPETJSWI_cjs.createLogger; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "randomCliColour", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkEPETJSWI_cjs.randomCliColour; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "randomColour", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkEPETJSWI_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 chunkQDGZOVPT_cjs = require('./chunk-QDGZOVPT.cjs');
|
|
4
|
+
var chunk77XFD7YW_cjs = require('./chunk-77XFD7YW.cjs');
|
|
5
|
+
var chunkFQD6NNEM_cjs = require('./chunk-FQD6NNEM.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
|
+
chunkFQD6NNEM_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 chunk77XFD7YW_cjs.camelCase(name || result.name);
|
|
25
25
|
}
|
|
26
26
|
if (result.type === "type") {
|
|
27
|
-
return
|
|
27
|
+
return chunk77XFD7YW_cjs.pascalCase(result.name);
|
|
28
28
|
}
|
|
29
29
|
if (result.type === "function") {
|
|
30
|
-
return
|
|
30
|
+
return chunk77XFD7YW_cjs.camelCase(result.name);
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return chunk77XFD7YW_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 chunkQDGZOVPT_cjs.getSource(chunkQDGZOVPT_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 chunkE5J6HBRC_cjs = require('./chunk-E5J6HBRC.cjs');
|
|
4
|
+
var chunkFQD6NNEM_cjs = require('./chunk-FQD6NNEM.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
|
+
chunkFQD6NNEM_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__ */ chunkE5J6HBRC_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 = chunkE5J6HBRC_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 chunkE5J6HBRC_cjs.colors.cyan(S_STEP_ACTIVE);
|
|
496
496
|
}
|
|
497
497
|
case "cancel": {
|
|
498
|
-
return
|
|
498
|
+
return chunkE5J6HBRC_cjs.colors.red(S_STEP_CANCEL);
|
|
499
499
|
}
|
|
500
500
|
case "error": {
|
|
501
|
-
return
|
|
501
|
+
return chunkE5J6HBRC_cjs.colors.yellow(S_STEP_ERROR);
|
|
502
502
|
}
|
|
503
503
|
case "submit": {
|
|
504
|
-
return
|
|
504
|
+
return chunkE5J6HBRC_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 = `${chunkE5J6HBRC_cjs.colors.gray(S_BAR)}
|
|
516
516
|
${symbol(this.state)} ${opts.message}
|
|
517
517
|
`;
|
|
518
|
-
const placeholder = opts.placeholder ?
|
|
518
|
+
const placeholder = opts.placeholder ? chunkE5J6HBRC_cjs.colors.inverse(opts.placeholder[0]) + chunkE5J6HBRC_cjs.colors.dim(opts.placeholder.slice(1)) : chunkE5J6HBRC_cjs.colors.inverse(chunkE5J6HBRC_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
|
+
${chunkE5J6HBRC_cjs.colors.yellow(
|
|
524
524
|
S_BAR
|
|
525
525
|
)} ${value}
|
|
526
|
-
${
|
|
526
|
+
${chunkE5J6HBRC_cjs.colors.yellow(S_BAR_END)} ${chunkE5J6HBRC_cjs.colors.yellow(
|
|
527
527
|
this.error
|
|
528
528
|
)}
|
|
529
529
|
`;
|
|
530
530
|
}
|
|
531
531
|
case "submit": {
|
|
532
|
-
return `${title}${
|
|
532
|
+
return `${title}${chunkE5J6HBRC_cjs.colors.gray(S_BAR)} ${chunkE5J6HBRC_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}${chunkE5J6HBRC_cjs.colors.gray(S_BAR)} ${chunkE5J6HBRC_cjs.colors.strikethrough(
|
|
538
|
+
chunkE5J6HBRC_cjs.colors.dim(this.value ?? "")
|
|
539
|
+
)}${this.value?.trim() ? "\n" + chunkE5J6HBRC_cjs.colors.gray(S_BAR) : ""}`;
|
|
540
540
|
}
|
|
541
541
|
default: {
|
|
542
|
-
return `${title}${
|
|
543
|
-
${
|
|
542
|
+
return `${title}${chunkE5J6HBRC_cjs.colors.cyan(S_BAR)} ${value}
|
|
543
|
+
${chunkE5J6HBRC_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 = `${chunkE5J6HBRC_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}${chunkE5J6HBRC_cjs.colors.gray(S_BAR)} ${chunkE5J6HBRC_cjs.colors.dim(value)}`;
|
|
567
567
|
}
|
|
568
568
|
case "cancel": {
|
|
569
|
-
return `${title}${
|
|
570
|
-
|
|
569
|
+
return `${title}${chunkE5J6HBRC_cjs.colors.gray(S_BAR)} ${chunkE5J6HBRC_cjs.colors.strikethrough(
|
|
570
|
+
chunkE5J6HBRC_cjs.colors.dim(value)
|
|
571
571
|
)}
|
|
572
|
-
${
|
|
572
|
+
${chunkE5J6HBRC_cjs.colors.gray(S_BAR)}`;
|
|
573
573
|
}
|
|
574
574
|
default: {
|
|
575
|
-
return `${title}${
|
|
576
|
-
${
|
|
575
|
+
return `${title}${chunkE5J6HBRC_cjs.colors.cyan(S_BAR)} ${this.value ? `${chunkE5J6HBRC_cjs.colors.green(S_RADIO_ACTIVE)} ${active}` : `${chunkE5J6HBRC_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkE5J6HBRC_cjs.colors.dim(active)}`} ${chunkE5J6HBRC_cjs.colors.dim("/")} ${this.value ? `${chunkE5J6HBRC_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkE5J6HBRC_cjs.colors.dim(inactive)}` : `${chunkE5J6HBRC_cjs.colors.green(S_RADIO_ACTIVE)} ${inactive}`}
|
|
576
|
+
${chunkE5J6HBRC_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 `${chunkE5J6HBRC_cjs.colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? chunkE5J6HBRC_cjs.colors.dim(`(${option.hint})`) : ""}`;
|
|
589
589
|
}
|
|
590
590
|
case "selected": {
|
|
591
|
-
return `${
|
|
591
|
+
return `${chunkE5J6HBRC_cjs.colors.dim(label)}`;
|
|
592
592
|
}
|
|
593
593
|
case "cancelled": {
|
|
594
|
-
return `${
|
|
594
|
+
return `${chunkE5J6HBRC_cjs.colors.strikethrough(chunkE5J6HBRC_cjs.colors.dim(label))}`;
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
return `${
|
|
597
|
+
return `${chunkE5J6HBRC_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkE5J6HBRC_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 = `${chunkE5J6HBRC_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}${chunkE5J6HBRC_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}${chunkE5J6HBRC_cjs.colors.gray(S_BAR)} ${opt(
|
|
615
615
|
this.options[this.cursor],
|
|
616
616
|
"cancelled"
|
|
617
617
|
)}
|
|
618
|
-
${
|
|
618
|
+
${chunkE5J6HBRC_cjs.colors.gray(S_BAR)}`;
|
|
619
619
|
}
|
|
620
620
|
default: {
|
|
621
|
-
return `${title}${
|
|
621
|
+
return `${title}${chunkE5J6HBRC_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
|
+
${chunkE5J6HBRC_cjs.colors.cyan(S_BAR)} `)}
|
|
625
|
+
${chunkE5J6HBRC_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 `${chunkE5J6HBRC_cjs.colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? chunkE5J6HBRC_cjs.colors.dim(`(${option.hint})`) : ""}`;
|
|
638
638
|
}
|
|
639
639
|
case "selected": {
|
|
640
|
-
return `${
|
|
640
|
+
return `${chunkE5J6HBRC_cjs.colors.green(S_CHECKBOX_SELECTED)} ${chunkE5J6HBRC_cjs.colors.dim(label)}`;
|
|
641
641
|
}
|
|
642
642
|
case "cancelled": {
|
|
643
|
-
return `${
|
|
643
|
+
return `${chunkE5J6HBRC_cjs.colors.strikethrough(chunkE5J6HBRC_cjs.colors.dim(label))}`;
|
|
644
644
|
}
|
|
645
645
|
case "active-selected": {
|
|
646
|
-
return `${
|
|
646
|
+
return `${chunkE5J6HBRC_cjs.colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? chunkE5J6HBRC_cjs.colors.dim(`(${option.hint})`) : ""}`;
|
|
647
647
|
}
|
|
648
648
|
case "submitted": {
|
|
649
|
-
return `${
|
|
649
|
+
return `${chunkE5J6HBRC_cjs.colors.dim(label)}`;
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
return `${
|
|
652
|
+
return `${chunkE5J6HBRC_cjs.colors.dim(S_CHECKBOX_INACTIVE)} ${chunkE5J6HBRC_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
|
+
${chunkE5J6HBRC_cjs.colors.reset(
|
|
663
|
+
chunkE5J6HBRC_cjs.colors.dim(
|
|
664
|
+
`Press ${chunkE5J6HBRC_cjs.colors.gray(
|
|
665
|
+
chunkE5J6HBRC_cjs.colors.bgWhite(chunkE5J6HBRC_cjs.colors.inverse(" space "))
|
|
666
|
+
)} to select, ${chunkE5J6HBRC_cjs.colors.gray(
|
|
667
|
+
chunkE5J6HBRC_cjs.colors.bgWhite(chunkE5J6HBRC_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 = `${chunkE5J6HBRC_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}${chunkE5J6HBRC_cjs.colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(chunkE5J6HBRC_cjs.colors.dim(", ")) || chunkE5J6HBRC_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(chunkE5J6HBRC_cjs.colors.dim(", "));
|
|
683
|
+
return `${title}${chunkE5J6HBRC_cjs.colors.gray(S_BAR)} ${label.trim() ? `${label}
|
|
684
|
+
${chunkE5J6HBRC_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 ? `${chunkE5J6HBRC_cjs.colors.yellow(S_BAR_END)} ${chunkE5J6HBRC_cjs.colors.yellow(ln)}` : ` ${ln}`
|
|
689
689
|
).join("\n");
|
|
690
|
-
return title +
|
|
690
|
+
return title + chunkE5J6HBRC_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 @@ ${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}` : ""}`;
|
|
|
698
698
|
}
|
|
699
699
|
return opt(option, active ? "active" : "inactive");
|
|
700
700
|
}).join(`
|
|
701
|
-
${
|
|
701
|
+
${chunkE5J6HBRC_cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
|
|
702
702
|
}
|
|
703
703
|
default: {
|
|
704
|
-
return `${title}${
|
|
704
|
+
return `${title}${chunkE5J6HBRC_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 @@ ${chunkKXT7F2WS_cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
|
|
|
712
712
|
}
|
|
713
713
|
return opt(option, active ? "active" : "inactive");
|
|
714
714
|
}).join(`
|
|
715
|
-
${
|
|
716
|
-
${
|
|
715
|
+
${chunkE5J6HBRC_cjs.colors.cyan(S_BAR)} `)}
|
|
716
|
+
${chunkE5J6HBRC_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-RHUB7H4Z.cjs.map
|
|
760
|
+
//# sourceMappingURL=prompt-RHUB7H4Z.cjs.map
|