@shell-shock/core 0.17.7 → 0.17.8

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 (145) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +1 -29
  2. package/dist/api.cjs +1 -95
  3. package/dist/api.d.cts +52 -4
  4. package/dist/api.d.cts.map +1 -1
  5. package/dist/api.d.mts +52 -4
  6. package/dist/api.d.mts.map +1 -1
  7. package/dist/api.mjs +1 -92
  8. package/dist/api.mjs.map +1 -1
  9. package/dist/components/command-validation-logic.cjs +1 -292
  10. package/dist/components/command-validation-logic.mjs +1 -289
  11. package/dist/components/command-validation-logic.mjs.map +1 -1
  12. package/dist/components/docs.cjs +1 -265
  13. package/dist/components/docs.d.cts.map +1 -1
  14. package/dist/components/docs.d.mts.map +1 -1
  15. package/dist/components/docs.mjs +1 -256
  16. package/dist/components/docs.mjs.map +1 -1
  17. package/dist/components/exec-builtin.cjs +13 -429
  18. package/dist/components/exec-builtin.mjs +13 -425
  19. package/dist/components/exec-builtin.mjs.map +1 -1
  20. package/dist/components/helpers.cjs +1 -120
  21. package/dist/components/helpers.mjs +1 -112
  22. package/dist/components/helpers.mjs.map +1 -1
  23. package/dist/components/index.cjs +1 -58
  24. package/dist/components/index.mjs +1 -10
  25. package/dist/components/options-parser-logic.cjs +5 -960
  26. package/dist/components/options-parser-logic.d.cts +1 -1
  27. package/dist/components/options-parser-logic.mjs +5 -945
  28. package/dist/components/options-parser-logic.mjs.map +1 -1
  29. package/dist/components/state-builtin.cjs +8 -629
  30. package/dist/components/state-builtin.d.cts.map +1 -1
  31. package/dist/components/state-builtin.d.mts.map +1 -1
  32. package/dist/components/state-builtin.mjs +8 -622
  33. package/dist/components/state-builtin.mjs.map +1 -1
  34. package/dist/components/usage.cjs +1 -117
  35. package/dist/components/usage.mjs +1 -114
  36. package/dist/components/usage.mjs.map +1 -1
  37. package/dist/components/utils-builtin.cjs +33 -838
  38. package/dist/components/utils-builtin.d.cts.map +1 -1
  39. package/dist/components/utils-builtin.d.mts.map +1 -1
  40. package/dist/components/utils-builtin.mjs +33 -828
  41. package/dist/components/utils-builtin.mjs.map +1 -1
  42. package/dist/config.cjs +1 -31
  43. package/dist/config.mjs +1 -29
  44. package/dist/config.mjs.map +1 -1
  45. package/dist/contexts/command.cjs +1 -26
  46. package/dist/contexts/command.mjs +1 -23
  47. package/dist/contexts/command.mjs.map +1 -1
  48. package/dist/contexts/index.cjs +1 -9
  49. package/dist/contexts/index.mjs +1 -4
  50. package/dist/contexts/options.cjs +1 -63
  51. package/dist/contexts/options.mjs +1 -58
  52. package/dist/contexts/options.mjs.map +1 -1
  53. package/dist/helpers/automd.cjs +1 -71
  54. package/dist/helpers/automd.mjs +1 -70
  55. package/dist/helpers/automd.mjs.map +1 -1
  56. package/dist/helpers/docs-helpers.cjs +1 -23
  57. package/dist/helpers/docs-helpers.mjs +1 -22
  58. package/dist/helpers/docs-helpers.mjs.map +1 -1
  59. package/dist/helpers/paths.cjs +1 -137
  60. package/dist/helpers/paths.mjs +1 -133
  61. package/dist/helpers/paths.mjs.map +1 -1
  62. package/dist/helpers/persistence.cjs +1 -113
  63. package/dist/helpers/persistence.mjs +1 -110
  64. package/dist/helpers/persistence.mjs.map +1 -1
  65. package/dist/helpers/update-package-json.cjs +1 -59
  66. package/dist/helpers/update-package-json.mjs +1 -57
  67. package/dist/helpers/update-package-json.mjs.map +1 -1
  68. package/dist/helpers/utilities.cjs +1 -95
  69. package/dist/helpers/utilities.mjs +1 -93
  70. package/dist/helpers/utilities.mjs.map +1 -1
  71. package/dist/helpers/validations.cjs +1 -71
  72. package/dist/helpers/validations.mjs +1 -71
  73. package/dist/helpers/validations.mjs.map +1 -1
  74. package/dist/index.cjs +1 -52
  75. package/dist/index.d.cts +1 -1
  76. package/dist/index.d.mts +1 -1
  77. package/dist/index.mjs +1 -7
  78. package/dist/plugin-utils/compute-bin.cjs +1 -50
  79. package/dist/plugin-utils/compute-bin.mjs +1 -49
  80. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  81. package/dist/plugin-utils/context-helpers.cjs +1 -231
  82. package/dist/plugin-utils/context-helpers.mjs +1 -221
  83. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  84. package/dist/plugin-utils/deepkit.cjs +1 -71
  85. package/dist/plugin-utils/deepkit.mjs +1 -69
  86. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  87. package/dist/plugin-utils/description-helpers.cjs +2 -111
  88. package/dist/plugin-utils/description-helpers.mjs +2 -107
  89. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  90. package/dist/plugin-utils/get-command-tree.cjs +1 -117
  91. package/dist/plugin-utils/get-command-tree.mjs +1 -114
  92. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  93. package/dist/plugin-utils/index.cjs +1 -39
  94. package/dist/plugin-utils/index.mjs +1 -10
  95. package/dist/plugin-utils/reflect.cjs +1 -52
  96. package/dist/plugin-utils/reflect.mjs +1 -52
  97. package/dist/plugin-utils/reflect.mjs.map +1 -1
  98. package/dist/plugin-utils/traverse-command-tree.cjs +1 -64
  99. package/dist/plugin-utils/traverse-command-tree.mjs +1 -62
  100. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  101. package/dist/plugin-utils/type-checks.cjs +1 -93
  102. package/dist/plugin-utils/type-checks.mjs +1 -88
  103. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  104. package/dist/plugin.cjs +4 -429
  105. package/dist/plugin.d.cts.map +1 -1
  106. package/dist/plugin.d.mts.map +1 -1
  107. package/dist/plugin.mjs +4 -423
  108. package/dist/plugin.mjs.map +1 -1
  109. package/dist/resolver/deepkit.cjs +1 -135
  110. package/dist/resolver/deepkit.mjs +1 -134
  111. package/dist/resolver/deepkit.mjs.map +1 -1
  112. package/dist/resolver/helpers.cjs +1 -173
  113. package/dist/resolver/helpers.mjs +1 -168
  114. package/dist/resolver/helpers.mjs.map +1 -1
  115. package/dist/resolver/module.cjs +1 -145
  116. package/dist/resolver/module.mjs +1 -144
  117. package/dist/resolver/module.mjs.map +1 -1
  118. package/dist/resolver/resolve.cjs +1 -222
  119. package/dist/resolver/resolve.mjs +1 -221
  120. package/dist/resolver/resolve.mjs.map +1 -1
  121. package/dist/types/command.cjs +1 -441
  122. package/dist/types/command.mjs +1 -405
  123. package/dist/types/command.mjs.map +1 -1
  124. package/dist/types/config.cjs +1 -144
  125. package/dist/types/config.d.cts +3 -2
  126. package/dist/types/config.d.cts.map +1 -1
  127. package/dist/types/config.d.mts +3 -2
  128. package/dist/types/config.d.mts.map +1 -1
  129. package/dist/types/config.mjs +1 -138
  130. package/dist/types/config.mjs.map +1 -1
  131. package/dist/types/context.cjs +1 -37
  132. package/dist/types/context.d.cts +3 -2
  133. package/dist/types/context.d.cts.map +1 -1
  134. package/dist/types/context.d.mts +3 -2
  135. package/dist/types/context.d.mts.map +1 -1
  136. package/dist/types/context.mjs +1 -34
  137. package/dist/types/context.mjs.map +1 -1
  138. package/dist/types/env.cjs +1 -52
  139. package/dist/types/env.mjs +1 -50
  140. package/dist/types/env.mjs.map +1 -1
  141. package/dist/types/index.cjs +1 -49
  142. package/dist/types/index.mjs +1 -6
  143. package/dist/types/options.cjs +1 -12
  144. package/dist/types/options.mjs +1 -10
  145. package/package.json +23 -23
