Split tarball hosting out of docs into its own project#1893
Conversation
The docs project was incidentally hosting preview tarballs because of a prebuild step that ran scripts/pack.ts and dumped *.tgz into docs/public/. Move all of that — pack script, smoke checks, gitignore entries, the .tgz proxy matcher exception — into a new top-level `tarballs/` workspace package that deploys as its own static Vercel project (framework: null, outputDirectory: public). Also fix a long-standing oddity in pack.ts where restoring the package.json after `pnpm pack` dropped the trailing newline because the original was rebuilt with JSON.stringify rather than the source bytes. The new version stores the raw original content and writes it back verbatim. Adds .github/workflows/tarballs-checks.yml that waits for the workflow-tarballs Vercel project and runs the new smoke script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 76406b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🧪 E2E Test Results✅ All tests passed Summary
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ 📋 Other
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 10 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 25 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 50 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 10 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express workflow with 25 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 50 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express stream pipeline with 5 transform steps (1MB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) 10 parallel streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro fan-out fan-in 10 streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
…ment, but tarballs are no longer served from docs after being split into a separate project, causing 404s for install commands. This commit fixes the issue reported at docs/app/[lang]/(home)/components/preview-badge.tsx:70 **Bug explanation:** The PR (commit 98d97cd) split tarball hosting out of the docs project into a new top-level `tarballs/` workspace that deploys as its own Vercel project (`workflow-tarballs`). This involved: 1. Moving `docs/scripts/pack.ts` → `tarballs/scripts/pack.ts` 2. Removing the `prebuild` script from `docs/package.json` (which previously ran `pack.ts` and placed `.tgz` files into `docs/public/`) 3. Removing the `.tgz` exclusion from the docs proxy middleware matcher 4. Creating `tarballs/vercel.json` for the new static Vercel project However, the `PreviewBadge` component at `docs/app/[lang]/(home)/components/preview-badge.tsx` was NOT updated. It still constructs tarball URLs using `deploymentUrl` which comes from the docs project's `VERCEL_URL`: ``` const baseUrl = deploymentUrl.replace(//$/, ''); const installCmd = `pnpm i ${baseUrl}/workflow.tgz`; ``` Since the docs deployment no longer serves `.tgz` files (no pack script runs, no tarballs in `docs/public/`, proxy middleware no longer excludes `.tgz`), these URLs will 404. Users clicking the Preview badge and copying the install command will get broken commands. **Fix explanation:** Added a `tarballsUrl` prop to `PreviewBadge` sourced from a new `TARBALLS_URL` environment variable. In `page.tsx`, the env var is read and passed to the component. In `preview-badge.tsx`, the tarball URLs are constructed using `tarballsUrl` when available, falling back to `deploymentUrl` for backwards compatibility. The `TARBALLS_URL` environment variable needs to be configured in the Vercel docs project settings (pointing to the tarballs project's deployment URL). This follows the same pattern as `VERCEL_URL` — it's a hostname without protocol, and `https://` is prepended in the code. Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: VaguelySerious <mittgfu@gmail.com>
- pack.ts now generates a public/index.html listing every published package with copyable `pnpm i …` install commands, so the bare deployment URL is itself a useful landing page when shared. - Drop the OIDC trusted-sources bypass from the tarballs smoke and CI workflow. The tarballs project must be publicly accessible (no Deployment Protection) for `pnpm install` to fetch tarball URLs from third-party projects, so the smoke now makes unauthenticated requests and fails loudly on a login redirect. - README documents the public-access requirement and the index page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| export function PreviewBadge({ deploymentUrl }: PreviewBadgeProps) { | ||
| const baseUrl = deploymentUrl.replace(/\/$/, ''); | ||
| export function PreviewBadge({ deploymentUrl, tarballsUrl }: PreviewBadgeProps) { | ||
| const baseUrl = (tarballsUrl || deploymentUrl).replace(/\/$/, ''); |
There was a problem hiding this comment.
honestly we don't need the tarballs link in docs preview-only page anymore for docs now. the tarballs project should just have an index web page that has this information and docs can be simplified
can do in follow up to unblock here
|
Backport to |
Summary
The
docsproject was incidentally hosting preview tarballs because of aprebuildstep that ranscripts/pack.tsand dumped*.tgzintodocs/public/. This PR moves all of that into a new top-leveltarballs/workspace package that deploys as its own static Vercel project.Follow-up (manual, not in this PR)
workflow-tarballsVercel project linked totarballs/(no framework preset;outputDirectory: public; install command runs at the repo root for the workspace). The new CI workflow'sproject-slug: workflow-tarballsdepends on this.https://workflow-docs-…vercel.sh/<pkg>.tgzto use the new host.