@shell-shock/core 0.3.0 → 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 (45) hide show
  1. package/dist/api.cjs.map +1 -1
  2. package/dist/api.d.cts.map +1 -1
  3. package/dist/api.d.mts.map +1 -1
  4. package/dist/api.mjs.map +1 -1
  5. package/dist/components/docs.cjs +87 -17
  6. package/dist/components/docs.cjs.map +1 -1
  7. package/dist/components/docs.d.cts +26 -1
  8. package/dist/components/docs.d.cts.map +1 -1
  9. package/dist/components/docs.d.mts +26 -1
  10. package/dist/components/docs.d.mts.map +1 -1
  11. package/dist/components/docs.mjs +88 -19
  12. package/dist/components/docs.mjs.map +1 -1
  13. package/dist/components/index.cjs +1 -0
  14. package/dist/components/index.d.cts +2 -2
  15. package/dist/components/index.d.mts +2 -2
  16. package/dist/components/index.mjs +2 -2
  17. package/dist/helpers/automd.cjs +59 -0
  18. package/dist/helpers/automd.cjs.map +1 -0
  19. package/dist/helpers/automd.mjs +58 -0
  20. package/dist/helpers/automd.mjs.map +1 -0
  21. package/dist/helpers/resolve-command.cjs +1 -1
  22. package/dist/helpers/resolve-command.cjs.map +1 -1
  23. package/dist/helpers/resolve-command.mjs +1 -1
  24. package/dist/helpers/resolve-command.mjs.map +1 -1
  25. package/dist/plugin.cjs +23 -6
  26. package/dist/plugin.cjs.map +1 -1
  27. package/dist/plugin.d.cts.map +1 -1
  28. package/dist/plugin.d.mts.map +1 -1
  29. package/dist/plugin.mjs +21 -6
  30. package/dist/plugin.mjs.map +1 -1
  31. package/dist/types/command.d.cts +1 -0
  32. package/dist/types/command.d.cts.map +1 -1
  33. package/dist/types/command.d.mts +1 -0
  34. package/dist/types/command.d.mts.map +1 -1
  35. package/dist/types/config.d.cts +3 -2
  36. package/dist/types/config.d.cts.map +1 -1
  37. package/dist/types/config.d.mts +3 -2
  38. package/dist/types/config.d.mts.map +1 -1
  39. package/dist/types/runtime.cjs +0 -0
  40. package/dist/types/runtime.d.cts +24 -0
  41. package/dist/types/runtime.d.cts.map +1 -0
  42. package/dist/types/runtime.d.mts +24 -0
  43. package/dist/types/runtime.d.mts.map +1 -0
  44. package/dist/types/runtime.mjs +1 -0
  45. package/package.json +27 -10
package/dist/api.cjs.map CHANGED
@@ -1 +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"}
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"}
@@ -1 +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"}
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,aAkB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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"}
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.map CHANGED
@@ -1 +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"}
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"}
@@ -18,7 +18,7 @@ let __stryke_path_join = require("@stryke/path/join");
18
18
  */
