Skip to content

refactor(web): rename packages/documents to packages/web, fix the broken Pages deploy - #918

Merged
Mearman merged 3 commits into
mainfrom
refactor/rename-documents-package-to-web
Sep 4, 2026
Merged

refactor(web): rename packages/documents to packages/web, fix the broken Pages deploy#918
Mearman merged 3 commits into
mainfrom
refactor/rename-documents-package-to-web

Conversation

@Mearman

@Mearman Mearman commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

packages/documents (the private, unpublished web UI) and packages/documents.js (the published conversion-engine package) were one character apart and easy to confuse. This renames the web UI's directory and npm package name to web, and fixes a real production bug it surfaced along the way: exadev.github.io/documents.js/ has been serving a blank page, because vite.config.ts hardcoded the Pages base path as /documents/ -- the directory's old name -- so every JS/CSS/manifest asset the build emitted 404'd.

Three commits:

  1. refactor: rename packages/documents to packages/web -- the directory/package rename and every reference to it across the workspace (package.json, README badge, ci.yml, root README, knip.config.ts, turbo.json's five package-scoped task keys, SECURITY.md, document-compute.js's README, both issue templates), plus a web@2.3.1 tag seeded on the same commit documents@2.3.1 already tags, so the release orchestrator's next run finds real release history instead of computing a first release and downgrading the version to 1.0.0.
  2. fix(web): derive the GitHub Pages base path from GITHUB_REPOSITORY -- the actual bug fix. The base path is now derived from the deploying repository's own name (with a git-remote fallback) rather than a hardcoded literal, so a future rename can't silently reintroduce the same class of bug.
  3. ci: verify the deployed Pages site's own assets actually resolve -- a new job that fetches the live deployed HTML after every Pages deploy and confirms every script/stylesheet/icon/manifest it references actually resolves, rather than only checking that the root HTML itself returns 200 (which is exactly the check that already passed while the site was broken).

Verified the fix end-to-end: building locally with CI=1 GITHUB_REPOSITORY=ExaDev/documents.js now emits /documents.js/... asset paths in dist/index.html, matching what Pages actually serves this repo at.

One deliberate non-change: the PWA manifest's app name/short_name still say "documents" -- that's the product name shown to end users installing the PWA, not the package name, and renaming the package doesn't imply renaming the product.

Test plan

  • pnpm exec eslint . --cache --max-warnings 0 -- whole workspace, clean
  • pnpm exec turbo run _typecheck _build _test --filter=web -- clean
  • pnpm exec turbo run _knip _typecheck --filter=// -- clean
  • git grep -n "packages/documents\b" (excluding packages/documents.js) -- zero remaining references
  • Local build with CI=1 GITHUB_REPOSITORY=ExaDev/documents.js -- confirmed every emitted asset path is /documents.js/...
  • YAML validity check on the modified ci.yml
  • CI green on this PR (exercises the same pre-push hook checks plus the new verify-deployed-site job against a real deploy once merged to main)

packages/documents (the private, unpublished web UI) and packages/documents.js
(a different, published package -- the conversion engine) were one character
apart and easy to confuse. Renaming the web UI's own directory and npm package
name to "web" removes that collision.

Updates every reference to the old path and package name across the
workspace: package.json (name/repository.directory/homepage), the README
badge, ci.yml's deploy-site job, the root README's package table and turbo
examples, knip.config.ts's workspace-scoped entry, turbo.json's five
package-scoped task keys, SECURITY.md, document-compute.js's README, and the
two issue templates' package dropdowns.

pnpm-lock.yaml is regenerated via a real pnpm install rather than hand-edited;
alongside the renamed importer key, that install also picked up picomatch and
fdir refreshing to their current allowed versions -- an ordinary side effect
of a full install, not something worth fighting to exclude from a
freshly-regenerated lockfile.

Also seeds a web@2.3.1 tag on the same commit documents@2.3.1 already tags:
the release orchestrator finds a package's last release by its newest
matching tag, and without this the very next release would see no prior
web@ tag at all, compute a first release, and write 1.0.0 into
packages/web/package.json -- a real version downgrade from today's 2.3.2 and
a restarted changelog, even though nothing about the package's own release
history actually changed.
vite.config.ts hardcoded the Pages base path as "/documents/", the
directory's old name. Every asset the build emitted therefore linked
to a path GitHub Pages was no longer serving, and the deployed site
at exadev.github.io/documents.js loaded a blank page: the root HTML
returned 200, but every JS/CSS/manifest URL inside it 404'd.

Deriving the path segment from GITHUB_REPOSITORY (owner/repo, set
automatically by every Actions run), falling back to the name parsed
from the git remote for a context where that variable is unset,
removes the class of bug entirely -- a repo rename can no longer
leave a stale literal behind for a future build to silently ship.

parseGitHubRepoUrl is renamed to parseGitHubRepo and now returns both
the repo name and the full URL, since __APP_REPO_URL__ already needed
the URL and the base path now needs the bare name from the same
parse.
deploy-site's own success only proves actions/deploy-pages accepted
the upload -- it says nothing about whether the page GitHub Pages now
serves actually works. The base-path bug this branch fixes shipped
past every existing check for exactly that reason: the root HTML
returned 200 while every asset it referenced 404'd.

The new job fetches the live deployed HTML, extracts every script,
stylesheet, icon, and manifest URL it references, and fetches each
one individually. Named distinctly from the pre-existing test-smoke
job (that one exercises each package's own built dist/ as a local
artifact; this one exercises the live Pages deployment over the
network) so a failure in either is unambiguous about which broke.
@Mearman
Mearman marked this pull request as ready for review September 4, 2026 17:52
@Mearman
Mearman merged commit 3888bd1 into main Sep 4, 2026
18 checks passed
@Mearman
Mearman deleted the refactor/rename-documents-package-to-web branch September 4, 2026 17:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-04T17:56:11.036146Z 54d7b3f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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