create-ampless 1.0.0-alpha.57 → 1.0.0-alpha.59

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 (63) hide show
  1. package/dist/index.js +1 -10
  2. package/dist/templates/_shared/AGENTS.ja.md +16 -26
  3. package/dist/templates/_shared/AGENTS.md +16 -26
  4. package/dist/templates/_shared/README.ja.md +29 -3
  5. package/dist/templates/_shared/README.md +29 -3
  6. package/dist/templates/_shared/THEMES.ja.md +495 -0
  7. package/dist/templates/_shared/THEMES.md +523 -0
  8. package/dist/templates/_shared/app/layout.tsx +8 -8
  9. package/dist/templates/_shared/app/providers.tsx +0 -2
  10. package/dist/templates/_shared/components/site-chrome/site-sidebar.tsx +2 -2
  11. package/dist/templates/_shared/components.json +1 -1
  12. package/dist/templates/_shared/lib/admin.ts +4 -6
  13. package/dist/templates/_shared/lib/ampless.ts +2 -8
  14. package/dist/templates/_shared/lib/amplify.ts +0 -5
  15. package/dist/templates/_shared/package.json +2 -2
  16. package/dist/templates/blog/pages/feed.ts +2 -2
  17. package/dist/templates/blog/pages/home.tsx +8 -10
  18. package/dist/templates/blog/pages/post.tsx +9 -12
  19. package/dist/templates/blog/pages/sitemap.ts +2 -2
  20. package/dist/templates/blog/pages/tag.tsx +7 -9
  21. package/dist/templates/corporate/pages/feed.ts +2 -2
  22. package/dist/templates/corporate/pages/home.tsx +6 -8
  23. package/dist/templates/corporate/pages/post.tsx +9 -12
  24. package/dist/templates/corporate/pages/sitemap.ts +2 -2
  25. package/dist/templates/corporate/pages/tag.tsx +7 -9
  26. package/dist/templates/dads/pages/feed.ts +2 -2
  27. package/dist/templates/dads/pages/home.tsx +6 -8
  28. package/dist/templates/dads/pages/post.tsx +9 -12
  29. package/dist/templates/dads/pages/sitemap.ts +2 -2
  30. package/dist/templates/dads/pages/tag.tsx +7 -9
  31. package/dist/templates/docs/pages/feed.ts +2 -2
  32. package/dist/templates/docs/pages/home.tsx +4 -6
  33. package/dist/templates/docs/pages/post.tsx +7 -10
  34. package/dist/templates/docs/pages/sitemap.ts +2 -2
  35. package/dist/templates/docs/pages/tag.tsx +6 -8
  36. package/dist/templates/landing/pages/feed.ts +2 -2
  37. package/dist/templates/landing/pages/home.tsx +6 -8
  38. package/dist/templates/landing/pages/post.tsx +9 -12
  39. package/dist/templates/landing/pages/sitemap.ts +2 -2
  40. package/dist/templates/landing/pages/tag.tsx +7 -9
  41. package/dist/templates/minimal/pages/feed.ts +2 -2
  42. package/dist/templates/minimal/pages/home.tsx +5 -6
  43. package/dist/templates/minimal/pages/post.tsx +8 -10
  44. package/dist/templates/minimal/pages/sitemap.ts +2 -2
  45. package/dist/templates/minimal/pages/tag.tsx +6 -7
  46. package/package.json +1 -1
  47. package/dist/templates/_shared/components/i18n-provider.tsx +0 -15
  48. package/dist/templates/_shared/lib/amplify-server.ts +0 -7
  49. package/dist/templates/_shared/lib/auth-server.ts +0 -15
  50. package/dist/templates/_shared/lib/cn.ts +0 -5
  51. package/dist/templates/_shared/lib/i18n.ts +0 -35
  52. package/dist/templates/_shared/lib/kv-provider.ts +0 -8
  53. package/dist/templates/_shared/lib/media.ts +0 -6
  54. package/dist/templates/_shared/lib/posts-provider.ts +0 -8
  55. package/dist/templates/_shared/lib/posts-public.ts +0 -27
  56. package/dist/templates/_shared/lib/posts.ts +0 -12
  57. package/dist/templates/_shared/lib/seo.ts +0 -11
  58. package/dist/templates/_shared/lib/site-settings.ts +0 -11
  59. package/dist/templates/_shared/lib/storage.ts +0 -10
  60. package/dist/templates/_shared/lib/theme-actions.ts +0 -5
  61. package/dist/templates/_shared/lib/theme-active.ts +0 -10
  62. package/dist/templates/_shared/lib/theme-config.ts +0 -12
  63. package/dist/templates/_shared/lib/upload.ts +0 -6
