@tanstack/create 0.61.6 → 0.62.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.
- package/CHANGELOG.md +13 -0
- package/dist/config-file.js +5 -2
- package/dist/custom-add-ons/starter.js +45 -28
- package/dist/file-helpers.js +1 -0
- package/dist/frameworks/react/add-ons/shadcn/assets/src/styles.css +224 -15
- package/dist/frameworks/react/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/dist/frameworks/react/add-ons/store/assets/src/routes/demo/store.tsx.ejs +1 -1
- package/dist/frameworks/react/add-ons/store/package.json +2 -2
- package/dist/frameworks/react/index.js +2 -2
- package/dist/frameworks/react/project/base/content/blog/fifth-post.mdx.ejs +54 -0
- package/dist/frameworks/react/project/base/content/blog/first-post.md.ejs +47 -0
- package/dist/frameworks/react/project/base/content/blog/fourth-post.md.ejs +42 -0
- package/dist/frameworks/react/project/base/content/blog/second-post.mdx.ejs +46 -0
- package/dist/frameworks/react/project/base/content/blog/third-post.md.ejs +49 -0
- package/dist/frameworks/react/project/base/content-collections.ts.ejs +37 -0
- package/dist/frameworks/react/project/base/package.json +8 -1
- package/dist/frameworks/react/project/base/public/images/lagoon-1.svg +13 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-2.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-3.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-4.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-5.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-about.svg +14 -0
- package/dist/frameworks/react/project/base/src/components/Footer.tsx.ejs +42 -0
- package/dist/frameworks/react/project/base/src/components/Header.tsx.ejs +92 -138
- package/dist/frameworks/react/project/base/src/components/MdxCallout.tsx.ejs +16 -0
- package/dist/frameworks/react/project/base/src/components/MdxMetrics.tsx.ejs +23 -0
- package/dist/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejs +81 -0
- package/dist/frameworks/react/project/base/src/lib/site.ts.ejs +4 -0
- package/dist/frameworks/react/project/base/src/main.tsx.ejs +0 -1
- package/dist/frameworks/react/project/base/src/routes/__root.tsx.ejs +10 -6
- package/dist/frameworks/react/project/base/src/routes/about.tsx.ejs +27 -0
- package/dist/frameworks/react/project/base/src/routes/blog.$slug.tsx.ejs +71 -0
- package/dist/frameworks/react/project/base/src/routes/blog.index.tsx.ejs +93 -0
- package/dist/frameworks/react/project/base/src/routes/index.tsx.ejs +58 -91
- package/dist/frameworks/react/project/base/src/routes/rss[.]xml.ts.ejs +35 -0
- package/dist/frameworks/react/project/base/src/styles.css.ejs +268 -6
- package/dist/frameworks/react/project/base/tsconfig.json.ejs +2 -0
- package/dist/frameworks/react/project/base/vite.config.ts.ejs +2 -0
- package/dist/frameworks/solid/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/dist/frameworks/solid/add-ons/store/assets/src/routes/demo.store.tsx.ejs +2 -2
- package/dist/frameworks/solid/examples/tanchat/assets/src/lib/demo-store.ts +5 -6
- package/dist/frameworks/solid/project/base/src/components/Header.tsx.ejs +8 -6
- package/dist/frameworks/solid/project/base/src/routes/__root.tsx.ejs +1 -1
- package/dist/frameworks/solid/project/base/src/routes/index.tsx.ejs +1 -1
- package/dist/frameworks.js +3 -0
- package/dist/package-json.js +1 -1
- package/dist/registry.js +21 -4
- package/dist/types/registry.d.ts +38 -0
- package/package.json +1 -1
- package/src/config-file.ts +6 -2
- package/src/custom-add-ons/starter.ts +30 -10
- package/src/file-helpers.ts +1 -0
- package/src/frameworks/react/add-ons/shadcn/assets/src/styles.css +224 -15
- package/src/frameworks/react/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/src/frameworks/react/add-ons/store/assets/src/routes/demo/store.tsx.ejs +1 -1
- package/src/frameworks/react/add-ons/store/package.json +2 -2
- package/src/frameworks/react/index.ts +2 -2
- package/src/frameworks/react/project/base/content/blog/fifth-post.mdx.ejs +54 -0
- package/src/frameworks/react/project/base/content/blog/first-post.md.ejs +47 -0
- package/src/frameworks/react/project/base/content/blog/fourth-post.md.ejs +42 -0
- package/src/frameworks/react/project/base/content/blog/second-post.mdx.ejs +46 -0
- package/src/frameworks/react/project/base/content/blog/third-post.md.ejs +49 -0
- package/src/frameworks/react/project/base/content-collections.ts.ejs +37 -0
- package/src/frameworks/react/project/base/package.json +8 -1
- package/src/frameworks/react/project/base/public/images/lagoon-1.svg +13 -0
- package/src/frameworks/react/project/base/public/images/lagoon-2.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-3.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-4.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-5.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-about.svg +14 -0
- package/src/frameworks/react/project/base/src/components/Footer.tsx.ejs +42 -0
- package/src/frameworks/react/project/base/src/components/Header.tsx.ejs +92 -138
- package/src/frameworks/react/project/base/src/components/MdxCallout.tsx.ejs +16 -0
- package/src/frameworks/react/project/base/src/components/MdxMetrics.tsx.ejs +23 -0
- package/src/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejs +81 -0
- package/src/frameworks/react/project/base/src/lib/site.ts.ejs +4 -0
- package/src/frameworks/react/project/base/src/main.tsx.ejs +0 -1
- package/src/frameworks/react/project/base/src/routes/__root.tsx.ejs +10 -6
- package/src/frameworks/react/project/base/src/routes/about.tsx.ejs +27 -0
- package/src/frameworks/react/project/base/src/routes/blog.$slug.tsx.ejs +71 -0
- package/src/frameworks/react/project/base/src/routes/blog.index.tsx.ejs +93 -0
- package/src/frameworks/react/project/base/src/routes/index.tsx.ejs +58 -91
- package/src/frameworks/react/project/base/src/routes/rss[.]xml.ts.ejs +35 -0
- package/src/frameworks/react/project/base/src/styles.css.ejs +268 -6
- package/src/frameworks/react/project/base/tsconfig.json.ejs +2 -0
- package/src/frameworks/react/project/base/vite.config.ts.ejs +2 -0
- package/src/frameworks/solid/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/src/frameworks/solid/add-ons/store/assets/src/routes/demo.store.tsx.ejs +2 -2
- package/src/frameworks/solid/examples/tanchat/assets/src/lib/demo-store.ts +5 -6
- package/src/frameworks/solid/project/base/src/components/Header.tsx.ejs +8 -6
- package/src/frameworks/solid/project/base/src/routes/__root.tsx.ejs +1 -1
- package/src/frameworks/solid/project/base/src/routes/index.tsx.ejs +1 -1
- package/src/frameworks.ts +4 -0
- package/src/package-json.ts +1 -1
- package/src/registry.ts +28 -4
- package/tests/add-ons.test.ts +4 -4
- package/tests/config-file.test.ts +3 -3
- package/tests/custom-add-ons/starter.test.ts +34 -2
- package/tests/frameworks.test.ts +24 -0
- package/tests/options.test.ts +4 -4
- package/tests/utils.test.ts +2 -2
|
@@ -33,9 +33,9 @@ import {
|
|
|
33
33
|
HeadContent, Scripts, <% if (hasContext) { %>createRootRouteWithContext<% } else { %>createRootRoute<% } %> } from '@tanstack/react-router'
|
|
34
34
|
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools';
|
|
35
35
|
import { TanStackDevtools } from '@tanstack/react-devtools'
|
|
36
|
-
|
|
36
|
+
import Footer from '../components/Footer'
|
|
37
37
|
import Header from '../components/Header'
|
|
38
|
-
<%
|
|
38
|
+
<% for(const integration of integrations.filter(i => i.type === 'layout' || i.type === 'provider' || i.type === 'devtools')) { %>
|
|
39
39
|
import <%= integration.jsName %> from '<%= relativePath(integration.path, true) %>'
|
|
40
40
|
<% } %><% if (addOnEnabled.paraglide) { %>
|
|
41
41
|
import { getLocale } from '#/paraglide/runtime'
|
|
@@ -61,6 +61,8 @@ interface MyRouterContext <% if (addOnEnabled["apollo-client"]) {%> extends Apol
|
|
|
61
61
|
<% } %>
|
|
62
62
|
}<% } %>
|
|
63
63
|
|
|
64
|
+
const THEME_INIT_SCRIPT = `(function(){try{var stored=window.localStorage.getItem('theme');var mode=(stored==='light'||stored==='dark'||stored==='auto')?stored:'auto';var prefersDark=window.matchMedia('(prefers-color-scheme: dark)').matches;var resolved=mode==='auto'?(prefersDark?'dark':'light'):mode;var root=document.documentElement;root.classList.remove('light','dark');root.classList.add(resolved);if(mode==='auto'){root.removeAttribute('data-theme')}else{root.setAttribute('data-theme',mode)}root.style.colorScheme=resolved;}catch(e){}})();`
|
|
65
|
+
|
|
64
66
|
export const Route = <% if (hasContext) { %>createRootRouteWithContext<MyRouterContext>()<% } else { %>createRootRoute<% } %>({
|
|
65
67
|
<% if (addOnEnabled.paraglide) { %>
|
|
66
68
|
beforeLoad: async () => {
|
|
@@ -96,14 +98,16 @@ export const Route = <% if (hasContext) { %>createRootRouteWithContext<MyRouterC
|
|
|
96
98
|
|
|
97
99
|
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
98
100
|
return (
|
|
99
|
-
|
|
101
|
+
<% if (addOnEnabled.paraglide) { %><html lang={getLocale()} suppressHydrationWarning><% } else { %><html lang="en" suppressHydrationWarning><% } %>
|
|
100
102
|
<head>
|
|
103
|
+
<script dangerouslySetInnerHTML={{ __html: THEME_INIT_SCRIPT }} />
|
|
101
104
|
<HeadContent />
|
|
102
105
|
</head>
|
|
103
|
-
<body>
|
|
106
|
+
<body className="font-sans antialiased [overflow-wrap:anywhere] selection:bg-[rgba(79,184,178,0.24)]">
|
|
104
107
|
<% for(const integration of integrations.filter(i => i.type === 'provider')) { %><<%= integration.jsName %>>
|
|
105
|
-
<% }
|
|
106
|
-
|
|
108
|
+
<% } %><Header />
|
|
109
|
+
{children}
|
|
110
|
+
<Footer />
|
|
107
111
|
<TanStackDevtools
|
|
108
112
|
config={{
|
|
109
113
|
position: 'bottom-right',
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
|
|
3
|
+
export const Route = createFileRoute('/about')({
|
|
4
|
+
component: About,
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
function About() {
|
|
8
|
+
return (
|
|
9
|
+
<main className="page-wrap px-4 py-12">
|
|
10
|
+
<section className="island-shell rounded-2xl p-6 sm:p-8">
|
|
11
|
+
<img
|
|
12
|
+
src="/images/lagoon-about.svg"
|
|
13
|
+
alt=""
|
|
14
|
+
className="mb-6 h-56 w-full rounded-2xl object-cover"
|
|
15
|
+
/>
|
|
16
|
+
<p className="island-kicker mb-2">About</p>
|
|
17
|
+
<h1 className="display-title mb-3 text-4xl font-bold text-[var(--sea-ink)] sm:text-5xl">
|
|
18
|
+
Built for shipping fast.
|
|
19
|
+
</h1>
|
|
20
|
+
<p className="m-0 max-w-3xl text-base leading-8 text-[var(--sea-ink-soft)]">
|
|
21
|
+
TanStack Start gives you type-safe routing, server functions, and modern SSR
|
|
22
|
+
defaults so you can focus on product work instead of framework glue.
|
|
23
|
+
</p>
|
|
24
|
+
</section>
|
|
25
|
+
</main>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createFileRoute, notFound } from '@tanstack/react-router'
|
|
2
|
+
import { MDXContent } from '@content-collections/mdx/react'
|
|
3
|
+
import { allBlogs } from 'content-collections'
|
|
4
|
+
import { SITE_URL } from '#/lib/site'
|
|
5
|
+
import { MdxCallout } from '#/components/MdxCallout'
|
|
6
|
+
import { MdxMetrics } from '#/components/MdxMetrics'
|
|
7
|
+
|
|
8
|
+
export const Route = createFileRoute('/blog/$slug')({
|
|
9
|
+
loader: ({ params }) => {
|
|
10
|
+
const post = Array.from(
|
|
11
|
+
new Map(
|
|
12
|
+
[...allBlogs]
|
|
13
|
+
.sort((a, b) => new Date(b.pubDate).valueOf() - new Date(a.pubDate).valueOf())
|
|
14
|
+
.map((entry) => [entry.slug, entry]),
|
|
15
|
+
).values(),
|
|
16
|
+
).find((entry) => entry.slug === params.slug)
|
|
17
|
+
if (!post) throw notFound()
|
|
18
|
+
return post
|
|
19
|
+
},
|
|
20
|
+
head: ({ loaderData, params }) => {
|
|
21
|
+
const title = loaderData?.title ?? 'Post'
|
|
22
|
+
const description = loaderData?.description ?? ''
|
|
23
|
+
const image = loaderData?.heroImage ?? '/images/lagoon-1.svg'
|
|
24
|
+
return {
|
|
25
|
+
links: [{ rel: 'canonical', href: `${SITE_URL}/blog/${params.slug}` }],
|
|
26
|
+
meta: [
|
|
27
|
+
{ title },
|
|
28
|
+
{ name: 'description', content: description },
|
|
29
|
+
{
|
|
30
|
+
property: 'og:image',
|
|
31
|
+
content: image.startsWith('http') ? image : `${SITE_URL}${image}`,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
component: BlogPost,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
function BlogPost() {
|
|
40
|
+
const post = Route.useLoaderData()
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<main className="page-wrap px-4 pb-12 pt-16">
|
|
44
|
+
<article className="island-shell rounded-2xl p-6 sm:p-8">
|
|
45
|
+
{post.heroImage ? (
|
|
46
|
+
<img
|
|
47
|
+
src={post.heroImage}
|
|
48
|
+
alt=""
|
|
49
|
+
className="mb-6 h-64 w-full rounded-2xl object-cover"
|
|
50
|
+
/>
|
|
51
|
+
) : null}
|
|
52
|
+
<p className="island-kicker mb-2">Post</p>
|
|
53
|
+
<h1 className="display-title mb-3 text-4xl font-bold text-[var(--sea-ink)] sm:text-5xl">
|
|
54
|
+
{post.title}
|
|
55
|
+
</h1>
|
|
56
|
+
<p className="mb-6 text-sm text-[var(--sea-ink-soft)]">
|
|
57
|
+
{new Date(post.pubDate).toLocaleDateString()}
|
|
58
|
+
</p>
|
|
59
|
+
<div
|
|
60
|
+
className="prose prose-slate prose-headings:text-[var(--sea-ink)] prose-p:text-[var(--sea-ink-soft)] prose-li:text-[var(--sea-ink-soft)] prose-ul:text-[var(--sea-ink-soft)] prose-ol:text-[var(--sea-ink-soft)] prose-strong:text-[var(--sea-ink)] prose-a:text-[var(--lagoon-deep)] max-w-none"
|
|
61
|
+
>
|
|
62
|
+
{post.mdx ? (
|
|
63
|
+
<MDXContent code={post.mdx} components={{ MdxCallout, MdxMetrics }} />
|
|
64
|
+
) : (
|
|
65
|
+
<div dangerouslySetInnerHTML={{ __html: post.html ?? '' }} />
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
</article>
|
|
69
|
+
</main>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Link, createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { allBlogs } from 'content-collections'
|
|
3
|
+
import { SITE_DESCRIPTION, SITE_TITLE, SITE_URL } from '#/lib/site'
|
|
4
|
+
|
|
5
|
+
const canonical = `${SITE_URL}/blog`
|
|
6
|
+
const pageTitle = `Blog | ${SITE_TITLE}`
|
|
7
|
+
|
|
8
|
+
export const Route = createFileRoute('/blog/')({
|
|
9
|
+
head: () => ({
|
|
10
|
+
links: [{ rel: 'canonical', href: canonical }],
|
|
11
|
+
meta: [
|
|
12
|
+
{ title: pageTitle },
|
|
13
|
+
{ name: 'description', content: SITE_DESCRIPTION },
|
|
14
|
+
{ property: 'og:image', content: `${SITE_URL}/images/lagoon-1.svg` },
|
|
15
|
+
],
|
|
16
|
+
}),
|
|
17
|
+
component: BlogIndex,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
function BlogIndex() {
|
|
21
|
+
const postsByDate = Array.from(
|
|
22
|
+
new Map(
|
|
23
|
+
[...allBlogs]
|
|
24
|
+
.sort((a, b) => new Date(b.pubDate).valueOf() - new Date(a.pubDate).valueOf())
|
|
25
|
+
.map((post) => [post.slug, post]),
|
|
26
|
+
).values(),
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const featured = postsByDate[0]
|
|
30
|
+
const posts = postsByDate.slice(1)
|
|
31
|
+
return (
|
|
32
|
+
<main className="page-wrap px-4 pb-8 pt-14">
|
|
33
|
+
<section className="mb-4">
|
|
34
|
+
<p className="island-kicker mb-2">Latest Dispatches</p>
|
|
35
|
+
<h1 className="display-title m-0 text-4xl font-bold tracking-tight text-[var(--sea-ink)] sm:text-5xl">
|
|
36
|
+
Blog
|
|
37
|
+
</h1>
|
|
38
|
+
</section>
|
|
39
|
+
|
|
40
|
+
<section className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
41
|
+
<article className="island-shell rise-in rounded-2xl p-5 sm:p-6 lg:col-span-2">
|
|
42
|
+
{featured.heroImage ? (
|
|
43
|
+
<img
|
|
44
|
+
src={featured.heroImage}
|
|
45
|
+
alt=""
|
|
46
|
+
className="mb-4 h-44 w-full rounded-xl object-cover xl:h-60"
|
|
47
|
+
/>
|
|
48
|
+
) : null}
|
|
49
|
+
<h2 className="m-0 text-2xl font-semibold text-[var(--sea-ink)]">
|
|
50
|
+
<Link
|
|
51
|
+
to="/blog/$slug"
|
|
52
|
+
params={{ slug: featured.slug }}
|
|
53
|
+
className="no-underline"
|
|
54
|
+
>
|
|
55
|
+
{featured.title}
|
|
56
|
+
</Link>
|
|
57
|
+
</h2>
|
|
58
|
+
<p className="mb-2 mt-3 text-base text-[var(--sea-ink-soft)]">
|
|
59
|
+
{featured.description}
|
|
60
|
+
</p>
|
|
61
|
+
<p className="m-0 text-xs text-[var(--sea-ink-soft)]">
|
|
62
|
+
{new Date(featured.pubDate).toLocaleDateString()}
|
|
63
|
+
</p>
|
|
64
|
+
</article>
|
|
65
|
+
|
|
66
|
+
{posts.map((post, index) => (
|
|
67
|
+
<article
|
|
68
|
+
key={post.slug}
|
|
69
|
+
className="island-shell rise-in rounded-2xl p-5 sm:last:col-span-2 lg:last:col-span-1"
|
|
70
|
+
style={{ animationDelay: `${index * 80 + 120}ms` }}
|
|
71
|
+
>
|
|
72
|
+
{post.heroImage ? (
|
|
73
|
+
<img
|
|
74
|
+
src={post.heroImage}
|
|
75
|
+
alt=""
|
|
76
|
+
className="mb-4 h-44 w-full rounded-xl object-cover"
|
|
77
|
+
/>
|
|
78
|
+
) : null}
|
|
79
|
+
<h2 className="m-0 text-2xl font-semibold text-[var(--sea-ink)]">
|
|
80
|
+
<Link to="/blog/$slug" params={{ slug: post.slug }} className="no-underline">
|
|
81
|
+
{post.title}
|
|
82
|
+
</Link>
|
|
83
|
+
</h2>
|
|
84
|
+
<p className="mb-2 mt-2 text-sm text-[var(--sea-ink-soft)]">{post.description}</p>
|
|
85
|
+
<p className="m-0 text-xs text-[var(--sea-ink-soft)]">
|
|
86
|
+
{new Date(post.pubDate).toLocaleDateString()}
|
|
87
|
+
</p>
|
|
88
|
+
</article>
|
|
89
|
+
))}
|
|
90
|
+
</section>
|
|
91
|
+
</main>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
@@ -1,105 +1,72 @@
|
|
|
1
1
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import {
|
|
3
|
-
Zap, Server, Route as RouteIcon, Shield, Waves, Sparkles,
|
|
4
|
-
} from "lucide-react";
|
|
5
2
|
|
|
6
3
|
export const Route = createFileRoute("/")({ component: App });
|
|
7
4
|
|
|
8
5
|
function App() {
|
|
9
|
-
const features = [
|
|
10
|
-
{
|
|
11
|
-
icon: <Zap className="w-12 h-12 text-cyan-400" />,
|
|
12
|
-
title: "Powerful Server Functions",
|
|
13
|
-
description: "Write server-side code that seamlessly integrates with your client components. Type-safe, secure, and simple.",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
icon: <Server className="w-12 h-12 text-cyan-400" />,
|
|
17
|
-
title: "Flexible Server Side Rendering",
|
|
18
|
-
description: "Full-document SSR, streaming, and progressive enhancement out of the box. Control exactly what renders where.",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
icon: <RouteIcon className="w-12 h-12 text-cyan-400" />,
|
|
22
|
-
title: "API Routes",
|
|
23
|
-
description: "Build type-safe API endpoints alongside your application. No separate backend needed.",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
icon: <Shield className="w-12 h-12 text-cyan-400" />,
|
|
27
|
-
title: "Strongly Typed Everything",
|
|
28
|
-
description: "End-to-end type safety from server to client. Catch errors before they reach production.",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
icon: <Waves className="w-12 h-12 text-cyan-400" />,
|
|
32
|
-
title: "Full Streaming Support",
|
|
33
|
-
description: "Stream data from server to client progressively. Perfect for AI applications and real-time updates.",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
icon: <Sparkles className="w-12 h-12 text-cyan-400" />,
|
|
37
|
-
title: "Next Generation Ready",
|
|
38
|
-
description: "Built from the ground up for modern web applications. Deploy anywhere JavaScript runs.",
|
|
39
|
-
},
|
|
40
|
-
];
|
|
41
|
-
|
|
42
6
|
return (
|
|
43
|
-
<
|
|
44
|
-
<section className="relative
|
|
45
|
-
<div className="absolute
|
|
46
|
-
<div className="
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
href="https://tanstack.com/start"
|
|
71
|
-
target="_blank"
|
|
72
|
-
rel="noopener noreferrer"
|
|
73
|
-
className="px-8 py-3 bg-cyan-500 hover:bg-cyan-600 text-white font-semibold rounded-lg transition-colors shadow-lg shadow-cyan-500/50"
|
|
74
|
-
>
|
|
75
|
-
Documentation
|
|
76
|
-
</a>
|
|
77
|
-
<p className="text-gray-400 text-sm mt-2">
|
|
78
|
-
Begin your TanStack Start journey by editing{" "}
|
|
79
|
-
<code className="px-2 py-1 bg-slate-700 rounded text-cyan-400">
|
|
80
|
-
/src/routes/index.tsx
|
|
81
|
-
</code>
|
|
82
|
-
</p>
|
|
83
|
-
</div>
|
|
7
|
+
<main className="page-wrap px-4 pb-8 pt-14">
|
|
8
|
+
<section className="island-shell rise-in relative overflow-hidden rounded-[2rem] px-6 py-10 sm:px-10 sm:py-14">
|
|
9
|
+
<div className="pointer-events-none absolute -left-20 -top-24 h-56 w-56 rounded-full bg-[radial-gradient(circle,rgba(79,184,178,0.32),transparent_66%)]" />
|
|
10
|
+
<div className="pointer-events-none absolute -bottom-20 -right-20 h-56 w-56 rounded-full bg-[radial-gradient(circle,rgba(47,106,74,0.18),transparent_66%)]" />
|
|
11
|
+
<p className="island-kicker mb-3">TanStack Start Base Template</p>
|
|
12
|
+
<h1 className="display-title mb-5 max-w-3xl text-4xl leading-[1.02] font-bold tracking-tight text-[var(--sea-ink)] sm:text-6xl">
|
|
13
|
+
Island hours, but for product teams.
|
|
14
|
+
</h1>
|
|
15
|
+
<p className="mb-8 max-w-2xl text-base text-[var(--sea-ink-soft)] sm:text-lg">
|
|
16
|
+
A tropical, breathable app starter with full-document SSR, server functions,
|
|
17
|
+
streaming, and type-safe routing. Calm on the eyes. Fast in production.
|
|
18
|
+
</p>
|
|
19
|
+
<div className="flex flex-wrap gap-3">
|
|
20
|
+
<a
|
|
21
|
+
href="/blog"
|
|
22
|
+
className="rounded-full border border-[rgba(50,143,151,0.3)] bg-[rgba(79,184,178,0.14)] px-5 py-2.5 text-sm font-semibold text-[var(--lagoon-deep)] no-underline transition hover:-translate-y-0.5 hover:bg-[rgba(79,184,178,0.24)]"
|
|
23
|
+
>
|
|
24
|
+
Explore Posts
|
|
25
|
+
</a>
|
|
26
|
+
<a
|
|
27
|
+
href="https://tanstack.com/router"
|
|
28
|
+
target="_blank"
|
|
29
|
+
rel="noopener noreferrer"
|
|
30
|
+
className="rounded-full border border-[rgba(23,58,64,0.2)] bg-white/50 px-5 py-2.5 text-sm font-semibold text-[var(--sea-ink)] no-underline transition hover:-translate-y-0.5 hover:border-[rgba(23,58,64,0.35)]"
|
|
31
|
+
>
|
|
32
|
+
Router Guide
|
|
33
|
+
</a>
|
|
84
34
|
</div>
|
|
85
35
|
</section>
|
|
86
36
|
|
|
87
|
-
<section className="
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
37
|
+
<section className="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
38
|
+
{[
|
|
39
|
+
['Type-Safe Routing', 'Routes and links stay in sync across every page.'],
|
|
40
|
+
['Server Functions', 'Call server code from your UI without creating API boilerplate.'],
|
|
41
|
+
['Streaming by Default', 'Ship progressively rendered responses for faster experiences.'],
|
|
42
|
+
['Tailwind Native', 'Design quickly with utility-first styling and custom tokens.'],
|
|
43
|
+
].map(([title, desc], index) => (
|
|
44
|
+
<article
|
|
45
|
+
key={title}
|
|
46
|
+
className="island-shell feature-card rise-in rounded-2xl p-5"
|
|
47
|
+
style={{ animationDelay: `${index * 90 + 80}ms` }}
|
|
93
48
|
>
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
</h3>
|
|
98
|
-
<p className="text-gray-400 leading-relaxed">{feature.description}</p>
|
|
99
|
-
</div>
|
|
49
|
+
<h2 className="mb-2 text-base font-semibold text-[var(--sea-ink)]">{title}</h2>
|
|
50
|
+
<p className="m-0 text-sm text-[var(--sea-ink-soft)]">{desc}</p>
|
|
51
|
+
</article>
|
|
100
52
|
))}
|
|
101
|
-
</div>
|
|
102
53
|
</section>
|
|
103
|
-
|
|
54
|
+
|
|
55
|
+
<section className="island-shell mt-8 rounded-2xl p-6">
|
|
56
|
+
<p className="island-kicker mb-2">Quick Start</p>
|
|
57
|
+
<ul className="m-0 list-disc space-y-2 pl-5 text-sm text-[var(--sea-ink-soft)]">
|
|
58
|
+
<li>
|
|
59
|
+
Edit <code>src/routes/index.tsx</code> to customize the hero and product narrative.
|
|
60
|
+
</li>
|
|
61
|
+
<li>
|
|
62
|
+
Update <code>src/components/Header.tsx</code> and <code>src/components/Footer.tsx</code>{' '}
|
|
63
|
+
for brand links.
|
|
64
|
+
</li>
|
|
65
|
+
<li>
|
|
66
|
+
Add routes in <code>src/routes</code> and tweak visual tokens in <code>src/styles.css</code>.
|
|
67
|
+
</li>
|
|
68
|
+
</ul>
|
|
69
|
+
</section>
|
|
70
|
+
</main>
|
|
104
71
|
);
|
|
105
72
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<% if (routerOnly) { ignoreFile() } %>
|
|
2
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
3
|
+
import { allBlogs } from 'content-collections'
|
|
4
|
+
import { SITE_DESCRIPTION, SITE_TITLE, SITE_URL } from '#/lib/site'
|
|
5
|
+
|
|
6
|
+
export const Route = createFileRoute('/rss.xml')({
|
|
7
|
+
server: {
|
|
8
|
+
handlers: {
|
|
9
|
+
GET: () => {
|
|
10
|
+
const posts = Array.from(
|
|
11
|
+
new Map(
|
|
12
|
+
[...allBlogs]
|
|
13
|
+
.sort((a, b) => new Date(b.pubDate).valueOf() - new Date(a.pubDate).valueOf())
|
|
14
|
+
.map((post) => [post.slug, post]),
|
|
15
|
+
).values(),
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
const items = posts
|
|
19
|
+
.map((post) => {
|
|
20
|
+
const url = `${SITE_URL}/blog/${post.slug}`
|
|
21
|
+
return `<item><title><![CDATA[${post.title}]]></title><description><![CDATA[${post.description}]]></description><link>${url}</link><guid>${url}</guid><pubDate>${new Date(post.pubDate).toUTCString()}</pubDate></item>`
|
|
22
|
+
})
|
|
23
|
+
.join('')
|
|
24
|
+
|
|
25
|
+
const xml = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[${SITE_TITLE}]]></title><description><![CDATA[${SITE_DESCRIPTION}]]></description><link>${SITE_URL}</link>${items}</channel></rss>`
|
|
26
|
+
|
|
27
|
+
return new Response(xml, {
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'application/rss+xml; charset=utf-8',
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
})
|