@@ -1,63 +1 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_types_command = require('../types/command.cjs');
4
- let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
5
- let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
6
- let defu = require("defu");
7
- defu = require_runtime.__toESM(defu, 1);
8
- let _alloy_js_core = require("@alloy-js/core");
9
-
10
- //#region src/contexts/options.ts
11
- function __assignType(fn, args) {
12
- fn.__type = args;
13
- return fn;
14
- }
15
- /**
16
- * The reflection parameter context used in template rendering.
17
- */
18
- const ExistingOptionsContext = (_alloy_js_core.createNamedContext.Ω = [["&F"]], (0, _alloy_js_core.createNamedContext)("ExistingOptions", []));
19
- /**
20
- * Hook to access the ExistingOptions context.
21
- *
22
- * @remarks
23
- * This context provides a list of option names that already exist on the interface definition.
24
- *
25
- * @returns A reactive version of the current reflection.
26
- */
27
- function useExistingOptions() {
28
- return _alloy_js_core.useContext.Ω = [["&F"]], (0, _alloy_js_core.useContext)(ExistingOptionsContext);
29
- }
30
- useExistingOptions.__type = [
31
- "useExistingOptions",
32
- "Hook to access the ExistingOptions context.",
33
- "P\"/!?\""
34
- ];
35
- function computedOptions(options) {
36
- return options.reduce(__assignType((ret, option) => {
37
- ret[(0, _stryke_string_format_camel_case.camelCase)(option.name)] ??= (0, defu.default)({ name: (0, _stryke_string_format_camel_case.camelCase)(option.name) }, ret[option.name] ?? {}, option);
38
- if (option.kind === require_types_command.CommandParameterKinds.boolean && option.isNegativeOf) ret[(0, _stryke_string_format_camel_case.camelCase)(option.isNegativeOf)] = (0, defu.default)({ name: (0, _stryke_string_format_camel_case.camelCase)(option.isNegativeOf) }, ret[option.isNegativeOf] ?? {}, {
39
- ...option,
40
- env: (0, _stryke_type_checks_is_set_string.isSetString)(option.env) ? `NO_${option.env}` : false,
41
- description: `${option.description.replace(/\.+$/, "")}. This property is the negative form of ${option.name}.`,
42
- isNegativeOf: (0, _stryke_string_format_camel_case.camelCase)(option.name),
43
- default: !option.default
44
- });
45
- return ret;
46
- }, [
47
- "ret",
48
- "option",
49
- "",
50
- "P\"2!\"2\"\"/#"
51
- ]), {});
52
- }
53
- computedOptions.__type = [
54
- "CommandOption",
55
- "options",
56
- "computedOptions",
57
- "P\"w!F2\"\"/#"
58
- ];
59
-
60
- //#endregion
61
- exports.ExistingOptionsContext = ExistingOptionsContext;
62
- exports.computedOptions = computedOptions;
63
- exports.useExistingOptions = useExistingOptions;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../types/command.cjs`);let n=require(`@stryke/string-format/camel-case`),r=require(`@stryke/type-checks/is-set-string`),i=require(`defu`);i=e.__toESM(i,1);let a=require(`@alloy-js/core`);function o(e,t){return e.__type=t,e}const s=(a.createNamedContext.Ω=[[`&F`]],(0,a.createNamedContext)(`ExistingOptions`,[]));function c(){return a.useContext.Ω=[[`&F`]],(0,a.useContext)(s)}c.__type=[`useExistingOptions`,`Hook to access the ExistingOptions context.`,`P"/!?"`];function l(e){return e.reduce(o((e,a)=>(e[(0,n.camelCase)(a.name)]??=(0,i.default)({name:(0,n.camelCase)(a.name)},e[a.name]??{},a),a.kind===t.CommandParameterKinds.boolean&&!a.variadic&&a.isNegativeOf&&(e[(0,n.camelCase)(a.isNegativeOf)]=(0,i.default)({name:(0,n.camelCase)(a.isNegativeOf)},e[a.isNegativeOf]??{},{...a,env:(0,r.isSetString)(a.env)?`NO_${a.env}`:!1,description:`${a.description.replace(/\.+$/,``)}. This property is the negative form of ${a.name}.`,isNegativeOf:(0,n.camelCase)(a.name),default:!a.default})),e),[`ret`,`option`,``,`P"2!"2""/#`]),{})}l.__type=[`CommandOption`,`options`,`computedOptions`,`P"w!F2""/#`],exports.ExistingOptionsContext=s,exports.computedOptions=l,exports.useExistingOptions=c;
@@ -1,59 +1,2 @@
1
- import { CommandParameterKinds } from "../types/command.mjs";
2
- import { camelCase } from "@stryke/string-format/camel-case";
3
- import { isSetString } from "@stryke/type-checks/is-set-string";
4
- import defu$1 from "defu";
5
- import { createNamedContext, useContext } from "@alloy-js/core";
6
-
7
- //#region src/contexts/options.ts
8
- function __assignType(fn, args) {
9
- fn.__type = args;
10
- return fn;
11
- }
12
- /**
13
- * The reflection parameter context used in template rendering.
14
- */
15
- const ExistingOptionsContext = (createNamedContext.Ω = [["&F"]], createNamedContext("ExistingOptions", []));
16
- /**
17
- * Hook to access the ExistingOptions context.
18
- *
19
- * @remarks
20
- * This context provides a list of option names that already exist on the interface definition.
21
- *
22
- * @returns A reactive version of the current reflection.
23
- */
24
- function useExistingOptions() {
25
- return useContext.Ω = [["&F"]], useContext(ExistingOptionsContext);
26
- }
27
- useExistingOptions.__type = [
28
- "useExistingOptions",
29
- "Hook to access the ExistingOptions context.",
30
- "P\"/!?\""
31
- ];
32
- function computedOptions(options) {
33
- return options.reduce(__assignType((ret, option) => {
34
- ret[camelCase(option.name)] ??= defu$1({ name: camelCase(option.name) }, ret[option.name] ?? {}, option);
35
- if (option.kind === CommandParameterKinds.boolean && option.isNegativeOf) ret[camelCase(option.isNegativeOf)] = defu$1({ name: camelCase(option.isNegativeOf) }, ret[option.isNegativeOf] ?? {}, {
36
- ...option,
37
- env: isSetString(option.env) ? `NO_${option.env}` : false,
38
- description: `${option.description.replace(/\.+$/, "")}. This property is the negative form of ${option.name}.`,
39
- isNegativeOf: camelCase(option.name),
40
- default: !option.default
41
- });
42
- return ret;
43
- }, [
44
- "ret",
45
- "option",
46
- "",
47
- "P\"2!\"2\"\"/#"
48
- ]), {});
49
- }
50
- computedOptions.__type = [
51
- "CommandOption",
52
- "options",
53
- "computedOptions",
54
- "P\"w!F2\"\"/#"
55
- ];
56
-
57
- //#endregion
58
- export { ExistingOptionsContext, computedOptions, useExistingOptions };
1
+ import{CommandParameterKinds as e}from"../types/command.mjs";import{camelCase as t}from"@stryke/string-format/camel-case";import{isSetString as n}from"@stryke/type-checks/is-set-string";import r from"defu";import{createNamedContext as i,useContext as a}from"@alloy-js/core";function o(e,t){return e.__type=t,e}const s=(i.Ω=[[`&F`]],i(`ExistingOptions`,[]));function c(){return a.Ω=[[`&F`]],a(s)}c.__type=[`useExistingOptions`,`Hook to access the ExistingOptions context.`,`P"/!?"`];function l(i){return i.reduce(o((i,a)=>(i[t(a.name)]??=r({name:t(a.name)},i[a.name]??{},a),a.kind===e.boolean&&!a.variadic&&a.isNegativeOf&&(i[t(a.isNegativeOf)]=r({name:t(a.isNegativeOf)},i[a.isNegativeOf]??{},{...a,env:n(a.env)?`NO_${a.env}`:!1,description:`${a.description.replace(/\.+$/,``)}. This property is the negative form of ${a.name}.`,isNegativeOf:t(a.name),default:!a.default})),i),[`ret`,`option`,``,`P"2!"2""/#`]),{})}l.__type=[`CommandOption`,`options`,`computedOptions`,`P"w!F2""/#`];export{s as ExistingOptionsContext,l as computedOptions,c as useExistingOptions};
59
2
  //# sourceMappingURL=options.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.mjs","names":[],"sources":["../../src/contexts/options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ComponentContext } from \"@alloy-js/core\";\nimport { createNamedContext, useContext } from \"@alloy-js/core\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { BooleanCommandOption, CommandOption } from \"../types/command\";\nimport { CommandParameterKinds } from \"../types/command\";\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const ExistingOptionsContext: ComponentContext<string[]> =\n createNamedContext<string[]>(\"ExistingOptions\", []);\n\n/**\n * Hook to access the ExistingOptions context.\n *\n * @remarks\n * This context provides a list of option names that already exist on the interface definition.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useExistingOptions() {\n return useContext<string[]>(ExistingOptionsContext)!;\n}\n\nexport function computedOptions(options: CommandOption[]) {\n return options.reduce(\n (ret, option) => {\n ret[camelCase(option.name)] ??= defu(\n {\n name: camelCase(option.name)\n },\n ret[option.name] ?? {},\n option\n ) as CommandOption;\n\n if (\n option.kind === CommandParameterKinds.boolean &&\n option.isNegativeOf\n ) {\n ret[camelCase(option.isNegativeOf)] = defu(\n {\n name: camelCase(option.isNegativeOf)\n },\n ret[option.isNegativeOf] ?? {},\n {\n ...option,\n env: isSetString(option.env) ? `NO_${option.env}` : false,\n description: `${option.description.replace(\n /\\.+$/,\n \"\"\n )}. This property is the negative form of ${option.name}.`,\n isNegativeOf: camelCase(option.name),\n default: !option.default\n }\n ) as BooleanCommandOption;\n }\n\n return ret;\n },\n {} as Record<string, CommandOption>\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;;;;AAUX,MAAa,0BAAsB,mBAAkB,IAAA,CAAA,CAAA,KAAA,CAAA,EAAA,mBAAA,mBAAA,EAAA,CAAA;;;;;;;;;AASrD,SAAS,qBAA4B;AACrC,QAAY,WAAW,IAAA,CAAA,CAAA,KAAA,CAAA,EAAA,WAAA,uBAAA;;AAEvB,mBAAS,SAAA;CAAA;CAAuC;CAAQ;CAAA;;AAEtD,QAAA,QAAA,OAAA,cAAA,KAAA,WAAA;AACK,MAAA,UAAW,OAAU,KAAA,MAAY,OAAI,EAC1C,MAAA,UAAA,OAAA,KAAA,EACK,EAAA,IAAM,OAAA,SAAA,EAAA,EAAsB,OAAE;AACnC,MAAA,OAAA,SAA0B,sBAAsB,+BAEhD,KAAA,UAAA,OAAA,aAAA,IAAA,OAAA,EACS,MAAW,UAAA,OAAgB,aAAO,EAC5C,EAAA,IAAA,OAAA,iBAAA,EAAA,EAAA;GACG,GAAA;GACY,KAAA,YAAgB,OAAG,IAAO,GAAK,MAAM,OAAO,QAAO;GAClE,aAAA,GAAA,OAAA,YAAA,QAAA,QAAA,GAAA,CAAA,0CAAA,OAAA,KAAA;GACa,cAAgB,UAAQ,OAAQ,KAAA;GAC5C,SAAA,CAAA,OAAA;GACK,CAAA;AAEP,SAAA;;;;;;;;AAGA,gBAAgB,SAAO;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"options.mjs","names":[],"sources":["../../src/contexts/options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ComponentContext } from \"@alloy-js/core\";\nimport { createNamedContext, useContext } from \"@alloy-js/core\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { BooleanCommandOption, CommandOption } from \"../types/command\";\nimport { CommandParameterKinds } from \"../types/command\";\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const ExistingOptionsContext: ComponentContext<string[]> =\n createNamedContext<string[]>(\"ExistingOptions\", []);\n\n/**\n * Hook to access the ExistingOptions context.\n *\n * @remarks\n * This context provides a list of option names that already exist on the interface definition.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useExistingOptions() {\n return useContext<string[]>(ExistingOptionsContext)!;\n}\n\nexport function computedOptions(options: CommandOption[]) {\n return options.reduce(\n (ret, option) => {\n ret[camelCase(option.name)] ??= defu(\n {\n name: camelCase(option.name)\n },\n ret[option.name] ?? {},\n option\n );\n\n if (\n option.kind === CommandParameterKinds.boolean &&\n !option.variadic &&\n option.isNegativeOf\n ) {\n ret[camelCase(option.isNegativeOf)] = defu(\n {\n name: camelCase(option.isNegativeOf)\n },\n ret[option.isNegativeOf] ?? {},\n {\n ...option,\n env: isSetString(option.env) ? `NO_${option.env}` : false,\n description: `${option.description.replace(\n /\\.+$/,\n \"\"\n )}. This property is the negative form of ${option.name}.`,\n isNegativeOf: camelCase(option.name),\n default: !option.default\n }\n ) as BooleanCommandOption;\n }\n\n return ret;\n },\n {} as Record<string, CommandOption>\n );\n}\n"],"mappings":"kRAAA,SAAS,EAAa,EAAI,EAAM,CAE9B,kBAAO,EAUT,MAAa,GAAsB,EAAkB,EAAA,CAAA,CAAA,KAAA,CAAA,CAAA,EAAA,kBAAA,EAAA,CAAA,EASrD,SAAS,GAA4B,CACrC,MAAO,GAAW,EAAK,CAAA,CAAA,KAAA,CAAA,CAAA,EAAA,EAAA,CAEvB,EAAS,OAAA,CAAA,qBAAuC,8CAAQ,SAAA,eAEtD,OAAA,EAAA,OAAA,GAAA,EAAA,KACC,EAAI,EAAW,EAAA,KAAU,IAAQ,EAAK,CACvC,KAAA,EAAA,EAAA,KAAA,CACF,CAAO,EAAA,EAAM,OAAA,EAAA,CAAA,EAAwB,CACnC,EAAA,OAAmB,EAAW,SAAqB,CAAA,EAAA,UAAA,EAAA,eAAA,EAAA,EAAA,EAAA,aAAA,EAAA,EAAA,CAEnD,KAAA,EAAA,EAAA,aAAA,CACK,CAAC,EAAG,EAAO,eAAmB,EAAC,CAAA,CACrC,GAAA,EACG,IAAA,EAAA,EAAA,IAAA,CAAA,MAAA,EAAA,MAAA,GACI,YAAQ,GAAQ,EAAO,YAAW,QAAM,OAAK,GAAQ,CAAA,0CAAiC,EAAA,KAAA,GAC7F,aAAA,EAAA,EAAA,KAAA,CACG,QAAU,CAAA,EAAS,QACrB,CAAA,EAEO,GACT,CAAA,MAAA,SAAA,GAAA,aAAA,CAAA,CAAA,EAAA,CAAA,CAEA,EAAgB,OAAA,CAAA,gBAAyB,UAAa,kBAAI,aAAA"}
