create-better-t-stack 2.33.6 → 2.33.8

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-CcycH-Mi.js";
2
+ import { createBtsCli } from "./src-jDxvJPRx.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-CcycH-Mi.js";
2
+ import { builder, createBtsCli, docs, init, router, sponsors } from "./src-jDxvJPRx.js";
3
3
 
4
4
  export { builder, createBtsCli, docs, init, router, sponsors };
@@ -1199,7 +1199,7 @@ const getLatestCLIVersion = () => {
1199
1199
  */
1200
1200
  function isTelemetryEnabled() {
1201
1201
  const BTS_TELEMETRY_DISABLED = process.env.BTS_TELEMETRY_DISABLED;
1202
- const BTS_TELEMETRY = "0";
1202
+ const BTS_TELEMETRY = "1";
1203
1203
  if (BTS_TELEMETRY_DISABLED !== void 0) return BTS_TELEMETRY_DISABLED !== "1";
1204
1204
  if (BTS_TELEMETRY !== void 0) return BTS_TELEMETRY === "1";
1205
1205
  return true;
@@ -1207,8 +1207,8 @@ function isTelemetryEnabled() {
1207
1207
 
1208
1208
  //#endregion
1209
1209
  //#region src/utils/analytics.ts
1210
- const POSTHOG_API_KEY = "random";
1211
- const POSTHOG_HOST = "random";
1210
+ const POSTHOG_API_KEY = "phc_8ZUxEwwfKMajJLvxz1daGd931dYbQrwKNficBmsdIrs";
1211
+ const POSTHOG_HOST = "https://us.i.posthog.com";
1212
1212
  async function trackProjectCreation(config, disableAnalytics = false) {
1213
1213
  if (!isTelemetryEnabled() || disableAnalytics) return;
1214
1214
  const sessionId = `cli_${crypto.randomUUID().replace(/-/g, "")}`;
@@ -2965,11 +2965,7 @@ async function setupApi(config) {
2965
2965
  if (webDirExists) {
2966
2966
  if (hasReactWeb) {
2967
2967
  if (api === "orpc") await addPackageDependency({
2968
- dependencies: [
2969
- "@orpc/tanstack-query",
2970
- "@orpc/client",
2971
- "@orpc/server"
2972
- ],
2968
+ dependencies: ["@orpc/tanstack-query", "@orpc/client"],
2973
2969
  projectDir: webDir
2974
2970
  });
2975
2971
  else if (api === "trpc") await addPackageDependency({
@@ -2986,8 +2982,7 @@ async function setupApi(config) {
2986
2982
  "@tanstack/vue-query",
2987
2983
  "@tanstack/vue-query-devtools",
2988
2984
  "@orpc/tanstack-query",
2989
- "@orpc/client",
2990
- "@orpc/server"
2985
+ "@orpc/client"
2991
2986
  ],
2992
2987
  projectDir: webDir
2993
2988
  });
@@ -2996,7 +2991,6 @@ async function setupApi(config) {
2996
2991
  dependencies: [
2997
2992
  "@orpc/tanstack-query",
2998
2993
  "@orpc/client",
2999
- "@orpc/server",
3000
2994
  "@tanstack/svelte-query"
3001
2995
  ],
3002
2996
  projectDir: webDir
@@ -3006,7 +3000,6 @@ async function setupApi(config) {
3006
3000
  dependencies: [
3007
3001
  "@orpc/tanstack-query",
3008
3002
  "@orpc/client",
3009
- "@orpc/server",
3010
3003
  "@tanstack/solid-query"
3011
3004
  ],
3012
3005
  projectDir: webDir
@@ -3023,11 +3016,7 @@ async function setupApi(config) {
3023
3016
  projectDir: nativeDir
3024
3017
  });
3025
3018
  else if (api === "orpc") await addPackageDependency({
3026
- dependencies: [
3027
- "@orpc/tanstack-query",
3028
- "@orpc/client",
3029
- "@orpc/server"
3030
- ],
3019
+ dependencies: ["@orpc/tanstack-query", "@orpc/client"],
3031
3020
  projectDir: nativeDir
3032
3021
  });
3033
3022
  }
@@ -4769,20 +4758,20 @@ async function displayPostInstallInstructions(config) {
4769
4758
  let stepCounter = 2;
4770
4759
  if (!depsInstalled) output += `${pc.cyan(`${stepCounter++}.`)} ${packageManager} install\n`;
4771
4760
  if (isConvex) {
4772
- output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev:setup ${pc.dim("(this will guide you through Convex project setup)")}\n`;
4773
- output += `${pc.cyan(`${stepCounter++}.`)} Copy environment variables from ${pc.white("packages/backend/.env.local")} \nto ${pc.white("apps/*/.env")}\n`;
4761
+ output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev:setup\n${pc.dim(" (this will guide you through Convex project setup)")}\n`;
4762
+ output += `${pc.cyan(`${stepCounter++}.`)} Copy environment variables from\n${pc.white(" packages/backend/.env.local")} to ${pc.white("apps/*/.env")}\n`;
4774
4763
  output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n\n`;
4775
4764
  } else {
4776
4765
  if (runtime !== "workers") output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n`;
4777
4766
  if (runtime === "workers") {
4778
- if (dbSetup === "d1") output += `${pc.yellow("IMPORTANT:")} Complete D1 database setup first (see Database commands below)\n`;
4767
+ if (dbSetup === "d1") output += `${pc.yellow("IMPORTANT:")} Complete D1 database setup first\n (see Database commands below)\n`;
4779
4768
  output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n`;
4780
4769
  output += `${pc.cyan(`${stepCounter++}.`)} cd apps/server && ${runCmd} run cf-typegen\n\n`;
4781
4770
  } else output += "\n";
4782
4771
  }
4783
4772
  output += `${pc.bold("Your project will be available at:")}\n`;
4784
4773
  if (hasWeb) output += `${pc.cyan("•")} Frontend: http://localhost:${webPort}\n`;
4785
- else if (!hasNative && !addons?.includes("starlight")) output += `${pc.yellow("NOTE:")} You are creating a backend-only app (no frontend selected)\n`;
4774
+ else if (!hasNative && !addons?.includes("starlight")) output += `${pc.yellow("NOTE:")} You are creating a backend-only app\n (no frontend selected)\n`;
4786
4775
  if (!isConvex) output += `${pc.cyan("•")} Backend API: http://localhost:3000\n`;
4787
4776
  if (addons?.includes("starlight")) output += `${pc.cyan("•")} Docs: http://localhost:4321\n`;
4788
4777
  if (addons?.includes("fumadocs")) output += `${pc.cyan("•")} Fumadocs: http://localhost:4000\n`;
@@ -4796,7 +4785,7 @@ async function displayPostInstallInstructions(config) {
4796
4785
  if (noOrmWarning) output += `\n${noOrmWarning.trim()}\n`;
4797
4786
  if (bunWebNativeWarning) output += `\n${bunWebNativeWarning.trim()}\n`;
4798
4787
  output += `\n${pc.bold("Update all dependencies:\n")}${pc.cyan(tazeCommand)}\n\n`;
4799
- output += `${pc.bold("Like Better-T Stack?")} Please consider giving us a star on GitHub:\n`;
4788
+ output += `${pc.bold("Like Better-T Stack?")} Please consider giving us a star\n on GitHub:\n`;
4800
4789
  output += pc.cyan("https://github.com/AmanVarshney01/create-better-t-stack");
4801
4790
  consola$1.box(output);
4802
4791
  }
@@ -4805,8 +4794,8 @@ function getNativeInstructions(isConvex) {
4805
4794
  const exampleUrl = isConvex ? "https://<YOUR_CONVEX_URL>" : "http://<YOUR_LOCAL_IP>:3000";
4806
4795
  const envFileName = ".env";
4807
4796
  const ipNote = isConvex ? "your Convex deployment URL (find after running 'dev:setup')" : "your local IP address";
4808
- let instructions = `${pc.yellow("NOTE:")} For Expo connectivity issues, update apps/native/${envFileName} \nwith ${ipNote}:\n${`${envVar}=${exampleUrl}`}\n`;
4809
- if (isConvex) instructions += `\n${pc.yellow("IMPORTANT:")} When using local development with Convex and native apps, ensure you use your local IP address \ninstead of localhost or 127.0.0.1 for proper connectivity.\n`;
4797
+ let instructions = `${pc.yellow("NOTE:")} For Expo connectivity issues, update\n apps/native/${envFileName} with ${ipNote}:\n ${`${envVar}=${exampleUrl}`}\n`;
4798
+ if (isConvex) instructions += `\n${pc.yellow("IMPORTANT:")} When using local development with Convex and native apps,\n ensure you use your local IP address instead of localhost or 127.0.0.1\n for proper connectivity.\n`;
4810
4799
  return instructions;
4811
4800
  }
4812
4801
  function getLintingInstructions(runCmd) {
@@ -4832,8 +4821,8 @@ async function getDatabaseInstructions(database, orm, runCmd, runtime, dbSetup)
4832
4821
  instructions.push("");
4833
4822
  }
4834
4823
  if (orm === "prisma") {
4835
- if (dbSetup === "turso") instructions.push(`${pc.yellow("NOTE:")} Turso support with Prisma is in Early Access and requires additional setup.`, `Learn more at: https://www.prisma.io/docs/orm/overview/databases/turso`);
4836
- if (database === "mongodb" && dbSetup === "docker") instructions.push(`${pc.yellow("WARNING:")} Prisma + MongoDB + Docker combination may not work.`);
4824
+ if (dbSetup === "turso") instructions.push(`${pc.yellow("NOTE:")} Turso support with Prisma is in Early Access and requires\n additional setup. Learn more at:\n https://www.prisma.io/docs/orm/overview/databases/turso`);
4825
+ if (database === "mongodb" && dbSetup === "docker") instructions.push(`${pc.yellow("WARNING:")} Prisma + MongoDB + Docker combination\n may not work.`);
4837
4826
  if (dbSetup === "docker") instructions.push(`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`);
4838
4827
  instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
4839
4828
  instructions.push(`${pc.cyan("•")} Database UI: ${`${runCmd} db:studio`}`);
@@ -4844,23 +4833,23 @@ async function getDatabaseInstructions(database, orm, runCmd, runtime, dbSetup)
4844
4833
  if (database === "sqlite" && dbSetup !== "d1") instructions.push(`${pc.cyan("•")} Start local DB (if needed): ${`cd apps/server && ${runCmd} db:local`}`);
4845
4834
  } else if (orm === "mongoose") {
4846
4835
  if (dbSetup === "docker") instructions.push(`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`);
4847
- } else if (orm === "none") instructions.push(`${pc.yellow("NOTE:")} Manual database schema setup required.`);
4836
+ } else if (orm === "none") instructions.push(`${pc.yellow("NOTE:")} Manual database schema setup\n required.`);
4848
4837
  return instructions.length ? `${pc.bold("Database commands:")}\n${instructions.join("\n")}` : "";
4849
4838
  }
4850
4839
  function getTauriInstructions(runCmd) {
4851
- return `\n${pc.bold("Desktop app with Tauri:")}\n${pc.cyan("•")} Start desktop app: ${`cd apps/web && ${runCmd} desktop:dev`}\n${pc.cyan("•")} Build desktop app: ${`cd apps/web && ${runCmd} desktop:build`}\n${pc.yellow("NOTE:")} Tauri requires Rust and platform-specific dependencies.\nSee: https://v2.tauri.app/start/prerequisites/`;
4840
+ return `\n${pc.bold("Desktop app with Tauri:")}\n${pc.cyan("•")} Start desktop app: ${`cd apps/web && ${runCmd} desktop:dev`}\n${pc.cyan("•")} Build desktop app: ${`cd apps/web && ${runCmd} desktop:build`}\n${pc.yellow("NOTE:")} Tauri requires Rust and platform-specific dependencies.\n See: https://v2.tauri.app/start/prerequisites/`;
4852
4841
  }
4853
4842
  function getPwaInstructions() {
4854
- return `\n${pc.bold("PWA with React Router v7:")}\n${pc.yellow("NOTE:")} There is a known compatibility issue between VitePWA \nand React Router v7.See: https://github.com/vite-pwa/vite-plugin-pwa/issues/809`;
4843
+ return `\n${pc.bold("PWA with React Router v7:")}\n${pc.yellow("NOTE:")} There is a known compatibility issue between VitePWA\n and React Router v7. See:\n https://github.com/vite-pwa/vite-plugin-pwa/issues/809`;
4855
4844
  }
4856
4845
  function getStarlightInstructions(runCmd) {
4857
4846
  return `\n${pc.bold("Documentation with Starlight:")}\n${pc.cyan("•")} Start docs site: ${`cd apps/docs && ${runCmd} dev`}\n${pc.cyan("•")} Build docs site: ${`cd apps/docs && ${runCmd} build`}`;
4858
4847
  }
4859
4848
  function getNoOrmWarning() {
4860
- return `\n${pc.yellow("WARNING:")} Database selected without an ORM. Features requiring database access (e.g., examples, auth) need manual setup.`;
4849
+ return `\n${pc.yellow("WARNING:")} Database selected without an ORM. Features requiring\n database access (e.g., examples, auth) need manual setup.`;
4861
4850
  }
4862
4851
  function getBunWebNativeWarning() {
4863
- return `\n${pc.yellow("WARNING:")} 'bun' might cause issues with web + native apps in a monorepo. Use 'pnpm' if problems arise.`;
4852
+ return `\n${pc.yellow("WARNING:")} 'bun' might cause issues with web + native apps in a monorepo.\n Use 'pnpm' if problems arise.`;
4864
4853
  }
4865
4854
  function getWorkersDeployInstructions(runCmd) {
4866
4855
  return `\n${pc.bold("Deploy frontend to Cloudflare Workers:")}\n${pc.cyan("•")} Deploy: ${`cd apps/web && ${runCmd} run deploy`}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "2.33.6",
3
+ "version": "2.33.8",
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",
@@ -53,7 +53,8 @@
53
53
  "check-types": "tsc --noEmit",
54
54
  "check": "biome check --write .",
55
55
  "test": "bun run build && vitest --ui",
56
- "test:with-build": "bun run build && WITH_BUILD=1 vitest --ui"
56
+ "test:with-build": "bun run build && WITH_BUILD=1 vitest --ui",
57
+ "prepublishOnly": "npm run build"
57
58
  },
58
59
  "exports": {
59
60
  ".": {
@@ -82,6 +83,5 @@
82
83
  "tsdown": "^0.14.1",
83
84
  "typescript": "^5.9.2",
84
85
  "vitest": "^3.2.4"
85
- },
86
- "gitHead": "22773232ae864b0b38bb72f5bf12d433ee74803c"
86
+ }
87
87
  }
@@ -1,9 +1,8 @@
1
1
  import { createORPCClient } from "@orpc/client";
2
2
  import { RPCLink } from "@orpc/client/fetch";
3
3
  import { createTanstackQueryUtils } from "@orpc/tanstack-query";
4
- import type { RouterClient } from "@orpc/server";
5
4
  import { QueryCache, QueryClient } from "@tanstack/react-query";
6
- import type { appRouter } from "../../server/src/routers";
5
+ import type { AppRouterClient } from "../../server/src/routers";
7
6
  {{#if auth}}
8
7
  import { authClient } from "@/lib/auth-client";
9
8
  {{/if}}
@@ -30,6 +29,6 @@ export const link = new RPCLink({
30
29
  {{/if}}
31
30
  });
32
31
 
33
- export const client: RouterClient<typeof appRouter> = createORPCClient(link);
32
+ export const client: AppRouterClient = createORPCClient(link);
34
33
 
35
34
  export const orpc = createTanstackQueryUtils(client);
@@ -1,6 +1,5 @@
1
1
  import { defineNuxtPlugin, useRuntimeConfig } from '#app'
2
- import type { RouterClient } from '@orpc/server'
3
- import type { appRouter } from "../../../server/src/routers/index";
2
+ import type { AppRouterClient } from "../../../server/src/routers/index";
4
3
  import { createORPCClient } from '@orpc/client'
5
4
  import { RPCLink } from '@orpc/client/fetch'
6
5
  import { createTanstackQueryUtils } from "@orpc/tanstack-query";
@@ -24,7 +23,7 @@ export default defineNuxtPlugin(() => {
24
23
  })
25
24
 
26
25
 
27
- const client: RouterClient<typeof appRouter> = createORPCClient(rpcLink)
26
+ const client: AppRouterClient = createORPCClient(rpcLink)
28
27
  const orpcUtils = createTanstackQueryUtils(client)
29
28
 
30
29
  return {
@@ -3,8 +3,7 @@ import { RPCLink } from "@orpc/client/fetch";
3
3
  import { createTanstackQueryUtils } from "@orpc/tanstack-query";
4
4
  import { QueryCache, QueryClient } from "@tanstack/react-query";
5
5
  import { toast } from "sonner";
6
- import type { appRouter } from "../../../server/src/routers/index";
7
- import type { RouterClient } from "@orpc/server";
6
+ import type { AppRouterClient } from "../../../server/src/routers/index";
8
7
 
9
8
  export const queryClient = new QueryClient({
10
9
  queryCache: new QueryCache({
@@ -37,6 +36,6 @@ export const link = new RPCLink({
37
36
  {{/if}}
38
37
  });
39
38
 
40
- export const client: RouterClient<typeof appRouter> = createORPCClient(link)
39
+ export const client: AppRouterClient = createORPCClient(link)
41
40
 
42
41
  export const orpc = createTanstackQueryUtils(client)
@@ -2,8 +2,7 @@ import { createORPCClient } from "@orpc/client";
2
2
  import { RPCLink } from "@orpc/client/fetch";
3
3
  import { createTanstackQueryUtils } from "@orpc/tanstack-query";
4
4
  import { QueryCache, QueryClient } from "@tanstack/solid-query";
5
- import type { appRouter } from "../../../server/src/routers/index";
6
- import type { RouterClient } from "@orpc/server";
5
+ import type { AppRouterClient } from "../../../server/src/routers/index";
7
6
 
8
7
  export const queryClient = new QueryClient({
9
8
  queryCache: new QueryCache({
@@ -25,6 +24,6 @@ export const link = new RPCLink({
25
24
  {{/if}}
26
25
  });
27
26
 
28
- export const client: RouterClient<typeof appRouter> = createORPCClient(link);
27
+ export const client: AppRouterClient = createORPCClient(link);
29
28
 
30
29
  export const orpc = createTanstackQueryUtils(client);
@@ -1,10 +1,9 @@
1
1
  import { PUBLIC_SERVER_URL } from "$env/static/public";
2
2
  import { createORPCClient } from "@orpc/client";
3
3
  import { RPCLink } from "@orpc/client/fetch";
4
- import type { RouterClient } from "@orpc/server";
5
4
  import { createTanstackQueryUtils } from "@orpc/tanstack-query";
6
5
  import { QueryCache, QueryClient } from "@tanstack/svelte-query";
7
- import type { appRouter } from "../../../server/src/routers/index";
6
+ import type { AppRouterClient } from "../../../server/src/routers/index";
8
7
 
9
8
  export const queryClient = new QueryClient({
10
9
  queryCache: new QueryCache({
@@ -26,6 +25,6 @@ export const link = new RPCLink({
26
25
  {{/if}}
27
26
  });
28
27
 
29
- export const client: RouterClient<typeof appRouter> = createORPCClient(link);
28
+ export const client: AppRouterClient = createORPCClient(link);
30
29
 
31
30
  export const orpc = createTanstackQueryUtils(client);
@@ -1,5 +1,6 @@
1
1
  {{#if (eq api "orpc")}}
2
2
  import { {{#if auth}}protectedProcedure, {{/if}}publicProcedure } from "../lib/orpc";
3
+ import type { RouterClient } from "@orpc/server";
3
4
  {{#if (includes examples "todo")}}
4
5
  import { todoRouter } from "./todo";
5
6
  {{/if}}
@@ -21,6 +22,7 @@ export const appRouter = {
21
22
  {{/if}}
22
23
  };
23
24
  export type AppRouter = typeof appRouter;
25
+ export type AppRouterClient = RouterClient<typeof appRouter>;
24
26
  {{else if (eq api "trpc")}}
25
27
  import {
26
28
  {{#if auth}}protectedProcedure, {{/if}}publicProcedure,
@@ -7,9 +7,8 @@ import { link, orpc } from "@/utils/orpc";
7
7
  import type { QueryClient } from "@tanstack/react-query";
8
8
  import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
9
9
  import { useState } from "react";
10
- import type { RouterClient } from "@orpc/server";
11
10
  import { createTanstackQueryUtils } from "@orpc/tanstack-query";
12
- import type { appRouter } from "../../../server/src/routers";
11
+ import type { AppRouterClient } from "../../../server/src/routers";
13
12
  import { createORPCClient } from "@orpc/client";
14
13
  {{/if}}
15
14
  {{#if (eq api "trpc")}}
@@ -67,7 +66,7 @@ function RootComponent() {
67
66
  });
68
67
 
69
68
  {{#if (eq api "orpc")}}
70
- const [client] = useState<RouterClient<typeof appRouter>>(() => createORPCClient(link));
69
+ const [client] = useState<AppRouterClient>(() => createORPCClient(link));
71
70
  const [orpcUtils] = useState(() => createTanstackQueryUtils(client));
72
71
  {{/if}}
73
72
 
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Better T Stack
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, 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,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.