create-better-t-stack 3.1.2 → 3.1.4

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createBtsCli } from "./src-D0KtbO1R.js";
2
+ import { createBtsCli } from "./src-DfqHfdEO.js";
3
3
 
4
4
  //#region src/cli.ts
5
5
  createBtsCli().run();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { builder, createBtsCli, docs, init, router, sponsors } from "./src-D0KtbO1R.js";
2
+ import { builder, createBtsCli, docs, init, router, sponsors } from "./src-DfqHfdEO.js";
3
3
 
4
4
  export { builder, createBtsCli, docs, init, router, sponsors };
@@ -4184,7 +4184,7 @@ function getFrontendType(frontend) {
4184
4184
  hasNative: frontend.some((f) => nativeFrontends.includes(f))
4185
4185
  };
4186
4186
  }
4187
- function getApiDependencies(api, frontendType) {
4187
+ function getApiDependencies(api, frontendType, backend) {
4188
4188
  const deps = {};
4189
4189
  if (api === "orpc") deps.server = { dependencies: [
4190
4190
  "@orpc/server",
@@ -4193,6 +4193,11 @@ function getApiDependencies(api, frontendType) {
4193
4193
  "@orpc/zod"
4194
4194
  ] };
4195
4195
  else if (api === "trpc") deps.server = { dependencies: ["@trpc/server", "@trpc/client"] };
4196
+ if (backend !== "self" && backend !== "convex" && backend !== "none") {
4197
+ if (!deps.server) deps.server = { dependencies: [] };
4198
+ if (backend === "hono") deps.server.dependencies.push("hono");
4199
+ else if (backend === "elysia") deps.server.dependencies.push("elysia");
4200
+ }
4196
4201
  if (frontendType.hasReactWeb) {
4197
4202
  if (api === "orpc") deps.web = { dependencies: [
4198
4203
  "@orpc/tanstack-query",
@@ -4285,7 +4290,7 @@ async function setupApi(config) {
4285
4290
  await fs.pathExists(serverDir);
4286
4291
  const frontendType = getFrontendType(frontend);
4287
4292
  if (!isConvex && api !== "none") {
4288
- const apiDeps = getApiDependencies(api, frontendType);
4293
+ const apiDeps = getApiDependencies(api, frontendType, backend);
4289
4294
  const apiPackageDir = path.join(projectDir, "packages/api");
4290
4295
  if (apiDeps.server) {
4291
4296
  await addPackageDependency({
@@ -4391,6 +4396,10 @@ async function setupBetterAuthPlugins(projectDir, config) {
4391
4396
  pluginsToAdd.push("reactStartCookies()");
4392
4397
  importsToAdd.push("import { reactStartCookies } from \"better-auth/react-start\";");
4393
4398
  }
4399
+ if (config.backend === "self" && config.frontend?.includes("next")) {
4400
+ pluginsToAdd.push("nextCookies()");
4401
+ importsToAdd.push("import { nextCookies } from \"better-auth/next-js\";");
4402
+ }
4394
4403
  if (config.frontend?.includes("native-nativewind") || config.frontend?.includes("native-unistyles")) {
4395
4404
  pluginsToAdd.push("expo()");
4396
4405
  importsToAdd.push("import { expo } from \"@better-auth/expo\";");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
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",
@@ -1,4 +1,12 @@
1
1
  {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
2
+ {{#if (and (ne backend "self") (includes frontend "next"))}}
3
+ import dotenv from "dotenv";
4
+
5
+ dotenv.config({
6
+ path: "../../apps/server/.env",
7
+ });
8
+
9
+ {{/if}}
2
10
  {{#if (eq dbSetup "planetscale")}}
3
11
  import { drizzle } from "drizzle-orm/planetscale-serverless";
4
12
 
@@ -1,4 +1,12 @@
1
1
  {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
2
+ {{#if (and (ne backend "self") (includes frontend "next"))}}
3
+ import dotenv from "dotenv";
4
+
5
+ dotenv.config({
6
+ path: "../../apps/server/.env",
7
+ });
8
+
9
+ {{/if}}
2
10
  {{#if (eq dbSetup "neon")}}
3
11
  import { neon, neonConfig } from '@neondatabase/serverless';
4
12
  import { drizzle } from 'drizzle-orm/neon-http';
@@ -1,4 +1,12 @@
1
1
  {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
2
+ {{#if (and (ne backend "self") (includes frontend "next"))}}
3
+ import dotenv from "dotenv";
4
+
5
+ dotenv.config({
6
+ path: "../../apps/server/.env",
7
+ });
8
+
9
+ {{/if}}
2
10
  import { drizzle } from "drizzle-orm/libsql";
3
11
  import { createClient } from "@libsql/client";
4
12