@pmate/cli 0.35.4 → 0.35.5

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/index.js CHANGED
@@ -17567,8 +17567,8 @@ async function buildDesktop(args) {
17567
17567
  const icon = import_node_path23.default.resolve(base, c.icon);
17568
17568
  const output = import_node_path23.default.resolve(args.outDir);
17569
17569
  if (!(0, import_node_fs18.existsSync)(icon) || !(0, import_node_fs18.statSync)(icon).isFile()) throw new Error(`Desktop icon not found: ${icon}`);
17570
- if (args.platform !== "mac" || !["arm64", "x64"].includes(args.arch)) throw new Error("This release supports mac --arch arm64|x64; Windows/Linux are not yet supported");
17571
- if (process.platform !== "darwin") throw new Error("macOS desktop packaging requires a macOS build host");
17570
+ if (!["mac", "win"].includes(args.platform) || !["arm64", "x64"].includes(args.arch)) throw new Error("Supported target: mac|win --arch arm64|x64");
17571
+ if (args.platform === "mac" && process.platform !== "darwin") throw new Error("macOS desktop packaging requires a macOS build host");
17572
17572
  const within = (parent, child) => {
17573
17573
  const rel = import_node_path23.default.relative(parent, child);
17574
17574
  return !rel || !rel.startsWith("..") && !import_node_path23.default.isAbsolute(rel);
@@ -17614,12 +17614,13 @@ async function buildDesktop(args) {
17614
17614
  asar: true,
17615
17615
  artifactName: "${productName}-${version}-${arch}.${ext}",
17616
17616
  mac: { icon, target: args.dir ? ["dir"] : ["dmg", "zip"], category: "public.app-category.social-networking", hardenedRuntime: args.signed, extendInfo: { NSMicrophoneUsageDescription: `${c.productName} uses your microphone for voice calls and voice messages.` }, ...args.signed ? {} : { identity: "-", notarize: false } },
17617
+ win: { icon, target: args.dir ? ["dir"] : ["nsis", "zip"], ...args.signed ? {} : { signExecutable: false } },
17617
17618
  forceCodeSigning: args.signed
17618
17619
  };
17619
17620
  const configPath = import_node_path23.default.join(staging, "builder.json");
17620
17621
  (0, import_node_fs18.writeFileSync)(configPath, JSON.stringify(builderConfig));
17621
- await runBuildCommand([process.execPath, import_node_path23.default.join(cache, "node_modules", "electron-builder", "cli.js"), "--config", configPath, "--mac", `--${args.arch}`, "--publish", "never"], appDir, { ...process.env, ...args.signed ? {} : { CSC_IDENTITY_AUTO_DISCOVERY: "false" } });
17622
- const result = { ...plan, signature: args.signed ? "configured-signing-required; verify notarization before distribution" : "ad-hoc; local development", artifacts: import_node_path23.default.join(staging, "artifacts"), resources: manifest };
17622
+ await runBuildCommand([process.execPath, import_node_path23.default.join(cache, "node_modules", "electron-builder", "cli.js"), "--config", configPath, args.platform === "mac" ? "--mac" : "--win", `--${args.arch}`, "--publish", "never"], appDir, { ...process.env, ...args.signed ? {} : { CSC_IDENTITY_AUTO_DISCOVERY: "false" } });
17623
+ const result = { ...plan, signature: args.signed ? args.platform === "mac" ? "configured-signing-required; verify notarization before distribution" : "configured-signing-required; verify Authenticode before distribution" : args.platform === "mac" ? "ad-hoc; local development" : "unsigned; local development", artifacts: import_node_path23.default.join(staging, "artifacts"), resources: manifest };
17623
17624
  (0, import_node_fs18.writeFileSync)(import_node_path23.default.join(staging, "build-report.json"), JSON.stringify(result, null, 2));
17624
17625
  console.log(JSON.stringify({ phase: "complete", report: import_node_path23.default.join(staging, "build-report.json"), artifacts: result.artifacts, signature: result.signature }, null, 2));
17625
17626
  }
@@ -23466,9 +23467,9 @@ function parseAppArgs(tokens) {
23466
23467
  } else throw new Error(`Unknown app build option: ${key}`);
23467
23468
  }
23468
23469
  if (options["--target"] !== "electron" || !options["--config"]) throw new Error("Use app build <ns:app> --target electron --config <file>");
23469
- const platform = options["--platform"] ?? (process.platform === "darwin" ? "mac" : process.platform);
23470
+ const platform = options["--platform"] ?? (process.platform === "darwin" ? "mac" : process.platform === "win32" ? "win" : process.platform);
23470
23471
  const arch = options["--arch"] ?? process.arch;
23471
- if (platform !== "mac" || !["arm64", "x64"].includes(arch)) throw new Error("Supported target: --platform mac --arch arm64|x64");
23472
+ if (!["mac", "win"].includes(platform) || !["arm64", "x64"].includes(arch)) throw new Error("Supported target: --platform mac|win --arch arm64|x64");
23472
23473
  return { type: "app" /* App */, action, id, target: "electron", config: options["--config"], platform, arch, outDir: options["--out-dir"] ?? "release/desktop", dryRun: switches.has("--dry-run"), signed: switches.has("--signed"), dir: switches.has("--dir"), json: switches.has("--json") };
23473
23474
  }
23474
23475
  let baseUrl;
@@ -9,6 +9,7 @@ const { createDesktopCalls } = require('./calls.cjs')
9
9
  const config = require('./desktop-config.json')
10
10
  const manifest = require('./resource-manifest.json')
11
11
  app.setName(config.productName)
12
+ if (process.platform === 'win32') app.setAppUserModelId(config.bundleId)
12
13
  // Stable across installer versions; separate from every other packaged PMate app.
13
14
  app.setPath('userData', path.join(app.getPath('appData'), config.bundleId))
14
15
  const allowedNavigation = new Set([config.origin, ...config.authOrigins])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.35.4",
3
+ "version": "0.35.5",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {