gutterpress 0.11.16-alpha.3 → 0.11.16-alpha.5
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.d.ts +1 -1
- package/dist/api/index.js +4 -2
- package/dist/{build-tse0tq0t.js → build-ee2traqp.js} +4 -4
- package/dist/{cli-x9bb628z.js → cli-4d4xegsw.js} +23 -12
- package/dist/{cli-14j4aqtc.js → cli-6s4pkvbx.js} +1 -1
- package/dist/{cli-w9qc8fem.js → cli-cg03zvez.js} +1 -1
- package/dist/{cli-8597az31.js → cli-wqy8hnnh.js} +2 -2
- package/dist/cli.js +12 -12
- package/dist/{doctor-s6npnst2.js → doctor-zn08944p.js} +2 -2
- package/dist/{engine-6jnxqfsm.js → engine-j5h953pg.js} +1 -1
- package/dist/{engine-5b92gk8n.js → engine-w17dbt4f.js} +2 -2
- package/dist/{ext-tf6x156j.js → ext-bw7da6e1.js} +4 -4
- package/dist/{index-w1qk3tap.js → index-ee7wp8q3.js} +2 -2
- package/dist/{index-ncxfknbv.js → index-nk2mt7gp.js} +26 -12
- package/dist/{index-zb48zwcq.js → index-qep93v0z.js} +1 -1
- package/dist/index.js +5 -3
- package/dist/lib/extension-manager.d.ts +14 -2
- package/dist/{new-n43vrq56.js → new-c9b5wwpe.js} +4 -4
- package/dist/{preflight-qnp6rd1d.js → preflight-mnpqsnsz.js} +4 -4
- package/dist/{preview-interface-twd6nsf5.js → preview-interface-5wnzrvhf.js} +5 -1
- package/dist/{preview-v66m0vff.js → preview-kcqapj66.js} +4 -4
- package/dist/{preview-shell-y8yrm3f0.js → preview-shell-xwn84kqr.js} +2 -1
- package/dist/{publish-xgmbeerq.js → publish-zf218d0c.js} +4 -4
- package/dist/{validate-281t5k0g.js → validate-mh9r5qzx.js} +4 -4
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export { listBuiltInTemplates, listCustomTemplates, saveProjectAsTemplate, impor
|
|
|
33
33
|
export type { TemplateInfo, SaveProjectAsTemplateOptions, } from "../lib/project-templates.ts";
|
|
34
34
|
export { extractVariables, substituteVariables, listSnippets, saveSnippet, deleteSnippet, listMergedSnippets, listMarkerComponents, SNIPPETS_DIR, } from "../lib/snippets.ts";
|
|
35
35
|
export type { MarkerComponent, SnippetEntry, SnippetSource } from "../lib/snippets.ts";
|
|
36
|
-
export { listProjectExtensions, describeExtension, addExtension, checkExtensionUpdates, updateExtensions, removeExtension, setExtensionEnabled, reorderExtensions, validateProjectExtensions, readExtensionCss, listBuiltInStyleSets, addBuiltInStyleSet, sameExtension, RECOMMENDED_EXTENSIONS, BUILT_IN_STYLE_SET_IDS, EXTENSIONS_DIR, PLUGINS_DIR, } from "../lib/extension-manager.ts";
|
|
36
|
+
export { listProjectExtensions, describeExtension, addExtension, checkExtensionUpdates, listNpmVersions, updateExtensions, removeExtension, setExtensionEnabled, reorderExtensions, validateProjectExtensions, readExtensionCss, listBuiltInStyleSets, addBuiltInStyleSet, sameExtension, RECOMMENDED_EXTENSIONS, BUILT_IN_STYLE_SET_IDS, EXTENSIONS_DIR, PLUGINS_DIR, } from "../lib/extension-manager.ts";
|
|
37
37
|
export type { ProjectExtensionEntry, ExtensionValidationResult, RecommendedExtension, ExtensionSourceKind, BuiltInStyleSet, BuiltInStyleSetId, AddExtensionOptions, ExtensionUpdateCheck, ExtensionUpdateResult, CheckExtensionUpdatesOptions, UpdateExtensionsOptions, } from "../lib/extension-manager.ts";
|
|
38
38
|
export { BUNDLED_EXTENSIONS, isBundledExtension, isPathSpecifier, parseExtensionSpecifier, } from "../lib/extension-specifier.ts";
|
|
39
39
|
export type { ParsedExtensionSpecifier } from "../lib/extension-specifier.ts";
|
package/dist/api/index.js
CHANGED
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
listGitHubRepositories,
|
|
72
72
|
listMarkerComponents,
|
|
73
73
|
listMergedSnippets,
|
|
74
|
+
listNpmVersions,
|
|
74
75
|
listProjectExtensions,
|
|
75
76
|
listProjectStyles,
|
|
76
77
|
listPublishAccounts,
|
|
@@ -128,10 +129,10 @@ import {
|
|
|
128
129
|
testRemoteAccess,
|
|
129
130
|
updateExtensions,
|
|
130
131
|
validateProjectExtensions
|
|
131
|
-
} from "../index-
|
|
132
|
+
} from "../index-nk2mt7gp.js";
|
|
132
133
|
import {
|
|
133
134
|
BuildError
|
|
134
|
-
} from "../index-
|
|
135
|
+
} from "../index-ee7wp8q3.js";
|
|
135
136
|
import {
|
|
136
137
|
DEFAULT_PRINT_OPTS,
|
|
137
138
|
assertMilestone,
|
|
@@ -226,6 +227,7 @@ export {
|
|
|
226
227
|
listPublishAccounts,
|
|
227
228
|
listProjectStyles,
|
|
228
229
|
listProjectExtensions,
|
|
230
|
+
listNpmVersions,
|
|
229
231
|
listMergedSnippets,
|
|
230
232
|
listMarkerComponents,
|
|
231
233
|
listLocalBranches,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
splitOutPath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-4d4xegsw.js";
|
|
5
5
|
import {
|
|
6
6
|
log
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-6s4pkvbx.js";
|
|
8
8
|
import {
|
|
9
9
|
UsageError,
|
|
10
10
|
parseFormat,
|
|
11
11
|
parsePdfxFlavor,
|
|
12
12
|
rejectExtraPositionals,
|
|
13
13
|
rejectUnknownFlags
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import"./cli-
|
|
14
|
+
} from "./cli-cg03zvez.js";
|
|
15
|
+
import"./cli-wqy8hnnh.js";
|
|
16
16
|
import {
|
|
17
17
|
BuildError
|
|
18
18
|
} from "./cli-46ycxe6r.js";
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
stampCreator,
|
|
14
14
|
stripAnnotations,
|
|
15
15
|
warn
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-6s4pkvbx.js";
|
|
17
17
|
import {
|
|
18
18
|
DEBOUNCE,
|
|
19
19
|
UsageError,
|
|
20
20
|
resolvePort
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-cg03zvez.js";
|
|
22
22
|
import {
|
|
23
23
|
MARGIN_BOX_IGNORED_PROPERTIES,
|
|
24
24
|
getAssetPath,
|
|
25
25
|
getAssetsDir
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-wqy8hnnh.js";
|
|
27
27
|
import {
|
|
28
28
|
BuildError
|
|
29
29
|
} from "./cli-46ycxe6r.js";
|
|
@@ -8202,7 +8202,7 @@ class PdfOutput {
|
|
|
8202
8202
|
const rawPdf = pdfxMode ? path8.join(stage, "raw.pdf") : path8.resolve(pdfFile);
|
|
8203
8203
|
await fsp2.mkdir(path8.dirname(path8.resolve(pdfFile)), { recursive: true });
|
|
8204
8204
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
8205
|
-
const { buildNativePdf } = await import("./engine-
|
|
8205
|
+
const { buildNativePdf } = await import("./engine-j5h953pg.js");
|
|
8206
8206
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
8207
8207
|
title: config.title,
|
|
8208
8208
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -10492,7 +10492,7 @@ async function rollbackNpmPluginInstall(installed) {
|
|
|
10492
10492
|
}
|
|
10493
10493
|
|
|
10494
10494
|
// src/lib/extension-manager.ts
|
|
10495
|
-
import { gt as semverGt } from "semver";
|
|
10495
|
+
import { gt as semverGt, rcompare as semverRcompare } from "semver";
|
|
10496
10496
|
var EXTENSIONS_DIR = "extensions";
|
|
10497
10497
|
var RECOMMENDED_EXTENSIONS = [
|
|
10498
10498
|
{
|
|
@@ -10879,7 +10879,7 @@ async function pruneOtherVersions(projectDir, name, keep) {
|
|
|
10879
10879
|
}
|
|
10880
10880
|
var LATEST_LOOKUP_TIMEOUT_MS = 30000;
|
|
10881
10881
|
var MAX_PACKUMENT_BYTES = 15 * 1024 * 1024;
|
|
10882
|
-
async function
|
|
10882
|
+
async function fetchNpmVersions(name, options) {
|
|
10883
10883
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
10884
10884
|
return withFetchTimeout({
|
|
10885
10885
|
timeoutMs: LATEST_LOOKUP_TIMEOUT_MS,
|
|
@@ -10900,18 +10900,29 @@ async function latestNpmVersion(name, options) {
|
|
|
10900
10900
|
if (bytes.byteLength > MAX_PACKUMENT_BYTES) {
|
|
10901
10901
|
throw new FriendlyHttpError(`npm metadata for "${name}" is too large to read.`);
|
|
10902
10902
|
}
|
|
10903
|
-
let latest;
|
|
10904
10903
|
try {
|
|
10905
|
-
|
|
10904
|
+
const packument = JSON.parse(Buffer.from(bytes).toString("utf8"));
|
|
10905
|
+
return {
|
|
10906
|
+
latest: packument["dist-tags"]?.latest,
|
|
10907
|
+
versions: Object.keys(packument.versions ?? {}).filter(isExactNpmVersion)
|
|
10908
|
+
};
|
|
10906
10909
|
} catch {
|
|
10907
10910
|
throw new FriendlyHttpError(`npm metadata for "${name}" is not valid JSON.`);
|
|
10908
10911
|
}
|
|
10909
|
-
if (typeof latest !== "string" || !isExactNpmVersion(latest)) {
|
|
10910
|
-
throw new FriendlyHttpError(`npm metadata for "${name}" has no latest version.`);
|
|
10911
|
-
}
|
|
10912
|
-
return latest;
|
|
10913
10912
|
});
|
|
10914
10913
|
}
|
|
10914
|
+
async function latestNpmVersion(name, options) {
|
|
10915
|
+
const { latest, versions } = await fetchNpmVersions(name, options);
|
|
10916
|
+
if (options.includePrerelease) {
|
|
10917
|
+
const newest = versions.sort(semverRcompare)[0];
|
|
10918
|
+
if (newest)
|
|
10919
|
+
return newest;
|
|
10920
|
+
}
|
|
10921
|
+
if (typeof latest !== "string" || !isExactNpmVersion(latest)) {
|
|
10922
|
+
throw new FriendlyHttpError(`npm metadata for "${name}" has no latest version.`);
|
|
10923
|
+
}
|
|
10924
|
+
return latest;
|
|
10925
|
+
}
|
|
10915
10926
|
async function checkExtensionUpdates(projectDir, options = {}) {
|
|
10916
10927
|
const entries = await listProjectExtensions(projectDir);
|
|
10917
10928
|
const pinned = entries.filter((e) => e.kind === "npm" && e.version);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "gutterpress",
|
|
7
|
-
version: "0.11.16-alpha.
|
|
7
|
+
version: "0.11.16-alpha.5",
|
|
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",
|
|
@@ -1109,13 +1109,13 @@ var favicon_default = "./favicon-wkbm9cjn.ico";
|
|
|
1109
1109
|
var manifest_schema_default = "./manifest.schema-40sfq49z.json";
|
|
1110
1110
|
|
|
1111
1111
|
// src/assets/preview/scripts/preview-interface.js
|
|
1112
|
-
var preview_interface_default = "./preview-interface-
|
|
1112
|
+
var preview_interface_default = "./preview-interface-5wnzrvhf.js";
|
|
1113
1113
|
|
|
1114
1114
|
// src/assets/preview/scripts/preview-bridge.js
|
|
1115
1115
|
var preview_bridge_default = "./preview-bridge-8jhd1wpb.js";
|
|
1116
1116
|
|
|
1117
1117
|
// src/assets/preview/scripts/preview-shell.js
|
|
1118
|
-
var preview_shell_default = "./preview-shell-
|
|
1118
|
+
var preview_shell_default = "./preview-shell-xwn84kqr.js";
|
|
1119
1119
|
|
|
1120
1120
|
// profiles/CGATS21_CRPC1.icc
|
|
1121
1121
|
var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
|
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-cg03zvez.js";
|
|
10
10
|
import {
|
|
11
11
|
EXIT_CODES
|
|
12
12
|
} from "./cli-46ycxe6r.js";
|
|
@@ -18,14 +18,14 @@ 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
|
-
validate: () => import("./validate-
|
|
26
|
-
preflight: () => import("./preflight-
|
|
27
|
-
doctor: () => import("./doctor-
|
|
28
|
-
ext: () => import("./ext-
|
|
21
|
+
new: () => import("./new-c9b5wwpe.js").then((m) => m.default),
|
|
22
|
+
preview: () => import("./preview-kcqapj66.js").then((m) => m.default),
|
|
23
|
+
build: () => import("./build-ee2traqp.js").then((m) => m.default),
|
|
24
|
+
publish: () => import("./publish-zf218d0c.js").then((m) => m.default),
|
|
25
|
+
validate: () => import("./validate-mh9r5qzx.js").then((m) => m.default),
|
|
26
|
+
preflight: () => import("./preflight-mnpqsnsz.js").then((m) => m.default),
|
|
27
|
+
doctor: () => import("./doctor-zn08944p.js").then((m) => m.default),
|
|
28
|
+
ext: () => import("./ext-bw7da6e1.js").then((m) => m.default)
|
|
29
29
|
};
|
|
30
30
|
var VERSION = package_default.version;
|
|
31
31
|
var main = defineCommand({
|
|
@@ -50,7 +50,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
50
50
|
const [command, ...commandArgs] = rawArgs;
|
|
51
51
|
try {
|
|
52
52
|
if (command === "new") {
|
|
53
|
-
const { newArgs } = await import("./new-
|
|
53
|
+
const { newArgs } = await import("./new-c9b5wwpe.js");
|
|
54
54
|
rejectUnknownFlags(commandArgs, newArgs, "new");
|
|
55
55
|
const parsed = parseArgs(commandArgs, {
|
|
56
56
|
...newArgs,
|
|
@@ -62,7 +62,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
if (command === "preflight") {
|
|
65
|
-
const { preflightArgs } = await import("./preflight-
|
|
65
|
+
const { preflightArgs } = await import("./preflight-mnpqsnsz.js");
|
|
66
66
|
rejectUnknownFlags(commandArgs, preflightArgs, "preflight");
|
|
67
67
|
const parsed = parseArgs(commandArgs, {
|
|
68
68
|
...preflightArgs,
|
|
@@ -82,7 +82,7 @@ async function preflightRequiredInvocations(rawArgs) {
|
|
|
82
82
|
}
|
|
83
83
|
if (subcommand.startsWith("-"))
|
|
84
84
|
return;
|
|
85
|
-
const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-
|
|
85
|
+
const { EXT_SUBCOMMANDS, extAddArgs, extRemoveArgs, extEnableArgs, extDisableArgs } = await import("./ext-bw7da6e1.js");
|
|
86
86
|
if (!EXT_SUBCOMMANDS.includes(subcommand)) {
|
|
87
87
|
throw new UsageError(`gutterpress ext: unknown command "${subcommand}"`);
|
|
88
88
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSystemDiagnostics,
|
|
3
3
|
log
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-6s4pkvbx.js";
|
|
5
5
|
import {
|
|
6
6
|
UsageError,
|
|
7
7
|
rejectExtraPositionals,
|
|
8
8
|
rejectUnknownFlags
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-cg03zvez.js";
|
|
10
10
|
import"./cli-46ycxe6r.js";
|
|
11
11
|
import"./cli-7fkhgtfn.js";
|
|
12
12
|
import"./cli-37x76zdn.js";
|
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
searchNpmExtensions,
|
|
13
13
|
setExtensionEnabled,
|
|
14
14
|
updateExtensions
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-4d4xegsw.js";
|
|
16
|
+
import"./cli-6s4pkvbx.js";
|
|
17
17
|
import {
|
|
18
18
|
UsageError,
|
|
19
19
|
exitForUsage,
|
|
20
20
|
rejectExtraPositionals,
|
|
21
21
|
rejectUnknownFlags,
|
|
22
22
|
resolveProjectDir
|
|
23
|
-
} from "./cli-
|
|
24
|
-
import"./cli-
|
|
23
|
+
} from "./cli-cg03zvez.js";
|
|
24
|
+
import"./cli-wqy8hnnh.js";
|
|
25
25
|
import {
|
|
26
26
|
EXIT_CODES
|
|
27
27
|
} from "./cli-46ycxe6r.js";
|
|
@@ -29,13 +29,13 @@ var favicon_default = "./favicon-wkbm9cjn.ico";
|
|
|
29
29
|
var manifest_schema_default = "./manifest.schema-40sfq49z.json";
|
|
30
30
|
|
|
31
31
|
// src/assets/preview/scripts/preview-interface.js
|
|
32
|
-
var preview_interface_default = "./preview-interface-
|
|
32
|
+
var preview_interface_default = "./preview-interface-5wnzrvhf.js";
|
|
33
33
|
|
|
34
34
|
// src/assets/preview/scripts/preview-bridge.js
|
|
35
35
|
var preview_bridge_default = "./preview-bridge-8jhd1wpb.js";
|
|
36
36
|
|
|
37
37
|
// src/assets/preview/scripts/preview-shell.js
|
|
38
|
-
var preview_shell_default = "./preview-shell-
|
|
38
|
+
var preview_shell_default = "./preview-shell-xwn84kqr.js";
|
|
39
39
|
|
|
40
40
|
// profiles/CGATS21_CRPC1.icc
|
|
41
41
|
var CGATS21_CRPC1_default = "./CGATS21_CRPC1-g0e3k7kr.icc";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MARGIN_BOX_IGNORED_PROPERTIES,
|
|
5
5
|
getAssetPath,
|
|
6
6
|
getAssetsDir
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-ee7wp8q3.js";
|
|
8
8
|
import {
|
|
9
9
|
INSTALL_HINTS,
|
|
10
10
|
execCapture,
|
|
@@ -4077,7 +4077,7 @@ import git from "isomorphic-git";
|
|
|
4077
4077
|
// package.json
|
|
4078
4078
|
var package_default = {
|
|
4079
4079
|
name: "gutterpress",
|
|
4080
|
-
version: "0.11.16-alpha.
|
|
4080
|
+
version: "0.11.16-alpha.5",
|
|
4081
4081
|
description: "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
4082
4082
|
author: "itlackey",
|
|
4083
4083
|
license: "MPL-2.0",
|
|
@@ -8692,7 +8692,7 @@ class PdfOutput {
|
|
|
8692
8692
|
const rawPdf = pdfxMode ? path8.join(stage, "raw.pdf") : path8.resolve(pdfFile);
|
|
8693
8693
|
await fsp2.mkdir(path8.dirname(path8.resolve(pdfFile)), { recursive: true });
|
|
8694
8694
|
log.info("Rendering HTML to PDF via the Gutterpress engine (native Chromium pagination)");
|
|
8695
|
-
const { buildNativePdf } = await import("./engine-
|
|
8695
|
+
const { buildNativePdf } = await import("./engine-w17dbt4f.js");
|
|
8696
8696
|
const engineDiagnostics = await buildNativePdf(htmlFile, rawPdf, {
|
|
8697
8697
|
title: config.title,
|
|
8698
8698
|
author: config.authors.length > 0 ? config.authors.join(", ") : undefined,
|
|
@@ -11549,7 +11549,7 @@ async function rollbackNpmPluginInstall(installed) {
|
|
|
11549
11549
|
}
|
|
11550
11550
|
|
|
11551
11551
|
// src/lib/extension-manager.ts
|
|
11552
|
-
import { gt as semverGt } from "semver";
|
|
11552
|
+
import { gt as semverGt, rcompare as semverRcompare } from "semver";
|
|
11553
11553
|
var EXTENSIONS_DIR = "extensions";
|
|
11554
11554
|
var RECOMMENDED_EXTENSIONS = [
|
|
11555
11555
|
{
|
|
@@ -11959,7 +11959,7 @@ async function pruneOtherVersions(projectDir, name, keep) {
|
|
|
11959
11959
|
}
|
|
11960
11960
|
var LATEST_LOOKUP_TIMEOUT_MS = 30000;
|
|
11961
11961
|
var MAX_PACKUMENT_BYTES = 15 * 1024 * 1024;
|
|
11962
|
-
async function
|
|
11962
|
+
async function fetchNpmVersions(name, options) {
|
|
11963
11963
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
11964
11964
|
return withFetchTimeout({
|
|
11965
11965
|
timeoutMs: LATEST_LOOKUP_TIMEOUT_MS,
|
|
@@ -11980,18 +11980,32 @@ async function latestNpmVersion(name, options) {
|
|
|
11980
11980
|
if (bytes.byteLength > MAX_PACKUMENT_BYTES) {
|
|
11981
11981
|
throw new FriendlyHttpError(`npm metadata for "${name}" is too large to read.`);
|
|
11982
11982
|
}
|
|
11983
|
-
let latest;
|
|
11984
11983
|
try {
|
|
11985
|
-
|
|
11984
|
+
const packument = JSON.parse(Buffer.from(bytes).toString("utf8"));
|
|
11985
|
+
return {
|
|
11986
|
+
latest: packument["dist-tags"]?.latest,
|
|
11987
|
+
versions: Object.keys(packument.versions ?? {}).filter(isExactNpmVersion)
|
|
11988
|
+
};
|
|
11986
11989
|
} catch {
|
|
11987
11990
|
throw new FriendlyHttpError(`npm metadata for "${name}" is not valid JSON.`);
|
|
11988
11991
|
}
|
|
11989
|
-
if (typeof latest !== "string" || !isExactNpmVersion(latest)) {
|
|
11990
|
-
throw new FriendlyHttpError(`npm metadata for "${name}" has no latest version.`);
|
|
11991
|
-
}
|
|
11992
|
-
return latest;
|
|
11993
11992
|
});
|
|
11994
11993
|
}
|
|
11994
|
+
async function latestNpmVersion(name, options) {
|
|
11995
|
+
const { latest, versions } = await fetchNpmVersions(name, options);
|
|
11996
|
+
if (options.includePrerelease) {
|
|
11997
|
+
const newest = versions.sort(semverRcompare)[0];
|
|
11998
|
+
if (newest)
|
|
11999
|
+
return newest;
|
|
12000
|
+
}
|
|
12001
|
+
if (typeof latest !== "string" || !isExactNpmVersion(latest)) {
|
|
12002
|
+
throw new FriendlyHttpError(`npm metadata for "${name}" has no latest version.`);
|
|
12003
|
+
}
|
|
12004
|
+
return latest;
|
|
12005
|
+
}
|
|
12006
|
+
async function listNpmVersions(name, options = {}) {
|
|
12007
|
+
return (await fetchNpmVersions(name, options)).versions.sort(semverRcompare);
|
|
12008
|
+
}
|
|
11995
12009
|
async function checkExtensionUpdates(projectDir, options = {}) {
|
|
11996
12010
|
const entries = await listProjectExtensions(projectDir);
|
|
11997
12011
|
const pinned = entries.filter((e) => e.kind === "npm" && e.version);
|
|
@@ -16302,4 +16316,4 @@ async function setPublishProviderConfig(projectDir, providerId, values) {
|
|
|
16302
16316
|
await writeManifestDoc(file, doc);
|
|
16303
16317
|
return settingsFromDoc(doc);
|
|
16304
16318
|
}
|
|
16305
|
-
export { BUNDLED_EXTENSIONS, isBundledExtension, isPathSpecifier, parseExtensionSpecifier, PRESET_IDS, PRESETS, TARGETS, TARGET_IDS, publishTargetFor, MANIFEST_FILENAMES, hasProjectManifest, loadManifest, loadManifestWithPath, resolveConfig, SYNC_SNAPSHOT_MESSAGE, log, resolveActiveStyles, listProjectStyles, EXTENSION_MANIFEST_FILENAME, readExtensionMeta, extensionStyleList, extensionEntry, extensionCarries, pathEscapesFolder, assertExtensionContained, resolveExtension, getChecks, getCheckById, resolveCheckSelectors, formatReport, ruleRemoteUrls, ruleRiskyProps, ruleSyntax, checkCss, inspectImage, runChecks, checkToolAvailability, reportMissingTools, executeValidation, executeAndReport, splitOutPath, runBuild, openPath, startPreviewServer, defaultConfigDir, FileTokenStore, extractUrlCredential, getSystemDiagnostics, slugifyProjectName, escapeYamlScalar, scaffoldProject, adoptFolder, ensureGitignoreHasDist, EXTENSION_KINDS, RESERVED_PREFIX, resolveExtensionPrefix, scaffoldExtension, BUILT_IN_TEMPLATE_IDS, listBuiltInTemplates, saveProjectAsTemplate, listCustomTemplates, importTemplateFromFolder, DEFAULT_NPM_REGISTRY, npmRegistryUrl, EXTENSIONS_DIR, RECOMMENDED_EXTENSIONS, BUILT_IN_STYLE_SET_IDS, sameExtension, listProjectExtensions, describeExtension, setExtensionEnabled, reorderExtensions, removeExtension, addExtension, checkExtensionUpdates, updateExtensions, listBuiltInStyleSets, addBuiltInStyleSet, validateProjectExtensions, readExtensionCss, SNIPPETS_DIR, extractVariables, substituteVariables, listSnippets, saveSnippet, deleteSnippet, listMergedSnippets, listMarkerComponents, importExtensionFromFile, importExtensionFromUrl, MAX_SEARCH_BYTES, SEARCH_KEYWORDS, searchNpmExtensions, setManifestFields, readManifestFields, setActiveStyles, AUTO_SNAPSHOT_DEFAULT_MINUTES, AUTO_SYNC_MIN_MINUTES, AUTO_SYNC_MAX_MINUTES, AUTO_SYNC_DEFAULT_MINUTES, AUTO_SYNC_PUSH_INTERVAL_MINUTES, autoSnapshotDelayMs, autoSyncDelayMs, isGitInternalPath, resolveGitHubClientId, GITHUB_HOST, GitHubAuthProvider, GDRIVE_HOST, resolveGoogleClientId, resolveGoogleClientSecret, GOOGLE_NOT_CONFIGURED_MESSAGE, requireGoogleClientCredentials, pkceChallengeFromVerifier, GoogleAuthProvider, revokeGoogleCredential, publishCredentialKey, publishConnectionStatus, listPublishAccounts, connectGoogleDrive, listGitHubRepositories, listRepoBooks, listGitHubBranches, sanitizeCloneFolderName, cloneRepository, isSshRemoteUrl, testRemoteAccess, knownForgeTokenUrl, connectGenericHost, parseRemoteOrigin, forgeKindForHost, diagnoseProjectRemote, syncProject, refreshRemoteCopies, REPAIR_SNAPSHOT_MESSAGE, repairOnlineBackup, scorchedEarth, listPublishProviders, publishProviderFor, resolvePublishFormat, resolvePublishRequest, runPublish, connectPublishProvider, disconnectPublishCredential, PublishSelectionsStore, readPublishSettings, setPublishProviderConfig };
|
|
16319
|
+
export { BUNDLED_EXTENSIONS, isBundledExtension, isPathSpecifier, parseExtensionSpecifier, PRESET_IDS, PRESETS, TARGETS, TARGET_IDS, publishTargetFor, MANIFEST_FILENAMES, hasProjectManifest, loadManifest, loadManifestWithPath, resolveConfig, SYNC_SNAPSHOT_MESSAGE, log, resolveActiveStyles, listProjectStyles, EXTENSION_MANIFEST_FILENAME, readExtensionMeta, extensionStyleList, extensionEntry, extensionCarries, pathEscapesFolder, assertExtensionContained, resolveExtension, getChecks, getCheckById, resolveCheckSelectors, formatReport, ruleRemoteUrls, ruleRiskyProps, ruleSyntax, checkCss, inspectImage, runChecks, checkToolAvailability, reportMissingTools, executeValidation, executeAndReport, splitOutPath, runBuild, openPath, startPreviewServer, defaultConfigDir, FileTokenStore, extractUrlCredential, getSystemDiagnostics, slugifyProjectName, escapeYamlScalar, scaffoldProject, adoptFolder, ensureGitignoreHasDist, EXTENSION_KINDS, RESERVED_PREFIX, resolveExtensionPrefix, scaffoldExtension, BUILT_IN_TEMPLATE_IDS, listBuiltInTemplates, saveProjectAsTemplate, listCustomTemplates, importTemplateFromFolder, DEFAULT_NPM_REGISTRY, npmRegistryUrl, EXTENSIONS_DIR, RECOMMENDED_EXTENSIONS, BUILT_IN_STYLE_SET_IDS, sameExtension, listProjectExtensions, describeExtension, setExtensionEnabled, reorderExtensions, removeExtension, addExtension, listNpmVersions, checkExtensionUpdates, updateExtensions, listBuiltInStyleSets, addBuiltInStyleSet, validateProjectExtensions, readExtensionCss, SNIPPETS_DIR, extractVariables, substituteVariables, listSnippets, saveSnippet, deleteSnippet, listMergedSnippets, listMarkerComponents, importExtensionFromFile, importExtensionFromUrl, MAX_SEARCH_BYTES, SEARCH_KEYWORDS, searchNpmExtensions, setManifestFields, readManifestFields, setActiveStyles, AUTO_SNAPSHOT_DEFAULT_MINUTES, AUTO_SYNC_MIN_MINUTES, AUTO_SYNC_MAX_MINUTES, AUTO_SYNC_DEFAULT_MINUTES, AUTO_SYNC_PUSH_INTERVAL_MINUTES, autoSnapshotDelayMs, autoSyncDelayMs, isGitInternalPath, resolveGitHubClientId, GITHUB_HOST, GitHubAuthProvider, GDRIVE_HOST, resolveGoogleClientId, resolveGoogleClientSecret, GOOGLE_NOT_CONFIGURED_MESSAGE, requireGoogleClientCredentials, pkceChallengeFromVerifier, GoogleAuthProvider, revokeGoogleCredential, publishCredentialKey, publishConnectionStatus, listPublishAccounts, connectGoogleDrive, listGitHubRepositories, listRepoBooks, listGitHubBranches, sanitizeCloneFolderName, cloneRepository, isSshRemoteUrl, testRemoteAccess, knownForgeTokenUrl, connectGenericHost, parseRemoteOrigin, forgeKindForHost, diagnoseProjectRemote, syncProject, refreshRemoteCopies, REPAIR_SNAPSHOT_MESSAGE, repairOnlineBackup, scorchedEarth, listPublishProviders, publishProviderFor, resolvePublishFormat, resolvePublishRequest, runPublish, connectPublishProvider, disconnectPublishCredential, PublishSelectionsStore, readPublishSettings, setPublishProviderConfig };
|
package/dist/index.js
CHANGED
|
@@ -79,6 +79,7 @@ import {
|
|
|
79
79
|
listGitHubRepositories,
|
|
80
80
|
listMarkerComponents,
|
|
81
81
|
listMergedSnippets,
|
|
82
|
+
listNpmVersions,
|
|
82
83
|
listProjectExtensions,
|
|
83
84
|
listProjectStyles,
|
|
84
85
|
listPublishAccounts,
|
|
@@ -145,13 +146,13 @@ import {
|
|
|
145
146
|
testRemoteAccess,
|
|
146
147
|
updateExtensions,
|
|
147
148
|
validateProjectExtensions
|
|
148
|
-
} from "./index-
|
|
149
|
+
} from "./index-nk2mt7gp.js";
|
|
149
150
|
import {
|
|
150
151
|
BUILD_DIAGNOSTIC_CODES
|
|
151
|
-
} from "./index-
|
|
152
|
+
} from "./index-qep93v0z.js";
|
|
152
153
|
import {
|
|
153
154
|
BuildError
|
|
154
|
-
} from "./index-
|
|
155
|
+
} from "./index-ee7wp8q3.js";
|
|
155
156
|
import {
|
|
156
157
|
DEFAULT_PRINT_OPTS,
|
|
157
158
|
assertMilestone,
|
|
@@ -255,6 +256,7 @@ export {
|
|
|
255
256
|
listPublishAccounts,
|
|
256
257
|
listProjectStyles,
|
|
257
258
|
listProjectExtensions,
|
|
259
|
+
listNpmVersions,
|
|
258
260
|
listMergedSnippets,
|
|
259
261
|
listMarkerComponents,
|
|
260
262
|
listLocalBranches,
|
|
@@ -153,7 +153,7 @@ export interface ExtensionUpdateCheck {
|
|
|
153
153
|
name: string;
|
|
154
154
|
/** The pinned version. */
|
|
155
155
|
current: string;
|
|
156
|
-
/** npm's `latest` dist-tag. */
|
|
156
|
+
/** npm's `latest` dist-tag (the newest of any kind with `includePrerelease`). */
|
|
157
157
|
latest: string;
|
|
158
158
|
/** `latest` is newer than `current` (semver). */
|
|
159
159
|
outdated: boolean;
|
|
@@ -162,9 +162,21 @@ export interface CheckExtensionUpdatesOptions {
|
|
|
162
162
|
/** Dependency injection for tests; production uses global fetch. */
|
|
163
163
|
fetch?: typeof globalThis.fetch;
|
|
164
164
|
signal?: AbortSignal;
|
|
165
|
+
/**
|
|
166
|
+
* Compare against the newest published version, pre-releases included
|
|
167
|
+
* (`-alpha`, `-beta`, `-rc`), instead of npm's `latest` dist-tag. Default
|
|
168
|
+
* false: the dist-tag, as `ext outdated` has always done.
|
|
169
|
+
*/
|
|
170
|
+
includePrerelease?: boolean;
|
|
165
171
|
}
|
|
166
172
|
/**
|
|
167
|
-
* Every
|
|
173
|
+
* Every published version of one npm package, newest first, pre-releases
|
|
174
|
+
* included — what a version picker chooses from (the caller decides whether to
|
|
175
|
+
* show pre-releases). One metadata lookup, the same one the update check makes.
|
|
176
|
+
*/
|
|
177
|
+
export declare function listNpmVersions(name: string, options?: Pick<CheckExtensionUpdatesOptions, "fetch" | "signal">): Promise<string[]>;
|
|
178
|
+
/**
|
|
179
|
+
* Every pinned npm extension of the book against npm's newest version, in manifest
|
|
168
180
|
* order. Bundled, path and unpinned entries are not npm's to answer for and
|
|
169
181
|
* are skipped. One lookup per package, in parallel; a failed lookup throws
|
|
170
182
|
* with the package named.
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
TARGET_IDS,
|
|
8
8
|
scaffoldExtension,
|
|
9
9
|
scaffoldProject
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-4d4xegsw.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveGhostscript
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-6s4pkvbx.js";
|
|
14
14
|
import {
|
|
15
15
|
UsageError,
|
|
16
16
|
rejectExtraPositionals,
|
|
17
17
|
rejectUnknownFlags
|
|
18
|
-
} from "./cli-
|
|
19
|
-
import"./cli-
|
|
18
|
+
} from "./cli-cg03zvez.js";
|
|
19
|
+
import"./cli-wqy8hnnh.js";
|
|
20
20
|
import {
|
|
21
21
|
EXIT_CODES
|
|
22
22
|
} from "./cli-46ycxe6r.js";
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
executeValidation,
|
|
3
3
|
publishTargetFor,
|
|
4
4
|
reportMissingTools
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-4d4xegsw.js";
|
|
6
6
|
import {
|
|
7
7
|
log
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-6s4pkvbx.js";
|
|
9
9
|
import {
|
|
10
10
|
UsageError,
|
|
11
11
|
rejectExtraPositionals,
|
|
12
12
|
rejectUnknownFlags
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
13
|
+
} from "./cli-cg03zvez.js";
|
|
14
|
+
import"./cli-wqy8hnnh.js";
|
|
15
15
|
import {
|
|
16
16
|
EXIT_CODES
|
|
17
17
|
} from "./cli-46ycxe6r.js";
|
|
@@ -1027,12 +1027,16 @@
|
|
|
1027
1027
|
});
|
|
1028
1028
|
if (!silent) return api.notifyPageChange();
|
|
1029
1029
|
},
|
|
1030
|
-
setZoom: function (z, silent) {
|
|
1030
|
+
setZoom: function (z, silent, fit) {
|
|
1031
1031
|
preserveViewport(function () {
|
|
1032
1032
|
// Embedded previews have one zoom owner. Clear the standalone
|
|
1033
1033
|
// viewer's narrow-screen fit before applying the host scale.
|
|
1034
1034
|
document.body.style.removeProperty('--gutterpress-fit-zoom');
|
|
1035
1035
|
document.documentElement.style.setProperty('--gutterpress-zoom', z);
|
|
1036
|
+
// A host "fit to width" scale means nothing should scroll sideways.
|
|
1037
|
+
// Device-pixel rounding (fractional OS scaling) or art reaching past
|
|
1038
|
+
// the sheet can still overflow by a hair; clip it in fit mode only.
|
|
1039
|
+
document.documentElement.style.overflowX = fit ? 'hidden' : '';
|
|
1036
1040
|
});
|
|
1037
1041
|
if (!silent) api.notifyPageChange();
|
|
1038
1042
|
},
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
runBuild,
|
|
7
7
|
splitOutPath,
|
|
8
8
|
startPreviewServer
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-4d4xegsw.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-6s4pkvbx.js";
|
|
13
13
|
import {
|
|
14
14
|
UsageError,
|
|
15
15
|
parseFormat,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
rejectExtraPositionals,
|
|
18
18
|
rejectUnknownFlags,
|
|
19
19
|
resolvePort
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import"./cli-
|
|
20
|
+
} from "./cli-cg03zvez.js";
|
|
21
|
+
import"./cli-wqy8hnnh.js";
|
|
22
22
|
import {
|
|
23
23
|
BuildError
|
|
24
24
|
} from "./cli-46ycxe6r.js";
|
|
@@ -108,7 +108,8 @@
|
|
|
108
108
|
if (sourceBody.classList.contains('debug')) api.toggleDebugMode();
|
|
109
109
|
}
|
|
110
110
|
var zoom = source.documentElement.style.getPropertyValue('--gutterpress-zoom');
|
|
111
|
-
|
|
111
|
+
// Carry the fit flag too (setZoom's third argument clips sideways overflow).
|
|
112
|
+
if (api && zoom) api.setZoom(zoom, true, source.documentElement.style.overflowX === 'hidden');
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
function onReady(frame, callback, onTimeout, timeoutMs) {
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
publishProviderFor,
|
|
12
12
|
resolvePublishFormat,
|
|
13
13
|
runPublish
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-4d4xegsw.js";
|
|
15
15
|
import {
|
|
16
16
|
FileTokenStore,
|
|
17
17
|
log
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-6s4pkvbx.js";
|
|
19
19
|
import {
|
|
20
20
|
UsageError,
|
|
21
21
|
rejectExtraPositionals,
|
|
22
22
|
rejectUnknownFlags
|
|
23
|
-
} from "./cli-
|
|
24
|
-
import"./cli-
|
|
23
|
+
} from "./cli-cg03zvez.js";
|
|
24
|
+
import"./cli-wqy8hnnh.js";
|
|
25
25
|
import {
|
|
26
26
|
EXIT_CODES
|
|
27
27
|
} from "./cli-46ycxe6r.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAndReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-4d4xegsw.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-6s4pkvbx.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError,
|
|
9
9
|
rejectExtraPositionals,
|
|
10
10
|
rejectUnknownFlags
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-cg03zvez.js";
|
|
12
|
+
import"./cli-wqy8hnnh.js";
|
|
13
13
|
import {
|
|
14
14
|
EXIT_CODES
|
|
15
15
|
} from "./cli-46ycxe6r.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gutterpress",
|
|
3
|
-
"version": "0.11.16-alpha.
|
|
3
|
+
"version": "0.11.16-alpha.5",
|
|
4
4
|
"description": "Markdown-to-PDF converter for professional print layout using a native Chromium print engine and Ghostscript.",
|
|
5
5
|
"author": "itlackey",
|
|
6
6
|
"license": "MPL-2.0",
|