create-smoodly-app 0.0.7 → 0.0.9

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 (72) hide show
  1. package/dist/index.js +22 -2
  2. package/package.json +1 -1
  3. package/templates/next/README.md +18 -2
  4. package/templates/next/app/globals.css +190 -0
  5. package/templates/next/app/layout.tsx +28 -4
  6. package/templates/next/components/ArticleCard.tsx +22 -0
  7. package/templates/next/components/articles.ts +38 -0
  8. package/templates/next/components/pages/Article.tsx +58 -10
  9. package/templates/next/components/pages/Articles.tsx +44 -0
  10. package/templates/next/components/pages/Home.tsx +12 -10
  11. package/templates/next/components/pages/Page.tsx +11 -8
  12. package/templates/next/components/sections/FavouriteArticles.tsx +42 -0
  13. package/templates/next/components/sections/Footer.tsx +69 -0
  14. package/templates/next/components/sections/Header.tsx +44 -0
  15. package/templates/next/components/sections/Hero.tsx +32 -7
  16. package/templates/next/components/sections/ImageText.tsx +59 -0
  17. package/templates/next/components/sections/PageHero.tsx +38 -0
  18. package/templates/next/components/sections/People.tsx +36 -0
  19. package/templates/next/components/sections/Points.tsx +50 -0
  20. package/templates/next/components/sections/Quote.tsx +33 -0
  21. package/templates/next/components/strings.ts +23 -0
  22. package/templates/next/messages/en.json +5 -0
  23. package/templates/next/package.json +4 -1
  24. package/templates/next/public/images/about_main.jpg +0 -0
  25. package/templates/next/public/images/article_photo.jpg +0 -0
  26. package/templates/next/public/images/hero_image.jpg +0 -0
  27. package/templates/next/public/images/home_section_2.jpg +0 -0
  28. package/templates/next/scripts/seed.ts +310 -0
  29. package/templates/next/smoodly/collections.ts +12 -3
  30. package/templates/next/smoodly/config.ts +12 -3
  31. package/templates/next/smoodly/sections.ts +14 -3
  32. package/templates/next/smoodly/server.ts +39 -21
  33. package/templates/next/smoodly/shared.ts +26 -0
  34. package/templates/next/supabase/migrations/00000000000000_smoodly.sql +7 -52
  35. package/templates/next-intl/README.md +19 -3
  36. package/templates/next-intl/app/[locale]/layout.tsx +27 -4
  37. package/templates/next-intl/app/globals.css +190 -0
  38. package/templates/next-intl/components/ArticleCard.tsx +22 -0
  39. package/templates/next-intl/components/articles.ts +38 -0
  40. package/templates/next-intl/components/pages/Article.tsx +58 -10
  41. package/templates/next-intl/components/pages/Articles.tsx +44 -0
  42. package/templates/next-intl/components/pages/Home.tsx +12 -10
  43. package/templates/next-intl/components/pages/Page.tsx +11 -8
  44. package/templates/next-intl/components/sections/FavouriteArticles.tsx +42 -0
  45. package/templates/next-intl/components/sections/Footer.tsx +69 -0
  46. package/templates/next-intl/components/sections/Header.tsx +44 -0
  47. package/templates/next-intl/components/sections/Hero.tsx +32 -7
  48. package/templates/next-intl/components/sections/ImageText.tsx +59 -0
  49. package/templates/next-intl/components/sections/PageHero.tsx +38 -0
  50. package/templates/next-intl/components/sections/People.tsx +36 -0
  51. package/templates/next-intl/components/sections/Points.tsx +50 -0
  52. package/templates/next-intl/components/sections/Quote.tsx +33 -0
  53. package/templates/next-intl/components/strings.ts +23 -0
  54. package/templates/next-intl/i18n/request.ts +14 -7
  55. package/templates/next-intl/messages/en.json +5 -0
  56. package/templates/next-intl/messages/fi.json +5 -0
  57. package/templates/next-intl/package.json +4 -1
  58. package/templates/next-intl/public/images/about_main.jpg +0 -0
  59. package/templates/next-intl/public/images/article_photo.jpg +0 -0
  60. package/templates/next-intl/public/images/hero_image.jpg +0 -0
  61. package/templates/next-intl/public/images/home_section_2.jpg +0 -0
  62. package/templates/next-intl/scripts/seed.ts +310 -0
  63. package/templates/next-intl/smoodly/collections.ts +13 -4
  64. package/templates/next-intl/smoodly/config.ts +12 -3
  65. package/templates/next-intl/smoodly/sections.ts +14 -3
  66. package/templates/next-intl/smoodly/server.ts +39 -21
  67. package/templates/next-intl/smoodly/shared.ts +26 -0
  68. package/templates/next-intl/supabase/migrations/00000000000000_smoodly.sql +7 -52
  69. package/templates/next/components/sections/ArticleList.tsx +0 -31
  70. package/templates/next/components/sections/CtaBanner.tsx +0 -35
  71. package/templates/next-intl/components/sections/ArticleList.tsx +0 -31
  72. package/templates/next-intl/components/sections/CtaBanner.tsx +0 -35
