@shell-shock/core 0.2.1 → 0.3.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 (148) hide show
  1. package/README.md +1 -1
  2. package/dist/api.cjs +15 -3
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +9 -1
  5. package/dist/api.d.cts.map +1 -0
  6. package/dist/api.d.mts +9 -1
  7. package/dist/api.d.mts.map +1 -0
  8. package/dist/api.mjs +14 -3
  9. package/dist/api.mjs.map +1 -0
  10. package/dist/components/docs.cjs +105 -0
  11. package/dist/components/docs.cjs.map +1 -0
  12. package/dist/components/docs.d.cts +56 -0
  13. package/dist/components/docs.d.cts.map +1 -0
  14. package/dist/components/docs.d.mts +56 -0
  15. package/dist/components/docs.d.mts.map +1 -0
  16. package/dist/components/docs.mjs +102 -0
  17. package/dist/components/docs.mjs.map +1 -0
  18. package/dist/components/index.cjs +4 -6
  19. package/dist/components/index.d.cts +2 -2
  20. package/dist/components/index.d.mts +2 -2
  21. package/dist/components/index.mjs +2 -2
  22. package/dist/config.cjs +2 -1
  23. package/dist/config.cjs.map +1 -0
  24. package/dist/config.d.cts +2 -1
  25. package/dist/config.d.cts.map +1 -0
  26. package/dist/config.d.mts +2 -1
  27. package/dist/config.d.mts.map +1 -0
  28. package/dist/config.mjs +2 -1
  29. package/dist/config.mjs.map +1 -0
  30. package/dist/contexts/command.cjs +21 -0
  31. package/dist/contexts/command.cjs.map +1 -0
  32. package/dist/contexts/command.d.cts +18 -0
  33. package/dist/contexts/command.d.cts.map +1 -0
  34. package/dist/contexts/command.d.mts +18 -0
  35. package/dist/contexts/command.d.mts.map +1 -0
  36. package/dist/contexts/command.mjs +19 -0
  37. package/dist/contexts/command.mjs.map +1 -0
  38. package/dist/contexts/index.cjs +4 -0
  39. package/dist/contexts/index.d.cts +2 -0
  40. package/dist/contexts/index.d.mts +2 -0
  41. package/dist/contexts/index.mjs +3 -0
  42. package/dist/helpers/docs-helpers.cjs +17 -0
  43. package/dist/helpers/docs-helpers.cjs.map +1 -0
  44. package/dist/helpers/docs-helpers.mjs +16 -0
  45. package/dist/helpers/docs-helpers.mjs.map +1 -0
  46. package/dist/helpers/persistence.cjs +2 -1
  47. package/dist/helpers/persistence.cjs.map +1 -0
  48. package/dist/helpers/persistence.mjs +2 -1
  49. package/dist/helpers/persistence.mjs.map +1 -0
  50. package/dist/helpers/resolve-command.cjs +118 -33
  51. package/dist/helpers/resolve-command.cjs.map +1 -0
  52. package/dist/helpers/resolve-command.mjs +116 -32
  53. package/dist/helpers/resolve-command.mjs.map +1 -0
  54. package/dist/helpers/update-package-json.cjs +18 -10
  55. package/dist/helpers/update-package-json.cjs.map +1 -0
  56. package/dist/helpers/update-package-json.mjs +17 -10
  57. package/dist/helpers/update-package-json.mjs.map +1 -0
  58. package/dist/helpers/utilities.cjs +30 -30
  59. package/dist/helpers/utilities.cjs.map +1 -0
  60. package/dist/helpers/utilities.mjs +29 -28
  61. package/dist/helpers/utilities.mjs.map +1 -0
  62. package/dist/helpers/validations.cjs +97 -0
  63. package/dist/helpers/validations.cjs.map +1 -0
  64. package/dist/helpers/validations.mjs +97 -0
  65. package/dist/helpers/validations.mjs.map +1 -0
  66. package/dist/index.cjs +5 -13
  67. package/dist/index.cjs.map +1 -0
  68. package/dist/index.d.cts +6 -17
  69. package/dist/index.d.mts +6 -17
  70. package/dist/index.mjs +4 -13
  71. package/dist/index.mjs.map +1 -0
  72. package/dist/plugin-utils/context-helpers.cjs +86 -0
  73. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  74. package/dist/plugin-utils/context-helpers.d.cts +58 -0
  75. package/dist/plugin-utils/context-helpers.d.cts.map +1 -0
  76. package/dist/plugin-utils/context-helpers.d.mts +58 -0
  77. package/dist/plugin-utils/context-helpers.d.mts.map +1 -0
  78. package/dist/plugin-utils/context-helpers.mjs +79 -0
  79. package/dist/plugin-utils/context-helpers.mjs.map +1 -0
  80. package/dist/plugin-utils/get-command-tree.cjs +4 -2
  81. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  82. package/dist/plugin-utils/get-command-tree.d.cts +2 -1
  83. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -0
  84. package/dist/plugin-utils/get-command-tree.d.mts +2 -1
  85. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -0
  86. package/dist/plugin-utils/get-command-tree.mjs +5 -2
  87. package/dist/plugin-utils/get-command-tree.mjs.map +1 -0
  88. package/dist/plugin-utils/index.cjs +14 -1
  89. package/dist/plugin-utils/index.d.cts +4 -1
  90. package/dist/plugin-utils/index.d.mts +4 -1
  91. package/dist/plugin-utils/index.mjs +4 -1
  92. package/dist/plugin-utils/reflect.cjs +25 -0
  93. package/dist/plugin-utils/reflect.cjs.map +1 -0
  94. package/dist/plugin-utils/reflect.d.cts +14 -0
  95. package/dist/plugin-utils/reflect.d.cts.map +1 -0
  96. package/dist/plugin-utils/reflect.d.mts +14 -0
  97. package/dist/plugin-utils/reflect.d.mts.map +1 -0
  98. package/dist/plugin-utils/reflect.mjs +24 -0
  99. package/dist/plugin-utils/reflect.mjs.map +1 -0
  100. package/dist/plugin-utils/traverse-command-tree.cjs +33 -0
  101. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  102. package/dist/plugin-utils/traverse-command-tree.d.cts +23 -0
  103. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -0
  104. package/dist/plugin-utils/traverse-command-tree.d.mts +23 -0
  105. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -0
  106. package/dist/plugin-utils/traverse-command-tree.mjs +31 -0
  107. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -0
  108. package/dist/plugin.cjs +267 -0
  109. package/dist/plugin.cjs.map +1 -0
  110. package/dist/plugin.d.cts +13 -0
  111. package/dist/plugin.d.cts.map +1 -0
  112. package/dist/plugin.d.mts +13 -0
  113. package/dist/plugin.d.mts.map +1 -0
  114. package/dist/plugin.mjs +261 -0
  115. package/dist/plugin.mjs.map +1 -0
  116. package/dist/types/command.d.cts +13 -4
  117. package/dist/types/command.d.cts.map +1 -0
  118. package/dist/types/command.d.mts +13 -4
  119. package/dist/types/command.d.mts.map +1 -0
  120. package/dist/types/config.d.cts +73 -10
  121. package/dist/types/config.d.cts.map +1 -0
  122. package/dist/types/config.d.mts +73 -10
  123. package/dist/types/config.d.mts.map +1 -0
  124. package/dist/types/context.d.cts +7 -4
  125. package/dist/types/context.d.cts.map +1 -0
  126. package/dist/types/context.d.mts +7 -4
  127. package/dist/types/context.d.mts.map +1 -0
  128. package/dist/types/index.d.cts +4 -4
  129. package/dist/types/index.d.mts +4 -4
  130. package/dist/types/internal.cjs +0 -0
  131. package/dist/types/internal.d.cts +24 -0
  132. package/dist/types/internal.d.cts.map +1 -0
  133. package/dist/types/internal.d.mts +24 -0
  134. package/dist/types/internal.d.mts.map +1 -0
  135. package/dist/types/internal.mjs +1 -0
  136. package/dist/types/options.d.cts +2 -1
  137. package/dist/types/options.d.cts.map +1 -0
  138. package/dist/types/options.d.mts +2 -1
  139. package/dist/types/options.d.mts.map +1 -0
  140. package/package.json +207 -92
  141. package/dist/components/utils-builtin.cjs +0 -453
  142. package/dist/components/utils-builtin.d.cts +0 -27
  143. package/dist/components/utils-builtin.d.mts +0 -27
  144. package/dist/components/utils-builtin.mjs +0 -447
  145. package/dist/powerlines.cjs +0 -172
  146. package/dist/powerlines.d.cts +0 -12
  147. package/dist/powerlines.d.mts +0 -12
  148. package/dist/powerlines.mjs +0 -168
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.2.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.2.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
package/dist/api.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
- const require_powerlines = require('./powerlines.cjs');
2
+ const require_plugin = require('./plugin.cjs');
3
3
  let powerlines = require("powerlines");
