Repository navigation
Refactor PDF build into three named commands with reviewer tracking - #270
Merged
Merged
Conversation
added 5 commits
October 5, 2026 18:17
build-pdf-print is the KDP interior (final, no cover, no links), build-pdf-digital the finished book for screens (final, cover and links), and build-pdf-draft an advance copy that now requires --reviewer, which replaces REVIEWER_NAME. Each writes its own file in build/, so the print interior and each reviewer's copy no longer overwrite the digital edition. resize-cover reads its page count from the print interior, the file actually uploaded; preview reads the digital edition, which is now the pre-push build. Claude-Session: https://claude.ai/code/session_01KtTPqhYezQFvpkDqQFUUVT
"Print" read as both the book Amazon prints and a page run off an office printer. The KDP build is now build-pdf-paperback, writing the paperback interior, and the page size it is laid out at is --size trim. Claude-Session: https://claude.ai/code/session_01KtTPqhYezQFvpkDqQFUUVT
build-pdf-paperback now runs resize-cover straight after the interior, so one command produces both files KDP takes and the spine is always sized from the interior just built. resize-cover still runs alone for --paper cream or --pages. Claude-Session: https://claude.ai/code/session_01KtTPqhYezQFvpkDqQFUUVT
Nothing ran or documented it. Rendering a page of a built PDF to PNG is what npm run preview does, finding the page by a phrase rather than a number that drifts between builds. Claude-Session: https://claude.ai/code/session_01KtTPqhYezQFvpkDqQFUUVT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the single
build-pdfcommand with three purpose-specific commands:build-pdf-digitalfor the finished book with cover and links,build-pdf-printfor the KDP interior without cover or links, andbuild-pdf-draftfor advance review copies. This makes the build process clearer and eliminates environment variable combinations.Key changes:
--reviewer "<name>"flag tobuild-pdf.mjsto replace theREVIEWER_NAMEenvironment variable, making reviewer tracking explicit in the command line--reviewerand final builds refuse it, preventing accidental misconfigurations(draft, reviewer-name),(print interior)) so multiple builds coexist inbuild/without overwritingpackage.json:build-pdf-digital:FINAL=1 node scripts/build-pdf.mjs(finished book)build-pdf-print:FINAL=1 NO_COVER=1 NO_LINKS=1 node scripts/build-pdf.mjs(KDP interior)build-pdf-draft:node scripts/build-pdf.mjs(advance copy, requires--reviewer)PRINT-SPECIFICATION.md,README.md, andCLAUDE.mdto reflect the new command structurescripts/resize-cover.mjsto read page count from the print interior build specificallyscripts/preview-page.mjsto clarify it works with the digital editionThe refactoring makes the three distinct build purposes explicit in the command names rather than hidden in environment variable combinations, and moves reviewer identification from an environment variable to a required command-line flag for draft builds.
https://claude.ai/code/session_01KtTPqhYezQFvpkDqQFUUVT