@shell-shock/core 0.13.7 → 0.13.9

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.
@@ -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 { getGlobalOptions } 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: getGlobalOptions(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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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"}
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 { getGlobalOptions } 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: getGlobalOptions(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 await Promise.all(\n ctx.input.context.inputs\n .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(\n (value, index) => value === ctx.input.command.segments[index]\n )\n )\n .map(async input => {\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\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":";;;;;;;;;;;;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;;;;;;AAOtD,eAAkB,QAAA,OAAA;CACd,MAAM,MAAI,OAAO,WAAY,IAAA,CAAA;QAAA;EAAA;EAAA;EAAA,CAAA,EAAA,WAAA,MAAA;AAC7B,KAAI,CAAC,IAAI,OAAO,WAAQ;AACpB,QAAM,mBAAmB,IAAA;AACzB,sBAAoB,IAAE;OAGtB,uBAAI,IAAA;AAER,QAAA,YAAA,IAAA;;AAEJ,QAAQ,SAAO;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
@@ -4,8 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const __ΩShellShockEnv = [
5
5
  "PATHEXT",
6
6
  "PATH",
7
+ "npm_config_user_agent",
8
+ "npm_execpath",
9
+ "comspec",
7
10
  "ShellShockEnv",
8
- "P&4!8&4\"8Mw#y"
11
+ "P&4!8&4\"8&4#8&4$8&4%8Mw&y"
9
12
  ];
10
13
 
11
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"env.cjs","names":[],"sources":["../../src/types/env.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\nexport interface ShellShockEnv {\n /**\n * The system PATHEXT variable, used to determine which file extensions are considered executable on Windows.\n *\n * @remarks\n * If not provided, it will default to '.EXE;.CMD;.BAT;.COM' on Windows, and will be ignored on other platforms. This variable is used to locate executable files when running commands, and is only relevant on Windows platforms. On non-Windows platforms, the system's executable file resolution will be used, and this variable will have no effect.\n */\n PATHEXT?: string;\n\n /**\n * The system PATH variable, used to locate executable files.\n */\n PATH?: string;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"env.cjs","names":[],"sources":["../../src/types/env.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\nexport interface ShellShockEnv {\n /**\n * The system PATHEXT variable, used to determine which file extensions are considered executable on Windows.\n *\n * @remarks\n * If not provided, it will default to '.EXE;.CMD;.BAT;.COM' on Windows, and will be ignored on other platforms. This variable is used to locate executable files when running commands, and is only relevant on Windows platforms. On non-Windows platforms, the system's executable file resolution will be used, and this variable will have no effect.\n *\n * @internal\n */\n PATHEXT?: string;\n\n /**\n * The system PATH variable, used to locate executable files.\n *\n * @internal\n */\n PATH?: string;\n\n /**\n * The npm user agent string, which can be used to detect if the environment is running within an npm script.\n *\n * @remarks\n * This variable is set by npm when running scripts defined in package.json. It can be used to conditionally adjust behavior when running within an npm script context, such as modifying logging output or adjusting command execution. If this variable is not set, it can be assumed that the environment is not running within an npm script.\n *\n * @internal\n */\n npm_config_user_agent?: string;\n\n /**\n * The npm execution path, which can be used to determine the location of the npm executable.\n *\n * @remarks\n * This variable is set by npm when running scripts defined in package.json. It provides the absolute path to the npm executable being used to run the script. This can be useful for resolving the location of npm or for debugging purposes. If this variable is not set, it may indicate that the environment is not running within an npm script context, or that npm is not available in the PATH.\n *\n * @internal\n */\n npm_execpath?: string;\n\n /**\n * The COMSPEC environment variable, which specifies the command-line interpreter to use on Windows.\n *\n * @remarks\n * This variable is used on Windows platforms to determine which command-line interpreter to use when executing commands. It typically points to cmd.exe, but can be customized by the user. If this variable is not set on Windows, it will default to 'cmd.exe'. On non-Windows platforms, this variable is ignored and has no effect on command execution.\n *\n * @internal\n */\n comspec?: string;\n}\n"],"mappings":""}
@@ -5,12 +5,43 @@ interface ShellShockEnv {
5
5
  *
6
6
  * @remarks
7
7
  * If not provided, it will default to '.EXE;.CMD;.BAT;.COM' on Windows, and will be ignored on other platforms. This variable is used to locate executable files when running commands, and is only relevant on Windows platforms. On non-Windows platforms, the system's executable file resolution will be used, and this variable will have no effect.
8
+ *
9
+ * @internal
8
10
  */
9
11
  PATHEXT?: string;
10
12
  /**
11
13
  * The system PATH variable, used to locate executable files.
14
+ *
15
+ * @internal
12
16
  */
13
17
  PATH?: string;
18
+ /**
19
+ * The npm user agent string, which can be used to detect if the environment is running within an npm script.
20
+ *
21
+ * @remarks
22
+ * This variable is set by npm when running scripts defined in package.json. It can be used to conditionally adjust behavior when running within an npm script context, such as modifying logging output or adjusting command execution. If this variable is not set, it can be assumed that the environment is not running within an npm script.
23
+ *
24
+ * @internal
25
+ */
26
+ npm_config_user_agent?: string;
27
+ /**
28
+ * The npm execution path, which can be used to determine the location of the npm executable.
29
+ *
30
+ * @remarks
31
+ * This variable is set by npm when running scripts defined in package.json. It provides the absolute path to the npm executable being used to run the script. This can be useful for resolving the location of npm or for debugging purposes. If this variable is not set, it may indicate that the environment is not running within an npm script context, or that npm is not available in the PATH.
32
+ *
33
+ * @internal
34
+ */
35
+ npm_execpath?: string;
36
+ /**
37
+ * The COMSPEC environment variable, which specifies the command-line interpreter to use on Windows.
38
+ *
39
+ * @remarks
40
+ * This variable is used on Windows platforms to determine which command-line interpreter to use when executing commands. It typically points to cmd.exe, but can be customized by the user. If this variable is not set on Windows, it will default to 'cmd.exe'. On non-Windows platforms, this variable is ignored and has no effect on command execution.
41
+ *
42
+ * @internal
43
+ */
44
+ comspec?: string;
14
45
  }
15
46
  //#endregion
16
47
  export { ShellShockEnv };
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.cts","names":[],"sources":["../../src/types/env.ts"],"mappings":";UAkBiB,aAAA;EAAA;;;;;;EAOf,OAAA;;;;EAKA,IAAA;AAAA"}
1
+ {"version":3,"file":"env.d.cts","names":[],"sources":["../../src/types/env.ts"],"mappings":";UAkBiB,aAAA;EAAA;;;;;;;;EASf,OAAA;EAqCO;;;;;EA9BP,IAAA;;;;;;;;;EAUA,qBAAA;;;;;;;;;EAUA,YAAA;;;;;;;;;EAUA,OAAA;AAAA"}
@@ -5,12 +5,43 @@ interface ShellShockEnv {
5
5
  *
6
6
  * @remarks
7
7
  * If not provided, it will default to '.EXE;.CMD;.BAT;.COM' on Windows, and will be ignored on other platforms. This variable is used to locate executable files when running commands, and is only relevant on Windows platforms. On non-Windows platforms, the system's executable file resolution will be used, and this variable will have no effect.
8
+ *
9
+ * @internal
8
10
  */
9
11
  PATHEXT?: string;
10
12
  /**
11
13
  * The system PATH variable, used to locate executable files.
14
+ *
15
+ * @internal
12
16
  */
13
17
  PATH?: string;
18
+ /**
19
+ * The npm user agent string, which can be used to detect if the environment is running within an npm script.
20
+ *
21
+ * @remarks
22
+ * This variable is set by npm when running scripts defined in package.json. It can be used to conditionally adjust behavior when running within an npm script context, such as modifying logging output or adjusting command execution. If this variable is not set, it can be assumed that the environment is not running within an npm script.
23
+ *
24
+ * @internal
25
+ */
26
+ npm_config_user_agent?: string;
27
+ /**
28
+ * The npm execution path, which can be used to determine the location of the npm executable.
29
+ *
30
+ * @remarks
31
+ * This variable is set by npm when running scripts defined in package.json. It provides the absolute path to the npm executable being used to run the script. This can be useful for resolving the location of npm or for debugging purposes. If this variable is not set, it may indicate that the environment is not running within an npm script context, or that npm is not available in the PATH.
32
+ *
33
+ * @internal
34
+ */
35
+ npm_execpath?: string;
36
+ /**
37
+ * The COMSPEC environment variable, which specifies the command-line interpreter to use on Windows.
38
+ *
39
+ * @remarks
40
+ * This variable is used on Windows platforms to determine which command-line interpreter to use when executing commands. It typically points to cmd.exe, but can be customized by the user. If this variable is not set on Windows, it will default to 'cmd.exe'. On non-Windows platforms, this variable is ignored and has no effect on command execution.
41
+ *
42
+ * @internal
43
+ */
44
+ comspec?: string;
14
45
  }
15
46
  //#endregion
16
47
  export { ShellShockEnv };
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.mts","names":[],"sources":["../../src/types/env.ts"],"mappings":";UAkBiB,aAAA;EAAA;;;;;;EAOf,OAAA;;;;EAKA,IAAA;AAAA"}
1
+ {"version":3,"file":"env.d.mts","names":[],"sources":["../../src/types/env.ts"],"mappings":";UAkBiB,aAAA;EAAA;;;;;;;;EASf,OAAA;EAqCO;;;;;EA9BP,IAAA;;;;;;;;;EAUA,qBAAA;;;;;;;;;EAUA,YAAA;;;;;;;;;EAUA,OAAA;AAAA"}
@@ -2,8 +2,11 @@
2
2
  const __ΩShellShockEnv = [
3
3
  "PATHEXT",
4
4
  "PATH",
5
+ "npm_config_user_agent",
6
+ "npm_execpath",
7
+ "comspec",
5
8
  "ShellShockEnv",
6
- "P&4!8&4\"8Mw#y"
9
+ "P&4!8&4\"8&4#8&4$8&4%8Mw&y"
7
10
  ];
8
11
 
9
12
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"env.mjs","names":[],"sources":["../../src/types/env.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\nexport interface ShellShockEnv {\n /**\n * The system PATHEXT variable, used to determine which file extensions are considered executable on Windows.\n *\n * @remarks\n * If not provided, it will default to '.EXE;.CMD;.BAT;.COM' on Windows, and will be ignored on other platforms. This variable is used to locate executable files when running commands, and is only relevant on Windows platforms. On non-Windows platforms, the system's executable file resolution will be used, and this variable will have no effect.\n */\n PATHEXT?: string;\n\n /**\n * The system PATH variable, used to locate executable files.\n */\n PATH?: string;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"env.mjs","names":[],"sources":["../../src/types/env.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\nexport interface ShellShockEnv {\n /**\n * The system PATHEXT variable, used to determine which file extensions are considered executable on Windows.\n *\n * @remarks\n * If not provided, it will default to '.EXE;.CMD;.BAT;.COM' on Windows, and will be ignored on other platforms. This variable is used to locate executable files when running commands, and is only relevant on Windows platforms. On non-Windows platforms, the system's executable file resolution will be used, and this variable will have no effect.\n *\n * @internal\n */\n PATHEXT?: string;\n\n /**\n * The system PATH variable, used to locate executable files.\n *\n * @internal\n */\n PATH?: string;\n\n /**\n * The npm user agent string, which can be used to detect if the environment is running within an npm script.\n *\n * @remarks\n * This variable is set by npm when running scripts defined in package.json. It can be used to conditionally adjust behavior when running within an npm script context, such as modifying logging output or adjusting command execution. If this variable is not set, it can be assumed that the environment is not running within an npm script.\n *\n * @internal\n */\n npm_config_user_agent?: string;\n\n /**\n * The npm execution path, which can be used to determine the location of the npm executable.\n *\n * @remarks\n * This variable is set by npm when running scripts defined in package.json. It provides the absolute path to the npm executable being used to run the script. This can be useful for resolving the location of npm or for debugging purposes. If this variable is not set, it may indicate that the environment is not running within an npm script context, or that npm is not available in the PATH.\n *\n * @internal\n */\n npm_execpath?: string;\n\n /**\n * The COMSPEC environment variable, which specifies the command-line interpreter to use on Windows.\n *\n * @remarks\n * This variable is used on Windows platforms to determine which command-line interpreter to use when executing commands. It typically points to cmd.exe, but can be customized by the user. If this variable is not set on Windows, it will default to 'cmd.exe'. On non-Windows platforms, this variable is ignored and has no effect on command execution.\n *\n * @internal\n */\n comspec?: string;\n}\n"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/core",
3
- "version": "0.13.7",
3
+ "version": "0.13.9",
4
4
  "private": false,
5
5
  "description": "A package containing the core Shell Shock functionality used to build and manage a command-line application.",
6
6
  "keywords": ["shell-shock", "powerlines", "storm-software"],
@@ -350,39 +350,39 @@
350
350
  "@alloy-js/core": "0.23.0-dev.8",
351
351
  "@alloy-js/markdown": "0.23.0-dev.1",
352
352
  "@alloy-js/typescript": "0.23.0-dev.4",
353
- "@powerlines/deepkit": "^0.6.148",
354
- "@powerlines/plugin-alloy": "^0.25.56",
355
- "@powerlines/plugin-automd": "^0.1.369",
356
- "@powerlines/plugin-deepkit": "^0.11.248",
357
- "@powerlines/plugin-nodejs": "^0.1.292",
358
- "@powerlines/plugin-tsdown": "^0.1.317",
353
+ "@powerlines/deepkit": "^0.6.160",
354
+ "@powerlines/plugin-alloy": "^0.25.68",
355
+ "@powerlines/plugin-automd": "^0.1.381",
356
+ "@powerlines/plugin-deepkit": "^0.11.260",
357
+ "@powerlines/plugin-nodejs": "^0.1.304",
358
+ "@powerlines/plugin-tsdown": "^0.1.323",
359
359
  "@standard-schema/spec": "^1.1.0",
360
360
  "@standard-schema/utils": "^0.3.0",
361
- "@stryke/cli": "^0.13.35",
362
- "@stryke/convert": "^0.6.56",
363
- "@stryke/fs": "^0.33.63",
364
- "@stryke/helpers": "^0.10.6",
365
- "@stryke/json": "^0.14.10",
366
- "@stryke/path": "^0.27.2",
367
- "@stryke/string-format": "^0.17.6",
368
- "@stryke/type-checks": "^0.5.41",
369
- "@stryke/types": "^0.11.1",
370
- "@stryke/zod": "^0.3.11",
361
+ "@stryke/cli": "^0.13.36",
362
+ "@stryke/convert": "^0.6.57",
363
+ "@stryke/fs": "^0.33.64",
364
+ "@stryke/helpers": "^0.10.7",
365
+ "@stryke/json": "^0.14.11",
366
+ "@stryke/path": "^0.27.3",
367
+ "@stryke/string-format": "^0.17.7",
368
+ "@stryke/type-checks": "^0.6.0",
369
+ "@stryke/types": "^0.11.2",
370
+ "@stryke/zod": "^0.3.12",
371
371
  "automd": "^0.4.3",
372
372
  "defu": "^6.1.4",
373
373
  "json-schema": "^0.4.0",
374
- "tsdown": "^0.21.4"
374
+ "tsdown": "^0.21.5"
375
375
  },
376
376
  "devDependencies": {
377
- "@powerlines/plugin-plugin": "^0.12.320",
377
+ "@powerlines/plugin-plugin": "^0.12.332",
378
378
  "@types/json-schema": "^7.0.15",
379
379
  "@types/node": "^25.5.0",
380
- "powerlines": "^0.42.10",
380
+ "powerlines": "^0.42.22",
381
381
  "typescript": "^5.9.3",
382
382
  "zod": "^4.3.6"
383
383
  },
384
384
  "peerDependencies": { "powerlines": ">=0.42.10", "zod": "^3.25.0 || ^4.0.0" },
385
385
  "peerDependenciesMeta": { "zod": { "optional": true } },
386
386
  "publishConfig": { "access": "public" },
387
- "gitHead": "bcec2ffe57f7284d7726461908827541dc907a23"
387
+ "gitHead": "036578a29fdeedf3a93c53a1ea4cf0a180b8f5bb"
388
388
  }
@@ -1,3 +0,0 @@
1
- import "node:module";
2
-
3
- export { };