mano-coding 0.1.26 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bin.js +34 -7
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -32036,6 +32036,22 @@ function resolveTaskExecutable(command, platform = process.platform, envPath) {
32036
32036
  }
32037
32037
  return command;
32038
32038
  }
32039
+ function prepareSpawnCommand(executable, args, platform = process.platform, comSpec = process.env.ComSpec ?? "cmd.exe") {
32040
+ const isWindowsBatch = platform === "win32" && /\.(cmd|bat)$/i.test(executable);
32041
+ if (!isWindowsBatch) {
32042
+ return {
32043
+ executable,
32044
+ args: [...args]
32045
+ };
32046
+ }
32047
+ const escapedArgs = args.map(
32048
+ (arg) => /[\s&|<>()^%!]/u.test(arg) ? `"${arg.replaceAll('"', '""')}"` : arg
32049
+ );
32050
+ return {
32051
+ executable: comSpec,
32052
+ args: ["/d", "/c", [executable, ...escapedArgs].join(" ")]
32053
+ };
32054
+ }
32039
32055
  async function executeTasks(tasks, ctx, options = {}) {
32040
32056
  if (tasks.length === 0) return;
32041
32057
  const stdio = options.stdio ?? "inherit";
@@ -32069,9 +32085,14 @@ async function executeTasks(tasks, ctx, options = {}) {
32069
32085
  if (options.onProgress) {
32070
32086
  options.onProgress(`\u6B63\u5728\u6267\u884C\u4EFB\u52A1 [${i + 1}/${tasks.length}] (${taskLabel}): ${command} ${effectiveArgs.join(" ")}`);
32071
32087
  }
32072
- const executable = resolveTaskExecutable(command, process.platform, env.PATH);
32088
+ const rawExecutable = resolveTaskExecutable(command, process.platform, env.PATH);
32089
+ const { executable, args: spawnArgs } = prepareSpawnCommand(
32090
+ rawExecutable,
32091
+ effectiveArgs,
32092
+ process.platform
32093
+ );
32073
32094
  await new Promise((resolve22, reject) => {
32074
- const child = spawn(executable, effectiveArgs, {
32095
+ const child = spawn(executable, spawnArgs, {
32075
32096
  cwd,
32076
32097
  env,
32077
32098
  stdio,
@@ -33676,6 +33697,7 @@ __export(src_exports, {
33676
33697
  parseTomlSelector: () => parseTomlSelector,
33677
33698
  planPluginDelivery: () => planPluginDelivery,
33678
33699
  prepareJournalRecovery: () => prepareJournalRecovery,
33700
+ prepareSpawnCommand: () => prepareSpawnCommand,
33679
33701
  prepareUserDataRecovery: () => prepareUserDataRecovery,
33680
33702
  readVariantJson: () => readVariantJson,
33681
33703
  recoverJournal: () => recoverJournal,
@@ -39623,8 +39645,8 @@ function collectTargetCandidates(manifests) {
39623
39645
  const seen = /* @__PURE__ */ new Set();
39624
39646
  const candidates = [];
39625
39647
  for (const manifest of manifests) {
39626
- for (const target of manifest.targets) {
39627
- if (!seen.has(target.id)) {
39648
+ for (const target of manifest?.targets ?? []) {
39649
+ if (target?.id && !seen.has(target.id)) {
39628
39650
  seen.add(target.id);
39629
39651
  candidates.push({ id: target.id, label: target.id });
39630
39652
  }
@@ -41912,8 +41934,13 @@ async function executeLaunch(launcherArgs) {
41912
41934
  resolved.installation["version"]
41913
41935
  );
41914
41936
  const cmd = resolved.command;
41915
- const child = spawn2(cmd.executable, [...cmd.args, ...resolved.passthroughArgs], {
41916
- stdio: "inherit"
41937
+ const rawExecutable = resolveTaskExecutable(cmd.executable, process.platform);
41938
+ const rawArgs = [...cmd.args, ...resolved.passthroughArgs];
41939
+ const { executable, args } = prepareSpawnCommand(rawExecutable, rawArgs, process.platform);
41940
+ const child = spawn2(executable, args, {
41941
+ stdio: "inherit",
41942
+ shell: false,
41943
+ windowsHide: true
41917
41944
  });
41918
41945
  const heartbeatTimer = setInterval(() => {
41919
41946
  void heartbeatLease(lease).catch(() => {
@@ -42277,7 +42304,7 @@ import { createRequire as createRequire2 } from "node:module";
42277
42304
  import { readFileSync as readFileSync4 } from "node:fs";
42278
42305
  import { fileURLToPath as fileURLToPath5 } from "node:url";
42279
42306
  function resolveVersion() {
42280
- if (true) return "0.1.26";
42307
+ if (true) return "0.1.28";
42281
42308
  const candidates = [
42282
42309
  new URL("../package.json", import.meta.url),
42283
42310
  new URL("../../package.json", import.meta.url),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mano-coding",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "Mano Coding CLI and toolchain",
5
5
  "type": "module",
6
6
  "main": "index.js",