create-better-t-stack 2.10.0 → 2.10.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/dist/index.js
CHANGED
|
@@ -133,7 +133,7 @@ import { withAccelerate } from "@prisma/extension-accelerate";
|
|
|
133
133
|
const prisma = new PrismaClient().$extends(withAccelerate());
|
|
134
134
|
|
|
135
135
|
export default prisma;
|
|
136
|
-
`;await h.writeFile(n,r.trim());let i=e.join(t,`src/db/index.ts`);if(await h.pathExists(i)){let e=await h.readFile(i,`utf8`);e.includes(`@prisma/extension-accelerate`)||(e=`import { withAccelerate } from "@prisma/extension-accelerate";\n${e}`,e=e.replace(`export const db = new PrismaClient();`,`export const db = new PrismaClient().$extends(withAccelerate());`),await h.writeFile(i,e))}return!0}catch{return o.warn(g.yellow(`Could not add Prisma Accelerate extension automatically`)),!1}}async function xe(t){let{
|
|
136
|
+
`;await h.writeFile(n,r.trim());let i=e.join(t,`src/db/index.ts`);if(await h.pathExists(i)){let e=await h.readFile(i,`utf8`);e.includes(`@prisma/extension-accelerate`)||(e=`import { withAccelerate } from "@prisma/extension-accelerate";\n${e}`,e=e.replace(`export const db = new PrismaClient();`,`export const db = new PrismaClient().$extends(withAccelerate());`),await h.writeFile(i,e))}return!0}catch{return o.warn(g.yellow(`Could not add Prisma Accelerate extension automatically`)),!1}}async function xe(t){let{packageManager:n,projectDir:r}=t,i=e.join(r,`apps/server`),a=d();a.start(`Setting up Prisma PostgreSQL`);try{await h.ensureDir(i),a.stop(`Starting Prisma setup`);let e=await ye(i,n);if(e)await L(r,e),await be(i),o.success(g.green(`Prisma PostgreSQL database configured successfully!`)),o.info(g.cyan('NOTE: Make sure to uncomment `import "dotenv/config";` in `apps/server/src/prisma.config.ts` to load environment variables.'));else{let e=d();e.start(`Setting up fallback configuration`),await L(r),e.stop(`Manual setup required`),R()}}catch(e){a.stop(g.red(`Prisma PostgreSQL setup failed`)),m.error(g.red(`Error during Prisma PostgreSQL setup: ${e instanceof Error?e.message:String(e)}`));try{await L(r),R()}catch{}o.info(`Setup completed with manual configuration required.`)}}async function Se(t,n){try{let r=e.join(t,`apps/server`,`.env`);await h.ensureDir(e.dirname(r));let i=``;await h.pathExists(r)&&(i=await h.readFile(r,`utf8`));let a=n||`postgresql://postgres:postgres@127.0.0.1:54322/postgres`,o=`DATABASE_URL="${a}"`,s=`DIRECT_URL="${a}"`;return i.includes(`DATABASE_URL=`)?i=i.replace(/DATABASE_URL=.*(\r?\n|$)/,`${o}$1`):i+=`\n${o}`,i.includes(`DIRECT_URL=`)?i=i.replace(/DIRECT_URL=.*(\r?\n|$)/,`${s}$1`):i+=`\n${s}`,await h.writeFile(r,i.trim()),!0}catch(e){return m.error(g.red(`Failed to update .env file for Supabase.`)),e instanceof Error&&m.error(e.message),!1}}function Ce(e){let t=e.match(/DB URL:\s*(postgresql:\/\/[^\s]+)/),n=t?.[1];return n||null}async function we(e,t){o.info(`Initializing Supabase project...`);try{let n=N(t,`supabase init`);return await x(n,{cwd:e,stdio:`inherit`,shell:!0}),o.success(`Supabase project initialized successfully.`),!0}catch(e){return m.error(g.red(`Failed to initialize Supabase project.`)),e instanceof Error?m.error(e.message):m.error(String(e)),e instanceof Error&&e.message.includes(`ENOENT`)&&(o.error(g.red(`Supabase CLI not found. Please install it globally or ensure it's in your PATH.`)),o.info(`You can install it using: npm install -g supabase`)),!1}}async function Te(e,t){o.info(`Starting Supabase services (this may take a moment)...`);let n=N(t,`supabase start`);try{let t=x(n,{cwd:e,shell:!0}),r=``;return t.stdout&&t.stdout.on(`data`,e=>{let t=e.toString();process.stdout.write(t),r+=t}),t.stderr&&t.stderr.pipe(process.stderr),await t,await new Promise(e=>setTimeout(e,100)),r}catch(e){m.error(g.red(`Failed to start Supabase services.`));let t=e;return t?.message?(m.error(`Error details: ${t.message}`),t.message.includes(`Docker is not running`)&&o.error(g.red(`Docker is not running. Please start Docker and try again.`))):m.error(String(e)),null}}function z(e){o.info(`"Manual Supabase Setup Instructions:"
|
|
137
137
|
1. Ensure Docker is installed and running.
|
|
138
138
|
2. Install the Supabase CLI (e.g., \`npm install -g supabase\`).
|
|
139
139
|
3. Run \`supabase init\` in your project's \`apps/server\` directory.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.1",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|