@mindw1n/webnative 3.0.3 → 3.0.5
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/docs/devlog.md +28 -0
- package/docs/screenshot.png +0 -0
- package/index.js +1 -1
- package/package.json +2 -1
- package/prebuilds/dist/linux +0 -0
- package/prebuilds/dist/linux_self_contained +0 -0
package/docs/devlog.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Project goal
|
|
2
|
+
- Any platform can build for any target with almost zero friction for developer
|
|
3
|
+
- The application itself is always web based
|
|
4
|
+
- Frontend is executed on native WebView component to minimize bundle size
|
|
5
|
+
- Any backend can be used on desktop platforms, as long as it implements the webnative IPC interface
|
|
6
|
+
- Mobile platforms can't support backend, so api abstraction layer is necessary.
|
|
7
|
+
- The cli tool also should be able to create self-contained apps, but in this case the bundle size don't matter
|
|
8
|
+
- Always try to build natively. If not possible, fall back to Docker. If Docker is not installed, xplain clearly why Docker is needed and how to install it manually.
|
|
9
|
+
|
|
10
|
+
## ⏳ means that the feature is under development
|
|
11
|
+
|
|
12
|
+
## v1 (status: partially implemented)
|
|
13
|
+
- ✅ Linux target only
|
|
14
|
+
- ✅ Self-contained AppImage build pipeline
|
|
15
|
+
- ⏳ Optional Node.js backend support
|
|
16
|
+
- ✅ Dev environment: Linux only
|
|
17
|
+
- No Windows/macOS/mobile *targets* in v1
|
|
18
|
+
|
|
19
|
+
## v2 (status: implemented)
|
|
20
|
+
- ✅ Windows and Linux self-contained targets
|
|
21
|
+
- ✅ Dev environment: Linux only
|
|
22
|
+
- No macOS/mobile *targets* in v2
|
|
23
|
+
|
|
24
|
+
## v3 (status: implemented)
|
|
25
|
+
- ✅ Windows and Linux self-contained targets
|
|
26
|
+
- ✅ Android apk target supported
|
|
27
|
+
- ✅ Dev environment: Linux only
|
|
28
|
+
- No macOS/mobile *targets* in v3
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -31,7 +31,7 @@ Name=${e.name}
|
|
|
31
31
|
Exec=app
|
|
32
32
|
Icon=app
|
|
33
33
|
Type=Application
|
|
34
|
-
Categories=${(e.categories??["Utility"]).join(";")};`),e.icon&&await Ci(L(wr,e.icon),L(z.bin,"app.png")),await Ci(L(z.prebuilds,"
|
|
34
|
+
Categories=${(e.categories??["Utility"]).join(";")};`),e.icon&&await Ci(L(wr,e.icon),L(z.bin,"app.png")),await Ci(L(z.prebuilds,"linux"),L(z.bin,"usr/bin/linux")),await Oi(L(z.bin,"usr/bin/linux"),493),await lu(z.public,L(z.bin,"usr/bin/public"),{recursive:!0}),await lu(z.backend,L(z.bin,"usr/bin/backend"),{recursive:!0}),await Ci(z.node,L(z.bin,"usr/bin/node")),await Oi(L(z.bin,"usr/bin/node"),493)}import{mkdir as hu,copyFile as Ea,cp as uu}from"node:fs/promises";import{join as J}from"node:path";var Ai=process.cwd(),Y={prebuilds:J(ot,"prebuilds/dist"),node:J(Lt,"node.exe"),bin:J(Ai,"dist/tmp"),public:J(Ai,"app/public"),backend:J(Ai,"app/backend/dist"),dist:J(Ai,"dist")};async function Ca(){await ou(Y.node),await Lm(),await hu(Y.dist,{recursive:!0}),await eu(Y.bin,J(Y.dist,"windows.zip")),await Ue()}async function Lm(){await hu(Y.bin,{recursive:!0}),await Ea(J(Y.prebuilds,"windows.exe"),J(Y.bin,"windows.exe")),await Ea(J(Y.prebuilds,"WebView2Loader.dll"),J(Y.bin,"WebView2Loader.dll")),await Ea(Y.node,J(Y.bin,"node.exe")),await uu(Y.public,J(Y.bin,"public"),{recursive:!0}),await uu(Y.backend,J(Y.bin,"backend"),{recursive:!0})}var yr={linux:{appimage:Sa},windows:{zip:Ca},android:{apk:Ii}};function Oa(){return`Available platforms:
|
|
35
35
|
`+Object.entries(yr).map(([e,t])=>` ${e}, targets: ${Object.keys(t).join(", ")}`).join(`
|
|
36
36
|
`)}import{join as Mm}from"node:path";function cu(e){e.command("build <platform>").usage("<platform> [options]").description(`Build the application
|
|
37
37
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindw1n/webnative",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.5",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --target=es2020 --outfile=index.js --banner:js=\"#!/usr/bin/env node\" --minify"
|
|
7
7
|
},
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"LICENSE",
|
|
13
13
|
"index.js",
|
|
14
14
|
"prebuilds/dist",
|
|
15
|
+
"docs",
|
|
15
16
|
"template",
|
|
16
17
|
"readme.md"
|
|
17
18
|
],
|
package/prebuilds/dist/linux
CHANGED
|
Binary file
|
|
Binary file
|