@shell-shock/preset-script 0.6.23 → 0.6.27

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.
Files changed (143) hide show
  1. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
  2. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  3. package/dist/components/banner-function-declaration.cjs +28 -27
  4. package/dist/components/banner-function-declaration.cjs.map +1 -1
  5. package/dist/components/banner-function-declaration.d.cts.map +1 -1
  6. package/dist/components/banner-function-declaration.d.mts.map +1 -1
  7. package/dist/components/banner-function-declaration.mjs +2 -2
  8. package/dist/components/banner-function-declaration.mjs.map +1 -1
  9. package/dist/components/bin-entry.cjs +54 -45
  10. package/dist/components/bin-entry.cjs.map +1 -1
  11. package/dist/components/bin-entry.d.cts +0 -1
  12. package/dist/components/bin-entry.d.cts.map +1 -1
  13. package/dist/components/bin-entry.d.mts +0 -1
  14. package/dist/components/bin-entry.d.mts.map +1 -1
  15. package/dist/components/bin-entry.mjs +17 -9
  16. package/dist/components/bin-entry.mjs.map +1 -1
  17. package/dist/components/command-entry.cjs +76 -235
  18. package/dist/components/command-entry.cjs.map +1 -1
  19. package/dist/components/command-entry.d.cts +1 -8
  20. package/dist/components/command-entry.d.cts.map +1 -1
  21. package/dist/components/command-entry.d.mts +2 -9
  22. package/dist/components/command-entry.d.mts.map +1 -1
  23. package/dist/components/command-entry.mjs +24 -183
  24. package/dist/components/command-entry.mjs.map +1 -1
  25. package/dist/components/command-router.cjs +85 -83
  26. package/dist/components/command-router.cjs.map +1 -1
  27. package/dist/components/command-router.d.cts.map +1 -1
  28. package/dist/components/command-router.d.mts.map +1 -1
  29. package/dist/components/command-router.mjs +59 -58
  30. package/dist/components/command-router.mjs.map +1 -1
  31. package/dist/components/exit-function-declaration.cjs +38 -37
  32. package/dist/components/exit-function-declaration.cjs.map +1 -1
  33. package/dist/components/exit-function-declaration.d.cts +2 -2
  34. package/dist/components/exit-function-declaration.d.cts.map +1 -1
  35. package/dist/components/exit-function-declaration.d.mts +2 -2
  36. package/dist/components/exit-function-declaration.d.mts.map +1 -1
  37. package/dist/components/exit-function-declaration.mjs +3 -3
  38. package/dist/components/exit-function-declaration.mjs.map +1 -1
  39. package/dist/components/index.cjs +2 -9
  40. package/dist/components/index.d.cts +2 -3
  41. package/dist/components/index.d.mts +2 -3
  42. package/dist/components/index.mjs +2 -3
  43. package/dist/components/virtual-command-entry.cjs +43 -59
  44. package/dist/components/virtual-command-entry.cjs.map +1 -1
  45. package/dist/components/virtual-command-entry.d.cts.map +1 -1
  46. package/dist/components/virtual-command-entry.d.mts.map +1 -1
  47. package/dist/components/virtual-command-entry.mjs +13 -30
  48. package/dist/components/virtual-command-entry.mjs.map +1 -1
  49. package/dist/helpers/get-default-options.cjs +8 -7
  50. package/dist/helpers/get-default-options.cjs.map +1 -1
  51. package/dist/helpers/get-default-options.d.cts +0 -1
  52. package/dist/helpers/get-default-options.d.cts.map +1 -1
  53. package/dist/helpers/get-default-options.d.mts +0 -1
  54. package/dist/helpers/get-default-options.d.mts.map +1 -1
  55. package/dist/helpers/get-default-options.mjs.map +1 -1
  56. package/dist/index.cjs +30 -42
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.d.cts +0 -1
  59. package/dist/index.d.cts.map +1 -1
  60. package/dist/index.d.mts +0 -1
  61. package/dist/index.d.mts.map +1 -1
  62. package/dist/index.mjs +8 -20
  63. package/dist/index.mjs.map +1 -1
  64. package/dist/plugin-help/dist/components/display.cjs +260 -0
  65. package/dist/plugin-help/dist/components/display.cjs.map +1 -0
  66. package/dist/{components/help.mjs → plugin-help/dist/components/display.mjs} +26 -30
  67. package/dist/plugin-help/dist/components/display.mjs.map +1 -0
  68. package/dist/plugin-help/dist/components/help-builtin.cjs +86 -0
  69. package/dist/plugin-help/dist/components/help-builtin.cjs.map +1 -0
  70. package/dist/plugin-help/dist/components/help-builtin.mjs +84 -0
  71. package/dist/plugin-help/dist/components/help-builtin.mjs.map +1 -0
  72. package/dist/plugin-help/dist/components/help-command.cjs +97 -0
  73. package/dist/plugin-help/dist/components/help-command.cjs.map +1 -0
  74. package/dist/plugin-help/dist/components/help-command.mjs +96 -0
  75. package/dist/plugin-help/dist/components/help-command.mjs.map +1 -0
  76. package/dist/plugin-help/dist/components/index.cjs +3 -0
  77. package/dist/plugin-help/dist/components/index.mjs +5 -0
  78. package/dist/plugin-help/dist/index.cjs +104 -0
  79. package/dist/plugin-help/dist/index.cjs.map +1 -0
  80. package/dist/plugin-help/dist/index.d.cts +2 -0
  81. package/dist/plugin-help/dist/index.d.mts +2 -0
  82. package/dist/plugin-help/dist/index.mjs +100 -0
  83. package/dist/plugin-help/dist/index.mjs.map +1 -0
  84. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs +18 -0
  85. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs.map +1 -0
  86. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs +17 -0
  87. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs.map +1 -0
  88. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs +39 -0
  89. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs.map +1 -0
  90. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs +38 -0
  91. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs.map +1 -0
  92. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs +34 -0
  93. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs.map +1 -0
  94. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs +34 -0
  95. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +1 -0
  96. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs +41 -0
  97. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs.map +1 -0
  98. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs +41 -0
  99. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs.map +1 -0
  100. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs +18 -0
  101. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs.map +1 -0
  102. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs +17 -0
  103. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs.map +1 -0
  104. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs +21 -0
  105. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs.map +1 -0
  106. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs +21 -0
  107. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +1 -0
  108. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs +13 -0
  109. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs.map +1 -0
  110. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs +12 -0
  111. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs.map +1 -0
  112. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs +21 -0
  113. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs.map +1 -0
  114. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs +21 -0
  115. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs.map +1 -0
  116. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs +20 -0
  117. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs.map +1 -0
  118. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs +20 -0
  119. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs.map +1 -0
  120. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs +13 -0
  121. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs.map +1 -0
  122. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs +12 -0
  123. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs.map +1 -0
  124. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs +9 -0
  125. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs.map +1 -0
  126. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs +8 -0
  127. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +1 -0
  128. package/dist/plugin-help/dist/types/plugin.d.cts +62 -0
  129. package/dist/plugin-help/dist/types/plugin.d.cts.map +1 -0
  130. package/dist/plugin-help/dist/types/plugin.d.mts +62 -0
  131. package/dist/plugin-help/dist/types/plugin.d.mts.map +1 -0
  132. package/dist/types/plugin.d.cts +9 -9
  133. package/dist/types/plugin.d.cts.map +1 -1
  134. package/dist/types/plugin.d.mts +9 -9
  135. package/dist/types/plugin.d.mts.map +1 -1
  136. package/package.json +15 -29
  137. package/dist/components/help.cjs +0 -264
  138. package/dist/components/help.cjs.map +0 -1
  139. package/dist/components/help.d.cts +0 -105
  140. package/dist/components/help.d.cts.map +0 -1
  141. package/dist/components/help.d.mts +0 -105
  142. package/dist/components/help.d.mts.map +0 -1
  143. package/dist/components/help.mjs.map +0 -1
