create-ampless 0.2.0-alpha.9 → 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/README.ja.md +77 -0
- package/README.md +4 -1
- package/dist/index.js +99 -47
- package/dist/templates/_shared/AGENTS.ja.md +104 -0
- package/dist/templates/_shared/AGENTS.md +104 -0
- package/dist/templates/_shared/README.ja.md +176 -0
- package/dist/templates/_shared/README.md +176 -0
- package/dist/templates/_shared/RUNBOOK.ja.md +120 -0
- package/dist/templates/_shared/RUNBOOK.md +24 -51
- package/dist/templates/_shared/amplify/auth/post-confirmation/resource.ts +6 -0
- package/dist/templates/_shared/amplify/backend.ts +2 -0
- package/dist/templates/_shared/amplify/data/get-published-post.js +9 -12
- package/dist/templates/_shared/amplify/data/list-posts-by-tag.js +6 -9
- package/dist/templates/_shared/amplify/data/list-published-posts.js +10 -11
- package/dist/templates/_shared/amplify/data/resource.custom.ts +1 -2
- package/dist/templates/_shared/amplify/data/resource.ts +22 -5
- package/dist/templates/_shared/amplify/events/processor-untrusted/resource.ts +4 -0
- package/dist/templates/_shared/amplify/functions/mcp-handler/handler.ts +1 -0
- package/dist/templates/_shared/amplify/functions/mcp-handler/resource.ts +11 -0
- package/dist/templates/_shared/amplify/functions/user-admin/resource.ts +6 -0
- package/dist/templates/_shared/app/(admin)/admin/mcp-tokens/page.tsx +5 -0
- package/dist/templates/_shared/app/globals.css +55 -39
- package/dist/templates/_shared/app/layout.tsx +24 -11
- package/dist/templates/_shared/app/r/[slug]/[[...path]]/route.ts +18 -0
- package/dist/templates/_shared/cms.config.ts +1 -23
- package/dist/templates/_shared/components/site-chrome/site-sidebar.tsx +2 -3
- package/dist/templates/_shared/lib/admin.ts +9 -7
- package/dist/templates/_shared/lib/posts-public.ts +1 -1
- package/dist/templates/_shared/package.json +11 -12
- package/dist/templates/_shared/proxy.ts +22 -8
- package/dist/templates/blog/README.ja.md +22 -0
- package/dist/templates/blog/README.md +17 -47
- package/dist/templates/blog/manifest.ts +1 -1
- package/dist/templates/blog/pages/feed.ts +3 -4
- package/dist/templates/blog/pages/home.tsx +5 -8
- package/dist/templates/blog/pages/post.tsx +7 -7
- package/dist/templates/blog/pages/sitemap.ts +3 -4
- package/dist/templates/blog/pages/tag.tsx +4 -4
- package/dist/templates/blog/tokens.css +26 -40
- package/dist/templates/corporate/README.ja.md +18 -0
- package/dist/templates/corporate/README.md +12 -14
- package/dist/templates/corporate/pages/feed.ts +2 -3
- package/dist/templates/corporate/pages/home.tsx +5 -8
- package/dist/templates/corporate/pages/post.tsx +7 -7
- package/dist/templates/corporate/pages/sitemap.ts +2 -3
- package/dist/templates/corporate/pages/tag.tsx +4 -4
- package/dist/templates/corporate/tokens.css +17 -39
- package/dist/templates/dads/README.ja.md +31 -0
- package/dist/templates/dads/README.md +13 -17
- package/dist/templates/dads/pages/feed.ts +2 -3
- package/dist/templates/dads/pages/home.tsx +5 -8
- package/dist/templates/dads/pages/post.tsx +7 -7
- package/dist/templates/dads/pages/sitemap.ts +2 -3
- package/dist/templates/dads/pages/tag.tsx +4 -4
- package/dist/templates/dads/tokens.css +22 -42
- package/dist/templates/docs/README.ja.md +24 -0
- package/dist/templates/docs/README.md +10 -13
- package/dist/templates/docs/pages/feed.ts +2 -3
- package/dist/templates/docs/pages/home.tsx +5 -6
- package/dist/templates/docs/pages/post.tsx +8 -8
- package/dist/templates/docs/pages/sitemap.ts +2 -3
- package/dist/templates/docs/pages/tag.tsx +5 -5
- package/dist/templates/docs/tokens.css +17 -39
- package/dist/templates/landing/README.ja.md +20 -0
- package/dist/templates/landing/README.md +14 -19
- package/dist/templates/landing/pages/feed.ts +3 -4
- package/dist/templates/landing/pages/home.tsx +5 -8
- package/dist/templates/landing/pages/post.tsx +7 -7
- package/dist/templates/landing/pages/sitemap.ts +2 -3
- package/dist/templates/landing/pages/tag.tsx +4 -4
- package/dist/templates/landing/tokens.css +17 -39
- package/dist/templates/minimal/README.ja.md +14 -0
- package/dist/templates/minimal/README.md +9 -47
- package/dist/templates/minimal/pages/feed.ts +3 -4
- package/dist/templates/minimal/pages/home.tsx +3 -4
- package/dist/templates/minimal/pages/post.tsx +6 -6
- package/dist/templates/minimal/pages/sitemap.ts +3 -4
- package/dist/templates/minimal/pages/tag.tsx +3 -3
- package/dist/templates/minimal/tokens.css +17 -39
- package/package.json +1 -1
- package/dist/templates/_shared/app/(admin)/admin/sites/page.tsx +0 -5
- package/dist/templates/_shared/app/site/[siteId]/raw/[slug]/route.ts +0 -5
- package/dist/templates/_shared/lib/admin-site-client.ts +0 -10
- package/dist/templates/_shared/lib/admin-site.ts +0 -12
- /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
|
@@ -1,52 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
> 日本語版: [README.ja.md](./README.ja.md)
|
|
2
|
+
>
|
|
3
|
+
# Minimal theme
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Soft blue accent on a warm-neutral background, derived from shadcn/ui's color tokens. Stripped-down blog layout with very few customization knobs — pick this when you want the design to disappear.
|
|
4
6
|
|
|
5
|
-
##
|
|
7
|
+
## Customizing
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
In `/admin/sites/<siteId>/theme`:
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
npm install
|
|
11
|
+
- **Primary color**
|
|
12
|
+
- **Corner radius**
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
# Requires AWS credentials configured (`aws configure`).
|
|
15
|
-
# First run takes ~5–10 min to provision resources.
|
|
16
|
-
# Generates amplify_outputs.json when ready.
|
|
17
|
-
npx ampx sandbox
|
|
18
|
-
|
|
19
|
-
# 3. Start the Next.js dev server (terminal 2)
|
|
20
|
-
npm run dev
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Then open [http://localhost:3000](http://localhost:3000).
|
|
24
|
-
|
|
25
|
-
## First admin user
|
|
26
|
-
|
|
27
|
-
Open [http://localhost:3000/login](http://localhost:3000/login) and click **Create admin account**. The first user to register is automatically added to the `ampless-admin` Cognito group.
|
|
28
|
-
|
|
29
|
-
After that, manage content from `/admin`:
|
|
30
|
-
|
|
31
|
-
- `/admin` — dashboard
|
|
32
|
-
- `/admin/posts` — list / create / edit posts (tiptap editor)
|
|
33
|
-
- `/admin/media` — upload images to S3
|
|
34
|
-
|
|
35
|
-
## Production deploy
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
git init && git add . && git commit -m "init"
|
|
39
|
-
git remote add origin <your-repo>
|
|
40
|
-
git push
|
|
41
|
-
# Then connect the repo to AWS Amplify Hosting in the AWS console.
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Customize
|
|
45
|
-
|
|
46
|
-
- `cms.config.ts` — site name, media delivery mode, plugins
|
|
47
|
-
- `app/` — Next.js App Router pages (`(public)/` for the blog, `(admin)/` for the CMS)
|
|
48
|
-
- `amplify/` — Amplify Gen 2 backend definitions (auth / data / storage)
|
|
49
|
-
|
|
50
|
-
## Plugins
|
|
51
|
-
|
|
52
|
-
Enabled: {{plugins}}
|
|
14
|
+
That's it. For richer customization (fonts, multiple accent colors, footer / nav controls), use the `blog` theme.
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { publicAssetUrl } from '@/lib/storage'
|
|
2
2
|
|
|
3
3
|
interface Ctx {
|
|
4
|
-
siteId: string
|
|
5
4
|
request: Request
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
// /feed.xml proxy — plugin-rss regenerates the feed on content events
|
|
9
|
-
// and writes it to `public/plugins/rss/
|
|
10
|
-
export async function minimalFeedHandler(
|
|
11
|
-
const url = publicAssetUrl(
|
|
8
|
+
// and writes it to `public/plugins/rss/feed.xml`.
|
|
9
|
+
export async function minimalFeedHandler(_ctx: Ctx): Promise<Response> {
|
|
10
|
+
const url = publicAssetUrl('public/plugins/rss/feed.xml')
|
|
12
11
|
const upstream = await fetch(url, { cache: 'no-store' })
|
|
13
12
|
if (!upstream.ok) {
|
|
14
13
|
return new Response(
|
|
@@ -5,10 +5,9 @@ import { loadSiteSettings } from '@/lib/site-settings'
|
|
|
5
5
|
import { TagList } from '@/components/tag-list'
|
|
6
6
|
import { t } from '@/lib/i18n'
|
|
7
7
|
|
|
8
|
-
export default async function MinimalHome(
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const { items: posts } = await listPublishedPosts({ siteId })
|
|
8
|
+
export default async function MinimalHome(_: ThemeRouteContext) {
|
|
9
|
+
const settings = await loadSiteSettings()
|
|
10
|
+
const { items: posts } = await listPublishedPosts()
|
|
12
11
|
|
|
13
12
|
return (
|
|
14
13
|
<main className="mx-auto max-w-2xl px-6 py-12">
|
|
@@ -13,17 +13,17 @@ import { t } from '@/lib/i18n'
|
|
|
13
13
|
type PostCtx = ThemeRouteContext<{ slug: string }>
|
|
14
14
|
|
|
15
15
|
export async function generatePostMetadata({ params }: PostCtx): Promise<Metadata> {
|
|
16
|
-
const {
|
|
17
|
-
const post = await getPublishedPost(slug
|
|
16
|
+
const { slug } = await params
|
|
17
|
+
const post = await getPublishedPost(slug)
|
|
18
18
|
if (!post) return {}
|
|
19
|
-
return postMetadata(post
|
|
19
|
+
return postMetadata(post)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export default async function MinimalPost({ params }: PostCtx) {
|
|
23
|
-
const {
|
|
23
|
+
const { slug } = await params
|
|
24
24
|
const [post, settings] = await Promise.all([
|
|
25
|
-
getPublishedPost(slug
|
|
26
|
-
loadSiteSettings(
|
|
25
|
+
getPublishedPost(slug),
|
|
26
|
+
loadSiteSettings(),
|
|
27
27
|
])
|
|
28
28
|
if (!post) notFound()
|
|
29
29
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { publicAssetUrl } from '@/lib/storage'
|
|
2
2
|
|
|
3
3
|
interface Ctx {
|
|
4
|
-
siteId: string
|
|
5
4
|
request: Request
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
// /sitemap.xml proxy — plugin-seo regenerates the sitemap on every
|
|
9
|
-
// content event and writes it to `public/plugins/seo/
|
|
10
|
-
export async function minimalSitemapHandler(
|
|
11
|
-
const url = publicAssetUrl(
|
|
8
|
+
// content event and writes it to `public/plugins/seo/sitemap.xml`.
|
|
9
|
+
export async function minimalSitemapHandler(_ctx: Ctx): Promise<Response> {
|
|
10
|
+
const url = publicAssetUrl('public/plugins/seo/sitemap.xml')
|
|
12
11
|
const upstream = await fetch(url, { cache: 'no-store' })
|
|
13
12
|
if (!upstream.ok) {
|
|
14
13
|
return new Response(
|
|
@@ -6,11 +6,11 @@ import { loadSiteSettings } from '@/lib/site-settings'
|
|
|
6
6
|
import { t } from '@/lib/i18n'
|
|
7
7
|
|
|
8
8
|
export default async function MinimalTag({ params }: ThemeRouteContext<{ tag: string }>) {
|
|
9
|
-
const {
|
|
9
|
+
const { tag } = await params
|
|
10
10
|
const decodedTag = decodeURIComponent(tag)
|
|
11
11
|
const [{ items: posts }, settings] = await Promise.all([
|
|
12
|
-
listPostsByTag(decodedTag, {
|
|
13
|
-
loadSiteSettings(
|
|
12
|
+
listPostsByTag(decodedTag, { limit: 50 }),
|
|
13
|
+
loadSiteSettings(),
|
|
14
14
|
])
|
|
15
15
|
|
|
16
16
|
if (posts.length === 0) notFound()
|
|
@@ -2,45 +2,23 @@
|
|
|
2
2
|
* pattern as templates/blog/tokens.css; see that file for context. */
|
|
3
3
|
|
|
4
4
|
[data-theme='minimal'] {
|
|
5
|
-
--background: oklch(0.99 0.005 90);
|
|
6
|
-
--foreground: oklch(0.18 0.02 250);
|
|
7
|
-
--card: oklch(1 0 0);
|
|
8
|
-
--card-foreground: oklch(0.18 0.02 250);
|
|
9
|
-
--primary: oklch(0.55 0.18 250);
|
|
10
|
-
--primary-foreground: oklch(0.985 0 0);
|
|
11
|
-
--secondary: oklch(0.95 0.01 250);
|
|
12
|
-
--secondary-foreground: oklch(0.25 0.05 250);
|
|
13
|
-
--muted: oklch(0.95 0.01 250);
|
|
14
|
-
--muted-foreground: oklch(0.5 0.02 250);
|
|
15
|
-
--accent: oklch(0.95 0.03 250);
|
|
16
|
-
--accent-foreground: oklch(0.3 0.08 250);
|
|
17
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
18
|
-
--destructive-foreground: oklch(0.985 0 0);
|
|
19
|
-
--border: oklch(0.9 0.01 250);
|
|
20
|
-
--input: oklch(0.9 0.01 250);
|
|
21
|
-
--ring: oklch(0.55 0.18 250);
|
|
5
|
+
--background: light-dark(oklch(0.99 0.005 90), oklch(0.18 0.02 250));
|
|
6
|
+
--foreground: light-dark(oklch(0.18 0.02 250), oklch(0.95 0.01 250));
|
|
7
|
+
--card: light-dark(oklch(1 0 0), oklch(0.22 0.02 250));
|
|
8
|
+
--card-foreground: light-dark(oklch(0.18 0.02 250), oklch(0.95 0.01 250));
|
|
9
|
+
--primary: light-dark(oklch(0.55 0.18 250), oklch(0.75 0.18 250));
|
|
10
|
+
--primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.18 0.02 250));
|
|
11
|
+
--secondary: light-dark(oklch(0.95 0.01 250), oklch(0.28 0.03 250));
|
|
12
|
+
--secondary-foreground: light-dark(oklch(0.25 0.05 250), oklch(0.95 0.01 250));
|
|
13
|
+
--muted: light-dark(oklch(0.95 0.01 250), oklch(0.28 0.03 250));
|
|
14
|
+
--muted-foreground: light-dark(oklch(0.5 0.02 250), oklch(0.7 0.02 250));
|
|
15
|
+
--accent: light-dark(oklch(0.95 0.03 250), oklch(0.32 0.05 250));
|
|
16
|
+
--accent-foreground: light-dark(oklch(0.3 0.08 250), oklch(0.95 0.01 250));
|
|
17
|
+
--destructive: light-dark(oklch(0.577 0.245 27.325), oklch(0.5 0.2 27));
|
|
18
|
+
--destructive-foreground: light-dark(oklch(0.985 0 0), oklch(0.985 0 0));
|
|
19
|
+
--border: light-dark(oklch(0.9 0.01 250), oklch(0.32 0.03 250));
|
|
20
|
+
--input: light-dark(oklch(0.9 0.01 250), oklch(0.32 0.03 250));
|
|
21
|
+
--ring: light-dark(oklch(0.55 0.18 250), oklch(0.55 0.18 250));
|
|
22
22
|
--radius: 0.375rem;
|
|
23
23
|
--ampless-body-font: system-ui, -apple-system, sans-serif;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
@media (prefers-color-scheme: dark) {
|
|
27
|
-
[data-theme='minimal'] {
|
|
28
|
-
--background: oklch(0.18 0.02 250);
|
|
29
|
-
--foreground: oklch(0.95 0.01 250);
|
|
30
|
-
--card: oklch(0.22 0.02 250);
|
|
31
|
-
--card-foreground: oklch(0.95 0.01 250);
|
|
32
|
-
--primary: oklch(0.75 0.18 250);
|
|
33
|
-
--primary-foreground: oklch(0.18 0.02 250);
|
|
34
|
-
--secondary: oklch(0.28 0.03 250);
|
|
35
|
-
--secondary-foreground: oklch(0.95 0.01 250);
|
|
36
|
-
--muted: oklch(0.28 0.03 250);
|
|
37
|
-
--muted-foreground: oklch(0.7 0.02 250);
|
|
38
|
-
--accent: oklch(0.32 0.05 250);
|
|
39
|
-
--accent-foreground: oklch(0.95 0.01 250);
|
|
40
|
-
--destructive: oklch(0.5 0.2 27);
|
|
41
|
-
--destructive-foreground: oklch(0.985 0 0);
|
|
42
|
-
--border: oklch(0.32 0.03 250);
|
|
43
|
-
--input: oklch(0.32 0.03 250);
|
|
44
|
-
--ring: oklch(0.55 0.18 250);
|
|
45
|
-
}
|
|
46
|
-
}
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Back-compat shim. Client-side admin-site helpers moved to
|
|
2
|
-
// `@ampless/admin` (L2 extraction). Existing call sites
|
|
3
|
-
// (`readAdminSiteIdFromCookie`, the `ADMIN_SITE_COOKIE` constant) keep
|
|
4
|
-
// working through this shim — the cms.config registration is performed
|
|
5
|
-
// inside the admin's <AdminProviders> bootstrap.
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
ADMIN_SITE_COOKIE,
|
|
9
|
-
readAdminSiteIdFromCookie,
|
|
10
|
-
} from '@ampless/admin/components'
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Back-compat shim. Server-side admin-site helpers moved to
|
|
2
|
-
// `@ampless/admin` (L2 extraction). New code should call the same
|
|
3
|
-
// methods on the `admin` instance directly.
|
|
4
|
-
|
|
5
|
-
import { admin } from './admin'
|
|
6
|
-
|
|
7
|
-
// Arrow wrappers: defer `admin` resolution to call time (avoid TDZ in
|
|
8
|
-
// case of circular import chains touching admin shims).
|
|
9
|
-
export const currentAdminSiteId: typeof admin.currentAdminSiteId =
|
|
10
|
-
(...args) => admin.currentAdminSiteId(...args)
|
|
11
|
-
export const adminSiteOptions: typeof admin.adminSiteOptions =
|
|
12
|
-
(...args) => admin.adminSiteOptions(...args)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|