@tanstack/create 0.61.6 → 0.62.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/config-file.js +5 -2
  3. package/dist/custom-add-ons/starter.js +45 -28
  4. package/dist/file-helpers.js +1 -0
  5. package/dist/frameworks/react/add-ons/shadcn/assets/src/styles.css +224 -15
  6. package/dist/frameworks/react/add-ons/store/assets/src/lib/demo-store.ts +5 -6
  7. package/dist/frameworks/react/add-ons/store/assets/src/routes/demo/store.tsx.ejs +1 -1
  8. package/dist/frameworks/react/add-ons/store/package.json +2 -2
  9. package/dist/frameworks/react/index.js +2 -2
  10. package/dist/frameworks/react/project/base/content/blog/fifth-post.mdx.ejs +54 -0
  11. package/dist/frameworks/react/project/base/content/blog/first-post.md.ejs +47 -0
  12. package/dist/frameworks/react/project/base/content/blog/fourth-post.md.ejs +42 -0
  13. package/dist/frameworks/react/project/base/content/blog/second-post.mdx.ejs +46 -0
  14. package/dist/frameworks/react/project/base/content/blog/third-post.md.ejs +49 -0
  15. package/dist/frameworks/react/project/base/content-collections.ts.ejs +37 -0
  16. package/dist/frameworks/react/project/base/package.json +8 -1
  17. package/dist/frameworks/react/project/base/public/images/lagoon-1.svg +13 -0
  18. package/dist/frameworks/react/project/base/public/images/lagoon-2.svg +12 -0
  19. package/dist/frameworks/react/project/base/public/images/lagoon-3.svg +12 -0
  20. package/dist/frameworks/react/project/base/public/images/lagoon-4.svg +12 -0
  21. package/dist/frameworks/react/project/base/public/images/lagoon-5.svg +12 -0
  22. package/dist/frameworks/react/project/base/public/images/lagoon-about.svg +14 -0
  23. package/dist/frameworks/react/project/base/src/components/Footer.tsx.ejs +42 -0
  24. package/dist/frameworks/react/project/base/src/components/Header.tsx.ejs +92 -138
  25. package/dist/frameworks/react/project/base/src/components/MdxCallout.tsx.ejs +16 -0
  26. package/dist/frameworks/react/project/base/src/components/MdxMetrics.tsx.ejs +23 -0
  27. package/dist/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejs +81 -0
  28. package/dist/frameworks/react/project/base/src/lib/site.ts.ejs +4 -0
  29. package/dist/frameworks/react/project/base/src/main.tsx.ejs +0 -1
  30. package/dist/frameworks/react/project/base/src/routes/__root.tsx.ejs +10 -6
  31. package/dist/frameworks/react/project/base/src/routes/about.tsx.ejs +27 -0
  32. package/dist/frameworks/react/project/base/src/routes/blog.$slug.tsx.ejs +71 -0
  33. package/dist/frameworks/react/project/base/src/routes/blog.index.tsx.ejs +93 -0
  34. package/dist/frameworks/react/project/base/src/routes/index.tsx.ejs +58 -91
  35. package/dist/frameworks/react/project/base/src/routes/rss[.]xml.ts.ejs +35 -0
  36. package/dist/frameworks/react/project/base/src/styles.css.ejs +268 -6
  37. package/dist/frameworks/react/project/base/tsconfig.json.ejs +2 -0
  38. package/dist/frameworks/react/project/base/vite.config.ts.ejs +2 -0
  39. package/dist/frameworks/solid/add-ons/store/assets/src/lib/demo-store.ts +5 -6
  40. package/dist/frameworks/solid/add-ons/store/assets/src/routes/demo.store.tsx.ejs +2 -2
  41. package/dist/frameworks/solid/examples/tanchat/assets/src/lib/demo-store.ts +5 -6
  42. package/dist/frameworks/solid/project/base/src/components/Header.tsx.ejs +8 -6
  43. package/dist/frameworks/solid/project/base/src/routes/__root.tsx.ejs +1 -1
  44. package/dist/frameworks/solid/project/base/src/routes/index.tsx.ejs +1 -1
  45. package/dist/frameworks.js +3 -0
  46. package/dist/package-json.js +1 -1
  47. package/dist/registry.js +21 -4
  48. package/dist/types/registry.d.ts +38 -0
  49. package/package.json +1 -1
  50. package/src/config-file.ts +6 -2
  51. package/src/custom-add-ons/starter.ts +30 -10
  52. package/src/file-helpers.ts +1 -0
  53. package/src/frameworks/react/add-ons/shadcn/assets/src/styles.css +224 -15
  54. package/src/frameworks/react/add-ons/store/assets/src/lib/demo-store.ts +5 -6
  55. package/src/frameworks/react/add-ons/store/assets/src/routes/demo/store.tsx.ejs +1 -1
  56. package/src/frameworks/react/add-ons/store/package.json +2 -2
  57. package/src/frameworks/react/index.ts +2 -2
  58. package/src/frameworks/react/project/base/content/blog/fifth-post.mdx.ejs +54 -0
  59. package/src/frameworks/react/project/base/content/blog/first-post.md.ejs +47 -0
  60. package/src/frameworks/react/project/base/content/blog/fourth-post.md.ejs +42 -0
  61. package/src/frameworks/react/project/base/content/blog/second-post.mdx.ejs +46 -0
  62. package/src/frameworks/react/project/base/content/blog/third-post.md.ejs +49 -0
  63. package/src/frameworks/react/project/base/content-collections.ts.ejs +37 -0
  64. package/src/frameworks/react/project/base/package.json +8 -1
  65. package/src/frameworks/react/project/base/public/images/lagoon-1.svg +13 -0
  66. package/src/frameworks/react/project/base/public/images/lagoon-2.svg +12 -0
  67. package/src/frameworks/react/project/base/public/images/lagoon-3.svg +12 -0
  68. package/src/frameworks/react/project/base/public/images/lagoon-4.svg +12 -0
  69. package/src/frameworks/react/project/base/public/images/lagoon-5.svg +12 -0
  70. package/src/frameworks/react/project/base/public/images/lagoon-about.svg +14 -0
  71. package/src/frameworks/react/project/base/src/components/Footer.tsx.ejs +42 -0
  72. package/src/frameworks/react/project/base/src/components/Header.tsx.ejs +92 -138
  73. package/src/frameworks/react/project/base/src/components/MdxCallout.tsx.ejs +16 -0
  74. package/src/frameworks/react/project/base/src/components/MdxMetrics.tsx.ejs +23 -0
  75. package/src/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejs +81 -0
  76. package/src/frameworks/react/project/base/src/lib/site.ts.ejs +4 -0
  77. package/src/frameworks/react/project/base/src/main.tsx.ejs +0 -1
  78. package/src/frameworks/react/project/base/src/routes/__root.tsx.ejs +10 -6
  79. package/src/frameworks/react/project/base/src/routes/about.tsx.ejs +27 -0
  80. package/src/frameworks/react/project/base/src/routes/blog.$slug.tsx.ejs +71 -0
  81. package/src/frameworks/react/project/base/src/routes/blog.index.tsx.ejs +93 -0
  82. package/src/frameworks/react/project/base/src/routes/index.tsx.ejs +58 -91
  83. package/src/frameworks/react/project/base/src/routes/rss[.]xml.ts.ejs +35 -0
  84. package/src/frameworks/react/project/base/src/styles.css.ejs +268 -6
  85. package/src/frameworks/react/project/base/tsconfig.json.ejs +2 -0
  86. package/src/frameworks/react/project/base/vite.config.ts.ejs +2 -0
  87. package/src/frameworks/solid/add-ons/store/assets/src/lib/demo-store.ts +5 -6
  88. package/src/frameworks/solid/add-ons/store/assets/src/routes/demo.store.tsx.ejs +2 -2
  89. package/src/frameworks/solid/examples/tanchat/assets/src/lib/demo-store.ts +5 -6
  90. package/src/frameworks/solid/project/base/src/components/Header.tsx.ejs +8 -6
  91. package/src/frameworks/solid/project/base/src/routes/__root.tsx.ejs +1 -1
  92. package/src/frameworks/solid/project/base/src/routes/index.tsx.ejs +1 -1
  93. package/src/frameworks.ts +4 -0
  94. package/src/package-json.ts +1 -1
  95. package/src/registry.ts +28 -4
  96. package/tests/add-ons.test.ts +4 -4
  97. package/tests/config-file.test.ts +3 -3
  98. package/tests/custom-add-ons/starter.test.ts +34 -2
  99. package/tests/frameworks.test.ts +24 -0
  100. package/tests/options.test.ts +4 -4
  101. package/tests/utils.test.ts +2 -2
