bosia 0.6.21 → 0.6.23

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 (58) hide show
  1. package/package.json +2 -2
  2. package/src/cli/add.ts +3 -4
  3. package/src/cli/block.ts +16 -10
  4. package/src/cli/create.ts +6 -11
  5. package/src/cli/feat.ts +19 -22
  6. package/src/cli/index.ts +1 -2
  7. package/src/cli/manifest.ts +1 -1
  8. package/src/cli/registry.ts +3 -1
  9. package/src/core/build.ts +1 -3
  10. package/src/core/client/App.svelte +3 -8
  11. package/src/core/client/router.svelte.ts +3 -8
  12. package/src/core/config.ts +1 -4
  13. package/src/core/cookies.ts +1 -2
  14. package/src/core/dev-500.ts +1 -1
  15. package/src/core/html.ts +1 -2
  16. package/src/core/plugin.ts +1 -3
  17. package/src/core/plugins/inspector/bun-plugin.ts +1 -4
  18. package/src/core/plugins/inspector/index.ts +45 -59
  19. package/src/core/renderer.ts +3 -10
  20. package/src/core/routeTypes.ts +3 -9
  21. package/src/core/scanner.ts +1 -3
  22. package/src/core/server.ts +30 -35
  23. package/src/core/staticManifest.ts +1 -3
  24. package/src/core/svelteAudit.ts +2 -5
  25. package/src/core/svelteCompiler.ts +2 -8
  26. package/templates/default/.prettierignore +1 -0
  27. package/templates/default/src/app.css +2 -0
  28. package/templates/demo/.prettierignore +1 -0
  29. package/templates/demo/src/app.css +2 -0
  30. package/templates/shop/.env.example +12 -0
  31. package/templates/shop/.prettierignore +7 -0
  32. package/templates/shop/.prettierrc.json +9 -0
  33. package/templates/shop/README.md +62 -0
  34. package/templates/shop/_gitignore +12 -0
  35. package/templates/shop/bosia.config.ts +10 -0
  36. package/templates/shop/instructions.txt +8 -0
  37. package/templates/shop/package.json +26 -0
  38. package/templates/shop/public/favicon.svg +14 -0
  39. package/templates/shop/public/logo-dark.svg +14 -0
  40. package/templates/shop/public/logo-light.svg +14 -0
  41. package/templates/shop/src/app.css +134 -0
  42. package/templates/shop/src/app.d.ts +14 -0
  43. package/templates/shop/src/app.html +11 -0
  44. package/templates/shop/src/hooks.server.ts +21 -0
  45. package/templates/shop/src/lib/utils.ts +1 -0
  46. package/templates/shop/src/routes/(private)/+layout.server.ts +10 -0
  47. package/templates/shop/src/routes/(private)/+layout.svelte +44 -0
  48. package/templates/shop/src/routes/(private)/dashboard/+page.svelte +11 -0
  49. package/templates/shop/src/routes/(public)/+layout.svelte +13 -0
  50. package/templates/shop/src/routes/(public)/+page.svelte +38 -0
  51. package/templates/shop/src/routes/+error.svelte +19 -0
  52. package/templates/shop/src/routes/+layout.server.ts +9 -0
  53. package/templates/shop/src/routes/+layout.svelte +6 -0
  54. package/templates/shop/template.json +10 -0
  55. package/templates/shop/tsconfig.json +22 -0
  56. package/templates/todo/.prettierignore +1 -0
  57. package/templates/todo/src/app.css +2 -0
  58. package/templates/todo/template.json +4 -1
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import { page } from "bosia/client";
3
+ import AdminSidebar from "$lib/components/AdminSidebar.svelte";
4
+ import {
5
+ Breadcrumb,
6
+ BreadcrumbList,
7
+ BreadcrumbItem,
8
+ BreadcrumbLink,
9
+ BreadcrumbPage,
10
+ BreadcrumbSeparator,
11
+ } from "$lib/components/ui/breadcrumb";
12
+
13
+ let { data, children }: { data: { user: { id: string; email: string } }; children: any } =
14
+ $props();
15
+
16
+ const segments = $derived(page.url.pathname.split("/").filter(Boolean));
17
+ const label = (s: string) => s[0].toUpperCase() + s.slice(1);
18
+ const hrefAt = (i: number) => "/" + segments.slice(0, i + 1).join("/");
19
+ </script>
20
+
21
+ <div class="flex min-h-screen">
22
+ <AdminSidebar currentPath={page.url.pathname} user={data.user} />
23
+ <main class="flex-1 overflow-x-hidden p-6">
24
+ {#if segments.length > 0}
25
+ <Breadcrumb class="mb-4">
26
+ <BreadcrumbList>
27
+ {#each segments as segment, i}
28
+ <BreadcrumbItem>
29
+ {#if i === segments.length - 1}
30
+ <BreadcrumbPage>{label(segment)}</BreadcrumbPage>
31
+ {:else}
32
+ <BreadcrumbLink href={hrefAt(i)}>{label(segment)}</BreadcrumbLink>
33
+ {/if}
34
+ </BreadcrumbItem>
35
+ {#if i < segments.length - 1}
36
+ <BreadcrumbSeparator />
37
+ {/if}
38
+ {/each}
39
+ </BreadcrumbList>
40
+ </Breadcrumb>
41
+ {/if}
42
+ {@render children()}
43
+ </main>
44
+ </div>
@@ -0,0 +1,11 @@
1
+ <!-- EDIT THIS FILE: add cards, KPIs, recent orders, sales charts, etc. -->
2
+ <svelte:head>
3
+ <title>Dashboard</title>
4
+ </svelte:head>
5
+
6
+ <div class="flex flex-col gap-4">
7
+ <h1 class="text-2xl font-bold tracking-tight">Dashboard</h1>
8
+ <p class="text-muted-foreground text-sm">
9
+ This is your admin home. Add widgets, KPI cards, and recent activity here.
10
+ </p>
11
+ </div>
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import { page } from "bosia/client";
3
+ import PublicNavbar from "$lib/components/PublicNavbar.svelte";
4
+
5
+ let { data, children }: { data: { user: any }; children: any } = $props();
6
+ </script>
7
+
8
+ <div class="flex min-h-screen flex-col">
9
+ <PublicNavbar currentPath={page.url.pathname} user={data.user} />
10
+ <div class="flex-1">
11
+ {@render children()}
12
+ </div>
13
+ </div>
@@ -0,0 +1,38 @@
1
+ <svelte:head>
2
+ <title>Welcome to your shop</title>
3
+ <meta
4
+ name="description"
5
+ content="A Bosia shop starter — auth, RBAC, S3 uploads, products & cart."
6
+ />
7
+ </svelte:head>
8
+
9
+ <main class="flex min-h-[80vh] flex-col items-center justify-center gap-6 p-8">
10
+ <div class="flex flex-col items-center gap-3 text-center">
11
+ <img src="/favicon.svg" alt="" class="size-16" />
12
+ <h1 class="text-4xl font-bold tracking-tight">Welcome to your shop</h1>
13
+ <p class="text-muted-foreground text-lg">
14
+ A Bosia shop starter — auth, RBAC, S3 uploads, products & cart.
15
+ </p>
16
+ </div>
17
+
18
+ <div class="mt-4 flex gap-3">
19
+ <a
20
+ href="/products"
21
+ class="bg-primary text-primary-foreground hover:bg-primary/90 rounded-md px-4 py-2 text-sm font-medium transition-colors"
22
+ >
23
+ Browse products
24
+ </a>
25
+ <a
26
+ href="/login"
27
+ class="border-border bg-secondary text-secondary-foreground hover:bg-secondary/80 rounded-md border px-4 py-2 text-sm font-medium transition-colors"
28
+ >
29
+ Sign in
30
+ </a>
31
+ </div>
32
+
33
+ <p class="text-muted-foreground mt-6 text-sm">
34
+ Edit <code class="bg-muted rounded px-1 py-0.5 font-mono text-xs"
35
+ >src/routes/(public)/+page.svelte</code
36
+ > to get started
37
+ </p>
38
+ </main>
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import type { ErrorProps } from "./$types";
3
+ let { error }: ErrorProps = $props();
4
+ </script>
5
+
6
+ <svelte:head>
7
+ <title>{error.status} — {error.message}</title>
8
+ </svelte:head>
9
+
10
+ <div class="min-h-screen flex flex-col items-center justify-center gap-4 text-center px-4">
11
+ <p class="text-8xl font-bold text-gray-200">{error.status}</p>
12
+ <p class="text-2xl font-semibold text-gray-700">{error.message}</p>
13
+ <a
14
+ href="/"
15
+ class="mt-4 px-5 py-2 rounded-lg bg-gray-900 text-white text-sm hover:bg-gray-700 transition-colors"
16
+ >
17
+ Go home
18
+ </a>
19
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { LoadEvent } from "bosia";
2
+
3
+ export async function load({ locals }: LoadEvent) {
4
+ return {
5
+ appName: "Bosia Shop",
6
+ requestTime: (locals.requestTime as number | null) ?? null,
7
+ user: locals.user ?? null,
8
+ };
9
+ }
@@ -0,0 +1,6 @@
1
+ <script lang="ts">
2
+ import "../app.css";
3
+ let { children }: { children: any } = $props();
4
+ </script>
5
+
6
+ {@render children()}
@@ -0,0 +1,10 @@
1
+ {
2
+ "features": ["auth", "rbac", "file-upload", "shop"],
3
+ "featureOptions": {
4
+ "drizzle.dialect": "postgres",
5
+ "auth.dialect": "postgres",
6
+ "rbac.dialect": "postgres",
7
+ "file-upload.dialect": "postgres",
8
+ "shop.dialect": "postgres"
9
+ }
10
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "allowJs": true,
8
+ "skipLibCheck": true,
9
+ "allowImportingTsExtensions": true,
10
+ "noEmit": true,
11
+ "verbatimModuleSyntax": true,
12
+ "types": ["bun-types"],
13
+ "lib": ["dom", "dom.iterable", "esnext"],
14
+ "rootDirs": [".", ".bosia/types"],
15
+ "paths": {
16
+ "$lib": ["./src/lib"],
17
+ "$lib/*": ["./src/lib/*"]
18
+ }
19
+ },
20
+ "include": ["src/**/*", ".bosia/types/**/*.d.ts"],
21
+ "exclude": ["node_modules", "dist"]
22
+ }
@@ -4,3 +4,4 @@ build
4
4
  .bosia
5
5
  bun.lock
6
6
  public/bosia-tw.css
7
+ bosia.json
@@ -1,6 +1,8 @@
1
1
  @import "tailwindcss";
2
2
  @source "../src";
3
3
 
4
+ @custom-variant dark (&:where(.dark, .dark *));
5
+
4
6
  /*
5
7
  * ─── shadcn-inspired Design Tokens ──────────────────────
6
8
  * CSS custom properties for light & dark themes.
@@ -1,3 +1,6 @@
1
1
  {
2
- "features": ["todo"]
2
+ "features": ["todo"],
3
+ "featureOptions": {
4
+ "drizzle.dialect": "postgres"
5
+ }
3
6
  }