create-ampless 1.0.0-alpha.39 → 1.0.0-alpha.41
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/dist/templates/_shared/README.ja.md +2 -1
- package/dist/templates/_shared/README.md +2 -1
- package/dist/templates/_shared/app/{site/[siteId]/r → r}/[slug]/[[...path]]/route.ts +7 -6
- package/dist/templates/_shared/package.json +8 -8
- package/dist/templates/_shared/proxy.ts +22 -8
- package/package.json +1 -1
- /package/dist/templates/_shared/app/{site/[siteId]/[slug] → [slug]}/page.tsx +0 -0
- /package/dist/templates/_shared/app/{site/[siteId]/feed.xml → feed.xml}/route.ts +0 -0
- /package/dist/templates/_shared/app/{site/[siteId]/og → og}/[slug]/route.ts +0 -0
- /package/dist/templates/_shared/app/{site/[siteId]/page.tsx → page.tsx} +0 -0
- /package/dist/templates/_shared/app/{site/[siteId]/sitemap.xml → sitemap.xml}/route.ts +0 -0
- /package/dist/templates/_shared/app/{site/[siteId]/tag → tag}/[tag]/page.tsx +0 -0
|
@@ -65,7 +65,8 @@ npm run sandbox
|
|
|
65
65
|
投稿(Post)が唯一のコンテンツタイプです。各投稿には以下があります:
|
|
66
66
|
|
|
67
67
|
- **Format** — `tiptap`(リッチテキスト)/ `markdown` / `html`(生 HTML、サニタイズなし)/ `static`(HTML/CSS/JS の zip アップロード)
|
|
68
|
-
- **No layout** フラグ(`format: 'html'` のときのみ)— 本文をそのまま出力し、Next.js のレイアウトもテーマのクロームも適用しない。URL は `/<slug>`
|
|
68
|
+
- **No layout** フラグ(`format: 'html'` のときのみ)— 本文をそのまま出力し、Next.js のレイアウトもテーマのクロームも適用しない。URL は `/<slug>` のままで、middleware がリクエストを内部のベア HTML ハンドラーに書き換える
|
|
69
|
+
- **キャッシュ戦略**(`metadata.cache`)— 投稿ごとに `Cache-Control` を上書き: `'auto'`(デフォルト、編集時刻ベースのクールダウン)、`'deep'`(常に長期キャッシュ)、`'hot'`(常に no-store)。詳細は `docs/CONTENT.ja.md`
|
|
69
70
|
- **Slug** — 公開 URL
|
|
70
71
|
- **Status** — `draft`(管理者のみ)または `published`
|
|
71
72
|
|
|
@@ -65,7 +65,8 @@ Promotion/demotion is done in the AWS Cognito console — see [RUNBOOK.md → Pr
|
|
|
65
65
|
Posts are the single content type. Each post has:
|
|
66
66
|
|
|
67
67
|
- **Format** — `tiptap` (rich text) / `markdown` / `html` (raw, no sanitization) / `static` (zip-upload of HTML/CSS/JS)
|
|
68
|
-
- **No layout** flag (`format: 'html'` only) — render the body verbatim with no Next.js layout and no theme chrome. URL stays `/<slug>`; the
|
|
68
|
+
- **No layout** flag (`format: 'html'` only) — render the body verbatim with no Next.js layout and no theme chrome. URL stays `/<slug>`; middleware rewrites the request to the internal bare-HTML handler.
|
|
69
|
+
- **Cache strategy** (`metadata.cache`) — override the per-post Cache-Control: `'auto'` (default; cooldown by edit time), `'deep'` (always long-cache), or `'hot'` (always no-store). See `docs/CONTENT.md` for details.
|
|
69
70
|
- **Slug** — the public URL
|
|
70
71
|
- **Status** — `draft` (admin only) or `published`
|
|
71
72
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { ampless } from '@/lib/ampless'
|
|
2
2
|
import { createUnderscoreRouteHandler } from '@ampless/runtime/routes'
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// Internal handler for no_layout HTML and static-bundle posts. Reached
|
|
5
|
+
// via middleware rewrite from `/<slug>(/<path>)` — never directly.
|
|
6
|
+
// Covers two cases that both bypass the themed post page:
|
|
6
7
|
//
|
|
7
8
|
// - `format: 'html'` posts with `metadata.no_layout === true`
|
|
8
9
|
// → bare HTML response, no Next.js root layout, no theme chrome
|
|
9
10
|
// - `format: 'static'` posts
|
|
10
11
|
// → S3 presigned URL redirect for the entrypoint and every bundle file
|
|
11
12
|
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
13
|
+
// The literal folder is `r/` (not `_/` etc.) because Next.js's App
|
|
14
|
+
// Router excludes any path part starting with `_` from route
|
|
15
|
+
// discovery. The browser URL stays `/<slug>(/<path>)` throughout —
|
|
16
|
+
// middleware does the public→internal translation.
|
|
16
17
|
export const dynamic = 'force-dynamic'
|
|
17
18
|
export const GET = createUnderscoreRouteHandler(ampless)
|
|
@@ -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.
|
|
26
|
-
"@ampless/plugin-rss": "^0.2.0-alpha.
|
|
27
|
-
"@ampless/plugin-seo": "^0.2.0-alpha.
|
|
28
|
-
"@ampless/plugin-webhook": "^0.2.0-alpha.
|
|
29
|
-
"@ampless/admin": "^1.0.0-alpha.
|
|
30
|
-
"@ampless/backend": "^1.0.0-alpha.
|
|
31
|
-
"@ampless/runtime": "^1.0.0-alpha.
|
|
25
|
+
"@ampless/plugin-og-image": "^0.2.0-alpha.10",
|
|
26
|
+
"@ampless/plugin-rss": "^0.2.0-alpha.10",
|
|
27
|
+
"@ampless/plugin-seo": "^0.2.0-alpha.10",
|
|
28
|
+
"@ampless/plugin-webhook": "^0.2.0-alpha.10",
|
|
29
|
+
"@ampless/admin": "^1.0.0-alpha.27",
|
|
30
|
+
"@ampless/backend": "^1.0.0-alpha.20",
|
|
31
|
+
"@ampless/runtime": "^1.0.0-alpha.14",
|
|
32
32
|
"@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
|
|
33
|
-
"ampless": "^1.0.0-alpha.
|
|
33
|
+
"ampless": "^1.0.0-alpha.10",
|
|
34
34
|
"aws-amplify": "^6.10.0",
|
|
35
35
|
"class-variance-authority": "^0.7.1",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
// Public-site proxy (Next.js 16 rename of "middleware"). Implementation
|
|
2
2
|
// moved to `@ampless/runtime` (L1 extraction); this file wires the
|
|
3
|
-
// project's `cms.config` into the factory and
|
|
4
|
-
// matcher. The runtime export name is still
|
|
5
|
-
// for API stability; only the user-side
|
|
6
|
-
// `export const proxy`) follows Next 16's
|
|
3
|
+
// project's `cms.config` + AppSync endpoint into the factory and
|
|
4
|
+
// re-exports the default matcher. The runtime export name is still
|
|
5
|
+
// `createAmplessMiddleware` for API stability; only the user-side
|
|
6
|
+
// file convention (proxy.ts + `export const proxy`) follows Next 16's
|
|
7
|
+
// rename.
|
|
7
8
|
//
|
|
8
|
-
// See `@ampless/runtime/middleware` for behaviour details:
|
|
9
|
-
//
|
|
10
|
-
//
|
|
9
|
+
// See `@ampless/runtime/middleware` for behaviour details: AppSync
|
|
10
|
+
// flag fetch + Lambda-memory LRU + `/r/<slug>(/<path>)` rewrite for
|
|
11
|
+
// no_layout HTML / static bundles + per-post Cache-Control.
|
|
11
12
|
|
|
12
13
|
import cmsConfig from './cms.config'
|
|
14
|
+
import outputs from './amplify_outputs.json'
|
|
13
15
|
import { createAmplessMiddleware } from '@ampless/runtime/middleware'
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
// `amplify_outputs.json` is generated by `npx ampx sandbox` /
|
|
18
|
+
// `npx ampx pipeline-deploy` — the public API key has a 365-day TTL
|
|
19
|
+
// and is rotated monthly by the api-key-renewer Lambda. See
|
|
20
|
+
// RUNBOOK.md §"API key rotation".
|
|
21
|
+
export const proxy = createAmplessMiddleware({
|
|
22
|
+
cmsConfig,
|
|
23
|
+
appsyncUrl: outputs.data.url,
|
|
24
|
+
// The public API key is always present in production deploys (the
|
|
25
|
+
// backend declares `apiKeyAuthorizationMode`). The non-null assertion
|
|
26
|
+
// is honest about the assumption; `ampx sandbox` will surface a clear
|
|
27
|
+
// error long before middleware ever runs if it ever isn't.
|
|
28
|
+
apiKey: outputs.data.api_key!,
|
|
29
|
+
})
|
|
16
30
|
|
|
17
31
|
// Next.js 16's Turbopack requires `config` to be a statically
|
|
18
32
|
// analysable object literal — referencing an imported variable
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|