gutterpress 0.0.0 → 0.9.0-alpha.1

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 (74) 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-k16v3n98.js} +5 -5
  5. package/dist/{build-5s92kgpc.js → build-8tqr4gbb.js} +5 -5
  6. package/dist/checks/types.d.ts +6 -0
  7. package/dist/{cli-hvqjs342.js → cli-rkqxbnkq.js} +2 -2
  8. package/dist/{cli-h7phg3ka.js → cli-v2dze8ja.js} +258 -258
  9. package/dist/{index-1tyj4bk3.js → cli-wchtvxvw.js} +4 -1
  10. package/dist/{cli-7ykx7pp0.js → cli-yp0d2hp8.js} +611 -259
  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-57czxy3q.js} +2 -2
  14. package/dist/{index-3h3fef7r.js → index-m3pa4wyf.js} +826 -335
  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/index.d.ts +0 -1
  26. package/dist/lib/npm-plugin-installer.d.ts +1 -1
  27. package/dist/lib/output-paths.d.ts +0 -1
  28. package/dist/lib/pagination.d.ts +0 -20
  29. package/dist/lib/pdf-inspect.d.ts +2 -2
  30. package/dist/lib/pdf-parse.d.ts +2 -1
  31. package/dist/lib/plugin-manager.d.ts +0 -2
  32. package/dist/lib/presets.d.ts +36 -7
  33. package/dist/lib/project-scaffold.d.ts +39 -2
  34. package/dist/lib/project-source.d.ts +11 -9
  35. package/dist/lib/project-templates.d.ts +45 -7
  36. package/dist/lib/publish/providers/azure-swa.d.ts +0 -1
  37. package/dist/lib/publish/providers/itch.d.ts +0 -1
  38. package/dist/lib/publish/providers/shopify.d.ts +0 -1
  39. package/dist/lib/remote-auth/github-repos.d.ts +0 -2
  40. package/dist/lib/remote-auth/recovery/dispatch.d.ts +0 -5
  41. package/dist/lib/remote-auth/recovery/outcome-mapping.d.ts +3 -2
  42. package/dist/lib/remote-auth/recovery/recover-stale-lock.d.ts +0 -8
  43. package/dist/lib/remote-auth/sync.d.ts +2 -10
  44. package/dist/lib/remote-auth/test-access.d.ts +0 -2
  45. package/dist/lib/remote-auth/test-support/git-http-server.d.ts +0 -37
  46. package/dist/lib/source-provider.d.ts +0 -14
  47. package/dist/lib/static-serve.d.ts +39 -0
  48. package/dist/lib/style-resolver.d.ts +10 -1
  49. package/dist/lib/targets.d.ts +84 -0
  50. package/dist/lib/theme-import.d.ts +0 -2
  51. package/dist/lib/theme-manager.d.ts +1 -1
  52. package/dist/lib/validation-exec.d.ts +4 -3
  53. package/dist/{lint-f63nxjfj.js → lint-4sq0dvf6.js} +5 -5
  54. package/dist/{manifest.schema-rn1dpdpn.json → manifest.schema-z61rzw44.json} +12 -6
  55. package/dist/new-f2nmyr5b.js +185 -0
  56. package/dist/{plugin-wf2cbmwc.js → plugin-xskq3dtx.js} +5 -5
  57. package/dist/{preflight-tg4mpz1h.js → preflight-epcffags.js} +24 -29
  58. package/dist/preview/file-watcher.d.ts +9 -22
  59. package/dist/preview/server-context.d.ts +22 -0
  60. package/dist/{preview-h2bwbb2x.js → preview-xf5dktz2.js} +5 -5
  61. package/dist/{project-source-0tg0r6vm.js → project-source-p0gn1wd5.js} +3 -3
  62. package/dist/{publish-ztaet53r.js → publish-97vdwq31.js} +5 -5
  63. package/dist/{repair-jkp4n3j8.js → repair-cz4z4hkg.js} +5 -5
  64. package/dist/schema/manifest.types.d.ts +14 -3
  65. package/dist/{source-provider-hp96b5jf.js → source-provider-c1rjm2c0.js} +2 -8
  66. package/dist/types.d.ts +0 -1
  67. package/dist/{validate-k2drs19j.js → validate-swzejnd8.js} +8 -8
  68. package/package.json +2 -2
  69. package/dist/chapter-01-jj8ftn4c.md +0 -29
  70. package/dist/lib/validation-profile.d.ts +0 -18
  71. package/dist/manifest-ryyg71nf.yaml +0 -9
  72. package/dist/new-7b08a42h.js +0 -105
  73. package/dist/theme-0yzvthe8.css +0 -65
  74. package/dist/theme-6a2fngc8.json +0 -6
