sandstone-cli 2.1.0 → 2.1.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/lib/create.js CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import { createRequire } from "node:module";
4
3
  var __create = Object.create;
5
4
  var __getProtoOf = Object.getPrototypeOf;
6
5
  var __defProp = Object.defineProperty;
@@ -18,7 +17,7 @@ var __toESM = (mod, isNodeMode, target) => {
18
17
  return to;
19
18
  };
20
19
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
21
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
+ var __require = import.meta.require;
22
21
 
23
22
  // node_modules/commander/lib/error.js
24
23
  var require_error = __commonJS((exports) => {
@@ -341,7 +340,7 @@ var require_help = __commonJS((exports) => {
341
340
  return Math.max(helper.longestOptionTermLength(cmd, helper), helper.longestGlobalOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper));
342
341
  }
343
342
  wrap(str, width, indent, minColumnWidth = 40) {
344
- const indents = " \\f\\t\\v   -    \uFEFF";
343
+ const indents = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF";
345
344
  const manualIndent = new RegExp(`[\\n][${indents}]+`);
346
345
  if (str.match(manualIndent))
347
346
  return str;
@@ -353,7 +352,7 @@ var require_help = __commonJS((exports) => {
353
352
  `, `
354
353
  `);
355
354
  const indentString = " ".repeat(indent);
356
- const zeroWidthSpace = "";
355
+ const zeroWidthSpace = "\u200B";
357
356
  const breaks = `\\s${zeroWidthSpace}`;
358
357
  const regex = new RegExp(`
359
358
  |.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, "g");
@@ -5661,173 +5660,6 @@ var require_lib = __commonJS((exports, module) => {
5661
5660
  };
5662
5661
  });
5663
5662
 
5664
- // node_modules/cli-width/index.js
5665
- var require_cli_width = __commonJS((exports, module) => {
5666
- module.exports = cliWidth;
5667
- function normalizeOpts(options) {
5668
- const defaultOpts = {
5669
- defaultWidth: 0,
5670
- output: process.stdout,
5671
- tty: __require("tty")
5672
- };
5673
- if (!options) {
5674
- return defaultOpts;
5675
- }
5676
- Object.keys(defaultOpts).forEach(function(key) {
5677
- if (!options[key]) {
5678
- options[key] = defaultOpts[key];
5679
- }
5680
- });
5681
- return options;
5682
- }
5683
- function cliWidth(options) {
5684
- const opts = normalizeOpts(options);
5685
- if (opts.output.getWindowSize) {
5686
- return opts.output.getWindowSize()[0] || opts.defaultWidth;
5687
- }
5688
- if (opts.tty.getWindowSize) {
5689
- return opts.tty.getWindowSize()[1] || opts.defaultWidth;
5690
- }
5691
- if (opts.output.columns) {
5692
- return opts.output.columns;
5693
- }
5694
- if (process.env.CLI_WIDTH) {
5695
- const width = parseInt(process.env.CLI_WIDTH, 10);
5696
- if (!isNaN(width) && width !== 0) {
5697
- return width;
5698
- }
5699
- }
5700
- return opts.defaultWidth;
5701
- }
5702
- });
5703
-
5704
- // node_modules/emoji-regex/index.js
5705
- var require_emoji_regex = __commonJS((exports, module) => {
5706
- module.exports = () => {
5707
- return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
5708
- };
5709
- });
5710
-
5711
- // node_modules/mute-stream/lib/index.js
5712
- var require_lib2 = __commonJS((exports, module) => {
5713
- var Stream = __require("stream");
5714
-
5715
- class MuteStream extends Stream {
5716
- #isTTY = null;
5717
- constructor(opts = {}) {
5718
- super(opts);
5719
- this.writable = this.readable = true;
5720
- this.muted = false;
5721
- this.on("pipe", this._onpipe);
5722
- this.replace = opts.replace;
5723
- this._prompt = opts.prompt || null;
5724
- this._hadControl = false;
5725
- }
5726
- #destSrc(key, def) {
5727
- if (this._dest) {
5728
- return this._dest[key];
5729
- }
5730
- if (this._src) {
5731
- return this._src[key];
5732
- }
5733
- return def;
5734
- }
5735
- #proxy(method, ...args) {
5736
- if (typeof this._dest?.[method] === "function") {
5737
- this._dest[method](...args);
5738
- }
5739
- if (typeof this._src?.[method] === "function") {
5740
- this._src[method](...args);
5741
- }
5742
- }
5743
- get isTTY() {
5744
- if (this.#isTTY !== null) {
5745
- return this.#isTTY;
5746
- }
5747
- return this.#destSrc("isTTY", false);
5748
- }
5749
- set isTTY(val) {
5750
- this.#isTTY = val;
5751
- }
5752
- get rows() {
5753
- return this.#destSrc("rows");
5754
- }
5755
- get columns() {
5756
- return this.#destSrc("columns");
5757
- }
5758
- mute() {
5759
- this.muted = true;
5760
- }
5761
- unmute() {
5762
- this.muted = false;
5763
- }
5764
- _onpipe(src) {
5765
- this._src = src;
5766
- }
5767
- pipe(dest, options) {
5768
- this._dest = dest;
5769
- return super.pipe(dest, options);
5770
- }
5771
- pause() {
5772
- if (this._src) {
5773
- return this._src.pause();
5774
- }
5775
- }
5776
- resume() {
5777
- if (this._src) {
5778
- return this._src.resume();
5779
- }
5780
- }
5781
- write(c) {
5782
- if (this.muted) {
5783
- if (!this.replace) {
5784
- return true;
5785
- }
5786
- if (c.match(/^\u001b/)) {
5787
- if (c.indexOf(this._prompt) === 0) {
5788
- c = c.slice(this._prompt.length);
5789
- c = c.replace(/./g, this.replace);
5790
- c = this._prompt + c;
5791
- }
5792
- this._hadControl = true;
5793
- return this.emit("data", c);
5794
- } else {
5795
- if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
5796
- this._hadControl = false;
5797
- this.emit("data", this._prompt);
5798
- c = c.slice(this._prompt.length);
5799
- }
5800
- c = c.toString().replace(/./g, this.replace);
5801
- }
5802
- }
5803
- this.emit("data", c);
5804
- }
5805
- end(c) {
5806
- if (this.muted) {
5807
- if (c && this.replace) {
5808
- c = c.toString().replace(/./g, this.replace);
5809
- } else {
5810
- c = null;
5811
- }
5812
- }
5813
- if (c) {
5814
- this.emit("data", c);
5815
- }
5816
- this.emit("end");
5817
- }
5818
- destroy(...args) {
5819
- return this.#proxy("destroy", ...args);
5820
- }
5821
- destroySoon(...args) {
5822
- return this.#proxy("destroySoon", ...args);
5823
- }
5824
- close(...args) {
5825
- return this.#proxy("close", ...args);
5826
- }
5827
- }
5828
- module.exports = MuteStream;
5829
- });
5830
-
5831
5663
  // node_modules/commander/esm.mjs
5832
5664
  var import__ = __toESM(require_commander(), 1);