@@ -1,20 +1,21 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_components_banner_function_declaration = require('./banner-function-declaration.cjs');
3
- const require_components_help = require('./help.cjs');
4
4
  const require_components_command_router = require('./command-router.cjs');
5
5
  const require_components_command_entry = require('./command-entry.cjs');
6
- let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
- let __alloy_js_core = require("@alloy-js/core");
8
- let __alloy_js_typescript = require("@alloy-js/typescript");
9
- let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
10
- let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
11
- let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
12
- let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
6
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _alloy_js_core = require("@alloy-js/core");
8
+ let _alloy_js_typescript = require("@alloy-js/typescript");
9
+ let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
10
+ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
11
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
13
12
  let defu = require("defu");
14
- defu = require_rolldown_runtime.__toESM(defu);
15
- let __stryke_path_join = require("@stryke/path/join");
16
- let __stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
17
- let __powerlines_plugin_alloy_typescript_components_typescript_file = require("@powerlines/plugin-alloy/typescript/components/typescript-file");
13
+ defu = require_runtime.__toESM(defu);
14
+ let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
15
+ let _stryke_path_join = require("@stryke/path/join");
16
+ let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
17
+ let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
18
+ let _powerlines_plugin_alloy_typescript_components_typescript_file = require("@powerlines/plugin-alloy/typescript/components/typescript-file");
18
19
 
19
20
  //#region src/components/virtual-command-entry.tsx
