buninu-linux 0.11.56 → 0.14.57
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/NOTICE.md +53 -50
- package/README.md +50 -19
- package/fetch-alpine.sh +1 -1
- package/initramfs/bin/buninu-land +2 -0
- package/initramfs/bin/dhclient +8 -0
- package/initramfs/bin/ping +8 -0
- package/initramfs/buninu/apps/jsgotty/gotty.js +4 -2
- package/initramfs/init.js +8 -7
- package/initramfs/lib/browser-resources.js +11 -0
- package/initramfs/lib/bunterm/images.js +2 -1
- package/initramfs/lib/bunterm/renderer.js +1 -1
- package/initramfs/lib/bunterm/terminal.js +2 -2
- package/initramfs/lib/dhclient.js +135 -0
- package/initramfs/lib/dhcp-start.js +85 -0
- package/initramfs/lib/dhcp-transport.js +44 -0
- package/initramfs/lib/dhcp.js +124 -0
- package/initramfs/lib/dlopen.js +58 -11
- package/initramfs/lib/ping.js +110 -0
- package/initramfs/usr/share/doc/buninu-linux/bunterm.md +1 -1
- package/initramfs/usr/share/doc/buninu-linux/dhclient.md +82 -0
- package/initramfs/usr/share/doc/buninu-linux/ping.md +91 -0
- package/package.json +2 -2
- package/scripts/arch.js +5 -5
- package/scripts/arch.sh +5 -5
- package/scripts/modules.js +1 -0
- package/scripts/npm-packages.md +11 -11
- package/scripts/stage-npm.js +8 -1
- package/scripts/stage-npm.sh +9 -1
- package/test/bunterm-image-bytes.test.js +55 -0
- package/test/dhcp-start.test.js +67 -0
- package/test/dhcp.test.js +99 -0
- package/test/fetch-npm.test.js +1 -1
- package/test/libc.test.js +41 -0
- package/test/ping.test.js +80 -0
- package/test/stage-npm.test.js +23 -3
package/test/stage-npm.test.js
CHANGED
|
@@ -6,7 +6,7 @@ import { join, resolve } from "node:path";
|
|
|
6
6
|
import { spawnSync } from "node:child_process";
|
|
7
7
|
import { stageNpm } from "../scripts/stage-npm.js";
|
|
8
8
|
import { npmPackages, npmDownloadsDir } from "../scripts/fetch-npm.js";
|
|
9
|
-
import { ensureBrowserResources } from "../initramfs/lib/browser-resources.js";
|
|
9
|
+
import { ensureBrowserResources, ensureLandResources } from "../initramfs/lib/browser-resources.js";
|
|
10
10
|
|
|
11
11
|
const work = mkdtempSync(join(tmpdir(), "buninu-stage-npm-"));
|
|
12
12
|
afterAll(() => rmSync(work, { recursive: true, force: true }));
|
|
@@ -26,6 +26,7 @@ async function fixture() {
|
|
|
26
26
|
"package/usr/lib/canvaskit/data": "only browser excludes this",
|
|
27
27
|
"package/usr/share/fonts/data": "only browser excludes this",
|
|
28
28
|
"package/lib/data": "keep data",
|
|
29
|
+
"package/vendor/canvaskit/canvaskit.wasm": "different wasm must be retained",
|
|
29
30
|
}, { compress: "gzip" }).bytes();
|
|
30
31
|
const archive = bin + ".tgz";
|
|
31
32
|
writeFileSync(join(downloadsDir, archive), data);
|
|
@@ -47,6 +48,7 @@ test("stages standard scoped layout, manifest, bins and browser-only exclusion",
|
|
|
47
48
|
expect(readFileSync(join(dir, "usr/README.md"), "utf8")).toBe("keep resource documentation");
|
|
48
49
|
expect(existsSync(join(dir, "usr/lib/canvaskit"))).toBe(pkg.name !== "buninu-browser");
|
|
49
50
|
expect(existsSync(join(dir, "usr/share/fonts"))).toBe(pkg.name !== "buninu-browser");
|
|
51
|
+
expect(readFileSync(join(dir, "vendor/canvaskit/canvaskit.wasm"), "utf8")).toBe("different wasm must be retained");
|
|
50
52
|
expect(statSync(join(dir, "index.js")).mode & 0o111).toBe(0o111);
|
|
51
53
|
expect(readlinkSync(join(lib, "node_modules/.bin", pkg.name.split("/").pop())))
|
|
52
54
|
.toBe(`../${pkg.name}/index.js`);
|
|
@@ -109,6 +111,8 @@ test("land launcher selects bundled casty and preserves package frontend dispatc
|
|
|
109
111
|
stageNpm(root, cfg);
|
|
110
112
|
const land = join(root, "usr/lib/node_modules/buninu-land");
|
|
111
113
|
mkdirSync(join(root, "bin"));
|
|
114
|
+
mkdirSync(join(root, "lib"), { recursive: true });
|
|
115
|
+
copyFileSync(new URL("../initramfs/lib/browser-resources.js", import.meta.url), join(root, "lib/browser-resources.js"));
|
|
112
116
|
const launcher = join(root, "bin/buninu-land");
|
|
113
117
|
copyFileSync(new URL("../initramfs/bin/buninu-land", import.meta.url), launcher);
|
|
114
118
|
writeFileSync(join(land, "index.js"), `
|
|
@@ -144,6 +148,7 @@ test.skipIf(!npmPackages.every(pkg => existsSync(join(npmDownloadsDir, pkg.archi
|
|
|
144
148
|
expect(result.status).toBe(0);
|
|
145
149
|
expect(readFileSync(join(shell, "usr/lib/package.json"), "utf8")).toBe(readFileSync(join(js, "usr/lib/package.json"), "utf8"));
|
|
146
150
|
for (const root of [js, shell]) {
|
|
151
|
+
expect(existsSync(join(root, "usr/lib/node_modules/buninu-land/vendor/canvaskit/canvaskit.wasm"))).toBe(false);
|
|
147
152
|
expect(existsSync(join(root, "usr/lib/node_modules/buninu-browser/usr/README.md"))).toBe(true);
|
|
148
153
|
expect(existsSync(join(root, "usr/lib/node_modules/buninu-browser/usr/lib/canvaskit"))).toBe(false);
|
|
149
154
|
expect(existsSync(join(root, "usr/lib/node_modules/buninu-browser/usr/share/fonts"))).toBe(false);
|
|
@@ -164,8 +169,23 @@ test.skipIf(!npmPackages.every(pkg => existsSync(join(npmDownloadsDir, pkg.archi
|
|
|
164
169
|
for (const args of [["--help"], ["--headless", "--help"], ["--version"]]) {
|
|
165
170
|
const landHelp = spawnSync(process.execPath, [join(js, "bin/buninu-land"), ...args], { encoding: "utf8", timeout: 15000 });
|
|
166
171
|
expect(landHelp.status).toBe(0);
|
|
167
|
-
expect(landHelp.stdout).toContain(args[0] === "--version" ? "0.1.
|
|
172
|
+
expect(landHelp.stdout).toContain(args[0] === "--version" ? "0.1.3" : args[0] === "--headless" ? "Wayland compositor" : "Usage");
|
|
168
173
|
}
|
|
169
|
-
|
|
174
|
+
const landWasm = join(js, "usr/lib/node_modules/buninu-land/vendor/canvaskit/canvaskit.wasm");
|
|
175
|
+
expect(readlinkSync(landWasm).startsWith("/")).toBe(false);
|
|
176
|
+
expect(readFileSync(landWasm).equals(readFileSync(join(js, "lib/canvaskit/canvaskit.wasm")))).toBe(true);
|
|
170
177
|
expect(existsSync(join(js, "usr/lib/node_modules/buninu-land/LICENSES/hyprland.txt"))).toBe(true);
|
|
171
178
|
}, 30000);
|
|
179
|
+
|
|
180
|
+
test("land resource link is relative, repeatable, and preserves a package-owned WASM", () => {
|
|
181
|
+
const root = fresh(), land = join(root, "usr/lib/node_modules/buninu-land");
|
|
182
|
+
mkdirSync(join(root, "lib/canvaskit"), { recursive: true });
|
|
183
|
+
writeFileSync(join(root, "lib/canvaskit/canvaskit.wasm"), "shared");
|
|
184
|
+
ensureLandResources(land, root); ensureLandResources(land, root);
|
|
185
|
+
const wasm = join(land, "vendor/canvaskit/canvaskit.wasm");
|
|
186
|
+
expect(readlinkSync(wasm).startsWith("/")).toBe(false);
|
|
187
|
+
expect(readFileSync(wasm, "utf8")).toBe("shared");
|
|
188
|
+
rmSync(wasm); writeFileSync(wasm, "package-owned");
|
|
189
|
+
ensureLandResources(land, root);
|
|
190
|
+
expect(readFileSync(wasm, "utf8")).toBe("package-owned");
|
|
191
|
+
});
|