Skip to content

Removed parse-email-address prepare hook that broke Docker dev build#28972

Merged
9larsons merged 1 commit into
mainfrom
fix-parse-email-prepare-docker
Jun 29, 2026
Merged

Removed parse-email-address prepare hook that broke Docker dev build#28972
9larsons merged 1 commit into
mainfrom
fix-parse-email-prepare-docker

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

Problem

The prepare: pnpm build script added in #28969 runs during pnpm install, including inside the ghost-dev Docker image build. That build stage only copies workspace package.json files into the image (not src/ directories), so tsc finds no input files, prints help output, and exits 1. Docker build fails, pnpm dev cannot start.

Fix

Removed the prepare hook. One-line change.

Type-resolution gap

The original motivation for adding prepare: ghost/core type-checks against parse-email-address types at build/index.d.ts. Without prepare, a fresh-clone dev session has no build/ until a manual build runs. Today this is mitigated by ghost/core's lint:types script which explicitly builds parse-email-address first, and by anyone who has ever run pnpm dev in the old fan-out (which kept tsc --watch running). A cleaner fix to track separately: expose src/index.ts as the types path in the exports field so node10 resolution doesn't need a build artifact.

ref #28969

The prepare: pnpm build script (added in #28969) runs during pnpm
install, including inside the ghost-dev Docker image build. That stage
only copies workspace package.json files into the image (not src/),
so tsc finds no input files and exits 1 with help output. Docker build
fails, pnpm dev cannot start.

Removed the prepare hook. Type resolution for the build/index.d.ts
output still works for developers who have run a prior build (pnpm
build inside ghost/parse-email-address) or who run ghost/core lint:types
(which explicitly builds parse-email-address first). A more robust fix
for the type-resolution gap would be to surface src as the types path
in the exports field; tracking separately.

ref #28969

no ref
@9larsons 9larsons requested a review from EvanHahn as a code owner June 29, 2026 20:11
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f2ba1987-dcb3-4dd5-91b1-f71eb4ac9013

📥 Commits

Reviewing files that changed from the base of the PR and between f8d6c3a and 811d866.

📒 Files selected for processing (1)
  • ghost/parse-email-address/package.json
💤 Files with no reviewable changes (1)
  • ghost/parse-email-address/package.json

Walkthrough

The prepare script is removed from ghost/parse-email-address/package.json, eliminating the automatic pnpm build step that previously ran during the package's install/prepare lifecycle. All other scripts (dev, build, build:tsc, test, lint) remain unchanged.

Possibly related PRs

  • TryGhost/Ghost#28844: Directly related — targets elimination of workspace build-on-setup, which aligns with removing the prepare script from @tryghost/parse-email-address.
  • TryGhost/Ghost#28847: Related — adjusts lint:types to explicitly build @tryghost/parse-email-address before type-checking, compensating for when the prepare step is absent.
  • TryGhost/Ghost#28969: Directly related — also modifies the scripts section of ghost/parse-email-address/package.json around the prepare script.

Suggested reviewers

  • EvanHahn
  • acburdine
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: removing the parse-email-address prepare hook that broke Docker dev builds.
Description check ✅ Passed The description directly explains the Docker build failure and the one-line fix, matching the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-parse-email-prepare-docker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jun 29, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 811d866

Command Status Duration Result
nx run ghost:test:integration ✅ Succeeded 2m 45s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 3s View ↗
nx run ghost:test:legacy ✅ Succeeded 2m 52s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 30s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded 1s View ↗
nx run-many -t test:unit -p @tryghost/parse-ema... ✅ Succeeded 3s View ↗
nx run @tryghost/admin:build ✅ Succeeded 5s View ↗
nx run-many -t lint -p @tryghost/parse-email-ad... ✅ Succeeded <1s View ↗
Additional runs (2) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-29 20:19:28 UTC

@9larsons 9larsons enabled auto-merge (squash) June 29, 2026 20:15
@9larsons 9larsons merged commit cc949c3 into main Jun 29, 2026
44 checks passed
@9larsons 9larsons deleted the fix-parse-email-prepare-docker branch June 29, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants