create-thexjs-app 0.1.4 → 1.1.0

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 (138) hide show
  1. package/README.md +56 -985
  2. package/dist/index.js +265 -196
  3. package/package.json +5 -1
  4. package/templates/{basic → addons/auth}/src/api/auth/login.ts +1 -3
  5. package/templates/{basic → addons/auth}/src/lib/auth.ts +13 -9
  6. package/templates/{basic → addons/auth}/src/lib/migrations/001_create_sessions.sql +1 -3
  7. package/templates/addons/auth/src/pages/dashboard/index.tsx +39 -0
  8. package/templates/addons/auth/src/pages/login.tsx +72 -0
  9. package/templates/addons/content/content/hello-world.md +13 -0
  10. package/templates/addons/content/src/pages/blog.tsx +29 -0
  11. package/templates/{basic → addons/shadcn}/components.json +1 -1
  12. package/templates/addons/shadcn/src/components/ui/badge.tsx +17 -0
  13. package/templates/addons/shadcn/src/components/ui/button.tsx +36 -0
  14. package/templates/addons/shadcn/src/components/ui/card.tsx +33 -0
  15. package/templates/addons/shadcn/src/components/ui/input.tsx +18 -0
  16. package/templates/addons/tailwind/src/styles/globals.css +32 -0
  17. package/templates/base/src/pages/index.tsx +29 -0
  18. package/templates/base/src/styles/globals.css +22 -0
  19. package/templates/base/tsconfig.json +24 -0
  20. package/templates/basic/content/blog/hello.md +0 -8
  21. package/templates/basic/public/favicon.ico +0 -0
  22. package/templates/basic/src/actions/dashboard/greet.ts +0 -3
  23. package/templates/basic/src/api/placeholder/comments.ts +0 -17
  24. package/templates/basic/src/api/placeholder/posts.ts +0 -20
  25. package/templates/basic/src/api/placeholder/todos.ts +0 -21
  26. package/templates/basic/src/api/placeholder/users.ts +0 -12
  27. package/templates/basic/src/components/Head.tsx +0 -21
  28. package/templates/basic/src/components/Image.tsx +0 -27
  29. package/templates/basic/src/components/Link.tsx +0 -10
  30. package/templates/basic/src/components/ui/badge.tsx +0 -49
  31. package/templates/basic/src/components/ui/button.tsx +0 -58
  32. package/templates/basic/src/components/ui/card.tsx +0 -88
  33. package/templates/basic/src/components/ui/input.tsx +0 -20
  34. package/templates/basic/src/layouts/main.tsx +0 -38
  35. package/templates/basic/src/lib/placeholder-data.ts +0 -176
  36. package/templates/basic/src/pages/_404.tsx +0 -17
  37. package/templates/basic/src/pages/about.tsx +0 -22
  38. package/templates/basic/src/pages/blog.tsx +0 -41
  39. package/templates/basic/src/pages/dashboard/index.tsx +0 -84
  40. package/templates/basic/src/pages/index.tsx +0 -54
  41. package/templates/basic/src/pages/login.tsx +0 -92
  42. package/templates/basic/src/pages/placeholder.tsx +0 -203
  43. package/templates/basic/src/pages/posts/[id].tsx +0 -17
  44. package/templates/basic/src/styles/globals.css +0 -90
  45. package/templates/basic/src/x-routes.ts +0 -29
  46. package/templates/basic/tsconfig.json +0 -11
  47. package/templates/basic/x.config.ts +0 -10
  48. package/templates/blog/components.json +0 -20
  49. package/templates/blog/content/posts/getting-started.md +0 -38
  50. package/templates/blog/content/posts/hello-world.md +0 -21
  51. package/templates/blog/content/posts/tailwind-v4.md +0 -31
  52. package/templates/blog/public/favicon.ico +0 -0
  53. package/templates/blog/src/components/ui/avatar.tsx +0 -91
  54. package/templates/blog/src/components/ui/badge.tsx +0 -49
  55. package/templates/blog/src/components/ui/button.tsx +0 -58
  56. package/templates/blog/src/components/ui/card.tsx +0 -88
  57. package/templates/blog/src/components/ui/input.tsx +0 -20
  58. package/templates/blog/src/layouts/blog.tsx +0 -46
  59. package/templates/blog/src/layouts/main.tsx +0 -32
  60. package/templates/blog/src/lib/utils.ts +0 -5
  61. package/templates/blog/src/pages/about.tsx +0 -36
  62. package/templates/blog/src/pages/blog/[slug].tsx +0 -56
  63. package/templates/blog/src/pages/blog/index.tsx +0 -70
  64. package/templates/blog/src/pages/index.tsx +0 -73
  65. package/templates/blog/src/styles/globals.css +0 -90
  66. package/templates/blog/src/x-routes.ts +0 -20
  67. package/templates/blog/tsconfig.json +0 -5
  68. package/templates/blog/x.config.ts +0 -6
  69. package/templates/default/components.json +0 -19
  70. package/templates/default/src/layouts/main.tsx +0 -28
  71. package/templates/default/src/pages/index.tsx +0 -66
  72. package/templates/default/src/styles/globals.css +0 -55
  73. package/templates/default/src/x-routes.ts +0 -17
  74. package/templates/default/tsconfig.json +0 -5
  75. package/templates/default/x.config.ts +0 -6
  76. package/templates/landing/components.json +0 -20
  77. package/templates/landing/public/favicon.ico +0 -0
  78. package/templates/landing/src/components/code-block.tsx +0 -118
  79. package/templates/landing/src/components/ui/avatar.tsx +0 -91
  80. package/templates/landing/src/components/ui/badge.tsx +0 -49
  81. package/templates/landing/src/components/ui/button.tsx +0 -58
  82. package/templates/landing/src/components/ui/card.tsx +0 -88
  83. package/templates/landing/src/components/ui/input.tsx +0 -20
  84. package/templates/landing/src/layouts/main.tsx +0 -78
  85. package/templates/landing/src/lib/syntax.tsx +0 -366
  86. package/templates/landing/src/lib/utils.ts +0 -5
  87. package/templates/landing/src/pages/docs/_layout.tsx +0 -139
  88. package/templates/landing/src/pages/docs/api-routes.tsx +0 -113
  89. package/templates/landing/src/pages/docs/build-deploy.tsx +0 -124
  90. package/templates/landing/src/pages/docs/configuration.tsx +0 -121
  91. package/templates/landing/src/pages/docs/content-collections.tsx +0 -130
  92. package/templates/landing/src/pages/docs/data-layer.tsx +0 -142
  93. package/templates/landing/src/pages/docs/getting-started.tsx +0 -129
  94. package/templates/landing/src/pages/docs/index.tsx +0 -187
  95. package/templates/landing/src/pages/docs/installation.tsx +0 -143
  96. package/templates/landing/src/pages/docs/introduction.tsx +0 -114
  97. package/templates/landing/src/pages/docs/layouts.tsx +0 -114
  98. package/templates/landing/src/pages/docs/middleware.tsx +0 -124
  99. package/templates/landing/src/pages/docs/packages/cli.tsx +0 -133
  100. package/templates/landing/src/pages/docs/packages/core.tsx +0 -176
  101. package/templates/landing/src/pages/docs/packages/env.tsx +0 -128
  102. package/templates/landing/src/pages/docs/pages.tsx +0 -135
  103. package/templates/landing/src/pages/docs/routing.tsx +0 -123
  104. package/templates/landing/src/pages/docs/server-functions.tsx +0 -177
  105. package/templates/landing/src/pages/features.tsx +0 -129
  106. package/templates/landing/src/pages/index.tsx +0 -159
  107. package/templates/landing/src/styles/globals.css +0 -136
  108. package/templates/landing/src/x-routes.ts +0 -31
  109. package/templates/landing/tsconfig.json +0 -10
  110. package/templates/landing/x.config.ts +0 -2
  111. package/templates/saas/components.json +0 -20
  112. package/templates/saas/public/favicon.ico +0 -0
  113. package/templates/saas/src/actions/dashboard.ts +0 -3
  114. package/templates/saas/src/api/auth/login.ts +0 -31
  115. package/templates/saas/src/components/ui/avatar.tsx +0 -91
  116. package/templates/saas/src/components/ui/badge.tsx +0 -49
  117. package/templates/saas/src/components/ui/button.tsx +0 -58
  118. package/templates/saas/src/components/ui/card.tsx +0 -88
  119. package/templates/saas/src/components/ui/input.tsx +0 -20
  120. package/templates/saas/src/layouts/dashboard.tsx +0 -67
  121. package/templates/saas/src/layouts/main.tsx +0 -38
  122. package/templates/saas/src/lib/auth.ts +0 -91
  123. package/templates/saas/src/lib/migrations/001_create_sessions.sql +0 -9
  124. package/templates/saas/src/lib/utils.ts +0 -5
  125. package/templates/saas/src/pages/dashboard/_middleware.ts +0 -9
  126. package/templates/saas/src/pages/dashboard/analytics.tsx +0 -68
  127. package/templates/saas/src/pages/dashboard/index.tsx +0 -86
  128. package/templates/saas/src/pages/dashboard/settings.tsx +0 -111
  129. package/templates/saas/src/pages/index.tsx +0 -110
  130. package/templates/saas/src/pages/login.tsx +0 -140
  131. package/templates/saas/src/pages/pricing.tsx +0 -121
  132. package/templates/saas/src/styles/globals.css +0 -90
  133. package/templates/saas/src/x-routes.ts +0 -22
  134. package/templates/saas/tsconfig.json +0 -5
  135. package/templates/saas/x.config.ts +0 -7
  136. /package/templates/{basic → addons/auth}/src/api/auth/logout.ts +0 -0
  137. /package/templates/{basic → addons/auth}/src/pages/dashboard/_middleware.ts +0 -0
  138. /package/templates/{basic → addons/shadcn}/src/lib/utils.ts +0 -0
@@ -1,58 +0,0 @@
1
- import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
- import { type VariantProps, cva } from "class-variance-authority";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- const buttonVariants = cva(
7
- "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-primary text-primary-foreground hover:bg-primary/80",
12
- outline:
13
- "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
14
- secondary:
15
- "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
16
- ghost:
17
- "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
18
- destructive:
19
- "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
20
- link: "text-primary underline-offset-4 hover:underline",
21
- },
22
- size: {
23
- default:
24
- "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
25
- xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
26
- sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
27
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
28
- icon: "size-8",
29
- "icon-xs":
30
- "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
31
- "icon-sm":
32
- "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
33
- "icon-lg": "size-9",
34
- },
35
- },
36
- defaultVariants: {
37
- variant: "default",
38
- size: "default",
39
- },
40
- },
41
- );
42
-
43
- function Button({
44
- className,
45
- variant = "default",
46
- size = "default",
47
- ...props
48
- }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
49
- return (
50
- <ButtonPrimitive
51
- data-slot="button"
52
- className={cn(buttonVariants({ variant, size, className }))}
53
- {...props}
54
- />
55
- );
56
- }
57
-
58
- export { Button, buttonVariants };
@@ -1,88 +0,0 @@
1
- import type * as React from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- function Card({
6
- className,
7
- size = "default",
8
- ...props
9
- }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
10
- return (
11
- <div
12
- data-slot="card"
13
- data-size={size}
14
- className={cn(
15
- "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
16
- className,
17
- )}
18
- {...props}
19
- />
20
- );
21
- }
22
-
23
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
24
- return (
25
- <div
26
- data-slot="card-header"
27
- className={cn(
28
- "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
29
- className,
30
- )}
31
- {...props}
32
- />
33
- );
34
- }
35
-
36
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
37
- return (
38
- <div
39
- data-slot="card-title"
40
- className={cn(
41
- "text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
42
- className,
43
- )}
44
- {...props}
45
- />
46
- );
47
- }
48
-
49
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
50
- return (
51
- <div
52
- data-slot="card-description"
53
- className={cn("text-sm text-muted-foreground", className)}
54
- {...props}
55
- />
56
- );
57
- }
58
-
59
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
60
- return (
61
- <div
62
- data-slot="card-action"
63
- className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
64
- {...props}
65
- />
66
- );
67
- }
68
-
69
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
70
- return (
71
- <div data-slot="card-content" className={cn("px-(--card-spacing)", className)} {...props} />
72
- );
73
- }
74
-
75
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
76
- return (
77
- <div
78
- data-slot="card-footer"
79
- className={cn(
80
- "flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",
81
- className,
82
- )}
83
- {...props}
84
- />
85
- );
86
- }
87
-
88
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
@@ -1,20 +0,0 @@
1
- import { Input as InputPrimitive } from "@base-ui/react/input";
2
- import type * as React from "react";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
7
- return (
8
- <InputPrimitive
9
- type={type}
10
- data-slot="input"
11
- className={cn(
12
- "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
13
- className,
14
- )}
15
- {...props}
16
- />
17
- );
18
- }
19
-
20
- export { Input };
@@ -1,46 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- export default function BlogLayout({ children }: { children: ReactNode }) {
4
- return (
5
- <div className="mx-auto max-w-4xl px-4 py-8">
6
- <nav className="mb-8 text-sm text-muted-foreground">
7
- <a href="/" className="transition-colors hover:text-foreground">
8
- Home
9
- </a>
10
- <span className="mx-2">/</span>
11
- <span className="text-foreground">Blog</span>
12
- </nav>
13
- <div className="grid gap-12 lg:grid-cols-[1fr_280px]">
14
- <div>{children}</div>
15
- <aside className="space-y-8">
16
- <div className="rounded-lg border border-border bg-card p-6">
17
- <h3 className="mb-4 text-sm font-semibold uppercase tracking-wider text-muted-foreground">
18
- Categories
19
- </h3>
20
- <ul className="space-y-2 text-sm text-muted-foreground">
21
- <li className="transition-colors hover:text-foreground">All Posts</li>
22
- <li className="transition-colors hover:text-foreground">Tutorials</li>
23
- <li className="transition-colors hover:text-foreground">Design</li>
24
- <li className="transition-colors hover:text-foreground">Technology</li>
25
- </ul>
26
- </div>
27
- <div className="rounded-lg border border-border bg-card p-6">
28
- <h3 className="mb-4 text-sm font-semibold uppercase tracking-wider text-muted-foreground">
29
- Tags
30
- </h3>
31
- <div className="flex flex-wrap gap-2">
32
- {["welcome", "tutorial", "css", "tailwind", "x-framework"].map((tag) => (
33
- <span
34
- key={tag}
35
- className="rounded-full border border-border bg-muted px-3 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground"
36
- >
37
- {tag}
38
- </span>
39
- ))}
40
- </div>
41
- </div>
42
- </aside>
43
- </div>
44
- </div>
45
- );
46
- }
@@ -1,32 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- export default function MainLayout({ children }: { children: ReactNode }) {
4
- return (
5
- <div className="flex min-h-screen flex-col bg-background">
6
- <header className="sticky top-0 z-50 border-b border-border bg-background/80 backdrop-blur-sm">
7
- <div className="mx-auto flex h-16 max-w-4xl items-center justify-between px-4">
8
- <a href="/" className="text-xl font-bold tracking-tight text-foreground">
9
- Blog
10
- </a>
11
- <nav className="flex items-center gap-8 text-sm font-medium text-muted-foreground">
12
- <a href="/" className="transition-colors hover:text-foreground">
13
- Home
14
- </a>
15
- <a href="/blog" className="transition-colors hover:text-foreground">
16
- Blog
17
- </a>
18
- <a href="/about" className="transition-colors hover:text-foreground">
19
- About
20
- </a>
21
- </nav>
22
- </div>
23
- </header>
24
- <main className="flex-1">{children}</main>
25
- <footer className="border-t border-border">
26
- <div className="mx-auto max-w-4xl px-4 py-8 text-center text-sm text-muted-foreground">
27
- &copy; {new Date().getFullYear()} The Blog. Built with x framework.
28
- </div>
29
- </footer>
30
- </div>
31
- );
32
- }
@@ -1,5 +0,0 @@
1
- import { type ClassValue, clsx } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
- export function cn(...inputs: ClassValue[]) {
4
- return twMerge(clsx(inputs));
5
- }
@@ -1,36 +0,0 @@
1
- import type { RouteProps } from "@thexjs/core";
2
-
3
- export default function AboutPage(_props: RouteProps) {
4
- return (
5
- <div className="mx-auto max-w-prose px-4 py-16">
6
- <h1 className="text-4xl font-bold tracking-tight">About This Blog</h1>
7
- <div className="mt-8 space-y-6 text-base leading-relaxed text-muted-foreground">
8
- <p>
9
- The Blog is a showcase for the <strong className="text-foreground">x framework</strong> —
10
- a Bun-based fullstack framework that combines static generation, server-side rendering,
11
- and API routes in a single process. This example demonstrates file-based routing, content
12
- collections, layouts, and more.
13
- </p>
14
- <p>
15
- Built with Tailwind CSS v4 and shadcn/ui components, the design emphasizes readability,
16
- modern aesthetics, and a dark theme out of the box. Every page is responsive, accessible,
17
- and performant.
18
- </p>
19
- </div>
20
- <div className="mt-12 rounded-2xl border border-border bg-card p-8">
21
- <h2 className="text-xl font-semibold tracking-tight">Author</h2>
22
- <div className="mt-4 flex items-center gap-4">
23
- <div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted text-sm font-semibold text-muted-foreground">
24
- X
25
- </div>
26
- <div>
27
- <p className="font-medium text-card-foreground">x Framework Team</p>
28
- <p className="text-sm text-muted-foreground">
29
- Building the future of fullstack development.
30
- </p>
31
- </div>
32
- </div>
33
- </div>
34
- </div>
35
- );
36
- }
@@ -1,56 +0,0 @@
1
- import { join } from "node:path";
2
- import { renderMarkdown, scanContent } from "@thexjs/core";
3
- import type { LoaderArgs, RouteProps } from "@thexjs/core";
4
-
5
- interface PostLoaderData {
6
- html: string;
7
- title: string;
8
- date: string;
9
- tags: string[];
10
- }
11
-
12
- export async function loader({ params }: LoaderArgs) {
13
- const contentDir = join(import.meta.dir, "..", "..", "..", "content");
14
- const entries = scanContent(contentDir);
15
- const entry = entries.find((e) => e.slug === params.slug);
16
- if (!entry) return new Response(null, { status: 302, headers: { Location: "/blog" } });
17
- const html = await renderMarkdown(entry.body);
18
- return {
19
- html,
20
- title: entry.frontmatter.title ?? entry.slug,
21
- date: entry.frontmatter.date ?? "",
22
- tags: (entry.frontmatter.tags ?? []) as string[],
23
- };
24
- }
25
-
26
- export default function BlogPostPage({ loaderData }: RouteProps) {
27
- const data = loaderData as Record<string, unknown>;
28
- const html = data.html as string;
29
- const title = data.title as string;
30
- const date = data.date as string;
31
- const tags = Array.isArray(data.tags) ? (data.tags as string[]) : [];
32
- return (
33
- <article className="max-w-prose">
34
- <h1 className="text-4xl font-bold tracking-tight">{title}</h1>
35
- <div className="mt-4 flex flex-wrap items-center gap-4 text-sm text-muted-foreground">
36
- {date && <time dateTime={date}>{date}</time>}
37
- {tags.length > 0 && (
38
- <div className="flex flex-wrap gap-2">
39
- {tags.map((tag: string) => (
40
- <span
41
- key={tag}
42
- className="rounded-full border border-border bg-muted px-2.5 py-0.5 text-xs text-muted-foreground"
43
- >
44
- {tag}
45
- </span>
46
- ))}
47
- </div>
48
- )}
49
- </div>
50
- <div
51
- className="prose prose-invert mt-8 max-w-none prose-headings:scroll-m-20 prose-headings:font-semibold prose-headings:tracking-tight prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl prose-a:text-primary prose-a:no-underline hover:prose-a:underline prose-code:rounded prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:text-sm prose-pre:rounded-xl prose-pre:border prose-pre:border-border prose-pre:bg-card prose-img:rounded-xl"
52
- dangerouslySetInnerHTML={{ __html: html }}
53
- />
54
- </article>
55
- );
56
- }
@@ -1,70 +0,0 @@
1
- import { join } from "node:path";
2
- import { scanContent } from "@thexjs/core";
3
- import type { LoaderArgs, RouteProps } from "@thexjs/core";
4
-
5
- interface BlogEntry {
6
- routePath: string;
7
- title: string;
8
- description: string;
9
- date: string;
10
- tags: string[];
11
- }
12
-
13
- interface BlogLoaderData {
14
- entries: BlogEntry[];
15
- }
16
-
17
- export async function loader(_args: LoaderArgs) {
18
- const contentDir = join(import.meta.dir, "..", "..", "..", "content");
19
- const entries = scanContent(contentDir);
20
- return {
21
- entries: entries.map((e) => ({
22
- routePath: e.routePath,
23
- title: e.frontmatter.title ?? e.slug,
24
- description: (e.frontmatter.description as string) ?? "",
25
- date: (e.frontmatter.date as string) ?? "",
26
- tags: Array.isArray(e.frontmatter.tags) ? (e.frontmatter.tags as string[]) : [],
27
- })),
28
- };
29
- }
30
-
31
- export default function BlogPage({ loaderData }: RouteProps) {
32
- const { entries } = loaderData as unknown as BlogLoaderData;
33
- return (
34
- <div>
35
- <h1 className="mb-8 text-3xl font-bold tracking-tight">All Posts</h1>
36
- {entries.length === 0 && (
37
- <p className="text-muted-foreground">No posts yet. Check back soon!</p>
38
- )}
39
- <div className="space-y-6">
40
- {entries.map((entry) => (
41
- <a
42
- key={entry.routePath}
43
- href={entry.routePath}
44
- className="group block rounded-xl border border-border bg-card p-6 transition-all duration-300 hover:-translate-y-0.5 hover:border-muted-foreground/30 hover:shadow-lg"
45
- >
46
- {entry.date && <p className="text-xs text-muted-foreground">{entry.date}</p>}
47
- <h2 className="mt-1.5 text-xl font-semibold text-card-foreground transition-colors group-hover:text-primary">
48
- {entry.title}
49
- </h2>
50
- {entry.description && (
51
- <p className="mt-2 line-clamp-2 text-sm text-muted-foreground">{entry.description}</p>
52
- )}
53
- {Array.isArray(entry.tags) && entry.tags.length > 0 && (
54
- <div className="mt-4 flex flex-wrap gap-2">
55
- {entry.tags.map((tag: string) => (
56
- <span
57
- key={tag}
58
- className="rounded-full border border-border bg-muted px-2.5 py-0.5 text-xs text-muted-foreground"
59
- >
60
- {tag}
61
- </span>
62
- ))}
63
- </div>
64
- )}
65
- </a>
66
- ))}
67
- </div>
68
- </div>
69
- );
70
- }
@@ -1,73 +0,0 @@
1
- const featuredPosts = [
2
- {
3
- slug: "hello-world",
4
- title: "Hello World",
5
- description:
6
- "Welcome to our blog — a space for thoughts on web development, design, and technology.",
7
- date: "Jul 27, 2026",
8
- },
9
- {
10
- slug: "getting-started",
11
- title: "Getting Started with x Framework",
12
- description: "Learn how to build your first fullstack application with x framework.",
13
- date: "Jul 26, 2026",
14
- },
15
- {
16
- slug: "tailwind-v4",
17
- title: "Tailwind CSS v4 — What's New",
18
- description: "A comprehensive look at the changes in Tailwind CSS v4.",
19
- date: "Jul 25, 2026",
20
- },
21
- ];
22
-
23
- export default function HomePage() {
24
- return (
25
- <div className="space-y-24">
26
- <section className="mx-auto max-w-4xl px-4 pt-24 text-center">
27
- <h1 className="bg-gradient-to-r from-foreground via-foreground/80 to-muted-foreground bg-clip-text text-5xl font-bold tracking-tight text-transparent sm:text-6xl">
28
- The Blog
29
- </h1>
30
- <p className="mt-6 text-lg text-muted-foreground sm:text-xl">
31
- Thoughts on web development, design, and technology.
32
- </p>
33
- </section>
34
- <section className="mx-auto max-w-4xl px-4">
35
- <h2 className="mb-8 text-2xl font-semibold tracking-tight">Featured Posts</h2>
36
- <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
37
- {featuredPosts.map((post) => (
38
- <a
39
- key={post.slug}
40
- href={`/blog/${post.slug}`}
41
- className="group rounded-xl border border-border bg-card p-6 transition-all duration-300 hover:-translate-y-1 hover:border-muted-foreground/30 hover:shadow-lg"
42
- >
43
- <p className="text-xs text-muted-foreground">{post.date}</p>
44
- <h3 className="mt-2 text-lg font-semibold text-card-foreground transition-colors group-hover:text-primary">
45
- {post.title}
46
- </h3>
47
- <p className="mt-2 line-clamp-2 text-sm text-muted-foreground">{post.description}</p>
48
- </a>
49
- ))}
50
- </div>
51
- </section>
52
- <section className="mx-auto max-w-4xl px-4 pb-24 text-center">
53
- <div className="rounded-2xl border border-border bg-card p-12">
54
- <h2 className="text-2xl font-semibold tracking-tight">Stay Updated</h2>
55
- <p className="mt-2 text-muted-foreground">Get notified when new posts are published.</p>
56
- <div className="mx-auto mt-6 flex max-w-md gap-3">
57
- <input
58
- type="email"
59
- placeholder="Enter your email"
60
- className="flex-1 rounded-lg border border-input bg-background px-4 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
61
- />
62
- <button
63
- type="button"
64
- className="rounded-lg bg-primary px-6 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90"
65
- >
66
- Subscribe
67
- </button>
68
- </div>
69
- </div>
70
- </section>
71
- </div>
72
- );
73
- }
@@ -1,90 +0,0 @@
1
- @import "tailwindcss";
2
- @import "tw-animate-css";
3
-
4
- @custom-variant dark (&:is(.dark *));
5
-
6
- @theme inline {
7
- --color-background: var(--background);
8
- --color-foreground: var(--foreground);
9
- --color-card: var(--card);
10
- --color-card-foreground: var(--card-foreground);
11
- --color-popover: var(--popover);
12
- --color-popover-foreground: var(--popover-foreground);
13
- --color-primary: var(--primary);
14
- --color-primary-foreground: var(--primary-foreground);
15
- --color-secondary: var(--secondary);
16
- --color-secondary-foreground: var(--secondary-foreground);
17
- --color-muted: var(--muted);
18
- --color-muted-foreground: var(--muted-foreground);
19
- --color-accent: var(--accent);
20
- --color-accent-foreground: var(--accent-foreground);
21
- --color-destructive: var(--destructive);
22
- --color-destructive-foreground: var(--destructive-foreground);
23
- --color-border: var(--border);
24
- --color-input: var(--input);
25
- --color-ring: var(--ring);
26
- --color-chart-1: var(--chart-1);
27
- --color-chart-2: var(--chart-2);
28
- --color-chart-3: var(--chart-3);
29
- --color-chart-4: var(--chart-4);
30
- --color-chart-5: var(--chart-5);
31
- --radius-sm: calc(var(--radius) * 0.6);
32
- --radius-md: calc(var(--radius) * 0.8);
33
- --radius-lg: var(--radius);
34
- --radius-xl: calc(var(--radius) * 1.4);
35
- --radius-2xl: calc(var(--radius) * 1.8);
36
- --radius-3xl: calc(var(--radius) * 2.2);
37
- --radius-4xl: calc(var(--radius) * 2.6);
38
- --color-sidebar: var(--sidebar);
39
- --color-sidebar-foreground: var(--sidebar-foreground);
40
- --color-sidebar-primary: var(--sidebar-primary);
41
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
42
- --color-sidebar-accent: var(--sidebar-accent);
43
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
44
- --color-sidebar-border: var(--sidebar-border);
45
- --color-sidebar-ring: var(--sidebar-ring);
46
- }
47
-
48
- :root {
49
- --radius: 0.625rem;
50
- --background: oklch(0.145 0 0);
51
- --foreground: oklch(0.985 0 0);
52
- --card: oklch(0.205 0 0);
53
- --card-foreground: oklch(0.985 0 0);
54
- --popover: oklch(0.205 0 0);
55
- --popover-foreground: oklch(0.985 0 0);
56
- --primary: oklch(0.922 0 0);
57
- --primary-foreground: oklch(0.205 0 0);
58
- --secondary: oklch(0.269 0 0);
59
- --secondary-foreground: oklch(0.985 0 0);
60
- --muted: oklch(0.269 0 0);
61
- --muted-foreground: oklch(0.708 0 0);
62
- --accent: oklch(0.269 0 0);
63
- --accent-foreground: oklch(0.985 0 0);
64
- --destructive: oklch(0.704 0.191 22.216);
65
- --border: oklch(1 0 0 / 10%);
66
- --input: oklch(1 0 0 / 15%);
67
- --ring: oklch(0.556 0 0);
68
- --chart-1: oklch(0.488 0.243 264.376);
69
- --chart-2: oklch(0.696 0.17 162.48);
70
- --chart-3: oklch(0.769 0.188 70.08);
71
- --chart-4: oklch(0.627 0.265 303.9);
72
- --chart-5: oklch(0.645 0.246 16.439);
73
- --sidebar: oklch(0.205 0 0);
74
- --sidebar-foreground: oklch(0.985 0 0);
75
- --sidebar-primary: oklch(0.488 0.243 264.376);
76
- --sidebar-primary-foreground: oklch(0.985 0 0);
77
- --sidebar-accent: oklch(0.269 0 0);
78
- --sidebar-foreground: oklch(0.985 0 0);
79
- --sidebar-border: oklch(1 0 0 / 10%);
80
- --sidebar-ring: oklch(0.556 0 0);
81
- }
82
-
83
- @layer base {
84
- * {
85
- @apply border-border outline-ring/50;
86
- }
87
- body {
88
- @apply bg-background text-foreground;
89
- }
90
- }
@@ -1,20 +0,0 @@
1
- // Auto-generated by @thexjs/core -- do not edit
2
- export type RouteMap = {
3
- "/": Record<string, never>;
4
- "/blog": Record<string, never>;
5
- "/blog/:slug": { slug: string };
6
- "/about": Record<string, never>;
7
- };
8
-
9
- export function href<T extends keyof RouteMap & string>(
10
- path: T,
11
- ...[params]: RouteMap[T] extends Record<string, never> ? [] : [RouteMap[T]]
12
- ): string {
13
- if (!params) return path;
14
- let result: string = path;
15
- for (const [key, value] of Object.entries(params)) {
16
- result = result.replace(new RegExp(`:${key}(?=/|$)`), encodeURIComponent(String(value)));
17
- }
18
- result = result.replace(/\*+$/, "");
19
- return result;
20
- }
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": { "noEmit": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] } },
4
- "include": ["src"]
5
- }
@@ -1,6 +0,0 @@
1
- import { defineConfig } from "@thexjs/core";
2
- export default defineConfig({
3
- pagesDir: "src/pages",
4
- layoutsDir: "src/layouts",
5
- contentDir: "content",
6
- });
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "base-nova",
4
- "rsc": false,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "",
8
- "css": "src/styles/globals.css",
9
- "baseColor": "neutral",
10
- "cssVariables": true,
11
- "prefix": ""
12
- },
13
- "aliases": {
14
- "components": "@/components",
15
- "utils": "@/lib/utils",
16
- "lib": "@/lib"
17
- },
18
- "iconLibrary": "lucide"
19
- }
@@ -1,28 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- export default function MainLayout({ children }: { children: ReactNode }) {
4
- return (
5
- <div className="relative flex min-h-screen flex-col overflow-hidden bg-background">
6
- <div
7
- className="pointer-events-none absolute inset-0 opacity-[0.35]"
8
- style={{
9
- backgroundImage:
10
- "linear-gradient(to right, #1c2433 1px, transparent 1px), linear-gradient(to bottom, #1c2433 1px, transparent 1px)",
11
- backgroundSize: "48px 48px",
12
- maskImage: "radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%)",
13
- }}
14
- />
15
- <header className="relative z-10 flex h-16 items-center px-6 sm:px-10">
16
- <a href="/" className="group flex items-center gap-2.5" aria-label="Home">
17
- <span className="flex h-8 w-8 items-center justify-center rounded-lg border border-border bg-surface">
18
- <svg viewBox="0 0 24 24" className="h-4 w-4 text-primary" fill="none">
19
- <polygon points="3,5 5,3 21,19 19,21" fill="currentColor" />
20
- <polygon points="19,5 21,3 5,21 3,19" fill="currentColor" opacity="0.45" />
21
- </svg>
22
- </span>
23
- </a>
24
- </header>
25
- <main className="relative z-10 flex flex-1 flex-col">{children}</main>
26
- </div>
27
- );
28
- }