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.
@@ -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.2" : args[0] === "--headless" ? "Wayland compositor" : "Usage");
172
+ expect(landHelp.stdout).toContain(args[0] === "--version" ? "0.1.3" : args[0] === "--headless" ? "Wayland compositor" : "Usage");
168
173
  }
169
- expect(existsSync(join(js, "usr/lib/node_modules/buninu-land/vendor/canvaskit/canvaskit.wasm"))).toBe(true);
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
+ });