@shell-shock/preset-script 0.6.0 → 0.6.2
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/README.md +1 -1
- package/dist/components/banner-function-declaration.cjs +4 -2
- package/dist/components/banner-function-declaration.cjs.map +1 -1
- package/dist/components/banner-function-declaration.mjs +4 -2
- package/dist/components/banner-function-declaration.mjs.map +1 -1
- package/dist/components/bin-entry.cjs +9 -5
- package/dist/components/bin-entry.cjs.map +1 -1
- 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 +9 -5
- package/dist/components/bin-entry.mjs.map +1 -1
- package/dist/components/command-entry.cjs +160 -155
- package/dist/components/command-entry.cjs.map +1 -1
- package/dist/components/command-entry.d.cts +8 -1
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts +8 -1
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +160 -156
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +90 -61
- package/dist/components/command-router.cjs.map +1 -1
- package/dist/components/command-router.d.cts +5 -1
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts +5 -1
- package/dist/components/command-router.d.mts.map +1 -1
- package/dist/components/command-router.mjs +90 -62
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/console-builtin.cjs +27 -19
- package/dist/components/console-builtin.cjs.map +1 -1
- package/dist/components/console-builtin.d.cts +4 -2
- package/dist/components/console-builtin.d.cts.map +1 -1
- package/dist/components/console-builtin.d.mts +4 -2
- package/dist/components/console-builtin.d.mts.map +1 -1
- package/dist/components/console-builtin.mjs +27 -19
- package/dist/components/console-builtin.mjs.map +1 -1
- package/dist/components/help.d.cts +7 -7
- package/dist/components/help.d.cts.map +1 -1
- package/dist/components/helpers.d.cts +5 -5
- package/dist/components/index.cjs +2 -0
- package/dist/components/index.d.cts +4 -4
- package/dist/components/index.d.mts +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/components/utils-builtin.cjs +59 -92
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.d.cts +8 -8
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +60 -93
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/components/virtual-command-entry.cjs +16 -12
- package/dist/components/virtual-command-entry.cjs.map +1 -1
- package/dist/components/virtual-command-entry.d.cts.map +1 -1
- package/dist/components/virtual-command-entry.d.mts.map +1 -1
- package/dist/components/virtual-command-entry.mjs +16 -12
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/index.cjs +2 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.mjs","names":["code","computed","For","Show","FunctionDeclaration","usePowerlines","TSDoc","TSDocParam","TSDocRemarks","TSDocTitle","TypescriptFile","getAppBin","getDynamicPathSegmentName","isDynamicPathSegment","joinPaths","constantCase","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualHelp","VirtualCommandHandlerDeclaration","props","command","children","context","_$createComponent","heading","title","segments","map","segment","join","description","replace","_$createIntrinsic","name","async","parameters","type","default","
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.mjs","names":["code","computed","For","Show","FunctionDeclaration","usePowerlines","TSDoc","TSDocParam","TSDocRemarks","TSDocTitle","TypescriptFile","getAppBin","getDynamicPathSegmentName","isDynamicPathSegment","joinPaths","constantCase","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualHelp","VirtualCommandHandlerDeclaration","props","command","children","context","_$createComponent","heading","title","segments","map","segment","join","description","replace","_$createIntrinsic","name","async","parameters","type","default","options","Object","values","commands","VirtualCommandEntry","imports","builtinImports","rest","filePath","entryPath","filter","_$mergeProps","path","value","didyoumean2","entries","child","isVirtual","reduce","ret","alias","console","utils","each","when","fallback"],"sources":["../../src/components/virtual-command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\nimport { VirtualHelp } from \"./help\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n 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 } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <hbr />\n <hbr />\n {children}\n <hbr />\n <hbr />\n {code`writeLine(\"\");\n banner(); `}\n <hbr />\n <hbr />\n <VirtualHelp\n segments={command.segments}\n options={Object.values(command.options)}\n commands={command.children ?? {}}\n />\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n {\n didyoumean2: [\n { name: \"didYouMean\", default: true },\n { name: \"ReturnTypeEnums\" },\n { name: \"ThresholdTypeEnums\" }\n ]\n },\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 console: [\n \"help\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\"useArgs\", \"hasFlag\", \"isMinimal\", \"isUnicodeSupported\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration command={command}>\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":";;;;;;;;;;;;;;;;;;;;AAuDA,SAAgBsB,iCACdC,OACA;CACA,MAAM,EAAEC,SAASC,aAAaF;CAE9B,MAAMG,UAAUrB,eAAoC;AAEpD,QAAA,CAAAsB,gBAEKrB,OAAK;EAAA,IACJsB,UAAO;AAAA,UAAE,OAAOJ,QAAQK,MAAK,IAAKlB,UAAUe,QAAQ,CAAA,GAAIF,QAAQM,SAC7DC,KAAIC,YACHnB,qBAAqBmB,QAAQ,GACzB,IAAIjB,aAAaH,0BAA0BoB,QAAQ,CAAC,CAAA,KACpDA,QACL,CACAC,KAAK,IAAI,CAAA;;EAAoB,IAAAR,WAAA;AAAA,UAAA;IAAAE,gBAC/BnB,cAAY,EAAA,IAAAiB,WAAA;AAAA,YAAE,GAAGD,QAAQU,YAAYC,QAAQ,QAAQ,GAAG,CAAA;OAAG,CAAA;IAAAC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AAA,CAAA;EAEtC,CAAA,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -59,8 +59,7 @@ const plugin = (options = {}) => {
|
|
|
59
59
|
"colors",
|
|
60
60
|
"help"
|
|
61
61
|
],
|
|
62
|
-
utils: ["
|
|
63
|
-
env: ["isCI"]
|
|
62
|
+
utils: ["useArgs", "isMinimal"]
|
|
64
63
|
},
|
|
65
64
|
get prefix() {
|
|
66
65
|
return [
|
|
@@ -81,7 +80,7 @@ const plugin = (options = {}) => {
|
|
|
81
80
|
"const": true,
|
|
82
81
|
name: "args",
|
|
83
82
|
type: "string[]",
|
|
84
|
-
initializer: __alloy_js_core.code`
|
|
83
|
+
initializer: __alloy_js_core.code`useArgs();`
|
|
85
84
|
}),
|
|
86
85
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
87
86
|
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["code","For","Show","VarDeclaration","render","theme","BannerFunctionDeclaration","VirtualHelp","BinEntry","CommandEntry","CommandRouter","ConsoleBuiltin","UtilsBuiltin","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","_$createComponent","order","handler","_self$","builtinImports","console","utils","
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["code","For","Show","VarDeclaration","render","theme","BannerFunctionDeclaration","VirtualHelp","BinEntry","CommandEntry","CommandRouter","ConsoleBuiltin","UtilsBuiltin","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","_$createComponent","order","handler","_self$","builtinImports","console","utils","prefix","_$createIntrinsic","children","when","Object","keys","commands","length","type","initializer","segments","values","each","doubleHardline","child","isVirtual","fallback","command"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { BannerFunctionDeclaration, VirtualHelp } from \"./components\";\nimport { BinEntry } from \"./components/bin-entry\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { ConsoleBuiltin } from \"./components/console-builtin\";\nimport { UtilsBuiltin } from \"./components/utils-builtin\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n theme({\n theme: options.theme\n }),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n },\n configResolved() {\n this.dependencies.didyoumean2 = \"^7.0.4\";\n },\n async prepare() {\n this.debug(\n \"Rendering built-in modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <UtilsBuiltin />\n <ConsoleBuiltin />\n </>\n );\n }\n },\n {\n name: \"shell-shock:script-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\"\n ],\n utils: [\"useArgs\", \"isMinimal\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <hbr />\n <hbr />\n {code`writeLine(\"\");\n banner();`}\n <hbr />\n <hbr />\n <VirtualHelp\n options={this.options}\n commands={this.commands ?? {}}\n />\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAae,UAGXC,UAA+B,EAAE,KAC9B;AACH,QAAO;0CACC,EACJX,OAAOW,QAAQX,OAChB,CAAC;EACF;GACEY,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,uEACD;AAED,WAAO;KACLC,gBAAgBN;KAChBO,iBAAiB;KACjB,GAAGL;KACJ;;GAEHM,iBAAiB;AACf,SAAKC,aAAaC,cAAc;;GAElC,MAAMC,UAAU;AACd,SAAKN,MACH,kEACD;AAED,wDACE,MAAI,kDAEDP,+CAAY,EAAA,CAAA,mDACZD,mDAAc,EAAA,CAAA,CAEnB,CAAC;;GAEJ;EACD;GACEM,MAAM;GACNQ,S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DY,2DACE7C,sBAAI;SAAA,IACHkC,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,kEAAGxC,+CAAY,EAACyC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,kEACrCtB,8DAAmB,EAACqC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAehC"}
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAoCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,mBAAA,GAAsB,mBAAtB,CAAA,CAAA,OAAA,CAAA,EAER,mBAFQ,EAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAoCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,mBAAA,GAAsB,mBAAtB,CAAA,CAAA,OAAA,CAAA,EAER,mBAFQ,EAAA,GA2GZ,MA3GY,CA2GL,QA3GK,CAAA,EAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAoCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,mBAAA,GAAsB,mBAAtB,CAAA,CAAA,OAAA,CAAA,EAER,mBAFQ,EAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAoCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,mBAAA,GAAsB,mBAAtB,CAAA,CAAA,OAAA,CAAA,EAER,mBAFQ,EAAA,GA2GZ,MA3GY,CA2GL,QA3GK,CAAA,EAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -56,8 +56,7 @@ const plugin = (options = {}) => {
|
|
|
56
56
|
"colors",
|
|
57
57
|
"help"
|
|
58
58
|
],
|
|
59
|
-
utils: ["
|
|
60
|
-
env: ["isCI"]
|
|
59
|
+
utils: ["useArgs", "isMinimal"]
|
|
61
60
|
},
|
|
62
61
|
get prefix() {
|
|
63
62
|
return [
|
|
@@ -78,7 +77,7 @@ const plugin = (options = {}) => {
|
|
|
78
77
|
"const": true,
|
|
79
78
|
name: "args",
|
|
80
79
|
type: "string[]",
|
|
81
|
-
initializer: code`
|
|
80
|
+
initializer: code`useArgs();`
|
|
82
81
|
}),
|
|
83
82
|
createIntrinsic("hbr", {}),
|
|
84
83
|
createComponent(CommandRouter, {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","theme","BannerFunctionDeclaration","VirtualHelp","BinEntry","CommandEntry","CommandRouter","ConsoleBuiltin","UtilsBuiltin","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","_$createComponent","order","handler","_self$","builtinImports","console","utils","
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","theme","BannerFunctionDeclaration","VirtualHelp","BinEntry","CommandEntry","CommandRouter","ConsoleBuiltin","UtilsBuiltin","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","_$createComponent","order","handler","_self$","builtinImports","console","utils","prefix","_$createIntrinsic","children","when","Object","keys","commands","length","type","initializer","segments","values","each","doubleHardline","child","isVirtual","fallback","command"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { BannerFunctionDeclaration, VirtualHelp } from \"./components\";\nimport { BinEntry } from \"./components/bin-entry\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { ConsoleBuiltin } from \"./components/console-builtin\";\nimport { UtilsBuiltin } from \"./components/utils-builtin\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n theme({\n theme: options.theme\n }),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n },\n configResolved() {\n this.dependencies.didyoumean2 = \"^7.0.4\";\n },\n async prepare() {\n this.debug(\n \"Rendering built-in modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <UtilsBuiltin />\n <ConsoleBuiltin />\n </>\n );\n }\n },\n {\n name: \"shell-shock:script-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `script` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\"\n ],\n utils: [\"useArgs\", \"isMinimal\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <hbr />\n <hbr />\n {code`writeLine(\"\");\n banner();`}\n <hbr />\n <hbr />\n <VirtualHelp\n options={this.options}\n commands={this.commands ?? {}}\n />\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,MAAae,UAGXC,UAA+B,EAAE,KAC9B;AACH,QAAO;EACLX,MAAM,EACJA,OAAOW,QAAQX,OAChB,CAAC;EACF;GACEY,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,uEACD;AAED,WAAO;KACLC,gBAAgBN;KAChBO,iBAAiB;KACjB,GAAGL;KACJ;;GAEHM,iBAAiB;AACf,SAAKC,aAAaC,cAAc;;GAElC,MAAMC,UAAU;AACd,SAAKN,MACH,kEACD;AAED,WAAOf,OACL,MAAI,CAAAsB,gBAEDd,cAAY,EAAA,CAAA,EAAAc,gBACZf,gBAAc,EAAA,CAAA,CAEnB,CAAC;;GAEJ;EACD;GACEM,MAAM;GACNQ,SAAS;IACPE,OAAO;IACP,MAAMC,UAAU;KAAA,MAAAC,SAAA;AACd,UAAKV,MACH,oEACD;AAED,YAAOf,OACL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;;QAAEO,gBAAc;QAAAX,WACpDY,UAAKrB,gBACHxB,MAAI;SAAA,IACHkC,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,iBAAAvB,gBAAGjB,cAAY,EAACyC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,iBAAAT,gBACrCb,qBAAmB,EAACqC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAehC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;UAmCiB,mBAAA,SACP,KAAK,4BAA4B,QAAQ;;AADnD;;;;;;;;;;EAmBY,cAAA,CAAA,EALN,aAK4B,EAAA,GAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;UAmCiB,mBAAA,SACP,KAAK,4BAA4B,QAAQ;;AADnD;;;;;;;;;;EAmBY,cAAA,CAAA,EALN,aAK4B,EAAA,GAAA,CAAG,CAAA,OAAA,EAJpB,OAIiC,EAAA,KAAA,EAJjB,WAIoC,EAAA,GAJpB,aAIoB,EAAA,CAAA,GAAA,KAAA;AAErE;AAAyC,KAF7B,sBAAA,GAAyB,UAEI,GAFS,mBAET;AACzB,KADJ,0BAAA,GAA6B,cACzB,GAAd,QAAc,CAAL,IAAK,CAAA,mBAAA,EAAA,OAAA,CAAA,CAAA,GACd,yBADc;AAAL,KAGC,mBAHD,CAAA,wBAIe,0BAJf,GAKP,0BALO,CAAA,GAMP,kBANO,CAMY,eANZ,CAAA,GAOT,kBAPS,CAOU,eAPV,CAAA,GAQT,OARS,CAQD,eARC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/preset-script",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Shell Shock preset that generates a fully-featured script application.",
|
|
6
6
|
"repository": {
|
|
@@ -296,13 +296,13 @@
|
|
|
296
296
|
"@powerlines/deepkit": "^0.6.51",
|
|
297
297
|
"@powerlines/plugin-alloy": "^0.20.15",
|
|
298
298
|
"@powerlines/plugin-plugin": "^0.12.222",
|
|
299
|
-
"@shell-shock/core": "^0.8.
|
|
300
|
-
"@shell-shock/plugin-theme": "^0.0.
|
|
301
|
-
"@stryke/path": "0.26.
|
|
302
|
-
"@stryke/string-format": "0.13.7",
|
|
303
|
-
"defu": "6.1.4",
|
|
299
|
+
"@shell-shock/core": "^0.8.3",
|
|
300
|
+
"@shell-shock/plugin-theme": "^0.0.20",
|
|
301
|
+
"@stryke/path": "^0.26.6",
|
|
302
|
+
"@stryke/string-format": "^0.13.7",
|
|
303
|
+
"defu": "^6.1.4",
|
|
304
304
|
"powerlines": "^0.38.38",
|
|
305
|
-
"@stryke/helpers": "^0.9.
|
|
305
|
+
"@stryke/helpers": "^0.9.42"
|
|
306
306
|
},
|
|
307
307
|
"devDependencies": {
|
|
308
308
|
"@babel/core": "^7.29.0",
|
|
@@ -310,5 +310,5 @@
|
|
|
310
310
|
"@types/node": "^22.19.10"
|
|
311
311
|
},
|
|
312
312
|
"publishConfig": { "access": "public" },
|
|
313
|
-
"gitHead": "
|
|
313
|
+
"gitHead": "109668970cbd9b415822d1e030858a154ef01834"
|
|
314
314
|
}
|