4
4
 
5
5
  //#region src/api.ts
@@ -15,7 +15,7 @@ var ShellShockAPI = class ShellShockAPI {
15
15
  return new ShellShockAPI(await (0, powerlines.createPowerlines)({
16
16
  framework: "shell-shock",
17
17
  ...config,
18
- plugins: [...config.plugins ?? [], require_powerlines.shellShock()]
18
+ plugins: [require_plugin.plugin(), ...config.plugins ?? []]
19
19
  }));
20
20
  }
21
21
  constructor(powerlines$1) {
@@ -40,6 +40,18 @@ var ShellShockAPI = class ShellShockAPI {
40
40
  return this.#powerlines.finalize();
41
41
  }
42
42
  };
43
+ /**
44
+ * Creates a new {@link ShellShockAPI} instance.
45
+ *
46
+ * @param options - The user configuration options.
47
+ * @returns A promise that resolves to a {@link ShellShockAPI} instance.
48
+ */
49
+ async function createShellShock(options = {}) {
50
+ options.root ??= process.cwd();
51
+ return ShellShockAPI.from(options);
52
+ }
43
53
 
44
54
  //#endregion
45
- exports.ShellShockAPI = ShellShockAPI;
55
+ exports.ShellShockAPI = ShellShockAPI;
56
+ exports.createShellShock = createShellShock;
57
+ //# sourceMappingURL=api.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.cjs","names":["createPowerlines","plugin","ShellShockAPI","powerlines","from","config","framework","plugins","constructor","clean","inlineConfig","prepare","lint","build","docs","finalize","createShellShock","options","root","process","cwd"],"sources":["../src/api.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 { createPowerlines } from \"powerlines\";\nimport type { PowerlinesAPI } from \"powerlines/api\";\nimport type {\n BuildInlineConfig,\n CleanInlineConfig,\n DocsInlineConfig,\n LintInlineConfig,\n PluginConfig,\n PrepareInlineConfig\n} from \"powerlines/types/config\";\nimport { plugin } from \"./plugin\";\nimport type { UserConfig } from \"./types/config\";\nimport type { Context } from \"./types/context\";\n\n/**\n * The Shell Shock API class.\n *\n * @remarks\n * This class provides methods to interact with the Shell Shock build system, including cleaning, preparing, linting, building, generating documentation, and finalizing projects.\n */\nexport class ShellShockAPI {\n #powerlines: PowerlinesAPI;\n\n public static async from(config: UserConfig = {}): Promise<ShellShockAPI> {\n const powerlines = await createPowerlines({\n framework: \"shell-shock\",\n ...config,\n plugins: [plugin(), ...(config.plugins ?? [])] as PluginConfig<Context>[]\n });\n\n return new ShellShockAPI(powerlines);\n }\n\n private constructor(powerlines: PowerlinesAPI) {\n this.#powerlines = powerlines;\n }\n\n public async clean(inlineConfig: CleanInlineConfig): Promise<void> {\n return this.#powerlines.clean(inlineConfig);\n }\n\n public async prepare(inlineConfig: PrepareInlineConfig): Promise<void> {\n return this.#powerlines.prepare(inlineConfig);\n }\n\n public async lint(inlineConfig: LintInlineConfig): Promise<void> {\n return this.#powerlines.lint(inlineConfig);\n }\n\n public async build(inlineConfig: BuildInlineConfig): Promise<void> {\n return this.#powerlines.build(inlineConfig);\n }\n\n public async docs(inlineConfig: DocsInlineConfig): Promise<void> {\n return this.#powerlines.docs(inlineConfig);\n }\n\n public async finalize(): Promise<void> {\n return this.#powerlines.finalize();\n }\n}\n\n/**\n * Creates a new {@link ShellShockAPI} instance.\n *\n * @param options - The user configuration options.\n * @returns A promise that resolves to a {@link ShellShockAPI} instance.\n */\nexport async function createShellShock(\n options: Partial<UserConfig> = {}\n): Promise<ShellShockAPI> {\n options.root ??= process.cwd();\n\n return ShellShockAPI.from(options);\n}\n"],"mappings":";;;;;;;;;;;AAsCA,IAAaE,gBAAb,MAAaA,cAAc;CACzB;CAEA,aAAoBE,KAAKC,SAAqB,EAAE,EAA0B;AAOxE,SAAO,IAAIH,cANQ,uCAAuB;GACxCI,WAAW;GACX,GAAGD;GACHE,SAAS,CAACN,uBAAQ,EAAE,GAAII,OAAOE,WAAW,EAAE,CAAC;GAC9C,CAAC,CAEkC;;CAG9BC,YAAYL,cAA2B;AAC7C,QAAK,aAAcA;;CAGrB,MAAaM,MAAMC,cAAgD;AACjE,SAAO,MAAK,WAAYD,MAAMC,aAAa;;CAG7C,MAAaC,QAAQD,cAAkD;AACrE,SAAO,MAAK,WAAYC,QAAQD,aAAa;;CAG/C,MAAaE,KAAKF,cAA+C;AAC/D,SAAO,MAAK,WAAYE,KAAKF,aAAa;;CAG5C,MAAaG,MAAMH,cAAgD;AACjE,SAAO,MAAK,WAAYG,MAAMH,aAAa;;CAG7C,MAAaI,KAAKJ,cAA+C;AAC/D,SAAO,MAAK,WAAYI,KAAKJ,aAAa;;CAG5C,MAAaK,WAA0B;AACrC,SAAO,MAAK,WAAYA,UAAU;;;;;;;;;AAUtC,eAAsBC,iBACpBC,UAA+B,EAAE,EACT;AACxBA,SAAQC,SAASC,QAAQC,KAAK;AAE9B,QAAOlB,cAAcE,KAAKa,QAAQ"}
package/dist/api.d.cts CHANGED
@@ -20,5 +20,13 @@ declare class ShellShockAPI {
20
20
  docs(inlineConfig: DocsInlineConfig): Promise<void>;
21
21
  finalize(): Promise<void>;
22
22
  }
