create-lx2-app 0.11.1-beta.c28ae83 → 0.11.1

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/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Lasse Lammers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import Ye from"path";import{execa as Rt}from"execa";import Qe from"fs-extra";imp
3
3
  / __| _ \\ __| /_\\_ _| __| | | __ __|_ ) /_\\ | _ \\ _ \\
4
4
  | (__| / _| / _ \\| | | _| | |__\\ \\ / / / / _ \\| _/ _/
5
5
  \\___|_|_\\___/_/ \\_\\_| |___| |____/_\\_\\/___| /_/ \\_\\_| |_|
6
- `,O="my-lx2-app",J="create-lx2-app";var b=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":"npm":"npm"};import P from"path";import V from"fs-extra";var oe={"next-auth":"^5.0.0-beta.25","@auth/prisma-adapter":"^2.8.0","@auth/drizzle-adapter":"^1.10.0","better-auth":"^1.2.7","better-sqlite3":"^11.9.1","@types/better-sqlite3":"^7.6.13",prisma:"^6.5.0","@prisma/client":"^6.5.0","drizzle-orm":"^0.44.4","drizzle-kit":"^0.31.4","@libsql/client":"^0.15.10",mysql2:"^3.14.3",postgres:"^3.4.7","@t3-oss/env-nextjs":"^0.12.0",zod:"^3.24.2",prettier:"^3.5.3","prettier-plugin-tailwindcss":"^0.6.11","@ianvs/prettier-plugin-sort-imports":"^4.4.1",eslint:"^9","eslint-config-next":"^15.2.4","@eslint/eslintrc":"^3.3.1","@biomejs/biome":"2.2.4",typescript:"^5.8.2","@types/node":"^22","@types/react":"^19","@types/react-dom":"^19",payload:"^3.33.0","@payloadcms/next":"^3.33.0","@payloadcms/payload-cloud":"^3.33.0","@payloadcms/richtext-lexical":"^3.33.0","@payloadcms/db-vercel-postgres":"^3.33.0","@payloadcms/db-sqlite":"^3.33.0",graphql:"^16.10.0",sharp:"^0.34.1"};import re from"path";import le from"fs-extra";import ot from"sort-package-json";var u=e=>{let{dependencies:s,devMode:a,projectDir:i}=e,t=le.readJsonSync(re.join(i,"package.json"));s.forEach(o=>{let r=oe[o];a&&t.devDependencies?t.devDependencies[o]=r:t.dependencies&&(t.dependencies[o]=r)});let n=ot(t);le.writeJsonSync(re.join(i,"package.json"),n,{spaces:2})};var pe=({projectDir:e,packages:s})=>{let a=s?.prisma.inUse,i=s?.drizzle.inUse,t=["next-auth"];a&&t.push("@auth/prisma-adapter"),i&&t.push("@auth/drizzle-adapter"),u({projectDir:e,dependencies:t,devMode:!1});let n=P.join(c,"template/packages"),o="src/app/api/auth/[...nextauth]/route.ts",r=P.join(n,o),p=P.join(e,o),d=P.join(n,"src/server/auth/config",a?"authjs-with-prisma.ts":i?"authjs-with-drizzle.ts":"authjs.ts"),m=P.join(e,"src/server/auth/config.ts"),f=P.join(n,"src/server/auth/authjs.ts"),h=P.join(e,"src/server/auth/index.ts");V.copySync(r,p),V.copySync(d,m),V.copySync(f,h)};import x from"path";import R from"fs-extra";import rt from"path";import ce from"fs-extra";import{sortPackageJson as lt}from"sort-package-json";function v(e){let{scripts:s,projectDir:a}=e,i=rt.join(a,"package.json"),t=ce.readJSONSync(i);t.scripts={...t.scripts,...s};let n=lt(t);ce.writeJSONSync(i,n,{spaces:2})}var de=({projectDir:e,packages:s,databaseProvider:a})=>{let i=s?.prisma.inUse,t=s?.drizzle.inUse,n=["better-auth"],o=[];(!i||!t)&&n.push("better-sqlite3"),(!i||!t)&&o.push("@types/better-sqlite3"),u({projectDir:e,dependencies:n,devMode:!1}),u({projectDir:e,dependencies:o,devMode:!0});let r=x.join(c,"template/packages"),p=x.join(r,"src/app/api/auth/[...betterauth]/route.ts"),d=x.join(e,"src/app/api/auth/[...all]/route.ts"),m=x.join(r,"src/server/auth",i?"better-auth-with-prisma.ts":t?"better-auth-with-drizzle.ts":"better-auth.ts"),f=R.readFileSync(m,"utf-8");(i||t)&&a!=="sqlite"&&(f=f.replace('provider: "sqlite",',`provider: "${{mysql:"mysql",postgresql:t?"pg":"postgresql"}[a]}",`));let h=x.join(e,"src/server/auth/index.ts");R.mkdirSync(x.dirname(h),{recursive:!0}),R.writeFileSync(h,f);let y=x.join(r,"src/lib/auth/better-auth-client.ts"),T=x.join(e,"src/lib/auth/client.ts");v({projectDir:e,scripts:{"auth:generate":"pnpm dlx @better-auth/cli@latest generate --config ./src/server/auth/index.ts --yes",...!i&&!t&&{"auth:migrate":"pnpm dlx @better-auth/cli@latest migrate --config ./src/server/auth/index.ts --yes"}}}),R.copySync(p,d),R.copySync(y,T)};import H from"path";import pt from"fs-extra";var me=({projectDir:e})=>{u({projectDir:e,dependencies:["@biomejs/biome"],devMode:!0});let s=H.join(c,"template/packages"),a=H.join(s,"config/biome.jsonc"),i=H.join(e,"biome.jsonc");pt.copyFileSync(a,i),v({projectDir:e,scripts:{"lint:unsafe":"biome check --write --unsafe .","lint:write":"biome check --write .",lint:"biome check .",format:"biome format --write ."}})};import S from"path";import _ from"fs-extra";var fe=({projectDir:e,packages:s,scopedAppName:a,databaseProvider:i})=>{let t=s?.authjs.inUse,n=s?.betterAuth.inUse;u({projectDir:e,dependencies:["drizzle-kit"],devMode:!0}),u({projectDir:e,dependencies:["drizzle-orm",{sqlite:"@libsql/client",mysql:"mysql2",postgresql:"postgres"}[i]],devMode:!1});let o=S.join(c,"template/packages"),r=S.join(o,"config/drizzle",{sqlite:"with-sqlite",mysql:"with-mysql",postgresql:"with-postgresql"}[i]+".ts"),p=S.join(e,"drizzle.config.ts"),d=S.join(o,"src/server/db/schema-drizzle",t?`with-authjs-${i}.ts`:n?`with-better-auth-${i}.ts`:`base-${i}.ts`),m=S.join(e,"src/server/db/schema.ts"),f=_.readFileSync(d,"utf-8");f=f.replace("project1_${name}",`${a}_\${name}`);let h=_.readFileSync(r,"utf-8");h=h.replace("project1_*",`${a}_*`);let y=S.join(o,`src/server/db/index-drizzle/with-${i}.ts`),T=S.join(e,"src/server/db/index.ts");v({projectDir:e,scripts:{"db:generate":"drizzle-kit generate","db:migrate":"drizzle-kit migrate","db:push":"drizzle-kit push","db:studio":"drizzle-kit studio"}}),_.copySync(r,p),_.mkdirSync(S.dirname(m),{recursive:!0}),_.writeFileSync(m,f),_.writeFileSync(p,h),_.copySync(y,T)};import $ from"path";import K from"fs-extra";var ue=({projectDir:e,scopedAppName:s,packages:a,databaseProvider:i})=>{let t=a?.envVariables.inUse,n=a?.authjs.inUse,o=a?.betterAuth.inUse,r=a?.prisma.inUse,p=a?.drizzle.inUse,d=a?.payload.inUse,m=[];t&&(m.push("@t3-oss/env-nextjs"),m.push("zod")),u({projectDir:e,dependencies:m,devMode:!1});let f=r||p||d,h=ct(!!n,!!o,!!r,!!p,!!d,s,i),y="";if(f?n?y="with-authjs-db.js":o?y="with-better-auth-db.js":d?y="with-payload.js":y="with-db.js":n?y="with-authjs.js":o&&(y="with-better-auth.js"),y!==""){let tt=$.join(c,"template/packages/src/env",y),st=$.join(e,"src/env.ts");K.copyFileSync(tt,st)}let T=$.join(e,".env"),Xe=$.join(e,".env.example"),Ze=dt+h,W=Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString("base64"),et=h.replace('AUTH_SECRET=""',`AUTH_SECRET="${W}" # Generated by create-lx2-app`).replace('BETTER_AUTH_SECRET=""',`BETTER_AUTH_SECRET="${W}" # Generated by create-lx2-app`).replace('PAYLOAD_SECRET=""',`PAYLOAD_SECRET="${W}" # Generated by create-lx2-app`);K.writeFileSync(T,et,"utf-8"),K.writeFileSync(Xe,Ze,"utf-8")};function ct(e,s,a,i,t,n,o){let r=`
6
+ `,O="my-lx2-app",J="create-lx2-app";var b=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":"npm":"npm"};import P from"path";import V from"fs-extra";var oe={"next-auth":"^5.0.0-beta.25","@auth/prisma-adapter":"^2.11.1","@auth/drizzle-adapter":"^1.11.1","better-auth":"^1.4.1","better-sqlite3":"^12.4.6","@types/better-sqlite3":"^7.6.13",prisma:"^7.0.0","@prisma/client":"^7.0.0","drizzle-orm":"^0.44.7","drizzle-kit":"^0.31.7","@libsql/client":"^0.15.15",mysql2:"^3.15.3",postgres:"^3.4.7","@t3-oss/env-nextjs":"^0.13.8",zod:"^4.1.13",prettier:"^3.6.2","prettier-plugin-tailwindcss":"^0.7.1","@ianvs/prettier-plugin-sort-imports":"^4.7.0",eslint:"^9.39.1","eslint-config-next":"^16.0.4","@eslint/eslintrc":"^3.3.1","@biomejs/biome":"^2.3.7",typescript:"^5.9.3","@types/node":"^24.9.2","@types/react":"^19.2.2","@types/react-dom":"^19.2.2",payload:"^3.64.0","@payloadcms/next":"^3.64.0","@payloadcms/payload-cloud":"^3.64.0","@payloadcms/richtext-lexical":"^3.64.0","@payloadcms/db-vercel-postgres":"^3.64.0","@payloadcms/db-sqlite":"^3.64.0",graphql:"^16.12.0",sharp:"^0.34.5"};import re from"path";import le from"fs-extra";import ot from"sort-package-json";var u=e=>{let{dependencies:s,devMode:a,projectDir:i}=e,t=le.readJsonSync(re.join(i,"package.json"));s.forEach(o=>{let r=oe[o];a&&t.devDependencies?t.devDependencies[o]=r:t.dependencies&&(t.dependencies[o]=r)});let n=ot(t);le.writeJsonSync(re.join(i,"package.json"),n,{spaces:2})};var pe=({projectDir:e,packages:s})=>{let a=s?.prisma.inUse,i=s?.drizzle.inUse,t=["next-auth"];a&&t.push("@auth/prisma-adapter"),i&&t.push("@auth/drizzle-adapter"),u({projectDir:e,dependencies:t,devMode:!1});let n=P.join(c,"template/packages"),o="src/app/api/auth/[...nextauth]/route.ts",r=P.join(n,o),p=P.join(e,o),d=P.join(n,"src/server/auth/config",a?"authjs-with-prisma.ts":i?"authjs-with-drizzle.ts":"authjs.ts"),m=P.join(e,"src/server/auth/config.ts"),f=P.join(n,"src/server/auth/authjs.ts"),h=P.join(e,"src/server/auth/index.ts");V.copySync(r,p),V.copySync(d,m),V.copySync(f,h)};import x from"path";import R from"fs-extra";import rt from"path";import ce from"fs-extra";import{sortPackageJson as lt}from"sort-package-json";function v(e){let{scripts:s,projectDir:a}=e,i=rt.join(a,"package.json"),t=ce.readJSONSync(i);t.scripts={...t.scripts,...s};let n=lt(t);ce.writeJSONSync(i,n,{spaces:2})}var de=({projectDir:e,packages:s,databaseProvider:a})=>{let i=s?.prisma.inUse,t=s?.drizzle.inUse,n=["better-auth"],o=[];(!i||!t)&&n.push("better-sqlite3"),(!i||!t)&&o.push("@types/better-sqlite3"),u({projectDir:e,dependencies:n,devMode:!1}),u({projectDir:e,dependencies:o,devMode:!0});let r=x.join(c,"template/packages"),p=x.join(r,"src/app/api/auth/[...betterauth]/route.ts"),d=x.join(e,"src/app/api/auth/[...all]/route.ts"),m=x.join(r,"src/server/auth",i?"better-auth-with-prisma.ts":t?"better-auth-with-drizzle.ts":"better-auth.ts"),f=R.readFileSync(m,"utf-8");(i||t)&&a!=="sqlite"&&(f=f.replace('provider: "sqlite",',`provider: "${{mysql:"mysql",postgresql:t?"pg":"postgresql"}[a]}",`));let h=x.join(e,"src/server/auth/index.ts");R.mkdirSync(x.dirname(h),{recursive:!0}),R.writeFileSync(h,f);let y=x.join(r,"src/lib/auth/better-auth-client.ts"),T=x.join(e,"src/lib/auth/client.ts");v({projectDir:e,scripts:{"auth:generate":"npx @better-auth/cli@latest generate --config ./src/server/auth/index.ts --yes",...!i&&!t&&{"auth:migrate":"npx @better-auth/cli@latest migrate --config ./src/server/auth/index.ts --yes"}}}),R.copySync(p,d),R.copySync(y,T)};import H from"path";import pt from"fs-extra";var me=({projectDir:e})=>{u({projectDir:e,dependencies:["@biomejs/biome"],devMode:!0});let s=H.join(c,"template/packages"),a=H.join(s,"config/biome.jsonc"),i=H.join(e,"biome.jsonc");pt.copyFileSync(a,i),v({projectDir:e,scripts:{"lint:unsafe":"biome check --write --unsafe .","lint:write":"biome check --write .",lint:"biome check .",format:"biome format --write ."}})};import S from"path";import _ from"fs-extra";var fe=({projectDir:e,packages:s,scopedAppName:a,databaseProvider:i})=>{let t=s?.authjs.inUse,n=s?.betterAuth.inUse;u({projectDir:e,dependencies:["drizzle-kit"],devMode:!0}),u({projectDir:e,dependencies:["drizzle-orm",{sqlite:"@libsql/client",mysql:"mysql2",postgresql:"postgres"}[i]],devMode:!1});let o=S.join(c,"template/packages"),r=S.join(o,"config/drizzle",{sqlite:"with-sqlite",mysql:"with-mysql",postgresql:"with-postgresql"}[i]+".ts"),p=S.join(e,"drizzle.config.ts"),d=S.join(o,"src/server/db/schema-drizzle",t?`with-authjs-${i}.ts`:n?`with-better-auth-${i}.ts`:`base-${i}.ts`),m=S.join(e,"src/server/db/schema.ts"),f=_.readFileSync(d,"utf-8");f=f.replace("project1_${name}",`${a}_\${name}`);let h=_.readFileSync(r,"utf-8");h=h.replace("project1_*",`${a}_*`);let y=S.join(o,`src/server/db/index-drizzle/with-${i}.ts`),T=S.join(e,"src/server/db/index.ts");v({projectDir:e,scripts:{"db:generate":"drizzle-kit generate","db:migrate":"drizzle-kit migrate","db:push":"drizzle-kit push","db:studio":"drizzle-kit studio"}}),_.copySync(r,p),_.mkdirSync(S.dirname(m),{recursive:!0}),_.writeFileSync(m,f),_.writeFileSync(p,h),_.copySync(y,T)};import $ from"path";import K from"fs-extra";var ue=({projectDir:e,scopedAppName:s,packages:a,databaseProvider:i})=>{let t=a?.envVariables.inUse,n=a?.authjs.inUse,o=a?.betterAuth.inUse,r=a?.prisma.inUse,p=a?.drizzle.inUse,d=a?.payload.inUse,m=[];t&&(m.push("@t3-oss/env-nextjs"),m.push("zod")),u({projectDir:e,dependencies:m,devMode:!1});let f=r||p||d,h=ct(!!n,!!o,!!r,!!p,!!d,s,i),y="";if(f?n?y="with-authjs-db.js":o?y="with-better-auth-db.js":d?y="with-payload.js":y="with-db.js":n?y="with-authjs.js":o&&(y="with-better-auth.js"),y!==""){let tt=$.join(c,"template/packages/src/env",y),st=$.join(e,"src/env.ts");K.copyFileSync(tt,st)}let T=$.join(e,".env"),Xe=$.join(e,".env.example"),Ze=dt+h,W=Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString("base64"),et=h.replace('AUTH_SECRET=""',`AUTH_SECRET="${W}" # Generated by create-lx2-app`).replace('BETTER_AUTH_SECRET=""',`BETTER_AUTH_SECRET="${W}" # Generated by create-lx2-app`).replace('PAYLOAD_SECRET=""',`PAYLOAD_SECRET="${W}" # Generated by create-lx2-app`);K.writeFileSync(T,et,"utf-8"),K.writeFileSync(Xe,Ze,"utf-8")};function ct(e,s,a,i,t,n,o){let r=`
7
7
  # When adding additional environment variables, the schema in "/src/env.ts"
8
8
  # should be updated accordingly.
9
9
  `.trim().concat(`
@@ -58,7 +58,7 @@ DISCORD_CLIENT_SECRET=""
58
58
  package manager such as pnpm, npm, or Yarn Classic.
59
59
  See: https://github.com/t3-oss/create-t3-app/issues/57`);let a=s.args[0];if(a&&(e.appName=a),e.flags=s.opts(),e.flags.CI){switch(e.packages=[],e.flags.backend){case"payload":e.packages.push("payload");break;default:break}switch(e.flags.authentication){case"authjs":e.packages.push("authjs");break;case"betterAuth":e.packages.push("betterAuth");break;default:break}switch(e.flags.orm){case"prisma":e.packages.push("prisma");break;case"drizzle":e.packages.push("drizzle");break;default:break}switch(e.flags.linter){case"eslint/prettier":e.packages.push("eslint/prettier");break;case"biome":e.packages.push("biome");break;default:break}return F.includes(e.flags.dbProvider)===!1&&(l.warn(`Incompatible database provided. Use: ${F.join(", ")}. Exiting.`),process.exit(0)),e.flags.backend==="payload"&&e.flags.dbProvider==="mysql"&&(l.warn("Payload CMS does not support MySQL. Exiting."),process.exit(0)),e}if(e.flags.default)return e;try{if(process.env.TERM_PROGRAM?.toLowerCase().includes("mintty"))throw l.warn(` WARNING: It looks like you are using MinTTY, which is non-interactive. This is most likely because you are
60
60
  using Git Bash. If that's that case, please use Git Bash from another terminal, such as Windows Terminal. Alternatively, you
61
- can provide the arguments from the CLI directly: https://create.lx2.dev/docs/getting-started#experimental-ci-flags to skip the prompts.`),new E("Non-interactive environment");let i=b(),t={};a||(t.name=await je({message:"What will your project be called?",default:O,validate:o=>_e(o)})),t.backend=await D({message:"What backend framework would you like to use?",choices:[{value:"nextjs",name:"Next.js"},{value:"payload",name:"Payload CMS"}],default:!g.flags.backend}),t.backend==="payload"&&(t.databaseProvider=await D({message:"What database provider would you like to use?",choices:[{value:"sqlite",name:"SQLite"},{value:"postgresql",name:"PostgreSQL"}],default:!g.flags.dbProvider})),t.backend==="nextjs"&&(t.authentication=await D({message:"What authentication provider would you like to use?",choices:[{value:"none",name:"None"},{value:"authjs",name:"Auth.js"},{value:"betterAuth",name:"Better Auth"}],default:!g.flags.authentication}),t.orm=await D({message:"What database ORM would you like to use?",choices:[{value:"none",name:"None"},{value:"prisma",name:"Prisma"},{value:"drizzle",name:"Drizzle"}],default:!g.flags.orm}),t.orm!=="none"&&(t.databaseProvider=await D({message:"What database provider would you like to use?",choices:[{value:"sqlite",name:"SQLite"},{value:"mysql",name:"MySQL"},{value:"postgresql",name:"PostgreSQL"}],default:!g.flags.dbProvider}))),t.linter=await D({message:"What linter and formatter would you like to use?",choices:[{value:"eslint/prettier",name:"ESLint/Prettier"},{value:"biome",name:"Biome"}],default:!g.flags.linter}),e.flags.git||(t.git=await Y({message:"Should we initialize a Git repository and stage the changes?",default:!g.flags.git})),e.flags.install||(t.install=await Y({message:`Should we run '${i}`+(i==="yarn"?"'?":" install' for you?"),default:!g.flags.install})),t.importAlias=await je({message:"What import alias would you like to use?",default:g.flags.importAlias,validate:Ae});let n=[];switch(t.backend){case"payload":n.push("payload");break;default:break}switch(t.authentication){case"authjs":n.push("authjs");break;case"betterAuth":n.push("betterAuth");break;default:break}switch(t.orm){case"prisma":n.push("prisma");break;case"drizzle":n.push("drizzle");break;default:break}switch(t.linter){case"eslint/prettier":n.push("eslint/prettier");break;case"biome":n.push("biome");break;default:break}return{appName:t.name??e.appName,packages:n,flags:{...e.flags,git:t.git||e.flags.git,install:t.install||e.flags.install,importAlias:t.importAlias??e.flags.importAlias},databaseProvider:t.databaseProvider||"sqlite"}}catch(i){if(i instanceof E)l.warn(`${J} needs an interactive terminal to run.`),await Y({message:"Continue scaffolding with default options?",default:!0})||(l.info("Exiting..."),process.exit(0)),l.info(`Scaffolding default lx2 app in ./${e.appName}`);else throw i}return e}import kt from"path";import ze from"chalk";import yt from"ora";function Ce(e){let{packages:s}=e;l.info("Adding boilerplate...");for(let[a,i]of Object.entries(s))if(i.inUse){let t=yt(`Boilerplating ${a}...`).start();i.installer(e),t.succeed(ze.green(`${ze.green.bold(a)}`))}l.info("")}import Q from"path";import{confirm as bt,select as vt}from"@inquirer/prompts";import j from"chalk";import M from"fs-extra";import wt from"ora";async function De({projectName:e,projectDir:s,pkgManager:a,install:i}){let t=Q.join(c,"template/base");i?l.info(""):l.info(`
61
+ can provide the arguments from the CLI directly: https://create.lx2.dev/docs/getting-started#experimental-ci-flags to skip the prompts.`),new E("Non-interactive environment");let i=b(),t={};a||(t.name=await je({message:"What will your project be called?",default:O,validate:o=>_e(o)})),t.backend=await D({message:"What backend framework would you like to use?",choices:[{value:"nextjs",name:"Next.js"},{value:"payload",name:"Payload CMS"}],default:!g.flags.backend}),t.backend==="payload"&&(t.databaseProvider=await D({message:"What database provider would you like to use?",choices:[{value:"sqlite",name:"SQLite"},{value:"postgresql",name:"PostgreSQL"}],default:!g.flags.dbProvider})),t.backend==="nextjs"&&(t.authentication=await D({message:"What authentication provider would you like to use?",choices:[{value:"none",name:"None"},{value:"authjs",name:"Auth.js"},{value:"betterAuth",name:"Better Auth"}],default:!g.flags.authentication}),t.orm=await D({message:"What database ORM would you like to use?",choices:[{value:"none",name:"None"},{value:"prisma",name:"Prisma"},{value:"drizzle",name:"Drizzle"}],default:!g.flags.orm}),t.orm!=="none"&&(t.databaseProvider=await D({message:"What database provider would you like to use?",choices:[{value:"sqlite",name:"SQLite"},{value:"mysql",name:"MySQL"},{value:"postgresql",name:"PostgreSQL"}],default:!g.flags.dbProvider}))),t.linter=await D({message:"What linter and formatter would you like to use?",choices:[{value:"eslint/prettier",name:"ESLint/Prettier"},{value:"biome",name:"Biome"}],default:!g.flags.linter}),e.flags.git||(t.git=await Y({message:"Should we initialize a Git repository and stage the changes?",default:!g.flags.git})),e.flags.install||(t.install=await Y({message:`Should we run '${i}`+(i==="yarn"?"'?":" install' for you?"),default:!g.flags.install})),t.importAlias=await je({message:"What import alias would you like to use?",default:g.flags.importAlias,validate:Ae});let n=[];switch(t.backend){case"payload":n.push("payload");break;default:break}switch(t.authentication){case"authjs":n.push("authjs");break;case"betterAuth":n.push("betterAuth");break;default:break}switch(t.orm){case"prisma":n.push("prisma");break;case"drizzle":n.push("drizzle");break;default:break}switch(t.linter){case"eslint/prettier":n.push("eslint/prettier");break;case"biome":n.push("biome");break;default:break}return{appName:t.name??e.appName,packages:n,flags:{...e.flags,git:t.git??e.flags.git,install:t.install??e.flags.install,importAlias:t.importAlias??e.flags.importAlias},databaseProvider:t.databaseProvider??"sqlite"}}catch(i){if(i instanceof E)l.warn(`${J} needs an interactive terminal to run.`),await Y({message:"Continue scaffolding with default options?",default:!0})||(l.info("Exiting..."),process.exit(0)),l.info(`Scaffolding default lx2 app in ./${e.appName}`);else throw i}return e}import kt from"path";import ze from"chalk";import yt from"ora";function Ce(e){let{packages:s}=e;l.info("Adding boilerplate...");for(let[a,i]of Object.entries(s))if(i.inUse){let t=yt(`Boilerplating ${a}...`).start();i.installer(e),t.succeed(ze.green(`${ze.green.bold(a)}`))}l.info("")}import Q from"path";import{confirm as bt,select as vt}from"@inquirer/prompts";import j from"chalk";import M from"fs-extra";import wt from"ora";async function De({projectName:e,projectDir:s,pkgManager:a,install:i}){let t=Q.join(c,"template/base");i?l.info(""):l.info(`
62
62
  Using: ${j.cyan.bold(a)}
63
63
  `);let n=wt(`Scaffolding in: ${s}...
64
64
  `).start();if(M.existsSync(s))if(M.readdirSync(s).length===0)e!=="."&&n.info(`${j.cyan.bold(e)} exists but is empty, continuing...
@@ -68,4 +68,4 @@ Using: ${j.cyan.bold(a)}
68
68
  `).start(),a=te(e),i=await se(e),t=Z.parse(e).name;if(i&&a){if(s.stop(),!await Me({message:`${U.redBright.bold("Warning:")} Git is already initialized in "${t}". Initializing a new git repository would delete the previous history. Would you like to continue anyways?`,default:!1})){s.info("Skipping Git initialization.");return}Ue.removeSync(Z.join(e,".git"))}else if(i&&!a&&(s.stop(),!await Me({message:`${U.redBright.bold("Warning:")} "${t}" is already in a git worktree. Would you still like to initialize a new git repository in this directory?`,default:!1}))){s.info("Skipping Git initialization.");return}try{let n=_t(),{major:o,minor:r}=Pt();o<2||o==2&&r<28?(await q("git",["init"],{cwd:e}),await q("git",["symbolic-ref","HEAD",`refs/heads/${n}`],{cwd:e})):await q("git",["init",`--initial-branch=${n}`],{cwd:e}),await q("git",["add","."],{cwd:e}),s.succeed(`${U.green("Successfully initialized and staged")} ${U.green.bold("git")}
69
69
  `)}catch{s.fail(`${U.bold.red("Failed:")} could not initialize git. Update git to the latest version!
70
70
  `)}}import At from"chalk";import{execa as $e}from"execa";import Le from"ora";var ie=async(e,s,a)=>{let{onDataHandle:i,args:t=["install"],stdout:n="pipe"}=a,o=Le(`Running ${s} install...`).start(),r=$e(s,t,{cwd:e,stdout:n});return await new Promise((p,d)=>{i&&r.stdout?.on("data",i(o)),r.on("error",m=>d(m)),r.on("close",()=>p())}),o},jt=async(e,s)=>{switch(e){case"npm":return await $e(e,["install"],{cwd:s,stderr:"inherit"}),null;case"pnpm":return ie(s,e,{onDataHandle:a=>i=>{let t=i.toString();t.includes("Progress")&&(a.text=t.includes("|")?t.split(" | ")[1]??"":t)}});case"yarn":return ie(s,e,{onDataHandle:a=>i=>{a.text=i.toString()}});case"bun":return ie(s,e,{stdout:"ignore"})}},Fe=async({projectDir:e})=>{l.info("Installing dependencies...");let s=b();(await jt(s,e)??Le()).succeed(At.green(`Successfully installed dependencies!
71
- `))};var Be=async({projectName:e=O,packages:s,install:a,projectDir:i,databaseProvider:t})=>{let n=b();l.info("Next steps:"),e!=="."&&l.info(` cd ${e}`),a===!0&&(n==="yarn"?l.info(` ${n}`):l.info(` ${n} install`)),["postgresql","mysql"].includes(t)&&l.info(" Add your database connection string to .env"),s?.authjs.inUse&&l.info(" Fill in your .env with necessary values. See https://create.lx2.dev/docs/first-steps for more info."),s?.betterAuth.inUse&&l.info(" Fill in your .env with necessary values. See https://create.lx2.dev/docs/first-steps for more info."),s?.prisma.inUse&&l.info(` Run "${n} db:push" to create you database tables.`),["npm"].includes(n)?l.info(` ${n} run dev`):l.info(` ${n} dev`),!await se(i)&&!te(i)&&l.info(" git init"),l.info(' git commit -m "initial commit"')};import G from"fs";import It from"path";function Ne(e,s,a){G.readdirSync(e).forEach(t=>{let n=It.join(e,t);if(G.statSync(n).isDirectory())Ne(n,s,a);else{let r=G.readFileSync(n,"utf8").replace(new RegExp(s,"g"),a);G.writeFileSync(n,r,"utf8")}})}function Ge(e,s){let a=s.replace(/\*/g,"").replace(/[^\/]$/,"$&/");Ne(e,"@/",a)}import We from"path";function Je(e){let a=N(e).split("/"),i=a[a.length-1];if(i==="."){let o=We.resolve(process.cwd());i=We.basename(o)}let t=a.findIndex(o=>o.startsWith("@"));a.findIndex(o=>o.startsWith("@"))!==-1&&(i=a.slice(t).join("/"));let n=a.filter(o=>!o.startsWith("@")).join("/");return[i,n]}import zt from"gradient-string";var Ct={primary:"#bf95f9",accent:"#6071a4",secondary:"#ff7ac5"};function Ve(){let e=zt(Object.values(Ct)),s=b();(s==="yarn"||s==="pnpm")&&console.log(""),console.log(e.multiline(ne))}import{execSync as Dt}from"child_process";import Tt from"https";function He(e){let s=C();s.includes("beta")?(l.warn(" You are using a beta version of create-lx2-app."),l.warn(" Please report any bugs you encounter.")):s!==e&&(l.warn(" You are using an outdated version of create-lx2-app."),l.warn(" Your version:",s+".","Latest version in the npm registry:",e),l.warn(" Please run the CLI with @latest to get the latest updates.")),console.log("")}function Ot(){return new Promise((e,s)=>{Tt.get("https://registry.npmjs.org/-/package/create-lx2-app/dist-tags",a=>{if(a.statusCode===200){let i="";a.on("data",t=>i+=t),a.on("end",()=>{e(JSON.parse(i).latest)})}else s()}).on("error",()=>{s()})})}var Ke=()=>Ot().catch(()=>{try{return Dt("npm view create-lx2-app version").toString().trim()}catch{return null}});async function Et(){let e=await Ke(),s=b();Ve(),e&&He(e);let{appName:a,packages:i,flags:{git:t,install:n,importAlias:o},databaseProvider:r}=await Ie(),p=Pe(i),[d,m]=Je(a),f=await Ee({projectName:m,scopedAppName:d,packages:p,install:n,databaseProvider:r}),h=Qe.readJsonSync(Ye.join(f,"package.json"));h.name=d,h.clx2aMetadata={initVersion:C()};let{stdout:y}=await Rt(s,["-v"],{cwd:f});h.packageManager=`${s}@${y.trim()}`,Qe.writeJSONSync(Ye.join(f,"package.json"),h,{spaces:2}),o!=="@/"&&Ge(f,o),n&&await Fe({projectDir:f}),t&&await qe(f),await Be({projectDir:f,projectName:m,packages:p,install:n,databaseProvider:r}),process.exit(0)}Et().catch(e=>{l.error("Aborting installation..."),e instanceof Error?l.error(e.message):(l.error("An unknown error occurred. Please open an issue on GitHub with the below:"),console.error(e)),process.exit(1)});
71
+ `))};var Be=async({projectName:e=O,packages:s,install:a,projectDir:i,databaseProvider:t})=>{let n=b();l.info("Next steps:"),e!=="."&&l.info(` cd ${e}`),a===!1&&(n==="yarn"?l.info(` ${n}`):l.info(` ${n} install`)),["postgresql","mysql"].includes(t)&&l.info(" Add your database connection string to .env"),s?.authjs.inUse&&l.info(" Fill in your .env with necessary values. See https://create.lx2.dev/docs/first-steps for more info."),s?.betterAuth.inUse&&l.info(" Fill in your .env with necessary values. See https://create.lx2.dev/docs/first-steps for more info."),s?.prisma.inUse&&l.info(` Run "${n} db:push" to create you database tables.`),["npm"].includes(n)?l.info(` ${n} run dev`):l.info(` ${n} dev`),!await se(i)&&!te(i)&&l.info(" git init"),l.info(' git commit -m "initial commit"')};import G from"fs";import It from"path";function Ne(e,s,a){G.readdirSync(e).forEach(t=>{let n=It.join(e,t);if(G.statSync(n).isDirectory())Ne(n,s,a);else{let r=G.readFileSync(n,"utf8").replace(new RegExp(s,"g"),a);G.writeFileSync(n,r,"utf8")}})}function Ge(e,s){let a=s.replace(/\*/g,"").replace(/[^\/]$/,"$&/");Ne(e,"@/",a)}import We from"path";function Je(e){let a=N(e).split("/"),i=a[a.length-1];if(i==="."){let o=We.resolve(process.cwd());i=We.basename(o)}let t=a.findIndex(o=>o.startsWith("@"));a.findIndex(o=>o.startsWith("@"))!==-1&&(i=a.slice(t).join("/"));let n=a.filter(o=>!o.startsWith("@")).join("/");return[i,n]}import zt from"gradient-string";var Ct={primary:"#bf95f9",accent:"#6071a4",secondary:"#ff7ac5"};function Ve(){let e=zt(Object.values(Ct)),s=b();(s==="yarn"||s==="pnpm")&&console.log(""),console.log(e.multiline(ne))}import{execSync as Dt}from"child_process";import Tt from"https";function He(e){let s=C();s.includes("beta")?(l.warn(" You are using a beta version of create-lx2-app."),l.warn(" Please report any bugs you encounter.")):s!==e&&(l.warn(" You are using an outdated version of create-lx2-app."),l.warn(" Your version:",s+".","Latest version in the npm registry:",e),l.warn(" Please run the CLI with @latest to get the latest updates.")),console.log("")}function Ot(){return new Promise((e,s)=>{Tt.get("https://registry.npmjs.org/-/package/create-lx2-app/dist-tags",a=>{if(a.statusCode===200){let i="";a.on("data",t=>i+=t),a.on("end",()=>{e(JSON.parse(i).latest)})}else s()}).on("error",()=>{s()})})}var Ke=()=>Ot().catch(()=>{try{return Dt("npm view create-lx2-app version").toString().trim()}catch{return null}});async function Et(){let e=await Ke(),s=b();Ve(),e&&He(e);let{appName:a,packages:i,flags:{git:t,install:n,importAlias:o},databaseProvider:r}=await Ie(),p=Pe(i),[d,m]=Je(a),f=await Ee({projectName:m,scopedAppName:d,packages:p,install:n,databaseProvider:r}),h=Qe.readJsonSync(Ye.join(f,"package.json"));if(h.name=d,h.clx2aMetadata={initVersion:C()},s!=="bun"){let{stdout:y}=await Rt(s,["-v"],{cwd:f});h.packageManager=`${s}@${y.trim()}`}Qe.writeJSONSync(Ye.join(f,"package.json"),h,{spaces:2}),o!=="@/"&&Ge(f,o),n&&await Fe({projectDir:f}),t&&await qe(f),await Be({projectDir:f,projectName:m,packages:p,install:n,databaseProvider:r}),process.exit(0)}Et().catch(e=>{l.error("Aborting installation..."),e instanceof Error?l.error(e.message):(l.error("An unknown error occurred. Please open an issue on GitHub with the below:"),console.error(e)),process.exit(1)});
package/package.json CHANGED
@@ -1,92 +1,99 @@
1
1
  {
2
- "name": "create-lx2-app",
3
- "version": "0.11.1-beta.c28ae83",
4
- "description": "The Most Opinionated Way to Build Next.js Apps",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/slickyeet/create-lx2-app",
9
- "directory": "cli"
10
- },
11
- "keywords": [
12
- "create-lx2-app",
13
- "lx2-app",
14
- "typescript",
15
- "next.js",
16
- "tailwind"
17
- ],
18
- "type": "module",
19
- "exports": "./dist/index.js",
20
- "bin": {
21
- "create-lx2-app": "./dist/index.js"
22
- },
23
- "files": [
24
- "dist",
25
- "template",
26
- "README.md",
27
- "LICENSE",
28
- "package.json"
29
- ],
30
- "engines": {
31
- "node": ">=18"
32
- },
33
- "scripts": {
34
- "dev": "tsup --watch",
35
- "build": "tsup",
36
- "start": "node dist/index.js",
37
- "format": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --write",
38
- "format:check": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --check",
39
- "typecheck": "tsc",
40
- "clean": "rm -rf dist .turbo node_modules",
41
- "link": "pnpm run build && npm link",
42
- "release": "changeset version",
43
- "pub:beta": "pnpm run build && npm publish --tag beta",
44
- "pub:release": "pnpm run build && npm publish"
45
- },
46
- "dependencies": {
47
- "@inquirer/prompts": "^7.4.0",
48
- "chalk": "^5.4.1",
49
- "commander": "^13.1.0",
50
- "execa": "^9.5.2",
51
- "fs-extra": "^11.3.0",
52
- "gradient-string": "^3.0.0",
53
- "ora": "^8.2.0",
54
- "sort-package-json": "^3.0.0"
55
- },
56
- "devDependencies": {
57
- "@auth/prisma-adapter": "^2.8.0",
58
- "@eslint/eslintrc": "^3.3.1",
59
- "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
60
- "@payloadcms/db-sqlite": "^3.33.0",
61
- "@payloadcms/db-vercel-postgres": "^3.33.0",
62
- "@payloadcms/next": "^3.33.0",
63
- "@payloadcms/payload-cloud": "^3.33.0",
64
- "@payloadcms/richtext-lexical": "^3.33.0",
65
- "@prisma/client": "^6.5.0",
66
- "@t3-oss/env-nextjs": "^0.13.8",
67
- "@types/better-sqlite3": "^7.6.13",
68
- "@types/fs-extra": "^11.0.4",
69
- "@types/node": "^24",
70
- "@types/react": "^19",
71
- "@types/react-dom": "^19",
72
- "better-auth": "^1.2.7",
73
- "better-sqlite3": "^11.9.1",
74
- "eslint": "^9.38.0",
75
- "eslint-config-next": "^16.0.1",
76
- "graphql": "^16.10.0",
77
- "next": "^16.0.1",
78
- "next-auth": "^5.0.0-beta.25",
79
- "payload": "^3.33.0",
80
- "prettier": "^3.6.2",
81
- "prettier-plugin-tailwindcss": "^0.7.1",
82
- "prisma": "^6.5.0",
83
- "react": "^19.2.0",
84
- "react-dom": "^19.2.0",
85
- "sharp": "^0.34.1",
86
- "tailwindcss": "^4.1.16",
87
- "tsup": "^8.4.0",
88
- "type-fest": "^4.37.0",
89
- "typescript": "^5.9.3",
90
- "zod": "^4.1.12"
91
- }
92
- }
2
+ "name": "create-lx2-app",
3
+ "version": "0.11.1",
4
+ "description": "The Most Opinionated Way to Build Next.js Apps",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/slickyeet/create-lx2-app",
9
+ "directory": "cli"
10
+ },
11
+ "keywords": [
12
+ "create-lx2-app",
13
+ "lx2-app",
14
+ "typescript",
15
+ "next.js",
16
+ "tailwind"
17
+ ],
18
+ "type": "module",
19
+ "exports": "./dist/index.js",
20
+ "bin": {
21
+ "create-lx2-app": "./dist/index.js"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "template",
26
+ "README.md",
27
+ "LICENSE",
28
+ "package.json"
29
+ ],
30
+ "engines": {
31
+ "node": ">=18"
32
+ },
33
+ "dependencies": {
34
+ "@inquirer/prompts": "^8.0.1",
35
+ "chalk": "^5.6.2",
36
+ "commander": "^14.0.2",
37
+ "execa": "^9.6.0",
38
+ "fs-extra": "^11.3.2",
39
+ "gradient-string": "^3.0.0",
40
+ "ora": "^9.0.0",
41
+ "sort-package-json": "^3.4.0"
42
+ },
43
+ "devDependencies": {
44
+ "@auth/drizzle-adapter": "^1.11.1",
45
+ "@auth/prisma-adapter": "^2.11.1",
46
+ "@biomejs/biome": "^2.3.7",
47
+ "@eslint/eslintrc": "^3.3.1",
48
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
49
+ "@libsql/client": "^0.15.15",
50
+ "@payloadcms/db-sqlite": "^3.64.0",
51
+ "@payloadcms/db-vercel-postgres": "^3.64.0",
52
+ "@payloadcms/next": "^3.64.0",
53
+ "@payloadcms/payload-cloud": "^3.64.0",
54
+ "@payloadcms/richtext-lexical": "^3.64.0",
55
+ "@prisma/client": "^7.0.0",
56
+ "@t3-oss/env-nextjs": "^0.13.8",
57
+ "@types/better-sqlite3": "^7.6.13",
58
+ "@types/fs-extra": "^11.0.4",
59
+ "@types/node": "^24.10.1",
60
+ "@types/react": "^19.2.7",
61
+ "@types/react-dom": "^19.2.3",
62
+ "better-auth": "^1.4.1",
63
+ "better-sqlite3": "^12.4.6",
64
+ "drizzle-kit": "^0.31.7",
65
+ "drizzle-orm": "^0.44.7",
66
+ "eslint": "^9.39.1",
67
+ "eslint-config-next": "^16.0.4",
68
+ "graphql": "^16.12.0",
69
+ "mysql2": "^3.15.3",
70
+ "next": "^16.0.4",
71
+ "next-auth": "^5.0.0-beta.25",
72
+ "payload": "^3.64.0",
73
+ "postgres": "^3.4.7",
74
+ "prettier": "^3.6.2",
75
+ "prettier-plugin-tailwindcss": "^0.7.1",
76
+ "prisma": "^7.0.0",
77
+ "react": "^19.2.0",
78
+ "react-dom": "^19.2.0",
79
+ "sharp": "^0.34.5",
80
+ "tailwindcss": "^4.1.17",
81
+ "tsup": "^8.5.1",
82
+ "type-fest": "^5.2.0",
83
+ "typescript": "^5.9.3",
84
+ "zod": "^4.1.13"
85
+ },
86
+ "scripts": {
87
+ "dev": "tsup --watch",
88
+ "build": "tsup",
89
+ "start": "node dist/index.js",
90
+ "format": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --write",
91
+ "format:check": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --check",
92
+ "typecheck": "tsc",
93
+ "clean": "rm -rf dist .turbo node_modules",
94
+ "link": "pnpm run build && npm link",
95
+ "release": "changeset version",
96
+ "pub:beta": "pnpm run build && npm publish --tag beta",
97
+ "pub:release": "pnpm run build && npm publish"
98
+ }
99
+ }
@@ -4,8 +4,8 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "next dev --turbopack",
8
- "build": "next build --turbopack",
7
+ "dev": "next dev",
8
+ "build": "next build",
9
9
  "start": "next start"
