create-ampless 0.2.0-alpha.15 → 0.2.0-alpha.17

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.
@@ -0,0 +1,5 @@
1
+ import { admin } from '@/lib/admin'
2
+ import { createMcpTokensPage } from '@ampless/admin/pages'
3
+
4
+ export const dynamic = 'force-dynamic'
5
+ export default createMcpTokensPage(admin)
@@ -0,0 +1,6 @@
1
+ import { admin } from '@/lib/admin'
2
+ import { createMcpTokensRoute } from '@ampless/admin/api'
3
+
4
+ export const dynamic = 'force-dynamic'
5
+ export const runtime = 'nodejs'
6
+ export const { GET, POST, DELETE } = createMcpTokensRoute(admin)
@@ -0,0 +1,9 @@
1
+ import { admin } from '@/lib/admin'
2
+ import { createMcpRoute } from '@ampless/admin/api'
3
+
4
+ // `force-dynamic` keeps CloudFront from caching MCP responses. Each
5
+ // tool call must hit the SSR Lambda — caching would serve stale or
6
+ // cross-token responses.
7
+ export const dynamic = 'force-dynamic'
8
+ export const runtime = 'nodejs'
9
+ export const { POST } = createMcpRoute(admin)
@@ -1,6 +1,7 @@
1
1
  import type { Metadata } from 'next'
2
2
  import { headers } from 'next/headers'
3
3
  import { DEFAULT_SITE_ID } from 'ampless'
4
+ import { validateColorScheme } from '@ampless/runtime'
4
5
  import { Providers } from './providers'
5
6
  import { siteMetadata } from '@/lib/seo'
6
7
  import { loadThemeConfig, renderThemeCss } from '@/lib/theme-config'
@@ -32,9 +33,18 @@ export default async function RootLayout({ children }: { children: React.ReactNo
32
33
  // system setting. Themes use `light-dark()` in their tokens.css so a
33
34
  // single declaration covers both modes; the active `color-scheme`
34
35
  // selects which value is rendered.
36
+ //
37
+ // The admin's theme-settings iframe preview passes the unsaved
38
+ // selection via `?previewColorScheme=<mode>`, which middleware
39
+ // forwards as `x-preview-color-scheme`. When that header is present
40
+ // it overrides the stored site setting so the preview updates live.
41
+ const previewHeader = h.get('x-preview-color-scheme')
42
+ const effectiveColorScheme = previewHeader
43
+ ? validateColorScheme(previewHeader)
44
+ : theme.colorScheme
35
45
  const htmlProps: { lang: string; 'data-color-scheme'?: 'light' | 'dark' } = { lang: locale }
36
- if (theme.colorScheme !== 'auto') {
37
- htmlProps['data-color-scheme'] = theme.colorScheme
46
+ if (effectiveColorScheme !== 'auto') {
47
+ htmlProps['data-color-scheme'] = effectiveColorScheme
38
48
  }
39
49
  return (
40
50
  <html {...htmlProps}>
@@ -22,15 +22,15 @@
22
22
  "@tiptap/pm": "^3.23.4",
23
23
  "@tiptap/react": "^3.23.4",
24
24
  "@tiptap/starter-kit": "^3.23.4",
25
- "@ampless/plugin-og-image": "^0.2.0-alpha.3",
26
- "@ampless/plugin-rss": "^0.2.0-alpha.3",
27
- "@ampless/plugin-seo": "^0.2.0-alpha.3",
28
- "@ampless/plugin-webhook": "^0.2.0-alpha.3",
29
- "@ampless/admin": "^0.2.0-alpha.13",
30
- "@ampless/backend": "^0.2.0-alpha.5",
31
- "@ampless/runtime": "^0.2.0-alpha.6",
25
+ "@ampless/plugin-og-image": "^0.2.0-alpha.5",
26
+ "@ampless/plugin-rss": "^0.2.0-alpha.5",
27
+ "@ampless/plugin-seo": "^0.2.0-alpha.5",
28
+ "@ampless/plugin-webhook": "^0.2.0-alpha.5",
29
+ "@ampless/admin": "^0.2.0-alpha.15",
30
+ "@ampless/backend": "^0.2.0-alpha.7",
31
+ "@ampless/runtime": "^0.2.0-alpha.8",
32
32
  "@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
33
- "ampless": "^0.2.0-alpha.3",
33
+ "ampless": "^0.2.0-alpha.5",
34
34
  "aws-amplify": "^6.10.0",
35
35
  "class-variance-authority": "^0.7.1",
36
36
  "clsx": "^2.1.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ampless",
3
- "version": "0.2.0-alpha.15",
3
+ "version": "0.2.0-alpha.17",
4
4
  "description": "Create a new ampless project",
5
5
  "license": "MIT",
6
6
  "type": "module",