Merge branch 'feat/desktop-offline' into feat/do-policies

This commit is contained in:
Linus Rath
2026-11-03 11:40:53 +01:00
118 changed files with 9180 additions and 2535 deletions
+7
View File
@@ -49,6 +49,13 @@ export const LITE_REMOVED_PATHS = [
"public/sqlite3mc",
];
/** The local store's engine in an export: Lite has no offline mode, and must not ship or load it. */
export function unexpectedEngineFiles(files) {
return files
.map((file) => file.replace(/\\/g, "/"))
.filter((file) => /(^|\/)store-worker\.js$/.test(file) || /(^|\/)sqlite3mc\//.test(file) || /(^|\/)sqlite3\.(wasm|mjs)$/.test(file));
}
/** Test trees are pruned too: they import the routes removed above. */
export const LITE_TEST_DIR_NAME = "__tests__";
export const LITE_TEST_FILE_PATTERN = /\.test\.[cm]?[jt]sx?$/;
+5 -1
View File
@@ -10,7 +10,7 @@ import { existsSync, readFileSync, statSync } from "node:fs";
import { join } from "node:path";
import {
LITE_PENDING_PATH_KEY, STALWART_EXCLUDED_FILES, STALWART_MAX_BUNDLE_BYTES, STALWART_SAFE_BUNDLE_BYTES, STALWART_ZIP_NAME,
collectApiStrings, collectZipEntries, discoverBuiltLocales, flightTextRowsWithNeedles, inlineScriptHashes, isMainModule, listZipEntries, parseLiteTarget, resolveRepoRoot, stalwartEntryProblems, stalwartZipEntryProblems, unexpectedApiStrings,
collectApiStrings, collectZipEntries, discoverBuiltLocales, flightTextRowsWithNeedles, inlineScriptHashes, isMainModule, listZipEntries, parseLiteTarget, resolveRepoRoot, stalwartEntryProblems, stalwartZipEntryProblems, unexpectedApiStrings, unexpectedEngineFiles,
} from "./lib.mjs";
const repoRoot = resolveRepoRoot(import.meta.url);
@@ -83,6 +83,10 @@ export function verifyExport({ root = repoRoot, target, safeBundleBytes = STALWA
const unexpected = unexpectedApiStrings(apiStrings);
for (const s of unexpected) problems.push(`client chunk references undocumented server endpoint ${s} (add an IS_LITE gate or document it in scripts/lite/lib.mjs)`);
if (existsSync(outDir)) {
for (const file of unexpectedEngineFiles(collectZipEntries(outDir).map(({ name }) => name))) problems.push(`out/${file} is the local store's engine, which Lite must not ship`);
}
let zipBytes = 0;
if (resolvedTarget === "stalwart") {
const entry = join(outDir, "index.html");