muon-ui 0.5.0 → 0.6.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 +5 -5
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/native/linux64/muon-bootstrap +0 -0
- package/dist/native/linux64/muon-prepare +0 -0
- package/dist/native/linuxarm/muon-bootstrap +0 -0
- package/dist/native/linuxarm/muon-prepare +0 -0
- package/dist/native/linuxarm64/muon-bootstrap +0 -0
- package/dist/native/linuxarm64/muon-prepare +0 -0
- package/dist/native/windows32/muon-bootstrap.exe +0 -0
- package/dist/native/windows32/muon-prepare.exe +0 -0
- package/dist/native/windows64/muon-bootstrap.exe +0 -0
- package/dist/native/windows64/muon-prepare.exe +0 -0
- package/dist/runtime/linux64/muon-core +0 -0
- package/dist/runtime/linuxarm/muon-core +0 -0
- package/dist/runtime/linuxarm64/muon-core +0 -0
- package/dist/runtime/windows32/libcardio.dll +0 -0
- package/dist/runtime/windows32/libmuon-ui.dll +0 -0
- package/dist/runtime/windows32/muon-core.exe +0 -0
- package/dist/runtime/windows64/libcardio.dll +0 -0
- package/dist/runtime/windows64/libmuon-ui.dll +0 -0
- package/dist/runtime/windows64/muon-core.exe +0 -0
- package/dist/{vite-options-D4u4kLQI.cjs → vite-options-KNDVcH-e.cjs} +4 -4
- package/dist/{vite-options-D4u4kLQI.cjs.map → vite-options-KNDVcH-e.cjs.map} +1 -1
- package/dist/vite.cjs +3 -3
- package/dist/vite.mjs +3 -3
- package/dist/vite.mjs.map +1 -1
- package/package.json +7 -7
- /package/dist/runtime/linux64/{LICENSE_muon → CREDITS.md} +0 -0
- /package/dist/runtime/linuxarm/{LICENSE_muon → CREDITS.md} +0 -0
- /package/dist/runtime/linuxarm64/{LICENSE_muon → CREDITS.md} +0 -0
- /package/dist/runtime/windows32/{LICENSE_muon → CREDITS.md} +0 -0
- /package/dist/runtime/windows64/{LICENSE_muon → CREDITS.md} +0 -0
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.6.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: 44340328835f0d4ee860b444916971dfa03486ef
|
|
10
10
|
*/
|
|
11
|
-
const require_vite_options = require("./vite-options-
|
|
11
|
+
const require_vite_options = require("./vite-options-KNDVcH-e.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");
|
|
@@ -245,8 +245,8 @@ var runMuonDev = async (options = {}) => {
|
|
|
245
245
|
};
|
|
246
246
|
//#endregion
|
|
247
247
|
//#region src/generated/packageMetadata.ts
|
|
248
|
-
var version = "0.
|
|
249
|
-
var git_commit_hash = "
|
|
248
|
+
var version = "0.6.0";
|
|
249
|
+
var git_commit_hash = "44340328835f0d4ee860b444916971dfa03486ef";
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region src/cli.ts
|
|
252
252
|
var readTargetValues = (value) => {
|
package/dist/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.cjs","names":[],"sources":["../src/dev.ts","../src/generated/packageMetadata.ts","../src/cli.ts"],"sourcesContent":["// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { spawn } from \"node:child_process\";\nimport { constants } from \"node:fs\";\nimport { access, mkdir, readFile, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\n\nimport { parse } from \"json5\";\nimport type { UserConfig } from \"vite\";\n\nimport { ensureMuonGitignoreEntry } from \"./gitignore.js\";\nimport { getDefaultMuonPrepareTarget, runMuonPrepare } from \"./prepare.js\";\nimport {\n getMuonExecutablePath,\n resolveMuonRuntimePath,\n} from \"./vite-internals.js\";\nimport {\n flattenVitePluginOptions,\n getMuonVitePluginOptions,\n} from \"./vite-options.js\";\nimport type { MuonVitePluginOptions } from \"./vite.js\";\n\nconst muonRecycleExitCode = 88;\n\ntype JsonObject = Record<string, unknown>;\n\ninterface LoadedViteMuonOptions {\n root: string;\n pluginOptions: MuonVitePluginOptions | undefined;\n}\n\ninterface ProjectConfigResolution {\n configPath: string | undefined;\n config: JsonObject | undefined;\n}\n\ninterface MuonDevOverrideConfig {\n asset?: {\n sourcePath: string;\n };\n cdp?: {\n enable: true;\n };\n browser?: {\n keybind: {\n devtools: \"f12\";\n recycle: \"ctrl+f12\";\n };\n };\n}\n\n/**\n * Options for launching Muon directly against local development assets.\n */\nexport interface MuonDevOptions {\n /**\n * Directory used as the project root.\n */\n root?: string;\n\n /**\n * Directory containing muon-core runtime files such as muon-core and plugins.\n */\n muonPath?: string;\n\n /**\n * Directory containing CEF files, or a CEF archive root with Release/Resources.\n */\n cefPath?: string;\n\n /**\n * Runtime staging directory used for development startup.\n */\n stagePath?: string;\n\n /**\n * Muon config path passed before the generated development override.\n */\n configPath?: string;\n\n /**\n * Local development asset directory.\n */\n assetSourcePath?: string;\n\n /**\n * Enable the Muon debugger defaults during development startup.\n */\n enableDebugger?: boolean;\n\n /**\n * Platform used for runtime target resolution.\n *\n * @remarks This is injectable for tests. Production code uses process.platform.\n */\n platform?: NodeJS.Platform;\n\n /**\n * Architecture used for runtime target resolution.\n *\n * @remarks This is injectable for tests. Production code uses process.arch.\n */\n architecture?: NodeJS.Architecture;\n\n /**\n * Environment used for child processes.\n */\n environment?: NodeJS.ProcessEnv;\n\n /**\n * Suppress native prepare progress messages.\n */\n quietPrepare?: boolean;\n}\n\n/**\n * Result returned after the Muon development process exits.\n */\nexport interface MuonDevResult {\n /**\n * Absolute project root used for development startup.\n */\n root: string;\n\n /**\n * Muon runtime target used for prepare.\n */\n target: string;\n\n /**\n * Directory containing muon-core files used as the staging source.\n */\n muonPath: string;\n\n /**\n * Directory or cached archive containing CEF files used as the staging source.\n */\n cefPath: string;\n\n /**\n * Directory containing the prepared Muon runtime.\n */\n stagePath: string;\n\n /**\n * Prepared muon-core executable path.\n */\n muonExecutablePath: string;\n\n /**\n * Project config path passed before the generated development override.\n */\n projectConfigPath?: string;\n\n /**\n * Generated development override config path.\n */\n overrideConfigPath: string;\n\n /**\n * Effective local asset source path.\n */\n assetSourcePath: string;\n\n /**\n * Exit code returned by the Muon process.\n */\n exitCode: number;\n}\n\nconst defaultProjectConfigFileNames = [\"muon.json5\", \"muon.jsonc\", \"muon.json\"];\n\nconst resolveFromRoot = (root: string, path: string): string =>\n isAbsolute(path) ? path : resolve(root, path);\n\nconst isJsonObject = (value: unknown): value is JsonObject =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst getErrorMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n\nconst fileExists = async (path: string): Promise<boolean> => {\n try {\n const stats = await stat(path);\n return stats.isFile();\n } catch {\n return false;\n }\n};\n\nconst directoryExists = async (path: string): Promise<boolean> => {\n try {\n const stats = await stat(path);\n return stats.isDirectory();\n } catch {\n return false;\n }\n};\n\nconst isMissingVitePackageError = (error: unknown): boolean => {\n const candidate = error as { code?: unknown; message?: unknown };\n return (\n candidate.code === \"ERR_MODULE_NOT_FOUND\" &&\n typeof candidate.message === \"string\" &&\n candidate.message.includes(\"vite\")\n );\n};\n\nconst loadViteMuonOptions = async (\n cwd: string,\n): Promise<LoadedViteMuonOptions> => {\n let vite: typeof import(\"vite\");\n try {\n vite = await import(\"vite\");\n } catch (error) {\n if (isMissingVitePackageError(error)) {\n return {\n root: resolve(cwd),\n pluginOptions: undefined,\n };\n }\n throw error;\n }\n\n const loaded = await vite.loadConfigFromFile(\n {\n command: \"serve\",\n mode: \"development\",\n isPreview: false,\n isSsrBuild: false,\n },\n undefined,\n cwd,\n \"silent\",\n );\n if (loaded === null) {\n return {\n root: resolve(cwd),\n pluginOptions: undefined,\n };\n }\n\n const config = loaded.config as UserConfig;\n const root =\n typeof config.root === \"string\" ? resolve(cwd, config.root) : resolve(cwd);\n const plugins = await flattenVitePluginOptions(config.plugins);\n const muonPlugins = plugins\n .map((plugin) => getMuonVitePluginOptions(plugin))\n .filter(\n (pluginOptions): pluginOptions is MuonVitePluginOptions =>\n pluginOptions !== undefined,\n );\n\n if (muonPlugins.length > 1) {\n throw new Error(\n \"Multiple muon() plugin definitions were found in vite.config.*.\",\n );\n }\n\n return {\n root,\n pluginOptions: muonPlugins[0],\n };\n};\n\nconst resolveProjectConfigPath = async (\n root: string,\n configPath: string | undefined,\n): Promise<string | undefined> => {\n if (configPath !== undefined) {\n const resolvedPath = resolveFromRoot(root, configPath);\n if (!(await fileExists(resolvedPath))) {\n throw new Error(`Muon config file does not exist: ${resolvedPath}`);\n }\n return resolvedPath;\n }\n\n for (const fileName of defaultProjectConfigFileNames) {\n const candidatePath = join(root, fileName);\n if (await fileExists(candidatePath)) {\n return candidatePath;\n }\n }\n\n return undefined;\n};\n\nconst readJsonObjectFile = async (\n filePath: string,\n label: string,\n): Promise<JsonObject> => {\n let content: string;\n try {\n content = await readFile(filePath, \"utf8\");\n } catch (error) {\n throw new Error(\n `${label} could not be read: ${filePath}: ${getErrorMessage(error)}`,\n );\n }\n\n let parsed: unknown;\n try {\n parsed = parse(content);\n } catch (error) {\n throw new Error(\n `${label} could not be parsed: ${filePath}: ${getErrorMessage(error)}`,\n );\n }\n\n if (!isJsonObject(parsed)) {\n throw new Error(`${label} must contain a JSON object: ${filePath}`);\n }\n\n return parsed;\n};\n\nconst resolveProjectConfig = async (\n root: string,\n configPath: string | undefined,\n): Promise<ProjectConfigResolution> => {\n const resolvedConfigPath = await resolveProjectConfigPath(root, configPath);\n if (resolvedConfigPath === undefined) {\n return {\n configPath: undefined,\n config: undefined,\n };\n }\n\n return {\n configPath: resolvedConfigPath,\n config: await readJsonObjectFile(resolvedConfigPath, \"muon config\"),\n };\n};\n\nconst readConfigAssetSourcePath = (\n config: JsonObject | undefined,\n): string | undefined => {\n if (config === undefined) {\n return undefined;\n }\n\n const asset = config.asset;\n if (asset === undefined) {\n return undefined;\n }\n if (!isJsonObject(asset)) {\n throw new Error(\"muon config asset must be an object when present.\");\n }\n\n const sourcePath = asset.sourcePath;\n if (sourcePath === undefined) {\n return undefined;\n }\n if (typeof sourcePath !== \"string\") {\n throw new Error(\"muon config asset.sourcePath must be a string.\");\n }\n if (sourcePath.trim().length === 0) {\n throw new Error(\"muon config asset.sourcePath must not be empty.\");\n }\n return sourcePath;\n};\n\nconst assertDevelopmentAssetDirectory = async (\n assetSourcePath: string,\n): Promise<void> => {\n if (await directoryExists(assetSourcePath)) {\n return;\n }\n\n try {\n await access(assetSourcePath, constants.F_OK);\n } catch {\n throw new Error(`Muon dev asset source does not exist: ${assetSourcePath}`);\n }\n\n throw new Error(\n `Muon dev asset source must be a directory: ${assetSourcePath}`,\n );\n};\n\nconst resolveAssetSource = async (\n root: string,\n assetSourcePath: string | undefined,\n projectConfig: ProjectConfigResolution,\n): Promise<{\n assetSourcePath: string;\n overrideAssetSourcePath: string | undefined;\n}> => {\n const configuredAssetSourcePath = readConfigAssetSourcePath(\n projectConfig.config,\n );\n if (assetSourcePath !== undefined) {\n const resolvedPath = resolveFromRoot(root, assetSourcePath);\n await assertDevelopmentAssetDirectory(resolvedPath);\n return {\n assetSourcePath: resolvedPath,\n overrideAssetSourcePath: resolvedPath,\n };\n }\n\n if (\n configuredAssetSourcePath !== undefined &&\n projectConfig.configPath !== undefined\n ) {\n return {\n assetSourcePath: resolve(\n dirname(projectConfig.configPath),\n configuredAssetSourcePath,\n ),\n overrideAssetSourcePath: undefined,\n };\n }\n\n const defaultAssetSourcePath = resolve(root, \"assets\");\n await assertDevelopmentAssetDirectory(defaultAssetSourcePath);\n return {\n assetSourcePath: defaultAssetSourcePath,\n overrideAssetSourcePath: defaultAssetSourcePath,\n };\n};\n\nconst createMuonDevOverrideConfig = (\n assetSourcePath: string | undefined,\n enableDebugger: boolean,\n): MuonDevOverrideConfig => ({\n ...(assetSourcePath === undefined\n ? {}\n : {\n asset: {\n sourcePath: assetSourcePath,\n },\n }),\n ...(enableDebugger\n ? {\n cdp: {\n enable: true,\n },\n browser: {\n keybind: {\n devtools: \"f12\",\n recycle: \"ctrl+f12\",\n },\n },\n }\n : {}),\n});\n\nconst writeMuonDevOverrideConfig = async (\n overrideConfigPath: string,\n overrideConfig: MuonDevOverrideConfig,\n): Promise<void> => {\n await mkdir(dirname(overrideConfigPath), { recursive: true });\n await writeFile(\n overrideConfigPath,\n `${JSON.stringify(overrideConfig, null, 2)}\\n`,\n );\n};\n\nconst runMuonExecutable = async (\n muonExecutablePath: string,\n configPaths: readonly string[],\n environment: NodeJS.ProcessEnv,\n): Promise<number> => {\n const args = configPaths.flatMap((configPath) => [\"-c\", configPath]);\n let exitCode = 0;\n do {\n const child = spawn(muonExecutablePath, args, {\n cwd: dirname(muonExecutablePath),\n env: environment,\n stdio: [\"ignore\", \"inherit\", \"inherit\"],\n });\n\n exitCode = await new Promise<number>((resolvePromise, reject) => {\n child.once(\"error\", reject);\n child.once(\"close\", (code) => {\n resolvePromise(code ?? 1);\n });\n });\n } while (exitCode === muonRecycleExitCode);\n return exitCode;\n};\n\n/**\n * Launches Muon directly against local development assets.\n *\n * @param options Development startup options.\n * @returns Development startup result after the Muon process exits.\n */\nexport const runMuonDev = async (\n options: MuonDevOptions = {},\n): Promise<MuonDevResult> => {\n const cwd = resolve(options.root ?? process.cwd());\n const loadedViteOptions = await loadViteMuonOptions(cwd);\n const root = loadedViteOptions.root;\n const pluginOptions = loadedViteOptions.pluginOptions;\n const platform = options.platform ?? process.platform;\n const architecture = options.architecture ?? process.arch;\n const environment = options.environment ?? process.env;\n const target = getDefaultMuonPrepareTarget(platform, architecture);\n const muonPath = resolveMuonRuntimePath({\n root,\n target,\n muonPath: options.muonPath ?? pluginOptions?.muonPath,\n });\n const cefPath =\n options.cefPath !== undefined\n ? resolveFromRoot(root, options.cefPath)\n : pluginOptions?.cefPath === undefined\n ? undefined\n : resolveFromRoot(root, pluginOptions.cefPath);\n const stagePath =\n options.stagePath !== undefined\n ? resolveFromRoot(root, options.stagePath)\n : pluginOptions?.stagePath === undefined\n ? resolve(root, \".muon\", target)\n : resolveFromRoot(root, pluginOptions.stagePath);\n const enableDebugger =\n options.enableDebugger ?? pluginOptions?.enableDebugger ?? true;\n const projectConfig = await resolveProjectConfig(root, options.configPath);\n const asset = await resolveAssetSource(\n root,\n options.assetSourcePath,\n projectConfig,\n );\n const overrideConfigPath = join(root, \".muon\", \"dev\", \"muon.dev.json\");\n\n await ensureMuonGitignoreEntry(root);\n\n const preparedRuntime = await runMuonPrepare({\n muonPath,\n cefPath,\n stageDir: stagePath,\n target,\n cacheDir: environment.MUON_CACHE_DIR,\n force: false,\n quiet: options.quietPrepare === true,\n prepareExecutablePath: undefined,\n environment,\n cwd: root,\n });\n if (preparedRuntime.stagePath === undefined) {\n throw new Error(\"muon-prepare did not return a staged runtime path.\");\n }\n\n await writeMuonDevOverrideConfig(\n overrideConfigPath,\n createMuonDevOverrideConfig(asset.overrideAssetSourcePath, enableDebugger),\n );\n const muonExecutablePath = getMuonExecutablePath(\n preparedRuntime.stagePath,\n platform,\n );\n const configPaths = [\n ...(projectConfig.configPath === undefined\n ? []\n : [projectConfig.configPath]),\n overrideConfigPath,\n ];\n const exitCode = await runMuonExecutable(\n muonExecutablePath,\n configPaths,\n environment,\n );\n\n return {\n root,\n target,\n muonPath: preparedRuntime.muonPath,\n cefPath: preparedRuntime.cefPath,\n stagePath: preparedRuntime.stagePath,\n muonExecutablePath,\n ...(projectConfig.configPath === undefined\n ? {}\n : { projectConfigPath: projectConfig.configPath }),\n overrideConfigPath,\n assetSourcePath: asset.assetSourcePath,\n exitCode,\n };\n};\n","// @ts-nocheck\n// This file is auto-generated by screw-up plugin\n// Do not edit manually\n\nexport const name = \"muon-ui\";\nexport const version = \"0.5.0\";\nexport const description = \"A multi-platform GUI application framework that uses CEF as its backend\";\nexport const author = \"Kouji Matsui (@kekyo@mi.kekyo.net)\";\nexport const license = \"MIT\";\nexport const repository_url = \"https://github.com/kekyo/muon-ui.git\";\nexport const git_commit_hash = \"122830dc7b35ced0c4c88c91d3a9dd8b3dee18e2\";\n","#!/usr/bin/env node\n// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { Command } from \"commander\";\n\nimport {\n getDefaultMuonPrepareTarget,\n runMuonPrepare,\n type MuonPrepareOptions,\n} from \"./prepare.js\";\nimport { ensureMuonGitignoreEntry } from \"./gitignore.js\";\nimport {\n embedMuonConfigInBootstrapFile,\n embedMuonConfigInCoreFile,\n embedMuonConfigInRuntime,\n type EmbedMuonConfigResult,\n} from \"./embed-config.js\";\nimport { buildMuonApp, type MuonBuildOptions } from \"./build.js\";\nimport { runMuonDev, type MuonDevOptions } from \"./dev.js\";\nimport { git_commit_hash, version } from \"./generated/packageMetadata.js\";\n\ninterface PrepareCommandOptions {\n muonPath: string | undefined;\n cefPath: string | undefined;\n stageDir: string | undefined;\n target: string | undefined;\n cacheDir: string | undefined;\n force: boolean | undefined;\n quiet: boolean | undefined;\n json: boolean | undefined;\n}\n\ninterface EmbedConfigCommandOptions {\n runtimePath: string | undefined;\n corePath: string | undefined;\n bootstrapPath: string | undefined;\n config: string | undefined;\n outputRuntimePath: string | undefined;\n output: string | undefined;\n outputBootstrap: string | undefined;\n json: boolean | undefined;\n}\n\ninterface BuildCommandOptions {\n target: string[];\n all: boolean | undefined;\n assets: string | undefined;\n config: string | undefined;\n outDir: string | undefined;\n name: string | undefined;\n json: boolean | undefined;\n}\n\ninterface DevCommandOptions {\n muonPath: string | undefined;\n cefPath: string | undefined;\n stageDir: string | undefined;\n config: string | undefined;\n assets: string | undefined;\n debugger: boolean | undefined;\n json: boolean | undefined;\n}\n\nconst readTargetValues = (value: string): string[] => {\n return value\n .split(\",\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n};\n\nconst appendTargetValues = (value: string, previous: string[]): string[] => {\n return [...previous, ...readTargetValues(value)];\n};\n\nconst validateEmbedConfigOptions = (\n options: EmbedConfigCommandOptions,\n): void => {\n if (options.runtimePath !== undefined && options.corePath !== undefined) {\n throw new Error(\"Specify at most one of --runtime-path or --core-path.\");\n }\n if (\n options.runtimePath === undefined &&\n options.corePath === undefined &&\n options.bootstrapPath === undefined\n ) {\n throw new Error(\n \"Specify at least one of --runtime-path, --core-path, or --bootstrap-path.\",\n );\n }\n if (\n options.corePath !== undefined &&\n options.outputRuntimePath !== undefined\n ) {\n throw new Error(\"--output-runtime-path requires --runtime-path.\");\n }\n if (options.runtimePath !== undefined && options.output !== undefined) {\n throw new Error(\"--output requires --core-path.\");\n }\n if (\n options.bootstrapPath === undefined &&\n options.outputBootstrap !== undefined\n ) {\n throw new Error(\"--output-bootstrap requires --bootstrap-path.\");\n }\n};\n\nconst runBuildCommand = async (\n commandOptions: BuildCommandOptions,\n): Promise<void> => {\n const targets = commandOptions.target;\n if (commandOptions.all === true && targets.length > 0) {\n throw new Error(\"Specify either --all or --target, not both.\");\n }\n\n const buildOptions: MuonBuildOptions = {\n root: process.cwd(),\n allTargets: commandOptions.all === true,\n };\n\n if (targets.length > 0) {\n buildOptions.targets = targets;\n }\n if (commandOptions.assets !== undefined) {\n buildOptions.assetSourcePath = commandOptions.assets;\n }\n if (commandOptions.config !== undefined) {\n buildOptions.configPath = commandOptions.config;\n }\n if (commandOptions.outDir !== undefined) {\n buildOptions.outputRoot = commandOptions.outDir;\n }\n if (commandOptions.name !== undefined) {\n buildOptions.appName = commandOptions.name;\n }\n\n const result = await buildMuonApp(buildOptions);\n if (commandOptions.json === true) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n for (const target of result.targets) {\n console.log(target.outputPath);\n }\n }\n};\n\nconst runPrepareCommand = async (\n commandOptions: PrepareCommandOptions,\n): Promise<void> => {\n const prepareOptions: MuonPrepareOptions = {\n muonPath: commandOptions.muonPath ?? \"\",\n cefPath: commandOptions.cefPath,\n stageDir: commandOptions.stageDir,\n target:\n commandOptions.target ??\n getDefaultMuonPrepareTarget(process.platform, process.arch),\n cacheDir: commandOptions.cacheDir,\n force: commandOptions.force === true,\n quiet: commandOptions.quiet === true,\n prepareExecutablePath: undefined,\n environment: process.env,\n cwd: process.cwd(),\n };\n const result = await runMuonPrepare(prepareOptions);\n if (commandOptions.json === true) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(result.stagePath ?? result.cefPath);\n }\n};\n\nconst runDevCommand = async (\n commandOptions: DevCommandOptions,\n command: Command,\n): Promise<void> => {\n const devOptions: MuonDevOptions = {\n root: process.cwd(),\n environment: process.env,\n quietPrepare: commandOptions.json === true,\n };\n\n if (commandOptions.muonPath !== undefined) {\n devOptions.muonPath = commandOptions.muonPath;\n }\n if (commandOptions.cefPath !== undefined) {\n devOptions.cefPath = commandOptions.cefPath;\n }\n if (commandOptions.stageDir !== undefined) {\n devOptions.stagePath = commandOptions.stageDir;\n }\n if (commandOptions.config !== undefined) {\n devOptions.configPath = commandOptions.config;\n }\n if (commandOptions.assets !== undefined) {\n devOptions.assetSourcePath = commandOptions.assets;\n }\n if (command.getOptionValueSource(\"debugger\") === \"cli\") {\n devOptions.enableDebugger = commandOptions.debugger === true;\n }\n\n const result = await runMuonDev(devOptions);\n if (commandOptions.json === true) {\n console.log(JSON.stringify(result, null, 2));\n }\n if (result.exitCode !== 0) {\n process.exitCode = result.exitCode;\n }\n};\n\nconst runInitCommand = async (): Promise<void> => {\n const result = await ensureMuonGitignoreEntry(process.cwd());\n console.log(\n result.changed ? `Updated ${result.gitignorePath}` : result.gitignorePath,\n );\n};\n\nconst printEmbedConfigResult = (\n result: EmbedMuonConfigResult,\n json: boolean | undefined,\n): void => {\n if (json === true) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(result.outputPath);\n }\n};\n\nconst runEmbedConfigCommand = async (\n commandOptions: EmbedConfigCommandOptions,\n): Promise<void> => {\n validateEmbedConfigOptions(commandOptions);\n const configPath = commandOptions.config ?? \"\";\n const coreResult =\n commandOptions.corePath !== undefined\n ? await embedMuonConfigInCoreFile({\n corePath: commandOptions.corePath,\n configPath,\n outputPath: commandOptions.output,\n })\n : commandOptions.runtimePath !== undefined\n ? await embedMuonConfigInRuntime({\n runtimePath: commandOptions.runtimePath,\n configPath,\n outputRuntimePath: commandOptions.outputRuntimePath,\n })\n : undefined;\n const bootstrapResult =\n commandOptions.bootstrapPath === undefined\n ? undefined\n : await embedMuonConfigInBootstrapFile({\n bootstrapPath: commandOptions.bootstrapPath,\n configPath,\n outputPath: commandOptions.outputBootstrap,\n });\n if (coreResult !== undefined && bootstrapResult !== undefined) {\n if (commandOptions.json === true) {\n console.log(\n JSON.stringify(\n {\n core: coreResult,\n bootstrap: bootstrapResult,\n },\n null,\n 2,\n ),\n );\n } else {\n console.log(`${coreResult.outputPath}\\n${bootstrapResult.outputPath}`);\n }\n return;\n }\n const result = coreResult ?? bootstrapResult;\n if (result === undefined) {\n throw new Error(\"No embed-config target was specified.\");\n }\n printEmbedConfigResult(result, commandOptions.json);\n};\n\nconst createCliCommand = (): Command => {\n const program = new Command();\n\n program\n .name(\"muon\")\n .description(\n \"Multi-platform GUI application framework that uses CEF as its backend\",\n )\n .version(`${version}-${git_commit_hash}`)\n .showSuggestionAfterError()\n .action(() => {\n program.outputHelp({ error: true });\n process.exitCode = 1;\n });\n\n program\n .command(\"build\")\n .description(\"Build CEF-free Muon app distribution directories\")\n .option(\n \"--target <target>\",\n \"target alias or comma-separated target aliases\",\n appendTargetValues,\n [],\n )\n .option(\"--all\", \"build all supported targets\")\n .option(\"--assets <path>\", \"asset root path\")\n .option(\"--config <path>\", \"muon config path\")\n .option(\"--out-dir <path>\", \"output root directory\")\n .option(\"--name <name>\", \"launcher file name\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: BuildCommandOptions) => {\n await runBuildCommand(options);\n });\n\n const devCommand = program\n .command(\"dev\")\n .description(\"Launch Muon directly with local development assets\")\n .option(\"--muon-path <path>\", \"Muon runtime file root\")\n .option(\"--cef-path <path>\", \"CEF file root\")\n .option(\"--stage-dir <path>\", \"prepared runtime output directory\")\n .option(\"--config <path>\", \"muon config path\")\n .option(\"--assets <path>\", \"development asset directory\")\n .option(\"--no-debugger\", \"disable Muon debugger defaults\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: DevCommandOptions) => {\n await runDevCommand(options, devCommand);\n });\n\n program\n .command(\"init\")\n .description(\"Initialize Muon project helper files\")\n .action(async () => {\n await runInitCommand();\n });\n\n program\n .command(\"prepare\")\n .description(\"Prepare a Muon runtime with CEF files\")\n .requiredOption(\"--muon-path <path>\", \"Muon runtime file root\")\n .option(\"--cef-path <path>\", \"CEF file root\")\n .option(\"--stage-dir <path>\", \"prepared runtime output directory\")\n .option(\"--target <target>\", \"prepare target\")\n .option(\"--cache-dir <path>\", \"CEF artifact cache directory\")\n .option(\"--force\", \"rebuild an existing prepared runtime\")\n .option(\"-q, --quiet\", \"suppress native prepare progress messages\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: PrepareCommandOptions) => {\n await runPrepareCommand(options);\n });\n\n program\n .command(\"embed-config\")\n .description(\"Embed muon.json into Muon runtime files\")\n .option(\"--runtime-path <path>\", \"prepared runtime directory\")\n .option(\"--core-path <path>\", \"muon-core executable path\")\n .option(\"--bootstrap-path <path>\", \"muon-bootstrap executable path\")\n .requiredOption(\"--config <path>\", \"muon config path\")\n .option(\"--output-runtime-path <path>\", \"patched runtime output directory\")\n .option(\"--output <path>\", \"patched muon-core output path\")\n .option(\"--output-bootstrap <path>\", \"patched bootstrap output path\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: EmbedConfigCommandOptions) => {\n await runEmbedConfigCommand(options);\n });\n\n return program;\n};\n\nconst main = async (): Promise<void> => {\n try {\n await createCliCommand().parseAsync(process.argv);\n } catch (error) {\n console.error(error instanceof Error ? error.message : String(error));\n process.exitCode = 1;\n }\n};\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAM,sBAAsB;AAoJ5B,IAAM,gCAAgC;CAAC;CAAc;CAAc;AAAW;AAE9E,IAAM,mBAAmB,MAAc,UAAA,GAAA,UAAA,YAC1B,IAAI,IAAI,QAAA,GAAA,UAAA,SAAe,MAAM,IAAI;AAE9C,IAAM,gBAAgB,UACpB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,IAAM,mBAAmB,UACvB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAEvD,IAAM,aAAa,OAAO,SAAmC;CAC3D,IAAI;EAEF,QAAO,OAAA,GAAA,iBAAA,MADkB,IAAI,GAChB,OAAO;CACtB,QAAQ;EACN,OAAO;CACT;AACF;AAEA,IAAM,kBAAkB,OAAO,SAAmC;CAChE,IAAI;EAEF,QAAO,OAAA,GAAA,iBAAA,MADkB,IAAI,GAChB,YAAY;CAC3B,QAAQ;EACN,OAAO;CACT;AACF;AAEA,IAAM,6BAA6B,UAA4B;CAC7D,MAAM,YAAY;CAClB,OACE,UAAU,SAAS,0BACnB,OAAO,UAAU,YAAY,YAC7B,UAAU,QAAQ,SAAS,MAAM;AAErC;AAEA,IAAM,sBAAsB,OAC1B,QACmC;CACnC,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,OAAO;CACtB,SAAS,OAAO;EACd,IAAI,0BAA0B,KAAK,GACjC,OAAO;GACL,OAAA,GAAA,UAAA,SAAc,GAAG;GACjB,eAAe,KAAA;EACjB;EAEF,MAAM;CACR;CAEA,MAAM,SAA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OAAO,iBAAiB,gCAAgC,EACxD,OAAO,UAAU,sBAAsB,EACvC,OAAO,OAAO,YAA+B;EAC5C,MAAM,cAAc,SAAS,UAAU;CACzC,CAAC;CAEH,QACG,QAAQ,MAAM,EACd,YAAY,sCAAsC,EAClD,OAAO,YAAY;EAClB,MAAM,eAAe;CACvB,CAAC;CAEH,QACG,QAAQ,SAAS,EACjB,YAAY,uCAAuC,EACnD,eAAe,sBAAsB,wBAAwB,EAC7D,OAAO,qBAAqB,eAAe,EAC3C,OAAO,sBAAsB,mCAAmC,EAChE,OAAO,qBAAqB,gBAAgB,EAC5C,OAAO,sBAAsB,8BAA8B,EAC3D,OAAO,WAAW,sCAAsC,EACxD,OAAO,eAAe,2CAA2C,EACjE,OAAO,UAAU,sBAAsB,EACvC,OAAO,OAAO,YAAmC;EAChD,MAAM,kBAAkB,OAAO;CACjC,CAAC;CAEH,QACG,QAAQ,cAAc,EACtB,YAAY,yCAAyC,EACrD,OAAO,yBAAyB,4BAA4B,EAC5D,OAAO,sBAAsB,2BAA2B,EACxD,OAAO,2BAA2B,gCAAgC,EAClE,eAAe,mBAAmB,kBAAkB,EACpD,OAAO,gCAAgC,kCAAkC,EACzE,OAAO,mBAAmB,+BAA+B,EACzD,OAAO,6BAA6B,+BAA+B,EACnE,OAAO,UAAU,sBAAsB,EACvC,OAAO,OAAO,YAAuC;EACpD,MAAM,sBAAsB,OAAO;CACrC,CAAC;CAEH,OAAO;AACT;AAEA,IAAM,OAAO,YAA2B;CACtC,IAAI;EACF,MAAM,iBAAiB,EAAE,WAAW,QAAQ,IAAI;CAClD,SAAS,OAAO;EACd,QAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;EACpE,QAAQ,WAAW;CACrB;AACF;AAEK,KAAK"}
|
|
1
|
+
{"version":3,"file":"cli.cjs","names":[],"sources":["../src/dev.ts","../src/generated/packageMetadata.ts","../src/cli.ts"],"sourcesContent":["// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { spawn } from \"node:child_process\";\nimport { constants } from \"node:fs\";\nimport { access, mkdir, readFile, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\n\nimport { parse } from \"json5\";\nimport type { UserConfig } from \"vite\";\n\nimport { ensureMuonGitignoreEntry } from \"./gitignore.js\";\nimport { getDefaultMuonPrepareTarget, runMuonPrepare } from \"./prepare.js\";\nimport {\n getMuonExecutablePath,\n resolveMuonRuntimePath,\n} from \"./vite-internals.js\";\nimport {\n flattenVitePluginOptions,\n getMuonVitePluginOptions,\n} from \"./vite-options.js\";\nimport type { MuonVitePluginOptions } from \"./vite.js\";\n\nconst muonRecycleExitCode = 88;\n\ntype JsonObject = Record<string, unknown>;\n\ninterface LoadedViteMuonOptions {\n root: string;\n pluginOptions: MuonVitePluginOptions | undefined;\n}\n\ninterface ProjectConfigResolution {\n configPath: string | undefined;\n config: JsonObject | undefined;\n}\n\ninterface MuonDevOverrideConfig {\n asset?: {\n sourcePath: string;\n };\n cdp?: {\n enable: true;\n };\n browser?: {\n keybind: {\n devtools: \"f12\";\n recycle: \"ctrl+f12\";\n };\n };\n}\n\n/**\n * Options for launching Muon directly against local development assets.\n */\nexport interface MuonDevOptions {\n /**\n * Directory used as the project root.\n */\n root?: string;\n\n /**\n * Directory containing muon-core runtime files such as muon-core and plugins.\n */\n muonPath?: string;\n\n /**\n * Directory containing CEF files, or a CEF archive root with Release/Resources.\n */\n cefPath?: string;\n\n /**\n * Runtime staging directory used for development startup.\n */\n stagePath?: string;\n\n /**\n * Muon config path passed before the generated development override.\n */\n configPath?: string;\n\n /**\n * Local development asset directory.\n */\n assetSourcePath?: string;\n\n /**\n * Enable the Muon debugger defaults during development startup.\n */\n enableDebugger?: boolean;\n\n /**\n * Platform used for runtime target resolution.\n *\n * @remarks This is injectable for tests. Production code uses process.platform.\n */\n platform?: NodeJS.Platform;\n\n /**\n * Architecture used for runtime target resolution.\n *\n * @remarks This is injectable for tests. Production code uses process.arch.\n */\n architecture?: NodeJS.Architecture;\n\n /**\n * Environment used for child processes.\n */\n environment?: NodeJS.ProcessEnv;\n\n /**\n * Suppress native prepare progress messages.\n */\n quietPrepare?: boolean;\n}\n\n/**\n * Result returned after the Muon development process exits.\n */\nexport interface MuonDevResult {\n /**\n * Absolute project root used for development startup.\n */\n root: string;\n\n /**\n * Muon runtime target used for prepare.\n */\n target: string;\n\n /**\n * Directory containing muon-core files used as the staging source.\n */\n muonPath: string;\n\n /**\n * Directory or cached archive containing CEF files used as the staging source.\n */\n cefPath: string;\n\n /**\n * Directory containing the prepared Muon runtime.\n */\n stagePath: string;\n\n /**\n * Prepared muon-core executable path.\n */\n muonExecutablePath: string;\n\n /**\n * Project config path passed before the generated development override.\n */\n projectConfigPath?: string;\n\n /**\n * Generated development override config path.\n */\n overrideConfigPath: string;\n\n /**\n * Effective local asset source path.\n */\n assetSourcePath: string;\n\n /**\n * Exit code returned by the Muon process.\n */\n exitCode: number;\n}\n\nconst defaultProjectConfigFileNames = [\"muon.json5\", \"muon.jsonc\", \"muon.json\"];\n\nconst resolveFromRoot = (root: string, path: string): string =>\n isAbsolute(path) ? path : resolve(root, path);\n\nconst isJsonObject = (value: unknown): value is JsonObject =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst getErrorMessage = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n\nconst fileExists = async (path: string): Promise<boolean> => {\n try {\n const stats = await stat(path);\n return stats.isFile();\n } catch {\n return false;\n }\n};\n\nconst directoryExists = async (path: string): Promise<boolean> => {\n try {\n const stats = await stat(path);\n return stats.isDirectory();\n } catch {\n return false;\n }\n};\n\nconst isMissingVitePackageError = (error: unknown): boolean => {\n const candidate = error as { code?: unknown; message?: unknown };\n return (\n candidate.code === \"ERR_MODULE_NOT_FOUND\" &&\n typeof candidate.message === \"string\" &&\n candidate.message.includes(\"vite\")\n );\n};\n\nconst loadViteMuonOptions = async (\n cwd: string,\n): Promise<LoadedViteMuonOptions> => {\n let vite: typeof import(\"vite\");\n try {\n vite = await import(\"vite\");\n } catch (error) {\n if (isMissingVitePackageError(error)) {\n return {\n root: resolve(cwd),\n pluginOptions: undefined,\n };\n }\n throw error;\n }\n\n const loaded = await vite.loadConfigFromFile(\n {\n command: \"serve\",\n mode: \"development\",\n isPreview: false,\n isSsrBuild: false,\n },\n undefined,\n cwd,\n \"silent\",\n );\n if (loaded === null) {\n return {\n root: resolve(cwd),\n pluginOptions: undefined,\n };\n }\n\n const config = loaded.config as UserConfig;\n const root =\n typeof config.root === \"string\" ? resolve(cwd, config.root) : resolve(cwd);\n const plugins = await flattenVitePluginOptions(config.plugins);\n const muonPlugins = plugins\n .map((plugin) => getMuonVitePluginOptions(plugin))\n .filter(\n (pluginOptions): pluginOptions is MuonVitePluginOptions =>\n pluginOptions !== undefined,\n );\n\n if (muonPlugins.length > 1) {\n throw new Error(\n \"Multiple muon() plugin definitions were found in vite.config.*.\",\n );\n }\n\n return {\n root,\n pluginOptions: muonPlugins[0],\n };\n};\n\nconst resolveProjectConfigPath = async (\n root: string,\n configPath: string | undefined,\n): Promise<string | undefined> => {\n if (configPath !== undefined) {\n const resolvedPath = resolveFromRoot(root, configPath);\n if (!(await fileExists(resolvedPath))) {\n throw new Error(`Muon config file does not exist: ${resolvedPath}`);\n }\n return resolvedPath;\n }\n\n for (const fileName of defaultProjectConfigFileNames) {\n const candidatePath = join(root, fileName);\n if (await fileExists(candidatePath)) {\n return candidatePath;\n }\n }\n\n return undefined;\n};\n\nconst readJsonObjectFile = async (\n filePath: string,\n label: string,\n): Promise<JsonObject> => {\n let content: string;\n try {\n content = await readFile(filePath, \"utf8\");\n } catch (error) {\n throw new Error(\n `${label} could not be read: ${filePath}: ${getErrorMessage(error)}`,\n );\n }\n\n let parsed: unknown;\n try {\n parsed = parse(content);\n } catch (error) {\n throw new Error(\n `${label} could not be parsed: ${filePath}: ${getErrorMessage(error)}`,\n );\n }\n\n if (!isJsonObject(parsed)) {\n throw new Error(`${label} must contain a JSON object: ${filePath}`);\n }\n\n return parsed;\n};\n\nconst resolveProjectConfig = async (\n root: string,\n configPath: string | undefined,\n): Promise<ProjectConfigResolution> => {\n const resolvedConfigPath = await resolveProjectConfigPath(root, configPath);\n if (resolvedConfigPath === undefined) {\n return {\n configPath: undefined,\n config: undefined,\n };\n }\n\n return {\n configPath: resolvedConfigPath,\n config: await readJsonObjectFile(resolvedConfigPath, \"muon config\"),\n };\n};\n\nconst readConfigAssetSourcePath = (\n config: JsonObject | undefined,\n): string | undefined => {\n if (config === undefined) {\n return undefined;\n }\n\n const asset = config.asset;\n if (asset === undefined) {\n return undefined;\n }\n if (!isJsonObject(asset)) {\n throw new Error(\"muon config asset must be an object when present.\");\n }\n\n const sourcePath = asset.sourcePath;\n if (sourcePath === undefined) {\n return undefined;\n }\n if (typeof sourcePath !== \"string\") {\n throw new Error(\"muon config asset.sourcePath must be a string.\");\n }\n if (sourcePath.trim().length === 0) {\n throw new Error(\"muon config asset.sourcePath must not be empty.\");\n }\n return sourcePath;\n};\n\nconst assertDevelopmentAssetDirectory = async (\n assetSourcePath: string,\n): Promise<void> => {\n if (await directoryExists(assetSourcePath)) {\n return;\n }\n\n try {\n await access(assetSourcePath, constants.F_OK);\n } catch {\n throw new Error(`Muon dev asset source does not exist: ${assetSourcePath}`);\n }\n\n throw new Error(\n `Muon dev asset source must be a directory: ${assetSourcePath}`,\n );\n};\n\nconst resolveAssetSource = async (\n root: string,\n assetSourcePath: string | undefined,\n projectConfig: ProjectConfigResolution,\n): Promise<{\n assetSourcePath: string;\n overrideAssetSourcePath: string | undefined;\n}> => {\n const configuredAssetSourcePath = readConfigAssetSourcePath(\n projectConfig.config,\n );\n if (assetSourcePath !== undefined) {\n const resolvedPath = resolveFromRoot(root, assetSourcePath);\n await assertDevelopmentAssetDirectory(resolvedPath);\n return {\n assetSourcePath: resolvedPath,\n overrideAssetSourcePath: resolvedPath,\n };\n }\n\n if (\n configuredAssetSourcePath !== undefined &&\n projectConfig.configPath !== undefined\n ) {\n return {\n assetSourcePath: resolve(\n dirname(projectConfig.configPath),\n configuredAssetSourcePath,\n ),\n overrideAssetSourcePath: undefined,\n };\n }\n\n const defaultAssetSourcePath = resolve(root, \"assets\");\n await assertDevelopmentAssetDirectory(defaultAssetSourcePath);\n return {\n assetSourcePath: defaultAssetSourcePath,\n overrideAssetSourcePath: defaultAssetSourcePath,\n };\n};\n\nconst createMuonDevOverrideConfig = (\n assetSourcePath: string | undefined,\n enableDebugger: boolean,\n): MuonDevOverrideConfig => ({\n ...(assetSourcePath === undefined\n ? {}\n : {\n asset: {\n sourcePath: assetSourcePath,\n },\n }),\n ...(enableDebugger\n ? {\n cdp: {\n enable: true,\n },\n browser: {\n keybind: {\n devtools: \"f12\",\n recycle: \"ctrl+f12\",\n },\n },\n }\n : {}),\n});\n\nconst writeMuonDevOverrideConfig = async (\n overrideConfigPath: string,\n overrideConfig: MuonDevOverrideConfig,\n): Promise<void> => {\n await mkdir(dirname(overrideConfigPath), { recursive: true });\n await writeFile(\n overrideConfigPath,\n `${JSON.stringify(overrideConfig, null, 2)}\\n`,\n );\n};\n\nconst runMuonExecutable = async (\n muonExecutablePath: string,\n configPaths: readonly string[],\n environment: NodeJS.ProcessEnv,\n): Promise<number> => {\n const args = configPaths.flatMap((configPath) => [\"-c\", configPath]);\n let exitCode = 0;\n do {\n const child = spawn(muonExecutablePath, args, {\n cwd: dirname(muonExecutablePath),\n env: environment,\n stdio: [\"ignore\", \"inherit\", \"inherit\"],\n });\n\n exitCode = await new Promise<number>((resolvePromise, reject) => {\n child.once(\"error\", reject);\n child.once(\"close\", (code) => {\n resolvePromise(code ?? 1);\n });\n });\n } while (exitCode === muonRecycleExitCode);\n return exitCode;\n};\n\n/**\n * Launches Muon directly against local development assets.\n *\n * @param options Development startup options.\n * @returns Development startup result after the Muon process exits.\n */\nexport const runMuonDev = async (\n options: MuonDevOptions = {},\n): Promise<MuonDevResult> => {\n const cwd = resolve(options.root ?? process.cwd());\n const loadedViteOptions = await loadViteMuonOptions(cwd);\n const root = loadedViteOptions.root;\n const pluginOptions = loadedViteOptions.pluginOptions;\n const platform = options.platform ?? process.platform;\n const architecture = options.architecture ?? process.arch;\n const environment = options.environment ?? process.env;\n const target = getDefaultMuonPrepareTarget(platform, architecture);\n const muonPath = resolveMuonRuntimePath({\n root,\n target,\n muonPath: options.muonPath ?? pluginOptions?.muonPath,\n });\n const cefPath =\n options.cefPath !== undefined\n ? resolveFromRoot(root, options.cefPath)\n : pluginOptions?.cefPath === undefined\n ? undefined\n : resolveFromRoot(root, pluginOptions.cefPath);\n const stagePath =\n options.stagePath !== undefined\n ? resolveFromRoot(root, options.stagePath)\n : pluginOptions?.stagePath === undefined\n ? resolve(root, \".muon\", target)\n : resolveFromRoot(root, pluginOptions.stagePath);\n const enableDebugger =\n options.enableDebugger ?? pluginOptions?.enableDebugger ?? true;\n const projectConfig = await resolveProjectConfig(root, options.configPath);\n const asset = await resolveAssetSource(\n root,\n options.assetSourcePath,\n projectConfig,\n );\n const overrideConfigPath = join(root, \".muon\", \"dev\", \"muon.dev.json\");\n\n await ensureMuonGitignoreEntry(root);\n\n const preparedRuntime = await runMuonPrepare({\n muonPath,\n cefPath,\n stageDir: stagePath,\n target,\n cacheDir: environment.MUON_CACHE_DIR,\n force: false,\n quiet: options.quietPrepare === true,\n prepareExecutablePath: undefined,\n environment,\n cwd: root,\n });\n if (preparedRuntime.stagePath === undefined) {\n throw new Error(\"muon-prepare did not return a staged runtime path.\");\n }\n\n await writeMuonDevOverrideConfig(\n overrideConfigPath,\n createMuonDevOverrideConfig(asset.overrideAssetSourcePath, enableDebugger),\n );\n const muonExecutablePath = getMuonExecutablePath(\n preparedRuntime.stagePath,\n platform,\n );\n const configPaths = [\n ...(projectConfig.configPath === undefined\n ? []\n : [projectConfig.configPath]),\n overrideConfigPath,\n ];\n const exitCode = await runMuonExecutable(\n muonExecutablePath,\n configPaths,\n environment,\n );\n\n return {\n root,\n target,\n muonPath: preparedRuntime.muonPath,\n cefPath: preparedRuntime.cefPath,\n stagePath: preparedRuntime.stagePath,\n muonExecutablePath,\n ...(projectConfig.configPath === undefined\n ? {}\n : { projectConfigPath: projectConfig.configPath }),\n overrideConfigPath,\n assetSourcePath: asset.assetSourcePath,\n exitCode,\n };\n};\n","// @ts-nocheck\n// This file is auto-generated by screw-up plugin\n// Do not edit manually\n\nexport const name = \"muon-ui\";\nexport const version = \"0.6.0\";\nexport const description = \"A multi-platform GUI application framework that uses CEF as its backend\";\nexport const author = \"Kouji Matsui (@kekyo@mi.kekyo.net)\";\nexport const license = \"MIT\";\nexport const repository_url = \"https://github.com/kekyo/muon-ui.git\";\nexport const git_commit_hash = \"44340328835f0d4ee860b444916971dfa03486ef\";\n","#!/usr/bin/env node\n// muon - Multi-platform GUI application framework that uses CEF as its backend\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/muon\n\nimport { Command } from \"commander\";\n\nimport {\n getDefaultMuonPrepareTarget,\n runMuonPrepare,\n type MuonPrepareOptions,\n} from \"./prepare.js\";\nimport { ensureMuonGitignoreEntry } from \"./gitignore.js\";\nimport {\n embedMuonConfigInBootstrapFile,\n embedMuonConfigInCoreFile,\n embedMuonConfigInRuntime,\n type EmbedMuonConfigResult,\n} from \"./embed-config.js\";\nimport { buildMuonApp, type MuonBuildOptions } from \"./build.js\";\nimport { runMuonDev, type MuonDevOptions } from \"./dev.js\";\nimport { git_commit_hash, version } from \"./generated/packageMetadata.js\";\n\ninterface PrepareCommandOptions {\n muonPath: string | undefined;\n cefPath: string | undefined;\n stageDir: string | undefined;\n target: string | undefined;\n cacheDir: string | undefined;\n force: boolean | undefined;\n quiet: boolean | undefined;\n json: boolean | undefined;\n}\n\ninterface EmbedConfigCommandOptions {\n runtimePath: string | undefined;\n corePath: string | undefined;\n bootstrapPath: string | undefined;\n config: string | undefined;\n outputRuntimePath: string | undefined;\n output: string | undefined;\n outputBootstrap: string | undefined;\n json: boolean | undefined;\n}\n\ninterface BuildCommandOptions {\n target: string[];\n all: boolean | undefined;\n assets: string | undefined;\n config: string | undefined;\n outDir: string | undefined;\n name: string | undefined;\n json: boolean | undefined;\n}\n\ninterface DevCommandOptions {\n muonPath: string | undefined;\n cefPath: string | undefined;\n stageDir: string | undefined;\n config: string | undefined;\n assets: string | undefined;\n debugger: boolean | undefined;\n json: boolean | undefined;\n}\n\nconst readTargetValues = (value: string): string[] => {\n return value\n .split(\",\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n};\n\nconst appendTargetValues = (value: string, previous: string[]): string[] => {\n return [...previous, ...readTargetValues(value)];\n};\n\nconst validateEmbedConfigOptions = (\n options: EmbedConfigCommandOptions,\n): void => {\n if (options.runtimePath !== undefined && options.corePath !== undefined) {\n throw new Error(\"Specify at most one of --runtime-path or --core-path.\");\n }\n if (\n options.runtimePath === undefined &&\n options.corePath === undefined &&\n options.bootstrapPath === undefined\n ) {\n throw new Error(\n \"Specify at least one of --runtime-path, --core-path, or --bootstrap-path.\",\n );\n }\n if (\n options.corePath !== undefined &&\n options.outputRuntimePath !== undefined\n ) {\n throw new Error(\"--output-runtime-path requires --runtime-path.\");\n }\n if (options.runtimePath !== undefined && options.output !== undefined) {\n throw new Error(\"--output requires --core-path.\");\n }\n if (\n options.bootstrapPath === undefined &&\n options.outputBootstrap !== undefined\n ) {\n throw new Error(\"--output-bootstrap requires --bootstrap-path.\");\n }\n};\n\nconst runBuildCommand = async (\n commandOptions: BuildCommandOptions,\n): Promise<void> => {\n const targets = commandOptions.target;\n if (commandOptions.all === true && targets.length > 0) {\n throw new Error(\"Specify either --all or --target, not both.\");\n }\n\n const buildOptions: MuonBuildOptions = {\n root: process.cwd(),\n allTargets: commandOptions.all === true,\n };\n\n if (targets.length > 0) {\n buildOptions.targets = targets;\n }\n if (commandOptions.assets !== undefined) {\n buildOptions.assetSourcePath = commandOptions.assets;\n }\n if (commandOptions.config !== undefined) {\n buildOptions.configPath = commandOptions.config;\n }\n if (commandOptions.outDir !== undefined) {\n buildOptions.outputRoot = commandOptions.outDir;\n }\n if (commandOptions.name !== undefined) {\n buildOptions.appName = commandOptions.name;\n }\n\n const result = await buildMuonApp(buildOptions);\n if (commandOptions.json === true) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n for (const target of result.targets) {\n console.log(target.outputPath);\n }\n }\n};\n\nconst runPrepareCommand = async (\n commandOptions: PrepareCommandOptions,\n): Promise<void> => {\n const prepareOptions: MuonPrepareOptions = {\n muonPath: commandOptions.muonPath ?? \"\",\n cefPath: commandOptions.cefPath,\n stageDir: commandOptions.stageDir,\n target:\n commandOptions.target ??\n getDefaultMuonPrepareTarget(process.platform, process.arch),\n cacheDir: commandOptions.cacheDir,\n force: commandOptions.force === true,\n quiet: commandOptions.quiet === true,\n prepareExecutablePath: undefined,\n environment: process.env,\n cwd: process.cwd(),\n };\n const result = await runMuonPrepare(prepareOptions);\n if (commandOptions.json === true) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(result.stagePath ?? result.cefPath);\n }\n};\n\nconst runDevCommand = async (\n commandOptions: DevCommandOptions,\n command: Command,\n): Promise<void> => {\n const devOptions: MuonDevOptions = {\n root: process.cwd(),\n environment: process.env,\n quietPrepare: commandOptions.json === true,\n };\n\n if (commandOptions.muonPath !== undefined) {\n devOptions.muonPath = commandOptions.muonPath;\n }\n if (commandOptions.cefPath !== undefined) {\n devOptions.cefPath = commandOptions.cefPath;\n }\n if (commandOptions.stageDir !== undefined) {\n devOptions.stagePath = commandOptions.stageDir;\n }\n if (commandOptions.config !== undefined) {\n devOptions.configPath = commandOptions.config;\n }\n if (commandOptions.assets !== undefined) {\n devOptions.assetSourcePath = commandOptions.assets;\n }\n if (command.getOptionValueSource(\"debugger\") === \"cli\") {\n devOptions.enableDebugger = commandOptions.debugger === true;\n }\n\n const result = await runMuonDev(devOptions);\n if (commandOptions.json === true) {\n console.log(JSON.stringify(result, null, 2));\n }\n if (result.exitCode !== 0) {\n process.exitCode = result.exitCode;\n }\n};\n\nconst runInitCommand = async (): Promise<void> => {\n const result = await ensureMuonGitignoreEntry(process.cwd());\n console.log(\n result.changed ? `Updated ${result.gitignorePath}` : result.gitignorePath,\n );\n};\n\nconst printEmbedConfigResult = (\n result: EmbedMuonConfigResult,\n json: boolean | undefined,\n): void => {\n if (json === true) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(result.outputPath);\n }\n};\n\nconst runEmbedConfigCommand = async (\n commandOptions: EmbedConfigCommandOptions,\n): Promise<void> => {\n validateEmbedConfigOptions(commandOptions);\n const configPath = commandOptions.config ?? \"\";\n const coreResult =\n commandOptions.corePath !== undefined\n ? await embedMuonConfigInCoreFile({\n corePath: commandOptions.corePath,\n configPath,\n outputPath: commandOptions.output,\n })\n : commandOptions.runtimePath !== undefined\n ? await embedMuonConfigInRuntime({\n runtimePath: commandOptions.runtimePath,\n configPath,\n outputRuntimePath: commandOptions.outputRuntimePath,\n })\n : undefined;\n const bootstrapResult =\n commandOptions.bootstrapPath === undefined\n ? undefined\n : await embedMuonConfigInBootstrapFile({\n bootstrapPath: commandOptions.bootstrapPath,\n configPath,\n outputPath: commandOptions.outputBootstrap,\n });\n if (coreResult !== undefined && bootstrapResult !== undefined) {\n if (commandOptions.json === true) {\n console.log(\n JSON.stringify(\n {\n core: coreResult,\n bootstrap: bootstrapResult,\n },\n null,\n 2,\n ),\n );\n } else {\n console.log(`${coreResult.outputPath}\\n${bootstrapResult.outputPath}`);\n }\n return;\n }\n const result = coreResult ?? bootstrapResult;\n if (result === undefined) {\n throw new Error(\"No embed-config target was specified.\");\n }\n printEmbedConfigResult(result, commandOptions.json);\n};\n\nconst createCliCommand = (): Command => {\n const program = new Command();\n\n program\n .name(\"muon\")\n .description(\n \"Multi-platform GUI application framework that uses CEF as its backend\",\n )\n .version(`${version}-${git_commit_hash}`)\n .showSuggestionAfterError()\n .action(() => {\n program.outputHelp({ error: true });\n process.exitCode = 1;\n });\n\n program\n .command(\"build\")\n .description(\"Build CEF-free Muon app distribution directories\")\n .option(\n \"--target <target>\",\n \"target alias or comma-separated target aliases\",\n appendTargetValues,\n [],\n )\n .option(\"--all\", \"build all supported targets\")\n .option(\"--assets <path>\", \"asset root path\")\n .option(\"--config <path>\", \"muon config path\")\n .option(\"--out-dir <path>\", \"output root directory\")\n .option(\"--name <name>\", \"launcher file name\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: BuildCommandOptions) => {\n await runBuildCommand(options);\n });\n\n const devCommand = program\n .command(\"dev\")\n .description(\"Launch Muon directly with local development assets\")\n .option(\"--muon-path <path>\", \"Muon runtime file root\")\n .option(\"--cef-path <path>\", \"CEF file root\")\n .option(\"--stage-dir <path>\", \"prepared runtime output directory\")\n .option(\"--config <path>\", \"muon config path\")\n .option(\"--assets <path>\", \"development asset directory\")\n .option(\"--no-debugger\", \"disable Muon debugger defaults\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: DevCommandOptions) => {\n await runDevCommand(options, devCommand);\n });\n\n program\n .command(\"init\")\n .description(\"Initialize Muon project helper files\")\n .action(async () => {\n await runInitCommand();\n });\n\n program\n .command(\"prepare\")\n .description(\"Prepare a Muon runtime with CEF files\")\n .requiredOption(\"--muon-path <path>\", \"Muon runtime file root\")\n .option(\"--cef-path <path>\", \"CEF file root\")\n .option(\"--stage-dir <path>\", \"prepared runtime output directory\")\n .option(\"--target <target>\", \"prepare target\")\n .option(\"--cache-dir <path>\", \"CEF artifact cache directory\")\n .option(\"--force\", \"rebuild an existing prepared runtime\")\n .option(\"-q, --quiet\", \"suppress native prepare progress messages\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: PrepareCommandOptions) => {\n await runPrepareCommand(options);\n });\n\n program\n .command(\"embed-config\")\n .description(\"Embed muon.json into Muon runtime files\")\n .option(\"--runtime-path <path>\", \"prepared runtime directory\")\n .option(\"--core-path <path>\", \"muon-core executable path\")\n .option(\"--bootstrap-path <path>\", \"muon-bootstrap executable path\")\n .requiredOption(\"--config <path>\", \"muon config path\")\n .option(\"--output-runtime-path <path>\", \"patched runtime output directory\")\n .option(\"--output <path>\", \"patched muon-core output path\")\n .option(\"--output-bootstrap <path>\", \"patched bootstrap output path\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: EmbedConfigCommandOptions) => {\n await runEmbedConfigCommand(options);\n });\n\n return program;\n};\n\nconst main = async (): Promise<void> => {\n try {\n await createCliCommand().parseAsync(process.argv);\n } catch (error) {\n console.error(error instanceof Error ? error.message : String(error));\n process.exitCode = 1;\n }\n};\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAM,sBAAsB;AAoJ5B,IAAM,gCAAgC;CAAC;CAAc;CAAc;AAAW;AAE9E,IAAM,mBAAmB,MAAc,UAAA,GAAA,UAAA,YAC1B,IAAI,IAAI,QAAA,GAAA,UAAA,SAAe,MAAM,IAAI;AAE9C,IAAM,gBAAgB,UACpB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,IAAM,mBAAmB,UACvB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAEvD,IAAM,aAAa,OAAO,SAAmC;CAC3D,IAAI;EAEF,QAAO,OAAA,GAAA,iBAAA,MADkB,IAAI,GAChB,OAAO;CACtB,QAAQ;EACN,OAAO;CACT;AACF;AAEA,IAAM,kBAAkB,OAAO,SAAmC;CAChE,IAAI;EAEF,QAAO,OAAA,GAAA,iBAAA,MADkB,IAAI,GAChB,YAAY;CAC3B,QAAQ;EACN,OAAO;CACT;AACF;AAEA,IAAM,6BAA6B,UAA4B;CAC7D,MAAM,YAAY;CAClB,OACE,UAAU,SAAS,0BACnB,OAAO,UAAU,YAAY,YAC7B,UAAU,QAAQ,SAAS,MAAM;AAErC;AAEA,IAAM,sBAAsB,OAC1B,QACmC;CACnC,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,OAAO;CAC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AACF;AAEK,KAAK"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: muon-ui
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.6.0
|
|
4
4
|
* description: A multi-platform GUI application framework that uses CEF as its backend
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/muon-ui.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: 44340328835f0d4ee860b444916971dfa03486ef
|
|
9
9
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: muon-ui
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.6.0
|
|
4
4
|
* description: A multi-platform GUI application framework that uses CEF as its backend
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/muon-ui.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: 44340328835f0d4ee860b444916971dfa03486ef
|
|
9
9
|
*/
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: muon-ui
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.6.0
|
|
4
4
|
* description: A multi-platform GUI application framework that uses CEF as its backend
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/muon-ui.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: 44340328835f0d4ee860b444916971dfa03486ef
|
|
9
9
|
*/
|
|
10
10
|
//#region \0rolldown/runtime.js
|
|
11
11
|
var __create = Object.create;
|
|
@@ -1835,7 +1835,7 @@ var defaultConfigFileNames = [
|
|
|
1835
1835
|
];
|
|
1836
1836
|
var appConfigSourcePath = "./assets.zip";
|
|
1837
1837
|
var defaultAppName = "muon-app";
|
|
1838
|
-
var muonLicenseFileName = "
|
|
1838
|
+
var muonLicenseFileName = "CREDITS.md";
|
|
1839
1839
|
var directoryMode = 493;
|
|
1840
1840
|
var executableMode = 493;
|
|
1841
1841
|
var assetSaltByteLength = 16;
|
|
@@ -2518,4 +2518,4 @@ Object.defineProperty(exports, "startMuonViteBrowserBridge", {
|
|
|
2518
2518
|
}
|
|
2519
2519
|
});
|
|
2520
2520
|
|
|
2521
|
-
//# sourceMappingURL=vite-options-
|
|
2521
|
+
//# sourceMappingURL=vite-options-KNDVcH-e.cjs.map
|