create-ampless 1.0.0-alpha.99 → 1.0.0-beta.149

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 (34) hide show
  1. package/README.ja.md +4 -4
  2. package/README.md +4 -4
  3. package/dist/index.js +198 -29
  4. package/dist/templates/_shared/README.ja.md +4 -4
  5. package/dist/templates/_shared/README.md +4 -4
  6. package/dist/templates/_shared/amplify/backend.ts +1 -1
  7. package/dist/templates/_shared/amplify/data/get-published-post.js +13 -1
  8. package/dist/templates/_shared/amplify/data/list-posts-by-tag.js +15 -3
  9. package/dist/templates/_shared/amplify/data/list-published-posts.js +26 -15
  10. package/dist/templates/_shared/amplify/events/dispatcher/handler.ts +11 -1
  11. package/dist/templates/_shared/amplify/secrets/encryption-key.ts +2 -2
  12. package/dist/templates/_shared/app/(admin)/admin/_editor-bootstrap.tsx +13 -0
  13. package/dist/templates/_shared/app/(admin)/admin/layout.tsx +2 -1
  14. package/dist/templates/_shared/app/(admin)/admin/preview/route.tsx +4 -0
  15. package/dist/templates/_shared/cms.config.ts +3 -0
  16. package/dist/templates/_shared/docs/plugin-author-guide.ja.md +841 -31
  17. package/dist/templates/_shared/docs/plugin-author-guide.md +1147 -80
  18. package/dist/templates/_shared/package.json +17 -16
  19. package/dist/templates/_shared/plugins/README.ja.md +1 -1
  20. package/dist/templates/_shared/plugins/README.md +1 -1
  21. package/dist/templates/blog/pages/home.tsx +5 -5
  22. package/dist/templates/blog/pages/post.tsx +5 -3
  23. package/dist/templates/corporate/pages/home.tsx +5 -5
  24. package/dist/templates/corporate/pages/post.tsx +5 -3
  25. package/dist/templates/dads/pages/home.tsx +5 -5
  26. package/dist/templates/dads/pages/post.tsx +5 -3
  27. package/dist/templates/docs/pages/post.tsx +5 -3
  28. package/dist/templates/landing/pages/home.tsx +5 -5
  29. package/dist/templates/landing/pages/post.tsx +5 -3
  30. package/dist/templates/minimal/pages/post.tsx +5 -3
  31. package/dist/templates/plugin-local/README.md +1 -1
  32. package/dist/templates/plugin-standalone/README.ja.md +3 -3
  33. package/dist/templates/plugin-standalone/README.md +3 -3
  34. package/package.json +1 -1
@@ -12,34 +12,35 @@
12
12
  "start": "next start",
13
13
  "lint": "next lint",
14
14
  "sandbox": "ampx sandbox --once && next dev",
15
- "update-ampless": "npx create-ampless@latest upgrade",
16
- "copy-theme": "npx create-ampless@latest copy-theme"
15
+ "update-ampless": "npx create-ampless@beta upgrade",
16
+ "copy-theme": "npx create-ampless@beta copy-theme"
17
17
  },
