@shell-shock/preset-script 0.6.61 → 0.6.63

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 (39) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -29
  3. package/dist/components/bin-entry.cjs +3 -149
  4. package/dist/components/bin-entry.d.cts.map +1 -1
  5. package/dist/components/bin-entry.d.mts.map +1 -1
  6. package/dist/components/bin-entry.mjs +3 -144
  7. package/dist/components/bin-entry.mjs.map +1 -1
  8. package/dist/components/command-entry.cjs +3 -203
  9. package/dist/components/command-entry.mjs +3 -197
  10. package/dist/components/command-entry.mjs.map +1 -1
  11. package/dist/components/command-router.cjs +2 -161
  12. package/dist/components/command-router.mjs +2 -156
  13. package/dist/components/command-router.mjs.map +1 -1
  14. package/dist/components/exit-function-declaration.cjs +6 -114
  15. package/dist/components/exit-function-declaration.mjs +6 -111
  16. package/dist/components/exit-function-declaration.mjs.map +1 -1
  17. package/dist/components/index.cjs +1 -18
  18. package/dist/components/index.mjs +1 -7
  19. package/dist/components/virtual-command-entry.cjs +1 -154
  20. package/dist/components/virtual-command-entry.mjs +1 -149
  21. package/dist/components/virtual-command-entry.mjs.map +1 -1
  22. package/dist/helpers/get-global-options.cjs +1 -76
  23. package/dist/helpers/get-global-options.mjs +1 -73
  24. package/dist/helpers/get-global-options.mjs.map +1 -1
  25. package/dist/index.cjs +1 -127
  26. package/dist/index.d.cts.map +1 -1
  27. package/dist/index.d.mts.map +1 -1
  28. package/dist/index.mjs +1 -120
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/types/index.mjs +1 -1
  31. package/dist/types/plugin.mjs +1 -1
  32. package/package.json +15 -19
  33. package/dist/components/bin-entry.cjs.map +0 -1
  34. package/dist/components/command-entry.cjs.map +0 -1
  35. package/dist/components/command-router.cjs.map +0 -1
  36. package/dist/components/exit-function-declaration.cjs.map +0 -1
  37. package/dist/components/virtual-command-entry.cjs.map +0 -1
  38. package/dist/helpers/get-global-options.cjs.map +0 -1
  39. package/dist/index.cjs.map +0 -1