20
21
  /**
@@ -22,27 +23,27 @@ let __powerlines_plugin_alloy_typescript_components_typescript_file = require("@
22
23
  */
23
24
  function VirtualCommandHandlerDeclaration(props) {
24
25
  const { command, children, banner } = props;
25
- const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
26
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
26
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
27
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
27
28
  get heading() {
28
- return `The ${command.title} (${(0, __shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.map((segment) => (0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, __stryke_string_format_constant_case.constantCase)((0, __shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment).join(" ")}) virtual command.`;
29
+ return `The ${command.title} (${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_constant_case.constantCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment).join(" ")}) virtual command.`;
29
30
  },
30
31
  get children() {
31
32
  return [
32
- (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { get children() {
33
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { get children() {
33
34
  return `${command.description.replace(/\.+$/, "")}.`;
34
35
  } }),
35
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
36
- (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocTitle, { get children() {
36
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
37
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocTitle, { get children() {
37
38
  return command.title;
38
39
  } }),
39
- (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
40
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
40
41
  name: "args",
41
42
  children: `The command-line arguments passed to the command.`
42
43
  })
43
44
  ];
44
45
  }
45
- }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
46
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
46
47
  "export": true,
47
48
  async: true,
48
49
  name: "handler",
@@ -53,30 +54,17 @@ function VirtualCommandHandlerDeclaration(props) {
53
54
  }],
54
55
  get children() {
55
56
  return [
56
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
57
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
57
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
58
58
  children,
59
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
60
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
61
- (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
59
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
60
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
62
61
  get when() {
63
62
  return Boolean(banner);
64
63
  },
65
64
  children: banner
66
65
  }),
67
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
68
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
69
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_help.VirtualHelp, {
70
- get segments() {
71
- return command.segments;
72
- },
73
- get options() {
74
- return Object.values(command.options);
75
- },
76
- get commands() {
77
- return command.children ?? {};
78
- }
79
- })
66
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
67
+ _alloy_js_core.code`return showHelp(); `
80
68
  ];
81
69
  }
82
70
  })];
@@ -86,9 +74,9 @@ function VirtualCommandHandlerDeclaration(props) {
86
74
  */
87
75
  function VirtualCommandEntry(props) {
88
76
  const { command, imports, builtinImports, ...rest } = props;
89
- const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
90
- const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
91
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_typescript_file.TypescriptFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
77
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
78
+ const filePath = (0, _alloy_js_core.computed)(() => (0, _stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
79
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
92
80
  get path() {
93
81
  return filePath.value;
94
82
  },
@@ -96,7 +84,7 @@ function VirtualCommandEntry(props) {
96
84
  return (0, defu.default)(imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
97
85
  ret[`./${child.name}`] = [{
98
86
  name: "handler",
99
- alias: `handle${(0, __stryke_string_format_pascal_case.pascalCase)(name)}`
87
+ alias: `handle${(0, _stryke_string_format_pascal_case.pascalCase)(name)}`
100
88
  }];
101
89
  return ret;
102
90
  }, {}));
@@ -105,14 +93,10 @@ function VirtualCommandEntry(props) {
105
93
  return (0, defu.default)(builtinImports ?? {}, {
106
94
  env: ["isDevelopment", "isDebug"],
107
95
  console: [
108
- "help",
109
96
  "warn",
110
97
  "error",
111
- "table",
112
98
  "colors",
113
- "writeLine",
114
- "splitText",
115
- "stripAnsi"
99
+ "writeLine"
116
100
  ],
117
101
  utils: [
118
102
  "useApp",
@@ -121,19 +105,19 @@ function VirtualCommandEntry(props) {
121
105
  "isMinimal",
122
106
  "isUnicodeSupported",
123
107
  "findSuggestions"
124
- ]
108
+ ],
109
+ [(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"]
125
110
  });
126
111
  },
127
112
  get children() {
128
113
  return [
129
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, { command }),
130
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
131
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
132
- (0, __alloy_js_core_jsx_runtime.createComponent)(VirtualCommandHandlerDeclaration, {
114
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, { command }),
115
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
116
+ (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandHandlerDeclaration, {
133
117
  command,
134
- banner: __alloy_js_core.code`banner(); `,
118
+ banner: _alloy_js_core.code`banner(); `,
135
119
  get children() {
136
- return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
120
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
137
121
  get segments() {
138
122
  return command.segments;
139
123
  },
@@ -145,19 +129,19 @@ function VirtualCommandEntry(props) {
145
129
  })
146
130
  ];
147
131
  }
148
- })), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
132
+ })), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
149
133
  get each() {
150
134
  return Object.values(command.children);
151
135
  },
152
- children: (child) => (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
136
+ children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
153
137
  get when() {
154
138
  return child.isVirtual;
155
139
  },
156
140
  get fallback() {
157
- return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
141
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
158
142
  },
159
143
  get children() {
160
- return (0, __alloy_js_core_jsx_runtime.createComponent)(VirtualCommandEntry, { command: child });
144
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandEntry, { command: child });
161
145
  }
162
146
  })
