muon-ui 0.9.0 → 0.11.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.
- package/dist/cli.cjs +134 -28
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/native/linux-amd64/muon-bootstrap +0 -0
- package/dist/native/linux-amd64/muon-builder +0 -0
- package/dist/native/linux-amd64/muon-runtime-helper +0 -0
- package/dist/native/linux-arm64/muon-bootstrap +0 -0
- package/dist/native/linux-arm64/muon-builder +0 -0
- package/dist/native/linux-arm64/muon-runtime-helper +0 -0
- package/dist/native/linux-armhf/muon-bootstrap +0 -0
- package/dist/native/linux-armhf/muon-builder +0 -0
- package/dist/native/linux-armhf/muon-runtime-helper +0 -0
- package/dist/native/windows-amd64/muon-bootstrap.exe +0 -0
- package/dist/native/windows-amd64/muon-builder.exe +0 -0
- package/dist/native/windows-i686/muon-bootstrap.exe +0 -0
- package/dist/native/windows-i686/muon-builder.exe +0 -0
- package/dist/runtime/linux-amd64/libmuon-ui.so +0 -0
- package/dist/runtime/linux-amd64/muon-core +0 -0
- package/dist/runtime/linux-arm64/libmuon-ui.so +0 -0
- package/dist/runtime/linux-arm64/muon-core +0 -0
- package/dist/runtime/linux-armhf/libmuon-ui.so +0 -0
- package/dist/runtime/linux-armhf/muon-core +0 -0
- package/dist/runtime/windows-amd64/libcardio.dll +0 -0
- package/dist/runtime/windows-amd64/libmuon-ui.dll +0 -0
- package/dist/runtime/windows-amd64/muon-core.exe +0 -0
- package/dist/runtime/windows-i686/libcardio.dll +0 -0
- package/dist/runtime/windows-i686/libmuon-ui.dll +0 -0
- package/dist/runtime/windows-i686/muon-core.exe +0 -0
- package/dist/{vite-internals-HXgH7b5M.cjs → vite-internals-Dha0jYI8.cjs} +278 -133
- package/dist/vite-internals-Dha0jYI8.cjs.map +1 -0
- package/dist/vite.cjs +502 -31
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +741 -149
- package/dist/vite.mjs.map +1 -1
- package/muon.d.ts +502 -53
- package/package.json +7 -7
- package/vite.d.ts +59 -59
- package/dist/vite-internals-HXgH7b5M.cjs.map +0 -1
package/dist/cli.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*!
|
|
3
3
|
* name: muon-ui
|
|
4
|
-
* version: 0.
|
|
4
|
+
* version: 0.11.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:
|
|
9
|
+
* git.commit.hash: db70f7643ac9fb1f61ab79f1de55c3dd8686de8d
|
|
10
10
|
*/
|
|
11
|
-
const require_vite_internals = require("./vite-internals-
|
|
11
|
+
const require_vite_internals = require("./vite-internals-Dha0jYI8.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");
|
|
@@ -79,7 +79,7 @@ var loadViteMuonOptions = async (cwd) => {
|
|
|
79
79
|
var resolveProjectConfigPath = async (root, configPath) => {
|
|
80
80
|
if (configPath !== void 0) {
|
|
81
81
|
const resolvedPath = resolveFromRoot(root, configPath);
|
|
82
|
-
if (!await fileExists(resolvedPath)) throw new Error(`
|
|
82
|
+
if (!await fileExists(resolvedPath)) throw new Error(`muon config file does not exist: ${resolvedPath}`);
|
|
83
83
|
return resolvedPath;
|
|
84
84
|
}
|
|
85
85
|
for (const fileName of defaultProjectConfigFileNames) {
|
|
@@ -130,9 +130,9 @@ var assertDevelopmentAssetDirectory = async (assetSourcePath) => {
|
|
|
130
130
|
try {
|
|
131
131
|
await (0, node_fs_promises.access)(assetSourcePath, node_fs.constants.F_OK);
|
|
132
132
|
} catch {
|
|
133
|
-
throw new Error(`
|
|
133
|
+
throw new Error(`muon run asset source does not exist: ${assetSourcePath}`);
|
|
134
134
|
}
|
|
135
|
-
throw new Error(`
|
|
135
|
+
throw new Error(`muon run asset source must be a directory: ${assetSourcePath}`);
|
|
136
136
|
};
|
|
137
137
|
var resolveAssetSource = async (root, assetSourcePath, projectConfig) => {
|
|
138
138
|
const configuredAssetSourcePath = readConfigAssetSourcePath(projectConfig.config);
|
|
@@ -192,10 +192,10 @@ var runMuonExecutable = async (muonExecutablePath, configPaths, environment) =>
|
|
|
192
192
|
return exitCode;
|
|
193
193
|
};
|
|
194
194
|
/**
|
|
195
|
-
* Launches
|
|
195
|
+
* Launches muon directly against local development assets.
|
|
196
196
|
*
|
|
197
197
|
* @param options Development startup options.
|
|
198
|
-
* @returns Development startup result after the
|
|
198
|
+
* @returns Development startup result after the muon process exits.
|
|
199
199
|
*/
|
|
200
200
|
var runMuonDev = async (options = {}) => {
|
|
201
201
|
const loadedViteOptions = await loadViteMuonOptions((0, node_path.resolve)(options.root ?? process.cwd()));
|
|
@@ -274,8 +274,13 @@ var supportedPackTypes = [
|
|
|
274
274
|
"deb",
|
|
275
275
|
"nsis"
|
|
276
276
|
];
|
|
277
|
+
var supportedLinuxSandboxModes = ["disabled", "setuid"];
|
|
277
278
|
var defaultArtifactsDirectory = "artifacts";
|
|
278
279
|
var defaultPackageBuildDirectory = ".muon/pack";
|
|
280
|
+
var systemRuntimeRoot = "/var/lib/muon/apps";
|
|
281
|
+
var systemCefCacheRoot = "/var/cache/muon/cef";
|
|
282
|
+
var runtimeHelperExecutableName = "muon-runtime-helper";
|
|
283
|
+
var debGtk3RuntimeDependency = "libgtk-3-0t64 | libgtk-3-0";
|
|
279
284
|
var isJsonObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
280
285
|
var readJsonObjectFile = async (path) => {
|
|
281
286
|
const parsed = (0, import_dist.parse)(await (0, node_fs_promises.readFile)(path, "utf8"));
|
|
@@ -299,7 +304,7 @@ var resolveMetadata = (packageJson, options) => {
|
|
|
299
304
|
if (packageNameSource === void 0 || packageNameSource.trim() === "") throw new Error("package.json name is required for muon pack.");
|
|
300
305
|
const version = options.packageVersion ?? (typeof packageJson.version === "string" ? packageJson.version : void 0);
|
|
301
306
|
if (version === void 0 || version.trim() === "") throw new Error("package.json version is required for muon pack.");
|
|
302
|
-
const description = options.description ?? (typeof packageJson.description === "string" ? packageJson.description : "
|
|
307
|
+
const description = options.description ?? (typeof packageJson.description === "string" ? packageJson.description : "muon application");
|
|
303
308
|
const author = options.author ?? stringifyAuthor(packageJson.author) ?? "Unknown";
|
|
304
309
|
return {
|
|
305
310
|
packageName: sanitizePackageName(packageNameSource),
|
|
@@ -319,6 +324,12 @@ var normalizePackTypes = (types) => {
|
|
|
319
324
|
for (const type of normalized) if (!supportedPackTypes.includes(type)) throw new Error(`Unsupported muon pack type: ${type}`);
|
|
320
325
|
return [...new Set(normalized)];
|
|
321
326
|
};
|
|
327
|
+
var normalizeLinuxSandboxMode = (mode) => {
|
|
328
|
+
if (mode === void 0) return "disabled";
|
|
329
|
+
const normalized = mode.trim().toLowerCase();
|
|
330
|
+
if (supportedLinuxSandboxModes.includes(normalized)) return normalized;
|
|
331
|
+
throw new Error(`Unsupported Linux sandbox mode: ${mode}`);
|
|
332
|
+
};
|
|
322
333
|
var packTargetSelectorTargets = {
|
|
323
334
|
linux: [
|
|
324
335
|
"linux-amd64",
|
|
@@ -366,6 +377,10 @@ var createPackTargetPlan = (types, targets) => {
|
|
|
366
377
|
if (plan.length === 0) throw new Error("No valid muon pack target and type combinations.");
|
|
367
378
|
return plan;
|
|
368
379
|
};
|
|
380
|
+
var validateLinuxSandboxModeForPlan = (mode, plan) => {
|
|
381
|
+
if (mode === "disabled") return;
|
|
382
|
+
for (const entry of plan) if (require_vite_internals.getMuonTargetDescriptor(entry.target).os !== "linux" || entry.types.length !== 1 || entry.types[0] !== "deb") throw new Error("--linux-sandbox=setuid is supported only for Linux deb packages. Specify --type deb with Linux targets.");
|
|
383
|
+
};
|
|
369
384
|
var runTool = async (executable, args, cwd, environment) => {
|
|
370
385
|
const child = (0, node_child_process.spawn)(executable, [...args], {
|
|
371
386
|
cwd,
|
|
@@ -451,7 +466,7 @@ var packageTarGz = async (target, metadata, artifactsRoot) => {
|
|
|
451
466
|
path: outputPath
|
|
452
467
|
};
|
|
453
468
|
};
|
|
454
|
-
var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot, environment) => {
|
|
469
|
+
var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot, environment, linuxSandbox, progress) => {
|
|
455
470
|
const descriptor = require_vite_internals.getMuonTargetDescriptor(target.target);
|
|
456
471
|
if (descriptor.os !== "linux") throw new Error(`Unsupported deb target: ${target.target}`);
|
|
457
472
|
const architecture = descriptor.arch;
|
|
@@ -461,12 +476,23 @@ var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot,
|
|
|
461
476
|
force: true
|
|
462
477
|
});
|
|
463
478
|
const installedDist = (0, node_path.join)((0, node_path.join)(packageRoot, "usr", "lib", metadata.packageName), target.distributionDirectoryName);
|
|
479
|
+
const privilegedPreparePath = `/usr/lib/${metadata.packageName}/${target.distributionDirectoryName}/${runtimeHelperExecutableName}`;
|
|
480
|
+
const systemRuntimePath = `${systemRuntimeRoot}/${metadata.packageName}/${target.target}/runtime`;
|
|
464
481
|
await (0, node_fs_promises.mkdir)(installedDist, { recursive: true });
|
|
465
482
|
await (0, node_fs_promises.cp)(target.outputPath, installedDist, { recursive: true });
|
|
483
|
+
if (linuxSandbox === "setuid") {
|
|
484
|
+
if (target.runtimeHelperPath === void 0) throw new Error(`muon runtime helper is unavailable for setuid deb target: ${target.target}`);
|
|
485
|
+
await (0, node_fs_promises.chmod)((0, node_path.join)(installedDist, runtimeHelperExecutableName), 2541);
|
|
486
|
+
}
|
|
466
487
|
await (0, node_fs_promises.writeFile)((0, node_path.join)(installedDist, "muon-install.json"), `${JSON.stringify({
|
|
467
488
|
type: "deb",
|
|
468
489
|
packageName: metadata.packageName,
|
|
469
|
-
launcherPath: `/usr/bin/${metadata.packageName}
|
|
490
|
+
launcherPath: `/usr/bin/${metadata.packageName}`,
|
|
491
|
+
...linuxSandbox === "setuid" ? {
|
|
492
|
+
runtimeMode: "system-setuid",
|
|
493
|
+
systemRuntimePath,
|
|
494
|
+
privilegedPreparePath
|
|
495
|
+
} : {}
|
|
470
496
|
}, void 0, 2)}\n`);
|
|
471
497
|
const binPath = (0, node_path.join)(packageRoot, "usr", "bin", metadata.packageName);
|
|
472
498
|
const launcherName = (0, node_path.basename)(target.launcherPath);
|
|
@@ -497,12 +523,47 @@ var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot,
|
|
|
497
523
|
`Version: ${metadata.version}`,
|
|
498
524
|
`Architecture: ${architecture}`,
|
|
499
525
|
`Maintainer: ${metadata.author}`,
|
|
526
|
+
`Depends: ${debGtk3RuntimeDependency}`,
|
|
500
527
|
`Description: ${metadata.description}`,
|
|
501
528
|
""
|
|
502
529
|
].join("\n"));
|
|
530
|
+
if (linuxSandbox === "setuid") {
|
|
531
|
+
const postinstPath = (0, node_path.join)(packageRoot, "DEBIAN", "postinst");
|
|
532
|
+
await (0, node_fs_promises.writeFile)(postinstPath, [
|
|
533
|
+
"#!/bin/sh",
|
|
534
|
+
"set -e",
|
|
535
|
+
`helper=${JSON.stringify(privilegedPreparePath)}`,
|
|
536
|
+
"if [ ! -f \"$helper\" ]; then",
|
|
537
|
+
" echo \"muon-runtime-helper is missing: $helper\" >&2",
|
|
538
|
+
" exit 1",
|
|
539
|
+
"fi",
|
|
540
|
+
"chown root:root \"$helper\"",
|
|
541
|
+
"chmod 4755 \"$helper\"",
|
|
542
|
+
"exit 0",
|
|
543
|
+
""
|
|
544
|
+
].join("\n"));
|
|
545
|
+
await (0, node_fs_promises.chmod)(postinstPath, 493);
|
|
546
|
+
const postrmPath = (0, node_path.join)(packageRoot, "DEBIAN", "postrm");
|
|
547
|
+
await (0, node_fs_promises.writeFile)(postrmPath, [
|
|
548
|
+
"#!/bin/sh",
|
|
549
|
+
"set -e",
|
|
550
|
+
"if [ \"$1\" = \"purge\" ]; then",
|
|
551
|
+
` rm -rf ${JSON.stringify(`${systemRuntimeRoot}/${metadata.packageName}`)}`,
|
|
552
|
+
` # Shared CEF cache ${systemCefCacheRoot} is intentionally preserved.`,
|
|
553
|
+
"fi",
|
|
554
|
+
"exit 0",
|
|
555
|
+
""
|
|
556
|
+
].join("\n"));
|
|
557
|
+
await (0, node_fs_promises.chmod)(postrmPath, 493);
|
|
558
|
+
}
|
|
503
559
|
const outputPath = (0, node_path.join)(artifactsRoot, `${metadata.packageName}-${metadata.version}-${architecture}.deb`);
|
|
504
560
|
await (0, node_fs_promises.mkdir)((0, node_path.dirname)(outputPath), { recursive: true });
|
|
561
|
+
progress?.({
|
|
562
|
+
phase: "pack",
|
|
563
|
+
status: "Running dpkg-deb"
|
|
564
|
+
});
|
|
505
565
|
await runTool("dpkg-deb", [
|
|
566
|
+
"--root-owner-group",
|
|
506
567
|
"--build",
|
|
507
568
|
packageRoot,
|
|
508
569
|
outputPath
|
|
@@ -516,7 +577,7 @@ var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot,
|
|
|
516
577
|
var escapeNsis = (value) => value.replaceAll("\\", "\\\\").replaceAll("\"", "$\\\"");
|
|
517
578
|
var nsisUninstallRegistryRoot = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
|
|
518
579
|
var createNsisUninstallRegistryKey = (appId) => `${nsisUninstallRegistryRoot}\\${appId}`;
|
|
519
|
-
var packageNsis = async (root, target, metadata, windowsResource, artifactsRoot, packageBuildRoot, environment) => {
|
|
580
|
+
var packageNsis = async (root, target, metadata, windowsResource, artifactsRoot, packageBuildRoot, environment, progress) => {
|
|
520
581
|
const descriptor = require_vite_internals.getMuonTargetDescriptor(target.target);
|
|
521
582
|
if (descriptor.os !== "windows") throw new Error(`Unsupported nsis target: ${target.target}`);
|
|
522
583
|
const scriptPath = (0, node_path.join)(packageBuildRoot, "nsis", `${metadata.packageName}-${target.target}.nsi`);
|
|
@@ -569,6 +630,10 @@ var packageNsis = async (root, target, metadata, windowsResource, artifactsRoot,
|
|
|
569
630
|
"FunctionEnd",
|
|
570
631
|
""
|
|
571
632
|
].join("\n"));
|
|
633
|
+
progress?.({
|
|
634
|
+
phase: "pack",
|
|
635
|
+
status: "Running makensis"
|
|
636
|
+
});
|
|
572
637
|
await runTool("makensis", [scriptPath], root, environment);
|
|
573
638
|
if (await statOrUndefined(outputPath) === void 0) throw new Error(`makensis did not create installer: ${outputPath}`);
|
|
574
639
|
return {
|
|
@@ -611,12 +676,13 @@ var reapplyPackWindowsResources = async (targets, resource, root, environment) =
|
|
|
611
676
|
}
|
|
612
677
|
};
|
|
613
678
|
/**
|
|
614
|
-
* Runs the
|
|
679
|
+
* Runs the muon build sequence and creates redistributable packages.
|
|
615
680
|
*
|
|
616
681
|
* @param options Pack options.
|
|
617
682
|
* @returns Generated package artifacts.
|
|
618
683
|
*/
|
|
619
684
|
var packMuonApp = async (options) => {
|
|
685
|
+
const progress = options.progress;
|
|
620
686
|
const cwd = (0, node_path.resolve)(options.root ?? process.cwd());
|
|
621
687
|
const environment = options.environment ?? process.env;
|
|
622
688
|
const project = await require_vite_internals.loadMuonBuildSequenceProject(cwd);
|
|
@@ -626,12 +692,15 @@ var packMuonApp = async (options) => {
|
|
|
626
692
|
const artifactsRoot = (0, node_path.resolve)(root, options.artifactsDir ?? defaultArtifactsDirectory);
|
|
627
693
|
const packageBuildRoot = (0, node_path.resolve)(root, defaultPackageBuildDirectory);
|
|
628
694
|
const types = normalizePackTypes(options.types);
|
|
695
|
+
const linuxSandbox = normalizeLinuxSandboxMode(options.linuxSandbox);
|
|
629
696
|
const pluginBuildOptions = require_vite_internals.resolveMuonViteBuildOptions(project.pluginOptions);
|
|
630
697
|
const targetPlan = createPackTargetPlan(types, resolvePackTargetCandidates(options, pluginBuildOptions));
|
|
698
|
+
validateLinuxSandboxModeForPlan(linuxSandbox, targetPlan);
|
|
631
699
|
const buildOptions = {
|
|
632
700
|
root: cwd,
|
|
633
701
|
targets: targetPlan.map((entry) => entry.target),
|
|
634
|
-
allTargets: false
|
|
702
|
+
allTargets: false,
|
|
703
|
+
includeRuntimeHelper: linuxSandbox === "setuid"
|
|
635
704
|
};
|
|
636
705
|
const windowsResourceOptions = require_vite_internals.mergeMuonWindowsResourceOptions(options.windowsResource, pluginBuildOptions.windowsResource);
|
|
637
706
|
const linuxDesktopOptions = require_vite_internals.mergeMuonLinuxDesktopOptions(options.linuxDesktop, pluginBuildOptions.linuxDesktop);
|
|
@@ -643,6 +712,7 @@ var packMuonApp = async (options) => {
|
|
|
643
712
|
if (options.packageDirectory !== void 0) buildOptions.packageDirectory = options.packageDirectory;
|
|
644
713
|
if (windowsResourceOptions !== void 0) buildOptions.windowsResource = windowsResourceOptions;
|
|
645
714
|
if (linuxDesktopOptions !== void 0) buildOptions.linuxDesktop = linuxDesktopOptions;
|
|
715
|
+
if (progress !== void 0) buildOptions.progress = progress;
|
|
646
716
|
const windowsResourceConfig = await require_vite_internals.readMuonConfigForWindowsResource(root, options.configPath);
|
|
647
717
|
const windowsResource = await require_vite_internals.resolveMuonWindowsResource({
|
|
648
718
|
root,
|
|
@@ -660,6 +730,10 @@ var packMuonApp = async (options) => {
|
|
|
660
730
|
copyright: void 0
|
|
661
731
|
}
|
|
662
732
|
});
|
|
733
|
+
progress?.({
|
|
734
|
+
phase: "pack",
|
|
735
|
+
status: "Building distributions"
|
|
736
|
+
});
|
|
663
737
|
const build = await require_vite_internals.runMuonBuildSequence(buildOptions, project);
|
|
664
738
|
if (options.packageVersion !== void 0) await reapplyPackWindowsResources(build.targets, windowsResource, root, environment);
|
|
665
739
|
const typesByTarget = new Map(targetPlan.map((entry) => [entry.target, entry.types]));
|
|
@@ -677,10 +751,25 @@ var packMuonApp = async (options) => {
|
|
|
677
751
|
});
|
|
678
752
|
await (0, node_fs_promises.mkdir)(artifactsRoot, { recursive: true });
|
|
679
753
|
const artifacts = [];
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
754
|
+
const totalArtifacts = targetPlan.reduce((sum, entry) => sum + entry.types.length, 0);
|
|
755
|
+
let artifactIndex = 0;
|
|
756
|
+
for (const target of build.targets) for (const type of typesByTarget.get(target.target) ?? []) {
|
|
757
|
+
artifactIndex += 1;
|
|
758
|
+
progress?.({
|
|
759
|
+
phase: "pack",
|
|
760
|
+
status: `Packaging ${type} ${target.target} (${artifactIndex}/${totalArtifacts})`
|
|
761
|
+
});
|
|
762
|
+
let artifact;
|
|
763
|
+
if (type === "zip") artifact = await packageZip(target, metadata, artifactsRoot);
|
|
764
|
+
else if (type === "tar.gz") artifact = await packageTarGz(target, metadata, artifactsRoot);
|
|
765
|
+
else if (type === "deb") artifact = await packageDeb(root, target, metadata, artifactsRoot, packageBuildRoot, environment, linuxSandbox, progress);
|
|
766
|
+
else artifact = await packageNsis(root, target, metadata, windowsResource, artifactsRoot, packageBuildRoot, environment, progress);
|
|
767
|
+
artifacts.push(artifact);
|
|
768
|
+
progress?.({
|
|
769
|
+
phase: "pack",
|
|
770
|
+
status: `Wrote ${artifact.path}`
|
|
771
|
+
});
|
|
772
|
+
}
|
|
684
773
|
return {
|
|
685
774
|
root,
|
|
686
775
|
packageName: metadata.packageName,
|
|
@@ -694,8 +783,8 @@ var packMuonApp = async (options) => {
|
|
|
694
783
|
};
|
|
695
784
|
//#endregion
|
|
696
785
|
//#region src/generated/packageMetadata.ts
|
|
697
|
-
var version = "0.
|
|
698
|
-
var git_commit_hash = "
|
|
786
|
+
var version = "0.11.0";
|
|
787
|
+
var git_commit_hash = "db70f7643ac9fb1f61ab79f1de55c3dd8686de8d";
|
|
699
788
|
//#endregion
|
|
700
789
|
//#region src/cli.ts
|
|
701
790
|
var readTargetValues = (value) => {
|
|
@@ -761,7 +850,15 @@ var runBuildCommand = async (commandOptions) => {
|
|
|
761
850
|
if (commandOptions.name !== void 0) buildOptions.appName = commandOptions.name;
|
|
762
851
|
if (commandOptions.appId !== void 0) buildOptions.appId = commandOptions.appId;
|
|
763
852
|
if (commandOptions.packageDirectory !== void 0) buildOptions.packageDirectory = commandOptions.packageDirectory;
|
|
764
|
-
const
|
|
853
|
+
const progressRenderer = require_vite_internals.createMuonProgressRenderer();
|
|
854
|
+
buildOptions.progress = progressRenderer.report;
|
|
855
|
+
const result = await (async () => {
|
|
856
|
+
try {
|
|
857
|
+
return await require_vite_internals.runMuonBuildSequence(buildOptions);
|
|
858
|
+
} finally {
|
|
859
|
+
progressRenderer.flush();
|
|
860
|
+
}
|
|
861
|
+
})();
|
|
765
862
|
if (commandOptions.json === true) console.log(JSON.stringify(result, null, 2));
|
|
766
863
|
else for (const target of result.targets) console.log(target.outputPath);
|
|
767
864
|
};
|
|
@@ -781,6 +878,7 @@ var runPackCommand = async (commandOptions) => {
|
|
|
781
878
|
if (windowsResource !== void 0) packOptions.windowsResource = windowsResource;
|
|
782
879
|
const linuxDesktop = createLinuxDesktopOptions(commandOptions);
|
|
783
880
|
if (linuxDesktop !== void 0) packOptions.linuxDesktop = linuxDesktop;
|
|
881
|
+
if (commandOptions.linuxSandbox !== void 0) packOptions.linuxSandbox = commandOptions.linuxSandbox;
|
|
784
882
|
if (commandOptions.name !== void 0) packOptions.appName = commandOptions.name;
|
|
785
883
|
if (commandOptions.appId !== void 0) packOptions.appId = commandOptions.appId;
|
|
786
884
|
if (commandOptions.packageDirectory !== void 0) packOptions.packageDirectory = commandOptions.packageDirectory;
|
|
@@ -789,7 +887,15 @@ var runPackCommand = async (commandOptions) => {
|
|
|
789
887
|
if (commandOptions.packageVersion !== void 0) packOptions.packageVersion = commandOptions.packageVersion;
|
|
790
888
|
if (commandOptions.description !== void 0) packOptions.description = commandOptions.description;
|
|
791
889
|
if (commandOptions.author !== void 0) packOptions.author = commandOptions.author;
|
|
792
|
-
const
|
|
890
|
+
const progressRenderer = require_vite_internals.createMuonProgressRenderer();
|
|
891
|
+
packOptions.progress = progressRenderer.report;
|
|
892
|
+
const result = await (async () => {
|
|
893
|
+
try {
|
|
894
|
+
return await packMuonApp(packOptions);
|
|
895
|
+
} finally {
|
|
896
|
+
progressRenderer.flush();
|
|
897
|
+
}
|
|
898
|
+
})();
|
|
793
899
|
if (commandOptions.json === true) console.log(JSON.stringify(result, null, 2));
|
|
794
900
|
else for (const artifact of result.artifacts) console.log(artifact.path);
|
|
795
901
|
};
|
|
@@ -868,22 +974,22 @@ var createCliCommand = () => {
|
|
|
868
974
|
program.outputHelp({ error: true });
|
|
869
975
|
process.exitCode = 1;
|
|
870
976
|
});
|
|
871
|
-
program.command("build").description("Build CEF-free
|
|
977
|
+
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("--icon <path>", "static application PNG icon 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) => {
|
|
872
978
|
await runBuildCommand(options);
|
|
873
979
|
});
|
|
874
|
-
program.command("pack").description("Build and package a
|
|
980
|
+
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("--icon <path>", "static application PNG icon 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("--linux-sandbox <mode>", "Linux deb CEF sandbox mode: disabled, setuid").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) => {
|
|
875
981
|
await runPackCommand(options);
|
|
876
982
|
});
|
|
877
|
-
const devCommand = program.command("run").description("Launch
|
|
983
|
+
const devCommand = program.command("run").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) => {
|
|
878
984
|
await runDevCommand(options, devCommand);
|
|
879
985
|
});
|
|
880
|
-
program.command("init").description("Initialize
|
|
986
|
+
program.command("init").description("Initialize muon project helper files").action(async () => {
|
|
881
987
|
await runInitCommand();
|
|
882
988
|
});
|
|
883
|
-
program.command("prepare").description("Prepare a
|
|
989
|
+
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) => {
|
|
884
990
|
await runPrepareCommand(options);
|
|
885
991
|
});
|
|
886
|
-
program.command("embed-config").description("Embed muon.json into
|
|
992
|
+
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) => {
|
|
887
993
|
await runEmbedConfigCommand(options);
|
|
888
994
|
});
|
|
889
995
|
return program;
|