@@ -1,24 +1,32 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');
1
2
  @import 'tailwindcss';
3
+ @plugin '@tailwindcss/typography';
2
4
 
3
5
  @import 'tw-animate-css';
4
6
 
5
7
  @custom-variant dark (&:is(.dark *));
6
8
 
7
- body {
8
- @apply m-0;
9
- font-family:
10
- -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
11
- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
12
- -webkit-font-smoothing: antialiased;
13
- -moz-osx-font-smoothing: grayscale;
14
- }
15
-
16
- code {
17
- font-family:
18
- source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
19
- }
20
-
21
9
  :root {
10
+ --sea-ink: #173a40;
11
+ --sea-ink-soft: #416166;
12
+ --lagoon: #4fb8b2;
13
+ --lagoon-deep: #328f97;
14
+ --palm: #2f6a4a;
15
+ --sand: #e7f0e8;
16
+ --foam: #f3faf5;
17
+ --surface: rgba(255, 255, 255, 0.74);
18
+ --surface-strong: rgba(255, 255, 255, 0.9);
19
+ --line: rgba(23, 58, 64, 0.14);
20
+ --inset-glint: rgba(255, 255, 255, 0.82);
21
+ --kicker: rgba(47, 106, 74, 0.9);
22
+ --bg-base: #e7f3ec;
23
+ --header-bg: rgba(251, 255, 248, 0.84);
24
+ --chip-bg: rgba(255, 255, 255, 0.8);
25
+ --chip-line: rgba(47, 106, 74, 0.18);
26
+ --link-bg-hover: rgba(255, 255, 255, 0.9);
27
+ --hero-a: rgba(79, 184, 178, 0.36);
28
+ --hero-b: rgba(47, 106, 74, 0.2);
29
+
22
30
  --background: oklch(1 0 0);
23
31
  --foreground: oklch(0.141 0.005 285.823);
24
32
  --card: oklch(1 0 0);
@@ -55,6 +63,26 @@ code {
55
63
  }
56
64
 
57
65
  .dark {
66
+ --sea-ink: #d7ece8;
67
+ --sea-ink-soft: #afcdc8;
68
+ --lagoon: #60d7cf;
69
+ --lagoon-deep: #8de5db;
70
+ --palm: #6ec89a;
71
+ --sand: #0f1a1e;
72
+ --foam: #101d22;
73
+ --surface: rgba(16, 30, 34, 0.8);
74
+ --surface-strong: rgba(15, 27, 31, 0.92);
75
+ --line: rgba(141, 229, 219, 0.18);
76
+ --inset-glint: rgba(194, 247, 238, 0.14);
77
+ --kicker: #b8efe5;
78
+ --bg-base: #0a1418;
79
+ --header-bg: rgba(10, 20, 24, 0.8);
80
+ --chip-bg: rgba(13, 28, 32, 0.9);
81
+ --chip-line: rgba(141, 229, 219, 0.24);
82
+ --link-bg-hover: rgba(24, 44, 49, 0.8);
83
+ --hero-a: rgba(96, 215, 207, 0.18);
84
+ --hero-b: rgba(110, 200, 154, 0.12);
85
+
58
86
  --background: oklch(0.141 0.005 285.823);
59
87
  --foreground: oklch(0.985 0 0);
60
88
  --card: oklch(0.141 0.005 285.823);
@@ -90,6 +118,7 @@ code {
90
118
  }
91
119
 
92
120
  @theme inline {
121
+ --font-sans: 'Manrope', ui-sans-serif, system-ui, sans-serif;
93
122
  --color-background: var(--background);
94
123
  --color-foreground: var(--foreground);
95
124
  --color-card: var(--card);
@@ -128,11 +157,191 @@ code {
128
157
  --color-sidebar-ring: var(--sidebar-ring);
129
158
  }
130
159
 
160
+ html,
161
+ body,
162
+ #app {
163
+ min-height: 100%;
164
+ }
165
+
166
+ body {
167
+ margin: 0;
168
+ color: var(--sea-ink);
169
+ font-family: var(--font-sans);
170
+ background-color: var(--bg-base);
171
+ background:
172
+ radial-gradient(1100px 620px at -8% -10%, var(--hero-a), transparent 58%),
173
+ radial-gradient(1050px 620px at 112% -12%, var(--hero-b), transparent 62%),
174
+ radial-gradient(720px 380px at 50% 115%, rgba(79, 184, 178, 0.1), transparent 68%),
175
+ linear-gradient(180deg, color-mix(in oklab, var(--sand) 68%, white) 0%, var(--foam) 44%, var(--bg-base) 100%);
176
+ overflow-x: hidden;
177
+ -webkit-font-smoothing: antialiased;
178
+ -moz-osx-font-smoothing: grayscale;
179
+ }
180
+
181
+ body::before {
182
+ content: '';
183
+ position: fixed;
184
+ inset: 0;
185
+ pointer-events: none;
186
+ z-index: -1;
187
+ opacity: 0.28;
188
+ background:
189
+ radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.8), transparent 34%),
190
+ radial-gradient(circle at 78% 26%, rgba(79, 184, 178, 0.2), transparent 42%),
191
+ radial-gradient(circle at 42% 82%, rgba(47, 106, 74, 0.14), transparent 36%);
192
+ }
193
+
194
+ body::after {
195
+ content: '';
196
+ position: fixed;
197
+ inset: 0;
198
+ pointer-events: none;
199
+ z-index: -1;
200
+ opacity: 0.14;
201
+ background-image:
202
+ linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
203
+ linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
204
+ background-size: 28px 28px;
205
+ mask-image: radial-gradient(circle at 50% 30%, black, transparent 78%);
206
+ }
207
+
208
+ a {
209
+ color: var(--lagoon-deep);
210
+ text-decoration-color: rgba(50, 143, 151, 0.4);
211
+ text-decoration-thickness: 1px;
212
+ text-underline-offset: 2px;
213
+ }
214
+
215
+ a:hover {
216
+ color: #246f76;
217
+ }
218
+
219
+ code {
220
+ font-size: 0.9em;
221
+ border: 1px solid var(--line);
222
+ background: color-mix(in oklab, var(--surface-strong) 82%, white 18%);
223
+ border-radius: 7px;
224
+ padding: 2px 7px;
225
+ }
226
+
227
+ pre code {
228
+ border: 0;
229
+ background: transparent;
230
+ padding: 0;
231
+ border-radius: 0;
232
+ font-size: inherit;
233
+ color: inherit;
234
+ }
235
+
236
+ .prose pre {
237
+ border: 1px solid var(--line);
238
+ border-radius: 12px;
239
+ background: #1d2e45;
240
+ color: #e8efff;
241
+ }
242
+
243
+ .page-wrap {
244
+ width: min(1080px, calc(100% - 2rem));
245
+ margin-inline: auto;
246
+ }
247
+
248
+ .display-title {
249
+ font-family: 'Fraunces', Georgia, serif;
250
+ }
251
+
252
+ .island-shell {
253
+ border: 1px solid var(--line);
254
+ background: linear-gradient(165deg, var(--surface-strong), var(--surface));
255
+ box-shadow:
256
+ 0 1px 0 var(--inset-glint) inset,
257
+ 0 22px 44px rgba(30, 90, 72, 0.1),
258
+ 0 6px 18px rgba(23, 58, 64, 0.08);
259
+ backdrop-filter: blur(4px);
260
+ }
261
+
262
+ .feature-card {
263
+ background: linear-gradient(165deg, color-mix(in oklab, var(--surface-strong) 93%, white 7%), var(--surface));
264
+ box-shadow:
265
+ 0 1px 0 var(--inset-glint) inset,
266
+ 0 18px 34px rgba(30, 90, 72, 0.1),
267
+ 0 4px 14px rgba(23, 58, 64, 0.06);
268
+ }
269
+
270
+ .feature-card:hover {
271
+ transform: translateY(-2px);
272
+ border-color: color-mix(in oklab, var(--lagoon-deep) 35%, var(--line));
273
+ }
274
+
275
+ button,
276
+ .island-shell,
277
+ a {
278
+ transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease,
279
+ transform 180ms ease;
280
+ }
281
+
282
+ .island-kicker {
283
+ letter-spacing: 0.16em;
284
+ text-transform: uppercase;
285
+ font-weight: 700;
286
+ font-size: 0.69rem;
287
+ color: var(--kicker);
288
+ }
289
+
290
+ .nav-link {
291
+ position: relative;
292
+ text-decoration: none;
293
+ color: var(--sea-ink-soft);
294
+ }
295
+
296
+ .nav-link::after {
297
+ content: '';
298
+ position: absolute;
299
+ left: 0;
300
+ bottom: -8px;
301
+ width: 100%;
302
+ height: 2px;
303
+ transform: scaleX(0);
304
+ transform-origin: left;
305
+ background: linear-gradient(90deg, var(--lagoon), #7ed3bf);
306
+ transition: transform 170ms ease;
307
+ }
308
+
309
+ .nav-link:hover,
310
+ .nav-link.is-active {
311
+ color: var(--sea-ink);
312
+ }
313
+
314
+ .nav-link:hover::after,
315
+ .nav-link.is-active::after {
316
+ transform: scaleX(1);
317
+ }
318
+
319
+ .rise-in {
320
+ animation: rise-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
321
+ }
322
+
323
+ @keyframes rise-in {
324
+ from {
325
+ opacity: 0;
326
+ transform: translateY(12px);
327
+ }
328
+ to {
329
+ opacity: 1;
330
+ transform: translateY(0);
331
+ }
332
+ }
333
+
334
+ .site-footer {
335
+ border-top: 1px solid var(--line);
336
+ background: color-mix(in oklab, var(--header-bg) 84%, transparent 16%);
337
+ }
338
+
131
339
  @layer base {
132
340
  * {
133
341
  @apply border-border outline-ring/50;
134
342
  }
135
343
  body {
136
- @apply bg-background text-foreground;
344
+ background-color: var(--background);
345
+ color: var(--foreground);
137
346
  }
138
347
  }
@@ -1,13 +1,12 @@
1
- import { Derived, Store } from '@tanstack/store'
1
+ import { Store } from '@tanstack/store'
2
2
 
3
3
  export const store = new Store({
4
4
  firstName: 'Jane',
5
5
  lastName: 'Smith',
6
6
  })
7
7
 
8
- export const fullName = new Derived({
9
- fn: () => `${store.state.firstName} ${store.state.lastName}`,
10
- deps: [store],
11
- })
8
+ export const fullName = new Store(`${store.state.firstName} ${store.state.lastName}`)
12
9
 
13
- fullName.mount()
10
+ store.subscribe(() => {
11
+ fullName.setState(() => `${store.state.firstName} ${store.state.lastName}`)
12
+ })
@@ -39,7 +39,7 @@ function LastName() {
39
39
  }
40
40
 
41
41
  function FullName() {
42
- const fName = useStore(fullName)
42
+ const fName = useStore(fullName, (state) => state)
43
43
  return (
44
44
  <div className="bg-white/10 rounded-lg px-4 py-2 outline-none ">
45
45
  {fName}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@tanstack/store": "^0.8.0",
4
- "@tanstack/react-store": "^0.8.0"
3
+ "@tanstack/store": "^0.9.1",
4
+ "@tanstack/react-store": "^0.9.1"
5
5
  },
6
6
  "devDependencies": {
7
7
  "@tanstack/devtools-event-client": "^0.4.0"
@@ -25,9 +25,9 @@ export function createFrameworkDefinition(): FrameworkDefinition {
25
25
  )
26
26
 
27
27
  return {
28
- id: 'react-cra',
28
+ id: 'react',
29
29
  name: 'React',
30
- description: 'Templates for React CRA',
30
+ description: 'Templates for React',
31
31
  version: '0.1.0',
32
32
  base: files,
33
33
  addOns,
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: 'Velvet Runtime Notes'
3
+ description: 'Use color tokens to keep light and dark themes aligned.'
4
+ pubDate: 'Aug 05 2024'
5
+ heroImage: '/images/lagoon-5.svg'
6
+ ---
7
+
8
+ Semantic tokens keep your UI stable while the brand evolves.
9
+
10
+ Instead of hard-coding one-off colors in components, shape a small set of
11
+ variables and map all surfaces to those variables.
12
+
13
+ ## Why this matters
14
+
15
+ - You can restyle the app in minutes instead of days
16
+ - Light and dark themes stay behaviorally consistent
17
+ - Add-on pages inherit your visual identity by default
18
+
19
+ <MdxCallout title="MDX Component Demo">
20
+ This callout is rendered from JSX inside an MDX post. It is useful for
21
+ release notes, warnings, and migration tips where you want stronger visual
22
+ emphasis than plain markdown blocks.
23
+ </MdxCallout>
24
+
25
+ <MdxMetrics
26
+ items={[
27
+ { label: 'Token count', value: '12 core vars' },
28
+ { label: 'Theme modes', value: 'light + dark + auto' },
29
+ { label: 'Restyle time', value: '< 30 min' },
30
+ ]}
31
+ />
32
+
33
+ ### Token-to-component mapping
34
+
35
+ | Token | Typical usage |
36
+ | --- | --- |
37
+ | `--surface` | Card backgrounds |
38
+ | `--line` | Borders and separators |
39
+ | `--lagoon-deep` | Links and active nav |
40
+
41
+ Keep the mapping documented and your team will make fewer ad-hoc styling calls.
42
+
43
+ ### Example: deriving UI from semantic tokens
44
+
45
+ ```tsx
46
+ const button = {
47
+ color: 'var(--sea-ink)',
48
+ background: 'var(--surface)',
49
+ borderColor: 'var(--line)',
50
+ }
51
+ ```
52
+
53
+ MDX is useful here because you can interleave narrative, tables, code blocks,
54
+ and custom JSX components in one authoring surface.
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: 'Neon Mango Protocol'
3
+ description: 'A quick walkthrough of the starter foundations.'
4
+ pubDate: 'Jul 08 2024'
5
+ heroImage: '/images/lagoon-3.svg'
6
+ ---
7
+
8
+ This starter ships with routes, SSR, and a calm visual system out of the box.
9
+
10
+ Start by editing route files, then layer in add-ons as needed.
11
+
12
+ ## What you get on day one
13
+
14
+ - Full-document SSR using TanStack Start
15
+ - Type-safe file routing with generated route types
16
+ - A reusable design token system for light and dark themes
17
+
18
+ The goal is simple: let teams ship product pages and APIs without spending the
19
+ first week wiring framework internals.
20
+
21
+ ### Suggested order of operations
22
+
23
+ 1. Make the home route feel like your product
24
+ 2. Add one feature route and one API route
25
+ 3. Introduce add-ons only after your core UX is clear
26
+
27
+ > Keep the first commit boring. Reliable defaults beat clever setup code.
28
+
29
+ ## Baseline delivery checklist
30
+
31
+ Before introducing custom infra, confirm these are green:
32
+
33
+ - `pnpm dev` starts cleanly
34
+ - one server route returns typed data
35
+ - one API route validates input/output
36
+ - one integration test exercises a full page render
37
+
38
+ When these are in place, you can iterate quickly without losing confidence.
39
+
40
+ ### Example request flow
41
+
42
+ 1. Client navigation enters route loader
43
+ 2. Loader calls server function
44
+ 3. Server function reads data source and returns typed payload
45
+ 4. Route component renders immediately with stable shape
46
+
47
+ That flow is simple, predictable, and easy to debug.
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: 'Static Tide Almanac'
3
+ description: 'Dial in layout polish and image rhythm across cards.'
4
+ pubDate: 'Jul 29 2024'
5
+ heroImage: '/images/lagoon-1.svg'
6
+ ---
7
+
8
+ As your app grows, visual rhythm matters as much as feature scope.
9
+
10
+ Use larger feature cards to call attention to primary content, then support with
11
+ smaller cards for secondary updates.
12
+
13
+ ## Practical layout pattern
14
+
15
+ Use one featured card followed by standard cards in a responsive grid:
16
+
17
+ - `lg:col-span-2` for the featured story
18
+ - regular span for supporting posts
19
+ - consistent card media height below `lg`
20
+
21
+ That gives you hierarchy without reinventing every breakpoint.
22
+
23
+ ### A quick spacing rule
24
+
25
+ Pair spacing in steps of 4 (`p-4`, `p-8`, `gap-4`, `gap-8`) and only break that
26
+ rule for hero sections.
27
+
28
+ ## Card hierarchy recipe
29
+
30
+ For content-heavy indexes, this sequence works well:
31
+
32
+ 1. One featured card with expanded width
33
+ 2. Three to six standard cards for breadth
34
+ 3. Optional utility card for onboarding links
35
+
36
+ Keep title sizes mostly consistent and let width + image treatment carry
37
+ hierarchy. That avoids jarring jumps as breakpoints shift.
38
+
39
+ ### Avoiding layout drift
40
+
41
+ If cards start to look uneven, check image heights first, then paragraph length.
42
+ Consistency there usually fixes 80% of visual noise.
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: 'Paper Lantern Cache'
3
+ description: 'How to shape navigation and page structure.'
4
+ pubDate: 'Jul 15 2024'
5
+ heroImage: '/images/lagoon-4.svg'
6
+ ---
7
+
8
+ Use file-based routes in `src/routes` to grow the app.
9
+
10
+ Keep shared UI in `src/components` and tune visual tokens in `src/styles.css`.
11
+
12
+ ## Route design tips
13
+
14
+ Treat routes like product domains, not technical buckets.
15
+
16
+ - `routes/settings.*` for account surfaces
17
+ - `routes/billing.*` for payment and plan logic
18
+ - `routes/api.*` for server handlers that belong to the same domain
19
+
20
+ When route trees map to business intent, onboarding gets faster and refactors
21
+ hurt less.
22
+
23
+ ```tsx
24
+ // src/routes/billing.index.tsx
25
+ export const Route = createFileRoute('/billing/')({
26
+ component: BillingPage,
27
+ })
28
+ ```
29
+
30
+ <MdxMetrics
31
+ items={[
32
+ { label: 'Route setup', value: '~10 min' },
33
+ { label: 'Type safety', value: 'end-to-end' },
34
+ { label: 'Refactor risk', value: 'lowered' },
35
+ ]}
36
+ />
37
+
38
+ ### Collaboration pattern
39
+
40
+ Use this lightweight ownership split:
41
+
42
+ 1. Product owns route naming and URL intent
43
+ 2. Design owns shared layout primitives and tokens
44
+ 3. Engineering owns loaders, actions, and caching
45
+
46
+ This pattern keeps URL design, data loading, and UI composition in one place.
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: 'Midnight Compass Build'
3
+ description: 'Where to customize theme and typography.'
4
+ pubDate: 'Jul 22 2024'
5
+ heroImage: '/images/lagoon-2.svg'
6
+ ---
7
+
8
+ Update CSS variables in `src/styles.css` to fit your brand.
9
+
10
+ Then adjust header and footer links to match your product.
11
+
12
+ ## Theme alignment checklist
13
+
14
+ Before adding one-off colors, audit these variables:
15
+
16
+ - `--sea-ink` and `--sea-ink-soft` for readable body copy
17
+ - `--surface` and `--surface-strong` for cards and shells
18
+ - `--lagoon` / `--lagoon-deep` for links and active UI affordances
19
+
20
+ If those are correct, most components will look coherent with zero extra work.
21
+
22
+ ### Accessibility reminder
23
+
24
+ Check contrast on at least three surfaces:
25
+
26
+ 1. page background
27
+ 2. primary card
28
+ 3. muted card
29
+
30
+ You can be highly branded and still hit comfortable readability.
31
+
32
+ ## Typography defaults that travel well
33
+
34
+ Use a high-contrast display face for headlines and a workhorse sans for body
35
+ copy. Then lock in a spacing scale that keeps article rhythm consistent:
36
+
37
+ - headings: `mt-10 mb-3`
38
+ - paragraphs: `mb-5`
39
+ - lists: `mb-6`
40
+
41
+ With those defaults set, long-form pages stay readable across both themes.
42
+
43
+ ### Practical review loop
44
+
45
+ When you tweak tokens, review these pages in order:
46
+
47
+ 1. Blog detail page (most typography states)
48
+ 2. Blog index page (cards + metadata)
49
+ 3. Home page (hero and CTA emphasis)
@@ -0,0 +1,37 @@
1
+ import { defineCollection, defineConfig } from '@content-collections/core'
2
+ import { compileMarkdown } from '@content-collections/markdown'
3
+ import { compileMDX } from '@content-collections/mdx'
4
+ import remarkGfm from 'remark-gfm'
5
+ import { z } from 'zod'
6
+
7
+ const blog = defineCollection({
8
+ name: 'blog',
9
+ directory: 'content/blog',
10
+ include: '**/*.{md,mdx}',
11
+ schema: z.object({
12
+ title: z.string(),
13
+ description: z.string(),
14
+ pubDate: z.string(),
15
+ content: z.string(),
16
+ heroImage: z.string().optional(),
17
+ }),
18
+ transform: async (document, context) => {
19
+ const isMdx = document._meta.filePath.endsWith('.mdx')
20
+
21
+ return {
22
+ ...document,
23
+ slug: document._meta.path,
24
+ pubDate: new Date(document.pubDate).toISOString(),
25
+ html: isMdx ? null : await compileMarkdown(context, document),
26
+ mdx: isMdx
27
+ ? await compileMDX(context, document, {
28
+ remarkPlugins: [remarkGfm],
29
+ })
30
+ : null,
31
+ }
32
+ },
33
+ })
34
+
35
+ export default defineConfig({
36
+ collections: [blog],
37
+ })
@@ -22,6 +22,11 @@
22
22
  "react-dom": "^19.2.0"
23
23
  },
24
24
  "devDependencies": {
25
+ "@content-collections/core": "^0.13.1",
26
+ "@content-collections/markdown": "^0.1.4",
27
+ "@content-collections/mdx": "^0.2.2",
28
+ "@content-collections/vite": "^0.2.8",
29
+ "@tailwindcss/typography": "^0.5.16",
25
30
  "@tanstack/devtools-vite": "^0.3.11",
26
31
  "@testing-library/dom": "^10.4.0",
27
32
  "@testing-library/react": "^16.2.0",
@@ -29,9 +34,11 @@
29
34
  "@types/react-dom": "^19.2.0",
30
35
  "@vitejs/plugin-react": "^5.0.4",
31
36
  "jsdom": "^27.0.0",
37
+ "remark-gfm": "^4.0.1",
32
38
  "typescript": "^5.7.2",
33
39
  "vite": "^7.1.7",
34
40
  "vite-tsconfig-paths": "^5.1.4",
35
- "vitest": "^3.0.5"
41
+ "vitest": "^3.0.5",
42
+ "zod": "^4.3.5"
36
43
  }
37
44
  }
@@ -0,0 +1,13 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630" role="img" aria-label="Lagoon gradient 1">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" x2="1" y1="0" y2="1">
4
+ <stop offset="0%" stop-color="#9be2dc"/>
5
+ <stop offset="55%" stop-color="#65c2c4"/>
6
+ <stop offset="100%" stop-color="#356f7b"/>
7
+ </linearGradient>
8
+ </defs>
9
+ <rect width="1200" height="630" fill="url(#bg)"/>
10
+ <circle cx="980" cy="90" r="120" fill="#fff" fill-opacity="0.32"/>
11
+ <path d="M0 500c160-70 280-70 420 0s260 70 420 0 240-70 360 0v130H0z" fill="#d8f4ec" fill-opacity="0.82"/>
12
+ <path d="M0 550c160-70 280-70 420 0s260 70 420 0 240-70 360 0v80H0z" fill="#2f6a4a" fill-opacity="0.18"/>
13
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630" role="img" aria-label="Lagoon gradient 2">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" x2="1" y1="0" y2="1">
4
+ <stop offset="0%" stop-color="#b1ebe4"/>
5
+ <stop offset="50%" stop-color="#73c7b3"/>
6
+ <stop offset="100%" stop-color="#2f6a4a"/>
7
+ </linearGradient>
8
+ </defs>
9
+ <rect width="1200" height="630" fill="url(#bg)"/>
10
+ <path d="M0 485c180-96 360-96 540 0s360 96 660 0v145H0z" fill="#f1fbf8" fill-opacity="0.72"/>
11
+ <circle cx="180" cy="140" r="90" fill="#fff" fill-opacity="0.26"/>
12
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630" role="img" aria-label="Lagoon gradient 3">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" x2="1" y1="0" y2="1">
4
+ <stop offset="0%" stop-color="#8fdcd0"/>
5
+ <stop offset="60%" stop-color="#4ea7ad"/>
6
+ <stop offset="100%" stop-color="#1f4f5c"/>
7
+ </linearGradient>
8
+ </defs>
9
+ <rect width="1200" height="630" fill="url(#bg)"/>
10
+ <path d="M0 520c160-70 320-70 480 0s320 70 720 0v110H0z" fill="#dff6ee" fill-opacity="0.8"/>
11
+ <path d="M0 560c160-70 320-70 480 0s320 70 720 0v70H0z" fill="#173a40" fill-opacity="0.16"/>
12
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630" role="img" aria-label="Lagoon gradient 4">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" x2="1" y1="1" y2="0">
4
+ <stop offset="0%" stop-color="#81d8c9"/>
5
+ <stop offset="52%" stop-color="#53a9c8"/>
6
+ <stop offset="100%" stop-color="#2f6a7b"/>
7
+ </linearGradient>
8
+ </defs>
9
+ <rect width="1200" height="630" fill="url(#bg)"/>
10
+ <circle cx="1040" cy="140" r="96" fill="#fff" fill-opacity="0.24"/>
11
+ <path d="M0 500c180-85 350-85 520 0s350 85 680 0v130H0z" fill="#effaf6" fill-opacity="0.74"/>
12
+ </svg>