gutterpress 0.0.0 → 0.9.0-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.
Files changed (82) hide show
  1. package/README.md +21 -16
  2. package/dist/api/index.d.ts +6 -2
  3. package/dist/api/index.js +15 -3
  4. package/dist/{audit-1jrwwacz.js → audit-nhn2pjz3.js} +5 -5
  5. package/dist/{build-5s92kgpc.js → build-san7fv2z.js} +5 -5
  6. package/dist/checks/types.d.ts +6 -0
  7. package/dist/{cli-hvqjs342.js → cli-e5zhb0xs.js} +2 -2
  8. package/dist/{cli-7ykx7pp0.js → cli-k4bd06sd.js} +982 -331
  9. package/dist/{cli-h7phg3ka.js → cli-najycadg.js} +258 -258
  10. package/dist/{index-1tyj4bk3.js → cli-wchtvxvw.js} +4 -1
  11. package/dist/{cli-5bxx0c4y.js → cli-yzrh708h.js} +2 -2
  12. package/dist/cli.js +15 -15
  13. package/dist/{doctor-25zjt8dz.js → doctor-hrk0kxxz.js} +2 -2
  14. package/dist/{index-3h3fef7r.js → index-bynn850m.js} +1200 -410
  15. package/dist/{cli-1tyj4bk3.js → index-wchtvxvw.js} +4 -1
  16. package/dist/{index-5bxx0c4y.js → index-yzrh708h.js} +2 -2
  17. package/dist/index.js +15 -3
  18. package/dist/lib/asset-inline.d.ts +19 -0
  19. package/dist/lib/build-error.d.ts +0 -1
  20. package/dist/lib/build-fingerprint.d.ts +14 -0
  21. package/dist/lib/build-runner.d.ts +21 -1
  22. package/dist/lib/ghostscript.d.ts +0 -9
  23. package/dist/lib/manifest-config.d.ts +7 -0
  24. package/dist/lib/manifest.d.ts +8 -0
  25. package/dist/lib/markdown/assemble.d.ts +4 -6
  26. package/dist/lib/markdown/chapter-id.d.ts +1 -1
  27. package/dist/lib/markdown/index.d.ts +1 -2
  28. package/dist/lib/npm-plugin-installer.d.ts +1 -1
  29. package/dist/lib/output-paths.d.ts +0 -1
  30. package/dist/lib/pagination.d.ts +0 -20
  31. package/dist/lib/pdf-inspect.d.ts +2 -2
  32. package/dist/lib/pdf-parse.d.ts +2 -1
  33. package/dist/lib/plugin-manager.d.ts +0 -2
  34. package/dist/lib/presets.d.ts +36 -7
  35. package/dist/lib/project-scaffold.d.ts +39 -2
  36. package/dist/lib/project-source.d.ts +11 -9
  37. package/dist/lib/project-templates.d.ts +45 -7
  38. package/dist/lib/publish/providers/azure-swa.d.ts +0 -1
  39. package/dist/lib/publish/providers/itch.d.ts +0 -1
  40. package/dist/lib/publish/providers/shopify.d.ts +0 -1
  41. package/dist/lib/remote-auth/github-repos.d.ts +0 -2
  42. package/dist/lib/remote-auth/recovery/dispatch.d.ts +0 -5
  43. package/dist/lib/remote-auth/recovery/outcome-mapping.d.ts +3 -2
  44. package/dist/lib/remote-auth/recovery/recover-stale-lock.d.ts +0 -8
  45. package/dist/lib/remote-auth/sync.d.ts +2 -10
  46. package/dist/lib/remote-auth/test-access.d.ts +0 -2
  47. package/dist/lib/remote-auth/test-support/git-http-server.d.ts +0 -37
  48. package/dist/lib/source-provider.d.ts +0 -14
  49. package/dist/lib/static-serve.d.ts +39 -0
  50. package/dist/lib/style-resolver.d.ts +10 -1
  51. package/dist/lib/targets.d.ts +84 -0
  52. package/dist/lib/theme-import.d.ts +0 -2
  53. package/dist/lib/theme-manager.d.ts +1 -1
  54. package/dist/lib/validation-exec.d.ts +4 -3
  55. package/dist/{lint-f63nxjfj.js → lint-96j9hrj4.js} +5 -5
  56. package/dist/{manifest.schema-rn1dpdpn.json → manifest.schema-z61rzw44.json} +12 -6
  57. package/dist/new-8p38wavc.js +185 -0
  58. package/dist/{pagedjs-interface-80g3xa8p.js → pagedjs-interface-qxvzgwd7.js} +92 -33
  59. package/dist/{plugin-wf2cbmwc.js → plugin-ees6nhkc.js} +5 -5
  60. package/dist/{preflight-tg4mpz1h.js → preflight-1q6c2edh.js} +24 -29
  61. package/dist/preview/file-watcher.d.ts +48 -39
  62. package/dist/preview/http-server.d.ts +5 -2
  63. package/dist/preview/server-context.d.ts +24 -0
  64. package/dist/preview-shell-6dqexx1m.js +581 -0
  65. package/dist/{preview-h2bwbb2x.js → preview-y5a2zen1.js} +5 -5
  66. package/dist/{project-source-0tg0r6vm.js → project-source-p0gn1wd5.js} +3 -3
  67. package/dist/{publish-ztaet53r.js → publish-rm9yb3wh.js} +5 -5
  68. package/dist/render.js +10 -19
  69. package/dist/{repair-jkp4n3j8.js → repair-zgq7q2g6.js} +5 -5
  70. package/dist/schema/manifest.types.d.ts +14 -3
  71. package/dist/server.d.ts +2 -0
  72. package/dist/{source-provider-hp96b5jf.js → source-provider-c1rjm2c0.js} +2 -8
  73. package/dist/types.d.ts +0 -1
  74. package/dist/{validate-k2drs19j.js → validate-nr0xa6sa.js} +8 -8
  75. package/package.json +2 -2
  76. package/dist/chapter-01-jj8ftn4c.md +0 -29
  77. package/dist/lib/validation-profile.d.ts +0 -18
  78. package/dist/manifest-ryyg71nf.yaml +0 -9
  79. package/dist/new-7b08a42h.js +0 -105
  80. package/dist/preview-shell-rghtfmc8.js +0 -155
  81. package/dist/theme-0yzvthe8.css +0 -65
  82. package/dist/theme-6a2fngc8.json +0 -6
