create-ampless 0.2.0-alpha.3 → 0.2.0-alpha.30

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 (47) hide show
  1. package/README.ja.md +77 -0
  2. package/README.md +40 -1
  3. package/dist/index.js +2171 -47
  4. package/dist/templates/_shared/AGENTS.ja.md +104 -0
  5. package/dist/templates/_shared/AGENTS.md +104 -0
  6. package/dist/templates/_shared/README.ja.md +181 -0
  7. package/dist/templates/_shared/README.md +181 -0
  8. package/dist/templates/_shared/RUNBOOK.ja.md +150 -0
  9. package/dist/templates/_shared/RUNBOOK.md +19 -1
  10. package/dist/templates/_shared/amplify/auth/post-confirmation/resource.ts +6 -0
  11. package/dist/templates/_shared/amplify/backend.custom.ts +41 -0
  12. package/dist/templates/_shared/amplify/backend.ts +12 -2
  13. package/dist/templates/_shared/amplify/data/resource.custom.ts +33 -0
  14. package/dist/templates/_shared/amplify/data/resource.ts +43 -18
  15. package/dist/templates/_shared/amplify/events/processor-untrusted/resource.ts +4 -0
  16. package/dist/templates/_shared/amplify/functions/mcp-handler/handler.ts +1 -0
  17. package/dist/templates/_shared/amplify/functions/mcp-handler/resource.ts +11 -0
  18. package/dist/templates/_shared/amplify/functions/user-admin/handler.ts +4 -0
  19. package/dist/templates/_shared/amplify/functions/user-admin/resource.ts +12 -0
  20. package/dist/templates/_shared/amplify.yml +18 -0
  21. package/dist/templates/_shared/app/(admin)/admin/mcp-tokens/page.tsx +5 -0
  22. package/dist/templates/_shared/app/(admin)/admin/users/page.tsx +5 -0
  23. package/dist/templates/_shared/app/globals.css +55 -39
  24. package/dist/templates/_shared/app/layout.tsx +22 -1
  25. package/dist/templates/_shared/app/site/[siteId]/[...path]/route.ts +17 -0
  26. package/dist/templates/_shared/lib/admin.ts +9 -7
  27. package/dist/templates/_shared/lib/amplify.ts +17 -6
  28. package/dist/templates/_shared/package.json +11 -9
  29. package/dist/templates/blog/README.ja.md +22 -0
  30. package/dist/templates/blog/README.md +17 -47
  31. package/dist/templates/blog/tokens.css +26 -40
  32. package/dist/templates/corporate/README.ja.md +18 -0
  33. package/dist/templates/corporate/README.md +12 -14
  34. package/dist/templates/corporate/tokens.css +17 -39
  35. package/dist/templates/dads/README.ja.md +31 -0
  36. package/dist/templates/dads/README.md +13 -17
  37. package/dist/templates/dads/tokens.css +22 -42
  38. package/dist/templates/docs/README.ja.md +24 -0
  39. package/dist/templates/docs/README.md +10 -13
  40. package/dist/templates/docs/tokens.css +17 -39
  41. package/dist/templates/landing/README.ja.md +20 -0
  42. package/dist/templates/landing/README.md +14 -19
  43. package/dist/templates/landing/tokens.css +17 -39
  44. package/dist/templates/minimal/README.ja.md +14 -0
  45. package/dist/templates/minimal/README.md +9 -47
  46. package/dist/templates/minimal/tokens.css +17 -39
  47. package/package.json +2 -1
