fix: build constructive-app template as a static export - #33
Open
marslavish wants to merge 5 commits into
Open
Conversation
|
Dependency limit exceeded — report not shown. This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report. Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard. Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account. |
NorOldBurden
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
nextjs/constructive-appbuild as a static export and fixes the template gaps found while deploying a generated app to the static site gateway.Gaps fixed
Static export config (
next.config.ts)Repro:
pnpm buildproduced a server build; the static site gateway needsout/. Turbopack also mis-inferred the workspace root in the generated pnpm monorepo.Impact: generated apps could not deploy as static sites.
Fix:
output: 'export',images: { unoptimized: true }, and aturbopack.rootthat walks up to the nearestpnpm-workspace.yaml, so the path resolves both standalone in this repo and aspackages/appin a generated monorepo.pnpm 11 global virtual store (
pnpm-workspace.yaml)Repro: with pnpm 11 defaults, Turbopack resolves
nextoutside the workspace and rejects it.Impact:
pnpm dev/pnpm buildfail in fresh checkouts.Fix:
enableGlobalVirtualStore: false.Install is broken out of the box (found while verifying)
Repro:
pnpm installexits 1 withERR_PNPM_IGNORED_BUILDS; pnpm 11 ignores thepnpmfield inpackage.json, and the committedallowBuildsvalues were literalset this to true or falseplaceholders.Impact: no script (
lint:types,build,dev) can run.Fix: moved the
graphqloverride intopnpm-workspace.yaml, setallowBuildsto real values, removed the deadpnpmfield.Dynamic org routes cannot static-export (route conversion)
Repro:
src/app/orgs/[orgId]/*has nogenerateStaticParams;next buildwithoutput: 'export'fails (and[]would export routes that 404 on a static host).Impact: the B2B org surface blocks the static export entirely.
Fix: converted to query-param routes per this PR's own convention doc —
/orgs/{members,invites,settings,activity}?orgId=…,useEntityParamsreadsorgIdvia nuqsuseQueryState,buildOrgRoutebuilds the links, sidebar configs and callers updated. Side effect: the org routes now matchgetRouteKeyFromPath, so theiraccess: 'protected'guard actually applies (the bracket paths never matched).Shell scroll (
app-shell.tsx)Repro:
<main>wasoverflow-hidden, so every page needed its ownh-full overflow-y-autowrapper; pages without one could not scroll.Impact: nested scroll containers and easy-to-miss unscrollable pages.
Fix:
<main>isoverflow-y-auto; removed the per-page wrappers.Query retry predicate (
src/lib/query-client.ts)Repro: SDK hooks throw plain
TypeErroron network failure andGraphQLRequestErrorwith anHTTP 5xxmessage on gateway hiccups; the predicate retried neither.Impact: transient infra errors surface as hard failures.
Fix: retry both (5xx only for
GraphQLRequestError).Conventions doc (
docs/CONVENTIONS.md, linked from the README)New: no
[param]routes (query-param detail routes with Suspense instead), create/edit via stack cards, every query error state renders arefetch()retry control, scrolling lives in the shell.docs/B2B.mdroute references updated to match.Build runs codegen when the SDK is absent (
scripts/ensure-sdk.sh)Repro:
pnpm buildfails in a checkout without the generated SDK (the repo commits only stubsrc/graphql/sdk/*/index.ts; the generated dirs are gitignored).Impact: generated apps need a manual
pnpm codegenstep before the first build.Fix:
buildrunsensure-sdk.sh, which runs codegen only whensrc/graphql/sdk/*/types.tsis missing, and skips it when a generated SDK is present.Out of scope
.env.localhandling in@agentic-kit/pi(scaffolder), not this template.pnpm-workspace.yamlplaceholder writer is scaffolder-side (@agentic-kit/pi); this PR only fixes the copy committed here.unknownfor some fields is in@constructive-io/graphql-codegen, not chased here.Verification
pnpm installpasses (it exits 1 onmain).pnpm lint:types: 0 errors with a generated SDK in place. Without one,mainand this branch fail with the identical 52 stub-SDK errors (sorted lists diff clean) — this PR adds no type errors.pnpm buildwith a generated SDK andNEXT_PUBLIC_DB_NAMEset: all 20 routes prerender as static content intoout/, including the four converted/orgs/*routes (their HTML contains the Suspense shell skeleton, confirming the nuqs query-param reads are prerender-safe).ensure-sdk.shguard exercised both ways against a fixture tree (runs codegen when atypes.tsis missing, skips when present).pnpm dev, the 5xx retry against a real gateway, and org navigation end to end. Static checks for these pass; runtime behavior needs a backend.