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
package/dist/index.js CHANGED
@@ -1747,16 +1747,7 @@ var AMPLESS_MANAGED_APP_PATHS = [
1747
1747
  "app/login",
1748
1748
  "app/site"
1749
1749
  ];
1750
- var AMPLESS_RETIRED_PATHS = [
1751
- // Retired alongside the in-deploy multi-site drop.
1752
- "lib/admin-site.ts",
1753
- "lib/admin-site-client.ts",
1754
- // Split into app/raw/[slug]/route.ts + app/static/[slug]/[[...path]]/route.ts.
1755
- // The old unified internal handler at app/r/[slug]/[[...path]]/route.ts
1756
- // is no longer wired to anything (middleware rewrites to /raw or
1757
- // /static now).
1758
- "app/r/[slug]/[[...path]]/route.ts"
1759
- ];
1750
+ var AMPLESS_RETIRED_PATHS = [];
1760
1751
  var AMPLESS_PACKAGES = /* @__PURE__ */ new Set([
1761
1752
  "ampless",
1762
1753
  "@ampless/admin",
@@ -36,42 +36,31 @@
36
36
  - `.amplify/` — Amplify CLI の作業ディレクトリ。
37
37
  - `pnpm-lock.yaml` / `package-lock.json` — パッケージマネージャーに任せる。
38
38
 
39
- ## テーマのカスタマイズ(標準的な手順)
39
+ ## テーマのカスタマイズ
40
40
 
41
- 1. 公式テーマをコピーする:
42
- ```bash
43
- npm run copy-theme blog my-blog
44
- ```
45
- `my-` プレフィックスがついているコピーは `npm run update-ampless` で上書きされない。ターゲット名が `my-` で始まらない場合、コマンドは実行を拒否する。
41
+ テーマのカスタマイズ手順 — ベーステーマの選び方、`themes/my-*/`
42
+ へのコピーフロー、Claude Design からの反映、AI 支援の実装、
43
+ レスポンシブの目視確認、Markdown 要素のデザイン方針、よくある失敗
44
+ — は [THEMES.ja.md](./THEMES.ja.md) を参照する。
46
45
 
47
- 2. 以下の優先順位で編集する:
48
- - `themes/my-blog/tokens.css` — 色、タイポグラフィ、スペーシング(`[data-theme='my-blog']` スコープの CSS カスタムプロパティ)。
49
- - `themes/my-blog/manifest.ts` — 管理 UI(`/admin/sites/<id>/theme`)に公開するフィールドの宣言。
50
- - `themes/my-blog/pages/` — レイアウト / 構造(Next.js ページモジュール: フィード、サイトマップ、投稿テンプレート)。
46
+ ## MCP サーバー(HTTP トランスポート)
51
47
 
52
- 3. テーマを有効化する: `/admin/sites/<siteId>/theme` を開き、`my-blog` を選択する。テーマ切り替えはランタイム設定 再デプロイは不要。
53
-
54
- 4. 動作確認:
55
- ```bash
56
- npm run dev # http://localhost:3000
57
- ```
58
-
59
- ## MCP サーバー(`@ampless/mcp-server`)
60
-
61
- エージェントが投稿コンテンツを直接クエリ・編集できる。公開ツール: `list_posts`、`get_post`、`create_post`、`update_post`、`delete_post`、`upload_media`、`get_schema`。
48
+ エージェントが `mcp-handler` Lambda 経由で投稿コンテンツを直接クエリ・編集できる。公開ツール: `list_posts`、`get_post`、`create_post`、`update_post`、`delete_post`、`upload_media`、`get_schema`、`upload_static_bundle`、`list_static_files`、`delete_static_file`、`get_site_context`。
62
49
 
63
50
  登録方法:
64
51
 
65
- プロジェクトルートの `.mcp.json` に追加する:
52
+ 1. 管理画面の `/admin/mcp-tokens` で Bearer トークンを発行する。
53
+ 2. Amplify コンソールまたは `amplify_outputs.json` で `mcp-handler` の Function URL を確認する。
54
+ 3. プロジェクトルートの `.mcp.json` に追加する:
55
+
66
56
  ```json
67
57
  {
68
58
  "mcpServers": {
69
59
  "ampless": {
70
- "command": "npx",
71
- "args": ["-y", "@ampless/mcp-server", "--outputs", "./amplify_outputs.json"],
72
- "env": {
73
- "AMPLESS_MCP_EMAIL": "<your-admin-email>",
74
- "AMPLESS_MCP_PASSWORD": "<your-admin-password>"
60
+ "url": "https://<function-url-id>.lambda-url.<region>.on.aws/",
61
+ "transport": "http",
62
+ "headers": {
63
+ "Authorization": "Bearer amk_..."
75
64
  }
76
65
  }
77
66
  }
@@ -99,6 +88,7 @@ UI / テーマを変更した場合、型チェックだけを根拠にタスク
99
88
 
100
89
  ## 参照先
101
90
 
91
+ - `THEMES.ja.md` — テーマカスタマイズの実務ガイド(ベーステーマの選び方、Claude Design からの反映、AI への依頼、ブラウザ確認、Markdown 要素のスタイリング、よくある失敗)。
102
92
  - `README.ja.md` — サイト運営者向けの日常利用ガイド。
103
93
  - `RUNBOOK.ja.md` — 定期的な運用手順(キーローテーション、バックアップ復元など)。
104
94
  - `themes/<name>/README.ja.md` — テーマごとのカスタマイズ詳細。
@@ -36,42 +36,31 @@ This file is written for AI coding agents (Claude Code, Cursor, Codex, etc.). Fo
36
36
  - `.amplify/` — Amplify CLI working directory.
37
37
  - `pnpm-lock.yaml` / `package-lock.json` — let the package manager update these.
38
38
 
39
- ## Customising a theme (the standard flow)
39
+ ## Theme customization
40
40
 
41
- 1. Copy an official theme:
42
- ```bash
43
- npm run copy-theme blog my-blog
44
- ```
45
- The `my-` prefix marks the copy as user-owned so `npm run update-ampless` leaves it alone. The target name must start with `my-` or the command refuses to run.
41
+ For theme customization workflows — choosing a base theme, the
42
+ standard copy-and-edit flow, Claude Design handoff, AI-assisted
43
+ implementation, responsive visual QA, Markdown styling expectations,
44
+ and the common failure modes — see [THEMES.md](./THEMES.md).
46
45
 
47
- 2. Edit in this priority order:
48
- - `themes/my-blog/tokens.css` — colours, typography, spacing (CSS custom properties scoped under `[data-theme='my-blog']`).
49
- - `themes/my-blog/manifest.ts` — declare which fields are exposed in the admin UI (`/admin/sites/<id>/theme`).
50
- - `themes/my-blog/pages/` — layout / structure (Next.js page modules: feed, sitemap, post templates).
46
+ ## MCP server (HTTP transport)
51
47
 
52
- 3. Activate the theme: open `/admin/sites/<siteId>/theme` and select `my-blog`. Theme switching is a runtime setting no redeploy needed.
53
-
54
- 4. Verify:
55
- ```bash
56
- npm run dev # http://localhost:3000
57
- ```
58
-
59
- ## MCP server (`@ampless/mcp-server`)
60
-
61
- Lets agents query and modify post content directly. Tools exposed: `list_posts`, `get_post`, `create_post`, `update_post`, `delete_post`, `upload_media`, `get_schema`.
48
+ Lets agents query and modify post content directly via the `mcp-handler` Lambda. Tools exposed: `list_posts`, `get_post`, `create_post`, `update_post`, `delete_post`, `upload_media`, `get_schema`, `upload_static_bundle`, `list_static_files`, `delete_static_file`, `get_site_context`.
62
49
 
63
50
  Registration:
64
51
 
65
- Add to `.mcp.json` at the project root:
52
+ 1. Issue a Bearer token from `/admin/mcp-tokens` in the admin UI.
53
+ 2. Find the `mcp-handler` Function URL in the Amplify console or `amplify_outputs.json`.
54
+ 3. Add to `.mcp.json` at the project root:
55
+
66
56
  ```json
67
57
  {
68
58
  "mcpServers": {
69
59
  "ampless": {
70
- "command": "npx",
71
- "args": ["-y", "@ampless/mcp-server", "--outputs", "./amplify_outputs.json"],
72
- "env": {
73
- "AMPLESS_MCP_EMAIL": "<your-admin-email>",
74
- "AMPLESS_MCP_PASSWORD": "<your-admin-password>"
60
+ "url": "https://<function-url-id>.lambda-url.<region>.on.aws/",
61
+ "transport": "http",
62
+ "headers": {
63
+ "Authorization": "Bearer amk_..."
75
64
  }
76
65
  }
77
66
  }
@@ -99,6 +88,7 @@ Do not report a task complete based solely on type checks if a UI/theme was modi
99
88
 
100
89
  ## See also
101
90
 
91
+ - `THEMES.md` — theme customization workflows (base-theme selection, Claude Design handoff, AI prompts, browser QA, Markdown styling, common pitfalls).
102
92
  - `README.md` — day-to-day usage for site owners.
103
93
  - `RUNBOOK.md` — occasional ops procedures (key rotation, backup restore, etc.).
104
94
  - `themes/<name>/README.md` — per-theme customization details.
@@ -86,7 +86,13 @@ npm run sandbox
86
86
  npm run copy-theme
87
87
  ```
88
88
 
89
- 独自テーマを作る場合: 既存テーマをコピーから始める(`cp -R themes/blog themes/your-theme`)→ `manifest.ts`、`tokens.css`、`pages/*.tsx` を編集 → `themes-registry.ts` に追加。フルガイド: [docs/THEMES.ja.md](https://github.com/heavymoons/ampless/blob/main/docs/THEMES.ja.md) ([English](https://github.com/heavymoons/ampless/blob/main/docs/THEMES.md))
89
+ インストール済みテーマを `npm run update-ampless` で上書きされない形でカスタマイズしたい場合は、`my-` プレフィックス付きにコピーする:
90
+
91
+ ```bash
92
+ npm run copy-theme blog my-blog
93
+ ```
94
+
95
+ テーマカスタマイズの実務ガイド — ベーステーマの選び方、コピー / 編集 / 切り替えの標準フロー、Claude Design からの反映、AI を使った実装、レスポンシブ確認、Markdown 要素のスタイリング、よくある失敗 — はこのプロジェクト内の [THEMES.ja.md](./THEMES.ja.md)([English](./THEMES.md))に集約しています。
90
96
 
91
97
  ## プラグイン
92
98
 
@@ -184,9 +190,29 @@ Amplify Hosting アプリの **Domain management** からドメインをバイ
184
190
 
185
191
  ## AI 連携(MCP)
186
192
 
187
- ampless は MCP(Model Context Protocol)サーバーを同梱しているので、Claude Desktop / Cursor / Claude Code など MCP に対応した AI クライアントから投稿の読み書きができます。
193
+ ampless は HTTP トランスポート + Bearer トークン認証による MCP(Model Context Protocol)サーバーを同梱しているので、Claude Desktop / Cursor / Claude Code など MCP に対応した AI クライアントから投稿の読み書きができます。
194
+
195
+ **セットアップ手順:**
196
+
197
+ 1. 管理画面の `/admin/mcp-tokens` にアクセスし、Bearer トークン(`amk_...`)を発行する。
198
+ 2. Amplify コンソールまたは `amplify_outputs.json` で `mcp-handler` Lambda の Function URL を確認する。
199
+ 3. MCP クライアントの設定ファイル(プロジェクトルートの `.mcp.json`、`claude_desktop_config.json` など)にエントリを追加する:
200
+
201
+ ```json
202
+ {
203
+ "mcpServers": {
204
+ "ampless": {
205
+ "url": "https://<function-url-id>.lambda-url.<region>.on.aws/",
206
+ "transport": "http",
207
+ "headers": {
208
+ "Authorization": "Bearer amk_..."
209
+ }
210
+ }
211
+ }
212
+ }
213
+ ```
188
214
 
189
- - **ローカル / sandbox** — グローバルに 1 度入れる: `npx -y @ampless/mcp-server@alpha` に `amplify_outputs.json` のパスを渡す
215
+ MCP のセットアップとトークン管理の詳細については [docs/architecture/04-access-layer-mcp.md](./docs/architecture/04-access-layer-mcp.md) を参照してください。
190
216
 
191
217
  ## ampless の更新
192
218
 
@@ -86,7 +86,13 @@ To install another official theme into this project:
86
86
  npm run copy-theme
87
87
  ```
88
88
 
89
- To author your own theme: copy an existing one as a starting point (`cp -R themes/blog themes/your-theme`), edit `manifest.ts`, `tokens.css`, and `pages/*.tsx`, then add it to `themes-registry.ts`. Full guide: [docs/THEMES.md](https://github.com/heavymoons/ampless/blob/main/docs/THEMES.md) ([日本語](https://github.com/heavymoons/ampless/blob/main/docs/THEMES.ja.md)).
89
+ To customize an installed theme without losing the customization on `npm run update-ampless`, copy it under the `my-` prefix:
90
+
91
+ ```bash
92
+ npm run copy-theme blog my-blog
93
+ ```
94
+
95
+ The full working guide for theme customization — base-theme selection, the standard copy / edit / activate flow, Claude Design handoff, AI-assisted implementation, responsive QA, Markdown styling, and the common pitfalls — lives in [THEMES.md](./THEMES.md) (and [THEMES.ja.md](./THEMES.ja.md)) right in this project.
90
96
 
91
97
  ## Plugins
92
98
 
@@ -184,9 +190,29 @@ Bind a domain to your Amplify Hosting app in **Domain management** — Amplify p
184
190
 
185
191
  ## AI integration (MCP)
186
192
 
187
- ampless ships an MCP (Model Context Protocol) server so Claude Desktop / Cursor / Claude Code / anything that speaks MCP can read and write your posts.
193
+ ampless ships an MCP (Model Context Protocol) server so Claude Desktop / Cursor / Claude Code / anything that speaks MCP can read and write your posts via HTTP transport with Bearer token authentication.
194
+
195
+ **Setup:**
196
+
197
+ 1. Go to `/admin/mcp-tokens` in your admin UI and issue a Bearer token (`amk_...`).
198
+ 2. Find the `mcp-handler` Lambda Function URL in your Amplify console or `amplify_outputs.json`.
199
+ 3. Add an entry to your MCP client's config (`.mcp.json` at the project root, `claude_desktop_config.json`, etc.):
200
+
201
+ ```json
202
+ {
203
+ "mcpServers": {
204
+ "ampless": {
205
+ "url": "https://<function-url-id>.lambda-url.<region>.on.aws/",
206
+ "transport": "http",
207
+ "headers": {
208
+ "Authorization": "Bearer amk_..."
209
+ }
210
+ }
211
+ }
212
+ }
213
+ ```
188
214
 
189
- - **Local / sandbox** — install once globally: `npx -y @ampless/mcp-server@alpha` with the path to your `amplify_outputs.json`.
215
+ See [docs/architecture/04-access-layer-mcp.md](./docs/architecture/04-access-layer-mcp.md) for the full MCP setup and token management guide.
190
216
 
191
217
  ## Updating ampless
192
218