Skip to content

Removed @tryghost/parse-email-address from pnpm dev fan-out#28969

Merged
9larsons merged 1 commit into
mainfrom
drop-parse-email-address-from-dev-fanout
Jun 29, 2026
Merged

Removed @tryghost/parse-email-address from pnpm dev fan-out#28969
9larsons merged 1 commit into
mainfrom
drop-parse-email-address-from-dev-fanout

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

@tryghost/parse-email-address is a 20-line workspace package wrapping the npm parse-email-address module. Its dev script runs tsc --watch continuously, emitting build/index.js and build/index.d.ts (~145 MB RSS for the tsc process, plus ~145 MB of Nx run-executor + pnpm wrapper overhead).

None of that output is consumed in dev. The package's package.json exports declares:

"exports": {
  ".": {
    "source": "./src/index.ts",
    "types": "./build/index.d.ts",
    "default": "./build/index.js"
  }
}

ghost/core runs with node --conditions=source --import=tsx (see ghost/core/nodemon.json), so the source condition wins and ghost/core imports the .ts source directly via tsx. The build/ output is purely a production artifact, never read at dev time. tsc --watch was running for nothing.

Change

Drop @tryghost/parse-email-address from docker:dev's dependsOn list in the root package.json. Saves ~290 MB RSS and one process per pnpm dev session.

pnpm --filter @tryghost/parse-email-address dev still works for solo work on the package itself. CI builds (which need build/) are unaffected since they invoke build targets directly.

@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: 842e913b-0062-4bdc-912a-110da2f66b39

📥 Commits

Reviewing files that changed from the base of the PR and between f9c264e and b0009a0.

📒 Files selected for processing (2)
  • ghost/parse-email-address/package.json
  • package.json

Walkthrough

A prepare script (pnpm build) is added to ghost/parse-email-address/package.json so the package builds automatically on install. Correspondingly, @tryghost/parse-email-address is removed from the nx.targets.docker:dev.dependsOn projects list in the root package.json, since the build is now handled by the lifecycle script rather than the nx pipeline.

Possibly related PRs

  • TryGhost/Ghost#28842: Modifies the same ghost/parse-email-address/package.json export configuration for the same package.
  • TryGhost/Ghost#28844: Removes the root pnpm build step from pnpm setup, coordinating with where package builds are triggered across the workspace.
  • TryGhost/Ghost#28902: Also modifies nx.targets.docker:dev.dependsOn in the root package.json.

Suggested reviewers

  • EvanHahn
  • jonatansberg
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: removing @tryghost/parse-email-address from the pnpm dev fan-out.
Description check ✅ Passed The description is directly related to the change and explains why the package was removed from dev fan-out.
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 drop-parse-email-address-from-dev-fanout

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 b0009a0

Command Status Duration Result
nx run ghost:test:legacy ✅ Succeeded 1m 24s View ↗

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


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

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.31%. Comparing base (41355a4) to head (b0009a0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #28969      +/-   ##
==========================================
+ Coverage   74.28%   74.31%   +0.03%     
==========================================
  Files        1562     1562              
  Lines      135348   135348              
  Branches    16447    16450       +3     
==========================================
+ Hits       100548   100589      +41     
+ Misses      33802    33761      -41     
  Partials      998      998              
Flag Coverage Δ
e2e-tests 76.46% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

parse-email-address is a 20-line workspace package wrapping the npm
parse-email-address module. Its dev script ran tsc --watch continuously
(~145 MB RSS, plus another ~145 MB of Nx run-executor + pnpm wrapper
overhead) to emit build/index.js + build/index.d.ts.

ghost/core runs with node --conditions=source --import=tsx (see
ghost/core/nodemon.json), so its runtime imports resolve through the
source export condition and load src/index.ts directly via tsx —
build/ is never read at runtime. But ghost/core type-checks against
the package types field, which points at build/index.d.ts, so a
fresh clone with no build/ would break editor type resolution.

Added a prepare script to parse-email-address so pnpm install builds
build/ once. tsconfig.tsbuildinfo and build/ are both gitignored, so a
true fresh clone always triggers the build. Source edits to this
package require a manual rebuild (or pnpm --filter @tryghost/parse-email-address
dev) — acceptable for a tiny rarely-touched package.

Net savings: 1 host process and ~290 MB RSS per dev session.

no ref
@9larsons 9larsons force-pushed the drop-parse-email-address-from-dev-fanout branch from 88d356b to b0009a0 Compare June 29, 2026 18:44
@9larsons 9larsons requested a review from acburdine June 29, 2026 18:47
@9larsons 9larsons marked this pull request as ready for review June 29, 2026 18:47
@9larsons 9larsons requested a review from EvanHahn as a code owner June 29, 2026 18:48
@9larsons

9larsons commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

I think this breaks Docker build as-is. Looking. edit: specifically the prepare, but I don't think we need that since the lint command runs build for this package...

@9larsons 9larsons enabled auto-merge (squash) June 29, 2026 19:26
@9larsons 9larsons merged commit f8d6c3a into main Jun 29, 2026
88 of 90 checks passed
@9larsons 9larsons deleted the drop-parse-email-address-from-dev-fanout branch June 29, 2026 19:59
9larsons added a commit that referenced this pull request Jun 29, 2026
…28972)

ref #28969

Removed the prepare hook.

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.
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