23
+ /**
24
+ * Creates a new {@link ShellShockAPI} instance.
25
+ *
26
+ * @param options - The user configuration options.
27
+ * @returns A promise that resolves to a {@link ShellShockAPI} instance.
28
+ */
29
+ declare function createShellShock(options?: Partial<UserConfig>): Promise<ShellShockAPI>;
23
30
  //#endregion
24
- export { ShellShockAPI };
31
+ export { ShellShockAPI, createShellShock };
32
+ //# sourceMappingURL=api.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.cts","names":[],"sources":["../src/api.ts"],"sourcesContent":[],"mappings":";;;;;;;AAsCA;;;;AAiBmC,cAjBtB,aAAA,CAiBsB;EAAoB,CAAA,OAAA;EAIlB,OAAA,IAAA,CAAA,MAAA,CAAA,EAlBF,UAkBE,CAAA,EAlBgB,OAkBhB,CAlBwB,aAkBxB,CAAA;EAAsB,QAAA,WAAA,CAAA;EAIzB,KAAA,CAAA,YAAA,EARC,iBAQD,CAAA,EARqB,OAQrB,CAAA,IAAA,CAAA;EAAmB,OAAA,CAAA,YAAA,EAJhB,mBAIgB,CAAA,EAJM,OAIN,CAAA,IAAA,CAAA;EAIlB,IAAA,CAAA,YAAA,EAJD,gBAIC,CAAA,EAJkB,OAIlB,CAAA,IAAA,CAAA;EAAoB,KAAA,CAAA,YAAA,EAApB,iBAAoB,CAAA,EAAA,OAAA,CAAA,IAAA,CAAA;EAIrB,IAAA,CAAA,YAAA,EAAA,gBAAA,CAAA,EAAmB,OAAnB,CAAA,IAAA,CAAA;EAAmB,QAAA,CAAA,CAAA,EAI1B,OAJ0B,CAAA,IAAA,CAAA;;;AAerD;;;;;AAEU,iBAFY,gBAAA,CAEZ,OAAA,CAAA,EADC,OACD,CADS,UACT,CAAA,CAAA,EAAP,OAAO,CAAC,aAAD,CAAA"}
package/dist/api.d.mts CHANGED
@@ -20,5 +20,13 @@ declare class ShellShockAPI {
20
20
  docs(inlineConfig: DocsInlineConfig): Promise<void>;
21
21
  finalize(): Promise<void>;
22
22
  }
23
+ /**
24
+ * Creates a new {@link ShellShockAPI} instance.
25
+ *
26
+ * @param options - The user configuration options.
27
+ * @returns A promise that resolves to a {@link ShellShockAPI} instance.
28
+ */
29
+ declare function createShellShock(options?: Partial<UserConfig>): Promise<ShellShockAPI>;
23
30
  //#endregion
24
- export { ShellShockAPI };
31
+ export { ShellShockAPI, createShellShock };
32
+ //# sourceMappingURL=api.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.mts","names":[],"sources":["../src/api.ts"],"sourcesContent":[],"mappings":";;;;;;;AAsCA;;;;AAiBmC,cAjBtB,aAAA,CAiBsB;EAAoB,CAAA,OAAA;EAIlB,OAAA,IAAA,CAAA,MAAA,CAAA,EAlBF,UAkBE,CAAA,EAlBgB,OAkBhB,CAlBwB,aAkBxB,CAAA;EAAsB,QAAA,WAAA,CAAA;EAIzB,KAAA,CAAA,YAAA,EARC,iBAQD,CAAA,EARqB,OAQrB,CAAA,IAAA,CAAA;EAAmB,OAAA,CAAA,YAAA,EAJhB,mBAIgB,CAAA,EAJM,OAIN,CAAA,IAAA,CAAA;EAIlB,IAAA,CAAA,YAAA,EAJD,gBAIC,CAAA,EAJkB,OAIlB,CAAA,IAAA,CAAA;EAAoB,KAAA,CAAA,YAAA,EAApB,iBAAoB,CAAA,EAAA,OAAA,CAAA,IAAA,CAAA;EAIrB,IAAA,CAAA,YAAA,EAAA,gBAAA,CAAA,EAAmB,OAAnB,CAAA,IAAA,CAAA;EAAmB,QAAA,CAAA,CAAA,EAI1B,OAJ0B,CAAA,IAAA,CAAA;;;AAerD;;;;;AAEU,iBAFY,gBAAA,CAEZ,OAAA,CAAA,EADC,OACD,CADS,UACT,CAAA,CAAA,EAAP,OAAO,CAAC,aAAD,CAAA"}
package/dist/api.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { shellShock } from "./powerlines.mjs";
1
+ import { plugin } from "./plugin.mjs";
2
2
  import { createPowerlines } from "powerlines";
3
3
 
4
4
  //#region src/api.ts
@@ -14,7 +14,7 @@ var ShellShockAPI = class ShellShockAPI {
14
14
  return new ShellShockAPI(await createPowerlines({
15
15
  framework: "shell-shock",
16
16
  ...config,
17
- plugins: [...config.plugins ?? [], shellShock()]
17
+ plugins: [plugin(), ...config.plugins ?? []]
18
18
  }));
19
19
  }
20
20
  constructor(powerlines) {
@@ -39,6 +39,17 @@ var ShellShockAPI = class ShellShockAPI {
39
39
  return this.#powerlines.finalize();
40
40
  }
41
41
  };
42
+ /**
43
+ * Creates a new {@link ShellShockAPI} instance.
44
+ *
45
+ * @param options - The user configuration options.
46
+ * @returns A promise that resolves to a {@link ShellShockAPI} instance.
47
+ */
48
+ async function createShellShock(options = {}) {
49
+ options.root ??= process.cwd();
50
+ return ShellShockAPI.from(options);
51
+ }
42
52
 