package/README.md CHANGED
@@ -54,7 +54,7 @@ the repository and run `bun install` when contributing to Gutterpress itself.
54
54
 
55
55
  ## System requirements
56
56
 
57
- The CLI needs a Chromium-based browser for PDF generation, and a few external tools for PDF post-processing and validation depending on which features you use. See [User Guide: Chapter 8 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/08-system-setup.md) for the full per-feature requirements matrix.
57
+ The CLI needs a Chromium-based browser for PDF generation, and a few external tools for PDF post-processing and validation depending on which features you use. See [User Guide: Chapter 7 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/07-system-setup.md) for the full per-feature requirements matrix.
58
58
 
59
59
  The short version: CLI PDF rendering needs a Chromium-based browser. Optional
60
60
  PDF/X output additionally needs **Ghostscript** and **qpdf**; the desktop app
@@ -64,7 +64,7 @@ uses its bundled browser for standard PDF export.
64
64
 
65
65
  ```sh
66
66
  # Scaffold a new project (manifest + starter chapter + stylesheet)
67
- gutterpress new "My First Book"
67
+ gutterpress new "My First Book" --preset dtrpg
68
68
 
69
69
  # Build a PDF from a project directory
70
70
  gutterpress build ./my-book
@@ -143,16 +143,21 @@ source.
143
143
 
144
144
  ### `gutterpress new`
145
145
 
146
- Scaffold a new project from an embedded starter template — the fastest way to start writing (see [Quick start](#quick-start)).
146
+ Scaffold a new project from an embedded starter template — the fastest way to start writing (see [Quick start](#quick-start)). Every new book picks the vendor preset it's designed for: `dtrpg` (DriveThruRPG print-on-demand), `book` (neutral 6x9in trade book), or `custom` (you supply the trim size in points).
147
147
 
148
148
  ```sh
