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.
Files changed (50) hide show
  1. package/README.md +88 -40
  2. package/dist/cli.cjs +15 -15
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/index.cjs +2 -2
  5. package/dist/index.mjs +2 -2
  6. package/dist/native/linux-amd64/muon-builder +0 -0
  7. package/dist/native/linux-amd64/{muon-bootstrap → muon-launcher} +0 -0
  8. package/dist/native/linux-amd64/muon-plugin-inspector +0 -0
  9. package/dist/native/linux-amd64/muon-runtime-helper +0 -0
  10. package/dist/native/linux-arm64/muon-builder +0 -0
  11. package/dist/native/linux-arm64/{muon-bootstrap → muon-launcher} +0 -0
  12. package/dist/native/linux-arm64/muon-plugin-inspector +0 -0
  13. package/dist/native/linux-arm64/muon-runtime-helper +0 -0
  14. package/dist/native/linux-armhf/muon-builder +0 -0
  15. package/dist/native/linux-armhf/{muon-bootstrap → muon-launcher} +0 -0
  16. package/dist/native/linux-armhf/muon-plugin-inspector +0 -0
  17. package/dist/native/linux-armhf/muon-runtime-helper +0 -0
  18. package/dist/native/muon-256.png +0 -0
  19. package/dist/native/windows-amd64/muon-builder.exe +0 -0
  20. package/dist/native/windows-amd64/{muon-bootstrap.exe → muon-launcher.exe} +0 -0
  21. package/dist/native/windows-amd64/muon-plugin-inspector.exe +0 -0
  22. package/dist/native/windows-i686/muon-builder.exe +0 -0
  23. package/dist/native/windows-i686/{muon-bootstrap.exe → muon-launcher.exe} +0 -0
  24. package/dist/native/windows-i686/muon-plugin-inspector.exe +0 -0
  25. package/dist/runtime/linux-amd64/CREDITS.md +31 -0
  26. package/dist/runtime/linux-amd64/muon-core +0 -0
  27. package/dist/runtime/linux-arm64/CREDITS.md +31 -0
  28. package/dist/runtime/linux-arm64/muon-core +0 -0
  29. package/dist/runtime/linux-armhf/CREDITS.md +31 -0
  30. package/dist/runtime/linux-armhf/muon-core +0 -0
  31. package/dist/runtime/windows-amd64/CREDITS.md +31 -0
  32. package/dist/runtime/windows-amd64/libcardio.dll +0 -0
  33. package/dist/runtime/windows-amd64/libmuon-ui.dll +0 -0
  34. package/dist/runtime/windows-amd64/muon-core.exe +0 -0
  35. package/dist/runtime/windows-i686/CREDITS.md +31 -0
  36. package/dist/runtime/windows-i686/libcardio.dll +0 -0
  37. package/dist/runtime/windows-i686/libmuon-ui.dll +0 -0
  38. package/dist/runtime/windows-i686/muon-core.exe +0 -0
  39. package/dist/{vite-internals-BInO_2N9.cjs → vite-internals-D987wez0.cjs} +79 -71
  40. package/dist/vite-internals-D987wez0.cjs.map +1 -0
  41. package/dist/vite.cjs +244 -17
  42. package/dist/vite.cjs.map +1 -1
  43. package/dist/vite.mjs +326 -94
  44. package/dist/vite.mjs.map +1 -1
  45. package/images/muon-120.png +0 -0
  46. package/images/vscode.png +0 -0
  47. package/muon.d.ts +40 -23
  48. package/package.json +7 -7
  49. package/vite.d.ts +15 -5
  50. 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 This?
12
+ ## What is this?
13
13
 
