gutterpress 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +422 -0
- package/dist/CGATS21_CRPC1-g0e3k7kr.icc +0 -0
- package/dist/api/index.d.ts +76 -0
- package/dist/api/index.js +272 -0
- package/dist/assets/preview/scripts/pagedjs-bridge.d.ts +1 -0
- package/dist/assets/preview/scripts/pagedjs-interface.d.ts +1 -0
- package/dist/assets/preview/scripts/preview-shell.d.ts +1 -0
- package/dist/audit-1jrwwacz.js +66 -0
- package/dist/build-5s92kgpc.js +77 -0
- package/dist/chapter-01-6fn9pvd0.md +31 -0
- package/dist/chapter-01-7jwqg1ct.md +20 -0
- package/dist/chapter-01-jj8ftn4c.md +29 -0
- package/dist/chapter-01-rkpyvjna.md +26 -0
- package/dist/checks/asset/approved-fonts.d.ts +3 -0
- package/dist/checks/asset/extensions.d.ts +41 -0
- package/dist/checks/asset/font-license.d.ts +3 -0
- package/dist/checks/asset/image-alpha.d.ts +3 -0
- package/dist/checks/asset/image-color-space.d.ts +3 -0
- package/dist/checks/asset/image-file-size.d.ts +3 -0
- package/dist/checks/asset/image-resolution.d.ts +3 -0
- package/dist/checks/asset/image-tac.d.ts +3 -0
- package/dist/checks/asset/index.d.ts +7 -0
- package/dist/checks/formatter.d.ts +3 -0
- package/dist/checks/heuristic/index.d.ts +4 -0
- package/dist/checks/heuristic/layer-count.d.ts +3 -0
- package/dist/checks/heuristic/placement-variance.d.ts +3 -0
- package/dist/checks/heuristic/section-density.d.ts +3 -0
- package/dist/checks/heuristic/text-density.d.ts +3 -0
- package/dist/checks/pdf/bleed.d.ts +3 -0
- package/dist/checks/pdf/bookmarks.d.ts +3 -0
- package/dist/checks/pdf/color-spaces.d.ts +3 -0
- package/dist/checks/pdf/cross-refs.d.ts +3 -0
- package/dist/checks/pdf/embedded-fonts.d.ts +3 -0
- package/dist/checks/pdf/image-resolution.d.ts +3 -0
- package/dist/checks/pdf/index.d.ts +15 -0
- package/dist/checks/pdf/ink-coverage.d.ts +3 -0
- package/dist/checks/pdf/page-labels.d.ts +3 -0
- package/dist/checks/pdf/page-size.d.ts +3 -0
- package/dist/checks/pdf/pdfx-markers.d.ts +3 -0
- package/dist/checks/pdf/pdfx-metadata.d.ts +3 -0
- package/dist/checks/pdf/pdfx-structure.d.ts +6 -0
- package/dist/checks/pdf/qpdf-structure.d.ts +3 -0
- package/dist/checks/pdf/rasterized-pages.d.ts +3 -0
- package/dist/checks/pdf/toc-links.d.ts +3 -0
- package/dist/checks/pdf/transparency.d.ts +3 -0
- package/dist/checks/policy.d.ts +61 -0
- package/dist/checks/register-builtins.d.ts +17 -0
- package/dist/checks/registry.d.ts +40 -0
- package/dist/checks/runner.d.ts +25 -0
- package/dist/checks/source/accessibility-alt-text.d.ts +3 -0
- package/dist/checks/source/accessibility-heading-order.d.ts +3 -0
- package/dist/checks/source/config-file.d.ts +8 -0
- package/dist/checks/source/htmlhint.d.ts +3 -0
- package/dist/checks/source/index.d.ts +6 -0
- package/dist/checks/source/local-refs.d.ts +3 -0
- package/dist/checks/source/markdownlint.d.ts +3 -0
- package/dist/checks/source/stylelint.d.ts +3 -0
- package/dist/checks/tool-check.d.ts +23 -0
- package/dist/checks/types.d.ts +52 -0
- package/dist/cli-1tyj4bk3.js +124 -0
- package/dist/cli-37x76zdn.js +4 -0
- package/dist/cli-506tg37g.js +26 -0
- package/dist/cli-5bxx0c4y.js +464 -0
- package/dist/cli-7ykx7pp0.js +12378 -0
- package/dist/cli-h7phg3ka.js +746 -0
- package/dist/cli-hvqjs342.js +284 -0
- package/dist/cli-yja077f6.js +92 -0
- package/dist/cli.js +157 -0
- package/dist/constants.d.ts +17 -0
- package/dist/doctor-25zjt8dz.js +57 -0
- package/dist/favicon-wkbm9cjn.ico +0 -0
- package/dist/git-http-yrb4ag6z.js +17 -0
- package/dist/index-1tyj4bk3.js +124 -0
- package/dist/index-37x76zdn.js +4 -0
- package/dist/index-3h3fef7r.js +15218 -0
- package/dist/index-5bxx0c4y.js +464 -0
- package/dist/index-yja077f6.js +92 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +310 -0
- package/dist/lib/app-heartbeat.d.ts +102 -0
- package/dist/lib/asset-inline.d.ts +73 -0
- package/dist/lib/browser-pool.d.ts +17 -0
- package/dist/lib/build-error.d.ts +52 -0
- package/dist/lib/build-fingerprint.d.ts +15 -0
- package/dist/lib/build-preflight.d.ts +43 -0
- package/dist/lib/build-runner.d.ts +161 -0
- package/dist/lib/build-staging.d.ts +64 -0
- package/dist/lib/chromium.d.ts +20 -0
- package/dist/lib/cli-args.d.ts +45 -0
- package/dist/lib/desktop.d.ts +14 -0
- package/dist/lib/diagnostics.d.ts +64 -0
- package/dist/lib/embedded-assets.d.ts +29 -0
- package/dist/lib/exec.d.ts +84 -0
- package/dist/lib/fetch-timeout.d.ts +41 -0
- package/dist/lib/ghostscript.d.ts +48 -0
- package/dist/lib/host-policy.d.ts +75 -0
- package/dist/lib/image-inspect.d.ts +32 -0
- package/dist/lib/install-hints.d.ts +21 -0
- package/dist/lib/lint-runner.d.ts +10 -0
- package/dist/lib/manifest-config.d.ts +31 -0
- package/dist/lib/manifest-doc.d.ts +25 -0
- package/dist/lib/manifest.d.ts +41 -0
- package/dist/lib/markdown/assemble.d.ts +78 -0
- package/dist/lib/markdown/chapter-id.d.ts +24 -0
- package/dist/lib/markdown/images.d.ts +34 -0
- package/dist/lib/markdown/index.d.ts +78 -0
- package/dist/lib/markdown/markdown-it-paged.d.ts +30 -0
- package/dist/lib/markdown/plugins.d.ts +69 -0
- package/dist/lib/markdown/renderer.d.ts +111 -0
- package/dist/lib/npm-plugin-installer.d.ts +33 -0
- package/dist/lib/open-path.d.ts +5 -0
- package/dist/lib/output-paths.d.ts +23 -0
- package/dist/lib/pagedjs-marker.d.ts +42 -0
- package/dist/lib/pagedjs.d.ts +26 -0
- package/dist/lib/pagination.d.ts +169 -0
- package/dist/lib/pdf-inspect.d.ts +123 -0
- package/dist/lib/pdf-parse.d.ts +57 -0
- package/dist/lib/plugin-manager.d.ts +108 -0
- package/dist/lib/plugin-vendor.d.ts +107 -0
- package/dist/lib/presets.d.ts +45 -0
- package/dist/lib/printsafe.d.ts +17 -0
- package/dist/lib/project-scaffold.d.ts +116 -0
- package/dist/lib/project-source.d.ts +140 -0
- package/dist/lib/project-templates.d.ts +49 -0
- package/dist/lib/publish/butler.d.ts +10 -0
- package/dist/lib/publish/command-runner.d.ts +18 -0
- package/dist/lib/publish/connect.d.ts +23 -0
- package/dist/lib/publish/manifest-publish.d.ts +9 -0
- package/dist/lib/publish/providers/azure-swa.d.ts +3 -0
- package/dist/lib/publish/providers/drivethrurpg.d.ts +10 -0
- package/dist/lib/publish/providers/guided.d.ts +3 -0
- package/dist/lib/publish/providers/itch.d.ts +5 -0
- package/dist/lib/publish/providers/kdp.d.ts +9 -0
- package/dist/lib/publish/providers/shopify.d.ts +5 -0
- package/dist/lib/publish/registry.d.ts +5 -0
- package/dist/lib/publish/run-publish.d.ts +30 -0
- package/dist/lib/publish/selections.d.ts +25 -0
- package/dist/lib/publish/types.d.ts +258 -0
- package/dist/lib/remote-auth/clone.d.ts +87 -0
- package/dist/lib/remote-auth/conflict-resolution.d.ts +29 -0
- package/dist/lib/remote-auth/diagnose.d.ts +77 -0
- package/dist/lib/remote-auth/generic-auth.d.ts +97 -0
- package/dist/lib/remote-auth/git-http.d.ts +85 -0
- package/dist/lib/remote-auth/github-auth.d.ts +69 -0
- package/dist/lib/remote-auth/github-repos.d.ts +64 -0
- package/dist/lib/remote-auth/operation-log.d.ts +66 -0
- package/dist/lib/remote-auth/recovery/abort-interrupted-operation.d.ts +103 -0
- package/dist/lib/remote-auth/recovery/backup.d.ts +113 -0
- package/dist/lib/remote-auth/recovery/classify.d.ts +109 -0
- package/dist/lib/remote-auth/recovery/context.d.ts +47 -0
- package/dist/lib/remote-auth/recovery/dispatch.d.ts +33 -0
- package/dist/lib/remote-auth/recovery/failsafe.d.ts +33 -0
- package/dist/lib/remote-auth/recovery/inspect.d.ts +74 -0
- package/dist/lib/remote-auth/recovery/manual-guidance.d.ts +28 -0
- package/dist/lib/remote-auth/recovery/outcome-mapping.d.ts +58 -0
- package/dist/lib/remote-auth/recovery/policy.d.ts +47 -0
- package/dist/lib/remote-auth/recovery/recover-auth.d.ts +42 -0
- package/dist/lib/remote-auth/recovery/recover-binary-conflict.d.ts +37 -0
- package/dist/lib/remote-auth/recovery/recover-corrupt-index.d.ts +40 -0
- package/dist/lib/remote-auth/recovery/recover-detached-head.d.ts +70 -0
- package/dist/lib/remote-auth/recovery/recover-interrupted-cherry-pick.d.ts +23 -0
- package/dist/lib/remote-auth/recovery/recover-interrupted-merge.d.ts +28 -0
- package/dist/lib/remote-auth/recovery/recover-interrupted-rebase.d.ts +39 -0
- package/dist/lib/remote-auth/recovery/recover-merge-conflict.d.ts +34 -0
- package/dist/lib/remote-auth/recovery/recover-missing-git-dir.d.ts +37 -0
- package/dist/lib/remote-auth/recovery/recover-missing-objects.d.ts +56 -0
- package/dist/lib/remote-auth/recovery/recover-network.d.ts +34 -0
- package/dist/lib/remote-auth/recovery/recover-non-fast-forward.d.ts +27 -0
- package/dist/lib/remote-auth/recovery/recover-stale-lock.d.ts +76 -0
- package/dist/lib/remote-auth/recovery/recover-unrelated-histories.d.ts +44 -0
- package/dist/lib/remote-auth/recovery/recover-wrong-remote.d.ts +35 -0
- package/dist/lib/remote-auth/recovery/types.d.ts +235 -0
- package/dist/lib/remote-auth/resolution-plan.d.ts +64 -0
- package/dist/lib/remote-auth/sync-messages.d.ts +26 -0
- package/dist/lib/remote-auth/sync-types.d.ts +225 -0
- package/dist/lib/remote-auth/sync.d.ts +45 -0
- package/dist/lib/remote-auth/test-access.d.ts +47 -0
- package/dist/lib/remote-auth/test-support/git-http-server.d.ts +71 -0
- package/dist/lib/remote-auth/token-store.d.ts +95 -0
- package/dist/lib/remote-auth/transport.d.ts +105 -0
- package/dist/lib/slug.d.ts +28 -0
- package/dist/lib/snippets.d.ts +39 -0
- package/dist/lib/source-provider.d.ts +244 -0
- package/dist/lib/static-serve.d.ts +54 -0
- package/dist/lib/style-resolver.d.ts +30 -0
- package/dist/lib/theme-import.d.ts +70 -0
- package/dist/lib/theme-manager.d.ts +128 -0
- package/dist/lib/tool-probe.d.ts +37 -0
- package/dist/lib/validation-exec.d.ts +47 -0
- package/dist/lib/validation-profile.d.ts +18 -0
- package/dist/lib/version.d.ts +9 -0
- package/dist/lint-f63nxjfj.js +65 -0
- package/dist/manifest-n1gh3qw5.yaml +9 -0
- package/dist/manifest-ryyg71nf.yaml +9 -0
- package/dist/manifest.schema-rn1dpdpn.json +564 -0
- package/dist/new-7b08a42h.js +105 -0
- package/dist/paged.polyfill-n95pbxfn.js +33288 -0
- package/dist/pagedjs-bridge-vn4hk9fx.js +111 -0
- package/dist/pagedjs-interface-80g3xa8p.js +498 -0
- package/dist/platform.d.ts +100 -0
- package/dist/plugin-wf2cbmwc.js +129 -0
- package/dist/preflight-tg4mpz1h.js +222 -0
- package/dist/preview/file-watcher.d.ts +174 -0
- package/dist/preview/http-server.d.ts +45 -0
- package/dist/preview/lifecycle.d.ts +67 -0
- package/dist/preview/server-context.d.ts +36 -0
- package/dist/preview-h2bwbb2x.js +102 -0
- package/dist/preview-shell-rghtfmc8.js +155 -0
- package/dist/project-source-0tg0r6vm.js +17 -0
- package/dist/publish-ztaet53r.js +233 -0
- package/dist/render.d.ts +20 -0
- package/dist/render.js +682 -0
- package/dist/repair-jkp4n3j8.js +171 -0
- package/dist/schema/manifest.types.d.ts +218 -0
- package/dist/server.d.ts +34 -0
- package/dist/source-provider-hp96b5jf.js +46 -0
- package/dist/test-helpers/testkit.d.ts +91 -0
- package/dist/theme-0yzvthe8.css +65 -0
- package/dist/theme-570zmh2t.css +58 -0
- package/dist/theme-6a2fngc8.json +6 -0
- package/dist/theme-cd6efzjw.json +6 -0
- package/dist/theme-nya4nqh6.css +70 -0
- package/dist/theme-tqfypc1w.json +6 -0
- package/dist/theme-xt0hjb1b.json +6 -0
- package/dist/theme-zz2ktzqs.css +60 -0
- package/dist/types.d.ts +31 -0
- package/dist/utils/file-utils.d.ts +53 -0
- package/dist/utils/logger.d.ts +59 -0
- package/dist/validate-k2drs19j.js +99 -0
- package/package.json +102 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* =============================================================================
|
|
2
|
+
Technical Document — gutterpress built-in theme (theme.css)
|
|
3
|
+
Clean sans-serif manual look with clear hierarchy. Customize tokens in :root.
|
|
4
|
+
============================================================================= */
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--color-ink: #1c1e21; /* body text */
|
|
8
|
+
--color-ink-muted: #5a5f66; /* captions, secondary text */
|
|
9
|
+
--color-accent: #0b5fff; /* headings, links */
|
|
10
|
+
--color-paper: #ffffff; /* page background */
|
|
11
|
+
--color-tint: #f3f5f9; /* code / note fill */
|
|
12
|
+
--color-rule: #d6dae0; /* borders, rules */
|
|
13
|
+
|
|
14
|
+
--font-body: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
|
|
15
|
+
--font-display: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
|
|
16
|
+
--font-mono: "SFMono-Regular", "Consolas", "Menlo", monospace;
|
|
17
|
+
|
|
18
|
+
--scale-h1: 2.0rem;
|
|
19
|
+
--scale-h2: 1.45rem;
|
|
20
|
+
--scale-h3: 1.15rem;
|
|
21
|
+
--leading: 1.5;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@page {
|
|
25
|
+
size: 8.5in 11in;
|
|
26
|
+
margin: 0.9in 1in;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
body {
|
|
30
|
+
color: var(--color-ink);
|
|
31
|
+
background: var(--color-paper);
|
|
32
|
+
font-family: var(--font-body);
|
|
33
|
+
line-height: var(--leading);
|
|
34
|
+
font-size: 10.5pt;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
h1, h2, h3 {
|
|
38
|
+
font-family: var(--font-display);
|
|
39
|
+
color: var(--color-ink);
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
line-height: 1.25;
|
|
42
|
+
}
|
|
43
|
+
h1 { font-size: var(--scale-h1); margin: 0 0 0.5em; color: var(--color-accent); }
|
|
44
|
+
h2 { font-size: var(--scale-h2); margin: 1.4em 0 0.4em; border-bottom: 1px solid var(--color-rule); padding-bottom: 0.15em; }
|
|
45
|
+
h3 { font-size: var(--scale-h3); margin: 1.2em 0 0.3em; }
|
|
46
|
+
|
|
47
|
+
p { margin: 0 0 0.7em; }
|
|
48
|
+
|
|
49
|
+
a { color: var(--color-accent); text-decoration: none; }
|
|
50
|
+
|
|
51
|
+
code {
|
|
52
|
+
font-family: var(--font-mono); font-size: 0.88em;
|
|
53
|
+
background: var(--color-tint); padding: 0.1em 0.35em; border-radius: 3px;
|
|
54
|
+
}
|
|
55
|
+
pre {
|
|
56
|
+
font-family: var(--font-mono); font-size: 0.85em;
|
|
57
|
+
background: var(--color-tint); border: 1px solid var(--color-rule);
|
|
58
|
+
border-radius: 4px; padding: 0.7em 0.9em; overflow: auto;
|
|
59
|
+
}
|
|
60
|
+
pre code { background: none; padding: 0; }
|
|
61
|
+
|
|
62
|
+
table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95em; }
|
|
63
|
+
th, td { border: 1px solid var(--color-rule); padding: 0.4em 0.6em; text-align: left; }
|
|
64
|
+
th { background: var(--color-tint); font-weight: 600; }
|
|
65
|
+
|
|
66
|
+
blockquote {
|
|
67
|
+
margin: 1em 0; padding: 0.5em 0.9em;
|
|
68
|
+
background: var(--color-tint); border-left: 3px solid var(--color-accent);
|
|
69
|
+
color: var(--color-ink-muted);
|
|
70
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* =============================================================================
|
|
2
|
+
Zine — gutterpress built-in theme (theme.css)
|
|
3
|
+
High-contrast, punchy, photocopier-friendly. Customize the tokens in :root.
|
|
4
|
+
============================================================================= */
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--color-ink: #000000; /* body text */
|
|
8
|
+
--color-ink-muted: #333333; /* secondary text */
|
|
9
|
+
--color-accent: #000000; /* headings (mono, high ink) */
|
|
10
|
+
--color-paper: #ffffff; /* page background */
|
|
11
|
+
--color-rule: #000000; /* heavy borders, rules */
|
|
12
|
+
|
|
13
|
+
--font-body: "Helvetica Neue", "Arial", sans-serif;
|
|
14
|
+
--font-display: "Impact", "Haettenschweiler", "Arial Black", sans-serif;
|
|
15
|
+
--font-mono: "Courier New", monospace;
|
|
16
|
+
|
|
17
|
+
--scale-h1: 2.8rem;
|
|
18
|
+
--scale-h2: 1.8rem;
|
|
19
|
+
--scale-h3: 1.3rem;
|
|
20
|
+
--leading: 1.4;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@page {
|
|
24
|
+
size: 5.5in 8.5in;
|
|
25
|
+
margin: 0.4in;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
color: var(--color-ink);
|
|
30
|
+
background: var(--color-paper);
|
|
31
|
+
font-family: var(--font-body);
|
|
32
|
+
line-height: var(--leading);
|
|
33
|
+
font-size: 10pt;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h1, h2, h3 {
|
|
37
|
+
font-family: var(--font-display);
|
|
38
|
+
color: var(--color-accent);
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
letter-spacing: -0.01em;
|
|
41
|
+
line-height: 0.95;
|
|
42
|
+
font-weight: 900;
|
|
43
|
+
}
|
|
44
|
+
h1 { font-size: var(--scale-h1); margin: 0 0 0.4em; }
|
|
45
|
+
h2 { font-size: var(--scale-h2); margin: 1.1em 0 0.3em; }
|
|
46
|
+
h3 { font-size: var(--scale-h3); margin: 1em 0 0.25em; }
|
|
47
|
+
|
|
48
|
+
p { margin: 0 0 0.6em; }
|
|
49
|
+
|
|
50
|
+
a { color: var(--color-accent); text-decoration: underline; font-weight: 700; }
|
|
51
|
+
|
|
52
|
+
blockquote {
|
|
53
|
+
margin: 1em 0; padding: 0.5em 0.8em;
|
|
54
|
+
border: 2px solid var(--color-rule);
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
hr { border: 0; border-top: 3px solid var(--color-rule); margin: 1em 0; }
|
|
59
|
+
|
|
60
|
+
code, pre { font-family: var(--font-mono); font-size: 0.95em; }
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TypeScript interfaces for the Gutterpress CLI
|
|
3
|
+
*
|
|
4
|
+
* Core types used by the preview server and CLI commands.
|
|
5
|
+
* Build pipeline types are in src/schema/manifest.types.ts.
|
|
6
|
+
*/
|
|
7
|
+
export type { GutterpressManifest, ResolvedConfig } from './schema/manifest.types';
|
|
8
|
+
/**
|
|
9
|
+
* Options for preview server (internal)
|
|
10
|
+
*/
|
|
11
|
+
export interface PreviewServerOptions {
|
|
12
|
+
/** Input markdown file path or directory (optional, defaults to cwd) */
|
|
13
|
+
input?: string;
|
|
14
|
+
/** Debug mode (preserve temporary files) */
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
/** Port for preview server */
|
|
17
|
+
port: number;
|
|
18
|
+
/**
|
|
19
|
+
* Hostname to bind to. Defaults to `127.0.0.1` (localhost only).
|
|
20
|
+
* Pass `0.0.0.0` to expose the server on the local network — opt-in
|
|
21
|
+
* because the preview serves whatever the user is editing, which may
|
|
22
|
+
* include unfinished or private content.
|
|
23
|
+
*/
|
|
24
|
+
host: string;
|
|
25
|
+
/** Enable verbose logging */
|
|
26
|
+
verbose: boolean;
|
|
27
|
+
/** Disable file watching */
|
|
28
|
+
noWatch: boolean;
|
|
29
|
+
/** Automatically open browser (default: true) */
|
|
30
|
+
openBrowser: boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplified file utilities - core file I/O only
|
|
3
|
+
*
|
|
4
|
+
* Provides essential file operations: read, write, resolve paths, check existence
|
|
5
|
+
*/
|
|
6
|
+
import { type Dirent } from 'fs';
|
|
7
|
+
/**
|
|
8
|
+
* Read a file as UTF-8 text
|
|
9
|
+
* @throws Error if file doesn't exist or can't be read
|
|
10
|
+
*/
|
|
11
|
+
export declare function readFile(filePath: string): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Write content to a file, creating parent directories if needed
|
|
14
|
+
*/
|
|
15
|
+
export declare function writeFile(filePath: string, content: string): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Check if a file exists
|
|
18
|
+
*/
|
|
19
|
+
export declare function fileExists(filePath: string): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Remove a directory or file recursively
|
|
22
|
+
* Safe to call even if path doesn't exist
|
|
23
|
+
*/
|
|
24
|
+
export declare function remove(targetPath: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a directory, including parent directories if needed
|
|
27
|
+
*/
|
|
28
|
+
export declare function mkdir(dirPath: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Check if a path is a directory
|
|
31
|
+
*/
|
|
32
|
+
export declare function isDirectory(targetPath: string): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Read all files in a directory
|
|
35
|
+
* @param dirPath Directory path to read
|
|
36
|
+
* @returns Array of directory entries
|
|
37
|
+
*/
|
|
38
|
+
export declare function readDirectory(dirPath: string): Promise<Dirent[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Wait for a file to be created
|
|
41
|
+
* Polls for file existence with exponential backoff
|
|
42
|
+
*
|
|
43
|
+
* @param filePath - Path to file to wait for
|
|
44
|
+
* @param options - Configuration options
|
|
45
|
+
* @param options.timeout - Maximum wait time in milliseconds (default: 10000)
|
|
46
|
+
* @param options.interval - Initial polling interval in milliseconds (default: 10)
|
|
47
|
+
* @returns Promise that resolves when file exists
|
|
48
|
+
* @throws {Error} If timeout is reached before file appears
|
|
49
|
+
*/
|
|
50
|
+
export declare function waitForFile(filePath: string, options?: {
|
|
51
|
+
timeout?: number;
|
|
52
|
+
interval?: number;
|
|
53
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leveled logging utility for gutterpress.
|
|
3
|
+
*
|
|
4
|
+
* ONE logger for the whole CLI/lib. Two surfaces share a single level state:
|
|
5
|
+
*
|
|
6
|
+
* - Leveled free functions (`debug`/`info`/`warn`/`error`/`success`) —
|
|
7
|
+
* timestamped, gated by the current level. Used by the preview server
|
|
8
|
+
* internals. `--verbose`/`--debug` calls `setLogLevel('DEBUG')` so
|
|
9
|
+
* `debug()` lines become visible; by default (INFO) they are suppressed.
|
|
10
|
+
* - The `log` facade object (`log.info`/`log.warn`/`log.error`/`log.success`)
|
|
11
|
+
* — clean, prefix-styled command output used by the CLI commands and
|
|
12
|
+
* re-exported from `index.ts` for the desktop. Always emitted (it carries
|
|
13
|
+
* user-facing command results, not diagnostic chatter), preserving the
|
|
14
|
+
* historical `lib/logger` behavior verbatim.
|
|
15
|
+
*/
|
|
16
|
+
export type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
|
17
|
+
/**
|
|
18
|
+
* Set the current log level. Messages below this level will be suppressed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get the current log level.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getLogLevel(): LogLevel;
|
|
25
|
+
/**
|
|
26
|
+
* Log a debug message (only shown when log level is DEBUG).
|
|
27
|
+
*/
|
|
28
|
+
export declare function debug(message: string, ...args: unknown[]): void;
|
|
29
|
+
/**
|
|
30
|
+
* Log an info message (shown at INFO level and above).
|
|
31
|
+
*/
|
|
32
|
+
export declare function info(message: string, ...args: unknown[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Log a warning message (shown at WARN level and above).
|
|
35
|
+
*/
|
|
36
|
+
export declare function warn(message: string, ...args: unknown[]): void;
|
|
37
|
+
/**
|
|
38
|
+
* Log an error message (always shown).
|
|
39
|
+
*/
|
|
40
|
+
export declare function error(message: string, ...args: unknown[]): void;
|
|
41
|
+
/**
|
|
42
|
+
* Log a success message (shown at INFO level and above).
|
|
43
|
+
*/
|
|
44
|
+
export declare function success(message: string, ...args: unknown[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Silence all logs (useful for testing).
|
|
47
|
+
* Sets to a level higher than WARN so only ERROR still shows.
|
|
48
|
+
*/
|
|
49
|
+
export declare function silence(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Reset to default log level (INFO).
|
|
52
|
+
*/
|
|
53
|
+
export declare function reset(): void;
|
|
54
|
+
export declare const log: {
|
|
55
|
+
info(msg: string, ...args: unknown[]): void;
|
|
56
|
+
warn(msg: string, ...args: unknown[]): void;
|
|
57
|
+
error(msg: string, ...args: unknown[]): void;
|
|
58
|
+
success(msg: string, ...args: unknown[]): void;
|
|
59
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
executeAndReport
|
|
3
|
+
} from "./cli-7ykx7pp0.js";
|
|
4
|
+
import {
|
|
5
|
+
log
|
|
6
|
+
} from "./cli-h7phg3ka.js";
|
|
7
|
+
import {
|
|
8
|
+
EXIT_CODES,
|
|
9
|
+
UsageError,
|
|
10
|
+
rejectExtraPositionals,
|
|
11
|
+
rejectUnknownFlags
|
|
12
|
+
} from "./cli-hvqjs342.js";
|
|
13
|
+
import"./cli-5bxx0c4y.js";
|
|
14
|
+
import"./cli-1tyj4bk3.js";
|
|
15
|
+
import"./cli-yja077f6.js";
|
|
16
|
+
import"./cli-37x76zdn.js";
|
|
17
|
+
|
|
18
|
+
// src/commands/validate.ts
|
|
19
|
+
import { defineCommand } from "citty";
|
|
20
|
+
var commandArgs = {
|
|
21
|
+
dir: {
|
|
22
|
+
type: "positional",
|
|
23
|
+
description: "Project directory (default: cwd). Sets the pre-build source directory unless --input is also given.",
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
pdf: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Path to the PDF file to validate (post-build checks)"
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Source directory for pre-build checks (overrides the positional directory)"
|
|
33
|
+
},
|
|
34
|
+
manifest: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Path to manifest.yaml"
|
|
37
|
+
},
|
|
38
|
+
category: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Comma-separated categories: source, pdf, asset, heuristic"
|
|
41
|
+
},
|
|
42
|
+
only: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Run only these check IDs/selectors (comma-separated)"
|
|
45
|
+
},
|
|
46
|
+
skip: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Skip these check IDs/selectors (comma-separated)"
|
|
49
|
+
},
|
|
50
|
+
format: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: "Output format: text (default) or json"
|
|
53
|
+
},
|
|
54
|
+
phase: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Run checks for phase: pre | post | all | pre-build | post-build (default: all)"
|
|
57
|
+
},
|
|
58
|
+
profile: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Validation profile lock (currently: dtrpg)"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var validate_default = defineCommand({
|
|
64
|
+
meta: {
|
|
65
|
+
name: "validate",
|
|
66
|
+
description: "Validate source files and/or PDF for print compliance"
|
|
67
|
+
},
|
|
68
|
+
args: commandArgs,
|
|
69
|
+
async run({ args, rawArgs }) {
|
|
70
|
+
const format = args.format === "json" ? "json" : "text";
|
|
71
|
+
const positionalDir = typeof args.dir === "string" ? args.dir : undefined;
|
|
72
|
+
const inputFlag = typeof args.input === "string" ? args.input : undefined;
|
|
73
|
+
const input = inputFlag ?? positionalDir;
|
|
74
|
+
let result;
|
|
75
|
+
try {
|
|
76
|
+
rejectUnknownFlags(rawArgs, commandArgs, "validate");
|
|
77
|
+
rejectExtraPositionals(args._, 1, "validate");
|
|
78
|
+
result = await executeAndReport({
|
|
79
|
+
manifest: typeof args.manifest === "string" ? args.manifest : undefined,
|
|
80
|
+
pdf: typeof args.pdf === "string" ? args.pdf : undefined,
|
|
81
|
+
input,
|
|
82
|
+
category: typeof args.category === "string" ? args.category : undefined,
|
|
83
|
+
only: typeof args.only === "string" ? args.only : undefined,
|
|
84
|
+
skip: typeof args.skip === "string" ? args.skip : undefined,
|
|
85
|
+
phase: typeof args.phase === "string" ? args.phase : undefined,
|
|
86
|
+
profile: typeof args.profile === "string" ? args.profile : undefined
|
|
87
|
+
}, format);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
log.error(error instanceof Error ? error.message : String(error));
|
|
90
|
+
process.exit(error instanceof UsageError ? error.exitCode : EXIT_CODES.USAGE);
|
|
91
|
+
}
|
|
92
|
+
if (!result.ok) {
|
|
93
|
+
process.exit(EXIT_CODES.FINDINGS);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
export {
|
|
98
|
+
validate_default as default
|
|
99
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gutterpress",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Markdown-to-PDF converter for professional print layout using Paged.js and Ghostscript.",
|
|
5
|
+
"author": "itlackey",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"markdown",
|
|
9
|
+
"pdf",
|
|
10
|
+
"print",
|
|
11
|
+
"pagedjs",
|
|
12
|
+
"ghostscript",
|
|
13
|
+
"book",
|
|
14
|
+
"publishing",
|
|
15
|
+
"ttrpg"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/dimm-city/gutterpress.git"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/dimm-city/gutterpress#readme",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/dimm-city/gutterpress/issues"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"bin": {
|
|
29
|
+
"gutterpress": "./dist/cli.js"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./api": {
|
|
37
|
+
"types": "./dist/api/index.d.ts",
|
|
38
|
+
"default": "./dist/api/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./render": {
|
|
41
|
+
"types": "./dist/render.d.ts",
|
|
42
|
+
"default": "./dist/render.js"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist/",
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build:library": "rimraf dist && bun build src/index.ts src/api/index.ts --target=node --packages=external --splitting --outdir=dist && bun build src/render.ts --target=node --packages=external --outdir=dist && node scripts/check-render-pure.mjs && tsc -p tsconfig.build.json",
|
|
52
|
+
"build": "bun run build:library && bun build src/cli.ts --target=node --packages=external --splitting --outdir=dist",
|
|
53
|
+
"prepublishOnly": "bun run build",
|
|
54
|
+
"test": "bun test",
|
|
55
|
+
"typecheck": "tsc --noEmit"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"bun": ">=1.0.0",
|
|
59
|
+
"node": ">=22.0.0"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"acorn": "8.16.0",
|
|
63
|
+
"chokidar": "^5.0.0",
|
|
64
|
+
"citty": "^0.2.0",
|
|
65
|
+
"diff3": "0.0.3",
|
|
66
|
+
"es-module-lexer": "2.0.0",
|
|
67
|
+
"fflate": "0.8.3",
|
|
68
|
+
"glob": "^13.0.0",
|
|
69
|
+
"htmlhint": "^1.9.2",
|
|
70
|
+
"isomorphic-git": "^1.38.4",
|
|
71
|
+
"markdown-it": "^14.1.0",
|
|
72
|
+
"markdown-it-abbr": "^2.0.0",
|
|
73
|
+
"markdown-it-attrs": "^4.3.0",
|
|
74
|
+
"markdown-it-deflist": "^3.0.1",
|
|
75
|
+
"markdown-it-footnote": "^4.0.0",
|
|
76
|
+
"markdown-it-mark": "^4.0.0",
|
|
77
|
+
"markdown-it-source-map": "^0.1.1",
|
|
78
|
+
"markdown-it-sub": "^2.0.0",
|
|
79
|
+
"markdown-it-sup": "^2.0.0",
|
|
80
|
+
"markdownlint": "^0.40.0",
|
|
81
|
+
"pdf-lib": "^1.17.1",
|
|
82
|
+
"postcss": "^8.5.18",
|
|
83
|
+
"puppeteer-core": "^25.0.4",
|
|
84
|
+
"resolve.exports": "2.0.3",
|
|
85
|
+
"semver": "7.8.0",
|
|
86
|
+
"tar": "7.5.20",
|
|
87
|
+
"unpdf": "^1.6.2",
|
|
88
|
+
"ws": "^8.21.0",
|
|
89
|
+
"yaml": "^2.8.2"
|
|
90
|
+
},
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@types/bun": "latest",
|
|
93
|
+
"@types/markdown-it": "^14.1.2",
|
|
94
|
+
"@types/node": "^22.0.0",
|
|
95
|
+
"@types/semver": "^7.7.1",
|
|
96
|
+
"@types/ws": "^8.5.13",
|
|
97
|
+
"pagedjs": "^0.4.3",
|
|
98
|
+
"playwright": "^1.60.0",
|
|
99
|
+
"rimraf": "^6.0.0",
|
|
100
|
+
"typescript": "^5"
|
|
101
|
+
}
|
|
102
|
+
}
|