Skip to content

fix: vendor web-shared via git subtree, unblock frontend build#2

Merged
davidfic merged 4 commits intomainfrom
fix/vendor-web-shared-via-subtree
Apr 15, 2026
Merged

fix: vendor web-shared via git subtree, unblock frontend build#2
davidfic merged 4 commits intomainfrom
fix/vendor-web-shared-via-subtree

Conversation

@davidfic
Copy link
Copy Markdown
Contributor

Summary

Unblocks haul's frontend build step (inside the docker image build) which was failing with:

```
Failed to resolve import "@beacon-shared/..."
```

Same structural issue as pilot's and prism's parallel PRs — a sibling-directory path alias in `vite.config.ts` that resolved locally but not on GitHub runners. Haul has no standalone frontend test job, so the failure only surfaced in the docker build stage.

What this PR does

  1. Pulls `beacon-stack/web-shared` into `web/ui/src/shared/` via `git subtree add --prefix=web/ui/src/shared https://github.com/beacon-stack/web-shared.git main --squash`.
  2. Rewires the Vite alias and the `tsconfig.json` `paths` map from `../../../web-shared` → `./src/shared`.

Zero import changes in any haul source file.

Verification

```
cd web/ui && npm run build # ✓ 1.36s clean
```

Why subtree

Same reasoning as the pilot and prism parallel PRs. Short version: `web-shared` ships `.tsx` source, a real published package needs build + `exports` map + `peerDependencies`, and the existing React singleton hack gets harder when the dep resolves via `node_modules`. Full decision trail is in beacon-stack/pilot#2.

Test plan

  • CI `Build` job green
  • CI `Lint` job green
  • Go `Test` job — will still be red on pre-existing failures (`TestSession_Peers_IncludesConnectedPeer`, `TestPieceCompletionSurvivesRestart`). Those are separate bug-fix PRs coming next.

davidfic and others added 4 commits April 15, 2026 07:57
git-subtree-dir: web/ui/src/shared
git-subtree-split: a5195d42958310e8d1cbc14a7d5349d30115b251
Previously web/ui/vite.config.ts and tsconfig.json resolved
@beacon-shared/* via a path relative to a sibling directory outside
the haul repo:

    "@beacon-shared": "../../../web-shared"

That only worked on the author's laptop and broke the docker build
stage on CI, which runs `npm run build` inside the Dockerfile as
part of image creation. Haul has no standalone frontend test job, so
the failure only surfaced in the docker job and was easy to miss
among the Go-side test failures — but the structural problem is the
same as pilot and prism got hit by this week.

Vendors web-shared into haul's tree at web/ui/src/shared/ via
`git subtree add --prefix=web/ui/src/shared
https://github.com/beacon-stack/web-shared.git main --squash` (the
parent commit on this branch), then rewires the Vite alias and the
tsconfig path map to point at the vendored copy.

No import changes in any haul source file — every existing
`import X from "@beacon-shared/Y"` still resolves correctly.

Same architectural reasoning as pilot and prism's parallel PRs:
subtree over published npm package because web-shared ships .tsx
source, a real package needs build/exports/peerDeps, and the React
singleton hack gets harder when the dep is installed via npm instead
of aliased in-tree.

Verified: `npm run build` succeeds cleanly in 1.36s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
haul depends on anacrolix/torrent which transitively pulls in a large
DHT/BitTorrent package tree. golangci-lint's default context-load
timeout (1 minute) is long enough for most Go projects but trips on
haul with a misleading "JSON decoding failed: unexpected EOF" error
that actually means "context load timeout hit mid-flight, partial
JSON response truncated."

Bump the timeout to 5m. Real linting is still sub-minute; the extra
buffer is for the initial package graph construction only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davidfic davidfic merged commit 7d22ee9 into main Apr 15, 2026
6 checks passed
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.

1 participant