@shell-shock/core 0.2.1 → 0.4.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 (158) 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 +175 -0
  11. package/dist/components/docs.cjs.map +1 -0
  12. package/dist/components/docs.d.cts +81 -0
  13. package/dist/components/docs.d.cts.map +1 -0
  14. package/dist/components/docs.d.mts +81 -0
  15. package/dist/components/docs.d.mts.map +1 -0
  16. package/dist/components/docs.mjs +171 -0
  17. package/dist/components/docs.mjs.map +1 -0
  18. package/dist/components/index.cjs +5 -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/automd.cjs +59 -0
  43. package/dist/helpers/automd.cjs.map +1 -0
  44. package/dist/helpers/automd.mjs +58 -0
  45. package/dist/helpers/automd.mjs.map +1 -0
  46. package/dist/helpers/docs-helpers.cjs +17 -0
  47. package/dist/helpers/docs-helpers.cjs.map +1 -0
  48. package/dist/helpers/docs-helpers.mjs +16 -0
  49. package/dist/helpers/docs-helpers.mjs.map +1 -0
  50. package/dist/helpers/persistence.cjs +2 -1
  51. package/dist/helpers/persistence.cjs.map +1 -0
  52. package/dist/helpers/persistence.mjs +2 -1
  53. package/dist/helpers/persistence.mjs.map +1 -0
  54. package/dist/helpers/resolve-command.cjs +118 -33
  55. package/dist/helpers/resolve-command.cjs.map +1 -0
  56. package/dist/helpers/resolve-command.mjs +116 -32
  57. package/dist/helpers/resolve-command.mjs.map +1 -0
  58. package/dist/helpers/update-package-json.cjs +18 -10
  59. package/dist/helpers/update-package-json.cjs.map +1 -0
  60. package/dist/helpers/update-package-json.mjs +17 -10
  61. package/dist/helpers/update-package-json.mjs.map +1 -0
  62. package/dist/helpers/utilities.cjs +30 -30
  63. package/dist/helpers/utilities.cjs.map +1 -0
  64. package/dist/helpers/utilities.mjs +29 -28
  65. package/dist/helpers/utilities.mjs.map +1 -0
  66. package/dist/helpers/validations.cjs +97 -0
  67. package/dist/helpers/validations.cjs.map +1 -0
  68. package/dist/helpers/validations.mjs +97 -0
  69. package/dist/helpers/validations.mjs.map +1 -0
  70. package/dist/index.cjs +5 -13
  71. package/dist/index.cjs.map +1 -0
  72. package/dist/index.d.cts +6 -17
  73. package/dist/index.d.mts +6 -17
  74. package/dist/index.mjs +4 -13
  75. package/dist/index.mjs.map +1 -0
  76. package/dist/plugin-utils/context-helpers.cjs +86 -0
  77. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  78. package/dist/plugin-utils/context-helpers.d.cts +58 -0
  79. package/dist/plugin-utils/context-helpers.d.cts.map +1 -0
  80. package/dist/plugin-utils/context-helpers.d.mts +58 -0
  81. package/dist/plugin-utils/context-helpers.d.mts.map +1 -0
  82. package/dist/plugin-utils/context-helpers.mjs +79 -0
  83. package/dist/plugin-utils/context-helpers.mjs.map +1 -0
  84. package/dist/plugin-utils/get-command-tree.cjs +4 -2
  85. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  86. package/dist/plugin-utils/get-command-tree.d.cts +2 -1
  87. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -0
  88. package/dist/plugin-utils/get-command-tree.d.mts +2 -1
  89. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -0
  90. package/dist/plugin-utils/get-command-tree.mjs +5 -2
  91. package/dist/plugin-utils/get-command-tree.mjs.map +1 -0
  92. package/dist/plugin-utils/index.cjs +14 -1
  93. package/dist/plugin-utils/index.d.cts +4 -1
  94. package/dist/plugin-utils/index.d.mts +4 -1
  95. package/dist/plugin-utils/index.mjs +4 -1
  96. package/dist/plugin-utils/reflect.cjs +25 -0
  97. package/dist/plugin-utils/reflect.cjs.map +1 -0
  98. package/dist/plugin-utils/reflect.d.cts +14 -0
  99. package/dist/plugin-utils/reflect.d.cts.map +1 -0
  100. package/dist/plugin-utils/reflect.d.mts +14 -0
  101. package/dist/plugin-utils/reflect.d.mts.map +1 -0
  102. package/dist/plugin-utils/reflect.mjs +24 -0
  103. package/dist/plugin-utils/reflect.mjs.map +1 -0
  104. package/dist/plugin-utils/traverse-command-tree.cjs +33 -0
  105. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  106. package/dist/plugin-utils/traverse-command-tree.d.cts +23 -0
  107. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -0
  108. package/dist/plugin-utils/traverse-command-tree.d.mts +23 -0
  109. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -0
  110. package/dist/plugin-utils/traverse-command-tree.mjs +31 -0
  111. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -0
  112. package/dist/plugin.cjs +284 -0
  113. package/dist/plugin.cjs.map +1 -0
  114. package/dist/plugin.d.cts +13 -0
  115. package/dist/plugin.d.cts.map +1 -0
  116. package/dist/plugin.d.mts +13 -0
  117. package/dist/plugin.d.mts.map +1 -0
  118. package/dist/plugin.mjs +276 -0
  119. package/dist/plugin.mjs.map +1 -0
  120. package/dist/types/command.d.cts +14 -4
  121. package/dist/types/command.d.cts.map +1 -0
  122. package/dist/types/command.d.mts +14 -4
  123. package/dist/types/command.d.mts.map +1 -0
  124. package/dist/types/config.d.cts +74 -10
  125. package/dist/types/config.d.cts.map +1 -0
  126. package/dist/types/config.d.mts +74 -10
  127. package/dist/types/config.d.mts.map +1 -0
  128. package/dist/types/context.d.cts +7 -4
  129. package/dist/types/context.d.cts.map +1 -0
  130. package/dist/types/context.d.mts +7 -4
  131. package/dist/types/context.d.mts.map +1 -0
  132. package/dist/types/index.d.cts +4 -4
  133. package/dist/types/index.d.mts +4 -4
  134. package/dist/types/internal.cjs +0 -0
  135. package/dist/types/internal.d.cts +24 -0
  136. package/dist/types/internal.d.cts.map +1 -0
  137. package/dist/types/internal.d.mts +24 -0
  138. package/dist/types/internal.d.mts.map +1 -0
  139. package/dist/types/internal.mjs +1 -0
  140. package/dist/types/options.d.cts +2 -1
  141. package/dist/types/options.d.cts.map +1 -0
  142. package/dist/types/options.d.mts +2 -1
  143. package/dist/types/options.d.mts.map +1 -0
  144. package/dist/types/runtime.cjs +0 -0
  145. package/dist/types/runtime.d.cts +24 -0
  146. package/dist/types/runtime.d.cts.map +1 -0
  147. package/dist/types/runtime.d.mts +24 -0
  148. package/dist/types/runtime.d.mts.map +1 -0
  149. package/dist/types/runtime.mjs +1 -0
  150. package/package.json +223 -91
  151. package/dist/components/utils-builtin.cjs +0 -453
  152. package/dist/components/utils-builtin.d.cts +0 -27
  153. package/dist/components/utils-builtin.d.mts +0 -27
  154. package/dist/components/utils-builtin.mjs +0 -447
  155. package/dist/powerlines.cjs +0 -172
  156. package/dist/powerlines.d.cts +0 -12
  157. package/dist/powerlines.d.mts +0 -12
  158. 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\";\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<any>[]\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":";;;;;;;;;;;AAqCA,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":";;;;;;;AAqCA;;;;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":";;;;;;;AAqCA;;;;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\";\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<any>[]\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":";;;;;;;;;;AAqCA,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,175 @@
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 __alloy_js_core.code`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 CommandDocsUsageExample(props) {
37
+ const { packageManager = "npm", command } = props;
38
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
39
+ return [
40
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
41
+ __alloy_js_core.code`\`\`\`bash `,
42
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
43
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Switch, { get children() {
44
+ return [
45
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
46
+ when: packageManager === "yarn",
47
+ children: `yarn exec `
48
+ }),
49
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
50
+ when: packageManager === "pnpm",
51
+ children: `pnpm exec `
52
+ }),
53
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
54
+ when: packageManager === "bun",
55
+ children: `bun x `
56
+ }),
57
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
58
+ "else": true,
59
+ children: `npx `
60
+ })
61
+ ];
62
+ } }),
63
+ (0, __alloy_js_core_jsx_runtime.memo)(() => `${require_plugin_utils_context_helpers.getAppBin(context)} `),
64
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
65
+ get each() {
66
+ return command.path.segments;
67
+ },
68
+ joiner: " ",
69
+ 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
70
+ }),
71
+ __alloy_js_core.code` [options] `,
72
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
73
+ __alloy_js_core.code`\`\`\``,
74
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
75
+ ];
76
+ }
77
+ /**
78
+ * Generates the markdown documentation for a command.
79
+ */
80
+ function CommandDocs(props) {
81
+ const { levelOffset = 0, command, usageExamples } = props;
82
+ return [
83
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
84
+ level: 1 + levelOffset,
85
+ get children() {
86
+ return command.title;
87
+ }
88
+ }),
89
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
90
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
91
+ (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`${command.description}`),
92
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
93
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
94
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
95
+ level: 2 + levelOffset,
96
+ children: "Usage"
97
+ }),
98
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
99
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
100
+ (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`The ${command.name} command can be executed using the following syntax: `),
101
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
102
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
103
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
104
+ get when() {
105
+ return usageExamples && usageExamples.length > 0;
106
+ },
107
+ get fallback() {
108
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(CommandDocsUsageExample, {
109
+ packageManager: "npm",
110
+ command
111
+ });
112
+ },
113
+ get children() {
114
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
115
+ each: usageExamples,
116
+ hardline: true,
117
+ children: (packageManager) => (0, __alloy_js_core_jsx_runtime.createComponent)(CommandDocsUsageExample, {
118
+ packageManager,
119
+ command
120
+ })
121
+ });
122
+ }
123
+ }),
124
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
125
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
126
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
127
+ level: 2 + levelOffset,
128
+ children: "Options"
129
+ }),
130
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
131
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
132
+ (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`The following options are available for the ${command.name} command:`),
133
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
134
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
135
+ (0, __alloy_js_core_jsx_runtime.createComponent)(CommandOptionsDocs, { command }),
136
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
137
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
138
+ ];
139
+ }
140
+ /**
141
+ * Generates the markdown documentation file for a command.
142
+ */
143
+ function CommandDocsFile(props) {
144
+ const { levelOffset = 0, command, ...rest } = props;
145
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
146
+ const usageExamples = (0, __alloy_js_core.memo)(() => [
147
+ "npm",
148
+ "yarn",
149
+ "pnpm",
150
+ "bun"
151
+ ]);
152
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_contexts_command.CommandContext.Provider, {
153
+ value: command,
154
+ get children() {
155
+ 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() {
156
+ return (0, __stryke_path_join.joinPaths)(require_docs_helpers.getDocsOutputPath(context), `${command.path.value}.md`);
157
+ } }, rest, { get children() {
158
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(CommandDocs, {
159
+ levelOffset,
160
+ command,
161
+ get usageExamples() {
162
+ return usageExamples();
163
+ }
164
+ });
165
+ } }));
166
+ }
167
+ });
168
+ }
169
+
170
+ //#endregion
171
+ exports.CommandDocs = CommandDocs;
172
+ exports.CommandDocsFile = CommandDocsFile;
173
+ exports.CommandDocsUsageExample = CommandDocsUsageExample;
174
+ exports.CommandOptionsDocs = CommandOptionsDocs;
175
+ //# sourceMappingURL=docs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.cjs","names":["code","For","Match","memo","Show","Switch","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","CommandDocsUsageExample","packageManager","context","_$createIntrinsic","children","when","_$memo","each","path","segments","joiner","segment","variables","variadic","CommandDocs","levelOffset","usageExamples","level","title","fallback","hardline","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, Match, memo, Show, Switch } 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 code`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 CommandDocsUsageExampleProps {\n /**\n * The package manager to generate the usage example for.\n *\n * @remarks\n * If not specified, examples for all supported package managers will be generated.\n *\n * @defaultValue \"npm\"\n */\n packageManager?: \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\n /**\n * The command to generate the usage example for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocsUsageExample(props: CommandDocsUsageExampleProps) {\n const { packageManager = \"npm\", command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <hbr />\n {code`\\`\\`\\`bash `}\n <hbr />\n <Switch>\n <Match when={packageManager === \"yarn\"}>{`yarn exec `}</Match>\n <Match when={packageManager === \"pnpm\"}>{`pnpm exec `}</Match>\n <Match when={packageManager === \"bun\"}>{`bun x `}</Match>\n <Match else>{`npx `}</Match>\n </Switch>\n {`${getAppBin(context)} `}\n <For each={command.path.segments} joiner=\" \">\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 </>\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 * Optional usage examples to include in the documentation.\n *\n * @defaultValue `[\"npm\"]`\n */\n usageExamples?: Required<CommandDocsUsageExampleProps>[\"packageManager\"][];\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command, usageExamples } = props;\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.title}</Heading>\n <hbr />\n <hbr />\n {code`${command.description}`}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <hbr />\n <hbr />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <hbr />\n <hbr />\n <Show\n when={usageExamples && usageExamples.length > 0}\n fallback={\n <CommandDocsUsageExample packageManager=\"npm\" command={command} />\n }>\n <For each={usageExamples!} hardline>\n {packageManager => (\n <CommandDocsUsageExample\n packageManager={packageManager}\n command={command}\n />\n )}\n </For>\n </Show>\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n <hbr />\n <hbr />\n {code`The following options are available for the ${\n command.name\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 const usageExamples = memo(\n () => [\"npm\", \"yarn\", \"pnpm\", \"bun\"] as CommandDocsProps[\"usageExamples\"]\n );\n\n return (\n <CommandContext.Provider value={command}>\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), `${command.path.value}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,81 @@
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 CommandDocsUsageExampleProps {
17
+ /**
18
+ * The package manager to generate the usage example for.
19
+ *
20
+ * @remarks
21
+ * If not specified, examples for all supported package managers will be generated.
22
+ *
23
+ * @defaultValue "npm"
24
+ */
25
+ packageManager?: "npm" | "yarn" | "pnpm" | "bun";
26
+ /**
27
+ * The command to generate the usage example for.
28
+ */
29
+ command: CommandTree;
30
+ }
31
+ /**
32
+ * Generates the markdown documentation for a command.
33
+ */
34
+ declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps): _alloy_js_core0.Children;
35
+ interface CommandDocsProps {
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 options documentation for.
47
+ */
48
+ command: CommandTree;
49
+ /**
50
+ * Optional usage examples to include in the documentation.
51
+ *
52
+ * @defaultValue `["npm"]`
53
+ */
54
+ usageExamples?: Required<CommandDocsUsageExampleProps>["packageManager"][];
55
+ }
56
+ /**
57
+ * Generates the markdown documentation for a command.
58
+ */
59
+ declare function CommandDocs(props: CommandDocsProps): _alloy_js_core0.Children;
60
+ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
61
+ /**
62
+ * The heading level offset to apply to the generated documentation.
63
+ *
64
+ * @remarks
65
+ * This is useful when nesting the documentation within other markdown files.
66
+ *
67
+ * @defaultValue 0
68
+ */
69
+ levelOffset?: number;
70
+ /**
71
+ * The command to generate documentation for.
72
+ */
73
+ command: CommandTree;
74
+ }
75
+ /**
76
+ * Generates the markdown documentation file for a command.
77
+ */
78
+ declare function CommandDocsFile(props: CommandDocsFileProps): _alloy_js_core0.Children;
79
+ //#endregion
80
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
81
+ //# 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;AAkCA;;AAqB2B,iBAnGX,kBAAA,CAmGW,KAAA,EAnGe,uBAmGf,CAAA,EAnGsC,eAAA,CAAA,QAmGtC;AAAT,UA3ED,4BAAA,CA2EC;EAAQ;AAM1B;AAgDA;;;;;AAoBA;;;;;WAvIW;;;;;iBAMK,uBAAA,QAA+B,+BAA4B,eAAA,CAAA;UAkC1D,gBAAA;;;;;;;;;;;;;WAcN;;;;;;kBAOO,SAAS;;;;;iBAMX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAgDlC,oBAAA,SAA6B,QAAQ;;;;;;;;;;;;;WAc3C;;;;;iBAMK,eAAA,QAAuB,uBAAoB,eAAA,CAAA"}
@@ -0,0 +1,81 @@
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 CommandDocsUsageExampleProps {
17
+ /**
18
+ * The package manager to generate the usage example for.
19
+ *
20
+ * @remarks
21
+ * If not specified, examples for all supported package managers will be generated.
22
+ *
23
+ * @defaultValue "npm"
24
+ */
25
+ packageManager?: "npm" | "yarn" | "pnpm" | "bun";
26
+ /**
27
+ * The command to generate the usage example for.
28
+ */
29
+ command: CommandTree;
30
+ }
31
+ /**
32
+ * Generates the markdown documentation for a command.
33
+ */
34
+ declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps): _alloy_js_core0.Children;
35
+ interface CommandDocsProps {
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 options documentation for.
47
+ */
48
+ command: CommandTree;
49
+ /**
50
+ * Optional usage examples to include in the documentation.
51
+ *
52
+ * @defaultValue `["npm"]`
53
+ */
54
+ usageExamples?: Required<CommandDocsUsageExampleProps>["packageManager"][];
55
+ }
56
+ /**
57
+ * Generates the markdown documentation for a command.
58
+ */
59
+ declare function CommandDocs(props: CommandDocsProps): _alloy_js_core0.Children;
60
+ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
61
+ /**
62
+ * The heading level offset to apply to the generated documentation.
63
+ *
64
+ * @remarks
65
+ * This is useful when nesting the documentation within other markdown files.
66
+ *
67
+ * @defaultValue 0
68
+ */
69
+ levelOffset?: number;
70
+ /**
71
+ * The command to generate documentation for.
72
+ */
73
+ command: CommandTree;
74
+ }
75
+ /**
76
+ * Generates the markdown documentation file for a command.
77
+ */
78
+ declare function CommandDocsFile(props: CommandDocsFileProps): _alloy_js_core0.Children;
79
+ //#endregion
80
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
81
+ //# 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;AAkCA;;AAqB2B,iBAnGX,kBAAA,CAmGW,KAAA,EAnGe,uBAmGf,CAAA,EAnGsC,eAAA,CAAA,QAmGtC;AAAT,UA3ED,4BAAA,CA2EC;EAAQ;AAM1B;AAgDA;;;;;AAoBA;;;;;WAvIW;;;;;iBAMK,uBAAA,QAA+B,+BAA4B,eAAA,CAAA;UAkC1D,gBAAA;;;;;;;;;;;;;WAcN;;;;;;kBAOO,SAAS;;;;;iBAMX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAgDlC,oBAAA,SAA6B,QAAQ;;;;;;;;;;;;;WAc3C;;;;;iBAMK,eAAA,QAAuB,uBAAoB,eAAA,CAAA"}