163
147
  })];
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-command-entry.cjs","names":["code","computed","For","Show","FunctionDeclaration","usePowerlines","TSDoc","TSDocParam","TSDocRemarks","TSDocTitle","TypescriptFile","getAppBin","getDynamicPathSegmentName","isDynamicPathSegment","joinPaths","constantCase","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualHelp","VirtualCommandHandlerDeclaration","props","command","children","banner","context","_$createComponent","heading","title","segments","map","segment","join","description","replace","_$createIntrinsic","name","async","parameters","type","default","when","Boolean","options","Object","values","commands","VirtualCommandEntry","imports","builtinImports","rest","filePath","entryPath","filter","_$mergeProps","path","value","entries","child","isVirtual","reduce","ret","alias","env","console","utils","each","fallback"],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\nimport { VirtualHelp } from \"./help\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <hbr />\n <hbr />\n {children}\n <hbr />\n <hbr />\n <Show when={Boolean(banner)}>{banner}</Show>\n <hbr />\n <hbr />\n <VirtualHelp\n segments={command.segments}\n options={Object.values(command.options)}\n commands={command.children ?? {}}\n />\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\n \"help\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"findSuggestions\"\n ]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration\n command={command}\n banner={code`banner(); `}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgBsB,iCACdC,OACA;CACA,MAAM,EAAEC,SAASC,UAAUC,WAAWH;CAEtC,MAAMI,8EAA8C;AAEpD,QAAA,kDAEKrB,6DAAK;EAAA,IACJuB,UAAO;AAAA,UAAE,OAAOL,QAAQM,MAAK,mDAAeH,QAAQ,CAAA,GAAIH,QAAQO,SAC7DC,KAAIC,sEACkBA,QAAQ,GACzB,0HAA2CA,QAAQ,CAAC,CAAA,KACpDA,QACL,CACAC,KAAK,IAAI,CAAA;;EAAoB,IAAAT,WAAA;AAAA,UAAA;qDAC/BjB,oEAAY,EAAA,IAAAiB,WAAA;AAAA,YAAE,GAAGD,QAAQW,YAAYC,QAAQ,QAAQ,GAAG,CAAA;OAAG,CAAA;qDAAA,OAAA,EAAA,CAAA;qDAE3D3B,kEAAU,EAAA,IAAAgB,WAAA;AAAA,YAAED,QAAQM;OAAK,CAAA;qDACzBvB,kEAAU;KAAC+B,MAAI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0B,OAAO,4DAAoB1B,KAAK;KAAI,CACxD;AAED,WAAOyB;MACN,EAA2B,CAClC,CAAC;;EAAA,IACDZ,iBAAc;AAAA,4BAAOA,kBAAkB,EAAE,EAAE;IACzCc,KAAK,CAAC,iBAAiB,UAAU;IACjCC,SAAS;KACP;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,OAAO;KACL;KACA;KACA;KACA;KACA;KACA;KAAiB;IAEpB,CAAC;;EAAA,IAAA1C,WAAA;AAAA,UAAA;qDACDP,0EAAyB,EAAUM,SAAO,CAAA;qDAAA,OAAA,EAAA,CAAA;qDAAA,OAAA,EAAA,CAAA;qDAG1CF,kCAAgC;KACtBE;KACTE,QAAQ1B,oBAAI;KAAY,IAAAyB,WAAA;AAAA,8DACvBL,iDAAa;OAAA,IACZW,WAAQ;AAAA,eAAEP,QAAQO;;OAAQ,IAC1BiB,WAAQ;AAAA,eAAExB,QAAQC;;OAAQ,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,mDAI/BvB,qBAAG;EAAA,IAACkE,OAAI;AAAA,UAAEtB,OAAOC,OAAOvB,QAAQC,SAAS;;EAAAA,WACvCmC,2DACEzD,sBAAI;GAAA,IACHwC,OAAI;AAAA,WAAEiB,MAAMC;;GAAS,IACrBQ,WAAQ;AAAA,4DAAGlD,+CAAY,EAACK,SAASoC,OAAK,CAAA;;GAAA,IAAAnC,WAAA;AAAA,4DACrCwB,qBAAmB,EAACzB,SAASoC,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
1
+ {"version":3,"file":"virtual-command-entry.cjs","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <Spacing />\n {children}\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`return showHelp(); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\"warn\", \"error\", \"colors\", \"writeLine\"],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"findSuggestions\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <Spacing />\n <VirtualCommandHandlerDeclaration\n command={command}\n banner={code`banner(); `}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,iCAAC,OAAsC;CACrD,MAAA,EACA,SACA,UACF;CAEE,MAAA,6EAAA;AACA,QAAG,iDAAe,4DAAe;EACjC,IAAA,UAAA;AACI,UAAC,OAAS,QAAA,MAAA,kDAAgC,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,qEAAA,QAAA,GAAA,wHAAA,QAAA,CAAA,CAAA,KAAA,QAAA,CAAA,KAAA,IAAA,CAAA;;EAE9C,IAAA,WAAA;AACA,UAAQ;oDAAmB,mEAAgB;AAErC,YAAS,GAAC,QAAA,YAAc,QAAA,QAAsB,GAAA,CAAA;OAEpD,CAAM;oDAAC,OAAA,EAAA,CAAA;oDAAA,iEAAA,EACJ,IAAA,WAAA;AACE,YAAA,QAAA;OAEA,CAAC;oDAAgB,iEAAA;KAChB,MAAI;KACJ,UAAU;KACX,CAAC;IAAC;;EAEN,CAAC,kDAAmB,0CAAkB;EACrC,UAAK;EACL,OAAK;EACL,MAAK;EACL,YAAK,CAAA;GACH,MAAE;GACF,MAAC;GACD,SAAE;GACH,CAAC;EACF,IAAI,WAAM;AACR,UAAE;oDAAsB,kDAAW,EAAE,CAAC;IAAA;oDAA8B,kDAAK,EAAA,CAAA;oDAAA,qBAAA;KACvE,IAAC,OAAS;AACT,aAAQ,QAAA,OAAA;;KAET,UAAU;KACX,CAAC;oDAAU,kDAAA,EAAA,CAAA;IAAA,mBAAA;IAAA;;EAEf,CAAC,CAAC;;;;;AASL,SAAW,oBAAW,OAAA;CACtB,MAAA,WAEE,SACC,gBACD,GA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../src/components/virtual-command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UA+CiB,qCAAA;WACN;EADM,MAAA,CAAA,EAEN,QAFM;EACN,QAAA,CAAA,EAEE,QAFF;;;;AAQX;AA6CiB,iBA7CD,gCAAA,CA6C0B,KAAA,EA5CjC,qCA4CiC,CAAA,EA5CI,QA4CJ;AACxC,UADe,wBAAA,SAAiC,IAChD,CAAA,cAAA,EAAA,MAAA,GAAA,gBAAA,CAAA,CAAA;EAGS,OAAA,EAAA,WAAA;;;AAMX;;iBAAgB,mBAAA,QAA2B,2BAAwB"}
1
+ {"version":3,"file":"virtual-command-entry.d.cts","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"mappings":";;;;;UA+CiB,qCAAA;EACf,OAAA,EAAS,WAAA;EACT,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UAqC7B,wBAAA,SAAiC,IAAA,CAChD,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,mBAAA,CAAoB,KAAA,EAAO,wBAAA,GAAwB,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-command-entry.d.mts","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UA+CiB,qCAAA;WACN;EADM,MAAA,CAAA,EAEN,QAFM;EACN,QAAA,CAAA,EAEE,QAFF;;;;AAQX;AA6CiB,iBA7CD,gCAAA,CA6C0B,KAAA,EA5CjC,qCA4CiC,CAAA,EA5CI,QA4CJ;AACxC,UADe,wBAAA,SAAiC,IAChD,CAAA,cAAA,EAAA,MAAA,GAAA,gBAAA,CAAA,CAAA;EAGS,OAAA,EAAA,WAAA;;;AAMX;;iBAAgB,mBAAA,QAA2B,2BAAwB"}
1
+ {"version":3,"file":"virtual-command-entry.d.mts","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"mappings":";;;;;UA+CiB,qCAAA;EACf,OAAA,EAAS,WAAA;EACT,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UAqC7B,wBAAA,SAAiC,IAAA,CAChD,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,mBAAA,CAAoB,KAAA,EAAO,wBAAA,GAAwB,QAAA"}
@@ -1,16 +1,16 @@
1
1
  import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
2
- import { VirtualHelp } from "./help.mjs";
3
2
  import { CommandRouter } from "./command-router.mjs";
4
3
  import { CommandEntry } from "./command-entry.mjs";
5
- import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
4
+ import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
6
5
  import { For, Show, code, computed } from "@alloy-js/core";
7
6
  import { FunctionDeclaration } from "@alloy-js/typescript";
8
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
+ import { Spacing } from "@powerlines/plugin-alloy/core/components";
9
8
  import { getAppBin, getDynamicPathSegmentName, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
10
- import { TSDoc, TSDocParam, TSDocRemarks, TSDocTitle } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
11
- import { pascalCase } from "@stryke/string-format/pascal-case";
9
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
12
10
  import defu from "defu";
11
+ import { TSDoc, TSDocParam, TSDocRemarks, TSDocTitle } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
13
12
  import { joinPaths } from "@stryke/path/join";
13
+ import { pascalCase } from "@stryke/string-format/pascal-case";
14
14
  import { constantCase } from "@stryke/string-format/constant-case";
15
15
  import { TypescriptFile } from "@powerlines/plugin-alloy/typescript/components/typescript-file";
16
16
 
@@ -51,30 +51,17 @@ function VirtualCommandHandlerDeclaration(props) {
51
51
  }],
52
52
  get children() {
53
53
  return [
54
- createIntrinsic("hbr", {}),
55
- createIntrinsic("hbr", {}),
54
+ createComponent(Spacing, {}),
56
55
  children,
57
- createIntrinsic("hbr", {}),
58
- createIntrinsic("hbr", {}),
56
+ createComponent(Spacing, {}),
59
57
  createComponent(Show, {
60
58
  get when() {
61
59
  return Boolean(banner);
62
60
  },
63
61
  children: banner
64
62
  }),
65
- createIntrinsic("hbr", {}),
66
- createIntrinsic("hbr", {}),
67
- createComponent(VirtualHelp, {
68
- get segments() {
69
- return command.segments;
70
- },
71
- get options() {
72
- return Object.values(command.options);
73
- },
74
- get commands() {
75
- return command.children ?? {};
76
- }
77
- })
63
+ createComponent(Spacing, {}),
64
+ code`return showHelp(); `
78
65
  ];
79
66
  }
80
67
  })];
