@shell-shock/preset-script 0.6.62 → 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.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/components/bin-entry.cjs +3 -149
- package/dist/components/bin-entry.d.cts.map +1 -1
- package/dist/components/bin-entry.d.mts.map +1 -1
- package/dist/components/bin-entry.mjs +3 -144
- package/dist/components/bin-entry.mjs.map +1 -1
- package/dist/components/command-entry.cjs +3 -203
- package/dist/components/command-entry.mjs +3 -197
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +2 -161
- package/dist/components/command-router.mjs +2 -156
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/exit-function-declaration.cjs +6 -114
- package/dist/components/exit-function-declaration.mjs +6 -111
- package/dist/components/exit-function-declaration.mjs.map +1 -1
- package/dist/components/index.cjs +1 -18
- package/dist/components/index.mjs +1 -7
- package/dist/components/virtual-command-entry.cjs +1 -154
- package/dist/components/virtual-command-entry.mjs +1 -149
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/helpers/get-global-options.cjs +1 -76
- package/dist/helpers/get-global-options.mjs +1 -73
- package/dist/helpers/get-global-options.mjs.map +1 -1
- package/dist/index.cjs +1 -127
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -120
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +15 -19
- package/dist/components/bin-entry.cjs.map +0 -1
- package/dist/components/command-entry.cjs.map +0 -1
- package/dist/components/command-router.cjs.map +0 -1
- package/dist/components/exit-function-declaration.cjs.map +0 -1
- package/dist/components/virtual-command-entry.cjs.map +0 -1
- package/dist/helpers/get-global-options.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
|
@@ -1,150 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CommandEntry } from "./command-entry.mjs";
|
|
3
|
-
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
|
-
import { For, Show, code, computed } from "@alloy-js/core";
|
|
5
|
-
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
6
|
-
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
7
|
-
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
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 { pascalCase } from "@stryke/string-format/pascal-case";
|
|
11
|
-
import defu from "defu";
|
|
12
|
-
import { joinPaths } from "@stryke/path/join";
|
|
13
|
-
import { constantCase } from "@stryke/string-format/constant-case";
|
|
14
|
-
import { TypescriptFile } from "@powerlines/plugin-alloy/typescript/components/typescript-file";
|
|
15
|
-
|
|
16
|
-
//#region src/components/virtual-command-entry.tsx
|
|
17
|
-
/**
|
|
18
|
-
* A component that generates the `handler` function declaration for a command.
|
|
19
|
-
*/
|
|
20
|
-
function VirtualCommandHandlerDeclaration(props) {
|
|
21
|
-
const { command, children, banner } = props;
|
|
22
|
-
const context = usePowerlines();
|
|
23
|
-
return [createComponent(TSDoc, {
|
|
24
|
-
get heading() {
|
|
25
|
-
return `The ${command.title} (${getAppBin(context)} ${command.segments.map((segment) => isDynamicPathSegment(segment) ? `[${constantCase(getDynamicPathSegmentName(segment))}]` : segment).join(" ")}) virtual command.`;
|
|
26
|
-
},
|
|
27
|
-
get children() {
|
|
28
|
-
return [
|
|
29
|
-
createComponent(TSDocRemarks, { get children() {
|
|
30
|
-
return `${command.description.replace(/\.+$/, "")}.`;
|
|
31
|
-
} }),
|
|
32
|
-
createIntrinsic("hbr", {}),
|
|
33
|
-
createComponent(TSDocTitle, { get children() {
|
|
34
|
-
return command.title;
|
|
35
|
-
} }),
|
|
36
|
-
createComponent(TSDocParam, {
|
|
37
|
-
name: "args",
|
|
38
|
-
children: `The command-line arguments passed to the command.`
|
|
39
|
-
})
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
}), createComponent(FunctionDeclaration, {
|
|
43
|
-
"export": true,
|
|
44
|
-
async: true,
|
|
45
|
-
name: "handler",
|
|
46
|
-
parameters: [{
|
|
47
|
-
name: "args",
|
|
48
|
-
type: "string[]",
|
|
49
|
-
default: "useArgs()"
|
|
50
|
-
}],
|
|
51
|
-
get children() {
|
|
52
|
-
return [
|
|
53
|
-
createComponent(Spacing, {}),
|
|
54
|
-
children,
|
|
55
|
-
createComponent(Spacing, {}),
|
|
56
|
-
createComponent(Show, {
|
|
57
|
-
get when() {
|
|
58
|
-
return Boolean(banner);
|
|
59
|
-
},
|
|
60
|
-
children: banner
|
|
61
|
-
}),
|
|
62
|
-
createComponent(Spacing, {}),
|
|
63
|
-
code`return showHelp(); `
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
})];
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* The virtual command entry point for the Shell Shock project.
|
|
70
|
-
*/
|
|
71
|
-
function VirtualCommandEntry(props) {
|
|
72
|
-
const { command, imports, builtinImports, ...rest } = props;
|
|
73
|
-
const context = usePowerlines();
|
|
74
|
-
const filePath = computed(() => joinPaths(context.entryPath, command.segments.filter((segment) => !isDynamicPathSegment(segment)).join("/"), "index.ts"));
|
|
75
|
-
return [createComponent(TypescriptFile, mergeProps(rest, {
|
|
76
|
-
get path() {
|
|
77
|
-
return filePath.value;
|
|
78
|
-
},
|
|
79
|
-
get imports() {
|
|
80
|
-
return defu(imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
|
|
81
|
-
ret[`./${child.name}`] = [{
|
|
82
|
-
name: "handler",
|
|
83
|
-
alias: `handle${pascalCase(name)}`
|
|
84
|
-
}];
|
|
85
|
-
return ret;
|
|
86
|
-
}, {}));
|
|
87
|
-
},
|
|
88
|
-
get builtinImports() {
|
|
89
|
-
return defu(builtinImports ?? {}, {
|
|
90
|
-
env: ["isDevelopment", "isDebug"],
|
|
91
|
-
console: [
|
|
92
|
-
"warn",
|
|
93
|
-
"error",
|
|
94
|
-
"writeLine",
|
|
95
|
-
"textColors"
|
|
96
|
-
],
|
|
97
|
-
utils: [
|
|
98
|
-
"isMinimal",
|
|
99
|
-
"isUnicodeSupported",
|
|
100
|
-
"findSuggestions"
|
|
101
|
-
],
|
|
102
|
-
state: [
|
|
103
|
-
"useGlobal",
|
|
104
|
-
"GlobalOptions",
|
|
105
|
-
"useGlobalOptions",
|
|
106
|
-
"withCommand",
|
|
107
|
-
"useArgs",
|
|
108
|
-
"hasFlag"
|
|
109
|
-
],
|
|
110
|
-
[joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showHelp"],
|
|
111
|
-
[joinPaths("banner", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showBanner"]
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
get children() {
|
|
115
|
-
return [createComponent(Spacing, {}), createComponent(VirtualCommandHandlerDeclaration, {
|
|
116
|
-
command,
|
|
117
|
-
banner: code`await showBanner(); `,
|
|
118
|
-
get children() {
|
|
119
|
-
return createComponent(CommandRouter, {
|
|
120
|
-
get segments() {
|
|
121
|
-
return command.segments;
|
|
122
|
-
},
|
|
123
|
-
get commands() {
|
|
124
|
-
return command.children;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
})];
|
|
129
|
-
}
|
|
130
|
-
})), createComponent(For, {
|
|
131
|
-
get each() {
|
|
132
|
-
return Object.values(command.children);
|
|
133
|
-
},
|
|
134
|
-
children: (child) => createComponent(Show, {
|
|
135
|
-
get when() {
|
|
136
|
-
return child.isVirtual;
|
|
137
|
-
},
|
|
138
|
-
get fallback() {
|
|
139
|
-
return createComponent(CommandEntry, { command: child });
|
|
140
|
-
},
|
|
141
|
-
get children() {
|
|
142
|
-
return createComponent(VirtualCommandEntry, { command: child });
|
|
143
|
-
}
|
|
144
|
-
})
|
|
145
|
-
})];
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
//#endregion
|
|
149
|
-
export { VirtualCommandEntry, VirtualCommandHandlerDeclaration };
|
|
1
|
+
import{CommandRouter as e}from"./command-router.mjs";import{CommandEntry as t}from"./command-entry.mjs";import{createComponent as n,createIntrinsic 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{FunctionDeclaration as l}from"@alloy-js/typescript";import{Spacing as u}from"@powerlines/plugin-alloy/core/components";import{usePowerlines as d}from"@powerlines/plugin-alloy/core/contexts/context";import{TSDoc as f,TSDocParam as p,TSDocRemarks as m,TSDocTitle as h}from"@powerlines/plugin-alloy/typescript/components/tsdoc";import{getAppBin as g,getDynamicPathSegmentName as _,isDynamicPathSegment as v}from"@shell-shock/core/plugin-utils";import{pascalCase as y}from"@stryke/string-format/pascal-case";import b from"defu";import{joinPaths as x}from"@stryke/path/join";import{constantCase as S}from"@stryke/string-format/constant-case";import{TypescriptFile as C}from"@powerlines/plugin-alloy/typescript/components/typescript-file";function w(e){let{command:t,children:i,banner:a}=e,c=d();return[n(f,{get heading(){return`The ${t.title} (${g(c)} ${t.segments.map(e=>v(e)?`[${S(_(e))}]`:e).join(` `)}) virtual command.`},get children(){return[n(m,{get children(){return`${t.description.replace(/\.+$/,``)}.`}}),r(`hbr`,{}),n(h,{get children(){return t.title}}),n(p,{name:`args`,children:`The command-line arguments passed to the command.`})]}}),n(l,{export:!0,async:!0,name:`handler`,parameters:[{name:`args`,type:`string[]`,default:`useArgs()`}],get children(){return[n(u,{}),i,n(u,{}),n(o,{get when(){return!!a},children:a}),n(u,{}),s`return showHelp(); `]}})]}function T(r){let{command:l,imports:f,builtinImports:p,...m}=r,h=d(),g=c(()=>x(h.entryPath,l.segments.filter(e=>!v(e)).join(`/`),`index.ts`));return[n(C,i(m,{get path(){return g.value},get imports(){return b(f??{},Object.entries(l.children).filter(([,e])=>e.isVirtual).reduce((e,[t,n])=>(e[`./${n.name}`]=[{name:`handler`,alias:`handle${y(t)}`}],e),{}))},get builtinImports(){return b(p??{},{env:[`isDevelopment`,`isDebug`],console:[`warn`,`error`,`writeLine`,`textColors`],utils:[`isMinimal`,`isUnicodeSupported`,`findSuggestions`],state:[{name:`GlobalOptions`,type:!0},`useGlobal`,`useGlobalOptions`,`withCommand`,`useArgs`,`hasFlag`],[x(`help`,...l.segments.filter(e=>!v(e)))]:[`showHelp`],[x(`banner`,...l.segments.filter(e=>!v(e)))]:[`showBanner`]})},get children(){return[n(u,{}),n(w,{command:l,banner:s`await showBanner(); `,get children(){return n(e,{get segments(){return l.segments},get commands(){return l.children}})}})]}})),n(a,{get each(){return Object.values(l.children)},children:e=>n(o,{get when(){return e.isVirtual},get fallback(){return n(t,{command:e})},get children(){return n(T,{command:e})}})})]}export{T as VirtualCommandEntry,w as VirtualCommandHandlerDeclaration};
|
|
150
2
|
//# sourceMappingURL=virtual-command-entry.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.mjs","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <Spacing />\n {children}\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`return showHelp(); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\", \"findSuggestions\"],\n state: [\n \"
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.mjs","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <Spacing />\n {children}\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`return showHelp(); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\", \"findSuggestions\"],\n state: [\n { name: \"GlobalOptions\", type: true },\n \"useGlobal\",\n \"useGlobalOptions\",\n \"withCommand\",\n \"useArgs\",\n \"hasFlag\"\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 <VirtualCommandHandlerDeclaration\n command={command}\n banner={code`await showBanner(); `}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":"q/BAmCA,SAAE,EAAA,EAAA,CACA,GAAM,CACR,UACA,WACA,UACM,EACC,EAAW,GAAK,CACvB,MAAO,CAAA,EAAO,EAAqB,CACnC,IAAQ,SAAC,CACH,MAAG,OAAA,EAAgB,MAAQ,IAAA,EAAe,EAAA,CAAA,GAAA,EAAA,SAAA,IAAA,GAAA,EAAA,EAAA,CAAA,IAAA,EAAA,EAAA,EAAA,CAAA,CAAA,GAAA,EAAA,CAAA,KAAA,IAAA,CAAA,qBAEhD,IAAO,UAAU,CACf,MAAS,CAAA,EAAW,EAAA,CACd,IAAG,UAAQ,CACT,MAAG,GAAA,EAAQ,YAAA,QAAA,OAAA,GAAA,CAAA,uBAGnB,IAAA,UAAA,CACG,OAAU,EAAK,OAEb,CAAA,CAAA,EAAS,EAAA,CACR,KAAC,OACP,SAAA,oDACK,CAAC,CAAC,EAEP,CAAA,CAAA,EAAgB,EAAc,WAE9B,MAAO,GACL,KAAC,UACD,WAAG,CAAA,CACD,KAAE,OACF,KAAK,WACL,QAAM,YACP,CAAC,CACF,IAAI,UAAQ,CACV,MAAI,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACF,IAAG,MAAQ,CACV,MAAA,EAAgB,GAEjB,SAAC,EACF,CAAC,CAAC,EAAiB,EAAW,EAAC,CAAA,CAAA,CAAQ,sBAAsB,EAEjE,CAAC,CAAC,CAKL,SAAgB,EAAE,EAAA,CAChB,GAAM,CACJ,UACA,UACA,iBACA,GAAG,GACD,EACA,EAAA,GAAA,CACH,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,SAAA,OAAA,GAAA,CAAA,EAAA,EAAA,CAAA,CAAA,KAAA,IAAA,CAAA,WAAA,CAAA,CACH,MAAA,CAAA,EAAA,EAAA,EAAA,EAAA,YAEM,OAAC,EAAU,OAEd,IAAK,SAAI,CACV,OAAA,EAAA,GAAA,EAAA,CAAA,OAAA,QAAA,EAAA,SAAA,CAAA,QAAA,EAAA,KAAA,EAAA,UAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MACA,EAAS,KAAA,EAAW,QAAA,CAAA,CACtB,KAAA,gCAEE,CAAA,CACa,GACb,EAAA,CAAA,CAAA,EAEA,IAAM,gBAAW,iBAEX,IAAA,CAAA,gBAAuB,UAAC,CACxB,QAAS,CAAC,OAAC,QAAa,YAAA,aAAA,CAC5B,MAAS,CAAA,YAAA,qBAAA,kBAAA,CACP,MAAQ,CAAA,CACR,KAAQ,gBACL,KAAO,GACP,CAAA,YAAS,mBAAA,cAAA,UAAA,UAAA,EACX,EAAQ,OAAA,GAAA,EAAA,SAAA,OAAA,GAAA,CAAA,EAAA,EAAA,CAAA,CAAA,EAAA,CAAA,WAAA,EACX,EAAA,SAAA,GAAA,EAAA,SAAA,OAAA,GAAA,CAAA,EAAA,EAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CACD,CAAA,EAED,IAAM,UAAC,CACJ,MAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACE,UACC,OAAQ,CAAA,uBACR,IAAI,UAAW,CACf,OAAS,EAAI,EAAA,CACX,IAAA,UAAa,CACb,OAAO,EAAQ,UAEb,IAAC,UAAc,CACb,OAAO,EAAQ,UAElB,CAAC,EAEL,CAAC,CAAC,EAEN,CAAC,CAAC,CAAE,EAAE,EAAA,CACL,IAAI,MAAA,CACF,OAAO,OAAI,OAAA,EAAiB,SAAS,EAEvC,SAAM,GAAS,EAAa,EAAA,CAC1B,IAAI,MAAO,CACT,OAAM,EAAO,WAEf,IAAI,UAAG,CACL,OAAK,EAAY,EAAA,CACf,QAAG,EACJ,CAAC,EAEJ,IAAI,UAAU,CACZ,OAAK,EAAK,EAAA,CACR,QAAK,EACN,CAAC,EAEL,CAAC,CACH,CAAC,CAAC"}
|
|
@@ -1,76 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _shell_shock_core = require("@shell-shock/core");
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/get-global-options.ts
|
|
6
|
-
/**
|
|
7
|
-
* Get the default command options.
|
|
8
|
-
*
|
|
9
|
-
* @returns The default command options.
|
|
10
|
-
*/
|
|
11
|
-
function getGlobalOptions() {
|
|
12
|
-
return [
|
|
13
|
-
{
|
|
14
|
-
name: "help",
|
|
15
|
-
title: "Help",
|
|
16
|
-
description: "Show help information.",
|
|
17
|
-
env: false,
|
|
18
|
-
alias: ["h", "?"],
|
|
19
|
-
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
20
|
-
optional: true,
|
|
21
|
-
default: false,
|
|
22
|
-
variadic: false,
|
|
23
|
-
skipAddingNegative: true
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: "version",
|
|
27
|
-
title: "Version",
|
|
28
|
-
description: "Show the version of the application.",
|
|
29
|
-
env: false,
|
|
30
|
-
alias: ["v"],
|
|
31
|
-
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
32
|
-
optional: true,
|
|
33
|
-
default: false,
|
|
34
|
-
variadic: false,
|
|
35
|
-
skipAddingNegative: true
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "verbose",
|
|
39
|
-
title: "Verbose",
|
|
40
|
-
description: "Enable verbose output.",
|
|
41
|
-
env: "VERBOSE",
|
|
42
|
-
alias: ["V"],
|
|
43
|
-
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
44
|
-
optional: true,
|
|
45
|
-
default: false,
|
|
46
|
-
variadic: false,
|
|
47
|
-
skipAddingNegative: true
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: "color",
|
|
51
|
-
title: "Color",
|
|
52
|
-
description: "Enable colored terminal output.",
|
|
53
|
-
env: "COLOR",
|
|
54
|
-
alias: ["colors"],
|
|
55
|
-
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
56
|
-
optional: true,
|
|
57
|
-
variadic: false,
|
|
58
|
-
skipAddingNegative: false
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "no-banner",
|
|
62
|
-
title: "Hide Banner",
|
|
63
|
-
description: "Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.",
|
|
64
|
-
env: "NO_BANNER",
|
|
65
|
-
alias: ["hide-banner"],
|
|
66
|
-
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
67
|
-
optional: true,
|
|
68
|
-
variadic: false,
|
|
69
|
-
default: false
|
|
70
|
-
}
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
exports.getGlobalOptions = getGlobalOptions;
|
|
76
|
-
//# sourceMappingURL=get-global-options.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@shell-shock/core`);function t(){return[{name:`help`,title:`Help`,description:`Show help information.`,env:!1,alias:[`h`,`?`],kind:e.CommandParameterKinds.boolean,optional:!0,default:!1,variadic:!1,skipAddingNegative:!0},{name:`version`,title:`Version`,description:`Show the version of the application.`,env:!1,alias:[`v`],kind:e.CommandParameterKinds.boolean,optional:!0,default:!1,variadic:!1,skipAddingNegative:!0},{name:`verbose`,title:`Verbose`,description:`Enable verbose output.`,env:`VERBOSE`,alias:[`V`],kind:e.CommandParameterKinds.boolean,optional:!0,default:!1,variadic:!1,skipAddingNegative:!0},{name:`color`,title:`Color`,description:`Enable colored terminal output.`,env:`COLOR`,alias:[`colors`],kind:e.CommandParameterKinds.boolean,optional:!0,variadic:!1,skipAddingNegative:!1},{name:`no-banner`,title:`Hide Banner`,description:`Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.`,env:`NO_BANNER`,alias:[`hide-banner`],kind:e.CommandParameterKinds.boolean,optional:!0,variadic:!1,default:!1}]}exports.getGlobalOptions=t;
|
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/get-global-options.ts
|
|
4
|
-
/**
|
|
5
|
-
* Get the default command options.
|
|
6
|
-
*
|
|
7
|
-
* @returns The default command options.
|
|
8
|
-
*/
|
|
9
|
-
function getGlobalOptions() {
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
name: "help",
|
|
13
|
-
title: "Help",
|
|
14
|
-
description: "Show help information.",
|
|
15
|
-
env: false,
|
|
16
|
-
alias: ["h", "?"],
|
|
17
|
-
kind: CommandParameterKinds.boolean,
|
|
18
|
-
optional: true,
|
|
19
|
-
default: false,
|
|
20
|
-
variadic: false,
|
|
21
|
-
skipAddingNegative: true
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "version",
|
|
25
|
-
title: "Version",
|
|
26
|
-
description: "Show the version of the application.",
|
|
27
|
-
env: false,
|
|
28
|
-
alias: ["v"],
|
|
29
|
-
kind: CommandParameterKinds.boolean,
|
|
30
|
-
optional: true,
|
|
31
|
-
default: false,
|
|
32
|
-
variadic: false,
|
|
33
|
-
skipAddingNegative: true
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "verbose",
|
|
37
|
-
title: "Verbose",
|
|
38
|
-
description: "Enable verbose output.",
|
|
39
|
-
env: "VERBOSE",
|
|
40
|
-
alias: ["V"],
|
|
41
|
-
kind: CommandParameterKinds.boolean,
|
|
42
|
-
optional: true,
|
|
43
|
-
default: false,
|
|
44
|
-
variadic: false,
|
|
45
|
-
skipAddingNegative: true
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "color",
|
|
49
|
-
title: "Color",
|
|
50
|
-
description: "Enable colored terminal output.",
|
|
51
|
-
env: "COLOR",
|
|
52
|
-
alias: ["colors"],
|
|
53
|
-
kind: CommandParameterKinds.boolean,
|
|
54
|
-
optional: true,
|
|
55
|
-
variadic: false,
|
|
56
|
-
skipAddingNegative: false
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: "no-banner",
|
|
60
|
-
title: "Hide Banner",
|
|
61
|
-
description: "Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.",
|
|
62
|
-
env: "NO_BANNER",
|
|
63
|
-
alias: ["hide-banner"],
|
|
64
|
-
kind: CommandParameterKinds.boolean,
|
|
65
|
-
optional: true,
|
|
66
|
-
variadic: false,
|
|
67
|
-
default: false
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
export { getGlobalOptions };
|
|
1
|
+
import{CommandParameterKinds as e}from"@shell-shock/core";function t(){return[{name:`help`,title:`Help`,description:`Show help information.`,env:!1,alias:[`h`,`?`],kind:e.boolean,optional:!0,default:!1,variadic:!1,skipAddingNegative:!0},{name:`version`,title:`Version`,description:`Show the version of the application.`,env:!1,alias:[`v`],kind:e.boolean,optional:!0,default:!1,variadic:!1,skipAddingNegative:!0},{name:`verbose`,title:`Verbose`,description:`Enable verbose output.`,env:`VERBOSE`,alias:[`V`],kind:e.boolean,optional:!0,default:!1,variadic:!1,skipAddingNegative:!0},{name:`color`,title:`Color`,description:`Enable colored terminal output.`,env:`COLOR`,alias:[`colors`],kind:e.boolean,optional:!0,variadic:!1,skipAddingNegative:!1},{name:`no-banner`,title:`Hide Banner`,description:`Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.`,env:`NO_BANNER`,alias:[`hide-banner`],kind:e.boolean,optional:!0,variadic:!1,default:!1}]}export{t as getGlobalOptions};
|
|
74
2
|
//# sourceMappingURL=get-global-options.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-global-options.mjs","names":[],"sources":["../../src/helpers/get-global-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getGlobalOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n variadic: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n variadic: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n variadic: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n variadic: false,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n variadic: false,\n default: false\n }\n ];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-global-options.mjs","names":[],"sources":["../../src/helpers/get-global-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getGlobalOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n variadic: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n variadic: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n variadic: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n variadic: false,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n variadic: false,\n default: false\n }\n ];\n}\n"],"mappings":"0DAyBA,SAAE,GAAA,CACF,MAAO,CAAA,CACL,KAAO,OACL,MAAA,OACA,YAAa,yBACb,IAAE,GACF,MAAE,CAAA,IAAW,IAAG,CAChB,KAAM,EAAM,QACZ,SAAU,GACV,QAAQ,GACR,SAAU,GACV,mBAAgB,GACjB,CAAE,CACD,KAAE,UACF,MAAC,UACD,YAAA,uCACA,IAAE,GACF,MAAO,CAAC,IAAE,CACV,KAAE,EAAuB,QACzB,SAAO,GACP,QAAS,GACT,SAAQ,GACR,mBAAgB,GACjB,CAAE,CACD,KAAE,UACF,MAAE,UACF,YAAC,yBACD,IAAA,UACA,MAAO,CAAC,IAAC,CACT,KAAE,EAAgB,QAClB,SAAE,GACF,QAAQ,GACR,SAAU,GACV,mBAAQ,GACT,CAAE,CACD,KAAE,QACF,MAAE,QACF,YAAE,kCACF,IAAC,QACD,MAAA,CAAA,SAAA,CACA,KAAM,EAAS,QACf,SAAU,GACV,SAAE,GACF,mBAAc,GACf,CAAE,CACD,KAAM,YACN,MAAE,cACF,YAAY,2HACZ,IAAE,YACF,MAAC,CAAA,cAAA,CACD,KAAA,EAAA,QACA,SAAS,GACT,SAAU,GACV,QAAE,GACH,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,127 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_components_bin_entry = require('./components/bin-entry.cjs');
|
|
4
|
-
const require_components_command_router = require('./components/command-router.cjs');
|
|
5
|
-
const require_components_virtual_command_entry = require('./components/virtual-command-entry.cjs');
|
|
6
|
-
const require_components_command_entry = require('./components/command-entry.cjs');
|
|
7
|
-
const require_helpers_get_global_options = require('./helpers/get-global-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_core_components = require("@powerlines/plugin-alloy/core/components");
|
|
12
|
-
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
13
|
-
let _shell_shock_plugin_banner = require("@shell-shock/plugin-banner");
|
|
14
|
-
_shell_shock_plugin_banner = require_runtime.__toESM(_shell_shock_plugin_banner);
|
|
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_help = require("@shell-shock/plugin-help");
|
|
18
|
-
_shell_shock_plugin_help = require_runtime.__toESM(_shell_shock_plugin_help);
|
|
19
|
-
|
|
20
|
-
//#region src/index.tsx
|
|
21
|
-
/**
|
|
22
|
-
* The Shell Shock base plugin.
|
|
23
|
-
*/
|
|
24
|
-
const plugin = (options = {}) => {
|
|
25
|
-
return [
|
|
26
|
-
...(0, _shell_shock_plugin_console.default)(options),
|
|
27
|
-
...(0, _shell_shock_plugin_help.default)(options),
|
|
28
|
-
...(0, _shell_shock_plugin_banner.default)(options.banner),
|
|
29
|
-
{
|
|
30
|
-
name: "shell-shock:script-preset",
|
|
31
|
-
config() {
|
|
32
|
-
this.debug("Providing default configuration for the Shell Shock `script` preset.");
|
|
33
|
-
return {
|
|
34
|
-
globalOptions: require_helpers_get_global_options.getGlobalOptions,
|
|
35
|
-
isCaseSensitive: false,
|
|
36
|
-
...options
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "shell-shock:script-preset:generate-entrypoint",
|
|
42
|
-
prepare: {
|
|
43
|
-
order: "post",
|
|
44
|
-
async handler() {
|
|
45
|
-
const _self$ = this;
|
|
46
|
-
this.debug("Rendering entrypoint modules for the Shell Shock `script` preset.");
|
|
47
|
-
return (0, _powerlines_plugin_alloy_render.render)(this, [(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_bin_entry.BinEntry, {
|
|
48
|
-
builtinImports: {
|
|
49
|
-
console: [
|
|
50
|
-
"divider",
|
|
51
|
-
"stripAnsi",
|
|
52
|
-
"writeLine",
|
|
53
|
-
"splitText",
|
|
54
|
-
"help"
|
|
55
|
-
],
|
|
56
|
-
utils: ["isMinimal"],
|
|
57
|
-
state: [
|
|
58
|
-
"useArgs",
|
|
59
|
-
"hasFlag",
|
|
60
|
-
"isHelp"
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
get children() {
|
|
64
|
-
return [
|
|
65
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
66
|
-
get when() {
|
|
67
|
-
return Object.keys(_self$.commands).length > 0;
|
|
68
|
-
},
|
|
69
|
-
get children() {
|
|
70
|
-
return [
|
|
71
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
72
|
-
"const": true,
|
|
73
|
-
name: "args",
|
|
74
|
-
type: "string[]",
|
|
75
|
-
initializer: _alloy_js_core.code`useArgs();`
|
|
76
|
-
}),
|
|
77
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
78
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
|
|
79
|
-
segments: [],
|
|
80
|
-
get commands() {
|
|
81
|
-
return _self$.commands ?? {};
|
|
82
|
-
}
|
|
83
|
-
}),
|
|
84
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
85
|
-
];
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
89
|
-
_alloy_js_core.code`await showBanner();`,
|
|
90
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
91
|
-
_alloy_js_core.code`return showHelp();`
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
95
|
-
get when() {
|
|
96
|
-
return Object.values(_self$.commands).length > 0;
|
|
97
|
-
},
|
|
98
|
-
get children() {
|
|
99
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
100
|
-
get each() {
|
|
101
|
-
return Object.values(_self$.commands);
|
|
102
|
-
},
|
|
103
|
-
doubleHardline: true,
|
|
104
|
-
children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
105
|
-
get when() {
|
|
106
|
-
return child.isVirtual;
|
|
107
|
-
},
|
|
108
|
-
get fallback() {
|
|
109
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
|
|
110
|
-
},
|
|
111
|
-
get children() {
|
|
112
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_virtual_command_entry.VirtualCommandEntry, { command: child });
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
})]);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
];
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
//#endregion
|
|
125
|
-
exports.default = plugin;
|
|
126
|
-
exports.plugin = plugin;
|
|
127
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`),t=require(`./components/bin-entry.cjs`),n=require(`./components/command-router.cjs`),r=require(`./components/virtual-command-entry.cjs`),i=require(`./components/command-entry.cjs`),a=require(`./helpers/get-global-options.cjs`);let o=require(`@alloy-js/core/jsx-runtime`),s=require(`@alloy-js/core`),c=require(`@alloy-js/typescript`),l=require(`@powerlines/plugin-alloy/core/components`),u=require(`@powerlines/plugin-alloy/render`),d=require(`@shell-shock/plugin-banner`);d=e.__toESM(d);let f=require(`@shell-shock/plugin-console`);f=e.__toESM(f);let p=require(`@shell-shock/plugin-help`);p=e.__toESM(p);const m=(e={})=>[...(0,f.default)(e),...(0,p.default)(e),...(0,d.default)(e.banner),{name:`shell-shock:script-preset`,config(){return this.debug("Providing default configuration for the Shell Shock `script` preset."),{globalOptions:a.getGlobalOptions,isCaseSensitive:!1,...e}},prepare:{order:`post`,async handler(){let e=this;return this.debug("Rendering entrypoint modules for the Shell Shock `script` preset."),(0,u.render)(this,[(0,o.createComponent)(t.BinEntry,{builtinImports:{console:[`divider`,`stripAnsi`,`writeLine`,`splitText`,`help`],utils:[`isMinimal`],state:[`useArgs`,`hasFlag`,`isHelp`]},get children(){return[(0,o.createComponent)(s.Show,{get when(){return Object.keys(e.commands).length>0},get children(){return[(0,o.createComponent)(c.VarDeclaration,{const:!0,name:`args`,type:`string[]`,initializer:s.code`useArgs();`}),(0,o.createIntrinsic)(`hbr`,{}),(0,o.createComponent)(n.CommandRouter,{segments:[],get commands(){return e.commands??{}}}),(0,o.createIntrinsic)(`hbr`,{})]}}),(0,o.createComponent)(l.Spacing,{}),s.code`await showBanner();`,(0,o.createComponent)(l.Spacing,{}),s.code`return showHelp();`]}}),(0,o.createComponent)(s.Show,{get when(){return Object.values(e.commands).length>0},get children(){return(0,o.createComponent)(s.For,{get each(){return Object.values(e.commands)},doubleHardline:!0,children:e=>(0,o.createComponent)(s.Show,{get when(){return e.isVirtual},get fallback(){return(0,o.createComponent)(i.CommandEntry,{command:e})},get children(){return(0,o.createComponent)(r.VirtualCommandEntry,{command:e})}})})}})])}}}];exports.default=m,exports.plugin=m;
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAqCA;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAqCA;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,121 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommandRouter } from "./components/command-router.mjs";
|
|
3
|
-
import { VirtualCommandEntry } from "./components/virtual-command-entry.mjs";
|
|
4
|
-
import { CommandEntry } from "./components/command-entry.mjs";
|
|
5
|
-
import { getGlobalOptions } from "./helpers/get-global-options.mjs";
|
|
6
|
-
import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
|
|
7
|
-
import { For, Show, code } from "@alloy-js/core";
|
|
8
|
-
import { VarDeclaration } from "@alloy-js/typescript";
|
|
9
|
-
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
10
|
-
import { render } from "@powerlines/plugin-alloy/render";
|
|
11
|
-
import banner from "@shell-shock/plugin-banner";
|
|
12
|
-
import console from "@shell-shock/plugin-console";
|
|
13
|
-
import help from "@shell-shock/plugin-help";
|
|
14
|
-
|
|
15
|
-
//#region src/index.tsx
|
|
16
|
-
/**
|
|
17
|
-
* The Shell Shock base plugin.
|
|
18
|
-
*/
|
|
19
|
-
const plugin = (options = {}) => {
|
|
20
|
-
return [
|
|
21
|
-
...console(options),
|
|
22
|
-
...help(options),
|
|
23
|
-
...banner(options.banner),
|
|
24
|
-
{
|
|
25
|
-
name: "shell-shock:script-preset",
|
|
26
|
-
config() {
|
|
27
|
-
this.debug("Providing default configuration for the Shell Shock `script` preset.");
|
|
28
|
-
return {
|
|
29
|
-
globalOptions: getGlobalOptions,
|
|
30
|
-
isCaseSensitive: false,
|
|
31
|
-
...options
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "shell-shock:script-preset:generate-entrypoint",
|
|
37
|
-
prepare: {
|
|
38
|
-
order: "post",
|
|
39
|
-
async handler() {
|
|
40
|
-
const _self$ = this;
|
|
41
|
-
this.debug("Rendering entrypoint modules for the Shell Shock `script` preset.");
|
|
42
|
-
return render(this, [createComponent(BinEntry, {
|
|
43
|
-
builtinImports: {
|
|
44
|
-
console: [
|
|
45
|
-
"divider",
|
|
46
|
-
"stripAnsi",
|
|
47
|
-
"writeLine",
|
|
48
|
-
"splitText",
|
|
49
|
-
"help"
|
|
50
|
-
],
|
|
51
|
-
utils: ["isMinimal"],
|
|
52
|
-
state: [
|
|
53
|
-
"useArgs",
|
|
54
|
-
"hasFlag",
|
|
55
|
-
"isHelp"
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
get children() {
|
|
59
|
-
return [
|
|
60
|
-
createComponent(Show, {
|
|
61
|
-
get when() {
|
|
62
|
-
return Object.keys(_self$.commands).length > 0;
|
|
63
|
-
},
|
|
64
|
-
get children() {
|
|
65
|
-
return [
|
|
66
|
-
createComponent(VarDeclaration, {
|
|
67
|
-
"const": true,
|
|
68
|
-
name: "args",
|
|
69
|
-
type: "string[]",
|
|
70
|
-
initializer: code`useArgs();`
|
|
71
|
-
}),
|
|
72
|
-
createIntrinsic("hbr", {}),
|
|
73
|
-
createComponent(CommandRouter, {
|
|
74
|
-
segments: [],
|
|
75
|
-
get commands() {
|
|
76
|
-
return _self$.commands ?? {};
|
|
77
|
-
}
|
|
78
|
-
}),
|
|
79
|
-
createIntrinsic("hbr", {})
|
|
80
|
-
];
|
|
81
|
-
}
|
|
82
|
-
}),
|
|
83
|
-
createComponent(Spacing, {}),
|
|
84
|
-
code`await showBanner();`,
|
|
85
|
-
createComponent(Spacing, {}),
|
|
86
|
-
code`return showHelp();`
|
|
87
|
-
];
|
|
88
|
-
}
|
|
89
|
-
}), createComponent(Show, {
|
|
90
|
-
get when() {
|
|
91
|
-
return Object.values(_self$.commands).length > 0;
|
|
92
|
-
},
|
|
93
|
-
get children() {
|
|
94
|
-
return createComponent(For, {
|
|
95
|
-
get each() {
|
|
96
|
-
return Object.values(_self$.commands);
|
|
97
|
-
},
|
|
98
|
-
doubleHardline: true,
|
|
99
|
-
children: (child) => createComponent(Show, {
|
|
100
|
-
get when() {
|
|
101
|
-
return child.isVirtual;
|
|
102
|
-
},
|
|
103
|
-
get fallback() {
|
|
104
|
-
return createComponent(CommandEntry, { command: child });
|
|
105
|
-
},
|
|
106
|
-
get children() {
|
|
107
|
-
return createComponent(VirtualCommandEntry, { command: child });
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
})]);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
];
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
//#endregion
|
|
120
|
-
export { plugin as default, plugin };
|
|
1
|
+
import{BinEntry as e}from"./components/bin-entry.mjs";import{CommandRouter as t}from"./components/command-router.mjs";import{VirtualCommandEntry as n}from"./components/virtual-command-entry.mjs";import{CommandEntry as r}from"./components/command-entry.mjs";import{getGlobalOptions as i}from"./helpers/get-global-options.mjs";import{createComponent as a,createIntrinsic as o}from"@alloy-js/core/jsx-runtime";import{For as s,Show as c,code as l}from"@alloy-js/core";import{VarDeclaration as u}from"@alloy-js/typescript";import{Spacing as d}from"@powerlines/plugin-alloy/core/components";import{render as f}from"@powerlines/plugin-alloy/render";import p from"@shell-shock/plugin-banner";import m from"@shell-shock/plugin-console";import h from"@shell-shock/plugin-help";const g=(g={})=>[...m(g),...h(g),...p(g.banner),{name:`shell-shock:script-preset`,config(){return this.debug("Providing default configuration for the Shell Shock `script` preset."),{globalOptions:i,isCaseSensitive:!1,...g}},prepare:{order:`post`,async handler(){let i=this;return this.debug("Rendering entrypoint modules for the Shell Shock `script` preset."),f(this,[a(e,{builtinImports:{console:[`divider`,`stripAnsi`,`writeLine`,`splitText`,`help`],utils:[`isMinimal`],state:[`useArgs`,`hasFlag`,`isHelp`]},get children(){return[a(c,{get when(){return Object.keys(i.commands).length>0},get children(){return[a(u,{const:!0,name:`args`,type:`string[]`,initializer:l`useArgs();`}),o(`hbr`,{}),a(t,{segments:[],get commands(){return i.commands??{}}}),o(`hbr`,{})]}}),a(d,{}),l`await showBanner();`,a(d,{}),l`return showHelp();`]}}),a(c,{get when(){return Object.values(i.commands).length>0},get children(){return a(s,{get each(){return Object.values(i.commands)},doubleHardline:!0,children:e=>a(c,{get when(){return e.isVirtual},get fallback(){return a(r,{command:e})},get children(){return a(n,{command:e})}})})}})])}}}];export{g as default,g as plugin};
|
|
121
2
|
//# sourceMappingURL=index.mjs.map
|