14
- Have you ever thought about how to update an outdated native GUI application into a modern one?
15
- Replacing applications is extremely complex and has always been a challenge for us.
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
- Since the causes are so varied, there is no "magic solution" that promises, "Use this method, and it'll be easily solved!"
18
- Even so, everyone wants to modernize their applications at the lowest possible cost.
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 (/ˈmjuːɒn/) is a multiplatform GUI application framework that uses CEF (Chromium Embedded Framework).
21
- You’ve probably heard of several similar projects, such as [Electron](https://www.electronjs.org/).
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
- To put it simply, muon is a framework that occupies the same niche as those projects.
24
- In other words, it’s software that allows you to implement locally running GUI applications as web applications.
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 advanced and widely used browser-based UI frameworks, such as React and Vue.
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
  ![vscode](./images/vscode.png)
29
29
 
30
- So, how does muon differ from earlier framework solutions?
30
+ So how is muon different from earlier framework software?
31
31
 
32
- It specializes in GUI application development within a local environment by using a whitelist approach (with a "deny-by-default" policy)
33
- for accessing external web resources.
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 might think, "It's a waste to use CEF without being able to access websites around the world!"
36
- However, I believe that is precisely the biggest problem with existing solutions—they've become extremely complex and difficult to manage.
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
- Furthermore, muon isn't completely unable to access external resources; since it uses a whitelist approach,
39
- you can still access permitted websites.
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
- It also features a plugin system that supports fully asynchronous processing, enabling interoperability with native libraries.
42
- Since these features become available based on pre-configured settings, there's no risk of unused functionality running unchecked.
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
- Since it's CEF-based, you can naturally use features expected in Chromium, such as WebGL, WebGPU, WebAssembly, Web Workers, and Local Storage.
45
- You can also display DevTools. Because it supports CDP (Chromium DevTools Protocol), you can debug using tools like VS Code or connect and control it via Playwright.
46
- You can also use remote DevTools from Chromium/Chrome via `chrome://inspect/`.
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, by clearly eliminating one of the major issues that arise when migrating native GTK/Qt/Windows applications to web applications,
49
- you can develop modern local GUI applications using the web-based technology ecosystem.
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
- - By restricting all network access with a whitelist filter, you can completely block problematic content.
54
- - It is provided as an easy-to-use NPM package, allowing you to easily turn your web application project into a native GUI application. No complex configuration or modifications are required.
55
- - The browser responsible for rendering is CEF (Chromium Embedded Framework). This means that, from the perspective of the web application, it is virtually equivalent to using Chromium or Chrome.
56
- - It supports Vite plugins. Since it supports Vite’s HMR, you can preview real-time updates during development.
57
- - With `muon run`, you can launch a development environment that uses local assets directly without starting an HTTP server.
58
- - You can include the Linux desktop launcher and icon metadata in your distribution build.
59
- - You can use DevTools. Furthermore, since it supports CDP (Chromium DevTools Protocol), you can perform remote debugging from an external source.
60
- - You can display multiple browser windows. Browser windows can also be organized into a parent-child hierarchy.
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 among those supported by the official CEF binaries:
68
- - Linux: amd64, armv7l, arm64
67
+ - Supports the following architectures from the official CEF binary architectures:
68
+ - Linux: amd64, armhf, arm64
69
69
  - Windows: i686, amd64
70
- - Build Environment
70
+ - Build environment
71
71
  - Node.js 20 or later
72
- - Vite 5 or later (optional)
72
+ - Vite 5 or later
73
73
 
74
74
  ---
75
75
 
76
- TODO:
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.14.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: 90d4fe3c0d2c7ac5c81682663879ddf9966a490b
9
+ * git.commit.hash: 33c694fe496f80cab223ce4231f3249ddf6b3dd1
10
10
  */
11
- const require_vite_internals = require("./vite-internals-BInO_2N9.cjs");
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.14.0";
1097
- var git_commit_hash = "90d4fe3c0d2c7ac5c81682663879ddf9966a490b";
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.bootstrapPath === void 0) throw new Error("Specify at least one of --runtime-path, --core-path, or --bootstrap-path.");
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.bootstrapPath === void 0 && options.outputBootstrap !== void 0) throw new Error("--output-bootstrap requires --bootstrap-path.");
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 bootstrapResult = commandOptions.bootstrapPath === void 0 ? void 0 : await require_vite_internals.embedMuonConfigInBootstrapFile({
1290
- bootstrapPath: commandOptions.bootstrapPath,
1289
+ const launcherResult = commandOptions.launcherPath === void 0 ? void 0 : await require_vite_internals.embedMuonConfigInLauncherFile({
1290
+ launcherPath: commandOptions.launcherPath,
1291
1291
  configPath,
1292
- outputPath: commandOptions.outputBootstrap
1292
+ outputPath: commandOptions.outputLauncher
1293
1293
  });
1294
- if (coreResult !== void 0 && bootstrapResult !== 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
- bootstrap: bootstrapResult
1297
+ launcher: launcherResult
1298
1298
  }, null, 2));
1299
- else console.log(`${coreResult.outputPath}\n${bootstrapResult.outputPath}`);
1299
+ else console.log(`${coreResult.outputPath}\n${launcherResult.outputPath}`);
1300
1300
  return;
1301
1301
  }
1302
- const result = coreResult ?? bootstrapResult;
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("--bootstrap-path <path>", "muon-bootstrap 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-bootstrap <path>", "patched bootstrap output path").option("--json", "write result as JSON").action(async (options) => {
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;