#!/usr/bin/env node
// make-tiny-pptx.mjs
//
// Builds a minimal ECMA-376 (OOXML) presentation skeleton and writes it to
// tests/fixtures/documents/tiny.pptx using adm-zip (root devDep).
//
// ACCEPTANCE (2026-06-12, snapotter/snapotter:latest + libreoffice-impress):
// soffice --headless --norestore --nolockcheck --nodefault \
// --convert-to pdf --outdir /tmp /tmp/tiny.pptx
// Result: /tmp/tiny.pdf produced, 8454 bytes. Impress opens the skeleton
// and renders the single-slide text box via impress_pdf_Export filter.
// NOTE: libreoffice-impress must be added to the Dockerfile (wave 3b image
// only had libreoffice-writer + libreoffice-calc).
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import AdmZip from "adm-zip";
const __dirname = dirname(fileURLToPath(import.meta.url));
const outPath = join(__dirname, "..", "..", "tests", "fixtures", "documents", "tiny.pptx");
const zip = new AdmZip();
// [Content_Types].xml
zip.addFile(
"[Content_Types].xml",
Buffer.from(`
`),
);
// _rels/.rels
zip.addFile(
"_rels/.rels",
Buffer.from(`
`),
);
// ppt/presentation.xml
zip.addFile(
"ppt/presentation.xml",
Buffer.from(`
`),
);
// ppt/_rels/presentation.xml.rels
zip.addFile(
"ppt/_rels/presentation.xml.rels",
Buffer.from(`
`),
);
// ppt/slides/slide1.xml
zip.addFile(
"ppt/slides/slide1.xml",
Buffer.from(`
SnapOtter pptx fixture
`),
);
// ppt/slides/_rels/slide1.xml.rels
zip.addFile(
"ppt/slides/_rels/slide1.xml.rels",
Buffer.from(`
`),
);
// ppt/slideLayouts/slideLayout1.xml
zip.addFile(
"ppt/slideLayouts/slideLayout1.xml",
Buffer.from(`
`),
);
// ppt/slideLayouts/_rels/slideLayout1.xml.rels
zip.addFile(
"ppt/slideLayouts/_rels/slideLayout1.xml.rels",
Buffer.from(`
`),
);
// ppt/slideMasters/slideMaster1.xml
zip.addFile(
"ppt/slideMasters/slideMaster1.xml",
Buffer.from(`
`),
);
// ppt/slideMasters/_rels/slideMaster1.xml.rels
zip.addFile(
"ppt/slideMasters/_rels/slideMaster1.xml.rels",
Buffer.from(`
`),
);
// ppt/theme/theme1.xml
zip.addFile(
"ppt/theme/theme1.xml",
Buffer.from(`
`),
);
zip.writeZip(outPath);
console.log(`Wrote ${outPath}`);