5833
5665
  var {
@@ -5848,7 +5680,7 @@ var {
5848
5680
  import figlet from "figlet";
5849
5681
 
5850
5682
  // src/version.ts
5851
- var CLI_VERSION = "2.1.0";
5683
+ var CLI_VERSION = "2.1.1";
5852
5684
 
5853
5685
  // src/commands/create.ts
5854
5686
  var import_semver = __toESM(require_semver2(), 1);
@@ -6033,9 +5865,9 @@ var ansiStyles = assembleStyles();
6033
5865
  var ansi_styles_default = ansiStyles;
6034
5866
 
6035
5867
  // node_modules/chalk/source/vendor/supports-color/index.js
6036
- import process2 from "node:process";
6037
- import os from "node:os";
6038
- import tty from "node:tty";
5868
+ import process2 from "process";
5869
+ import os from "os";
5870
+ import tty from "tty";
6039
5871
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
6040
5872
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
6041
5873
  const position = argv.indexOf(prefix + flag);
@@ -6521,1896 +6353,114 @@ var nanoid = (size = 21) => {
6521
6353
  return id;
6522
6354
  };
6523
6355
 
6524
- // node_modules/@inquirer/core/dist/lib/key.js
6525
- var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
6526
- var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
6527
- var isBackspaceKey = (key) => key.name === "backspace";
6528
- var isTabKey = (key) => key.name === "tab";
6529
- var isNumberKey = (key) => "1234567890".includes(key.name);
6530
- var isEnterKey = (key) => key.name === "enter" || key.name === "return";
6531
- // node_modules/@inquirer/core/dist/lib/errors.js
6532
- class AbortPromptError extends Error {
6533
- name = "AbortPromptError";
6534
- message = "Prompt was aborted";
6535
- constructor(options) {
6536
- super();
6537
- this.cause = options?.cause;
6538
- }
6539
- }
6540
-
6541
- class CancelPromptError extends Error {
6542
- name = "CancelPromptError";
6543
- message = "Prompt was canceled";
6544
- }
6545
-
6546
- class ExitPromptError extends Error {
6547
- name = "ExitPromptError";
6548
- }
6549
-
6550
- class HookError extends Error {
6551
- name = "HookError";
6552
- }
6553
-
6554
- class ValidationError extends Error {
6555
- name = "ValidationError";
6556
- }
6557
- // node_modules/@inquirer/core/dist/lib/use-state.js
6558
- import { AsyncResource as AsyncResource2 } from "node:async_hooks";
6356
+ // src/commands/create.ts
6357
+ import { confirm, select, input } from "@inquirer/prompts";
6559
6358
 
6560
- // node_modules/@inquirer/core/dist/lib/hook-engine.js
6561
- import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
6562
- var hookStorage = new AsyncLocalStorage;
6563
- function createStore(rl) {
6564
- const store = {
6565
- rl,
6566
- hooks: [],
6567
- hooksCleanup: [],
6568
- hooksEffect: [],
6569
- index: 0,
6570
- handleChange() {}
6571
- };
6572
- return store;
6573
- }
6574
- function withHooks(rl, cb) {
6575
- const store = createStore(rl);
6576
- return hookStorage.run(store, () => {
6577
- function cycle(render) {
6578
- store.handleChange = () => {
6579
- store.index = 0;
6580
- render();
6581
- };
6582
- store.handleChange();
6583
- }
6584
- return cb(cycle);
6585
- });
6586
- }
6587
- function getStore() {
6588
- const store = hookStorage.getStore();
6589
- if (!store) {
6590
- throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
6591
- }
6592
- return store;
6593
- }
6594
- function readline() {
6595
- return getStore().rl;
6596
- }
6597
- function withUpdates(fn) {
6598
- const wrapped = (...args) => {
6599
- const store = getStore();
6600
- let shouldUpdate = false;
6601
- const oldHandleChange = store.handleChange;
6602
- store.handleChange = () => {
6603
- shouldUpdate = true;
6604
- };
6605
- const returnValue = fn(...args);
6606
- if (shouldUpdate) {
6607
- oldHandleChange();
6608
- }
6609
- store.handleChange = oldHandleChange;
6610
- return returnValue;
6611
- };
6612
- return AsyncResource.bind(wrapped);
6613
- }
6614
- function withPointer(cb) {
6615
- const store = getStore();
6616
- const { index } = store;
6617
- const pointer = {
6618
- get() {
6619
- return store.hooks[index];
6620
- },
6621
- set(value) {
6622
- store.hooks[index] = value;
6623
- },
6624
- initialized: index in store.hooks
6625
- };
6626
- const returnValue = cb(pointer);
6627
- store.index++;
6628
- return returnValue;
6629
- }
6630
- function handleChange() {
6631
- getStore().handleChange();
6632
- }
6633
- var effectScheduler = {
6634
- queue(cb) {
6635
- const store = getStore();
6636
- const { index } = store;
6637
- store.hooksEffect.push(() => {
6638
- store.hooksCleanup[index]?.();
6639
- const cleanFn = cb(readline());
6640
- if (cleanFn != null && typeof cleanFn !== "function") {
6641
- throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
6642
- }
6643
- store.hooksCleanup[index] = cleanFn;
6644
- });
6645
- },
6646
- run() {
6647
- const store = getStore();
6648
- withUpdates(() => {
6649
- store.hooksEffect.forEach((effect) => {
6650
- effect();
6651
- });
6652
- store.hooksEffect.length = 0;
6653
- })();
6654
- },
6655
- clearAll() {
6656
- const store = getStore();
6657
- store.hooksCleanup.forEach((cleanFn) => {
6658
- cleanFn?.();
6659
- });
6660
- store.hooksEffect.length = 0;
6661
- store.hooksCleanup.length = 0;
6359
+ // src/utils.ts
6360
+ import fs from "fs";
6361
+ import path from "path";
6362
+ import os2 from "os";
6363
+ import { execSync } from "child_process";
6364
+ function hasYarn() {
6365
+ try {
6366
+ execSync("yarn --version");
6367
+ return true;
6368
+ } catch (error) {
6369
+ return false;
6662
6370
  }
6663
- };
6664
-
6665
- // node_modules/@inquirer/core/dist/lib/use-state.js
6666
- function useState(defaultValue) {
6667
- return withPointer((pointer) => {
6668
- const setState = AsyncResource2.bind(function setState2(newValue) {
6669
- if (pointer.get() !== newValue) {
6670
- pointer.set(newValue);
6671
- handleChange();
6672
- }
6673
- });
6674
- if (pointer.initialized) {
6675
- return [pointer.get(), setState];
6676
- }
6677
- const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
6678
- pointer.set(value);
6679
- return [value, setState];
6680
- });
6681
- }
6682
-
6683
- // node_modules/@inquirer/core/dist/lib/use-effect.js
6684
- function useEffect(cb, depArray) {
6685
- withPointer((pointer) => {
6686
- const oldDeps = pointer.get();
6687
- const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
6688
- if (hasChanged) {
6689
- effectScheduler.queue(cb);
6690
- }
6691
- pointer.set(depArray);
6692
- });
6693
6371
  }
6694
-
6695
- // node_modules/@inquirer/core/dist/lib/theme.js
6696
- import { styleText } from "node:util";
6697
-
6698
- // node_modules/@inquirer/figures/dist/index.js
6699
- import process3 from "node:process";
6700
- function isUnicodeSupported() {
6701
- if (process3.platform !== "win32") {
6702
- return process3.env["TERM"] !== "linux";
6372
+ function hasPnpm() {
6373
+ try {
6374
+ execSync("pnpm --version");
6375
+ return true;
6376
+ } catch (error) {
6377
+ return false;
6703
6378
  }
6704
- return Boolean(process3.env["WT_SESSION"]) || Boolean(process3.env["TERMINUS_SUBLIME"]) || process3.env["ConEmuTask"] === "{cmd::Cmder}" || process3.env["TERM_PROGRAM"] === "Terminus-Sublime" || process3.env["TERM_PROGRAM"] === "vscode" || process3.env["TERM"] === "xterm-256color" || process3.env["TERM"] === "alacritty" || process3.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
6705
6379
  }
6706
- var common = {
6707
- circleQuestionMark: "(?)",
6708
- questionMarkPrefix: "(?)",
6709
- square: "█",
6710
- squareDarkShade: "▓",
6711
- squareMediumShade: "▒",
6712
- squareLightShade: "░",
6713
- squareTop: "▀",
6714
- squareBottom: "▄",
6715
- squareLeft: "▌",
6716
- squareRight: "▐",
6717
- squareCenter: "■",
6718
- bullet: "●",
6719
- dot: "․",
6720
- ellipsis: "…",
6721
- pointerSmall: "›",
6722
- triangleUp: "▲",
6723
- triangleUpSmall: "▴",
6724
- triangleDown: "▼",
6725
- triangleDownSmall: "▾",
6726
- triangleLeftSmall: "◂",
6727
- triangleRightSmall: "▸",
6728
- home: "⌂",
6729
- heart: "♥",
6730
- musicNote: "♪",
6731
- musicNoteBeamed: "♫",
6732
- arrowUp: "↑",
6733
- arrowDown: "↓",
6734
- arrowLeft: "←",
6735
- arrowRight: "→",
6736
- arrowLeftRight: "↔",
6737
- arrowUpDown: "↕",
6738
- almostEqual: "≈",
6739
- notEqual: "≠",
6740
- lessOrEqual: "≤",
6741
- greaterOrEqual: "≥",
6742
- identical: "≡",
6743
- infinity: "∞",
6744
- subscriptZero: "₀",
6745
- subscriptOne: "₁",
6746
- subscriptTwo: "₂",
6747
- subscriptThree: "₃",
6748
- subscriptFour: "₄",
6749
- subscriptFive: "₅",
6750
- subscriptSix: "₆",
6751
- subscriptSeven: "₇",
6752
- subscriptEight: "₈",
6753
- subscriptNine: "₉",
6754
- oneHalf: "½",
6755
- oneThird: "⅓",
6756
- oneQuarter: "¼",
6757
- oneFifth: "⅕",
6758
- oneSixth: "⅙",
6759
- oneEighth: "⅛",
6760
- twoThirds: "⅔",
6761
- twoFifths: "⅖",
6762
- threeQuarters: "¾",
6763
- threeFifths: "⅗",
6764
- threeEighths: "⅜",
6765
- fourFifths: "⅘",
6766
- fiveSixths: "⅚",
6767
- fiveEighths: "⅝",
6768
- sevenEighths: "⅞",
6769
- line: "─",
6770
- lineBold: "━",
6771
- lineDouble: "═",
6772
- lineDashed0: "┄",
6773
- lineDashed1: "┅",
6774
- lineDashed2: "┈",
6775
- lineDashed3: "┉",
6776
- lineDashed4: "╌",
6777
- lineDashed5: "╍",
6778
- lineDashed6: "╴",
6779
- lineDashed7: "╶",
6780
- lineDashed8: "╸",
6781
- lineDashed9: "╺",
6782
- lineDashed10: "╼",
6783
- lineDashed11: "╾",
6784
- lineDashed12: "−",
6785
- lineDashed13: "–",
6786
- lineDashed14: "‐",
6787
- lineDashed15: "⁃",
6788
- lineVertical: "│",
6789
- lineVerticalBold: "┃",
6790
- lineVerticalDouble: "║",
6791
- lineVerticalDashed0: "┆",
6792
- lineVerticalDashed1: "┇",
6793
- lineVerticalDashed2: "┊",
6794
- lineVerticalDashed3: "┋",
6795
- lineVerticalDashed4: "╎",
6796
- lineVerticalDashed5: "╏",
6797
- lineVerticalDashed6: "╵",
6798
- lineVerticalDashed7: "╷",
6799
- lineVerticalDashed8: "╹",
6800
- lineVerticalDashed9: "╻",
6801
- lineVerticalDashed10: "╽",
6802
- lineVerticalDashed11: "╿",
6803
- lineDownLeft: "┐",
6804
- lineDownLeftArc: "╮",
6805
- lineDownBoldLeftBold: "┓",
6806
- lineDownBoldLeft: "┒",
6807
- lineDownLeftBold: "┑",
6808
- lineDownDoubleLeftDouble: "╗",
6809
- lineDownDoubleLeft: "╖",
6810
- lineDownLeftDouble: "╕",
6811
- lineDownRight: "┌",
6812
- lineDownRightArc: "╭",
6813
- lineDownBoldRightBold: "┏",
6814
- lineDownBoldRight: "┎",
6815
- lineDownRightBold: "┍",
6816
- lineDownDoubleRightDouble: "╔",
6817
- lineDownDoubleRight: "╓",
6818
- lineDownRightDouble: "╒",
6819
- lineUpLeft: "┘",
6820
- lineUpLeftArc: "╯",
6821
- lineUpBoldLeftBold: "┛",
6822
- lineUpBoldLeft: "┚",
6823
- lineUpLeftBold: "┙",
6824
- lineUpDoubleLeftDouble: "╝",
6825
- lineUpDoubleLeft: "╜",
6826
- lineUpLeftDouble: "╛",
6827
- lineUpRight: "└",
6828
- lineUpRightArc: "╰",
6829
- lineUpBoldRightBold: "┗",
6830
- lineUpBoldRight: "┖",
6831
- lineUpRightBold: "┕",
6832
- lineUpDoubleRightDouble: "╚",
6833
- lineUpDoubleRight: "╙",
6834
- lineUpRightDouble: "╘",
6835
- lineUpDownLeft: "┤",
6836
- lineUpBoldDownBoldLeftBold: "┫",
6837
- lineUpBoldDownBoldLeft: "┨",
6838
- lineUpDownLeftBold: "┥",
6839
- lineUpBoldDownLeftBold: "┩",
6840
- lineUpDownBoldLeftBold: "┪",
6841
- lineUpDownBoldLeft: "┧",
6842
- lineUpBoldDownLeft: "┦",
6843
- lineUpDoubleDownDoubleLeftDouble: "╣",
6844
- lineUpDoubleDownDoubleLeft: "╢",
6845
- lineUpDownLeftDouble: "╡",
6846
- lineUpDownRight: "├",
6847
- lineUpBoldDownBoldRightBold: "┣",
6848
- lineUpBoldDownBoldRight: "┠",
6849
- lineUpDownRightBold: "┝",
6850
- lineUpBoldDownRightBold: "┡",
6851
- lineUpDownBoldRightBold: "┢",
6852
- lineUpDownBoldRight: "┟",
6853
- lineUpBoldDownRight: "┞",
6854
- lineUpDoubleDownDoubleRightDouble: "╠",
6855
- lineUpDoubleDownDoubleRight: "╟",
6856
- lineUpDownRightDouble: "╞",
6857
- lineDownLeftRight: "┬",
6858
- lineDownBoldLeftBoldRightBold: "┳",
6859
- lineDownLeftBoldRightBold: "┯",
6860
- lineDownBoldLeftRight: "┰",
6861
- lineDownBoldLeftBoldRight: "┱",
6862
- lineDownBoldLeftRightBold: "┲",
6863
- lineDownLeftRightBold: "┮",
6864
- lineDownLeftBoldRight: "┭",
6865
- lineDownDoubleLeftDoubleRightDouble: "╦",
6866
- lineDownDoubleLeftRight: "╥",
6867
- lineDownLeftDoubleRightDouble: "╤",
6868
- lineUpLeftRight: "┴",
6869
- lineUpBoldLeftBoldRightBold: "┻",
6870
- lineUpLeftBoldRightBold: "┷",
6871
- lineUpBoldLeftRight: "┸",
6872
- lineUpBoldLeftBoldRight: "┹",
6873
- lineUpBoldLeftRightBold: "┺",
6874
- lineUpLeftRightBold: "┶",
6875
- lineUpLeftBoldRight: "┵",
6876
- lineUpDoubleLeftDoubleRightDouble: "╩",
6877
- lineUpDoubleLeftRight: "╨",
6878
- lineUpLeftDoubleRightDouble: "╧",
6879
- lineUpDownLeftRight: "┼",
6880
- lineUpBoldDownBoldLeftBoldRightBold: "╋",
6881
- lineUpDownBoldLeftBoldRightBold: "╈",
6882
- lineUpBoldDownLeftBoldRightBold: "╇",
6883
- lineUpBoldDownBoldLeftRightBold: "╊",
6884
- lineUpBoldDownBoldLeftBoldRight: "╉",
6885
- lineUpBoldDownLeftRight: "╀",
6886
- lineUpDownBoldLeftRight: "╁",
6887
- lineUpDownLeftBoldRight: "┽",
6888
- lineUpDownLeftRightBold: "┾",
6889
- lineUpBoldDownBoldLeftRight: "╂",
6890
- lineUpDownLeftBoldRightBold: "┿",
6891
- lineUpBoldDownLeftBoldRight: "╃",
6892
- lineUpBoldDownLeftRightBold: "╄",
6893
- lineUpDownBoldLeftBoldRight: "╅",
6894
- lineUpDownBoldLeftRightBold: "╆",
6895
- lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
6896
- lineUpDoubleDownDoubleLeftRight: "╫",
6897
- lineUpDownLeftDoubleRightDouble: "╪",
6898
- lineCross: "╳",
6899
- lineBackslash: "╲",
6900
- lineSlash: "╱"
6901
- };
6902
- var specialMainSymbols = {
6903
- tick: "✔",
6904
- info: "ℹ",
6905
- warning: "⚠",
6906
- cross: "✘",
6907
- squareSmall: "◻",
6908
- squareSmallFilled: "◼",
6909
- circle: "◯",
6910
- circleFilled: "◉",
6911
- circleDotted: "◌",
6912
- circleDouble: "◎",
6913
- circleCircle: "ⓞ",
6914
- circleCross: "ⓧ",
6915
- circlePipe: "Ⓘ",
6916
- radioOn: "◉",
6917
- radioOff: "◯",
6918
- checkboxOn: "☒",
6919
- checkboxOff: "☐",
6920
- checkboxCircleOn: "ⓧ",
6921
- checkboxCircleOff: "Ⓘ",
6922
- pointer: "❯",
6923
- triangleUpOutline: "△",
6924
- triangleLeft: "◀",
6925
- triangleRight: "▶",
6926
- lozenge: "◆",
6927
- lozengeOutline: "◇",
6928
- hamburger: "☰",
6929
- smiley: "㋡",
6930
- mustache: "෴",
6931
- star: "★",
6932
- play: "▶",
6933
- nodejs: "⬢",
6934
- oneSeventh: "⅐",
6935
- oneNinth: "⅑",
6936
- oneTenth: "⅒"
6937
- };
6938
- var specialFallbackSymbols = {
6939
- tick: "√",
6940
- info: "i",
6941
- warning: "‼",
6942
- cross: "×",
6943
- squareSmall: "□",
6944
- squareSmallFilled: "■",
6945
- circle: "( )",
6946
- circleFilled: "(*)",
6947
- circleDotted: "( )",
6948
- circleDouble: "( )",
6949
- circleCircle: "(○)",
6950
- circleCross: "(×)",
6951
- circlePipe: "(│)",
6952
- radioOn: "(*)",
6953
- radioOff: "( )",
6954
- checkboxOn: "[×]",
6955
- checkboxOff: "[ ]",
6956
- checkboxCircleOn: "(×)",
6957
- checkboxCircleOff: "( )",
6958
- pointer: ">",
6959
- triangleUpOutline: "∆",
6960
- triangleLeft: "◄",
6961
- triangleRight: "►",
6962
- lozenge: "♦",
6963
- lozengeOutline: "◊",
6964
- hamburger: "≡",
6965
- smiley: "☺",
6966
- mustache: "┌─┐",
6967
- star: "✶",
6968
- play: "►",
6969
- nodejs: "♦",
6970
- oneSeventh: "1/7",
6971
- oneNinth: "1/9",
6972
- oneTenth: "1/10"
6973
- };
6974
- var mainSymbols = {
6975
- ...common,
6976
- ...specialMainSymbols
6977
- };
6978
- var fallbackSymbols = {
6979
- ...common,
6980
- ...specialFallbackSymbols
6981
- };
6982
- var shouldUseMain = isUnicodeSupported();
6983
- var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
6984
- var dist_default = figures;
6985
- var replacements = Object.entries(specialMainSymbols);
6986
-
6987
- // node_modules/@inquirer/core/dist/lib/theme.js
6988
- var defaultTheme = {
6989
- prefix: {
6990
- idle: styleText("blue", "?"),
6991
- done: styleText("green", dist_default.tick)
6992
- },
6993
- spinner: {
6994
- interval: 80,
6995
- frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => styleText("yellow", frame))
6996
- },
6997
- style: {
6998
- answer: (text) => styleText("cyan", text),
6999
- message: (text) => styleText("bold", text),
7000
- error: (text) => styleText("red", `> ${text}`),
7001
- defaultAnswer: (text) => styleText("dim", `(${text})`),
7002
- help: (text) => styleText("dim", text),
7003
- highlight: (text) => styleText("cyan", text),
7004
- key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
7005
- }
7006
- };
7007
-
7008
- // node_modules/@inquirer/core/dist/lib/make-theme.js
7009
- function isPlainObject(value) {
7010
- if (typeof value !== "object" || value === null)
6380
+ function hasBun() {
6381
+ try {
6382
+ execSync("bun --version");
6383
+ return true;
6384
+ } catch (error) {
7011
6385
  return false;
7012
- let proto2 = value;
7013
- while (Object.getPrototypeOf(proto2) !== null) {
7014
- proto2 = Object.getPrototypeOf(proto2);
7015
6386
  }
7016
- return Object.getPrototypeOf(value) === proto2;
7017
6387
  }
7018
- function deepMerge(...objects) {
7019
- const output = {};
7020
- for (const obj of objects) {
7021
- for (const [key, value] of Object.entries(obj)) {
7022
- const prevValue = output[key];
7023
- output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
6388
+ var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
6389
+ function getMinecraftPath() {
6390
+ function getMCPath() {
6391
+ switch (os2.platform()) {
6392
+ case "win32":
6393
+ return path.join(os2.homedir(), "AppData/Roaming/.minecraft");
6394
+ case "darwin":
6395
+ return path.join(os2.homedir(), "Library/Application Support/minecraft");
6396
+ case "linux":
6397
+ default:
6398
+ return path.join(os2.homedir(), ".minecraft");
7024
6399
  }
7025
6400
  }
7026
- return output;
6401
+ const mcPath = getMCPath();
6402
+ if (!fs.existsSync(mcPath)) {
6403
+ throw new Error("Unable to locate the .minecraft folder. Please specify it manually.");
6404
+ }
6405
+ return mcPath;
7027
6406
  }
7028
- function makeTheme(...themes) {
7029
- const themesToMerge = [
7030
- defaultTheme,
7031
- ...themes.filter((theme) => theme != null)
7032
- ];
7033
- return deepMerge(...themesToMerge);
6407
+ function getWorldsList(clientPath) {
6408
+ const mcPath = clientPath || getMinecraftPath();
6409
+ const savesPath = path.join(mcPath, "saves");
6410
+ return fs.readdirSync(savesPath, { withFileTypes: true }).filter((f) => f.isDirectory).map((f) => f.name);
7034
6411
  }
7035
6412
 
7036
- // node_modules/@inquirer/core/dist/lib/use-prefix.js
7037
- function usePrefix({ status = "idle", theme }) {
7038
- const [showLoader, setShowLoader] = useState(false);
7039
- const [tick, setTick] = useState(0);
7040
- const { prefix, spinner } = makeTheme(theme);
7041
- useEffect(() => {
7042
- if (status === "loading") {
7043
- let tickInterval;
7044
- let inc = -1;
7045
- const delayTimeout = setTimeout(() => {
7046
- setShowLoader(true);
7047
- tickInterval = setInterval(() => {
7048
- inc = inc + 1;
7049
- setTick(inc % spinner.frames.length);
7050
- }, spinner.interval);
7051
- }, 300);
7052
- return () => {
7053
- clearTimeout(delayTimeout);
7054
- clearInterval(tickInterval);
7055
- };
7056
- } else {
7057
- setShowLoader(false);
7058
- }
7059
- }, [status]);
7060
- if (showLoader) {
7061
- return spinner.frames[tick];
7062
- }
7063
- const iconName = status === "loading" ? "idle" : status;
7064
- return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
7065
- }
7066
- // node_modules/@inquirer/core/dist/lib/use-memo.js
7067
- function useMemo(fn, dependencies) {
7068
- return withPointer((pointer) => {
7069
- const prev = pointer.get();
7070
- if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
7071
- const value = fn();
7072
- pointer.set({ value, dependencies });
7073
- return value;
7074
- }
7075
- return prev.value;
6413
+ // src/commands/create.ts
6414
+ function toJson(obj, pretty = false) {
6415
+ return util.inspect(obj, {
6416
+ depth: Number(Infinity),
6417
+ colors: false,
6418
+ breakLength: Number(Infinity),
6419
+ compact: !pretty,
6420
+ maxArrayLength: Number(Infinity)
7076
6421
  });
7077
6422
  }
7078
- // node_modules/@inquirer/core/dist/lib/use-ref.js
7079
- function useRef(val) {
7080
- return useState({ current: val })[0];
7081
- }
7082
- // node_modules/@inquirer/core/dist/lib/use-keypress.js
7083
- function useKeypress(userHandler) {
7084
- const signal = useRef(userHandler);
7085
- signal.current = userHandler;
7086
- useEffect((rl) => {
7087
- let ignore = false;
7088
- const handler = withUpdates((_input, event) => {
7089
- if (ignore)
7090
- return;
7091
- signal.current(event, rl);
6423
+ async function createCommand2(_project, opts) {
6424
+ const projectPath = path2.resolve(_project);
6425
+ const projectName = path2.basename(projectPath);
6426
+ const projectType = await confirm({
6427
+ message: "Whether your project will be a library for use in other Sandstone projects >",
6428
+ default: false
6429
+ }) === true ? "library" : "pack";
6430
+ const sv = (v) => new import_semver.SemVer(v);
6431
+ const versions = [[sv("1.0.0-beta.1"), sv(CLI_VERSION)]];
6432
+ const version = await select({
6433
+ message: "Which version of Sandstone do you want to use? These are the only supported versions for new projects.",
6434
+ choices: versions.map((v) => {
6435
+ const { prerelease, major, minor } = v[0];
6436
+ const release = `${major}.${minor}`;
6437
+ return {
6438
+ name: prerelease.length === 0 ? `Release Version ${release}` : `${capitalize(prerelease[0])} Version ${prerelease[1]} for release ${release}`,
6439
+ value: v,
6440
+ short: v[0].toString()
6441
+ };
6442
+ }),
6443
+ default: versions[0]
6444
+ });
6445
+ let packName = projectName;
6446
+ let namespace = projectName.replace(RegExp(/ /g), "_");
6447
+ if (projectType === "pack") {
6448
+ packName = await input({
6449
+ message: "Name of your output pack(s) (can be changed later) >",
6450
+ default: projectName
7092
6451
  });
7093
- rl.input.on("keypress", handler);
7094
- return () => {
7095
- ignore = true;
7096
- rl.input.removeListener("keypress", handler);
7097
- };
7098
- }, []);
7099
- }
7100
- // node_modules/@inquirer/core/dist/lib/utils.js
7101
- var import_cli_width = __toESM(require_cli_width(), 1);
7102
-
7103
- // node_modules/ansi-regex/index.js
7104
- function ansiRegex({ onlyFirst = false } = {}) {
7105
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
7106
- const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
7107
- const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
7108
- const pattern = `${osc}|${csi}`;
7109
- return new RegExp(pattern, onlyFirst ? undefined : "g");
7110
- }
7111
-
7112
- // node_modules/strip-ansi/index.js
7113
- var regex = ansiRegex();
7114
- function stripAnsi(string) {
7115
- if (typeof string !== "string") {
7116
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
7117
- }
7118
- return string.replace(regex, "");
7119
- }
7120
-
7121
- // node_modules/get-east-asian-width/lookup.js
7122
- function isAmbiguous(x) {
7123
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
7124
- }
7125
- function isFullWidth(x) {
7126
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
7127
- }
7128
- function isWide(x) {
7129
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
7130
- }
7131
-
7132
- // node_modules/get-east-asian-width/index.js
7133
- function validate(codePoint) {
7134
- if (!Number.isSafeInteger(codePoint)) {
7135
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
7136
- }
7137
- }
7138
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
7139
- validate(codePoint);
7140
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
7141
- return 2;
7142
- }
7143
- return 1;
7144
- }
7145
-
7146
- // node_modules/wrap-ansi/node_modules/string-width/index.js
7147
- var import_emoji_regex = __toESM(require_emoji_regex(), 1);
7148
- var segmenter = new Intl.Segmenter;
7149
- var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
7150
- function stringWidth(string, options = {}) {
7151
- if (typeof string !== "string" || string.length === 0) {
7152
- return 0;
7153
- }
7154
- const {
7155
- ambiguousIsNarrow = true,
7156
- countAnsiEscapeCodes = false
7157
- } = options;
7158
- if (!countAnsiEscapeCodes) {
7159
- string = stripAnsi(string);
7160
- }
7161
- if (string.length === 0) {
7162
- return 0;
6452
+ namespace = await input({
6453
+ message: "Default namespace (can be changed later) >",
6454
+ default: namespace
6455
+ });
6456
+ } else {
6457
+ packName += "-testing";
6458
+ namespace += "_test";
7163
6459
  }
7164
- let width = 0;
7165
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
7166
- for (const { segment: character } of segmenter.segment(string)) {
7167
- const codePoint = character.codePointAt(0);
7168
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
7169
- continue;
7170
- }
7171
- if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
7172
- continue;
7173
- }
7174
- if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
7175
- continue;
7176
- }
7177
- if (codePoint >= 55296 && codePoint <= 57343) {
7178
- continue;
7179
- }
7180
- if (codePoint >= 65024 && codePoint <= 65039) {
7181
- continue;
7182
- }
7183
- if (defaultIgnorableCodePointRegex.test(character)) {
7184
- continue;
7185
- }
7186
- if (import_emoji_regex.default().test(character)) {
7187
- width += 2;
7188
- continue;
7189
- }
7190
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
7191
- }
7192
- return width;
7193
- }
7194
-
7195
- // node_modules/ansi-styles/index.js
7196
- var ANSI_BACKGROUND_OFFSET2 = 10;
7197
- var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
7198
- var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
7199
- var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
7200
- var styles3 = {
7201
- modifier: {
7202
- reset: [0, 0],
7203
- bold: [1, 22],
7204
- dim: [2, 22],
7205
- italic: [3, 23],
7206
- underline: [4, 24],
7207
- overline: [53, 55],
7208
- inverse: [7, 27],
7209
- hidden: [8, 28],
7210
- strikethrough: [9, 29]
7211
- },
7212
- color: {
7213
- black: [30, 39],
7214
- red: [31, 39],
7215
- green: [32, 39],
7216
- yellow: [33, 39],
7217
- blue: [34, 39],
7218
- magenta: [35, 39],
7219
- cyan: [36, 39],
7220
- white: [37, 39],
7221
- blackBright: [90, 39],
7222
- gray: [90, 39],
7223
- grey: [90, 39],
7224
- redBright: [91, 39],
7225
- greenBright: [92, 39],
7226
- yellowBright: [93, 39],
7227
- blueBright: [94, 39],
7228
- magentaBright: [95, 39],
7229
- cyanBright: [96, 39],
7230
- whiteBright: [97, 39]
7231
- },
7232
- bgColor: {
7233
- bgBlack: [40, 49],
7234
- bgRed: [41, 49],
7235
- bgGreen: [42, 49],
7236
- bgYellow: [43, 49],
7237
- bgBlue: [44, 49],
7238
- bgMagenta: [45, 49],
7239
- bgCyan: [46, 49],
7240
- bgWhite: [47, 49],
7241
- bgBlackBright: [100, 49],
7242
- bgGray: [100, 49],
7243
- bgGrey: [100, 49],
7244
- bgRedBright: [101, 49],
7245
- bgGreenBright: [102, 49],
7246
- bgYellowBright: [103, 49],
7247
- bgBlueBright: [104, 49],
7248
- bgMagentaBright: [105, 49],
7249
- bgCyanBright: [106, 49],
7250
- bgWhiteBright: [107, 49]
7251
- }
7252
- };
7253
- var modifierNames2 = Object.keys(styles3.modifier);
7254
- var foregroundColorNames2 = Object.keys(styles3.color);
7255
- var backgroundColorNames2 = Object.keys(styles3.bgColor);
7256
- var colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2];
7257
- function assembleStyles2() {
7258
- const codes = new Map;
7259
- for (const [groupName, group] of Object.entries(styles3)) {
7260
- for (const [styleName, style] of Object.entries(group)) {
7261
- styles3[styleName] = {
7262
- open: `\x1B[${style[0]}m`,
7263
- close: `\x1B[${style[1]}m`
7264
- };
7265
- group[styleName] = styles3[styleName];
7266
- codes.set(style[0], style[1]);
7267
- }
7268
- Object.defineProperty(styles3, groupName, {
7269
- value: group,
7270
- enumerable: false
7271
- });
7272
- }
7273
- Object.defineProperty(styles3, "codes", {
7274
- value: codes,
7275
- enumerable: false
7276
- });
7277
- styles3.color.close = "\x1B[39m";
7278
- styles3.bgColor.close = "\x1B[49m";
7279
- styles3.color.ansi = wrapAnsi162();
7280
- styles3.color.ansi256 = wrapAnsi2562();
7281
- styles3.color.ansi16m = wrapAnsi16m2();
7282
- styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
7283
- styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
7284
- styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
7285
- Object.defineProperties(styles3, {
7286
- rgbToAnsi256: {
7287
- value(red, green, blue) {
7288
- if (red === green && green === blue) {
7289
- if (red < 8) {
7290
- return 16;
7291
- }
7292
- if (red > 248) {
7293
- return 231;
7294
- }
7295
- return Math.round((red - 8) / 247 * 24) + 232;
7296
- }
7297
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
7298
- },
7299
- enumerable: false
7300
- },
7301
- hexToRgb: {
7302
- value(hex) {
7303
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
7304
- if (!matches) {
7305
- return [0, 0, 0];
7306
- }
7307
- let [colorString] = matches;
7308
- if (colorString.length === 3) {
7309
- colorString = [...colorString].map((character) => character + character).join("");
7310
- }
7311
- const integer = Number.parseInt(colorString, 16);
7312
- return [
7313
- integer >> 16 & 255,
7314
- integer >> 8 & 255,
7315
- integer & 255
7316
- ];
7317
- },
7318
- enumerable: false
7319
- },
7320
- hexToAnsi256: {
7321
- value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
7322
- enumerable: false
7323
- },
7324
- ansi256ToAnsi: {
7325
- value(code) {
7326
- if (code < 8) {
7327
- return 30 + code;
7328
- }
7329
- if (code < 16) {
7330
- return 90 + (code - 8);
7331
- }
7332
- let red;
7333
- let green;
7334
- let blue;
7335
- if (code >= 232) {
7336
- red = ((code - 232) * 10 + 8) / 255;
7337
- green = red;
7338
- blue = red;
7339
- } else {
7340
- code -= 16;
7341
- const remainder = code % 36;
7342
- red = Math.floor(code / 36) / 5;
7343
- green = Math.floor(remainder / 6) / 5;
7344
- blue = remainder % 6 / 5;
7345
- }
7346
- const value = Math.max(red, green, blue) * 2;
7347
- if (value === 0) {
7348
- return 30;
7349
- }
7350
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
7351
- if (value === 2) {
7352
- result += 60;
7353
- }
7354
- return result;
7355
- },
7356
- enumerable: false
7357
- },
7358
- rgbToAnsi: {
7359
- value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)),
7360
- enumerable: false
7361
- },
7362
- hexToAnsi: {
7363
- value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)),
7364
- enumerable: false
7365
- }
7366
- });
7367
- return styles3;
7368
- }
7369
- var ansiStyles2 = assembleStyles2();
7370
- var ansi_styles_default2 = ansiStyles2;
7371
-
7372
- // node_modules/wrap-ansi/index.js
7373
- var ESCAPES2 = new Set([
7374
- "\x1B",
7375
- "›"
7376
- ]);
7377
- var END_CODE = 39;
7378
- var ANSI_ESCAPE_BELL = "\x07";
7379
- var ANSI_CSI = "[";
7380
- var ANSI_OSC = "]";
7381
- var ANSI_SGR_TERMINATOR = "m";
7382
- var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
7383
- var wrapAnsiCode = (code) => `${ESCAPES2.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
7384
- var wrapAnsiHyperlink = (url) => `${ESCAPES2.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
7385
- var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
7386
- var wrapWord = (rows, word, columns) => {
7387
- const characters = [...word];
7388
- let isInsideEscape = false;
7389
- let isInsideLinkEscape = false;
7390
- let visible = stringWidth(stripAnsi(rows.at(-1)));
7391
- for (const [index, character] of characters.entries()) {
7392
- const characterLength = stringWidth(character);
7393
- if (visible + characterLength <= columns) {
7394
- rows[rows.length - 1] += character;
7395
- } else {
7396
- rows.push(character);
7397
- visible = 0;
7398
- }
7399
- if (ESCAPES2.has(character)) {
7400
- isInsideEscape = true;
7401
- const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
7402
- isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
7403
- }
7404
- if (isInsideEscape) {
7405
- if (isInsideLinkEscape) {
7406
- if (character === ANSI_ESCAPE_BELL) {
7407
- isInsideEscape = false;
7408
- isInsideLinkEscape = false;
7409
- }
7410
- } else if (character === ANSI_SGR_TERMINATOR) {
7411
- isInsideEscape = false;
7412
- }
7413
- continue;
7414
- }
7415
- visible += characterLength;
7416
- if (visible === columns && index < characters.length - 1) {
7417
- rows.push("");
7418
- visible = 0;
7419
- }
7420
- }
7421
- if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
7422
- rows[rows.length - 2] += rows.pop();
7423
- }
7424
- };
7425
- var stringVisibleTrimSpacesRight = (string) => {
7426
- const words = string.split(" ");
7427
- let last = words.length;
7428
- while (last > 0) {
7429
- if (stringWidth(words[last - 1]) > 0) {
7430
- break;
7431
- }
7432
- last--;
7433
- }
7434
- if (last === words.length) {
7435
- return string;
7436
- }
7437
- return words.slice(0, last).join(" ") + words.slice(last).join("");
7438
- };
7439
- var exec = (string, columns, options = {}) => {
7440
- if (options.trim !== false && string.trim() === "") {
7441
- return "";
7442
- }
7443
- let returnValue = "";
7444
- let escapeCode;
7445
- let escapeUrl;
7446
- const lengths = wordLengths(string);
7447
- let rows = [""];
7448
- for (const [index, word] of string.split(" ").entries()) {
7449
- if (options.trim !== false) {
7450
- rows[rows.length - 1] = rows.at(-1).trimStart();
7451
- }
7452
- let rowLength = stringWidth(rows.at(-1));
7453
- if (index !== 0) {
7454
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
7455
- rows.push("");
7456
- rowLength = 0;
7457
- }
7458
- if (rowLength > 0 || options.trim === false) {
7459
- rows[rows.length - 1] += " ";
7460
- rowLength++;
7461
- }
7462
- }
7463
- if (options.hard && lengths[index] > columns) {
7464
- const remainingColumns = columns - rowLength;
7465
- const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
7466
- const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
7467
- if (breaksStartingNextLine < breaksStartingThisLine) {
7468
- rows.push("");
7469
- }
7470
- wrapWord(rows, word, columns);
7471
- continue;
7472
- }
7473
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
7474
- if (options.wordWrap === false && rowLength < columns) {
7475
- wrapWord(rows, word, columns);
7476
- continue;
7477
- }
7478
- rows.push("");
7479
- }
7480
- if (rowLength + lengths[index] > columns && options.wordWrap === false) {
7481
- wrapWord(rows, word, columns);
7482
- continue;
7483
- }
7484
- rows[rows.length - 1] += word;
7485
- }
7486
- if (options.trim !== false) {
7487
- rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
7488
- }
7489
- const preString = rows.join(`
7490
- `);
7491
- const pre = [...preString];
7492
- let preStringIndex = 0;
7493
- for (const [index, character] of pre.entries()) {
7494
- returnValue += character;
7495
- if (ESCAPES2.has(character)) {
7496
- const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
7497
- if (groups.code !== undefined) {
7498
- const code2 = Number.parseFloat(groups.code);
7499
- escapeCode = code2 === END_CODE ? undefined : code2;
7500
- } else if (groups.uri !== undefined) {
7501
- escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
7502
- }
7503
- }
7504
- const code = ansi_styles_default2.codes.get(Number(escapeCode));
7505
- if (pre[index + 1] === `
7506
- `) {
7507
- if (escapeUrl) {
7508
- returnValue += wrapAnsiHyperlink("");
7509
- }
7510
- if (escapeCode && code) {
7511
- returnValue += wrapAnsiCode(code);
7512
- }
7513
- } else if (character === `
7514
- `) {
7515
- if (escapeCode && code) {
7516
- returnValue += wrapAnsiCode(escapeCode);
7517
- }
7518
- if (escapeUrl) {
7519
- returnValue += wrapAnsiHyperlink(escapeUrl);
7520
- }
7521
- }
7522
- preStringIndex += character.length;
7523
- }
7524
- return returnValue;
7525
- };
7526
- function wrapAnsi(string, columns, options) {
7527
- return String(string).normalize().replaceAll(`\r
7528
- `, `
7529
- `).split(`
7530
- `).map((line) => exec(line, columns, options)).join(`
7531
- `);
7532
- }
7533
-
7534
- // node_modules/@inquirer/core/dist/lib/utils.js
7535
- function breakLines(content, width) {
7536
- return content.split(`
7537
- `).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
7538
- `).map((str) => str.trimEnd())).join(`
7539
- `);
7540
- }
7541
- function readlineWidth() {
7542
- return import_cli_width.default({ defaultWidth: 80, output: readline().output });
7543
- }
7544
-
7545
- // node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
7546
- function usePointerPosition({ active, renderedItems, pageSize, loop }) {
7547
- const state = useRef({
7548
- lastPointer: active,
7549
- lastActive: undefined
7550
- });
7551
- const { lastPointer, lastActive } = state.current;
7552
- const middle = Math.floor(pageSize / 2);
7553
- const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
7554
- const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
7555
- let pointer = defaultPointerPosition;
7556
- if (renderedLength > pageSize) {
7557
- if (loop) {
7558
- pointer = lastPointer;
7559
- if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
7560
- pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
7561
- }
7562
- } else {
7563
- const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
7564
- pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
7565
- }
7566
- }
7567
- state.current.lastPointer = pointer;
7568
- state.current.lastActive = active;
7569
- return pointer;
7570
- }
7571
- function usePagination({ items, active, renderItem, pageSize, loop = true }) {
7572
- const width = readlineWidth();
7573
- const bound = (num) => (num % items.length + items.length) % items.length;
7574
- const renderedItems = items.map((item, index) => {
7575
- if (item == null)
7576
- return [];
7577
- return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
7578
- `);
7579
- });
7580
- const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
7581
- const renderItemAtIndex = (index) => renderedItems[index] ?? [];
7582
- const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
7583
- const activeItem = renderItemAtIndex(active).slice(0, pageSize);
7584
- const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
7585
- const pageBuffer = Array.from({ length: pageSize });
7586
- pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
7587
- const itemVisited = new Set([active]);
7588
- let bufferPointer = activeItemPosition + activeItem.length;
7589
- let itemPointer = bound(active + 1);
7590
- while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
7591
- const lines = renderItemAtIndex(itemPointer);
7592
- const linesToAdd = lines.slice(0, pageSize - bufferPointer);
7593
- pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
7594
- itemVisited.add(itemPointer);
7595
- bufferPointer += linesToAdd.length;
7596
- itemPointer = bound(itemPointer + 1);
7597
- }
7598
- bufferPointer = activeItemPosition - 1;
7599
- itemPointer = bound(active - 1);
7600
- while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
7601
- const lines = renderItemAtIndex(itemPointer);
7602
- const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
7603
- pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
7604
- itemVisited.add(itemPointer);
7605
- bufferPointer -= linesToAdd.length;
7606
- itemPointer = bound(itemPointer - 1);
7607
- }
7608
- return pageBuffer.filter((line) => typeof line === "string").join(`
7609
- `);
7610
- }
7611
- // node_modules/@inquirer/core/dist/lib/create-prompt.js
7612
- var import_mute_stream = __toESM(require_lib2(), 1);
7613
- import * as readline2 from "node:readline";
7614
- import { AsyncResource as AsyncResource3 } from "node:async_hooks";
7615
-
7616
- // node_modules/@inquirer/core/node_modules/signal-exit/dist/mjs/signals.js
7617
- var signals = [];
7618
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
7619
- if (process.platform !== "win32") {
7620
- signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
7621
- }
7622
- if (process.platform === "linux") {
7623
- signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
7624
- }
7625
-
7626
- // node_modules/@inquirer/core/node_modules/signal-exit/dist/mjs/index.js
7627
- var processOk = (process4) => !!process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
7628
- var kExitEmitter = Symbol.for("signal-exit emitter");
7629
- var global2 = globalThis;
7630
- var ObjectDefineProperty = Object.defineProperty.bind(Object);
7631
-
7632
- class Emitter {
7633
- emitted = {
7634
- afterExit: false,
7635
- exit: false
7636
- };
7637
- listeners = {
7638
- afterExit: [],
7639
- exit: []
7640
- };
7641
- count = 0;
7642
- id = Math.random();
7643
- constructor() {
7644
- if (global2[kExitEmitter]) {
7645
- return global2[kExitEmitter];
7646
- }
7647
- ObjectDefineProperty(global2, kExitEmitter, {
7648
- value: this,
7649
- writable: false,
7650
- enumerable: false,
7651
- configurable: false
7652
- });
7653
- }
7654
- on(ev, fn) {
7655
- this.listeners[ev].push(fn);
7656
- }
7657
- removeListener(ev, fn) {
7658
- const list = this.listeners[ev];
7659
- const i = list.indexOf(fn);
7660
- if (i === -1) {
7661
- return;
7662
- }
7663
- if (i === 0 && list.length === 1) {
7664
- list.length = 0;
7665
- } else {
7666
- list.splice(i, 1);
7667
- }
7668
- }
7669
- emit(ev, code, signal) {
7670
- if (this.emitted[ev]) {
7671
- return false;
7672
- }
7673
- this.emitted[ev] = true;
7674
- let ret = false;
7675
- for (const fn of this.listeners[ev]) {
7676
- ret = fn(code, signal) === true || ret;
7677
- }
7678
- if (ev === "exit") {
7679
- ret = this.emit("afterExit", code, signal) || ret;
7680
- }
7681
- return ret;
7682
- }
7683
- }
7684
-
7685
- class SignalExitBase {
7686
- }
7687
- var signalExitWrap = (handler) => {
7688
- return {
7689
- onExit(cb, opts) {
7690
- return handler.onExit(cb, opts);
7691
- },
7692
- load() {
7693
- return handler.load();
7694
- },
7695
- unload() {
7696
- return handler.unload();
7697
- }
7698
- };
7699
- };
7700
-
7701
- class SignalExitFallback extends SignalExitBase {
7702
- onExit() {
7703
- return () => {};
7704
- }
7705
- load() {}
7706
- unload() {}
7707
- }
7708
-
7709
- class SignalExit extends SignalExitBase {
7710
- #hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
7711
- #emitter = new Emitter;
7712
- #process;
7713
- #originalProcessEmit;
7714
- #originalProcessReallyExit;
7715
- #sigListeners = {};
7716
- #loaded = false;
7717
- constructor(process4) {
7718
- super();
7719
- this.#process = process4;
7720
- this.#sigListeners = {};
7721
- for (const sig of signals) {
7722
- this.#sigListeners[sig] = () => {
7723
- const listeners = this.#process.listeners(sig);
7724
- let { count } = this.#emitter;
7725
- const p = process4;
7726
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
7727
- count += p.__signal_exit_emitter__.count;
7728
- }
7729
- if (listeners.length === count) {
7730
- this.unload();
7731
- const ret = this.#emitter.emit("exit", null, sig);
7732
- const s = sig === "SIGHUP" ? this.#hupSig : sig;
7733
- if (!ret)
7734
- process4.kill(process4.pid, s);
7735
- }
7736
- };
7737
- }
7738
- this.#originalProcessReallyExit = process4.reallyExit;
7739
- this.#originalProcessEmit = process4.emit;
7740
- }
7741
- onExit(cb, opts) {
7742
- if (!processOk(this.#process)) {
7743
- return () => {};
7744
- }
7745
- if (this.#loaded === false) {
7746
- this.load();
7747
- }
7748
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
7749
- this.#emitter.on(ev, cb);
7750
- return () => {
7751
- this.#emitter.removeListener(ev, cb);
7752
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
7753
- this.unload();
7754
- }
7755
- };
7756
- }
7757
- load() {
7758
- if (this.#loaded) {
7759
- return;
7760
- }
7761
- this.#loaded = true;
7762
- this.#emitter.count += 1;
7763
- for (const sig of signals) {
7764
- try {
7765
- const fn = this.#sigListeners[sig];
7766
- if (fn)
7767
- this.#process.on(sig, fn);
7768
- } catch (_) {}
7769
- }
7770
- this.#process.emit = (ev, ...a) => {
7771
- return this.#processEmit(ev, ...a);
7772
- };
7773
- this.#process.reallyExit = (code) => {
7774
- return this.#processReallyExit(code);
7775
- };
7776
- }
7777
- unload() {
7778
- if (!this.#loaded) {
7779
- return;
7780
- }
7781
- this.#loaded = false;
7782
- signals.forEach((sig) => {
7783
- const listener = this.#sigListeners[sig];
7784
- if (!listener) {
7785
- throw new Error("Listener not defined for signal: " + sig);
7786
- }
7787
- try {
7788
- this.#process.removeListener(sig, listener);
7789
- } catch (_) {}
7790
- });
7791
- this.#process.emit = this.#originalProcessEmit;
7792
- this.#process.reallyExit = this.#originalProcessReallyExit;
7793
- this.#emitter.count -= 1;
7794
- }
7795
- #processReallyExit(code) {
7796
- if (!processOk(this.#process)) {
7797
- return 0;
7798
- }
7799
- this.#process.exitCode = code || 0;
7800
- this.#emitter.emit("exit", this.#process.exitCode, null);
7801
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
7802
- }
7803
- #processEmit(ev, ...args) {
7804
- const og = this.#originalProcessEmit;
7805
- if (ev === "exit" && processOk(this.#process)) {
7806
- if (typeof args[0] === "number") {
7807
- this.#process.exitCode = args[0];
7808
- }
7809
- const ret = og.call(this.#process, ev, ...args);
7810
- this.#emitter.emit("exit", this.#process.exitCode, null);
7811
- return ret;
7812
- } else {
7813
- return og.call(this.#process, ev, ...args);
7814
- }
7815
- }
7816
- }
7817
- var process4 = globalThis.process;
7818
- var {
7819
- onExit,
7820
- load,
7821
- unload
7822
- } = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback);
7823
-
7824
- // node_modules/@inquirer/core/dist/lib/screen-manager.js
7825
- import { stripVTControlCharacters } from "node:util";
7826
-
7827
- // node_modules/@inquirer/ansi/dist/index.js
7828
- var ESC = "\x1B[";
7829
- var cursorLeft = ESC + "G";
7830
- var cursorHide = ESC + "?25l";
7831
- var cursorShow = ESC + "?25h";
7832
- var cursorUp = (rows = 1) => rows > 0 ? `${ESC}${rows}A` : "";
7833
- var cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : "";
7834
- var cursorTo = (x, y) => {
7835
- if (typeof y === "number" && !Number.isNaN(y)) {
7836
- return `${ESC}${y + 1};${x + 1}H`;
7837
- }
7838
- return `${ESC}${x + 1}G`;
7839
- };
7840
- var eraseLine = ESC + "2K";
7841
- var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
7842
-
7843
- // node_modules/@inquirer/core/dist/lib/screen-manager.js
7844
- var height = (content) => content.split(`
7845
- `).length;
7846
- var lastLine = (content) => content.split(`
7847
- `).pop() ?? "";
7848
-
7849
- class ScreenManager {
7850
- height = 0;
7851
- extraLinesUnderPrompt = 0;
7852
- cursorPos;
7853
- rl;
7854
- constructor(rl) {
7855
- this.rl = rl;
7856
- this.cursorPos = rl.getCursorPos();
7857
- }
7858
- write(content) {
7859
- this.rl.output.unmute();
7860
- this.rl.output.write(content);
7861
- this.rl.output.mute();
7862
- }
7863
- render(content, bottomContent = "") {
7864
- const promptLine = lastLine(content);
7865
- const rawPromptLine = stripVTControlCharacters(promptLine);
7866
- let prompt = rawPromptLine;
7867
- if (this.rl.line.length > 0) {
7868
- prompt = prompt.slice(0, -this.rl.line.length);
7869
- }
7870
- this.rl.setPrompt(prompt);
7871
- this.cursorPos = this.rl.getCursorPos();
7872
- const width = readlineWidth();
7873
- content = breakLines(content, width);
7874
- bottomContent = breakLines(bottomContent, width);
7875
- if (rawPromptLine.length % width === 0) {
7876
- content += `
7877
- `;
7878
- }
7879
- let output = content + (bottomContent ? `
7880
- ` + bottomContent : "");
7881
- const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
7882
- const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
7883
- if (bottomContentHeight > 0)
7884
- output += cursorUp(bottomContentHeight);
7885
- output += cursorTo(this.cursorPos.cols);
7886
- this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
7887
- this.extraLinesUnderPrompt = bottomContentHeight;
7888
- this.height = height(output);
7889
- }
7890
- checkCursorPos() {
7891
- const cursorPos = this.rl.getCursorPos();
7892
- if (cursorPos.cols !== this.cursorPos.cols) {
7893
- this.write(cursorTo(cursorPos.cols));
7894
- this.cursorPos = cursorPos;
7895
- }
7896
- }
7897
- done({ clearContent }) {
7898
- this.rl.setPrompt("");
7899
- let output = cursorDown(this.extraLinesUnderPrompt);
7900
- output += clearContent ? eraseLines(this.height) : `
7901
- `;
7902
- output += cursorShow;
7903
- this.write(output);
7904
- this.rl.close();
7905
- }
7906
- }
7907
-
7908
- // node_modules/@inquirer/core/dist/lib/promise-polyfill.js
7909
- class PromisePolyfill extends Promise {
7910
- static withResolver() {
7911
- let resolve;
7912
- let reject;
7913
- const promise = new Promise((res, rej) => {
7914
- resolve = res;
7915
- reject = rej;
7916
- });
7917
- return { promise, resolve, reject };
7918
- }
7919
- }
7920
-
7921
- // node_modules/@inquirer/core/dist/lib/create-prompt.js
7922
- function getCallSites() {
7923
- const _prepareStackTrace = Error.prepareStackTrace;
7924
- let result = [];
7925
- try {
7926
- Error.prepareStackTrace = (_, callSites) => {
7927
- const callSitesWithoutCurrent = callSites.slice(1);
7928
- result = callSitesWithoutCurrent;
7929
- return callSitesWithoutCurrent;
7930
- };
7931
- new Error().stack;
7932
- } catch {
7933
- return result;
7934
- }
7935
- Error.prepareStackTrace = _prepareStackTrace;
7936
- return result;
7937
- }
7938
- function createPrompt(view) {
7939
- const callSites = getCallSites();
7940
- const prompt = (config, context = {}) => {
7941
- const { input = process.stdin, signal } = context;
7942
- const cleanups = new Set;
7943
- const output = new import_mute_stream.default;
7944
- output.pipe(context.output ?? process.stdout);
7945
- const rl = readline2.createInterface({
7946
- terminal: true,
7947
- input,
7948
- output
7949
- });
7950
- const screen = new ScreenManager(rl);
7951
- const { promise, resolve, reject } = PromisePolyfill.withResolver();
7952
- const cancel = () => reject(new CancelPromptError);
7953
- if (signal) {
7954
- const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
7955
- if (signal.aborted) {
7956
- abort();
7957
- return Object.assign(promise, { cancel });
7958
- }
7959
- signal.addEventListener("abort", abort);
7960
- cleanups.add(() => signal.removeEventListener("abort", abort));
7961
- }
7962
- cleanups.add(onExit((code, signal2) => {
7963
- reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
7964
- }));
7965
- const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
7966
- rl.on("SIGINT", sigint);
7967
- cleanups.add(() => rl.removeListener("SIGINT", sigint));
7968
- const checkCursorPos = () => screen.checkCursorPos();
7969
- rl.input.on("keypress", checkCursorPos);
7970
- cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
7971
- return withHooks(rl, (cycle) => {
7972
- const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
7973
- rl.on("close", hooksCleanup);
7974
- cleanups.add(() => rl.removeListener("close", hooksCleanup));
7975
- cycle(() => {
7976
- try {
7977
- const nextView = view(config, (value) => {
7978
- setImmediate(() => resolve(value));
7979
- });
7980
- if (nextView === undefined) {
7981
- const callerFilename = callSites[1]?.getFileName();
7982
- throw new Error(`Prompt functions must return a string.
7983
- at ${callerFilename}`);
7984
- }
7985
- const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
7986
- screen.render(content, bottomContent);
7987
- effectScheduler.run();
7988
- } catch (error) {
7989
- reject(error);
7990
- }
7991
- });
7992
- return Object.assign(promise.then((answer) => {
7993
- effectScheduler.clearAll();
7994
- return answer;
7995
- }, (error) => {
7996
- effectScheduler.clearAll();
7997
- throw error;
7998
- }).finally(() => {
7999
- cleanups.forEach((cleanup) => cleanup());
8000
- screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
8001
- output.end();
8002
- }).then(() => promise), { cancel });
8003
- });
8004
- };
8005
- return prompt;
8006
- }
8007
- // node_modules/@inquirer/core/dist/lib/Separator.js
8008
- import { styleText as styleText2 } from "node:util";
8009
- class Separator {
8010
- separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
8011
- type = "separator";
8012
- constructor(separator) {
8013
- if (separator) {
8014
- this.separator = separator;
8015
- }
8016
- }
8017
- static isSeparator(choice) {
8018
- return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
8019
- }
8020
- }
8021
- // node_modules/@inquirer/confirm/dist/index.js
8022
- function getBooleanValue(value, defaultValue) {
8023
- let answer = defaultValue !== false;
8024
- if (/^(y|yes)/i.test(value))
8025
- answer = true;
8026
- else if (/^(n|no)/i.test(value))
8027
- answer = false;
8028
- return answer;
8029
- }
8030
- function boolToString(value) {
8031
- return value ? "Yes" : "No";
8032
- }
8033
- var dist_default2 = createPrompt((config, done) => {
8034
- const { transformer = boolToString } = config;
8035
- const [status, setStatus] = useState("idle");
8036
- const [value, setValue] = useState("");
8037
- const theme = makeTheme(config.theme);
8038
- const prefix = usePrefix({ status, theme });
8039
- useKeypress((key, rl) => {
8040
- if (status !== "idle")
8041
- return;
8042
- if (isEnterKey(key)) {
8043
- const answer = getBooleanValue(value, config.default);
8044
- setValue(transformer(answer));
8045
- setStatus("done");
8046
- done(answer);
8047
- } else if (isTabKey(key)) {
8048
- const answer = boolToString(!getBooleanValue(value, config.default));
8049
- rl.clearLine(0);
8050
- rl.write(answer);
8051
- setValue(answer);
8052
- } else {
8053
- setValue(rl.line);
8054
- }
8055
- });
8056
- let formattedValue = value;
8057
- let defaultValue = "";
8058
- if (status === "done") {
8059
- formattedValue = theme.style.answer(value);
8060
- } else {
8061
- defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
8062
- }
8063
- const message = theme.style.message(config.message, status);
8064
- return `${prefix} ${message}${defaultValue} ${formattedValue}`;
8065
- });
8066
- // node_modules/@inquirer/input/dist/index.js
8067
- var inputTheme = {
8068
- validationFailureMode: "keep"
8069
- };
8070
- var dist_default3 = createPrompt((config, done) => {
8071
- const { prefill = "tab" } = config;
8072
- const theme = makeTheme(inputTheme, config.theme);
8073
- const [status, setStatus] = useState("idle");
8074
- const [defaultValue = "", setDefaultValue] = useState(config.default);
8075
- const [errorMsg, setError] = useState();
8076
- const [value, setValue] = useState("");
8077
- const prefix = usePrefix({ status, theme });
8078
- async function validate2(value2) {
8079
- const { required, pattern, patternError = "Invalid input" } = config;
8080
- if (required && !value2) {
8081
- return "You must provide a value";
8082
- }
8083
- if (pattern && !pattern.test(value2)) {
8084
- return patternError;
8085
- }
8086
- if (typeof config.validate === "function") {
8087
- return await config.validate(value2) || "You must provide a valid value";
8088
- }
8089
- return true;
8090
- }
8091
- useKeypress(async (key, rl) => {
8092
- if (status !== "idle") {
8093
- return;
8094
- }
8095
- if (isEnterKey(key)) {
8096
- const answer = value || defaultValue;
8097
- setStatus("loading");
8098
- const isValid = await validate2(answer);
8099
- if (isValid === true) {
8100
- setValue(answer);
8101
- setStatus("done");
8102
- done(answer);
8103
- } else {
8104
- if (theme.validationFailureMode === "clear") {
8105
- setValue("");
8106
- } else {
8107
- rl.write(value);
8108
- }
8109
- setError(isValid);
8110
- setStatus("idle");
8111
- }
8112
- } else if (isBackspaceKey(key) && !value) {
8113
- setDefaultValue(undefined);
8114
- } else if (isTabKey(key) && !value) {
8115
- setDefaultValue(undefined);
8116
- rl.clearLine(0);
8117
- rl.write(defaultValue);
8118
- setValue(defaultValue);
8119
- } else {
8120
- setValue(rl.line);
8121
- setError(undefined);
8122
- }
8123
- });
8124
- useEffect((rl) => {
8125
- if (prefill === "editable" && defaultValue) {
8126
- rl.write(defaultValue);
8127
- setValue(defaultValue);
8128
- }
8129
- }, []);
8130
- const message = theme.style.message(config.message, status);
8131
- let formattedValue = value;
8132
- if (typeof config.transformer === "function") {
8133
- formattedValue = config.transformer(value, { isFinal: status === "done" });
8134
- } else if (status === "done") {
8135
- formattedValue = theme.style.answer(value);
8136
- }
8137
- let defaultStr;
8138
- if (defaultValue && status !== "done" && !value) {
8139
- defaultStr = theme.style.defaultAnswer(defaultValue);
8140
- }
8141
- let error = "";
8142
- if (errorMsg) {
8143
- error = theme.style.error(errorMsg);
8144
- }
8145
- return [
8146
- [prefix, message, defaultStr, formattedValue].filter((v) => v !== undefined).join(" "),
8147
- error
8148
- ];
8149
- });
8150
- // node_modules/@inquirer/select/dist/index.js
8151
- import { styleText as styleText3 } from "node:util";
8152
- var selectTheme = {
8153
- icon: { cursor: dist_default.pointer },
8154
- style: {
8155
- disabled: (text) => styleText3("dim", `- ${text}`),
8156
- description: (text) => styleText3("cyan", text),
8157
- keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " • "))
8158
- },
8159
- indexMode: "hidden",
8160
- keybindings: []
8161
- };
8162
- function isSelectable(item) {
8163
- return !Separator.isSeparator(item) && !item.disabled;
8164
- }
8165
- function normalizeChoices(choices) {
8166
- return choices.map((choice) => {
8167
- if (Separator.isSeparator(choice))
8168
- return choice;
8169
- if (typeof choice !== "object" || choice === null || !("value" in choice)) {
8170
- const name2 = String(choice);
8171
- return {
8172
- value: choice,
8173
- name: name2,
8174
- short: name2,
8175
- disabled: false
8176
- };
8177
- }
8178
- const name = choice.name ?? String(choice.value);
8179
- const normalizedChoice = {
8180
- value: choice.value,
8181
- name,
8182
- short: choice.short ?? name,
8183
- disabled: choice.disabled ?? false
8184
- };
8185
- if (choice.description) {
8186
- normalizedChoice.description = choice.description;
8187
- }
8188
- return normalizedChoice;
8189
- });
8190
- }
8191
- var dist_default4 = createPrompt((config, done) => {
8192
- const { loop = true, pageSize = 7 } = config;
8193
- const theme = makeTheme(selectTheme, config.theme);
8194
- const { keybindings } = theme;
8195
- const [status, setStatus] = useState("idle");
8196
- const prefix = usePrefix({ status, theme });
8197
- const searchTimeoutRef = useRef();
8198
- const searchEnabled = !keybindings.includes("vim");
8199
- const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);
8200
- const bounds = useMemo(() => {
8201
- const first = items.findIndex(isSelectable);
8202
- const last = items.findLastIndex(isSelectable);
8203
- if (first === -1) {
8204
- throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
8205
- }
8206
- return { first, last };
8207
- }, [items]);
8208
- const defaultItemIndex = useMemo(() => {
8209
- if (!("default" in config))
8210
- return -1;
8211
- return items.findIndex((item) => isSelectable(item) && item.value === config.default);
8212
- }, [config.default, items]);
8213
- const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
8214
- const selectedChoice = items[active];
8215
- useKeypress((key, rl) => {
8216
- clearTimeout(searchTimeoutRef.current);
8217
- if (isEnterKey(key)) {
8218
- setStatus("done");
8219
- done(selectedChoice.value);
8220
- } else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {
8221
- rl.clearLine(0);
8222
- if (loop || isUpKey(key, keybindings) && active !== bounds.first || isDownKey(key, keybindings) && active !== bounds.last) {
8223
- const offset = isUpKey(key, keybindings) ? -1 : 1;
8224
- let next = active;
8225
- do {
8226
- next = (next + offset + items.length) % items.length;
8227
- } while (!isSelectable(items[next]));
8228
- setActive(next);
8229
- }
8230
- } else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
8231
- const selectedIndex = Number(rl.line) - 1;
8232
- let selectableIndex = -1;
8233
- const position = items.findIndex((item2) => {
8234
- if (Separator.isSeparator(item2))
8235
- return false;
8236
- selectableIndex++;
8237
- return selectableIndex === selectedIndex;
8238
- });
8239
- const item = items[position];
8240
- if (item != null && isSelectable(item)) {
8241
- setActive(position);
8242
- }
8243
- searchTimeoutRef.current = setTimeout(() => {
8244
- rl.clearLine(0);
8245
- }, 700);
8246
- } else if (isBackspaceKey(key)) {
8247
- rl.clearLine(0);
8248
- } else if (searchEnabled) {
8249
- const searchTerm = rl.line.toLowerCase();
8250
- const matchIndex = items.findIndex((item) => {
8251
- if (Separator.isSeparator(item) || !isSelectable(item))
8252
- return false;
8253
- return item.name.toLowerCase().startsWith(searchTerm);
8254
- });
8255
- if (matchIndex !== -1) {
8256
- setActive(matchIndex);
8257
- }
8258
- searchTimeoutRef.current = setTimeout(() => {
8259
- rl.clearLine(0);
8260
- }, 700);
8261
- }
8262
- });
8263
- useEffect(() => () => {
8264
- clearTimeout(searchTimeoutRef.current);
8265
- }, []);
8266
- const message = theme.style.message(config.message, status);
8267
- const helpLine = theme.style.keysHelpTip([
8268
- ["↑↓", "navigate"],
8269
- ["⏎", "select"]
8270
- ]);
8271
- let separatorCount = 0;
8272
- const page = usePagination({
8273
- items,
8274
- active,
8275
- renderItem({ item, isActive, index }) {
8276
- if (Separator.isSeparator(item)) {
8277
- separatorCount++;
8278
- return ` ${item.separator}`;
8279
- }
8280
- const indexLabel = theme.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
8281
- if (item.disabled) {
8282
- const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
8283
- return theme.style.disabled(`${indexLabel}${item.name} ${disabledLabel}`);
8284
- }
8285
- const color = isActive ? theme.style.highlight : (x) => x;
8286
- const cursor = isActive ? theme.icon.cursor : ` `;
8287
- return color(`${cursor} ${indexLabel}${item.name}`);
8288
- },
8289
- pageSize,
8290
- loop
8291
- });
8292
- if (status === "done") {
8293
- return [prefix, message, theme.style.answer(selectedChoice.short)].filter(Boolean).join(" ");
8294
- }
8295
- const { description } = selectedChoice;
8296
- const lines = [
8297
- [prefix, message].filter(Boolean).join(" "),
8298
- page,
8299
- " ",
8300
- description ? theme.style.description(description) : "",
8301
- helpLine
8302
- ].filter(Boolean).join(`
8303
- `).trimEnd();
8304
- return `${lines}${cursorHide}`;
8305
- });
8306
- // src/version.ts
8307
- var CLI_VERSION2 = "2.1.0";
8308
-
8309
- // src/utils.ts
8310
- import fs from "fs";
8311
- import path from "path";
8312
- import os2 from "os";
8313
- import { execSync } from "child_process";
8314
- function hasYarn() {
8315
- try {
8316
- execSync("yarn --version");
8317
- return true;
8318
- } catch (error) {
8319
- return false;
8320
- }
8321
- }
8322
- function hasPnpm() {
8323
- try {
8324
- execSync("pnpm --version");
8325
- return true;
8326
- } catch (error) {
8327
- return false;
8328
- }
8329
- }
8330
- function hasBun() {
8331
- try {
8332
- execSync("bun --version");
8333
- return true;
8334
- } catch (error) {
8335
- return false;
8336
- }
8337
- }
8338
- var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
8339
- function getMinecraftPath() {
8340
- function getMCPath() {
8341
- switch (os2.platform()) {
8342
- case "win32":
8343
- return path.join(os2.homedir(), "AppData/Roaming/.minecraft");
8344
- case "darwin":
8345
- return path.join(os2.homedir(), "Library/Application Support/minecraft");
8346
- case "linux":
8347
- default:
8348
- return path.join(os2.homedir(), ".minecraft");
8349
- }
8350
- }
8351
- const mcPath = getMCPath();
8352
- if (!fs.existsSync(mcPath)) {
8353
- throw new Error("Unable to locate the .minecraft folder. Please specify it manually.");
8354
- }
8355
- return mcPath;
8356
- }
8357
- function getWorldsList(clientPath) {
8358
- const mcPath = clientPath || getMinecraftPath();
8359
- const savesPath = path.join(mcPath, "saves");
8360
- return fs.readdirSync(savesPath, { withFileTypes: true }).filter((f) => f.isDirectory).map((f) => f.name);
8361
- }
8362
-
8363
- // src/commands/create.ts
8364
- function toJson(obj, pretty = false) {
8365
- return util.inspect(obj, {
8366
- depth: Number(Infinity),
8367
- colors: false,
8368
- breakLength: Number(Infinity),
8369
- compact: !pretty,
8370
- maxArrayLength: Number(Infinity)
8371
- });
8372
- }
8373
- async function createCommand2(_project, opts) {
8374
- const projectPath = path2.resolve(_project);
8375
- const projectName = path2.basename(projectPath);
8376
- const projectType = await dist_default2({
8377
- message: "Whether your project will be a library for use in other Sandstone projects >",
8378
- default: false
8379
- }) === true ? "library" : "pack";
8380
- const sv = (v) => new import_semver.SemVer(v);
8381
- const versions = [[sv("1.0.0-beta.1"), sv(CLI_VERSION2)]];
8382
- const version = await dist_default4({
8383
- message: "Which version of Sandstone do you want to use? These are the only supported versions for new projects.",
8384
- choices: versions.map((v) => {
8385
- const { prerelease, major, minor } = v[0];
8386
- const release = `${major}.${minor}`;
8387
- return {
8388
- name: prerelease.length === 0 ? `Release Version ${release}` : `${capitalize(prerelease[0])} Version ${prerelease[1]} for release ${release}`,
8389
- value: v,
8390
- short: v[0].toString()
8391
- };
8392
- }),
8393
- default: versions[0]
8394
- });
8395
- let packName = projectName;
8396
- let namespace = projectName.replace(RegExp(/ /g), "_");
8397
- if (projectType === "pack") {
8398
- packName = await dist_default3({
8399
- message: "Name of your output pack(s) (can be changed later) >",
8400
- default: projectName
8401
- });
8402
- namespace = await dist_default3({
8403
- message: "Default namespace (can be changed later) >",
8404
- default: namespace
8405
- });
8406
- } else {
8407
- packName += "-testing";
8408
- namespace += "_test";
8409
- }
8410
- const saveOptions = {};
8411
- if (version[0].major === 1) {
8412
- if (opts.clientPath) {
8413
- saveOptions.clientPath = opts.clientPath;
6460
+ const saveOptions = {};
6461
+ if (version[0].major === 1) {
6462
+ if (opts.clientPath) {
6463
+ saveOptions.clientPath = opts.clientPath;
8414
6464
  }
8415
6465
  if (opts.root) {
8416
6466
  saveOptions.root = true;
@@ -8419,7 +6469,7 @@ async function createCommand2(_project, opts) {
8419
6469
  } else if (opts.serverPath) {
8420
6470
  saveOptions.serverPath = opts.serverPath;
8421
6471
  } else {
8422
- const saveChoice = await dist_default4({
6472
+ const saveChoice = await select({
8423
6473
  message: "Where do you want your pack(s) to be exported to (can be changed later)?",
8424
6474
  choices: [{
8425
6475
  name: "In the root client (.minecraft/datapacks & .minecraft/resourcepacks) folder(s)",
@@ -8444,14 +6494,14 @@ async function createCommand2(_project, opts) {
8444
6494
  saveOptions.root = true;
8445
6495
  break;
8446
6496
  case "world":
8447
- const world = await dist_default4({
6497
+ const world = await select({
8448
6498
  message: "What world do you want to save the packs in? >",
8449
6499
  choices: getWorldsList(saveOptions.clientPath)
8450
6500
  });
8451
6501
  saveOptions.world = world;
8452
6502
  break;
8453
6503
  case "server-path":
8454
- const serverPath = await dist_default3({
6504
+ const serverPath = await input({
8455
6505
  message: "Where is the server to save the packs in? Relative paths are accepted. >"
8456
6506
  });
8457
6507
  saveOptions.serverPath = serverPath;
@@ -8473,18 +6523,18 @@ async function createCommand2(_project, opts) {
8473
6523
  choices.unshift("pnpm");
8474
6524
  if (bun)
8475
6525
  choices.unshift("bun");
8476
- packageManager = await dist_default4({
6526
+ packageManager = await select({
8477
6527
  message: "What package manager do you want to use? (For now you have to use Bun) >",
8478
6528
  choices
8479
6529
  });
8480
6530
  }
8481
6531
  import_fs_extra.default.mkdirSync(projectPath);
8482
6532
  console.log(chalk_template_default`Installing {rgb(229, 193, 0) sandstone@${version[0]}}, {rgb(229, 193, 0) sandstone-cli@${version[1]}} and {cyan typescript} using {cyan ${packageManager}}.`);
8483
- const exec2 = (cmd) => child.execSync(cmd, { cwd: projectPath });
8484
- exec2("git clone https://github.com/sandstone-mc/sandstone-template.git .");
8485
- exec2(`git checkout ${projectType}-${version[0]}`);
6533
+ const exec = (cmd) => child.execSync(cmd, { cwd: projectPath });
6534
+ exec("git clone https://github.com/sandstone-mc/sandstone-template.git .");
6535
+ exec(`git checkout ${projectType}-${version[0]}`);
8486
6536
  await import_fs_extra.default.rm(".git", { force: true, recursive: true });
8487
- exec2(`${packageManager} install`);
6537
+ exec(`${packageManager} install`);
8488
6538
  const configPath = path2.join(projectPath, `${projectType === "library" ? "test/" : ""}sandstone.config.ts`);
8489
6539
  let templateConfig = await import_fs_extra.default.readFile(configPath, "utf8");
8490
6540
  templateConfig = templateConfig.replace("packUid: 'kZZpDK67'", `packUid: ${toJson(nanoid(8))}`);
@@ -8499,29 +6549,13 @@ async function createCommand2(_project, opts) {
8499
6549
  console.log(chalk_template_default`{green Success!} Created "${projectName}" at "${projectPath}"`);
8500
6550
  console.log(`Inside that directory, you can run several commands:
8501
6551
  `);
8502
- console.log(chalk_template_default` {cyan ${prefix} dev:build}:\n Builds the packs. {cyan }\n`);
8503
- console.log(chalk_template_default` {cyan ${prefix} dev:watch}:\n Builds the packs, and rebuilds on each file change. {cyan }\n`);
6552
+ console.log(chalk_template_default` {cyan ${prefix} dev:build}:\n Builds the packs. {cyan \u26CF}\n`);
6553
+ console.log(chalk_template_default` {cyan ${prefix} dev:watch}:\n Builds the packs, and rebuilds on each file change. {cyan \u26CF}\n`);
8504
6554
  console.log(`We suggest that you begin by typing:
8505
6555
  `);
8506
6556
  console.log(chalk_template_default` {cyan cd} ${projectName}\n {cyan ${prefix} dev:watch}`);
8507
6557
  }
8508
6558
 
8509
- // node_modules/commander/esm.mjs
8510
- var import__2 = __toESM(require_commander(), 1);
8511
- var {
8512
- program: program2,
8513
- createCommand: createCommand3,
8514
- createArgument: createArgument2,
8515
- createOption: createOption2,
8516
- CommanderError: CommanderError2,
8517
- InvalidArgumentError: InvalidArgumentError2,
8518
- InvalidOptionArgumentError: InvalidOptionArgumentError2,
8519
- Command: Command2,
8520
- Argument: Argument2,
8521
- Option: Option2,
8522
- Help: Help2
8523
- } = import__2.default;
8524
-
8525
6559
  // src/shared.ts
8526
6560
  function opt(flags, description, config) {
8527
6561
  return { flags, description, ...config };
@@ -8537,7 +6571,6 @@ var options = {
8537
6571
  dry: opt("-d, --dry", "Do not save the pack. Mostly useful with `verbose`."),
8538
6572
  verbose: opt("-f, --verbose", "Fully log all resulting resources: functions, advancements..."),
8539
6573
  root: opt("-r, --root", "Save the pack & resource pack in the .minecraft/datapacks & .minecraft/resource_packs folders. Override the value specified in the configuration file."),
8540
- fullTrace: opt("-t, --full-trace", "Show the full stack trace on errors."),
8541
6574
  strictErrors: opt("-e, --strict-errors", "Stop pack compilation on type errors."),
8542
6575
  production: opt("-p, --production", 'Runs Sandstone in production mode. This sets process.env.SANDSTONE_ENV to "production".'),
8543
6576
  path: opt("-h,--path <path>", "Path of the folder containing your sandstone workspace.", { default: "./" }),
@@ -8553,7 +6586,7 @@ var options = {
8553
6586
  var BuildOptions = {
8554
6587
  get(name) {
8555
6588
  const def = options[name];
8556
- const option = new Option2(def.flags, def.description);
6589
+ const option = new Option(def.flags, def.description);
8557
6590
  if (def.default !== undefined)
8558
6591
  option.default(def.default);
8559
6592
  if (def.env !== false) {
@@ -8564,6 +6597,6 @@ var BuildOptions = {
8564
6597
  };
8565
6598
 
8566
6599
  // src/create.ts
8567
- var commander3 = new Command;
6600
+ var commander2 = new Command;
8568
6601
  console.log(figlet.textSync("Sandstone"));
8569
- commander3.version(CLI_VERSION).description("Create a new Sandstone project. \u26CF").addOption(BuildOptions.get("name")).addOption(BuildOptions.get("namespace")).addOption(BuildOptions.get("world")).addOption(BuildOptions.get("clientPath")).addOption(BuildOptions.get("serverPath")).action(createCommand2).addArgument(new Argument("<projectName>", "Not the name of the output pack")).parse(process.argv);
6602
+ commander2.version(CLI_VERSION).description("Create a new Sandstone project. \u26CF").addOption(BuildOptions.get("name")).addOption(BuildOptions.get("namespace")).addOption(BuildOptions.get("world")).addOption(BuildOptions.get("clientPath")).addOption(BuildOptions.get("serverPath")).action(createCommand2).addArgument(new Argument("<projectName>", "Not the name of the output pack")).parse(process.argv);