muon-ui 0.7.0 → 0.8.0

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 (43) hide show
  1. package/README.md +1 -0
  2. package/dist/cli.cjs +269 -120
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/index.cjs +2 -2
  5. package/dist/index.mjs +2 -2
  6. package/dist/native/linux-amd64/muon-bootstrap +0 -0
  7. package/dist/native/linux-amd64/muon-builder +0 -0
  8. package/dist/native/linux-arm64/muon-bootstrap +0 -0
  9. package/dist/native/linux-arm64/{muon-prepare → muon-builder} +0 -0
  10. package/dist/native/linux-armhf/muon-bootstrap +0 -0
  11. package/dist/native/linux-armhf/{muon-prepare → muon-builder} +0 -0
  12. package/dist/native/muon-bootstrap.png +0 -0
  13. package/dist/native/windows-amd64/muon-bootstrap.exe +0 -0
  14. package/dist/native/windows-amd64/muon-builder.exe +0 -0
  15. package/dist/native/windows-i686/muon-bootstrap.exe +0 -0
  16. package/dist/native/windows-i686/muon-builder.exe +0 -0
  17. package/dist/runtime/linux-amd64/CREDITS.md +24 -0
  18. package/dist/runtime/linux-amd64/muon-core +0 -0
  19. package/dist/runtime/linux-arm64/CREDITS.md +24 -0
  20. package/dist/runtime/linux-arm64/muon-core +0 -0
  21. package/dist/runtime/linux-armhf/CREDITS.md +24 -0
  22. package/dist/runtime/linux-armhf/muon-core +0 -0
  23. package/dist/runtime/windows-amd64/CREDITS.md +24 -0
  24. package/dist/runtime/windows-amd64/libcardio.dll +0 -0
  25. package/dist/runtime/windows-amd64/libmuon-ui.dll +0 -0
  26. package/dist/runtime/windows-amd64/muon-core.exe +0 -0
  27. package/dist/runtime/windows-i686/CREDITS.md +24 -0
  28. package/dist/runtime/windows-i686/libcardio.dll +0 -0
  29. package/dist/runtime/windows-i686/libmuon-ui.dll +0 -0
  30. package/dist/runtime/windows-i686/muon-core.exe +0 -0
  31. package/dist/{vite-options-FFh0NWUa.cjs → vite-internals-ChWiL2TL.cjs} +1225 -102
  32. package/dist/vite-internals-ChWiL2TL.cjs.map +1 -0
  33. package/dist/vite.cjs +10 -8
  34. package/dist/vite.cjs.map +1 -1
  35. package/dist/vite.mjs +876 -49
  36. package/dist/vite.mjs.map +1 -1
  37. package/muon.d.ts +129 -27
  38. package/package.json +14 -10
  39. package/vite.d.ts +165 -13
  40. package/dist/native/linux-amd64/muon-prepare +0 -0
  41. package/dist/native/windows-amd64/muon-prepare.exe +0 -0
  42. package/dist/native/windows-i686/muon-prepare.exe +0 -0
  43. package/dist/vite-options-FFh0NWUa.cjs.map +0 -1
package/dist/cli.cjs CHANGED
@@ -1,23 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  /*!
3
3
  * name: muon-ui
4
- * version: 0.7.0
4
+ * version: 0.8.0
5
5
  * description: A multi-platform GUI application framework that uses CEF as its backend
6
6
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
7
7
  * license: MIT
8
8
  * repository.url: https://github.com/kekyo/muon-ui.git
9
- * git.commit.hash: fe80718aaa617c0c0ea5c816bbe38d22bf2e8402
9
+ * git.commit.hash: 9bb6148e155dab16c4ca441073b144e21981b038
10
10
  */
11
- const require_vite_options = require("./vite-options-FFh0NWUa.cjs");
11
+ const require_vite_internals = require("./vite-internals-ChWiL2TL.cjs");
12
12
  let commander = require("commander");
13
13
  let node_child_process = require("node:child_process");
14
14
  let node_fs = require("node:fs");
15
15
  let node_fs_promises = require("node:fs/promises");
16
16
  let node_path = require("node:path");
17
17
  let adm_zip = require("adm-zip");
18
- adm_zip = require_vite_options.__toESM(adm_zip, 1);
18
+ adm_zip = require_vite_internals.__toESM(adm_zip, 1);
19
+ let tar_vern = require("tar-vern");
19
20
  //#region src/dev.ts
20
- var import_dist = require_vite_options.require_dist();
21
+ var import_dist = require_vite_internals.require_dist();
21
22
  var muonRecycleExitCode = 88;
22
23
  var defaultProjectConfigFileNames = [
23
24
  "muon.json5",
@@ -41,16 +42,16 @@ var directoryExists = async (path) => {
41
42
  return false;
42
43
  }
43
44
  };
