Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(desktop): AppImage launches reuse a compile cache shipped in the image #19256

Closedayagmar(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/19256/headopened View on GitHub

Showing 5 changed files with 130 additions and 4 deletions (loading 2).

x
0 of 5 viewed, 5 left
111 additions and 0 deletionsapps/desktop/scripts/main-process-bundle.test.mjsModified
View file
@@ -171,3 +171,114 @@
await NodeFSP.rm(directory, { recursive: true, force: true });
});
+​
+it("under AppImage, reuses the shipped compile cache from a different mount path", async () => {
+ const directory = await NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "t3-desktop-appimage-"));
+ try {
+ const entries = ["src/boot.ts", "src/compileCache.ts"];
+ const source = NodePath.join(directory, "source");
+ await NodeFSP.mkdir(NodePath.join(source, "src"), { recursive: true });
+ await Promise.all(
+ entries.map((entry) =>
+ NodeFSP.copyFile(new URL(`../${entry}`, import.meta.url), NodePath.join(source, entry)),
+ ),
+ );
+ assert.ok(Array.isArray(desktopConfig.pack));
+ for (const packConfig of desktopConfig.pack) {
+ if (!Array.isArray(packConfig.entry)) continue;
+ if (!packConfig.entry.some((entry) => entries.includes(entry))) continue;
+ await build({
+ ...packConfig,
+ config: false,
+ cwd: source,
+ tsconfig: false,
+ sourcemap: false,
+ onSuccess: undefined,
+ logLevel: "silent",
+ });
+ }