create-better-t-stack 3.13.1 → 3.13.2

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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { r as createBtsCli } from "./src-BpuxNIy_.mjs";
2
+ import { r as createBtsCli } from "./src-kvJQuDe_.mjs";
3
3
 
4
4
  //#region src/cli.ts
5
5
  createBtsCli().run();
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { a as router, i as docs, n as create, o as sponsors, r as createBtsCli, t as builder } from "./src-BpuxNIy_.mjs";
2
+ import { a as router, i as docs, n as create, o as sponsors, r as createBtsCli, t as builder } from "./src-kvJQuDe_.mjs";
3
3
 
4
4
  export { builder, create, createBtsCli, docs, router, sponsors };
@@ -4376,11 +4376,11 @@ async function setupAIDependencies(config) {
4376
4376
  const hasSvelte = frontend.includes("svelte");
4377
4377
  const hasReactNative = frontend.includes("native-bare") || frontend.includes("native-uniwind") || frontend.includes("native-unistyles");
4378
4378
  if (backend === "convex" && convexBackendDirExists) await addPackageDependency({
4379
- dependencies: [
4380
- "@convex-dev/agent",
4381
- "ai",
4382
- "@ai-sdk/google"
4383
- ],
4379
+ dependencies: ["@convex-dev/agent"],
4380
+ customDependencies: {
4381
+ ai: "^5.0.117",
4382
+ "@ai-sdk/google": "^2.0.52"
4383
+ },
4384
4384
  projectDir: convexBackendDir
4385
4385
  });
4386
4386
  else if (backend === "self" && webClientDirExists) await addPackageDependency({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "3.13.1",
3
+ "version": "3.13.2",
4
4
  "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5
5
  "keywords": [
6
6
  "better-auth",
@@ -67,7 +67,7 @@
67
67
  "prepublishOnly": "npm run build"
68
68
  },
69
69
  "dependencies": {
70
- "@better-t-stack/types": "^3.13.1",
70
+ "@better-t-stack/types": "^3.13.2",
71
71
  "@clack/core": "^0.5.0",
72
72
  "@clack/prompts": "^1.0.0-alpha.8",
73
73
  "@orpc/server": "^1.13.0",
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { createForm } from '@tanstack/svelte-form';
3
- import z from 'zod';
3
+ import { z } from 'zod';
4
4
  import { authClient } from '$lib/auth-client';
5
5
  import { goto } from '$app/navigation';
6
6
 
@@ -53,10 +53,11 @@
53
53
  class="w-full border"
54
54
  onblur={field.handleBlur}
55
55
  value={field.state.value}
56
- oninput={(e: Event) => {
57
- const target = e.target as HTMLInputElement
58
- field.handleChange(target.value)
59
- }} />
56
+ oninput={(e: Event) => {
57
+ const target = e.target as HTMLInputElement;
58
+ field.handleChange(target.value);
59
+ }}
60
+ />
60
61
  {#if field.state.meta.isTouched}
61
62
  {#each field.state.meta.errors as error}
62
63
  <p class="text-sm text-red-500" role="alert">{error}</p>
@@ -76,11 +77,11 @@
76
77
  type="password"
77
78
  class="w-full border"
78
79
  onblur={field.handleBlur}
79
- value={field.state.value}
80
- oninput={(e: Event) => {
81
- const target = e.target as HTMLInputElement
82
- field.handleChange(target.value)
83
- }}
80
+ value={field.state.value}
81
+ oninput={(e: Event) => {
82
+ const target = e.target as HTMLInputElement;
83
+ field.handleChange(target.value);
84
+ }}
84
85
  />
85
86
  {#if field.state.meta.isTouched}
86
87
  {#each field.state.meta.errors as error}
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { createForm } from '@tanstack/svelte-form';
3
- import z from 'zod';
3
+ import { z } from 'zod';
4
4
  import { authClient } from '$lib/auth-client';
5
5
  import { goto } from '$app/navigation';
6
6
 
@@ -60,11 +60,11 @@
60
60
  name={field.name}
61
61
  class="w-full border"
62
62
  onblur={field.handleBlur}
63
- value={field.state.value}
64
- oninput={(e: Event) => {
65
- const target = e.target as HTMLInputElement
66
- field.handleChange(target.value)
67
- }}
63
+ value={field.state.value}
64
+ oninput={(e: Event) => {
65
+ const target = e.target as HTMLInputElement;
66
+ field.handleChange(target.value);
67
+ }}
68
68
  />
69
69
  {#if field.state.meta.isTouched}
70
70
  {#each field.state.meta.errors as error}
@@ -85,11 +85,11 @@
85
85
  type="email"
86
86
  class="w-full border"
87
87
  onblur={field.handleBlur}
88
- value={field.state.value}
89
- oninput={(e: Event) => {
90
- const target = e.target as HTMLInputElement
91
- field.handleChange(target.value)
92
- }}
88
+ value={field.state.value}
89
+ oninput={(e: Event) => {
90
+ const target = e.target as HTMLInputElement;
91
+ field.handleChange(target.value);
92
+ }}
93
93
  />
94
94
  {#if field.state.meta.isTouched}
95
95
  {#each field.state.meta.errors as error}
@@ -110,13 +110,13 @@
110
110
  type="password"
111
111
  class="w-full border"
112
112
  onblur={field.handleBlur}
113
- value={field.state.value}
114
- oninput={(e: Event) => {
115
- const target = e.target as HTMLInputElement
116
- field.handleChange(target.value)
117
- }}
113
+ value={field.state.value}
114
+ oninput={(e: Event) => {
115
+ const target = e.target as HTMLInputElement;
116
+ field.handleChange(target.value);
117
+ }}
118
118
  />
119
- {#if field.state.meta.errors}
119
+ {#if field.state.meta.isTouched}
120
120
  {#each field.state.meta.errors as error}
121
121
  <p class="text-sm text-red-500" role="alert">{error}</p>
122
122
  {/each}
@@ -1,5 +1,4 @@
1
1
  <script lang="ts">
2
- import { onMount } from 'svelte';
3
2
  import { goto } from '$app/navigation';
4
3
  import { authClient } from '$lib/auth-client';
5
4
  {{#if (eq api "orpc")}}
@@ -7,33 +6,36 @@
7
6
  import { createQuery } from '@tanstack/svelte-query';
8
7
  {{/if}}
9
8
  {{#if (eq payments "polar")}}
10
- let customerState: any = null;
9
+ let customerState = $state<{ activeSubscriptions?: unknown[] } | null>(null);
11
10
  {{/if}}
12
11
 
13
12
  const sessionQuery = authClient.useSession();
14
13
 
15
14
  {{#if (eq api "orpc")}}
16
15
  const privateDataQuery = createQuery(orpc.privateData.queryOptions());
17
- {{/if}}
16
+ {{/if}}
18
17
 
19
- onMount(() => {
20
- const { data: session, isPending } = $sessionQuery;
21
- if (!session && !isPending) {
18
+ $effect(() => {
19
+ if (!$sessionQuery.isPending && !$sessionQuery.data) {
22
20
  goto('/login');
23
21
  }
24
- {{#if (eq payments "polar")}}
25
- if (session) {
22
+ });
23
+
24
+ {{#if (eq payments "polar")}}
25
+ $effect(() => {
26
+ if ($sessionQuery.data) {
26
27
  authClient.customer.state().then(({ data }) => {
27
28
  customerState = data;
28
29
  });
29
30
  }
30
- {{/if}}
31
31
  });
32
+ {{/if}}
32
33
  </script>
33
34
 
34
35
  {#if $sessionQuery.isPending}
35
36
  <div>Loading...</div>
36
37
  {:else if !$sessionQuery.data}
38
+ <div>Redirecting to login...</div>
37
39
  {:else}
38
40
  <div>
39
41
  <h1>Dashboard</h1>
@@ -10,7 +10,7 @@
10
10
  }),
11
11
  });
12
12
 
13
- let messagesEndElement: HTMLDivElement | null = null;
13
+ let messagesEndElement: HTMLDivElement | null = $state(null);
14
14
 
15
15
  $effect(() => {
16
16
  if (chat.messages.length > 0) {
@@ -24,7 +24,7 @@
24
24
  {#each links as link (link.to)}
25
25
  <a
26
26
  href={link.to}
27
- class=""
27
+ class="hover:text-neutral-400 transition-colors"
28
28
  >
29
29
  {link.label}
30
30
  </a>
@@ -24,7 +24,7 @@
24
24
  import { queryClient } from '$lib/orpc';
25
25
  import Header from '../components/Header.svelte';
26
26
 
27
- let { children } = $props();
27
+ const { children } = $props();
28
28
  </script>
29
29
 
30
30
  <QueryClientProvider client={queryClient}>
@@ -41,7 +41,7 @@
41
41
  import '../app.css';
42
42
  import Header from '../components/Header.svelte';
43
43
 
44
- let { children } = $props();
44
+ const { children } = $props();
45
45
  </script>
46
46
 
47
47
  <div class="grid h-svh grid-rows-[auto_1fr]">
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import { page } from '$app/stores';
2
+ import { page } from '$app/state';
3
3
 
4
- const checkout_id = $page.url.searchParams.get('checkout_id');
4
+ const checkout_id = $derived(page.url.searchParams.get('checkout_id'));
5
5
  </script>
6
6
 
7
7
  <div class="container mx-auto px-4 py-8">