Repository navigation
Conversation
In the Build Output API a function named `index` is also served at `/`, so `.vercel/output/functions/index.func` shadowed a static `index.html` for any app shipping a frontend beside the runtime. The target now emits `functions/b4.func` with `config.json` routing `/(.*)` to `/b4`, and `validateVercelOutput` checks that pair. `build.vercel.functionName` picks a different name (one path segment of letters, digits, `_` or `-`); `b4 check` and `b4 build` reject anything else before writing. The loaded config now travels on BuildEmitContext so targets can read their own `build.<target>` block. Fixes #687 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The docs checker's B4Config path inventory and the Key reference on the configuration page both enumerate every config key, so the new option has to appear in both. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Resolves four conflicts against #693 (typed build.targets) and #698 (vercel Postgres driver): - core types.ts and the configuration reference keep main's BuildTargetName union alongside the new build.vercel block. - The targets registry keeps main's Record<BuildTargetName, BuildTarget> alongside the config field on BuildEmitContext. - The SEO lastmod manifest is regenerated rather than hand-merged. Also renames the function path in #698's new "Run the Vercel bundle locally" snippet, which still imported index.func. Co-Authored-By: Claude Opus 5 <[email protected]>
Adopts #697's build.vercel resolver instead of the parallel one this branch added: - functionName moves into resolveVercelBuildConfig beside reconcileVercelJson, so one resolver validates the whole build.vercel shape and b4 check/b4 build reject a bad name through the path that already rejects a bad flag. The separate check.ts hook is gone. - The emitter reads ctx.buildConfig (#697) rather than the ctx.config field this branch had added, and resolves both options in one call. - types.ts, the config reference, and the CLI page carry both options. - #697's new prebuilt test asserted the old index.func path; updated, plus a test that both options are honored together. Co-Authored-By: Claude Opus 5 <[email protected]>
The build target context carries buildConfig from #697, so the config field this branch had added is gone. Spreads skip excess-property checks, so the leftover spread compiled silently. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Drive-by from #697, since this PR is already editing That list is consumed as an exact-ordered, all-present signature: Nothing is broken today: the flag defaults to true and this lane's fixtures do not set it, so the marker is always emitted and the lane stays green. It is a latent trap for whoever next configures the lane's fixture for a prebuilt-only project. That change would flip Two options, whichever fits your rename:
Entirely your call whether to fold it in here or leave it. Flagging rather than opening a competing PR, since your diff already owns these lines. |
Only the generated SEO lastmod manifest conflicted; regenerated rather than hand-merged. No code overlap with #694, #701, or the software-factory work order. Co-Authored-By: Claude Opus 5 <[email protected]>
Integrates #695 (vercel outDir + relaxed output validator), which landed on the same files: - functionName joins outDir and reconcileVercelJson in the shared build.vercel resolver. - The relaxed validator asserted a route reaching a hardcoded /index; it now takes the resolved function name, so a composed config.json is still checked against the function the build actually wrote. - The emitter derives both the staged and published function directories from the name, on top of #695's outDir staging. - Docs and the config path inventory carry all three options. Co-Authored-By: Claude Opus 5 <[email protected]>
Only the generated SEO lastmod manifest conflicted with #705; regenerated rather than hand-merged. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Closing in favor of #696, which covers the same ground as part of the composed Build Output work. Both PRs added #696 addresses the shadowing this PR fixes: it exposes The one behavioural difference worth noting: this PR renamed the function unconditionally, while #696 keeps No work is lost; nothing here is needed once #696 lands. |
Pull request was closed
Neither change affects this page. #705 batches route-discovery errors, and #708 is the edge page's own local-run recipe switching from /healthz to /readyz for the same reason this guide already did. #691 was closed unmerged, so the emitted function directory is still index.func and this page's shadowing argument stands unchanged. Only the lastmod manifest conflicted; regenerated. Co-Authored-By: Claude Opus 5 <[email protected]>
Fixes #687.
Problem
The
verceltarget emitted.vercel/output/functions/index.funcwithconfig.jsonrouting/(.*)to/index. In the Build Output API a function namedindexis also served at/, so it shadowed a staticindex.htmlfor any app that ships a frontend beside the runtime. hashbrown had to copy the function asagent.funcin an external assembler (liveloveapp/hashbrown@cf3f94f).Change
b4:b4 buildemitsfunctions/b4.funcandconfig.jsonroutes/(.*)to/b4.validateVercelOutputvalidates the name/route pair it is given (defaultb4), so an output built for another name is rejected rather than silently accepted.build.vercel.functionNameoption (@b4run/coreB4Config): one path segment of letters, digits,_or-. Bothb4 build(before any filesystem work) andb4 checkreject anything else withB4_E1003. Setting it to"index"restores the old layout exactly.BuildEmitContextnow carries the loaded config so targets can read their ownbuild.<target>block.b4 buildreference gains the missingvercelbullet; the Upgrading page gets a compatibility section..vercel/outputby path must use the new name or pinfunctionName: "index".Tests
vercel-target.test.ts: custom name emitsagent.funcand routes to/agent; six invalid names ("",../escape,index/../escape,a b,.hidden, a number) are rejected before.vercelis created; the Build Output contract test proves the default validator rejects an output written for another name.check-error-codes.test.ts: invalidbuild.vercel.functionName→[B4_E1003]with the docs link.index.funcexpectations acrossbuild-targets,vercel-target,vercel-native-laneand the native fixture helper moved tob4.func.Ran locally:
vercel-target,build-targets,check-error-codes,vercel-native-lane(424 passed, 1 gated skip), plus lint and typecheck for@b4run/cliand@b4run/core.Not released.
🤖 Generated with Claude Code