@shell-shock/plugin-help 0.1.12 → 0.2.1

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.
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.1.10-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.1.12-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
package/dist/index.cjs CHANGED
@@ -30,25 +30,26 @@ const plugin = (options = {}) => {
30
30
  enforce: "post",
31
31
  config() {
32
32
  this.debug("Providing default configuration for the Shell Shock `help` plugin.");
33
- return { help: (0, defu.default)({ command: options.command === false ? false : (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "help" }, options, { builtins: true }) };
33
+ return { help: (0, defu.default)({ command: options.command === false ? false : (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? { name: options.command } : { name: "help" } }, options, { builtins: true }) };
34
34
  },
35
35
  async configResolved() {
36
36
  this.debug("Adding the Help command to the application context.");
37
37
  if (this.config.help.command !== false) {
38
38
  this.inputs ??= [];
39
- if (this.inputs.some((input) => input.name === this.config.help.command)) this.info("The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.");
39
+ if (this.inputs.some((input) => input.name === this.config.help.command.name)) this.info("The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.");
40
40
  else this.inputs.push({
41
- id: this.config.help.command,
42
- name: this.config.help.command,
43
- path: this.config.help.command,
44
- segments: [this.config.help.command],
41
+ id: this.config.help.command.name,
42
+ path: this.config.help.command.name,
43
+ segments: [this.config.help.command.name],
45
44
  title: "Help",
45
+ icon: "?",
46
46
  description: `A command for displaying help information to assist in using the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface application.`,
47
47
  entry: {
48
48
  file: (0, _stryke_path_join.joinPaths)(this.entryPath, "help", "index.ts"),
49
49
  input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "help", "command.ts") }
50
50
  },
51
- isVirtual: false
51
+ isVirtual: false,
52
+ ...this.config.help.command
52
53
  });
53
54
  await (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_help_command.HelpCommand, {}));
54
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;AAyCA;;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAgHJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAoHJ,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAyCA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAgHJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAoHJ,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -25,25 +25,26 @@ const plugin = (options = {}) => {
25
25
  enforce: "post",
26
26
  config() {
27
27
  this.debug("Providing default configuration for the Shell Shock `help` plugin.");
28
- return { help: defu({ command: options.command === false ? false : isSetString(options.command) ? options.command : "help" }, options, { builtins: true }) };
28
+ return { help: defu({ command: options.command === false ? false : isSetString(options.command) ? { name: options.command } : { name: "help" } }, options, { builtins: true }) };
29
29
  },
30
30
  async configResolved() {
31
31
  this.debug("Adding the Help command to the application context.");
32
32
  if (this.config.help.command !== false) {
33
33
  this.inputs ??= [];
34
- if (this.inputs.some((input) => input.name === this.config.help.command)) this.info("The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.");
34
+ if (this.inputs.some((input) => input.name === this.config.help.command.name)) this.info("The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.");
35
35
  else this.inputs.push({
36
- id: this.config.help.command,
37
- name: this.config.help.command,
38
- path: this.config.help.command,
39
- segments: [this.config.help.command],
36
+ id: this.config.help.command.name,
37
+ path: this.config.help.command.name,
38
+ segments: [this.config.help.command.name],
40
39
  title: "Help",
40
+ icon: "?",
41
41
  description: `A command for displaying help information to assist in using the ${getAppTitle(this, true)} command-line interface application.`,
42
42
  entry: {
43
43
  file: joinPaths(this.entryPath, "help", "index.ts"),
44
44
  input: { file: joinPaths(this.entryPath, "help", "command.ts") }
45
45
  },
46
- isVirtual: false
46
+ isVirtual: false,
47
+ ...this.config.help.command
47
48
  });
48
49
  await render(this, createComponent(HelpCommand, {}));
49
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { computed, For, Show } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport {\n getAppDescription,\n getAppName,\n getAppTitle,\n getCommandList\n} from \"@shell-shock/core/plugin-utils\";\nimport console from \"@shell-shock/plugin-console\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport { HelpBuiltin, HelpCommand } from \"./components\";\nimport type { HelpPluginContext, HelpPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\n/**\n * The Help - Shell Shock plugin to add a help command to the application.\n */\nexport const plugin = <TContext extends HelpPluginContext = HelpPluginContext>(\n options: HelpPluginOptions = {}\n) => {\n return [\n ...theme(options.theme),\n console(options.console),\n {\n name: \"shell-shock:help\",\n enforce: \"post\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `help` plugin.\"\n );\n\n return {\n help: defu(\n {\n command:\n options.command === false\n ? false\n : isSetString(options.command)\n ? options.command\n : \"help\"\n },\n options,\n {\n builtins: true\n }\n )\n };\n },\n async configResolved() {\n this.debug(\"Adding the Help command to the application context.\");\n\n if (this.config.help.command !== false) {\n this.inputs ??= [];\n if (\n this.inputs.some(input => input.name === this.config.help.command)\n ) {\n this.info(\n \"The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: this.config.help.command,\n name: this.config.help.command,\n path: this.config.help.command,\n segments: [this.config.help.command],\n title: \"Help\",\n description: `A command for displaying help information to assist in using the ${getAppTitle(\n this,\n true\n )} command-line interface application.`,\n entry: {\n file: joinPaths(this.entryPath, \"help\", \"index.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"help\", \"command.ts\")\n }\n },\n isVirtual: false\n });\n }\n\n await render(this, <HelpCommand />);\n }\n },\n prepare: {\n order: \"post\",\n async handler() {\n const commands = await getCommandList(this);\n this.debug(\n `Rendering \\`help\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(this),\n title: getAppTitle(this),\n description: getAppDescription(this),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n options: Object.fromEntries(\n this.options.map(option => [option.name, option])\n ),\n entry: {\n file: joinPaths(this.entryPath, \"bin.ts\")\n },\n args: [],\n parent: null,\n children: this.commands\n }));\n\n return render(\n this,\n <>\n <Show when={this.config.help.builtins !== false}>\n <HelpBuiltin command={bin.value} />\n <Spacing />\n <For\n each={commands.sort((a, b) => a.name.localeCompare(b.name))}\n doubleHardline>\n {command => <HelpBuiltin command={command} />}\n </For>\n </Show>\n </>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AA,CAAA,OAAA,MAAA,OAAA,CAAA,CAAA;MACV,OAAM,EACJ,MAAK,UAAQ,KAAK,WAAU,SAAa,EAC1C;MACD,MAAM,EAAA;MACN,QAAM;MACN,UAAQ,KAAM;MACf,EAAE;AACH,YAAO,OAAA,MAAA,CAAA,gBAAA,MAAA;MACL,IAAI,OAAA;AACF,cAAE,OAAA,OAAA,KAAA,aAAA;;;AAGJ,cAAM;QAAA,gBAAc,aAAe,EACrC,IAAA,UAAA;AACD,gBAAA,IAAA;WAEM,CAAC;QAAE,gBAAK,SAAA,EAAA,CAAA;QAAA,gBAAA,KAAA;SACP,IAAA,OAAU;AACR,iBAAA,SAAgB,MAAC,GAAA,MAAc,EAAC,KAAK,cAAA,EAAA,KAAA,CAAA;;SAExC,gBAAiB;SAChB,WAAS,YAAA,gBAAA,aAAA,EACD,SACX,CAAA;;;;MAGF,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { computed, For, Show } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport {\n getAppDescription,\n getAppName,\n getAppTitle,\n getCommandList\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandConfig } from \"@shell-shock/core/types/command\";\nimport console from \"@shell-shock/plugin-console\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport { HelpBuiltin, HelpCommand } from \"./components\";\nimport type { HelpPluginContext, HelpPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\n/**\n * The Help - Shell Shock plugin to add a help command to the application.\n */\nexport const plugin = <TContext extends HelpPluginContext = HelpPluginContext>(\n options: HelpPluginOptions = {}\n) => {\n return [\n ...theme(options.theme),\n console(options.console),\n {\n name: \"shell-shock:help\",\n enforce: \"post\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `help` plugin.\"\n );\n\n return {\n help: defu(\n {\n command:\n options.command === false\n ? false\n : isSetString(options.command)\n ? { name: options.command }\n : { name: \"help\" }\n },\n options,\n {\n builtins: true\n }\n )\n };\n },\n async configResolved() {\n this.debug(\"Adding the Help command to the application context.\");\n\n if (this.config.help.command !== false) {\n this.inputs ??= [];\n if (\n this.inputs.some(\n input =>\n input.name === (this.config.help.command as CommandConfig).name\n )\n ) {\n this.info(\n \"The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: this.config.help.command.name,\n path: this.config.help.command.name,\n segments: [this.config.help.command.name],\n title: \"Help\",\n icon: \"?\",\n description: `A command for displaying help information to assist in using the ${getAppTitle(\n this,\n true\n )} command-line interface application.`,\n entry: {\n file: joinPaths(this.entryPath, \"help\", \"index.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"help\", \"command.ts\")\n }\n },\n isVirtual: false,\n ...this.config.help.command\n });\n }\n\n await render(this, <HelpCommand />);\n }\n },\n prepare: {\n order: \"post\",\n async handler() {\n const commands = await getCommandList(this);\n this.debug(\n `Rendering \\`help\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(this),\n title: getAppTitle(this),\n description: getAppDescription(this),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n options: Object.fromEntries(\n this.options.map(option => [option.name, option])\n ),\n entry: {\n file: joinPaths(this.entryPath, \"bin.ts\")\n },\n args: [],\n parent: null,\n children: this.commands\n }));\n\n return render(\n this,\n <>\n <Show when={this.config.help.builtins !== false}>\n <HelpBuiltin command={bin.value} />\n <Spacing />\n <For\n each={commands.sort((a, b) => a.name.localeCompare(b.name))}\n doubleHardline>\n {command => <HelpBuiltin command={command} />}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,MAAa,UAAe,UAAA,EAAA,KAAA;;;;;GAE1B,MAAA;GACC,SAAU;GACX,SAAA;AACI,SAAC,MAAM,qEAAiE;AAC5E,WAAS,EACN,MAAA,KAAA,EACI,SAAA,QAAA,YAAA,QAAA,QAAA,YAAA,QAAA,QAAA,GAAA,EACG,MAAC,QAAa,SACf,GAAC,EACR,MAAA,QACO,EACL,EAAA,SAAc,EACd,UAAS,MACP,CAAA,EACD;;;AAGD,SAAE,MAAO,sDAAA;AACT,QAAI,KAAK,OAAK,KAAA,YAAA,OAAA;AACZ,UAAI,WAAA,EAAA;AACJ,SAAI,KAAE,OAAO,MAAA,UAAA,MAAA,SAAA,KAAA,OAAA,KAAA,QAAA,KAAA,CACX,MAAK,KAAC,2LAAoB;SAE1B,MAAK,OAAK,KAAA;MACR,IAAI,KAAK,OAAO,KAAE,QAAQ;MAC1B,MAAM,KAAK,OAAO,KAAK,QAAE;MACzB,UAAC,CAAA,KAAA,OAAA,KAAA,QAAA,KAAA;MACD,OAAO;MACP,MAAA;MACA,aAAY,oEAAA,YAAA,MAAA,KAAA,CAAA;MACZ,OAAA;OACF,MAAA,UAAA,KAAA,WAAA,QAAA,WAAA;OACD,OAAA,EACF,MAAA,UAAA,KAAA,WAAA,QAAA,aAAA,EACK;OACC;;MAED,GAAA,KAAK,OAAO,KAAK;MACnB,CAAA;AAEF,WAAI,OAAK,MAAO,gBAAI,aAAA,EAAA,CAAA,CAAA;;;GAGxB,SAAQ;IACN,OAAM;IACN,MAAM,UAAS;KACb,MAAM,SAAM;KACZ,MAAK,WAAA,MAAA,eAAA,KAAA;AACL,UAAI,MAAK,gDAAA,SAAA,OAAA,mBAAA;KACT,MAAI,MAAK,gBAAY;MACnB,IAAI;MACJ,MAAI,WAAW,KAAO;MACtB,OAAI,YAAe,KAAC;MACpB,aAAY,kBAAK,KAAA;MACjB,WAAW;MACX,MAAI;MACJ,UAAU,EAAA;MACV,OAAM,EAAA;MACN,SAAO,OAAQ,YAAK,KAAU,QAAW,KAAE,WAAA,CAAA,OAAA,MAAA,OAAA,CAAA,CAAA;MAC3C,OAAI,EACF,MAAI,UAAM,KAAU,WAAK,SAAgB,EAC1C;MACD,MAAM,EAAE;MACR,QAAM;MACN,UAAK,KAAA;MACN,EAAE;AACH,YAAO,OAAO,MAAM,CAAC,gBAAK,MAAA;MACxB,IAAI,OAAA;AACJ,cAAA,OAAA,OAAA,KAAA,aAAA;;MAEA,IAAA,WAAa;AACf,cAAA;QAAA,gBAAA,aAAA,EACD,IAAA,UAAA;AACQ,gBAAA,IAAA;WAEF,CAAC;QAAA,gBAAU,SAAA,EAAA,CAAA;QAAA,gBAAA,KAAA;SACd,IAAM,OAAS;AACV,iBAAK,SAAA,MAAA,GAAA,MAAA,EAAA,KAAA,cAAA,EAAA,KAAA,CAAA;;SAEN,gBAAS;SACT,WAAQ,YAAQ,gBAAA,aAAA,EACnB;SAED,CAAA;QAAK;;MAEN,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}
@@ -0,0 +1,17 @@
1
+ //#region ../../node_modules/.pnpm/@stryke+types@0.11.2/node_modules/@stryke/types/dist/base.d.cts
2
+ /**
3
+ * Create a type that makes the given keys required. The remaining keys are kept as is.
4
+ *
5
+ * @remarks
6
+ * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.
7
+ */
8
+ type RequiredKeys<BaseType, Keys extends keyof BaseType> = Required<Pick<BaseType, Keys>> & Omit<BaseType, Keys>;
9
+ /**
10
+ * Create a type that makes the given keys optional. The remaining keys are kept as is.
11
+ *
12
+ * @remarks
13
+ * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.
14
+ */
15
+ //#endregion
16
+ export { RequiredKeys };
17
+ //# sourceMappingURL=base.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.cts","names":["TypedArray","SerializablePrimitive","Primitive","BuiltIns","Date","RegExp","AtomicObject","Function","Promise","TypeTester","value","TypeMap","Record","emptyObjectSymbol","FunctionOrValue","Value","X","List","A","ReadonlyArray","FunctionLike","P","R$1","args","AnyFunction","Nullish","Nullishable","T","NonNullishObject","NativeClass","AnyNumber","AnyString","AnyBoolean","AnyArray","PlainObject","AnyMap","Map","AnyWeakMap","WeakKey","WeakMap","EmptyArray","EmptyObject","Any","IndexType","TypedIndexable","Indexable","Dictionary","EMPTY_STRING","NEWLINE_STRING","EMPTY_OBJECT","AnyCase","F1","Uppercase","Lowercase","F2","R","F","Newable","_args","Abstract","prototype","Clonable","clone","MaybePromise","ReducerFunction","TState","TAction","state","action","TYPE_ARGUMENTS","TYPE_ARRAY","TYPE_OBJECT","TYPE_MAP","TYPE_SET","Collection","IArguments","Set","NonUndefined","BrowserNativeObject","File","DeepPartial","NestedValue","K","Rollback","initialValue","currentValue","RequiredKeysOf","BaseType","Key","Exclude","IsEqual","G","B","Filter","KeyType$1","ExcludeType","ExceptOptions","requireExactProps","Except","ObjectType","KeysType","Options","KeyType","Partial","Simplify","RequiredKeys","Keys","Pick","Required","Omit","PartialKeys","$NestedValue","TValue","RefObject","current","Identity","id","Versioned","version","Sequenced","sequence","Typed","__type","ClassTypeCheckable","isTypeOf","NonRecursiveType","arguments_","IsPrimitive","IsNever","IsAny","IsNull","IsUndefined","IsUnknown","IsNullish","IsFunction","GlobalThis","globalThis","Class","Arguments","Constructor","AbstractClass","AbstractConstructor","BuildTuple","L","Fill","HasMultipleCallSignatures","StructuredCloneablePrimitive","StructuredCloneableData","ArrayBuffer","DataView","Error","Blob","StructuredCloneableCollection","StructuredCloneable","ReadonlyMap","ReadonlySet","key"],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+types@0.11.2/node_modules/@stryke/types/dist/base.d.cts"],"x_google_ignoreList":[0],"mappings":";;;;;;;KAiLKyG,YAAAA,8BAA0ClB,QAAAA,IAAYqB,QAAAA,CAASD,IAAAA,CAAKpB,QAAAA,EAAUmB,IAAAA,KAASG,IAAAA,CAAKtB,QAAAA,EAAUmB,IAAAA"}
@@ -0,0 +1,17 @@
1
+ //#region ../../node_modules/.pnpm/@stryke+types@0.11.2/node_modules/@stryke/types/dist/base.d.cts
2
+ /**
3
+ * Create a type that makes the given keys required. The remaining keys are kept as is.
4
+ *
5
+ * @remarks
6
+ * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.
7
+ */
8
+ type RequiredKeys<BaseType, Keys extends keyof BaseType> = Required<Pick<BaseType, Keys>> & Omit<BaseType, Keys>;
9
+ /**
10
+ * Create a type that makes the given keys optional. The remaining keys are kept as is.
11
+ *
12
+ * @remarks
13
+ * Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.
14
+ */
15
+ //#endregion
16
+ export { RequiredKeys };
17
+ //# sourceMappingURL=base.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.mts","names":["TypedArray","SerializablePrimitive","Primitive","BuiltIns","Date","RegExp","AtomicObject","Function","Promise","TypeTester","value","TypeMap","Record","emptyObjectSymbol","FunctionOrValue","Value","X","List","A","ReadonlyArray","FunctionLike","P","R$1","args","AnyFunction","Nullish","Nullishable","T","NonNullishObject","NativeClass","AnyNumber","AnyString","AnyBoolean","AnyArray","PlainObject","AnyMap","Map","AnyWeakMap","WeakKey","WeakMap","EmptyArray","EmptyObject","Any","IndexType","TypedIndexable","Indexable","Dictionary","EMPTY_STRING","NEWLINE_STRING","EMPTY_OBJECT","AnyCase","F1","Uppercase","Lowercase","F2","R","F","Newable","_args","Abstract","prototype","Clonable","clone","MaybePromise","ReducerFunction","TState","TAction","state","action","TYPE_ARGUMENTS","TYPE_ARRAY","TYPE_OBJECT","TYPE_MAP","TYPE_SET","Collection","IArguments","Set","NonUndefined","BrowserNativeObject","File","DeepPartial","NestedValue","K","Rollback","initialValue","currentValue","RequiredKeysOf","BaseType","Key","Exclude","IsEqual","G","B","Filter","KeyType$1","ExcludeType","ExceptOptions","requireExactProps","Except","ObjectType","KeysType","Options","KeyType","Partial","Simplify","RequiredKeys","Keys","Pick","Required","Omit","PartialKeys","$NestedValue","TValue","RefObject","current","Identity","id","Versioned","version","Sequenced","sequence","Typed","__type","ClassTypeCheckable","isTypeOf","NonRecursiveType","arguments_","IsPrimitive","IsNever","IsAny","IsNull","IsUndefined","IsUnknown","IsNullish","IsFunction","GlobalThis","globalThis","Class","Arguments","Constructor","AbstractClass","AbstractConstructor","BuildTuple","L","Fill","HasMultipleCallSignatures","StructuredCloneablePrimitive","StructuredCloneableData","ArrayBuffer","DataView","Error","Blob","StructuredCloneableCollection","StructuredCloneable","ReadonlyMap","ReadonlySet","key"],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+types@0.11.2/node_modules/@stryke/types/dist/base.d.cts"],"x_google_ignoreList":[0],"mappings":";;;;;;;KAiLKyG,YAAAA,8BAA0ClB,QAAAA,IAAYqB,QAAAA,CAASD,IAAAA,CAAKpB,QAAAA,EAAUmB,IAAAA,KAASG,IAAAA,CAAKtB,QAAAA,EAAUmB,IAAAA"}
@@ -1,4 +1,5 @@
1
- import { ResolvedConfig, UserConfig } from "@shell-shock/core";
1
+ import { RequiredKeys } from "../node_modules/.pnpm/@stryke_types@0.11.2/node_modules/@stryke/types/dist/base.cjs";
2
+ import { CommandConfig, ResolvedConfig, UserConfig } from "@shell-shock/core";
2
3
  import { Context } from "@shell-shock/core/types/context";
3
4
  import { ConsolePluginContext, ConsolePluginOptions, ConsolePluginResolvedConfig, ConsolePluginUserConfig } from "@shell-shock/plugin-console";
4
5
  import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme";
@@ -15,11 +16,11 @@ interface HelpPluginOptions {
15
16
  * Should the plugin add the `help` command?
16
17
  *
17
18
  * @remarks
18
- * This can be set to a string to specify a custom command name for the `help` command. By default, the command name will be `"help"`.
19
+ * This can be set to a string to specify a custom command name for the `help` command, an object to override the default command configuration, or `false` to disable the help command. By default, the command name will be `"help"`.
19
20
  *
20
- * @defaultValue true
21
+ * @defaultValue "help"
21
22
  */
22
- command?: boolean | string;
23
+ command?: Partial<CommandConfig> | string | false;
23
24
  /**
24
25
  * Theme plugin options.
25
26
  */
@@ -39,7 +40,7 @@ type HelpPluginUserConfig = ThemePluginUserConfig & ConsolePluginUserConfig & Us
39
40
  *
40
41
  * @defaultValue "help"
41
42
  */
42
- command: string | false;
43
+ command: Partial<CommandConfig> | string | false;
43
44
  };
44
45
  };
45
46
  type HelpPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolvedConfig & ResolvedConfig & {
@@ -48,11 +49,11 @@ type HelpPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolve
48
49
  */
49
50
  help: Required<Omit<HelpPluginOptions, "theme" | "console" | "command">> & {
50
51
  /**
51
- * The name of the help command to add to the application, or `false` to disable adding a help command.
52
+ * The properties of the help command to add to the application, or `false` to disable adding a help command.
52
53
  *
53
- * @defaultValue "help"
54
+ * @defaultValue \{ name: "help" \}
54
55
  */
55
- command: string | false;
56
+ command: RequiredKeys<Partial<CommandConfig>, "name"> | false;
56
57
  };
57
58
  };
58
59
  type HelpPluginContext<TResolvedConfig extends HelpPluginResolvedConfig = HelpPluginResolvedConfig> = ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & Context<TResolvedConfig>;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts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AAA,CAAmB,eAAA,IACrB,oBAAA,CAAqB,eAAA,IACrB,OAAA,CAAQ,eAAA"}
@@ -1,6 +1,7 @@
1
+ import { RequiredKeys } from "../node_modules/.pnpm/@stryke_types@0.11.2/node_modules/@stryke/types/dist/base.mjs";
1
2
  import { ConsolePluginContext, ConsolePluginOptions, ConsolePluginResolvedConfig, ConsolePluginUserConfig } from "@shell-shock/plugin-console";
2
3
  import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme";
3
- import { ResolvedConfig, UserConfig } from "@shell-shock/core";
4
+ import { CommandConfig, ResolvedConfig, UserConfig } from "@shell-shock/core";
4
5
  import { Context } from "@shell-shock/core/types/context";
5
6
 
6
7
  //#region src/types/plugin.d.ts
@@ -15,11 +16,11 @@ interface HelpPluginOptions {
15
16
  * Should the plugin add the `help` command?
16
17
  *
17
18
  * @remarks
18
- * This can be set to a string to specify a custom command name for the `help` command. By default, the command name will be `"help"`.
19
+ * This can be set to a string to specify a custom command name for the `help` command, an object to override the default command configuration, or `false` to disable the help command. By default, the command name will be `"help"`.
19
20
  *
20
- * @defaultValue true
21
+ * @defaultValue "help"
21
22
  */
22
- command?: boolean | string;
23
+ command?: Partial<CommandConfig> | string | false;
23
24
  /**
24
25
  * Theme plugin options.
25
26
  */
@@ -39,7 +40,7 @@ type HelpPluginUserConfig = ThemePluginUserConfig & ConsolePluginUserConfig & Us
39
40
  *
40
41
  * @defaultValue "help"
41
42
  */
42
- command: string | false;
43
+ command: Partial<CommandConfig> | string | false;
43
44
  };
44
45
  };
45
46
  type HelpPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolvedConfig & ResolvedConfig & {
@@ -48,11 +49,11 @@ type HelpPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolve
48
49
  */
49
50
  help: Required<Omit<HelpPluginOptions, "theme" | "console" | "command">> & {
50
51
  /**
51
- * The name of the help command to add to the application, or `false` to disable adding a help command.
52
+ * The properties of the help command to add to the application, or `false` to disable adding a help command.
52
53
  *
53
- * @defaultValue "help"
54
+ * @defaultValue \{ name: "help" \}
54
55
  */
55
- command: string | false;
56
+ command: RequiredKeys<Partial<CommandConfig>, "name"> | false;
56
57
  };
57
58
  };
58
59
  type HelpPluginContext<TResolvedConfig extends HelpPluginResolvedConfig = HelpPluginResolvedConfig> = ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & Context<TResolvedConfig>;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;UAiCiB,iBAAA;;AAAjB;;;;EAME,QAAA;EAUA;;;;;;;AAaF;EAbE,OAAA;;;;EAKA,KAAA,GAAQ,kBAAA;EAcK;;;EATb,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,oBAAA,GAAuB,qBAAA,GACjC,uBAAA,GACA,UAAA;EAAA;;;EAIE,IAAA,EAAM,IAAA,CAAK,iBAAA;IAMT;;;AAIN;;IAJM,OAAA;EAAA;AAAA;AAAA,KAIM,wBAAA,GAA2B,yBAAA,GACrC,2BAAA,GACA,cAAA;EAIsB;;;EAApB,IAAA,EAAM,QAAA,CAAS,IAAA,CAAK,iBAAA;IAAN;;;;;IAMZ,OAAA;EAAA;AAAA;AAAA,KAIM,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,kBAAA,CAAmB,eAAA,IACrB,oBAAA,CAAqB,eAAA,IACrB,OAAA,CAAQ,eAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;UAsCiB,iBAAA;;AAAjB;;;;EAME,QAAA;EAeQ;;;;;;;;EALR,OAAA,GAAU,OAAA,CAAQ,aAAA;EAKV;;;EAAR,KAAA,GAAQ,kBAAA;EAKsB;AAGhC;;EAHE,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,oBAAA,GAAuB,qBAAA,GACjC,uBAAA,GACA,UAAA;EAAA;;;EAIE,IAAA,EAAM,IAAA,CAAK,iBAAA;IAMA;;;;;IAAT,OAAA,EAAS,OAAA,CAAQ,aAAA;EAAA;AAAA;AAAA,KAIX,wBAAA,GAA2B,yBAAA,GACrC,2BAAA,GACA,cAAA;EANI;;;EAUF,IAAA,EAAM,QAAA,CAAS,IAAA,CAAK,iBAAA;IAVY;AAIpC;;;;IAYM,OAAA,EAAS,YAAA,CAAa,OAAA,CAAQ,aAAA;EAAA;AAAA;AAAA,KAIxB,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,kBAAA,CAAmB,eAAA,IACrB,oBAAA,CAAqB,eAAA,IACrB,OAAA,CAAQ,eAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-help",
3
- "version": "0.1.12",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "description": "A package containing a Shell Shock plugin to provide help and documentation for the local application's commands.",
6
6
  "keywords": [
@@ -52,21 +52,22 @@
52
52
  "dependencies": {
53
53
  "@alloy-js/core": "0.23.0-dev.8",
54
54
  "@alloy-js/typescript": "0.23.0-dev.4",
55
- "@powerlines/deepkit": "^0.6.160",
56
- "@powerlines/plugin-alloy": "^0.25.68",
57
- "@powerlines/plugin-plugin": "^0.12.332",
58
- "@shell-shock/core": "^0.13.10",
59
- "@shell-shock/plugin-theme": "^0.3.25",
60
- "@shell-shock/plugin-console": "^0.1.21",
55
+ "@powerlines/deepkit": "^0.6.161",
56
+ "@powerlines/plugin-alloy": "^0.25.69",
57
+ "@powerlines/plugin-plugin": "^0.12.333",
58
+ "@shell-shock/core": "^0.13.12",
59
+ "@shell-shock/plugin-theme": "^0.3.27",
60
+ "@shell-shock/plugin-console": "^0.1.23",
61
61
  "@stryke/string-format": "^0.17.7",
62
62
  "@stryke/type-checks": "^0.6.0",
63
63
  "@stryke/path": "^0.27.3",
64
64
  "defu": "^6.1.4",
65
- "powerlines": "^0.42.22"
65
+ "powerlines": "^0.42.23"
66
66
  },
67
67
  "devDependencies": {
68
- "@powerlines/plugin-deepkit": "^0.11.260",
69
- "@types/node": "^25.5.0"
68
+ "@powerlines/plugin-deepkit": "^0.11.261",
69
+ "@types/node": "^25.5.0",
70
+ "@stryke/types": "^0.11.2"
70
71
  },
71
72
  "publishConfig": { "access": "public" },
72
73
  "exports": {
@@ -170,5 +171,6 @@
170
171
  }
171
172
  }
172
173
  },
173
- "gitHead": "e407612d68d6376d543e8009c6e2aeb5ff6bc74c"
174
+ "inlinedDependencies": { "@stryke/types": "0.11.2" },
175
+ "gitHead": "24f916421b8fcaf63663a5cb24746fadfcc7842f"
174
176
  }