@kubb/core 3.0.0-beta.3 → 3.0.0-beta.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/index.cjs CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunk2TOEDZ2U_cjs = require('./chunk-2TOEDZ2U.cjs');
6
- var chunkMVWRVN66_cjs = require('./chunk-MVWRVN66.cjs');
7
- var chunkSQBOUPF4_cjs = require('./chunk-SQBOUPF4.cjs');
8
- require('./chunk-4GJEWGQN.cjs');
9
- require('./chunk-KXT7F2WS.cjs');
10
- var chunk72BWXKV4_cjs = require('./chunk-72BWXKV4.cjs');
5
+ var chunkPAAEVG63_cjs = require('./chunk-PAAEVG63.cjs');
6
+ var chunkLTK4CURY_cjs = require('./chunk-LTK4CURY.cjs');
7
+ var chunkE3M4QKGT_cjs = require('./chunk-E3M4QKGT.cjs');
8
+ require('./chunk-ZTR3NNAO.cjs');
9
+ require('./chunk-2JGRDU6N.cjs');
10
+ var chunkYEWLGG6A_cjs = require('./chunk-YEWLGG6A.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
- chunk72BWXKV4_cjs.init_cjs_shims();
29
+ chunkYEWLGG6A_cjs.init_cjs_shims();
30
30
 
31
31
  // src/build.ts
32
- chunk72BWXKV4_cjs.init_cjs_shims();
32
+ chunkYEWLGG6A_cjs.init_cjs_shims();
33
33
 
34
34
  // src/PluginManager.ts
35
- chunk72BWXKV4_cjs.init_cjs_shims();
35
+ chunkYEWLGG6A_cjs.init_cjs_shims();
36
36
 
37
37
  // src/PromiseManager.ts
38
- chunk72BWXKV4_cjs.init_cjs_shims();
38
+ chunkYEWLGG6A_cjs.init_cjs_shims();
39
39
 
40
40
  // src/utils/executeStrategies.ts
41
- chunk72BWXKV4_cjs.init_cjs_shims();
41
+ chunkYEWLGG6A_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
- chunk72BWXKV4_cjs.init_cjs_shims();
103
+ chunkYEWLGG6A_cjs.init_cjs_shims();
104
104
  var ValidationPluginError = class extends Error {
105
105
  };
106
106
 
107
107
  // src/plugin.ts
108
- chunk72BWXKV4_cjs.init_cjs_shims();
108
+ chunkYEWLGG6A_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 chunkMVWRVN66_cjs.EventEmitter();
159
+ events = new chunkLTK4CURY_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 chunkSQBOUPF4_cjs.FileManager();
171
+ this.fileManager = new chunkE3M4QKGT_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 chunk2TOEDZ2U_cjs.transformReservedWord(names?.at(0) || params.name);
257
+ return chunkPAAEVG63_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 chunk2TOEDZ2U_cjs.transformReservedWord(name);
264
+ return chunkPAAEVG63_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
- chunkSQBOUPF4_cjs.setUniqueName(plugin.name, usedPluginNames);
594
+ chunkE3M4QKGT_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
- chunk72BWXKV4_cjs.init_cjs_shims();
629
+ chunkYEWLGG6A_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 = chunkMVWRVN66_cjs.createLogger() } = options;
637
+ const { config, logger = chunkLTK4CURY_cjs.createLogger() } = options;
638
638
  try {
639
- if (isInputPath(config) && !new chunkSQBOUPF4_cjs.URLPath(config.input.path).isURL) {
639
+ if (isInputPath(config) && !new chunkE3M4QKGT_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 (chunkSQBOUPF4_cjs.FileManager.getMode(pluginOptions.output?.path) === "single") {
703
+ if (chunkE3M4QKGT_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 chunkSQBOUPF4_cjs.processFiles({
719
+ files = await chunkE3M4QKGT_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
- chunk72BWXKV4_cjs.init_cjs_shims();
741
+ chunkYEWLGG6A_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
- chunk72BWXKV4_cjs.init_cjs_shims();
766
+ chunkYEWLGG6A_cjs.init_cjs_shims();
767
767
 
768
768
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
769
- chunk72BWXKV4_cjs.init_cjs_shims();
769
+ chunkYEWLGG6A_cjs.init_cjs_shims();
770
770
 
771
771
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
772
- chunk72BWXKV4_cjs.init_cjs_shims();
772
+ chunkYEWLGG6A_cjs.init_cjs_shims();
773
773
 
774
774
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
775
- chunk72BWXKV4_cjs.init_cjs_shims();
775
+ chunkYEWLGG6A_cjs.init_cjs_shims();
776
776
 
777
777
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
778
- chunk72BWXKV4_cjs.init_cjs_shims();
778
+ chunkYEWLGG6A_cjs.init_cjs_shims();
779
779
 
780
780
  // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
781
- chunk72BWXKV4_cjs.init_cjs_shims();
781
+ chunkYEWLGG6A_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
- chunk72BWXKV4_cjs.init_cjs_shims();
973
+ chunkYEWLGG6A_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
- chunk72BWXKV4_cjs.init_cjs_shims();
979
+ chunkYEWLGG6A_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 chunkSQBOUPF4_cjs.FileManager; }
1181
+ get: function () { return chunkE3M4QKGT_cjs.FileManager; }
1182
1182
  });
1183
1183
  Object.defineProperty(exports, "getSource", {
1184
1184
  enumerable: true,
1185
- get: function () { return chunkSQBOUPF4_cjs.getSource; }
1185
+ get: function () { return chunkE3M4QKGT_cjs.getSource; }
1186
1186
  });
1187
1187
  exports.BaseGenerator = BaseGenerator;
1188
1188
  exports.PackageManager = PackageManager;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-ibNoWwHN.cjs';
2
- export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-ibNoWwHN.cjs';
1
+ import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-DKZ30qz_.cjs';
2
+ export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-DKZ30qz_.cjs';
3
3
  import { L as Logger } from './logger-DvbHXjIO.cjs';
4
4
  import { PossiblePromise } from '@kubb/types';
5
5
  import '@kubb/fs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-C9aZTwst.js';
2
- export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-C9aZTwst.js';
1
+ import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-Cn8nSj1H.js';
2
+ export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource } from './FileManager-Cn8nSj1H.js';
3
3
  import { L as Logger } from './logger-DvbHXjIO.js';
4
4
  import { PossiblePromise } from '@kubb/types';
5
5
  import '@kubb/fs';
package/dist/logger.cjs CHANGED
@@ -1,26 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var chunkMVWRVN66_cjs = require('./chunk-MVWRVN66.cjs');
4
- require('./chunk-KXT7F2WS.cjs');
5
- require('./chunk-72BWXKV4.cjs');
3
+ var chunkLTK4CURY_cjs = require('./chunk-LTK4CURY.cjs');
4
+ require('./chunk-2JGRDU6N.cjs');
5
+ require('./chunk-YEWLGG6A.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "LogMapper", {
10
10
  enumerable: true,
11
- get: function () { return chunkMVWRVN66_cjs.LogMapper; }
11
+ get: function () { return chunkLTK4CURY_cjs.LogMapper; }
12
12
  });
13
13
  Object.defineProperty(exports, "createLogger", {
14
14
  enumerable: true,
15
- get: function () { return chunkMVWRVN66_cjs.createLogger; }
15
+ get: function () { return chunkLTK4CURY_cjs.createLogger; }
16
16
  });
17
17
  Object.defineProperty(exports, "randomCliColour", {
18
18
  enumerable: true,
19
- get: function () { return chunkMVWRVN66_cjs.randomCliColour; }
19
+ get: function () { return chunkLTK4CURY_cjs.randomCliColour; }
20
20
  });
21
21
  Object.defineProperty(exports, "randomColour", {
22
22
  enumerable: true,
23
- get: function () { return chunkMVWRVN66_cjs.randomColour; }
23
+ get: function () { return chunkLTK4CURY_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 chunkSQBOUPF4_cjs = require('./chunk-SQBOUPF4.cjs');
4
- var chunk4GJEWGQN_cjs = require('./chunk-4GJEWGQN.cjs');
5
- var chunk72BWXKV4_cjs = require('./chunk-72BWXKV4.cjs');
3
+ var chunkE3M4QKGT_cjs = require('./chunk-E3M4QKGT.cjs');
4
+ var chunkZTR3NNAO_cjs = require('./chunk-ZTR3NNAO.cjs');
5
+ var chunkYEWLGG6A_cjs = require('./chunk-YEWLGG6A.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
- chunk72BWXKV4_cjs.init_cjs_shims();
13
+ chunkYEWLGG6A_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 chunk4GJEWGQN_cjs.camelCase(name || result.name);
24
+ return chunkZTR3NNAO_cjs.camelCase(name || result.name);
25
25
  }
26
26
  if (result.type === "type") {
27
- return chunk4GJEWGQN_cjs.pascalCase(result.name);
27
+ return chunkZTR3NNAO_cjs.pascalCase(result.name);
28
28
  }
29
29
  if (result.type === "function") {
30
- return chunk4GJEWGQN_cjs.camelCase(result.name);
30
+ return chunkZTR3NNAO_cjs.camelCase(result.name);
31
31
  }
32
- return chunk4GJEWGQN_cjs.camelCase(result.name);
32
+ return chunkZTR3NNAO_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 chunkSQBOUPF4_cjs.getSource(chunkSQBOUPF4_cjs.createFile(file), { logger: mockedLogger });
65
+ const source = await chunkE3M4QKGT_cjs.getSource(chunkE3M4QKGT_cjs.createFile(file), { logger: mockedLogger });
66
66
  expect(source).toMatchFileSnapshot(path__default.default.join("__snapshots__", file.path));
67
67
  }
68
68
  }
package/dist/mocks.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ResolvedFile, File } from '@kubb/fs/types';
2
- import { a as PluginManager } from './FileManager-ibNoWwHN.cjs';
2
+ import { a as PluginManager } from './FileManager-DKZ30qz_.cjs';
3
3
  import { L as Logger } from './logger-DvbHXjIO.cjs';
4
4
  import '@kubb/fs';
5
5
  import '@kubb/types';
package/dist/mocks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ResolvedFile, File } from '@kubb/fs/types';
2
- import { a as PluginManager } from './FileManager-C9aZTwst.js';
2
+ import { a as PluginManager } from './FileManager-Cn8nSj1H.js';
3
3
  import { L as Logger } from './logger-DvbHXjIO.js';
4
4
  import '@kubb/fs';
5
5
  import '@kubb/types';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkKXT7F2WS_cjs = require('./chunk-KXT7F2WS.cjs');
4
- var chunk72BWXKV4_cjs = require('./chunk-72BWXKV4.cjs');
3
+ var chunk2JGRDU6N_cjs = require('./chunk-2JGRDU6N.cjs');
4
+ var chunkYEWLGG6A_cjs = require('./chunk-YEWLGG6A.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
- chunk72BWXKV4_cjs.init_cjs_shims();
17
+ chunkYEWLGG6A_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__ */ chunkKXT7F2WS_cjs.getDefaultExportFromCjs(picocolorsExports);
112
+ var l = /* @__PURE__ */ chunk2JGRDU6N_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 = chunkKXT7F2WS_cjs.isUnicodeSupported();
478
+ var unicode = chunk2JGRDU6N_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 chunkKXT7F2WS_cjs.colors.cyan(S_STEP_ACTIVE);
495
+ return chunk2JGRDU6N_cjs.colors.cyan(S_STEP_ACTIVE);
496
496
  }
497
497
  case "cancel": {
498
- return chunkKXT7F2WS_cjs.colors.red(S_STEP_CANCEL);
498
+ return chunk2JGRDU6N_cjs.colors.red(S_STEP_CANCEL);
499
499
  }
500
500
  case "error": {
501
- return chunkKXT7F2WS_cjs.colors.yellow(S_STEP_ERROR);
501
+ return chunk2JGRDU6N_cjs.colors.yellow(S_STEP_ERROR);
502
502
  }
503
503
  case "submit": {
504
- return chunkKXT7F2WS_cjs.colors.green(S_STEP_SUBMIT);
504
+ return chunk2JGRDU6N_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 = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
515
+ const title = `${chunk2JGRDU6N_cjs.colors.gray(S_BAR)}
516
516
  ${symbol(this.state)} ${opts.message}
517
517
  `;
518
- const placeholder = opts.placeholder ? chunkKXT7F2WS_cjs.colors.inverse(opts.placeholder[0]) + chunkKXT7F2WS_cjs.colors.dim(opts.placeholder.slice(1)) : chunkKXT7F2WS_cjs.colors.inverse(chunkKXT7F2WS_cjs.colors.hidden("_"));
518
+ const placeholder = opts.placeholder ? chunk2JGRDU6N_cjs.colors.inverse(opts.placeholder[0]) + chunk2JGRDU6N_cjs.colors.dim(opts.placeholder.slice(1)) : chunk2JGRDU6N_cjs.colors.inverse(chunk2JGRDU6N_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
- ${chunkKXT7F2WS_cjs.colors.yellow(
523
+ ${chunk2JGRDU6N_cjs.colors.yellow(
524
524
  S_BAR
525
525
  )} ${value}
526
- ${chunkKXT7F2WS_cjs.colors.yellow(S_BAR_END)} ${chunkKXT7F2WS_cjs.colors.yellow(
526
+ ${chunk2JGRDU6N_cjs.colors.yellow(S_BAR_END)} ${chunk2JGRDU6N_cjs.colors.yellow(
527
527
  this.error
528
528
  )}
529
529
  `;
530
530
  }
531
531
  case "submit": {
532
- return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.dim(
532
+ return `${title}${chunk2JGRDU6N_cjs.colors.gray(S_BAR)} ${chunk2JGRDU6N_cjs.colors.dim(
533
533
  this.value || opts.placeholder
534
534
  )}`;
535
535
  }
536
536
  case "cancel": {
537
- return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.strikethrough(
538
- chunkKXT7F2WS_cjs.colors.dim(this.value ?? "")
539
- )}${this.value?.trim() ? "\n" + chunkKXT7F2WS_cjs.colors.gray(S_BAR) : ""}`;
537
+ return `${title}${chunk2JGRDU6N_cjs.colors.gray(S_BAR)} ${chunk2JGRDU6N_cjs.colors.strikethrough(
538
+ chunk2JGRDU6N_cjs.colors.dim(this.value ?? "")
539
+ )}${this.value?.trim() ? "\n" + chunk2JGRDU6N_cjs.colors.gray(S_BAR) : ""}`;
540
540
  }
541
541
  default: {
542
- return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${value}
543
- ${chunkKXT7F2WS_cjs.colors.cyan(
542
+ return `${title}${chunk2JGRDU6N_cjs.colors.cyan(S_BAR)} ${value}
543
+ ${chunk2JGRDU6N_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 = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
560
+ const title = `${chunk2JGRDU6N_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}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.dim(value)}`;
566
+ return `${title}${chunk2JGRDU6N_cjs.colors.gray(S_BAR)} ${chunk2JGRDU6N_cjs.colors.dim(value)}`;
567
567
  }
568
568
  case "cancel": {
569
- return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.strikethrough(
570
- chunkKXT7F2WS_cjs.colors.dim(value)
569
+ return `${title}${chunk2JGRDU6N_cjs.colors.gray(S_BAR)} ${chunk2JGRDU6N_cjs.colors.strikethrough(
570
+ chunk2JGRDU6N_cjs.colors.dim(value)
571
571
  )}
572
- ${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}`;
572
+ ${chunk2JGRDU6N_cjs.colors.gray(S_BAR)}`;
573
573
  }
574
574
  default: {
575
- return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${this.value ? `${chunkKXT7F2WS_cjs.colors.green(S_RADIO_ACTIVE)} ${active}` : `${chunkKXT7F2WS_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(active)}`} ${chunkKXT7F2WS_cjs.colors.dim("/")} ${this.value ? `${chunkKXT7F2WS_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(inactive)}` : `${chunkKXT7F2WS_cjs.colors.green(S_RADIO_ACTIVE)} ${inactive}`}
576
- ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR_END)}
575
+ return `${title}${chunk2JGRDU6N_cjs.colors.cyan(S_BAR)} ${this.value ? `${chunk2JGRDU6N_cjs.colors.green(S_RADIO_ACTIVE)} ${active}` : `${chunk2JGRDU6N_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunk2JGRDU6N_cjs.colors.dim(active)}`} ${chunk2JGRDU6N_cjs.colors.dim("/")} ${this.value ? `${chunk2JGRDU6N_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunk2JGRDU6N_cjs.colors.dim(inactive)}` : `${chunk2JGRDU6N_cjs.colors.green(S_RADIO_ACTIVE)} ${inactive}`}
576
+ ${chunk2JGRDU6N_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 `${chunkKXT7F2WS_cjs.colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? chunkKXT7F2WS_cjs.colors.dim(`(${option.hint})`) : ""}`;
588
+ return `${chunk2JGRDU6N_cjs.colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? chunk2JGRDU6N_cjs.colors.dim(`(${option.hint})`) : ""}`;
589
589
  }
590
590
  case "selected": {
591
- return `${chunkKXT7F2WS_cjs.colors.dim(label)}`;
591
+ return `${chunk2JGRDU6N_cjs.colors.dim(label)}`;
592
592
  }
593
593
  case "cancelled": {
594
- return `${chunkKXT7F2WS_cjs.colors.strikethrough(chunkKXT7F2WS_cjs.colors.dim(label))}`;
594
+ return `${chunk2JGRDU6N_cjs.colors.strikethrough(chunk2JGRDU6N_cjs.colors.dim(label))}`;
595
595
  }
596
596
  }
597
- return `${chunkKXT7F2WS_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(label)}`;
597
+ return `${chunk2JGRDU6N_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunk2JGRDU6N_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 = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
603
+ const title = `${chunk2JGRDU6N_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}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${opt(
608
+ return `${title}${chunk2JGRDU6N_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}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${opt(
614
+ return `${title}${chunk2JGRDU6N_cjs.colors.gray(S_BAR)} ${opt(
615
615
  this.options[this.cursor],
616
616
  "cancelled"
617
617
  )}
618
- ${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}`;
618
+ ${chunk2JGRDU6N_cjs.colors.gray(S_BAR)}`;
619
619
  }
620
620
  default: {
621
- return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${this.options.map(
621
+ return `${title}${chunk2JGRDU6N_cjs.colors.cyan(S_BAR)} ${this.options.map(
622
622
  (option, i) => opt(option, i === this.cursor ? "active" : "inactive")
623
623
  ).join(`
624
- ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} `)}
625
- ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR_END)}
624
+ ${chunk2JGRDU6N_cjs.colors.cyan(S_BAR)} `)}
625
+ ${chunk2JGRDU6N_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 `${chunkKXT7F2WS_cjs.colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? chunkKXT7F2WS_cjs.colors.dim(`(${option.hint})`) : ""}`;
637
+ return `${chunk2JGRDU6N_cjs.colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? chunk2JGRDU6N_cjs.colors.dim(`(${option.hint})`) : ""}`;
638
638
  }
639
639
  case "selected": {
640
- return `${chunkKXT7F2WS_cjs.colors.green(S_CHECKBOX_SELECTED)} ${chunkKXT7F2WS_cjs.colors.dim(label)}`;
640
+ return `${chunk2JGRDU6N_cjs.colors.green(S_CHECKBOX_SELECTED)} ${chunk2JGRDU6N_cjs.colors.dim(label)}`;
641
641
  }
642
642
  case "cancelled": {
643
- return `${chunkKXT7F2WS_cjs.colors.strikethrough(chunkKXT7F2WS_cjs.colors.dim(label))}`;
643
+ return `${chunk2JGRDU6N_cjs.colors.strikethrough(chunk2JGRDU6N_cjs.colors.dim(label))}`;
644
644
  }
645
645
  case "active-selected": {
646
- return `${chunkKXT7F2WS_cjs.colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? chunkKXT7F2WS_cjs.colors.dim(`(${option.hint})`) : ""}`;
646
+ return `${chunk2JGRDU6N_cjs.colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? chunk2JGRDU6N_cjs.colors.dim(`(${option.hint})`) : ""}`;
647
647
  }
648
648
  case "submitted": {
649
- return `${chunkKXT7F2WS_cjs.colors.dim(label)}`;
649
+ return `${chunk2JGRDU6N_cjs.colors.dim(label)}`;
650
650
  }
651
651
  }
652
- return `${chunkKXT7F2WS_cjs.colors.dim(S_CHECKBOX_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(label)}`;
652
+ return `${chunk2JGRDU6N_cjs.colors.dim(S_CHECKBOX_INACTIVE)} ${chunk2JGRDU6N_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
- ${chunkKXT7F2WS_cjs.colors.reset(
663
- chunkKXT7F2WS_cjs.colors.dim(
664
- `Press ${chunkKXT7F2WS_cjs.colors.gray(
665
- chunkKXT7F2WS_cjs.colors.bgWhite(chunkKXT7F2WS_cjs.colors.inverse(" space "))
666
- )} to select, ${chunkKXT7F2WS_cjs.colors.gray(
667
- chunkKXT7F2WS_cjs.colors.bgWhite(chunkKXT7F2WS_cjs.colors.inverse(" enter "))
662
+ ${chunk2JGRDU6N_cjs.colors.reset(
663
+ chunk2JGRDU6N_cjs.colors.dim(
664
+ `Press ${chunk2JGRDU6N_cjs.colors.gray(
665
+ chunk2JGRDU6N_cjs.colors.bgWhite(chunk2JGRDU6N_cjs.colors.inverse(" space "))
666
+ )} to select, ${chunk2JGRDU6N_cjs.colors.gray(
667
+ chunk2JGRDU6N_cjs.colors.bgWhite(chunk2JGRDU6N_cjs.colors.inverse(" enter "))
668
668
  )} to submit`
669
669
  )
670
670
  )}`;
671
671
  }
672
672
  },
673
673
  render() {
674
- const title = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
674
+ const title = `${chunk2JGRDU6N_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}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(chunkKXT7F2WS_cjs.colors.dim(", ")) || chunkKXT7F2WS_cjs.colors.dim("none")}`;
679
+ return `${title}${chunk2JGRDU6N_cjs.colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(chunk2JGRDU6N_cjs.colors.dim(", ")) || chunk2JGRDU6N_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(chunkKXT7F2WS_cjs.colors.dim(", "));
683
- return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${label.trim() ? `${label}
684
- ${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}` : ""}`;
682
+ const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(chunk2JGRDU6N_cjs.colors.dim(", "));
683
+ return `${title}${chunk2JGRDU6N_cjs.colors.gray(S_BAR)} ${label.trim() ? `${label}
684
+ ${chunk2JGRDU6N_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 ? `${chunkKXT7F2WS_cjs.colors.yellow(S_BAR_END)} ${chunkKXT7F2WS_cjs.colors.yellow(ln)}` : ` ${ln}`
688
+ (ln, i) => i === 0 ? `${chunk2JGRDU6N_cjs.colors.yellow(S_BAR_END)} ${chunk2JGRDU6N_cjs.colors.yellow(ln)}` : ` ${ln}`
689
689
  ).join("\n");
690
- return title + chunkKXT7F2WS_cjs.colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
690
+ return title + chunk2JGRDU6N_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
- ${chunkKXT7F2WS_cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
701
+ ${chunk2JGRDU6N_cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
702
702
  }
703
703
  default: {
704
- return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${this.options.map((option, i) => {
704
+ return `${title}${chunk2JGRDU6N_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
- ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} `)}
716
- ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR_END)}
715
+ ${chunk2JGRDU6N_cjs.colors.cyan(S_BAR)} `)}
716
+ ${chunk2JGRDU6N_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-FODZPXQF.cjs.map
760
- //# sourceMappingURL=prompt-FODZPXQF.cjs.map
759
+ //# sourceMappingURL=prompt-NXAVVYGK.cjs.map
760
+ //# sourceMappingURL=prompt-NXAVVYGK.cjs.map