Three copies of popup.html and options.html exist in the repo today:
packages/extension-shared/src/popup.html (canonical)
packages/extension-chrome/src/popup.html (Vite entry for the Chrome shell)
packages/extension-firefox/src/popup.html (Vite entry for the Firefox shell)
Same for options.html. Identical content; updating one and forgetting the others silently drifts.
Why three copies
Vite needs HTML as a build entry. The shells' vite.config.ts files point at their own src/*.html, so the files must physically exist in each shell. We can't currently reach into the workspace dep's HTML via a Vite entry path.
Options
- Pre-build script in each shell that copies from
@gitmarks/extension-shared/src/*.html → its own src/*.html before vite build runs. Authoritative source stays in the shared package; the copies become build artifacts (gitignored).
- Point Vite entries at
node_modules/@gitmarks/extension-shared/src/popup.html directly (works in pnpm because of workspace symlinks, but breaks if anyone materializes deps without symlinks).
- Templated HTML — generate the file at build time from a TS module in extension-shared.
(1) is the lowest-friction. Probably a 30-line script per shell.
Flagged by
Post-merge code review of PR #32.
Three copies of
popup.htmlandoptions.htmlexist in the repo today:packages/extension-shared/src/popup.html(canonical)packages/extension-chrome/src/popup.html(Vite entry for the Chrome shell)packages/extension-firefox/src/popup.html(Vite entry for the Firefox shell)Same for
options.html. Identical content; updating one and forgetting the others silently drifts.Why three copies
Vite needs HTML as a build entry. The shells'
vite.config.tsfiles point at their ownsrc/*.html, so the files must physically exist in each shell. We can't currently reach into the workspace dep's HTML via a Vite entry path.Options
@gitmarks/extension-shared/src/*.html→ its ownsrc/*.htmlbeforevite buildruns. Authoritative source stays in the shared package; the copies become build artifacts (gitignored).node_modules/@gitmarks/extension-shared/src/popup.htmldirectly (works in pnpm because of workspace symlinks, but breaks if anyone materializes deps without symlinks).(1) is the lowest-friction. Probably a 30-line script per shell.
Flagged by
Post-merge code review of PR #32.