@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.
- package/README.md +1 -1
- 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,93 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { code } from "@alloy-js/core";
|
|
3
|
-
import { FunctionDeclaration, IfStatement, InterfaceDeclaration, InterfaceMember, VarDeclaration } from "@alloy-js/typescript";
|
|
4
|
-
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
5
|
-
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
6
|
-
import { getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
7
|
-
import { IsVerbose } from "@shell-shock/core/components/helpers";
|
|
8
|
-
|
|
9
|
-
//#region src/components/exit-function-declaration.tsx
|
|
10
|
-
/**
|
|
11
|
-
* The `exit` handler function declaration code for the Shell Shock project.
|
|
12
|
-
*/
|
|
13
|
-
function ExitFunctionDeclaration() {
|
|
14
|
-
const context = usePowerlines();
|
|
15
|
-
return [
|
|
16
|
-
createComponent(InterfaceDeclaration, {
|
|
17
|
-
"export": true,
|
|
18
|
-
name: "ExitOptions",
|
|
19
|
-
doc: "Options for the exit handler function.",
|
|
20
|
-
get children() {
|
|
21
|
-
return [
|
|
22
|
-
createComponent(InterfaceMember, {
|
|
23
|
-
name: "exception",
|
|
24
|
-
optional: true,
|
|
25
|
-
type: "string | Error",
|
|
26
|
-
doc: "An optional exception that caused the exit. This can be a string message or an Error object."
|
|
27
|
-
}),
|
|
28
|
-
createIntrinsic("hbr", {}),
|
|
29
|
-
createComponent(InterfaceMember, {
|
|
30
|
-
name: "skipProcessExit",
|
|
31
|
-
optional: true,
|
|
32
|
-
type: "boolean",
|
|
33
|
-
doc: "Indicates whether the exit function should manually exit the process or not. If set to true, the exit function will not call process.exit() and will allow the application to continue running. If set to false or not specified, the exit function will call process.exit() to terminate the application."
|
|
34
|
-
}),
|
|
35
|
-
createIntrinsic("hbr", {}),
|
|
36
|
-
createComponent(InterfaceMember, {
|
|
37
|
-
name: "isSynchronous",
|
|
38
|
-
optional: true,
|
|
39
|
-
type: "boolean",
|
|
40
|
-
doc: "Indicates whether the exit function should perform synchronous operations only. If set to true, the exit function will avoid any asynchronous operations during exit. If set to false or not specified, the exit function may perform asynchronous operations as needed."
|
|
41
|
-
}),
|
|
42
|
-
createIntrinsic("hbr", {}),
|
|
43
|
-
createComponent(InterfaceMember, {
|
|
44
|
-
name: "signal",
|
|
45
|
-
optional: true,
|
|
46
|
-
type: "number",
|
|
47
|
-
doc: "The signal number that triggered the exit. This is typically used when the shutdown is initiated by a system signal (e.g., SIGINT, SIGTERM)."
|
|
48
|
-
}),
|
|
49
|
-
createIntrinsic("hbr", {}),
|
|
50
|
-
createComponent(InterfaceMember, {
|
|
51
|
-
name: "startDate",
|
|
52
|
-
optional: true,
|
|
53
|
-
type: "Date",
|
|
54
|
-
doc: "A Date object representing the timestamp when the process started. This can be used to measure the duration of the shutdown process."
|
|
55
|
-
})
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
}),
|
|
59
|
-
createComponent(Spacing, {}),
|
|
60
|
-
createComponent(VarDeclaration, {
|
|
61
|
-
"let": true,
|
|
62
|
-
name: "isExiting",
|
|
63
|
-
type: "boolean",
|
|
64
|
-
initializer: code`false;`
|
|
65
|
-
}),
|
|
66
|
-
createComponent(VarDeclaration, {
|
|
67
|
-
"const": true,
|
|
68
|
-
name: "callbackAsyncQueue",
|
|
69
|
-
type: "Array<[(code: number | string) => Promise<void> | void, number]>",
|
|
70
|
-
initializer: code`[];`
|
|
71
|
-
}),
|
|
72
|
-
createComponent(VarDeclaration, {
|
|
73
|
-
"const": true,
|
|
74
|
-
name: "callbackSyncQueue",
|
|
75
|
-
type: "Array<(code: number | string) => void>",
|
|
76
|
-
initializer: code`[];`
|
|
77
|
-
}),
|
|
78
|
-
createComponent(Spacing, {}),
|
|
79
|
-
createComponent(FunctionDeclaration, {
|
|
80
|
-
"export": true,
|
|
81
|
-
async: true,
|
|
82
|
-
name: "exit",
|
|
83
|
-
parameters: [{
|
|
84
|
-
name: "options",
|
|
85
|
-
type: "ExitOptions",
|
|
86
|
-
default: "{}"
|
|
87
|
-
}],
|
|
88
|
-
get children() {
|
|
89
|
-
return [
|
|
90
|
-
memo(() => code`
|
|
1
|
+
import{createComponent as e,createIntrinsic as t,memo as n}from"@alloy-js/core/jsx-runtime";import{code as r}from"@alloy-js/core";import{FunctionDeclaration as i,IfStatement as a,InterfaceDeclaration as o,InterfaceMember as s,VarDeclaration as c}from"@alloy-js/typescript";import{Spacing as l}from"@powerlines/plugin-alloy/core/components/spacing";import{usePowerlines as u}from"@powerlines/plugin-alloy/core/contexts/context";import{getAppTitle as d}from"@shell-shock/core/plugin-utils";import{IsVerbose as f}from"@shell-shock/core/components/helpers";function p(){let p=u();return[e(o,{export:!0,name:`ExitOptions`,doc:`Options for the exit handler function.`,get children(){return[e(s,{name:`exception`,optional:!0,type:`string | Error`,doc:`An optional exception that caused the exit. This can be a string message or an Error object.`}),t(`hbr`,{}),e(s,{name:`skipProcessExit`,optional:!0,type:`boolean`,doc:`Indicates whether the exit function should manually exit the process or not. If set to true, the exit function will not call process.exit() and will allow the application to continue running. If set to false or not specified, the exit function will call process.exit() to terminate the application.`}),t(`hbr`,{}),e(s,{name:`isSynchronous`,optional:!0,type:`boolean`,doc:`Indicates whether the exit function should perform synchronous operations only. If set to true, the exit function will avoid any asynchronous operations during exit. If set to false or not specified, the exit function may perform asynchronous operations as needed.`}),t(`hbr`,{}),e(s,{name:`signal`,optional:!0,type:`number`,doc:`The signal number that triggered the exit. This is typically used when the shutdown is initiated by a system signal (e.g., SIGINT, SIGTERM).`}),t(`hbr`,{}),e(s,{name:`startDate`,optional:!0,type:`Date`,doc:`A Date object representing the timestamp when the process started. This can be used to measure the duration of the shutdown process.`})]}}),e(l,{}),e(c,{let:!0,name:`isExiting`,type:`boolean`,initializer:r`false;`}),e(c,{const:!0,name:`callbackAsyncQueue`,type:`Array<[(code: number | string) => Promise<void> | void, number]>`,initializer:r`[];`}),e(c,{const:!0,name:`callbackSyncQueue`,type:`Array<(code: number | string) => void>`,initializer:r`[];`}),e(l,{}),e(i,{export:!0,async:!0,name:`exit`,parameters:[{name:`options`,type:`ExitOptions`,default:`{}`}],get children(){return[n(()=>r`
|
|
91
2
|
try {
|
|
92
3
|
if (isExiting) {
|
|
93
4
|
return;
|
|
@@ -103,21 +14,13 @@ function ExitFunctionDeclaration() {
|
|
|
103
14
|
}
|
|
104
15
|
|
|
105
16
|
if (options.exception) {
|
|
106
|
-
error({ message: \`A fatal error occured while running the application - please contact the ${
|
|
17
|
+
error({ message: \`A fatal error occured while running the application - please contact the ${d(p)} support team\${options.exception && typeof options.exception !== "symbol" ? \`: \\n\\n\${typeof options.exception === "string" ? options.exception : options.exception.message}\` : "."}\`,
|
|
107
18
|
...(options.exception && typeof options.exception === "object" ? { stack: (options.exception as { message: string; stack?: string }).stack } : {})
|
|
108
19
|
});
|
|
109
20
|
}
|
|
110
21
|
|
|
111
|
-
const terminate = (force = false) => { `),
|
|
112
|
-
|
|
113
|
-
get condition() {
|
|
114
|
-
return createComponent(IsVerbose, {});
|
|
115
|
-
},
|
|
116
|
-
children: code`writeLine("");`
|
|
117
|
-
}),
|
|
118
|
-
createIntrinsic("hbr", {}),
|
|
119
|
-
memo(() => code`
|
|
120
|
-
verbose(\`The ${getAppTitle(context, true)} application exited \${options.exception ? \`early due to an exception\` : "successfully"}\${options.startDate ? \`. Total processing time is \${Date.now() - options.startDate.getTime() > 5000 ? Math.floor((Date.now() - options.startDate.getTime()) / 1000) : Date.now() - options.startDate.getTime()} \${Date.now() - options.startDate.getTime() > 5000 ? "seconds" : "milliseconds"}\` : ""}...\`);
|
|
22
|
+
const terminate = (force = false) => { `),e(a,{get condition(){return e(f,{})},children:r`writeLine("");`}),t(`hbr`,{}),n(()=>r`
|
|
23
|
+
verbose(\`The ${d(p,!0)} application exited \${options.exception ? \`early due to an exception\` : "successfully"}\${options.startDate ? \`. Total processing time is \${Date.now() - options.startDate.getTime() > 5000 ? Math.floor((Date.now() - options.startDate.getTime()) / 1000) : Date.now() - options.startDate.getTime()} \${Date.now() - options.startDate.getTime() > 5000 ? "seconds" : "milliseconds"}\` : ""}...\`);
|
|
121
24
|
if (!options.skipProcessExit) {
|
|
122
25
|
process.nextTick(() => process.exit(exitCode));
|
|
123
26
|
}
|
|
@@ -144,19 +47,11 @@ function ExitFunctionDeclaration() {
|
|
|
144
47
|
|
|
145
48
|
terminate();
|
|
146
49
|
} catch (err) {
|
|
147
|
-
error(\`The exit process failed to complete\${(err as Error)?.message ? \` - \${(err as Error).message}\` : ""}. Please contact the ${
|
|
50
|
+
error(\`The exit process failed to complete\${(err as Error)?.message ? \` - \${(err as Error).message}\` : ""}. Please contact the ${d(p,!0)} support team.\`);
|
|
148
51
|
|
|
149
52
|
if (!options.skipProcessExit) {
|
|
150
53
|
process.nextTick(() => process.exit(1));
|
|
151
54
|
}
|
|
152
55
|
}
|
|
153
|
-
`)
|
|
154
|
-
];
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
//#endregion
|
|
161
|
-
export { ExitFunctionDeclaration };
|
|
56
|
+
`)]}})]}export{p as ExitFunctionDeclaration};
|
|
162
57
|
//# sourceMappingURL=exit-function-declaration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-function-declaration.mjs","names":[],"sources":["../../src/components/exit-function-declaration.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 } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { IsVerbose } from \"@shell-shock/core/components/helpers\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\n/**\n * The `exit` handler function declaration code for the Shell Shock project.\n */\nexport function ExitFunctionDeclaration() {\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"ExitOptions\"\n doc=\"Options for the exit handler function.\">\n <InterfaceMember\n name=\"exception\"\n optional\n type=\"string | Error\"\n doc=\"An optional exception that caused the exit. This can be a string message or an Error object.\"\n />\n <hbr />\n <InterfaceMember\n name=\"skipProcessExit\"\n optional\n type=\"boolean\"\n doc=\"Indicates whether the exit function should manually exit the process or not. If set to true, the exit function will not call process.exit() and will allow the application to continue running. If set to false or not specified, the exit function will call process.exit() to terminate the application.\"\n />\n <hbr />\n <InterfaceMember\n name=\"isSynchronous\"\n optional\n type=\"boolean\"\n doc=\"Indicates whether the exit function should perform synchronous operations only. If set to true, the exit function will avoid any asynchronous operations during exit. If set to false or not specified, the exit function may perform asynchronous operations as needed.\"\n />\n <hbr />\n <InterfaceMember\n name=\"signal\"\n optional\n type=\"number\"\n doc=\"The signal number that triggered the exit. This is typically used when the shutdown is initiated by a system signal (e.g., SIGINT, SIGTERM).\"\n />\n <hbr />\n <InterfaceMember\n name=\"startDate\"\n optional\n type=\"Date\"\n doc=\"A Date object representing the timestamp when the process started. This can be used to measure the duration of the shutdown process.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <VarDeclaration\n let\n name=\"isExiting\"\n type=\"boolean\"\n initializer={code`false;`}\n />\n <VarDeclaration\n const\n name=\"callbackAsyncQueue\"\n type=\"Array<[(code: number | string) => Promise<void> | void, number]>\"\n initializer={code`[];`}\n />\n <VarDeclaration\n const\n name=\"callbackSyncQueue\"\n type=\"Array<(code: number | string) => void>\"\n initializer={code`[];`}\n />\n <Spacing />\n <FunctionDeclaration\n export\n async\n name=\"exit\"\n parameters={[\n {\n name: \"options\",\n type: \"ExitOptions\",\n default: \"{}\"\n }\n ]}>\n {code`\n try {\n if (isExiting) {\n return;\n }\n\n isExiting = true;\n\n let exitCode: number | string = 0;\n if ((options.signal !== undefined && options.signal > 0) || options.exception) {\n exitCode = 128 + (options.signal ?? 1);\n } else if (typeof process.exitCode === \"number\" || typeof process.exitCode === \"string\") {\n exitCode = process.exitCode;\n }\n\n if (options.exception) {\n error({ message: \\`A fatal error occured while running the application - please contact the ${getAppTitle(\n context\n )} support team\\${options.exception && typeof options.exception !== \"symbol\" ? \\`: \\\\n\\\\n\\${typeof options.exception === \"string\" ? options.exception : options.exception.message}\\` : \".\"}\\`,\n ...(options.exception && typeof options.exception === \"object\" ? { stack: (options.exception as { message: string; stack?: string }).stack } : {})\n });\n }\n\n const terminate = (force = false) => { `}\n <IfStatement\n condition={<IsVerbose />}>{code`writeLine(\"\");`}</IfStatement>\n <hbr />\n {code`\n verbose(\\`The ${getAppTitle(\n context,\n true\n )} application exited \\${options.exception ? \\`early due to an exception\\` : \"successfully\"}\\${options.startDate ? \\`. Total processing time is \\${Date.now() - options.startDate.getTime() > 5000 ? Math.floor((Date.now() - options.startDate.getTime()) / 1000) : Date.now() - options.startDate.getTime()} \\${Date.now() - options.startDate.getTime() > 5000 ? \"seconds\" : \"milliseconds\"}\\` : \"\"}...\\`);\n if (!options.skipProcessExit) {\n process.nextTick(() => process.exit(exitCode));\n }\n };\n\n for (const callbackSync of callbackSyncQueue) {\n callbackSync(exitCode);\n }\n\n if (!options.isSynchronous) {\n const promises = [];\n let forceAfter = 0;\n for (const [callbackAsync, wait] of callbackAsyncQueue) {\n forceAfter = Math.max(forceAfter, wait);\n promises.push(Promise.resolve(callbackAsync(exitCode)));\n }\n\n const asyncTimer = setTimeout(() => {\n terminate(true);\n }, forceAfter);\n await Promise.all(promises);\n clearTimeout(asyncTimer);\n }\n\n terminate();\n } catch (err) {\n error(\\`The exit process failed to complete\\${(err as Error)?.message ? \\` - \\${(err as Error).message}\\` : \"\"}. Please contact the ${getAppTitle(\n context,\n true\n )} support team.\\`);\n\n if (!options.skipProcessExit) {\n process.nextTick(() => process.exit(1));\n }\n }\n `}\n </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"exit-function-declaration.mjs","names":[],"sources":["../../src/components/exit-function-declaration.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 } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { IsVerbose } from \"@shell-shock/core/components/helpers\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\n/**\n * The `exit` handler function declaration code for the Shell Shock project.\n */\nexport function ExitFunctionDeclaration() {\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"ExitOptions\"\n doc=\"Options for the exit handler function.\">\n <InterfaceMember\n name=\"exception\"\n optional\n type=\"string | Error\"\n doc=\"An optional exception that caused the exit. This can be a string message or an Error object.\"\n />\n <hbr />\n <InterfaceMember\n name=\"skipProcessExit\"\n optional\n type=\"boolean\"\n doc=\"Indicates whether the exit function should manually exit the process or not. If set to true, the exit function will not call process.exit() and will allow the application to continue running. If set to false or not specified, the exit function will call process.exit() to terminate the application.\"\n />\n <hbr />\n <InterfaceMember\n name=\"isSynchronous\"\n optional\n type=\"boolean\"\n doc=\"Indicates whether the exit function should perform synchronous operations only. If set to true, the exit function will avoid any asynchronous operations during exit. If set to false or not specified, the exit function may perform asynchronous operations as needed.\"\n />\n <hbr />\n <InterfaceMember\n name=\"signal\"\n optional\n type=\"number\"\n doc=\"The signal number that triggered the exit. This is typically used when the shutdown is initiated by a system signal (e.g., SIGINT, SIGTERM).\"\n />\n <hbr />\n <InterfaceMember\n name=\"startDate\"\n optional\n type=\"Date\"\n doc=\"A Date object representing the timestamp when the process started. This can be used to measure the duration of the shutdown process.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <VarDeclaration\n let\n name=\"isExiting\"\n type=\"boolean\"\n initializer={code`false;`}\n />\n <VarDeclaration\n const\n name=\"callbackAsyncQueue\"\n type=\"Array<[(code: number | string) => Promise<void> | void, number]>\"\n initializer={code`[];`}\n />\n <VarDeclaration\n const\n name=\"callbackSyncQueue\"\n type=\"Array<(code: number | string) => void>\"\n initializer={code`[];`}\n />\n <Spacing />\n <FunctionDeclaration\n export\n async\n name=\"exit\"\n parameters={[\n {\n name: \"options\",\n type: \"ExitOptions\",\n default: \"{}\"\n }\n ]}>\n {code`\n try {\n if (isExiting) {\n return;\n }\n\n isExiting = true;\n\n let exitCode: number | string = 0;\n if ((options.signal !== undefined && options.signal > 0) || options.exception) {\n exitCode = 128 + (options.signal ?? 1);\n } else if (typeof process.exitCode === \"number\" || typeof process.exitCode === \"string\") {\n exitCode = process.exitCode;\n }\n\n if (options.exception) {\n error({ message: \\`A fatal error occured while running the application - please contact the ${getAppTitle(\n context\n )} support team\\${options.exception && typeof options.exception !== \"symbol\" ? \\`: \\\\n\\\\n\\${typeof options.exception === \"string\" ? options.exception : options.exception.message}\\` : \".\"}\\`,\n ...(options.exception && typeof options.exception === \"object\" ? { stack: (options.exception as { message: string; stack?: string }).stack } : {})\n });\n }\n\n const terminate = (force = false) => { `}\n <IfStatement\n condition={<IsVerbose />}>{code`writeLine(\"\");`}</IfStatement>\n <hbr />\n {code`\n verbose(\\`The ${getAppTitle(\n context,\n true\n )} application exited \\${options.exception ? \\`early due to an exception\\` : \"successfully\"}\\${options.startDate ? \\`. Total processing time is \\${Date.now() - options.startDate.getTime() > 5000 ? Math.floor((Date.now() - options.startDate.getTime()) / 1000) : Date.now() - options.startDate.getTime()} \\${Date.now() - options.startDate.getTime() > 5000 ? \"seconds\" : \"milliseconds\"}\\` : \"\"}...\\`);\n if (!options.skipProcessExit) {\n process.nextTick(() => process.exit(exitCode));\n }\n };\n\n for (const callbackSync of callbackSyncQueue) {\n callbackSync(exitCode);\n }\n\n if (!options.isSynchronous) {\n const promises = [];\n let forceAfter = 0;\n for (const [callbackAsync, wait] of callbackAsyncQueue) {\n forceAfter = Math.max(forceAfter, wait);\n promises.push(Promise.resolve(callbackAsync(exitCode)));\n }\n\n const asyncTimer = setTimeout(() => {\n terminate(true);\n }, forceAfter);\n await Promise.all(promises);\n clearTimeout(asyncTimer);\n }\n\n terminate();\n } catch (err) {\n error(\\`The exit process failed to complete\\${(err as Error)?.message ? \\` - \\${(err as Error).message}\\` : \"\"}. Please contact the ${getAppTitle(\n context,\n true\n )} support team.\\`);\n\n if (!options.skipProcessExit) {\n process.nextTick(() => process.exit(1));\n }\n }\n `}\n </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":"yiBA4BA,SAAS,GAA+B,CACxC,IAAQ,EAAC,GAAqB,CAC9B,MAAO,CAAA,EAAO,EAAoC,WAEhD,KAAA,cACC,IAAK,yCACN,IAAA,UAAA,CACI,MAAC,CAAA,EAAS,EAA0B,CAClC,KAAA,wBAEA,KAAC,iBACJ,IAAA,+FACE,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACC,KAAA,kBACA,SAAM,GACN,KAAK,UACL,IAAC,6SACF,CAAC,CAAE,EAAe,MAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACjB,KAAE,gBACF,SAAQ,GACR,KAAM,UACN,IAAC,2QACF,CAAC,CAAC,EAAK,MAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACN,KAAC,SACD,SAAQ,GACR,KAAE,SACF,IAAE,+IACH,CAAC,CAAE,EAAe,MAAQ,EAAI,CAAA,CAAA,EAAqB,EAAiB,CACnE,KAAC,YACD,SAAM,GACN,KAAC,OACD,IAAE,uIACH,CAAC,CAAC,EAEN,CAAC,CAAE,EAAkB,EAAS,EAAA,CAAG,CAAC,EAAc,EAAe,CAC9D,IAAK,GACL,KAAK,YACL,KAAK,UACL,YAAY,CAAA,SACb,CAAC,CAAE,EAAI,EAAA,CACN,MAAM,GACN,KAAM,qBACN,KAAK,mEACL,YAAU,CAAA,MACX,CAAC,CAAE,EAAG,EAAA,CACL,MAAM,GACN,KAAM,oBACN,KAAM,yCACN,YAAa,CAAI,MAClB,CAAC,CAAE,EAAG,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACL,OAAI,GACJ,MAAG,GACH,KAAG,OACH,WAAI,CAAA,CACF,KAAM,UACN,KAAM,cACN,QAAE,KACH,CAAC,CACF,IAAG,UAAA,CACD,MAAE,CAAA,MAAA,CAAA;;;;;;;;;;;;;;;;4GAgBY,EAAA,EAAA,CAAA;;;;;qDAKV,CAAA,EAAA,EAAA,CACF,IAAE,WAAA,CACD,OAAI,EAAA,EAAA,EAAA,CAAA,EAEL,SAAQ,CAAA,iBACT,CAAC,CAAE,EAAU,MAAA,EAAA,CAAA,CAAA,MAAA,CAAA;8BACR,EAAA,EAAA,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;kJA2B+H,EAAmB,EAAQ,GAAM,CAAC;;;;;;UAMnK,CAAC,EAER,CAAC,CAAC"}
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_components_exit_function_declaration = require('./exit-function-declaration.cjs');
|
|
3
|
-
const require_components_bin_entry = require('./bin-entry.cjs');
|
|
4
|
-
const require_components_command_router = require('./command-router.cjs');
|
|
5
|
-
const require_components_virtual_command_entry = require('./virtual-command-entry.cjs');
|
|
6
|
-
const require_components_command_entry = require('./command-entry.cjs');
|
|
7
|
-
|
|
8
|
-
exports.BinEntry = require_components_bin_entry.BinEntry;
|
|
9
|
-
exports.CommandEntry = require_components_command_entry.CommandEntry;
|
|
10
|
-
exports.CommandHandlerDeclaration = require_components_command_entry.CommandHandlerDeclaration;
|
|
11
|
-
exports.CommandInvocation = require_components_command_entry.CommandInvocation;
|
|
12
|
-
exports.CommandRouter = require_components_command_router.CommandRouter;
|
|
13
|
-
exports.CommandRouterBody = require_components_command_router.CommandRouterBody;
|
|
14
|
-
exports.CommandRouterRoute = require_components_command_router.CommandRouterRoute;
|
|
15
|
-
exports.ExitFunctionDeclaration = require_components_exit_function_declaration.ExitFunctionDeclaration;
|
|
16
|
-
exports.RunApplication = require_components_bin_entry.RunApplication;
|
|
17
|
-
exports.VirtualCommandEntry = require_components_virtual_command_entry.VirtualCommandEntry;
|
|
18
|
-
exports.VirtualCommandHandlerDeclaration = require_components_virtual_command_entry.VirtualCommandHandlerDeclaration;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./exit-function-declaration.cjs`),t=require(`./bin-entry.cjs`),n=require(`./command-router.cjs`),r=require(`./virtual-command-entry.cjs`),i=require(`./command-entry.cjs`);exports.BinEntry=t.BinEntry,exports.CommandEntry=i.CommandEntry,exports.CommandHandlerDeclaration=i.CommandHandlerDeclaration,exports.CommandInvocation=i.CommandInvocation,exports.CommandRouter=n.CommandRouter,exports.CommandRouterBody=n.CommandRouterBody,exports.CommandRouterRoute=n.CommandRouterRoute,exports.ExitFunctionDeclaration=e.ExitFunctionDeclaration,exports.RunApplication=t.RunApplication,exports.VirtualCommandEntry=r.VirtualCommandEntry,exports.VirtualCommandHandlerDeclaration=r.VirtualCommandHandlerDeclaration;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BinEntry, RunApplication } from "./bin-entry.mjs";
|
|
3
|
-
import { CommandRouter, CommandRouterBody, CommandRouterRoute } from "./command-router.mjs";
|
|
4
|
-
import { VirtualCommandEntry, VirtualCommandHandlerDeclaration } from "./virtual-command-entry.mjs";
|
|
5
|
-
import { CommandEntry, CommandHandlerDeclaration, CommandInvocation } from "./command-entry.mjs";
|
|
6
|
-
|
|
7
|
-
export { BinEntry, CommandEntry, CommandHandlerDeclaration, CommandInvocation, CommandRouter, CommandRouterBody, CommandRouterRoute, ExitFunctionDeclaration, RunApplication, VirtualCommandEntry, VirtualCommandHandlerDeclaration };
|
|
1
|
+
import{ExitFunctionDeclaration as e}from"./exit-function-declaration.mjs";import{BinEntry as t,RunApplication as n}from"./bin-entry.mjs";import{CommandRouter as r,CommandRouterBody as i,CommandRouterRoute as a}from"./command-router.mjs";import{VirtualCommandEntry as o,VirtualCommandHandlerDeclaration as s}from"./virtual-command-entry.mjs";import{CommandEntry as c,CommandHandlerDeclaration as l,CommandInvocation as u}from"./command-entry.mjs";export{t as BinEntry,c as CommandEntry,l as CommandHandlerDeclaration,u as CommandInvocation,r as CommandRouter,i as CommandRouterBody,a as CommandRouterRoute,e as ExitFunctionDeclaration,n as RunApplication,o as VirtualCommandEntry,s as VirtualCommandHandlerDeclaration};
|
|
@@ -1,154 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_components_command_router = require('./command-router.cjs');
|
|
4
|
-
const require_components_command_entry = require('./command-entry.cjs');
|
|
5
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
8
|
-
let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
|
|
9
|
-
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
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_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
13
|
-
let defu = require("defu");
|
|
14
|
-
defu = require_runtime.__toESM(defu);
|
|
15
|
-
let _stryke_path_join = require("@stryke/path/join");
|
|
16
|
-
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
17
|
-
let _powerlines_plugin_alloy_typescript_components_typescript_file = require("@powerlines/plugin-alloy/typescript/components/typescript-file");
|
|
18
|
-
|
|
19
|
-
//#region src/components/virtual-command-entry.tsx
|
|
20
|
-
/**
|
|
21
|
-
* A component that generates the `handler` function declaration for a command.
|
|
22
|
-
*/
|
|
23
|
-
function VirtualCommandHandlerDeclaration(props) {
|
|
24
|
-
const { command, children, banner } = props;
|
|
25
|
-
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
26
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
27
|
-
get heading() {
|
|
28
|
-
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(" ")}) virtual command.`;
|
|
29
|
-
},
|
|
30
|
-
get children() {
|
|
31
|
-
return [
|
|
32
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { get children() {
|
|
33
|
-
return `${command.description.replace(/\.+$/, "")}.`;
|
|
34
|
-
} }),
|
|
35
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
36
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocTitle, { get children() {
|
|
37
|
-
return command.title;
|
|
38
|
-
} }),
|
|
39
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
40
|
-
name: "args",
|
|
41
|
-
children: `The command-line arguments passed to the command.`
|
|
42
|
-
})
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
46
|
-
"export": true,
|
|
47
|
-
async: true,
|
|
48
|
-
name: "handler",
|
|
49
|
-
parameters: [{
|
|
50
|
-
name: "args",
|
|
51
|
-
type: "string[]",
|
|
52
|
-
default: "useArgs()"
|
|
53
|
-
}],
|
|
54
|
-
get children() {
|
|
55
|
-
return [
|
|
56
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
57
|
-
children,
|
|
58
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
59
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
60
|
-
get when() {
|
|
61
|
-
return Boolean(banner);
|
|
62
|
-
},
|
|
63
|
-
children: banner
|
|
64
|
-
}),
|
|
65
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
66
|
-
_alloy_js_core.code`return showHelp(); `
|
|
67
|
-
];
|
|
68
|
-
}
|
|
69
|
-
})];
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The virtual command entry point for the Shell Shock project.
|
|
73
|
-
*/
|
|
74
|
-
function VirtualCommandEntry(props) {
|
|
75
|
-
const { command, imports, builtinImports, ...rest } = props;
|
|
76
|
-
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
77
|
-
const filePath = (0, _alloy_js_core.computed)(() => (0, _stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
|
|
78
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
79
|
-
get path() {
|
|
80
|
-
return filePath.value;
|
|
81
|
-
},
|
|
82
|
-
get imports() {
|
|
83
|
-
return (0, defu.default)(imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
|
|
84
|
-
ret[`./${child.name}`] = [{
|
|
85
|
-
name: "handler",
|
|
86
|
-
alias: `handle${(0, _stryke_string_format_pascal_case.pascalCase)(name)}`
|
|
87
|
-
}];
|
|
88
|
-
return ret;
|
|
89
|
-
}, {}));
|
|
90
|
-
},
|
|
91
|
-
get builtinImports() {
|
|
92
|
-
return (0, defu.default)(builtinImports ?? {}, {
|
|
93
|
-
env: ["isDevelopment", "isDebug"],
|
|
94
|
-
console: [
|
|
95
|
-
"warn",
|
|
96
|
-
"error",
|
|
97
|
-
"writeLine",
|
|
98
|
-
"textColors"
|
|
99
|
-
],
|
|
100
|
-
utils: [
|
|
101
|
-
"isMinimal",
|
|
102
|
-
"isUnicodeSupported",
|
|
103
|
-
"findSuggestions"
|
|
104
|
-
],
|
|
105
|
-
state: [
|
|
106
|
-
"useGlobal",
|
|
107
|
-
"GlobalOptions",
|
|
108
|
-
"useGlobalOptions",
|
|
109
|
-
"withCommand",
|
|
110
|
-
"useArgs",
|
|
111
|
-
"hasFlag"
|
|
112
|
-
],
|
|
113
|
-
[(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"],
|
|
114
|
-
[(0, _stryke_path_join.joinPaths)("banner", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showBanner"]
|
|
115
|
-
});
|
|
116
|
-
},
|
|
117
|
-
get children() {
|
|
118
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandHandlerDeclaration, {
|
|
119
|
-
command,
|
|
120
|
-
banner: _alloy_js_core.code`await showBanner(); `,
|
|
121
|
-
get children() {
|
|
122
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
|
|
123
|
-
get segments() {
|
|
124
|
-
return command.segments;
|
|
125
|
-
},
|
|
126
|
-
get commands() {
|
|
127
|
-
return command.children;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
})];
|
|
132
|
-
}
|
|
133
|
-
})), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
134
|
-
get each() {
|
|
135
|
-
return Object.values(command.children);
|
|
136
|
-
},
|
|
137
|
-
children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
138
|
-
get when() {
|
|
139
|
-
return child.isVirtual;
|
|
140
|
-
},
|
|
141
|
-
get fallback() {
|
|
142
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
|
|
143
|
-
},
|
|
144
|
-
get children() {
|
|
145
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandEntry, { command: child });
|
|
146
|
-
}
|
|
147
|
-
})
|
|
148
|
-
})];
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
//#endregion
|
|
152
|
-
exports.VirtualCommandEntry = VirtualCommandEntry;
|
|
153
|
-
exports.VirtualCommandHandlerDeclaration = VirtualCommandHandlerDeclaration;
|
|
154
|
-
//# sourceMappingURL=virtual-command-entry.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`./command-router.cjs`),n=require(`./command-entry.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@alloy-js/core`),a=require(`@alloy-js/typescript`),o=require(`@powerlines/plugin-alloy/core/components`),s=require(`@powerlines/plugin-alloy/core/contexts/context`),c=require(`@powerlines/plugin-alloy/typescript/components/tsdoc`),l=require(`@shell-shock/core/plugin-utils`),u=require(`@stryke/string-format/pascal-case`),d=require(`defu`);d=e.__toESM(d);let f=require(`@stryke/path/join`),p=require(`@stryke/string-format/constant-case`),m=require(`@powerlines/plugin-alloy/typescript/components/typescript-file`);function h(e){let{command:t,children:n,banner:u}=e,d=(0,s.usePowerlines)();return[(0,r.createComponent)(c.TSDoc,{get heading(){return`The ${t.title} (${(0,l.getAppBin)(d)} ${t.segments.map(e=>(0,l.isDynamicPathSegment)(e)?`[${(0,p.constantCase)((0,l.getDynamicPathSegmentName)(e))}]`:e).join(` `)}) virtual command.`},get children(){return[(0,r.createComponent)(c.TSDocRemarks,{get children(){return`${t.description.replace(/\.+$/,``)}.`}}),(0,r.createIntrinsic)(`hbr`,{}),(0,r.createComponent)(c.TSDocTitle,{get children(){return t.title}}),(0,r.createComponent)(c.TSDocParam,{name:`args`,children:`The command-line arguments passed to the command.`})]}}),(0,r.createComponent)(a.FunctionDeclaration,{export:!0,async:!0,name:`handler`,parameters:[{name:`args`,type:`string[]`,default:`useArgs()`}],get children(){return[(0,r.createComponent)(o.Spacing,{}),n,(0,r.createComponent)(o.Spacing,{}),(0,r.createComponent)(i.Show,{get when(){return!!u},children:u}),(0,r.createComponent)(o.Spacing,{}),i.code`return showHelp(); `]}})]}function g(e){let{command:a,imports:c,builtinImports:p,..._}=e,v=(0,s.usePowerlines)(),y=(0,i.computed)(()=>(0,f.joinPaths)(v.entryPath,a.segments.filter(e=>!(0,l.isDynamicPathSegment)(e)).join(`/`),`index.ts`));return[(0,r.createComponent)(m.TypescriptFile,(0,r.mergeProps)(_,{get path(){return y.value},get imports(){return(0,d.default)(c??{},Object.entries(a.children).filter(([,e])=>e.isVirtual).reduce((e,[t,n])=>(e[`./${n.name}`]=[{name:`handler`,alias:`handle${(0,u.pascalCase)(t)}`}],e),{}))},get builtinImports(){return(0,d.default)(p??{},{env:[`isDevelopment`,`isDebug`],console:[`warn`,`error`,`writeLine`,`textColors`],utils:[`isMinimal`,`isUnicodeSupported`,`findSuggestions`],state:[{name:`GlobalOptions`,type:!0},`useGlobal`,`useGlobalOptions`,`withCommand`,`useArgs`,`hasFlag`],[(0,f.joinPaths)(`help`,...a.segments.filter(e=>!(0,l.isDynamicPathSegment)(e)))]:[`showHelp`],[(0,f.joinPaths)(`banner`,...a.segments.filter(e=>!(0,l.isDynamicPathSegment)(e)))]:[`showBanner`]})},get children(){return[(0,r.createComponent)(o.Spacing,{}),(0,r.createComponent)(h,{command:a,banner:i.code`await showBanner(); `,get children(){return(0,r.createComponent)(t.CommandRouter,{get segments(){return a.segments},get commands(){return a.children}})}})]}})),(0,r.createComponent)(i.For,{get each(){return Object.values(a.children)},children:e=>(0,r.createComponent)(i.Show,{get when(){return e.isVirtual},get fallback(){return(0,r.createComponent)(n.CommandEntry,{command:e})},get children(){return(0,r.createComponent)(g,{command:e})}})})]}exports.VirtualCommandEntry=g,exports.VirtualCommandHandlerDeclaration=h;
|
|
@@ -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"}
|