@@ -103,14 +90,10 @@ function VirtualCommandEntry(props) {
103
90
  return defu(builtinImports ?? {}, {
104
91
  env: ["isDevelopment", "isDebug"],
105
92
  console: [
106
- "help",
107
93
  "warn",
108
94
  "error",
109
- "table",
110
95
  "colors",
111
- "writeLine",
112
- "splitText",
113
- "stripAnsi"
96
+ "writeLine"
114
97
  ],
115
98
  utils: [
116
99
  "useApp",
@@ -119,14 +102,14 @@ function VirtualCommandEntry(props) {
119
102
  "isMinimal",
120
103
  "isUnicodeSupported",
121
104
  "findSuggestions"
122
- ]
105
+ ],
106
+ [joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showHelp"]
123
107
  });
124
108
  },
125
109
  get children() {
126
110
  return [
127
111
  createComponent(BannerFunctionDeclaration, { command }),
128
- createIntrinsic("hbr", {}),
129
- createIntrinsic("hbr", {}),
112
+ createComponent(Spacing, {}),
130
113
  createComponent(VirtualCommandHandlerDeclaration, {
131
114
  command,
132
115
  banner: code`banner(); `,
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-command-entry.mjs","names":["code","computed","For","Show","FunctionDeclaration","usePowerlines","TSDoc","TSDocParam","TSDocRemarks","TSDocTitle","TypescriptFile","getAppBin","getDynamicPathSegmentName","isDynamicPathSegment","joinPaths","constantCase","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualHelp","VirtualCommandHandlerDeclaration","props","command","children","banner","context","_$createComponent","heading","title","segments","map","segment","join","description","replace","_$createIntrinsic","name","async","parameters","type","default","when","Boolean","options","Object","values","commands","VirtualCommandEntry","imports","builtinImports","rest","filePath","entryPath","filter","_$mergeProps","path","value","entries","child","isVirtual","reduce","ret","alias","env","console","utils","each","fallback"],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\nimport { VirtualHelp } from \"./help\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <hbr />\n <hbr />\n {children}\n <hbr />\n <hbr />\n <Show when={Boolean(banner)}>{banner}</Show>\n <hbr />\n <hbr />\n <VirtualHelp\n segments={command.segments}\n options={Object.values(command.options)}\n commands={command.children ?? {}}\n />\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\n \"help\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"findSuggestions\"\n ]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration\n command={command}\n banner={code`banner(); `}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwDA,SAAgBsB,iCACdC,OACA;CACA,MAAM,EAAEC,SAASC,UAAUC,WAAWH;CAEtC,MAAMI,UAAUtB,eAAoC;AAEpD,QAAA,CAAAuB,gBAEKtB,OAAK;EAAA,IACJuB,UAAO;AAAA,UAAE,OAAOL,QAAQM,MAAK,IAAKnB,UAAUgB,QAAQ,CAAA,GAAIH,QAAQO,SAC7DC,KAAIC,YACHpB,qBAAqBoB,QAAQ,GACzB,IAAIlB,aAAaH,0BAA0BqB,QAAQ,CAAC,CAAA,KACpDA,QACL,CACAC,KAAK,IAAI,CAAA;;EAAoB,IAAAT,WAAA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;GAAS,IACrBQ,WAAQ;AAAA,WAAAzC,gBAAGT,cAAY,EAACK,SAASoC,OAAK,CAAA;;GAAA,IAAAnC,WAAA;AAAA,WAAAG,gBACrCqB,qBAAmB,EAACzB,SAASoC,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
1
+ {"version":3,"file":"virtual-command-entry.mjs","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <Spacing />\n {children}\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`return showHelp(); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\"warn\", \"error\", \"colors\", \"writeLine\"],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"findSuggestions\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <Spacing />\n <VirtualCommandHandlerDeclaration\n command={command}\n banner={code`banner(); `}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,iCAAC,OAAsC;CACrD,MAAA,EACA,SACA,UACF;CAEE,MAAA,UAAA,eAAA;AACA,QAAG,CAAA,gBAAe,OAAe;EACjC,IAAA,UAAA;AACI,UAAC,OAAS,QAAA,MAAA,IAAA,UAAgC,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,YAAA,qBAAA,QAAA,GAAA,IAAA,aAAA,0BAAA,QAAA,CAAA,CAAA,KAAA,QAAA,CAAA,KAAA,IAAA,CAAA;;EAE9C,IAAA,WAAA;AACA,UAAQ;IAAA,gBAAmB,cAAgB;AAErC,YAAS,GAAC,QAAA,YAAc,QAAA,QAAsB,GAAA,CAAA;OAEpD,CAAM;IAAC,gBAAA,OAAA,EAAA,CAAA;IAAA,gBAAA,YAAA,EACJ,IAAA,WAAA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AACb,UAAO;IAAC,gBAAkB,2BAAmB,EACpC;;;KAED;KACN,QAAQ,IAAI;KACZ,IAAC,WAAA;AACD,aAAA,gBAAqB,eAAqB;OACxC,IAAM,WAAC;AACP,eAAW,QAAQ;;OAEjB,IAAC,WAAO;AACP,eAAQ,QAAA;;OAEV,CAAC;;KAEL,CAAC;IAAC;;EAEN,CAAC,CAAC,EAAE,gBAAa,KAAA;EAChB,IAAI,OAAK;AACP,UAAO,OAAE,OAAQ,QAAS,SAAM;;EAElC,WAAQ,UAAA,gBAAA,MAAA;GACN,IAAI,OAAM;AACR,WAAG,MAAA;;GAEL,IAAG,WAAS;AACV,WAAC,gBAAA,cAAA,EACC,SAAS,OACV,CAAC;;GAEJ,IAAI,WAAW;AACb,WAAI,gBAAkB,qBAAQ,EAC5B,SAAC,OACF,CAAC;;GAEL,CAAC;EACH,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let __shell_shock_core = require("@shell-shock/core");
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _shell_shock_core = require("@shell-shock/core");
3
4
 
4
5
  //#region src/helpers/get-default-options.ts
5
6
  /**
@@ -15,7 +16,7 @@ function getDefaultOptions() {
15
16
  description: "Show help information.",
16
17
  env: false,
17
18
  alias: ["h", "?"],
18
- kind: __shell_shock_core.CommandParameterKinds.boolean,
19
+ kind: _shell_shock_core.CommandParameterKinds.boolean,
19
20
  optional: true,
20
21
  default: false,
21
22
  skipAddingNegative: true
@@ -26,7 +27,7 @@ function getDefaultOptions() {
26
27
  description: "Show the version of the application.",
27
28
  env: false,
28
29
  alias: ["v"],
29
- kind: __shell_shock_core.CommandParameterKinds.boolean,
30
+ kind: _shell_shock_core.CommandParameterKinds.boolean,
30
31
  optional: true,
31
32
  default: false,
32
33
  skipAddingNegative: true
@@ -37,7 +38,7 @@ function getDefaultOptions() {
37
38
  description: "Enable verbose output.",
38
39
  env: "VERBOSE",
39
40
  alias: ["V"],
40
- kind: __shell_shock_core.CommandParameterKinds.boolean,
41
+ kind: _shell_shock_core.CommandParameterKinds.boolean,
41
42
  optional: true,
42
43
  default: false,
43
44
  skipAddingNegative: true
@@ -48,7 +49,7 @@ function getDefaultOptions() {
48
49
  description: "Enable colored terminal output.",
49
50
  env: "COLOR",
50
51
  alias: ["colors"],
51
- kind: __shell_shock_core.CommandParameterKinds.boolean,
52
+ kind: _shell_shock_core.CommandParameterKinds.boolean,
52
53
  optional: true,
53
54
  skipAddingNegative: false
54
55
  },
@@ -58,7 +59,7 @@ function getDefaultOptions() {
58
59
  description: "Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.",
59
60
  env: "NO_BANNER",
60
61
  alias: ["hide-banner"],
61
- kind: __shell_shock_core.CommandParameterKinds.boolean,
62
+ kind: _shell_shock_core.CommandParameterKinds.boolean,
62
63
  optional: true,
63
64
  default: false
64
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-options.cjs","names":["CommandParameterKinds","getDefaultOptions","name","title","description","env","alias","kind","boolean","optional","default","skipAddingNegative"],"sources":["../../src/helpers/get-default-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getDefaultOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false\n }\n ];\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgBC,oBAAqC;AACnD,QAAO;EACL;GACEC,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,KAAK,IAAI;GACjBC,MAAMP,yCAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACTC,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,IAAI;GACZC,MAAMP,yCAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACTC,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,IAAI;GACZC,MAAMP,yCAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACTC,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,SAAS;GACjBC,MAAMP,yCAAsBQ;GAC5BC,UAAU;GACVE,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,KAAK;GACLC,OAAO,CAAC,cAAc;GACtBC,MAAMP,yCAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACV;EACF"}
1
+ {"version":3,"file":"get-default-options.cjs","names":["CommandParameterKinds"],"sources":["../../src/helpers/get-default-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getDefaultOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false\n }\n ];\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgB,oBAAqC;AACnD,QAAO;EACL;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,KAAK,IAAI;GACjB,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,SAAS;GACjB,MAAMA,wCAAsB;GAC5B,UAAU;GACV,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aACE;GACF,KAAK;GACL,OAAO,CAAC,cAAc;GACtB,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACV;EACF"}
@@ -1,7 +1,6 @@
1
1
  import { CommandOption } from "@shell-shock/core";
2
2
 
3
3
  //#region src/helpers/get-default-options.d.ts
4
-
5
4
  /**
6
5
  * Get the default command options.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-options.d.cts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"sourcesContent":[],"mappings":";;;;;;AA0BA;;;iBAAgB,iBAAA,CAAA,GAAqB"}
1
+ {"version":3,"file":"get-default-options.d.cts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"mappings":";;;;;AA0BA;;;iBAAgB,iBAAA,CAAA,GAAqB,aAAA"}
@@ -1,7 +1,6 @@
1
1
  import { CommandOption } from "@shell-shock/core";
2
2
 
3
3
  //#region src/helpers/get-default-options.d.ts
4
-
5
4
  /**
6
5
  * Get the default command options.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-options.d.mts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"sourcesContent":[],"mappings":";;;;;;AA0BA;;;iBAAgB,iBAAA,CAAA,GAAqB"}
1
+ {"version":3,"file":"get-default-options.d.mts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"mappings":";;;;;AA0BA;;;iBAAgB,iBAAA,CAAA,GAAqB,aAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-options.mjs","names":["CommandParameterKinds","getDefaultOptions","name","title","description","env","alias","kind","boolean","optional","default","skipAddingNegative"],"sources":["../../src/helpers/get-default-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getDefaultOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false\n }\n ];\n}\n"],"mappings":";;;;;;;;AA0BA,SAAgBC,oBAAqC;AACnD,QAAO;EACL;GACEC,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,KAAK,IAAI;GACjBC,MAAMP,sBAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACTC,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,IAAI;GACZC,MAAMP,sBAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACTC,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,IAAI;GACZC,MAAMP,sBAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACTC,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aAAa;GACbC,KAAK;GACLC,OAAO,CAAC,SAAS;GACjBC,MAAMP,sBAAsBQ;GAC5BC,UAAU;GACVE,oBAAoB;GACrB;EACD;GACET,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,KAAK;GACLC,OAAO,CAAC,cAAc;GACtBC,MAAMP,sBAAsBQ;GAC5BC,UAAU;GACVC,SAAS;GACV;EACF"}
1
+ {"version":3,"file":"get-default-options.mjs","names":[],"sources":["../../src/helpers/get-default-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getDefaultOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false\n }\n ];\n}\n"],"mappings":";;;;;;;;AA0BA,SAAgB,oBAAqC;AACnD,QAAO;EACL;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,KAAK,IAAI;GACjB,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,SAAS;GACjB,MAAM,sBAAsB;GAC5B,UAAU;GACV,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aACE;GACF,KAAK;GACL,OAAO,CAAC,cAAc;GACtB,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACV;EACF"}