muon-ui 0.20.0 → 0.22.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/README.md +27 -21
- package/dist/cli.cjs +29 -11
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/native/linux-amd64/muon-builder +0 -0
- package/dist/native/linux-amd64/muon-launcher +0 -0
- package/dist/native/linux-amd64/muon-plugin-inspector +0 -0
- package/dist/native/linux-amd64/muon-runtime-helper +0 -0
- package/dist/native/linux-arm64/muon-builder +0 -0
- package/dist/native/linux-arm64/muon-launcher +0 -0
- package/dist/native/linux-arm64/muon-plugin-inspector +0 -0
- package/dist/native/linux-arm64/muon-runtime-helper +0 -0
- package/dist/native/linux-armhf/muon-builder +0 -0
- package/dist/native/linux-armhf/muon-launcher +0 -0
- package/dist/native/linux-armhf/muon-plugin-inspector +0 -0
- package/dist/native/linux-armhf/muon-runtime-helper +0 -0
- package/dist/native/windows-amd64/muon-builder.exe +0 -0
- package/dist/native/windows-amd64/muon-launcher.exe +0 -0
- package/dist/native/windows-amd64/muon-plugin-inspector.exe +0 -0
- package/dist/native/windows-i686/muon-builder.exe +0 -0
- package/dist/native/windows-i686/muon-launcher.exe +0 -0
- package/dist/native/windows-i686/muon-plugin-inspector.exe +0 -0
- package/dist/runtime/linux-amd64/CREDITS.md +89 -0
- package/dist/runtime/linux-amd64/muon-core +0 -0
- package/dist/runtime/linux-amd64/muon-executor-supervisor +0 -0
- package/dist/runtime/linux-amd64/plugins/node-bridge.mjs +3013 -0
- package/dist/runtime/linux-amd64/plugins/node.so +0 -0
- package/dist/runtime/linux-arm64/CREDITS.md +89 -0
- package/dist/runtime/linux-arm64/muon-core +0 -0
- package/dist/runtime/linux-arm64/muon-executor-supervisor +0 -0
- package/dist/runtime/linux-arm64/plugins/node-bridge.mjs +3013 -0
- package/dist/runtime/linux-arm64/plugins/node.so +0 -0
- package/dist/runtime/linux-armhf/CREDITS.md +89 -0
- package/dist/runtime/linux-armhf/muon-core +0 -0
- package/dist/runtime/linux-armhf/muon-executor-supervisor +0 -0
- package/dist/runtime/linux-armhf/plugins/node-bridge.mjs +3013 -0
- package/dist/runtime/linux-armhf/plugins/node.so +0 -0
- package/dist/runtime/windows-amd64/CREDITS.md +89 -0
- package/dist/runtime/windows-amd64/libcardio.dll +0 -0
- package/dist/runtime/windows-amd64/libmuon-ui.dll +0 -0
- package/dist/runtime/windows-amd64/muon-core.exe +0 -0
- package/dist/runtime/windows-amd64/plugins/node-bridge.mjs +3013 -0
- package/dist/runtime/windows-amd64/plugins/node.dll +0 -0
- package/dist/runtime/windows-i686/CREDITS.md +89 -0
- package/dist/runtime/windows-i686/libcardio.dll +0 -0
- package/dist/runtime/windows-i686/libmuon-ui.dll +0 -0
- package/dist/runtime/windows-i686/muon-core.exe +0 -0
- package/dist/runtime/windows-i686/plugins/node-bridge.mjs +3013 -0
- package/dist/runtime/windows-i686/plugins/node.dll +0 -0
- package/dist/{vite-internals-DpXCyV08.cjs → vite-internals-BA4riWRd.cjs} +1259 -44
- package/dist/vite-internals-BA4riWRd.cjs.map +1 -0
- package/dist/vite.cjs +43 -14
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +1233 -47
- package/dist/vite.mjs.map +1 -1
- package/muon-virtual-modules.d.ts +10 -1
- package/muon.d.ts +163 -5
- package/package.json +9 -7
- package/vite.d.ts +1 -1
- package/dist/vite-internals-DpXCyV08.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Application replacement is extremely complex, and it has always been a hard prob
|
|
|
17
17
|
The causes vary widely, so there is no magic solution that makes everything easy.
|
|
18
18
|
Even so, everyone wants to modernize with as little cost as possible.
|
|
19
19
|
|
|
20
|
-
muon (
|
|
20
|
+
muon (/ˈmjuːɒn/) is a multi-platform GUI application framework that uses CEF (Chromium Embedded Framework).
|
|
21
21
|
You have probably heard of similar projects such as [Electron](https://www.electronjs.org/).
|
|
22
22
|
|
|
23
23
|
Roughly speaking, muon is framework software in the same category.
|
|
@@ -73,35 +73,36 @@ With the minimal setup, installing the NPM package and adding one line to the co
|
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
|
-
##
|
|
76
|
+
## Getting started with muon (Quick version)
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Install the muon package, officially named `muon-ui`, into `devDependencies`:
|
|
78
|
+
Let's get started by creating an application with muon (a muon app).
|
|
79
|
+
Use a [Vite template](https://vite.dev/guide/) to create "my-muon-app" as you normally would:
|
|
81
80
|
|
|
82
81
|
```bash
|
|
83
|
-
npm
|
|
82
|
+
npm create vite@latest my-muon-app -- --template react-ts
|
|
84
83
|
```
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
This example uses React + TypeScript, but of course other choices are fine. Be sure to enable TypeScript.
|
|
86
|
+
Then run:
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
```bash
|
|
89
|
+
cd my-muon-app
|
|
90
|
+
npm install
|
|
91
|
+
npm run dev
|
|
92
|
+
```
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
CEF is downloaded from the official CDN when it becomes necessary.
|
|
94
|
+
This starts the Vite development server, and you can click the link to view the page in a browser.
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
Now add muon to this project:
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
```bash
|
|
99
|
+
npm install -D muon-ui
|
|
100
|
+
```
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
The CEF binary itself is not included in the NPM package.
|
|
103
|
+
CEF is downloaded from the official CDN when it is needed.
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
Add the following code to `vite.config.ts` to enable it:
|
|
105
|
+
Next, add the muon Vite plugin to Vite so that you can build your muon app. Add the following code to `vite.config.ts`:
|
|
105
106
|
|
|
106
107
|
```ts
|
|
107
108
|
import { defineConfig } from 'vite'
|
|
@@ -116,8 +117,13 @@ export default defineConfig({
|
|
|
116
117
|
})
|
|
117
118
|
```
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
Everything is now ready. Launch muon:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm run dev
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The muon window should appear with your page!
|
|
121
127
|
|
|
122
128
|
---
|
|
123
129
|
|
package/dist/cli.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*!
|
|
3
3
|
* name: muon-ui
|
|
4
|
-
* version: 0.
|
|
4
|
+
* version: 0.22.0
|
|
5
5
|
* description: A multi-platform GUI application framework that uses CEF as its backend
|
|
6
6
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
7
7
|
* license: MIT
|
|
8
8
|
* repository.url: https://github.com/kekyo/muon-ui.git
|
|
9
|
-
* git.commit.hash:
|
|
9
|
+
* git.commit.hash: 5c8d38ea864ba1916f26e6beb6814a4af57479d7
|
|
10
10
|
*/
|
|
11
|
-
const require_vite_internals = require("./vite-internals-
|
|
11
|
+
const require_vite_internals = require("./vite-internals-BA4riWRd.cjs");
|
|
12
12
|
let commander = require("commander");
|
|
13
13
|
let node_child_process = require("node:child_process");
|
|
14
14
|
let node_fs = require("node:fs");
|
|
@@ -115,12 +115,18 @@ var copyViteOutputAsRunAssets = async (project, assetSourcePath, assetPrefix) =>
|
|
|
115
115
|
await (0, node_fs_promises.mkdir)((0, node_path.dirname)(destinationPath), { recursive: true });
|
|
116
116
|
await (0, node_fs_promises.cp)(project.viteOutputDirectory, destinationPath, { recursive: true });
|
|
117
117
|
};
|
|
118
|
-
var prepareViteRunAssets = async (cwd) => {
|
|
118
|
+
var prepareViteRunAssets = async (cwd, configPath) => {
|
|
119
119
|
const project = await require_vite_internals.loadMuonBuildSequenceProject(cwd);
|
|
120
120
|
if (project.pluginOptions === void 0) return;
|
|
121
121
|
const buildOptions = require_vite_internals.resolveMuonViteBuildOptions(project.pluginOptions);
|
|
122
122
|
const packagedAssetOptions = require_vite_internals.createVitePackagedAssetOptions(project.viteBase ?? "/");
|
|
123
123
|
const assetSourcePath = (0, node_path.join)(project.root, ".muon", "run", "assets");
|
|
124
|
+
const effectiveConfigPath = configPath ?? buildOptions.configPath;
|
|
125
|
+
const projectConfig = await resolveProjectConfig(project.root, effectiveConfigPath);
|
|
126
|
+
const nodeProject = await require_vite_internals.resolveMuonNodeProject(projectConfig.config, projectConfig.configPath === void 0 ? project.root : (0, node_path.dirname)(projectConfig.configPath));
|
|
127
|
+
if (project.viteOutputDirectory === void 0) throw new Error("Vite output directory could not be resolved.");
|
|
128
|
+
await require_vite_internals.assertMuonNodeProjectViteBuildIsSafe(nodeProject, project.viteOutputDirectory, project.vitePublicDirectory ?? "");
|
|
129
|
+
await require_vite_internals.assertMuonNodeProjectAssetSourceIsSafe(nodeProject, assetSourcePath);
|
|
124
130
|
await (0, node_fs_promises.rm)(assetSourcePath, {
|
|
125
131
|
recursive: true,
|
|
126
132
|
force: true
|
|
@@ -130,7 +136,7 @@ var prepareViteRunAssets = async (cwd) => {
|
|
|
130
136
|
return {
|
|
131
137
|
root: project.root,
|
|
132
138
|
pluginOptions: project.pluginOptions,
|
|
133
|
-
configPath:
|
|
139
|
+
configPath: effectiveConfigPath,
|
|
134
140
|
assetSourcePath,
|
|
135
141
|
browserStartPage: packagedAssetOptions.browserStartPage,
|
|
136
142
|
runtimePluginConfig,
|
|
@@ -221,7 +227,7 @@ var resolveAssetSource = async (root, assetSourcePath, projectConfig) => {
|
|
|
221
227
|
overrideAssetSourcePath: defaultAssetSourcePath
|
|
222
228
|
};
|
|
223
229
|
};
|
|
224
|
-
var createMuonDevOverrideConfig = (assetSourcePath, enableDebugger, browserStartPage, runtimePluginConfig) => {
|
|
230
|
+
var createMuonDevOverrideConfig = (assetSourcePath, enableDebugger, browserStartPage, runtimePluginConfig, nodeProjectPath) => {
|
|
225
231
|
const browser = browserStartPage === void 0 && !enableDebugger ? void 0 : {
|
|
226
232
|
...browserStartPage === void 0 ? {} : { startPage: browserStartPage },
|
|
227
233
|
...enableDebugger ? { keybind: {
|
|
@@ -231,6 +237,7 @@ var createMuonDevOverrideConfig = (assetSourcePath, enableDebugger, browserStart
|
|
|
231
237
|
};
|
|
232
238
|
return {
|
|
233
239
|
...assetSourcePath === void 0 ? {} : { asset: { sourcePath: assetSourcePath } },
|
|
240
|
+
...nodeProjectPath === void 0 ? {} : { node: { project: nodeProjectPath } },
|
|
234
241
|
...enableDebugger ? { cdp: { enable: true } } : {},
|
|
235
242
|
...browser === void 0 ? {} : { browser },
|
|
236
243
|
...runtimePluginConfig === void 0 ? {} : { plugin: runtimePluginConfig }
|
|
@@ -258,7 +265,7 @@ var runMuonExecutable = async (muonExecutablePath, configPaths, allowInsecureLoc
|
|
|
258
265
|
});
|
|
259
266
|
};
|
|
260
267
|
var runMuonDevOnce = async (options, cwd, reportViteServerProxyWarning) => {
|
|
261
|
-
const preparedViteAssets = options.assetSourcePath === void 0 ? await prepareViteRunAssets(cwd) : void 0;
|
|
268
|
+
const preparedViteAssets = options.assetSourcePath === void 0 ? await prepareViteRunAssets(cwd, options.configPath) : void 0;
|
|
262
269
|
const loadedViteOptions = preparedViteAssets === void 0 ? await loadViteMuonOptions(cwd) : {
|
|
263
270
|
root: preparedViteAssets.root,
|
|
264
271
|
pluginOptions: preparedViteAssets.pluginOptions,
|
|
@@ -281,12 +288,15 @@ var runMuonDevOnce = async (options, cwd, reportViteServerProxyWarning) => {
|
|
|
281
288
|
const enableDebugger = options.enableDebugger ?? pluginOptions?.enableDebugger ?? true;
|
|
282
289
|
const allowInsecureLocalhost = options.allowInsecureLocalhost ?? pluginOptions?.allowInsecureLocalhost ?? false;
|
|
283
290
|
const projectConfig = await resolveProjectConfig(root, options.configPath ?? preparedViteAssets?.configPath);
|
|
291
|
+
const nodeProject = await require_vite_internals.resolveMuonNodeProject(projectConfig.config, projectConfig.configPath === void 0 ? root : (0, node_path.dirname)(projectConfig.configPath));
|
|
284
292
|
const asset = preparedViteAssets === void 0 ? await resolveAssetSource(root, options.assetSourcePath, projectConfig) : {
|
|
285
293
|
assetSourcePath: preparedViteAssets.assetSourcePath,
|
|
286
294
|
overrideAssetSourcePath: preparedViteAssets.assetSourcePath
|
|
287
295
|
};
|
|
288
296
|
const browserStartPage = preparedViteAssets?.browserStartPage !== void 0 && !hasConfigBrowserStartPage(projectConfig.config) ? preparedViteAssets.browserStartPage : void 0;
|
|
289
297
|
const overrideConfigPath = (0, node_path.join)(root, ".muon", "run", "muon.run.json");
|
|
298
|
+
await require_vite_internals.assertMuonNodeProjectStagingIsSafe(nodeProject, stagePath);
|
|
299
|
+
await require_vite_internals.assertMuonNodeProjectAssetSourceIsSafe(nodeProject, asset.assetSourcePath);
|
|
290
300
|
await require_vite_internals.ensureMuonGitignoreEntry(root);
|
|
291
301
|
const preparedRuntime = await require_vite_internals.runMuonPrepare({
|
|
292
302
|
muonPath,
|
|
@@ -294,6 +304,7 @@ var runMuonDevOnce = async (options, cwd, reportViteServerProxyWarning) => {
|
|
|
294
304
|
stageDir: stagePath,
|
|
295
305
|
target,
|
|
296
306
|
cacheDir: environment.MUON_CACHE_DIR,
|
|
307
|
+
nodeRuntimeRequirement: require_vite_internals.createMuonNodeRuntimeRequirement(nodeProject, true),
|
|
297
308
|
force: false,
|
|
298
309
|
quiet: options.quietPrepare === true,
|
|
299
310
|
prepareExecutablePath: void 0,
|
|
@@ -301,7 +312,9 @@ var runMuonDevOnce = async (options, cwd, reportViteServerProxyWarning) => {
|
|
|
301
312
|
cwd: root
|
|
302
313
|
});
|
|
303
314
|
if (preparedRuntime.stagePath === void 0) throw new Error("muon-builder did not return a staged runtime path.");
|
|
304
|
-
await
|
|
315
|
+
const nodeProjectPath = await require_vite_internals.stageMuonNodeProject(nodeProject, preparedRuntime.stagePath);
|
|
316
|
+
if (nodeProjectPath !== void 0) await require_vite_internals.assertMuonNodeHostArtifacts(preparedRuntime.stagePath, platform);
|
|
317
|
+
await writeMuonDevOverrideConfig(overrideConfigPath, createMuonDevOverrideConfig(asset.overrideAssetSourcePath, enableDebugger, browserStartPage, preparedViteAssets?.runtimePluginConfig, nodeProjectPath));
|
|
305
318
|
const muonExecutablePath = require_vite_internals.getMuonExecutablePath(preparedRuntime.stagePath, platform);
|
|
306
319
|
const exitCode = await runMuonExecutable(muonExecutablePath, [...projectConfig.configPath === void 0 ? [] : [projectConfig.configPath], overrideConfigPath], allowInsecureLocalhost, environment);
|
|
307
320
|
return {
|
|
@@ -1006,7 +1019,11 @@ var packMuonApp = async (options) => {
|
|
|
1006
1019
|
if (linuxDesktopOptions !== void 0) buildOptions.linuxDesktop = linuxDesktopOptions;
|
|
1007
1020
|
if (progress !== void 0) buildOptions.progress = progress;
|
|
1008
1021
|
buildOptions.environment = environment;
|
|
1009
|
-
const windowsResourceConfig = await require_vite_internals.readMuonConfigForWindowsResource(root, options.configPath);
|
|
1022
|
+
const windowsResourceConfig = await require_vite_internals.readMuonConfigForWindowsResource(root, options.configPath ?? pluginBuildOptions.configPath);
|
|
1023
|
+
const nodeProject = await require_vite_internals.resolveMuonNodeProject(windowsResourceConfig.config, windowsResourceConfig.directory);
|
|
1024
|
+
await require_vite_internals.assertMuonNodeProjectPackCleanupIsSafe(nodeProject, packageBuildRoot);
|
|
1025
|
+
await require_vite_internals.assertMuonNodeProjectPackCleanupIsSafe(nodeProject, (0, node_path.join)(artifactsRoot, "deb"));
|
|
1026
|
+
await require_vite_internals.assertMuonNodeProjectPackCleanupIsSafe(nodeProject, (0, node_path.join)(artifactsRoot, "nsis"));
|
|
1010
1027
|
const windowsResource = await require_vite_internals.resolveMuonWindowsResource({
|
|
1011
1028
|
root,
|
|
1012
1029
|
packageDirectory: options.packageDirectory ?? pluginBuildOptions.packageDirectory ?? "",
|
|
@@ -1108,8 +1125,8 @@ var packMuonApp = async (options) => {
|
|
|
1108
1125
|
};
|
|
1109
1126
|
//#endregion
|
|
1110
1127
|
//#region src/generated/packageMetadata.ts
|
|
1111
|
-
var version = "0.
|
|
1112
|
-
var git_commit_hash = "
|
|
1128
|
+
var version = "0.22.0";
|
|
1129
|
+
var git_commit_hash = "5c8d38ea864ba1916f26e6beb6814a4af57479d7";
|
|
1113
1130
|
//#endregion
|
|
1114
1131
|
//#region src/cli.ts
|
|
1115
1132
|
var readTargetValues = (value) => {
|
|
@@ -1256,6 +1273,7 @@ var runPrepareCommand = async (commandOptions) => {
|
|
|
1256
1273
|
stageDir: commandOptions.stageDir,
|
|
1257
1274
|
target: commandOptions.target ?? require_vite_internals.getDefaultMuonPrepareTarget(process.platform, process.arch),
|
|
1258
1275
|
cacheDir: commandOptions.cacheDir,
|
|
1276
|
+
nodeRuntimeRequirement: void 0,
|
|
1259
1277
|
force: commandOptions.force === true,
|
|
1260
1278
|
quiet: commandOptions.quiet === true,
|
|
1261
1279
|
prepareExecutablePath: void 0,
|