@@ -0,0 +1,523 @@
1
+ > 日本語版: [THEMES.ja.md](./THEMES.ja.md)
2
+ >
3
+ # THEMES.md
4
+
5
+ Working guide for customizing themes in an ampless project. Written
6
+ for AI coding agents and humans alike — keep it as your day-to-day
7
+ reference when designing or restyling a site.
8
+
9
+ All theme-related instructions live here. `AGENTS.md` / `AGENTS.ja.md`
10
+ deliberately keep only a one-line pointer back to this file.
11
+
12
+ ## Ground rules
13
+
14
+ - Never edit the official themes directly.
15
+ - Keep customizations inside `themes/my-*/`.
16
+ - The shared shell (`app/`, `components/`, `lib/`) is touched only when
17
+ the change genuinely can't be solved inside a theme.
18
+ - `themes-registry.ts` is auto-generated — don't hand-edit it.
19
+ - UI / theme changes are NOT done when type-checks pass. Always verify
20
+ in a browser.
21
+
22
+ ## Picking a base theme
23
+
24
+ Theme customization in ampless starts by copying an existing theme
25
+ into `themes/my-*/`. Deciding "which theme to start from" first keeps
26
+ the scope small — much smaller than deciding "what to build" first.
27
+
28
+ ### `blog`
29
+
30
+ Personal blogs, journals, technical notes, short news commentary —
31
+ anything chronological where individual posts are the primary unit.
32
+
33
+ Out of the box:
34
+
35
+ - Post feed on the home page.
36
+ - Per-post detail page.
37
+ - Per-tag archive page.
38
+ - Header / footer nav.
39
+ - Wide tuning surface for colors, fonts, radii, pinned posts, etc.
40
+
41
+ Good fits:
42
+
43
+ - Personal-media feel.
44
+ - Adjusting the density of the post list.
45
+ - Strengthening typography on the detail page.
46
+ - Designing Markdown elements (tables, code, blockquotes) as part of
47
+ the reading experience.
48
+
49
+ When in doubt, start from `blog`.
50
+
51
+ ### `minimal`
52
+
53
+ Restrained, small-surface blog.
54
+
55
+ Out of the box:
56
+
57
+ - Few manifest customization fields.
58
+ - Minimal chrome.
59
+ - Design steps back so the posts take the lead.
60
+
61
+ Good fits:
62
+
63
+ - Light color / radius tweaks only.
64
+ - Layout largely untouched.
65
+ - Low-content sites.
66
+
67
+ If you want to redesign meaningfully, start from `blog` instead.
68
+
69
+ ### `landing`
70
+
71
+ Single-page introduction sites.
72
+
73
+ Out of the box:
74
+
75
+ - Hero-centric layout.
76
+ - CTA button.
77
+ - Optional latest-posts strip.
78
+ - Site description and primary CTAs front and center.
79
+
80
+ Good fits:
81
+
82
+ - Products, events, portfolios, shop introductions.
83
+ - Sites that prioritize the first impression over a long post list.
84
+ - Letting an AI design the hero / CTA / feature sections.
85
+
86
+ ### `corporate`
87
+
88
+ Company sites, firms, organizations.
89
+
90
+ Out of the box:
91
+
92
+ - Restrained hero.
93
+ - News / announcements list.
94
+ - Substantial header / footer.
95
+ - Footer disclaimer slot.
96
+
97
+ Good fits:
98
+
99
+ - Putting company overview / services up front.
100
+ - Managing news and announcements as posts.
101
+ - Trust, readability, maintainability as priorities.
102
+
103
+ ### `docs`
104
+
105
+ Documentation sites.
106
+
107
+ Out of the box:
108
+
109
+ - Sidebar-driven navigation.
110
+ - Putting `tag:<name>` into a sidebar entry auto-expands the matching
111
+ post list.
112
+ - Structure tuned for code fonts and technical writing.
113
+
114
+ Good fits:
115
+
116
+ - Help docs, specifications, developer reference.
117
+ - Categorizing posts by tag and surfacing them in the sidebar.
118
+ - Heavy use of Markdown code blocks and tables.
119
+
120
+ ### `dads`
121
+
122
+ Public-sector sites following Japan's Digital Agency Design System.
123
+
124
+ Out of the box:
125
+
126
+ - High contrast.
127
+ - Accessibility-first.
128
+ - Restrained decoration.
129
+ - Built on `@digital-go-jp/tailwind-theme-plugin`.
130
+
131
+ Good fits:
132
+
133
+ - Government, municipal, public-sector information sites.
134
+ - Compliance and readability prioritized over a distinctive look.
135
+
136
+ Caveats:
137
+
138
+ - Reskinning to non-DADS palettes erodes the "DADS-compliant" claim.
139
+ - For public-sector work, don't take AI-suggested decorative changes
140
+ at face value — keep accessibility first.
141
+
142
+ ## Standard workflow
143
+
144
+ 1. Copy an official theme.
145
+
146
+ ```bash
147
+ npm run copy-theme blog my-blog
148
+ ```
149
+
150
+ The `my-` prefix marks the copy as user-owned;
151
+ `npm run update-ampless` leaves anything under `themes/my-*/` alone.
152
+
153
+ 2. Implement inside the theme first.
154
+
155
+ In priority order:
156
+
157
+ - `themes/my-blog/tokens.css` — colors, fonts, spacing, rules,
158
+ Markdown body styling.
159
+ - `themes/my-blog/manifest.ts` — fields exposed to the admin UI.
160
+ - `themes/my-blog/pages/` — per-route layouts (home / post / tag /
161
+ feed / sitemap).
162
+ - `themes/my-blog/components.tsx` (or similar) — shared UI used
163
+ only within this theme. Header, footer, wordmark, and such can
164
+ live here.
165
+
166
+ 3. Activate the theme.
167
+
168
+ Open `/admin/sites/<siteId>/theme`, select `my-blog`, save. Theme
169
+ switching is a runtime setting — no redeploy required.
170
+
171
+ 4. Verify.
172
+
173
+ ```bash
174
+ npm run dev
175
+ npx tsc --noEmit
176
+ npm run build
177
+ npm run lint
178
+ ```
179
+
180
+ If `npm run lint` is misaligned with the project's Next.js version,
181
+ say so — but type-check, build, and browser verification still all
182
+ have to pass.
183
+
184
+ ## Design before you implement
185
+
186
+ Before changing a theme, decide in this order:
187
+
188
+ 1. **Site role.** Personal blog? Technical notes? News commentary?
189
+ Company site? Documentation? Landing page?
190
+ 2. **Reading mode.** Slow reading of long-form posts? Fast scanning
191
+ of a list? Strong hero impression? Search / tag discovery?
192
+ 3. **Screen inventory.** At minimum, think through:
193
+ - home
194
+ - post detail
195
+ - tag / archive
196
+ - empty state
197
+ - mobile home
198
+ - mobile detail
199
+ 4. **Change surface.** Is `tokens.css` enough? Does `pages/` structure
200
+ change? Do you need a new theme-local component?
201
+ 5. **Markdown.** For blog or docs themes, Markdown elements are part
202
+ of the design — not afterthought.
203
+
204
+ ### Order of operations
205
+
206
+ First, change what `tokens.css` can change:
207
+
208
+ - Colors
209
+ - Fonts
210
+ - Backgrounds
211
+ - Rules
212
+ - Spacing
213
+ - Prose / Markdown
214
+ - Responsive sizing
215
+
216
+ Then change `pages/`:
217
+
218
+ - Home structure.
219
+ - Post-list density.
220
+ - Post-detail spacing and meta.
221
+ - Tag / archive presentation.
222
+ - Empty state.
223
+
224
+ Last, extract repeated UI into theme-local components like
225
+ `components.tsx`.
226
+
227
+ Reach for shared `components/` or `app/` only when the change has to
228
+ be used across multiple themes.
229
+
230
+ ## Working without Claude Design
231
+
232
+ Read the existing theme first. Don't restart from scratch.
233
+
234
+ What to read:
235
+
236
+ - `tokens.css` token structure.
237
+ - Public fields in `manifest.ts`.
238
+ - Data fetching and rendering responsibilities in `pages/home.tsx`,
239
+ `pages/post.tsx`, `pages/tag.tsx`.
240
+ - `themes/<official-name>/README.*` if present — theme-specific intent.
241
+
242
+ How to proceed:
243
+
244
+ 1. Decompose the requirements into "reading experience", "information
245
+ density", "brand feel", and "content types".
246
+ 2. Set the broad direction in `tokens.css`.
247
+ 3. Change `pages/` only where needed.
248
+ 4. Extract repeated chrome into theme-local components.
249
+ 5. Always include Markdown elements in the design.
250
+
251
+ Markdown elements to check:
252
+
253
+ - Headings `h1` / `h2` / `h3`
254
+ - Paragraphs
255
+ - Lists
256
+ - Tables
257
+ - Blockquotes
258
+ - Inline code
259
+ - Code blocks
260
+ - Images
261
+ - Links
262
+
263
+ For reading-focused sites, body legibility is the top priority.
264
+ Express the design through the framing — spacing, rules, navigation,
265
+ list density, meta typography — not the body itself.
266
+
267
+ ## Using AI for theme customization
268
+
269
+ Don't treat AI as a single "implement everything" tool. Accuracy goes
270
+ up when you split the work across roles.
271
+
272
+ A workable split:
273
+
274
+ - **Design exploration**: Claude Design, ChatGPT, image generation —
275
+ produce a direction.
276
+ - **Implementation plan**: Codex / Claude Code reads the existing
277
+ theme and decides which files reflect the plan.
278
+ - **Implementation**: edits inside the theme.
279
+ - **Verification**: Desktop / Mobile browser screenshots.
280
+ - **Polish**: overflow, empty states, Markdown, long titles.
281
+
282
+ ### What to feed the AI
283
+
284
+ When you ask an AI to draft a theme, include:
285
+
286
+ - Site name.
287
+ - Site content.
288
+ - Audience.
289
+ - Primary post types.
290
+ - Vibes to avoid.
291
+ - Reference sites or screenshots.
292
+ - That both Desktop and Mobile are required.
293
+ - That home / archive / detail / empty-state are all required.
294
+ - That Markdown — tables, lists, code, blockquotes — is in scope.
295
+
296
+ Example:
297
+
298
+ ```text
299
+ Design a theme for ishinao.net, a personal blog. The content is
300
+ day-to-day life, technical notes, and short news commentary.
301
+ Body legibility is the top priority because this is a reading site,
302
+ but the home, archive, header, and meta deserve real design.
303
+ Produce Top-empty, Top-with-content, Archive, and Detail for both
304
+ Desktop and Mobile. Markdown tables, lists, blockquotes, and code
305
+ blocks should sit cleanly inside the theme's world.
306
+ ```
307
+
308
+ ### Don't trust AI output verbatim
309
+
310
+ Common gaps in AI-produced themes:
311
+
312
+ - Desktop looks great; Mobile breaks.
313
+ - Hero is polished but post detail looks generic.
314
+ - Decoration wins over body legibility.
315
+ - Markdown tables / code aren't designed.
316
+ - No empty state.
317
+ - Long real-world Japanese titles overflow.
318
+ - Spacing / type sizes drift between mockup and implementation.
319
+
320
+ Treat AI output as a **visual spec**, not finished code.
321
+
322
+ ## Using Claude Design
323
+
324
+ Claude Design output HTML is usually a collection of artboards across
325
+ multiple screens, not a single finished site. Don't port the HTML
326
+ verbatim — extract the design intent per screen and map it onto the
327
+ ampless theme structure.
328
+
329
+ ### Reading the output
330
+
331
+ First, classify the artboards by screen from the HTML or screenshots:
332
+
333
+ - Desktop / Top empty
334
+ - Desktop / Top with content
335
+ - Desktop / Archive list
336
+ - Desktop / Detail
337
+ - Mobile / Top
338
+ - Mobile / Archive
339
+ - Mobile / Detail
340
+
341
+ Then pull the shared tokens out of each screen:
342
+
343
+ - Background color
344
+ - Accent color
345
+ - Rule color
346
+ - Font family
347
+ - Heading size relationships
348
+ - Body line-height
349
+ - List density
350
+ - Spacing unit
351
+ - Header / footer chrome
352
+ - Mobile widths, padding, line breaks, info-elision rules
353
+
354
+ Don't implement from a single artboard in isolation. Look at Desktop
355
+ and Mobile together to see how the same UI transforms.
356
+
357
+ ### Mapping to ampless
358
+
359
+ Map Claude Design screens onto the ampless theme structure:
360
+
361
+ - Top / Home → `themes/my-blog/pages/home.tsx`
362
+ - Detail / Article → `themes/my-blog/pages/post.tsx`
363
+ - Archive / Tag / List → `themes/my-blog/pages/tag.tsx`
364
+ - Shared header / wordmark / footer →
365
+ `themes/my-blog/components.tsx`
366
+ - Colors, fonts, grid, prose, responsive → `themes/my-blog/tokens.css`
367
+ - Values exposed in the admin UI → `themes/my-blog/manifest.ts`
368
+
369
+ Don't copy generated code or inline styles wholesale. What you need
370
+ is the design rules, not the implementation.
371
+
372
+ ### Implementation tips
373
+
374
+ Extract by hand from the Claude Design HTML:
375
+
376
+ - Screen types.
377
+ - Shared tokens.
378
+ - Layout grid.
379
+ - Heading size scale.
380
+ - List row height, rule treatment, meta position.
381
+ - Mobile elision / vertical stacking / size changes.
382
+ - Empty-state handling.
383
+
384
+ On the ampless side, slot those into:
385
+
386
+ - Shared design language → `tokens.css`
387
+ - Screen structure → `pages/*.tsx`
388
+ - Repeating UI → theme-local `components.tsx`
389
+ - Admin-editable values → `manifest.ts`
390
+
391
+ If a Claude Design board carries multiple states, note them first.
392
+ Example:
393
+
394
+ ```text
395
+ Final - ishinao.net theme
396
+ - Top empty
397
+ - Top with content
398
+ - Archive list
399
+ - Detail editorial body
400
+ - Mobile top empty
401
+ - Mobile top with content
402
+ - Mobile archive
403
+ - Mobile detail
404
+ ```
405
+
406
+ Treat the list as your implementation checklist.
407
+
408
+ ### Claude Design reflection checklist
409
+
410
+ - Implemented both Desktop and Mobile?
411
+ - Handled both empty and populated states?
412
+ - Same design language flows through list / detail / tag pages?
413
+ - Wordmark, nav, meta, rules, background treated consistently?
414
+ - No horizontal scroll or text overflow on mobile?
415
+ - Long Japanese titles don't break the layout?
416
+ - 1 / many / no-tag / multi-tag posts all render cleanly?
417
+ - Markdown tables / code blocks don't float outside the theme world?
418
+
419
+ ## Using other AI tools (no Claude Design)
420
+
421
+ You can still get a lot out of AI without Claude Design.
422
+
423
+ ### Ask in text
424
+
425
+ Have the AI write a design spec first:
426
+
427
+ ```text
428
+ Based on the blog theme, draft a theme spec for a personal technical
429
+ blog. Output is a written spec — not code — split across tokens,
430
+ home, post detail, tag archive, mobile rules, and Markdown styling.
431
+ Body legibility is the top priority; decoration lives in the chrome
432
+ and lists.
433
+ ```
434
+
435
+ Then hand the spec to Codex / Claude Code for implementation.
436
+
437
+ ### Use reference images / screenshots
438
+
439
+ If you have reference imagery, have the AI extract:
440
+
441
+ - Colors.
442
+ - Font vibes.
443
+ - Spacing.
444
+ - Rules.
445
+ - Information density.
446
+ - Desktop / Mobile differences.
447
+ - What should land in `tokens.css`.
448
+ - Whether `pages/` structure has to change.
449
+
450
+ ### Asking AI to implement
451
+
452
+ Phrase the implementation ask narrowly:
453
+
454
+ ```text
455
+ Edit only themes/my-blog. Don't touch shared app / components / lib.
456
+ Read the existing theme first to learn the tokens.css / pages /
457
+ manifest responsibilities. Verify Desktop 1440px and Mobile 390px in
458
+ the browser. Style Markdown tables, lists, blockquotes, and code
459
+ blocks consistently with the theme.
460
+ ```
461
+
462
+ A vague "make it look good" prompt is how you end up with shared
463
+ files edited and Mobile forgotten.
464
+
465
+ ## Browser verification
466
+
467
+ UI / theme changes need a real dev server. Open the actual pages.
468
+
469
+ ```bash
470
+ npm run dev
471
+ ```
472
+
473
+ Representative widths:
474
+
475
+ - Desktop: `1440 x 1100`
476
+ - Mobile: `390 x 844`
477
+
478
+ When taking screenshots, append a query string to bypass any
479
+ intermediate cache:
480
+
481
+ ```text
482
+ http://localhost:3000/?v=theme-check-1
483
+ ```
484
+
485
+ What to look for:
486
+
487
+ - First impression matches the reference direction.
488
+ - Text doesn't overflow its parent.
489
+ - No horizontal scroll on mobile.
490
+ - Background, rules, spacing, and type scale all feel right at the
491
+ width.
492
+ - Body contrast and line-height are comfortable to read.
493
+ - Empty link / tag / nav / footer configurations don't leave dead
494
+ chrome behind.
495
+
496
+ ## Theme-local components
497
+
498
+ Theme-specific shared UI belongs in the theme, e.g.
499
+ `themes/my-blog/components.tsx`.
500
+
501
+ Good candidates:
502
+
503
+ - Header
504
+ - Footer
505
+ - Wordmark
506
+ - Post row
507
+ - Meta block
508
+ - Theme-specific decorative UI
509
+
510
+ Put something in shared `components/` only when it has to be reused
511
+ across multiple themes or by the admin UI.
512
+
513
+ ## Common failure modes
514
+
515
+ - Implementing only the first Claude Design thumbnail you opened.
516
+ - Hugging Desktop and missing the Mobile artboards.
517
+ - Editing shared `components/` for a change `tokens.css` could have
518
+ handled.
519
+ - Editing the official `themes/blog/` directly.
520
+ - Leaving Markdown tables, blockquotes, and code blocks unstyled.
521
+ - Calling a change "done" because the build passed, with no browser
522
+ check.
523
+ - Empty footer / nav configurations still rendering empty chrome.
@@ -1,22 +1,22 @@
1
1
  import type { Metadata } from 'next'
