@vercel/geistdocs 1.25.1-canary.9556d32 → 1.25.1-canary.bd8995b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{program as T}from"commander";import{access as ce,copyFile as le}from"fs/promises";import{join as pe}from"path";import{cancel as de,intro as ge,isCancel as ue,log as fe,outro as me,spinner as he,text as we}from"@clack/prompts";import{spawn as te}from"child_process";import{readFileSync as se}from"fs";import{cp as ne,readFile as ae,rename as re,writeFile as ie}from"fs/promises";import{join as $}from"path";import{fileURLToPath as oe}from"url";var g="@vercel/geistdocs",m=(e,t=[],s={})=>new Promise((n,a)=>{let r=te(e,t,{stdio:"inherit",...s});r.on("error",a),r.on("close",i=>{if(i===0){n();return}a(new Error(`Command failed with exit code ${i}: ${[e,...t].join(" ")}`))})}),A=["dependencies","devDependencies","optionalDependencies","peerDependencies"],_=()=>JSON.parse(se(new URL("../../package.json",import.meta.url),"utf8")).version,P=async e=>{let t=$(e,"package.json"),s=await ae(t,"utf8");return JSON.parse(s)},x=async(e,t)=>{let s=$(e,"package.json");await ie(s,`${JSON.stringify(t,null,2)}
3
- `,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.25.1-canary.9556d32","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(ee);T.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(q);T.parse(process.argv);
3
+ `,"utf8")},R=(e,t)=>{for(let s of A){let n=e[s];if(n&&t in n)return n[t]}},V=(e,t)=>!!R(e,t),b=(e,t,s)=>{let n=!1;for(let a of A){let r=e[a];r&&t in r&&(r[t]=s,n=!0)}return n},j=()=>oe(new URL("../../template",import.meta.url)),F=async e=>{await ne(j(),e,{recursive:!0});let t=$(e,".gitignore"),s=$(e,"_gitignore");try{await re(s,t)}catch{}};var ye=async e=>{await F(e)},Pe=async e=>{try{return await ce(e),!0}catch{return!1}},ve=async()=>{await Pe(".env.example")&&await le(".env.example",".env.local")},Te=async e=>{let t=await P(e),s=_();return b(t,g,s)?(await x(e,t),!0):!1},ke=async e=>{await m("pnpm",["install"],{cwd:e,env:process.env,stdio:"inherit"})},$e=async e=>{await m("git",["init"],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["add","."],{cwd:e,env:process.env,stdio:"inherit"}),await m("git",["commit","-m","\u2728 Initial commit"],{cwd:e,env:process.env,stdio:"inherit"})},xe=async()=>{let e=await we({message:"What is your project named?",placeholder:"my-app",validate(t){if(t.length===0)return"Please enter a project name."}});return ue(e)&&(de("Operation cancelled."),process.exit(0)),e.toString()},G=async e=>{try{ge("Let's start a Geistdocs project!");let t=process.cwd(),s=e.name||await xe(),n=he(),a=pe(t,s);n.start("Copying bundled template..."),await ye(s),n.message("Setting up environment variables..."),process.chdir(a),await ve(),n.message("Rewriting package dependency versions..."),await Te(a),n.message("Installing dependencies..."),await ke(a),e.disableGit||(n.message("Initializing Git repository..."),await $e(a)),n.stop("Project initialized successfully!"),me("Run `pnpm dev` to start the development server.")}catch(t){let s=t instanceof Error?t.message:`Failed to initialize project: ${t}`;fe.error(s),process.exit(1)}};import{readFileSync as be,writeFileSync as Fe}from"fs";import{mkdir as De,readFile as N,writeFile as Se}from"fs/promises";import{dirname as Ce,extname as Re,relative as M,resolve as S}from"path";import{intro as je,isCancel as Ee,log as h,multiselect as Ne,outro as D,spinner as Ue}from"@clack/prompts";import{glob as Oe}from"glob";import{Node as v,Project as Ie,SyntaxKind as Je}from"ts-morph";var Le="geistdocs.tsx",Ae="content/docs/**/*.mdx",U=".translation-cache.json",E=8,B=()=>({version:1,entries:{}}),_e=async e=>{let t=await N(e),{createHash:s}=await import("crypto");return s("sha256").update(t).digest("hex")},Ve=e=>{let t=S(process.cwd(),e);return be(t,"utf8")},z=e=>v.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(v.isPropertyAssignment(t)){let s=t.getNameNode();if(v.isIdentifier(s)||v.isStringLiteral(s))return[s.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],Ge=e=>{try{let t=new Ie({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),s=Ve(e),r=t.createSourceFile(e,s,{overwrite:!0}).getVariableDeclarations().find(l=>l.getName()==="translations")?.getInitializer();if(!r)return[];if(v.isObjectLiteralExpression(r))return z(r);let i=r.getFirstDescendantByKind(Je.ObjectLiteralExpression);return i?z(i):[]}catch(t){let s=t instanceof Error?t.message:`${t}`;return h.warn(`Failed to read locales from ${e}: ${s}`),[]}},Be=async()=>{let e=await Ne({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ee(e)&&(D("Translation cancelled"),process.exit(0)),e},ze=async e=>(await Oe(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),He=async()=>{let e=S(process.cwd(),U);try{let t=await N(e,"utf8"),s=JSON.parse(t);return s.version!==1||!s.entries?B():{version:1,entries:s.entries}}catch{return B()}},H=e=>{let t=S(process.cwd(),U),s=JSON.stringify(e,null,2);Fe(t,s,"utf8")},Me=async e=>{let t=await Promise.all(e.map(async s=>[s,await _e(s)]));return Object.fromEntries(t)},Ke=(e,t)=>{let s=Re(e);return`${e.slice(0,-s.length)}.${t}${s}`},K=(e,t)=>`${M(process.cwd(),e)}::${t}`,qe=(e,t,s,n,a=!1)=>{let r=[],i=0;for(let l of t){let c=s[l];for(let o of e){let d=Ke(l,o),u=K(l,o),f=n.entries[u];if(!a&&f?.hash===c){i+=1;continue}r.push({locale:o,sourceFile:l,sourceHash:c,targetFile:d})}}return{tasks:r,skippedCount:i}},Xe=async e=>{await De(Ce(e),{recursive:!0})},We=async(e,t,s)=>{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:s})});if(!n.ok){let r=await n.text();throw new Error(`API request failed (${n.status}): ${r}`)}let a=await n.json();if(!a.translation)throw new Error("API response did not include a translation");return a.translation},Ye=async(e,t,s)=>{let n=await N(e.sourceFile,"utf8"),a=await We(t,n,e.locale);await Xe(e.targetFile),await Se(e.targetFile,a,"utf8"),s.entries[K(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},q=async(e,t)=>{je("Translate MDX content");let s=e??Ae,n=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",a=Ge(t.config??Le),r=await ze(s);r.length===0&&(h.error(`No MDX files found matching pattern: ${s}`),D("Translation cancelled"),process.exit(1)),h.info(`Found ${r.length} MDX file(s) matching pattern`),a.length===0&&(a=await Be());let i=S(process.cwd(),U),l=await He();await H(l),h.info(`Using cache: ${i}`);let c=await Me(r),{tasks:o,skippedCount:d}=qe(a,r,c,l,t.force);if(o.length===0){h.success("All translations are up to date!"),D(`Skipped ${d} file(s) (unchanged)`);return}let u=[];for(let y=0;y<o.length;y+=E)u.push(o.slice(y,y+E));h.info(`Processing ${o.length} translation(s) in ${u.length} batch(es) of up to ${E}`),d>0&&h.info(`Skipped ${d} translation(s) (unchanged)`);let f=Ue();f.start("Translating content...");let k=0;for(let y of u)await Promise.all(y.map(async L=>{await Ye(L,n,l),k+=1,f.message(`Translated ${k}/${o.length}: ${M(process.cwd(),L.targetFile)}`)})),await H(l);f.stop("Translation complete!"),D(`Created/updated ${o.length} file(s)`)};import{access as Ze,copyFile as Qe,mkdir as Z,rm as J}from"fs/promises";import{dirname as et,join as w}from"path";import{intro as tt,log as p,outro as C,spinner as Q}from"@clack/prompts";import{glob as st}from"glob";var nt=["**/*"],at=["content/docs/**"],O=".geistdocs-tmp",rt=async(e,t)=>{let s=w(e,t);await J(s,{recursive:!0,force:!0}),await Z(s,{recursive:!0})},I=async e=>await J(e,{recursive:!0,force:!0}),X=async(e,t,s)=>(await st(e,{cwd:s,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),it=async e=>{try{return await Ze(e),!0}catch{return!1}},ot=async(e,t,s)=>{let n=w(t,e),a=w(s,e);return await it(n)?(await Qe(n,a),{success:!0}):{success:!1,error:`Source file not found: ${n}`}},ct=async(e,t)=>{let s=w(t,e);return await J(s,{force:!0}),{success:!0}},W=20,Y=async(e,t,s)=>{let n=[];for(let a=0;a<e.length;a+=s){let r=e.slice(a,a+s),i=await Promise.all(r.map(t));n.push(...i)}return n},lt=async(e,t,s,n,a)=>{let r={success:[],deleted:[],failed:[]},i=[...new Set(e.map(c=>et(w(n,c))))];a.message(`Creating ${i.length} directories...`),await Promise.all(i.map(c=>Z(c,{recursive:!0}))),a.message(`Updating ${e.length} files...`);let l=await Y(e,async c=>{let o=await ot(c,s,n);return{file:c,...o}},W);for(let{file:c,success:o,error:d}of l)o?r.success.push(c):r.failed.push({file:c,error:d??"Unknown error"});if(t.length>0){a.message(`Deleting ${t.length} files...`);let c=await Y(t,async o=>{try{return await ct(o,n),{file:o,success:!0}}catch(d){let u=d instanceof Error?d.message:`${d}`;return{file:o,success:!1,error:u}}},W);for(let o of c)o.success?r.deleted.push(o.file):r.failed.push({file:o.file,error:o.error})}return r},pt=e=>{if(e.success.length>0){p.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)p.info(` \u2713 ${t}`)}if(e.deleted.length>0){p.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)p.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){p.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:s}of e.failed)p.error(` \u2717 ${t}: ${s}`)}},dt=e=>e.includes("canary")?"canary":"latest",gt=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(g)}`);if(!t.ok)throw new Error(`Failed to resolve ${g}@${e}`);let n=(await t.json())["dist-tags"]?.[e];if(!n)throw new Error(`Could not find dist-tag ${e} for ${g}`);return n},ut=async e=>{let t=await P(e),s=R(t,g);if(!s)return{currentVersion:s,nextVersion:void 0,updated:!1};let n=dt(s),a=await gt(n);return s===a?{currentVersion:s,nextVersion:a,updateTag:n,updated:!1}:(b(t,g,a),await x(e,t),{currentVersion:s,nextVersion:a,updateTag:n,updated:!0})},ft=async(e,t,s)=>{let n=await P(e);if(!V(n,g))return!1;t&&t.length>0&&p.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),s?.sync&&p.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:a,nextVersion:r,updateTag:i,updated:l}=await ut(e);if(!l)return p.success(a?`@vercel/geistdocs is already at ${r} (${i}).`:"No package version update was needed."),C("Package-based site is already up to date."),!0;p.info(`Bumping ${g} from ${a} to ${r} (${i})`);let c=Q();return c.start("Installing updated package version..."),await m("pnpm",["install"],{cwd:e}),c.stop("Package update complete!"),C("Please review and test the upgraded package version."),!0},mt=async(e,t,s,n,a)=>{let r=w(e,O),i=Q(),l=a?.sync?r:t;i.start("Preparing template snapshot..."),a?.sync&&(await rt(e,O),await F(r)),i.message("Scanning for files...");let c=await X(s,n,l),o=[];if(a?.sync){i.message("Comparing with local files...");let u=await X(s,n,e),f=new Set(c);o=u.filter(k=>!f.has(k))}if(i.stop(`Found ${c.length} files to update`),c.length===0&&o.length===0){p.warn("No files matched the patterns. Nothing to update."),a?.sync&&await I(r),C("Update cancelled.");return}p.info(`Patterns: ${s.length}`),p.info(`Files to update: ${c.length}`),a?.sync&&p.info(`Files to delete: ${o.length}`),i.start("Updating files...");let d=await lt(c,o,l,e,i);a?.sync&&(i.message("Cleaning up..."),await I(r)),i.stop("Update complete!"),pt(d),C("Please review and test the changes carefully.")},ee=async(e,t)=>{let s=process.cwd(),n=j(),a=e&&e.length>0?e:nt,r=e&&e.length>0?[]:at;try{if(tt("Let's update your Geistdocs project!"),await ft(s,e,t))return;p.info("Template source: bundled package snapshot"),e&&e.length>0&&p.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&p.info("Sync mode enabled: will delete files removed from template"),await mt(s,n,a,r,t)}catch(i){let l=i instanceof Error?i.message:`${i}`;try{await I(w(s,O))}catch{}p.error(`Failed to update project: ${l}`),process.exit(1)}};T.name("geistdocs").description("CLI for Geistdocs projects").version("1.25.1-canary.bd8995b","-v, --version","Output the current version");T.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").option("--disable-git","Disable git initialization").action(G);T.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(ee);T.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(q);T.parse(process.argv);
@@ -1,7 +1,10 @@
1
1
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "fumadocs-ui/components/tabs.unstyled";
2
- import type { ComponentProps } from "react";
2
+ import { type ComponentProps } from "react";
3
3
  export declare const CodeBlockTabsList: (props: ComponentProps<typeof TabsList>) => import("react/jsx-runtime").JSX.Element;
