@shell-shock/preset-cli 0.8.0 → 0.8.4

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 (107) 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 +48 -164
  4. package/dist/components/banner-function-declaration.d.cts +2 -2
  5. package/dist/components/banner-function-declaration.d.cts.map +1 -1
  6. package/dist/components/banner-function-declaration.d.mts +2 -2
  7. package/dist/components/banner-function-declaration.d.mts.map +1 -1
  8. package/dist/components/banner-function-declaration.mjs +29 -146
  9. package/dist/components/banner-function-declaration.mjs.map +1 -1
  10. package/dist/components/command-entry.cjs +122 -120
  11. package/dist/components/command-entry.d.cts.map +1 -1
  12. package/dist/components/command-entry.d.mts +3 -3
  13. package/dist/components/command-entry.d.mts.map +1 -1
  14. package/dist/components/command-entry.mjs +21 -20
  15. package/dist/components/command-entry.mjs.map +1 -1
  16. package/dist/components/command-router.cjs +20 -19
  17. package/dist/components/command-router.d.cts +3 -3
  18. package/dist/components/command-router.d.cts.map +1 -1
  19. package/dist/components/command-router.d.mts.map +1 -1
  20. package/dist/components/command-router.mjs +1 -1
  21. package/dist/components/command-router.mjs.map +1 -1
  22. package/dist/components/index.cjs +4 -0
  23. package/dist/components/index.d.cts +2 -1
  24. package/dist/components/index.d.mts +2 -1
  25. package/dist/components/index.mjs +2 -1
  26. package/dist/components/upgrade-builtin.cjs +171 -0
  27. package/dist/components/upgrade-builtin.d.cts +15 -0
  28. package/dist/components/upgrade-builtin.d.cts.map +1 -0
  29. package/dist/components/upgrade-builtin.d.mts +15 -0
  30. package/dist/components/upgrade-builtin.d.mts.map +1 -0
  31. package/dist/components/upgrade-builtin.mjs +169 -0
  32. package/dist/components/upgrade-builtin.mjs.map +1 -0
  33. package/dist/components/virtual-command-entry.cjs +26 -24
  34. package/dist/components/virtual-command-entry.d.cts.map +1 -1
  35. package/dist/components/virtual-command-entry.d.mts +3 -3
  36. package/dist/components/virtual-command-entry.d.mts.map +1 -1
  37. package/dist/components/virtual-command-entry.mjs +7 -6
  38. package/dist/components/virtual-command-entry.mjs.map +1 -1
  39. package/dist/helpers/get-default-options.cjs +6 -6
  40. package/dist/helpers/get-default-options.mjs.map +1 -1
  41. package/dist/index.cjs +49 -62
  42. package/dist/index.d.cts +0 -1
  43. package/dist/index.d.cts.map +1 -1
  44. package/dist/index.d.mts +0 -1
  45. package/dist/index.d.mts.map +1 -1
  46. package/dist/index.mjs +23 -36
  47. package/dist/index.mjs.map +1 -1
  48. package/dist/plugin-help/dist/components/display.cjs +259 -0
  49. package/dist/plugin-help/dist/components/display.mjs +254 -0
  50. package/dist/plugin-help/dist/components/display.mjs.map +1 -0
  51. package/dist/plugin-help/dist/components/help-builtin.cjs +85 -0
  52. package/dist/plugin-help/dist/components/help-builtin.mjs +84 -0
  53. package/dist/plugin-help/dist/components/help-builtin.mjs.map +1 -0
  54. package/dist/plugin-help/dist/components/help-command.cjs +96 -0
  55. package/dist/plugin-help/dist/components/help-command.mjs +96 -0
  56. package/dist/plugin-help/dist/components/help-command.mjs.map +1 -0
  57. package/dist/plugin-help/dist/components/index.cjs +3 -0
  58. package/dist/plugin-help/dist/components/index.mjs +5 -0
  59. package/dist/plugin-help/dist/index.cjs +103 -0
  60. package/dist/plugin-help/dist/index.d.cts +2 -0
  61. package/dist/plugin-help/dist/index.d.mts +2 -0
  62. package/dist/plugin-help/dist/index.mjs +100 -0
  63. package/dist/plugin-help/dist/index.mjs.map +1 -0
  64. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs +17 -0
  65. 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
  66. 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
  67. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs +38 -0
  68. 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
  69. 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
  70. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs +33 -0
  71. 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
  72. 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
  73. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs +40 -0
  74. 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
  75. 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
  76. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs +17 -0
  77. 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
  78. 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
  79. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs +20 -0
  80. 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
  81. 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
  82. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs +12 -0
  83. 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
  84. 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
  85. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs +20 -0
  86. 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
  87. 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
  88. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs +19 -0
  89. 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
  90. 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
  91. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs +12 -0
  92. 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
  93. 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
  94. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs +8 -0
  95. 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
  96. 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
  97. package/dist/plugin-help/dist/types/plugin.d.cts +62 -0
  98. package/dist/plugin-help/dist/types/plugin.d.cts.map +1 -0
  99. package/dist/plugin-help/dist/types/plugin.d.mts +62 -0
  100. package/dist/plugin-help/dist/types/plugin.d.mts.map +1 -0
  101. package/dist/types/index.d.cts +2 -2
  102. package/dist/types/index.d.mts +2 -2
  103. package/dist/types/plugin.d.cts +20 -34
  104. package/dist/types/plugin.d.cts.map +1 -1
  105. package/dist/types/plugin.d.mts +20 -34
  106. package/dist/types/plugin.d.mts.map +1 -1
  107. package/package.json +30 -16