@@ -1,71 +1 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
3
- const require_components_docs = require('../components/docs.cjs');
4
- require('../plugin-utils/index.cjs');
5
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
- let _alloy_js_core_components = require("@alloy-js/core/components");
7
- let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
8
- let _alloy_js_core = require("@alloy-js/core");
9
- let _alloy_js_markdown = require("@alloy-js/markdown");
10
- let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
11
- let automd = require("automd");
12
-
13
- //#region src/helpers/automd.tsx
14
- function __assignType(fn, args) {
15
- fn.__type = args;
16
- return fn;
17
- }
18
- /**
19
- * AutoMD generator to generate CLI command documentation
20
- *
21
- * @see https://automd.unjs.io/
22
- *
23
- * @param context - The generator context.
24
- * @returns The generated documentation content.
25
- */
26
- const commands = __assignType((context) => (0, automd.defineGenerator)({
27
- name: "commands",
28
- async generate() {
29
- return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, [
30
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
31
- level: 2,
32
- children: "Commands"
33
- }),
34
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
35
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following commands are available in the ${require_context_helpers.getAppTitle(context, true)} command-line interface application:`),
36
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
37
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core_components.For, {
38
- get each() {
39
- return Object.values(context.commands);
40
- },
41
- doubleHardline: true,
42
- get children() {
43
- return __assignType((child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core_components.Show, {
44
- get when() {
45
- return !child.isVirtual;
46
- },
47
- get children() {
48
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandDocs, {
49
- command: child,
50
- levelOffset: 2
51
- });
52
- }
53
- }), [
54
- "child",
55
- "",
56
- "P\"2!\"/\""
57
- ]);
58
- }
59
- }),
60
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
61
- ]) };
62
- }
63
- }), [
64
- "Context",
65
- "context",
66
- "",
67
- "P\"w!2\"\"/#"
68
- ]);
69
-
70
- //#endregion
71
- exports.commands = commands;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../plugin-utils/context-helpers.cjs`),t=require(`../components/docs.cjs`);require(`../plugin-utils/index.cjs`);let n=require(`@alloy-js/core/jsx-runtime`),r=require(`@alloy-js/core/components`),i=require(`@powerlines/plugin-alloy/render`),a=require(`@alloy-js/core`),o=require(`@alloy-js/markdown`),s=require(`@powerlines/plugin-alloy/core/components/spacing`),c=require(`automd`);function l(e,t){return e.__type=t,e}const u=l(u=>(0,c.defineGenerator)({name:`commands`,async generate(){return{contents:(0,i.renderString)(u,[(0,n.createComponent)(o.Heading,{level:2,children:`Commands`}),(0,n.createComponent)(s.Spacing,{}),(0,n.memo)(()=>a.code`The following commands are available in the ${e.getAppTitle(u,!0)} command-line interface application:`),(0,n.createComponent)(s.Spacing,{}),(0,n.createComponent)(r.For,{get each(){return Object.values(u.commands)},doubleHardline:!0,get children(){return l(e=>(0,n.createComponent)(r.Show,{get when(){return!e.isVirtual},get children(){return(0,n.createComponent)(t.CommandDocs,{command:e,levelOffset:2})}}),[`child`,``,`P"2!"/"`])}}),(0,n.createComponent)(s.Spacing,{})])}}}),[`Context`,`context`,``,`P"w!2""/#`]);exports.commands=u;
@@ -1,71 +1,2 @@
1
- import { getAppTitle } from "../plugin-utils/context-helpers.mjs";
2
- import { CommandDocs } from "../components/docs.mjs";
3
- import "../plugin-utils/index.mjs";
4
- import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
5
- import { For, Show } from "@alloy-js/core/components";
6
- import { renderString } from "@powerlines/plugin-alloy/render";
7
- import { code } from "@alloy-js/core";
8
- import { Heading } from "@alloy-js/markdown";
9
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
10
- import { defineGenerator } from "automd";
11
-
12
- //#region src/helpers/automd.tsx
13
- function __assignType(fn, args) {
14
- fn.__type = args;
15
- return fn;
16
- }
17
- /**
18
- * AutoMD generator to generate CLI command documentation
19
- *
20
- * @see https://automd.unjs.io/
21
- *
22
- * @param context - The generator context.
23
- * @returns The generated documentation content.
24
- */
25
- const commands = __assignType((context) => defineGenerator({
26
- name: "commands",
27
- async generate() {
28
- return { contents: renderString(context, [
29
- createComponent(Heading, {
30
- level: 2,
31
- children: "Commands"
32
- }),
33
- createComponent(Spacing, {}),
34
- memo(() => code`The following commands are available in the ${getAppTitle(context, true)} command-line interface application:`),
35
- createComponent(Spacing, {}),
36
- createComponent(For, {
37
- get each() {
38
- return Object.values(context.commands);
39
- },
40
- doubleHardline: true,
41
- get children() {
42
- return __assignType((child) => createComponent(Show, {
43
- get when() {
44
- return !child.isVirtual;
45
- },
46
- get children() {
47
- return createComponent(CommandDocs, {
48
- command: child,
49
- levelOffset: 2
50
- });
51
- }
52
- }), [
53
- "child",
54
- "",
55
- "P\"2!\"/\""
56
- ]);
57
- }
58
- }),
59
- createComponent(Spacing, {})
60
- ]) };
61
- }
62
- }), [
63
- "Context",
64
- "context",
65
- "",
66
- "P\"w!2\"\"/#"
67
- ]);
68
-
69
- //#endregion
70
- export { commands };
1
+ import{getAppTitle as e}from"../plugin-utils/context-helpers.mjs";import{CommandDocs as t}from"../components/docs.mjs";import"../plugin-utils/index.mjs";import{createComponent as n,memo as r}from"@alloy-js/core/jsx-runtime";import{For as i,Show as a}from"@alloy-js/core/components";import{renderString as o}from"@powerlines/plugin-alloy/render";import{code as s}from"@alloy-js/core";import{Heading as c}from"@alloy-js/markdown";import{Spacing as l}from"@powerlines/plugin-alloy/core/components/spacing";import{defineGenerator as u}from"automd";function d(e,t){return e.__type=t,e}const f=d(f=>u({name:`commands`,async generate(){return{contents:o(f,[n(c,{level:2,children:`Commands`}),n(l,{}),r(()=>s`The following commands are available in the ${e(f,!0)} command-line interface application:`),n(l,{}),n(i,{get each(){return Object.values(f.commands)},doubleHardline:!0,get children(){return d(e=>n(a,{get when(){return!e.isVirtual},get children(){return n(t,{command:e,levelOffset:2})}}),[`child`,``,`P"2!"/"`])}}),n(l,{})])}}}),[`Context`,`context`,``,`P"w!2""/#`]);export{f as commands};
71
2
  //# sourceMappingURL=automd.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"automd.mjs","names":[],"sources":["../../src/helpers/automd.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { For, Show } from \"@alloy-js/core/components\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { renderString } from \"@powerlines/plugin-alloy/render\";\nimport { defineGenerator } from \"automd\";\nimport { CommandDocs } from \"../components/docs\";\nimport { getAppTitle } from \"../plugin-utils\";\nimport type { Context } from \"../types/context\";\n\n/**\n * AutoMD generator to generate CLI command documentation\n *\n * @see https://automd.unjs.io/\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const commands = (context: Context) =>\n defineGenerator({\n name: \"commands\",\n async generate() {\n return {\n contents: renderString(\n context,\n <>\n <Heading level={2}>Commands</Heading>\n <Spacing />\n {code`The following commands are available in the ${getAppTitle(\n context,\n true\n )} command-line interface application:`}\n <Spacing />\n <For each={Object.values(context.commands)} doubleHardline>\n {child => (\n <Show when={!child.isVirtual}>\n <CommandDocs command={child} levelOffset={2} />\n </Show>\n )}\n </For>\n <Spacing />\n </>\n )\n };\n }\n });\n"],"mappings":";;;;;;;;;;;;;AAEE,IAAG,SAAS;;;;;;;;;;;AAoCd,MAAW,WAAS,cAAA,YAAA,gBAAA;CAClB,MAAE;CACF,MAAI,WAAO;AACT,SAAI,EACF,UAAI,aAAO,SAAA;GAAA,gBAAA,SAAA;IACT,OAAG;IACH,UAAK;IACN,CAAC;GAAE,gBAAY,SAAA,EAAA,CAAA;GAAA,WAAA,IAAA,+CAAA,YAAA,SAAA,KAAA,CAAA,sCAAA;GAAA,gBAAA,SAAA,EAAA,CAAA;GAAA,gBAAA,KAAA;IACd,IAAI,OAAM;AACR,YAAI,OAAO,OAAA,QAAA,SAAA;;IAEb,gBAAe;IACf,IAAI,WAAU;AACZ,YAAO,cAAa,UAAO,gBAAmB,MAAA;MAC5C,IAAG,OAAQ;AACT,cAAO,CAAC,MAAM;;MAEhB,IAAI,WAAM;AACR,cAAC,gBAAA,aAAA;QACD,SAAG;QACJ,aAAS;QACV,CAAA;;MAEL,CAAA,EAAA;MAAA;MAAA;MAAA;MAAA,CAAA;;IAEH,CAAA;GAAA,gBAAA,SAAA,EAAA,CAAA;GAAA,CAAA"}
1
+ {"version":3,"file":"automd.mjs","names":[],"sources":["../../src/helpers/automd.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { For, Show } from \"@alloy-js/core/components\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { renderString } from \"@powerlines/plugin-alloy/render\";\nimport { defineGenerator } from \"automd\";\nimport { CommandDocs } from \"../components/docs\";\nimport { getAppTitle } from \"../plugin-utils\";\nimport type { Context } from \"../types/context\";\n\n/**\n * AutoMD generator to generate CLI command documentation\n *\n * @see https://automd.unjs.io/\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const commands = (context: Context) =>\n defineGenerator({\n name: \"commands\",\n async generate() {\n return {\n contents: renderString(\n context,\n <>\n <Heading level={2}>Commands</Heading>\n <Spacing />\n {code`The following commands are available in the ${getAppTitle(\n context,\n true\n )} command-line interface application:`}\n <Spacing />\n <For each={Object.values(context.commands)} doubleHardline>\n {child => (\n <Show when={!child.isVirtual}>\n <CommandDocs command={child} levelOffset={2} />\n </Show>\n )}\n </For>\n <Spacing />\n </>\n )\n };\n }\n });\n"],"mappings":"sjBAEE,GAAG,OAAS,IAoCd,MAAW,EAAS,EAAA,GAAA,EAAA,CAClB,KAAE,WACF,MAAI,UAAO,CACT,MAAI,CACF,SAAI,EAAO,EAAA,CAAA,EAAA,EAAA,CACT,MAAG,EACH,SAAK,WACN,CAAC,CAAE,EAAY,EAAA,EAAA,CAAA,CAAA,MAAA,CAAA,+CAAA,EAAA,EAAA,GAAA,CAAA,sCAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACd,IAAI,MAAM,CACR,OAAI,OAAO,OAAA,EAAA,SAAA,EAEb,eAAe,GACf,IAAI,UAAU,CACZ,OAAO,EAAa,GAAO,EAAmB,EAAA,CAC5C,IAAG,MAAQ,CACT,MAAO,CAAC,EAAM,WAEhB,IAAI,UAAM,CACR,OAAC,EAAA,EAAA,CACD,QAAG,EACJ,YAAS,EACV,CAAA,EAEL,CAAA,CAAA,CAAA,QAAA,GAAA,UAAA,CAAA,EAEH,CAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1,23 +1 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- let _stryke_path_join = require("@stryke/path/join");
3
-
4
- //#region src/helpers/docs-helpers.ts
5
- /**
6
- * Gets the output path for the generated documentation.
7
- *
8
- * @param context - The Shell Shock context.
9
- * @returns The output path for the generated documentation.
10
- */
11
- function getDocsOutputPath(context) {
12
- return (0, _stryke_path_join.joinPaths)(context.config.root, "docs", "generated");
13
- }
14
- getDocsOutputPath.__type = [
15
- "Context",
16
- "context",
17
- "getDocsOutputPath",
18
- "Gets the output path for the generated documentation.",
19
- "P\"w!2\"&/#?$"
20
- ];
21
-
22
- //#endregion
23
- exports.getDocsOutputPath = getDocsOutputPath;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@stryke/path/join`);function t(t){return(0,e.joinPaths)(t.config.root,`docs`,`generated`)}t.__type=[`Context`,`context`,`getDocsOutputPath`,`Gets the output path for the generated documentation.`,`P"w!2"&/#?$`],exports.getDocsOutputPath=t;
@@ -1,23 +1,2 @@
1
- import { joinPaths } from "@stryke/path/join";
2
-
3
- //#region src/helpers/docs-helpers.ts
4
- /**
5
- * Gets the output path for the generated documentation.
6
- *
7
- * @param context - The Shell Shock context.
8
- * @returns The output path for the generated documentation.
9
- */
10
- function getDocsOutputPath(context) {
11
- return joinPaths(context.config.root, "docs", "generated");
12
- }
13
- getDocsOutputPath.__type = [
14
- "Context",
15
- "context",
16
- "getDocsOutputPath",
17
- "Gets the output path for the generated documentation.",
18
- "P\"w!2\"&/#?$"
19
- ];
20
-
21
- //#endregion
22
- export { getDocsOutputPath };
1
+ import{joinPaths as e}from"@stryke/path/join";function t(t){return e(t.config.root,`docs`,`generated`)}t.__type=[`Context`,`context`,`getDocsOutputPath`,`Gets the output path for the generated documentation.`,`P"w!2"&/#?$`];export{t as getDocsOutputPath};
23
2
  //# sourceMappingURL=docs-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs-helpers.mjs","names":[],"sources":["../../src/helpers/docs-helpers.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 { joinPaths } from \"@stryke/path/join\";\nimport type { Context } from \"../types/context\";\n\n/**\n * Gets the output path for the generated documentation.\n *\n * @param context - The Shell Shock context.\n * @returns The output path for the generated documentation.\n */\nexport function getDocsOutputPath(context: Context): string {\n return joinPaths(context.config.root, \"docs\", \"generated\");\n}\n"],"mappings":";;;;;;;;;AAwBA,SAAU,kBAAoB,SAAa;AACvC,QAAO,UAAK,QAAY,OAAQ,MAAA,QAAU,YAAa;;AAE3D,kBAAgB,SAAA;CAAA;CAAkB;CAAgB;CAAU;CAAA;CAAA"}
1
+ {"version":3,"file":"docs-helpers.mjs","names":[],"sources":["../../src/helpers/docs-helpers.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 { joinPaths } from \"@stryke/path/join\";\nimport type { Context } from \"../types/context\";\n\n/**\n * Gets the output path for the generated documentation.\n *\n * @param context - The Shell Shock context.\n * @returns The output path for the generated documentation.\n */\nexport function getDocsOutputPath(context: Context): string {\n return joinPaths(context.config.root, \"docs\", \"generated\");\n}\n"],"mappings":"8CAwBA,SAAU,EAAoB,EAAa,CACzC,OAAE,EAAY,EAAW,OAAK,KAAI,OAAU,YAAa,CAE3D,EAAgB,OAAA,CAAA,UAAkB,UAAgB,oBAAU,wDAAA,cAAA"}
@@ -1,137 +1 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
3
- let _stryke_path_append = require("@stryke/path/append");
4
- let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
5
- let _stryke_path_join_paths = require("@stryke/path/join-paths");
6
- let _stryke_path_replace = require("@stryke/path/replace");
7
- let _stryke_path_resolve_parent_path = require("@stryke/path/resolve-parent-path");
8
- let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
9
- let powerlines_utils = require("powerlines/utils");
10
- let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
11
- let _stryke_fs_list_files = require("@stryke/fs/list-files");
12
- let _stryke_path_common = require("@stryke/path/common");
13
- let node_fs = require("node:fs");
14
-
15
- //#region src/helpers/paths.ts
16
- function __assignType(fn, args) {
17
- fn.__type = args;
18
- return fn;
19
- }
20
- function resolveCommandId(context, file) {
21
- return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((p) => Boolean(p) && !require_context_helpers.isDynamicPathSegment(p), [
22
- "p",
23
- "",
24
- "P\"2!\"/\""
25
- ])).join("/").replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").replaceAll("/", "-");
26
- }
27
- resolveCommandId.__type = [
28
- "Context",
29
- "context",
30
- "file",
31
- "resolveCommandId",
32
- "P\"w!2\"&2#&/$"
33
- ];
34
- /**
35
- * Finds the command name from the given file path.
36
- *
37
- * @param file - The file path to extract the command name from.
38
- * @returns The command name.
39
- */
40
- function resolveCommandName(file) {
41
- let path = (0, _stryke_path_file_path_fns.findFilePath)(file);
42
- let name = (0, _stryke_path_file_path_fns.findFolderName)(file, { requireExtension: true });
43
- while (require_context_helpers.isDynamicPathSegment(name)) {
44
- path = (0, _stryke_path_resolve_parent_path.resolveParentPath)(path);
45
- name = (0, _stryke_path_file_path_fns.findFolderName)(path, { requireExtension: true });
46
- }
47
- return name;
48
- }
49
- resolveCommandName.__type = [
50
- "file",
51
- "resolveCommandName",
52
- "Finds the command name from the given file path.",
53
- "P&2!\"/\"?#"
54
- ];
55
- function resolveCommandPath(context, file) {
56
- return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").split("/").filter(__assignType((path) => path && !require_context_helpers.isPathSegmentGroup(path), [
57
- "path",
58
- "",
59
- "P\"2!\"/\""
60
- ])).join("/");
61
- }
62
- resolveCommandPath.__type = [
63
- "Context",
64
- "context",
65
- "file",
66
- "resolveCommandPath",
67
- "P\"w!2\"&2#&/$"
68
- ];
69
- function resolveCommandDynamicPathSegments(context, file) {
70
- return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((path) => Boolean(path) && require_context_helpers.isDynamicPathSegment(path), [
71
- "path",
72
- "",
73
- "P\"2!\"/\""
74
- ])).map(__assignType((path) => require_context_helpers.getDynamicPathSegmentName(path), [
75
- "path",
76
- "",
77
- "P\"2!\"/\""
78
- ]));
79
- }
80
- resolveCommandDynamicPathSegments.__type = [
81
- "Context",
82
- "context",
83
- "file",
84
- "resolveCommandDynamicPathSegments",
85
- "P\"w!2\"&2#&F/$"
86
- ];
87
- async function findCommandsRoot(context) {
88
- let paths = [];
89
- if ((0, _stryke_type_checks_is_set_string.isSetString)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input, context.config.root), context.workspaceConfig.workspaceRoot));
90
- else if ((0, powerlines_utils.isTypeDefinition)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input.file, context.config.root), context.workspaceConfig.workspaceRoot));
91
- else if (Array.isArray(context.config.input) && context.config.input.length > 0) paths = (await Promise.all(context.config.input.map(__assignType(async (input) => (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(input) ? input : input.file, context.config.root), context.workspaceConfig.workspaceRoot)), [
92
- "input",
93
- "",
94
- "P\"2!\"/\""
95
- ])))).flat();
96
- else if ((0, _stryke_type_checks_is_set_object.isSetObject)(context.config.input)) paths = (await Promise.all(Object.values(context.config.input).map(__assignType(async (input) => Array.isArray(input) ? (await Promise.all(input.map(__assignType(async (i) => (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(i) ? i : i.file, context.config.root), context.workspaceConfig.workspaceRoot)), [
97
- "i",
98
- "",
99
- "P\"2!\"/\""
100
- ])))).flat() : (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(input) ? input : input.file, context.config.root), context.workspaceConfig.workspaceRoot)), [
101
- "input",
102
- "",
103
- "P\"2!\"/\""
104
- ])))).flat();
105
- if (paths.length > 0) return (0, _stryke_path_common.commonPath)(paths.map(__assignType((p) => (0, _stryke_path_file_path_fns.findFilePath)(p), [
106
- "p",
107
- "",
108
- "P\"2!\"/\""
109
- ])));
110
- let commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src/commands");
111
- if (!(0, node_fs.existsSync)(commandsPath)) {
112
- commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "commands");
113
- if (!(0, node_fs.existsSync)(commandsPath)) {
114
- commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src");
115
- if (!(0, node_fs.existsSync)(commandsPath)) commandsPath = context.config.root;
116
- }
117
- }
118
- paths = (await Promise.all([(0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_append.appendPath)(commandsPath, context.workspaceConfig.workspaceRoot), "**/command.ts")), (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_append.appendPath)(commandsPath, context.workspaceConfig.workspaceRoot), "**/command.tsx"))])).flat();
119
- if (paths.length > 0) return (0, _stryke_path_common.commonPath)(paths.map(__assignType((p) => (0, _stryke_path_file_path_fns.findFilePath)(p), [
120
- "p",
121
- "",
122
- "P\"2!\"/\""
123
- ])));
124
- return (0, _stryke_path_append.appendPath)(commandsPath, context.workspaceConfig.workspaceRoot);
125
- }
126
- findCommandsRoot.__type = [
127
- "Context",
128
- "context",
129
- "findCommandsRoot",
130
- "P\"w!2\"&`/#"
131
- ];
132
-
133
- //#endregion
134
- exports.findCommandsRoot = findCommandsRoot;
135
- exports.resolveCommandId = resolveCommandId;
136
- exports.resolveCommandName = resolveCommandName;
137
- exports.resolveCommandPath = resolveCommandPath;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../plugin-utils/context-helpers.cjs`);let t=require(`@stryke/path/append`),n=require(`@stryke/path/file-path-fns`),r=require(`@stryke/path/join-paths`),i=require(`@stryke/path/replace`),a=require(`@stryke/path/resolve-parent-path`),o=require(`@stryke/type-checks/is-set-string`),s=require(`powerlines/utils`),c=require(`@stryke/type-checks/is-set-object`),l=require(`@stryke/fs/list-files`),u=require(`@stryke/path/common`),d=require(`node:fs`);function f(e,t){return e.__type=t,e}function p(t,r){return(0,i.replacePath)((0,n.findFilePath)(r),t.commandsPath).split(`/`).filter(f(t=>!!t&&!e.isDynamicPathSegment(t),[`p`,``,`P"2!"/"`])).join(`/`).replaceAll(/^\/+/g,``).replaceAll(/\/+$/g,``).replaceAll(`/`,`-`)}p.__type=[`Context`,`context`,`file`,`resolveCommandId`,`P"w!2"&2#&/$`];function m(t){let r=(0,n.findFilePath)(t),i=(0,n.findFolderName)(t,{requireExtension:!0});for(;e.isDynamicPathSegment(i);)r=(0,a.resolveParentPath)(r),i=(0,n.findFolderName)(r,{requireExtension:!0});return i}m.__type=[`file`,`resolveCommandName`,`Finds the command name from the given file path.`,`P&2!"/"?#`];function h(t,r){return(0,i.replacePath)((0,n.findFilePath)(r),t.commandsPath).replaceAll(/^\/+/g,``).replaceAll(/\/+$/g,``).split(`/`).filter(f(t=>t&&!e.isPathSegmentGroup(t),[`path`,``,`P"2!"/"`])).join(`/`)}h.__type=[`Context`,`context`,`file`,`resolveCommandPath`,`P"w!2"&2#&/$`];function g(t,r){return(0,i.replacePath)((0,n.findFilePath)(r),t.commandsPath).split(`/`).filter(f(t=>!!t&&e.isDynamicPathSegment(t),[`path`,``,`P"2!"/"`])).map(f(t=>e.getDynamicPathSegmentName(t),[`path`,``,`P"2!"/"`]))}g.__type=[`Context`,`context`,`file`,`resolveCommandDynamicPathSegments`,`P"w!2"&2#&F/$`];async function _(e){let i=[];if((0,o.isSetString)(e.config.input)?i=await(0,l.listFiles)((0,t.appendPath)((0,t.appendPath)(e.config.input,e.config.root),e.config.cwd)):(0,s.isTypeDefinition)(e.config.input)?i=await(0,l.listFiles)((0,t.appendPath)((0,t.appendPath)(e.config.input.file,e.config.root),e.config.cwd)):Array.isArray(e.config.input)&&e.config.input.length>0?i=(await Promise.all(e.config.input.map(f(async n=>(0,l.listFiles)((0,t.appendPath)((0,t.appendPath)((0,o.isSetString)(n)?n:n.file,e.config.root),e.config.cwd)),[`input`,``,`P"2!"/"`])))).flat():(0,c.isSetObject)(e.config.input)&&(i=(await Promise.all(Object.values(e.config.input).map(f(async n=>Array.isArray(n)?(await Promise.all(n.map(f(async n=>(0,l.listFiles)((0,t.appendPath)((0,t.appendPath)((0,o.isSetString)(n)?n:n.file,e.config.root),e.config.cwd)),[`i`,``,`P"2!"/"`])))).flat():(0,l.listFiles)((0,t.appendPath)((0,t.appendPath)((0,o.isSetString)(n)?n:n.file,e.config.root),e.config.cwd)),[`input`,``,`P"2!"/"`])))).flat()),i.length>0)return(0,u.commonPath)(i.map(f(e=>(0,n.findFilePath)(e),[`p`,``,`P"2!"/"`])));let a=(0,r.joinPaths)(e.config.root,`src/commands`);return(0,d.existsSync)(a)||(a=(0,r.joinPaths)(e.config.root,`commands`),(0,d.existsSync)(a)||(a=(0,r.joinPaths)(e.config.root,`src`),(0,d.existsSync)(a)||(a=e.config.root))),i=(await Promise.all([(0,l.listFiles)((0,r.joinPaths)((0,t.appendPath)(a,e.config.cwd),`**/command.ts`)),(0,l.listFiles)((0,r.joinPaths)((0,t.appendPath)(a,e.config.cwd),`**/command.tsx`))])).flat(),i.length>0?(0,u.commonPath)(i.map(f(e=>(0,n.findFilePath)(e),[`p`,``,`P"2!"/"`]))):(0,t.appendPath)(a,e.config.cwd)}_.__type=[`Context`,`context`,`findCommandsRoot`,'P"w!2"&`/#'],exports.findCommandsRoot=_,exports.resolveCommandId=p,exports.resolveCommandName=m,exports.resolveCommandPath=h;