gutterpress 0.11.21 → 0.11.22-alpha.2
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/README.md +11 -0
- package/dist/api/index.d.ts +5 -1
- package/dist/api/index.js +68 -47
- package/dist/{build-0neyk5h6.js → build-84retk4k.js} +16 -10
- package/dist/{index-sth219v1.js → cli-2ppw6q9v.js} +26 -6
- package/dist/cli-3twpesca.js +103 -0
- package/dist/cli-5et23z83.js +2089 -0
- package/dist/{cli-j79451n6.js → cli-5qhjwne5.js} +5 -76
- package/dist/cli-80t93x2r.js +75 -0
- package/dist/{cli-j0drzb6f.js → cli-885pcze8.js} +885 -5481
- package/dist/{cli-b57adna7.js → cli-9pk65fqf.js} +9 -201
- package/dist/{cli-sqkccnm7.js → cli-d8xjns66.js} +1 -102
- package/dist/cli-h3phdstf.js +200 -0
- package/dist/{index-qf7y4d85.js → cli-habkc5ng.js} +12 -258
- package/dist/cli-hndkg7bn.js +196 -0
- package/dist/cli-pn3z0y9p.js +3073 -0
- package/dist/cli.js +15 -13
- package/dist/{doctor-fptq8tvn.js → doctor-fmzpg7ag.js} +7 -4
- package/dist/engine/shared/print-area.d.ts +77 -1
- package/dist/{engine-x07q927h.js → engine-5p8tn9b4.js} +4 -3
- package/dist/{engine-0b8bt05n.js → engine-9710cd7x.js} +3 -2
- package/dist/{ext-gp624t5c.js → ext-hsdnad5c.js} +21 -14
- package/dist/extension-restore-05pae3cp.js +16 -0
- package/dist/extension-restore-3r7phztr.js +20 -0
- package/dist/{gutterpress-viewer-w7njnkj7.js → gutterpress-viewer-w9jzx6sb.js} +56 -52
- package/dist/{index-t7r8g75c.js → index-2d8j0enc.js} +4 -2
- package/dist/{cli-sth219v1.js → index-2ppw6q9v.js} +26 -6
- package/dist/{index-mr7zs8mv.js → index-3wcr69ba.js} +5579 -10055
- package/dist/{cli-5qr3z0qa.js → index-93pqkvty.js} +63 -207
- package/dist/{index-mr72vt8n.js → index-apc8w9w8.js} +55 -267
- package/dist/index-ew7cyk7c.js +2208 -0
- package/dist/index-jsz0s3dy.js +213 -0
- package/dist/index-kx03e4m4.js +3244 -0
- package/dist/index-r7jcsk6h.js +200 -0
- package/dist/index.js +71 -50
- package/dist/lib/extension-manifest.d.ts +22 -1
- package/dist/lib/markdown/assemble.d.ts +3 -2
- package/dist/lib/markdown/plugins.d.ts +20 -0
- package/dist/lib/markdown/two-versions.d.ts +32 -0
- package/dist/lib/page-size.d.ts +3 -4
- package/dist/lib/pdf-inspect.d.ts +12 -0
- package/dist/lib/project-scaffold.d.ts +3 -3
- package/dist/lib/publish/plugin-provider.d.ts +16 -0
- package/dist/lib/publish/run-publish.d.ts +13 -5
- package/dist/lib/publish/types.d.ts +34 -2
- package/dist/lib/text-diff.d.ts +43 -0
- package/dist/lib/two-versions-markers.d.ts +26 -0
- package/dist/lib/version-changes.d.ts +87 -0
- package/dist/{manifest.schema-n292sb77.json → manifest.schema-nvawq0xv.json} +2 -2
- package/dist/{new-dre6aw05.js → new-fqtt022k.js} +23 -16
- package/dist/{pdf-inspect-zdmy7qca.js → pdf-inspect-wnw4za71.js} +1 -1
- package/dist/plugins-gfvsgnxb.js +24 -0
- package/dist/plugins-nfxr831f.js +26 -0
- package/dist/{preflight-1k1zkg1p.js → preflight-gr9mscjw.js} +18 -11
- package/dist/{preview-dtrksvxf.js → preview-52w9pdps.js} +19 -13
- package/dist/{publish-g1ytnrmr.js → publish-esmcyhpb.js} +40 -23
- package/dist/render.js +706 -0
- package/dist/schema/manifest.types.d.ts +8 -3
- package/dist/{source-provider-pzmz0br9.js → source-provider-2r74a7wp.js} +2 -1
- package/dist/{source-provider-qbthnmqw.js → source-provider-qbfknhyy.js} +2 -1
- package/dist/{validate-yrrq8639.js → validate-vt1d7h6k.js} +16 -10
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PublishProvider, PublishProviderInfo } from "./types.ts";
|
|
2
|
+
/** The book whose `extensions:` are searched — the pair runPublish takes. */
|
|
3
|
+
export interface PublishBook {
|
|
4
|
+
projectDir: string;
|
|
5
|
+
manifestPath?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Built-in providers, then the book's enabled publishing plugins. Reads
|
|
8
|
+
* package.json only; a book whose manifest can't be read lists the built-ins. */
|
|
9
|
+
export declare function listBookPublishProviders(book: PublishBook): Promise<PublishProviderInfo[]>;
|
|
10
|
+
/**
|
|
11
|
+
* The provider for `id`: a built-in (exactly as `publishProviderFor`), else
|
|
12
|
+
* one of the book's publishing plugins. An npm entry of that name is restored
|
|
13
|
+
* first, so a fresh clone can publish. Throws on an unknown id, naming every
|
|
14
|
+
* destination the book has.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolvePublishProvider(id: string, book: PublishBook): Promise<PublishProvider>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PreflightIssue, PublishArtifactFormat, PublishDeps, PublishOutcome, PublishProviderInfo, PublishRequest } from "./types.ts";
|
|
1
|
+
import type { PreflightIssue, PublishArtifactFormat, PublishDeps, PublishOutcome, PublishProvider, PublishProviderInfo, PublishRequest } from "./types.ts";
|
|
2
2
|
export interface RunPublishOptions {
|
|
3
3
|
projectDir: string;
|
|
4
4
|
providerId: string;
|
|
@@ -10,6 +10,12 @@ export interface RunPublishOptions {
|
|
|
10
10
|
artifactPath?: string;
|
|
11
11
|
/** Stop after preflight — report issues without contacting the platform. */
|
|
12
12
|
dryRun?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The provider, when the caller has already resolved it (the CLI does, to
|
|
15
|
+
* map a failed restore to its own exit code): no second lookup or restore.
|
|
16
|
+
* Default: {@link resolvePublishProvider}(`providerId`).
|
|
17
|
+
*/
|
|
18
|
+
provider?: PublishProvider;
|
|
13
19
|
}
|
|
14
20
|
export interface RunPublishResult {
|
|
15
21
|
ok: boolean;
|
|
@@ -33,11 +39,13 @@ export interface RunPublishResult {
|
|
|
33
39
|
* with a preflight error over one bad manifest field.
|
|
34
40
|
*/
|
|
35
41
|
export declare function resolvePublishFormat(info: PublishProviderInfo, providerConfig: Record<string, unknown>): PublishArtifactFormat;
|
|
42
|
+
type RequestOptions = Pick<RunPublishOptions, "projectDir" | "providerId" | "manifestPath" | "artifactPath">;
|
|
36
43
|
/**
|
|
37
|
-
* Resolve the {@link PublishRequest} for a provider from the
|
|
38
|
-
* manifest —
|
|
39
|
-
*
|
|
44
|
+
* Resolve the {@link PublishRequest} for a BUILT-IN provider from the
|
|
45
|
+
* project's manifest — for hosts that call individual provider methods
|
|
46
|
+
* (authenticate, listProducts, destinations) outside a full publish.
|
|
40
47
|
*/
|
|
41
|
-
export declare function resolvePublishRequest(options:
|
|
48
|
+
export declare function resolvePublishRequest(options: RequestOptions, deps: PublishDeps): Promise<PublishRequest>;
|
|
42
49
|
/** Preflight → authenticate → upload, with structured results throughout. */
|
|
43
50
|
export declare function runPublish(options: RunPublishOptions, deps: PublishDeps): Promise<RunPublishResult>;
|
|
51
|
+
export {};
|
|
@@ -39,13 +39,17 @@ export type PublishProviderId = "local" | "itch" | "drivethrurpg" | "kdp" | "azu
|
|
|
39
39
|
* - "api" — real programmatic upload (itch.io, Azure SWA, Shopify)
|
|
40
40
|
* - "guided" — no upload API exists; we validate + stage a package and open
|
|
41
41
|
* the platform's upload page with a checklist (DTRPG, KDP)
|
|
42
|
+
* - "plugin" — a publishing plugin (experimental, #381): the book's own
|
|
43
|
+
* extension runs the upload and handles its own sign-in
|
|
42
44
|
*/
|
|
43
|
-
export type PublishProviderKind = "api" | "guided";
|
|
45
|
+
export type PublishProviderKind = "api" | "guided" | "plugin";
|
|
44
46
|
/** Which build output the provider consumes. */
|
|
45
47
|
export type PublishArtifactFormat = "pdf" | "html";
|
|
46
48
|
/** Static, UI-facing description of a provider. */
|
|
47
49
|
export interface PublishProviderInfo {
|
|
48
|
-
|
|
50
|
+
/** A built-in {@link PublishProviderId}, or a publishing plugin's package
|
|
51
|
+
* name (experimental, #381). */
|
|
52
|
+
id: string;
|
|
49
53
|
/** Human name ("itch.io"). */
|
|
50
54
|
label: string;
|
|
51
55
|
kind: PublishProviderKind;
|
|
@@ -106,7 +110,35 @@ export interface PublishProviderInfo {
|
|
|
106
110
|
label: string;
|
|
107
111
|
canCreate: boolean;
|
|
108
112
|
};
|
|
113
|
+
/** A badge, not a kind: the provider may change or go away. Set on every
|
|
114
|
+
* publishing plugin today (#381). */
|
|
115
|
+
experimental?: true;
|
|
116
|
+
}
|
|
117
|
+
export interface PublishPluginContext {
|
|
118
|
+
project: {
|
|
119
|
+
dir: string;
|
|
120
|
+
title: string;
|
|
121
|
+
authors: string[];
|
|
122
|
+
};
|
|
123
|
+
/** The one build output validated for this run: a PDF file, or the
|
|
124
|
+
* website export directory. */
|
|
125
|
+
artifact: PublishArtifact;
|
|
126
|
+
/** The manifest's `publish.<package-name>` section, minus the two keys core
|
|
127
|
+
* reads from it: `format` (which build to publish) and `credential`. */
|
|
128
|
+
settings: Record<string, unknown>;
|
|
129
|
+
/** Progress line sink. Use this, never `console.log`: stdout carries
|
|
130
|
+
* `--json` output. */
|
|
131
|
+
log: (message: string) => void;
|
|
132
|
+
}
|
|
133
|
+
export interface PublishPluginResult {
|
|
134
|
+
/** Where the published work lives — kept only when it is an http(s) URL. */
|
|
135
|
+
url?: string;
|
|
136
|
+
/** One-line summary shown to the author. */
|
|
137
|
+
detail?: string;
|
|
109
138
|
}
|
|
139
|
+
/** `outputDir` is the folder holding `context.artifact.path`: the website
|
|
140
|
+
* export directory for html, the PDF's folder for pdf. */
|
|
141
|
+
export type PublishPluginFunction = (outputDir: string, context: PublishPluginContext) => Promise<PublishPluginResult | void>;
|
|
110
142
|
/** The project being published (resolved from the manifest by the orchestrator). */
|
|
111
143
|
export interface PublishProject {
|
|
112
144
|
projectDir: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* text-diff.ts — a small two-way sequence diff for the Versions view.
|
|
3
|
+
*
|
|
4
|
+
* Two readers: the what-changed hint on a version card ("3 paragraphs
|
|
5
|
+
* changed") and the side-by-side file compare (lines aligned, changed ones
|
|
6
|
+
* marked). Myers' O(ND) algorithm over any array, with a budget: when two
|
|
7
|
+
* texts have almost nothing in common the edit script is as long as both
|
|
8
|
+
* texts and the trace would grow with its square, so past the budget the
|
|
9
|
+
* result is "everything after the common ends changed" — honest for the
|
|
10
|
+
* hint, readable in the compare view, and bounded in memory. Pure, no I/O.
|
|
11
|
+
*/
|
|
12
|
+
export type DiffOp<T> = {
|
|
13
|
+
kind: "equal";
|
|
14
|
+
a: T;
|
|
15
|
+
b: T;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "delete";
|
|
18
|
+
a: T;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "insert";
|
|
21
|
+
b: T;
|
|
22
|
+
};
|
|
23
|
+
export declare function diffSequences<T>(a: readonly T[], b: readonly T[]): DiffOp<T>[];
|
|
24
|
+
/**
|
|
25
|
+
* How many items changed, counting an edited item once: each run of
|
|
26
|
+
* deletes and inserts counts as the larger of the two, so a reworded
|
|
27
|
+
* paragraph is "1 paragraph changed", not a removal plus an addition.
|
|
28
|
+
*/
|
|
29
|
+
export declare function countChanged<T>(ops: readonly DiffOp<T>[]): number;
|
|
30
|
+
/** One row of the side-by-side compare: a line on each side, or a gap. */
|
|
31
|
+
export interface CompareRow {
|
|
32
|
+
then: string | null;
|
|
33
|
+
now: string | null;
|
|
34
|
+
changed: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Lay a line diff out as two aligned columns: equal lines share a row;
|
|
38
|
+
* within a changed run the removed and added lines pair up in order and
|
|
39
|
+
* the longer side's extra lines face a gap.
|
|
40
|
+
*/
|
|
41
|
+
export declare function alignRows(ops: readonly DiffOp<string>[]): CompareRow[];
|
|
42
|
+
/** Split into lines for diffing; a CR before the break is not content. */
|
|
43
|
+
export declare function textLines(text: string): string[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exact lines a converge merge writes around a passage edited both here
|
|
3
|
+
* and online (`remote-auth/converge-merge.ts`):
|
|
4
|
+
*
|
|
5
|
+
* <<<<<<< your version
|
|
6
|
+
* …the passage as edited on this computer…
|
|
7
|
+
* =======
|
|
8
|
+
* …the passage as edited online…
|
|
9
|
+
* >>>>>>> online version
|
|
10
|
+
*
|
|
11
|
+
* Three consumers read them back and must agree byte for byte: the merge
|
|
12
|
+
* that writes them, the `source.sync.merge-markers` check that reports them,
|
|
13
|
+
* and the markdown rule that renders them as two labelled versions instead
|
|
14
|
+
* of a setext heading (`markdown/two-versions.ts`). This file imports
|
|
15
|
+
* nothing, so the node-free `/render` graph can depend on it too.
|
|
16
|
+
*
|
|
17
|
+
* (The desktop's editor panel keeps its own copy of the two sentinels — the
|
|
18
|
+
* renderer may not value-import the lib — pinned to the merge's real output
|
|
19
|
+
* by `packages/desktop/tests/editor/two-versions.test.ts`.)
|
|
20
|
+
*/
|
|
21
|
+
/** Marker labels — author language, never git jargon. */
|
|
22
|
+
export declare const YOUR_VERSION_LABEL = "your version";
|
|
23
|
+
export declare const ONLINE_VERSION_LABEL = "online version";
|
|
24
|
+
export declare const TWO_VERSIONS_OPEN = "<<<<<<< your version";
|
|
25
|
+
export declare const TWO_VERSIONS_SEPARATOR = "=======";
|
|
26
|
+
export declare const TWO_VERSIONS_CLOSE = ">>>>>>> online version";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type SnapshotEntry } from "./source-provider.ts";
|
|
2
|
+
import { defaultGitHttp } from "./remote-auth/git-http.ts";
|
|
3
|
+
import type { HostCredential, TokenStore } from "./remote-auth/token-store.ts";
|
|
4
|
+
import { type CompareRow } from "./text-diff.ts";
|
|
5
|
+
export type { CompareRow };
|
|
6
|
+
export interface VersionFileChange {
|
|
7
|
+
/** Repo-relative path, forward slashes. */
|
|
8
|
+
path: string;
|
|
9
|
+
kind: "added" | "removed" | "changed";
|
|
10
|
+
/** Plain size hint: "3 paragraphs changed", "1 rule changed", "replaced", "added", "removed". */
|
|
11
|
+
hint: string;
|
|
12
|
+
/** Both sides are text, so the compare view can show them. */
|
|
13
|
+
text: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface VersionChanges {
|
|
16
|
+
files: VersionFileChange[];
|
|
17
|
+
/** Changed files beyond the ones listed (the list is capped). */
|
|
18
|
+
more: number;
|
|
19
|
+
}
|
|
20
|
+
/** A history entry with what it changed and where it is kept. */
|
|
21
|
+
export interface VersionEntry extends SnapshotEntry {
|
|
22
|
+
changes: VersionFileChange[];
|
|
23
|
+
moreChanges: number;
|
|
24
|
+
/** True = online too; false = on this computer only; null = no online copy to compare with. */
|
|
25
|
+
backedUp: boolean | null;
|
|
26
|
+
}
|
|
27
|
+
/** How many changed files a version card lists before "and N more". */
|
|
28
|
+
export declare const VERSION_CHANGES_SHOWN = 8;
|
|
29
|
+
/** The size hint for a text file that changed between two versions. */
|
|
30
|
+
export declare function changeHint(filepath: string, before: string, after: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* The files `oid` changed against its first parent (every file, for a
|
|
33
|
+
* version with no parent), sorted by path and capped to
|
|
34
|
+
* {@link VERSION_CHANGES_SHOWN}.
|
|
35
|
+
*/
|
|
36
|
+
export declare function listVersionChanges(dir: string, oid: string, options?: {
|
|
37
|
+
cache?: object;
|
|
38
|
+
}): Promise<VersionChanges>;
|
|
39
|
+
/**
|
|
40
|
+
* A history page with each version's changes and whether it is backed up.
|
|
41
|
+
* Versions come newest-first, and everything older than the first backed-up
|
|
42
|
+
* one is backed up too, so the ancestry walk runs only over the versions
|
|
43
|
+
* that are on this computer only.
|
|
44
|
+
*/
|
|
45
|
+
export declare function describeVersions(projectDir: string, entries: SnapshotEntry[]): Promise<VersionEntry[]>;
|
|
46
|
+
/**
|
|
47
|
+
* The commits reachable from `fromOid` that `baseOid`'s history does not
|
|
48
|
+
* have, newest first, down to (not including) their merge base. None when
|
|
49
|
+
* the two share no history.
|
|
50
|
+
*/
|
|
51
|
+
export declare function commitsAhead(dir: string, fromOid: string, baseOid: string, cache?: object, limit?: number): Promise<SnapshotEntry[]>;
|
|
52
|
+
/**
|
|
53
|
+
* What is online that this computer has not got: fetch the book's branch
|
|
54
|
+
* (remote-tracking ref only — no merge, no checkout, safe on a dirty tree)
|
|
55
|
+
* and describe the commits above the merge base. Quiet on every failure,
|
|
56
|
+
* reporting why, like `checkRemoteUpdates`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function listOnlineVersions(options: {
|
|
59
|
+
projectDir: string;
|
|
60
|
+
credential?: HostCredential;
|
|
61
|
+
tokenStore?: TokenStore;
|
|
62
|
+
httpClient?: typeof defaultGitHttp;
|
|
63
|
+
}): Promise<{
|
|
64
|
+
entries: VersionEntry[];
|
|
65
|
+
reason?: "no-remote" | "auth" | "offline";
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* One file at version `id` beside the same file as it is on disk now, as
|
|
69
|
+
* aligned rows for the compare view. `binary` when either side is not text.
|
|
70
|
+
* A side that does not exist (the file was added since, or removed) is an
|
|
71
|
+
* empty column.
|
|
72
|
+
*/
|
|
73
|
+
export declare function compareVersionFile(projectDir: string, id: string, filepath: string): Promise<{
|
|
74
|
+
binary: true;
|
|
75
|
+
} | {
|
|
76
|
+
binary: false;
|
|
77
|
+
rows: CompareRow[];
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Write every file of version `id` under `destDir` (the whole repository
|
|
81
|
+
* tree, so a book inside a larger repository still finds its shared
|
|
82
|
+
* stylesheets) and return the folder the preview should render — the
|
|
83
|
+
* book's own subfolder of it.
|
|
84
|
+
*/
|
|
85
|
+
export declare function exportVersionTree(projectDir: string, id: string, destDir: string): Promise<{
|
|
86
|
+
inputDir: string;
|
|
87
|
+
}>;
|
|
@@ -234,13 +234,13 @@
|
|
|
234
234
|
},
|
|
235
235
|
"artSafe": {
|
|
236
236
|
"type": "number",
|
|
237
|
-
"description": "The ART rule, in points: how far inside the trim art that does not bleed (images, backgrounds, borders, rules) must stay on the top, bottom and OUTER edge; at the binding edge art uses `gutter`. For DriveThruRPG it is the \"non-bleeding art at least 0.25in from the outside edges (0.5in at the binding)\" rule. Art that runs out to the page's edge is a bleed and is not judged on that edge. The preview's overlay outlines it (dotted) and flags art outside it, and an image pinned to the top, bottom or outer edge (`.gp-pin`) sits on it unless it carries `.gp-flush`. Absent = the same as `safe`. Preset default: dtrpg 18 (0.25in); book and custom none.",
|
|
237
|
+
"description": "The ART rule, in points: how far inside the trim art that does not bleed (images, backgrounds, borders, rules) must stay on the top, bottom and OUTER edge; at the binding edge art uses `gutter`. For DriveThruRPG it is the \"non-bleeding art at least 0.25in from the outside edges (0.5in at the binding)\" rule. Art that runs out to the page's edge is a bleed and is not judged on that edge. The preview's overlay outlines it (dotted) and flags art outside it, the `pdf.print.safe-margins` check fails a PDF with an image closer (or one that stops in the bleed band), and an image pinned to the top, bottom or outer edge (`.gp-pin`) sits on it unless it carries `.gp-flush`. Absent = the same as `safe`. Preset default: dtrpg 18 (0.25in); book and custom none.",
|
|
238
238
|
"minimum": 0,
|
|
239
239
|
"examples": [18]
|
|
240
240
|
},
|
|
241
241
|
"gutter": {
|
|
242
242
|
"type": "number",
|
|
243
|
-
"description": "The binding allowance, in points: how far content stays from the spine, measured from the trim at the binding edge (the left edge of a right-hand page, the right edge of a left-hand one). It stands in for `safe` there, for text and for art alike: the preview's overlay draws and judges that edge against it, the `pdf.print.safe-margins` check fails text closer to the spine than it, and an image pinned to the binding edge (`.gp-pin`) sits on it. The other edges keep `safe` and `artSafe`. Use it when your book keeps its text further from the spine than the printer's minimum: the Field Guide keeps 0.75in (54) where DriveThruRPG asks for 0.5in. Absent = the same as `safe`.
|
|
243
|
+
"description": "The binding allowance, in points: how far content stays from the spine, measured from the trim at the binding edge (the left edge of a right-hand page, the right edge of a left-hand one). It stands in for `safe` there, for text and for art alike: the preview's overlay draws and judges that edge against it, the `pdf.print.safe-margins` check fails text or an image closer to the spine than it, and an image pinned to the binding edge (`.gp-pin`) sits on it. The other edges keep `safe` and `artSafe`. Use it when your book keeps its text further from the spine than the printer's minimum: the Field Guide keeps 0.75in (54) where DriveThruRPG asks for 0.5in. Absent = the same as `safe`. Preset default: dtrpg 36 (0.5in, DriveThruRPG's rule for text and non-bleeding art at the binding — the same as its `safe`, declared so a book inherits it visibly); book and custom none.",
|
|
244
244
|
"minimum": 0,
|
|
245
245
|
"examples": [54]
|
|
246
246
|
}
|
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BUILT_IN_TEMPLATE_IDS,
|
|
3
3
|
EXTENSION_KINDS,
|
|
4
|
-
PRESETS,
|
|
5
|
-
PRESET_IDS,
|
|
6
|
-
TARGETS,
|
|
7
|
-
TARGET_IDS,
|
|
8
4
|
scaffoldExtension,
|
|
9
5
|
scaffoldProject
|
|
10
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-885pcze8.js";
|
|
11
7
|
import {
|
|
12
8
|
resolveGhostscript
|
|
13
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-5qhjwne5.js";
|
|
10
|
+
import"./cli-ht1bcqdd.js";
|
|
11
|
+
import"./cli-9pk65fqf.js";
|
|
12
|
+
import"./cli-2ppw6q9v.js";
|
|
13
|
+
import"./cli-eyyggect.js";
|
|
14
|
+
import {
|
|
15
|
+
isToolAvailable
|
|
16
|
+
} from "./cli-asap4t1z.js";
|
|
17
|
+
import"./cli-habkc5ng.js";
|
|
18
|
+
import"./cli-v5mp7a6q.js";
|
|
19
|
+
import {
|
|
20
|
+
PRESETS,
|
|
21
|
+
PRESET_IDS,
|
|
22
|
+
TARGETS,
|
|
23
|
+
TARGET_IDS
|
|
24
|
+
} from "./cli-5et23z83.js";
|
|
25
|
+
import"./cli-pn3z0y9p.js";
|
|
26
|
+
import"./cli-80t93x2r.js";
|
|
14
27
|
import {
|
|
15
28
|
UsageError,
|
|
16
29
|
rejectExtraPositionals,
|
|
17
30
|
rejectUnknownFlags
|
|
18
|
-
} from "./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
31
|
+
} from "./cli-d8xjns66.js";
|
|
32
|
+
import"./cli-3twpesca.js";
|
|
33
|
+
import"./cli-hndkg7bn.js";
|
|
21
34
|
import {
|
|
22
35
|
EXIT_CODES
|
|
23
36
|
} from "./cli-46ycxe6r.js";
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-eyyggect.js";
|
|
26
|
-
import {
|
|
27
|
-
isToolAvailable
|
|
28
|
-
} from "./cli-asap4t1z.js";
|
|
29
|
-
import"./cli-5qr3z0qa.js";
|
|
30
|
-
import"./cli-v5mp7a6q.js";
|
|
37
|
+
import"./cli-h3phdstf.js";
|
|
31
38
|
import"./cli-37x76zdn.js";
|
|
32
39
|
|
|
33
40
|
// src/commands/new.ts
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__resetPathPluginCacheForTests,
|
|
3
|
+
applyPlugins,
|
|
4
|
+
collectPluginCss,
|
|
5
|
+
collectPluginStyleGroups,
|
|
6
|
+
collectPluginStylePaths,
|
|
7
|
+
loadPlugin,
|
|
8
|
+
loadPlugins,
|
|
9
|
+
loadPluginsWithCss,
|
|
10
|
+
loadPublishFunction
|
|
11
|
+
} from "./index-kx03e4m4.js";
|
|
12
|
+
import"./index-r7jcsk6h.js";
|
|
13
|
+
import"./index-37x76zdn.js";
|
|
14
|
+
export {
|
|
15
|
+
loadPublishFunction,
|
|
16
|
+
loadPluginsWithCss,
|
|
17
|
+
loadPlugins,
|
|
18
|
+
loadPlugin,
|
|
19
|
+
collectPluginStylePaths,
|
|
20
|
+
collectPluginStyleGroups,
|
|
21
|
+
collectPluginCss,
|
|
22
|
+
applyPlugins,
|
|
23
|
+
__resetPathPluginCacheForTests
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__resetPathPluginCacheForTests,
|
|
3
|
+
applyPlugins,
|
|
4
|
+
collectPluginCss,
|
|
5
|
+
collectPluginStyleGroups,
|
|
6
|
+
collectPluginStylePaths,
|
|
7
|
+
loadPlugin,
|
|
8
|
+
loadPlugins,
|
|
9
|
+
loadPluginsWithCss,
|
|
10
|
+
loadPublishFunction
|
|
11
|
+
} from "./cli-pn3z0y9p.js";
|
|
12
|
+
import"./cli-80t93x2r.js";
|
|
13
|
+
import"./cli-3twpesca.js";
|
|
14
|
+
import"./cli-h3phdstf.js";
|
|
15
|
+
import"./cli-37x76zdn.js";
|
|
16
|
+
export {
|
|
17
|
+
loadPublishFunction,
|
|
18
|
+
loadPluginsWithCss,
|
|
19
|
+
loadPlugins,
|
|
20
|
+
loadPlugin,
|
|
21
|
+
collectPluginStylePaths,
|
|
22
|
+
collectPluginStyleGroups,
|
|
23
|
+
collectPluginCss,
|
|
24
|
+
applyPlugins,
|
|
25
|
+
__resetPathPluginCacheForTests
|
|
26
|
+
};
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeValidation,
|
|
3
|
-
publishTargetFor,
|
|
4
3
|
reportMissingTools
|
|
5
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-885pcze8.js";
|
|
5
|
+
import"./cli-5qhjwne5.js";
|
|
6
|
+
import"./cli-ht1bcqdd.js";
|
|
7
|
+
import"./cli-9pk65fqf.js";
|
|
8
|
+
import"./cli-2ppw6q9v.js";
|
|
9
|
+
import"./cli-eyyggect.js";
|
|
10
|
+
import"./cli-asap4t1z.js";
|
|
11
|
+
import"./cli-habkc5ng.js";
|
|
12
|
+
import"./cli-v5mp7a6q.js";
|
|
13
|
+
import {
|
|
14
|
+
publishTargetFor
|
|
15
|
+
} from "./cli-5et23z83.js";
|
|
16
|
+
import"./cli-pn3z0y9p.js";
|
|
6
17
|
import {
|
|
7
18
|
log
|
|
8
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-80t93x2r.js";
|
|
9
20
|
import {
|
|
10
21
|
UsageError,
|
|
11
22
|
rejectExtraPositionals,
|
|
12
23
|
rejectUnknownFlags
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
24
|
+
} from "./cli-d8xjns66.js";
|
|
25
|
+
import"./cli-3twpesca.js";
|
|
26
|
+
import"./cli-hndkg7bn.js";
|
|
16
27
|
import {
|
|
17
28
|
BuildError,
|
|
18
29
|
EXIT_CODES
|
|
19
30
|
} from "./cli-46ycxe6r.js";
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-eyyggect.js";
|
|
22
|
-
import"./cli-asap4t1z.js";
|
|
23
|
-
import"./cli-5qr3z0qa.js";
|
|
24
|
-
import"./cli-v5mp7a6q.js";
|
|
31
|
+
import"./cli-h3phdstf.js";
|
|
25
32
|
import"./cli-37x76zdn.js";
|
|
26
33
|
|
|
27
34
|
// src/commands/preflight.ts
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
previewArgs
|
|
3
|
-
} from "./cli-75qkn0k5.js";
|
|
4
1
|
import {
|
|
5
2
|
openPath,
|
|
6
3
|
runBuild,
|
|
7
4
|
splitOutPath,
|
|
8
5
|
startPreviewServer
|
|
9
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-885pcze8.js";
|
|
7
|
+
import"./cli-5qhjwne5.js";
|
|
8
|
+
import {
|
|
9
|
+
previewArgs
|
|
10
|
+
} from "./cli-75qkn0k5.js";
|
|
11
|
+
import"./cli-ht1bcqdd.js";
|
|
12
|
+
import"./cli-9pk65fqf.js";
|
|
13
|
+
import"./cli-2ppw6q9v.js";
|
|
14
|
+
import"./cli-eyyggect.js";
|
|
15
|
+
import"./cli-asap4t1z.js";
|
|
16
|
+
import"./cli-habkc5ng.js";
|
|
17
|
+
import"./cli-v5mp7a6q.js";
|
|
18
|
+
import"./cli-5et23z83.js";
|
|
19
|
+
import"./cli-pn3z0y9p.js";
|
|
10
20
|
import {
|
|
11
21
|
log
|
|
12
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-80t93x2r.js";
|
|
13
23
|
import {
|
|
14
24
|
UsageError,
|
|
15
25
|
parseFormat,
|
|
@@ -17,17 +27,13 @@ import {
|
|
|
17
27
|
rejectExtraPositionals,
|
|
18
28
|
rejectUnknownFlags,
|
|
19
29
|
resolvePort
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
30
|
+
} from "./cli-d8xjns66.js";
|
|
31
|
+
import"./cli-3twpesca.js";
|
|
32
|
+
import"./cli-hndkg7bn.js";
|
|
23
33
|
import {
|
|
24
34
|
BuildError
|
|
25
35
|
} from "./cli-46ycxe6r.js";
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-eyyggect.js";
|
|
28
|
-
import"./cli-asap4t1z.js";
|
|
29
|
-
import"./cli-5qr3z0qa.js";
|
|
30
|
-
import"./cli-v5mp7a6q.js";
|
|
36
|
+
import"./cli-h3phdstf.js";
|
|
31
37
|
import"./cli-37x76zdn.js";
|
|
32
38
|
|
|
33
39
|
// src/commands/preview.ts
|
|
@@ -2,35 +2,44 @@ import {
|
|
|
2
2
|
connectGoogleDrive,
|
|
3
3
|
connectPublishProvider,
|
|
4
4
|
disconnectPublishCredential,
|
|
5
|
+
listBookPublishProviders,
|
|
5
6
|
listPublishAccounts,
|
|
6
|
-
listPublishProviders,
|
|
7
|
-
loadManifestWithPath,
|
|
8
7
|
openPath,
|
|
9
8
|
publishConnectionStatus,
|
|
10
9
|
publishCredentialKey,
|
|
11
|
-
publishProviderFor,
|
|
12
10
|
resolvePublishFormat,
|
|
11
|
+
resolvePublishProvider,
|
|
13
12
|
runPublish
|
|
14
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-885pcze8.js";
|
|
14
|
+
import {
|
|
15
|
+
FileTokenStore
|
|
16
|
+
} from "./cli-5qhjwne5.js";
|
|
17
|
+
import"./cli-ht1bcqdd.js";
|
|
18
|
+
import"./cli-9pk65fqf.js";
|
|
19
|
+
import"./cli-2ppw6q9v.js";
|
|
20
|
+
import"./cli-eyyggect.js";
|
|
21
|
+
import"./cli-asap4t1z.js";
|
|
22
|
+
import"./cli-habkc5ng.js";
|
|
23
|
+
import"./cli-v5mp7a6q.js";
|
|
24
|
+
import {
|
|
25
|
+
loadManifestWithPath
|
|
26
|
+
} from "./cli-5et23z83.js";
|
|
27
|
+
import"./cli-pn3z0y9p.js";
|
|
15
28
|
import {
|
|
16
|
-
FileTokenStore,
|
|
17
29
|
log
|
|
18
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-80t93x2r.js";
|
|
19
31
|
import {
|
|
20
32
|
UsageError,
|
|
21
33
|
rejectExtraPositionals,
|
|
22
34
|
rejectUnknownFlags
|
|
23
|
-
} from "./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
35
|
+
} from "./cli-d8xjns66.js";
|
|
36
|
+
import"./cli-3twpesca.js";
|
|
37
|
+
import"./cli-hndkg7bn.js";
|
|
26
38
|
import {
|
|
39
|
+
BuildError,
|
|
27
40
|
EXIT_CODES
|
|
28
41
|
} from "./cli-46ycxe6r.js";
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-eyyggect.js";
|
|
31
|
-
import"./cli-asap4t1z.js";
|
|
32
|
-
import"./cli-5qr3z0qa.js";
|
|
33
|
-
import"./cli-v5mp7a6q.js";
|
|
42
|
+
import"./cli-h3phdstf.js";
|
|
34
43
|
import"./cli-37x76zdn.js";
|
|
35
44
|
|
|
36
45
|
// src/commands/publish.ts
|
|
@@ -100,7 +109,7 @@ var commandArgs = {
|
|
|
100
109
|
},
|
|
101
110
|
provider: {
|
|
102
111
|
type: "string",
|
|
103
|
-
description: "Provider id: itch | drivethrurpg | kdp | azure-swa | shopify | gdrive"
|
|
112
|
+
description: "Provider id: itch | drivethrurpg | kdp | azure-swa | shopify | gdrive, or a publishing plugin's package name (experimental)"
|
|
104
113
|
},
|
|
105
114
|
list: { type: "boolean", description: "List providers and connection status" },
|
|
106
115
|
connect: {
|
|
@@ -161,7 +170,10 @@ var publish_default = defineCommand({
|
|
|
161
170
|
});
|
|
162
171
|
publishSettings = manifest.publish ?? {};
|
|
163
172
|
} catch {}
|
|
164
|
-
const providers =
|
|
173
|
+
const providers = await listBookPublishProviders({
|
|
174
|
+
projectDir: projectDir2,
|
|
175
|
+
...manifestArg !== undefined ? { manifestPath: manifestArg } : {}
|
|
176
|
+
});
|
|
165
177
|
const rows = await Promise.all(providers.map(async (p) => {
|
|
166
178
|
const status = await publishConnectionStatus(p, deps);
|
|
167
179
|
const accounts = p.credential.required ? await listPublishAccounts(p, deps) : [];
|
|
@@ -172,7 +184,8 @@ var publish_default = defineCommand({
|
|
|
172
184
|
kind: p.kind,
|
|
173
185
|
format: resolvePublishFormat(p, providerConfig),
|
|
174
186
|
connected: status.connected,
|
|
175
|
-
accounts
|
|
187
|
+
accounts,
|
|
188
|
+
...p.experimental ? { experimental: true } : {}
|
|
176
189
|
};
|
|
177
190
|
}));
|
|
178
191
|
if (json) {
|
|
@@ -180,7 +193,7 @@ var publish_default = defineCommand({
|
|
|
180
193
|
`);
|
|
181
194
|
} else {
|
|
182
195
|
for (const r of rows) {
|
|
183
|
-
const status = r.kind === "guided" ? "no key needed" : r.connected ? "connected" : "not connected";
|
|
196
|
+
const status = r.experimental ? "experimental" : r.kind === "guided" ? "no key needed" : r.connected ? "connected" : "not connected";
|
|
184
197
|
log.info(`${r.id.padEnd(13)} ${r.label.padEnd(22)} ${r.kind.padEnd(6)} ${r.format.padEnd(4)} ${status}`);
|
|
185
198
|
for (const acc of r.accounts) {
|
|
186
199
|
log.info(` • ${acc.account ? acc.account : "(default)"}`);
|
|
@@ -191,17 +204,20 @@ var publish_default = defineCommand({
|
|
|
191
204
|
}
|
|
192
205
|
const providerId = typeof args.provider === "string" ? args.provider : "";
|
|
193
206
|
if (!providerId) {
|
|
194
|
-
log.error("Specify a provider: gutterpress publish --provider <itch|drivethrurpg|kdp|azure-swa|shopify|gdrive> (or --list).");
|
|
207
|
+
log.error("Specify a provider: gutterpress publish --provider <itch|drivethrurpg|kdp|azure-swa|shopify|gdrive> " + "or a publishing plugin's package name (or --list).");
|
|
195
208
|
process.exit(EXIT_CODES.USAGE);
|
|
196
209
|
}
|
|
210
|
+
const projectDir = path.resolve(args.project ?? ".");
|
|
197
211
|
let provider;
|
|
198
212
|
try {
|
|
199
|
-
provider =
|
|
213
|
+
provider = await resolvePublishProvider(providerId, {
|
|
214
|
+
projectDir,
|
|
215
|
+
...typeof args.manifest === "string" ? { manifestPath: args.manifest } : {}
|
|
216
|
+
});
|
|
200
217
|
} catch (e) {
|
|
201
218
|
log.error(e instanceof Error ? e.message : String(e));
|
|
202
|
-
process.exit(EXIT_CODES.USAGE);
|
|
219
|
+
process.exit(e instanceof BuildError ? e.exitCode : EXIT_CODES.USAGE);
|
|
203
220
|
}
|
|
204
|
-
const projectDir = path.resolve(args.project ?? ".");
|
|
205
221
|
const account = typeof args.account === "string" ? args.account.trim() : "";
|
|
206
222
|
if (args.disconnect) {
|
|
207
223
|
const key = publishCredentialKey(provider.info.credential.host, account);
|
|
@@ -211,7 +227,7 @@ var publish_default = defineCommand({
|
|
|
211
227
|
}
|
|
212
228
|
if (args.connect) {
|
|
213
229
|
if (!provider.info.credential.required) {
|
|
214
|
-
log.info(`${provider.info.label} is a guided provider — no API key needed. Just run: gutterpress publish --provider ${provider.info.id}`);
|
|
230
|
+
log.info(provider.info.experimental ? `${provider.info.label} is a publishing plugin — it manages its own credentials (see its documentation). Just run: gutterpress publish --provider ${provider.info.id}` : `${provider.info.label} is a guided provider — no API key needed. Just run: gutterpress publish --provider ${provider.info.id}`);
|
|
215
231
|
return;
|
|
216
232
|
}
|
|
217
233
|
if (provider.info.credential.connect === "oauth") {
|
|
@@ -264,6 +280,7 @@ Create one at: ${provider.info.credential.tokenUrl}` : ""));
|
|
|
264
280
|
result = await runPublish({
|
|
265
281
|
projectDir,
|
|
266
282
|
providerId: provider.info.id,
|
|
283
|
+
provider,
|
|
267
284
|
manifestPath: typeof args.manifest === "string" ? args.manifest : undefined,
|
|
268
285
|
artifactPath: typeof args.file === "string" ? args.file : undefined,
|
|
269
286
|
dryRun: !!args["dry-run"]
|