feat(POSTV1-ASSET-ALL-16): 生成并部署全量复杂素材
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run

This commit is contained in:
suyx
2026-08-06 11:39:46 +08:00
parent fd4cd277cc
commit 9de0d2a63c
9 changed files with 8644 additions and 46 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ function fixture() {
sha256: createHash("sha256").update(bytes).digest("hex"),
};
const manifest = {
counts: { dynamic_fonts: 0, dynamic_images: 0, font_panel_items: 0, static_stickers: 1 },
counts: { dynamic_fonts: 0, dynamic_images: 0, font_panel_items: 0, static_stickers: 1, text_previews: 0 },
entries: [entry],
root_ref: "p0a_runtime_assets",
schema_version: "DadaRuntimeAssets/v1",
+7 -6
View File
@@ -15,12 +15,13 @@ import {
test("committed P0-A runtime manifest covers the frozen first-version binary assets", () => {
const manifest = readRuntimeAssetManifest("config/runtime-assets-manifest.json");
assert.deepEqual(manifest.counts, {
dynamic_fonts: 7,
dynamic_images: 8,
font_panel_items: 11,
dynamic_fonts: 18,
dynamic_images: 43,
font_panel_items: 86,
static_stickers: 1407,
text_previews: 261,
});
assert.equal(manifest.entries.length, 1433);
assert.equal(manifest.entries.length, 1815);
assert.doesNotMatch(serializeRuntimeAssetManifest(manifest), /[A-Za-z]:[\\/]/);
});
@@ -42,7 +43,7 @@ test("runtime asset deployment creates verified hardlinks and a path-free manife
sha256: createHash("sha256").update(bytes).digest("hex"),
};
const manifest = createRuntimeAssetManifest({
counts: { dynamic_fonts: 0, dynamic_images: 0, font_panel_items: 0, static_stickers: 1 },
counts: { dynamic_fonts: 0, dynamic_images: 0, font_panel_items: 0, static_stickers: 1, text_previews: 0 },
entries: [entry],
});
@@ -75,7 +76,7 @@ test("runtime asset deployment refuses a mismatched existing target", async (t)
sha256: createHash("sha256").update("expected").digest("hex"),
};
const manifest = createRuntimeAssetManifest({
counts: { dynamic_fonts: 0, dynamic_images: 0, font_panel_items: 0, static_stickers: 1 },
counts: { dynamic_fonts: 0, dynamic_images: 0, font_panel_items: 0, static_stickers: 1, text_previews: 0 },
entries: [entry],
});
+5 -4
View File
@@ -114,12 +114,13 @@ test("portable package serves the product and keeps SQLite data across API resta
assert.ok(existsSync(join(packageRoot, "web", "index.html")));
const runtimeAssetManifest = JSON.parse(await readFile(join(packageRoot, "asset-metadata", "manifest.json"), "utf8"));
assert.deepEqual(runtimeAssetManifest.counts, {
dynamic_fonts: 7,
dynamic_images: 8,
font_panel_items: 11,
dynamic_fonts: 18,
dynamic_images: 43,
font_panel_items: 86,
static_stickers: 1407,
text_previews: 261,
});
assert.equal(runtimeAssetManifest.entries.length, 1433);
assert.equal(runtimeAssetManifest.entries.length, 1815);
const packagedWorker = await readFile(join(packageRoot, "server", "worker", "dist", "worker.js"), "utf8");
const packagedOneApiAdapter = await readFile(join(packageRoot, "server", "worker", "dist", "oneapi-generation-adapter.js"), "utf8");
assert.match(packagedWorker, /GenerationProcessor/);
+11
View File
@@ -1,5 +1,6 @@
import { describe, expect, it } from "vitest";
import complexAssetCatalog from "../../apps/web/src/generated/complex-assets.json";
import {
P0A_COLOR_CARD_IDS,
P0A_DYNAMIC_STICKER_IDS,
@@ -25,4 +26,14 @@ describe("POSTV1-ASSET-ALL-16 complete asset catalog", () => {
expect(P0A_DYNAMIC_STICKER_IDS[0]).toBe("DYN001");
expect(P0A_DYNAMIC_STICKER_IDS.at(-1)).toBe("DYN035");
});
it("generates a sanitized browser catalog for every text, font, and dynamic definition", () => {
expect(complexAssetCatalog.schema_version).toBe("DadaComplexBrowserCatalog/v1");
expect(complexAssetCatalog.text_templates).toHaveLength(332);
expect(complexAssetCatalog.font_panel_items).toHaveLength(86);
expect(complexAssetCatalog.dynamic_stickers).toHaveLength(35);
expect(complexAssetCatalog.text_templates.filter((item) => item.preview_asset_id)).toHaveLength(261);
expect(complexAssetCatalog.text_templates.every((item) => item.available)).toBe(true);
expect(JSON.stringify(complexAssetCatalog)).not.toMatch(/[A-Z]:[\\/]/i);
});
});