@shell-shock/core 0.12.2 → 0.13.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/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/api.cjs +3 -2
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +0 -1
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +0 -1
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +1 -1
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +54 -53
- package/dist/components/command-validation-logic.cjs.map +1 -1
- package/dist/components/command-validation-logic.d.cts +2 -3
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +2 -3
- package/dist/components/command-validation-logic.d.mts.map +1 -1
- package/dist/components/command-validation-logic.mjs +1 -1
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +45 -44
- package/dist/components/docs.cjs.map +1 -1
- package/dist/components/docs.d.cts +5 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +5 -5
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/helpers.cjs +16 -15
- package/dist/components/helpers.cjs.map +1 -1
- package/dist/components/helpers.d.cts +7 -8
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +7 -8
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/components/options-parser-logic.cjs +187 -186
- package/dist/components/options-parser-logic.cjs.map +1 -1
- package/dist/components/options-parser-logic.d.cts +9 -9
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +9 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/usage.cjs +21 -20
- package/dist/components/usage.cjs.map +1 -1
- package/dist/components/usage.d.cts +2 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts.map +1 -1
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +128 -127
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +4 -4
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +1 -0
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +0 -1
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +0 -1
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +5 -4
- package/dist/contexts/command.cjs.map +1 -1
- package/dist/contexts/command.d.cts +0 -1
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts +0 -1
- package/dist/contexts/command.d.mts.map +1 -1
- package/dist/contexts/index.cjs +1 -0
- package/dist/contexts/options.cjs +12 -11
- package/dist/contexts/options.cjs.map +1 -1
- package/dist/contexts/options.d.cts +0 -1
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +0 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +3 -3
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/automd.cjs +16 -16
- package/dist/helpers/automd.cjs.map +1 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +3 -3
- package/dist/helpers/docs-helpers.cjs.map +1 -1
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/paths.cjs +26 -26
- package/dist/helpers/paths.cjs.map +1 -1
- package/dist/helpers/paths.mjs +1 -1
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +3 -3
- package/dist/helpers/persistence.cjs.map +1 -1
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +16 -16
- package/dist/helpers/update-package-json.cjs.map +1 -1
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +9 -9
- package/dist/helpers/utilities.cjs.map +1 -1
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs.map +1 -1
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/plugin-utils/context-helpers.cjs +10 -10
- package/dist/plugin-utils/context-helpers.cjs.map +1 -1
- package/dist/plugin-utils/context-helpers.d.cts +0 -3
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +0 -3
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +1 -1
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +18 -18
- package/dist/plugin-utils/deepkit.cjs.map +1 -1
- package/dist/plugin-utils/deepkit.d.cts +0 -1
- package/dist/plugin-utils/deepkit.d.cts.map +1 -1
- package/dist/plugin-utils/deepkit.d.mts +0 -1
- package/dist/plugin-utils/deepkit.d.mts.map +1 -1
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs.map +1 -1
- package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/description-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.d.cts +0 -1
- package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/get-command-tree.d.mts +0 -1
- package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +1 -0
- package/dist/plugin-utils/reflect.cjs.map +1 -1
- package/dist/plugin-utils/reflect.d.cts +0 -1
- package/dist/plugin-utils/reflect.d.cts.map +1 -1
- package/dist/plugin-utils/reflect.d.mts +0 -1
- package/dist/plugin-utils/reflect.d.mts.map +1 -1
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.d.cts +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +7 -7
- package/dist/plugin-utils/type-checks.cjs.map +1 -1
- package/dist/plugin-utils/type-checks.d.cts +0 -1
- package/dist/plugin-utils/type-checks.d.cts.map +1 -1
- package/dist/plugin-utils/type-checks.d.mts +0 -1
- package/dist/plugin-utils/type-checks.d.mts.map +1 -1
- package/dist/plugin-utils/type-checks.mjs +1 -1
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +68 -75
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +0 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +0 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +23 -30
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/deepkit.cjs +29 -29
- package/dist/resolver/deepkit.cjs.map +1 -1
- package/dist/resolver/deepkit.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +17 -17
- package/dist/resolver/helpers.cjs.map +1 -1
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/module.cjs +29 -29
- package/dist/resolver/module.cjs.map +1 -1
- package/dist/resolver/module.mjs +1 -1
- package/dist/resolver/module.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +17 -17
- package/dist/resolver/resolve.cjs.map +1 -1
- package/dist/resolver/resolve.mjs +3 -3
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +1 -0
- package/dist/types/command.cjs.map +1 -1
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +1 -0
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +1 -0
- package/dist/types/context.cjs.map +1 -1
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/env.cjs +1 -0
- package/dist/types/env.d.cts.map +1 -1
- package/dist/types/env.d.mts.map +1 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/options.cjs +1 -0
- package/dist/types/options.d.cts.map +1 -1
- package/dist/types/options.d.mts.map +1 -1
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts.map +1 -1
- package/dist/types/runtime.d.mts.map +1 -1
- package/package.json +23 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.cjs","names":[],"sources":["../../src/resolver/resolve.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 { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { ReflectionVisibility } from \"@powerlines/deepkit/vendor/type\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { getDefaultOptions } from \"../helpers/utilities\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"../plugin-utils/context-helpers\";\nimport { extractType } from \"../plugin-utils/deepkit\";\nimport type { CommandModule, CommandTree, Context } from \"../types\";\nimport { resolveFromBytecode } from \"./deepkit\";\nimport {\n applyArgsDefaults,\n applyDefaults,\n applyOptionsDefaults,\n resolveVirtualCommand\n} from \"./helpers\";\nimport { resolveFromExports } from \"./module\";\nimport type { ResolverContext, ResolverInput } from \"./types\";\n\nasync function initialize<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<ResolverContext> {\n const { context, command, parent } = input;\n\n const title =\n command.title ||\n `${\n parent?.title\n ? `${\n parent.isVirtual\n ? parent.title.replace(/(?:c|C)ommands?$/, \"\").trim()\n : parent.title\n } - `\n : \"\"\n }${titleCase(command.name)}${command.isVirtual ? \" Commands\" : \"\"}`;\n\n const output = {\n alias: [],\n icon: parent?.icon,\n ...command,\n title,\n options: getDefaultOptions(context, command),\n args: [],\n parent: parent ?? null,\n children: {}\n } as CommandTree;\n\n const result: ResolverContext = {\n input,\n output\n };\n\n if (!command.isVirtual) {\n if (\n !command.entry.input?.file ||\n !context.fs.existsSync(command.entry.input.file)\n ) {\n throw new Error(\n `${\n !command.entry.input?.file ? \"Missing\" : \"Non-existent\"\n } command entry file for \"${command.name}\"`\n );\n }\n\n context.debug(\n `Adding reflection for user-defined command: ${command.id} (file: ${\n command.entry.input.file\n })`\n );\n\n result.module = await resolveModule<CommandModule>(\n context,\n command.entry.input,\n {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n reflectionLevel: \"verbose\"\n })\n ]\n }\n );\n }\n\n return result;\n}\n\nasync function postprocess<TContext extends Context = Context>(\n ctx: ResolverContext<TContext>\n): Promise<CommandTree> {\n ctx.output.options = applyOptionsDefaults(ctx);\n ctx.output.args = applyArgsDefaults(ctx);\n\n // Ensure unique argument names by appending an index suffix to duplicates\n ctx.output.args.forEach((arg, index) => {\n const found = ctx.output.args.findIndex(a => a.name === arg.name);\n if (\n (found !== -1 && found !== index) ||\n ctx.output.segments.some(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment) === arg.name\n )\n ) {\n arg.name += `_${\n ctx.output.segments.filter(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment).replace(/_\\d+$/, \"\") === arg.name\n ).length +\n ctx.output.args.filter(a => a.name.replace(/_\\d+$/, \"\") === arg.name)\n .length\n }`;\n arg.env = arg.name\n ? arg.env || arg.env === false\n ? arg.env\n : ctx.input.context.config.autoAssignEnv\n ? constantCase(arg.name)\n : false\n : false;\n }\n });\n\n applyDefaults(ctx);\n\n if (ctx.input.context.env) {\n if (isSetObject(ctx.output.options)) {\n Object.values(ctx.output.options)\n .filter(option => Boolean(option.env))\n .forEach(option => {\n ctx.input.context.env.types.env.addProperty({\n name: option.env as string,\n optional: option.optional ? true : undefined,\n description: option.description,\n visibility: ReflectionVisibility.public,\n type: extractType(option),\n default: option.default,\n tags: {\n title: option.title,\n alias: option.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n });\n });\n }\n\n ctx.output.args\n .filter(arg => Boolean(arg.env))\n .forEach(arg =>\n ctx.input.context.env.types.env.addProperty({\n name: arg.env as string,\n optional: arg.optional ? true : undefined,\n description: arg.description,\n visibility: ReflectionVisibility.public,\n type: extractType(arg),\n default: arg.default,\n tags: {\n alias: arg.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n })\n );\n }\n\n for (const input of ctx.input.context.inputs.filter(\n input =>\n input.segments.filter(segment => !isDynamicPathSegment(segment))\n .length ===\n ctx.input.command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n ).length +\n 1 &&\n input.segments\n .slice(0, ctx.input.command.segments.length)\n .every((value, index) => value === ctx.input.command.segments[index])\n )) {\n ctx.output.children[input.name] = await resolve<TContext>({\n context: ctx.input.context,\n command: input,\n parent: ctx.output\n });\n }\n\n return ctx.output;\n}\n\n/**\n * Resolves a command tree from the given resolver input.\n *\n * @param input - The resolver input containing the context, command, and optional parent command tree.\n * @returns A promise that resolves to the resolved command tree.\n */\nexport async function resolve<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<CommandTree> {\n const ctx = await initialize<TContext>(input);\n\n if (!ctx.output.isVirtual) {\n await resolveFromExports(ctx);\n resolveFromBytecode(ctx);\n } else {\n resolveVirtualCommand(ctx);\n }\n\n return postprocess(ctx);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;AA+BX,eAAe,WAAI,OAAA;CACf,MAAM,EAAE,SAAG,SAAA,WAAA;CACX,MAAM,QAAQ,QAAI,SACd,GAAG,QAAQ,QACL,GAAG,OAAC,YACA,OAAO,MAAM,QAAQ,oBAAM,GAAA,CAAA,MAAA,GAC3B,OAAO,MAAK;CAY1B,MAAM,SAAS;EACX;EACA,QAZW;GACX,OAAO,EAAE;GACT,MAAM,QAAQ;GACd,GAAG;;GAEH,SAAM,oCAAA,SAAA,QAAA;GACN,MAAM,EAAE;GACV,QAAA,UAAA;GACE,UAAU,EAAA;GACb;EAIA;AACD,KAAI,CAAC,QAAE,WAAA;AACH,MAAI,CAAC,QAAQ,MAAM,OAAO,yDAEtB,OAAK,IAAA,MAAA,GAAA,CAAA,QAAA,MAAA,OAAA,OAAA,YAAA,eAAA,2BAAA,QAAA,KAAA,GAAA;AAET,UAAQ,MAAM,+CAAA,QAAA,GAAA,UAAA,QAAA,MAAA,MAAA,KAAA,GAAA;AACd,S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IAAI,MAAM,QAAA,SAAA,OAAA,cAAA,YAAA,CAAA,6CAAA,QAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,SACN,KACJ,QAAM,SACD,MAAK,GAAA,IAAA,MAAA,QAAA,SAAA,OAAA,CACL,MAAE,cAAA,OAAA,UAAA,UAAA,IAAA,MAAA,QAAA,SAAA,QAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CACX,KAAA,OAAA,SAAA,MAAA,QAAA,OAAA,QAAA,IAAA,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,QAAA;EACA,SAAA,IAAA,MAAA;;EAEQ,QAAQ,IAAA;;AAGhB,QAAO,IAAI;;AAEf,YAAY,SAAS;CAAC;CAAmB;CAAI;CAAA;CAAA;CAAA;;;;;;;AAO7C,eAAsB,QAAQ,OAAO;CACjC,MAAM,MAAM,OAAO,WAAW,IAAC,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,WAAA,MAAA;AAC/B,KAAI,CAAC,IAAI,OAAK,WAAA;AACV,QAAM,kCAAmB,IAAA;AACzB,wCAAoB,IAAI;OAGxB,uCAAkB,IAAA;AAEtB,QAAO,YAAC,IAAA;;AAEZ,QAAI,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
1
|
+
{"version":3,"file":"resolve.cjs","names":[],"sources":["../../src/resolver/resolve.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 { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { ReflectionVisibility } from \"@powerlines/deepkit/vendor/type\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { getDefaultOptions } from \"../helpers/utilities\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"../plugin-utils/context-helpers\";\nimport { extractType } from \"../plugin-utils/deepkit\";\nimport type { CommandModule, CommandTree, Context } from \"../types\";\nimport { resolveFromBytecode } from \"./deepkit\";\nimport {\n applyArgsDefaults,\n applyDefaults,\n applyOptionsDefaults,\n resolveVirtualCommand\n} from \"./helpers\";\nimport { resolveFromExports } from \"./module\";\nimport type { ResolverContext, ResolverInput } from \"./types\";\n\nasync function initialize<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<ResolverContext> {\n const { context, command, parent } = input;\n\n const title =\n command.title ||\n `${\n parent?.title\n ? `${\n parent.isVirtual\n ? parent.title.replace(/(?:c|C)ommands?$/, \"\").trim()\n : parent.title\n } - `\n : \"\"\n }${titleCase(command.name)}${command.isVirtual ? \" Commands\" : \"\"}`;\n\n const output = {\n alias: [],\n icon: parent?.icon,\n ...command,\n title,\n options: getDefaultOptions(context, command),\n args: [],\n parent: parent ?? null,\n children: {}\n } as CommandTree;\n\n const result: ResolverContext = {\n input,\n output\n };\n\n if (!command.isVirtual) {\n if (\n !command.entry.input?.file ||\n !context.fs.existsSync(command.entry.input.file)\n ) {\n throw new Error(\n `${\n !command.entry.input?.file ? \"Missing\" : \"Non-existent\"\n } command entry file for \"${command.name}\"`\n );\n }\n\n context.debug(\n `Adding reflection for user-defined command: ${command.id} (file: ${\n command.entry.input.file\n })`\n );\n\n result.module = await resolveModule<CommandModule>(\n context,\n command.entry.input,\n {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n reflectionLevel: \"verbose\"\n })\n ]\n }\n );\n }\n\n return result;\n}\n\nasync function postprocess<TContext extends Context = Context>(\n ctx: ResolverContext<TContext>\n): Promise<CommandTree> {\n ctx.output.options = applyOptionsDefaults(ctx);\n ctx.output.args = applyArgsDefaults(ctx);\n\n // Ensure unique argument names by appending an index suffix to duplicates\n ctx.output.args.forEach((arg, index) => {\n const found = ctx.output.args.findIndex(a => a.name === arg.name);\n if (\n (found !== -1 && found !== index) ||\n ctx.output.segments.some(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment) === arg.name\n )\n ) {\n arg.name += `_${\n ctx.output.segments.filter(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment).replace(/_\\d+$/, \"\") === arg.name\n ).length +\n ctx.output.args.filter(a => a.name.replace(/_\\d+$/, \"\") === arg.name)\n .length\n }`;\n arg.env = arg.name\n ? arg.env || arg.env === false\n ? arg.env\n : ctx.input.context.config.autoAssignEnv\n ? constantCase(arg.name)\n : false\n : false;\n }\n });\n\n applyDefaults(ctx);\n\n if (ctx.input.context.env) {\n if (isSetObject(ctx.output.options)) {\n Object.values(ctx.output.options)\n .filter(option => Boolean(option.env))\n .forEach(option => {\n ctx.input.context.env.types.env.addProperty({\n name: option.env as string,\n optional: option.optional ? true : undefined,\n description: option.description,\n visibility: ReflectionVisibility.public,\n type: extractType(option),\n default: option.default,\n tags: {\n title: option.title,\n alias: option.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n });\n });\n }\n\n ctx.output.args\n .filter(arg => Boolean(arg.env))\n .forEach(arg =>\n ctx.input.context.env.types.env.addProperty({\n name: arg.env as string,\n optional: arg.optional ? true : undefined,\n description: arg.description,\n visibility: ReflectionVisibility.public,\n type: extractType(arg),\n default: arg.default,\n tags: {\n alias: arg.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n })\n );\n }\n\n for (const input of ctx.input.context.inputs.filter(\n input =>\n input.segments.filter(segment => !isDynamicPathSegment(segment))\n .length ===\n ctx.input.command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n ).length +\n 1 &&\n input.segments\n .slice(0, ctx.input.command.segments.length)\n .every((value, index) => value === ctx.input.command.segments[index])\n )) {\n ctx.output.children[input.name] = await resolve<TContext>({\n context: ctx.input.context,\n command: input,\n parent: ctx.output\n });\n }\n\n return ctx.output;\n}\n\n/**\n * Resolves a command tree from the given resolver input.\n *\n * @param input - The resolver input containing the context, command, and optional parent command tree.\n * @returns A promise that resolves to the resolved command tree.\n */\nexport async function resolve<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<CommandTree> {\n const ctx = await initialize<TContext>(input);\n\n if (!ctx.output.isVirtual) {\n await resolveFromExports(ctx);\n resolveFromBytecode(ctx);\n } else {\n resolveVirtualCommand(ctx);\n }\n\n return postprocess(ctx);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;AA+BX,eAAE,WAAiB,OAAA;CACjB,MAAA,EAAA,SAAa,SAAA,WAAA;CACb,MAAA,QAAA,QAAoB,SACpB,GAAA,QAAA,QACQ,GAAO,OAAC,YACT,OAAA,MAAqB,QAAQ,oBAAO,GAAA,CAAA,MAAA,GAC/B,OAAA,MAAiB;CAY3B,MAAM,SAAS;EACX;EACA,QAZO;GACP,OAAC,EAAA;GACN,MAAQ,QAAA;GACH,GAAE;;GAEF,SAAM,oCAAA,SAAA,QAAA;GACV,MAAQ,EAAA;GACN,QAAA,UAAA;GACA,UAAQ,EAAA;GACT;EAIA;AACD,KAAI,CAAC,QAAE,WAAA;AACJ,MAAA,CAAA,QAAU,MAAQ,OAAQ,yDAEzB,OAAS,IAAA,MAAA,GAAA,CAAA,QAAA,MAAA,OAAA,OAAA,YAAA,eAAA,2BAAA,QAAA,KAAA,GAAA;AAET,UAAQ,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AAA,6CAAA,QAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CACX,WACD,IAAI,MAAI,QAAA,SAAA,OAAA,cAAA,YAAA,CAAA,6CAAA,QAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,SACJ,KACJ,MAAM,SACD,MAAC,GAAA,IAAA,MAAA,QAAA,SAAA,OAAA,CACJ,MAAK,cAAA,OAAA,UAAA,UAAA,IAAA,MAAA,QAAA,SAAA,QAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CACX,KAAA,OAAA,SAAA,MAAA,QAAA,OAAA,QAAA,IAAA,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,QAAA;EACA,SAAA,IAAA,MAAA;;EAEF,QAAkB,IAAA;;AAGhB,QAAI,IAAA;;AAER,YAAS,SAAO;CAAM;CAAmB;CAAI;CAAA;CAAA;CAAA;;;;;;;AAO7C,eAAkB,QAAY,OAAO;CACjC,MAAM,MAAE,OAAS,WAAO,IAAO,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,WAAA,MAAA;AAC/B,KAAI,CAAC,IAAG,OAAM,WAAA;AACV,QAAM,kCAAmB,IAAA;AACzB,wCAAoB,IAAA;OAGpB,uCAAkB,IAAA;AAEtB,QAAO,YAAC,IAAA;;AAEZ,QAAI,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
@@ -5,8 +5,8 @@ import { applyArgsDefaults, applyDefaults, applyOptionsDefaults, resolveVirtualC
|
|
|
5
5
|
import { resolveFromBytecode } from "./deepkit.mjs";
|
|
6
6
|
import { resolveFromExports } from "./module.mjs";
|
|
7
7
|
import { constantCase } from "@stryke/string-format/constant-case";
|
|
8
|
-
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
9
8
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
9
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
10
10
|
import { ReflectionVisibility } from "@powerlines/deepkit/vendor/type";
|
|
11
11
|
import { esbuildPlugin } from "@powerlines/deepkit/esbuild-plugin";
|
|
12
12
|
import { resolveModule } from "@powerlines/plugin-esbuild/helpers/resolve";
|
|
@@ -142,7 +142,7 @@ async function postprocess(ctx) {
|
|
|
142
142
|
"P\"2!\"/\""
|
|
143
143
|
]));
|
|
144
144
|
}
|
|
145
|
-
for (const input of ctx.input.context.inputs.filter(__assignType((input
|
|
145
|
+
for (const input of ctx.input.context.inputs.filter(__assignType((input) => input.segments.filter(__assignType((segment) => !isDynamicPathSegment(segment), [
|
|
146
146
|
"segment",
|
|
147
147
|
"",
|
|
148
148
|
"P\"2!\"/\""
|
|
@@ -150,7 +150,7 @@ async function postprocess(ctx) {
|
|
|
150
150
|
"segment",
|
|
151
151
|
"",
|
|
152
152
|
"P\"2!\"/\""
|
|
153
|
-
])).length + 1 && input
|
|
153
|
+
])).length + 1 && input.segments.slice(0, ctx.input.command.segments.length).every(__assignType((value, index) => value === ctx.input.command.segments[index], [
|
|
154
154
|
"value",
|
|
155
155
|
"index",
|
|
156
156
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.mjs","names":[],"sources":["../../src/resolver/resolve.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 { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { ReflectionVisibility } from \"@powerlines/deepkit/vendor/type\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { getDefaultOptions } from \"../helpers/utilities\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"../plugin-utils/context-helpers\";\nimport { extractType } from \"../plugin-utils/deepkit\";\nimport type { CommandModule, CommandTree, Context } from \"../types\";\nimport { resolveFromBytecode } from \"./deepkit\";\nimport {\n applyArgsDefaults,\n applyDefaults,\n applyOptionsDefaults,\n resolveVirtualCommand\n} from \"./helpers\";\nimport { resolveFromExports } from \"./module\";\nimport type { ResolverContext, ResolverInput } from \"./types\";\n\nasync function initialize<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<ResolverContext> {\n const { context, command, parent } = input;\n\n const title =\n command.title ||\n `${\n parent?.title\n ? `${\n parent.isVirtual\n ? parent.title.replace(/(?:c|C)ommands?$/, \"\").trim()\n : parent.title\n } - `\n : \"\"\n }${titleCase(command.name)}${command.isVirtual ? \" Commands\" : \"\"}`;\n\n const output = {\n alias: [],\n icon: parent?.icon,\n ...command,\n title,\n options: getDefaultOptions(context, command),\n args: [],\n parent: parent ?? null,\n children: {}\n } as CommandTree;\n\n const result: ResolverContext = {\n input,\n output\n };\n\n if (!command.isVirtual) {\n if (\n !command.entry.input?.file ||\n !context.fs.existsSync(command.entry.input.file)\n ) {\n throw new Error(\n `${\n !command.entry.input?.file ? \"Missing\" : \"Non-existent\"\n } command entry file for \"${command.name}\"`\n );\n }\n\n context.debug(\n `Adding reflection for user-defined command: ${command.id} (file: ${\n command.entry.input.file\n })`\n );\n\n result.module = await resolveModule<CommandModule>(\n context,\n command.entry.input,\n {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n reflectionLevel: \"verbose\"\n })\n ]\n }\n );\n }\n\n return result;\n}\n\nasync function postprocess<TContext extends Context = Context>(\n ctx: ResolverContext<TContext>\n): Promise<CommandTree> {\n ctx.output.options = applyOptionsDefaults(ctx);\n ctx.output.args = applyArgsDefaults(ctx);\n\n // Ensure unique argument names by appending an index suffix to duplicates\n ctx.output.args.forEach((arg, index) => {\n const found = ctx.output.args.findIndex(a => a.name === arg.name);\n if (\n (found !== -1 && found !== index) ||\n ctx.output.segments.some(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment) === arg.name\n )\n ) {\n arg.name += `_${\n ctx.output.segments.filter(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment).replace(/_\\d+$/, \"\") === arg.name\n ).length +\n ctx.output.args.filter(a => a.name.replace(/_\\d+$/, \"\") === arg.name)\n .length\n }`;\n arg.env = arg.name\n ? arg.env || arg.env === false\n ? arg.env\n : ctx.input.context.config.autoAssignEnv\n ? constantCase(arg.name)\n : false\n : false;\n }\n });\n\n applyDefaults(ctx);\n\n if (ctx.input.context.env) {\n if (isSetObject(ctx.output.options)) {\n Object.values(ctx.output.options)\n .filter(option => Boolean(option.env))\n .forEach(option => {\n ctx.input.context.env.types.env.addProperty({\n name: option.env as string,\n optional: option.optional ? true : undefined,\n description: option.description,\n visibility: ReflectionVisibility.public,\n type: extractType(option),\n default: option.default,\n tags: {\n title: option.title,\n alias: option.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n });\n });\n }\n\n ctx.output.args\n .filter(arg => Boolean(arg.env))\n .forEach(arg =>\n ctx.input.context.env.types.env.addProperty({\n name: arg.env as string,\n optional: arg.optional ? true : undefined,\n description: arg.description,\n visibility: ReflectionVisibility.public,\n type: extractType(arg),\n default: arg.default,\n tags: {\n alias: arg.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n })\n );\n }\n\n for (const input of ctx.input.context.inputs.filter(\n input =>\n input.segments.filter(segment => !isDynamicPathSegment(segment))\n .length ===\n ctx.input.command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n ).length +\n 1 &&\n input.segments\n .slice(0, ctx.input.command.segments.length)\n .every((value, index) => value === ctx.input.command.segments[index])\n )) {\n ctx.output.children[input.name] = await resolve<TContext>({\n context: ctx.input.context,\n command: input,\n parent: ctx.output\n });\n }\n\n return ctx.output;\n}\n\n/**\n * Resolves a command tree from the given resolver input.\n *\n * @param input - The resolver input containing the context, command, and optional parent command tree.\n * @returns A promise that resolves to the resolved command tree.\n */\nexport async function resolve<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<CommandTree> {\n const ctx = await initialize<TContext>(input);\n\n if (!ctx.output.isVirtual) {\n await resolveFromExports(ctx);\n resolveFromBytecode(ctx);\n } else {\n resolveVirtualCommand(ctx);\n }\n\n return postprocess(ctx);\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;AA+BX,eAAe,WAAI,OAAA;CACf,MAAM,EAAE,SAAG,SAAA,WAAA;CACX,MAAM,QAAQ,QAAI,SACd,GAAG,QAAQ,QACL,GAAG,OAAC,YACA,OAAO,MAAM,QAAQ,oBAAM,GAAA,CAAA,MAAA,GAC3B,OAAO,MAAK;CAY1B,MAAM,SAAS;EACX;EACA,QAZW;GACX,OAAO,EAAE;GACT,MAAM,QAAQ;GACd,GAAG;;GAEH,SAAM,kBAAA,SAAA,QAAA;GACN,MAAM,EAAE;GACV,QAAA,UAAA;GACE,UAAU,EAAA;GACb;EAIA;AACD,KAAI,CAAC,QAAE,WAAA;AACH,MAAI,CAAC,QAAQ,MAAM,OAAO,yDAEtB,OAAK,IAAA,MAAA,GAAA,CAAA,QAAA,MAAA,OAAA,OAAA,YAAA,eAAA,2BAAA,QAAA,KAAA,GAAA;AAET,UAAQ,MAAM,+CAAA,QAAA,GAAA,UAAA,QAAA,MAAA,MAAA,KAAA,GAAA;AACd,SAAM,SAAA,OAAA,cAAA,IAAA,CAAA,CAAA,iBAAA,OAAA,CAAA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AAA,CAAA,qBAAA,QAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,SACN,KACJ,QAAM,SACD,MAAK,GAAA,IAAA,MAAA,QAAA,SAAA,OAAA,CACL,MAAE,cAAA,OAAA,UAAA,UAAA,IAAA,MAAA,QAAA,SAAA,QAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CACX,KAAA,OAAA,SAAA,MAAA,QAAA,OAAA,QAAA,IAAA,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,QAAA;EACA,SAAA,IAAA,MAAA;;EAEQ,QAAQ,IAAA;;AAGhB,QAAO,IAAI;;AAEf,YAAY,SAAS;CAAC;CAAmB;CAAI;CAAA;CAAA;CAAA;;;;;;;AAO7C,eAAsB,QAAQ,OAAO;CACjC,MAAM,MAAM,OAAO,WAAW,IAAC,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,WAAA,MAAA;AAC/B,KAAI,CAAC,IAAI,OAAK,WAAA;AACV,QAAM,mBAAmB,IAAA;AACzB,sBAAoB,IAAI;OAGxB,uBAAkB,IAAA;AAEtB,QAAO,YAAC,IAAA;;AAEZ,QAAI,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
1
|
+
{"version":3,"file":"resolve.mjs","names":[],"sources":["../../src/resolver/resolve.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 { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { ReflectionVisibility } from \"@powerlines/deepkit/vendor/type\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { getDefaultOptions } from \"../helpers/utilities\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"../plugin-utils/context-helpers\";\nimport { extractType } from \"../plugin-utils/deepkit\";\nimport type { CommandModule, CommandTree, Context } from \"../types\";\nimport { resolveFromBytecode } from \"./deepkit\";\nimport {\n applyArgsDefaults,\n applyDefaults,\n applyOptionsDefaults,\n resolveVirtualCommand\n} from \"./helpers\";\nimport { resolveFromExports } from \"./module\";\nimport type { ResolverContext, ResolverInput } from \"./types\";\n\nasync function initialize<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<ResolverContext> {\n const { context, command, parent } = input;\n\n const title =\n command.title ||\n `${\n parent?.title\n ? `${\n parent.isVirtual\n ? parent.title.replace(/(?:c|C)ommands?$/, \"\").trim()\n : parent.title\n } - `\n : \"\"\n }${titleCase(command.name)}${command.isVirtual ? \" Commands\" : \"\"}`;\n\n const output = {\n alias: [],\n icon: parent?.icon,\n ...command,\n title,\n options: getDefaultOptions(context, command),\n args: [],\n parent: parent ?? null,\n children: {}\n } as CommandTree;\n\n const result: ResolverContext = {\n input,\n output\n };\n\n if (!command.isVirtual) {\n if (\n !command.entry.input?.file ||\n !context.fs.existsSync(command.entry.input.file)\n ) {\n throw new Error(\n `${\n !command.entry.input?.file ? \"Missing\" : \"Non-existent\"\n } command entry file for \"${command.name}\"`\n );\n }\n\n context.debug(\n `Adding reflection for user-defined command: ${command.id} (file: ${\n command.entry.input.file\n })`\n );\n\n result.module = await resolveModule<CommandModule>(\n context,\n command.entry.input,\n {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n reflectionLevel: \"verbose\"\n })\n ]\n }\n );\n }\n\n return result;\n}\n\nasync function postprocess<TContext extends Context = Context>(\n ctx: ResolverContext<TContext>\n): Promise<CommandTree> {\n ctx.output.options = applyOptionsDefaults(ctx);\n ctx.output.args = applyArgsDefaults(ctx);\n\n // Ensure unique argument names by appending an index suffix to duplicates\n ctx.output.args.forEach((arg, index) => {\n const found = ctx.output.args.findIndex(a => a.name === arg.name);\n if (\n (found !== -1 && found !== index) ||\n ctx.output.segments.some(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment) === arg.name\n )\n ) {\n arg.name += `_${\n ctx.output.segments.filter(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment).replace(/_\\d+$/, \"\") === arg.name\n ).length +\n ctx.output.args.filter(a => a.name.replace(/_\\d+$/, \"\") === arg.name)\n .length\n }`;\n arg.env = arg.name\n ? arg.env || arg.env === false\n ? arg.env\n : ctx.input.context.config.autoAssignEnv\n ? constantCase(arg.name)\n : false\n : false;\n }\n });\n\n applyDefaults(ctx);\n\n if (ctx.input.context.env) {\n if (isSetObject(ctx.output.options)) {\n Object.values(ctx.output.options)\n .filter(option => Boolean(option.env))\n .forEach(option => {\n ctx.input.context.env.types.env.addProperty({\n name: option.env as string,\n optional: option.optional ? true : undefined,\n description: option.description,\n visibility: ReflectionVisibility.public,\n type: extractType(option),\n default: option.default,\n tags: {\n title: option.title,\n alias: option.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n });\n });\n }\n\n ctx.output.args\n .filter(arg => Boolean(arg.env))\n .forEach(arg =>\n ctx.input.context.env.types.env.addProperty({\n name: arg.env as string,\n optional: arg.optional ? true : undefined,\n description: arg.description,\n visibility: ReflectionVisibility.public,\n type: extractType(arg),\n default: arg.default,\n tags: {\n alias: arg.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n })\n );\n }\n\n for (const input of ctx.input.context.inputs.filter(\n input =>\n input.segments.filter(segment => !isDynamicPathSegment(segment))\n .length ===\n ctx.input.command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n ).length +\n 1 &&\n input.segments\n .slice(0, ctx.input.command.segments.length)\n .every((value, index) => value === ctx.input.command.segments[index])\n )) {\n ctx.output.children[input.name] = await resolve<TContext>({\n context: ctx.input.context,\n command: input,\n parent: ctx.output\n });\n }\n\n return ctx.output;\n}\n\n/**\n * Resolves a command tree from the given resolver input.\n *\n * @param input - The resolver input containing the context, command, and optional parent command tree.\n * @returns A promise that resolves to the resolved command tree.\n */\nexport async function resolve<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<CommandTree> {\n const ctx = await initialize<TContext>(input);\n\n if (!ctx.output.isVirtual) {\n await resolveFromExports(ctx);\n resolveFromBytecode(ctx);\n } else {\n resolveVirtualCommand(ctx);\n }\n\n return postprocess(ctx);\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;AA+BX,eAAE,WAAiB,OAAA;CACjB,MAAA,EAAA,SAAa,SAAA,WAAA;CACb,MAAA,QAAA,QAAoB,SACpB,GAAA,QAAA,QACQ,GAAO,OAAC,YACT,OAAA,MAAqB,QAAQ,oBAAO,GAAA,CAAA,MAAA,GAC/B,OAAA,MAAiB;CAY3B,MAAM,SAAS;EACX;EACA,QAZO;GACP,OAAC,EAAA;GACN,MAAQ,QAAA;GACH,GAAE;;GAEF,SAAM,kBAAA,SAAA,QAAA;GACV,MAAQ,EAAA;GACN,QAAA,UAAA;GACA,UAAQ,EAAA;GACT;EAIA;AACD,KAAI,CAAC,QAAE,WAAA;AACJ,MAAA,CAAA,QAAU,MAAQ,OAAQ,yDAEzB,OAAS,IAAA,MAAA,GAAA,CAAA,QAAA,MAAA,OAAA,OAAA,YAAA,eAAA,2BAAA,QAAA,KAAA,GAAA;AAET,UAAQ,MAAM,+CAAA,QAAA,GAAA,UAAA,QAAA,M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A,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CACX,WACD,IAAI,MAAI,QAAA,SAAA,OAAA,cAAA,YAAA,CAAA,qBAAA,QAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,SACJ,KACJ,MAAM,SACD,MAAC,GAAA,IAAA,MAAA,QAAA,SAAA,OAAA,CACJ,MAAK,cAAA,OAAA,UAAA,UAAA,IAAA,MAAA,QAAA,SAAA,QAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CACX,KAAA,OAAA,SAAA,MAAA,QAAA,OAAA,QAAA,IAAA,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,QAAA;EACA,SAAA,IAAA,MAAA;;EAEF,QAAkB,IAAA;;AAGhB,QAAI,IAAA;;AAER,YAAS,SAAO;CAAM;CAAmB;CAAI;CAAA;CAAA;CAAA;;;;;;;AAO7C,eAAkB,QAAY,OAAO;CACjC,MAAM,MAAE,OAAS,WAAO,IAAO,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,WAAA,MAAA;AAC/B,KAAI,CAAC,IAAG,OAAM,WAAA;AACV,QAAM,mBAAmB,IAAA;AACzB,sBAAoB,IAAA;OAGpB,uBAAkB,IAAA;AAEtB,QAAO,YAAC,IAAA;;AAEZ,QAAI,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
package/dist/types/command.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.cjs","names":[],"sources":["../../src/types/command.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 { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport type { JsonSchema7TupleType } from \"@stryke/json\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { JSONSchema7Object } from \"json-schema\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport type * as z3 from \"zod/v3\";\n\nexport type CommandParameterType =\n | string\n | number\n | boolean\n | (string | number)[];\n\nexport const CommandParameterKinds = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\"\n} as const;\n\nexport type CommandParameterKind =\n (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: CommandParameterKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"string\";\n /**\n * The default value.\n */\n default?: string;\n /**\n * A standard string format to validate the option value against.\n */\n format?:\n | \"email\"\n | \"uri\"\n | \"uuid\"\n | \"ipv4\"\n | \"ipv6\"\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"duration\";\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"number\";\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"boolean\";\n /**\n * The default value.\n */\n default?: boolean;\n}\n\nexport type CommandParameter =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\n\nexport type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<\n T,\n \"kind\" | \"alias\"\n> &\n Partial<Omit<T, \"kind\" | \"alias\">> & {\n alias?: string | string[];\n };\n\nexport type StringCommandParameterConfig =\n AsCommandParameterConfig<StringCommandParameter>;\nexport type NumberCommandParameterConfig =\n AsCommandParameterConfig<NumberCommandParameter>;\nexport type BooleanCommandParameterConfig =\n AsCommandParameterConfig<BooleanCommandParameter>;\n\nexport type CommandParameterConfig =\n | StringCommandParameterConfig\n | NumberCommandParameterConfig\n | BooleanCommandParameterConfig;\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandOption;\nexport type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;\n\nexport type CommandArgument =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\nexport type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandConfig extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandConfig & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n args: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n};\n\nexport type SerializedCommandTree = Omit<CommandTree, \"parent\" | \"children\"> & {\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n};\n\nexport interface CommandMetadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n}\n\nexport interface CommandModule {\n metadata?: CommandMetadata;\n options?:\n | Record<string, CommandOptionConfig>\n | JSONSchema7Object\n | StandardJSONSchemaV1<Record<string, CommandParameterType>>\n | z3.AnyZodObject;\n args?:\n | CommandArgumentConfig[]\n | JsonSchema7TupleType\n | StandardJSONSchemaV1<CommandParameterType[]>\n | z3.AnyZodTuple;\n default?: AnyFunction;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.cjs","names":[],"sources":["../../src/types/command.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 { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport type { JsonSchema7TupleType } from \"@stryke/json\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { JSONSchema7Object } from \"json-schema\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport type * as z3 from \"zod/v3\";\n\nexport type CommandParameterType =\n | string\n | number\n | boolean\n | (string | number)[];\n\nexport const CommandParameterKinds = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\"\n} as const;\n\nexport type CommandParameterKind =\n (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: CommandParameterKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"string\";\n /**\n * The default value.\n */\n default?: string;\n /**\n * A standard string format to validate the option value against.\n */\n format?:\n | \"email\"\n | \"uri\"\n | \"uuid\"\n | \"ipv4\"\n | \"ipv6\"\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"duration\";\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"number\";\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"boolean\";\n /**\n * The default value.\n */\n default?: boolean;\n}\n\nexport type CommandParameter =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\n\nexport type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<\n T,\n \"kind\" | \"alias\"\n> &\n Partial<Omit<T, \"kind\" | \"alias\">> & {\n alias?: string | string[];\n };\n\nexport type StringCommandParameterConfig =\n AsCommandParameterConfig<StringCommandParameter>;\nexport type NumberCommandParameterConfig =\n AsCommandParameterConfig<NumberCommandParameter>;\nexport type BooleanCommandParameterConfig =\n AsCommandParameterConfig<BooleanCommandParameter>;\n\nexport type CommandParameterConfig =\n | StringCommandParameterConfig\n | NumberCommandParameterConfig\n | BooleanCommandParameterConfig;\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandOption;\nexport type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;\n\nexport type CommandArgument =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\nexport type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandConfig extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandConfig & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n args: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n};\n\nexport type SerializedCommandTree = Omit<CommandTree, \"parent\" | \"children\"> & {\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n};\n\nexport interface CommandMetadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n}\n\nexport interface CommandModule {\n metadata?: CommandMetadata;\n options?:\n | Record<string, CommandOptionConfig>\n | JSONSchema7Object\n | StandardJSONSchemaV1<Record<string, CommandParameterType>>\n | z3.AnyZodObject;\n args?:\n | CommandArgumentConfig[]\n | JsonSchema7TupleType\n | StandardJSONSchemaV1<CommandParameterType[]>\n | z3.AnyZodTuple;\n default?: AnyFunction;\n}\n"],"mappings":";;;AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,UAAU;CAAC;CAAG;OAAM;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;OAAoB;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAE5B,MAAK,2BAAiB;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAE,qBAAa;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEf,MAAK,mBAAW;OAAW;CAAA;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.cts","names":[],"sources":["../../src/types/command.ts"],"
|
|
1
|
+
{"version":3,"file":"command.d.cts","names":[],"sources":["../../src/types/command.ts"],"mappings":";;;;;;;;KAyBY,oBAAA;AAAA,cAMC,qBAAA;EAAA;;;;KAMD,oBAAA,WACF,qBAAA,eAAoC,qBAAA;AAAA,UAE7B,oBAAA;EALP;;;EASR,IAAA;;;;EAIA,IAAA,EAAM,oBAAA;EAXI;;;EAeV,KAAA;EAdiE;AAEnE;;EAgBE,WAAA;EAR0B;;;EAY1B,KAAA;EARA;;;EAYA,GAAA;EAIA;;;EAAA,QAAA;AAAA;AAAA,UAGe,sBAAA,SAA+B,oBAAA;EAAoB;;;EAIlE,IAAA;EAQA;;;EAJA,OAAA;EAsBO;AAGT;;EArBE,MAAA;EAqBkE;;;EARlE,QAAA;EAoBA;;;EAfA,OAAA;AAAA;AAAA,UAGe,sBAAA,SAA+B,oBAAA;;;;EAI9C,IAAA;EAwBA;;;EApBA,OAAA;EAuB0B;;;EAnB1B,QAAA;EAsBE;;;EAjBF,OAAA;AAAA;AAAA,UAGe,uBAAA,SAAgC,oBAAA;EActB;;AAE3B;EAZE,IAAA;EAYkC;;;EARlC,OAAA;AAAA;AAAA,KAGU,gBAAA,GACR,sBAAA,GACA,sBAAA,GACA,uBAAA;AAAA,KAEQ,wBAAA,WAAmC,oBA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AK,WAAA;;;;EAIvC,MAAA;EAtCA;;;EA0CA,QAAA,EAAU,MAAA,SAAe,qBAAA;AAAA;AAAA,UAGV,eAAA;;;;;;;EAOf,KAAA;EArBU;;;;;;EA6BV,WAAA;EAzCA;;;EA8CA,KAAA;EA1CM;;;;;;EAkDN,IAAA;AAAA;AAAA,UAGe,aAAA;EACf,QAAA,GAAW,eAAA;EACX,OAAA,GACI,MAAA,SAAe,mBAAA,IACf,iBAAA,GACA,oBAAA,CAAqB,MAAA,SAAe,oBAAA,KACpC,EAAA,CAAG,YAAA;EACP,IAAA,GACI,qBAAA,KACA,oBAAA,GACA,oBAAA,CAAqB,oBAAA,MACrB,EAAA,CAAG,WAAA;EACP,OAAA,GAAU,WAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.mts","names":[],"sources":["../../src/types/command.ts"],"
|
|
1
|
+
{"version":3,"file":"command.d.mts","names":[],"sources":["../../src/types/command.ts"],"mappings":";;;;;;;;KAyBY,oBAAA;AAAA,cAMC,qBAAA;EAAA;;;;KAMD,oBAAA,WACF,qBAAA,eAAoC,qBAAA;AAAA,UAE7B,oBAAA;EALP;;;EASR,IAAA;;;;EAIA,IAAA,EAAM,oBAAA;EAXI;;;EAeV,KAAA;EAdiE;AAEnE;;EAgBE,WAAA;EAR0B;;;EAY1B,KAAA;EARA;;;EAYA,GAAA;EAIA;;;EAAA,QAAA;AAAA;AAAA,UAGe,sBAAA,SAA+B,oBAAA;EAAoB;;;EAIlE,IAAA;EAQA;;;EAJA,OAAA;EAsBO;AAGT;;EArBE,MAAA;EAqBkE;;;EARlE,QAAA;EAoBA;;;EAfA,OAAA;AAAA;AAAA,UAGe,sBAAA,SAA+B,oBAAA;;;;EAI9C,IAAA;EAwBA;;;EApBA,OAAA;EAuB0B;;;EAnB1B,QAAA;EAsBE;;;EAjBF,OAAA;AAAA;AAAA,UAGe,uBAAA,SAAgC,oBAAA;EActB;;AAE3B;EAZE,IAAA;EAY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EA,MAAA,SAAe,WAAA;EA/Cf;;;EAmDA,QAAA,EAAU,MAAA,SAAe,WAAA;AAAA;AAAA,KAGf,qBAAA,GAAwB,IAAA,CAAK,WAAA;;;;EAIvC,MAAA;EAtCA;;;EA0CA,QAAA,EAAU,MAAA,SAAe,qBAAA;AAAA;AAAA,UAGV,eAAA;;;;;;;EAOf,KAAA;EArBU;;;;;;EA6BV,WAAA;EAzCA;;;EA8CA,KAAA;EA1CM;;;;;;EAkDN,IAAA;AAAA;AAAA,UAGe,aAAA;EACf,QAAA,GAAW,eAAA;EACX,OAAA,GACI,MAAA,SAAe,mBAAA,IACf,iBAAA,GACA,oBAAA,CAAqB,MAAA,SAAe,oBAAA,KACpC,EAAA,CAAG,YAAA;EACP,IAAA,GACI,qBAAA,KACA,oBAAA,GACA,oBAAA,CAAqB,oBAAA,MACrB,EAAA,CAAG,WAAA;EACP,OAAA,GAAU,WAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.mjs","names":[],"sources":["../../src/types/command.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 { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport type { JsonSchema7TupleType } from \"@stryke/json\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { JSONSchema7Object } from \"json-schema\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport type * as z3 from \"zod/v3\";\n\nexport type CommandParameterType =\n | string\n | number\n | boolean\n | (string | number)[];\n\nexport const CommandParameterKinds = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\"\n} as const;\n\nexport type CommandParameterKind =\n (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: CommandParameterKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"string\";\n /**\n * The default value.\n */\n default?: string;\n /**\n * A standard string format to validate the option value against.\n */\n format?:\n | \"email\"\n | \"uri\"\n | \"uuid\"\n | \"ipv4\"\n | \"ipv6\"\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"duration\";\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"number\";\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"boolean\";\n /**\n * The default value.\n */\n default?: boolean;\n}\n\nexport type CommandParameter =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\n\nexport type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<\n T,\n \"kind\" | \"alias\"\n> &\n Partial<Omit<T, \"kind\" | \"alias\">> & {\n alias?: string | string[];\n };\n\nexport type StringCommandParameterConfig =\n AsCommandParameterConfig<StringCommandParameter>;\nexport type NumberCommandParameterConfig =\n AsCommandParameterConfig<NumberCommandParameter>;\nexport type BooleanCommandParameterConfig =\n AsCommandParameterConfig<BooleanCommandParameter>;\n\nexport type CommandParameterConfig =\n | StringCommandParameterConfig\n | NumberCommandParameterConfig\n | BooleanCommandParameterConfig;\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandOption;\nexport type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;\n\nexport type CommandArgument =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\nexport type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandConfig extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandConfig & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n args: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n};\n\nexport type SerializedCommandTree = Omit<CommandTree, \"parent\" | \"children\"> & {\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n};\n\nexport interface CommandMetadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n}\n\nexport interface CommandModule {\n metadata?: CommandMetadata;\n options?:\n | Record<string, CommandOptionConfig>\n | JSONSchema7Object\n | StandardJSONSchemaV1<Record<string, CommandParameterType>>\n | z3.AnyZodObject;\n args?:\n | CommandArgumentConfig[]\n | JsonSchema7TupleType\n | StandardJSONSchemaV1<CommandParameterType[]>\n | z3.AnyZodTuple;\n default?: AnyFunction;\n}\n"],"mappings":";AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,UAAU;CAAC;
|
|
1
|
+
{"version":3,"file":"command.mjs","names":[],"sources":["../../src/types/command.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 { StandardJSONSchemaV1 } from \"@standard-schema/spec\";\nimport type { JsonSchema7TupleType } from \"@stryke/json\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { JSONSchema7Object } from \"json-schema\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport type * as z3 from \"zod/v3\";\n\nexport type CommandParameterType =\n | string\n | number\n | boolean\n | (string | number)[];\n\nexport const CommandParameterKinds = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\"\n} as const;\n\nexport type CommandParameterKind =\n (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: CommandParameterKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"string\";\n /**\n * The default value.\n */\n default?: string;\n /**\n * A standard string format to validate the option value against.\n */\n format?:\n | \"email\"\n | \"uri\"\n | \"uuid\"\n | \"ipv4\"\n | \"ipv6\"\n | \"date\"\n | \"time\"\n | \"date-time\"\n | \"duration\";\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: string[];\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"number\";\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n\n /**\n * The allowed choices for the option value.\n */\n choices?: number[];\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: \"boolean\";\n /**\n * The default value.\n */\n default?: boolean;\n}\n\nexport type CommandParameter =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\n\nexport type AsCommandParameterConfig<T extends BaseCommandParameter> = Pick<\n T,\n \"kind\" | \"alias\"\n> &\n Partial<Omit<T, \"kind\" | \"alias\">> & {\n alias?: string | string[];\n };\n\nexport type StringCommandParameterConfig =\n AsCommandParameterConfig<StringCommandParameter>;\nexport type NumberCommandParameterConfig =\n AsCommandParameterConfig<NumberCommandParameter>;\nexport type BooleanCommandParameterConfig =\n AsCommandParameterConfig<BooleanCommandParameter>;\n\nexport type CommandParameterConfig =\n | StringCommandParameterConfig\n | NumberCommandParameterConfig\n | BooleanCommandParameterConfig;\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandOption;\nexport type CommandOptionConfig = AsCommandParameterConfig<CommandOption>;\n\nexport type CommandArgument =\n | StringCommandParameter\n | NumberCommandParameter\n | BooleanCommandParameter;\nexport type CommandArgumentConfig = AsCommandParameterConfig<CommandArgument>;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandConfig extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandConfig & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n args: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n};\n\nexport type SerializedCommandTree = Omit<CommandTree, \"parent\" | \"children\"> & {\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n};\n\nexport interface CommandMetadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n}\n\nexport interface CommandModule {\n metadata?: CommandMetadata;\n options?:\n | Record<string, CommandOptionConfig>\n | JSONSchema7Object\n | StandardJSONSchemaV1<Record<string, CommandParameterType>>\n | z3.AnyZodObject;\n args?:\n | CommandArgumentConfig[]\n | JsonSchema7TupleType\n | StandardJSONSchemaV1<CommandParameterType[]>\n | z3.AnyZodTuple;\n default?: AnyFunction;\n}\n"],"mappings":";AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,UAAU;CAAC;CAAG;OAAM;OAAiB;CAAA;CAAA;CAAA;;;;;;;AAE3C,MAAM,aAAS;CAAA;CAAS;CAAG;CAAY;CAA2B;AAClE,MAAI,0BAA4B,CAAC,wBAAqB,gBAAa;AAEnE,MAAK,wBAA0B;;CAE9B,QAAW;CACX,SAAY;CACZ;AACD,MAAC,0BAA+B;OAAG;OAAkB;CAAA;CAAA;CAAA;AAErD,MAAM,0BAAqB;CAAM;OAAG;CAAA;CAAA;CAAA;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;CAAA;OAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
package/dist/types/config.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs","names":[],"sources":["../../src/types/config.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { AutoMDPluginResolvedConfig } from \"@powerlines/plugin-automd/types/plugin\";\nimport type {\n NodeJsPluginOptions,\n NodeJsPluginResolvedConfig,\n NodeJsPluginUserConfig\n} from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type {\n TsdownPluginResolvedConfig,\n TsdownPluginUserConfig\n} from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { OutputConfig as PowerlinesOutputConfig } from \"powerlines\";\nimport type { CommandBase, CommandOption } from \"./command\";\nimport type { Context } from \"./context\";\n\ntype BuildOptions = Pick<\n TsdownPluginUserConfig,\n | \"root\"\n | \"name\"\n | \"title\"\n | \"description\"\n | \"logLevel\"\n | \"mode\"\n | \"skipCache\"\n | \"autoInstall\"\n | \"plugins\"\n | \"tsconfig\"\n | \"tsconfigRaw\"\n>;\n\ntype BaseOptions = Partial<BuildOptions> & {\n /**\n * A set of default command options to apply to each command.\n *\n * @remarks\n * To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.\n */\n defaultOptions?:\n | CommandOption[]\n | ((context: Context, input: CommandBase) => CommandOption[])\n | false;\n\n /**\n * Determines whether commands and option names are treated as case-sensitive.\n *\n * @defaultValue `false`\n */\n isCaseSensitive?: boolean;\n\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin?: string | string[];\n\n /**\n * Should Shell Shock attempt to automatically assign environment variables to manipulate default values for command options based on the option name?\n *\n * @remarks\n * If set to a string, Shell Shock will use the provided string as an application specific environment variable prefix, convert the option name to {@link https://stringcase.org/cases/constant/ | constant case}, and prepend the provided `string` value to determine the corresponding environment variable name. For example, if an option is named `\"configPath\"` and the `autoAssignEnv` is `\"MY_APP_\"`, Shell Shock will look for an environment variable named `\"MY_APP_CONFIG_PATH\"` and assign its value to the option if it exists. If set to `true`, Shell Shock will use a default environment variable prefix derived from the {@link Options.name | application name}.\n *\n * @see https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa\n * @see https://stringcase.org/cases/constant/\n */\n autoAssignEnv?: true | string;\n};\n\n/**\n * The plugin options for Shell Shock.\n */\nexport type Options = BaseOptions & Partial<NodeJsPluginOptions>;\n\n/**\n * The output configuration options for Shell Shock.\n */\nexport type OutputConfig = Pick<\n PowerlinesOutputConfig,\n \"outputPath\" | \"assets\" | \"storage\"\n> & {\n /**\n * An indicator specifying whether to generate TypeScript declaration files (.d.ts) during the build process.\n */\n dts?: false;\n};\n\n/**\n * The user configuration options for Shell Shock.\n */\nexport type UserConfig = BaseOptions &\n Partial<NodeJsPluginUserConfig> & {\n /**\n * Configuration for the output of the build process\n */\n output?: OutputConfig;\n };\n\n/**\n * The resolved configuration options for Shell Shock.\n */\nexport type ResolvedConfig = TsdownPluginResolvedConfig &\n AutoMDPluginResolvedConfig &\n NodeJsPluginResolvedConfig &\n Required<Omit<Options, \"bin\">> & {\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin: Record<string, string>;\n\n /**\n * The command-line application specific environment variable prefix used for automatically assigning environment variables to command options.\n */\n appSpecificEnvPrefix: string;\n\n /**\n * The user configuration for the Shell Shock process.\n */\n userConfig: UserConfig;\n };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.cjs","names":[],"sources":["../../src/types/config.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { AutoMDPluginResolvedConfig } from \"@powerlines/plugin-automd/types/plugin\";\nimport type {\n NodeJsPluginOptions,\n NodeJsPluginResolvedConfig,\n NodeJsPluginUserConfig\n} from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type {\n TsdownPluginResolvedConfig,\n TsdownPluginUserConfig\n} from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { OutputConfig as PowerlinesOutputConfig } from \"powerlines\";\nimport type { CommandBase, CommandOption } from \"./command\";\nimport type { Context } from \"./context\";\n\ntype BuildOptions = Pick<\n TsdownPluginUserConfig,\n | \"root\"\n | \"name\"\n | \"title\"\n | \"description\"\n | \"logLevel\"\n | \"mode\"\n | \"skipCache\"\n | \"autoInstall\"\n | \"plugins\"\n | \"tsconfig\"\n | \"tsconfigRaw\"\n>;\n\ntype BaseOptions = Partial<BuildOptions> & {\n /**\n * A set of default command options to apply to each command.\n *\n * @remarks\n * To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.\n */\n defaultOptions?:\n | CommandOption[]\n | ((context: Context, input: CommandBase) => CommandOption[])\n | false;\n\n /**\n * Determines whether commands and option names are treated as case-sensitive.\n *\n * @defaultValue `false`\n */\n isCaseSensitive?: boolean;\n\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin?: string | string[];\n\n /**\n * Should Shell Shock attempt to automatically assign environment variables to manipulate default values for command options based on the option name?\n *\n * @remarks\n * If set to a string, Shell Shock will use the provided string as an application specific environment variable prefix, convert the option name to {@link https://stringcase.org/cases/constant/ | constant case}, and prepend the provided `string` value to determine the corresponding environment variable name. For example, if an option is named `\"configPath\"` and the `autoAssignEnv` is `\"MY_APP_\"`, Shell Shock will look for an environment variable named `\"MY_APP_CONFIG_PATH\"` and assign its value to the option if it exists. If set to `true`, Shell Shock will use a default environment variable prefix derived from the {@link Options.name | application name}.\n *\n * @see https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa\n * @see https://stringcase.org/cases/constant/\n */\n autoAssignEnv?: true | string;\n};\n\n/**\n * The plugin options for Shell Shock.\n */\nexport type Options = BaseOptions & Partial<NodeJsPluginOptions>;\n\n/**\n * The output configuration options for Shell Shock.\n */\nexport type OutputConfig = Pick<\n PowerlinesOutputConfig,\n \"outputPath\" | \"assets\" | \"storage\"\n> & {\n /**\n * An indicator specifying whether to generate TypeScript declaration files (.d.ts) during the build process.\n */\n dts?: false;\n};\n\n/**\n * The user configuration options for Shell Shock.\n */\nexport type UserConfig = BaseOptions &\n Partial<NodeJsPluginUserConfig> & {\n /**\n * Configuration for the output of the build process\n */\n output?: OutputConfig;\n };\n\n/**\n * The resolved configuration options for Shell Shock.\n */\nexport type ResolvedConfig = TsdownPluginResolvedConfig &\n AutoMDPluginResolvedConfig &\n NodeJsPluginResolvedConfig &\n Required<Omit<Options, \"bin\">> & {\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin: Record<string, string>;\n\n /**\n * The command-line application specific environment variable prefix used for automatically assigning environment variables to command options.\n */\n appSpecificEnvPrefix: string;\n\n /**\n * The user configuration for the Shell Shock process.\n */\n userConfig: UserConfig;\n };\n"],"mappings":";;;AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,cAAc;CAAA;CAAM;CAAW;CAAM;;;;;;;;;AAE3C,MAAM,YAAS;CAAA;CAAS;CAAG;CAAY;CAAqB;AAC5D,MAAI,aAAc;CAAA;CAAM;CAAA;CAAe;CAA4B;AACnE,MAAM,kBAAkB;OAAC;CAAa;CAAS;CAAA;CAAa;CAAO;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AACnE,MAAK,iBAAkB;OAAO;OAAkB;CAAU;CAAoB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;AAG9E,MAAC,kBAAuB;OAAG;CAAQ;CAAiB;CAAS;CAAM;CAAA;CAAA;CAAA;CAAA;AAEnE,MAAC,gBAAqB;OAAK;OAAsB;OAAI;CAAA;CAAA;CAAA;CAAA;AAErD,MAAM,oBAAoB;OAAO;OAAG;OAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/types/config.ts"],"
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;KAgCK,YAAA,GAAe,IAAA,CAClB,sBAAA;AAAA,KAcG,WAAA,GAAc,OAAA,CAAQ,YAAA;EAftB;;;;;AACmB;EAqBtB,cAAA,GACI,aAAA,OACE,OAAA,EAAS,OAAA,EAAS,KAAA,EAAO,WAAA,KAAgB,aAAA;;;;;;EAQ/C,eAAA;EAR+C;;;;;;;;;;EAoB/C,GAAA;EApB+C;;;;;;AAqCjD;;;EANE,aAAA;AAAA;;;;KAMU,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,mBAAA;;;;KAKhC,YAAA,GAAe,IAAA,CACzB,cAAA;EADU;;;EAOV,GAAA;AAAA;;;;KAMU,UAAA,GAAa,WAAA,GACvB,OAAA,CAAQ,sBAAA;EADE;;;EAKR,MAAA,GAAS,YAAA;AAAA;;;;KAMD,cAAA,GAAiB,0BAAA,GAC3B,0BAAA,GACA,0BAAA,GACA,QAAA,CAAS,IAAA,CAAK,OAAA;EAdS;;;;;;;AAWzB;;;EAcI,GAAA,EAAK,MAAA;EAbP;;;EAkBE,oBAAA;EAhBF;;;EAqBE,UAAA,EAAY,UAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/types/config.ts"],"
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/types/config.ts"],"mappings":";;;;;;;;KAgCK,YAAA,GAAe,IAAA,CAClB,sBAAA;AAAA,KAcG,WAAA,GAAc,OAAA,CAAQ,YAAA;EAftB;;;;;AACmB;EAqBtB,cAAA,GACI,aAAA,OACE,OAAA,EAAS,OAAA,EAAS,KAAA,EAAO,WAAA,KAAgB,aAAA;;;;;;EAQ/C,eAAA;EAR+C;;;;;;;;;;EAoB/C,GAAA;EApB+C;;;;;;AAqCjD;;;EANE,aAAA;AAAA;;;;KAMU,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,mBAAA;;;;KAKhC,YAAA,GAAe,IAAA,CACzB,cAAA;EADU;;;EAOV,GAAA;AAAA;;;;KAMU,UAAA,GAAa,WAAA,GACvB,OAAA,CAAQ,sBAAA;EADE;;;EAKR,MAAA,GAAS,YAAA;AAAA;;;;KAMD,cAAA,GAAiB,0BAAA,GAC3B,0BAAA,GACA,0BAAA,GACA,QAAA,CAAS,IAAA,CAAK,OAAA;EAdS;;;;;;;AAWzB;;;EAcI,GAAA,EAAK,MAAA;EAbP;;;EAkBE,oBAAA;EAhBF;;;EAqBE,UAAA,EAAY,UAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":[],"sources":["../../src/types/config.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { AutoMDPluginResolvedConfig } from \"@powerlines/plugin-automd/types/plugin\";\nimport type {\n NodeJsPluginOptions,\n NodeJsPluginResolvedConfig,\n NodeJsPluginUserConfig\n} from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type {\n TsdownPluginResolvedConfig,\n TsdownPluginUserConfig\n} from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { OutputConfig as PowerlinesOutputConfig } from \"powerlines\";\nimport type { CommandBase, CommandOption } from \"./command\";\nimport type { Context } from \"./context\";\n\ntype BuildOptions = Pick<\n TsdownPluginUserConfig,\n | \"root\"\n | \"name\"\n | \"title\"\n | \"description\"\n | \"logLevel\"\n | \"mode\"\n | \"skipCache\"\n | \"autoInstall\"\n | \"plugins\"\n | \"tsconfig\"\n | \"tsconfigRaw\"\n>;\n\ntype BaseOptions = Partial<BuildOptions> & {\n /**\n * A set of default command options to apply to each command.\n *\n * @remarks\n * To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.\n */\n defaultOptions?:\n | CommandOption[]\n | ((context: Context, input: CommandBase) => CommandOption[])\n | false;\n\n /**\n * Determines whether commands and option names are treated as case-sensitive.\n *\n * @defaultValue `false`\n */\n isCaseSensitive?: boolean;\n\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin?: string | string[];\n\n /**\n * Should Shell Shock attempt to automatically assign environment variables to manipulate default values for command options based on the option name?\n *\n * @remarks\n * If set to a string, Shell Shock will use the provided string as an application specific environment variable prefix, convert the option name to {@link https://stringcase.org/cases/constant/ | constant case}, and prepend the provided `string` value to determine the corresponding environment variable name. For example, if an option is named `\"configPath\"` and the `autoAssignEnv` is `\"MY_APP_\"`, Shell Shock will look for an environment variable named `\"MY_APP_CONFIG_PATH\"` and assign its value to the option if it exists. If set to `true`, Shell Shock will use a default environment variable prefix derived from the {@link Options.name | application name}.\n *\n * @see https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa\n * @see https://stringcase.org/cases/constant/\n */\n autoAssignEnv?: true | string;\n};\n\n/**\n * The plugin options for Shell Shock.\n */\nexport type Options = BaseOptions & Partial<NodeJsPluginOptions>;\n\n/**\n * The output configuration options for Shell Shock.\n */\nexport type OutputConfig = Pick<\n PowerlinesOutputConfig,\n \"outputPath\" | \"assets\" | \"storage\"\n> & {\n /**\n * An indicator specifying whether to generate TypeScript declaration files (.d.ts) during the build process.\n */\n dts?: false;\n};\n\n/**\n * The user configuration options for Shell Shock.\n */\nexport type UserConfig = BaseOptions &\n Partial<NodeJsPluginUserConfig> & {\n /**\n * Configuration for the output of the build process\n */\n output?: OutputConfig;\n };\n\n/**\n * The resolved configuration options for Shell Shock.\n */\nexport type ResolvedConfig = TsdownPluginResolvedConfig &\n AutoMDPluginResolvedConfig &\n NodeJsPluginResolvedConfig &\n Required<Omit<Options, \"bin\">> & {\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin: Record<string, string>;\n\n /**\n * The command-line application specific environment variable prefix used for automatically assigning environment variables to command options.\n */\n appSpecificEnvPrefix: string;\n\n /**\n * The user configuration for the Shell Shock process.\n */\n userConfig: UserConfig;\n };\n"],"mappings":";AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"config.mjs","names":[],"sources":["../../src/types/config.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { AutoMDPluginResolvedConfig } from \"@powerlines/plugin-automd/types/plugin\";\nimport type {\n NodeJsPluginOptions,\n NodeJsPluginResolvedConfig,\n NodeJsPluginUserConfig\n} from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type {\n TsdownPluginResolvedConfig,\n TsdownPluginUserConfig\n} from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { OutputConfig as PowerlinesOutputConfig } from \"powerlines\";\nimport type { CommandBase, CommandOption } from \"./command\";\nimport type { Context } from \"./context\";\n\ntype BuildOptions = Pick<\n TsdownPluginUserConfig,\n | \"root\"\n | \"name\"\n | \"title\"\n | \"description\"\n | \"logLevel\"\n | \"mode\"\n | \"skipCache\"\n | \"autoInstall\"\n | \"plugins\"\n | \"tsconfig\"\n | \"tsconfigRaw\"\n>;\n\ntype BaseOptions = Partial<BuildOptions> & {\n /**\n * A set of default command options to apply to each command.\n *\n * @remarks\n * To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.\n */\n defaultOptions?:\n | CommandOption[]\n | ((context: Context, input: CommandBase) => CommandOption[])\n | false;\n\n /**\n * Determines whether commands and option names are treated as case-sensitive.\n *\n * @defaultValue `false`\n */\n isCaseSensitive?: boolean;\n\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin?: string | string[];\n\n /**\n * Should Shell Shock attempt to automatically assign environment variables to manipulate default values for command options based on the option name?\n *\n * @remarks\n * If set to a string, Shell Shock will use the provided string as an application specific environment variable prefix, convert the option name to {@link https://stringcase.org/cases/constant/ | constant case}, and prepend the provided `string` value to determine the corresponding environment variable name. For example, if an option is named `\"configPath\"` and the `autoAssignEnv` is `\"MY_APP_\"`, Shell Shock will look for an environment variable named `\"MY_APP_CONFIG_PATH\"` and assign its value to the option if it exists. If set to `true`, Shell Shock will use a default environment variable prefix derived from the {@link Options.name | application name}.\n *\n * @see https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa\n * @see https://stringcase.org/cases/constant/\n */\n autoAssignEnv?: true | string;\n};\n\n/**\n * The plugin options for Shell Shock.\n */\nexport type Options = BaseOptions & Partial<NodeJsPluginOptions>;\n\n/**\n * The output configuration options for Shell Shock.\n */\nexport type OutputConfig = Pick<\n PowerlinesOutputConfig,\n \"outputPath\" | \"assets\" | \"storage\"\n> & {\n /**\n * An indicator specifying whether to generate TypeScript declaration files (.d.ts) during the build process.\n */\n dts?: false;\n};\n\n/**\n * The user configuration options for Shell Shock.\n */\nexport type UserConfig = BaseOptions &\n Partial<NodeJsPluginUserConfig> & {\n /**\n * Configuration for the output of the build process\n */\n output?: OutputConfig;\n };\n\n/**\n * The resolved configuration options for Shell Shock.\n */\nexport type ResolvedConfig = TsdownPluginResolvedConfig &\n AutoMDPluginResolvedConfig &\n NodeJsPluginResolvedConfig &\n Required<Omit<Options, \"bin\">> & {\n /**\n * The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | \"bin\" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).\n *\n * @remarks\n * If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin: Record<string, string>;\n\n /**\n * The command-line application specific environment variable prefix used for automatically assigning environment variables to command options.\n */\n appSpecificEnvPrefix: string;\n\n /**\n * The user configuration for the Shell Shock process.\n */\n userConfig: UserConfig;\n };\n"],"mappings":";AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,cAAc;CAAA;CAAM;CAAW;CAAM;;;;;;;;;AAE3C,MAAM,YAAS;CAAA;CAAS;CAAG;CAAY;CAAqB;AAC5D,MAAI,aAAc;CAAA;CAAM;CAAA;CAAe;CAA4B;AACnE,MAAM,kBAAkB;OAAC;CAAa;CAAS;CAAA;CAAa;CAAO;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AACnE,MAAK,iBAAkB;OAAO;OAAkB;CAAU;CAAoB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;AAG9E,MAAC,kBAAuB;OAAG;CAAQ;CAAiB;CAAS;CAAM;CAAA;CAAA;CAAA;CAAA;AAEnE,MAAC,gBAAqB;OAAK;OAAsB;OAAI;CAAA;CAAA;CAAA;CAAA;AAErD,MAAM,oBAAoB;OAAO;OAAG;OAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
|
package/dist/types/context.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.cjs","names":[],"sources":["../../src/types/context.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 { NodeJsPluginContext } from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type { TsdownPluginContext } from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { UnresolvedContext as PowerlinesUnresolvedContext } from \"powerlines\";\nimport type { CommandConfig, CommandOption, CommandTree } from \"./command\";\nimport type { ResolvedConfig } from \"./config\";\n\nexport type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> =\n TsdownPluginContext<TResolvedConfig> &\n NodeJsPluginContext<TResolvedConfig> & {\n /**\n * The root path where commands are located.\n */\n commandsPath: string;\n\n /**\n * The default command arguments to apply to all application commands.\n */\n options: CommandOption[];\n\n /**\n * The list of commands discovered in the project.\n */\n inputs: CommandConfig[];\n\n /**\n * The command-line application structure.\n */\n commands: Record<string, CommandTree>;\n };\n\nexport type UnresolvedContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n> = PowerlinesUnresolvedContext<TResolvedConfig>;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.cjs","names":[],"sources":["../../src/types/context.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 { NodeJsPluginContext } from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type { TsdownPluginContext } from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { UnresolvedContext as PowerlinesUnresolvedContext } from \"powerlines\";\nimport type { CommandConfig, CommandOption, CommandTree } from \"./command\";\nimport type { ResolvedConfig } from \"./config\";\n\nexport type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> =\n TsdownPluginContext<TResolvedConfig> &\n NodeJsPluginContext<TResolvedConfig> & {\n /**\n * The root path where commands are located.\n */\n commandsPath: string;\n\n /**\n * The default command arguments to apply to all application commands.\n */\n options: CommandOption[];\n\n /**\n * The list of commands discovered in the project.\n */\n inputs: CommandConfig[];\n\n /**\n * The command-line application structure.\n */\n commands: Record<string, CommandTree>;\n };\n\nexport type UnresolvedContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig\n> = PowerlinesUnresolvedContext<TResolvedConfig>;\n"],"mappings":";;;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"
|
|
1
|
+
{"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;KAwBY,OAAA,yBAAgC,cAAA,GAAiB,cAAA,IAC3D,mBAAA,CAAoB,eAAA,IAClB,mBAAA,CAAoB,eAAA;;AAFxB;;EAMM,YAAA;EANsC;;;EAWtC,OAAA,EAAS,aAAA;EATS;;;EAclB,MAAA,EAAQ,aAAA;EAKiB;;;EAAzB,QAAA,EAAU,MAAA,SAAe,WAAA;AAAA;AAAA,KAGnB,iBAAA,yBACc,cAAA,GAAiB,cAAA,IACvC,mBAAA,CAA4B,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"
|
|
1
|
+
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;KAwBY,OAAA,yBAAgC,cAAA,GAAiB,cAAA,IAC3D,mBAAA,CAAoB,eAAA,IAClB,mBAAA,CAAoB,eAAA;;AAFxB;;EAMM,YAAA;EANsC;;;EAWtC,OAAA,EAAS,aAAA;EATS;;;EAclB,MAAA,EAAQ,aAAA;EAKiB;;;EAAzB,QAAA,EAAU,MAAA,SAAe,WAAA;AAAA;AAAA,KAGnB,iBAAA,yBACc,cAAA,GAAiB,cAAA,IACvC,mBAAA,CAA4B,eAAA"}
|
package/dist/types/env.cjs
CHANGED
package/dist/types/env.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.cts","names":[],"sources":["../../src/types/env.ts"],"
|
|
1
|
+
{"version":3,"file":"env.d.cts","names":[],"sources":["../../src/types/env.ts"],"mappings":";UAkBiB,aAAA;EAAA;;;;;;EAOf,OAAA;;;;EAKA,IAAA;AAAA"}
|
package/dist/types/env.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.mts","names":[],"sources":["../../src/types/env.ts"],"
|
|
1
|
+
{"version":3,"file":"env.d.mts","names":[],"sources":["../../src/types/env.ts"],"mappings":";UAkBiB,aAAA;EAAA;;;;;;EAOf,OAAA;;;;EAKA,IAAA;AAAA"}
|
package/dist/types/index.cjs
CHANGED
package/dist/types/options.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.cts","names":[],"sources":["../../src/types/options.ts"],"
|
|
1
|
+
{"version":3,"file":"options.d.cts","names":[],"sources":["../../src/types/options.ts"],"mappings":";UAkBiB,kBAAA;EACf,IAAA;EACA,OAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.mts","names":[],"sources":["../../src/types/options.ts"],"
|
|
1
|
+
{"version":3,"file":"options.d.mts","names":[],"sources":["../../src/types/options.ts"],"mappings":";UAkBiB,kBAAA;EACf,IAAA;EACA,OAAA;AAAA"}
|
package/dist/types/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.cts","names":[],"sources":["../../src/types/runtime.ts"],"
|
|
1
|
+
{"version":3,"file":"runtime.d.cts","names":[],"sources":["../../src/types/runtime.ts"],"mappings":";UAkBiB,cAAA;EAAA;;;EAIf,IAAA;EAKQ;;;EAAR,QAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../src/types/runtime.ts"],"
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../src/types/runtime.ts"],"mappings":";UAkBiB,cAAA;EAAA;;;EAIf,IAAA;EAKQ;;;EAAR,QAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing the core Shell Shock functionality used to build and manage a command-line application.",
|
|
6
6
|
"repository": {
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"default": "./dist/index.mjs"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"./*": "./*",
|
|
59
58
|
"./api": {
|
|
60
59
|
"require": { "types": "./dist/api.d.cts", "default": "./dist/api.cjs" },
|
|
61
60
|
"import": { "types": "./dist/api.d.mts", "default": "./dist/api.mjs" },
|
|
@@ -215,6 +214,7 @@
|
|
|
215
214
|
"default": "./dist/contexts/options.mjs"
|
|
216
215
|
}
|
|
217
216
|
},
|
|
217
|
+
"./package.json": "./package.json",
|
|
218
218
|
"./plugin": {
|
|
219
219
|
"require": {
|
|
220
220
|
"types": "./dist/plugin.d.cts",
|
|
@@ -352,37 +352,37 @@
|
|
|
352
352
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
353
353
|
"@alloy-js/markdown": "0.23.0-dev.1",
|
|
354
354
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
355
|
-
"@powerlines/deepkit": "^0.6.
|
|
356
|
-
"@powerlines/plugin-alloy": "^0.
|
|
357
|
-
"@powerlines/plugin-automd": "^0.1.
|
|
358
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
359
|
-
"@powerlines/plugin-nodejs": "^0.1.
|
|
360
|
-
"@powerlines/plugin-tsdown": "^0.1.
|
|
355
|
+
"@powerlines/deepkit": "^0.6.134",
|
|
356
|
+
"@powerlines/plugin-alloy": "^0.25.41",
|
|
357
|
+
"@powerlines/plugin-automd": "^0.1.355",
|
|
358
|
+
"@powerlines/plugin-deepkit": "^0.11.234",
|
|
359
|
+
"@powerlines/plugin-nodejs": "^0.1.277",
|
|
360
|
+
"@powerlines/plugin-tsdown": "^0.1.303",
|
|
361
361
|
"@standard-schema/spec": "^1.1.0",
|
|
362
362
|
"@standard-schema/utils": "^0.3.0",
|
|
363
|
-
"@stryke/cli": "^0.13.
|
|
364
|
-
"@stryke/convert": "^0.6.
|
|
365
|
-
"@stryke/fs": "^0.33.
|
|
366
|
-
"@stryke/helpers": "^0.
|
|
367
|
-
"@stryke/json": "^0.14.
|
|
368
|
-
"@stryke/path": "^0.
|
|
369
|
-
"@stryke/string-format": "^0.
|
|
370
|
-
"@stryke/type-checks": "^0.5.
|
|
371
|
-
"@stryke/types": "^0.
|
|
372
|
-
"@stryke/zod": "^0.3.
|
|
363
|
+
"@stryke/cli": "^0.13.35",
|
|
364
|
+
"@stryke/convert": "^0.6.56",
|
|
365
|
+
"@stryke/fs": "^0.33.63",
|
|
366
|
+
"@stryke/helpers": "^0.10.6",
|
|
367
|
+
"@stryke/json": "^0.14.10",
|
|
368
|
+
"@stryke/path": "^0.27.2",
|
|
369
|
+
"@stryke/string-format": "^0.17.6",
|
|
370
|
+
"@stryke/type-checks": "^0.5.41",
|
|
371
|
+
"@stryke/types": "^0.11.1",
|
|
372
|
+
"@stryke/zod": "^0.3.11",
|
|
373
373
|
"automd": "^0.4.3",
|
|
374
374
|
"defu": "^6.1.4",
|
|
375
375
|
"json-schema": "^0.4.0",
|
|
376
|
-
"powerlines": "^0.
|
|
377
|
-
"
|
|
376
|
+
"powerlines": "^0.41.20",
|
|
377
|
+
"tsdown": "^0.21.4"
|
|
378
378
|
},
|
|
379
379
|
"devDependencies": {
|
|
380
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
380
|
+
"@powerlines/plugin-plugin": "^0.12.306",
|
|
381
381
|
"@types/json-schema": "^7.0.15",
|
|
382
|
-
"@types/node": "^25.
|
|
382
|
+
"@types/node": "^25.5.0",
|
|
383
383
|
"typescript": "^5.9.3",
|
|
384
384
|
"zod": "^4.3.6"
|
|
385
385
|
},
|
|
386
386
|
"publishConfig": { "access": "public" },
|
|
387
|
-
"gitHead": "
|
|
387
|
+
"gitHead": "86c55189ed02d126fb583cf6d2555266f00d0f3a"
|
|
388
388
|
}
|