43
53
  //#endregion
44
- export { ShellShockAPI };
54
+ export { ShellShockAPI, createShellShock };
55
+ //# sourceMappingURL=api.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.mjs","names":["createPowerlines","plugin","ShellShockAPI","powerlines","from","config","framework","plugins","constructor","clean","inlineConfig","prepare","lint","build","docs","finalize","createShellShock","options","root","process","cwd"],"sources":["../src/api.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 { createPowerlines } from \"powerlines\";\nimport type { PowerlinesAPI } from \"powerlines/api\";\nimport type {\n BuildInlineConfig,\n CleanInlineConfig,\n DocsInlineConfig,\n LintInlineConfig,\n PluginConfig,\n PrepareInlineConfig\n} from \"powerlines/types/config\";\nimport { plugin } from \"./plugin\";\nimport type { UserConfig } from \"./types/config\";\nimport type { Context } from \"./types/context\";\n\n/**\n * The Shell Shock API class.\n *\n * @remarks\n * This class provides methods to interact with the Shell Shock build system, including cleaning, preparing, linting, building, generating documentation, and finalizing projects.\n */\nexport class ShellShockAPI {\n #powerlines: PowerlinesAPI;\n\n public static async from(config: UserConfig = {}): Promise<ShellShockAPI> {\n const powerlines = await createPowerlines({\n framework: \"shell-shock\",\n ...config,\n plugins: [plugin(), ...(config.plugins ?? [])] as PluginConfig<Context>[]\n });\n\n return new ShellShockAPI(powerlines);\n }\n\n private constructor(powerlines: PowerlinesAPI) {\n this.#powerlines = powerlines;\n }\n\n public async clean(inlineConfig: CleanInlineConfig): Promise<void> {\n return this.#powerlines.clean(inlineConfig);\n }\n\n public async prepare(inlineConfig: PrepareInlineConfig): Promise<void> {\n return this.#powerlines.prepare(inlineConfig);\n }\n\n public async lint(inlineConfig: LintInlineConfig): Promise<void> {\n return this.#powerlines.lint(inlineConfig);\n }\n\n public async build(inlineConfig: BuildInlineConfig): Promise<void> {\n return this.#powerlines.build(inlineConfig);\n }\n\n public async docs(inlineConfig: DocsInlineConfig): Promise<void> {\n return this.#powerlines.docs(inlineConfig);\n }\n\n public async finalize(): Promise<void> {\n return this.#powerlines.finalize();\n }\n}\n\n/**\n * Creates a new {@link ShellShockAPI} instance.\n *\n * @param options - The user configuration options.\n * @returns A promise that resolves to a {@link ShellShockAPI} instance.\n */\nexport async function createShellShock(\n options: Partial<UserConfig> = {}\n): Promise<ShellShockAPI> {\n options.root ??= process.cwd();\n\n return ShellShockAPI.from(options);\n}\n"],"mappings":";;;;;;;;;;AAsCA,IAAaE,gBAAb,MAAaA,cAAc;CACzB;CAEA,aAAoBE,KAAKC,SAAqB,EAAE,EAA0B;AAOxE,SAAO,IAAIH,cANQ,MAAMF,iBAAiB;GACxCM,WAAW;GACX,GAAGD;GACHE,SAAS,CAACN,QAAQ,EAAE,GAAII,OAAOE,WAAW,EAAE,CAAC;GAC9C,CAAC,CAEkC;;CAG9BC,YAAYL,YAA2B;AAC7C,QAAK,aAAcA;;CAGrB,MAAaM,MAAMC,cAAgD;AACjE,SAAO,MAAK,WAAYD,MAAMC,aAAa;;CAG7C,MAAaC,QAAQD,cAAkD;AACrE,SAAO,MAAK,WAAYC,QAAQD,aAAa;;CAG/C,MAAaE,KAAKF,cAA+C;AAC/D,SAAO,MAAK,WAAYE,KAAKF,aAAa;;CAG5C,MAAaG,MAAMH,cAAgD;AACjE,SAAO,MAAK,WAAYG,MAAMH,aAAa;;CAG7C,MAAaI,KAAKJ,cAA+C;AAC/D,SAAO,MAAK,WAAYI,KAAKJ,aAAa;;CAG5C,MAAaK,WAA0B;AACrC,SAAO,MAAK,WAAYA,UAAU;;;;;;;;;AAUtC,eAAsBC,iBACpBC,UAA+B,EAAE,EACT;AACxBA,SAAQC,SAASC,QAAQC,KAAK;AAE9B,QAAOlB,cAAcE,KAAKa,QAAQ"}
@@ -0,0 +1,105 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_contexts_command = require('../contexts/command.cjs');
3
+ const require_docs_helpers = require('../helpers/docs-helpers.cjs');
4
+ const require_plugin_utils_context_helpers = require('../plugin-utils/context-helpers.cjs');
5
+ const require_plugin_utils_reflect = require('../plugin-utils/reflect.cjs');
6
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
8
+ let __alloy_js_core = require("@alloy-js/core");
9
+ let __alloy_js_markdown = require("@alloy-js/markdown");
10
+ let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
11
+ let __powerlines_plugin_alloy_markdown_components_markdown_file = require("@powerlines/plugin-alloy/markdown/components/markdown-file");
12
+ let __powerlines_plugin_alloy_markdown_components_markdown_table = require("@powerlines/plugin-alloy/markdown/components/markdown-table");
13
+ let __stryke_path_join = require("@stryke/path/join");
14
+
15
+ //#region src/components/docs.tsx
16
+ /**
17
+ * Generates the options markdown documentation for a command.
18
+ */
19
+ function CommandOptionsDocs(props) {
20
+ const { command } = props;
21
+ if (Object.keys(command.options).length === 0) return ["This command does not have any options."];
22
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_markdown_components_markdown_table.MarkdownTable, { get data() {
23
+ return require_plugin_utils_reflect.sortOptions(Object.values(command.options)).map((option) => {
24
+ return {
25
+ name: option.name.trim(),
26
+ description: option.description.trim(),
27
+ defaultValue: option.default ? String(option.default)?.includes("\"") ? option.default : `\`${option.default}\`` : "",
28
+ required: option.optional || option.default ? "" : "✔"
29
+ };
30
+ });
31
+ } });
32
+ }
33
+ /**
34
+ * Generates the markdown documentation for a command.
35
+ */
36
+ function CommandDocs(props) {
37
+ const { levelOffset = 0, command } = props;
38
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
39
+ return [
40
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
41
+ level: 1 + levelOffset,
42
+ get children() {
43
+ return command.name;
44
+ }
45
+ }),
46
+ (0, __alloy_js_core_jsx_runtime.memo)(() => command.description),
47
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
48
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
49
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
50
+ level: 2 + levelOffset,
51
+ children: "Usage"
52
+ }),
53
+ __alloy_js_core.code`The command can be executed using the following syntax:
54
+ \`\`\`bash `,
55
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
56
+ (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`$ ${require_plugin_utils_context_helpers.getAppBin(context)} `),
57
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
58
+ get each() {
59
+ return command.path.segments;
60
+ },
61
+ children: (segment) => require_plugin_utils_context_helpers.isVariableCommandPath(segment) ? `<${command.path.variables[segment]?.variadic ? "..." : ""}${(0, __stryke_string_format_kebab_case.kebabCase)(require_plugin_utils_context_helpers.getVariableCommandPathName(segment))}>` : segment
62
+ }),
63
+ __alloy_js_core.code` [options] `,
64
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
65
+ __alloy_js_core.code`\`\`\``,
66
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
67
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
68
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
69
+ level: 2 + levelOffset,
70
+ children: "Options"
71
+ }),
72
+ (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`The following options are available for the ${command.title} command:`),
73
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
74
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
75
+ (0, __alloy_js_core_jsx_runtime.createComponent)(CommandOptionsDocs, { command }),
76
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
77
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
78
+ ];
79
+ }
80
+ /**
81
+ * Generates the markdown documentation file for a command.
82
+ */
83
+ function CommandDocsFile(props) {
84
+ const { levelOffset = 0, command, ...rest } = props;
85
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
86
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_contexts_command.CommandContext.Provider, {
87
+ value: command,
88
+ get children() {
89
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_markdown_components_markdown_file.MarkdownFile, (0, __alloy_js_core_jsx_runtime.mergeProps)({ get path() {
90
+ return (0, __stryke_path_join.joinPaths)(require_docs_helpers.getDocsOutputPath(context), `${command.path.value}.md`);
91
+ } }, rest, { get children() {
92
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(CommandDocs, {
93
+ levelOffset,
94
+ command
95
+ });
96
+ } }));
97
+ }
98
+ });
99
+ }
100
+
101
+ //#endregion
102
+ exports.CommandDocs = CommandDocs;
103
+ exports.CommandDocsFile = CommandDocsFile;
104
+ exports.CommandOptionsDocs = CommandOptionsDocs;
105
+ //# sourceMappingURL=docs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.cjs","names":["code","For","Heading","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","kebabCase","CommandContext","getDocsOutputPath","getAppBin","getVariableCommandPathName","isVariableCommandPath","sortOptions","CommandOptionsDocs","props","command","Object","keys","options","length","_$createComponent","data","values","map","option","name","trim","description","defaultValue","default","String","includes","required","optional","CommandDocs","levelOffset","context","level","children","_$memo","_$createIntrinsic","each","path","segments","segment","variables","variadic","title","CommandDocsFile","rest","Provider","value","_$mergeProps"],"sources":["../../src/components/docs.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 } from \"@alloy-js/core\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { MarkdownFileProps } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownFile } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport {\n getAppBin,\n getVariableCommandPathName,\n isVariableCommandPath\n} from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\n\nexport interface CommandOptionsDocsProps {\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the options markdown documentation for a command.\n */\nexport function CommandOptionsDocs(props: CommandOptionsDocsProps) {\n const { command } = props;\n if (Object.keys(command.options).length === 0) {\n return <>This command does not have any options.</>;\n }\n\n return (\n <MarkdownTable\n data={sortOptions(Object.values(command.options)).map(option => {\n return {\n name: option.name.trim(),\n description: option.description.trim(),\n defaultValue: option.default\n ? String(option.default)?.includes('\"')\n ? option.default\n : `\\`${option.default}\\``\n : \"\",\n required: option.optional || option.default ? \"\" : \"✔\"\n };\n })}\n />\n );\n}\n\nexport interface CommandDocsProps {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.name}</Heading>\n {command.description}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n {code`The command can be executed using the following syntax:\n \\`\\`\\`bash `}\n <hbr />\n {code`$ ${getAppBin(context)} `}\n <For each={command.path.segments}>\n {segment =>\n isVariableCommandPath(segment)\n ? `<${command.path.variables[segment]?.variadic ? \"...\" : \"\"}${kebabCase(\n getVariableCommandPathName(segment)\n )}>`\n : segment\n }\n </For>\n {code` [options] `}\n <hbr />\n {code`\\`\\`\\``}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n {code`The following options are available for the ${\n command.title\n } command:`}\n <hbr />\n <hbr />\n <CommandOptionsDocs command={command} />\n <hbr />\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation file for a command.\n */\nexport function CommandDocsFile(props: CommandDocsFileProps) {\n const { levelOffset = 0, command, ...rest } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <CommandContext.Provider value={command}>\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), `${command.path.value}.md`)}\n {...rest}>\n <CommandDocs levelOffset={levelOffset} command={command} />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+CA,SAAgBc,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAA,CAAA,0CAAA;AAGF,yDACGf,4EAAa,EAAA,IACZiB,OAAI;AAAA,SAAET,yCAAYI,OAAOM,OAAOP,QAAQG,QAAQ,CAAC,CAACK,KAAIC,WAAU;AAC9D,UAAO;IACLC,MAAMD,OAAOC,KAAKC,MAAM;IACxBC,aAAaH,OAAOG,YAAYD,MAAM;IACtCE,cAAcJ,OAAOK,UACjBC,OAAON,OAAOK,QAAQ,EAAEE,SAAS,KAAI,GACnCP,OAAOK,UACP,KAAKL,OAAOK,QAAO,MACrB;IACJG,UAAUR,OAAOS,YAAYT,OAAOK,UAAU,KAAK;IACpD;IACD;IAAA,CAAA;;;;;AAyBR,SAAgBK,YAAYpB,OAAyB;CACnD,MAAM,EAAEqB,cAAc,GAAGpB,YAAYD;CAErC,MAAMsB,8EAAkC;AAExC,QAAA;mDAEKnC,6BAAO;GAACoC,OAAO,IAAIF;GAAW,IAAAG,WAAA;AAAA,WAAGvB,QAAQU;;GAAI,CAAA;8CAC7CV,QAAQY,YAAW;mDAAA,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAGnB1B,6BAAO;GAACoC,OAAO,IAAIF;GAAWG,UAAA;GAAA,CAAA;EAC9BvC,oBAAI;;mDACO,OAAA,EAAA,CAAA;8CAEXA,oBAAI,KAAKU,+CAAU2B,QAAQ,CAAA,GAAG;mDAC9BpC,qBAAG;GAAA,IAACyC,OAAI;AAAA,WAAE1B,QAAQ2B,KAAKC;;GAAQL,WAC7BM,YACCjC,2DAAsBiC,QAAQ,GAC1B,IAAI7B,QAAQ2B,KAAKG,UAAUD,UAAUE,WAAW,QAAQ,sDACtDpC,gEAA2BkC,QAC7B,CAAC,CAAA,KACDA;GAAO,CAAA;EAGd7C,oBAAI;mDAAa,OAAA,EAAA,CAAA;EAEjBA,oBAAI;mDAAQ,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAGZE,6BAAO;GAACoC,OAAO,IAAIF;GAAWG,UAAA;GAAA,CAAA;8CAC9BvC,oBAAI,+CACHgB,QAAQgC,MAAK,WACJ;mDAAA,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAGVlC,oBAAkB,EAAUE,SAAO,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;EAAA;;;;;AA2B1C,SAAgBiC,gBAAgBlC,OAA6B;CAC3D,MAAM,EAAEqB,cAAc,GAAGpB,SAAS,GAAGkC,SAASnC;CAE9C,MAAMsB,8EAAkC;AAExC,yDACG7B,wCAAe2C,UAAQ;EAACC,OAAOpC;EAAO,IAAAuB,WAAA;AAAA,2DACpCnC,sHAAY,EAAA,IACXuC,OAAI;AAAA,6CAAYlC,uCAAkB4B,QAAQ,EAAE,GAAGrB,QAAQ2B,KAAKS,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAX,WAAA;AAAA,4DACPJ,aAAW;KAAcC;KAAsBpB;KAAO,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
@@ -0,0 +1,56 @@
1
+ import { CommandTree } from "../types/command.cjs";
2
+ import * as _alloy_js_core0 from "@alloy-js/core";
3
+ import { MarkdownFileProps } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
4
+
5
+ //#region src/components/docs.d.ts
6
+ interface CommandOptionsDocsProps {
7
+ /**
8
+ * The command to generate options documentation for.
9
+ */
10
+ command: CommandTree;
11
+ }
12
+ /**
13
+ * Generates the options markdown documentation for a command.
14
+ */
15
+ declare function CommandOptionsDocs(props: CommandOptionsDocsProps): _alloy_js_core0.Children;
16
+ interface CommandDocsProps {
17
+ /**
18
+ * The heading level offset to apply to the generated documentation.
19
+ *
20
+ * @remarks
21
+ * This is useful when nesting the documentation within other markdown files.
22
+ *
23
+ * @defaultValue 0
24
+ */
25
+ levelOffset?: number;
26
+ /**
27
+ * The command to generate options documentation for.
28
+ */
29
+ command: CommandTree;
30
+ }
31
+ /**
32
+ * Generates the markdown documentation for a command.
33
+ */
34
+ declare function CommandDocs(props: CommandDocsProps): _alloy_js_core0.Children;
35
+ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
36
+ /**
37
+ * The heading level offset to apply to the generated documentation.
38
+ *
39
+ * @remarks
40
+ * This is useful when nesting the documentation within other markdown files.
41
+ *
42
+ * @defaultValue 0
43
+ */
44
+ levelOffset?: number;
45
+ /**
46
+ * The command to generate documentation for.
47
+ */
48
+ command: CommandTree;
49
+ }
50
+ /**
51
+ * Generates the markdown documentation file for a command.
52
+ */
53
+ declare function CommandDocsFile(props: CommandDocsFileProps): _alloy_js_core0.Children;
54
+ //#endregion
55
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
56
+ //# sourceMappingURL=docs.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;;UAqCiB,uBAAA;;;AAAjB;EAUgB,OAAA,EANL,WAMK;AAwBhB;AAoBA;AA2CA;;AAcW,iBArGK,kBAAA,CAqGL,KAAA,EArG+B,uBAqG/B,CAAA,EArGsD,eAAA,CAAA,QAqGtD;AAdmC,UA/D7B,gBAAA,CA+D6B;EAAO;AAoBrD;;;;;;;;;;;WArEW;;;;;iBAMK,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UA2ClC,oBAAA,SAA6B,QAAQ;;;;;;;;;;;;;WAc3C;;;;;iBAMK,eAAA,QAAuB,uBAAoB,eAAA,CAAA"}
@@ -0,0 +1,56 @@
1
+ import { CommandTree } from "../types/command.mjs";
2
+ import * as _alloy_js_core0 from "@alloy-js/core";
3
+ import { MarkdownFileProps } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
4
+
5
+ //#region src/components/docs.d.ts
6
+ interface CommandOptionsDocsProps {
7
+ /**
8
+ * The command to generate options documentation for.
9
+ */
10
+ command: CommandTree;
11
+ }
12
+ /**
13
+ * Generates the options markdown documentation for a command.
14
+ */
15
+ declare function CommandOptionsDocs(props: CommandOptionsDocsProps): _alloy_js_core0.Children;
16
+ interface CommandDocsProps {
17
+ /**
18
+ * The heading level offset to apply to the generated documentation.
19
+ *
20
+ * @remarks
21
+ * This is useful when nesting the documentation within other markdown files.
22
+ *
23
+ * @defaultValue 0
24
+ */
25
+ levelOffset?: number;
26
+ /**
27
+ * The command to generate options documentation for.
28
+ */
29
+ command: CommandTree;
30
+ }
31
+ /**
32
+ * Generates the markdown documentation for a command.
33
+ */
34
+ declare function CommandDocs(props: CommandDocsProps): _alloy_js_core0.Children;
35
+ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
36
+ /**
37
+ * The heading level offset to apply to the generated documentation.
38
+ *
39
+ * @remarks
40
+ * This is useful when nesting the documentation within other markdown files.
41
+ *
42
+ * @defaultValue 0
43
+ */
44
+ levelOffset?: number;
45
+ /**
46
+ * The command to generate documentation for.
47
+ */
48
+ command: CommandTree;
49
+ }
50
+ /**
51
+ * Generates the markdown documentation file for a command.
52
+ */
53
+ declare function CommandDocsFile(props: CommandDocsFileProps): _alloy_js_core0.Children;
54
+ //#endregion
55
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
56
+ //# sourceMappingURL=docs.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.mts","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;;UAqCiB,uBAAA;;;AAAjB;EAUgB,OAAA,EANL,WAMK;AAwBhB;AAoBA;AA2CA;;AAcW,iBArGK,kBAAA,CAqGL,KAAA,EArG+B,uBAqG/B,CAAA,EArGsD,eAAA,CAAA,QAqGtD;AAdmC,UA/D7B,gBAAA,CA+D6B;EAAO;AAoBrD;;;;;;;;;;;WArEW;;;;;iBAMK,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UA2ClC,oBAAA,SAA6B,QAAQ;;;;;;;;;;;;;WAc3C;;;;;iBAMK,eAAA,QAAuB,uBAAoB,eAAA,CAAA"}
@@ -0,0 +1,102 @@
1
+ import { CommandContext } from "../contexts/command.mjs";
2
+ import { getDocsOutputPath } from "../helpers/docs-helpers.mjs";
3
+ import { getAppBin, getVariableCommandPathName, isVariableCommandPath } from "../plugin-utils/context-helpers.mjs";
4
+ import { sortOptions } from "../plugin-utils/reflect.mjs";
5
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
6
+ import { kebabCase } from "@stryke/string-format/kebab-case";
7
+ import { For, code } from "@alloy-js/core";
8
+ import { Heading } from "@alloy-js/markdown";
9
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
10
+ import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
11
+ import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
12
+ import { joinPaths } from "@stryke/path/join";
13
+
14
+ //#region src/components/docs.tsx
15
+ /**
16
+ * Generates the options markdown documentation for a command.
17
+ */
18
+ function CommandOptionsDocs(props) {
19
+ const { command } = props;
20
+ if (Object.keys(command.options).length === 0) return ["This command does not have any options."];
21
+ return createComponent(MarkdownTable, { get data() {
22
+ return sortOptions(Object.values(command.options)).map((option) => {
23
+ return {
24
+ name: option.name.trim(),
25
+ description: option.description.trim(),
26
+ defaultValue: option.default ? String(option.default)?.includes("\"") ? option.default : `\`${option.default}\`` : "",
27
+ required: option.optional || option.default ? "" : "✔"
28
+ };
29
+ });
30
+ } });
31
+ }
32
+ /**
33
+ * Generates the markdown documentation for a command.
34
+ */
35
+ function CommandDocs(props) {
36
+ const { levelOffset = 0, command } = props;
37
+ const context = usePowerlines();
38
+ return [
39
+ createComponent(Heading, {
40
+ level: 1 + levelOffset,
41
+ get children() {
42
+ return command.name;
43
+ }
44
+ }),
45
+ memo(() => command.description),
46
+ createIntrinsic("hbr", {}),
47
+ createIntrinsic("hbr", {}),
48
+ createComponent(Heading, {
49
+ level: 2 + levelOffset,
50
+ children: "Usage"
51
+ }),
52
+ code`The command can be executed using the following syntax:
53
+ \`\`\`bash `,
54
+ createIntrinsic("hbr", {}),
55
+ memo(() => code`$ ${getAppBin(context)} `),
56
+ createComponent(For, {
57
+ get each() {
58
+ return command.path.segments;
59
+ },
60
+ children: (segment) => isVariableCommandPath(segment) ? `<${command.path.variables[segment]?.variadic ? "..." : ""}${kebabCase(getVariableCommandPathName(segment))}>` : segment
61
+ }),
62
+ code` [options] `,
63
+ createIntrinsic("hbr", {}),
64
+ code`\`\`\``,
65
+ createIntrinsic("hbr", {}),
66
+ createIntrinsic("hbr", {}),
67
+ createComponent(Heading, {
68
+ level: 2 + levelOffset,
69
+ children: "Options"
70
+ }),
71
+ memo(() => code`The following options are available for the ${command.title} command:`),
72
+ createIntrinsic("hbr", {}),
73
+ createIntrinsic("hbr", {}),
74
+ createComponent(CommandOptionsDocs, { command }),
75
+ createIntrinsic("hbr", {}),
76
+ createIntrinsic("hbr", {})
77
+ ];
78
+ }
79
+ /**
80
+ * Generates the markdown documentation file for a command.
81
+ */
82
+ function CommandDocsFile(props) {
83
+ const { levelOffset = 0, command, ...rest } = props;
84
+ const context = usePowerlines();
85
+ return createComponent(CommandContext.Provider, {
86
+ value: command,
87
+ get children() {
88
+ return createComponent(MarkdownFile, mergeProps({ get path() {
89
+ return joinPaths(getDocsOutputPath(context), `${command.path.value}.md`);
90
+ } }, rest, { get children() {
91
+ return createComponent(CommandDocs, {
92
+ levelOffset,
93
+ command
94
+ });
95
+ } }));
96
+ }
97
+ });
98
+ }
99
+
100
+ //#endregion
101
+ export { CommandDocs, CommandDocsFile, CommandOptionsDocs };
102
+ //# sourceMappingURL=docs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.mjs","names":["code","For","Heading","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","kebabCase","CommandContext","getDocsOutputPath","getAppBin","getVariableCommandPathName","isVariableCommandPath","sortOptions","CommandOptionsDocs","props","command","Object","keys","options","length","_$createComponent","data","values","map","option","name","trim","description","defaultValue","default","String","includes","required","optional","CommandDocs","levelOffset","context","level","children","_$memo","_$createIntrinsic","each","path","segments","segment","variables","variadic","title","CommandDocsFile","rest","Provider","value","_$mergeProps"],"sources":["../../src/components/docs.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 } from \"@alloy-js/core\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { MarkdownFileProps } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownFile } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport {\n getAppBin,\n getVariableCommandPathName,\n isVariableCommandPath\n} from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\n\nexport interface CommandOptionsDocsProps {\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the options markdown documentation for a command.\n */\nexport function CommandOptionsDocs(props: CommandOptionsDocsProps) {\n const { command } = props;\n if (Object.keys(command.options).length === 0) {\n return <>This command does not have any options.</>;\n }\n\n return (\n <MarkdownTable\n data={sortOptions(Object.values(command.options)).map(option => {\n return {\n name: option.name.trim(),\n description: option.description.trim(),\n defaultValue: option.default\n ? String(option.default)?.includes('\"')\n ? option.default\n : `\\`${option.default}\\``\n : \"\",\n required: option.optional || option.default ? \"\" : \"✔\"\n };\n })}\n />\n );\n}\n\nexport interface CommandDocsProps {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.name}</Heading>\n {command.description}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n {code`The command can be executed using the following syntax:\n \\`\\`\\`bash `}\n <hbr />\n {code`$ ${getAppBin(context)} `}\n <For each={command.path.segments}>\n {segment =>\n isVariableCommandPath(segment)\n ? `<${command.path.variables[segment]?.variadic ? \"...\" : \"\"}${kebabCase(\n getVariableCommandPathName(segment)\n )}>`\n : segment\n }\n </For>\n {code` [options] `}\n <hbr />\n {code`\\`\\`\\``}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n {code`The following options are available for the ${\n command.title\n } command:`}\n <hbr />\n <hbr />\n <CommandOptionsDocs command={command} />\n <hbr />\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation file for a command.\n */\nexport function CommandDocsFile(props: CommandDocsFileProps) {\n const { levelOffset = 0, command, ...rest } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <CommandContext.Provider value={command}>\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), `${command.path.value}.md`)}\n {...rest}>\n <CommandDocs levelOffset={levelOffset} command={command} />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+CA,SAAgBc,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAA,CAAA,0CAAA;AAGF,QAAAC,gBACGhB,eAAa,EAAA,IACZiB,OAAI;AAAA,SAAET,YAAYI,OAAOM,OAAOP,QAAQG,QAAQ,CAAC,CAACK,KAAIC,WAAU;AAC9D,UAAO;IACLC,MAAMD,OAAOC,KAAKC,MAAM;IACxBC,aAAaH,OAAOG,YAAYD,MAAM;IACtCE,cAAcJ,OAAOK,UACjBC,OAAON,OAAOK,QAAQ,EAAEE,SAAS,KAAI,GACnCP,OAAOK,UACP,KAAKL,OAAOK,QAAO,MACrB;IACJG,UAAUR,OAAOS,YAAYT,OAAOK,UAAU,KAAK;IACpD;IACD;IAAA,CAAA;;;;;AAyBR,SAAgBK,YAAYpB,OAAyB;CACnD,MAAM,EAAEqB,cAAc,GAAGpB,YAAYD;CAErC,MAAMsB,UAAUlC,eAAwB;AAExC,QAAA;EAAAkB,gBAEKnB,SAAO;GAACoC,OAAO,IAAIF;GAAW,IAAAG,WAAA;AAAA,WAAGvB,QAAQU;;GAAI,CAAA;EAAAc,WAC7CxB,QAAQY,YAAW;EAAAa,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAApB,gBAGnBnB,SAAO;GAACoC,OAAO,IAAIF;GAAWG,UAAA;GAAA,CAAA;EAC9BvC,IAAI;;EACOyC,gBAAA,OAAA,EAAA,CAAA;EAAAD,WAEXxC,IAAI,KAAKU,UAAU2B,QAAQ,CAAA,GAAG;EAAAhB,gBAC9BpB,KAAG;GAAA,IAACyC,OAAI;AAAA,WAAE1B,QAAQ2B,KAAKC;;GAAQL,WAC7BM,YACCjC,sBAAsBiC,QAAQ,GAC1B,IAAI7B,QAAQ2B,KAAKG,UAAUD,UAAUE,WAAW,QAAQ,KAAKxC,UAC3DI,2BAA2BkC,QAC7B,CAAC,CAAA,KACDA;GAAO,CAAA;EAGd7C,IAAI;EAAayC,gBAAA,OAAA,EAAA,CAAA;EAEjBzC,IAAI;EAAQyC,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAApB,gBAGZnB,SAAO;GAACoC,OAAO,IAAIF;GAAWG,UAAA;GAAA,CAAA;EAAAC,WAC9BxC,IAAI,+CACHgB,QAAQgC,MAAK,WACJ;EAAAP,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAApB,gBAGVP,oBAAkB,EAAUE,SAAO,CAAA;EAAAyB,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;;;;;AA2B1C,SAAgBQ,gBAAgBlC,OAA6B;CAC3D,MAAM,EAAEqB,cAAc,GAAGpB,SAAS,GAAGkC,SAASnC;CAE9C,MAAMsB,UAAUlC,eAAwB;AAExC,QAAAkB,gBACGb,eAAe2C,UAAQ;EAACC,OAAOpC;EAAO,IAAAuB,WAAA;AAAA,UAAAlB,gBACpCjB,cAAYiD,WAAA,EAAA,IACXV,OAAI;AAAA,WAAErC,UAAUG,kBAAkB4B,QAAQ,EAAE,GAAGrB,QAAQ2B,KAAKS,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAX,WAAA;AAAA,WAAAlB,gBACPc,aAAW;KAAcC;KAAsBpB;KAAO,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
@@ -1,7 +1,5 @@
1
- const require_components_utils_builtin = require('./utils-builtin.cjs');
1
+ const require_components_docs = require('./docs.cjs');
2
2
 