149
- gutterpress new <name> [options]
150
-
151
- --author <name> Author name to record in the project
152
- --dir <path> Parent directory to create the project in (default: current directory)
153
- --folder <name> Folder name to create (default: a slug of the project name)
154
- --template <id> Starter template: book, ttrpg, zine, technical (default: book)
155
- --git Initialise local version history (default: true; use --no-git to skip)
149
+ gutterpress new <name> --preset <id> [options]
150
+
151
+ --preset <id> Vendor preset the book is designed for: dtrpg, book, custom (required)
152
+ --author <name> Author name to record in the project
153
+ --dir <path> Parent directory to create the project in (default: current directory)
154
+ --folder <name> Folder name to create (default: a slug of the project name)
155
+ --template <id> Starter template: book, zine, technical (default: book)
156
+ --targets <ids> Publish targets recorded in the manifest (comma-separated: dtrpg, itch; or "none") — default: the preset's
157
+ --page-width <pt> Trim width in points, 72pt = 1in (required with --preset custom; optional override otherwise)
158
+ --page-height <pt> Trim height in points, 72pt = 1in (required with --preset custom; optional override otherwise)
159
+ --page-tolerance <pt> Allowed trim deviation when validating a built PDF (default: 0.5)
160
+ --git Initialise local version history (default: true; use --no-git to skip)
156
161
  --no-git
157
162
  ```
158
163
 
@@ -245,7 +250,7 @@ Common print-unsafe patterns the plugin flags: remote `url(...)` references in C
245
250
 
246
251
  ### `gutterpress validate`
247
252
 
248
- Run the validation pipeline (pre-build source checks and/or post-build PDF checks). Tools that aren't installed are skipped with a warning — they don't fail the run. See [User Guide: Chapter 7 — Validation](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/07-validation.md) for the full check list and [User Guide: Chapter 8 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/08-system-setup.md) for which external tools each check needs.
253
+ Run the validation pipeline (pre-build source checks and/or post-build PDF checks). Tools that aren't installed are skipped with a warning — they don't fail the run. See [User Guide: Chapter 6 — Validation](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/06-validation.md) for the full check list and [User Guide: Chapter 7 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/07-system-setup.md) for which external tools each check needs.
249
254
 
250
255
  The positional directory and `--pdf`/`--input` are independent: the positional (or `--input`) sets the pre-build source directory, `--pdf` separately points at a built PDF for post-build checks. `--input` overrides the positional if both are given.
251
256
 
@@ -260,7 +265,7 @@ gutterpress validate [dir] [options]
260
265
  --skip <ids> Skip these check IDs/selectors (comma-separated)
261
266
  --format <fmt> text (default) | json
262
267
  --phase <p> pre | post | all | pre-build | post-build (default: all)
263
- --profile <p> Validation profile lock (currently: dtrpg)
268
+ --target <t> Publish targets to validate against (comma-separated, e.g. dtrpg,itch), overriding the manifest's `targets:`
264
269
  ```
265
270
 
266
271
  ### `gutterpress audit`
@@ -287,7 +292,7 @@ gutterpress preflight [dir] --pdf <path> [options]
287
292
  --pdf <path> Path to the PDF file to preflight (required)
288
293
  --input <dir> Optional source directory for pre-build checks (overrides the positional directory)
289
294
  --manifest <path> Path to manifest.yaml