@@ -1,31 +0,0 @@
1
- import { f, smoodly, type Props } from "smoodly";
2
- import { articles } from "@/smoodly/collections";
3
-
4
- export const articleListSchema = smoodly.schema.section({
5
- name: "articleList",
6
- title: "Article list",
7
- fields: {
8
- title: f.text(),
9
- // .resolve("author") — hydrate each article AND follow its author ref
10
- // one level (article → person), all in resolveTree's batched pass.
11
- items: f.refList(() => articles).resolve("author"),
12
- },
13
- });
14
-
15
- function ArticleListView({ title, items, styles }: Props<typeof articleListSchema>) {
16
- return (
17
- <smoodly.Section styles={styles}>
18
- <h2>{title}</h2>
19
- <ul>
20
- {/* an item demoted/deleted after publish resolves to null — skip it */}
21
- {items.filter(Boolean).map((article, i) => (
22
- <li key={i}>
23
- <strong>{article.title}</strong> — {article.author?.name ?? "unknown author"}
24
- </li>
25
- ))}
26
- </ul>
27
- </smoodly.Section>
28
- );
29
- }
30
-
31
- export const ArticleList = smoodly.section(articleListSchema, ArticleListView);
@@ -1,35 +0,0 @@
1
- import { f, smoodly, type Props } from "smoodly";
2
-
3
- // The locked-zone section: every page renders exactly one of these in its
4
- // `prefooter` zone. Editors change the words, never the structure — no
5
- // add, remove, move or duplicate. The editor materializes the node from
6
- // `sample` the first time it opens a page whose prefooter is empty.
7
- export const ctaBannerSchema = smoodly.schema.section({
8
- name: "ctaBanner",
9
- title: "CTA banner",
10
- description: "The closing call to action under every page.",
11
- fields: {
12
- heading: f.text(),
13
- buttonLabel: f.text(),
14
- buttonHref: f.text(),
15
- },
16
- styles: {
17
- tone: f.select(["light", "dark"]).default("dark"),
18
- },
19
- sample: {
20
- heading: "Ready to try Smoodly?",
21
- buttonLabel: "Read the docs",
22
- buttonHref: "/docs/intro",
23
- },
24
- });
25
-
26
- function CtaBannerView({ heading, buttonLabel, buttonHref, styles }: Props<typeof ctaBannerSchema>) {
27
- return (
28
- <smoodly.Section styles={styles}>
29
- <h2>{heading}</h2>
30
- <a href={buttonHref}>{buttonLabel}</a>
31
- </smoodly.Section>
32
- );
33
- }
34
-
35
- export const CtaBanner = smoodly.section(ctaBannerSchema, CtaBannerView);
@@ -1,31 +0,0 @@
1
- import { f, smoodly, type Props } from "smoodly";
2
- import { articles } from "@/smoodly/collections";
3
-
4
- export const articleListSchema = smoodly.schema.section({
5
- name: "articleList",
6
- title: "Article list",
7
- fields: {
8
- title: f.text(),
9
- // .resolve("author") — hydrate each article AND follow its author ref
10
- // one level (article → person), all in resolveTree's batched pass.
11
- items: f.refList(() => articles).resolve("author"),
12
- },
13
- });
14
-
15
- function ArticleListView({ title, items, styles }: Props<typeof articleListSchema>) {
16
- return (
17
- <smoodly.Section styles={styles}>
18
- <h2>{title}</h2>
19
- <ul>
20
- {/* an item demoted/deleted after publish resolves to null — skip it */}
21
- {items.filter(Boolean).map((article, i) => (
22
- <li key={i}>
23
- <strong>{article.title}</strong> — {article.author?.name ?? "unknown author"}
24
- </li>
25
- ))}
26
- </ul>
27
- </smoodly.Section>
28
- );
29
- }
30
-
31
- export const ArticleList = smoodly.section(articleListSchema, ArticleListView);
@@ -1,35 +0,0 @@
1
- import { f, smoodly, type Props } from "smoodly";
2
-
3
- // The locked-zone section: every page renders exactly one of these in its
4
- // `prefooter` zone. Editors change the words, never the structure — no
5
- // add, remove, move or duplicate. The editor materializes the node from
6
- // `sample` the first time it opens a page whose prefooter is empty.
7
- export const ctaBannerSchema = smoodly.schema.section({
8
- name: "ctaBanner",
9
- title: "CTA banner",
10
- description: "The closing call to action under every page.",
11
- fields: {
12
- heading: f.text(),
13
- buttonLabel: f.text(),
14
- buttonHref: f.text(),
15
- },
16
- styles: {
17
- tone: f.select(["light", "dark"]).default("dark"),
18
- },
19
- sample: {
20
- heading: "Ready to try Smoodly?",
21
- buttonLabel: "Read the docs",
22
- buttonHref: "/docs/intro",
23
- },
24
- });
25
-
26
- function CtaBannerView({ heading, buttonLabel, buttonHref, styles }: Props<typeof ctaBannerSchema>) {
27
- return (
28
- <smoodly.Section styles={styles}>
29
- <h2>{heading}</h2>
30
- <a href={buttonHref}>{buttonLabel}</a>
31
- </smoodly.Section>
32
- );
33
- }
34
-
35
- export const CtaBanner = smoodly.section(ctaBannerSchema, CtaBannerView);