3
- exports.ArgsUtilities = require_components_utils_builtin.ArgsUtilities;
4
- exports.ColorSupportUtilities = require_components_utils_builtin.ColorSupportUtilities;
5
- exports.EnvSupportUtilities = require_components_utils_builtin.EnvSupportUtilities;
6
- exports.HyperlinkSupportUtilities = require_components_utils_builtin.HyperlinkSupportUtilities;
7
- exports.UtilsBuiltin = require_components_utils_builtin.UtilsBuiltin;
3
+ exports.CommandDocs = require_components_docs.CommandDocs;
4
+ exports.CommandDocsFile = require_components_docs.CommandDocsFile;
5
+ exports.CommandOptionsDocs = require_components_docs.CommandOptionsDocs;
@@ -1,2 +1,2 @@
1
- import { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps } from "./utils-builtin.cjs";
2
- export { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps };
1
+ import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.cjs";
2
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
@@ -1,2 +1,2 @@
1
- import { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps } from "./utils-builtin.mjs";
2
- export { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps };
1
+ import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.mjs";
2
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
@@ -1,3 +1,3 @@
1
- import { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin } from "./utils-builtin.mjs";
1
+ import { CommandDocs, CommandDocsFile, CommandOptionsDocs } from "./docs.mjs";
2
2
 
