YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(release): retain literal route paths in localization
Ezra Elletteaff5652f4124
diff --git a/apps/screenpipe-app-tauri/bun.lock b/apps/screenpipe-app-tauri/bun.lockindex c7b129f2f..2c0e4d68d 100644--- a/apps/screenpipe-app-tauri/bun.lock+++ b/apps/screenpipe-app-tauri/bun.lock@@ -114,6 +114,7 @@"eslint-config-next": "14.2.4","eslint-plugin-react-hooks": "4.6.2","eslint-plugin-react-x": "^5.10.1",+ "fast-glob": "3.3.3","gt": "2.21.3","jsdom": "^24.1.3","mocha": "^11.7.5",diff --git a/apps/screenpipe-app-tauri/package.json b/apps/screenpipe-app-tauri/package.jsonindex 07f3fa55b..7ae852f85 100644--- a/apps/screenpipe-app-tauri/package.json+++ b/apps/screenpipe-app-tauri/package.json@@ -195,6 +195,7 @@"eslint-config-next": "14.2.4","eslint-plugin-react-hooks": "4.6.2","eslint-plugin-react-x": "^5.10.1",+ "fast-glob": "3.3.3","gt": "2.21.3","jsdom": "^24.1.3","mocha": "^11.7.5",diff --git a/apps/screenpipe-app-tauri/scripts/i18n/collect.mjs b/apps/screenpipe-app-tauri/scripts/i18n/collect.mjsindex 0737477d7..7d8405b55 100644--- a/apps/screenpipe-app-tauri/scripts/i18n/collect.mjs+++ b/apps/screenpipe-app-tauri/scripts/i18n/collect.mjs@@ -6,15 +6,18 @@import { generateSettings } from "gt/config/generateSettings";import { collectFiles } from "gt/formats/files/collectFiles";import { matchFiles } from "gt/fs/matchFiles";+import glob from "fast-glob";import path from "node:path";import { writeJson } from "./prepare.mjs";const settings = await generateSettings({ config: process.argv[2], omitConfigIds: true });// GT keeps the first source for a shared message ID, including icon metadata.// Resolve exclusions first, then give every runner the same relative file order.+// The collector expands these paths again, so retain literal Next.js route names.settings.src = matchFiles(process.cwd(), settings.src).map((file) => path.relative(process.cwd(), file).split(path.sep).join("/"))- .sort();+ .sort()+ .map((file) => glob.posix.escapePath(file));const { files } = await collectFiles({ inline: true }, settings, "gt-react");const file = files.find((file) => file.fileFormat === "GTJSON");const destination = path.join(process.cwd(), ".localization/source");diff --git a/apps/screenpipe-app-tauri/scripts/i18n/collect.test.ts b/apps/screenpipe-app-tauri/scripts/i18n/collect.test.tsindex 38e180163..15d300058 100644--- a/apps/screenpipe-app-tauri/scripts/i18n/collect.test.ts+++ b/apps/screenpipe-app-tauri/scripts/i18n/collect.test.ts@@ -24,8 +24,13 @@ test("release snapshot handoff is independent of source file discovery order", aawait fs.mkdir(path.dirname(path.join(root, file)), { recursive: true });await fs.writeFile(path.join(root, file), `export function Probe() { return <button><${icon} />Manage</button>; }`);}+ const route = path.join(root, "app/(main)/[slug]/page.tsx");+ await fs.mkdir(path.dirname(route), { recursive: true });+ await fs.writeFile(route, "export default function Page() { return <p>Literal route message</p>; }");const snapshot = await prepareLocalization({ root, config, mode: "cached" });- expect(snapshot.coverage.ja.frontend.total).toBe(1);+ expect(snapshot.coverage.ja.frontend.total).toBe(2);+ const source = JSON.parse(await fs.readFile(path.join(root, ".localization/source/en.json"), "utf8"));+ expect(Object.values(source)).toContain("Literal route message");process.env.SCREENPIPE_I18N_SNAPSHOT = path.join(root, ".localization/snapshot.json");const handedOff = await prepareLocalization({ root, config: { ...config, src: [...config.src].reverse() }, mode: "cached" });expect(handedOff).toEqual(snapshot);