gutterpress 0.10.0-beta.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.js +2 -2
- package/dist/{audit-85zn35v8.js → audit-cvarpa72.js} +4 -4
- package/dist/{build-1faqmp0y.js → build-6r502chw.js} +4 -4
- package/dist/{cli-7e79d7se.js → cli-149edp6b.js} +1 -1
- package/dist/{cli-v935c2ws.js → cli-cqtggsng.js} +1 -1
- package/dist/{cli-5tffrg48.js → cli-eq5naw4m.js} +136 -122
- package/dist/{cli-afm8pa0h.js → cli-zfcryxg8.js} +2 -2
- package/dist/cli.js +15 -15
- package/dist/{doctor-69v5c9wy.js → doctor-akvxbtjb.js} +2 -2
- package/dist/{engine-nbfdy0pp.js → engine-b159tbns.js} +2 -2
- package/dist/{engine-hrtn0b28.js → engine-ft4cr3ep.js} +1 -1
- package/dist/{gutterpress-viewer-fb6fhwsy.js → gutterpress-viewer-te8g5grx.js} +55 -21
- package/dist/{index-052x5fef.js → index-ge7q9xj3.js} +244 -230
- package/dist/{index-wsydvp08.js → index-wq3r5pj7.js} +1 -1
- package/dist/{index-c2b6gyeg.js → index-ycpvr0am.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/lib/build-staging.d.ts +51 -0
- package/dist/{lint-17404bsx.js → lint-p2sw53d9.js} +4 -4
- package/dist/{new-vsgpxzek.js → new-hvq0x91q.js} +4 -4
- package/dist/{plugin-s4yfpx6p.js → plugin-pssmk0dx.js} +4 -4
- package/dist/{preflight-1h3apvqh.js → preflight-4j00yd0g.js} +4 -4
- package/dist/{preview-cqf383g4.js → preview-d4s6gk6p.js} +4 -4
- package/dist/{preview-interface-hg5eqv88.js → preview-interface-0ssk8bmm.js} +4 -2
- package/dist/{publish-arvycera.js → publish-tkc26en7.js} +4 -4
- package/dist/{repair-vmwh2bhe.js → repair-2va4w12t.js} +4 -4
- package/dist/{validate-ztzq7p35.js → validate-w9vfefrw.js} +4 -4
- package/package.json +1 -1
package/dist/api/index.js
CHANGED
|
@@ -122,12 +122,12 @@ import {
|
|
|
122
122
|
validateProjectPlugins,
|
|
123
123
|
verifyRepoReadable,
|
|
124
124
|
writeAppHeartbeat
|
|
125
|
-
} from "../index-
|
|
125
|
+
} from "../index-ge7q9xj3.js";
|
|
126
126
|
import {
|
|
127
127
|
BuildError,
|
|
128
128
|
DEFAULT_PRINT_OPTS,
|
|
129
129
|
readyProbeExpr
|
|
130
|
-
} from "../index-
|
|
130
|
+
} from "../index-ycpvr0am.js";
|
|
131
131
|
import {
|
|
132
132
|
AUTO_SNAPSHOT_MESSAGE,
|
|
133
133
|
HISTORY_PAGE_LIMIT,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-eq5naw4m.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-cqtggsng.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-149edp6b.js";
|
|
12
|
+
import"./cli-zfcryxg8.js";
|
|
13
13
|
import"./cli-c41yr7he.js";
|
|
14
14
|
import {
|
|
15
15
|
EXIT_CODES
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
splitOutPath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-eq5naw4m.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-cqtggsng.js";
|
|
8
8
|
import {
|
|
9
9
|
UsageError,
|
|
10
10
|
parseEngine,
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
parsePdfxFlavor,
|
|
13
13
|
rejectExtraPositionals,
|
|
14
14
|
rejectUnknownFlags
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-149edp6b.js";
|
|
16
|
+
import"./cli-zfcryxg8.js";
|
|
17
17
|
import"./cli-c41yr7he.js";
|
|
18
18
|
import {
|
|
19
19
|
BuildError
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "gutterpress",
|
|
7
|
-
version: "0.10.0
|
|
7
|
+
version: "0.10.0",
|
|
8
8
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
9
9
|
author: "itlackey",
|
|
10
10
|
license: "MPL-2.0",
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
stampCreator,
|
|
16
16
|
stripAnnotations,
|
|
17
17
|
warn
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-cqtggsng.js";
|
|
19
19
|
import {
|
|
20
20
|
DEBOUNCE,
|
|
21
21
|
UsageError,
|
|
22
22
|
resolvePort
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-149edp6b.js";
|
|
24
24
|
import {
|
|
25
25
|
MARGIN_BOX_IGNORED_PROPERTIES,
|
|
26
26
|
RENDER_TIMEOUT_MS,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
getAssetPath,
|
|
30
30
|
getBrowser,
|
|
31
31
|
prewarmBrowser
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-zfcryxg8.js";
|
|
33
33
|
import {
|
|
34
34
|
INSTALL_HINTS,
|
|
35
35
|
execCapture,
|
|
@@ -6905,6 +6905,76 @@ async function writeBuildFingerprint(input) {
|
|
|
6905
6905
|
return outPath;
|
|
6906
6906
|
}
|
|
6907
6907
|
|
|
6908
|
+
// src/lib/build-preflight.ts
|
|
6909
|
+
var INSTALL_HINTS2 = {
|
|
6910
|
+
gs: INSTALL_HINTS.gs.body,
|
|
6911
|
+
qpdf: INSTALL_HINTS.qpdf.body
|
|
6912
|
+
};
|
|
6913
|
+
function rendersInPooledChromium(format, opts) {
|
|
6914
|
+
return format !== "html" && !opts.engineBrowser;
|
|
6915
|
+
}
|
|
6916
|
+
async function preflightBuildTools(format, opts, config) {
|
|
6917
|
+
const missing = [];
|
|
6918
|
+
if (rendersInPooledChromium(format, opts) && !await resolveChromiumExecutable()) {
|
|
6919
|
+
await requireChromiumExecutable();
|
|
6920
|
+
}
|
|
6921
|
+
if (format === "pdfx" && !await resolveGhostscript()) {
|
|
6922
|
+
missing.push({ name: "gs (Ghostscript)", installHint: INSTALL_HINTS2.gs });
|
|
6923
|
+
}
|
|
6924
|
+
if (format === "pdfx") {
|
|
6925
|
+
const stripAnnotations2 = opts.stripAnnotations ?? config.pdfx.stripAnnotations;
|
|
6926
|
+
if (stripAnnotations2 && !await isToolAvailable("qpdf")) {
|
|
6927
|
+
missing.push({ name: "qpdf", installHint: INSTALL_HINTS2.qpdf });
|
|
6928
|
+
}
|
|
6929
|
+
}
|
|
6930
|
+
if (missing.length === 0)
|
|
6931
|
+
return;
|
|
6932
|
+
const list = missing.map((m) => ` • ${m.name}
|
|
6933
|
+
${m.installHint}`).join(`
|
|
6934
|
+
|
|
6935
|
+
`);
|
|
6936
|
+
throw new BuildError(`Required system tools not found:
|
|
6937
|
+
|
|
6938
|
+
${list}
|
|
6939
|
+
|
|
6940
|
+
Install the missing tools and re-run, or set GHOSTSCRIPT_PATH, CHROMIUM_PATH, or system PATH so gutterpress can find them. See the User Guide Chapter 7 (System Setup) at examples/gutterpress-user-guide/07-system-setup.md for the full per-feature matrix.`, 2);
|
|
6941
|
+
}
|
|
6942
|
+
async function verifyNativeChromiumMilestone() {
|
|
6943
|
+
let version;
|
|
6944
|
+
try {
|
|
6945
|
+
const browser = await getBrowser(RENDER_TIMEOUT_MS);
|
|
6946
|
+
version = await browser.version();
|
|
6947
|
+
} catch (err) {
|
|
6948
|
+
throw new BuildError(`Could not launch a Chromium browser for --engine native: ` + `${err instanceof Error ? err.message : String(err)}`, 2);
|
|
6949
|
+
}
|
|
6950
|
+
const milestone = Number(/Chrome\/(\d+)/.exec(version)?.[1] ?? 0);
|
|
6951
|
+
if (milestone < REQUIRED_MILESTONE) {
|
|
6952
|
+
await closeBrowser();
|
|
6953
|
+
throw new BuildError(`The Gutterpress native engine requires Chromium ${REQUIRED_MILESTONE}+; found ${version}.
|
|
6954
|
+
|
|
6955
|
+
` + `Install a newer Chrome, Chromium, or Edge, or point CHROMIUM_PATH ` + `(or PUPPETEER_EXECUTABLE_PATH) at a ${REQUIRED_MILESTONE}+ binary.
|
|
6956
|
+
|
|
6957
|
+
` + `Note: this applies to the CLI's own Chromium only — the desktop app ` + `renders --engine native with its own bundled browser and needs no ` + `separate install.`, 2);
|
|
6958
|
+
}
|
|
6959
|
+
}
|
|
6960
|
+
function computeGates(format, opts, config) {
|
|
6961
|
+
if (format === "html") {
|
|
6962
|
+
if (opts.skipLint || opts.skipPreValidate || opts.skipPostValidate) {
|
|
6963
|
+
log.info("Validation/lint flags ignored for --format html (no validation phases apply)");
|
|
6964
|
+
}
|
|
6965
|
+
return { lint: false, preValidate: false, postValidate: false };
|
|
6966
|
+
}
|
|
6967
|
+
const lint2 = !opts.skipLint && config.lint.enabled !== false;
|
|
6968
|
+
const preValidate = !opts.skipPreValidate && config.validate.enabled !== false;
|
|
6969
|
+
const postValidate = format === "pdfx" && !opts.skipPostValidate && config.validate.enabled !== false;
|
|
6970
|
+
return { lint: lint2, preValidate, postValidate };
|
|
6971
|
+
}
|
|
6972
|
+
|
|
6973
|
+
// src/lib/build-staging.ts
|
|
6974
|
+
import path6 from "node:path";
|
|
6975
|
+
import os from "node:os";
|
|
6976
|
+
import fsp from "node:fs/promises";
|
|
6977
|
+
|
|
6908
6978
|
// src/lib/missing-asset-placeholder.ts
|
|
6909
6979
|
import { createHash as createHash5 } from "node:crypto";
|
|
6910
6980
|
import { deflateSync } from "node:zlib";
|
|
@@ -7082,75 +7152,7 @@ function placeholderPng(width = 640, height = 480, cell = 32) {
|
|
|
7082
7152
|
return png;
|
|
7083
7153
|
}
|
|
7084
7154
|
|
|
7085
|
-
// src/lib/build-preflight.ts
|
|
7086
|
-
var INSTALL_HINTS2 = {
|
|
7087
|
-
gs: INSTALL_HINTS.gs.body,
|
|
7088
|
-
qpdf: INSTALL_HINTS.qpdf.body
|
|
7089
|
-
};
|
|
7090
|
-
function rendersInPooledChromium(format, opts) {
|
|
7091
|
-
return format !== "html" && !opts.engineBrowser;
|
|
7092
|
-
}
|
|
7093
|
-
async function preflightBuildTools(format, opts, config) {
|
|
7094
|
-
const missing = [];
|
|
7095
|
-
if (rendersInPooledChromium(format, opts) && !await resolveChromiumExecutable()) {
|
|
7096
|
-
await requireChromiumExecutable();
|
|
7097
|
-
}
|
|
7098
|
-
if (format === "pdfx" && !await resolveGhostscript()) {
|
|
7099
|
-
missing.push({ name: "gs (Ghostscript)", installHint: INSTALL_HINTS2.gs });
|
|
7100
|
-
}
|
|
7101
|
-
if (format === "pdfx") {
|
|
7102
|
-
const stripAnnotations2 = opts.stripAnnotations ?? config.pdfx.stripAnnotations;
|
|
7103
|
-
if (stripAnnotations2 && !await isToolAvailable("qpdf")) {
|
|
7104
|
-
missing.push({ name: "qpdf", installHint: INSTALL_HINTS2.qpdf });
|
|
7105
|
-
}
|
|
7106
|
-
}
|
|
7107
|
-
if (missing.length === 0)
|
|
7108
|
-
return;
|
|
7109
|
-
const list = missing.map((m) => ` • ${m.name}
|
|
7110
|
-
${m.installHint}`).join(`
|
|
7111
|
-
|
|
7112
|
-
`);
|
|
7113
|
-
throw new BuildError(`Required system tools not found:
|
|
7114
|
-
|
|
7115
|
-
${list}
|
|
7116
|
-
|
|
7117
|
-
Install the missing tools and re-run, or set GHOSTSCRIPT_PATH, CHROMIUM_PATH, or system PATH so gutterpress can find them. See the User Guide Chapter 7 (System Setup) at examples/gutterpress-user-guide/07-system-setup.md for the full per-feature matrix.`, 2);
|
|
7118
|
-
}
|
|
7119
|
-
async function verifyNativeChromiumMilestone() {
|
|
7120
|
-
let version;
|
|
7121
|
-
try {
|
|
7122
|
-
const browser = await getBrowser(RENDER_TIMEOUT_MS);
|
|
7123
|
-
version = await browser.version();
|
|
7124
|
-
} catch (err) {
|
|
7125
|
-
throw new BuildError(`Could not launch a Chromium browser for --engine native: ` + `${err instanceof Error ? err.message : String(err)}`, 2);
|
|
7126
|
-
}
|
|
7127
|
-
const milestone = Number(/Chrome\/(\d+)/.exec(version)?.[1] ?? 0);
|
|
7128
|
-
if (milestone < REQUIRED_MILESTONE) {
|
|
7129
|
-
await closeBrowser();
|
|
7130
|
-
throw new BuildError(`The Gutterpress native engine requires Chromium ${REQUIRED_MILESTONE}+; found ${version}.
|
|
7131
|
-
|
|
7132
|
-
` + `Install a newer Chrome, Chromium, or Edge, or point CHROMIUM_PATH ` + `(or PUPPETEER_EXECUTABLE_PATH) at a ${REQUIRED_MILESTONE}+ binary.
|
|
7133
|
-
|
|
7134
|
-
` + `Note: this applies to the CLI's own Chromium only — the desktop app ` + `renders --engine native with its own bundled browser and needs no ` + `separate install.`, 2);
|
|
7135
|
-
}
|
|
7136
|
-
}
|
|
7137
|
-
function computeGates(format, opts, config) {
|
|
7138
|
-
if (format === "html") {
|
|
7139
|
-
if (opts.skipLint || opts.skipPreValidate || opts.skipPostValidate) {
|
|
7140
|
-
log.info("Validation/lint flags ignored for --format html (no validation phases apply)");
|
|
7141
|
-
}
|
|
7142
|
-
return { lint: false, preValidate: false, postValidate: false };
|
|
7143
|
-
}
|
|
7144
|
-
const lint2 = !opts.skipLint && config.lint.enabled !== false;
|
|
7145
|
-
const preValidate = !opts.skipPreValidate && config.validate.enabled !== false;
|
|
7146
|
-
const postValidate = format === "pdfx" && !opts.skipPostValidate && config.validate.enabled !== false;
|
|
7147
|
-
return { lint: lint2, preValidate, postValidate };
|
|
7148
|
-
}
|
|
7149
|
-
|
|
7150
7155
|
// src/lib/build-staging.ts
|
|
7151
|
-
import path6 from "node:path";
|
|
7152
|
-
import os from "node:os";
|
|
7153
|
-
import fsp from "node:fs/promises";
|
|
7154
7156
|
async function shipViewerHtml(htmlFile, outDir) {
|
|
7155
7157
|
await fsp.mkdir(path6.join(outDir, "engine"), { recursive: true });
|
|
7156
7158
|
await fsp.copyFile(await getAssetPath("engine/gutterpress-viewer.js"), path6.join(outDir, "engine/gutterpress-viewer.js"));
|
|
@@ -7159,6 +7161,50 @@ async function shipViewerHtml(htmlFile, outDir) {
|
|
|
7159
7161
|
const html = await fsp.readFile(htmlFile, "utf-8");
|
|
7160
7162
|
await fsp.writeFile(htmlFile, /<\/head>/i.test(html) ? html.replace(/<\/head>/i, tag + "</head>") : tag + html, "utf-8");
|
|
7161
7163
|
}
|
|
7164
|
+
async function stageBookAssets(options) {
|
|
7165
|
+
const { renderDir, outDir, htmlFile, imageRefs, cssAssets, onPlan } = options;
|
|
7166
|
+
const { copies: imageCopies, errors, destinations } = await planImageCopies(renderDir, imageRefs);
|
|
7167
|
+
const copies = [...cssAssets, ...imageCopies];
|
|
7168
|
+
onPlan?.({ unresolved: errors, copyCount: copies.length });
|
|
7169
|
+
const missingPlaceholders = copies.length ? await copyReferencedAssets(copies, outDir) : new Map;
|
|
7170
|
+
let staged = await fsp.readFile(htmlFile, "utf8");
|
|
7171
|
+
if (missingPlaceholders.size > 0) {
|
|
7172
|
+
const rewrites = new Map(missingPlaceholders);
|
|
7173
|
+
for (const [ref, dest] of destinations) {
|
|
7174
|
+
const placeholder = missingPlaceholders.get(dest);
|
|
7175
|
+
if (placeholder)
|
|
7176
|
+
rewrites.set(ref, placeholder);
|
|
7177
|
+
}
|
|
7178
|
+
staged = rewriteMissingImageReferences(staged, rewrites);
|
|
7179
|
+
await fsp.writeFile(htmlFile, staged, "utf8");
|
|
7180
|
+
}
|
|
7181
|
+
if (staged.includes("--gp-shape:")) {
|
|
7182
|
+
await fsp.writeFile(htmlFile, await inlineShapeUrls(staged, outDir), "utf8");
|
|
7183
|
+
}
|
|
7184
|
+
return { missing: [...missingPlaceholders.keys()].sort() };
|
|
7185
|
+
}
|
|
7186
|
+
async function copyReferencedAssets(copies, outDir) {
|
|
7187
|
+
const dirs = new Set(copies.map((c) => path6.dirname(path6.resolve(outDir, c.to))));
|
|
7188
|
+
await Promise.all([...dirs].map((d) => fsp.mkdir(d, { recursive: true })));
|
|
7189
|
+
const missing = new Map;
|
|
7190
|
+
await Promise.all(copies.map(async (c) => {
|
|
7191
|
+
const dest = path6.resolve(outDir, c.to);
|
|
7192
|
+
try {
|
|
7193
|
+
await fsp.copyFile(c.from, dest);
|
|
7194
|
+
} catch (err) {
|
|
7195
|
+
if (err?.code === "ENOENT") {
|
|
7196
|
+
const placeholder = placeholderOutputPath(c.to);
|
|
7197
|
+
const placeholderDest = path6.resolve(outDir, placeholder);
|
|
7198
|
+
await fsp.mkdir(path6.dirname(placeholderDest), { recursive: true });
|
|
7199
|
+
await fsp.writeFile(placeholderDest, placeholderPng());
|
|
7200
|
+
missing.set(c.to, placeholder);
|
|
7201
|
+
return;
|
|
7202
|
+
}
|
|
7203
|
+
throw new BuildError(`Could not copy asset ${c.from} → ${c.to}: ` + (err instanceof Error ? err.message : String(err)), 1);
|
|
7204
|
+
}
|
|
7205
|
+
}));
|
|
7206
|
+
return missing;
|
|
7207
|
+
}
|
|
7162
7208
|
async function createStageRoot() {
|
|
7163
7209
|
return fsp.mkdtemp(path6.join(os.tmpdir(), "gutterpress-stage-"));
|
|
7164
7210
|
}
|
|
@@ -7271,67 +7317,35 @@ async function renderBook(ctx) {
|
|
|
7271
7317
|
}
|
|
7272
7318
|
},
|
|
7273
7319
|
onImageRefs: (refs) => imageRefs.push(...refs),
|
|
7274
|
-
onCssAssets: (
|
|
7320
|
+
onCssAssets: (copies) => cssAssets.push(...copies),
|
|
7275
7321
|
onStyleWarnings: (warnings) => {
|
|
7276
7322
|
for (const w of warnings)
|
|
7277
7323
|
log.warn(` ${w}`);
|
|
7278
7324
|
}
|
|
7279
7325
|
});
|
|
7280
7326
|
log.success(`Wrote ${htmlFile}`);
|
|
7281
|
-
const {
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7327
|
+
const { missing } = await stageBookAssets({
|
|
7328
|
+
renderDir,
|
|
7329
|
+
outDir: workDir,
|
|
7330
|
+
htmlFile,
|
|
7331
|
+
imageRefs,
|
|
7332
|
+
cssAssets,
|
|
7333
|
+
onPlan: ({ unresolved, copyCount }) => {
|
|
7334
|
+
if (unresolved.length > 0) {
|
|
7335
|
+
throw new BuildError(`Cannot resolve ${unresolved.length} image reference(s):
|
|
7336
|
+
` + unresolved.map((e) => ` - ${e}`).join(`
|
|
7285
7337
|
`), 1);
|
|
7286
|
-
}
|
|
7287
|
-
const copies = [...cssAssets, ...imageCopies];
|
|
7288
|
-
let missingPlaceholders = new Map;
|
|
7289
|
-
if (copies.length > 0) {
|
|
7290
|
-
log.info(`Copying ${copies.length} referenced asset(s)`);
|
|
7291
|
-
missingPlaceholders = await copyReferencedAssets(copies, workDir);
|
|
7292
|
-
}
|
|
7293
|
-
let staged = await fsp2.readFile(htmlFile, "utf8");
|
|
7294
|
-
if (missingPlaceholders.size > 0) {
|
|
7295
|
-
const rewrites = new Map(missingPlaceholders);
|
|
7296
|
-
for (const [ref, dest] of destinations) {
|
|
7297
|
-
const placeholder = missingPlaceholders.get(dest);
|
|
7298
|
-
if (placeholder)
|
|
7299
|
-
rewrites.set(ref, placeholder);
|
|
7300
|
-
}
|
|
7301
|
-
staged = rewriteMissingImageReferences(staged, rewrites);
|
|
7302
|
-
await fsp2.writeFile(htmlFile, staged, "utf8");
|
|
7303
|
-
}
|
|
7304
|
-
if (staged.includes("--gp-shape:")) {
|
|
7305
|
-
await fsp2.writeFile(htmlFile, await inlineShapeUrls(staged, workDir), "utf8");
|
|
7306
|
-
}
|
|
7307
|
-
return htmlFile;
|
|
7308
|
-
}
|
|
7309
|
-
async function copyReferencedAssets(copies, outDir) {
|
|
7310
|
-
const dirs = new Set(copies.map((c) => path7.dirname(path7.resolve(outDir, c.to))));
|
|
7311
|
-
await Promise.all([...dirs].map((d) => fsp2.mkdir(d, { recursive: true })));
|
|
7312
|
-
const missing = new Map;
|
|
7313
|
-
await Promise.all(copies.map(async (c) => {
|
|
7314
|
-
const dest = path7.resolve(outDir, c.to);
|
|
7315
|
-
try {
|
|
7316
|
-
await fsp2.copyFile(c.from, dest);
|
|
7317
|
-
} catch (err) {
|
|
7318
|
-
if (err?.code === "ENOENT") {
|
|
7319
|
-
const placeholder = placeholderOutputPath(c.to);
|
|
7320
|
-
const placeholderDest = path7.resolve(outDir, placeholder);
|
|
7321
|
-
await fsp2.mkdir(path7.dirname(placeholderDest), { recursive: true });
|
|
7322
|
-
await fsp2.writeFile(placeholderDest, placeholderPng());
|
|
7323
|
-
missing.set(c.to, placeholder);
|
|
7324
|
-
return;
|
|
7325
7338
|
}
|
|
7326
|
-
|
|
7339
|
+
if (copyCount > 0)
|
|
7340
|
+
log.info(`Copying ${copyCount} referenced asset(s)`);
|
|
7327
7341
|
}
|
|
7328
|
-
})
|
|
7329
|
-
if (missing.
|
|
7330
|
-
log.warn(`${missing.
|
|
7331
|
-
for (const m of
|
|
7342
|
+
});
|
|
7343
|
+
if (missing.length > 0) {
|
|
7344
|
+
log.warn(`${missing.length} referenced image(s) do not exist — a magenta placeholder ` + `was substituted so the build could finish. Each one is a visible hole ` + `in the PDF:`);
|
|
7345
|
+
for (const m of missing)
|
|
7332
7346
|
log.warn(` missing: ${m}`);
|
|
7333
7347
|
}
|
|
7334
|
-
return
|
|
7348
|
+
return htmlFile;
|
|
7335
7349
|
}
|
|
7336
7350
|
async function resolveIccProfile(icc, manifestDir, explicitIccPath) {
|
|
7337
7351
|
const iccCandidates = path7.isAbsolute(icc) ? [icc] : [path7.resolve(manifestDir, icc), path7.resolve(icc)];
|
|
@@ -7429,7 +7443,7 @@ class PdfOutput {
|
|
|
7429
7443
|
const rawPdf = pdfxMode ? path7.join(stage, "raw.pdf") : path7.resolve(pdfFile);
|
|
7430
7444
|
await fsp2.mkdir(path7.dirname(path7.resolve(pdfFile)), { recursive: true });
|
|
7431
7445
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
7432
|
-
const { buildNativePdf } = await import("./engine-
|
|
7446
|
+
const { buildNativePdf } = await import("./engine-ft4cr3ep.js");
|
|
7433
7447
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
7434
7448
|
title: config.title,
|
|
7435
7449
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -1422,7 +1422,7 @@ var favicon_default = "./favicon-wkbm9cjn.ico";
|
|
|
1422
1422
|
var manifest_schema_default = "./manifest.schema-zxgxnbg7.json";
|
|
1423
1423
|
|
|
1424
1424
|
// src/assets/preview/scripts/preview-interface.js
|
|
1425
|
-
var preview_interface_default = "./preview-interface-
|
|
1425
|
+
var preview_interface_default = "./preview-interface-0ssk8bmm.js";
|
|
1426
1426
|
|
|
1427
1427
|
// src/assets/preview/scripts/preview-bridge.js
|
|
1428
1428
|
var preview_bridge_default = "./preview-bridge-fz7vpk8m.js";
|
|
@@ -1434,7 +1434,7 @@ var preview_shell_default = "./preview-shell-c5mfa3q0.js";
|
|
|
1434
1434
|
var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
|
|
1435
1435
|
|
|
1436
1436
|
// src/assets/engine/gutterpress-viewer.js
|
|
1437
|
-
var gutterpress_viewer_default = "./gutterpress-viewer-
|
|
1437
|
+
var gutterpress_viewer_default = "./gutterpress-viewer-te8g5grx.js";
|
|
1438
1438
|
|
|
1439
1439
|
// src/assets/engine/gutterpress-agent.js
|
|
1440
1440
|
var gutterpress_agent_default = "./gutterpress-agent-cazqstr1.js";
|
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
UsageError,
|
|
7
7
|
package_default,
|
|
8
8
|
rejectUnknownFlags
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-149edp6b.js";
|
|
10
10
|
import {
|
|
11
11
|
EXIT_CODES
|
|
12
12
|
} from "./cli-46ycxe6r.js";
|
|
@@ -18,17 +18,17 @@ import {
|
|
|
18
18
|
import { defineCommand, parseArgs, runMain } from "citty";
|
|
19
19
|
import { statSync } from "node:fs";
|
|
20
20
|
var SUBCOMMANDS = {
|
|
21
|
-
new: () => import("./new-
|
|
22
|
-
preview: () => import("./preview-
|
|
23
|
-
build: () => import("./build-
|
|
24
|
-
publish: () => import("./publish-
|
|
25
|
-
lint: () => import("./lint-
|
|
26
|
-
validate: () => import("./validate-
|
|
27
|
-
audit: () => import("./audit-
|
|
28
|
-
preflight: () => import("./preflight-
|
|
29
|
-
repair: () => import("./repair-
|
|
30
|
-
doctor: () => import("./doctor-
|
|
31
|
-
plugin: () => import("./plugin-
|
|
21
|
+
new: () => import("./new-hvq0x91q.js").then((m) => m.default),
|
|
22
|
+
preview: () => import("./preview-d4s6gk6p.js").then((m) => m.default),
|
|
23
|
+
build: () => import("./build-6r502chw.js").then((m) => m.default),
|
|
24
|
+
publish: () => import("./publish-tkc26en7.js").then((m) => m.default),
|
|
25
|
+
lint: () => import("./lint-p2sw53d9.js").then((m) => m.default),
|
|
26
|
+
validate: () => import("./validate-w9vfefrw.js").then((m) => m.default),
|
|
27
|
+
audit: () => import("./audit-cvarpa72.js").then((m) => m.default),
|
|
28
|
+
preflight: () => import("./preflight-4j00yd0g.js").then((m) => m.default),
|
|
29
|
+
repair: () => import("./repair-2va4w12t.js").then((m) => m.default),
|
|
30
|
+
doctor: () => import("./doctor-akvxbtjb.js").then((m) => m.default),
|
|
31
|
+
plugin: () => import("./plugin-pssmk0dx.js").then((m) => m.default)
|
|
32
32
|
};
|
|
33
33
|
var VERSION = package_default.version;
|
|
34
34
|
var main = defineCommand({
|
|
@@ -53,7 +53,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
53
53
|
const [command, ...commandArgs] = rawArgs;
|
|
54
54
|
try {
|
|
55
55
|
if (command === "new") {
|
|
56
|
-
const { newArgs } = await import("./new-
|
|
56
|
+
const { newArgs } = await import("./new-hvq0x91q.js");
|
|
57
57
|
rejectUnknownFlags(commandArgs, newArgs, "new");
|
|
58
58
|
const parsed2 = parseArgs(commandArgs, {
|
|
59
59
|
...newArgs,
|
|
@@ -65,7 +65,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
if (command === "preflight") {
|
|
68
|
-
const { preflightArgs } = await import("./preflight-
|
|
68
|
+
const { preflightArgs } = await import("./preflight-4j00yd0g.js");
|
|
69
69
|
rejectUnknownFlags(commandArgs, preflightArgs, "preflight");
|
|
70
70
|
const parsed2 = parseArgs(commandArgs, {
|
|
71
71
|
...preflightArgs,
|
|
@@ -89,7 +89,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
89
89
|
if (subcommand !== "add") {
|
|
90
90
|
throw new UsageError(`gutterpress plugin: unknown command "${subcommand}"`);
|
|
91
91
|
}
|
|
92
|
-
const { pluginAddArgs } = await import("./plugin-
|
|
92
|
+
const { pluginAddArgs } = await import("./plugin-pssmk0dx.js");
|
|
93
93
|
rejectUnknownFlags(subcommandArgs, pluginAddArgs, "plugin add");
|
|
94
94
|
const parsed = parseArgs(subcommandArgs, {
|
|
95
95
|
...pluginAddArgs,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSystemDiagnostics,
|
|
3
3
|
log
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-cqtggsng.js";
|
|
5
5
|
import {
|
|
6
6
|
UsageError,
|
|
7
7
|
rejectExtraPositionals,
|
|
8
8
|
rejectUnknownFlags
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-149edp6b.js";
|
|
10
10
|
import"./cli-c41yr7he.js";
|
|
11
11
|
import"./cli-46ycxe6r.js";
|
|
12
12
|
import"./cli-37x76zdn.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-wq3r5pj7.js";
|
|
4
4
|
import {
|
|
5
5
|
BuildError,
|
|
6
6
|
RENDER_TIMEOUT_MS,
|
|
7
7
|
assertMilestone,
|
|
8
8
|
connectChromium,
|
|
9
9
|
getBrowser
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-ycpvr0am.js";
|
|
11
11
|
import"./index-37x76zdn.js";
|
|
12
12
|
|
|
13
13
|
// src/lib/engine.ts
|