290
- --profile <p> Validation profile lock (currently: dtrpg)
295
+ --target <t> Publish targets to preflight against (comma-separated, e.g. dtrpg,itch), overriding the manifest's `targets:`
291
296
  --report-dir <dir> Output directory for preflight reports (default: alongside the PDF)
292
297
  --name <name> Base filename for report outputs
293
298
  ```
@@ -385,7 +390,7 @@ privileges.
385
390
  Use the manifest `export` field, or `plugin add --export <name>`, for packages
386
391
  that expose a named plugin function instead of a default export.
387
392
 
388
- See [User Guide: Chapter 6 — Plugins](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/06-plugins.md) for authoring custom plugins.
393
+ See [User Guide: Chapter 5 — Plugins](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/05-plugins.md) for authoring custom plugins.
389
394
 
390
395
  ## CI / scripting
391
396
 
@@ -401,11 +406,11 @@ The standalone binary is the easiest way — drop it in a GitHub Actions step an
401
406
  ./gutterpress build ./my-book --out dist/my-book.pdf
402
407
  ```
403
408
 
404
- The binary is self-contained except for the system tools described in [User Guide: Chapter 8 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/08-system-setup.md). On a runner with Chrome and Ghostscript present, you don't need a separate Node or Bun install.
409
+ The binary is self-contained except for the system tools described in [User Guide: Chapter 7 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/07-system-setup.md). On a runner with Chrome and Ghostscript present, you don't need a separate Node or Bun install.
405
410
 
406
411
  ## Troubleshooting
407
412
 
