@shell-shock/preset-script 0.6.22 → 0.6.26

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 +78 -237
  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 +26 -185
  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} +30 -34
  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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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.39/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
package/dist/index.cjs CHANGED
@@ -1,19 +1,20 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ const require_index = require('./plugin-help/dist/index.cjs');
3
4
  const require_components_banner_function_declaration = require('./components/banner-function-declaration.cjs');
4
5
  const require_components_bin_entry = require('./components/bin-entry.cjs');
5
- const require_components_help = require('./components/help.cjs');
6
6
  const require_components_command_router = require('./components/command-router.cjs');
7
7
  const require_components_virtual_command_entry = require('./components/virtual-command-entry.cjs');
8
8
  const require_components_command_entry = require('./components/command-entry.cjs');
9
9
  require('./components/index.cjs');
10
10
  const require_helpers_get_default_options = require('./helpers/get-default-options.cjs');
11
- let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
12
- let __alloy_js_core = require("@alloy-js/core");
13
- let __alloy_js_typescript = require("@alloy-js/typescript");
14
- let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
15
- let __shell_shock_plugin_console = require("@shell-shock/plugin-console");
16
- __shell_shock_plugin_console = require_rolldown_runtime.__toESM(__shell_shock_plugin_console);
11
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
12
+ let _alloy_js_core = require("@alloy-js/core");
13
+ let _alloy_js_typescript = require("@alloy-js/typescript");
14
+ let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
15
+ let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
16
+ let _shell_shock_plugin_console = require("@shell-shock/plugin-console");
17
+ _shell_shock_plugin_console = require_runtime.__toESM(_shell_shock_plugin_console);
17
18
 
18
19
  //#region src/index.tsx
19
20
  /**
@@ -21,7 +22,8 @@ __shell_shock_plugin_console = require_rolldown_runtime.__toESM(__shell_shock_pl
21
22
  */
22
23
  const plugin = (options = {}) => {
23
24
  return [
24
- (0, __shell_shock_plugin_console.default)(options),
25
+ (0, _shell_shock_plugin_console.default)(options),
26
+ ...require_index.plugin(options),
25
27
  {
26
28
  name: "shell-shock:script-preset",
27
29
  config() {
@@ -40,7 +42,7 @@ const plugin = (options = {}) => {
40
42
  async handler() {
41
43
  const _self$ = this;
42
44
  this.debug("Rendering entrypoint modules for the Shell Shock `script` preset.");
43
- return (0, __powerlines_plugin_alloy_render.render)(this, [(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_bin_entry.BinEntry, {
45
+ return (0, _powerlines_plugin_alloy_render.render)(this, [(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_bin_entry.BinEntry, {
44
46
  builtinImports: {
45
47
  console: [
46
48
  "divider",
@@ -57,71 +59,58 @@ const plugin = (options = {}) => {
57
59
  ]
58
60
  },
59
61
  get prefix() {
60
- return [
61
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, {}),
62
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
63
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
64
- ];
62
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {})];
65
63
  },
66
64
  get children() {
67
65
  return [
68
- (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
66
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
69
67
  get when() {
70
68
  return Object.keys(_self$.commands).length > 0;
71
69
  },
72
70
  get children() {
73
71
  return [
74
- (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
72
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
75
73
  "const": true,
76
74
  name: "args",
77
75
  type: "string[]",
78
- initializer: __alloy_js_core.code`useArgs();`
76
+ initializer: _alloy_js_core.code`useArgs();`
79
77
  }),
80
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
81
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
78
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
79
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
82
80
  segments: [],
83
81
  get commands() {
84
82
  return _self$.commands ?? {};
85
83
  }
86
84
  }),
87
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
85
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
88
86
  ];
89
87
  }
90
88
  }),
91
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
92
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
93
- __alloy_js_core.code`banner();`,
94
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
95
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
96
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_help.VirtualHelp, {
97
- get options() {
98
- return _self$.options;
99
- },
100
- get commands() {
101
- return _self$.commands ?? {};
102
- }
103
- })
89
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
90
+ _alloy_js_core.code`banner();`,
91
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
92
+ _alloy_js_core.code`return showHelp();`
104
93
  ];
105
94
  }
106
- }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
95
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
107
96
  get when() {
108
97
  return Object.values(_self$.commands).length > 0;
109
98
  },
110
99
  get children() {
111
- return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
100
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
112
101
  get each() {
113
102
  return Object.values(_self$.commands);
114
103
  },
115
104
  doubleHardline: true,
116
- children: (child) => (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
105
+ children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
117
106
  get when() {
118
107
  return child.isVirtual;
119
108
  },
120
109
  get fallback() {
121
- return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
110
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
122
111
  },
123
112
  get children() {
124
- return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_virtual_command_entry.VirtualCommandEntry, { command: child });
113
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_virtual_command_entry.VirtualCommandEntry, { command: child });
125
114
  }
126
115
  })
127
116
  });
@@ -132,9 +121,8 @@ const plugin = (options = {}) => {
132
121
  }
133
122
  ];
134
123
  };