@@ -1,204 +1,4 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_components_virtual_command_entry = require('./virtual-command-entry.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 _alloy_js_typescript = require("@alloy-js/typescript");
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 _powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
10
- let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
11
- let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
12
- let _stryke_path_replace = require("@stryke/path/replace");
13
- let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
14
- let defu = require("defu");
15
- defu = require_runtime.__toESM(defu);
16
- let _shell_shock_core_components_helpers = require("@shell-shock/core/components/helpers");
17
- let _shell_shock_core_components_command_validation_logic = require("@shell-shock/core/components/command-validation-logic");
18
- let _shell_shock_core_components_options_parser_logic = require("@shell-shock/core/components/options-parser-logic");
19
- let _stryke_path_find = require("@stryke/path/find");
20
- let _stryke_path_join = require("@stryke/path/join");
21
- let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
22
- let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
23
- let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
24
-
25
- //#region src/components/command-entry.tsx
26
- function CommandInvocation(props) {
27
- const { command } = props;
28
- return [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code` return withCommand("${command.path}", [${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? (0, _stryke_string_format_camel_case.camelCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment)) : `"${segment}"`).join(", ")}], [${Object.keys(command.options).length > 0 ? `options` : ""}${command.args.length > 0 ? `${Object.keys(command.options).length > 0 ? ", " : ""}${command.args.map((arg) => (0, _stryke_string_format_camel_case.camelCase)(arg.name)).join(", ")}` : ""}], handle${(0, _stryke_string_format_pascal_case.pascalCase)(command.name)}); `), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
29
- }
30
- /**
31
- * A component that generates the `handler` function declaration for a command.
32
- */
33
- function CommandHandlerDeclaration(props) {
34
- const { command, banner, children } = props;
35
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
36
- return [
37
- (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_options_parser_logic.OptionsInterfaceDeclaration, { command }),
38
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
39
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
40
- get heading() {
41
- return `The ${command.title} (${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_constant_case.constantCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment).join(" ")}) command.`;
42
- },
43
- get children() {
44
- return [
45
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { get children() {
46
- return `${command.description.replace(/\.+$/, "")}.`;
47
- } }),
48
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
49
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocTitle, { get children() {
50
- return command.title;
51
- } }),
52
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
53
- name: "args",
54
- children: `The command-line arguments passed to the command.`
55
- })
56
- ];
57
- }
58
- }),
59
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
60
- "export": true,
61
- async: true,
62
- name: "handler",
63
- parameters: [{
64
- name: "args",
65
- type: "string[]",
66
- default: "useArgs()"
67
- }],
68
- get children() {
69
- return [
70
- (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_options_parser_logic.CommandParserLogic, {
71
- command,
72
- get appSpecificEnvPrefix() {
73
- return context.config.appSpecificEnvPrefix;
74
- },
75
- get isCaseSensitive() {
76
- return context.config.isCaseSensitive;
77
- }
78
- }),
79
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
80
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
81
- get when() {
82
- return Boolean(banner);
83
- },
84
- children: banner
85
- }),
86
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
87
- _alloy_js_core.code`writeLine("");`,
88
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
89
- get condition() {
90
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_helpers.IsDebug, {});
91
- },
92
- get children() {
93
- return _alloy_js_core.code`writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`./virtual-command-entry.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core`),i=require(`@alloy-js/typescript`),a=require(`@powerlines/plugin-alloy/core/components/spacing`),o=require(`@powerlines/plugin-alloy/core/contexts/context`),s=require(`@powerlines/plugin-alloy/typescript/components/entry-file`),c=require(`@powerlines/plugin-alloy/typescript/components/tsdoc`),l=require(`@shell-shock/core/plugin-utils`),u=require(`@stryke/path/replace`),d=require(`@stryke/string-format/pascal-case`),f=require(`defu`);f=e.__toESM(f);let p=require(`@shell-shock/core/components/helpers`),m=require(`@shell-shock/core/components/command-validation-logic`),h=require(`@shell-shock/core/components/options-parser-logic`),g=require(`@stryke/path/find`),_=require(`@stryke/path/join`),v=require(`@stryke/string-format/camel-case`),y=require(`@stryke/string-format/constant-case`),b=require(`@stryke/string-format/kebab-case`);function x(e){let{command:t}=e;return[(0,n.memo)(()=>r.code` return withCommand("${t.path}", [${t.segments.map(e=>(0,l.isDynamicPathSegment)(e)?(0,v.camelCase)((0,l.getDynamicPathSegmentName)(e)):`"${e}"`).join(`, `)}], [${Object.keys(t.options).length>0?`options`:``}${t.args.length>0?`${Object.keys(t.options).length>0?`, `:``}${t.args.map(e=>(0,v.camelCase)(e.name)).join(`, `)}`:``}], handle${(0,d.pascalCase)(t.name)}); `),(0,n.createIntrinsic)(`hbr`,{})]}function S(e){let{command:t,banner:s,children:u}=e,d=(0,o.usePowerlines)();return[(0,n.createComponent)(h.OptionsInterfaceDeclaration,{command:t}),(0,n.createComponent)(a.Spacing,{}),(0,n.createComponent)(c.TSDoc,{get heading(){return`The ${t.title} (${(0,l.getAppBin)(d)} ${t.segments.map(e=>(0,l.isDynamicPathSegment)(e)?`[${(0,y.constantCase)((0,l.getDynamicPathSegmentName)(e))}]`:e).join(` `)}) command.`},get children(){return[(0,n.createComponent)(c.TSDocRemarks,{get children(){return`${t.description.replace(/\.+$/,``)}.`}}),(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(c.TSDocTitle,{get children(){return t.title}}),(0,n.createComponent)(c.TSDocParam,{name:`args`,children:`The command-line arguments passed to the command.`})]}}),(0,n.createComponent)(i.FunctionDeclaration,{export:!0,async:!0,name:`handler`,parameters:[{name:`args`,type:`string[]`,default:`useArgs()`}],get children(){return[(0,n.createComponent)(h.CommandParserLogic,{command:t,get appSpecificEnvPrefix(){return d.config.appSpecificEnvPrefix},get isCaseSensitive(){return d.config.isCaseSensitive}}),(0,n.createComponent)(a.Spacing,{}),(0,n.createComponent)(r.Show,{get when(){return!!s},children:s}),(0,n.createComponent)(a.Spacing,{}),r.code`writeLine("");`,(0,n.createComponent)(i.IfStatement,{get condition(){return(0,n.createComponent)(p.IsDebug,{})},get children(){return r.code`writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
94
2
  writeLine("");
95
- debug(\`Command path: ${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `\${${(0, _stryke_string_format_camel_case.camelCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}}` : segment).join(" / ")} \\n\\nOptions: \\n${Object.values(command.options).map((option) => ` - ${(0, _stryke_string_format_kebab_case.kebabCase)(option.name)}: \${options.${(0, _stryke_string_format_camel_case.camelCase)(option.name)} === undefined ? "" : JSON.stringify(options.${(0, _stryke_string_format_camel_case.camelCase)(option.name)})}`).join("\\n")}${command.args.length > 0 ? ` \\n\\nArguments: \\n${command.args.map((arg) => ` - ${(0, _stryke_string_format_kebab_case.kebabCase)(arg.name)}: \${${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} === undefined ? "" : JSON.stringify(${(0, _stryke_string_format_camel_case.camelCase)(arg.name)})}`).join("\\n")}` : ""}\`); `;
96
- }
97
- }),
98
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
99
- children,
100
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
101
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
102
- condition: _alloy_js_core.code`options.help`,
103
- children: _alloy_js_core.code`return showHelp(); `
104
- }),
105
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
106
- return [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, _alloy_js_core_jsx_runtime.createComponent)(CommandInvocation, { command })];
107
- } })
108
- ];
109
- }
110
- })
111
- ];
112
- }
113
- /**
114
- * The command entry point for the Shell Shock project.
115
- */
116
- function CommandEntry(props) {
117
- const { command, imports, builtinImports, ...rest } = props;
118
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
119
- const filePath = (0, _alloy_js_core.computed)(() => (0, _stryke_path_join.joinPaths)(command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
120
- const commandSourcePath = (0, _alloy_js_core.computed)(() => (0, _stryke_path_replace.replaceExtension)((0, _stryke_path_find.relativePath)((0, _stryke_path_join.joinPaths)(context.entryPath, (0, _stryke_path_find.findFilePath)(filePath.value)), command.entry.input?.file || command.entry.file)));
121
- const typeDefinition = (0, _alloy_js_core.computed)(() => ({
122
- ...command.entry,
123
- output: command.id
124
- }));
125
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_entry_file.EntryFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
126
- get path() {
127
- return filePath.value;
128
- },
129
- get typeDefinition() {
130
- return typeDefinition.value;
131
- },
132
- get imports() {
133
- return (0, defu.default)(imports ?? {}, { [commandSourcePath.value.startsWith(".") ? commandSourcePath.value : `./${commandSourcePath.value}`]: `handle${(0, _stryke_string_format_pascal_case.pascalCase)(command.name)}` });
134
- },
135
- get builtinImports() {
136
- return (0, defu.default)(builtinImports ?? {}, {
137
- env: [
138
- "env",
139
- "isDevelopment",
140
- "isDebug"
141
- ],
142
- console: [
143
- "debug",
144
- "warn",
145
- "error",
146
- "writeLine",
147
- "textColors"
148
- ],
149
- utils: ["isMinimal", "isUnicodeSupported"],
150
- state: [
151
- "useGlobal",
152
- "GlobalOptions",
153
- "useGlobalOptions",
154
- "useArgs",
155
- "hasFlag",
156
- "withCommand"
157
- ],
158
- [(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"],
159
- [(0, _stryke_path_join.joinPaths)("banner", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showBanner"]
160
- });
161
- },
162
- get children() {
163
- return [
164
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
165
- (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_options_parser_logic.OptionsInterfaceDeclaration, { command }),
166
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
167
- (0, _alloy_js_core_jsx_runtime.createComponent)(CommandHandlerDeclaration, {
168
- command,
169
- banner: _alloy_js_core.code`await showBanner(); `,
170
- get children() {
171
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_command_validation_logic.CommandValidationLogic, { command }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
172
- condition: _alloy_js_core.code`failures.length > 0`,
173
- get children() {
174
- return _alloy_js_core.code`error(\`The following validation failures were found while processing the user provided input, and must be corrected before the \${italic("${command.title}")} command can be executed: \\n\\n\${failures.map(failure => " - " + failure).join("\\n")}\`);
175
- options.help = true; `;
176
- }
177
- })];
178
- }
179
- })
180
- ];
181
- }
182
- })), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
183
- get each() {
184
- return Object.values(command.children);
185
- },
186
- children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
187
- get when() {
188
- return child.isVirtual;
189
- },
190
- get fallback() {
191
- return (0, _alloy_js_core_jsx_runtime.createComponent)(CommandEntry, { command: child });
192
- },
193
- get children() {
194
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_virtual_command_entry.VirtualCommandEntry, { command: child });
195
- }
196
- })
197
- })];
198
- }
199
-
200
- //#endregion
201
- exports.CommandEntry = CommandEntry;
202
- exports.CommandHandlerDeclaration = CommandHandlerDeclaration;
203
- exports.CommandInvocation = CommandInvocation;
204
- //# sourceMappingURL=command-entry.cjs.map
3
+ debug(\`Command path: ${t.segments.map(e=>(0,l.isDynamicPathSegment)(e)?`\${${(0,v.camelCase)((0,l.getDynamicPathSegmentName)(e))}}`:e).join(` / `)} \\n\\nOptions: \\n${Object.values(t.options).map(e=>` - ${(0,b.kebabCase)(e.name)}: \${options.${(0,v.camelCase)(e.name)} === undefined ? "" : JSON.stringify(options.${(0,v.camelCase)(e.name)})}`).join(`\\n`)}${t.args.length>0?` \\n\\nArguments: \\n${t.args.map(e=>` - ${(0,b.kebabCase)(e.name)}: \${${(0,v.camelCase)(e.name)} === undefined ? "" : JSON.stringify(${(0,v.camelCase)(e.name)})}`).join(`\\n`)}`:``}\`); `}}),(0,n.createComponent)(a.Spacing,{}),u,(0,n.createComponent)(a.Spacing,{}),(0,n.createComponent)(i.IfStatement,{condition:r.code`options.help`,children:r.code`return showHelp(); `}),(0,n.createComponent)(i.ElseClause,{get children(){return[(0,n.createIntrinsic)(`hbr`,{}),(0,n.createComponent)(x,{command:t})]}})]}})]}function C(e){let{command:c,imports:p,builtinImports:v,...y}=e,b=(0,o.usePowerlines)(),x=(0,r.computed)(()=>(0,_.joinPaths)(c.segments.filter(e=>!(0,l.isDynamicPathSegment)(e)).join(`/`),`index.ts`)),w=(0,r.computed)(()=>(0,u.replaceExtension)((0,g.relativePath)((0,_.joinPaths)(b.entryPath,(0,g.findFilePath)(x.value)),c.entry.input?.file||c.entry.file))),T=(0,r.computed)(()=>({...c.entry,output:c.id}));return[(0,n.createComponent)(s.EntryFile,(0,n.mergeProps)(y,{get path(){return x.value},get typeDefinition(){return T.value},get imports(){return(0,f.default)(p??{},{[w.value.startsWith(`.`)?w.value:`./${w.value}`]:`handle${(0,d.pascalCase)(c.name)}`})},get builtinImports(){return(0,f.default)(v??{},{env:[`env`,`isDevelopment`,`isDebug`],console:[`debug`,`warn`,`error`,`writeLine`,`textColors`],utils:[`isMinimal`,`isUnicodeSupported`],state:[{name:`GlobalOptions`,type:!0},`useGlobal`,`useGlobalOptions`,`useArgs`,`hasFlag`,`withCommand`],[(0,_.joinPaths)(`help`,...c.segments.filter(e=>!(0,l.isDynamicPathSegment)(e)))]:[`showHelp`],[(0,_.joinPaths)(`banner`,...c.segments.filter(e=>!(0,l.isDynamicPathSegment)(e)))]:[`showBanner`]})},get children(){return[(0,n.createComponent)(a.Spacing,{}),(0,n.createComponent)(h.OptionsInterfaceDeclaration,{command:c}),(0,n.createComponent)(a.Spacing,{}),(0,n.createComponent)(S,{command:c,banner:r.code`await showBanner(); `,get children(){return[(0,n.createComponent)(m.CommandValidationLogic,{command:c}),(0,n.createComponent)(i.IfStatement,{condition:r.code`failures.length > 0`,get children(){return r.code`error(\`The following validation failures were found while processing the user provided input, and must be corrected before the \${italic("${c.title}")} command can be executed: \\n\\n\${failures.map(failure => " - " + failure).join("\\n")}\`);
4
+ options.help = true; `}})]}})]}})),(0,n.createComponent)(r.For,{get each(){return Object.values(c.children)},children:e=>(0,n.createComponent)(r.Show,{get when(){return e.isVirtual},get fallback(){return(0,n.createComponent)(C,{command:e})},get children(){return(0,n.createComponent)(t.VirtualCommandEntry,{command:e})}})})]}exports.CommandEntry=C,exports.CommandHandlerDeclaration=S,exports.CommandInvocation=x;
@@ -1,199 +1,5 @@
1
- import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
2
- import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
- import { For, Show, code, computed } from "@alloy-js/core";
4
- import { ElseClause, FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
5
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
6
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
- import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
8
- import { TSDoc, TSDocParam, TSDocRemarks, TSDocTitle } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
9
- import { getAppBin, getDynamicPathSegmentName, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
10
- import { replaceExtension } from "@stryke/path/replace";
11
- import { pascalCase } from "@stryke/string-format/pascal-case";
12
- import defu from "defu";
13
- import { IsDebug } from "@shell-shock/core/components/helpers";
14
- import { CommandValidationLogic } from "@shell-shock/core/components/command-validation-logic";
15
- import { CommandParserLogic, OptionsInterfaceDeclaration } from "@shell-shock/core/components/options-parser-logic";
16
- import { findFilePath, relativePath } from "@stryke/path/find";
17
- import { joinPaths } from "@stryke/path/join";
18
- import { camelCase } from "@stryke/string-format/camel-case";
19
- import { constantCase } from "@stryke/string-format/constant-case";
20
- import { kebabCase } from "@stryke/string-format/kebab-case";
21
-
22
- //#region src/components/command-entry.tsx
23
- function CommandInvocation(props) {
24
- const { command } = props;
25
- return [memo(() => code` return withCommand("${command.path}", [${command.segments.map((segment) => isDynamicPathSegment(segment) ? camelCase(getDynamicPathSegmentName(segment)) : `"${segment}"`).join(", ")}], [${Object.keys(command.options).length > 0 ? `options` : ""}${command.args.length > 0 ? `${Object.keys(command.options).length > 0 ? ", " : ""}${command.args.map((arg) => camelCase(arg.name)).join(", ")}` : ""}], handle${pascalCase(command.name)}); `), createIntrinsic("hbr", {})];
26
- }
27
- /**
28
- * A component that generates the `handler` function declaration for a command.
29
- */
30
- function CommandHandlerDeclaration(props) {
31
- const { command, banner, children } = props;
32
- const context = usePowerlines();
33
- return [
34
- createComponent(OptionsInterfaceDeclaration, { command }),
35
- createComponent(Spacing, {}),
36
- createComponent(TSDoc, {
37
- get heading() {
38
- return `The ${command.title} (${getAppBin(context)} ${command.segments.map((segment) => isDynamicPathSegment(segment) ? `[${constantCase(getDynamicPathSegmentName(segment))}]` : segment).join(" ")}) command.`;
39
- },
40
- get children() {
41
- return [
42
- createComponent(TSDocRemarks, { get children() {
43
- return `${command.description.replace(/\.+$/, "")}.`;
44
- } }),
45
- createIntrinsic("hbr", {}),
46
- createComponent(TSDocTitle, { get children() {
47
- return command.title;
48
- } }),
49
- createComponent(TSDocParam, {
50
- name: "args",
51
- children: `The command-line arguments passed to the command.`
52
- })
53
- ];
54
- }
55
- }),
56
- createComponent(FunctionDeclaration, {
57
- "export": true,
58
- async: true,
59
- name: "handler",
60
- parameters: [{
61
- name: "args",
62
- type: "string[]",
63
- default: "useArgs()"
64
- }],
65
- get children() {
66
- return [
67
- createComponent(CommandParserLogic, {
68
- command,
69
- get appSpecificEnvPrefix() {
70
- return context.config.appSpecificEnvPrefix;
71
- },
72
- get isCaseSensitive() {
73
- return context.config.isCaseSensitive;
74
- }
75
- }),
76
- createComponent(Spacing, {}),
77
- createComponent(Show, {
78
- get when() {
79
- return Boolean(banner);
80
- },
81
- children: banner
82
- }),
83
- createComponent(Spacing, {}),
84
- code`writeLine("");`,
85
- createComponent(IfStatement, {
86
- get condition() {
87
- return createComponent(IsDebug, {});
88
- },
89
- get children() {
90
- return code`writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
1
+ import{VirtualCommandEntry as e}from"./virtual-command-entry.mjs";import{createComponent as t,createIntrinsic as n,memo as r,mergeProps as i}from"@alloy-js/core/jsx-runtime";import{For as a,Show as o,code as s,computed as c}from"@alloy-js/core";import{ElseClause as l,FunctionDeclaration as u,IfStatement as d}from"@alloy-js/typescript";import{Spacing as f}from"@powerlines/plugin-alloy/core/components/spacing";import{usePowerlines as p}from"@powerlines/plugin-alloy/core/contexts/context";import{EntryFile as m}from"@powerlines/plugin-alloy/typescript/components/entry-file";import{TSDoc as h,TSDocParam as g,TSDocRemarks as _,TSDocTitle as v}from"@powerlines/plugin-alloy/typescript/components/tsdoc";import{getAppBin as y,getDynamicPathSegmentName as b,isDynamicPathSegment as x}from"@shell-shock/core/plugin-utils";import{replaceExtension as S}from"@stryke/path/replace";import{pascalCase as C}from"@stryke/string-format/pascal-case";import w from"defu";import{IsDebug as T}from"@shell-shock/core/components/helpers";import{CommandValidationLogic as E}from"@shell-shock/core/components/command-validation-logic";import{CommandParserLogic as D,OptionsInterfaceDeclaration as O}from"@shell-shock/core/components/options-parser-logic";import{findFilePath as k,relativePath as A}from"@stryke/path/find";import{joinPaths as j}from"@stryke/path/join";import{camelCase as M}from"@stryke/string-format/camel-case";import{constantCase as N}from"@stryke/string-format/constant-case";import{kebabCase as P}from"@stryke/string-format/kebab-case";function F(e){let{command:t}=e;return[r(()=>s` return withCommand("${t.path}", [${t.segments.map(e=>x(e)?M(b(e)):`"${e}"`).join(`, `)}], [${Object.keys(t.options).length>0?`options`:``}${t.args.length>0?`${Object.keys(t.options).length>0?`, `:``}${t.args.map(e=>M(e.name)).join(`, `)}`:``}], handle${C(t.name)}); `),n(`hbr`,{})]}function I(e){let{command:r,banner:i,children:a}=e,c=p();return[t(O,{command:r}),t(f,{}),t(h,{get heading(){return`The ${r.title} (${y(c)} ${r.segments.map(e=>x(e)?`[${N(b(e))}]`:e).join(` `)}) command.`},get children(){return[t(_,{get children(){return`${r.description.replace(/\.+$/,``)}.`}}),n(`hbr`,{}),t(v,{get children(){return r.title}}),t(g,{name:`args`,children:`The command-line arguments passed to the command.`})]}}),t(u,{export:!0,async:!0,name:`handler`,parameters:[{name:`args`,type:`string[]`,default:`useArgs()`}],get children(){return[t(D,{command:r,get appSpecificEnvPrefix(){return c.config.appSpecificEnvPrefix},get isCaseSensitive(){return c.config.isCaseSensitive}}),t(f,{}),t(o,{get when(){return!!i},children:i}),t(f,{}),s`writeLine("");`,t(d,{get condition(){return t(T,{})},get children(){return s`writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
91
2
  writeLine("");
92
- debug(\`Command path: ${command.segments.map((segment) => isDynamicPathSegment(segment) ? `\${${camelCase(getDynamicPathSegmentName(segment))}}` : segment).join(" / ")} \\n\\nOptions: \\n${Object.values(command.options).map((option) => ` - ${kebabCase(option.name)}: \${options.${camelCase(option.name)} === undefined ? "" : JSON.stringify(options.${camelCase(option.name)})}`).join("\\n")}${command.args.length > 0 ? ` \\n\\nArguments: \\n${command.args.map((arg) => ` - ${kebabCase(arg.name)}: \${${camelCase(arg.name)} === undefined ? "" : JSON.stringify(${camelCase(arg.name)})}`).join("\\n")}` : ""}\`); `;
93
- }
94
- }),
95
- createComponent(Spacing, {}),
96
- children,
97
- createComponent(Spacing, {}),
98
- createComponent(IfStatement, {
99
- condition: code`options.help`,
100
- children: code`return showHelp(); `
101
- }),
102
- createComponent(ElseClause, { get children() {
103
- return [createIntrinsic("hbr", {}), createComponent(CommandInvocation, { command })];
104
- } })
105
- ];
106
- }
107
- })
108
- ];
109
- }
110
- /**
111
- * The command entry point for the Shell Shock project.
112
- */
113
- function CommandEntry(props) {
114
- const { command, imports, builtinImports, ...rest } = props;
115
- const context = usePowerlines();
116
- const filePath = computed(() => joinPaths(command.segments.filter((segment) => !isDynamicPathSegment(segment)).join("/"), "index.ts"));
117
- const commandSourcePath = computed(() => replaceExtension(relativePath(joinPaths(context.entryPath, findFilePath(filePath.value)), command.entry.input?.file || command.entry.file)));
118
- const typeDefinition = computed(() => ({
119
- ...command.entry,
120
- output: command.id
121
- }));
122
- return [createComponent(EntryFile, mergeProps(rest, {
123
- get path() {
124
- return filePath.value;
125
- },
126
- get typeDefinition() {
127
- return typeDefinition.value;
128
- },
129
- get imports() {
130
- return defu(imports ?? {}, { [commandSourcePath.value.startsWith(".") ? commandSourcePath.value : `./${commandSourcePath.value}`]: `handle${pascalCase(command.name)}` });
131
- },
132
- get builtinImports() {
133
- return defu(builtinImports ?? {}, {
134
- env: [
135
- "env",
136
- "isDevelopment",
137
- "isDebug"
138
- ],
139
- console: [
140
- "debug",
141
- "warn",
142
- "error",
143
- "writeLine",
144
- "textColors"
145
- ],
146
- utils: ["isMinimal", "isUnicodeSupported"],
147
- state: [
148
- "useGlobal",
149
- "GlobalOptions",
150
- "useGlobalOptions",
151
- "useArgs",
152
- "hasFlag",
153
- "withCommand"
154
- ],
155
- [joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showHelp"],
156
- [joinPaths("banner", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showBanner"]
157
- });
158
- },
159
- get children() {
160
- return [
161
- createComponent(Spacing, {}),
162
- createComponent(OptionsInterfaceDeclaration, { command }),
163
- createComponent(Spacing, {}),
164
- createComponent(CommandHandlerDeclaration, {
165
- command,
166
- banner: code`await showBanner(); `,
167
- get children() {
168
- return [createComponent(CommandValidationLogic, { command }), createComponent(IfStatement, {
169
- condition: code`failures.length > 0`,
170
- get children() {
171
- return code`error(\`The following validation failures were found while processing the user provided input, and must be corrected before the \${italic("${command.title}")} command can be executed: \\n\\n\${failures.map(failure => " - " + failure).join("\\n")}\`);
172
- options.help = true; `;
173
- }
174
- })];
175
- }
176
- })
177
- ];
178
- }
179
- })), createComponent(For, {
180
- get each() {
181
- return Object.values(command.children);
182
- },
183
- children: (child) => createComponent(Show, {
184
- get when() {
185
- return child.isVirtual;
186
- },
187
- get fallback() {
188
- return createComponent(CommandEntry, { command: child });
189
- },
190
- get children() {
191
- return createComponent(VirtualCommandEntry, { command: child });
192
- }
193
- })
194
- })];
195
- }
196
-
197
- //#endregion
198
- export { CommandEntry, CommandHandlerDeclaration, CommandInvocation };
3
+ debug(\`Command path: ${r.segments.map(e=>x(e)?`\${${M(b(e))}}`:e).join(` / `)} \\n\\nOptions: \\n${Object.values(r.options).map(e=>` - ${P(e.name)}: \${options.${M(e.name)} === undefined ? "" : JSON.stringify(options.${M(e.name)})}`).join(`\\n`)}${r.args.length>0?` \\n\\nArguments: \\n${r.args.map(e=>` - ${P(e.name)}: \${${M(e.name)} === undefined ? "" : JSON.stringify(${M(e.name)})}`).join(`\\n`)}`:``}\`); `}}),t(f,{}),a,t(f,{}),t(d,{condition:s`options.help`,children:s`return showHelp(); `}),t(l,{get children(){return[n(`hbr`,{}),t(F,{command:r})]}})]}})]}function L(n){let{command:r,imports:l,builtinImports:u,...h}=n,g=p(),_=c(()=>j(r.segments.filter(e=>!x(e)).join(`/`),`index.ts`)),v=c(()=>S(A(j(g.entryPath,k(_.value)),r.entry.input?.file||r.entry.file))),y=c(()=>({...r.entry,output:r.id}));return[t(m,i(h,{get path(){return _.value},get typeDefinition(){return y.value},get imports(){return w(l??{},{[v.value.startsWith(`.`)?v.value:`./${v.value}`]:`handle${C(r.name)}`})},get builtinImports(){return w(u??{},{env:[`env`,`isDevelopment`,`isDebug`],console:[`debug`,`warn`,`error`,`writeLine`,`textColors`],utils:[`isMinimal`,`isUnicodeSupported`],state:[{name:`GlobalOptions`,type:!0},`useGlobal`,`useGlobalOptions`,`useArgs`,`hasFlag`,`withCommand`],[j(`help`,...r.segments.filter(e=>!x(e)))]:[`showHelp`],[j(`banner`,...r.segments.filter(e=>!x(e)))]:[`showBanner`]})},get children(){return[t(f,{}),t(O,{command:r}),t(f,{}),t(I,{command:r,banner:s`await showBanner(); `,get children(){return[t(E,{command:r}),t(d,{condition:s`failures.length > 0`,get children(){return s`error(\`The following validation failures were found while processing the user provided input, and must be corrected before the \${italic("${r.title}")} command can be executed: \\n\\n\${failures.map(failure => " - " + failure).join("\\n")}\`);
4
+ options.help = true; `}})]}})]}})),t(a,{get each(){return Object.values(r.children)},children:n=>t(o,{get when(){return n.isVirtual},get fallback(){return t(L,{command:n})},get children(){return t(e,{command:n})}})})]}export{L as CommandEntry,I as CommandHandlerDeclaration,F as CommandInvocation};
199
5
  //# sourceMappingURL=command-entry.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.mjs","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { CommandValidationLogic } from \"@shell-shock/core/components/command-validation-logic\";\nimport { IsDebug } from \"@shell-shock/core/components/helpers\";\nimport {\n CommandParserLogic,\n OptionsInterfaceDeclaration\n} from \"@shell-shock/core/components/options-parser-logic\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport function CommandInvocation(props: { command: CommandTree }) {\n const { command } = props;\n\n return (\n <>\n {code` return withCommand(\"${command.path}\", [${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? camelCase(getDynamicPathSegmentName(segment))\n : `\"${segment}\"`\n )\n .join(\", \")}], [${\n Object.keys(command.options).length > 0 ? `options` : \"\"\n }${\n command.args.length > 0\n ? `${\n Object.keys(command.options).length > 0 ? \", \" : \"\"\n }${command.args.map(arg => camelCase(arg.name)).join(\", \")}`\n : \"\"\n }], handle${pascalCase(command.name)}); `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function CommandHandlerDeclaration(\n props: CommandHandlerDeclarationProps\n) {\n const { command, banner, children } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <CommandParserLogic\n command={command}\n appSpecificEnvPrefix={context.config.appSpecificEnvPrefix}\n isCaseSensitive={context.config.isCaseSensitive}\n />\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`writeLine(\"\");`}\n <IfStatement condition={<IsDebug />}>\n {code`writeLine(textColors.body.tertiary(\"Debug mode is enabled. Additional debug information may be logged to the console.\"));\n writeLine(\"\");\n debug(\\`Command path: ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `\\${${camelCase(getDynamicPathSegmentName(segment))}}`\n : segment\n )\n .join(\" / \")} \\\\n\\\\nOptions: \\\\n${Object.values(command.options)\n .map(\n option =>\n ` - ${kebabCase(option.name)}: \\${options.${camelCase(\n option.name\n )} === undefined ? \"\" : JSON.stringify(options.${camelCase(\n option.name\n )})}`\n )\n .join(\"\\\\n\")}${\n command.args.length > 0\n ? ` \\\\n\\\\nArguments: \\\\n${command.args\n .map(\n arg =>\n ` - ${kebabCase(arg.name)}: \\${${camelCase(\n arg.name\n )} === undefined ? \"\" : JSON.stringify(${camelCase(\n arg.name\n )})}`\n )\n .join(\"\\\\n\")}`\n : \"\"\n }\\`); `}\n </IfStatement>\n <Spacing />\n {children}\n <Spacing />\n <IfStatement condition={code`options.help`}>\n {code`return showHelp(); `}\n </IfStatement>\n <ElseClause>\n <hbr />\n <CommandInvocation command={command} />\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value.startsWith(\".\")\n ? commandSourcePath.value\n : `./${commandSourcePath.value}`]:\n `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\"debug\", \"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\"],\n state: [\n \"useGlobal\",\n \"GlobalOptions\",\n \"useGlobalOptions\",\n \"useArgs\",\n \"hasFlag\",\n \"withCommand\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"],\n [joinPaths(\n \"banner\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showBanner\"]\n })}>\n <Spacing />\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await showBanner(); `}>\n <CommandValidationLogic command={command} />\n <IfStatement condition={code`failures.length > 0`}>\n {code`error(\\`The following validation failures were found while processing the user provided input, and must be corrected before the \\${italic(\"${\n command.title\n }\")} command can be executed: \\\\n\\\\n\\${failures.map(failure => \" - \" + failure).join(\"\\\\n\")}\\`);\n options.help = true; `}\n </IfStatement>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAO,kBAAA,OAEL;CACA,MAAA,EACA,YACI;AACN,QAAS,CAAA,WAAY,IAAM,wBAAkB,QAAA,KAAA,MAAA,QAAA,SAAA,KAAA,YAAA,qBAAA,QAAA,GAAA,UAAA,0BAAA,QAAA,CAAA,GAAA,IAAA,QAAA,GAAA,CAAA,KAAA,KAAA,CAAA,MAAA,OAAA,KAAA,QAAA,QAAA,CAAA,SAAA,IAAA,YAAA,KAAA,QAAA,KAAA,SAAA,IAAA,GAAA,OAAA,KAAA,QAAA,QAAA,CAAA,SAAA,IAAA,OAAA,KAAA,QAAA,KAAA,KAAA,QAAA,UAAA,IA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Y,cAAA,EACV,SAAU,OACV,CAAA;;GAEJ,IAAA,WAAA;AACD,WAAA,gBAAA,qBAAA,EACK,SAAA,OACD,CAAA;;GAEF,CAAA"}