package/README.ja.md ADDED
@@ -0,0 +1,77 @@
1
+ > English: [README.md](./README.md)
2
+ >
3
+
4
+ # create-ampless
5
+
6
+ [ampless](https://github.com/heavymoons/ampless) プロジェクト向け CLI スキャフォールディングツール。
7
+
8
+ > **プレリリース / アルファ版。** v1.0 まではマイナーバージョンでも破壊的変更が入る可能性があります。`@alpha` タグを使用してください(`@latest` タグは v1.0 まで存在しません)。
9
+
10
+ ```bash
11
+ npx create-ampless@alpha
12
+ ```
13
+
14
+ ウィザードが以下を順に案内します:
15
+
16
+ 1. プロジェクト名
17
+ 2. サイト名(デフォルトの `<title>` および OGP `siteName` として使用)
18
+ 3. テーマ — v0.1 では `blog`
19
+ 4. プラグイン — `seo`、`rss`、`webhook`
20
+
21
+ 出力は AWS Amplify Gen 2 バックエンド定義を含む Next.js 16(App Router)プロジェクトです。`/admin` に管理パネル、`/` にパブリックブログが設置され、選択したプラグインが `cms.config.ts` にあらかじめ設定されます。また運用メモ用の `RUNBOOK.md` も生成されます。
22
+
23
+ ## 生成されたプロジェクトでの次のステップ
24
+
25
+ ```bash
26
+ cd my-project
27
+ npm install
28
+ npx ampx sandbox # AWS 開発リソースをプロビジョニングし amplify_outputs.json を生成
29
+ npm run dev # http://localhost:3000
30
+ ```
31
+
32
+ `/login` でサインアップすると、最初に登録したユーザーが自動的に `ampless-admin` Cognito グループに昇格します。
33
+
34
+ ## ワンショットデプロイ:`--deploy`
35
+
36
+ ウィザードは `npx` から Amplify Hosting の URL まで一気に進めることもできます:
37
+
38
+ ```bash
39
+ npx create-ampless@alpha my-site --deploy
40
+ ```
41
+
42
+ このフラグを追加すると、スキャフォールディング後に以下が実行されます:
43
+
44
+ 1. `git init` + 初回コミット
45
+ 2. GitHub リポジトリを作成(`gh repo create`)してプッシュ
46
+ 3. 新しいリポジトリに紐付けた `aws amplify create-app`
47
+ 4. `aws amplify create-branch main`
48
+ 5. `aws amplify start-job --job-type RELEASE`
49
+ 6. `--domain` を指定した場合はオプションで `aws amplify create-domain-association`
50
+
51
+ コマンドラインに指定が不足している場合はインタラクティブに確認します。CI 向けのフル指定の例:
52
+
53
+ ```bash
54
+ npx create-ampless@alpha my-site --deploy \
55
+ --github-owner my-org \
56
+ --github-private \
57
+ --aws-region us-east-1 \
58
+ --domain example.com --subdomain blog \
59
+ --skip-confirm
60
+ ```
61
+
62
+ apex ドメインが同じ AWS アカウントの Route 53 でホストされている場合、ACM の検証が完了すると Amplify が DNS レコードを自動作成します。それ以外の場合、CLI がレジストラで追加すべき正確な CNAME を表示します。
63
+
64
+ ### デプロイの要件
65
+
66
+ - [`gh`](https://cli.github.com/) のインストールと認証(`gh auth login`)
67
+ - [`aws`](https://aws.amazon.com/cli/) のインストールと設定(`aws configure`)
68
+ - `repo` スコープを持つ GitHub トークン(`--github-token` → `GITHUB_TOKEN` 環境変数 → `gh auth token` → インタラクティブプロンプトの順で解決)
69
+
70
+ ## 動作要件
71
+
72
+ - Node.js >= 20
73
+ - AWS アカウントと `aws configure` の設定済み(サンドボックス / パイプラインデプロイは AWS に直接アクセスします)
74
+
75
+ ## ライセンス
76
+
77
+ [MIT](../../LICENSE)
package/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ > 日本語版: [README.ja.md](./README.ja.md)
2
+ >
3
+
1
4
  # create-ampless
2
5
 
3
6
  CLI scaffolding tool for [ampless](https://github.com/heavymoons/ampless) projects.
@@ -15,7 +18,7 @@ The wizard walks you through:
15
18
  3. Theme — `blog` for v0.1
16
19
  4. Plugins — `seo`, `rss`, `webhook`
17
20
 
18
- Output is a Next.js 15 (App Router) project with the AWS Amplify Gen 2 backend definitions, an admin panel at `/admin`, public blog at `/`, the chosen plugins pre-wired in `cms.config.ts`, and a `RUNBOOK.md` for operations notes.
21
+ Output is a Next.js 16 (App Router) project with the AWS Amplify Gen 2 backend definitions, an admin panel at `/admin`, public blog at `/`, the chosen plugins pre-wired in `cms.config.ts`, and a `RUNBOOK.md` for operations notes.
19
22
 
20
23
  ## Next steps inside the generated project
21
24
 
@@ -28,6 +31,42 @@ npm run dev # http://localhost:3000
28
31
 
29
32
  Sign up at `/login` — the first registered user is automatically promoted to the `ampless-admin` Cognito group.
30
33
 
34
+ ## One-shot deploy: `--deploy`
35
+
36
+ The wizard can also take you all the way from `npx` to a live Amplify Hosting URL:
37
+
38
+ ```bash
39
+ npx create-ampless@alpha my-site --deploy
40
+ ```
41
+
42
+ That extra flag, after scaffolding, runs:
43
+
44
+ 1. `git init` + initial commit
45
+ 2. Create a GitHub repo (`gh repo create`) and push
46
+ 3. `aws amplify create-app` linked to the new repo
47
+ 4. `aws amplify create-branch main`
48
+ 5. `aws amplify start-job --job-type RELEASE`
49
+ 6. Optional `aws amplify create-domain-association` if you pass `--domain`
50
+
51
+ Anything missing on the command line gets asked interactively. For CI-friendly fully-flagged usage:
52
+
53
+ ```bash
54
+ npx create-ampless@alpha my-site --deploy \
55
+ --github-owner my-org \
56
+ --github-private \
57
+ --aws-region us-east-1 \
58
+ --domain example.com --subdomain blog \
59
+ --skip-confirm
60
+ ```
61
+
62
+ If the apex domain is hosted in Route 53 in the same AWS account, Amplify will auto-create the DNS records once ACM validates. Otherwise the CLI prints the exact CNAMEs to add at your registrar.
63
+
64
+ ### Deploy requirements
65
+
66
+ - [`gh`](https://cli.github.com/) installed and authenticated (`gh auth login`)
67
+ - [`aws`](https://aws.amazon.com/cli/) installed and configured (`aws configure`)
68
+ - A GitHub token with `repo` scope (resolved via `--github-token` → `GITHUB_TOKEN` env → `gh auth token` → interactive prompt)
69
+
31
70
  ## Requirements
32
71
 
33
72
  - Node.js >= 20