135
- var src_default = plugin;
136
124
 
137
125
  //#endregion
138
- exports.default = src_default;
126
+ exports.default = plugin;
139
127
  exports.plugin = plugin;
140
128
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["code","For","Show","VarDeclaration","render","console","BannerFunctionDeclaration","VirtualHelp","BinEntry","CommandEntry","CommandRouter","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","prepare","order","handler","_self$","_$createComponent","builtinImports","utils","prefix","_$createIntrinsic","children","when","Object","keys","commands","length","type","initializer","segments","values","each","doubleHardline","child","isVirtual","fallback","command"],"sources":["../src/index.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 { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport console from \"@shell-shock/plugin-console\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerFunctionDeclaration, VirtualHelp } from \"./components\";\nimport { BinEntry } from \"./components/bin-entry\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n console(options),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n }\n },\n {\n name: \"shell-shock:script-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\"\n ],\n utils: [\"useApp\", \"useArgs\", \"isMinimal\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <hbr />\n <hbr />\n {code`banner();`}\n <hbr />\n <hbr />\n <VirtualHelp\n options={this.options}\n commands={this.commands ?? {}}\n />\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,MAAaa,UAGXC,UAA+B,EAAE,KAC9B;AACH,QAAO;4CACGA,QAAQ;EAChB;GACEC,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,uEACD;AAED,WAAO;KACLC,gBAAgBN;KAChBO,iBAAiB;KACjB,GAAGL;KACJ;;GAEJ;EACD;GACEC,MAAM;GACNK,SAAS;IACPC,OAAO;IACP,MAAMC,UAAU;KAAA,MAAAC,SAAA;AACd,UAAKN,MACH,oEACD;AAED,yDACE,MAAI,kDAEDT,uCAAQ;MACPiB,gBAAgB;OACdpB,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACD;OACDqB,OAAO;QAAC;QAAU;QAAW;QAAW;OACzC;MAAA,IACDC,SAAM;AAAA,cAAA;yDAEDrB,0EAAyB,EAAA,CAAA;yDAAA,OAAA,EAAA,CAAA;yDAAA,OAAA,EAAA,CAAA;QAAA;;MAAA,IAAAuB,WAAA;AAAA,cAAA;yDAK7B3B,sBAAI;SAAA,IAAC4B,OAAI;AAAA,iBAAEC,OAAOC,KAAKT,OAAKU,SAAS,CAACC,SAAS;;SAAC,IAAAL,WAAA;AAAA,iBAAA;4DAC9C1B,sCAAc;YAAA,SAAA;YAEbY,MAAI;YACJoB,MAAI;YACJC,aAAapC,oBAAI;YAAY,CAAA;4DAAA,OAAA,EAAA,CAAA;4DAG9BU,iDAAa;YAAC2B,UAAU,EAAE;YAAA,IAAEJ,WAAQ;AAAA,oBAAEV,OAAKU,YAAY,EAAE;;YAAA,CAAA;4DAAA,OAAA,EAAA,CAAA;WAAA;;SAAA,CAAA;yDAAA,OAAA,EAAA,CAAA;yDAAA,OAAA,EAAA,CAAA;QAK3DjC,oBAAI;yDAAW,OAAA,EAAA,CAAA;yDAAA,OAAA,EAAA,CAAA;yDAGfO,qCAAW;SAAA,IACVO,UAAO;AAAA,iBAAES,OAAKT;;SAAO,IACrBmB,WAAQ;AAAA,iBAAEV,OAAKU,YAAY,EAAE;;SAAA,CAAA;QAAA;;MAAA,CAAA,mDAGhC/B,sBAAI;MAAA,IAAC4B,OAAI;AAAA,cAAEC,OAAOO,OAAOf,OAAKU,SAAS,CAACC,SAAS;;MAAC,IAAAL,WAAA;AAAA,+DAChD5B,qBAAG;QAAA,IAACsC,OAAI;AAAA,gBAAER,OAAOO,OAAOf,OAAKU,SAAS;;QAAEO,gBAAc;QAAAX,WACpDY,2DACEvC,sBAAI;SAAA,IACH4B,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,kEAAGlC,+CAAY,EAACmC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,kEACrClB,8DAAmB,EAACiC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAe5B"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.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 { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport console from \"@shell-shock/plugin-console\";\nimport help from \"@shell-shock/plugin-help\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerFunctionDeclaration } from \"./components\";\nimport { BinEntry } from \"./components/bin-entry\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n console(options),\n ...help(options),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n }\n },\n {\n name: \"shell-shock:script-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\"\n ],\n utils: [\"useApp\", \"useArgs\", \"isMinimal\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <Spacing />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <Spacing />\n {code`banner();`}\n <Spacing />\n {code`return showHelp();`}\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAW,UAA8B,UAAA,EAAA,KAAA;AACxC,QAAA;2CAAA,QAAA;EAAA,GAAA,qBAAA,QAAA;EAAA;GACC,MAAQ;GACN,SAAC;AACH,SAAO,MAAA,uEAAA;AACL,WAAQ;KACL,gBAAa;KAChB,iBAAA;KACE,GAAK;KACL;;GAEH;EAAE;GACD,MAAK;;IAEH,OAAE;IACF,MAAI,UAAA;KACF,MAAE,SAAA;AACF,UAAK,MAAA,oEAAA;AACL,wDAAC,MAAA,iDAAA,uCAAA;MACH,gBAAA;OACD,SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACD,OAAA;QAAA;QAAA;QAAA;QAAA;OACO;MACL,IAAQ,SAAC;AACP,cAAQ,iDAAK,0EAAA,EAAA,CAAA,kDAAA,kDAAA,EAAA,CAAA,CAAA;;MAEX,IAAI,WAAM;AACR,cAAC;wDAAqB,qBAAQ;SAC/B,IAAA,OAAA;;;SAGC,IAAI,WAAA;AACH,iBAAA;2DAAA,qCAAA;YACE,SAAA;YACC,MAAA;YACE,MAAA;YACA,aAAW,mBAAA;YACZ,CAAC;2DAAa,OAAA,EAAA,CAAA;2DAAA,iDAAA;YACb,UAAG,EAAS;YACZ,IAAG,WAAU;AACX,oBAAO,OAAC,YAAA,EAAA;;YAEX,CAAC;2DAAC,OAAA,EAAA,CAAA;WAAA;;SAEN,CAAC;wDAAG,kDAAA,EAAA,CAAA;QAAA,mBAAA;wDAAA,kDAAA,EAAA,CAAA;QAAA,mBAAA;QAAA;;MAER,CAAC,kDAAS,qBAAA;MACT,IAAI,OAAO;AACT,cAAO,OAAE,OAAS,OAAA,SAAA,CAAA,SAAA;;MAEpB,IAAI,WAAG;AACL,8DAAuB,oBAAK;QAC1B,IAAI,OAAC;AACH,gBAAI,OAAA,OAAA,OAAA,SAAA;;QAEN,gBAAY;QACZ,WAAM,0DAA6B,qBAAA;SACjC,IAAG,OAAA;AACD,iBAAM,MAAA;;SAER,IAAG,WAAK;AACN,iEAAI,+CAAA,EACL,SAAS,OACT,CAAA;;SAED,IAAC,WAAY;AACb,iEAAQ,8DAAA,EACJ,SAAM,OACT,CAAG;;SAEL,CAAC;QACH,CAAC;;MAEL,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}
package/dist/index.d.cts CHANGED
@@ -2,7 +2,6 @@ import { ScriptPresetContext, ScriptPresetOptions } from "./types/plugin.cjs";
2
2
  import { Plugin } from "powerlines";
3
3
 
4
4
  //#region src/index.d.ts
5
-
6
5
  /**
7
6
  * The Shell Shock base plugin.
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,mBAAA,GAAsB,mBAAtB,CAAA,CAAA,OAAA,CAAA,EAER,mBAFQ,EAAA,GAwFZ,MAxFY,CAwFL,QAxFK,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAoCA;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KAiFJ,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -2,7 +2,6 @@ import { ScriptPresetContext, ScriptPresetOptions } from "./types/plugin.mjs";
2
2
  import { Plugin } from "powerlines";
3
3
 
4
4
  //#region src/index.d.ts
5
-
6
5
  /**
7
6
  * The Shell Shock base plugin.
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,mBAAA,GAAsB,mBAAtB,CAAA,CAAA,OAAA,CAAA,EAER,mBAFQ,EAAA,GAwFZ,MAxFY,CAwFL,QAxFK,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAoCA;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KAiFJ,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
+ import { plugin as plugin$1 } from "./plugin-help/dist/index.mjs";
1
2
  import { BannerFunctionDeclaration } from "./components/banner-function-declaration.mjs";
2
3
  import { BinEntry } from "./components/bin-entry.mjs";
3
- import { VirtualHelp } from "./components/help.mjs";
4
4
  import { CommandRouter } from "./components/command-router.mjs";
5
5
  import { VirtualCommandEntry } from "./components/virtual-command-entry.mjs";
6
6
  import { CommandEntry } from "./components/command-entry.mjs";
@@ -9,6 +9,7 @@ import { getDefaultOptions } from "./helpers/get-default-options.mjs";
9
9
  import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
10
10
  import { For, Show, code } from "@alloy-js/core";
11
11
  import { VarDeclaration } from "@alloy-js/typescript";
12
+ import { Spacing } from "@powerlines/plugin-alloy/core/components";
12
13
  import { render } from "@powerlines/plugin-alloy/render";
13
14
  import console from "@shell-shock/plugin-console";
14
15
 
@@ -19,6 +20,7 @@ import console from "@shell-shock/plugin-console";
19
20
  const plugin = (options = {}) => {
20
21
  return [
21
22
  console(options),
23
+ ...plugin$1(options),
22
24
  {
23
25
  name: "shell-shock:script-preset",
24
26
  config() {
@@ -54,11 +56,7 @@ const plugin = (options = {}) => {
54
56
  ]
55
57
  },
56
58
  get prefix() {
57
- return [
58
- createComponent(BannerFunctionDeclaration, {}),
59
- createIntrinsic("hbr", {}),
60
- createIntrinsic("hbr", {})
61
- ];
59
+ return [createComponent(BannerFunctionDeclaration, {}), createComponent(Spacing, {})];
62
60
  },
63
61
  get children() {
64
62
  return [
@@ -85,19 +83,10 @@ const plugin = (options = {}) => {
85
83
  ];
86
84
  }
87
85
  }),
88
- createIntrinsic("hbr", {}),
89
- createIntrinsic("hbr", {}),
86
+ createComponent(Spacing, {}),
90
87
  code`banner();`,
91
- createIntrinsic("hbr", {}),
92
- createIntrinsic("hbr", {}),
93
- createComponent(VirtualHelp, {
94
- get options() {
95
- return _self$.options;
96
- },
97
- get commands() {
98
- return _self$.commands ?? {};
99
- }
100
- })
88
+ createComponent(Spacing, {}),
89
+ code`return showHelp();`
101
90
  ];
102
91
  }
103
92
  }), createComponent(Show, {
@@ -129,8 +118,7 @@ const plugin = (options = {}) => {
129
118
  }
130
119
  ];
131
120
  };
132
- var src_default = plugin;
133
121
 
134
122
  //#endregion
135
- export { src_default as default, plugin };
123
+ export { plugin as default, plugin };
136
124
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","console","BannerFunctionDeclaration","VirtualHelp","BinEntry","CommandEntry","CommandRouter","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","prepare","order","handler","_self$","_$createComponent","builtinImports","utils","prefix","_$createIntrinsic","children","when","Object","keys","commands","length","type","initializer","segments","values","each","doubleHardline","child","isVirtual","fallback","command"],"sources":["../src/index.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 { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport console from \"@shell-shock/plugin-console\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerFunctionDeclaration, VirtualHelp } from \"./components\";\nimport { BinEntry } from \"./components/bin-entry\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n console(options),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n }\n },\n {\n name: \"shell-shock:script-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\"\n ],\n utils: [\"useApp\", \"useArgs\", \"isMinimal\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <hbr />\n <hbr />\n {code`banner();`}\n <hbr />\n <hbr />\n <VirtualHelp\n options={this.options}\n commands={this.commands ?? {}}\n />\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAaa,UAGXC,UAA+B,EAAE,KAC9B;AACH,QAAO;EACLT,QAAQS,QAAQ;EAChB;GACEC,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,uEACD;AAED,WAAO;KACLC,gBAAgBN;KAChBO,iBAAiB;KACjB,GAAGL;KACJ;;GAEJ;EACD;GACEC,MAAM;GACNK,SAAS;IACPC,OAAO;IACP,MAAMC,UAAU;KAAA,MAAAC,SAAA;AACd,UAAKN,MACH,oEACD;AAED,YAAOb,OACL,MAAI,CAAAoB,gBAEDhB,UAAQ;MACPiB,gBAAgB;OACdpB,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACD;OACDqB,OAAO;QAAC;QAAU;QAAW;QAAW;OACzC;MAAA,IACDC,SAAM;AAAA,cAAA;QAAAH,gBAEDlB,2BAAyB,EAAA,CAAA;QAAAsB,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAA;;MAAA,IAAAC,WAAA;AAAA,cAAA;QAAAL,gBAK7BtB,MAAI;SAAA,IAAC4B,OAAI;AAAA,iBAAEC,OAAOC,KAAKT,OAAKU,SAAS,CAACC,SAAS;;SAAC,IAAAL,WAAA;AAAA,iBAAA;WAAAL,gBAC9CrB,gBAAc;YAAA,SAAA;YAEbY,MAAI;YACJoB,MAAI;YACJC,aAAapC,IAAI;YAAY,CAAA;WAAA4B,gBAAA,OAAA,EAAA,CAAA;WAAAJ,gBAG9Bd,eAAa;YAAC2B,UAAU,EAAE;YAAA,IAAEJ,WAAQ;AAAA,oBAAEV,OAAKU,YAAY,EAAE;;YAAA,CAAA;WAAAL,gBAAA,OAAA,EAAA,CAAA;WAAA;;SAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAK3D5B,IAAI;QAAW4B,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAAJ,gBAGfjB,aAAW;SAAA,IACVO,UAAO;AAAA,iBAAES,OAAKT;;SAAO,IACrBmB,WAAQ;AAAA,iBAAEV,OAAKU,YAAY,EAAE;;SAAA,CAAA;QAAA;;MAAA,CAAA,EAAAT,gBAGhCtB,MAAI;MAAA,IAAC4B,OAAI;AAAA,cAAEC,OAAOO,OAAOf,OAAKU,SAAS,CAACC,SAAS;;MAAC,IAAAL,WAAA;AAAA,cAAAL,gBAChDvB,KAAG;QAAA,IAACsC,OAAI;AAAA,gBAAER,OAAOO,OAAOf,OAAKU,SAAS;;QAAEO,gBAAc;QAAAX,WACpDY,UAAKjB,gBACHtB,MAAI;SAAA,IACH4B,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,iBAAAnB,gBAAGf,cAAY,EAACmC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,iBAAAL,gBACrCb,qBAAmB,EAACiC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAe5B"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport console from \"@shell-shock/plugin-console\";\nimport help from \"@shell-shock/plugin-help\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerFunctionDeclaration } from \"./components\";\nimport { BinEntry } from \"./components/bin-entry\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n console(options),\n ...help(options),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n }\n },\n {\n name: \"shell-shock:script-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\"\n ],\n utils: [\"useApp\", \"useArgs\", \"isMinimal\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <Spacing />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <Spacing />\n {code`banner();`}\n <Spacing />\n {code`return showHelp();`}\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,MAAW,UAA8B,UAAA,EAAA,KAAA;AACxC,QAAA;EAAA,QAAA,QAAA;EAAA,GAAA,SAAA,QAAA;EAAA;GACC,MAAQ;GACN,SAAC;AACH,SAAO,MAAA,uEAAA;AACL,WAAQ;KACL,gBAAa;KAChB,iBAAA;KACE,GAAK;KACL;;GAEH;EAAE;GACD,MAAK;;IAEH,OAAE;IACF,MAAI,UAAA;KACF,MAAE,SAAA;AACF,UAAK,MAAA,oEAAA;AACL,YAAC,OAAA,MAAA,CAAA,gBAAA,UAAA;MACH,gBAAA;OACD,SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACD,OAAA;QAAA;QAAA;QAAA;QAAA;OACO;MACL,IAAQ,SAAC;AACP,cAAQ,CAAI,gBAAC,2BAAA,EAAA,CAAA,EAAA,gBAAA,SAAA,EAAA,CAAA,CAAA;;MAEX,IAAI,WAAM;AACR,cAAC;QAAA,gBAAqB,MAAQ;SAC/B,IAAA,OAAA;;;SAGC,IAAI,WAAA;AACH,iBAAA;WAAA,gBAAA,gBAAA;YACE,SAAA;YACC,MAAA;YACE,MAAA;YACA,aAAW,IAAA;YACZ,CAAC;WAAE,gBAAW,OAAA,EAAA,CAAA;WAAA,gBAAA,eAAA;YACb,UAAG,EAAS;YACZ,IAAG,WAAU;AACX,oBAAO,OAAC,YAAA,EAAA;;YAEX,CAAC;WAAC,gBAAA,OAAA,EAAA,CAAA;WAAA;;SAEN,CAAC;QAAE,gBAAC,SAAA,EAAA,CAAA;QAAA,IAAA;QAAA,gBAAA,SAAA,EAAA,CAAA;QAAA,IAAA;QAAA;;MAER,CAAC,EAAE,gBAAO,MAAA;MACT,IAAI,OAAO;AACT,cAAO,OAAE,OAAS,OAAA,SAAA,CAAA,SAAA;;MAEpB,IAAI,WAAG;AACL,cAAK,gBAAkB,KAAK;QAC1B,IAAI,OAAC;AACH,gBAAI,OAAA,OAAA,OAAA,SAAA;;QAEN,gBAAY;QACZ,WAAM,UAAa,gBAAgB,MAAA;SACjC,IAAG,OAAA;AACD,iBAAM,MAAA;;SAER,IAAG,WAAK;AACN,iBAAI,gBAAA,cAAA,EACL,SAAS,OACT,CAAA;;SAED,IAAC,WAAY;AACb,iBAAQ,gBAAA,qBAAA,EACJ,SAAM,OACT,CAAG;;SAEL,CAAC;QACH,CAAC;;MAEL,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}
@@ -0,0 +1,260 @@
1
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
2
+ const require_kebab_case = require('../node_modules/.pnpm/@stryke_string-format@0.17.4/node_modules/@stryke/string-format/dist/kebab-case.cjs');
3
+ const require_snake_case = require('../node_modules/.pnpm/@stryke_string-format@0.17.4/node_modules/@stryke/string-format/dist/snake-case.cjs');
4
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let _alloy_js_core = require("@alloy-js/core");
6
+ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
7
+ let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
8
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
+ let _shell_shock_core = require("@shell-shock/core");
10
+ let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
11
+
12
+ //#region ../plugin-help/dist/components/display.mjs
13
+ /**
14
+ * A component that generates the usage display for a command.
15
+ */
16
+ function HelpUsageDisplay(props) {
17
+ const { command, indent = 2 } = props;
18
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
19
+ const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
20
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
21
+ get each() {
22
+ return Object.keys(context.config.bin);
23
+ },
24
+ hardline: true,
25
+ children: (bin) => [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
26
+ writeLine(
27
+ colors.text.body.secondary(\`\$ \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${require_snake_case.snakeCase((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${colors.text.usage.dynamic("[command]")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${colors.text.usage.args("<${require_snake_case.snakeCase((arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === _shell_shock_core.CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${colors.text.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
28
+ );`), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
29
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
30
+ get when() {
31
+ return command.args.length > 0;
32
+ },
33
+ get children() {
34
+ return [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
35
+ get each() {
36
+ return Object.keys(context.config.bin);
37
+ },
38
+ hardline: true,
39
+ children: (bin) => [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
40
+ writeLine(
41
+ colors.text.body.secondary(\`\$ \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${require_snake_case.snakeCase((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${colors.text.usage.dynamic("[command]")}` : ""} \${colors.text.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${colors.text.usage.args("<${require_snake_case.snakeCase((arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === _shell_shock_core.CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
42
+ );`), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
43
+ })];
44
+ }
45
+ })];
46
+ }
47
+ /**
48
+ * A component that generates the options table display for a command.
49
+ */
50
+ function HelpOptionsDisplay(props) {
51
+ const { options } = props;
52
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
53
+ return [
54
+ _alloy_js_core.code`table([ `,
55
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
56
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
57
+ get each() {
58
+ return (0, _shell_shock_core_plugin_utils.sortOptions)(options);
59
+ },
60
+ hardline: true,
61
+ children: (option) => {
62
+ const flags = [];
63
+ const names = [];
64
+ if (option.name.length === 1) flags.push(`-${option.name}`);
65
+ else names.push(`--${require_kebab_case.kebabCase(option.name)}`);
66
+ option.alias.forEach((alias) => {
67
+ if (alias.length === 1) flags.push(`-${alias}`);
68
+ else names.push(`--${require_kebab_case.kebabCase(alias)}`);
69
+ });
70
+ return _alloy_js_core.code`[{ value: colors.text.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.kind === _shell_shock_core.CommandParameterKinds.string ? ` <${require_snake_case.snakeCase(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.format ? option.format : option.name)}${option.variadic ? "..." : ""}>` : option.kind === _shell_shock_core.CommandParameterKinds.number ? ` <${require_snake_case.snakeCase(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.name)}${option.variadic ? "..." : ""}>` : ""}"), align: "right", border: "none", maxWidth: "1/3" }, { value: colors.text.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(option.description).replace(/\.+$/, "").trim()}${option.env || option.default !== void 0 ? ` (${option.env ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${option.default !== void 0 ? ", " : ""}` : ""}${option.default !== void 0 ? `default: ${JSON.stringify(option.default).replace(/"/g, "\\\"")}` : ""})` : ""}.\`), align: "left", border: "none" }], `;
71
+ }
72
+ }),
73
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
74
+ _alloy_js_core.code` ]); `
75
+ ];
76
+ }
77
+ /**
78
+ * A component that generates the commands table display for a command.
79
+ */
80
+ function HelpCommandsDisplay(props) {
81
+ const { commands } = props;
82
+ return [
83
+ _alloy_js_core.code`table([ `,
84
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
85
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
86
+ get each() {
87
+ return Object.values(commands);
88
+ },
89
+ hardline: true,
90
+ children: (child) => _alloy_js_core.code`[{ value: colors.text.body.primary("${child.name}"), align: "right", border: "none" }, { value: colors.text.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
91
+ }),
92
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
93
+ _alloy_js_core.code` ]); `
94
+ ];
95
+ }
96
+ /**
97
+ * A component that generates the `help` function declaration for a command.
98
+ */
99
+ function BaseHelpDisplay(props) {
100
+ const { command, indent = 1, filterGlobalOptions = false } = props;
101
+ const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
102
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
103
+ const options = (0, _alloy_js_core.computed)(() => filterGlobalOptions ? Object.values(command.options).filter((option) => !context.options.some((globalOption) => globalOption.name === option.name || option.alias.includes(globalOption.name) || globalOption.alias?.includes(option.name) || globalOption.alias?.some((alias) => option.alias.includes(alias)))) : Object.values(command.options));
104
+ return [
105
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
106
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
107
+ (0, _alloy_js_core_jsx_runtime.createComponent)(HelpUsageDisplay, {
108
+ command,
109
+ indent
110
+ }),
111
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
112
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
113
+ get when() {
114
+ return options.value.length > 0;
115
+ },
116
+ get children() {
117
+ return [
118
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
119
+ writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
120
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
121
+ (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { get options() {
122
+ return options.value;
123
+ } }),
124
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
125
+ ];
126
+ }
127
+ }),
128
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
129
+ get when() {
130
+ return Object.keys(command.children).length > 0;
131
+ },
132
+ get children() {
133
+ return [
134
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
135
+ writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
136
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
137
+ (0, _alloy_js_core_jsx_runtime.createComponent)(HelpCommandsDisplay, { get commands() {
138
+ return command.children;
139
+ } }),
140
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
141
+ ];
142
+ }
143
+ })
144
+ ];
145
+ }
146
+ /**
147
+ * A component that generates the invocation of the `help` function for a command.
148
+ */
149
+ function VirtualCommandHelpDisplay(props) {
150
+ const { options, segments, commands } = props;
151
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
152
+ return [
153
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
154
+ _alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
155
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
156
+ (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { options }),
157
+ _alloy_js_core.code`writeLine(""); `,
158
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
159
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
160
+ get when() {
161
+ return Object.keys(commands).length > 0;
162
+ },
163
+ get children() {
164
+ return [
165
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(colors.text.body.secondary("The following commands are available through the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface:"));
166
+ writeLine(""); `),
167
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
168
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
169
+ get each() {
170
+ return Object.values(commands);
171
+ },
172
+ doubleHardline: true,
173
+ joiner: _alloy_js_core.code`writeLine(""); `,
174
+ ender: _alloy_js_core.code`writeLine(""); `,
175
+ children: (child) => [
176
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
177
+ writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
178
+ writeLine("");
179
+ writeLine(colors.text.body.secondary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
180
+ writeLine("");
181
+ `),
182
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
183
+ (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
184
+ command: child,
185
+ indent: 2,
186
+ filterGlobalOptions: true
187
+ }),
188
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
189
+ ]
190
+ }),
191
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help("Running a specific command with the help flag (via: '${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help') will provide additional information that is specific to that command.");
192
+ writeLine("");`)
193
+ ];
194
+ }
195
+ })
196
+ ];
197
+ }
198
+ /**
199
+ * A component that generates the invocation of the `help` function for a command.
200
+ */
201
+ function CommandHelpDisplay(props) {
202
+ const { command } = props;
203
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
204
+ return [
205
+ _alloy_js_core.code`writeLine(""); `,
206
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
207
+ (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
208
+ command,
209
+ filterGlobalOptions: false
210
+ }),
211
+ _alloy_js_core.code`writeLine(""); `,
212
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
213
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
214
+ get when() {
215
+ return Object.keys(command.children).length > 0;
216
+ },
217
+ get children() {
218
+ return [
219
+ _alloy_js_core.code`writeLine(colors.text.body.secondary("The following sub-commands are available:"));
220
+ writeLine(""); `,
221
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
222
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
223
+ get each() {
224
+ return Object.values(command.children);
225
+ },
226
+ doubleHardline: true,
227
+ joiner: _alloy_js_core.code`writeLine(""); `,
228
+ ender: _alloy_js_core.code`writeLine(""); `,
229
+ children: (child) => [
230
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
231
+ writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
232
+ writeLine("");
233
+ writeLine(colors.text.body.secondary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
234
+ writeLine("");
235
+ `),
236
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
237
+ (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
238
+ command: child,
239
+ indent: 2,
240
+ filterGlobalOptions: true
241
+ }),
242
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
243
+ ]
244
+ }),
245
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help("Running a specific command with the help flag (via: '${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.join(" ")} <specific command> --help') will provide additional information that is specific to that command.");
246
+ writeLine("");`)
247
+ ];
248
+ }
249
+ })
250
+ ];
251
+ }
252
+
253
+ //#endregion
254
+ exports.BaseHelpDisplay = BaseHelpDisplay;
255
+ exports.CommandHelpDisplay = CommandHelpDisplay;
256
+ exports.HelpCommandsDisplay = HelpCommandsDisplay;
257
+ exports.HelpOptionsDisplay = HelpOptionsDisplay;
258
+ exports.HelpUsageDisplay = HelpUsageDisplay;
259
+ exports.VirtualCommandHelpDisplay = VirtualCommandHelpDisplay;
260
+ //# sourceMappingURL=display.cjs.map