Repository navigation
Share Graft CMS across Astro and Next, remove Sanity, pin Bun 1.4 - #53
Conversation
Lift schema and MDX into packages/content, restore the Next archive as a local workspace on the same static index, and remove Studio plus sanity-config. Vercel still builds only the Astro app. Co-authored-by: Anderson Joseph <hello@andersonjoseph.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
…chunks. Astro prerender rewrites import.meta.url to dist/server/.prerender, so a relative path to graft.config.ts looked for .graft/index.db in the output tree. Look up @andy-portfolio/content/package.json instead (with cwd fallbacks). Co-authored-by: Anderson Joseph <hello@andersonjoseph.com>
root: false walks up to the repo config, whose force-ignore then lints zero files. Co-authored-by: Anderson Joseph <hello@andersonjoseph.com>
createRequire can succeed with a path that is not on disk. Confirm the content root exists, then fall back to cwd, and resolve at open time. Co-authored-by: Anderson Joseph <hello@andersonjoseph.com>
next dev binds localhost and blocks HMR/static chunks from 127.0.0.1, which is what agent-browser uses unless the origin is allowlisted. Co-authored-by: Anderson Joseph <hello@andersonjoseph.com>
GitHub Actions has no secrets, and next build was evaluating env.ts while
collecting /api/spotify/now-playing. Match Astro: lazy getters, construct
Resend inside handlers, and return {isPlaying:false} when Spotify env is missing.
Co-authored-by: Anderson Joseph <hello@andersonjoseph.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile SummaryThis change moves portfolio content to the shared Graft package and updates the Astro site and local Next archive to consume it. Production validation confirmed that the migrated blog and case-study pages build and serve their expected Graft content. However, the legacy static sitemap still overrides the generated sitemap, causing search engines to receive stale and invalid route entries. Confidence Score: 4/5Not merge-safe until the static sitemap no longer overrides the Graft-generated sitemap. There is one verified non-security P1 finding. Under the scoring rules, a single non-security P1 results in a score of 4. Files Needing Attention: apps/web-next/public/sitemap.xml should be removed, renamed, or generated from the shared Graft content so that apps/web-next/src/app/sitemap.ts serves /sitemap.xml.
What T-Rex did
|
public/sitemap.xml was served instead of Next’s sitemap.ts, advertising obsolete /case-study/* URLs and omitting i-built-smol. The same file in apps/web would ship on Vercel beside @astrojs/sitemap. Co-authored-by: Anderson Joseph <hello@andersonjoseph.com>
Summary
Graft is now the CMS for both site versions. Sanity is gone.
packages/content(@andy-portfolio/content).graft compilewrites the static SQLite index both apps read.apps/web, port 3000): still the live Vercel site. Blog bodies stay on Astro content collections +@astrojs/mdx.apps/web-next, port 3001): restored as a workspace sobun dev/bun lint/bun buildinclude it. Not deployed. Blog uses@usegraft/sdk-nextMdxBody; projects and case studies come from the same Graft collections.apps/studio,packages/sanity-config, Sanity export script, revalidate webhooks, Sanity env on Turbo/CI.packageManager, CIsetup-bun). First 1.4 install wroteconfigVersion: 1inbun.lock(still hoisted).Two versions + Graft
apps/webapps/web)apps/web-nextAuthor posts, projects, and case studies once under
packages/content/content/.Vercel stays Astro-only:
apps/web/vercel.jsonbuildCommandisbun run build(the Astro app script, which compiles Graft then runsastro build). There is noapps/web-next/vercel.json.Index path (dev + prerender)
The compiled SQLite file lives at
packages/content/.graft/index.db. Resolving it viaimport.meta.urlbroke in two bundlers:dist/server/.prerender/.graft/index.db@andy-portfolio/contentto a virtual[project]/packages/contentpath that is not on diskgetIndexPath()now confirms the candidate exists (or falls back to cwd /GRAFT_CONTENT_ROOT) at open time.CI Next build (no secrets)
Lint’s new
web-nextbuild step has no Spotify/Resend secrets. Next was throwing while collecting/api/spotify/now-playingbecauseenv.tsparsed those keys at import. The archive now matches Astro: lazygetSpotifyEnv/getResendEnv, Resend constructed inside handlers, Spotify idle{isPlaying:false}when env is missing. Verified locally with those variables unset.Greptile P1: stale static sitemap
Deleted
apps/web-next/public/sitemap.xmlsosrc/app/sitemap.tsowns/sitemap.xml(Graft posts +/case-studies/*, no obsolete/case-study/*). Deleted the same file fromapps/web/public/so Vercel does not ship it beside@astrojs/sitemap(sitemap-index.xml/sitemap-0.xml). Confirmed Next:3001/sitemap.xmlincludesi-built-smoland both case studies.Bun 1.3.14 vs 1.4.0
Same machine (Linux), warm
node_modules+ bun cache, 3 runs, median. GNUtimefor wall + max RSS;bun --versionalso timed withperf_counter(GNUtimerounds sub-10ms to0.00). Nested scripts used the version under test viaPATH.1.3.14 can still
bun install --frozen-lockfileagainst this 1.4configVersion: 1lockfile (no rewrite).bun --versionstartupbun install --frozen-lockfilecontent compilebun run lint--force; washwebbuildweb-nextbuild.nextafter the first 1.4 runDo not read this as live-site TTFB. Vercel’s Astro compile still runs on Node 22. Bun 1.4 only changes local/CI
bun installandbun runof those scripts.Verification
Lint, format, Astro typecheck, Next
tsc, Astro production build, and Next production build all passed locally after the index-path fix.agent-browser walk of Astro
:3000and Next:3001:/,/projects(SEO filter), both blog posts, both case studies, Astro mobile viewport. Same Graft titles, nocdn.sanity.io.Astro home Selected Works
Next home Selected Works
Astro projects SEO filter
Astro Smol blog post
Next Smol blog post
Astro projects on mobile
To show artifacts inline, enable in settings.
Summary by cubic
Replaces Sanity with a shared Graft CMS for both the live Astro site and the local Next.js archive, so both apps read the same compiled content index from
@andy-portfolio/content, and pins Bun to 1.4.0.Changes
@andy-portfolio/content;graft compilewrites the SQLite index both apps read.@usegraft/sdk-nextfor MDX and reads the same index for projects and case studies.@andy-portfolio/content/package.json, with a cwd fallback for Turbopack's virtual paths, so Astro's prerendered build finds it.next buildworks in CI without secrets.apps/studio,packages/sanity-config, the Sanity export script, and the revalidate webhook routes.apps/web-nextback to the Turbo workspace and updates its dev/build scripts to compile Graft first.public/sitemap.xmlfiles so the generated sitemaps own/sitemap.xml.packageManagerand the CI setup.Migration
bun installto update the lockfile.Written for commit 6bede75. Summary will update on new commits.