19
19
  function CommandOptionsDocs(props) {
20
20
  const { command } = props;
21
- if (Object.keys(command.options).length === 0) return ["This command does not have any options."];
21
+ if (Object.keys(command.options).length === 0) return __alloy_js_core.code`This command does not have any options.`;
22
22
  return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_markdown_components_markdown_table.MarkdownTable, { get data() {
23
23
  return require_plugin_utils_reflect.sortOptions(Object.values(command.options)).map((option) => {
24
24
  return {
@@ -33,43 +33,103 @@ function CommandOptionsDocs(props) {
33
33
  /**
34
34
  * Generates the markdown documentation for a command.
35
35
  */
36
- function CommandDocs(props) {
37
- const { levelOffset = 0, command } = props;
36
+ function CommandDocsUsageExample(props) {
37
+ const { packageManager = "npm", command } = props;
38
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;
39
82
  return [
40
83
  (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
41
84
  level: 1 + levelOffset,
42
85
  get children() {
43
- return command.name;
86
+ return command.title;
44
87
  }
45
88
  }),
46
- (0, __alloy_js_core_jsx_runtime.memo)(() => command.description),
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}`),
47
92
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
48
93
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
49
94
  (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
50
95
  level: 2 + levelOffset,
51
96
  children: "Usage"
52
97
  }),
53
- __alloy_js_core.code`The command can be executed using the following syntax:
54
- \`\`\`bash `,
55
98
  (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;
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;
60
106
  },
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
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
+ }
62
123
  }),
63
- __alloy_js_core.code` [options] `,
64
- (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
65
- __alloy_js_core.code`\`\`\``,
66
124
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
67
125
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
68
126
  (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
69
127
  level: 2 + levelOffset,
70
128
  children: "Options"
71
129
  }),
72
- (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`The following options are available for the ${command.title} command:`),
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:`),
73
133
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
74
134
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
75
135
  (0, __alloy_js_core_jsx_runtime.createComponent)(CommandOptionsDocs, { command }),
@@ -83,6 +143,12 @@ function CommandDocs(props) {
83
143
  function CommandDocsFile(props) {
84
144
  const { levelOffset = 0, command, ...rest } = props;
85
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
+ ]);
86
152
  return (0, __alloy_js_core_jsx_runtime.createComponent)(require_contexts_command.CommandContext.Provider, {
87
153
  value: command,
88
154
  get children() {
@@ -91,7 +157,10 @@ function CommandDocsFile(props) {
91
157
  } }, rest, { get children() {
92
158
  return (0, __alloy_js_core_jsx_runtime.createComponent)(CommandDocs, {
93
159
  levelOffset,
94
- command
160
+ command,
161
+ get usageExamples() {
162
+ return usageExamples();
163
+ }
95
164
  });
96
165
  } }));
97
166
  }
@@ -101,5 +170,6 @@ function CommandDocsFile(props) {
101
170
  //#endregion
102
171
  exports.CommandDocs = CommandDocs;
103
172
  exports.CommandDocsFile = CommandDocsFile;
173
+ exports.CommandDocsUsageExample = CommandDocsUsageExample;
104
174
  exports.CommandOptionsDocs = CommandOptionsDocs;
105
175
  //# sourceMappingURL=docs.cjs.map
@@ -1 +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}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AC,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"}
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":";;;;;;;;;;;;;;;;;;AA+CA,SAAgBkB,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAOxB,oBAAI;AAGb,yDACGS,4EAAa,EAAA,IACZiB,OAAI;AAAA,SAAET,yCAAY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6B;CAC3D,MAAM,EAAEmC,cAAc,GAAGlC,SAAS,GAAGyC,SAAS1C;CAE9C,MAAMsB,8EAAkC;CACxC,MAAMc,gDACE;EAAC;EAAO;EAAQ;EAAQ;EAChC,CAAC;AAED,yDACG3C,wCAAekD,UAAQ;EAACC,OAAO3C;EAAO,IAAAuB,WAAA;AAAA,2DACpCnC,sHAAY,EAAA,IACXuC,OAAI;AAAA,6CAAYlC,uCAAkB4B,QAAQ,EAAE,GAAGrB,QAAQ2B,KAAKgB,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAlB,WAAA;AAAA,4DACPU,aAAW;KACGC;KACJlC;KAAO,IAChBmC,gBAAa;AAAA,aAAEA,eAAe;;KAAA,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
@@ -13,6 +13,25 @@ interface CommandOptionsDocsProps {
13
13
  * Generates the options markdown documentation for a command.
14
14
  */
15
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;
16
35
  interface CommandDocsProps {
17
36
  /**
18
37
  * The heading level offset to apply to the generated documentation.
@@ -27,6 +46,12 @@ interface CommandDocsProps {
27
46
  * The command to generate options documentation for.
28
47
  */
29
48
  command: CommandTree;
49
+ /**
50
+ * Optional usage examples to include in the documentation.
51
+ *
52
+ * @defaultValue `["npm"]`
53
+ */
54
+ usageExamples?: Required<CommandDocsUsageExampleProps>["packageManager"][];
30
55
  }
31
56
  /**
32
57
  * Generates the markdown documentation for a command.
@@ -52,5 +77,5 @@ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
52
77
  */
53
78
  declare function CommandDocsFile(props: CommandDocsFileProps): _alloy_js_core0.Children;
54
79
  //#endregion
55
- export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
80
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
56
81
  //# sourceMappingURL=docs.d.cts.map
@@ -1 +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"}
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"}
@@ -13,6 +13,25 @@ interface CommandOptionsDocsProps {
13
13
  * Generates the options markdown documentation for a command.
14
14
  */
15
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;
16
35
  interface CommandDocsProps {
17
36
  /**
18
37
  * The heading level offset to apply to the generated documentation.
@@ -27,6 +46,12 @@ interface CommandDocsProps {
27
46
  * The command to generate options documentation for.
28
47
  */
29
48
  command: CommandTree;
49
+ /**
50
+ * Optional usage examples to include in the documentation.
51
+ *
52
+ * @defaultValue `["npm"]`
53
+ */
54
+ usageExamples?: Required<CommandDocsUsageExampleProps>["packageManager"][];
30
55
  }
31
56
  /**
32
57
  * Generates the markdown documentation for a command.
@@ -52,5 +77,5 @@ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
52
77
  */
53
78
  declare function CommandDocsFile(props: CommandDocsFileProps): _alloy_js_core0.Children;
54
79
  //#endregion
55
- export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
80
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
56
81
  //# sourceMappingURL=docs.d.mts.map
@@ -1 +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"}
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"}
@@ -4,7 +4,7 @@ import { getAppBin, getVariableCommandPathName, isVariableCommandPath } from "..
4
4
  import { sortOptions } from "../plugin-utils/reflect.mjs";
5
5
  import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
6
6
  import { kebabCase } from "@stryke/string-format/kebab-case";
7
- import { For, code } from "@alloy-js/core";
7
+ import { For, Match, Show, Switch, code, memo as memo$1 } from "@alloy-js/core";
8
8
  import { Heading } from "@alloy-js/markdown";
9
9
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
10
10
  import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
@@ -17,7 +17,7 @@ import { joinPaths } from "@stryke/path/join";
17
17
  */
18
18
  function CommandOptionsDocs(props) {
19
19
  const { command } = props;
20
- if (Object.keys(command.options).length === 0) return ["This command does not have any options."];
20
+ if (Object.keys(command.options).length === 0) return code`This command does not have any options.`;
21
21
  return createComponent(MarkdownTable, { get data() {
22
22
  return sortOptions(Object.values(command.options)).map((option) => {
23
23
  return {
@@ -32,43 +32,103 @@ function CommandOptionsDocs(props) {
32
32
  /**
33
33
  * Generates the markdown documentation for a command.
34
34
  */
35
- function CommandDocs(props) {
36
- const { levelOffset = 0, command } = props;
35
+ function CommandDocsUsageExample(props) {
36
+ const { packageManager = "npm", command } = props;
37
37
  const context = usePowerlines();
38
+ return [
39
+ createIntrinsic("hbr", {}),
40
+ code`\`\`\`bash `,
41
+ createIntrinsic("hbr", {}),
42
+ createComponent(Switch, { get children() {
43
+ return [
44
+ createComponent(Match, {
45
+ when: packageManager === "yarn",
46
+ children: `yarn exec `
47
+ }),
48
+ createComponent(Match, {
49
+ when: packageManager === "pnpm",
50
+ children: `pnpm exec `
51
+ }),
52
+ createComponent(Match, {
53
+ when: packageManager === "bun",
54
+ children: `bun x `
55
+ }),
56
+ createComponent(Match, {
57
+ "else": true,
58
+ children: `npx `
59
+ })
60
+ ];
61
+ } }),
62
+ memo(() => `${getAppBin(context)} `),
63
+ createComponent(For, {
64
+ get each() {
65
+ return command.path.segments;
66
+ },
67
+ joiner: " ",
68
+ children: (segment) => isVariableCommandPath(segment) ? `<${command.path.variables[segment]?.variadic ? "..." : ""}${kebabCase(getVariableCommandPathName(segment))}>` : segment
69
+ }),
70
+ code` [options] `,
71
+ createIntrinsic("hbr", {}),
72
+ code`\`\`\``,
73
+ createIntrinsic("hbr", {})
74
+ ];
75
+ }
76
+ /**
77
+ * Generates the markdown documentation for a command.
78
+ */
79
+ function CommandDocs(props) {
80
+ const { levelOffset = 0, command, usageExamples } = props;
38
81
  return [
39
82
  createComponent(Heading, {
40
83
  level: 1 + levelOffset,
41
84
  get children() {
42
- return command.name;
85
+ return command.title;
43
86
  }
44
87
  }),
45
- memo(() => command.description),
88
+ createIntrinsic("hbr", {}),
89
+ createIntrinsic("hbr", {}),
90
+ memo(() => code`${command.description}`),
46
91
  createIntrinsic("hbr", {}),
47
92
  createIntrinsic("hbr", {}),
48
93
  createComponent(Heading, {
49
94
  level: 2 + levelOffset,
50
95
  children: "Usage"
51
96
  }),
52
- code`The command can be executed using the following syntax:
53
- \`\`\`bash `,
54
97
  createIntrinsic("hbr", {}),
55
- memo(() => code`$ ${getAppBin(context)} `),
56
- createComponent(For, {
57
- get each() {
58
- return command.path.segments;
98
+ createIntrinsic("hbr", {}),
99
+ memo(() => code`The ${command.name} command can be executed using the following syntax: `),
100
+ createIntrinsic("hbr", {}),
101
+ createIntrinsic("hbr", {}),
102
+ createComponent(Show, {
103
+ get when() {
104
+ return usageExamples && usageExamples.length > 0;
59
105
  },
60
- children: (segment) => isVariableCommandPath(segment) ? `<${command.path.variables[segment]?.variadic ? "..." : ""}${kebabCase(getVariableCommandPathName(segment))}>` : segment
106
+ get fallback() {
107
+ return createComponent(CommandDocsUsageExample, {
108
+ packageManager: "npm",
109
+ command
110
+ });
111
+ },
112
+ get children() {
113
+ return createComponent(For, {
114
+ each: usageExamples,
115
+ hardline: true,
116
+ children: (packageManager) => createComponent(CommandDocsUsageExample, {
117
+ packageManager,
118
+ command
119
+ })
120
+ });
121
+ }
61
122
  }),
62
- code` [options] `,
63
- createIntrinsic("hbr", {}),
64
- code`\`\`\``,
65
123
  createIntrinsic("hbr", {}),
66
124
  createIntrinsic("hbr", {}),
67
125
  createComponent(Heading, {
68
126
  level: 2 + levelOffset,
69
127
  children: "Options"
70
128
  }),
71
- memo(() => code`The following options are available for the ${command.title} command:`),
129
+ createIntrinsic("hbr", {}),
130
+ createIntrinsic("hbr", {}),
131
+ memo(() => code`The following options are available for the ${command.name} command:`),
72
132
  createIntrinsic("hbr", {}),
73
133
  createIntrinsic("hbr", {}),
74
134
  createComponent(CommandOptionsDocs, { command }),
@@ -82,6 +142,12 @@ function CommandDocs(props) {
82
142
  function CommandDocsFile(props) {
83
143
  const { levelOffset = 0, command, ...rest } = props;
84
144
  const context = usePowerlines();
145
+ const usageExamples = memo$1(() => [
146
+ "npm",
147
+ "yarn",
148
+ "pnpm",
149
+ "bun"
150
+ ]);
85
151
  return createComponent(CommandContext.Provider, {
86
152
  value: command,
87
153
  get children() {
@@ -90,7 +156,10 @@ function CommandDocsFile(props) {
90
156
  } }, rest, { get children() {
91
157
  return createComponent(CommandDocs, {
92
158
  levelOffset,
93
- command
159
+ command,
160
+ get usageExamples() {
161
+ return usageExamples();
162
+ }
94
163
  });
95
164
  } }));
96
165
  }
@@ -98,5 +167,5 @@ function CommandDocsFile(props) {
98
167
  }
99
168
 
100
169
  //#endregion
101
- export { CommandDocs, CommandDocsFile, CommandOptionsDocs };
170
+ export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs };
102
171
  //# sourceMappingURL=docs.mjs.map
@@ -1 +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>\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E,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
+ {"version":3,"file":"docs.mjs","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":";;;;;;;;;;;;;;;;;AA+CA,SAAgBkB,mBAAmBC,OAAgC;C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OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAAjB,gBAKJnB,SAAO;GAACkD,OAAO,IAAIF;GAAWX,UAAA;GAAA,CAAA;EAAAD,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAAG,WAG9B7C,IAAI,+CACHoB,QAAQU,KAAI,WACH;EAAAY,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAAjB,gBAGVP,oBAAkB,EAAUE,SAAO,CAAA;EAAAsB,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;;;;;AA2B1C,SAAgBkB,gBAAgBzC,OAA6B;CAC3D,MAAM,EAAEmC,cAAc,GAAGlC,SAAS,GAAGyC,SAAS1C;CAE9C,MAAMsB,UAAUlC,eAAwB;CACxC,MAAMgD,gBAAgBpD,aACd;EAAC;EAAO;EAAQ;EAAQ;EAChC,CAAC;AAED,QAAAsB,gBACGb,eAAekD,UAAQ;EAACC,OAAO3C;EAAO,IAAAuB,WAAA;AAAA,UAAAlB,gBACpCjB,cAAYwD,WAAA,EAAA,IACXjB,OAAI;AAAA,WAAErC,UAAUG,kBAAkB4B,QAAQ,EAAE,GAAGrB,QAAQ2B,KAAKgB,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAlB,WAAA;AAAA,WAAAlB,gBACP4B,aAAW;KACGC;KACJlC;KAAO,IAChBmC,gBAAa;AAAA,aAAEA,eAAe;;KAAA,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
@@ -2,4 +2,5 @@ const require_components_docs = require('./docs.cjs');
2
2
 
3
3
  exports.CommandDocs = require_components_docs.CommandDocs;
4
4
  exports.CommandDocsFile = require_components_docs.CommandDocsFile;
5
+ exports.CommandDocsUsageExample = require_components_docs.CommandDocsUsageExample;
5
6
  exports.CommandOptionsDocs = require_components_docs.CommandOptionsDocs;
@@ -1,2 +1,2 @@
1
- import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.cjs";
2
- export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
1
+ import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.cjs";
2
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
@@ -1,2 +1,2 @@
1
- import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.mjs";
2
- export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandOptionsDocs, CommandOptionsDocsProps };
1
+ import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.mjs";
2
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
@@ -1,3 +1,3 @@
1
- import { CommandDocs, CommandDocsFile, CommandOptionsDocs } from "./docs.mjs";
1
+ import { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs } from "./docs.mjs";
2
2
 
3
- export { CommandDocs, CommandDocsFile, CommandOptionsDocs };
3
+ export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs };