bosia 0.2.3 → 0.3.1
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/README.md +39 -39
- package/package.json +56 -54
- package/src/ambient.d.ts +31 -0
- package/src/cli/add.ts +120 -114
- package/src/cli/build.ts +10 -10
- package/src/cli/create.ts +142 -137
- package/src/cli/dev.ts +7 -9
- package/src/cli/feat.ts +266 -258
- package/src/cli/index.ts +51 -42
- package/src/cli/registry.ts +136 -115
- package/src/cli/start.ts +17 -17
- package/src/cli/test.ts +25 -0
- package/src/core/build.ts +72 -56
- package/src/core/client/App.svelte +177 -156
- package/src/core/client/appState.svelte.ts +33 -31
- package/src/core/client/enhance.ts +83 -78
- package/src/core/client/hydrate.ts +95 -81
- package/src/core/client/prefetch.ts +101 -94
- package/src/core/client/router.svelte.ts +64 -51
- package/src/core/cookies.ts +70 -66
- package/src/core/cors.ts +44 -35
- package/src/core/csrf.ts +38 -38
- package/src/core/dedup.ts +17 -17
- package/src/core/dev.ts +196 -168
- package/src/core/env.ts +160 -148
- package/src/core/envCodegen.ts +73 -73
- package/src/core/errors.ts +48 -49
- package/src/core/hooks.ts +50 -50
- package/src/core/html.ts +184 -145
- package/src/core/matcher.ts +130 -121
- package/src/core/paths.ts +8 -10
- package/src/core/plugin.ts +113 -107
- package/src/core/prerender.ts +191 -122
- package/src/core/renderer.ts +359 -286
- package/src/core/routeFile.ts +140 -127
- package/src/core/routeTypes.ts +144 -83
- package/src/core/scanner.ts +125 -95
- package/src/core/server.ts +538 -424
- package/src/core/types.ts +25 -20
- package/src/lib/index.ts +8 -8
- package/src/lib/utils.ts +44 -30
- package/templates/default/.prettierignore +5 -0
- package/templates/default/.prettierrc.json +9 -0
- package/templates/default/README.md +5 -5
- package/templates/default/package.json +22 -18
- package/templates/default/src/app.css +80 -80
- package/templates/default/src/app.d.ts +3 -3
- package/templates/default/src/routes/+error.svelte +7 -10
- package/templates/default/src/routes/+layout.svelte +2 -2
- package/templates/default/src/routes/+page.svelte +30 -32
- package/templates/default/src/routes/about/+page.svelte +3 -3
- package/templates/default/tsconfig.json +20 -20
- package/templates/demo/.prettierignore +5 -0
- package/templates/demo/.prettierrc.json +9 -0
- package/templates/demo/README.md +9 -9
- package/templates/demo/package.json +22 -17
- package/templates/demo/src/app.css +80 -80
- package/templates/demo/src/app.d.ts +3 -3
- package/templates/demo/src/hooks.server.ts +9 -9
- package/templates/demo/src/routes/(public)/+layout.svelte +45 -23
- package/templates/demo/src/routes/(public)/+page.svelte +96 -67
- package/templates/demo/src/routes/(public)/about/+page.svelte +13 -25
- package/templates/demo/src/routes/(public)/all/[...catchall]/+page.svelte +24 -28
- package/templates/demo/src/routes/(public)/blog/+page.svelte +55 -46
- package/templates/demo/src/routes/(public)/blog/[slug]/+page.server.ts +36 -38
- package/templates/demo/src/routes/(public)/blog/[slug]/+page.svelte +60 -42
- package/templates/demo/src/routes/+error.svelte +10 -7
- package/templates/demo/src/routes/+layout.server.ts +4 -4
- package/templates/demo/src/routes/+layout.svelte +2 -2
- package/templates/demo/src/routes/actions-test/+page.server.ts +16 -16
- package/templates/demo/src/routes/actions-test/+page.svelte +49 -49
- package/templates/demo/src/routes/api/hello/+server.ts +25 -25
- package/templates/demo/tsconfig.json +20 -20
- package/templates/todo/.prettierignore +5 -0
- package/templates/todo/.prettierrc.json +9 -0
- package/templates/todo/README.md +9 -9
- package/templates/todo/package.json +22 -17
- package/templates/todo/src/app.css +80 -80
- package/templates/todo/src/app.d.ts +7 -7
- package/templates/todo/src/hooks.server.ts +9 -9
- package/templates/todo/src/routes/+error.svelte +10 -7
- package/templates/todo/src/routes/+layout.server.ts +4 -4
- package/templates/todo/src/routes/+layout.svelte +2 -2
- package/templates/todo/src/routes/+page.svelte +44 -44
- package/templates/todo/template.json +1 -1
- package/templates/todo/tsconfig.json +20 -20
package/src/core/types.ts
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
// ─── Bosia Core Types ────────────────────────────────────
|
|
2
2
|
|
|
3
|
+
/** Canonicalization mode for trailing slashes. Set per-page or per-layout. */
|
|
4
|
+
export type TrailingSlash = "never" | "always" | "ignore";
|
|
5
|
+
|
|
3
6
|
/** A page route discovered from the file system */
|
|
4
7
|
export interface PageRoute {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
/** URL pattern, e.g. "/" or "/blog/[slug]" or "/[...rest]" */
|
|
9
|
+
pattern: string;
|
|
10
|
+
/** Path to +page.svelte, relative to src/routes/ */
|
|
11
|
+
page: string;
|
|
12
|
+
/** Chain of +layout.svelte paths root → leaf, relative to src/routes/ */
|
|
13
|
+
layouts: string[];
|
|
14
|
+
/** Path to +page.server.ts if exists, relative to src/routes/ */
|
|
15
|
+
pageServer: string | null;
|
|
16
|
+
/** Chain of +layout.server.ts files root → leaf, with their layout depth */
|
|
17
|
+
layoutServers: { path: string; depth: number }[];
|
|
18
|
+
/** Effective trailing-slash mode (page wins over layout chain). Defaults to "never". */
|
|
19
|
+
trailingSlash: TrailingSlash;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
/** An API route discovered from the file system */
|
|
18
23
|
export interface ApiRoute {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
/** URL pattern, e.g. "/api/hello" or "/api/users/[id]" */
|
|
25
|
+
pattern: string;
|
|
26
|
+
/** Path to +server.ts, relative to src/routes/ */
|
|
27
|
+
server: string;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
/** The full route manifest produced by the scanner */
|
|
26
31
|
export interface RouteManifest {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
pages: PageRoute[];
|
|
33
|
+
apis: ApiRoute[];
|
|
34
|
+
/** Path to root +error.svelte if it exists, relative to src/routes/ */
|
|
35
|
+
errorPage: string | null;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
/** Result of matching a URL against a route */
|
|
34
39
|
export interface RouteMatch<T> {
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
route: T;
|
|
41
|
+
params: Record<string, string>;
|
|
37
42
|
}
|
package/src/lib/index.ts
CHANGED
|
@@ -8,14 +8,14 @@ export { sequence } from "../core/hooks.ts";
|
|
|
8
8
|
export { error, redirect, fail } from "../core/errors.ts";
|
|
9
9
|
export type { HttpError, Redirect, RedirectOptions, ActionFailure } from "../core/errors.ts";
|
|
10
10
|
export type {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
RequestEvent,
|
|
12
|
+
LoadEvent,
|
|
13
|
+
MetadataEvent,
|
|
14
|
+
Metadata,
|
|
15
|
+
Handle,
|
|
16
|
+
ResolveFunction,
|
|
17
|
+
Cookies,
|
|
18
|
+
CookieOptions,
|
|
19
19
|
} from "../core/hooks.ts";
|
|
20
20
|
export type { CsrfConfig } from "../core/csrf.ts";
|
|
21
21
|
export type { CorsConfig } from "../core/cors.ts";
|
package/src/lib/utils.ts
CHANGED
|
@@ -2,45 +2,59 @@ import { twMerge } from "tailwind-merge";
|
|
|
2
2
|
|
|
3
3
|
type ClassDictionary = Record<string, any>;
|
|
4
4
|
type ClassArray = ClassValue[];
|
|
5
|
-
type ClassValue =
|
|
5
|
+
type ClassValue =
|
|
6
|
+
| ClassArray
|
|
7
|
+
| ClassDictionary
|
|
8
|
+
| string
|
|
9
|
+
| number
|
|
10
|
+
| bigint
|
|
11
|
+
| null
|
|
12
|
+
| boolean
|
|
13
|
+
| undefined;
|
|
6
14
|
|
|
7
15
|
function clsx(...inputs: ClassValue[]): string {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
let str = "";
|
|
17
|
+
for (const input of inputs) {
|
|
18
|
+
if (!input) continue;
|
|
19
|
+
if (typeof input === "string" || typeof input === "number") {
|
|
20
|
+
str && (str += " ");
|
|
21
|
+
str += input;
|
|
22
|
+
} else if (Array.isArray(input)) {
|
|
23
|
+
const inner = clsx(...input);
|
|
24
|
+
if (inner) {
|
|
25
|
+
str && (str += " ");
|
|
26
|
+
str += inner;
|
|
27
|
+
}
|
|
28
|
+
} else if (typeof input === "object") {
|
|
29
|
+
for (const k in input) {
|
|
30
|
+
if ((input as ClassDictionary)[k]) {
|
|
31
|
+
str && (str += " ");
|
|
32
|
+
str += k;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return str;
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
export function cn(...inputs: ClassValue[]) {
|
|
27
|
-
|
|
41
|
+
return twMerge(clsx(inputs));
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
export function getServerTime() {
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
const now = new Date();
|
|
46
|
+
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
33
47
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
// Get timezone offset in minutes and convert to ±HH:MM format
|
|
49
|
+
const offsetMinutes = -now.getTimezoneOffset();
|
|
50
|
+
const offsetHours = Math.floor(Math.abs(offsetMinutes) / 60);
|
|
51
|
+
const offsetMins = Math.abs(offsetMinutes) % 60;
|
|
52
|
+
const sign = offsetMinutes >= 0 ? "+" : "-";
|
|
53
|
+
const offsetStr = `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMins).padStart(2, "0")}`;
|
|
40
54
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
// Convert UTC time to local time by adding the offset
|
|
56
|
+
const localTime = new Date(now.getTime() + offsetMinutes * 60 * 1000);
|
|
57
|
+
const timestamp = localTime.toISOString().slice(0, -1) + offsetStr;
|
|
44
58
|
|
|
45
|
-
|
|
59
|
+
return { timestamp, timezone: timeZone };
|
|
46
60
|
}
|
|
@@ -48,7 +48,7 @@ Fetch data on the server before rendering:
|
|
|
48
48
|
import type { LoadEvent } from "bosia";
|
|
49
49
|
|
|
50
50
|
export async function load({ params }: LoadEvent) {
|
|
51
|
-
|
|
51
|
+
return { post: await getPost(params.slug) };
|
|
52
52
|
}
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -57,7 +57,7 @@ export async function load({ params }: LoadEvent) {
|
|
|
57
57
|
```typescript
|
|
58
58
|
// src/routes/api/hello/+server.ts
|
|
59
59
|
export function GET() {
|
|
60
|
-
|
|
60
|
+
return Response.json({ message: "hello" });
|
|
61
61
|
}
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -79,8 +79,8 @@ src/routes/
|
|
|
79
79
|
|
|
80
80
|
```svelte
|
|
81
81
|
<div class="bg-background text-foreground">
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
<p class="text-muted-foreground">Muted text</p>
|
|
83
|
+
<button class="bg-primary text-primary-foreground">Click</button>
|
|
84
84
|
</div>
|
|
85
85
|
```
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ Dark mode is supported via the `.dark` class on any parent element.
|
|
|
92
92
|
import { cn } from "$lib/utils";
|
|
93
93
|
|
|
94
94
|
// Merges Tailwind classes safely
|
|
95
|
-
cn("px-4 py-2", isActive && "bg-primary")
|
|
95
|
+
cn("px-4 py-2", isActive && "bg-primary");
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
## Learn More
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
"name": "{{PROJECT_NAME}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "bosia dev",
|
|
7
|
+
"build": "bosia build",
|
|
8
|
+
"start": "bosia start",
|
|
9
|
+
"check": "tsc --noEmit && prettier --check .",
|
|
10
|
+
"format": "prettier --write .",
|
|
11
|
+
"format:check": "prettier --check ."
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"bosia": "^{{BOSIA_VERSION}}",
|
|
15
|
+
"svelte": "^5.20.0",
|
|
16
|
+
"tailwind-merge": "^3.5.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/bun": "latest",
|
|
20
|
+
"prettier": "^3.3.0",
|
|
21
|
+
"prettier-plugin-svelte": "^3.2.0",
|
|
22
|
+
"typescript": "^5"
|
|
23
|
+
}
|
|
20
24
|
}
|
|
@@ -8,125 +8,125 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
@theme {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
--color-background: hsl(var(--background));
|
|
12
|
+
--color-foreground: hsl(var(--foreground));
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
--color-card: hsl(var(--card));
|
|
15
|
+
--color-card-foreground: hsl(var(--card-foreground));
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
--color-popover: hsl(var(--popover));
|
|
18
|
+
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
--color-primary: hsl(var(--primary));
|
|
21
|
+
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
--color-secondary: hsl(var(--secondary));
|
|
24
|
+
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
--color-muted: hsl(var(--muted));
|
|
27
|
+
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
--color-accent: hsl(var(--accent));
|
|
30
|
+
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
--color-destructive: hsl(var(--destructive));
|
|
33
|
+
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
--color-border: hsl(var(--border));
|
|
36
|
+
--color-input: hsl(var(--input));
|
|
37
|
+
--color-ring: hsl(var(--ring));
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
40
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
41
|
+
--radius-lg: var(--radius);
|
|
42
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/* ─── Light Theme (Default) ─────────────────────────────── */
|
|
46
46
|
|
|
47
47
|
:root {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
--background: 0 0% 100%;
|
|
49
|
+
--foreground: 222.2 84% 4.9%;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
--card: 0 0% 100%;
|
|
52
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
--popover: 0 0% 100%;
|
|
55
|
+
--popover-foreground: 222.2 84% 4.9%;
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
--primary: 222.2 47.4% 11.2%;
|
|
58
|
+
--primary-foreground: 210 40% 98%;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
--secondary: 210 40% 96.1%;
|
|
61
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
--muted: 210 40% 96.1%;
|
|
64
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
--accent: 210 40% 96.1%;
|
|
67
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
--destructive: 0 84.2% 60.2%;
|
|
70
|
+
--destructive-foreground: 210 40% 98%;
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
--border: 214.3 31.8% 91.4%;
|
|
73
|
+
--input: 214.3 31.8% 91.4%;
|
|
74
|
+
--ring: 222.2 84% 4.9%;
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
--radius: 0.5rem;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/* ─── Dark Theme ─────────────────────────────────────────── */
|
|
80
80
|
|
|
81
81
|
.dark {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
--background: 222.2 84% 4.9%;
|
|
83
|
+
--foreground: 210 40% 98%;
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
--card: 222.2 84% 4.9%;
|
|
86
|
+
--card-foreground: 210 40% 98%;
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
--popover: 222.2 84% 4.9%;
|
|
89
|
+
--popover-foreground: 210 40% 98%;
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
--primary: 210 40% 98%;
|
|
92
|
+
--primary-foreground: 222.2 47.4% 11.2%;
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
--secondary: 217.2 32.6% 17.5%;
|
|
95
|
+
--secondary-foreground: 210 40% 98%;
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
--muted: 217.2 32.6% 17.5%;
|
|
98
|
+
--muted-foreground: 215 20.2% 65.1%;
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
--accent: 217.2 32.6% 17.5%;
|
|
101
|
+
--accent-foreground: 210 40% 98%;
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
--destructive: 0 62.8% 30.6%;
|
|
104
|
+
--destructive-foreground: 210 40% 98%;
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
--border: 217.2 32.6% 17.5%;
|
|
107
|
+
--input: 217.2 32.6% 17.5%;
|
|
108
|
+
--ring: 212.7 26.8% 83.9%;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/* ─── Base Styles ────────────────────────────────────────── */
|
|
112
112
|
|
|
113
113
|
@layer base {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
114
|
+
* {
|
|
115
|
+
border-color: theme(--color-border);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
body {
|
|
119
|
+
background-color: theme(--color-background);
|
|
120
|
+
color: theme(--color-foreground);
|
|
121
|
+
font-family:
|
|
122
|
+
"Inter",
|
|
123
|
+
system-ui,
|
|
124
|
+
-apple-system,
|
|
125
|
+
BlinkMacSystemFont,
|
|
126
|
+
"Segoe UI",
|
|
127
|
+
Roboto,
|
|
128
|
+
"Helvetica Neue",
|
|
129
|
+
Arial,
|
|
130
|
+
sans-serif;
|
|
131
|
+
}
|
|
132
132
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="svelte" />
|
|
2
2
|
|
|
3
3
|
declare module "*.svelte" {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import type { Component } from "svelte";
|
|
5
|
+
const component: Component<Record<string, any>, Record<string, any>, any>;
|
|
6
|
+
export default component;
|
|
7
7
|
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
let { error }: { error: { status: number; message: string } } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<svelte:head>
|
|
6
|
-
|
|
6
|
+
<title>{error.status} — {error.message}</title>
|
|
7
7
|
</svelte:head>
|
|
8
8
|
|
|
9
9
|
<main class="flex min-h-screen flex-col items-center justify-center gap-4 text-center px-4">
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
>
|
|
16
|
-
Go home
|
|
17
|
-
</a>
|
|
10
|
+
<p class="text-8xl font-bold text-gray-200">{error.status}</p>
|
|
11
|
+
<p class="text-2xl font-semibold">{error.message}</p>
|
|
12
|
+
<a href="/" class="mt-4 rounded-md border px-4 py-2 text-sm hover:bg-muted transition-colors">
|
|
13
|
+
Go home
|
|
14
|
+
</a>
|
|
18
15
|
</main>
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
const name = "{{PROJECT_NAME}}";
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
1
|
<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-8">
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
<div class="flex flex-col items-center gap-3 text-center">
|
|
3
|
+
<img src="/favicon.svg" alt="" class="size-16" />
|
|
4
|
+
<h1 class="text-4xl font-bold tracking-tight">Welcome to Bosia</h1>
|
|
5
|
+
<p class="text-muted-foreground text-lg">
|
|
6
|
+
A Bosia project — SSR + Svelte 5 + Bun + ElysiaJS
|
|
7
|
+
</p>
|
|
8
|
+
</div>
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
10
|
+
<div class="mt-4 flex gap-3">
|
|
11
|
+
<a
|
|
12
|
+
href="https://github.com/bosapi/bosia"
|
|
13
|
+
target="_blank"
|
|
14
|
+
rel="noopener noreferrer"
|
|
15
|
+
class="bg-primary text-primary-foreground hover:bg-primary/90 rounded-md px-4 py-2 text-sm font-medium transition-colors"
|
|
16
|
+
>
|
|
17
|
+
Docs
|
|
18
|
+
</a>
|
|
19
|
+
<a
|
|
20
|
+
href="https://github.com/bosapi/bosia/tree/main/registry"
|
|
21
|
+
target="_blank"
|
|
22
|
+
rel="noopener noreferrer"
|
|
23
|
+
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"
|
|
24
|
+
>
|
|
25
|
+
Components
|
|
26
|
+
</a>
|
|
27
|
+
</div>
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
<p class="text-muted-foreground mt-6 text-sm">
|
|
30
|
+
Edit <code class="bg-muted rounded px-1 py-0.5 font-mono text-xs"
|
|
31
|
+
>src/routes/+page.svelte</code
|
|
32
|
+
> to get started
|
|
33
|
+
</p>
|
|
36
34
|
</main>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<svelte:head>
|
|
2
|
-
|
|
2
|
+
<title>About | Bosia</title>
|
|
3
3
|
</svelte:head>
|
|
4
4
|
|
|
5
5
|
<div>
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
<h1>About</h1>
|
|
7
|
+
<p>This page is prerendered at build time — no server work per request.</p>
|
|
8
8
|
</div>
|