408
- - **`Ghostscript executable not found`** — Ghostscript is required only for PDF/X and ink-coverage checks. Standard Windows installs are auto-detected; for a non-standard install, set `GHOSTSCRIPT_PATH` to the full path of `gs`, `gswin64c.exe`, or `gswin32c.exe`. See [User Guide: Chapter 8 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/08-system-setup.md).
413
+ - **`Ghostscript executable not found`** — Ghostscript is required only for PDF/X and ink-coverage checks. Standard Windows installs are auto-detected; for a non-standard install, set `GHOSTSCRIPT_PATH` to the full path of `gs`, `gswin64c.exe`, or `gswin32c.exe`. See [User Guide: Chapter 7 — System Setup](https://github.com/dimm-city/gutterpress/blob/main/examples/gutterpress-user-guide/07-system-setup.md).
409
414
  - **`No Chrome or Chromium binary found`** — install a Chromium-based browser or set `CHROMIUM_PATH=/path/to/chrome`. The desktop app includes its own browser and needs no separate browser install.
410
415
  - **`Tool "X" not found — skipping`** during validate — that's the graceful path; the check requires `X` and isn't available. Install the tool or accept the skip.
411
416
  - **All validate checks skipped on Windows** — was a bug pre-0.1.7 (used `which`, which isn't on stock Windows); fixed to use `where.exe`.
@@ -18,10 +18,14 @@ export type { GutterpressManifest, ResolvedConfig, } from "../schema/manifest.ty
18
18
  export type { GutterpressPlugin, GutterpressPluginExport, GutterpressPluginMetadata, } from "../lib/markdown/plugins";
19
19
  export { getSystemDiagnostics, } from "../lib/diagnostics";
20
20
  export type { ToolStatus, SystemDiagnostics, } from "../lib/diagnostics";
21
- export { detectProjectSource, capabilitiesFor, findEnclosingRepoDir, repoSubPath, } from "../lib/project-source";
21
+ export { detectProjectSource, capabilitiesFor, findEnclosingRepoDir, repoSubPath, repoRootForSource, } from "../lib/project-source";
22
22
  export type { ProjectSource, ProjectCapabilities, } from "../lib/project-source";
23
23
  export { scaffoldProject, adoptFolder, slugifyProjectName, escapeYamlScalar, } from "../lib/project-scaffold.ts";
24
- export type { ProjectTemplateId, ProjectVersionHistoryMode, CreateProjectOptions, AdoptFolderOptions, CreateProjectResult, CreateProjectErrorCode, CreateProjectError, } from "../lib/project-scaffold.ts";
24
+ export type { ProjectTemplateId, ProjectVersionHistoryMode, CreateProjectOptions, CustomPageOptions, AdoptFolderOptions, CreateProjectResult, CreateProjectErrorCode, CreateProjectError, } from "../lib/project-scaffold.ts";
25
+ export { PRESET_IDS, PRESETS } from "../lib/presets.ts";
26
+ export type { PresetId, VendorPreset } from "../lib/presets.ts";
27
+ export { TARGETS, TARGET_IDS, publishTargetFor } from "../lib/targets.ts";
28
+ export type { PublishTarget, TargetOverlay } from "../lib/targets.ts";
25
29
  export { listBuiltInTemplates, listCustomTemplates, saveProjectAsTemplate, importTemplateFromFolder, BUILT_IN_TEMPLATE_IDS, } from "../lib/project-templates.ts";
26
30
  export type { TemplateInfo, SaveProjectAsTemplateOptions, } from "../lib/project-templates.ts";
27
31
  export { extractVariables, substituteVariables, listSnippets, readSnippet, saveSnippet, deleteSnippet, SNIPPETS_DIR, } from "../lib/snippets.ts";
package/dist/api/index.js CHANGED
@@ -15,11 +15,15 @@ import {
15
15
  GitHubAuthProvider,
16
16
  MANIFEST_FILENAMES,
17
17
  PLUGINS_DIR,
18
+ PRESETS,
19
+ PRESET_IDS,
18
20
  PublishSelectionsStore,
19
21
  RECOMMENDED_PLUGINS,
20
22
  RepoNeedsRecoveryError,
21
23
  SNIPPETS_DIR,
22
24
  SYNC_SNAPSHOT_MESSAGE,
25
+ TARGETS,
26
+ TARGET_IDS,
23
27
  THEMES_DIR,
24
28
  addLocalPlugin,
25
29
  addNpmPlugin,
@@ -80,6 +84,7 @@ import {
80
84
  publishConnectionStatus,
81
85
  publishCredentialKey,
82
86
  publishProviderFor,
87
+ publishTargetFor,
83
88
  pullChanges,
84
89
  pushChanges,
85
90
  readAppHeartbeat,
@@ -118,7 +123,7 @@ import {
118
123
  validateProjectPlugins,
119
124
  verifyRepoReadable,
120
125
  writeAppHeartbeat
121
- } from "../index-3h3fef7r.js";
126
+ } from "../index-bynn850m.js";
122
127
  import {
123
128
  AUTO_SNAPSHOT_MESSAGE,
124
129
  HISTORY_PAGE_LIMIT,
@@ -128,13 +133,14 @@ import {
128
133
  resolveLogger,
129
134
  restoreVersionWithBackup,
130
135
  shortOid
131
- } from "../index-5bxx0c4y.js";
136
+ } from "../index-yzrh708h.js";
132
137
  import {
133
138
  capabilitiesFor,
134
139
  detectProjectSource,
135
140
  findEnclosingRepoDir,
141
+ repoRootForSource,
136
142
  repoSubPath
137
- } from "../index-1tyj4bk3.js";
143
+ } from "../index-wchtvxvw.js";
138
144
  import"../index-yja077f6.js";
139
145
  import"../index-37x76zdn.js";
140
146
  export {
@@ -168,6 +174,7 @@ export {
168
174
  resolveBuiltInTheme,
169
175
  resolveActiveStyles,
170
176
  repoSubPath,
177
+ repoRootForSource,
171
178
  removeProjectTheme,
172
179
  removeAppHeartbeat,
173
180
  redactCredential,
@@ -180,6 +187,7 @@ export {
180
187
  readAppHeartbeat,
181
188
  pushChanges,
182
189
  pullChanges,
190
+ publishTargetFor,
183
191
  publishProviderFor,
184
192
  publishCredentialKey,
185
193
  publishConnectionStatus,
@@ -245,12 +253,16 @@ export {
245
253
  addNpmPlugin,
246
254
  addLocalPlugin,
247
255
  THEMES_DIR,
256
+ TARGET_IDS,
257
+ TARGETS,
248
258
  SYNC_SNAPSHOT_MESSAGE,
249
259
  SNIPPETS_DIR,
250
260
  RepoNeedsRecoveryError,
251
261
  RESTORE_BACKUP_MESSAGE,
252
262
  RECOMMENDED_PLUGINS,
253
263
  PublishSelectionsStore,
264
+ PRESET_IDS,
265
+ PRESETS,
254
266
  PLUGINS_DIR,
255
267
  MANIFEST_FILENAMES,
256
268
  HISTORY_PAGE_LIMIT,
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  executeAndReport
3
- } from "./cli-7ykx7pp0.js";
3
+ } from "./cli-k4bd06sd.js";
4
4
  import {
5
5
  log
6
- } from "./cli-h7phg3ka.js";
6
+ } from "./cli-najycadg.js";
7
7
  import {
8
8
  EXIT_CODES,
9
9
  UsageError,
10
10
  rejectExtraPositionals,
11
11
  rejectUnknownFlags
12
- } from "./cli-hvqjs342.js";
13
- import"./cli-5bxx0c4y.js";
14
- import"./cli-1tyj4bk3.js";
12
+ } from "./cli-e5zhb0xs.js";
13
+ import"./cli-yzrh708h.js";
14
+ import"./cli-wchtvxvw.js";
15
15
  import"./cli-yja077f6.js";
16
16
  import"./cli-37x76zdn.js";
17
17
 
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runBuild,
3
3
  splitOutPath
4
- } from "./cli-7ykx7pp0.js";
4
+ } from "./cli-k4bd06sd.js";
5
5
  import {
6
6
  log
7
- } from "./cli-h7phg3ka.js";
7
+ } from "./cli-najycadg.js";
8
8
  import {
9
9
  BuildError,
10
10
  UsageError,
@@ -12,9 +12,9 @@ import {
12
12
  parsePdfxFlavor,
13
13
  rejectExtraPositionals,
14
14
  rejectUnknownFlags
15
- } from "./cli-hvqjs342.js";
16
- import"./cli-5bxx0c4y.js";
17
- import"./cli-1tyj4bk3.js";
15
+ } from "./cli-e5zhb0xs.js";
16
+ import"./cli-yzrh708h.js";
17
+ import"./cli-wchtvxvw.js";
18
18
  import"./cli-yja077f6.js";
19
19
  import"./cli-37x76zdn.js";
20
20
 
@@ -3,6 +3,12 @@ export type CheckSeverity = "error" | "warning" | "info";
3
3
  export type CheckCategory = "source" | "pdf" | "asset" | "heuristic";
4
4
  export type CheckPhase = "pre-build" | "post-build";
5
5
  export interface CheckResult {
6
+ /**
7
+ * Publish-target id this result was produced for (ADR 0008). Set only on
8
+ * multi-target runs, where the same check can legitimately pass for one
9
+ * destination and fail for another; absent on target-independent results.
10
+ */
11
+ target?: string;
6
12
  checkId: string;
7
13
  severity: CheckSeverity;
8
14
  message: string;
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "gutterpress",
4
- version: "0.0.0",
4
+ version: "0.9.0-alpha.2",
5
5
  description: "Markdown-to-PDF converter for professional print layout using Paged.js and Ghostscript.",
6
6
  author: "itlackey",
7
7
  license: "MPL-2.0",
@@ -13,7 +13,7 @@ var package_default = {
13
13
  "ghostscript",
14
14
  "book",
15
15
  "publishing",
16
- "ttrpg"
16
+ "zine"
17
17
  ],
18
18
  repository: {
19
19
  type: "git",