4
4
  export declare const CodeBlockTabsTrigger: ({ children, ...props }: ComponentProps<typeof TabsTrigger>) => import("react/jsx-runtime").JSX.Element;
5
- export declare const CodeBlockTabs: (props: ComponentProps<typeof Tabs>) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const CodeBlockTabs: ({ compact, ...props }: ComponentProps<typeof Tabs> & {
6
+ compact?: boolean;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const CompactCodeBlockTabs: (props: Omit<ComponentProps<typeof CodeBlockTabs>, "compact">) => import("react/jsx-runtime").JSX.Element;
6
9
  export declare const CodeBlockTab: (props: ComponentProps<typeof TabsContent>) => import("react/jsx-runtime").JSX.Element;
7
10
  //# sourceMappingURL=code-block-tabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-block-tabs.d.ts","sourceRoot":"","sources":["../../src/components/code-block-tabs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,eAAO,MAAM,iBAAiB,GAAI,OAAO,cAAc,CAAC,OAAO,QAAQ,CAAC,4CAUvE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,wBAGlC,cAAc,CAAC,OAAO,WAAW,CAAC,4CAWpC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,cAAc,CAAC,OAAO,IAAI,CAAC,4CAU/D,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,cAAc,CAAC,OAAO,WAAW,CAAC,4CAQrE,CAAC"}
1
+ {"version":3,"file":"code-block-tabs.d.ts","sourceRoot":"","sources":["../../src/components/code-block-tabs.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,OAAO,CAAC;AAEf,eAAO,MAAM,iBAAiB,GAAI,OAAO,cAAc,CAAC,OAAO,QAAQ,CAAC,4CAYvE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,wBAGlC,cAAc,CAAC,OAAO,WAAW,CAAC,4CAUpC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,uBAG3B,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,4CAuDrD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,EAAE,SAAS,CAAC,4CACrB,CAAC;AAE1C,eAAO,MAAM,YAAY,GAAI,OAAO,cAAc,CAAC,OAAO,WAAW,CAAC,4CAErE,CAAC"}
@@ -1,7 +1,30 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cn } from "@vercel/geistcn/utils";
4
+ import { IconChevronDown } from "@vercel/geistcn-assets/icons";
3
5
  import { Tabs, TabsContent, TabsList, TabsTrigger, } from "fumadocs-ui/components/tabs.unstyled";
4
- export const CodeBlockTabsList = (props) => (_jsx(TabsList, { ...props, className: cn("w-full rounded-none border-b bg-background-200 px-2.5 text-gray-800", props.className), children: props.children }));
5
- export const CodeBlockTabsTrigger = ({ children, ...props }) => (_jsxs(TabsTrigger, { ...props, className: cn("group relative px-1 py-2 text-sm data-[state=active]:text-gray-1000", props.className), children: [_jsx("div", { className: "absolute inset-x-0 bottom-0 h-px group-data-[state=active]:bg-gray-1000" }), children] }));
6
- export const CodeBlockTabs = (props) => (_jsx(Tabs, { ...props, className: cn("overflow-hidden rounded-sm border bg-background-100", props.className), children: props.children }));
7
- export const CodeBlockTab = (props) => (_jsx(TabsContent, { ...props, className: cn("[&>div]:mb-0 [&_pre]:rounded-none [&_pre]:border-none", props.className) }));
6
+ import { Children, isValidElement, useState, } from "react";
7
+ export const CodeBlockTabsList = (props) => {
8
+ return (_jsx(TabsList, { ...props, className: cn("mb-3 flex w-full flex-nowrap items-center overflow-x-auto pb-px text-gray-900", props.className), children: props.children }));
9
+ };
10
+ export const CodeBlockTabsTrigger = ({ children, ...props }) => (_jsx(TabsTrigger, { ...props, className: cn("flex h-8 cursor-pointer items-center rounded-md border-0 bg-transparent px-3 text-label-13 outline-0 transition-[color] duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] hover:text-gray-1000 data-[state=active]:bg-gray-200 data-[state=active]:text-gray-1000 motion-reduce:transition-none", props.className), children: children }));
11
+ export const CodeBlockTabs = ({ compact = false, ...props }) => {
12
+ const [value, setValue] = useState(String(props.defaultValue ?? props.value ?? ""));
13
+ const options = Children.toArray(props.children)
14
+ .flatMap((child) => isValidElement(child)
15
+ ? Children.toArray(child.props.children)
16
+ : [])
17
+ .filter((isValidElement))
18
+ .filter((child) => typeof child.props.value === "string")
19
+ .map((child) => ({
20
+ label: String(child.props.children),
21
+ value: child.props.value,
22
+ }));
23
+ const tabs = (_jsx(Tabs, { ...props, className: cn("not-prose", props.className), onValueChange: compact ? setValue : props.onValueChange, value: compact ? value : props.value, children: props.children }));
24
+ if (!compact) {
25
+ return tabs;
26
+ }
27
+ return (_jsxs("div", { className: "relative [&_[role=tablist]]:hidden", children: [_jsxs("label", { className: "absolute top-2 right-12 z-2", children: [_jsx("span", { className: "sr-only", children: "Code language" }), _jsx("select", { "aria-label": "Code language", className: "h-8 cursor-pointer appearance-none rounded-md border-0 bg-transparent py-0 pr-7 pl-2 text-gray-900 text-label-13 outline-none transition-colors duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] hover:bg-gray-200 focus-visible:shadow-[var(--ds-focus-ring)] motion-reduce:transition-none", onChange: (event) => setValue(event.target.value), value: value, children: options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) }), _jsx("span", { className: "pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-gray-900", children: _jsx(IconChevronDown, { size: 16 }) })] }), tabs] }));
28
+ };
29
+ export const CompactCodeBlockTabs = (props) => _jsx(CodeBlockTabs, { ...props, compact: true });
30
+ export const CodeBlockTab = (props) => (_jsx(TabsContent, { ...props, className: cn("[&>div]:mb-0", props.className) }));
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  interface CodeBlockProps {
3
3
  children: ReactNode;
4
4
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/components/code-block.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,SAAS,GAAI,mEAKvB,cAAc,4CAWhB,CAAC"}
1
+ {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../src/components/code-block.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,UAAU,cAAc;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuBD,eAAO,MAAM,SAAS,GAAI,mEAKvB,cAAc,4CA8BhB,CAAC"}
@@ -1,4 +1,29 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CodeBlockServer } from "@vercel/geistcn/components/code-block-server";
3
3
  import { cn } from "@vercel/geistcn/utils";
4
- export const CodeBlock = ({ children, className, "data-line-numbers": lineNumbers, title, }) => (_jsx(CodeBlockServer, { className: cn("[&_code]:border-0 [&_code]:bg-transparent [&_code]:p-0", className), filename: title, hideLineNumbers: !lineNumbers, children: children }));
4
+ import { LogoNextJs, LogoSvelte } from "@vercel/geistcn-assets/logos";
5
+ import { isValidElement } from "react";
6
+ const FRAMEWORK_ICONS = {
7
+ next: _jsx(LogoNextJs, { height: 16 }),
8
+ nextjs: _jsx(LogoNextJs, { height: 16 }),
9
+ svelte: _jsx(LogoSvelte, { height: 16 }),
10
+ sveltekit: _jsx(LogoSvelte, { height: 16 }),
11
+ };
12
+ const resolveFrameworkTitle = (title) => {
13
+ const hashIndex = title?.lastIndexOf("#") ?? -1;
14
+ if (!title || hashIndex === -1) {
15
+ return null;
16
+ }
17
+ const icon = FRAMEWORK_ICONS[title.slice(hashIndex + 1).toLowerCase()];
18
+ if (!icon) {
19
+ return null;
20
+ }
21
+ return { icon, title: title.slice(0, hashIndex) };
22
+ };
23
+ export const CodeBlock = ({ children, className, "data-line-numbers": lineNumbers, title, }) => {
24
+ const frameworkTitle = resolveFrameworkTitle(title);
25
+ const code = isValidElement(children)
26
+ ? children.props.children
27
+ : children;
28
+ return (_jsx(CodeBlockServer, { className: cn("[&_code]:min-w-full [&_code]:border-0 [&_code]:bg-transparent [&_code]:p-0", lineNumbers !== undefined && "line-numbers", frameworkTitle && "[&_[data-section=tabs]>div:first-child]:hidden", className), filename: frameworkTitle?.title ?? title, headerActions: frameworkTitle ? (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-gray-900 text-label-13", children: [_jsx("span", { className: "flex w-4 shrink-0 items-center", children: frameworkTitle.icon }), _jsx("span", { className: "truncate", children: frameworkTitle.title })] })) : undefined, hideLineNumbers: lineNumbers === undefined, children: code }));
29
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAI,6DAO7B,oBAAoB,4CAqFtB,CAAC"}
1
+ {"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/prompt-input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,GAAI,6DAO7B,oBAAoB,4CAmFtB,CAAC"}
@@ -14,6 +14,7 @@ export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRe
14
14
  const nextHeight = textarea.scrollHeight > 56 ? Math.min(textarea.scrollHeight, 200) : 56;
15
15
  textarea.style.height = `${nextHeight}px`;
16
16
  }, [textareaRef]);
17
+ // biome-ignore lint/correctness/useExhaustiveDependencies: controlled value changes must resize the textarea after React updates its DOM value.
17
18
  useEffect(() => {
18
19
  adjustHeight();
19
20
  }, [adjustHeight, value]);
@@ -32,5 +33,5 @@ export const ChatPromptInput = ({ onChange, onStop, onSubmit, status, textareaRe
32
33
  event.currentTarget.form?.requestSubmit();
33
34
  }
34
35
  };
35
- return (_jsx("div", { className: "cursor-text rounded-[12px] border border-gray-300 border-solid pt-2 pb-2 shadow-xs transition-colors duration-250 focus-within:border-gray-500", onClick: () => textareaRef.current?.focus(), children: _jsxs("form", { className: "flex flex-col items-center gap-2", onSubmit: onSubmit, children: [_jsx("textarea", { className: "min-h-0 w-full resize-none rounded-none border-0 bg-transparent px-4 py-2 font-sans text-gray-1000 text-sm shadow-none outline-hidden ring-0 placeholder:text-gray-600 focus:outline-none focus-visible:ring-0", maxLength: 1000, name: "message", onChange: handleChange, onKeyDown: handleKeyDown, placeholder: "Ask a question...", ref: textareaRef, value: value }), _jsx("div", { className: "flex w-full items-center justify-end px-2", children: isGenerating && onStop ? (_jsx(Button, { className: "animate-fade-in-scale", onClick: onStop, prefix: _jsx(IconStopCircle, { className: "size-4" }), size: "small", typeName: "button", children: "Stop" })) : (_jsx(Button, { "aria-label": "Submit", className: "size-8 animate-fade-in-scale p-0", disabled: value.trim().length <= 3, shape: "square", size: "small", svgOnly: true, typeName: "submit", children: _jsx(IconArrowUp, { className: "size-4" }) })) })] }) }));
36
+ return (_jsx("div", { className: "cursor-text rounded-[12px] border border-gray-300 border-solid pt-2 pb-2 shadow-xs transition-colors duration-250 focus-within:border-gray-500", children: _jsxs("form", { className: "flex flex-col items-center gap-2", onSubmit: onSubmit, children: [_jsx("textarea", { className: "min-h-0 w-full resize-none rounded-none border-0 bg-transparent px-4 py-2 font-sans text-gray-1000 text-sm shadow-none outline-hidden ring-0 placeholder:text-gray-600 focus:outline-none focus-visible:ring-0", maxLength: 1000, name: "message", onChange: handleChange, onKeyDown: handleKeyDown, placeholder: "Ask a question...", ref: textareaRef, value: value }), _jsx("div", { className: "flex w-full items-center justify-end px-2", children: isGenerating && onStop ? (_jsx(Button, { className: "animate-fade-in-scale", onClick: onStop, prefix: _jsx(IconStopCircle, { className: "size-4" }), size: "small", typeName: "button", children: "Stop" })) : (_jsx(Button, { "aria-label": "Submit", className: "size-8 animate-fade-in-scale p-0", disabled: value.trim().length <= 3, shape: "square", size: "small", svgOnly: true, typeName: "submit", children: _jsx(IconArrowUp, { className: "size-4" }) })) })] }) }));
36
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAgBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AAopBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDAqHlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
1
+ {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAgBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AAkpBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDAqHlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
@@ -160,7 +160,6 @@ const InlinePageActions = ({ askAIEnabled, checked, copyEnabled, onAskAI, onCopy
160
160
  // The desktop action control: a compact copy button plus an actions dropdown,
161
161
  // aligned beside the page title.
162
162
  const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile, menuView, onAskAI, onCopy, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, providersBackRef, query, setMenuView, v0Provider, }) => {
163
- const CopyStateIcon = checked ? IconCheck : IconCopy;
164
163
  return (_jsxs("div", { className: "inline-flex shrink-0 overflow-hidden rounded-md border border-gray-400 bg-background-100", children: [copyEnabled ? (_jsxs("button", { "aria-label": "Copy page", className: "inline-flex h-8 touch-manipulation items-center gap-1.5 px-3 font-medium text-sm transition-colors hover:bg-gray-100 hover:text-gray-1000 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-gray-600/50", onClick: onCopy, type: "button", children: [_jsxs("span", { className: "relative size-4", children: [_jsx(IconCopy, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-75 opacity-0" : "scale-100 opacity-100") }), _jsx(IconCheck, { className: cn("absolute inset-0 size-4 transition-all duration-200", checked ? "scale-100 opacity-100" : "scale-75 opacity-0") })] }), _jsx("span", { children: "Copy page" })] })) : null, _jsxs(DropdownMenu, { onOpenChange: (open) => {
165
164
  if (!open) {
166
165
  setMenuView("main");
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAI9C,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CA6BrC,CAAC"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/internal/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAI9C,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,4CAoCrC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useDocsSearch } from "fumadocs-core/search/client";
4
- import { SearchDialog as FumadocsSearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogOverlay, } from "fumadocs-ui/components/dialog/search";
4
+ import { SearchDialog as FumadocsSearchDialog, SearchDialogClose, SearchDialogContent, SearchDialogHeader, SearchDialogIcon, SearchDialogInput, SearchDialogList, SearchDialogListItem, SearchDialogOverlay, } from "fumadocs-ui/components/dialog/search";
5
5
  import { useI18n } from "fumadocs-ui/contexts/i18n";
6
6
  import { getPublicPath } from "../config";
7
7
  export const GeistdocsSearchDialog = ({ basePath, ...props }) => {
@@ -11,5 +11,5 @@ export const GeistdocsSearchDialog = ({ basePath, ...props }) => {
11
11
  locale,
12
12
  api: getPublicPath("/api/search", basePath),
13
13
  });
14
- return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "border-none", "data-geistdocs-command-modal": true, children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { items: query.data === "empty" ? null : query.data })] })] }));
14
+ return (_jsxs(FumadocsSearchDialog, { isLoading: query.isLoading, onSearchChange: setSearch, search: search, ...props, children: [_jsx(SearchDialogOverlay, { className: "bg-background-100/80 backdrop-blur-none" }), _jsxs(SearchDialogContent, { className: "border-none", "data-geistdocs-command-modal": true, children: [_jsxs(SearchDialogHeader, { children: [_jsx(SearchDialogIcon, {}), _jsx(SearchDialogInput, {}), _jsx(SearchDialogClose, {})] }), _jsx(SearchDialogList, { "aria-label": "Search results", Item: (itemProps) => (_jsx(SearchDialogListItem, { ...itemProps, role: "option" })), items: query.data === "empty" ? null : query.data, role: "listbox" })] })] }));
15
15
  };
package/dist/mdx.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAkB/C,OAAO,EAGL,KAAK,4BAA4B,IAAI,mBAAmB,EAGzD,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,2BAA2B,8EAAe,CAAC;AACxD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAoB,CAAC;AAC5D,eAAO,MAAM,mBAAmB;;;;;;;gCAAa,CAAC;AAC9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA8BD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
1
+ {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAmB/C,OAAO,EAGL,KAAK,4BAA4B,IAAI,mBAAmB,EAGzD,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,2BAA2B,8EAAe,CAAC;AACxD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAoB,CAAC;AAC5D,eAAO,MAAM,mBAAmB;;;;;;;gCAAa,CAAC;AAC9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA+BD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}
package/dist/mdx.js CHANGED
@@ -3,7 +3,7 @@ import { TypeTable } from "fumadocs-ui/components/type-table";
3
3
  import defaultMdxComponents from "fumadocs-ui/mdx";
4
4
  import { Callout, CalloutContainer, CalloutDescription, CalloutTitle, } from "./components/callout";
5
5
  import { CodeBlock } from "./components/code-block";
6
- import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, } from "./components/code-block-tabs";
6
+ import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CompactCodeBlockTabs, } from "./components/code-block-tabs";
7
7
  import { CopyPrompt } from "./components/copy-prompt";
8
8
  import { Mermaid } from "./components/mermaid";
9
9
  import { Video } from "./components/video";
@@ -18,6 +18,7 @@ export const getGeistdocsMDXComponents = (components) => ({
18
18
  pre: CodeBlock,
19
19
  a: ({ href, ...props }) => typeof href === "string" && href.startsWith("/") ? (_jsx(LocalizedLink, { className: "font-normal text-gray-1000 no-underline", href: href, ...props })) : (_jsx("a", { href: href, ...props, className: "font-normal text-gray-1000 no-underline" })),
20
20
  CodeBlockTabs,
21
+ CompactCodeBlockTabs,
21
22
  CodeBlockTabsList,
22
23
  CodeBlockTabsTrigger,
23
24
  CodeBlockTab,
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Docs
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.9556d32 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.bd8995b so agents can understand the installed package without web access.
4
4
  They are generated from `apps/template/content/docs` during the package build.
5
5
 
6
6
  ## How to use these files
package/docs/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Documentation
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.9556d32.
3
+ These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.bd8995b.
4
4
  They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
5
5
 
6
6
  ## Documentation Index
@@ -423,7 +423,7 @@ Fix unrelated build failures first. A migration is safer when the starting point
423
423
 
424
424
  ## Install Geistdocs
425
425
 
426
- Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting.
426
+ Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting. Geistdocs requires Next.js 16.3.3 or later within 16.x. Earlier 16.3 releases can retain an optional catch-all route's index content after a client navigation to a child page when Cache Components and Partial Prefetching are enabled.
427
427
 
428
428
  For an existing project, use your package manager directly:
429
429
 
@@ -1202,7 +1202,9 @@ related:
1202
1202
 
1203
1203
  Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
1204
1204
 
1205
- Help me write a Geistdocs MDX page. Use this page as a syntax reference and create an example page with frontmatter, headings, links, a code block, a `Callout`, and a `CopyPrompt` component.
1205
+ Help me write a Geistdocs MDX page. Use this page as a syntax reference and
1206
+ create an example page with frontmatter, headings, links, a code block, a
1207
+ `Callout`, and a `CopyPrompt` component.
1206
1208
 
1207
1209
  ## Frontmatter
1208
1210
 
@@ -1383,6 +1385,78 @@ export const Button = ({ children }) => {
1383
1385
  };
1384
1386
  ```
1385
1387
 
1388
+ ### Tabs and switchers
1389
+
1390
+ Use consecutive fences with `tab` metadata for code tabs that expose every
1391
+ option at once:
1392
+
1393
+ ````md
1394
+ ```ts tab="TypeScript" title="example.ts"
1395
+ export const greeting: string = "Hello from TypeScript";
1396
+ ```
1397
+
1398
+ ```js tab="JavaScript" title="example.js"
1399
+ export const greeting = "Hello from JavaScript";
1400
+ ```
1401
+ ````
1402
+
1403
+ This renders as:
1404
+
1405
+ ```ts tab="TypeScript" title="example.ts"
1406
+ export const greeting: string = "Hello from TypeScript";
1407
+ ```
1408
+
1409
+ ```js tab="JavaScript" title="example.js"
1410
+ export const greeting = "Hello from JavaScript";
1411
+ ```
1412
+
1413
+ Wrap the same fences in `<CodeBlockTabs compact>` to move the selector into the
1414
+ code-block header:
1415
+
1416
+ ````mdx
1417
+ <CompactCodeBlockTabs defaultValue="TypeScript">
1418
+ <CodeBlockTabsList>
1419
+ <CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
1420
+ <CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
1421
+ </CodeBlockTabsList>
1422
+ <CodeBlockTab value="TypeScript">
1423
+ ```ts title="example.ts"
1424
+ export const greeting: string = "Hello from TypeScript";
1425
+ ```
1426
+ </CodeBlockTab>
1427
+ <CodeBlockTab value="JavaScript">
1428
+ ```js title="example.js"
1429
+ export const greeting = "Hello from JavaScript";
1430
+ ```
1431
+ </CodeBlockTab>
1432
+ </CompactCodeBlockTabs>
1433
+ ````
1434
+
1435
+ This renders as:
1436
+
1437
+ <CompactCodeBlockTabs defaultValue="TypeScript">
1438
+ <CodeBlockTabsList>
1439
+ <CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
1440
+ <CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
1441
+ </CodeBlockTabsList>
1442
+ <CodeBlockTab value="TypeScript">
1443
+ ```ts title="example.ts"
1444
+ export const greeting: string = "Hello from TypeScript";
1445
+ ```
1446
+ </CodeBlockTab>
1447
+ <CodeBlockTab value="JavaScript">
1448
+ ```js title="example.js"
1449
+ export const greeting = "Hello from JavaScript";
1450
+ ```
1451
+ </CodeBlockTab>
1452
+ </CompactCodeBlockTabs>
1453
+
1454
+ When migrating an existing site such as next-site, translate adjacent
1455
+ `switcher` fences to `tab="TypeScript"` and `tab="JavaScript"`, then wrap the
1456
+ pair with `<CodeBlockTabs compact>`. Import `@vercel/geistdocs/styles.css` (or
1457
+ `theme.css` with the documented Geist dependencies) so Tailwind scans the
1458
+ package's compiled components and emits the tab layout utilities.
1459
+
1386
1460
  ### Framework icons
1387
1461
 
1388
1462
  Append `#<framework>` to the title to show a framework logo instead of the
@@ -1391,22 +1465,22 @@ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
1391
1465
 
1392
1466
  ````md
1393
1467
  ```ts title="flags.ts#next"
1394
- import { flag } from 'flags/next';
1468
+ import { flag } from "flags/next";
1395
1469
  ```
1396
1470
 
1397
1471
  ```ts title="flags.ts#svelte"
1398
- import { flag } from 'flags/sveltekit';
1472
+ import { flag } from "flags/sveltekit";
1399
1473
  ```
1400
1474
  ````
1401
1475
 
1402
1476
  This renders as:
1403
1477
 
1404
1478
  ```ts title="flags.ts#next"
1405
- import { flag } from 'flags/next';
1479
+ import { flag } from "flags/next";
1406
1480
  ```
1407
1481
 
1408
1482
  ```ts title="flags.ts#svelte"
1409
- import { flag } from 'flags/sveltekit';
1483
+ import { flag } from "flags/sveltekit";
1410
1484
  ```
1411
1485
 
1412
1486
  ### Line Numbers
@@ -199,5 +199,5 @@
199
199
  }
200
200
  ],
201
201
  "source": "apps/template/content/docs",
202
- "version": "1.25.1-canary.9556d32"
202
+ "version": "1.25.1-canary.bd8995b"
203
203
  }
@@ -44,7 +44,7 @@ Fix unrelated build failures first. A migration is safer when the starting point
44
44
 
45
45
  ## Install Geistdocs
46
46
 
47
- Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting.
47
+ Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting. Geistdocs requires Next.js 16.3.3 or later within 16.x. Earlier 16.3 releases can retain an optional catch-all route's index content after a client navigation to a child page when Cache Components and Partial Prefetching are enabled.
48
48
 
49
49
  For an existing project, use your package manager directly:
50
50
 
@@ -15,7 +15,9 @@ related:
15
15
 
16
16
  Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
17
17
 
18
- Help me write a Geistdocs MDX page. Use this page as a syntax reference and create an example page with frontmatter, headings, links, a code block, a `Callout`, and a `CopyPrompt` component.
18
+ Help me write a Geistdocs MDX page. Use this page as a syntax reference and
19
+ create an example page with frontmatter, headings, links, a code block, a
20
+ `Callout`, and a `CopyPrompt` component.
19
21
 
20
22
  ## Frontmatter
21
23
 
@@ -196,6 +198,78 @@ export const Button = ({ children }) => {
196
198
  };
197
199
  ```
198
200
 
201
+ ### Tabs and switchers
202
+
203
+ Use consecutive fences with `tab` metadata for code tabs that expose every
204
+ option at once:
205
+
206
+ ````md
207
+ ```ts tab="TypeScript" title="example.ts"
208
+ export const greeting: string = "Hello from TypeScript";
209
+ ```
210
+
211
+ ```js tab="JavaScript" title="example.js"
212
+ export const greeting = "Hello from JavaScript";
213
+ ```
214
+ ````
215
+
216
+ This renders as:
217
+
218
+ ```ts tab="TypeScript" title="example.ts"
219
+ export const greeting: string = "Hello from TypeScript";
220
+ ```
221
+
222
+ ```js tab="JavaScript" title="example.js"
223
+ export const greeting = "Hello from JavaScript";
224
+ ```
225
+
226
+ Wrap the same fences in `<CodeBlockTabs compact>` to move the selector into the
227
+ code-block header:
228
+
229
+ ````mdx
230
+ <CompactCodeBlockTabs defaultValue="TypeScript">
231
+ <CodeBlockTabsList>
232
+ <CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
233
+ <CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
234
+ </CodeBlockTabsList>
235
+ <CodeBlockTab value="TypeScript">
236
+ ```ts title="example.ts"
237
+ export const greeting: string = "Hello from TypeScript";
238
+ ```
239
+ </CodeBlockTab>
240
+ <CodeBlockTab value="JavaScript">
241
+ ```js title="example.js"
242
+ export const greeting = "Hello from JavaScript";
243
+ ```
244
+ </CodeBlockTab>
245
+ </CompactCodeBlockTabs>
246
+ ````
247
+
248
+ This renders as:
249
+
250
+ <CompactCodeBlockTabs defaultValue="TypeScript">
251
+ <CodeBlockTabsList>
252
+ <CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
253
+ <CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
254
+ </CodeBlockTabsList>
255
+ <CodeBlockTab value="TypeScript">
256
+ ```ts title="example.ts"
257
+ export const greeting: string = "Hello from TypeScript";
258
+ ```
259
+ </CodeBlockTab>
260
+ <CodeBlockTab value="JavaScript">
261
+ ```js title="example.js"
262
+ export const greeting = "Hello from JavaScript";
263
+ ```
264
+ </CodeBlockTab>
265
+ </CompactCodeBlockTabs>
266
+
267
+ When migrating an existing site such as next-site, translate adjacent
268
+ `switcher` fences to `tab="TypeScript"` and `tab="JavaScript"`, then wrap the
269
+ pair with `<CodeBlockTabs compact>`. Import `@vercel/geistdocs/styles.css` (or
270
+ `theme.css` with the documented Geist dependencies) so Tailwind scans the
271
+ package's compiled components and emits the tab layout utilities.
272
+
199
273
  ### Framework icons
200
274
 
201
275
  Append `#<framework>` to the title to show a framework logo instead of the
@@ -204,22 +278,22 @@ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
204
278
 
205
279
  ````md
206
280
  ```ts title="flags.ts#next"
207
- import { flag } from 'flags/next';
281
+ import { flag } from "flags/next";
208
282
  ```
209
283
 
210
284
  ```ts title="flags.ts#svelte"
211
- import { flag } from 'flags/sveltekit';
285
+ import { flag } from "flags/sveltekit";
212
286
  ```
213
287
  ````
214
288
 
215
289
  This renders as:
216
290
 
217
291
  ```ts title="flags.ts#next"
218
- import { flag } from 'flags/next';
292
+ import { flag } from "flags/next";
219
293
  ```
220
294
 
221
295
  ```ts title="flags.ts#svelte"
222
- import { flag } from 'flags/sveltekit';
296
+ import { flag } from "flags/sveltekit";
223
297
  ```
224
298
 
225
299
  ### Line Numbers
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/geistdocs",
3
3
  "description": "Runtime and CLI for Geistdocs projects.",
4
- "version": "1.25.1-canary.9556d32",
4
+ "version": "1.25.1-canary.bd8995b",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -224,7 +224,7 @@
224
224
  "zod": "^4.1.13"
225
225
  },
226
226
  "peerDependencies": {
227
- "next": "^16.3.0",
227
+ "next": "^16.3.3",
228
228
  "react": "^19.2.3",
229
229
  "react-dom": "^19.2.3",
230
230
  "tailwindcss": "^4.1.17"
@@ -238,7 +238,7 @@
238
238
  "@types/react": "^19.2.7",
239
239
  "@types/react-dom": "^19.2.3",
240
240
  "mdast-util-mdx-jsx": "^3.2.0",
241
- "next": "16.3.1",
241
+ "next": "16.3.3",
242
242
  "react": "^19.2.3",
243
243
  "react-dom": "^19.2.3",
244
244
  "tsup": "^8.5.1",
@@ -42,7 +42,7 @@ Fix unrelated build failures first. A migration is safer when the starting point
42
42
 
43
43
  ## Install Geistdocs
44
44
 
45
- Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting.
45
+ Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting. Geistdocs requires Next.js 16.3.3 or later within 16.x. Earlier 16.3 releases can retain an optional catch-all route's index content after a client navigation to a child page when Cache Components and Partial Prefetching are enabled.
46
46
 
47
47
  For an existing project, use your package manager directly:
48
48
 
@@ -12,7 +12,9 @@ related:
12
12
  Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
13
13
 
14
14
  <CopyPrompt text="Help me write a Geistdocs MDX page. Use this page as a syntax reference and create an example page with frontmatter, headings, links, a code block, a Callout, and a CopyPrompt component.">
15
- Help me write a Geistdocs MDX page. Use this page as a syntax reference and create an example page with frontmatter, headings, links, a code block, a `Callout`, and a `CopyPrompt` component.
15
+ Help me write a Geistdocs MDX page. Use this page as a syntax reference and
16
+ create an example page with frontmatter, headings, links, a code block, a
17
+ `Callout`, and a `CopyPrompt` component.
16
18
  </CopyPrompt>
17
19
 
18
20
  ## Frontmatter
@@ -194,6 +196,78 @@ export const Button = ({ children }) => {
194
196
  };
195
197
  ```
196
198
 
199
+ ### Tabs and switchers
200
+
201
+ Use consecutive fences with `tab` metadata for code tabs that expose every
202
+ option at once:
203
+
204
+ ````md
205
+ ```ts tab="TypeScript" title="example.ts"
206
+ export const greeting: string = "Hello from TypeScript";
207
+ ```
208
+
209
+ ```js tab="JavaScript" title="example.js"
210
+ export const greeting = "Hello from JavaScript";
211
+ ```
212
+ ````
213
+
214
+ This renders as:
215
+
216
+ ```ts tab="TypeScript" title="example.ts"
217
+ export const greeting: string = "Hello from TypeScript";
218
+ ```
219
+
220
+ ```js tab="JavaScript" title="example.js"
221
+ export const greeting = "Hello from JavaScript";
222
+ ```
223
+
224
+ Wrap the same fences in `<CodeBlockTabs compact>` to move the selector into the
225
+ code-block header:
226
+
227
+ ````mdx
228
+ <CompactCodeBlockTabs defaultValue="TypeScript">
229
+ <CodeBlockTabsList>
230
+ <CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
231
+ <CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
232
+ </CodeBlockTabsList>
233
+ <CodeBlockTab value="TypeScript">
234
+ ```ts title="example.ts"
235
+ export const greeting: string = "Hello from TypeScript";
236
+ ```
237
+ </CodeBlockTab>
238
+ <CodeBlockTab value="JavaScript">
239
+ ```js title="example.js"
240
+ export const greeting = "Hello from JavaScript";
241
+ ```
242
+ </CodeBlockTab>
243
+ </CompactCodeBlockTabs>
244
+ ````
245
+
246
+ This renders as:
247
+
248
+ <CompactCodeBlockTabs defaultValue="TypeScript">
249
+ <CodeBlockTabsList>
250
+ <CodeBlockTabsTrigger value="TypeScript">TypeScript</CodeBlockTabsTrigger>
251
+ <CodeBlockTabsTrigger value="JavaScript">JavaScript</CodeBlockTabsTrigger>
252
+ </CodeBlockTabsList>
253
+ <CodeBlockTab value="TypeScript">
254
+ ```ts title="example.ts"
255
+ export const greeting: string = "Hello from TypeScript";
256
+ ```
257
+ </CodeBlockTab>
258
+ <CodeBlockTab value="JavaScript">
259
+ ```js title="example.js"
260
+ export const greeting = "Hello from JavaScript";
261
+ ```
262
+ </CodeBlockTab>
263
+ </CompactCodeBlockTabs>
264
+
265
+ When migrating an existing site such as next-site, translate adjacent
266
+ `switcher` fences to `tab="TypeScript"` and `tab="JavaScript"`, then wrap the
267
+ pair with `<CodeBlockTabs compact>`. Import `@vercel/geistdocs/styles.css` (or
268
+ `theme.css` with the documented Geist dependencies) so Tailwind scans the
269
+ package's compiled components and emits the tab layout utilities.
270
+
197
271
  ### Framework icons
198
272
 
199
273
  Append `#<framework>` to the title to show a framework logo instead of the
@@ -202,22 +276,22 @@ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
202
276
 
203
277
  ````md
204
278
  ```ts title="flags.ts#next"
205
- import { flag } from 'flags/next';
279
+ import { flag } from "flags/next";
206
280
  ```
207
281
 
208
282
  ```ts title="flags.ts#svelte"
209
- import { flag } from 'flags/sveltekit';
283
+ import { flag } from "flags/sveltekit";
210
284
  ```
211
285
  ````
212
286
 
213
287
  This renders as:
214
288
 
215
289
  ```ts title="flags.ts#next"
216
- import { flag } from 'flags/next';
290
+ import { flag } from "flags/next";
217
291
  ```
218
292
 
219
293
  ```ts title="flags.ts#svelte"
220
- import { flag } from 'flags/sveltekit';
294
+ import { flag } from "flags/sveltekit";
221
295
  ```
222
296
 
223
297
  ### Line Numbers
@@ -19,7 +19,7 @@
19
19
  "@vercel/analytics": "^1.6.1",
20
20
  "@vercel/geistcn": "1.0.3",
21
21
  "@vercel/geistcn-assets": "2.0.1",
22
- "@vercel/geistdocs": "1.25.1-canary.9556d32",
22
+ "@vercel/geistdocs": "1.25.1-canary.bd8995b",
23
23
  "@vercel/speed-insights": "^1.3.1",
24
24
  "ai": "^6.0.132",
25
25
  "class-variance-authority": "^0.7.1",
@@ -36,7 +36,7 @@
36
36
  "mermaid": "^11.12.2",
37
37
  "motion": "^12.23.25",
38
38
  "nanoid": "^5.1.6",
39
- "next": "16.3.1",
39
+ "next": "16.3.3",
40
40
  "next-themes": "^0.4.6",
41
41
  "radix-ui": "1.6.4",
42
42
  "react": "^19.2.3",
package/theme.css CHANGED
@@ -63,10 +63,73 @@
63
63
  .line-numbers code .line::before {
64
64
  content: counter(step);
65
65
  counter-increment: step;
66
- @apply mr-6 inline-block w-6 text-right tabular-nums text-gray-800;
66
+ @apply mr-5 inline-block w-4 shrink-0 text-right font-mono text-[13px] tabular-nums text-gray-600;
67
67
  }
68
68
  }
69
69
 
70
+ /* Match GeistCN CodeBlock's complete line-state treatment for Shiki output. */
71
+ [data-geist-code-block] :is(.line, .highlighted-line) {
72
+ position: relative;
73
+ display: inline-block;
74
+ width: max-content;
75
+ min-width: 100%;
76
+ height: 20px;
77
+ padding: 0 20px !important;
78
+ }
79
+
80
+ [data-geist-code-block]
81
+ :is(.highlighted-line, .line.highlighted, [data-highlighted="true"]) {
82
+ background: var(--ds-blue-300) !important;
83
+ border-left: 0 !important;
84
+ box-shadow: inset 2px 0 0 0 var(--ds-blue-900);
85
+ }
86
+
87
+ [data-geist-code-block] .line[data-active="true"] {
88
+ background: var(--ds-amber-300) !important;
89
+ box-shadow: inset 2px 0 0 0 var(--ds-amber-900);
90
+ }
91
+
92
+ [data-geist-code-block] :is([data-added="true"], .line.diff.add) {
93
+ background: var(--ds-green-300) !important;
94
+ box-shadow: inset 2px 0 0 0 var(--ds-green-900);
95
+ }
96
+
97
+ [data-geist-code-block] :is([data-removed="true"], .line.diff.remove) {
98
+ /* Current GeistCN red-300; the legacy design-system layer redefines the
99
+ variable to a weaker HSL value later in the cascade. */
100
+ background: oklch(94.33% 0.0369 15.0115) !important;
101
+ box-shadow: inset 2px 0 0 0 var(--ds-red-900);
102
+ opacity: 1 !important;
103
+ }
104
+
105
+ [data-geist-code-block] :is(.line.diff.add, .line.diff.remove)::before {
106
+ content: none !important;
107
+ }
108
+
109
+ [data-geist-code-block]
110
+ :is(
111
+ [data-added="true"],
112
+ [data-removed="true"],
113
+ .line.diff.add,
114
+ .line.diff.remove
115
+ )::after {
116
+ position: absolute;
117
+ inset: 0;
118
+ padding-left: 8px;
119
+ font-weight: 500;
120
+ pointer-events: none;
121
+ }
122
+
123
+ [data-geist-code-block] :is([data-added="true"], .line.diff.add)::after {
124
+ color: var(--ds-green-900);
125
+ content: "+";
126
+ }
127
+
128
+ [data-geist-code-block] :is([data-removed="true"], .line.diff.remove)::after {
129
+ color: var(--ds-red-900);
130
+ content: "-";
131
+ }
132
+
70
133
  :root {
71
134
  --fd-layout-width: 100%;
72
135
  --fd-page-width: 100%;