@shell-shock/preset-script 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/dist/components/args-parser-logic.cjs +678 -0
  3. package/dist/components/args-parser-logic.cjs.map +1 -0
  4. package/dist/components/args-parser-logic.d.cts +45 -0
  5. package/dist/components/args-parser-logic.d.cts.map +1 -0
  6. package/dist/components/args-parser-logic.d.mts +45 -0
  7. package/dist/components/args-parser-logic.d.mts.map +1 -0
  8. package/dist/components/args-parser-logic.mjs +672 -0
  9. package/dist/components/args-parser-logic.mjs.map +1 -0
  10. package/dist/components/bin-entry.cjs +188 -0
  11. package/dist/components/bin-entry.cjs.map +1 -0
  12. package/dist/components/{entry/bin.d.cts → bin-entry.d.cts} +9 -3
  13. package/dist/components/bin-entry.d.cts.map +1 -0
  14. package/dist/components/{entry/bin.d.mts → bin-entry.d.mts} +9 -3
  15. package/dist/components/bin-entry.d.mts.map +1 -0
  16. package/dist/components/bin-entry.mjs +185 -0
  17. package/dist/components/bin-entry.mjs.map +1 -0
  18. package/dist/components/command-entry.cjs +162 -0
  19. package/dist/components/command-entry.cjs.map +1 -0
  20. package/dist/components/command-entry.d.cts +24 -0
  21. package/dist/components/command-entry.d.cts.map +1 -0
  22. package/dist/components/command-entry.d.mts +24 -0
  23. package/dist/components/command-entry.d.mts.map +1 -0
  24. package/dist/components/command-entry.mjs +158 -0
  25. package/dist/components/command-entry.mjs.map +1 -0
  26. package/dist/components/command-router.cjs +129 -74
  27. package/dist/components/command-router.cjs.map +1 -1
  28. package/dist/components/command-router.d.cts +13 -4
  29. package/dist/components/command-router.d.cts.map +1 -0
  30. package/dist/components/command-router.d.mts +13 -4
  31. package/dist/components/command-router.d.mts.map +1 -0
  32. package/dist/components/command-router.mjs +128 -73
  33. package/dist/components/command-router.mjs.map +1 -1
  34. package/dist/components/console-builtin.cjs +2086 -0
  35. package/dist/components/console-builtin.cjs.map +1 -0
  36. package/dist/components/console-builtin.d.cts +56 -0
  37. package/dist/components/console-builtin.d.cts.map +1 -0
  38. package/dist/components/console-builtin.d.mts +56 -0
  39. package/dist/components/console-builtin.d.mts.map +1 -0
  40. package/dist/components/console-builtin.mjs +2077 -0
  41. package/dist/components/console-builtin.mjs.map +1 -0
  42. package/dist/components/help.cjs +130 -0
  43. package/dist/components/help.cjs.map +1 -0
  44. package/dist/components/help.d.cts +57 -0
  45. package/dist/components/help.d.cts.map +1 -0
  46. package/dist/components/help.d.mts +57 -0
  47. package/dist/components/help.d.mts.map +1 -0
  48. package/dist/components/help.mjs +126 -0
  49. package/dist/components/help.mjs.map +1 -0
  50. package/dist/components/index.cjs +39 -15
  51. package/dist/components/index.d.cts +9 -7
  52. package/dist/components/index.d.mts +9 -7
  53. package/dist/components/index.mjs +8 -6
  54. package/dist/components/utils-builtin.cjs +612 -0
  55. package/dist/components/utils-builtin.cjs.map +1 -0
  56. package/dist/components/utils-builtin.d.cts +32 -0
  57. package/dist/components/utils-builtin.d.cts.map +1 -0
  58. package/dist/components/utils-builtin.d.mts +32 -0
  59. package/dist/components/utils-builtin.d.mts.map +1 -0
  60. package/dist/components/utils-builtin.mjs +605 -0
  61. package/dist/components/utils-builtin.mjs.map +1 -0
  62. package/dist/components/virtual-command-entry.cjs +140 -0
  63. package/dist/components/virtual-command-entry.cjs.map +1 -0
  64. package/dist/components/virtual-command-entry.d.cts +21 -0
  65. package/dist/components/virtual-command-entry.d.cts.map +1 -0
  66. package/dist/components/virtual-command-entry.d.mts +21 -0
  67. package/dist/components/virtual-command-entry.d.mts.map +1 -0
  68. package/dist/components/virtual-command-entry.mjs +137 -0
  69. package/dist/components/virtual-command-entry.mjs.map +1 -0
  70. package/dist/contexts/index.cjs +4 -0
  71. package/dist/contexts/index.d.cts +2 -0
  72. package/dist/contexts/index.d.mts +2 -0
  73. package/dist/contexts/index.mjs +3 -0
  74. package/dist/contexts/theme.d.cts +20 -0
  75. package/dist/contexts/theme.d.cts.map +1 -0
  76. package/dist/contexts/theme.d.mts +20 -0
  77. package/dist/contexts/theme.d.mts.map +1 -0
  78. package/dist/helpers/ansi-utils.cjs +28 -4
  79. package/dist/helpers/ansi-utils.cjs.map +1 -1
  80. package/dist/helpers/ansi-utils.d.cts +68 -0
  81. package/dist/helpers/ansi-utils.d.cts.map +1 -0
  82. package/dist/helpers/ansi-utils.d.mts +68 -0
  83. package/dist/helpers/ansi-utils.d.mts.map +1 -0
  84. package/dist/helpers/ansi-utils.mjs +28 -4
  85. package/dist/helpers/ansi-utils.mjs.map +1 -1
  86. package/dist/helpers/get-default-options.cjs +6 -13
  87. package/dist/helpers/get-default-options.cjs.map +1 -1
  88. package/dist/helpers/get-default-options.mjs +6 -13
  89. package/dist/helpers/get-default-options.mjs.map +1 -1
  90. package/dist/index.cjs +117 -29
  91. package/dist/index.cjs.map +1 -1
  92. package/dist/index.d.cts.map +1 -0
  93. package/dist/index.d.mts.map +1 -0
  94. package/dist/index.mjs +118 -28
  95. package/dist/index.mjs.map +1 -1
  96. package/dist/types/plugin.d.cts +1 -6
  97. package/dist/types/plugin.d.cts.map +1 -0
  98. package/dist/types/plugin.d.mts +1 -6
  99. package/dist/types/plugin.d.mts.map +1 -0
  100. package/package.json +163 -71
  101. package/dist/components/builtin/console.cjs +0 -1232
  102. package/dist/components/builtin/console.cjs.map +0 -1
  103. package/dist/components/builtin/console.d.cts +0 -37
  104. package/dist/components/builtin/console.d.mts +0 -37
  105. package/dist/components/builtin/console.mjs +0 -1225
  106. package/dist/components/builtin/console.mjs.map +0 -1
  107. package/dist/components/builtin/index.cjs +0 -9
  108. package/dist/components/builtin/index.d.cts +0 -2
  109. package/dist/components/builtin/index.d.mts +0 -2
  110. package/dist/components/builtin/index.mjs +0 -3
  111. package/dist/components/entry/bin.cjs +0 -92
  112. package/dist/components/entry/bin.cjs.map +0 -1
  113. package/dist/components/entry/bin.mjs +0 -91
  114. package/dist/components/entry/bin.mjs.map +0 -1
  115. package/dist/components/entry/command.cjs +0 -54
  116. package/dist/components/entry/command.cjs.map +0 -1
  117. package/dist/components/entry/command.d.cts +0 -15
  118. package/dist/components/entry/command.d.mts +0 -15
  119. package/dist/components/entry/command.mjs +0 -53
  120. package/dist/components/entry/command.mjs.map +0 -1
  121. package/dist/components/entry/index.cjs +0 -3
  122. package/dist/components/entry/index.d.cts +0 -2
  123. package/dist/components/entry/index.d.mts +0 -2
  124. package/dist/components/entry/index.mjs +0 -3
  125. package/dist/components/shutdown.cjs +0 -93
  126. package/dist/components/shutdown.cjs.map +0 -1
  127. package/dist/components/shutdown.d.cts +0 -14
  128. package/dist/components/shutdown.d.mts +0 -14
  129. package/dist/components/shutdown.mjs +0 -91
  130. package/dist/components/shutdown.mjs.map +0 -1
  131. package/dist/contexts/command.cjs +0 -21
  132. package/dist/contexts/command.cjs.map +0 -1
  133. package/dist/contexts/command.mjs +0 -19
  134. package/dist/contexts/command.mjs.map +0 -1
