create-better-t-stack 2.1.3 → 2.1.5

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.
Files changed (29) hide show
  1. package/README.md +40 -19
  2. package/dist/index.js +97 -97
  3. package/package.json +1 -1
  4. package/templates/api/orpc/web/svelte/src/lib/orpc.ts.hbs +31 -0
  5. package/templates/auth/web/svelte/src/components/SignInForm.svelte +108 -0
  6. package/templates/auth/web/svelte/src/components/SignUpForm.svelte +142 -0
  7. package/templates/auth/web/svelte/src/components/UserMenu.svelte +54 -0
  8. package/templates/auth/web/svelte/src/lib/auth-client.ts +6 -0
  9. package/templates/auth/web/svelte/src/routes/dashboard/+page.svelte +31 -0
  10. package/templates/auth/web/svelte/src/routes/login/+page.svelte +12 -0
  11. package/templates/examples/ai/web/nuxt/app/pages/ai.vue +1 -2
  12. package/templates/examples/ai/web/svelte/src/routes/ai/+page.svelte +98 -0
  13. package/templates/examples/todo/web/svelte/src/routes/todos/+page.svelte +150 -0
  14. package/templates/frontend/native/_gitignore +3 -2
  15. package/templates/frontend/react/tanstack-router/vite.config.ts.hbs +0 -2
  16. package/templates/frontend/svelte/_gitignore +23 -0
  17. package/templates/frontend/svelte/_npmrc +1 -0
  18. package/templates/frontend/svelte/package.json +31 -0
  19. package/templates/frontend/svelte/src/app.css +5 -0
  20. package/templates/frontend/svelte/src/app.d.ts +13 -0
  21. package/templates/frontend/svelte/src/app.html +12 -0
  22. package/templates/frontend/svelte/src/components/Header.svelte.hbs +40 -0
  23. package/templates/frontend/svelte/src/lib/index.ts +1 -0
  24. package/templates/frontend/svelte/src/routes/+layout.svelte.hbs +19 -0
  25. package/templates/frontend/svelte/src/routes/+page.svelte.hbs +44 -0
  26. package/templates/frontend/svelte/static/favicon.png +0 -0
  27. package/templates/frontend/svelte/svelte.config.js +18 -0
  28. package/templates/frontend/svelte/tsconfig.json +19 -0
  29. package/templates/frontend/svelte/vite.config.ts +7 -0