18
18
  "dependencies": {
19
19
  "@aws-amplify/adapter-nextjs": "^1.7.3",
20
20
  "@radix-ui/react-dialog": "^1.1.15",
21
21
  "@radix-ui/react-label": "^2.1.8",
22
22
  "@radix-ui/react-slot": "^1.2.4",
23
+ "@tiptap/core": "^3.23.6",
23
24
  "@tiptap/extension-image": "^3.23.6",
24
25
  "@tiptap/extension-link": "^3.23.6",
25
26
  "@tiptap/pm": "^3.23.6",
26
27
  "@tiptap/react": "^3.23.6",
27
28
  "@tiptap/starter-kit": "^3.23.6",
28
- "@ampless/plugin-analytics-ga4": "^0.2.0-alpha.14",
29
- "@ampless/plugin-cookie-consent": "^0.1.0-alpha.5",
30
- "@ampless/plugin-gtm": "^0.2.0-alpha.13",
31
- "@ampless/plugin-og-image": "^0.2.0-alpha.30",
32
- "@ampless/plugin-plausible": "^0.2.0-alpha.13",
33
- "@ampless/plugin-reading-time": "^0.1.0-alpha.3",
34
- "@ampless/plugin-rss": "^0.2.0-alpha.30",
35
- "@ampless/plugin-schema-jsonld": "^0.1.1-alpha.9",
36
- "@ampless/plugin-seo": "^0.2.0-alpha.30",
37
- "@ampless/plugin-webhook": "^0.2.0-alpha.31",
38
- "@ampless/admin": "^1.0.0-alpha.59",
39
- "@ampless/backend": "^1.0.0-alpha.48",
40
- "@ampless/runtime": "^1.0.0-alpha.38",
29
+ "@ampless/plugin-analytics-ga4": "^0.2.0-beta.35",
30
+ "@ampless/plugin-cookie-consent": "^0.1.0-beta.26",
31
+ "@ampless/plugin-gtm": "^0.2.0-beta.34",
32
+ "@ampless/plugin-og-image": "^0.2.0-beta.51",
33
+ "@ampless/plugin-plausible": "^0.2.0-beta.34",
34
+ "@ampless/plugin-reading-time": "^0.1.0-beta.24",
35
+ "@ampless/plugin-rss": "^0.2.0-beta.51",
36
+ "@ampless/plugin-schema-jsonld": "^0.1.1-beta.30",
37
+ "@ampless/plugin-seo": "^0.2.0-beta.51",
38
+ "@ampless/plugin-webhook": "^0.2.0-beta.52",
39
+ "@ampless/admin": "^1.0.0-beta.87",
40
+ "@ampless/backend": "^1.0.0-beta.73",
41
+ "@ampless/runtime": "^1.0.0-beta.60",
41
42
  "@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
42
- "ampless": "^1.0.0-alpha.30",
43
+ "ampless": "^1.0.0-beta.51",
43
44
  "aws-amplify": "^6.17.0",
44
45
  "class-variance-authority": "^0.7.1",
45
46
  "clsx": "^2.1.1",
@@ -29,7 +29,7 @@
29
29
  - 別パッケージとして version 上げて publish するのは大袈裟
30
30
 
31
31
  複数サイトで使いたくなったら、独立 npm パッケージに切り出す:
32
- `npx create-ampless@latest plugin <name> --standalone` で publish 用の
32
+ `npx create-ampless@beta plugin <name> --standalone` で publish 用の
33
33
  ディレクトリ一式が scaffold される。
34
34
 
35
35
  ## クライアントサイドスクリプトに関する注意
@@ -31,7 +31,7 @@ that:
31
31
  - you'd rather not version-bump or republish to iterate on
32
32
 
33
33
  When the plugin grows useful for more than one site, lift it into its
34
- own npm package — `npx create-ampless@latest plugin <name> --standalone`
34
+ own npm package — `npx create-ampless@beta plugin <name> --standalone`
35
35
  scaffolds the directory ready for `npm publish`.
36
36
 
37
37
  ## A note on client-side scripts
@@ -1,6 +1,5 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, parseLinkList, type ThemeRouteContext } from 'ampless'
3
- import { renderBody } from '@ampless/runtime'
4
3
  import { ampless } from '@/lib/ampless'
5
4
  import { admin } from '@/lib/admin'
6
5
  import { TagList } from '@/components/tag-list'
@@ -59,13 +58,14 @@ export default async function BlogHome(_: ThemeRouteContext) {
59
58
  </time>
60
59
  )}
61
60
  </Link>
62
- <div
63
- className="prose prose-neutral dark:prose-invert mt-4 max-w-none"
64
- dangerouslySetInnerHTML={{ __html: renderBody(featured) }}
65
- />
61
+ <div className="prose prose-neutral dark:prose-invert mt-4 max-w-none">
62
+ {await ampless.renderBody(featured)}
63
+ </div>
66
64
  </article>
67
65
  )}
68
66
 
