muon-ui 0.5.0 → 0.7.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 +368 -15
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/native/{linux64 → linux-amd64}/muon-bootstrap +0 -0
- package/dist/native/{linux64 → linux-amd64}/muon-prepare +0 -0
- package/dist/native/{linuxarm64 → linux-arm64}/muon-bootstrap +0 -0
- package/dist/native/{linuxarm64 → linux-arm64}/muon-prepare +0 -0
- package/dist/native/{linuxarm → linux-armhf}/muon-bootstrap +0 -0
- package/dist/native/{linuxarm → linux-armhf}/muon-prepare +0 -0
- package/dist/native/{windows64 → windows-amd64}/muon-bootstrap.exe +0 -0
- package/dist/native/{windows64 → windows-amd64}/muon-prepare.exe +0 -0
- package/dist/native/{windows32/muon-prepare.exe → windows-i686/muon-bootstrap.exe} +0 -0
- package/dist/native/{windows32/muon-bootstrap.exe → windows-i686/muon-prepare.exe} +0 -0
- package/dist/runtime/{linux64/LICENSE_muon → linux-amd64/CREDITS.md} +0 -97
- package/dist/runtime/{linux64 → linux-amd64}/libmuon-ui.so +0 -0
- package/dist/runtime/linux-amd64/muon-core +0 -0
- package/dist/runtime/{linuxarm/LICENSE_muon → linux-arm64/CREDITS.md} +0 -97
- package/dist/runtime/linux-arm64/libmuon-ui.so +0 -0
- package/dist/runtime/linux-arm64/muon-core +0 -0
- package/dist/runtime/{windows32/LICENSE_muon → linux-armhf/CREDITS.md} +0 -97
- package/dist/runtime/{linuxarm → linux-armhf}/libmuon-ui.so +0 -0
- package/dist/runtime/linux-armhf/muon-core +0 -0
- package/dist/runtime/{linuxarm64/LICENSE_muon → windows-amd64/CREDITS.md} +0 -97
- package/dist/runtime/{windows64 → windows-amd64}/libcardio.dll +0 -0
- package/dist/runtime/windows-amd64/libmuon-ui.dll +0 -0
- package/dist/runtime/{windows64 → windows-amd64}/muon-core.exe +0 -0
- package/dist/runtime/windows-i686/CREDITS.md +266 -0
- package/dist/runtime/{windows32 → windows-i686}/libcardio.dll +0 -0
- package/dist/runtime/windows-i686/libmuon-ui.dll +0 -0
- package/dist/runtime/{windows32 → windows-i686}/muon-core.exe +0 -0
- package/dist/{vite-options-D4u4kLQI.cjs → vite-options-FFh0NWUa.cjs} +228 -137
- package/dist/vite-options-FFh0NWUa.cjs.map +1 -0
- package/dist/vite.cjs +23 -3
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +234 -135
- package/dist/vite.mjs.map +1 -1
- package/images/muon-120.png +0 -0
- package/muon.d.ts +33 -0
- package/package.json +7 -7
- package/vite.d.ts +9 -4
- package/dist/runtime/linux64/muon-core +0 -0
- package/dist/runtime/linuxarm/muon-core +0 -0
- package/dist/runtime/linuxarm64/libmuon-ui.so +0 -0
- package/dist/runtime/linuxarm64/muon-core +0 -0
- package/dist/runtime/windows32/libmuon-ui.dll +0 -0
- package/dist/runtime/windows64/LICENSE_muon +0 -363
- package/dist/runtime/windows64/libmuon-ui.dll +0 -0
- package/dist/vite-options-D4u4kLQI.cjs.map +0 -1
- /package/dist/runtime/{linux64 → linux-amd64}/libcardio.so +0 -0
- /package/dist/runtime/{linuxarm64 → linux-arm64}/libcardio.so +0 -0
- /package/dist/runtime/{linuxarm → linux-armhf}/libcardio.so +0 -0
- /package/dist/runtime/{windows64 → windows-amd64}/libgcc_s_seh-1.dll +0 -0
- /package/dist/runtime/{windows64 → windows-amd64}/libstdc++-6.dll +0 -0
- /package/dist/runtime/{windows32 → windows-i686}/libgcc_s_dw2-1.dll +0 -0
- /package/dist/runtime/{windows32 → windows-i686}/libstdc++-6.dll +0 -0
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,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;AAEK,KAAK"}
|
|
1
|
+
{"version":3,"file":"cli.cjs","names":[],"sources":["../src/dev.ts","../src/pack.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","// 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 { type Stats } from \"node:fs\";\nimport {\n chmod,\n cp,\n mkdir,\n readFile,\n readdir,\n rm,\n stat,\n writeFile,\n} from \"node:fs/promises\";\nimport {\n basename,\n dirname,\n isAbsolute,\n join,\n relative,\n resolve,\n sep,\n} from \"node:path\";\n\nimport AdmZip from \"adm-zip\";\nimport { parse } from \"json5\";\nimport type { InlineConfig, UserConfig } from \"vite\";\n\nimport {\n buildMuonApp,\n type MuonBuildOptions,\n type MuonBuildResult,\n type MuonBuildTarget,\n type MuonBuildTargetResult,\n} from \"./build.js\";\nimport {\n flattenVitePluginOptions,\n getMuonVitePluginOptions,\n} from \"./vite-options.js\";\nimport type { MuonViteBuildOptions, MuonVitePluginOptions } from \"./vite.js\";\nimport { getMuonTargetDescriptor } from \"./targets.js\";\n\nconst supportedPackTypes = [\"zip\", \"deb\", \"nsis\"] as const;\nconst defaultArtifactsDirectory = \"artifacts\";\nconst defaultPackageBuildDirectory = \".muon/pack\";\nconst suppressViteMuonBuildEnvironmentKey = \"MUON_SUPPRESS_VITE_MUON_BUILD\";\n\ntype JsonObject = Record<string, unknown>;\n\n/**\n * Muon package output type.\n */\nexport type MuonPackType = (typeof supportedPackTypes)[number];\n\n/**\n * Options for creating redistributable Muon package artifacts.\n */\nexport interface MuonPackOptions {\n /**\n * Project root.\n */\n root?: string;\n /**\n * Package artifact types to generate.\n */\n types: readonly string[];\n /**\n * Public target identifiers to build.\n */\n targets?: readonly string[];\n /**\n * Build every supported target.\n */\n allTargets?: boolean;\n /**\n * Muon config path to embed.\n */\n configPath?: string;\n /**\n * File name used for the app launcher.\n */\n appName?: string;\n /**\n * Stable application identifier used for portable runtime state.\n */\n appId?: string;\n /**\n * Directory containing package runtime/ and native/ folders.\n */\n packageDirectory?: string;\n /**\n * Directory that receives generated package artifacts.\n */\n artifactsDir?: string;\n /**\n * Package name override.\n */\n packageName?: string;\n /**\n * Package version override.\n */\n packageVersion?: string;\n /**\n * Package description override.\n */\n description?: string;\n /**\n * Package author/maintainer override.\n */\n author?: string;\n /**\n * Environment used for child processes.\n */\n environment?: NodeJS.ProcessEnv;\n}\n\n/**\n * Generated package artifact metadata.\n */\nexport interface MuonPackArtifact {\n /**\n * Package artifact type.\n */\n type: MuonPackType;\n /**\n * Muon target packaged in this artifact.\n */\n target: MuonBuildTarget;\n /**\n * Generated artifact path.\n */\n path: string;\n}\n\n/**\n * Result of a Muon package build.\n */\nexport interface MuonPackResult {\n /**\n * Absolute project root used for packaging.\n */\n root: string;\n /**\n * Debian/installer safe package name.\n */\n packageName: string;\n /**\n * Package version.\n */\n version: string;\n /**\n * Launcher file base name.\n */\n appName: string;\n /**\n * Stable app identifier embedded in launcher/runtime config.\n */\n appId: string;\n /**\n * Muon dist build result.\n */\n build: MuonBuildResult;\n /**\n * Target dist directories used as package inputs.\n */\n targets: MuonBuildTargetResult[];\n /**\n * Generated package artifacts.\n */\n artifacts: MuonPackArtifact[];\n}\n\ninterface LoadedViteMuonOptions {\n root: string;\n pluginOptions: MuonVitePluginOptions | undefined;\n}\n\ninterface PackageMetadata {\n packageName: string;\n version: string;\n description: string;\n author: string;\n}\n\nconst isJsonObject = (value: unknown): value is JsonObject =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\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: \"build\",\n mode: \"production\",\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 readJsonObjectFile = async (path: string): Promise<JsonObject> => {\n const parsed = parse(await readFile(path, \"utf8\"));\n if (!isJsonObject(parsed)) {\n throw new Error(`JSON file must contain an object: ${path}`);\n }\n return parsed;\n};\n\nconst readPackageJson = async (root: string): Promise<JsonObject> => {\n return await readJsonObjectFile(join(root, \"package.json\"));\n};\n\nconst sanitizePackageName = (value: string): string => {\n const unscoped = value.startsWith(\"@\")\n ? value.slice(value.indexOf(\"/\") + 1)\n : value;\n const sanitized = unscoped\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9+.-]+/g, \"-\")\n .replace(/^[.+-]+/g, \"\")\n .replace(/[.+-]+$/g, \"\");\n return sanitized.length > 0 ? sanitized : \"muon-app\";\n};\n\nconst stringifyAuthor = (value: unknown): string | undefined => {\n if (typeof value === \"string\") {\n return value;\n }\n if (!isJsonObject(value) || typeof value.name !== \"string\") {\n return undefined;\n }\n return value.email === undefined || typeof value.email !== \"string\"\n ? value.name\n : `${value.name} <${value.email}>`;\n};\n\nconst resolveMetadata = (\n packageJson: JsonObject,\n options: MuonPackOptions,\n): PackageMetadata => {\n const packageNameSource =\n options.packageName ??\n (typeof packageJson.name === \"string\" ? packageJson.name : undefined);\n if (packageNameSource === undefined || packageNameSource.trim() === \"\") {\n throw new Error(\"package.json name is required for muon pack.\");\n }\n const version =\n options.packageVersion ??\n (typeof packageJson.version === \"string\" ? packageJson.version : undefined);\n if (version === undefined || version.trim() === \"\") {\n throw new Error(\"package.json version is required for muon pack.\");\n }\n const description =\n options.description ??\n (typeof packageJson.description === \"string\"\n ? packageJson.description\n : \"Muon application\");\n const author =\n options.author ?? stringifyAuthor(packageJson.author) ?? \"Unknown\";\n return {\n packageName: sanitizePackageName(packageNameSource),\n version,\n description,\n author,\n };\n};\n\nconst normalizePackTypes = (types: readonly string[]): MuonPackType[] => {\n const normalized = types\n .flatMap((value) => value.split(\",\"))\n .map((value) => value.trim().toLowerCase())\n .filter((value) => value.length > 0);\n if (normalized.length === 0) {\n throw new Error(\"Specify at least one package type with --type.\");\n }\n for (const type of normalized) {\n if (!supportedPackTypes.includes(type as MuonPackType)) {\n throw new Error(`Unsupported muon pack type: ${type}`);\n }\n }\n return [...new Set(normalized)] as MuonPackType[];\n};\n\nconst getPluginBuildOptions = (\n pluginOptions: MuonVitePluginOptions | undefined,\n): MuonViteBuildOptions => {\n return typeof pluginOptions?.build === \"object\" ? pluginOptions.build : {};\n};\n\nconst resolveBuildOutputDirectory = async (root: string): Promise<string> => {\n const vite = await import(\"vite\");\n const resolved = await vite.resolveConfig(\n { root } satisfies InlineConfig,\n \"build\",\n \"production\",\n \"production\",\n );\n return isAbsolute(resolved.build.outDir)\n ? resolved.build.outDir\n : resolve(resolved.root, resolved.build.outDir);\n};\n\nconst runViteBuild = async (\n root: string,\n _environment: NodeJS.ProcessEnv,\n): Promise<void> => {\n const vite = await import(\"vite\");\n const previous = process.env[suppressViteMuonBuildEnvironmentKey];\n process.env[suppressViteMuonBuildEnvironmentKey] = \"1\";\n try {\n await vite.build({ root } satisfies InlineConfig);\n } finally {\n if (previous === undefined) {\n delete process.env[suppressViteMuonBuildEnvironmentKey];\n } else {\n process.env[suppressViteMuonBuildEnvironmentKey] = previous;\n }\n }\n};\n\nconst createBuildOptions = (\n root: string,\n assetSourcePath: string,\n pluginBuildOptions: MuonViteBuildOptions,\n options: MuonPackOptions,\n): MuonBuildOptions => {\n const buildOptions: MuonBuildOptions = {\n root,\n assetSourcePath,\n assetPrefix: \"main\",\n };\n Object.assign(buildOptions, pluginBuildOptions);\n if (options.targets !== undefined && options.targets.length > 0) {\n buildOptions.targets = options.targets;\n buildOptions.allTargets = false;\n } else if (options.allTargets !== undefined) {\n buildOptions.allTargets = options.allTargets;\n }\n if (options.configPath !== undefined) {\n buildOptions.configPath = options.configPath;\n }\n if (options.appName !== undefined) {\n buildOptions.appName = options.appName;\n }\n if (options.appId !== undefined) {\n buildOptions.appId = options.appId;\n }\n if (options.packageDirectory !== undefined) {\n buildOptions.packageDirectory = options.packageDirectory;\n }\n return buildOptions;\n};\n\nconst assertPackTypeSupportsTarget = (\n type: MuonPackType,\n target: MuonBuildTarget,\n): void => {\n const descriptor = getMuonTargetDescriptor(target);\n if (type === \"deb\" && descriptor.os !== \"linux\") {\n throw new Error(\"deb packaging supports only Linux targets.\");\n }\n if (type === \"nsis\" && descriptor.os !== \"windows\") {\n throw new Error(\"nsis packaging supports only Windows targets.\");\n }\n};\n\nconst runTool = async (\n executable: string,\n args: readonly string[],\n cwd: string,\n environment: NodeJS.ProcessEnv,\n): Promise<void> => {\n const child = spawn(executable, [...args], {\n cwd,\n env: environment,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n let stderr = \"\";\n child.stderr.setEncoding(\"utf8\");\n child.stderr.on(\"data\", (chunk: string) => {\n stderr += chunk;\n });\n const exitCode = await new Promise<number>((resolvePromise, reject) => {\n child.once(\"error\", reject);\n child.once(\"close\", (code) => {\n resolvePromise(code ?? 1);\n });\n });\n if (exitCode !== 0) {\n throw new Error(\n `${executable} failed with exit code ${exitCode}: ${stderr.trim()}`,\n );\n }\n};\n\nconst statOrUndefined = async (path: string): Promise<Stats | undefined> => {\n try {\n return await stat(path);\n } catch {\n return undefined;\n }\n};\n\nconst addDirectoryToZip = async (\n zip: AdmZip,\n directory: string,\n entryRoot: string,\n): Promise<void> => {\n const walk = async (currentDirectory: string): Promise<void> => {\n const entries = await readdir(currentDirectory, { withFileTypes: true });\n entries.sort((left, right) => left.name.localeCompare(right.name));\n for (const entry of entries) {\n const path = join(currentDirectory, entry.name);\n if (entry.isDirectory()) {\n await walk(path);\n } else if (entry.isFile()) {\n const stats = await stat(path);\n const relativePath = relative(directory, path).split(sep).join(\"/\");\n zip.addFile(\n `${entryRoot}/${relativePath}`,\n await readFile(path),\n undefined,\n stats.mode << 16,\n );\n }\n }\n };\n await walk(directory);\n};\n\nconst packageZip = async (\n target: MuonBuildTargetResult,\n metadata: PackageMetadata,\n artifactsRoot: string,\n): Promise<MuonPackArtifact> => {\n const zip = new AdmZip();\n await addDirectoryToZip(\n zip,\n target.outputPath,\n target.distributionDirectoryName,\n );\n const outputPath = join(\n artifactsRoot,\n `${metadata.packageName}-${metadata.version}-${target.target}.zip`,\n );\n await mkdir(dirname(outputPath), { recursive: true });\n await writeFile(outputPath, zip.toBuffer());\n return {\n type: \"zip\",\n target: target.target,\n path: outputPath,\n };\n};\n\nconst packageDeb = async (\n root: string,\n target: MuonBuildTargetResult,\n metadata: PackageMetadata,\n artifactsRoot: string,\n packageBuildRoot: string,\n environment: NodeJS.ProcessEnv,\n): Promise<MuonPackArtifact> => {\n const descriptor = getMuonTargetDescriptor(target.target);\n if (descriptor.os !== \"linux\") {\n throw new Error(`Unsupported deb target: ${target.target}`);\n }\n const architecture = descriptor.arch;\n const packageRoot = join(\n packageBuildRoot,\n \"deb\",\n `${metadata.packageName}-${target.target}`,\n );\n await rm(packageRoot, { recursive: true, force: true });\n const installRoot = join(packageRoot, \"usr\", \"lib\", metadata.packageName);\n const installedDist = join(installRoot, target.distributionDirectoryName);\n await mkdir(installedDist, { recursive: true });\n await cp(target.outputPath, installedDist, { recursive: true });\n const binPath = join(packageRoot, \"usr\", \"bin\", metadata.packageName);\n const launcherName = basename(target.launcherPath);\n await mkdir(dirname(binPath), { recursive: true });\n await writeFile(\n binPath,\n [\n \"#!/usr/bin/env bash\",\n \"set -euo pipefail\",\n `exec ${JSON.stringify(`/usr/lib/${metadata.packageName}/${target.distributionDirectoryName}/${launcherName}`)} \"$@\"`,\n \"\",\n ].join(\"\\n\"),\n );\n await chmod(binPath, 0o755);\n const controlPath = join(packageRoot, \"DEBIAN\", \"control\");\n await mkdir(dirname(controlPath), { recursive: true });\n await writeFile(\n controlPath,\n [\n `Package: ${metadata.packageName}`,\n `Version: ${metadata.version}`,\n `Architecture: ${architecture}`,\n `Maintainer: ${metadata.author}`,\n `Description: ${metadata.description}`,\n \"\",\n ].join(\"\\n\"),\n );\n const outputPath = join(\n artifactsRoot,\n `${metadata.packageName}-${metadata.version}-${architecture}.deb`,\n );\n await mkdir(dirname(outputPath), { recursive: true });\n await runTool(\n \"dpkg-deb\",\n [\"--build\", packageRoot, outputPath],\n root,\n environment,\n );\n return {\n type: \"deb\",\n target: target.target,\n path: outputPath,\n };\n};\n\nconst escapeNsis = (value: string): string =>\n value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '$\\\\\"');\n\nconst packageNsis = async (\n root: string,\n target: MuonBuildTargetResult,\n metadata: PackageMetadata,\n artifactsRoot: string,\n packageBuildRoot: string,\n environment: NodeJS.ProcessEnv,\n): Promise<MuonPackArtifact> => {\n const descriptor = getMuonTargetDescriptor(target.target);\n if (descriptor.os !== \"windows\") {\n throw new Error(`Unsupported nsis target: ${target.target}`);\n }\n const scriptPath = join(\n packageBuildRoot,\n \"nsis\",\n `${metadata.packageName}-${target.target}.nsi`,\n );\n const outputPath = join(\n artifactsRoot,\n `${metadata.packageName}-${metadata.version}-${descriptor.arch}-setup.exe`,\n );\n await mkdir(dirname(scriptPath), { recursive: true });\n await mkdir(dirname(outputPath), { recursive: true });\n await writeFile(\n scriptPath,\n [\n \"Unicode true\",\n `Name \"${escapeNsis(metadata.packageName)}\"`,\n `OutFile \"${escapeNsis(outputPath)}\"`,\n `InstallDir \"$LOCALAPPDATA\\\\Programs\\\\${escapeNsis(metadata.packageName)}\"`,\n \"RequestExecutionLevel user\",\n \"Section\",\n ' SetOutPath \"$INSTDIR\"',\n ` File /r \"${escapeNsis(target.outputPath)}\\\\*\"`,\n ` CreateShortCut \"$SMPROGRAMS\\\\${escapeNsis(metadata.packageName)}.lnk\" \"$INSTDIR\\\\${escapeNsis(basename(target.launcherPath))}\"`,\n \"SectionEnd\",\n \"\",\n ].join(\"\\n\"),\n );\n await runTool(\"makensis\", [scriptPath], root, environment);\n if ((await statOrUndefined(outputPath)) === undefined) {\n throw new Error(`makensis did not create installer: ${outputPath}`);\n }\n return {\n type: \"nsis\",\n target: target.target,\n path: outputPath,\n };\n};\n\n/**\n * Builds a Vite app, creates Muon dist directories, and packages them.\n *\n * @param options Pack options.\n * @returns Generated package artifacts.\n */\nexport const packMuonApp = async (\n options: MuonPackOptions,\n): Promise<MuonPackResult> => {\n const cwd = resolve(options.root ?? process.cwd());\n const environment = options.environment ?? process.env;\n const loadedOptions = await loadViteMuonOptions(cwd);\n const root = loadedOptions.root;\n const metadata = resolveMetadata(await readPackageJson(root), options);\n const artifactsRoot = resolve(\n root,\n options.artifactsDir ?? defaultArtifactsDirectory,\n );\n const packageBuildRoot = resolve(root, defaultPackageBuildDirectory);\n const types = normalizePackTypes(options.types);\n const viteOutputDirectory = await resolveBuildOutputDirectory(root);\n await runViteBuild(root, environment);\n const build = await buildMuonApp(\n createBuildOptions(\n root,\n viteOutputDirectory,\n getPluginBuildOptions(loadedOptions.pluginOptions),\n options,\n ),\n );\n for (const type of types) {\n for (const target of build.targets) {\n assertPackTypeSupportsTarget(type, target.target);\n }\n }\n await rm(packageBuildRoot, { recursive: true, force: true });\n await rm(join(artifactsRoot, \"deb\"), { recursive: true, force: true });\n await rm(join(artifactsRoot, \"nsis\"), { recursive: true, force: true });\n await mkdir(artifactsRoot, { recursive: true });\n const artifacts: MuonPackArtifact[] = [];\n for (const target of build.targets) {\n for (const type of types) {\n if (type === \"zip\") {\n artifacts.push(await packageZip(target, metadata, artifactsRoot));\n } else if (type === \"deb\") {\n artifacts.push(\n await packageDeb(\n root,\n target,\n metadata,\n artifactsRoot,\n packageBuildRoot,\n environment,\n ),\n );\n } else {\n artifacts.push(\n await packageNsis(\n root,\n target,\n metadata,\n artifactsRoot,\n packageBuildRoot,\n environment,\n ),\n );\n }\n }\n }\n return {\n root,\n packageName: metadata.packageName,\n version: metadata.version,\n appName: build.appName,\n appId: build.appId,\n build,\n targets: build.targets,\n artifacts,\n };\n};\n\nexport const muonPackSuppressViteBuildEnvironmentKey =\n suppressViteMuonBuildEnvironmentKey;\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.7.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 = \"fe80718aaa617c0c0ea5c816bbe38d22bf2e8402\";\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 { packMuonApp, type MuonPackOptions } from \"./pack.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 appId: string | undefined;\n json: boolean | undefined;\n}\n\ninterface PackCommandOptions {\n type: string[];\n target: string[];\n all: boolean | undefined;\n config: string | undefined;\n name: string | undefined;\n appId: string | undefined;\n packageDirectory: string | undefined;\n artifactsDir: string | undefined;\n packageName: string | undefined;\n packageVersion: string | undefined;\n description: string | undefined;\n author: 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 appendPackTypeValues = (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 if (commandOptions.appId !== undefined) {\n buildOptions.appId = commandOptions.appId;\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 runPackCommand = async (\n commandOptions: PackCommandOptions,\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 packOptions: MuonPackOptions = {\n root: process.cwd(),\n types: commandOptions.type,\n environment: process.env,\n };\n if (targets.length > 0) {\n packOptions.targets = targets;\n }\n if (commandOptions.all !== undefined) {\n packOptions.allTargets = commandOptions.all;\n }\n if (commandOptions.config !== undefined) {\n packOptions.configPath = commandOptions.config;\n }\n if (commandOptions.name !== undefined) {\n packOptions.appName = commandOptions.name;\n }\n if (commandOptions.appId !== undefined) {\n packOptions.appId = commandOptions.appId;\n }\n if (commandOptions.packageDirectory !== undefined) {\n packOptions.packageDirectory = commandOptions.packageDirectory;\n }\n if (commandOptions.artifactsDir !== undefined) {\n packOptions.artifactsDir = commandOptions.artifactsDir;\n }\n if (commandOptions.packageName !== undefined) {\n packOptions.packageName = commandOptions.packageName;\n }\n if (commandOptions.packageVersion !== undefined) {\n packOptions.packageVersion = commandOptions.packageVersion;\n }\n if (commandOptions.description !== undefined) {\n packOptions.description = commandOptions.description;\n }\n if (commandOptions.author !== undefined) {\n packOptions.author = commandOptions.author;\n }\n\n const result = await packMuonApp(packOptions);\n if (commandOptions.json === true) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n for (const artifact of result.artifacts) {\n console.log(artifact.path);\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 \"public target or comma-separated public targets\",\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(\"--app-id <id>\", \"stable application identifier\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: BuildCommandOptions) => {\n await runBuildCommand(options);\n });\n\n program\n .command(\"pack\")\n .description(\"Build and package a Muon app\")\n .requiredOption(\n \"-t, --type <type>\",\n \"package type or comma-separated package types: zip, deb, nsis\",\n appendPackTypeValues,\n [],\n )\n .option(\n \"--target <target>\",\n \"public target or comma-separated public targets\",\n appendTargetValues,\n [],\n )\n .option(\"--all\", \"build all supported targets\")\n .option(\"--config <path>\", \"muon config path\")\n .option(\"--name <name>\", \"launcher file name\")\n .option(\"--app-id <id>\", \"stable application identifier\")\n .option(\"--package-directory <path>\", \"Muon package dist directory\")\n .option(\"--artifacts-dir <path>\", \"package artifact output directory\")\n .option(\"--package-name <name>\", \"package name override\")\n .option(\"--package-version <version>\", \"package version override\")\n .option(\"--description <text>\", \"package description override\")\n .option(\"--author <text>\", \"package author override\")\n .option(\"--json\", \"write result as JSON\")\n .action(async (options: PackCommandOptions) => {\n await runPackCommand(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,kBAAgB,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,+BAA6B,UAA4B;CAC7D,MAAM,YAAY;CAClB,OACE,UAAU,SAAS,0BACnB,OAAO,UAAU,YAAY,YAC7B,UAAU,QAAQ,SAAS,MAAM;AAErC;AAEA,IAAM,wBAAsB,OAC1B,QACmC;CACnC,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,OAAO;CACtB,SAAS,OAAO;EACd,IAAI,4BAA0B,KAAK,GAC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AAO,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"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: muon-ui
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.7.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: fe80718aaa617c0c0ea5c816bbe38d22bf2e8402
|
|
9
9
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: muon-ui
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.7.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: fe80718aaa617c0c0ea5c816bbe38d22bf2e8402
|
|
9
9
|
*/
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -264,100 +264,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
264
264
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
265
265
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
266
266
|
SOFTWARE.
|
|
267
|
-
|
|
268
|
-
## Noto color emoji
|
|
269
|
-
|
|
270
|
-
Source: https://github.com/googlefonts/noto-emoji/
|
|
271
|
-
|
|
272
|
-
Copyright 2013 Google LLC
|
|
273
|
-
|
|
274
|
-
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
275
|
-
This license is copied below, and is also available with a FAQ at:
|
|
276
|
-
https://scripts.sil.org/OFL
|
|
277
|
-
|
|
278
|
-
-----------------------------------------------------------
|
|
279
|
-
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
280
|
-
-----------------------------------------------------------
|
|
281
|
-
|
|
282
|
-
PREAMBLE
|
|
283
|
-
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
284
|
-
development of collaborative font projects, to support the font creation
|
|
285
|
-
efforts of academic and linguistic communities, and to provide a free and
|
|
286
|
-
open framework in which fonts may be shared and improved in partnership
|
|
287
|
-
with others.
|
|
288
|
-
|
|
289
|
-
The OFL allows the licensed fonts to be used, studied, modified and
|
|
290
|
-
redistributed freely as long as they are not sold by themselves. The
|
|
291
|
-
fonts, including any derivative works, can be bundled, embedded,
|
|
292
|
-
redistributed and/or sold with any software provided that any reserved
|
|
293
|
-
names are not used by derivative works. The fonts and derivatives,
|
|
294
|
-
however, cannot be released under any other type of license. The
|
|
295
|
-
requirement for fonts to remain under this license does not apply
|
|
296
|
-
to any document created using the fonts or their derivatives.
|
|
297
|
-
|
|
298
|
-
DEFINITIONS
|
|
299
|
-
"Font Software" refers to the set of files released by the Copyright
|
|
300
|
-
Holder(s) under this license and clearly marked as such. This may
|
|
301
|
-
include source files, build scripts and documentation.
|
|
302
|
-
|
|
303
|
-
"Reserved Font Name" refers to any names specified as such after the
|
|
304
|
-
copyright statement(s).
|
|
305
|
-
|
|
306
|
-
"Original Version" refers to the collection of Font Software components as
|
|
307
|
-
distributed by the Copyright Holder(s).
|
|
308
|
-
|
|
309
|
-
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
310
|
-
or substituting -- in part or in whole -- any of the components of the
|
|
311
|
-
Original Version, by changing formats or by porting the Font Software to a
|
|
312
|
-
new environment.
|
|
313
|
-
|
|
314
|
-
"Author" refers to any designer, engineer, programmer, technical
|
|
315
|
-
writer or other person who contributed to the Font Software.
|
|
316
|
-
|
|
317
|
-
PERMISSION & CONDITIONS
|
|
318
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
319
|
-
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
320
|
-
redistribute, and sell modified and unmodified copies of the Font
|
|
321
|
-
Software, subject to the following conditions:
|
|
322
|
-
|
|
323
|
-
1) Neither the Font Software nor any of its individual components,
|
|
324
|
-
in Original or Modified Versions, may be sold by itself.
|
|
325
|
-
|
|
326
|
-
2) Original or Modified Versions of the Font Software may be bundled,
|
|
327
|
-
redistributed and/or sold with any software, provided that each copy
|
|
328
|
-
contains the above copyright notice and this license. These can be
|
|
329
|
-
included either as stand-alone text files, human-readable headers or
|
|
330
|
-
in the appropriate machine-readable metadata fields within text or
|
|
331
|
-
binary files as long as those fields can be easily viewed by the user.
|
|
332
|
-
|
|
333
|
-
3) No Modified Version of the Font Software may use the Reserved Font
|
|
334
|
-
Name(s) unless explicit written permission is granted by the corresponding
|
|
335
|
-
Copyright Holder. This restriction only applies to the primary font name as
|
|
336
|
-
presented to the users.
|
|
337
|
-
|
|
338
|
-
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
339
|
-
Software shall not be used to promote, endorse or advertise any
|
|
340
|
-
Modified Version, except to acknowledge the contribution(s) of the
|
|
341
|
-
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
342
|
-
permission.
|
|
343
|
-
|
|
344
|
-
5) The Font Software, modified or unmodified, in part or in whole,
|
|
345
|
-
must be distributed entirely under this license, and must not be
|
|
346
|
-
distributed under any other license. The requirement for fonts to
|
|
347
|
-
remain under this license does not apply to any document created
|
|
348
|
-
using the Font Software.
|
|
349
|
-
|
|
350
|
-
TERMINATION
|
|
351
|
-
This license becomes null and void if any of the above conditions are
|
|
352
|
-
not met.
|
|
353
|
-
|
|
354
|
-
DISCLAIMER
|
|
355
|
-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
356
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
357
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
358
|
-
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
359
|
-
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
360
|
-
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
361
|
-
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
362
|
-
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
363
|
-
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
@@ -264,100 +264,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
264
264
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
265
265
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
266
266
|
SOFTWARE.
|
|
267
|
-
|
|
268
|
-
## Noto color emoji
|
|
269
|
-
|
|
270
|
-
Source: https://github.com/googlefonts/noto-emoji/
|
|
271
|
-
|
|
272
|
-
Copyright 2013 Google LLC
|
|
273
|
-
|
|
274
|
-
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
275
|
-
This license is copied below, and is also available with a FAQ at:
|
|
276
|
-
https://scripts.sil.org/OFL
|
|
277
|
-
|
|
278
|
-
-----------------------------------------------------------
|
|
279
|
-
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
280
|
-
-----------------------------------------------------------
|
|
281
|
-
|
|
282
|
-
PREAMBLE
|
|
283
|
-
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
284
|
-
development of collaborative font projects, to support the font creation
|
|
285
|
-
efforts of academic and linguistic communities, and to provide a free and
|
|
286
|
-
open framework in which fonts may be shared and improved in partnership
|
|
287
|
-
with others.
|
|
288
|
-
|
|
289
|
-
The OFL allows the licensed fonts to be used, studied, modified and
|
|
290
|
-
redistributed freely as long as they are not sold by themselves. The
|
|
291
|
-
fonts, including any derivative works, can be bundled, embedded,
|
|
292
|
-
redistributed and/or sold with any software provided that any reserved
|
|
293
|
-
names are not used by derivative works. The fonts and derivatives,
|
|
294
|
-
however, cannot be released under any other type of license. The
|
|
295
|
-
requirement for fonts to remain under this license does not apply
|
|
296
|
-
to any document created using the fonts or their derivatives.
|
|
297
|
-
|
|
298
|
-
DEFINITIONS
|
|
299
|
-
"Font Software" refers to the set of files released by the Copyright
|
|
300
|
-
Holder(s) under this license and clearly marked as such. This may
|
|
301
|
-
include source files, build scripts and documentation.
|
|
302
|
-
|
|
303
|
-
"Reserved Font Name" refers to any names specified as such after the
|
|
304
|
-
copyright statement(s).
|
|
305
|
-
|
|
306
|
-
"Original Version" refers to the collection of Font Software components as
|
|
307
|
-
distributed by the Copyright Holder(s).
|
|
308
|
-
|
|
309
|
-
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
310
|
-
or substituting -- in part or in whole -- any of the components of the
|
|
311
|
-
Original Version, by changing formats or by porting the Font Software to a
|
|
312
|
-
new environment.
|
|
313
|
-
|
|
314
|
-
"Author" refers to any designer, engineer, programmer, technical
|
|
315
|
-
writer or other person who contributed to the Font Software.
|
|
316
|
-
|
|
317
|
-
PERMISSION & CONDITIONS
|
|
318
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
319
|
-
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
320
|
-
redistribute, and sell modified and unmodified copies of the Font
|
|
321
|
-
Software, subject to the following conditions:
|
|
322
|
-
|
|
323
|
-
1) Neither the Font Software nor any of its individual components,
|
|
324
|
-
in Original or Modified Versions, may be sold by itself.
|
|
325
|
-
|
|
326
|
-
2) Original or Modified Versions of the Font Software may be bundled,
|
|
327
|
-
redistributed and/or sold with any software, provided that each copy
|
|
328
|
-
contains the above copyright notice and this license. These can be
|
|
329
|
-
included either as stand-alone text files, human-readable headers or
|
|
330
|
-
in the appropriate machine-readable metadata fields within text or
|
|
331
|
-
binary files as long as those fields can be easily viewed by the user.
|
|
332
|
-
|
|
333
|
-
3) No Modified Version of the Font Software may use the Reserved Font
|
|
334
|
-
Name(s) unless explicit written permission is granted by the corresponding
|
|
335
|
-
Copyright Holder. This restriction only applies to the primary font name as
|
|
336
|
-
presented to the users.
|
|
337
|
-
|
|
338
|
-
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
339
|
-
Software shall not be used to promote, endorse or advertise any
|
|
340
|
-
Modified Version, except to acknowledge the contribution(s) of the
|
|
341
|
-
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
342
|
-
permission.
|
|
343
|
-
|
|
344
|
-
5) The Font Software, modified or unmodified, in part or in whole,
|
|
345
|
-
must be distributed entirely under this license, and must not be
|
|
346
|
-
distributed under any other license. The requirement for fonts to
|
|
347
|
-
remain under this license does not apply to any document created
|
|
348
|
-
using the Font Software.
|
|
349
|
-
|
|
350
|
-
TERMINATION
|
|
351
|
-
This license becomes null and void if any of the above conditions are
|
|
352
|
-
not met.
|
|
353
|
-
|
|
354
|
-
DISCLAIMER
|
|
355
|
-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
356
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
357
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
358
|
-
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
359
|
-
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
360
|
-
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
361
|
-
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
362
|
-
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
363
|
-
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|