@@ -1,93 +0,0 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
- let __alloy_js_core = require("@alloy-js/core");
4
- let __alloy_js_typescript = require("@alloy-js/typescript");
5
- let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
6
-
7
- //#region src/components/shutdown.tsx
8
- /**
9
- * The `shutdown` handler function declaration code for the Shell Shock project.
10
- */
11
- function ShutdownFunctionDeclaration() {
12
- const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
13
- return [
14
- (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
15
- "let": true,
16
- name: "isShutdown",
17
- type: "boolean",
18
- initializer: __alloy_js_core.code`false;`
19
- }),
20
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
21
- (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
22
- name: "shutdown",
23
- parameters: [{
24
- name: "exception",
25
- type: "string | Error",
26
- optional: true
27
- }],
28
- get children() {
29
- return __alloy_js_core.code`
30
- try {
31
- if (isShutdown) {
32
- return;
33
- }
34
-
35
- isShutdown = true;
36
-
37
- if (exception) {
38
- error(\`A fatal error occured while running the application - please contact the ${context.config.title} support team: \\n\${typeof exception === "string" ? exception : exception.message}\`);
39
- }
40
-
41
- verbose(\`The ${context.config.title} application exited \${exception ? \`early due to an exception\` : "successfully"}...\`);
42
- process.exit(exception ? 1 : 0);
43
- } catch (err) {
44
- error(\`The shutdown process failed to complete\${(err as Error).message ? \` - (err as Error).message\` : ""}. Please contact the ${context.config.title} support team.\`);
45
- process.exit(1);
46
- }
47
- `;
48
- }
49
- })
50
- ];
51
- }
52
- /**
53
- * The `shutdown` handler function usage code for the Shell Shock project.
54
- */
55
- function ShutdownFunctionUsage() {
56
- return [
57
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
58
- __alloy_js_core.code`try {
59
- if ("process" in globalThis && !("Deno" in globalThis)) {
60
- // eslint-disable-next-line ts/no-misused-promises
61
- process.on("exit", shutdown);
62
- }
63
-
64
- for (const type of ["unhandledRejection", "uncaughtException"]) {
65
- process.on(type, err => shutdown(err || new Error(\`An \${type === "unhandledRejection" ? "unhandled promise rejection" : "uncaught exception"} occurred during processing - the application is shutting down.\`)));
66
- }
67
-
68
- for (const type of ["SIGTERM", "SIGINT", "SIGUSR2"]) {
69
- process.once(type, () => {
70
- verbose("The application was terminated by the user");
71
- return shutdown();
72
- });
73
- }
74
-
75
- const result = await main();
76
- if (result?.error) {
77
- danger(result.error);
78
- }
79
-
80
- shutdown();
81
- } catch (err) {
82
- verbose("An exception occurred during processing");
83
- shutdown(err);
84
- }
85
- `,
86
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
87
- ];
88
- }
89
-
90
- //#endregion
91
- exports.ShutdownFunctionDeclaration = ShutdownFunctionDeclaration;
92
- exports.ShutdownFunctionUsage = ShutdownFunctionUsage;
93
- //# sourceMappingURL=shutdown.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shutdown.cjs","names":["code","FunctionDeclaration","VarDeclaration","usePowerlines","ShutdownFunctionDeclaration","context","_$createComponent","name","type","initializer","_$createIntrinsic","parameters","optional","children","config","title","ShutdownFunctionUsage"],"sources":["../../src/components/shutdown.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 { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\n/**\n * The `shutdown` handler function declaration code for the Shell Shock project.\n */\nexport function ShutdownFunctionDeclaration() {\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <VarDeclaration\n let\n name=\"isShutdown\"\n type=\"boolean\"\n initializer={code`false;`}\n />\n <hbr />\n <FunctionDeclaration\n name=\"shutdown\"\n parameters={[\n { name: \"exception\", type: \"string | Error\", optional: true }\n ]}>\n {code`\n try {\n if (isShutdown) {\n return;\n }\n\n isShutdown = true;\n\n if (exception) {\n error(\\`A fatal error occured while running the application - please contact the ${\n context.config.title\n } support team: \\\\n\\${typeof exception === \"string\" ? exception : exception.message}\\`);\n }\n\n verbose(\\`The ${context.config.title} application exited \\${exception ? \\`early due to an exception\\` : \"successfully\"}...\\`);\n process.exit(exception ? 1 : 0);\n } catch (err) {\n error(\\`The shutdown process failed to complete\\${(err as Error).message ? \\` - (err as Error).message\\` : \"\"}. Please contact the ${\n context.config.title\n } support team.\\`);\n process.exit(1);\n }\n `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `shutdown` handler function usage code for the Shell Shock project.\n */\nexport function ShutdownFunctionUsage() {\n return (\n <>\n <hbr />\n {code`try {\n if (\"process\" in globalThis && !(\"Deno\" in globalThis)) {\n // eslint-disable-next-line ts/no-misused-promises\n process.on(\"exit\", shutdown);\n }\n\n for (const type of [\"unhandledRejection\", \"uncaughtException\"]) {\n process.on(type, err => shutdown(err || new Error(\\`An \\${type === \"unhandledRejection\" ? \"unhandled promise rejection\" : \"uncaught exception\"} occurred during processing - the application is shutting down.\\`)));\n }\n\n for (const type of [\"SIGTERM\", \"SIGINT\", \"SIGUSR2\"]) {\n process.once(type, () => {\n verbose(\"The application was terminated by the user\");\n return shutdown();\n });\n }\n\n const result = await main();\n if (result?.error) {\n danger(result.error);\n }\n\n shutdown();\n } catch (err) {\n verbose(\"An exception occurred during processing\");\n shutdown(err);\n }\n `}\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgBI,8BAA8B;CAC5C,MAAMC,8EAA8C;AAEpD,QAAA;mDAEKH,sCAAc;GAAA,OAAA;GAEbK,MAAI;GACJC,MAAI;GACJC,aAAaT,oBAAI;GAAQ,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAG1BC,2CAAmB;GAClBM,MAAI;GACJI,YAAY,CACV;IAAEJ,MAAM;IAAaC,MAAM;IAAkBI,UAAU;IAAM,CAC9D;GAAA,IAAAC,WAAA;AAAA,WACAb,oBAAI;;;;;;;;;iGAUGK,QAAQS,OAAOC,MAAK;;;4BAIRV,QAAQS,OAAOC,MAAK;;;iJAIlCV,QAAQS,OAAOC,MAAK;;;;;GAIzB,CAAA;EAAA;;;;;AAST,SAAgBC,wBAAwB;AACtC,QAAA;mDAAA,OAAA,EAAA,CAAA;EAGKhB,oBAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDA2BJ,OAAA,EAAA,CAAA;EAAA"}
@@ -1,14 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
-
3
- //#region src/components/shutdown.d.ts
4
- /**
5
- * The `shutdown` handler function declaration code for the Shell Shock project.
6
- */
7
- declare function ShutdownFunctionDeclaration(): _alloy_js_core0.Children;
8
- /**
9
- * The `shutdown` handler function usage code for the Shell Shock project.
10
- */
11
- declare function ShutdownFunctionUsage(): _alloy_js_core0.Children;
12
- //#endregion
13
- export { ShutdownFunctionDeclaration, ShutdownFunctionUsage };
14
- //# sourceMappingURL=shutdown.d.cts.map
@@ -1,14 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
-
3
- //#region src/components/shutdown.d.ts
4
- /**
5
- * The `shutdown` handler function declaration code for the Shell Shock project.
6
- */
7
- declare function ShutdownFunctionDeclaration(): _alloy_js_core0.Children;
8
- /**
9
- * The `shutdown` handler function usage code for the Shell Shock project.
10
- */
11
- declare function ShutdownFunctionUsage(): _alloy_js_core0.Children;
12
- //#endregion
13
- export { ShutdownFunctionDeclaration, ShutdownFunctionUsage };
14
- //# sourceMappingURL=shutdown.d.mts.map
@@ -1,91 +0,0 @@
1
- import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
2
- import { code } from "@alloy-js/core";
3
- import { FunctionDeclaration, VarDeclaration } from "@alloy-js/typescript";
4
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
5
-
6
- //#region src/components/shutdown.tsx
7
- /**
8
- * The `shutdown` handler function declaration code for the Shell Shock project.
9
- */
10
- function ShutdownFunctionDeclaration() {
11
- const context = usePowerlines();
12
- return [
13
- createComponent(VarDeclaration, {
14
- "let": true,
15
- name: "isShutdown",
16
- type: "boolean",
17
- initializer: code`false;`
18
- }),
19
- createIntrinsic("hbr", {}),
20
- createComponent(FunctionDeclaration, {
21
- name: "shutdown",
22
- parameters: [{
23
- name: "exception",
24
- type: "string | Error",
25
- optional: true
26
- }],
27
- get children() {
28
- return code`
29
- try {
30
- if (isShutdown) {
31
- return;
32
- }
33
-
34
- isShutdown = true;
35
-
36
- if (exception) {
37
- error(\`A fatal error occured while running the application - please contact the ${context.config.title} support team: \\n\${typeof exception === "string" ? exception : exception.message}\`);
38
- }
39
-
40
- verbose(\`The ${context.config.title} application exited \${exception ? \`early due to an exception\` : "successfully"}...\`);
41
- process.exit(exception ? 1 : 0);
42
- } catch (err) {
43
- error(\`The shutdown process failed to complete\${(err as Error).message ? \` - (err as Error).message\` : ""}. Please contact the ${context.config.title} support team.\`);
44
- process.exit(1);
45
- }
46
- `;
47
- }
48
- })
49
- ];
50
- }
51
- /**
52
- * The `shutdown` handler function usage code for the Shell Shock project.
53
- */
54
- function ShutdownFunctionUsage() {
55
- return [
56
- createIntrinsic("hbr", {}),
57
- code`try {
58
- if ("process" in globalThis && !("Deno" in globalThis)) {
59
- // eslint-disable-next-line ts/no-misused-promises
60
- process.on("exit", shutdown);
61
- }
62
-
63
- for (const type of ["unhandledRejection", "uncaughtException"]) {
64
- process.on(type, err => shutdown(err || new Error(\`An \${type === "unhandledRejection" ? "unhandled promise rejection" : "uncaught exception"} occurred during processing - the application is shutting down.\`)));
65
- }
66
-
67
- for (const type of ["SIGTERM", "SIGINT", "SIGUSR2"]) {
68
- process.once(type, () => {
69
- verbose("The application was terminated by the user");
70
- return shutdown();
71
- });
72
- }
73
-
74
- const result = await main();
75
- if (result?.error) {
76
- danger(result.error);
77
- }
78
-
79
- shutdown();
80
- } catch (err) {
81
- verbose("An exception occurred during processing");
82
- shutdown(err);
83
- }
84
- `,
85
- createIntrinsic("hbr", {})
86
- ];
87
- }
88
-
89
- //#endregion
90
- export { ShutdownFunctionDeclaration, ShutdownFunctionUsage };
91
- //# sourceMappingURL=shutdown.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shutdown.mjs","names":["code","FunctionDeclaration","VarDeclaration","usePowerlines","ShutdownFunctionDeclaration","context","_$createComponent","name","type","initializer","_$createIntrinsic","parameters","optional","children","config","title","ShutdownFunctionUsage"],"sources":["../../src/components/shutdown.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 { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\n/**\n * The `shutdown` handler function declaration code for the Shell Shock project.\n */\nexport function ShutdownFunctionDeclaration() {\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <VarDeclaration\n let\n name=\"isShutdown\"\n type=\"boolean\"\n initializer={code`false;`}\n />\n <hbr />\n <FunctionDeclaration\n name=\"shutdown\"\n parameters={[\n { name: \"exception\", type: \"string | Error\", optional: true }\n ]}>\n {code`\n try {\n if (isShutdown) {\n return;\n }\n\n isShutdown = true;\n\n if (exception) {\n error(\\`A fatal error occured while running the application - please contact the ${\n context.config.title\n } support team: \\\\n\\${typeof exception === \"string\" ? exception : exception.message}\\`);\n }\n\n verbose(\\`The ${context.config.title} application exited \\${exception ? \\`early due to an exception\\` : \"successfully\"}...\\`);\n process.exit(exception ? 1 : 0);\n } catch (err) {\n error(\\`The shutdown process failed to complete\\${(err as Error).message ? \\` - (err as Error).message\\` : \"\"}. Please contact the ${\n context.config.title\n } support team.\\`);\n process.exit(1);\n }\n `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `shutdown` handler function usage code for the Shell Shock project.\n */\nexport function ShutdownFunctionUsage() {\n return (\n <>\n <hbr />\n {code`try {\n if (\"process\" in globalThis && !(\"Deno\" in globalThis)) {\n // eslint-disable-next-line ts/no-misused-promises\n process.on(\"exit\", shutdown);\n }\n\n for (const type of [\"unhandledRejection\", \"uncaughtException\"]) {\n process.on(type, err => shutdown(err || new Error(\\`An \\${type === \"unhandledRejection\" ? \"unhandled promise rejection\" : \"uncaught exception\"} occurred during processing - the application is shutting down.\\`)));\n }\n\n for (const type of [\"SIGTERM\", \"SIGINT\", \"SIGUSR2\"]) {\n process.once(type, () => {\n verbose(\"The application was terminated by the user\");\n return shutdown();\n });\n }\n\n const result = await main();\n if (result?.error) {\n danger(result.error);\n }\n\n shutdown();\n } catch (err) {\n verbose(\"An exception occurred during processing\");\n shutdown(err);\n }\n `}\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgBI,8BAA8B;CAC5C,MAAMC,UAAUF,eAAoC;AAEpD,QAAA;EAAAG,gBAEKJ,gBAAc;GAAA,OAAA;GAEbK,MAAI;GACJC,MAAI;GACJC,aAAaT,IAAI;GAAQ,CAAA;EAAAU,gBAAA,OAAA,EAAA,CAAA;EAAAJ,gBAG1BL,qBAAmB;GAClBM,MAAI;GACJI,YAAY,CACV;IAAEJ,MAAM;IAAaC,MAAM;IAAkBI,UAAU;IAAM,CAC9D;GAAA,IAAAC,WAAA;AAAA,WACAb,IAAI;;;;;;;;;iGAUGK,QAAQS,OAAOC,MAAK;;;4BAIRV,QAAQS,OAAOC,MAAK;;;iJAIlCV,QAAQS,OAAOC,MAAK;;;;;GAIzB,CAAA;EAAA;;;;;AAST,SAAgBC,wBAAwB;AACtC,QAAA;EAAAN,gBAAA,OAAA,EAAA,CAAA;EAGKV,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BJU,gBAAA,OAAA,EAAA,CAAA;EAAA"}
@@ -1,21 +0,0 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let __alloy_js_core = require("@alloy-js/core");
3
-
4
- //#region src/contexts/command.ts
5
- /**
6
- * The reflection parameter context used in template rendering.
7
- */
8
- const CommandContext = (0, __alloy_js_core.createNamedContext)("command");
9
- /**
10
- * Hook to access the Command context.
11
- *
12
- * @returns A reactive version of the current reflection.
13
- */
14
- function useCommand() {
15
- return (0, __alloy_js_core.useContext)(CommandContext);
16
- }
17
-
18
- //#endregion
19
- exports.CommandContext = CommandContext;
20
- exports.useCommand = useCommand;
21
- //# sourceMappingURL=command.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.cjs","names":["createNamedContext","useContext","CommandContext","useCommand"],"sources":["../../src/contexts/command.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 { ComponentContext } from \"@alloy-js/core\";\nimport { createNamedContext, useContext } from \"@alloy-js/core\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const CommandContext: ComponentContext<CommandTree | undefined> =\n createNamedContext<CommandTree | undefined>(\"command\");\n\n/**\n * Hook to access the Command context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useCommand() {\n return useContext<CommandTree | undefined>(CommandContext)!;\n}\n"],"mappings":";;;;;;;AAyBA,MAAaE,yDACiC,UAAU;;;;;;AAOxD,SAAgBC,aAAa;AAC3B,wCAA2CD,eAAe"}
@@ -1,19 +0,0 @@
1
- import { createNamedContext, useContext } from "@alloy-js/core";
2
-
3
- //#region src/contexts/command.ts
4
- /**
5
- * The reflection parameter context used in template rendering.
6
- */
7
- const CommandContext = createNamedContext("command");
8
- /**
9
- * Hook to access the Command context.
10
- *
11
- * @returns A reactive version of the current reflection.
12
- */
13
- function useCommand() {
14
- return useContext(CommandContext);
15
- }
16
-
17
- //#endregion
18
- export { CommandContext, useCommand };
19
- //# sourceMappingURL=command.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.mjs","names":["createNamedContext","useContext","CommandContext","useCommand"],"sources":["../../src/contexts/command.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 { ComponentContext } from \"@alloy-js/core\";\nimport { createNamedContext, useContext } from \"@alloy-js/core\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const CommandContext: ComponentContext<CommandTree | undefined> =\n createNamedContext<CommandTree | undefined>(\"command\");\n\n/**\n * Hook to access the Command context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useCommand() {\n return useContext<CommandTree | undefined>(CommandContext)!;\n}\n"],"mappings":";;;;;;AAyBA,MAAaE,iBACXF,mBAA4C,UAAU;;;;;;AAOxD,SAAgBG,aAAa;AAC3B,QAAOF,WAAoCC,eAAe"}