@@ -1,18 +1,19 @@
1
1
  import {
2
2
  executeValidation,
3
+ publishTargetFor,
3
4
  reportMissingTools
4
- } from "./cli-7ykx7pp0.js";
5
+ } from "./cli-yp0d2hp8.js";
5
6
  import {
6
7
  log
7
- } from "./cli-h7phg3ka.js";
8
+ } from "./cli-v2dze8ja.js";
8
9
  import {
9
10
  EXIT_CODES,
10
11
  UsageError,
11
12
  rejectExtraPositionals,
12
13
  rejectUnknownFlags
13
- } from "./cli-hvqjs342.js";
14
- import"./cli-5bxx0c4y.js";
15
- import"./cli-1tyj4bk3.js";
14
+ } from "./cli-rkqxbnkq.js";
15
+ import"./cli-yzrh708h.js";
16
+ import"./cli-wchtvxvw.js";
16
17
  import"./cli-yja077f6.js";
17
18
  import"./cli-37x76zdn.js";
18
19
 
@@ -35,25 +36,19 @@ function severityRank(severity) {
35
36
  return 2;
36
37
  }
37
38
  function buildRequiredChecks(execution) {
38
- if (execution.profile !== "dtrpg")
39
- return [];
40
- const requiredIds = [
41
- "pdf.structure.qpdf",
42
- "pdf.print.pdfx-markers",
43
- "pdf.print.pdfx-metadata",
44
- "pdf.print.embedded-fonts"
45
- ];
46
39
  const skipped = new Set(execution.tools.skippedChecks);
47
- const failed = new Set(execution.report.errors.map((item) => item.checkId));
48
40
  const passed = new Set(execution.report.passed);
49
- return requiredIds.map((id) => {
50
- if (skipped.has(id))
51
- return { id, status: "skipped" };
52
- if (failed.has(id))
53
- return { id, status: "fail" };
54
- if (passed.has(id))
55
- return { id, status: "pass" };
56
- return { id, status: "fail" };
41
+ return execution.targets.flatMap((targetId) => {
42
+ const failed = new Set(execution.report.errors.filter((item) => item.target === undefined || item.target === targetId).map((item) => item.checkId));
43
+ return publishTargetFor(targetId).requiredChecks.map((id) => {
44
+ if (skipped.has(id))
45
+ return { target: targetId, id, status: "skipped" };
46
+ if (failed.has(id))
47
+ return { target: targetId, id, status: "fail" };
48
+ if (passed.has(id))
49
+ return { target: targetId, id, status: "pass" };
50
+ return { target: targetId, id, status: "fail" };
51
+ });
57
52
  });
58
53
  }
59
54
  function buildPreflightPayload(execution) {
@@ -85,8 +80,8 @@ function buildPreflightPayload(execution) {
85
80
  const requiredChecks = buildRequiredChecks(execution);
86
81
  const skippedRequired = requiredChecks.some((check) => check.status === "skipped");
87
82
  return {
88
- schemaVersion: 1,
89
- profile: execution.profile ?? null,
83
+ schemaVersion: 2,
84
+ targets: [...execution.targets],
90
85
  status: computeStatus(execution.report.summary.errors, execution.report.summary.warnings, execution.tools.missing.length, skippedRequired),
91
86
  pdf: execution.context.pdfPath ?? "",
92
87
  summary: { ...execution.report.summary },
@@ -103,7 +98,7 @@ function toPreflightMarkdown(payload) {
103
98
  lines.push("# gutterpress preflight");
104
99
  lines.push("");
105
100
  lines.push(`- Status: **${payload.status}**`);
106
- lines.push(`- Profile: ${payload.profile ?? "none"}`);
101
+ lines.push(`- Targets: ${payload.targets.length > 0 ? payload.targets.join(", ") : "none"}`);
107
102
  lines.push(`- PDF: ${payload.pdf}`);
108
103
  lines.push(`- Summary: ${payload.summary.errors} error(s), ${payload.summary.warnings} warning(s), ${payload.summary.passed}/${payload.summary.total} checks passed`);
109
104
  if (payload.tools.missing.length > 0) {
@@ -117,7 +112,7 @@ function toPreflightMarkdown(payload) {
117
112
  lines.push("");
118
113
  lines.push("## Required Checks");
119
114
  for (const check of payload.requiredChecks) {
120
- lines.push(`- ${check.id}: ${check.status}`);
115
+ lines.push(`- [${check.target}] ${check.id}: ${check.status}`);
121
116
  }
122
117
  }
123
118
  if (payload.issues.length > 0) {
@@ -155,9 +150,9 @@ var preflightArgs = {
155
150
  type: "string",
156
151
  description: "Path to manifest.yaml"
157
152
  },
158
- profile: {
153
+ target: {
159
154
  type: "string",
160
- description: "Validation profile lock (currently: dtrpg)"
155
+ description: "Publish targets to preflight against (comma-separated, e.g. dtrpg,itch), overriding the manifest's `targets:`"
161
156
  },
162
157
  "report-dir": {
163
158
  type: "string",
@@ -187,7 +182,7 @@ var preflight_default = defineCommand({
187
182
  pdf: typeof args.pdf === "string" ? args.pdf : undefined,
188
183
  input,
189
184
  phase: "post-build",
190
- profile: typeof args.profile === "string" ? args.profile : undefined
185
+ target: typeof args.target === "string" ? args.target : undefined
191
186
  });
192
187
  } catch (error) {
193
188
  log.error(error instanceof Error ? error.message : String(error));
@@ -13,26 +13,6 @@ import type { ResolvedPluginConfig } from '../schema/manifest.types';
13
13
  * every source change now performs a full-document pagination.
14
14
  */
15
15
  export declare function incrementalPreviewEnabled(): boolean;
16
- /**
17
- * Shared preview render path. renderChapters() does all Markdown, CSS, and
18
- * Paged.js-slot work.
19
- *
20
- * Named `renderPreviewBook` (ARCH finding #53) to distinguish it from
21
- * build-runner.ts's `renderBook` — same name, different module, and a
22
- * genuinely different contract: this one is degrade-and-report (a plugin the
23
- * author enabled but hasn't installed yet is skipped with a loud warning so
24
- * the rest of the live preview still renders); build-runner.ts's is
25
- * fail-fast, because a final artifact must never silently drop a plugin.
26
- * Both preambles now share {@link loadPluginsWithCss}.
27
- */
28
- export declare function renderPreviewBook(inputPath: string, config: {
29
- title?: string;
30
- styles?: string[];
31
- plugins?: ResolvedPluginConfig[];
32
- }, opts: {
33
- files: string[] | null;
34
- wrapChapters: boolean;
35
- }): Promise<string>;
36
16
  /**
37
17
  * Rewrite rendered book HTML for the live preview. Injects, in order:
38
18
  * 1. pagedjs-interface.js — defines window.previewAPI for in-iframe controls
@@ -70,6 +50,12 @@ export declare function injectPreviewScripts(html: string): string;
70
50
  *
71
51
  * Empty `inputPath` writes a static placeholder — the desktop app (packages/desktop)
72
52
  * supplies a real path via its own folder picker.
53
+ *
54
+ * `cssAssets` is REQUIRED, not optional: it is the map the HTTP server resolves
55
+ * the inliner's rewritten asset URLs against (see {@link ServerState.cssAssets}),
56
+ * so a caller that skipped it would render a book.html whose shared-art URLs
57
+ * 404 — the exact bug this parameter exists to fix, reintroduced silently.
58
+ * Every render replaces its contents.
73
59
  */
74
60
  export declare function generateAndWriteHtml(inputPath: string, tempDir: string, config: {
75
61
  title?: string;
@@ -78,7 +64,7 @@ export declare function generateAndWriteHtml(inputPath: string, tempDir: string,
78
64
  files?: string[] | null;
79
65
  };
80
66
  plugins?: ResolvedPluginConfig[];
81
- }): Promise<void>;
67
+ }, cssAssets: Map<string, string>): Promise<void>;
82
68
  /**
83
69
  * Chokidar 5's `ignored` matcher (regex or function) is tested against the
84
70
  * fully-qualified, forward-slash-normalized ABSOLUTE path — never a path
@@ -102,7 +88,8 @@ export declare function isDotPathUnderRoot(candidatePath: string, root: string):
102
88
  * Whether the watcher should ignore a path.
103
89
  *
104
90
  * IN-PROJECT paths get the dotfile rule ({@link isDotPathUnderRoot}) — a
105
- * project's own `.git/`, `.DS_Store`, editor swap files, and so on are noise.
91
+ * project's own `.git/`, `.DS_Store`, editor swap files, and so on are noise
92
+ * plus the generated/vendored-subtree rule ({@link isGeneratedProjectPath}).
106
93
  *
107
94
  * A path OUTSIDE the project is only ever seen because it is a DECLARED
108
95
  * external dependency the manifest named explicitly (see
@@ -29,6 +29,28 @@ export interface ServerState {
29
29
  config: ResolvedConfig;
30
30
  /** Server options */
31
31
  options: PreviewServerOptions;
32
+ /**
33
+ * Files the inlined CSS references but could not embed, as
34
+ * `book.html`-relative URL path → absolute source path.
35
+ *
36
+ * `asset-inline.ts` embeds fonts and images up to
37
+ * `IMAGE_INLINE_MAX_BYTES`; anything larger keeps its project-relative path
38
+ * (if it lives in the book) or becomes `assets/<contentHash><ext>` (if it
39
+ * does not — e.g. art referenced from a repo-root shared stylesheet, the
40
+ * normative multi-book layout). Either way the inliner returns a COPY PLAN,
41
+ * which the build executes into its output dir.
42
+ *
43
+ * The preview serves the project in place and has no output dir, so a
44
+ * rewritten `assets/<hash>` URL had nothing behind it and shared art
45
+ * rendered broken in the live preview while building correctly. Keeping the
46
+ * plan here lets the server resolve those URLs straight from their real
47
+ * location — same URL as the build, still nothing copied.
48
+ *
49
+ * Rebuilt from scratch on every render, so a stylesheet edit that drops an
50
+ * image drops its URL too. Exact-match lookups only: never a path-traversal
51
+ * surface.
52
+ */
53
+ cssAssets: Map<string, string>;
32
54
  }
33
55
  /**
34
56
  * Create initial server state
@@ -6,10 +6,10 @@ import {
6
6
  runBuild,
7
7
  splitOutPath,
8
8
  startPreviewServer
9
- } from "./cli-7ykx7pp0.js";
9
+ } from "./cli-yp0d2hp8.js";
10
10
  import {
11
11
  log
12
- } from "./cli-h7phg3ka.js";
12
+ } from "./cli-v2dze8ja.js";
13
13
  import {
14
14
  BuildError,
15
15
  UsageError,
@@ -18,9 +18,9 @@ import {
18
18
  rejectExtraPositionals,
19
19
  rejectUnknownFlags,
20
20
  resolvePort
21
- } from "./cli-hvqjs342.js";
22
- import"./cli-5bxx0c4y.js";
23
- import"./cli-1tyj4bk3.js";
21
+ } from "./cli-rkqxbnkq.js";
22
+ import"./cli-yzrh708h.js";
23
+ import"./cli-wchtvxvw.js";
24
24
  import"./cli-yja077f6.js";
25
25
  import"./cli-37x76zdn.js";
26
26
 
@@ -2,15 +2,15 @@ import {
2
2
  capabilitiesFor,
3
3
  detectProjectSource,
4
4
  findEnclosingRepoDir,
5
- pickSyncRemote,
5
+ repoRootForSource,
6
6
  repoSubPath,
7
7
  syncRemoteFor
8
- } from "./cli-1tyj4bk3.js";
8
+ } from "./cli-wchtvxvw.js";
9
9
  import"./cli-37x76zdn.js";
10
10
  export {
11
11
  syncRemoteFor,
12
12
  repoSubPath,
13
- pickSyncRemote,
13
+ repoRootForSource,
14
14
  findEnclosingRepoDir,
15
15
  detectProjectSource,
16
16
  capabilitiesFor
@@ -7,19 +7,19 @@ import {
7
7
  publishCredentialKey,
8
8
  publishProviderFor,
9
9
  runPublish
10
- } from "./cli-7ykx7pp0.js";
10
+ } from "./cli-yp0d2hp8.js";
11
11
  import {
12
12
  FileTokenStore,
13
13
  log
14
- } from "./cli-h7phg3ka.js";
14
+ } from "./cli-v2dze8ja.js";
15
15
  import {
16
16
  EXIT_CODES,
17
17
  UsageError,
18
18
  rejectExtraPositionals,
19
19
  rejectUnknownFlags
20
- } from "./cli-hvqjs342.js";
21
- import"./cli-5bxx0c4y.js";
22
- import"./cli-1tyj4bk3.js";
20
+ } from "./cli-rkqxbnkq.js";
21
+ import"./cli-yzrh708h.js";
22
+ import"./cli-wchtvxvw.js";
23
23
  import"./cli-yja077f6.js";
24
24
  import"./cli-37x76zdn.js";
25
25
 
@@ -8,18 +8,18 @@ import {
8
8
  makeManualGuidance,
9
9
  recover,
10
10
  verifyRepoReadable
11
- } from "./cli-7ykx7pp0.js";
11
+ } from "./cli-yp0d2hp8.js";
12
12
  import {
13
13
  FileTokenStore,
14
14
  defaultConfigDir
15
- } from "./cli-h7phg3ka.js";
15
+ } from "./cli-v2dze8ja.js";
16
16
  import {
17
17
  UsageError,
18
18
  rejectExtraPositionals,
19
19
  rejectUnknownFlags
20
- } from "./cli-hvqjs342.js";
21
- import"./cli-5bxx0c4y.js";
22
- import"./cli-1tyj4bk3.js";
20
+ } from "./cli-rkqxbnkq.js";
21
+ import"./cli-yzrh708h.js";
22
+ import"./cli-wchtvxvw.js";
23
23
  import"./cli-yja077f6.js";
24
24
  import"./cli-37x76zdn.js";
25
25
 
@@ -1,4 +1,4 @@
1
- export type CheckSeverity = "error" | "warning" | "info";
1
+ type CheckSeverity = "error" | "warning" | "info";
2
2
  export interface PluginConfig {
3
3
  path?: string;
4
4
  name?: string;
@@ -29,7 +29,7 @@ export interface PluginConfig {
29
29
  * absent uses the default (bare-host) credential. This book-level choice
30
30
  * overrides any project/global default.
31
31
  */
32
- export interface PublishSettings {
32
+ interface PublishSettings {
33
33
  itch?: {
34
34
  /** itch.io project as `user/game` (the butler push target). */
35
35
  target?: string;
@@ -64,7 +64,15 @@ export interface GutterpressManifest {
64
64
  title?: string;
65
65
  authors?: string[];
66
66
  publish?: PublishSettings;
67
- preset?: "dtrpg" | "book";
67
+ /** How the book is designed (ADR 0008). The registry in lib/presets.ts is authoritative. */
68
+ preset?: "dtrpg" | "book" | "custom";
69
+ /**
70
+ * Where the book is published (ADR 0008): publish-target ids whose
71
+ * validation policies this book is checked against. Absent = the preset's
72
+ * defaults (`dtrpg` -> ["dtrpg"]; `book`/`custom` -> []). The registry in
73
+ * lib/targets.ts is authoritative.
74
+ */
75
+ targets?: string[];
68
76
  styles?: string[];
69
77
  plugins?: (string | PluginConfig)[];
70
78
  source?: {
@@ -155,6 +163,8 @@ export interface ResolvedPluginConfig {
155
163
  export interface ResolvedConfig {
156
164
  title: string;
157
165
  authors: string[];
166
+ /** Validated publish-target ids for this book (may be empty). */
167
+ targets: string[];
158
168
  styles?: string[];
159
169
  plugins: ResolvedPluginConfig[];
160
170
  source: {
@@ -216,3 +226,4 @@ export interface ResolvedConfig {
216
226
  };
217
227
  };
218
228
  }
229
+ export {};
@@ -2,9 +2,7 @@ import {
2
2
  AUTO_SNAPSHOT_MESSAGE,
3
3
  HISTORY_PAGE_LIMIT,
4
4
  RESTORE_BACKUP_MESSAGE,
5
- SNAPSHOT_STAGING_MARKER,
6
5
  __repoLockQueueSizeForTests,
7
- gitAuthor,
8
6
  gitDirFor,
9
7
  gitScopeFor,
10
8
  hasPendingChanges,
@@ -12,15 +10,14 @@ import {
12
10
  isNoChangesError,
13
11
  listWorkdirChanges,
14
12
  providerFor,
15
- readGitAuthor,
16
13
  resolveGitAuthor,
17
14
  restoreVersionWithBackup,
18
15
  snapshotStagingMarkerPath,
19
16
  snapshotWorkingTreeUnlocked,
20
17
  stageChanges,
21
18
  withRepoLock
22
- } from "./cli-5bxx0c4y.js";
23
- import"./cli-1tyj4bk3.js";
19
+ } from "./cli-yzrh708h.js";
20
+ import"./cli-wchtvxvw.js";
24
21
  import"./cli-37x76zdn.js";
25
22
  export {
26
23
  withRepoLock,
@@ -29,7 +26,6 @@ export {
29
26
  snapshotStagingMarkerPath,
30
27
  restoreVersionWithBackup,
31
28
  resolveGitAuthor,
32
- readGitAuthor,
33
29
  providerFor,
34
30
  listWorkdirChanges,
35
31
  isNoChangesError,
@@ -37,9 +33,7 @@ export {
37
33
  hasPendingChanges,
38
34
  gitScopeFor,
39
35
  gitDirFor,
40
- gitAuthor,
41
36
  __repoLockQueueSizeForTests,
42
- SNAPSHOT_STAGING_MARKER,
43
37
  RESTORE_BACKUP_MESSAGE,
44
38
  HISTORY_PAGE_LIMIT,
45
39
  AUTO_SNAPSHOT_MESSAGE
package/dist/types.d.ts CHANGED
@@ -4,7 +4,6 @@
4
4
  * Core types used by the preview server and CLI commands.
5
5
  * Build pipeline types are in src/schema/manifest.types.ts.
6
6
  */
7
- export type { GutterpressManifest, ResolvedConfig } from './schema/manifest.types';
8
7
  /**
9
8
  * Options for preview server (internal)
10
9
  */
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  executeAndReport
3
- } from "./cli-7ykx7pp0.js";
3
+ } from "./cli-yp0d2hp8.js";
4
4
  import {
5
5
  log
6
- } from "./cli-h7phg3ka.js";
6
+ } from "./cli-v2dze8ja.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-rkqxbnkq.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
 
@@ -55,9 +55,9 @@ var commandArgs = {
55
55
  type: "string",
56
56
  description: "Run checks for phase: pre | post | all | pre-build | post-build (default: all)"
57
57
  },
58
- profile: {
58
+ target: {
59
59
  type: "string",
60
- description: "Validation profile lock (currently: dtrpg)"
60
+ description: "Publish targets to validate against (comma-separated, e.g. dtrpg,itch), overriding the manifest's `targets:`"
61
61
  }
62
62
  };
63
63
  var validate_default = defineCommand({
@@ -83,7 +83,7 @@ var validate_default = defineCommand({
83
83
  only: typeof args.only === "string" ? args.only : undefined,
84
84
  skip: typeof args.skip === "string" ? args.skip : undefined,
85
85
  phase: typeof args.phase === "string" ? args.phase : undefined,
86
- profile: typeof args.profile === "string" ? args.profile : undefined
86
+ target: typeof args.target === "string" ? args.target : undefined
87
87
  }, format);
88
88
  } catch (error) {
89
89
  log.error(error instanceof Error ? error.message : String(error));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gutterpress",
3
- "version": "0.0.0",
3
+ "version": "0.9.0-alpha.1",
4
4
  "description": "Markdown-to-PDF converter for professional print layout using Paged.js and Ghostscript.",
5
5
  "author": "itlackey",
6
6
  "license": "MPL-2.0",
@@ -12,7 +12,7 @@
12
12
  "ghostscript",
13
13
  "book",
14
14
  "publishing",
15
- "ttrpg"
15
+ "zine"
16
16
  ],
17
17
  "repository": {
18
18
  "type": "git",
@@ -1,29 +0,0 @@
1
- # Introduction
2
-
3
- Welcome to {{TITLE}}, a tabletop roleplaying supplement. This first page is a
4
- starting point — replace it with your own rules, lore, and tables.
5
-
6
- ## How to use this supplement
7
-
8
- Write your rules in plain paragraphs, then break out the parts players reach for
9
- most into clearly labelled blocks. Headings keep long sections easy to scan at
10
- the table.
11
-
12
- ## A sample rule
13
-
14
- > **Quick rule:** When two characters disagree on the outcome of an action, both
15
- > roll. The higher result decides what happens, and the other player narrates
16
- > how their character reacts.
17
-
18
- ## A sample stat block
19
-
20
- Use a simple table for stat blocks so the numbers line up neatly on the page:
21
-
22
- | Attribute | Value |
23
- | --------- | ----- |
24
- | Health | 10 |
25
- | Defense | 4 |
26
- | Speed | 6 |
27
-
28
- Add more files alongside this one and they become the next sections of your
29
- supplement. Start writing and watch your rules take shape in the preview.
@@ -1,18 +0,0 @@
1
- import type { ResolvedConfig } from "../schema/manifest.types";
2
- export type ValidationProfile = "dtrpg";
3
- export declare const DTRPG_STRICT_PDF_CHECKS: readonly ["pdf.structure.qpdf", "pdf.print.pdfx-markers", "pdf.print.pdfx-metadata", "pdf.print.embedded-fonts"];
4
- /**
5
- * Fill in the strict PDF checks (structure/PDF-X markers/metadata/embedded
6
- * fonts) for any of them the config left unset, without overwriting an
7
- * author's explicit choice. ARCH finding #21: replaces the old
8
- * `applyDtrpgPdfDefaults` name, which implied a dtrpg-only opt-in even though
9
- * `executeValidation` applies it to every PDF validation regardless of
10
- * profile/preset — see validation-exec.ts.
11
- */
12
- export declare function applyDefaultPdfStrictChecks(config: ResolvedConfig): ResolvedConfig;
13
- /**
14
- * @deprecated Use {@link applyDefaultPdfStrictChecks} — kept as an alias so
15
- * existing call sites keep resolving under the old, dtrpg-branded name.
16
- */
17
- export declare const applyDtrpgPdfDefaults: typeof applyDefaultPdfStrictChecks;
18
- export declare function applyValidationProfile(config: ResolvedConfig, profile: ValidationProfile): ResolvedConfig;
@@ -1,9 +0,0 @@
1
- title: "{{TITLE}}"
2
- authors:
3
- - "{{AUTHOR}}"
4
- source:
5
- files:
6
- - chapter-01.md
7
- styles:
8
- - styles/book.css
9
- preset: dtrpg
@@ -1,105 +0,0 @@
1
- import {
2
- BUILT_IN_TEMPLATE_IDS,
3
- scaffoldProject
4
- } from "./cli-7ykx7pp0.js";
5
- import"./cli-h7phg3ka.js";
6
- import {
7
- EXIT_CODES,
8
- UsageError,
9
- rejectExtraPositionals,
10
- rejectUnknownFlags
11
- } from "./cli-hvqjs342.js";
12
- import"./cli-5bxx0c4y.js";
13
- import"./cli-1tyj4bk3.js";
14
- import"./cli-yja077f6.js";
15
- import"./cli-37x76zdn.js";
16
-
17
- // src/commands/new.ts
18
- import { defineCommand } from "citty";
19
- import { resolve } from "node:path";
20
- var newArgs = {
21
- name: {
22
- type: "positional",
23
- description: "Project name (becomes the title and folder name)",
24
- required: true
25
- },
26
- author: {
27
- type: "string",
28
- description: "Author name to record in the project"
29
- },
30
- dir: {
31
- type: "string",
32
- description: "Parent directory to create the project in (default: current directory)"
33
- },
34
- folder: {
35
- type: "string",
36
- description: "Folder name to create (default: a slug of the project name)"
37
- },
38
- template: {
39
- type: "string",
40
- description: `Starter template: ${BUILT_IN_TEMPLATE_IDS.join(", ")} (default: book)`
41
- },
42
- git: {
43
- type: "boolean",
44
- description: "Initialise local version history (default: true; use --no-git to skip)",
45
- default: true
46
- }
47
- };
48
- var new_default = defineCommand({
49
- meta: {
50
- name: "new",
51
- description: "Create a new Gutterpress project from a starter template"
52
- },
53
- args: newArgs,
54
- async run({ args, rawArgs }) {
55
- try {
56
- rejectUnknownFlags(rawArgs, newArgs, "new");
57
- rejectExtraPositionals(args._, 1, "new");
58
- } catch (error) {
59
- if (error instanceof UsageError) {
60
- console.error(error.message);
61
- process.exit(error.exitCode);
62
- }
63
- throw error;
64
- }
65
- const name = String(args.name);
66
- const parentDir = resolve(typeof args.dir === "string" && args.dir ? args.dir : process.cwd());
67
- let template;
68
- if (typeof args.template === "string" && args.template) {
69
- if (!BUILT_IN_TEMPLATE_IDS.includes(args.template)) {
70
- console.error(`Unknown template "${args.template}". Choose one of: ${BUILT_IN_TEMPLATE_IDS.join(", ")}.`);
71
- process.exit(EXIT_CODES.USAGE);
72
- }
73
- template = args.template;
74
- }
75
- try {
76
- const result = await scaffoldProject({
77
- name,
78
- author: typeof args.author === "string" ? args.author : undefined,
79
- parentDir,
80
- folderName: typeof args.folder === "string" && args.folder ? args.folder : undefined,
81
- template,
82
- versionHistory: args.git === false ? "none" : "local-git"
83
- });
84
- console.log(`Created project: ${result.projectDir}`);
85
- console.log(` manifest: ${result.manifestPath}`);
86
- console.log(` start writing in: ${result.openFile}`);
87
- if (result.versionHistory === "local-git") {
88
- console.log(" version history: enabled (local snapshots)");
89
- } else if (result.versionHistoryError) {
90
- console.log(` version history: not enabled (${result.versionHistoryError})`);
91
- }
92
- console.log("");
93
- console.log(`Next: gutterpress preview "${result.projectDir}"`);
94
- } catch (e) {
95
- const err = e;
96
- const code = err && typeof err.code === "string" ? err.code : "scaffold-io";
97
- console.error(`Could not create project: ${err?.message ?? String(e)}`);
98
- process.exit(code === "scaffold-io" ? EXIT_CODES.PIPELINE : EXIT_CODES.USAGE);
99
- }
100
- }
101
- });
102
- export {
103
- newArgs,
104
- new_default as default
105
- };