67
+ {featured && (await ampless.publicPostScriptsForPage([featured]))}
68
+
69
69
  {posts.length === 0 ? (
70
70
  !featured && <p className="text-gray-500">{admin.t('public.noPosts')}</p>
71
71
  ) : (
@@ -2,7 +2,6 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, parseLinkList, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@ampless/runtime'
6
5
  import { ampless } from '@/lib/ampless'
7
6
  import { admin } from '@/lib/admin'
8
7
  import { LightboxBinder } from '@/components/lightbox-content'
@@ -86,11 +85,14 @@ export default async function BlogPost({ params }: PostCtx) {
86
85
  id="post-body"
87
86
  className="prose prose-neutral dark:prose-invert max-w-none [&_img]:max-w-[var(--ampless-img-max-width)] [&_img]:mx-auto"
88
87
  style={proseStyle}
89
- dangerouslySetInnerHTML={{ __html: renderBody(post) }}
90
- />
88
+ >
89
+ {await ampless.renderBody(post)}
90
+ </div>
91
91
 
92
92
  {html.afterContent}
93
93
 
94
+ {await ampless.publicPostScriptsForPage([post])}
95
+
94
96
  <TagList tags={post.tags} className="mt-8 border-t pt-6" />
95
97
 
96
98
  <footer className="mt-6 flex flex-wrap items-center gap-x-6 gap-y-2 text-sm text-gray-500">
@@ -1,6 +1,5 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, type ThemeRouteContext } from 'ampless'
3
- import { renderBody } from '@ampless/runtime'
4
3
  import { ampless } from '@/lib/ampless'
5
4
  import { SiteHeader } from '@/components/site-chrome/site-header'
6
5
  import { SiteFooter } from '@/components/site-chrome/site-footer'
@@ -70,14 +69,15 @@ export default async function CorporateHome(_: ThemeRouteContext) {
70
69
  {formatDate(featured.publishedAt, settings.dateFormat, settings.timezone)}
71
70
  </time>
72
71
  )}
73
- <div
74
- className="prose prose-neutral dark:prose-invert mt-6 max-w-none"
75
- dangerouslySetInnerHTML={{ __html: renderBody(featured) }}
76
- />
72
+ <div className="prose prose-neutral dark:prose-invert mt-6 max-w-none">
73
+ {await ampless.renderBody(featured)}
74
+ </div>
77
75
  </article>
78
76
  </section>
79
77
  )}
80
78
 