@@ -1,6 +1,6 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let __shell_shock_core = require("@shell-shock/core");
3
- let __shell_shock_preset_script_helpers_get_default_options = require("@shell-shock/preset-script/helpers/get-default-options");
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ let _shell_shock_core = require("@shell-shock/core");
3
+ let _shell_shock_preset_script_helpers_get_default_options = require("@shell-shock/preset-script/helpers/get-default-options");
4
4
 
5
5
  //#region src/helpers/get-default-options.ts
6
6
  /**
@@ -12,13 +12,13 @@ let __shell_shock_preset_script_helpers_get_default_options = require("@shell-sh
12
12
  */
13
13
  function getDefaultOptions(context, _) {
14
14
  return [
15
- ...(0, __shell_shock_preset_script_helpers_get_default_options.getDefaultOptions)(),
15
+ ...(0, _shell_shock_preset_script_helpers_get_default_options.getDefaultOptions)(),
16
16
  context.config.interactive !== "never" && context.config.interactive !== true && {
17
17
  name: "interactive",
18
18
  title: "Interactive",
19
19
  description: "Enable interactive mode - will be set to false if running in a CI pipeline.",
20
20
  alias: ["i", "interact"],
21
- kind: __shell_shock_core.CommandParameterKinds.boolean,
21
+ kind: _shell_shock_core.CommandParameterKinds.boolean,
22
22
  optional: true,
23
23
  default: context.config.interactive !== false
24
24
  },
@@ -27,7 +27,7 @@ function getDefaultOptions(context, _) {
27
27
  title: "Non-Interactive",
28
28
  description: "Disable interactive mode - will be set to true if running in a CI pipeline.",
29
29
  alias: ["no-interactive"],
30
- kind: __shell_shock_core.CommandParameterKinds.boolean,
30
+ kind: _shell_shock_core.CommandParameterKinds.boolean,
31
31
  optional: true,
32
32
  default: false,
33
33
  isNegativeOf: "interactive"
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-options.mjs","names":["CommandParameterKinds","getDefaultOptions","getDefaultOptionsBase","context","_","config","interactive","name","title","description","alias","kind","boolean","optional","default","isNegativeOf","filter","Boolean"],"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 { CommandBase, CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { getDefaultOptions as getDefaultOptionsBase } from \"@shell-shock/preset-script/helpers/get-default-options\";\nimport type { CLIPresetContext } from \"../types\";\n\n/**\n * Get the default command options.\n *\n * @param context - The build context.\n * @param _ - The command input.\n * @returns The default command options.\n */\nexport function getDefaultOptions(\n context: CLIPresetContext,\n _: CommandBase\n): CommandOption[] {\n return [\n ...getDefaultOptionsBase(),\n context.config.interactive !== \"never\" &&\n context.config.interactive !== true && {\n name: \"interactive\",\n title: \"Interactive\",\n description:\n \"Enable interactive mode - will be set to false if running in a CI pipeline.\",\n alias: [\"i\", \"interact\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: context.config.interactive !== false\n },\n context.config.interactive !== \"never\" &&\n context.config.interactive !== false && {\n name: \"non-interactive\",\n title: \"Non-Interactive\",\n description:\n \"Disable interactive mode - will be set to true if running in a CI pipeline.\",\n alias: [\"no-interactive\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n isNegativeOf: \"interactive\"\n }\n ].filter(Boolean) as CommandOption[];\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAAgBC,oBACdE,SACAC,GACiB;AACjB,QAAO;EACL,GAAGF,mBAAuB;EAC1BC,QAAQE,OAAOC,gBAAgB,WAC7BH,QAAQE,OAAOC,gBAAgB,QAAQ;GACrCC,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,OAAO,CAAC,KAAK,WAAW;GACxBC,MAAMX,sBAAsBY;GAC5BC,UAAU;GACVC,SAASX,QAAQE,OAAOC,gBAAgB;GACzC;EACHH,QAAQE,OAAOC,gBAAgB,WAC7BH,QAAQE,OAAOC,gBAAgB,SAAS;GACtCC,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,OAAO,CAAC,iBAAiB;GACzBC,MAAMX,sBAAsBY;GAC5BC,UAAU;GACVC,SAAS;GACTC,cAAc;GACf;EACJ,CAACC,OAAOC,QAAQ"}
1
+ {"version":3,"file":"get-default-options.mjs","names":["getDefaultOptions","getDefaultOptionsBase"],"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 { CommandBase, CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { getDefaultOptions as getDefaultOptionsBase } from \"@shell-shock/preset-script/helpers/get-default-options\";\nimport type { CLIPresetContext } from \"../types\";\n\n/**\n * Get the default command options.\n *\n * @param context - The build context.\n * @param _ - The command input.\n * @returns The default command options.\n */\nexport function getDefaultOptions(\n context: CLIPresetContext,\n _: CommandBase\n): CommandOption[] {\n return [\n ...getDefaultOptionsBase(),\n context.config.interactive !== \"never\" &&\n context.config.interactive !== true && {\n name: \"interactive\",\n title: \"Interactive\",\n description:\n \"Enable interactive mode - will be set to false if running in a CI pipeline.\",\n alias: [\"i\", \"interact\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: context.config.interactive !== false\n },\n context.config.interactive !== \"never\" &&\n context.config.interactive !== false && {\n name: \"non-interactive\",\n title: \"Non-Interactive\",\n description:\n \"Disable interactive mode - will be set to true if running in a CI pipeline.\",\n alias: [\"no-interactive\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n isNegativeOf: \"interactive\"\n }\n ].filter(Boolean) as CommandOption[];\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAAgBA,oBACd,SACA,GACiB;AACjB,QAAO;EACL,GAAGC,mBAAuB;EAC1B,QAAQ,OAAO,gBAAgB,WAC7B,QAAQ,OAAO,gBAAgB,QAAQ;GACrC,MAAM;GACN,OAAO;GACP,aACE;GACF,OAAO,CAAC,KAAK,WAAW;GACxB,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS,QAAQ,OAAO,gBAAgB;GACzC;EACH,QAAQ,OAAO,gBAAgB,WAC7B,QAAQ,OAAO,gBAAgB,SAAS;GACtC,MAAM;GACN,OAAO;GACP,aACE;GACF,OAAO,CAAC,iBAAiB;GACzB,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACT,cAAc;GACf;EACJ,CAAC,OAAO,QAAQ"}
package/dist/index.cjs CHANGED
@@ -1,22 +1,24 @@
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_command_router = require('./components/command-router.cjs');
5
6
  const require_components_virtual_command_entry = require('./components/virtual-command-entry.cjs');
6
7
  const require_components_command_entry = require('./components/command-entry.cjs');
8
+ const require_components_upgrade_builtin = require('./components/upgrade-builtin.cjs');
7
9
  const require_get_default_options = require('./helpers/get-default-options.cjs');
8
- let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
9
- let __alloy_js_core = require("@alloy-js/core");
10
- let __alloy_js_typescript = require("@alloy-js/typescript");
11
- let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
12
- let __shell_shock_plugin_console = require("@shell-shock/plugin-console");
13
- __shell_shock_plugin_console = require_rolldown_runtime.__toESM(__shell_shock_plugin_console);
14
- let __shell_shock_plugin_prompts = require("@shell-shock/plugin-prompts");
15
- __shell_shock_plugin_prompts = require_rolldown_runtime.__toESM(__shell_shock_plugin_prompts);
16
- let __shell_shock_plugin_upgrade = require("@shell-shock/plugin-upgrade");
17
- __shell_shock_plugin_upgrade = require_rolldown_runtime.__toESM(__shell_shock_plugin_upgrade);
18
- let __shell_shock_preset_script_components_bin_entry = require("@shell-shock/preset-script/components/bin-entry");
19
- let __shell_shock_preset_script_components_help = require("@shell-shock/preset-script/components/help");
10
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
11
+ let _alloy_js_core = require("@alloy-js/core");
12
+ let _alloy_js_typescript = require("@alloy-js/typescript");
13
+ let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
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_runtime.__toESM(_shell_shock_plugin_console);
17
+ let _shell_shock_plugin_prompts = require("@shell-shock/plugin-prompts");
18
+ _shell_shock_plugin_prompts = require_runtime.__toESM(_shell_shock_plugin_prompts);
19
+ let _shell_shock_plugin_upgrade = require("@shell-shock/plugin-upgrade");
20
+ _shell_shock_plugin_upgrade = require_runtime.__toESM(_shell_shock_plugin_upgrade);
21
+ let _shell_shock_preset_script_components_bin_entry = require("@shell-shock/preset-script/components/bin-entry");
20
22
 
21
23
  //#region src/index.tsx
22
24
  /**
@@ -27,9 +29,10 @@ let __shell_shock_preset_script_components_help = require("@shell-shock/preset-s
27
29
  */
28
30
  const plugin = (options = {}) => {
29
31
  return [
30
- (0, __shell_shock_plugin_console.default)(options),
31
- (0, __shell_shock_plugin_prompts.default)(options),
32
- options.upgrade !== false && (0, __shell_shock_plugin_upgrade.default)(options.upgrade),
32
+ ...(0, _shell_shock_plugin_console.default)(options),
33
+ ...require_index.plugin(options),
34
+ ...(0, _shell_shock_plugin_prompts.default)(options),
35
+ (0, _shell_shock_plugin_upgrade.default)(options),
33
36
  {
34
37
  name: "shell-shock:cli-preset",
35
38
  config() {
@@ -39,6 +42,13 @@ const plugin = (options = {}) => {
39
42
  isCaseSensitive: false,
40
43
  ...options
41
44
  };
45
+ },
46
+ prepare: {
47
+ order: "post",
48
+ async handler() {
49
+ this.debug("Rendering upgrade built-in module.");
50
+ return (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_upgrade_builtin.UpgradeBuiltin, {}));
51
+ }
42
52
  }
43
53
  },
44
54
  {
@@ -48,7 +58,7 @@ const plugin = (options = {}) => {
48
58
  async handler() {
49
59
  const _self$ = this;
50
60
  this.debug("Rendering entrypoint modules for the Shell Shock `cli` preset.");
51
- return (0, __powerlines_plugin_alloy_render.render)(this, [(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_bin_entry.BinEntry, {
61
+ return (0, _powerlines_plugin_alloy_render.render)(this, [(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_preset_script_components_bin_entry.BinEntry, {
52
62
  builtinImports: {
53
63
  console: [
54
64
  "info",
@@ -61,11 +71,7 @@ const plugin = (options = {}) => {
61
71
  "stripAnsi",
62
72
  "writeLine",
63
73
  "splitText",
64
- "colors",
65
- "writeLine",
66
- "splitText",
67
- "stripAnsi",
68
- "createSpinner"
74
+ "colors"
69
75
  ],
70
76
  utils: [
71
77
  "useApp",
@@ -80,82 +86,64 @@ const plugin = (options = {}) => {
80
86
  "toggle",
81
87
  "select",
82
88
  "confirm",
83
- "waitForKeyPress",
84
- "isCancel",
85
- "sleep"
89
+ "isCancel"
86
90
  ],
87
- upgrade: [
88
- "checkForUpdates",
89
- "isCheckForUpdatesRequired",
90
- "upgrade"
91
- ],
92
- env: ["env", "paths"]
91
+ env: ["env", "paths"],
92
+ upgrade: ["executeUpgrade"]
93
93
  },
94
94
  get prefix() {
95
- return [
96
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, {}),
97
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
98
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
99
- ];
95
+ 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, {})];
100
96
  },
101
97
  get children() {
102
98
  return [
103
- (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
99
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
104
100
  get when() {
105
101
  return Object.keys(_self$.commands).length > 0;
106
102
  },
107
103
  get children() {
108
104
  return [
109
- (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
105
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
110
106
  "let": true,
111
107
  name: "args",
112
108
  type: "string[]",
113
- initializer: __alloy_js_core.code`useArgs();`
109
+ initializer: _alloy_js_core.code`useArgs();`
114
110
  }),
115
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
116
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
111
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
112
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
117
113
  segments: [],
118
114
  get commands() {
119
115
  return _self$.commands ?? {};
120
116
  }
121
117
  }),
122
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
118
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
123
119
  ];
124
120
  }
125
121
  }),
126
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
127
- __alloy_js_core.code`await banner(0, false);`,
128
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
129
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
130
- (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_help.VirtualHelp, {
131
- get options() {
132
- return _self$.options;
133
- },
134
- get commands() {
135
- return _self$.commands ?? {};
136
- }
137
- })
122
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
123
+ _alloy_js_core.code`await banner(0);`,
124
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
125
+ _alloy_js_core.code`return showHelp(); `
138
126
  ];
139
127
  }
140
- }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
128
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
141
129
  get when() {
142
130
  return Object.values(_self$.commands).length > 0;
143
131
  },
144
132
  get children() {
145
- return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
133
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
146
134
  get each() {
147
135
  return Object.values(_self$.commands);
148
136
  },
149
137
  doubleHardline: true,
150
- children: (child) => (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
138
+ children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
151
139
  get when() {
152
140
  return child.isVirtual;
153
141
  },
154
142
  get fallback() {
155
- return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
143
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
156
144
  },
157
145
  get children() {
158
- return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_virtual_command_entry.VirtualCommandEntry, { command: child });
146
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_virtual_command_entry.VirtualCommandEntry, { command: child });
159
147
  }
160
148
  })
161
149
  });
@@ -166,8 +154,7 @@ const plugin = (options = {}) => {
166
154
  }
167
155
  ];
168
156
  };
169
- var src_default = plugin;
170
157
 
171
158
  //#endregion
172
- exports.default = src_default;
159
+ exports.default = plugin;
173
160
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -2,7 +2,6 @@ import { CLIPresetContext, CLIPresetOptions } 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 CLI Preset plugin.
8
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;;;;AAuHc,cAvHD,MAuHC,EAAA,CAAA,iBAvH0B,gBAuH1B,GAvH6C,gBAuH7C,CAAA,CAAA,OAAA,CAAA,EAtHH,gBAsHG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;;;;cAAa,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -2,7 +2,6 @@ import { CLIPresetContext, CLIPresetOptions } 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 CLI Preset plugin.
8
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;;;;AAuHc,cAvHD,MAuHC,EAAA,CAAA,iBAvH0B,gBAuH1B,GAvH6C,gBAuH7C,CAAA,CAAA,OAAA,CAAA,EAtHH,gBAsHG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;;;;cAAa,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,17 +1,19 @@
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 { CommandRouter } from "./components/command-router.mjs";
3
4
  import { VirtualCommandEntry } from "./components/virtual-command-entry.mjs";
4
5
  import { CommandEntry } from "./components/command-entry.mjs";
6
+ import { UpgradeBuiltin } from "./components/upgrade-builtin.mjs";
5
7
  import { getDefaultOptions } from "./helpers/get-default-options.mjs";
6
8
  import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
7
9
  import { For, Show, code } from "@alloy-js/core";
8
10
  import { VarDeclaration } from "@alloy-js/typescript";
11
+ import { Spacing } from "@powerlines/plugin-alloy/core/components";
9
12
  import { render } from "@powerlines/plugin-alloy/render";
10
13
  import console from "@shell-shock/plugin-console";
11
14
  import prompts from "@shell-shock/plugin-prompts";
12
15
  import upgrade from "@shell-shock/plugin-upgrade";
13
16
  import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
14
- import { VirtualHelp } from "@shell-shock/preset-script/components/help";
15
17
 
16
18
  //#region src/index.tsx
17
19
  /**
@@ -22,9 +24,10 @@ import { VirtualHelp } from "@shell-shock/preset-script/components/help";
22
24
  */
23
25
  const plugin = (options = {}) => {
24
26
  return [
25
- console(options),
26
- prompts(options),
27
- options.upgrade !== false && upgrade(options.upgrade),
27
+ ...console(options),
28
+ ...plugin$1(options),
29
+ ...prompts(options),
30
+ upgrade(options),
28
31
  {
29
32
  name: "shell-shock:cli-preset",
30
33
  config() {
@@ -34,6 +37,13 @@ const plugin = (options = {}) => {
34
37
  isCaseSensitive: false,
35
38
  ...options
36
39
  };
40
+ },
41
+ prepare: {
42
+ order: "post",
43
+ async handler() {
44
+ this.debug("Rendering upgrade built-in module.");
45
+ return render(this, createComponent(UpgradeBuiltin, {}));
46
+ }
37
47
  }
38
48
  },
39
49
  {
@@ -56,11 +66,7 @@ const plugin = (options = {}) => {
56
66
  "stripAnsi",
57
67
  "writeLine",
58
68
  "splitText",
59
- "colors",
60
- "writeLine",
61
- "splitText",
62
- "stripAnsi",
63
- "createSpinner"
69
+ "colors"
64
70
  ],
65
71
  utils: [
66
72
  "useApp",
@@ -75,23 +81,13 @@ const plugin = (options = {}) => {
75
81
  "toggle",
76
82
  "select",
77
83
  "confirm",
78
- "waitForKeyPress",
79
- "isCancel",
80
- "sleep"
81
- ],
82
- upgrade: [
83
- "checkForUpdates",
84
- "isCheckForUpdatesRequired",
85
- "upgrade"
84
+ "isCancel"
86
85
  ],
87
- env: ["env", "paths"]
86
+ env: ["env", "paths"],
87
+ upgrade: ["executeUpgrade"]
88
88
  },
89
89
  get prefix() {
90
- return [
91
- createComponent(BannerFunctionDeclaration, {}),
92
- createIntrinsic("hbr", {}),
93
- createIntrinsic("hbr", {})
94
- ];
90
+ return [createComponent(BannerFunctionDeclaration, {}), createComponent(Spacing, {})];
95
91
  },
96
92
  get children() {
97
93
  return [
@@ -119,17 +115,9 @@ const plugin = (options = {}) => {
119
115
  }
120
116
  }),
121
117
  createIntrinsic("hbr", {}),
122
- code`await banner(0, false);`,
123
- createIntrinsic("hbr", {}),
124
- createIntrinsic("hbr", {}),
125
- createComponent(VirtualHelp, {
126
- get options() {
127
- return _self$.options;
128
- },
129
- get commands() {
130
- return _self$.commands ?? {};
131
- }
132
- })
118
+ code`await banner(0);`,
119
+ createComponent(Spacing, {}),
120
+ code`return showHelp(); `
133
121
  ];
134
122
  }
135
123
  }), createComponent(Show, {
@@ -161,8 +149,7 @@ const plugin = (options = {}) => {
161
149
  }
162
150
  ];
163
151
  };
164
- var src_default = plugin;
165
152
 
166
153
  //#endregion
167
- export { src_default as default, plugin };
154
+ export { plugin as default, plugin };
168
155
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","console","prompts","upgrade","BinEntry","VirtualHelp","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","prepare","order","handler","_self$","_$createComponent","builtinImports","utils","env","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 prompts from \"@shell-shock/plugin-prompts\";\nimport upgrade from \"@shell-shock/plugin-upgrade\";\nimport { BinEntry } from \"@shell-shock/preset-script/components/bin-entry\";\nimport { VirtualHelp } from \"@shell-shock/preset-script/components/help\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerFunctionDeclaration } from \"./components/banner-function-declaration\";\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 { CLIPresetContext, CLIPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock CLI Preset plugin.\n *\n * @remarks\n * This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `upgrade` plugin to manage upgrading the local application's version.\n */\nexport const plugin = <TContext extends CLIPresetContext = CLIPresetContext>(\n options: CLIPresetOptions = {}\n) => {\n return [\n console(options),\n prompts(options),\n options.upgrade !== false && upgrade(options.upgrade),\n {\n name: \"shell-shock:cli-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `cli` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n }\n },\n {\n name: \"shell-shock:cli-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"info\",\n \"debug\",\n \"warn\",\n \"help\",\n \"error\",\n \"cursor\",\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\",\n \"createSpinner\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"waitForKeyPress\",\n \"isCancel\",\n \"sleep\"\n ],\n upgrade: [\n \"checkForUpdates\",\n \"isCheckForUpdatesRequired\",\n \"upgrade\"\n ],\n env: [\"env\", \"paths\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n let\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 {code`await banner(0, false);`}\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":";;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAae,UACXC,UAA4B,EAAE,KAC3B;AACH,QAAO;EACLX,QAAQW,QAAQ;EAChBV,QAAQU,QAAQ;EAChBA,QAAQT,YAAY,SAASA,QAAQS,QAAQT,QAAQ;EACrD;GACEU,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,oEACD;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,iEACD;AAED,YAAOf,OACL,MAAI,CAAAsB,gBAEDlB,UAAQ;MACPmB,gBAAgB;OACdtB,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACD;OACDuB,OAAO;QACL;QACA;QACA;QACA;QACA;QACD;OACDtB,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACD;OACDC,SAAS;QACP;QACA;QACA;QACD;OACDsB,KAAK,CAAC,OAAO,QAAO;OACrB;MAAA,IACDC,SAAM;AAAA,cAAA;QAAAJ,gBAEDhB,2BAAyB,EAAA,CAAA;QAAAqB,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAA;;MAAA,IAAAC,WAAA;AAAA,cAAA;QAAAN,gBAK7BxB,MAAI;SAAA,IAAC+B,OAAI;AAAA,iBAAEC,OAAOC,KAAKV,OAAKW,SAAS,CAACC,SAAS;;SAAC,IAAAL,WAAA;AAAA,iBAAA;WAAAN,gBAC9CvB,gBAAc;YAAA,OAAA;YAEbc,MAAI;YACJqB,MAAI;YACJC,aAAavC,IAAI;YAAY,CAAA;WAAA+B,gBAAA,OAAA,EAAA,CAAA;WAAAL,gBAG9Bd,eAAa;YAAC4B,UAAU,EAAE;YAAA,IAAEJ,WAAQ;AAAA,oBAAEX,OAAKW,YAAY,EAAE;;YAAA,CAAA;WAAAL,gBAAA,OAAA,EAAA,CAAA;WAAA;;SAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAI3D/B,IAAI;QAAyB+B,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAAL,gBAG7BjB,aAAW;SAAA,IACVO,UAAO;AAAA,iBAAES,OAAKT;;SAAO,IACrBoB,WAAQ;AAAA,iBAAEX,OAAKW,YAAY,EAAE;;SAAA,CAAA;QAAA;;MAAA,CAAA,EAAAV,gBAGhCxB,MAAI;MAAA,IAAC+B,OAAI;AAAA,cAAEC,OAAOO,OAAOhB,OAAKW,SAAS,CAACC,SAAS;;MAAC,IAAAL,WAAA;AAAA,cAAAN,gBAChDzB,KAAG;QAAA,IAACyC,OAAI;AAAA,gBAAER,OAAOO,OAAOhB,OAAKW,SAAS;;QAAEO,gBAAc;QAAAX,WACpDY,UAAKlB,gBACHxB,MAAI;SAAA,IACH+B,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,iBAAApB,gBAAGf,cAAY,EAACoC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,iBAAAN,gBACrCb,qBAAmB,EAACkC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAe7B"}
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 prompts from \"@shell-shock/plugin-prompts\";\nimport upgrade from \"@shell-shock/plugin-upgrade\";\nimport { BinEntry } from \"@shell-shock/preset-script/components/bin-entry\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerFunctionDeclaration } from \"./components/banner-function-declaration\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { UpgradeBuiltin } from \"./components/upgrade-builtin\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { CLIPresetContext, CLIPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock CLI Preset plugin.\n *\n * @remarks\n * This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `upgrade` plugin to manage upgrading the local application's version.\n */\nexport const plugin = <TContext extends CLIPresetContext = CLIPresetContext>(\n options: CLIPresetOptions = {}\n): Plugin<TContext>[] => {\n return [\n ...console<TContext>(options),\n ...help<TContext>(options),\n ...prompts<TContext>(options),\n upgrade<TContext>(options),\n {\n name: \"shell-shock:cli-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `cli` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n },\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\"Rendering upgrade built-in module.\");\n\n return render(this, <UpgradeBuiltin />);\n }\n }\n },\n {\n name: \"shell-shock:cli-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"info\",\n \"debug\",\n \"warn\",\n \"help\",\n \"error\",\n \"cursor\",\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"isCancel\"\n ],\n env: [\"env\", \"paths\"],\n upgrade: [\"executeUpgrade\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <Spacing />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n let\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 {code`await banner(0);`}\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 ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAW,UAAoB,UAAA,EAAA,KAAA;AAC7B,QAAO;EAAC,GAAA,QAAe,QAAA;EAAA,GAAA,SAAA,QAAA;EAAA,GAAA,QAAA,QAAA;EAAA,QAAA,QAAA;EAAA;GACvB,MAAO;GACL,SAAG;AACD,SAAK,MAAC,oEAAkB;AACxB,WAAC;KACH,gBAAkB;KAClB,iBAAA;KACE,GAAK;KACL;;GAEF,SAAO;IACL,OAAG;;AAED,UAAA,MAAO,qCAAA;AACP,YAAE,OAAA,MAAgB,gBAAiB,gBAAA,EAAA,CAAA,CAAA;;IAEtC;GACF;EAAE;GACD,MAAG;GACH,SAAS;IACP,OAAO;IACP,MAAE,UAAc;KACd,MAAM,SAAQ;;AAEd,YAAE,OAAO,MAAW,CAAC,gBAAkB,UAAE;MACzC,gBAAA;OACF,SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACD,OAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACD,SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACQ,KAAC,CAAK,OAAO,QAAI;OACvB,SAAS,CAAA,iBAAA;OACP;MACA,IAAM,SAAS;AACb,cAAK,CAAK,gBAAA,2BAAA,EAAA,CAAA,EAAA,gBAAA,SAAA,EAAA,CAAA,CAAA;;MAEV,IAAC,WAAA;;;SAED,IAAO,OAAM;AACP,iBAAA,OAAA,KAAA,OAAA,SAAA,CAAA,SAAA;;SAEF,IAAC,WAAA;AACC,iBAAA;WAAA,gBAAgB,gBAAA;YACd,OAAO;YACP,MAAG;YACH,MAAG;YACH,aAAQ,IAAA;YACT,CAAC;WAAE,gBAAM,OAAA,EAAA,CAAA;WAAA,gBAAA,eAAA;YACR,UAAS,EAAA;YACT,IAAG,WAAO;AACR,oBAAC,OAAQ,YAAA,EAAA;;YAEZ,CAAC;WAAE,gBAAW,OAAA,EAAA,CAAA;WAAA;;SAElB,CAAC;QAAE,gBAAW,OAAA,EAAA,CAAA;QAAA,IAAA;QAAA,gBAAA,SAAA,EAAA,CAAA;QAAA,IAAA;QAAA;;MAElB,CAAC,EAAE,gBAAa,MAAA;MACf,IAAI,OAAO;AACT,cAAO,OAAE,OAAQ,OAAA,SAAA,CAAA,SAAA;;MAEnB,IAAI,WAAO;AACT,cAAO,gBAAQ,KAAA;QACb,IAAI,OAAC;AACH,gBAAE,OAAS,OAAA,OAAA,SAAA;;QAEb,gBAAe;QACf,WAAO,UAAO,gBAAA,MAAA;SACZ,IAAI,OAAO;AACT,iBAAG,MAAQ;;SAEb,IAAG,WAAA;AACD,iBAAO,gBAAc,cAAA,EACrB,SAAW,OACZ,CAAA;;SAED,IAAG,WAAA;AACD,iBAAG,gBAAA,qBAA2B,EAC5B,SAAS,OACV,CAAC;;SAEL,CAAC;QACH,CAAC;;MAEL,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}