3
- export { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin };
3
+ export { CommandDocs, CommandDocsFile, CommandOptionsDocs };
package/dist/config.cjs CHANGED
@@ -14,4 +14,5 @@ function defineConfig(config) {
14
14
  }
15
15
 
16
16
  //#endregion
17
- exports.defineConfig = defineConfig;
17
+ exports.defineConfig = defineConfig;
18
+ //# sourceMappingURL=config.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.cjs","names":["defineConfig","config"],"sources":["../src/config.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 { UserConfig } from \"./types/config\";\n\n/**\n * A utility function to define a Shell Shock user configuration.\n *\n * @remarks\n * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.\n *\n * @param config - A partial user configuration object.\n * @returns A complete user configuration object.\n */\nexport function defineConfig(config: Partial<UserConfig>): UserConfig {\n return config;\n}\n"],"mappings":";;;;;;;;;;;AA6BA,SAAgBA,aAAaC,QAAyC;AACpE,QAAOA"}
package/dist/config.d.cts CHANGED
@@ -13,4 +13,5 @@ import { UserConfig } from "./types/config.cjs";
13
13
  */
14
14
  declare function defineConfig(config: Partial<UserConfig>): UserConfig;
15
15
  //#endregion
16
- export { defineConfig };
16
+ export { defineConfig };
17
+ //# sourceMappingURL=config.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;AA6BA;;;;;;;iBAAgB,YAAA,SAAqB,QAAQ,cAAc"}
package/dist/config.d.mts CHANGED
@@ -13,4 +13,5 @@ import { UserConfig } from "./types/config.mjs";
13
13
  */
14
14
  declare function defineConfig(config: Partial<UserConfig>): UserConfig;
15
15
  //#endregion
16
- export { defineConfig };
16
+ export { defineConfig };
17
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;AA6BA;;;;;;;iBAAgB,YAAA,SAAqB,QAAQ,cAAc"}
package/dist/config.mjs CHANGED
@@ -13,4 +13,5 @@ function defineConfig(config) {
13
13
  }
14
14
 
15
15
  //#endregion
16
- export { defineConfig };
16
+ export { defineConfig };
17
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":["defineConfig","config"],"sources":["../src/config.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 { UserConfig } from \"./types/config\";\n\n/**\n * A utility function to define a Shell Shock user configuration.\n *\n * @remarks\n * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.\n *\n * @param config - A partial user configuration object.\n * @returns A complete user configuration object.\n */\nexport function defineConfig(config: Partial<UserConfig>): UserConfig {\n return config;\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAgBA,aAAaC,QAAyC;AACpE,QAAOA"}
@@ -0,0 +1,21 @@
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