2
2
  import { headers } from 'next/headers'
3
- import { validateColorScheme } from '@ampless/runtime'
3
+ import { renderThemeCss, validateColorScheme } from '@ampless/runtime'
4
+ import { getDictionary } from '@ampless/admin'
5
+ import { I18nProvider } from '@ampless/admin/components'
6
+ import { ampless } from '@/lib/ampless'
7
+ import { admin } from '@/lib/admin'
4
8
  import { Providers } from './providers'
5
- import { siteMetadata } from '@/lib/seo'
6
- import { loadThemeConfig, renderThemeCss } from '@/lib/theme-config'
7
- import { getLocale, getDictionary } from '@/lib/i18n'
8
- import { I18nProvider } from '@/components/i18n-provider'
9
9
  import './globals.css'
10
10
 
11
11
  export async function generateMetadata(): Promise<Metadata> {
12
- return siteMetadata()
12
+ return ampless.siteMetadata()
13
13
  }
14
14
 
15
15
  export default async function RootLayout({ children }: { children: React.ReactNode }) {
16
16
  const h = await headers()
17
- const theme = await loadThemeConfig()
17
+ const theme = await ampless.loadThemeConfig()
18
18
  const themeCss = renderThemeCss(theme.cssVars)
19
- const locale = getLocale()
19
+ const locale = admin.locale
20
20
  const dict = getDictionary(locale)
21
21
  // `data-color-scheme` pins the visitor to light or dark regardless
22
22
  // of their system `prefers-color-scheme`. `'auto'` (the default)
@@ -2,8 +2,6 @@
2
2
 
3
3
  import { useEffect } from 'react'
4
4
  import '@/lib/amplify'
5
- import '@/lib/posts-provider'
6
- import '@/lib/kv-provider'
7
5
 
8
6
  export function Providers({ children }: { children: React.ReactNode }) {
9
7
  useEffect(() => {
@@ -1,6 +1,6 @@
1
1
  import Link from 'next/link'
2
2
  import { parseLinkList, isTagListUrl } from 'ampless'
3
- import { listPostsByTag } from '@/lib/posts-public'
3
+ import { ampless } from '@/lib/ampless'
4
4
 
5
5
  interface Props {
6
6
  links: string | undefined
@@ -27,7 +27,7 @@ export async function SiteSidebar({ links, className }: Props) {
27
27
  items.map(async (item) => {
28
28
  const tagRef = isTagListUrl(item.url)
29
29
  if (!tagRef) return { type: 'link' as const, label: item.label, url: item.url }
30
- const { items: posts } = await listPostsByTag(tagRef.tag, { limit: 50 })
30
+ const { items: posts } = await ampless.listPostsByTag(tagRef.tag, { limit: 50 })
31
31
  return {
32
32
  type: 'tagSection' as const,
33
33
  label: item.label,
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "aliases": {
14
14
  "components": "@/components",
15
- "utils": "@/lib/cn",
15
+ "utils": "@ampless/runtime/ui",
16
16
  "ui": "@/components/ui",
17
17
  "lib": "@/lib",
18
18
  "hooks": "@/hooks"
@@ -1,16 +1,14 @@
1
1
  // Wired-up admin UI factory. Single source of truth for the admin
2
2
  // library — every admin route shell, API route shell, and form
3
- // re-export shim imports the `admin` value from here.
4
- //
5
- // L2 architectural change (admin extraction): admin UI now lives in
6
- // `@ampless/admin`. This module wires the project's
3
+ // imports the `admin` value from here. Admin UI lives in
4
+ // `@ampless/admin`; this module wires the project's
7
5
  // `amplify_outputs.json` and `cms.config` into a single `Admin`
8
6
  // instance.
9
7
  //
10
8
  // NOTE: we pass `ampless` as a thunk (not the resolved instance) so we
11
9
  // don't have a static `import './ampless'` at the top of this file.
12
10
  // A static import would form the cycle
13
- // `lib/admin.ts → lib/ampless.ts → themes-registry → themes → lib/i18n.ts → lib/admin.ts`
11
+ // `lib/admin.ts → lib/ampless.ts → themes-registry → themes → lib/admin.ts`
14
12
  // and crash with a TDZ ReferenceError on `ampless` at module init.
15
13
  // The thunk uses dynamic `import()` so `lib/ampless.ts` only loads on
16
14
  // the first `loadSiteSettings` / `loadThemeConfig` call (request
@@ -28,5 +26,5 @@ export const admin = createAdmin({
28
26
  })
29
27
 
30
28
  // Convenience: the server-side translation helper. Client components
31
- // should use `useT()` from `@/components/i18n-provider` instead.
29
+ // should use `useT()` from `@ampless/admin/components` instead.
32
30
  export const t = admin.t
@@ -1,15 +1,9 @@
1
1
  // Wired-up ampless runtime instance. Single source of truth for the
2
2
  // public-side library — every route handler, dispatcher, and theme
3
- // component imports the `ampless` value from here.
4
- //
5
- // L1 architectural change (runtime extraction): public-side
6
- // behaviour now lives in `@ampless/runtime`. This module wires the
3
+ // component imports the `ampless` value from here. Public-side
4
+ // behaviour lives in `@ampless/runtime`; this module wires the
7
5
  // project's `amplify_outputs.json`, `cms.config`, and themes registry
8
6
  // into a single `Ampless` instance.
9
- //
10
- // Admin-side modules (post providers, kv-provider, auth, etc.) stay
11
- // in `templates/_shared/lib/` for now — they move into `@ampless/admin`
12
- // in L2.
13
7
 
14
8
  import outputs from '../amplify_outputs.json'
15
9
  import cmsConfig from '@/cms.config'
@@ -13,8 +13,3 @@ import { Amplify } from 'aws-amplify'
13
13
  import outputs from '../amplify_outputs.json'
14
14
 
15
15
  Amplify.configure(outputs, { ssr: true })
16
-
17
- export function configureAmplify() {
18
- // module-level side effect above already ran; keep this as a no-op
19
- // for callers that still import it as a function for back-compat.
20
- }
@@ -29,8 +29,8 @@
29
29
  "@ampless/plugin-rss": "^0.2.0-alpha.15",
30
30
  "@ampless/plugin-seo": "^0.2.0-alpha.15",
31
31
  "@ampless/plugin-webhook": "^0.2.0-alpha.15",
32
- "@ampless/admin": "^1.0.0-alpha.37",
33
- "@ampless/backend": "^1.0.0-alpha.28",
32
+ "@ampless/admin": "^1.0.0-alpha.38",
33
+ "@ampless/backend": "^1.0.0-alpha.29",
34
34
  "@ampless/runtime": "^1.0.0-alpha.21",
35
35
  "@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
36
36
  "ampless": "^1.0.0-alpha.15",
@@ -1,4 +1,4 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
@@ -7,7 +7,7 @@ interface Ctx {
7
7
  // /feed.xml proxy — plugin-rss regenerates the feed on content events
8
8
  // and writes it to `public/plugins/rss/feed.xml`.
9
9
  export async function blogFeedHandler(_ctx: Ctx): Promise<Response> {
10
- const url = publicAssetUrl('public/plugins/rss/feed.xml')
10
+ const url = ampless.publicAssetUrl('public/plugins/rss/feed.xml')
11
11
  const upstream = await fetch(url, { cache: 'no-store' })
12
12
  if (!upstream.ok) {
13
13
  return new Response(