muon-ui 0.14.0 → 0.16.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 +88 -40
- package/dist/cli.cjs +15 -15
- 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-bootstrap → 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-bootstrap → 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-bootstrap → 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/muon-256.png +0 -0
- package/dist/native/windows-amd64/muon-builder.exe +0 -0
- package/dist/native/windows-amd64/{muon-bootstrap.exe → 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-bootstrap.exe → muon-launcher.exe} +0 -0
- package/dist/native/windows-i686/muon-plugin-inspector.exe +0 -0
- package/dist/runtime/linux-amd64/CREDITS.md +31 -0
- package/dist/runtime/linux-amd64/muon-core +0 -0
- package/dist/runtime/linux-arm64/CREDITS.md +31 -0
- package/dist/runtime/linux-arm64/muon-core +0 -0
- package/dist/runtime/linux-armhf/CREDITS.md +31 -0
- package/dist/runtime/linux-armhf/muon-core +0 -0
- package/dist/runtime/windows-amd64/CREDITS.md +31 -0
- package/dist/runtime/windows-amd64/libcardio.dll +0 -0
- package/dist/runtime/windows-amd64/libmuon-ui.dll +0 -0
- package/dist/runtime/windows-amd64/muon-core.exe +0 -0
- package/dist/runtime/windows-i686/CREDITS.md +31 -0
- package/dist/runtime/windows-i686/libcardio.dll +0 -0
- package/dist/runtime/windows-i686/libmuon-ui.dll +0 -0
- package/dist/runtime/windows-i686/muon-core.exe +0 -0
- package/dist/{vite-internals-BInO_2N9.cjs → vite-internals-D987wez0.cjs} +79 -71
- package/dist/vite-internals-D987wez0.cjs.map +1 -0
- package/dist/vite.cjs +244 -17
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +326 -94
- package/dist/vite.mjs.map +1 -1
- package/images/muon-120.png +0 -0
- package/images/vscode.png +0 -0
- package/muon.d.ts +40 -23
- package/package.json +7 -7
- package/vite.d.ts +15 -5
- package/dist/vite-internals-BInO_2N9.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -9,74 +9,122 @@ A multi-platform GUI application framework that uses CEF as its backend.
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
## What is
|
|
12
|
+
## What is this?
|
|
13
13
|
|
|
14
|
-
Have you ever
|
|
15
|
-
|
|
14
|
+
Have you ever wanted to update an aging native GUI application into a modern application?
|
|
15
|
+
Application replacement is extremely complex, and it has always been a hard problem.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
Even so, everyone wants to modernize
|
|
17
|
+
The causes vary widely, so there is no magic solution that makes everything easy.
|
|
18
|
+
Even so, everyone wants to modernize with as little cost as possible.
|
|
19
19
|
|
|
20
|
-
muon (
|
|
21
|
-
You
|
|
20
|
+
muon (pronounced "muon") is a multi-platform GUI application framework that uses CEF (Chromium Embedded Framework).
|
|
21
|
+
You have probably heard of similar projects such as [Electron](https://www.electronjs.org/).
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
In other words, it
|
|
23
|
+
Roughly speaking, muon is framework software in the same category.
|
|
24
|
+
In other words, it lets you implement local GUI applications as web applications.
|
|
25
25
|
|
|
26
|
-
With muon, you can build native applications using the most
|
|
26
|
+
With muon, you can build native applications using the most mature and widely used browser UI frameworks, such as React and Vue.
|
|
27
27
|
|
|
28
28
|

|
|
29
29
|
|
|
30
|
-
So
|
|
30
|
+
So how is muon different from earlier framework software?
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
muon specializes in local GUI application development by using a whitelist approach for access to external web resources.
|
|
33
|
+
In practice, access is denied by default.
|
|
34
34
|
|
|
35
|
-
You
|
|
36
|
-
However,
|
|
35
|
+
You may think that using CEF without access to websites around the world is a waste.
|
|
36
|
+
However, we believe that this is the biggest reason existing solutions have become very complex and difficult to handle.
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
muon also does not completely forbid access to external resources.
|
|
39
|
+
Because the policy is whitelist-based, permitted websites remain accessible.
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
muon also includes a plugin system with fully asynchronous processing for interoperability with native libraries.
|
|
42
|
+
These features are enabled from explicit configuration, so unused capabilities are not left open.
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
You can also use remote DevTools from Chromium/Chrome
|
|
44
|
+
Because muon is based on CEF, Chromium features such as WebGL, WebGPU, WebAssembly, Web workers, and Local storage are available as expected.
|
|
45
|
+
DevTools can be shown. CDP (Chrome DevTools Protocol) is also available, so you can debug with VS Code, connect Playwright, or control the app externally.
|
|
46
|
+
You can also use remote DevTools from Chromium/Chrome through `chrome://inspect/`.
|
|
47
47
|
|
|
48
|
-
In short,
|
|
49
|
-
you
|
|
48
|
+
In short, muon clearly removes one of the major problems that appears when migrating GTK/Qt/Windows native applications to web applications.
|
|
49
|
+
This lets you build modern local GUI applications with the web technology ecosystem.
|
|
50
|
+
|
|
51
|
+
muon also minimizes the steps required to create a muon application, keeping the barrier to entry low.
|
|
52
|
+
With the minimal setup, installing the NPM package and adding one line to the configuration file is enough to launch your first muon app.
|
|
50
53
|
|
|
51
54
|
### Features
|
|
52
55
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
- The browser
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- It features a plugin system. Plugin functionality can be restricted using a whitelist filter.
|
|
62
|
-
- Using built-in plugins, you can access local files, open dialogs, launch child processes, and manipulate windows.
|
|
63
|
-
- It supports packages for Linux (deb) and Windows (NSIS), as well as portable operation.
|
|
56
|
+
- Restricts all network access through a whitelist filter, letting you completely exclude problematic content.
|
|
57
|
+
- Provided as an easy-to-use NPM package, so you can turn your web application project into a native GUI application without complex configuration or changes.
|
|
58
|
+
- The rendering browser is CEF (Chromium Embedded Framework). From the web application's point of view, this is almost the same as using Chromium or Chrome.
|
|
59
|
+
- Supports the Vite plugin system. It also supports Vite HMR, so previews update in real time during development.
|
|
60
|
+
- Supports Linux (deb) and Windows (NSIS) package generation, and portable distribution.
|
|
61
|
+
- DevTools can be used. CDP (Chrome DevTools Protocol) is also supported, so remote debugging from external tools is possible.
|
|
62
|
+
- Includes a plugin system. Plugin capabilities can also be restricted by a whitelist filter.
|
|
63
|
+
- Built-in plugins provide access to local files, open dialogs, child process launching, and window operations.
|
|
64
64
|
|
|
65
65
|
### Environment
|
|
66
66
|
|
|
67
|
-
- Supports the following architectures
|
|
68
|
-
- Linux: amd64,
|
|
67
|
+
- Supports the following architectures from the official CEF binary architectures:
|
|
68
|
+
- Linux: amd64, armhf, arm64
|
|
69
69
|
- Windows: i686, amd64
|
|
70
|
-
- Build
|
|
70
|
+
- Build environment
|
|
71
71
|
- Node.js 20 or later
|
|
72
|
-
- Vite 5 or later
|
|
72
|
+
- Vite 5 or later
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
## How to enable muon on your project
|
|
77
|
+
|
|
78
|
+
### Install the muon package
|
|
79
|
+
|
|
80
|
+
Install the muon package, officially named `muon-ui`, into `devDependencies`:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm install -D muon-ui
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The muon package includes the following:
|
|
87
|
+
|
|
88
|
+
- muon CLI
|
|
89
|
+
- muon Vite plugin
|
|
90
|
+
- TypeScript type definitions for muon built-in plugins
|
|
91
|
+
- Platform-specific muon binary assets
|
|
92
|
+
|
|
93
|
+
The CEF binary itself is not included in the NPM package.
|
|
94
|
+
CEF is downloaded from the official CDN when it becomes necessary.
|
|
95
|
+
|
|
96
|
+
### Configure the muon Vite plugin
|
|
97
|
+
|
|
98
|
+
Installing the muon package almost completes the preparation, but you should enable the muon Vite plugin so that HMR (Hot Module Replacement) and muon app builds are available.
|
|
99
|
+
|
|
100
|
+
For anyone unfamiliar with HMR, Vite acts as a development server, lets a browser show the page, and updates the display almost in real time when the page is edited.
|
|
101
|
+
In other words, it is a very useful feature that automatically previews edit results.
|
|
102
|
+
|
|
103
|
+
The muon Vite plugin supports HMR by launching muon instead of a browser and making HMR work inside the muon app.
|
|
104
|
+
Add the following code to `vite.config.ts` to enable it:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { defineConfig } from 'vite'
|
|
108
|
+
import react from '@vitejs/plugin-react'
|
|
109
|
+
import muon from 'muon-ui/vite'
|
|
110
|
+
|
|
111
|
+
export default defineConfig({
|
|
112
|
+
plugins: [
|
|
113
|
+
react(), // React plugin
|
|
114
|
+
muon(), // muon plugin (add this)
|
|
115
|
+
],
|
|
116
|
+
})
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Add `muon()` to the `plugins` array in the `defineConfig()` argument.
|
|
120
|
+
This enables the muon Vite plugin. Preparation is now complete.
|
|
77
121
|
|
|
78
122
|
---
|
|
79
123
|
|
|
124
|
+
## Documents
|
|
125
|
+
|
|
126
|
+
For more information, [please visit the repository](https://github.com/kekyo/muon-ui/).
|
|
127
|
+
|
|
80
128
|
## License
|
|
81
129
|
|
|
82
130
|
Under MIT.
|
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.16.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: 33c694fe496f80cab223ce4231f3249ddf6b3dd1
|
|
10
10
|
*/
|
|
11
|
-
const require_vite_internals = require("./vite-internals-
|
|
11
|
+
const require_vite_internals = require("./vite-internals-D987wez0.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");
|
|
@@ -1093,8 +1093,8 @@ var packMuonApp = async (options) => {
|
|
|
1093
1093
|
};
|
|
1094
1094
|
//#endregion
|
|
1095
1095
|
//#region src/generated/packageMetadata.ts
|
|
1096
|
-
var version = "0.
|
|
1097
|
-
var git_commit_hash = "
|
|
1096
|
+
var version = "0.16.0";
|
|
1097
|
+
var git_commit_hash = "33c694fe496f80cab223ce4231f3249ddf6b3dd1";
|
|
1098
1098
|
//#endregion
|
|
1099
1099
|
//#region src/cli.ts
|
|
1100
1100
|
var readTargetValues = (value) => {
|
|
@@ -1121,10 +1121,10 @@ var readBooleanValue = (value, label) => {
|
|
|
1121
1121
|
};
|
|
1122
1122
|
var validateEmbedConfigOptions = (options) => {
|
|
1123
1123
|
if (options.runtimePath !== void 0 && options.corePath !== void 0) throw new Error("Specify at most one of --runtime-path or --core-path.");
|
|
1124
|
-
if (options.runtimePath === void 0 && options.corePath === void 0 && options.
|
|
1124
|
+
if (options.runtimePath === void 0 && options.corePath === void 0 && options.launcherPath === void 0) throw new Error("Specify at least one of --runtime-path, --core-path, or --launcher-path.");
|
|
1125
1125
|
if (options.corePath !== void 0 && options.outputRuntimePath !== void 0) throw new Error("--output-runtime-path requires --runtime-path.");
|
|
1126
1126
|
if (options.runtimePath !== void 0 && options.output !== void 0) throw new Error("--output requires --core-path.");
|
|
1127
|
-
if (options.
|
|
1127
|
+
if (options.launcherPath === void 0 && options.outputLauncher !== void 0) throw new Error("--output-launcher requires --launcher-path.");
|
|
1128
1128
|
};
|
|
1129
1129
|
var createWindowsResourceOptions = (commandOptions) => {
|
|
1130
1130
|
const options = {};
|
|
@@ -1286,20 +1286,20 @@ var runEmbedConfigCommand = async (commandOptions) => {
|
|
|
1286
1286
|
configPath,
|
|
1287
1287
|
outputRuntimePath: commandOptions.outputRuntimePath
|
|
1288
1288
|
}) : void 0;
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1289
|
+
const launcherResult = commandOptions.launcherPath === void 0 ? void 0 : await require_vite_internals.embedMuonConfigInLauncherFile({
|
|
1290
|
+
launcherPath: commandOptions.launcherPath,
|
|
1291
1291
|
configPath,
|
|
1292
|
-
outputPath: commandOptions.
|
|
1292
|
+
outputPath: commandOptions.outputLauncher
|
|
1293
1293
|
});
|
|
1294
|
-
if (coreResult !== void 0 &&
|
|
1294
|
+
if (coreResult !== void 0 && launcherResult !== void 0) {
|
|
1295
1295
|
if (commandOptions.json === true) console.log(JSON.stringify({
|
|
1296
1296
|
core: coreResult,
|
|
1297
|
-
|
|
1297
|
+
launcher: launcherResult
|
|
1298
1298
|
}, null, 2));
|
|
1299
|
-
else console.log(`${coreResult.outputPath}\n${
|
|
1299
|
+
else console.log(`${coreResult.outputPath}\n${launcherResult.outputPath}`);
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
|
-
const result = coreResult ??
|
|
1302
|
+
const result = coreResult ?? launcherResult;
|
|
1303
1303
|
if (result === void 0) throw new Error("No embed-config target was specified.");
|
|
1304
1304
|
printEmbedConfigResult(result, commandOptions.json);
|
|
1305
1305
|
};
|
|
@@ -1324,7 +1324,7 @@ var createCliCommand = () => {
|
|
|
1324
1324
|
program.command("prepare").description("Prepare a muon runtime with CEF files").requiredOption("--muon-path <path>", "muon runtime file root").option("--cef-path <path>", "CEF file root").option("--stage-dir <path>", "prepared runtime output directory").option("--target <target>", "prepare target").option("--cache-dir <path>", "CEF artifact cache directory").option("--force", "rebuild an existing prepared runtime").option("-q, --quiet", "suppress native builder progress messages").option("--json", "write result as JSON").action(async (options) => {
|
|
1325
1325
|
await runPrepareCommand(options);
|
|
1326
1326
|
});
|
|
1327
|
-
program.command("embed-config").description("Embed muon.json into muon runtime files").option("--runtime-path <path>", "prepared runtime directory").option("--core-path <path>", "muon-core executable path").option("--
|
|
1327
|
+
program.command("embed-config").description("Embed muon.json into muon runtime files").option("--runtime-path <path>", "prepared runtime directory").option("--core-path <path>", "muon-core executable path").option("--launcher-path <path>", "muon-launcher executable path").requiredOption("--config <path>", "muon config path").option("--output-runtime-path <path>", "patched runtime output directory").option("--output <path>", "patched muon-core output path").option("--output-launcher <path>", "patched launcher output path").option("--json", "write result as JSON").action(async (options) => {
|
|
1328
1328
|
await runEmbedConfigCommand(options);
|
|
1329
1329
|
});
|
|
1330
1330
|
return program;
|