79
+ {featured && (await ampless.publicPostScriptsForPage([featured]))}
80
+
81
81
  {posts.length > 0 && (
82
82
  <section className="mx-auto max-w-4xl px-6 py-16">
83
83
  <h2 className="mb-8 border-l-4 border-[var(--primary)] pl-4 text-2xl font-bold">
@@ -2,7 +2,6 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@ampless/runtime'
6
5
  import { ampless } from '@/lib/ampless'
7
6
  import { admin } from '@/lib/admin'
8
7
  import { LightboxBinder } from '@/components/lightbox-content'
@@ -75,11 +74,14 @@ export default async function CorporatePost({ params }: PostCtx) {
75
74
  id="post-body"
76
75
  className="prose prose-neutral dark:prose-invert max-w-none [&_img]:max-w-[var(--ampless-img-max-width)] [&_img]:mx-auto"
77
76
  style={proseStyle}
78
- dangerouslySetInnerHTML={{ __html: renderBody(post) }}
79
- />
77
+ >
78
+ {await ampless.renderBody(post)}
79
+ </div>
80
80
 
81
81
  {html.afterContent}
82
82
 
83
+ {await ampless.publicPostScriptsForPage([post])}
84
+
83
85
  <TagList tags={post.tags} className="mt-8 border-t pt-6" />
84
86
  </article>
85
87
 
@@ -1,6 +1,5 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, type ThemeRouteContext } from 'ampless'
3
- import { renderBody } from '@ampless/runtime'
4
3
  import { ampless } from '@/lib/ampless'
5
4
  import { SiteHeader } from '@/components/site-chrome/site-header'
6
5
  import { SiteFooter } from '@/components/site-chrome/site-footer'
@@ -63,14 +62,15 @@ export default async function DadsHome(_: ThemeRouteContext) {
63
62
  {featured.title}
64
63
  </Link>
65
64
  </h2>
66
- <div
67
- className="prose prose-neutral dark:prose-invert mt-6 max-w-none"
68
- dangerouslySetInnerHTML={{ __html: renderBody(featured) }}
69
- />
65
+ <div className="prose prose-neutral dark:prose-invert mt-6 max-w-none">
66
+ {await ampless.renderBody(featured)}
67
+ </div>
70
68
  </div>
71
69
  </section>
72
70
  )}
73
71
 
72
+ {featured && (await ampless.publicPostScriptsForPage([featured]))}
73
+
74
74
  {posts.length > 0 && (
75
75
  <section className="px-6 py-12">
76
76
  <div className="mx-auto max-w-4xl">
@@ -2,7 +2,6 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@ampless/runtime'
6
5
  import { ampless } from '@/lib/ampless'
7
6
  import { admin } from '@/lib/admin'
8
7
  import { LightboxBinder } from '@/components/lightbox-content'
@@ -80,11 +79,14 @@ export default async function DadsPost({ params }: PostCtx) {
80
79
  id="post-body"
81
80
  className="prose prose-neutral dark:prose-invert max-w-none [&_a]:text-[var(--primary)] [&_a]:underline-offset-4 [&_img]:max-w-[var(--ampless-img-max-width)] [&_img]:mx-auto"
82
81
  style={proseStyle}
83
- dangerouslySetInnerHTML={{ __html: renderBody(post) }}
84
- />
82
+ >
83
+ {await ampless.renderBody(post)}
84
+ </div>
85
85
 
86
86
  {html.afterContent}
87
87
 
88
+ {await ampless.publicPostScriptsForPage([post])}
89
+
88
90
  <TagList tags={post.tags} className="mt-10 border-t pt-6" />
89
91
  </article>
90
92
 
@@ -2,7 +2,6 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@ampless/runtime'
6
5
  import { ampless } from '@/lib/ampless'
7
6
  import { LightboxBinder } from '@/components/lightbox-content'
8
7
  import { TagList } from '@/components/tag-list'
@@ -77,11 +76,14 @@ export default async function DocsPost({ params }: PostCtx) {
77
76
  id="post-body"
78
77
  className="prose prose-neutral dark:prose-invert max-w-none [&_img]:max-w-[var(--ampless-img-max-width)] [&_img]:mx-auto"
79
78
  style={proseStyle}
80
- dangerouslySetInnerHTML={{ __html: renderBody(post) }}
81
- />
79
+ >
80
+ {await ampless.renderBody(post)}
81
+ </div>
82
82
 
83
83
  {html.afterContent}
84
84
 
85
+ {await ampless.publicPostScriptsForPage([post])}
86
+
85
87
  <TagList tags={post.tags} className="mt-10 border-t pt-6" />
86
88
  </article>
87
89
  </main>
@@ -1,6 +1,5 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, type ThemeRouteContext } from 'ampless'
3
- import { renderBody } from '@ampless/runtime'
4
3
  import { ampless } from '@/lib/ampless'
5
4
  import { SiteHeader } from '@/components/site-chrome/site-header'
6
5
  import { SiteFooter } from '@/components/site-chrome/site-footer'
@@ -63,14 +62,15 @@ export default async function LandingHome(_: ThemeRouteContext) {
63
62
  <section className="mx-auto max-w-3xl px-6 py-16">
64
63
  <article>
65
64
  <h2 className="text-3xl font-bold tracking-tight">{featured.title}</h2>
66
- <div
67
- className="prose prose-neutral dark:prose-invert mt-6 max-w-none"
68
- dangerouslySetInnerHTML={{ __html: renderBody(featured) }}
69
- />
65
+ <div className="prose prose-neutral dark:prose-invert mt-6 max-w-none">
66
+ {await ampless.renderBody(featured)}
67
+ </div>
70
68
  </article>
71
69
  </section>
72
70
  )}
73
71
 
72
+ {featured && (await ampless.publicPostScriptsForPage([featured]))}
73
+
74
74
  {posts.length > 0 && (
75
75
  <section className="mx-auto max-w-5xl px-6 py-16">
76
76
  <h2 className="mb-8 text-3xl font-bold">Latest</h2>
@@ -2,7 +2,6 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@ampless/runtime'
6
5
  import { ampless } from '@/lib/ampless'
7
6
  import { admin } from '@/lib/admin'
8
7
  import { LightboxBinder } from '@/components/lightbox-content'
@@ -77,11 +76,14 @@ export default async function LandingPost({ params }: PostCtx) {
77
76
  id="post-body"
78
77
  className="prose prose-neutral dark:prose-invert max-w-none [&_img]:max-w-[var(--ampless-img-max-width)] [&_img]:mx-auto"
79
78
  style={proseStyle}
80
- dangerouslySetInnerHTML={{ __html: renderBody(post) }}
81
- />
79
+ >
80
+ {await ampless.renderBody(post)}
81
+ </div>
82
82
 
83
83
  {html.afterContent}
84
84
 
85
+ {await ampless.publicPostScriptsForPage([post])}
86
+
85
87
  <TagList tags={post.tags} className="mt-10 border-t pt-6" />
86
88
  </article>
87
89
 
@@ -2,7 +2,6 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@ampless/runtime'
6
5
  import { ampless } from '@/lib/ampless'
7
6
  import { admin } from '@/lib/admin'
8
7
  import { LightboxBinder } from '@/components/lightbox-content'
@@ -58,11 +57,14 @@ export default async function MinimalPost({ params }: PostCtx) {
58
57
  id="post-body"
59
58
  className="prose prose-neutral dark:prose-invert max-w-none [&_img]:max-w-[var(--ampless-img-max-width)] [&_img]:mx-auto"
60
59
  style={proseStyle}
61
- dangerouslySetInnerHTML={{ __html: renderBody(post) }}
62
- />
60
+ >
61
+ {await ampless.renderBody(post)}
62
+ </div>
63
63
 
64
64
  {html.afterContent}
65
65
 
66
+ {await ampless.publicPostScriptsForPage([post])}
67
+
66
68
  <TagList tags={post.tags} className="mt-8 border-t pt-6" />
67
69
  </article>
68
70
 
@@ -31,4 +31,4 @@ Restart `next dev` and visit `/admin/plugins` to configure.
31
31
  - Trust level: `{{trustLevel}}`
32
32
  - Capabilities: `{{capabilitiesList}}`
33
33
  - When this plugin grows useful for more than one site, lift it into
34
- its own npm package via `npx create-ampless plugin <name> --standalone`.
34
+ its own npm package via `npx create-ampless@beta plugin <name> --standalone`.
@@ -2,12 +2,12 @@
2
2
 
3
3
  # {{packageName}}
4
4
 
5
- > [Pre-release / alpha] {{description}}
5
+ > [Pre-release / beta] {{description}}
6
6
 
7
7
  ## インストール
8
8
 
9
9
  ```bash
10
- npm install {{packageName}}@alpha
10
+ npm install {{packageName}}@beta
11
11
  ```
12
12
 
13
13
  ## 設定
@@ -37,7 +37,7 @@ export default defineConfig({
37
37
  pnpm install
38
38
  pnpm test
39
39
  pnpm build
40
- pnpm publish --access public --tag alpha
40
+ pnpm publish --access public --tag beta
41
41
  ```
42
42
 
43
43
  API 詳細は [ampless plugin author guide](https://github.com/heavymoons/ampless/blob/main/packages/ampless/docs/plugin-author-guide.md) を参照。
@@ -2,12 +2,12 @@
2
2
 
3
3
  # {{packageName}}
4
4
 
5
- > [Pre-release / alpha] {{description}}
5
+ > [Pre-release / beta] {{description}}
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install {{packageName}}@alpha
10
+ npm install {{packageName}}@beta
11
11
  ```
12
12
 
13
13
  ## Configure
@@ -37,7 +37,7 @@ Then go to `/admin/plugins` to configure.
37
37
  pnpm install
38
38
  pnpm test
39
39
  pnpm build
40
- pnpm publish --access public --tag alpha
40
+ pnpm publish --access public --tag beta
41
41
  ```
42
42
 
43
43
  See the [ampless plugin author guide](https://github.com/heavymoons/ampless/blob/main/packages/ampless/docs/plugin-author-guide.md) for the full API.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ampless",
3
- "version": "1.0.0-alpha.99",
3
+ "version": "1.0.0-beta.149",
4
4
  "description": "Create a new ampless project",
5
5
  "license": "MIT",
6
6
  "type": "module",