44
- var isMissingVitePackageError$1 = (error) => {
45
+ var isMissingVitePackageError = (error) => {
45
46
  const candidate = error;
46
47
  return candidate.code === "ERR_MODULE_NOT_FOUND" && typeof candidate.message === "string" && candidate.message.includes("vite");
47
48
  };
48
- var loadViteMuonOptions$1 = async (cwd) => {
49
+ var loadViteMuonOptions = async (cwd) => {
49
50
  let vite;
50
51
  try {
51
52
  vite = await import("vite");
52
53
  } catch (error) {
53
- if (isMissingVitePackageError$1(error)) return {
54
+ if (isMissingVitePackageError(error)) return {
54
55
  root: (0, node_path.resolve)(cwd),
55
56
  pluginOptions: void 0
56
57
  };
@@ -68,7 +69,7 @@ var loadViteMuonOptions$1 = async (cwd) => {
68
69
  };
69
70
  const config = loaded.config;
70
71
  const root = typeof config.root === "string" ? (0, node_path.resolve)(cwd, config.root) : (0, node_path.resolve)(cwd);
71
- const muonPlugins = (await require_vite_options.flattenVitePluginOptions(config.plugins)).map((plugin) => require_vite_options.getMuonVitePluginOptions(plugin)).filter((pluginOptions) => pluginOptions !== void 0);
72
+ const muonPlugins = (await require_vite_internals.flattenVitePluginOptions(config.plugins)).map((plugin) => require_vite_internals.getMuonVitePluginOptions(plugin)).filter((pluginOptions) => pluginOptions !== void 0);
72
73
  if (muonPlugins.length > 1) throw new Error("Multiple muon() plugin definitions were found in vite.config.*.");
73
74
  return {
74
75
  root,
@@ -197,14 +198,14 @@ var runMuonExecutable = async (muonExecutablePath, configPaths, environment) =>
197
198
  * @returns Development startup result after the Muon process exits.
198
199
  */
199
200
  var runMuonDev = async (options = {}) => {
200
- const loadedViteOptions = await loadViteMuonOptions$1((0, node_path.resolve)(options.root ?? process.cwd()));
201
+ const loadedViteOptions = await loadViteMuonOptions((0, node_path.resolve)(options.root ?? process.cwd()));
201
202
  const root = loadedViteOptions.root;
202
203
  const pluginOptions = loadedViteOptions.pluginOptions;
203
204
  const platform = options.platform ?? process.platform;
204
205
  const architecture = options.architecture ?? process.arch;
205
206
  const environment = options.environment ?? process.env;
206
- const target = require_vite_options.getDefaultMuonPrepareTarget(platform, architecture);
207
- const muonPath = require_vite_options.resolveMuonRuntimePath({
207
+ const target = require_vite_internals.getDefaultMuonPrepareTarget(platform, architecture);
208
+ const muonPath = require_vite_internals.resolveMuonRuntimePath({
208
209
  root,
209
210
  target,
210
211
  muonPath: options.muonPath ?? pluginOptions?.muonPath
@@ -215,8 +216,8 @@ var runMuonDev = async (options = {}) => {
215
216
  const projectConfig = await resolveProjectConfig(root, options.configPath);
216
217
  const asset = await resolveAssetSource(root, options.assetSourcePath, projectConfig);
217
218
  const overrideConfigPath = (0, node_path.join)(root, ".muon", "dev", "muon.dev.json");
218
- await require_vite_options.ensureMuonGitignoreEntry(root);
219
- const preparedRuntime = await require_vite_options.runMuonPrepare({
219
+ await require_vite_internals.ensureMuonGitignoreEntry(root);
220
+ const preparedRuntime = await require_vite_internals.runMuonPrepare({
220
221
  muonPath,
221
222
  cefPath,
222
223
  stageDir: stagePath,
@@ -228,9 +229,9 @@ var runMuonDev = async (options = {}) => {
228
229
  environment,
229
230
  cwd: root
230
231
  });
231
- if (preparedRuntime.stagePath === void 0) throw new Error("muon-prepare did not return a staged runtime path.");
232
+ if (preparedRuntime.stagePath === void 0) throw new Error("muon-builder did not return a staged runtime path.");
232
233
  await writeMuonDevOverrideConfig(overrideConfigPath, createMuonDevOverrideConfig(asset.overrideAssetSourcePath, enableDebugger));
233
- const muonExecutablePath = require_vite_options.getMuonExecutablePath(preparedRuntime.stagePath, platform);
234
+ const muonExecutablePath = require_vite_internals.getMuonExecutablePath(preparedRuntime.stagePath, platform);
234
235
  const exitCode = await runMuonExecutable(muonExecutablePath, [...projectConfig.configPath === void 0 ? [] : [projectConfig.configPath], overrideConfigPath], environment);
235
236
  return {
236
237
  root,
@@ -269,47 +270,13 @@ function __resolveDefaultExport(module, isESM) {
269
270
  }
270
271
  var supportedPackTypes = [
271
272
  "zip",
273
+ "tar.gz",
272
274
  "deb",
273
275
  "nsis"
274
276
  ];
275
277
  var defaultArtifactsDirectory = "artifacts";
276
278
  var defaultPackageBuildDirectory = ".muon/pack";
277
- var suppressViteMuonBuildEnvironmentKey = "MUON_SUPPRESS_VITE_MUON_BUILD";
278
279
  var isJsonObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
279
- var isMissingVitePackageError = (error) => {
280
- const candidate = error;
281
- return candidate.code === "ERR_MODULE_NOT_FOUND" && typeof candidate.message === "string" && candidate.message.includes("vite");
282
- };
283
- var loadViteMuonOptions = async (cwd) => {
284
- let vite;
285
- try {
286
- vite = await import("vite");
287
- } catch (error) {
288
- if (isMissingVitePackageError(error)) return {
289
- root: (0, node_path.resolve)(cwd),
290
- pluginOptions: void 0
291
- };
292
- throw error;
293
- }
294
- const loaded = await vite.loadConfigFromFile({
295
- command: "build",
296
- mode: "production",
297
- isPreview: false,
298
- isSsrBuild: false
299
- }, void 0, cwd, "silent");
300
- if (loaded === null) return {
301
- root: (0, node_path.resolve)(cwd),
302
- pluginOptions: void 0
303
- };
304
- const config = loaded.config;
305
- const root = typeof config.root === "string" ? (0, node_path.resolve)(cwd, config.root) : (0, node_path.resolve)(cwd);
306
- const muonPlugins = (await require_vite_options.flattenVitePluginOptions(config.plugins)).map((plugin) => require_vite_options.getMuonVitePluginOptions(plugin)).filter((pluginOptions) => pluginOptions !== void 0);
307
- if (muonPlugins.length > 1) throw new Error("Multiple muon() plugin definitions were found in vite.config.*.");
308
- return {
309
- root,
310
- pluginOptions: muonPlugins[0]
311
- };
312
- };
313
280
  var readJsonObjectFile = async (path) => {
314
281
  const parsed = (0, import_dist.parse)(await (0, node_fs_promises.readFile)(path, "utf8"));
315
282
  if (!isJsonObject(parsed)) throw new Error(`JSON file must contain an object: ${path}`);
@@ -341,51 +308,63 @@ var resolveMetadata = (packageJson, options) => {
341
308
  author
342
309
  };
343
310
  };
311
+ var createPackMetadataPackageJson = (packageJson, metadata) => ({
312
+ ...packageJson,
313
+ version: metadata.version
314
+ });
344
315
  var normalizePackTypes = (types) => {
345
- const normalized = types.flatMap((value) => value.split(",")).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);
316
+ if (types === void 0) return [...supportedPackTypes];
317
+ const normalized = types.flatMap((value) => value.split(",")).map((value) => value.trim().toLowerCase()).map((value) => value === "tgz" ? "tar.gz" : value).filter((value) => value.length > 0);
346
318
  if (normalized.length === 0) throw new Error("Specify at least one package type with --type.");
347
319
  for (const type of normalized) if (!supportedPackTypes.includes(type)) throw new Error(`Unsupported muon pack type: ${type}`);
348
320
  return [...new Set(normalized)];
349
321
  };
350
- var getPluginBuildOptions = (pluginOptions) => {
351
- return typeof pluginOptions?.build === "object" ? pluginOptions.build : {};
352
- };
353
- var resolveBuildOutputDirectory = async (root) => {
354
- const resolved = await (await import("vite")).resolveConfig({ root }, "build", "production", "production");
355
- return (0, node_path.isAbsolute)(resolved.build.outDir) ? resolved.build.outDir : (0, node_path.resolve)(resolved.root, resolved.build.outDir);
356
- };
357
- var runViteBuild = async (root, _environment) => {
358
- const vite = await import("vite");
359
- const previous = process.env[suppressViteMuonBuildEnvironmentKey];
360
- process.env[suppressViteMuonBuildEnvironmentKey] = "1";
361
- try {
362
- await vite.build({ root });
363
- } finally {
364
- if (previous === void 0) delete process.env[suppressViteMuonBuildEnvironmentKey];
365
- else process.env[suppressViteMuonBuildEnvironmentKey] = previous;
366
- }
367
- };
368
- var createBuildOptions = (root, assetSourcePath, pluginBuildOptions, options) => {
369
- const buildOptions = {
370
- root,
371
- assetSourcePath,
372
- assetPrefix: "main"
373
- };
374
- Object.assign(buildOptions, pluginBuildOptions);
375
- if (options.targets !== void 0 && options.targets.length > 0) {
376
- buildOptions.targets = options.targets;
377
- buildOptions.allTargets = false;
378
- } else if (options.allTargets !== void 0) buildOptions.allTargets = options.allTargets;
379
- if (options.configPath !== void 0) buildOptions.configPath = options.configPath;
380
- if (options.appName !== void 0) buildOptions.appName = options.appName;
381
- if (options.appId !== void 0) buildOptions.appId = options.appId;
382
- if (options.packageDirectory !== void 0) buildOptions.packageDirectory = options.packageDirectory;
383
- return buildOptions;
384
- };
385
- var assertPackTypeSupportsTarget = (type, target) => {
386
- const descriptor = require_vite_options.getMuonTargetDescriptor(target);
387
- if (type === "deb" && descriptor.os !== "linux") throw new Error("deb packaging supports only Linux targets.");
388
- if (type === "nsis" && descriptor.os !== "windows") throw new Error("nsis packaging supports only Windows targets.");
322
+ var packTargetSelectorTargets = {
323
+ linux: [
324
+ "linux-amd64",
325
+ "linux-armhf",
326
+ "linux-arm64"
327
+ ],
328
+ windows: ["windows-i686", "windows-amd64"],
329
+ amd64: ["linux-amd64", "windows-amd64"],
330
+ arm64: ["linux-arm64"],
331
+ armhf: ["linux-armhf"],
332
+ i686: ["windows-i686"]
333
+ };
334
+ var normalizePackTargetSelector = (selector) => {
335
+ const normalized = selector.trim().toLowerCase();
336
+ if (require_vite_internals.allMuonTargets.includes(normalized)) return [normalized];
337
+ const targets = packTargetSelectorTargets[normalized];
338
+ if (targets !== void 0) return targets;
339
+ throw new Error(`Unsupported muon pack target selector: ${selector}`);
340
+ };
341
+ var normalizePackTargetSelectors = (selectors) => {
342
+ const targets = selectors.flatMap((selector) => selector.split(",")).map((selector) => selector.trim()).filter((selector) => selector.length > 0).flatMap((selector) => normalizePackTargetSelector(selector));
343
+ return [...new Set(targets)];
344
+ };
345
+ var normalizePluginBuildTargets = (targets) => {
346
+ return [...new Set(targets.map((target) => require_vite_internals.normalizeMuonTarget(target, "muon pack target")))];
347
+ };
348
+ var resolvePackTargetCandidates = (options, pluginBuildOptions) => {
349
+ if (options.allTargets === true) return [...require_vite_internals.allMuonTargets];
350
+ if (options.targets !== void 0 && options.targets.length > 0) return normalizePackTargetSelectors(options.targets);
351
+ if (options.allTargets === false) return [require_vite_internals.getDefaultMuonBuildTarget()];
352
+ if (pluginBuildOptions.allTargets === true) return [...require_vite_internals.allMuonTargets];
353
+ if (pluginBuildOptions.targets !== void 0 && pluginBuildOptions.targets.length > 0) return normalizePluginBuildTargets(pluginBuildOptions.targets);
354
+ if (pluginBuildOptions.allTargets === false) return [require_vite_internals.getDefaultMuonBuildTarget()];
355
+ return [...require_vite_internals.allMuonTargets];
356
+ };
357
+ var packTypeSupportsTarget = (type, target) => {
358
+ const descriptor = require_vite_internals.getMuonTargetDescriptor(target);
359
+ return type === "zip" && descriptor.os === "windows" || type === "tar.gz" && descriptor.os === "linux" || type === "deb" && descriptor.os === "linux" || type === "nsis" && descriptor.os === "windows";
360
+ };
361
+ var createPackTargetPlan = (types, targets) => {
362
+ const plan = targets.map((target) => ({
363
+ target,
364
+ types: types.filter((type) => packTypeSupportsTarget(type, target))
365
+ })).filter((entry) => entry.types.length > 0);
366
+ if (plan.length === 0) throw new Error("No valid muon pack target and type combinations.");
367
+ return plan;
389
368
  };
390
369
  var runTool = async (executable, args, cwd, environment) => {
391
370
  const child = (0, node_child_process.spawn)(executable, [...args], {
@@ -445,8 +424,35 @@ var packageZip = async (target, metadata, artifactsRoot) => {
445
424
  path: outputPath
446
425
  };
447
426
  };
427
+ var toArchivePath = (path) => path.split(node_path.sep).join("/");
428
+ var createTarGzEntryGenerator = async function* (directory, entryRoot) {
429
+ yield await (0, tar_vern.createDirectoryItem)(entryRoot, "exceptName", { directoryPath: directory });
430
+ const walk = async function* (currentDirectory) {
431
+ const entries = await (0, node_fs_promises.readdir)(currentDirectory, { withFileTypes: true });
432
+ entries.sort((left, right) => left.name.localeCompare(right.name));
433
+ for (const entry of entries) {
434
+ const path = (0, node_path.join)(currentDirectory, entry.name);
435
+ const entryName = `${entryRoot}/${toArchivePath((0, node_path.relative)(directory, path))}`;
436
+ if (entry.isDirectory()) {
437
+ yield await (0, tar_vern.createDirectoryItem)(entryName, "exceptName", { directoryPath: path });
438
+ yield* walk(path);
439
+ } else if (entry.isFile()) yield await (0, tar_vern.createReadFileItem)(entryName, path, "exceptName");
440
+ }
441
+ };
442
+ yield* walk(directory);
443
+ };
444
+ var packageTarGz = async (target, metadata, artifactsRoot) => {
445
+ const outputPath = (0, node_path.join)(artifactsRoot, `${metadata.packageName}-${metadata.version}-${target.target}.tar.gz`);
446
+ await (0, node_fs_promises.mkdir)((0, node_path.dirname)(outputPath), { recursive: true });
447
+ await (0, tar_vern.storeReaderToFile)((0, tar_vern.createTarPacker)(createTarGzEntryGenerator(target.outputPath, target.distributionDirectoryName), "gzip"), outputPath);
448
+ return {
449
+ type: "tar.gz",
450
+ target: target.target,
451
+ path: outputPath
452
+ };
453
+ };
448
454
  var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot, environment) => {
449
- const descriptor = require_vite_options.getMuonTargetDescriptor(target.target);
455
+ const descriptor = require_vite_internals.getMuonTargetDescriptor(target.target);
450
456
  if (descriptor.os !== "linux") throw new Error(`Unsupported deb target: ${target.target}`);
451
457
  const architecture = descriptor.arch;
452
458
  const packageRoot = (0, node_path.join)(packageBuildRoot, "deb", `${metadata.packageName}-${target.target}`);
@@ -457,6 +463,11 @@ var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot,
457
463
  const installedDist = (0, node_path.join)((0, node_path.join)(packageRoot, "usr", "lib", metadata.packageName), target.distributionDirectoryName);
458
464
  await (0, node_fs_promises.mkdir)(installedDist, { recursive: true });
459
465
  await (0, node_fs_promises.cp)(target.outputPath, installedDist, { recursive: true });
466
+ await (0, node_fs_promises.writeFile)((0, node_path.join)(installedDist, "muon-install.json"), `${JSON.stringify({
467
+ type: "deb",
468
+ packageName: metadata.packageName,
469
+ launcherPath: `/usr/bin/${metadata.packageName}`
470
+ }, void 0, 2)}\n`);
460
471
  const binPath = (0, node_path.join)(packageRoot, "usr", "bin", metadata.packageName);
461
472
  const launcherName = (0, node_path.basename)(target.launcherPath);
462
473
  await (0, node_fs_promises.mkdir)((0, node_path.dirname)(binPath), { recursive: true });
@@ -467,6 +478,18 @@ var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot,
467
478
  ""
468
479
  ].join("\n"));
469
480
  await (0, node_fs_promises.chmod)(binPath, 493);
481
+ if (target.linuxDesktop === void 0) throw new Error(`Linux desktop metadata is unavailable: ${target.target}`);
482
+ const applicationsPath = (0, node_path.join)(packageRoot, "usr", "share", "applications", `${target.linuxDesktop.desktopId}.desktop`);
483
+ await (0, node_fs_promises.mkdir)((0, node_path.dirname)(applicationsPath), { recursive: true });
484
+ await (0, node_fs_promises.writeFile)(applicationsPath, require_vite_internals.createLinuxDesktopEntry({
485
+ desktop: target.linuxDesktop,
486
+ exec: `${require_vite_internals.quoteDesktopExecArgument(`/usr/bin/${metadata.packageName}`)} --muon-launch-from=normal`,
487
+ tryExec: `/usr/bin/${metadata.packageName}`,
488
+ icon: target.linuxDesktop.desktopId
489
+ }));
490
+ const iconPath = (0, node_path.join)(packageRoot, "usr", "share", "icons", "hicolor", "256x256", "apps", `${target.linuxDesktop.desktopId}.png`);
491
+ await (0, node_fs_promises.mkdir)((0, node_path.dirname)(iconPath), { recursive: true });
492
+ await (0, node_fs_promises.cp)((0, node_path.join)(target.outputPath, target.linuxDesktop.iconFileName), iconPath);
470
493
  const controlPath = (0, node_path.join)(packageRoot, "DEBIAN", "control");
471
494
  await (0, node_fs_promises.mkdir)((0, node_path.dirname)(controlPath), { recursive: true });
472
495
  await (0, node_fs_promises.writeFile)(controlPath, [
@@ -491,24 +514,57 @@ var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot,
491
514
  };
492
515
  };
493
516
  var escapeNsis = (value) => value.replaceAll("\\", "\\\\").replaceAll("\"", "$\\\"");
494
- var packageNsis = async (root, target, metadata, artifactsRoot, packageBuildRoot, environment) => {
495
- const descriptor = require_vite_options.getMuonTargetDescriptor(target.target);
517
+ var nsisUninstallRegistryRoot = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
518
+ var createNsisUninstallRegistryKey = (appId) => `${nsisUninstallRegistryRoot}\\${appId}`;
519
+ var packageNsis = async (root, target, metadata, appId, windowsResource, artifactsRoot, packageBuildRoot, environment) => {
520
+ const descriptor = require_vite_internals.getMuonTargetDescriptor(target.target);
496
521
  if (descriptor.os !== "windows") throw new Error(`Unsupported nsis target: ${target.target}`);
497
522
  const scriptPath = (0, node_path.join)(packageBuildRoot, "nsis", `${metadata.packageName}-${target.target}.nsi`);
498
523
  const outputPath = (0, node_path.join)(artifactsRoot, `${metadata.packageName}-${metadata.version}-${descriptor.arch}-setup.exe`);
524
+ const launcherFileName = (0, node_path.basename)(target.launcherPath);
525
+ const uninstallRegistryKey = createNsisUninstallRegistryKey(appId);
499
526
  await (0, node_fs_promises.mkdir)((0, node_path.dirname)(scriptPath), { recursive: true });
500
527
  await (0, node_fs_promises.mkdir)((0, node_path.dirname)(outputPath), { recursive: true });
528
+ const iconPath = windowsResource.iconPath === void 0 ? void 0 : (0, node_path.join)((0, node_path.dirname)(scriptPath), `${metadata.packageName}-${target.target}.ico`);
529
+ if (windowsResource.iconPath !== void 0 && iconPath !== void 0) await require_vite_internals.createWindowsIconFromPngFile(windowsResource.iconPath, iconPath);
501
530
  await (0, node_fs_promises.writeFile)(scriptPath, [
502
531
  "Unicode true",
503
532
  `Name "${escapeNsis(metadata.packageName)}"`,
504
533
  `OutFile "${escapeNsis(outputPath)}"`,
505
534
  `InstallDir "$LOCALAPPDATA\\Programs\\${escapeNsis(metadata.packageName)}"`,
506
535
  "RequestExecutionLevel user",
536
+ "ShowInstDetails nevershow",
537
+ "AutoCloseWindow true",
538
+ ...createNsisResourceDirectives(windowsResource, iconPath),
539
+ "Page instfiles",
507
540
  "Section",
508
541
  " SetOutPath \"$INSTDIR\"",
509
542
  ` File /r "${escapeNsis(target.outputPath)}\\*"`,
510
- ` CreateShortCut "$SMPROGRAMS\\${escapeNsis(metadata.packageName)}.lnk" "$INSTDIR\\${escapeNsis((0, node_path.basename)(target.launcherPath))}"`,
543
+ ` CreateShortCut "$SMPROGRAMS\\${escapeNsis(metadata.packageName)}.lnk" "$INSTDIR\\${escapeNsis(launcherFileName)}"`,
544
+ " WriteUninstaller \"$INSTDIR\\Uninstall.exe\"",
545
+ ` WriteRegStr HKCU "${escapeNsis(uninstallRegistryKey)}" "DisplayName" "${escapeNsis(metadata.packageName)}"`,
546
+ ` WriteRegStr HKCU "${escapeNsis(uninstallRegistryKey)}" "DisplayVersion" "${escapeNsis(metadata.version)}"`,
547
+ ` WriteRegStr HKCU "${escapeNsis(uninstallRegistryKey)}" "Publisher" "${escapeNsis(metadata.author)}"`,
548
+ ` WriteRegStr HKCU "${escapeNsis(uninstallRegistryKey)}" "InstallLocation" "$INSTDIR"`,
549
+ ` WriteRegStr HKCU "${escapeNsis(uninstallRegistryKey)}" "DisplayIcon" "$\\"$INSTDIR\\${escapeNsis(launcherFileName)}$\\""`,
550
+ ` WriteRegStr HKCU "${escapeNsis(uninstallRegistryKey)}" "UninstallString" "$\\"$INSTDIR\\Uninstall.exe$\\" /S"`,
551
+ ` WriteRegStr HKCU "${escapeNsis(uninstallRegistryKey)}" "QuietUninstallString" "$\\"$INSTDIR\\Uninstall.exe$\\" /S"`,
552
+ ` WriteRegDWORD HKCU "${escapeNsis(uninstallRegistryKey)}" "NoModify" 1`,
553
+ ` WriteRegDWORD HKCU "${escapeNsis(uninstallRegistryKey)}" "NoRepair" 1`,
554
+ "SectionEnd",
555
+ "",
556
+ "Section \"Uninstall\"",
557
+ ` Delete "$SMPROGRAMS\\${escapeNsis(metadata.packageName)}.lnk"`,
558
+ ` DeleteRegKey HKCU "${escapeNsis(uninstallRegistryKey)}"`,
559
+ " RMDir /r \"$INSTDIR\"",
560
+ ` RMDir /r "$LOCALAPPDATA\\${escapeNsis(appId)}"`,
511
561
  "SectionEnd",
562
+ "",
563
+ "Function .onInstSuccess",
564
+ " IfSilent +3",
565
+ " SetOutPath \"$INSTDIR\"",
566
+ ` Exec "$\\"$INSTDIR\\${escapeNsis(launcherFileName)}$\\""`,
567
+ "FunctionEnd",
512
568
  ""
513
569
  ].join("\n"));
514
570
  await runTool("makensis", [scriptPath], root, environment);
@@ -519,8 +575,32 @@ var packageNsis = async (root, target, metadata, artifactsRoot, packageBuildRoot
519
575
  path: outputPath
520
576
  };
521
577
  };
578
+ var createNsisResourceDirectives = (resource, iconPath) => {
579
+ const lines = [];
580
+ if (iconPath !== void 0) {
581
+ lines.push(`Icon "${escapeNsis(iconPath)}"`);
582
+ lines.push(`UninstallIcon "${escapeNsis(iconPath)}"`);
583
+ }
584
+ lines.push(`VIProductVersion "${escapeNsis(resource.fixedVersion)}"`);
585
+ lines.push(`VIFileVersion "${escapeNsis(resource.fixedVersion)}"`);
586
+ lines.push(`VIAddVersionKey /LANG=${resource.language} "CompanyName" "${escapeNsis(resource.companyName)}"`);
587
+ lines.push(`VIAddVersionKey /LANG=${resource.language} "FileDescription" "${escapeNsis(resource.fileDescription)}"`);
588
+ lines.push(`VIAddVersionKey /LANG=${resource.language} "FileVersion" "${escapeNsis(resource.version)}"`);
589
+ lines.push(`VIAddVersionKey /LANG=${resource.language} "ProductName" "${escapeNsis(resource.productName)}"`);
590
+ lines.push(`VIAddVersionKey /LANG=${resource.language} "ProductVersion" "${escapeNsis(resource.version)}"`);
591
+ if (resource.copyright !== void 0) lines.push(`VIAddVersionKey /LANG=${resource.language} "LegalCopyright" "${escapeNsis(resource.copyright)}"`);
592
+ return lines;
593
+ };
594
+ var reapplyPackWindowsResources = async (targets, resource, root, environment) => {
595
+ for (const target of targets) if (require_vite_internals.getMuonTargetDescriptor(target.target).os === "windows") await require_vite_internals.updateWindowsPeResources({
596
+ executablePath: target.launcherPath,
597
+ resource,
598
+ environment,
599
+ cwd: root
600
+ });
601
+ };
522
602
  /**
523
- * Builds a Vite app, creates Muon dist directories, and packages them.
603
+ * Runs the Muon build sequence and creates redistributable packages.
524
604
  *
525
605
  * @param options Pack options.
526
606
  * @returns Generated package artifacts.
@@ -528,16 +608,47 @@ var packageNsis = async (root, target, metadata, artifactsRoot, packageBuildRoot
528
608
  var packMuonApp = async (options) => {
529
609
  const cwd = (0, node_path.resolve)(options.root ?? process.cwd());
530
610
  const environment = options.environment ?? process.env;
531
- const loadedOptions = await loadViteMuonOptions(cwd);
532
- const root = loadedOptions.root;
533
- const metadata = resolveMetadata(await readPackageJson(root), options);
611
+ const project = await require_vite_internals.loadMuonBuildSequenceProject(cwd);
612
+ const root = project.root;
613
+ const packageJson = await readPackageJson(root);
614
+ const metadata = resolveMetadata(packageJson, options);
534
615
  const artifactsRoot = (0, node_path.resolve)(root, options.artifactsDir ?? defaultArtifactsDirectory);
535
616
  const packageBuildRoot = (0, node_path.resolve)(root, defaultPackageBuildDirectory);
536
617
  const types = normalizePackTypes(options.types);
537
- const viteOutputDirectory = await resolveBuildOutputDirectory(root);
538
- await runViteBuild(root, environment);
539
- const build = await require_vite_options.buildMuonApp(createBuildOptions(root, viteOutputDirectory, getPluginBuildOptions(loadedOptions.pluginOptions), options));
540
- for (const type of types) for (const target of build.targets) assertPackTypeSupportsTarget(type, target.target);
618
+ const pluginBuildOptions = require_vite_internals.resolveMuonViteBuildOptions(project.pluginOptions);
619
+ const targetPlan = createPackTargetPlan(types, resolvePackTargetCandidates(options, pluginBuildOptions));
620
+ const buildOptions = {
621
+ root: cwd,
622
+ targets: targetPlan.map((entry) => entry.target),
623
+ allTargets: false
624
+ };
625
+ const windowsResourceOptions = require_vite_internals.mergeMuonWindowsResourceOptions(options.windowsResource, pluginBuildOptions.windowsResource);
626
+ const linuxDesktopOptions = require_vite_internals.mergeMuonLinuxDesktopOptions(options.linuxDesktop, pluginBuildOptions.linuxDesktop);
627
+ if (options.configPath !== void 0) buildOptions.configPath = options.configPath;
628
+ if (options.appName !== void 0) buildOptions.appName = options.appName;
629
+ if (options.appId !== void 0) buildOptions.appId = options.appId;
630
+ if (options.packageDirectory !== void 0) buildOptions.packageDirectory = options.packageDirectory;
631
+ if (windowsResourceOptions !== void 0) buildOptions.windowsResource = windowsResourceOptions;
632
+ if (linuxDesktopOptions !== void 0) buildOptions.linuxDesktop = linuxDesktopOptions;
633
+ const windowsResourceConfig = await require_vite_internals.readMuonConfigForWindowsResource(root, options.configPath);
634
+ const windowsResource = await require_vite_internals.resolveMuonWindowsResource({
635
+ root,
636
+ packageDirectory: options.packageDirectory ?? pluginBuildOptions.packageDirectory ?? "",
637
+ packageJson: createPackMetadataPackageJson(packageJson, metadata),
638
+ muonConfig: windowsResourceConfig.config,
639
+ muonConfigDirectory: windowsResourceConfig.directory,
640
+ options: windowsResourceOptions,
641
+ defaults: {
642
+ productName: metadata.packageName,
643
+ fileDescription: metadata.description,
644
+ companyName: metadata.author,
645
+ version: metadata.version,
646
+ copyright: void 0
647
+ }
648
+ });
649
+ const build = await require_vite_internals.runMuonBuildSequence(buildOptions, project);
650
+ if (options.packageVersion !== void 0) await reapplyPackWindowsResources(build.targets, windowsResource, root, environment);
651
+ const typesByTarget = new Map(targetPlan.map((entry) => [entry.target, entry.types]));
541
652
  await (0, node_fs_promises.rm)(packageBuildRoot, {
542
653
  recursive: true,
543
654
  force: true
@@ -552,9 +663,10 @@ var packMuonApp = async (options) => {
552
663
  });
553
664
  await (0, node_fs_promises.mkdir)(artifactsRoot, { recursive: true });
554
665
  const artifacts = [];
555
- for (const target of build.targets) for (const type of types) if (type === "zip") artifacts.push(await packageZip(target, metadata, artifactsRoot));
666
+ for (const target of build.targets) for (const type of typesByTarget.get(target.target) ?? []) if (type === "zip") artifacts.push(await packageZip(target, metadata, artifactsRoot));
667
+ else if (type === "tar.gz") artifacts.push(await packageTarGz(target, metadata, artifactsRoot));
556
668
  else if (type === "deb") artifacts.push(await packageDeb(root, target, metadata, artifactsRoot, packageBuildRoot, environment));
557
- else artifacts.push(await packageNsis(root, target, metadata, artifactsRoot, packageBuildRoot, environment));
669
+ else artifacts.push(await packageNsis(root, target, metadata, build.appId, windowsResource, artifactsRoot, packageBuildRoot, environment));
558
670
  return {
559
671
  root,
560
672
  packageName: metadata.packageName,
@@ -568,8 +680,8 @@ var packMuonApp = async (options) => {
568
680
  };
569
681
  //#endregion
570
682
  //#region src/generated/packageMetadata.ts
571
- var version = "0.7.0";
572
- var git_commit_hash = "fe80718aaa617c0c0ea5c816bbe38d22bf2e8402";
683
+ var version = "0.8.0";
684
+ var git_commit_hash = "9bb6148e155dab16c4ca441073b144e21981b038";
573
685
  //#endregion
574
686
  //#region src/cli.ts
575
687
  var readTargetValues = (value) => {
@@ -579,7 +691,14 @@ var appendTargetValues = (value, previous) => {
579
691
  return [...previous, ...readTargetValues(value)];
580
692
  };
581
693
  var appendPackTypeValues = (value, previous) => {
582
- return [...previous, ...readTargetValues(value)];
694
+ return [...previous ?? [], ...readTargetValues(value)];
695
+ };
696
+ var readCommaSeparatedValues = (value) => value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0);
697
+ var readBooleanValue = (value, label) => {
698
+ const normalized = value.trim().toLowerCase();
699
+ if (normalized === "true" || normalized === "1" || normalized === "yes") return true;
700
+ if (normalized === "false" || normalized === "0" || normalized === "no") return false;
701
+ throw new Error(`${label} must be true or false.`);
583
702
  };
584
703
  var validateEmbedConfigOptions = (options) => {
585
704
  if (options.runtimePath !== void 0 && options.corePath !== void 0) throw new Error("Specify at most one of --runtime-path or --core-path.");
@@ -588,20 +707,46 @@ var validateEmbedConfigOptions = (options) => {
588
707
  if (options.runtimePath !== void 0 && options.output !== void 0) throw new Error("--output requires --core-path.");
589
708
  if (options.bootstrapPath === void 0 && options.outputBootstrap !== void 0) throw new Error("--output-bootstrap requires --bootstrap-path.");
590
709
  };
710
+ var createWindowsResourceOptions = (commandOptions) => {
711
+ const options = {};
712
+ if (commandOptions.windowsIcon !== void 0) options.iconPath = commandOptions.windowsIcon;
713
+ if (commandOptions.windowsProductName !== void 0) options.productName = commandOptions.windowsProductName;
714
+ if (commandOptions.windowsFileDescription !== void 0) options.fileDescription = commandOptions.windowsFileDescription;
715
+ if (commandOptions.windowsCompanyName !== void 0) options.companyName = commandOptions.windowsCompanyName;
716
+ if (commandOptions.windowsVersion !== void 0) options.version = commandOptions.windowsVersion;
717
+ if (commandOptions.windowsCopyright !== void 0) options.copyright = commandOptions.windowsCopyright;
718
+ return Object.keys(options).length === 0 ? void 0 : options;
719
+ };
720
+ var createLinuxDesktopOptions = (commandOptions) => {
721
+ const options = {};
722
+ if (commandOptions.linuxDesktopId !== void 0) options.desktopId = commandOptions.linuxDesktopId;
723
+ if (commandOptions.linuxName !== void 0) options.name = commandOptions.linuxName;
724
+ if (commandOptions.linuxComment !== void 0) options.comment = commandOptions.linuxComment;
725
+ if (commandOptions.linuxIcon !== void 0) options.iconPath = commandOptions.linuxIcon;
726
+ if (commandOptions.linuxCategories !== void 0) options.categories = readCommaSeparatedValues(commandOptions.linuxCategories);
727
+ if (commandOptions.linuxStartupNotify !== void 0) options.startupNotify = readBooleanValue(commandOptions.linuxStartupNotify, "--linux-startup-notify");
728
+ return Object.keys(options).length === 0 ? void 0 : options;
729
+ };
591
730
  var runBuildCommand = async (commandOptions) => {
592
731
  const targets = commandOptions.target;
593
732
  if (commandOptions.all === true && targets.length > 0) throw new Error("Specify either --all or --target, not both.");
594
733
  const buildOptions = {
595
734
  root: process.cwd(),
596
- allTargets: commandOptions.all === true
735
+ defaultAllTargets: false
597
736
  };
598
737
  if (targets.length > 0) buildOptions.targets = targets;
738
+ if (commandOptions.all === true) buildOptions.allTargets = true;
599
739
  if (commandOptions.assets !== void 0) buildOptions.assetSourcePath = commandOptions.assets;
600
740
  if (commandOptions.config !== void 0) buildOptions.configPath = commandOptions.config;
741
+ const windowsResource = createWindowsResourceOptions(commandOptions);
742
+ if (windowsResource !== void 0) buildOptions.windowsResource = windowsResource;
743
+ const linuxDesktop = createLinuxDesktopOptions(commandOptions);
744
+ if (linuxDesktop !== void 0) buildOptions.linuxDesktop = linuxDesktop;
601
745
  if (commandOptions.outDir !== void 0) buildOptions.outputRoot = commandOptions.outDir;
602
746
  if (commandOptions.name !== void 0) buildOptions.appName = commandOptions.name;
603
747
  if (commandOptions.appId !== void 0) buildOptions.appId = commandOptions.appId;
604
- const result = await require_vite_options.buildMuonApp(buildOptions);
748
+ if (commandOptions.packageDirectory !== void 0) buildOptions.packageDirectory = commandOptions.packageDirectory;
749
+ const result = await require_vite_internals.runMuonBuildSequence(buildOptions);
605
750
  if (commandOptions.json === true) console.log(JSON.stringify(result, null, 2));
606
751
  else for (const target of result.targets) console.log(target.outputPath);
607
752
  };
@@ -610,12 +755,16 @@ var runPackCommand = async (commandOptions) => {
610
755
  if (commandOptions.all === true && targets.length > 0) throw new Error("Specify either --all or --target, not both.");
611
756
  const packOptions = {
612
757
  root: process.cwd(),
613
- types: commandOptions.type,
614
758
  environment: process.env
615
759
  };
760
+ if (commandOptions.type !== void 0) packOptions.types = commandOptions.type;
616
761
  if (targets.length > 0) packOptions.targets = targets;
617
762
  if (commandOptions.all !== void 0) packOptions.allTargets = commandOptions.all;
618
763
  if (commandOptions.config !== void 0) packOptions.configPath = commandOptions.config;
764
+ const windowsResource = createWindowsResourceOptions(commandOptions);
765
+ if (windowsResource !== void 0) packOptions.windowsResource = windowsResource;
766
+ const linuxDesktop = createLinuxDesktopOptions(commandOptions);
767
+ if (linuxDesktop !== void 0) packOptions.linuxDesktop = linuxDesktop;
619
768
  if (commandOptions.name !== void 0) packOptions.appName = commandOptions.name;
620
769
  if (commandOptions.appId !== void 0) packOptions.appId = commandOptions.appId;
621
770
  if (commandOptions.packageDirectory !== void 0) packOptions.packageDirectory = commandOptions.packageDirectory;
@@ -629,11 +778,11 @@ var runPackCommand = async (commandOptions) => {
629
778
  else for (const artifact of result.artifacts) console.log(artifact.path);
630
779
  };
631
780
  var runPrepareCommand = async (commandOptions) => {
632
- const result = await require_vite_options.runMuonPrepare({
781
+ const result = await require_vite_internals.runMuonPrepare({
633
782
  muonPath: commandOptions.muonPath ?? "",
634
783
  cefPath: commandOptions.cefPath,
635
784
  stageDir: commandOptions.stageDir,
636
- target: commandOptions.target ?? require_vite_options.getDefaultMuonPrepareTarget(process.platform, process.arch),
785
+ target: commandOptions.target ?? require_vite_internals.getDefaultMuonPrepareTarget(process.platform, process.arch),
637
786
  cacheDir: commandOptions.cacheDir,
638
787
  force: commandOptions.force === true,
639
788
  quiet: commandOptions.quiet === true,
@@ -661,7 +810,7 @@ var runDevCommand = async (commandOptions, command) => {
661
810
  if (result.exitCode !== 0) process.exitCode = result.exitCode;
662
811
  };
663
812
  var runInitCommand = async () => {
664
- const result = await require_vite_options.ensureMuonGitignoreEntry(process.cwd());
813
+ const result = await require_vite_internals.ensureMuonGitignoreEntry(process.cwd());
665
814
  console.log(result.changed ? `Updated ${result.gitignorePath}` : result.gitignorePath);
666
815
  };
667
816
  var printEmbedConfigResult = (result, json) => {
@@ -671,16 +820,16 @@ var printEmbedConfigResult = (result, json) => {
671
820
  var runEmbedConfigCommand = async (commandOptions) => {
672
821
  validateEmbedConfigOptions(commandOptions);
673
822
  const configPath = commandOptions.config ?? "";
674
- const coreResult = commandOptions.corePath !== void 0 ? await require_vite_options.embedMuonConfigInCoreFile({
823
+ const coreResult = commandOptions.corePath !== void 0 ? await require_vite_internals.embedMuonConfigInCoreFile({
675
824
  corePath: commandOptions.corePath,
676
825
  configPath,
677
826
  outputPath: commandOptions.output
678
- }) : commandOptions.runtimePath !== void 0 ? await require_vite_options.embedMuonConfigInRuntime({
827
+ }) : commandOptions.runtimePath !== void 0 ? await require_vite_internals.embedMuonConfigInRuntime({
679
828
  runtimePath: commandOptions.runtimePath,
680
829
  configPath,
681
830
  outputRuntimePath: commandOptions.outputRuntimePath
682
831
  }) : void 0;
683
- const bootstrapResult = commandOptions.bootstrapPath === void 0 ? void 0 : await require_vite_options.embedMuonConfigInBootstrapFile({
832
+ const bootstrapResult = commandOptions.bootstrapPath === void 0 ? void 0 : await require_vite_internals.embedMuonConfigInBootstrapFile({
684
833
  bootstrapPath: commandOptions.bootstrapPath,
685
834
  configPath,
686
835
  outputPath: commandOptions.outputBootstrap
@@ -703,10 +852,10 @@ var createCliCommand = () => {
703
852
  program.outputHelp({ error: true });
704
853
  process.exitCode = 1;
705
854
  });
706
- program.command("build").description("Build CEF-free Muon app distribution directories").option("--target <target>", "public target or comma-separated public targets", appendTargetValues, []).option("--all", "build all supported targets").option("--assets <path>", "asset root path").option("--config <path>", "muon config path").option("--out-dir <path>", "output root directory").option("--name <name>", "launcher file name").option("--app-id <id>", "stable application identifier").option("--json", "write result as JSON").action(async (options) => {
855
+ program.command("build").description("Build CEF-free Muon app distribution directories").option("--target <target>", "public target or comma-separated public targets", appendTargetValues, []).option("--all", "build all supported targets").option("--assets <path>", "asset root path").option("--config <path>", "muon config path").option("--windows-icon <path>", "Windows PNG icon resource path").option("--windows-product-name <name>", "Windows product name").option("--windows-file-description <text>", "Windows file description").option("--windows-company-name <name>", "Windows company name").option("--windows-version <version>", "Windows resource version").option("--windows-copyright <text>", "Windows legal copyright").option("--linux-desktop-id <id>", "Linux desktop entry identifier").option("--linux-name <name>", "Linux desktop display name").option("--linux-comment <text>", "Linux desktop comment").option("--linux-icon <path>", "Linux desktop PNG icon path").option("--linux-categories <list>", "Linux desktop categories").option("--linux-startup-notify <boolean>", "Linux startup notification").option("--out-dir <path>", "output root directory").option("--name <name>", "launcher file name").option("--app-id <id>", "stable application identifier").option("--package-directory <path>", "Muon package dist directory").option("--json", "write result as JSON").action(async (options) => {
707
856
  await runBuildCommand(options);
708
857
  });
709
- program.command("pack").description("Build and package a Muon app").requiredOption("-t, --type <type>", "package type or comma-separated package types: zip, deb, nsis", appendPackTypeValues, []).option("--target <target>", "public target or comma-separated public targets", appendTargetValues, []).option("--all", "build all supported targets").option("--config <path>", "muon config path").option("--name <name>", "launcher file name").option("--app-id <id>", "stable application identifier").option("--package-directory <path>", "Muon package dist directory").option("--artifacts-dir <path>", "package artifact output directory").option("--package-name <name>", "package name override").option("--package-version <version>", "package version override").option("--description <text>", "package description override").option("--author <text>", "package author override").option("--json", "write result as JSON").action(async (options) => {
858
+ program.command("pack").description("Build and package a Muon app").option("--type <type>", "package type or comma-separated package types: zip, tar.gz, tgz, deb, nsis (default: all)", appendPackTypeValues).option("--target <target>", "public target, platform, arch, or comma-separated selectors", appendTargetValues, []).option("--all", "build all supported targets").option("--config <path>", "muon config path").option("--windows-icon <path>", "Windows PNG icon resource path").option("--windows-product-name <name>", "Windows product name").option("--windows-file-description <text>", "Windows file description").option("--windows-company-name <name>", "Windows company name").option("--windows-version <version>", "Windows resource version").option("--windows-copyright <text>", "Windows legal copyright").option("--linux-desktop-id <id>", "Linux desktop entry identifier").option("--linux-name <name>", "Linux desktop display name").option("--linux-comment <text>", "Linux desktop comment").option("--linux-icon <path>", "Linux desktop PNG icon path").option("--linux-categories <list>", "Linux desktop categories").option("--linux-startup-notify <boolean>", "Linux startup notification").option("--name <name>", "launcher file name").option("--app-id <id>", "stable application identifier").option("--package-directory <path>", "Muon package dist directory").option("--artifacts-dir <path>", "package artifact output directory").option("--package-name <name>", "package name override").option("--package-version <version>", "package version override").option("--description <text>", "package description override").option("--author <text>", "package author override").option("--json", "write result as JSON").action(async (options) => {
710
859
  await runPackCommand(options);
711
860
  });
712
861
  const devCommand = program.command("dev").description("Launch Muon directly with local development assets").option("--muon-path <path>", "Muon runtime file root").option("--cef-path <path>", "CEF file root").option("--stage-dir <path>", "prepared runtime output directory").option("--config <path>", "muon config path").option("--assets <path>", "development asset directory").option("--no-debugger", "disable Muon debugger defaults").option("--json", "write result as JSON").action(async (options) => {
@@ -715,7 +864,7 @@ var createCliCommand = () => {
715
864
  program.command("init").description("Initialize Muon project helper files").action(async () => {
716
865
  await runInitCommand();
717
866
  });
718
- program.command("prepare").description("Prepare a Muon runtime with CEF files").requiredOption("--muon-path <path>", "Muon runtime file root").option("--cef-path <path>", "CEF file root").option("--stage-dir <path>", "prepared runtime output directory").option("--target <target>", "prepare target").option("--cache-dir <path>", "CEF artifact cache directory").option("--force", "rebuild an existing prepared runtime").option("-q, --quiet", "suppress native prepare progress messages").option("--json", "write result as JSON").action(async (options) => {
867
+ program.command("prepare").description("Prepare a Muon runtime with CEF files").requiredOption("--muon-path <path>", "Muon runtime file root").option("--cef-path <path>", "CEF file root").option("--stage-dir <path>", "prepared runtime output directory").option("--target <target>", "prepare target").option("--cache-dir <path>", "CEF artifact cache directory").option("--force", "rebuild an existing prepared runtime").option("-q, --quiet", "suppress native builder progress messages").option("--json", "write result as JSON").action(async (options) => {
719
868
  await runPrepareCommand(options);
720
869
  });
721
870
  program.command("embed-config").description("Embed muon.json into Muon runtime files").option("--runtime-path <path>", "prepared runtime directory").option("--core-path <path>", "muon-core executable path").option("--bootstrap-path <path>", "muon-bootstrap executable path").requiredOption("--config <path>", "muon config path").option("--output-runtime-path <path>", "patched runtime output directory").option("--output <path>", "patched muon-core output path").option("--output-bootstrap <path>", "patched bootstrap output path").option("--json", "write result as JSON").action(async (options) => {