@@ -22,20 +22,6 @@ import { STYLES } from "@/registry/styles"
2222// This is used by the v4 site.
2323const WHITELISTED_STYLES = [ "new-york-v4" ]
2424
25- // Template directories to archive during build.
26- const TEMPLATE_NAMES = [
27- "next-app" ,
28- "vite-app" ,
29- "react-router-app" ,
30- "start-app" ,
31- "astro-app" ,
32- "next-monorepo" ,
33- "vite-monorepo" ,
34- "react-router-monorepo" ,
35- "start-monorepo" ,
36- "astro-monorepo" ,
37- ]
38-
3925// Collect paths for batch prettier formatting at the end.
4026const prettierPaths : string [ ] = [ ]
4127
10187 console . log ( "\n⚙️ Building public/r/config.json..." )
10288 await buildConfig ( )
10389
104- console . log ( "\n📦 Building public/r/templates..." )
105- await buildTemplates ( )
106-
10790 // Copy UI to examples before cleanup.
10891 console . log ( "\n📋 Copying UI to examples..." )
10992 await copyUIToExamples ( )
@@ -746,71 +729,6 @@ async function batchPrettier(paths: string[]) {
746729 } )
747730}
748731
749- async function buildTemplates ( ) {
750- const templatesDir = path . resolve ( process . cwd ( ) , "../../templates" )
751- const outputDir = path . join ( process . cwd ( ) , "public/r/templates" )
752- await fs . mkdir ( outputDir , { recursive : true } )
753-
754- await Promise . all (
755- TEMPLATE_NAMES . map ( async ( name ) => {
756- const templatePath = path . join ( templatesDir , name )
757-
758- // Verify the template directory exists.
759- try {
760- await fs . access ( templatePath )
761- } catch {
762- console . log ( ` ⚠️ templates/${ name } not found, skipping` )
763- return
764- }
765-
766- const outputPath = path . join ( outputDir , `${ name } .tar.gz` )
767-
768- await new Promise < void > ( ( resolve , reject ) => {
769- const proc = spawn (
770- "tar" ,
771- [
772- "-czf" ,
773- outputPath ,
774- "--exclude" ,
775- "node_modules" ,
776- "--exclude" ,
777- ".git" ,
778- "--exclude" ,
779- "pnpm-lock.yaml" ,
780- "--exclude" ,
781- "._*" ,
782- "-C" ,
783- templatesDir ,
784- name ,
785- ] ,
786- {
787- cwd : process . cwd ( ) ,
788- stdio : "pipe" ,
789- env : { ...process . env , COPYFILE_DISABLE : "1" } ,
790- }
791- )
792- let stderr = ""
793- proc . stderr ?. on ( "data" , ( data ) => ( stderr += data ) )
794- proc . on ( "close" , ( code ) => {
795- if ( code !== 0 ) {
796- reject ( new Error ( `tar exited with code ${ code } : ${ stderr } ` ) )
797- } else {
798- resolve ( )
799- }
800- } )
801- proc . on ( "error" , reject )
802- } )
803-
804- // Zero out the gzip mtime header (bytes 4-7) for deterministic output.
805- const buf = await fs . readFile ( outputPath )
806- buf [ 4 ] = buf [ 5 ] = buf [ 6 ] = buf [ 7 ] = 0
807- await fs . writeFile ( outputPath , buf )
808-
809- console . log ( ` ✅ ${ name } .tar.gz` )
810- } )
811- )
812- }
813-
814732async function buildColors ( ) {
815733 const colorsTargetPath = path . join ( process . cwd ( ) , "public/r/colors" )
816734 await fs . mkdir ( colorsTargetPath , { recursive : true } )
0 commit comments