10
10
  },
11
11
  "dependencies": {
@@ -13,7 +13,7 @@ export const env = createEnv({
13
13
  : z.string().optional(),
14
14
  DISCORD_CLIENT_ID: z.string(),
15
15
  DISCORD_CLIENT_SECRET: z.string(),
16
- DATABASE_URL: z.string().url(),
16
+ DATABASE_URL: z.url(),
17
17
  NODE_ENV: z
18
18
  .enum(["development", "test", "production"])
19
19
  .default("development"),
@@ -10,7 +10,7 @@ export const env = createEnv({
10
10
  NODE_ENV: z
11
11
  .enum(["development", "test", "production"])
12
12
  .default("development"),
13
- DATABASE_URL: z.string().url(),
13
+ DATABASE_URL: z.url(),
14
14
  BETTER_AUTH_SECRET: z.string(),
15
15
  DISCORD_CLIENT_ID: z.string(),
16
16
  DISCORD_CLIENT_SECRET: z.string(),
@@ -23,7 +23,7 @@ export const env = createEnv({
23
23
  */
24
24
  client: {
25
25
  // NEXT_PUBLIC_CLIENTVAR: z.string(),
26
- NEXT_PUBLIC_BETTER_AUTH_URL: z.string().url(),
26
+ NEXT_PUBLIC_BETTER_AUTH_URL: z.url(),
27
27
  },
28
28
 
29
29
  /**
@@ -20,7 +20,7 @@ export const env = createEnv({
20
20
  */
21
21
  client: {
22
22
  // NEXT_PUBLIC_CLIENTVAR: z.string(),
23
- NEXT_PUBLIC_BETTER_AUTH_URL: z.string().url(),
23
+ NEXT_PUBLIC_BETTER_AUTH_URL: z.url(),
24
24
  },
25
25
 
26
26
  /**
@@ -7,7 +7,7 @@ export const env = createEnv({
7
7
  * isn't built with invalid env vars.
8
8
  */
9
9
  server: {
10
- DATABASE_URL: z.string().url(),
10
+ DATABASE_URL: z.url(),
11
11
  NODE_ENV: z
12
12
  .enum(["development", "test", "production"])
13
13
  .default("development"),
@@ -8,7 +8,7 @@ export const env = createEnv({
8
8
  */
9
9
  server: {
10
10
  PAYLOAD_SECRET: z.string().min(32),
11
- DATABASE_URL: z.string().url(),
11
+ DATABASE_URL: z.url(),
12
12
  NODE_ENV: z
13
13
  .enum(["development", "test", "production"])
14
14
  .default("development"),