3b0b39558887
fix: Preserve Chrome archive paths (v5.2.1)
- time
- 2026-09-06 18:23 UTC · 1 month ago
- machine
- koh2
- parent
- 3536281cbb50
↓ peach-browser-3b0b3955.tar.gzatlas at this save
files changed5 files
manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1scripts/release-lib.test.ts+23 −1scripts/release-lib.ts+6 −3manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22 "manifest_version": 3,33 "name": "Peach Password Manager",4- "version": "5.2.0",4+ "version": "5.2.1",55 "description": "Zero-knowledge password manager",66 "browser_specific_settings": {77 "gecko": {manifest.json+1 −1
@@ -2,7 +2,7 @@22 "manifest_version": 3,33 "minimum_chrome_version": "116",44 "name": "Peach Password Manager",5- "version": "5.2.0",5+ "version": "5.2.1",66 "description": "Zero-knowledge password manager",77 "action": {88 "default_popup": "src/popup/index.html",package.json+1 −1
@@ -1,6 +1,6 @@11 {22 "name": "peach",3- "version": "5.2.0",3+ "version": "5.2.1",44 "description": "Zero-knowledge password manager",55 "license": "GPL-3.0-only",66 "type": "module",scripts/release-lib.test.ts+23 −1
@@ -1,7 +1,8 @@11 // scripts/release-lib.test.ts22 // PB-26-211: release tool hardening — security tests for the argv-based runner.33 import { createHash } from "node:crypto";4-import { existsSync, readFileSync, rmSync } from "node:fs";4+import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";5+import { tmpdir } from "node:os";56 import { fileURLToPath } from "node:url";67 import { dirname, join, resolve } from "node:path";78 import { afterEach, describe, expect, it } from "vitest";@@ -14,6 +15,7 @@1415 resolveBin,1516 preflight,1617 packageChromeZip,18+ collectDirectory,1719 uploadChrome,1820 signFirefox,1921 CWS_SECRET_NAMES,@@ -289,6 +291,26 @@289291 expect(createHash("sha256").update(first).digest("hex")).toBe(290292 createHash("sha256").update(second).digest("hex"),291293 );294+ });295+296+ it("preserves paths relative to the distribution root", () => {297+ const fixture = join(tmpdir(), `peach-release-paths-${process.pid}`);298+ rmSync(fixture, { recursive: true, force: true });299+ mkdirSync(join(fixture, "assets"), { recursive: true });300+ mkdirSync(join(fixture, "icons"), { recursive: true });301+ writeFileSync(join(fixture, "manifest.json"), "{}");302+ writeFileSync(join(fixture, "assets", "entry.js"), "export {};");303+ writeFileSync(join(fixture, "icons", "16.png"), "icon");304+305+ try {306+ expect(collectDirectory(fixture).map((entry) => entry.path)).toEqual([307+ "assets/entry.js",308+ "icons/16.png",309+ "manifest.json",310+ ]);311+ } finally {312+ rmSync(fixture, { recursive: true, force: true });313+ }292314 });293315 294316 it("embeds no source maps, .DS_Store or __MACOSX entries", () => {scripts/release-lib.ts+6 −3
@@ -220,11 +220,14 @@220220 );221221 }222222 223-function collectDirectory(dir: string): Array<{ path: string; data: Buffer }> {223+export function collectDirectory(224+ dir: string,225+ root = dir,226+): Array<{ path: string; data: Buffer }> {224227 return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {225228 const full = join(dir, entry.name);226- if (entry.isDirectory()) return collectDirectory(full);227- return [{ path: relative(dir, full).split(sep).join("/"), data: readFileSync(full) }];229+ if (entry.isDirectory()) return collectDirectory(full, root);230+ return [{ path: relative(root, full).split(sep).join("/"), data: readFileSync(full) }];228231 });229232 }230233