1
+ {"version":3,"file":"command-entry.mjs","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { CommandValidationLogic } from \"@shell-shock/core/components/command-validation-logic\";\nimport { IsDebug } from \"@shell-shock/core/components/helpers\";\nimport {\n CommandParserLogic,\n OptionsInterfaceDeclaration\n} from \"@shell-shock/core/components/options-parser-logic\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport function CommandInvocation(props: { command: CommandTree }) {\n const { command } = props;\n\n return (\n <>\n {code` return withCommand(\"${command.path}\", [${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? camelCase(getDynamicPathSegmentName(segment))\n : `\"${segment}\"`\n )\n .join(\", \")}], [${\n Object.keys(command.options).length > 0 ? `options` : \"\"\n }${\n command.args.length > 0\n ? `${\n Object.keys(command.options).length > 0 ? \", \" : \"\"\n }${command.args.map(arg => camelCase(arg.name)).join(\", \")}`\n : \"\"\n }], handle${pascalCase(command.name)}); `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function CommandHandlerDeclaration(\n props: CommandHandlerDeclarationProps\n) {\n const { command, banner, children } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <CommandParserLogic\n command={command}\n appSpecificEnvPrefix={context.config.appSpecificEnvPrefix}\n isCaseSensitive={context.config.isCaseSensitive}\n />\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`writeLine(\"\");`}\n <IfStatement condition={<IsDebug />}>\n {code`writeLine(textColors.body.tertiary(\"Debug mode is enabled. Additional debug information may be logged to the console.\"));\n writeLine(\"\");\n debug(\\`Command path: ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `\\${${camelCase(getDynamicPathSegmentName(segment))}}`\n : segment\n )\n .join(\" / \")} \\\\n\\\\nOptions: \\\\n${Object.values(command.options)\n .map(\n option =>\n ` - ${kebabCase(option.name)}: \\${options.${camelCase(\n option.name\n )} === undefined ? \"\" : JSON.stringify(options.${camelCase(\n option.name\n )})}`\n )\n .join(\"\\\\n\")}${\n command.args.length > 0\n ? ` \\\\n\\\\nArguments: \\\\n${command.args\n .map(\n arg =>\n ` - ${kebabCase(arg.name)}: \\${${camelCase(\n arg.name\n )} === undefined ? \"\" : JSON.stringify(${camelCase(\n arg.name\n )})}`\n )\n .join(\"\\\\n\")}`\n : \"\"\n }\\`); `}\n </IfStatement>\n <Spacing />\n {children}\n <Spacing />\n <IfStatement condition={code`options.help`}>\n {code`return showHelp(); `}\n </IfStatement>\n <ElseClause>\n <hbr />\n <CommandInvocation command={command} />\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value.startsWith(\".\")\n ? commandSourcePath.value\n : `./${commandSourcePath.value}`]:\n `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\"debug\", \"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\"],\n state: [\n { name: \"GlobalOptions\", type: true },\n \"useGlobal\",\n \"useGlobalOptions\",\n \"useArgs\",\n \"hasFlag\",\n \"withCommand\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"],\n [joinPaths(\n \"banner\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showBanner\"]\n })}>\n <Spacing />\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await showBanner(); `}>\n <CommandValidationLogic command={command} />\n <IfStatement condition={code`failures.length > 0`}>\n {code`error(\\`The following validation failures were found while processing the user provided input, and must be corrected before the \\${italic(\"${\n command.title\n }\")} command can be executed: \\\\n\\\\n\\${failures.map(failure => \" - \" + failure).join(\"\\\\n\")}\\`);\n options.help = true; `}\n </IfStatement>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":"mgDAsCA,SAAO,EAAA,EAAA,CACL,GAAA,CACA,WACI,EACN,MAAO,CAAA,MAAA,CAAA,wBAA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