@@ -0,0 +1,23 @@
1
+ node_modules
2
+
3
+ # Output
4
+ .output
5
+ .vercel
6
+ .netlify
7
+ .wrangler
8
+ /.svelte-kit
9
+ /build
10
+
11
+ # OS
12
+ .DS_Store
13
+ Thumbs.db
14
+
15
+ # Env
16
+ .env
17
+ .env.*
18
+ !.env.example
19
+ !.env.test
20
+
21
+ # Vite
22
+ vite.config.js.timestamp-*
23
+ vite.config.ts.timestamp-*
@@ -0,0 +1 @@
1
+ engine-strict=true
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "web",
3
+ "private": true,
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite dev",
8
+ "build": "vite build",
9
+ "preview": "vite preview",
10
+ "prepare": "svelte-kit sync || echo ''",
11
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
13
+ },
14
+ "devDependencies": {
15
+ "@sveltejs/adapter-auto": "^6.0.0",
16
+ "@sveltejs/kit": "^2.20.7",
17
+ "@sveltejs/vite-plugin-svelte": "^5.0.3",
18
+ "@tailwindcss/vite": "^4.1.4",
19
+ "svelte": "^5.28.2",
20
+ "svelte-check": "^4.1.6",
21
+ "tailwindcss": "^4.1.4",
22
+ "typescript": "^5.8.3",
23
+ "@tanstack/svelte-query-devtools": "^5.74.6",
24
+ "vite": "^6.3.3"
25
+ },
26
+ "dependencies": {
27
+ "@tanstack/svelte-form": "^1.7.0",
28
+ "@tanstack/svelte-query": "^5.74.4",
29
+ "zod": "^3.24.3"
30
+ }
31
+ }
@@ -0,0 +1,5 @@
1
+ @import 'tailwindcss';
2
+
3
+ body {
4
+ @apply bg-neutral-950 text-neutral-100;
5
+ }
@@ -0,0 +1,13 @@
1
+ // See https://svelte.dev/docs/kit/types#app.d.ts
2
+ // for information about these interfaces
3
+ declare global {
4
+ namespace App {
5
+ // interface Error {}
6
+ // interface Locals {}
7
+ // interface PageData {}
8
+ // interface PageState {}
9
+ // interface Platform {}
10
+ }
11
+ }
12
+
13
+ export {};
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%sveltekit.assets%/favicon.png" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ %sveltekit.head%
8
+ </head>
9
+ <body data-sveltekit-preload-data="hover">
10
+ <div style="display: contents">%sveltekit.body%</div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+
3
+ {{#if auth}}
4
+ import UserMenu from './UserMenu.svelte';
5
+ {{/if}}
6
+ const links = [
7
+ { to: "/", label: "Home" },
8
+ {{#if auth}}
9
+ { to: "/dashboard", label: "Dashboard" },
10
+ {{/if}}
11
+ {{#if (includes examples "todo")}}
12
+ { to: "/todos", label: "Todos" },
13
+ {{/if}}
14
+ {{#if (includes examples "ai")}}
15
+ { to: "/ai", label: "AI Chat" },
16
+ {{/if}}
17
+ ];
18
+
19
+ </script>
20
+
21
+ <div>
22
+ <div class="flex flex-row items-center justify-between px-4 py-2 md:px-6">
23
+ <nav class="flex gap-4 text-lg">
24
+ {#each links as link (link.to)}
25
+ <a
26
+ href={link.to}
27
+ class=""
28
+ >
29
+ {link.label}
30
+ </a>
31
+ {/each}
32
+ </nav>
33
+ <div class="flex items-center gap-2">
34
+ {{#if auth}}
35
+ <UserMenu />
36
+ {{/if}}
37
+ </div>
38
+ </div>
39
+ <hr class="border-neutral-800" />
40
+ </div>
@@ -0,0 +1 @@
1
+ // place files you want to import through the `$lib` alias in this folder.
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { QueryClientProvider } from '@tanstack/svelte-query';
3
+ import { SvelteQueryDevtools } from '@tanstack/svelte-query-devtools'
4
+ import '../app.css';
5
+ import { queryClient } from '$lib/orpc';
6
+ import Header from '../components/Header.svelte';
7
+
8
+ let { children } = $props();
9
+ </script>
10
+
11
+ <QueryClientProvider client={queryClient}>
12
+ <div class="grid h-svh grid-rows-[auto_1fr]">
13
+ <Header />
14
+ <main class="overflow-y-auto">
15
+ {@render children()}
16
+ </main>
17
+ </div>
18
+ <SvelteQueryDevtools />
19
+ </QueryClientProvider>
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import { orpc } from "$lib/orpc";
3
+ import { createQuery } from "@tanstack/svelte-query";
4
+
5
+ const healthCheck = createQuery(orpc.healthCheck.queryOptions());
6
+
7
+
8
+ const TITLE_TEXT = `
9
+ ██████╗ ███████╗████████╗████████╗███████╗██████╗
10
+ ██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗
11
+ ██████╔╝█████╗ ██║ ██║ █████╗ ██████╔╝
12
+ ██╔══██╗██╔══╝ ██║ ██║ ██╔══╝ ██╔══██╗
13
+ ██████╔╝███████╗ ██║ ██║ ███████╗██║ ██║
14
+ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
15
+
16
+ ████████╗ ███████╗████████╗ █████╗ ██████╗██╗ ██╗
17
+ ╚══██╔══╝ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
18
+ ██║ ███████╗ ██║ ███████║██║ █████╔╝
19
+ ██║ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗
20
+ ██║ ███████║ ██║ ██║ ██║╚██████╗██║ ██╗
21
+ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
22
+ `;
23
+ </script>
24
+
25
+ <div class="container mx-auto max-w-3xl px-4 py-2">
26
+ <pre class="overflow-x-auto font-mono text-sm">{TITLE_TEXT}</pre>
27
+ <div class="grid gap-6">
28
+ <section class="rounded-lg border p-4">
29
+ <h2 class="mb-2 font-medium">API Status</h2>
30
+ <div class="flex items-center gap-2">
31
+ <div
32
+ class={`h-2 w-2 rounded-full ${$healthCheck.data ? "bg-green-500" : "bg-red-500"}`}
33
+ ></div>
34
+ <span class="text-muted-foreground text-sm">
35
+ {$healthCheck.isLoading
36
+ ? "Checking..."
37
+ : $healthCheck.data
38
+ ? "Connected"
39
+ : "Disconnected"}
40
+ </span>
41
+ </div>
42
+ </section>
43
+ </div>
44
+ </div>
@@ -0,0 +1,18 @@
1
+ import adapter from '@sveltejs/adapter-auto';
2
+ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
3
+
4
+ /** @type {import('@sveltejs/kit').Config} */
5
+ const config = {
6
+ // Consult https://svelte.dev/docs/kit/integrations
7
+ // for more information about preprocessors
8
+ preprocess: vitePreprocess(),
9
+
10
+ kit: {
11
+ // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
12
+ // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
13
+ // See https://svelte.dev/docs/kit/adapters for more information about adapters.
14
+ adapter: adapter()
15
+ }
16
+ };
17
+
18
+ export default config;
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "./.svelte-kit/tsconfig.json",
3
+ "compilerOptions": {
4
+ "allowJs": true,
5
+ "checkJs": true,
6
+ "esModuleInterop": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "resolveJsonModule": true,
9
+ "skipLibCheck": true,
10
+ "sourceMap": true,
11
+ "strict": true,
12
+ "moduleResolution": "bundler"
13
+ }
14
+ // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
15
+ // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
16
+ //
17
+ // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
18
+ // from the referenced tsconfig.json - TypeScript does not merge them in
19
+ }
@@ -0,0 +1,7 @@
1
+ import tailwindcss from '@tailwindcss/vite';
2
+ import { sveltekit } from '@sveltejs/kit/vite';
3
+ import { defineConfig } from 'vite';
4
+
5
+ export default defineConfig({
6
+ plugins: [tailwindcss(), sveltekit()]
7
+ });