create-smoodly-app 0.0.50 → 0.0.52

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 (159) hide show
  1. package/README.md +22 -30
  2. package/dist/index.js +87 -329
  3. package/package.json +4 -5
  4. package/templates/astro-blank/AGENTS.md +2 -8
  5. package/templates/astro-blank/README.md +13 -23
  6. package/templates/astro-blank/package.json +2 -3
  7. package/templates/astro-blank/scripts/seed.ts +9 -3
  8. package/templates/astro-blank/src/smoodly/collections.ts +2 -2
  9. package/templates/astro-blank-intl/AGENTS.md +2 -8
  10. package/templates/astro-blank-intl/README.md +13 -23
  11. package/templates/astro-blank-intl/package.json +2 -3
  12. package/templates/astro-blank-intl/scripts/seed.ts +9 -3
  13. package/templates/astro-blank-intl/src/smoodly/collections.ts +2 -2
  14. package/templates/astro-lorem/AGENTS.md +2 -8
  15. package/templates/astro-lorem/README.md +12 -16
  16. package/templates/astro-lorem/package.json +2 -3
  17. package/templates/astro-lorem/scripts/seed.ts +9 -3
  18. package/templates/astro-lorem/src/components/sections/PageHero.schema.ts +3 -1
  19. package/templates/astro-lorem/src/sections/pageHero.astro +1 -1
  20. package/templates/astro-lorem-intl/AGENTS.md +2 -8
  21. package/templates/astro-lorem-intl/README.md +12 -16
  22. package/templates/astro-lorem-intl/package.json +2 -3
  23. package/templates/astro-lorem-intl/scripts/seed.ts +9 -3
  24. package/templates/astro-lorem-intl/src/components/sections/PageHero.schema.ts +3 -1
  25. package/templates/astro-lorem-intl/src/sections/pageHero.astro +1 -1
  26. package/templates/blank/AGENTS.md +7 -13
  27. package/templates/blank/README.md +12 -22
  28. package/templates/blank/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
  29. package/templates/blank/next.config.ts +1 -4
  30. package/templates/blank/package.json +4 -4
  31. package/templates/blank/scripts/seed.ts +9 -3
  32. package/templates/blank/smoodly/collections.ts +2 -2
  33. package/templates/blank/smoodly/server.ts +25 -47
  34. package/templates/blank-intl/AGENTS.md +7 -13
  35. package/templates/blank-intl/README.md +12 -22
  36. package/templates/blank-intl/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
  37. package/templates/blank-intl/next.config.ts +1 -4
  38. package/templates/blank-intl/package.json +4 -4
  39. package/templates/blank-intl/scripts/seed.ts +9 -3
  40. package/templates/blank-intl/smoodly/collections.ts +2 -2
  41. package/templates/blank-intl/smoodly/server.ts +25 -47
  42. package/templates/blank-intl.tsconfig.json +0 -3
  43. package/templates/blank.tsconfig.json +0 -3
  44. package/templates/lorem/AGENTS.md +7 -13
  45. package/templates/lorem/README.md +13 -17
  46. package/templates/lorem/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
  47. package/templates/lorem/components/sections/PageHero.schema.ts +3 -1
  48. package/templates/lorem/components/sections/PageHero.tsx +1 -1
  49. package/templates/lorem/next.config.ts +1 -4
  50. package/templates/lorem/package.json +4 -4
  51. package/templates/lorem/scripts/seed.ts +9 -3
  52. package/templates/lorem/smoodly/server.ts +25 -47
  53. package/templates/lorem-intl/AGENTS.md +7 -13
  54. package/templates/lorem-intl/README.md +13 -17
  55. package/templates/lorem-intl/app/(smoodly)/admin/[[...segments]]/route.ts +6 -5
  56. package/templates/lorem-intl/components/sections/PageHero.schema.ts +3 -1
  57. package/templates/lorem-intl/components/sections/PageHero.tsx +1 -1
  58. package/templates/lorem-intl/next.config.ts +1 -4
  59. package/templates/lorem-intl/package.json +4 -4
  60. package/templates/lorem-intl/scripts/seed.ts +9 -3
  61. package/templates/lorem-intl/smoodly/server.ts +25 -47
  62. package/templates/lorem-intl.tsconfig.json +0 -3
  63. package/templates/lorem.tsconfig.json +0 -3
  64. package/templates/astro-blank/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  65. package/templates/astro-blank/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  66. package/templates/astro-blank/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  67. package/templates/astro-blank/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  68. package/templates/astro-blank/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  69. package/templates/astro-blank/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  70. package/templates/astro-blank/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  71. package/templates/astro-blank/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  72. package/templates/astro-blank/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  73. package/templates/astro-blank/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  74. package/templates/astro-blank/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  75. package/templates/astro-blank/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
  76. package/templates/astro-blank-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  77. package/templates/astro-blank-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  78. package/templates/astro-blank-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  79. package/templates/astro-blank-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  80. package/templates/astro-blank-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  81. package/templates/astro-blank-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  82. package/templates/astro-blank-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  83. package/templates/astro-blank-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  84. package/templates/astro-blank-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  85. package/templates/astro-blank-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  86. package/templates/astro-blank-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  87. package/templates/astro-blank-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
  88. package/templates/astro-lorem/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  89. package/templates/astro-lorem/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  90. package/templates/astro-lorem/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  91. package/templates/astro-lorem/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  92. package/templates/astro-lorem/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  93. package/templates/astro-lorem/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  94. package/templates/astro-lorem/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  95. package/templates/astro-lorem/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  96. package/templates/astro-lorem/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  97. package/templates/astro-lorem/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  98. package/templates/astro-lorem/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  99. package/templates/astro-lorem/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
  100. package/templates/astro-lorem-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  101. package/templates/astro-lorem-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  102. package/templates/astro-lorem-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  103. package/templates/astro-lorem-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  104. package/templates/astro-lorem-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  105. package/templates/astro-lorem-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  106. package/templates/astro-lorem-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  107. package/templates/astro-lorem-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  108. package/templates/astro-lorem-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  109. package/templates/astro-lorem-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  110. package/templates/astro-lorem-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  111. package/templates/astro-lorem-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
  112. package/templates/blank/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  113. package/templates/blank/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  114. package/templates/blank/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  115. package/templates/blank/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  116. package/templates/blank/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  117. package/templates/blank/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  118. package/templates/blank/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  119. package/templates/blank/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  120. package/templates/blank/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  121. package/templates/blank/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  122. package/templates/blank/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  123. package/templates/blank/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
  124. package/templates/blank-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  125. package/templates/blank-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  126. package/templates/blank-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  127. package/templates/blank-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  128. package/templates/blank-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  129. package/templates/blank-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  130. package/templates/blank-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  131. package/templates/blank-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  132. package/templates/blank-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  133. package/templates/blank-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  134. package/templates/blank-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  135. package/templates/blank-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -20
  136. package/templates/lorem/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  137. package/templates/lorem/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  138. package/templates/lorem/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  139. package/templates/lorem/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  140. package/templates/lorem/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  141. package/templates/lorem/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  142. package/templates/lorem/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  143. package/templates/lorem/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  144. package/templates/lorem/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  145. package/templates/lorem/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  146. package/templates/lorem/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  147. package/templates/lorem/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
  148. package/templates/lorem-intl/supabase/migrations/20260926120000_smoodly_v1.sql +0 -535
  149. package/templates/lorem-intl/supabase/migrations/20260926130000_smoodly_v2.sql +0 -26
  150. package/templates/lorem-intl/supabase/migrations/20260926140000_smoodly_v3.sql +0 -38
  151. package/templates/lorem-intl/supabase/migrations/20260926150000_smoodly_v4.sql +0 -41
  152. package/templates/lorem-intl/supabase/migrations/20260929120000_smoodly_v5.sql +0 -56
  153. package/templates/lorem-intl/supabase/migrations/20260929135523_smoodly_v6.sql +0 -200
  154. package/templates/lorem-intl/supabase/migrations/20260930040956_smoodly_v7.sql +0 -84
  155. package/templates/lorem-intl/supabase/migrations/20261007120000_smoodly_v8.sql +0 -154
  156. package/templates/lorem-intl/supabase/migrations/20261007200000_smoodly_v9.sql +0 -30
  157. package/templates/lorem-intl/supabase/migrations/20261008120000_smoodly_v10.sql +0 -47
  158. package/templates/lorem-intl/supabase/migrations/20261009120000_smoodly_v11.sql +0 -49
  159. package/templates/lorem-intl/supabase/migrations/20261009120100_smoodly_views.sql +0 -58
