muon-ui 0.12.0 → 0.13.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 +167 -42
- 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/muon-core +0 -0
- package/dist/runtime/linux-arm64/muon-core +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-BK3BM9YY.cjs → vite-internals-6HS7FULY.cjs} +251 -149
- package/dist/vite-internals-6HS7FULY.cjs.map +1 -0
- package/dist/vite.cjs +23 -13
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +237 -157
- package/dist/vite.mjs.map +1 -1
- package/package.json +7 -7
- package/vite.d.ts +43 -0
- package/dist/vite-internals-BK3BM9YY.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.13.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: 8eedbe10e5a89eef8f7061d528518353bd09083e
|
|
10
10
|
*/
|
|
11
|
-
const require_vite_internals = require("./vite-internals-
|
|
11
|
+
const require_vite_internals = require("./vite-internals-6HS7FULY.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");
|
|
@@ -236,35 +236,23 @@ var writeMuonDevOverrideConfig = async (overrideConfigPath, overrideConfig) => {
|
|
|
236
236
|
await (0, node_fs_promises.writeFile)(overrideConfigPath, `${JSON.stringify(overrideConfig, null, 2)}\n`);
|
|
237
237
|
};
|
|
238
238
|
var runMuonExecutable = async (muonExecutablePath, configPaths, environment) => {
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
child.once("error", reject);
|
|
253
|
-
child.once("close", (code) => {
|
|
254
|
-
resolvePromise(code ?? 1);
|
|
255
|
-
});
|
|
239
|
+
const child = (0, node_child_process.spawn)(muonExecutablePath, configPaths.flatMap((configPath) => ["-c", configPath]), {
|
|
240
|
+
cwd: (0, node_path.dirname)(muonExecutablePath),
|
|
241
|
+
env: environment,
|
|
242
|
+
stdio: [
|
|
243
|
+
"ignore",
|
|
244
|
+
"inherit",
|
|
245
|
+
"inherit"
|
|
246
|
+
]
|
|
247
|
+
});
|
|
248
|
+
return await new Promise((resolvePromise, reject) => {
|
|
249
|
+
child.once("error", reject);
|
|
250
|
+
child.once("close", (code) => {
|
|
251
|
+
resolvePromise(code ?? 1);
|
|
256
252
|
});
|
|
257
|
-
}
|
|
258
|
-
return exitCode;
|
|
253
|
+
});
|
|
259
254
|
};
|
|
260
|
-
|
|
261
|
-
* Launches muon directly against local development assets.
|
|
262
|
-
*
|
|
263
|
-
* @param options Development startup options.
|
|
264
|
-
* @returns Development startup result after the muon process exits.
|
|
265
|
-
*/
|
|
266
|
-
var runMuonDev = async (options = {}) => {
|
|
267
|
-
const cwd = (0, node_path.resolve)(options.root ?? process.cwd());
|
|
255
|
+
var runMuonDevOnce = async (options, cwd) => {
|
|
268
256
|
const preparedViteAssets = options.assetSourcePath === void 0 ? await prepareViteRunAssets(cwd) : void 0;
|
|
269
257
|
const loadedViteOptions = preparedViteAssets === void 0 ? await loadViteMuonOptions(cwd) : {
|
|
270
258
|
root: preparedViteAssets.root,
|
|
@@ -321,6 +309,20 @@ var runMuonDev = async (options = {}) => {
|
|
|
321
309
|
exitCode
|
|
322
310
|
};
|
|
323
311
|
};
|
|
312
|
+
/**
|
|
313
|
+
* Launches muon directly against local development assets.
|
|
314
|
+
*
|
|
315
|
+
* @param options Development startup options.
|
|
316
|
+
* @returns Development startup result after the muon process exits.
|
|
317
|
+
*/
|
|
318
|
+
var runMuonDev = async (options = {}) => {
|
|
319
|
+
const cwd = (0, node_path.resolve)(options.root ?? process.cwd());
|
|
320
|
+
let result;
|
|
321
|
+
do
|
|
322
|
+
result = await runMuonDevOnce(options, cwd);
|
|
323
|
+
while (result.exitCode === muonRecycleExitCode);
|
|
324
|
+
return result;
|
|
325
|
+
};
|
|
324
326
|
//#endregion
|
|
325
327
|
//#region src/pack.ts
|
|
326
328
|
var AdmZip = __resolveDefaultExport(adm_zip.default, false);
|
|
@@ -710,7 +712,7 @@ var packageDeb = async (root, target, metadata, artifactsRoot, packageBuildRoot,
|
|
|
710
712
|
var escapeNsis = (value) => value.replaceAll("\\", "\\\\").replaceAll("\"", "$\\\"");
|
|
711
713
|
var nsisUninstallRegistryRoot = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
|
|
712
714
|
var createNsisUninstallRegistryKey = (appId) => `${nsisUninstallRegistryRoot}\\${appId}`;
|
|
713
|
-
var packageNsis = async (root, target, metadata, windowsResource, artifactsRoot, packageBuildRoot, environment, progress) => {
|
|
715
|
+
var packageNsis = async (root, target, metadata, windowsResource, windowsCodeSigning, artifactsRoot, packageBuildRoot, environment, progress) => {
|
|
714
716
|
const descriptor = require_vite_internals.getMuonTargetDescriptor(target.target);
|
|
715
717
|
if (descriptor.os !== "windows") throw new Error(`Unsupported nsis target: ${target.target}`);
|
|
716
718
|
const scriptPath = (0, node_path.join)(packageBuildRoot, "nsis", `${metadata.packageName}-${target.target}.nsi`);
|
|
@@ -723,10 +725,17 @@ var packageNsis = async (root, target, metadata, windowsResource, artifactsRoot,
|
|
|
723
725
|
await (0, node_fs_promises.mkdir)((0, node_path.dirname)(outputPath), { recursive: true });
|
|
724
726
|
const iconPath = (0, node_path.join)((0, node_path.dirname)(scriptPath), `${metadata.packageName}-${target.target}.ico`);
|
|
725
727
|
await require_vite_internals.createWindowsIconFromPngFile(windowsResource.iconPath, iconPath);
|
|
728
|
+
const codeSigningDirectives = await createNsisCodeSigningDirectives({
|
|
729
|
+
root,
|
|
730
|
+
scriptPath,
|
|
731
|
+
target: target.target,
|
|
732
|
+
codeSigning: windowsCodeSigning
|
|
733
|
+
});
|
|
726
734
|
await (0, node_fs_promises.writeFile)(scriptPath, [
|
|
727
735
|
"Unicode true",
|
|
728
736
|
`Name "${escapeNsis(nsisDisplayName)}"`,
|
|
729
737
|
`OutFile "${escapeNsis(outputPath)}"`,
|
|
738
|
+
...codeSigningDirectives,
|
|
730
739
|
`InstallDir "$LOCALAPPDATA\\Programs\\${escapeNsis(nsisInstallDirectoryName)}"`,
|
|
731
740
|
"RequestExecutionLevel user",
|
|
732
741
|
"ShowInstDetails nevershow",
|
|
@@ -797,6 +806,51 @@ var createNsisResourceDirectives = (resource, iconPath) => {
|
|
|
797
806
|
if (resource.copyright !== void 0) lines.push(`VIAddVersionKey /LANG=${resource.language} "LegalCopyright" "${escapeNsis(resource.copyright)}"`);
|
|
798
807
|
return lines;
|
|
799
808
|
};
|
|
809
|
+
var createNsisCodeSigningWrapperScript = (configPath) => [
|
|
810
|
+
"#!/usr/bin/env node",
|
|
811
|
+
"const { readFileSync } = require('node:fs');",
|
|
812
|
+
"const { spawnSync } = require('node:child_process');",
|
|
813
|
+
`const config = JSON.parse(readFileSync(${JSON.stringify(configPath)}, 'utf8'));`,
|
|
814
|
+
"const [kind, target, path] = process.argv.slice(2);",
|
|
815
|
+
"const args = config.args.map((arg) => arg.replaceAll('{path}', path).replaceAll('{target}', target).replaceAll('{kind}', kind));",
|
|
816
|
+
"const result = spawnSync(config.command, args, { cwd: config.cwd, env: process.env, stdio: 'inherit' });",
|
|
817
|
+
"if (result.error) {",
|
|
818
|
+
" console.error(result.error.message);",
|
|
819
|
+
" process.exit(1);",
|
|
820
|
+
"}",
|
|
821
|
+
"process.exit(result.status ?? 1);",
|
|
822
|
+
""
|
|
823
|
+
].join("\n");
|
|
824
|
+
var createNsisCodeSigningDirectiveCommand = (input) => `"${escapeNsis(process.execPath)}" "${escapeNsis(input.wrapperPath)}" "${input.kind}" "${input.target}" "%1"`;
|
|
825
|
+
var createNsisCodeSigningDirectives = async (input) => {
|
|
826
|
+
const codeSigning = input.codeSigning;
|
|
827
|
+
if (codeSigning === void 0) return [];
|
|
828
|
+
const signsInstaller = require_vite_internals.includesWindowsCodeSigningTarget(codeSigning, "nsisInstaller");
|
|
829
|
+
const signsUninstaller = require_vite_internals.includesWindowsCodeSigningTarget(codeSigning, "nsisUninstaller");
|
|
830
|
+
if (!signsInstaller && !signsUninstaller) return [];
|
|
831
|
+
const scriptDirectory = (0, node_path.dirname)(input.scriptPath);
|
|
832
|
+
const configPath = (0, node_path.join)(scriptDirectory, `${(0, node_path.basename)(input.scriptPath)}.sign.json`);
|
|
833
|
+
const wrapperPath = (0, node_path.join)(scriptDirectory, `${(0, node_path.basename)(input.scriptPath)}.sign.cjs`);
|
|
834
|
+
await (0, node_fs_promises.writeFile)(configPath, `${JSON.stringify({
|
|
835
|
+
command: codeSigning.command,
|
|
836
|
+
args: codeSigning.args,
|
|
837
|
+
cwd: input.root
|
|
838
|
+
}, void 0, 2)}\n`);
|
|
839
|
+
await (0, node_fs_promises.writeFile)(wrapperPath, createNsisCodeSigningWrapperScript(configPath));
|
|
840
|
+
await (0, node_fs_promises.chmod)(wrapperPath, 493);
|
|
841
|
+
const lines = [];
|
|
842
|
+
if (signsInstaller) lines.push(`!finalize '${createNsisCodeSigningDirectiveCommand({
|
|
843
|
+
wrapperPath,
|
|
844
|
+
kind: "nsisInstaller",
|
|
845
|
+
target: input.target
|
|
846
|
+
})}' = 0`);
|
|
847
|
+
if (signsUninstaller) lines.push(`!uninstfinalize '${createNsisCodeSigningDirectiveCommand({
|
|
848
|
+
wrapperPath,
|
|
849
|
+
kind: "nsisUninstaller",
|
|
850
|
+
target: input.target
|
|
851
|
+
})}' = 0`);
|
|
852
|
+
return lines;
|
|
853
|
+
};
|
|
800
854
|
var reapplyPackWindowsResources = async (targets, resource, root, environment) => {
|
|
801
855
|
for (const target of targets) {
|
|
802
856
|
const descriptor = require_vite_internals.getMuonTargetDescriptor(target.target);
|
|
@@ -816,6 +870,33 @@ var reapplyPackWindowsResources = async (targets, resource, root, environment) =
|
|
|
816
870
|
}
|
|
817
871
|
}
|
|
818
872
|
};
|
|
873
|
+
var signPackWindowsExecutables = async (targets, codeSigning, root, environment, progress) => {
|
|
874
|
+
if (codeSigning === void 0) return;
|
|
875
|
+
progress?.({
|
|
876
|
+
phase: "pack",
|
|
877
|
+
status: "Signing Windows executables"
|
|
878
|
+
});
|
|
879
|
+
for (const target of targets) {
|
|
880
|
+
const descriptor = require_vite_internals.getMuonTargetDescriptor(target.target);
|
|
881
|
+
if (descriptor.os !== "windows") continue;
|
|
882
|
+
await require_vite_internals.signWindowsExecutable({
|
|
883
|
+
codeSigning,
|
|
884
|
+
kind: "runtime",
|
|
885
|
+
target: target.target,
|
|
886
|
+
path: (0, node_path.join)(target.outputPath, descriptor.runtimeExecutableName),
|
|
887
|
+
cwd: root,
|
|
888
|
+
environment
|
|
889
|
+
});
|
|
890
|
+
await require_vite_internals.signWindowsExecutable({
|
|
891
|
+
codeSigning,
|
|
892
|
+
kind: "launcher",
|
|
893
|
+
target: target.target,
|
|
894
|
+
path: target.launcherPath,
|
|
895
|
+
cwd: root,
|
|
896
|
+
environment
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
};
|
|
819
900
|
var createPortableBuildOptions = (input) => {
|
|
820
901
|
const buildOptions = {
|
|
821
902
|
root: input.project.root,
|
|
@@ -840,8 +921,10 @@ var createPortableBuildOptions = (input) => {
|
|
|
840
921
|
if (input.options.appId !== void 0) buildOptions.appId = input.options.appId;
|
|
841
922
|
if (input.options.packageDirectory !== void 0) buildOptions.packageDirectory = input.options.packageDirectory;
|
|
842
923
|
if (input.windowsResourceOptions !== void 0) buildOptions.windowsResource = input.windowsResourceOptions;
|
|
924
|
+
if (input.windowsCodeSigningOptions !== void 0) buildOptions.windowsCodeSigning = input.windowsCodeSigningOptions;
|
|
843
925
|
if (input.linuxDesktopOptions !== void 0) buildOptions.linuxDesktop = input.linuxDesktopOptions;
|
|
844
926
|
if (input.progress !== void 0) buildOptions.progress = input.progress;
|
|
927
|
+
buildOptions.environment = input.environment;
|
|
845
928
|
buildOptions.browserProfilePathOverride = portableProfilePath;
|
|
846
929
|
return buildOptions;
|
|
847
930
|
};
|
|
@@ -858,8 +941,10 @@ var buildPortableTargets = async (input) => {
|
|
|
858
941
|
outputRoot: (0, node_path.join)(input.packageBuildRoot, "portable-build"),
|
|
859
942
|
targets: input.targets,
|
|
860
943
|
windowsResourceOptions: input.windowsResourceOptions,
|
|
944
|
+
windowsCodeSigningOptions: input.windowsCodeSigningOptions,
|
|
861
945
|
linuxDesktopOptions: input.linuxDesktopOptions,
|
|
862
946
|
iconPath: input.iconPath,
|
|
947
|
+
environment: input.environment,
|
|
863
948
|
progress: input.progress
|
|
864
949
|
}));
|
|
865
950
|
await Promise.all(build.targets.map(writePortableInstallMetadata));
|
|
@@ -893,6 +978,7 @@ var packMuonApp = async (options) => {
|
|
|
893
978
|
includeRuntimeHelper: linuxSandbox === "setuid"
|
|
894
979
|
};
|
|
895
980
|
const windowsResourceOptions = require_vite_internals.mergeMuonWindowsResourceOptions(options.windowsResource, pluginBuildOptions.windowsResource);
|
|
981
|
+
const windowsCodeSigningOptions = options.windowsCodeSigning !== void 0 ? options.windowsCodeSigning : pluginBuildOptions.windowsCodeSigning;
|
|
896
982
|
const linuxDesktopOptions = require_vite_internals.mergeMuonLinuxDesktopOptions(options.linuxDesktop, pluginBuildOptions.linuxDesktop);
|
|
897
983
|
const iconPath = options.iconPath ?? pluginBuildOptions.iconPath;
|
|
898
984
|
if (options.configPath !== void 0) buildOptions.configPath = options.configPath;
|
|
@@ -901,8 +987,10 @@ var packMuonApp = async (options) => {
|
|
|
901
987
|
if (options.appId !== void 0) buildOptions.appId = options.appId;
|
|
902
988
|
if (options.packageDirectory !== void 0) buildOptions.packageDirectory = options.packageDirectory;
|
|
903
989
|
if (windowsResourceOptions !== void 0) buildOptions.windowsResource = windowsResourceOptions;
|
|
990
|
+
if (windowsCodeSigningOptions !== void 0) buildOptions.windowsCodeSigning = windowsCodeSigningOptions;
|
|
904
991
|
if (linuxDesktopOptions !== void 0) buildOptions.linuxDesktop = linuxDesktopOptions;
|
|
905
992
|
if (progress !== void 0) buildOptions.progress = progress;
|
|
993
|
+
buildOptions.environment = environment;
|
|
906
994
|
const windowsResourceConfig = await require_vite_internals.readMuonConfigForWindowsResource(root, options.configPath);
|
|
907
995
|
const windowsResource = await require_vite_internals.resolveMuonWindowsResource({
|
|
908
996
|
root,
|
|
@@ -920,12 +1008,19 @@ var packMuonApp = async (options) => {
|
|
|
920
1008
|
copyright: void 0
|
|
921
1009
|
}
|
|
922
1010
|
});
|
|
1011
|
+
const windowsCodeSigning = require_vite_internals.resolveMuonWindowsCodeSigning({
|
|
1012
|
+
muonConfig: windowsResourceConfig.config,
|
|
1013
|
+
options: windowsCodeSigningOptions
|
|
1014
|
+
});
|
|
923
1015
|
progress?.({
|
|
924
1016
|
phase: "pack",
|
|
925
1017
|
status: "Building distributions"
|
|
926
1018
|
});
|
|
927
1019
|
const build = await require_vite_internals.runMuonBuildSequence(buildOptions, project);
|
|
928
|
-
if (options.packageVersion !== void 0)
|
|
1020
|
+
if (options.packageVersion !== void 0) {
|
|
1021
|
+
await reapplyPackWindowsResources(build.targets, windowsResource, root, environment);
|
|
1022
|
+
await signPackWindowsExecutables(build.targets, windowsCodeSigning, root, environment, progress);
|
|
1023
|
+
}
|
|
929
1024
|
const typesByTarget = new Map(targetPlan.map((entry) => [entry.target, entry.types]));
|
|
930
1025
|
const portableTargets = targetPlan.filter((entry) => entry.types.some(isPortablePackType)).map((entry) => entry.target);
|
|
931
1026
|
await (0, node_fs_promises.rm)(packageBuildRoot, {
|
|
@@ -948,11 +1043,16 @@ var packMuonApp = async (options) => {
|
|
|
948
1043
|
packageBuildRoot,
|
|
949
1044
|
targets: portableTargets,
|
|
950
1045
|
windowsResourceOptions,
|
|
1046
|
+
windowsCodeSigningOptions,
|
|
951
1047
|
linuxDesktopOptions,
|
|
952
1048
|
iconPath,
|
|
1049
|
+
environment,
|
|
953
1050
|
progress
|
|
954
1051
|
});
|
|
955
|
-
if (options.packageVersion !== void 0)
|
|
1052
|
+
if (options.packageVersion !== void 0) {
|
|
1053
|
+
await reapplyPackWindowsResources([...portableTargetsByTarget.values()], windowsResource, root, environment);
|
|
1054
|
+
await signPackWindowsExecutables([...portableTargetsByTarget.values()], windowsCodeSigning, root, environment, progress);
|
|
1055
|
+
}
|
|
956
1056
|
const artifacts = [];
|
|
957
1057
|
const totalArtifacts = targetPlan.reduce((sum, entry) => sum + entry.types.length, 0);
|
|
958
1058
|
let artifactIndex = 0;
|
|
@@ -972,7 +1072,7 @@ var packMuonApp = async (options) => {
|
|
|
972
1072
|
if (portableTarget === void 0) throw new Error(`Portable target was not built: ${target.target}`);
|
|
973
1073
|
artifact = await packageTarGz(portableTarget, metadata, artifactsRoot);
|
|
974
1074
|
} else if (type === "deb") artifact = await packageDeb(root, target, metadata, artifactsRoot, packageBuildRoot, environment, linuxSandbox, progress);
|
|
975
|
-
else artifact = await packageNsis(root, target, metadata, windowsResource, artifactsRoot, packageBuildRoot, environment, progress);
|
|
1075
|
+
else artifact = await packageNsis(root, target, metadata, windowsResource, windowsCodeSigning, artifactsRoot, packageBuildRoot, environment, progress);
|
|
976
1076
|
if (artifact === void 0) continue;
|
|
977
1077
|
artifacts.push(artifact);
|
|
978
1078
|
progress?.({
|
|
@@ -993,8 +1093,8 @@ var packMuonApp = async (options) => {
|
|
|
993
1093
|
};
|
|
994
1094
|
//#endregion
|
|
995
1095
|
//#region src/generated/packageMetadata.ts
|
|
996
|
-
var version = "0.
|
|
997
|
-
var git_commit_hash = "
|
|
1096
|
+
var version = "0.13.0";
|
|
1097
|
+
var git_commit_hash = "8eedbe10e5a89eef8f7061d528518353bd09083e";
|
|
998
1098
|
//#endregion
|
|
999
1099
|
//#region src/cli.ts
|
|
1000
1100
|
var readTargetValues = (value) => {
|
|
@@ -1006,6 +1106,12 @@ var appendTargetValues = (value, previous) => {
|
|
|
1006
1106
|
var appendPackTypeValues = (value, previous) => {
|
|
1007
1107
|
return [...previous ?? [], ...readTargetValues(value)];
|
|
1008
1108
|
};
|
|
1109
|
+
var appendWindowsSignArgValue = (value, previous) => {
|
|
1110
|
+
return [...previous ?? [], value];
|
|
1111
|
+
};
|
|
1112
|
+
var appendWindowsSignTargetValues = (value, previous) => {
|
|
1113
|
+
return [...previous ?? [], ...readTargetValues(value)];
|
|
1114
|
+
};
|
|
1009
1115
|
var readCommaSeparatedValues = (value) => value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
1010
1116
|
var readBooleanValue = (value, label) => {
|
|
1011
1117
|
const normalized = value.trim().toLowerCase();
|
|
@@ -1040,7 +1146,22 @@ var createLinuxDesktopOptions = (commandOptions) => {
|
|
|
1040
1146
|
if (commandOptions.linuxStartupNotify !== void 0) options.startupNotify = readBooleanValue(commandOptions.linuxStartupNotify, "--linux-startup-notify");
|
|
1041
1147
|
return Object.keys(options).length === 0 ? void 0 : options;
|
|
1042
1148
|
};
|
|
1043
|
-
var
|
|
1149
|
+
var createWindowsCodeSigningOptions = (commandOptions, command) => {
|
|
1150
|
+
if (command.getOptionValueSource("windowsCodeSigning") === "cli" && commandOptions.windowsCodeSigning === false) return false;
|
|
1151
|
+
const args = commandOptions.windowsSignArg ?? [];
|
|
1152
|
+
const targets = commandOptions.windowsSignTarget ?? [];
|
|
1153
|
+
if (commandOptions.windowsSignCommand === void 0) {
|
|
1154
|
+
if (args.length > 0 || targets.length > 0) throw new Error("--windows-sign-command is required when Windows signing arguments or targets are specified.");
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
const options = {
|
|
1158
|
+
command: commandOptions.windowsSignCommand,
|
|
1159
|
+
args
|
|
1160
|
+
};
|
|
1161
|
+
if (targets.length > 0) options.targets = targets;
|
|
1162
|
+
return options;
|
|
1163
|
+
};
|
|
1164
|
+
var runBuildCommand = async (commandOptions, command) => {
|
|
1044
1165
|
const targets = commandOptions.target;
|
|
1045
1166
|
if (commandOptions.all === true && targets.length > 0) throw new Error("Specify either --all or --target, not both.");
|
|
1046
1167
|
const buildOptions = {
|
|
@@ -1054,6 +1175,8 @@ var runBuildCommand = async (commandOptions) => {
|
|
|
1054
1175
|
if (commandOptions.icon !== void 0) buildOptions.iconPath = commandOptions.icon;
|
|
1055
1176
|
const windowsResource = createWindowsResourceOptions(commandOptions);
|
|
1056
1177
|
if (windowsResource !== void 0) buildOptions.windowsResource = windowsResource;
|
|
1178
|
+
const windowsCodeSigning = createWindowsCodeSigningOptions(commandOptions, command);
|
|
1179
|
+
if (windowsCodeSigning !== void 0) buildOptions.windowsCodeSigning = windowsCodeSigning;
|
|
1057
1180
|
const linuxDesktop = createLinuxDesktopOptions(commandOptions);
|
|
1058
1181
|
if (linuxDesktop !== void 0) buildOptions.linuxDesktop = linuxDesktop;
|
|
1059
1182
|
if (commandOptions.outDir !== void 0) buildOptions.outputRoot = commandOptions.outDir;
|
|
@@ -1072,7 +1195,7 @@ var runBuildCommand = async (commandOptions) => {
|
|
|
1072
1195
|
if (commandOptions.json === true) console.log(JSON.stringify(result, null, 2));
|
|
1073
1196
|
else for (const target of result.targets) console.log(target.outputPath);
|
|
1074
1197
|
};
|
|
1075
|
-
var runPackCommand = async (commandOptions) => {
|
|
1198
|
+
var runPackCommand = async (commandOptions, command) => {
|
|
1076
1199
|
const targets = commandOptions.target;
|
|
1077
1200
|
if (commandOptions.all === true && targets.length > 0) throw new Error("Specify either --all or --target, not both.");
|
|
1078
1201
|
const packOptions = {
|
|
@@ -1086,6 +1209,8 @@ var runPackCommand = async (commandOptions) => {
|
|
|
1086
1209
|
if (commandOptions.icon !== void 0) packOptions.iconPath = commandOptions.icon;
|
|
1087
1210
|
const windowsResource = createWindowsResourceOptions(commandOptions);
|
|
1088
1211
|
if (windowsResource !== void 0) packOptions.windowsResource = windowsResource;
|
|
1212
|
+
const windowsCodeSigning = createWindowsCodeSigningOptions(commandOptions, command);
|
|
1213
|
+
if (windowsCodeSigning !== void 0) packOptions.windowsCodeSigning = windowsCodeSigning;
|
|
1089
1214
|
const linuxDesktop = createLinuxDesktopOptions(commandOptions);
|
|
1090
1215
|
if (linuxDesktop !== void 0) packOptions.linuxDesktop = linuxDesktop;
|
|
1091
1216
|
if (commandOptions.linuxSandbox !== void 0) packOptions.linuxSandbox = commandOptions.linuxSandbox;
|
|
@@ -1184,11 +1309,11 @@ var createCliCommand = () => {
|
|
|
1184
1309
|
program.outputHelp({ error: true });
|
|
1185
1310
|
process.exitCode = 1;
|
|
1186
1311
|
});
|
|
1187
|
-
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) => {
|
|
1188
|
-
await runBuildCommand(options);
|
|
1312
|
+
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("--windows-sign-command <command>", "Windows code signing command").option("--windows-sign-arg <arg>", "Windows code signing command argument", appendWindowsSignArgValue).option("--windows-sign-target <target>", "Windows code signing target or comma-separated targets", appendWindowsSignTargetValues).option("--no-windows-code-signing", "disable muon.json Windows signing").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, command) => {
|
|
1313
|
+
await runBuildCommand(options, command);
|
|
1189
1314
|
});
|
|
1190
|
-
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) => {
|
|
1191
|
-
await runPackCommand(options);
|
|
1315
|
+
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("--windows-sign-command <command>", "Windows code signing command").option("--windows-sign-arg <arg>", "Windows code signing command argument", appendWindowsSignArgValue).option("--windows-sign-target <target>", "Windows code signing target or comma-separated targets", appendWindowsSignTargetValues).option("--no-windows-code-signing", "disable muon.json Windows signing").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, command) => {
|
|
1316
|
+
await runPackCommand(options, command);
|
|
1192
1317
|
});
|
|
1193
1318
|
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) => {
|
|
1194
1319
|
await runDevCommand(options, devCommand);
|