@@ -1,47 +0,0 @@
1
- -- Smoodly core schema, version 10 (DESIGN §3, the document stamp, decided 2026-10-08).
2
- -- Shipped in the smoodly package; `npx smoodly migrate` copies it into supabase/migrations/.
3
- -- Never edit a published file: the next change is the next file.
4
- -- The delta over version 9: published_models, one row per space holding the
5
- -- document stamp the space recorded as current, so only the deployment at that
6
- -- stamp rewrites delivery rows (a preview deployment on a newer package serves
7
- -- assembled documents and writes nothing). Additive: no function changes.
8
-
9
- set client_min_messages = warning;
10
-
11
- -- The document stamp a space recorded as current: set by `npx smoodly rebuild` and by the first writer
12
- -- into an empty record; only a reader at this stamp rewrites published_pages and published_entries.
13
- create table if not exists "published_models" (
14
- "space_id" uuid primary key default '00000000-0000-0000-0000-000000000000',
15
- "model" text not null,
16
- "recorded_at" timestamptz not null default now()
17
- );
18
-
19
- alter table "published_models" enable row level security;
20
-
21
- -- Stamped with the caller's space on insert, as every content table.
22
- drop trigger if exists "smoodly_a_set_space" on "published_models";
23
- create trigger "smoodly_a_set_space" before insert on "published_models"
24
- for each row execute function "smoodly_set_space"();
25
-
26
- -- A write key reads and writes its own space's record; no other key reads (spec 2026-09-29 content API contract §8).
27
- drop policy if exists "smoodly_write" on "published_models";
28
-
29
- drop policy if exists "smoodly_insert" on "published_models";
30
- create policy "smoodly_insert" on "published_models" for insert
31
- with check ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
32
-
33
- drop policy if exists "smoodly_update" on "published_models";
34
- create policy "smoodly_update" on "published_models" for update
35
- using ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write')
36
- with check ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
37
-
38
- drop policy if exists "smoodly_delete" on "published_models";
39
- create policy "smoodly_delete" on "published_models" for delete
40
- using ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
41
-
42
- drop policy if exists "smoodly_read" on "published_models";
43
- create policy "smoodly_read" on "published_models" for select
44
- using ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
45
-
46
- insert into "smoodly_meta" ("key", "value") values ('schema_version', '10')
47
- on conflict ("key") do update set "value" = excluded."value";
@@ -1,49 +0,0 @@
1
- -- Smoodly core schema, version 11 (DESIGN §3, static mode, decided 2026-10-09).
2
- -- Shipped in the smoodly package; `npx smoodly migrate` copies it into supabase/migrations/.
3
- -- Never edit a published file: the next change is the next file.
4
- -- The delta over version 10: space_deploys, one row per space holding the last
5
- -- Deploy press (static mode's button), so a serverless function can tell a
6
- -- build in flight from one that landed. Additive: no function changes.
7
-
8
- set client_min_messages = warning;
9
-
10
- -- The last Deploy press of a space (spec 2026-10-09 static mode §7): who pressed and when; the admin
11
- -- compares it with the build marker the live site serves to show building, landed or not landed.
12
- create table if not exists "space_deploys" (
13
- "space_id" uuid primary key default '00000000-0000-0000-0000-000000000000',
14
- -- Null until the first press: a removal may make the row first.
15
- "requested_at" timestamptz,
16
- "requested_by" text,
17
- -- When a delivery row last went (an unpublish, a delete): a change the count of newer rows cannot see.
18
- "removed_at" timestamptz
19
- );
20
-
21
- alter table "space_deploys" enable row level security;
22
-
23
- -- Stamped with the caller's space on insert, as every content table.
24
- drop trigger if exists "smoodly_a_set_space" on "space_deploys";
25
- create trigger "smoodly_a_set_space" before insert on "space_deploys"
26
- for each row execute function "smoodly_set_space"();
27
-
28
- -- A write key reads and writes its own space's row; no other key reads (spec 2026-09-29 content API contract §8).
29
- drop policy if exists "smoodly_write" on "space_deploys";
30
-
31
- drop policy if exists "smoodly_insert" on "space_deploys";
32
- create policy "smoodly_insert" on "space_deploys" for insert
33
- with check ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
34
-
35
- drop policy if exists "smoodly_update" on "space_deploys";
36
- create policy "smoodly_update" on "space_deploys" for update
37
- using ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write')
38
- with check ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
39
-
40
- drop policy if exists "smoodly_delete" on "space_deploys";
41
- create policy "smoodly_delete" on "space_deploys" for delete
42
- using ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
43
-
44
- drop policy if exists "smoodly_read" on "space_deploys";
45
- create policy "smoodly_read" on "space_deploys" for select
46
- using ("space_id" = (select "smoodly_current_space"()) and not (select "smoodly_space_key_revoked"()) and (select "smoodly_key_kind"()) = 'write');
47
-
48
- insert into "smoodly_meta" ("key", "value") values ('schema_version', '11')
49
- on conflict ("key") do update set "value" = excluded."value";
@@ -1,58 +0,0 @@
1
- -- Smoodly: read views for this app's collections, written by `npx smoodly migrate`
2
- -- (2026-10-09T12:01:00.000Z). One block per collection; the marker's hash is the block's SQL, compared on the next run.
3
- -- Never edit a written file: change the collection and run migrate again.
4
-
5
- -- smoodly:collection people sha256:929798ebb4fa2bb6
6
- create or replace view "people" with (security_invoker = true) as
7
- select
8
- e."id",
9
- l."locale",
10
- l."slug",
11
- e."sort",
12
- e."created_at",
13
- l."updated_at",
14
- coalesce(v."fields", e."fields" || l."fields")->>'name' as "name",
15
- coalesce(v."fields", e."fields" || l."fields")->>'role' as "role"
16
- from "entries" e
17
- join "entry_locales" l on l."entry_id" = e."id"
18
- left join "entry_versions" v on v."id" = l."published_version_id"
19
- where e."collection" = 'people' and l."status" = 'published';
20
-
21
- -- smoodly:collection articles sha256:dcbe071d70e13943
22
- create or replace view "articles" with (security_invoker = true) as
23
- select
24
- e."id",
25
- l."locale",
26
- l."slug",
27
- e."sort",
28
- e."created_at",
29
- l."updated_at",
30
- coalesce(v."fields", e."fields" || l."fields")->>'title' as "title",
31
- coalesce(v."fields", e."fields" || l."fields")->'image' as "image",
32
- (coalesce(v."fields", e."fields" || l."fields")->>'date')::timestamptz as "date",
33
- coalesce(v."fields", e."fields" || l."fields")->>'author' as "author",
34
- coalesce(v."fields", e."fields" || l."fields")->>'excerpt' as "excerpt",
35
- coalesce(v."fields", e."fields" || l."fields")->'body' as "body",
36
- coalesce(v."fields", e."fields" || l."fields")->'tags' as "tags"
37
- from "entries" e
38
- join "entry_locales" l on l."entry_id" = e."id"
39
- left join "entry_versions" v on v."id" = l."published_version_id"
40
- where e."collection" = 'articles' and l."status" = 'published';
41
-
42
- -- smoodly:collection news sha256:03a94ad5ba35ffe4
43
- create or replace view "news" with (security_invoker = true) as
44
- select
45
- e."id",
46
- l."locale",
47
- l."slug",
48
- e."sort",
49
- e."created_at",
50
- l."updated_at",
51
- coalesce(v."fields", e."fields" || l."fields")->>'title' as "title",
52
- (coalesce(v."fields", e."fields" || l."fields")->>'date')::timestamptz as "date",
53
- coalesce(v."fields", e."fields" || l."fields")->>'excerpt' as "excerpt",
54
- coalesce(v."fields", e."fields" || l."fields")->'body' as "body"
55
- from "entries" e
56
- join "entry_locales" l on l."entry_id" = e."id"
57
- left join "entry_versions" v on v."id" = l."published_version_id"
58
- where e."collection" = 'news' and l."status" = 'published';