@sonicjs-cms/core 2.19.0 → 3.0.0-beta.10

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 (230) hide show
  1. package/README.md +52 -52
  2. package/dist/admin-documents-form.template-DDSH6ROU.js +6 -0
  3. package/dist/{admin-layout-catalyst.template-UMTIN66R.js.map → admin-documents-form.template-DDSH6ROU.js.map} +1 -1
  4. package/dist/admin-documents-form.template-LSZKGA5J.cjs +19 -0
  5. package/dist/{admin-layout-catalyst.template-HFD37TY5.cjs.map → admin-documents-form.template-LSZKGA5J.cjs.map} +1 -1
  6. package/dist/{filter-bar.template-DlVYMk-T.d.cts → admin-layout-catalyst.template-DrwDUfsE.d.cts} +25 -1
  7. package/dist/{filter-bar.template-DlVYMk-T.d.ts → admin-layout-catalyst.template-DrwDUfsE.d.ts} +25 -1
  8. package/dist/admin-layout-catalyst.template-KDHKVLXR.cjs +21 -0
  9. package/dist/admin-layout-catalyst.template-KDHKVLXR.cjs.map +1 -0
  10. package/dist/admin-layout-catalyst.template-YQ4EMF2J.js +7 -0
  11. package/dist/admin-layout-catalyst.template-YQ4EMF2J.js.map +1 -0
  12. package/dist/app-Bo0X1OWX.d.ts +1268 -0
  13. package/dist/app-Do66yCcV.d.cts +1268 -0
  14. package/dist/cache-DDARE4QE.js +4 -0
  15. package/dist/cache-DDARE4QE.js.map +1 -0
  16. package/dist/cache-LVYS4BPL.cjs +33 -0
  17. package/dist/cache-LVYS4BPL.cjs.map +1 -0
  18. package/dist/chunk-2CB4KY7I.cjs +771 -0
  19. package/dist/chunk-2CB4KY7I.cjs.map +1 -0
  20. package/dist/{chunk-ABB34XUS.cjs → chunk-3KYKEXV7.cjs} +667 -19
  21. package/dist/chunk-3KYKEXV7.cjs.map +1 -0
  22. package/dist/chunk-4BTBSXMR.cjs +912 -0
  23. package/dist/chunk-4BTBSXMR.cjs.map +1 -0
  24. package/dist/{chunk-55RDMDOP.js → chunk-5V62WT6M.js} +181 -57
  25. package/dist/chunk-5V62WT6M.js.map +1 -0
  26. package/dist/{chunk-OCL3HMEG.js → chunk-6OC6MF3C.js} +7004 -9807
  27. package/dist/chunk-6OC6MF3C.js.map +1 -0
  28. package/dist/chunk-AI663NBO.js +821 -0
  29. package/dist/chunk-AI663NBO.js.map +1 -0
  30. package/dist/chunk-ALDRXTUO.js +273 -0
  31. package/dist/chunk-ALDRXTUO.js.map +1 -0
  32. package/dist/{chunk-TFNTM3OA.js → chunk-ATUPB6MN.js} +645 -15
  33. package/dist/chunk-ATUPB6MN.js.map +1 -0
  34. package/dist/chunk-BLMTL57B.js +767 -0
  35. package/dist/chunk-BLMTL57B.js.map +1 -0
  36. package/dist/{chunk-4ZSNJDLS.cjs → chunk-CRGUD4KC.cjs} +9 -9
  37. package/dist/chunk-CRGUD4KC.cjs.map +1 -0
  38. package/dist/chunk-F67UK75A.cjs +158 -0
  39. package/dist/chunk-F67UK75A.cjs.map +1 -0
  40. package/dist/chunk-GCDZZNIN.js +192 -0
  41. package/dist/chunk-GCDZZNIN.js.map +1 -0
  42. package/dist/chunk-HIKBY7MS.cjs +70 -0
  43. package/dist/chunk-HIKBY7MS.cjs.map +1 -0
  44. package/dist/{chunk-4NPCDK6B.js → chunk-IDCZBF35.js} +557 -90
  45. package/dist/chunk-IDCZBF35.js.map +1 -0
  46. package/dist/chunk-IESEVHXL.js +66 -0
  47. package/dist/chunk-IESEVHXL.js.map +1 -0
  48. package/dist/chunk-IGADDMXH.js +387 -0
  49. package/dist/chunk-IGADDMXH.js.map +1 -0
  50. package/dist/chunk-IHTXB7AT.cjs +276 -0
  51. package/dist/chunk-IHTXB7AT.cjs.map +1 -0
  52. package/dist/chunk-IVPRUGTY.js +242 -0
  53. package/dist/chunk-IVPRUGTY.js.map +1 -0
  54. package/dist/{chunk-JZVHLLSI.cjs → chunk-IXUHXTHW.cjs} +2 -151
  55. package/dist/chunk-IXUHXTHW.cjs.map +1 -0
  56. package/dist/chunk-J6JTWD2A.cjs +100 -0
  57. package/dist/chunk-J6JTWD2A.cjs.map +1 -0
  58. package/dist/chunk-JEQ7FLOD.cjs +199 -0
  59. package/dist/chunk-JEQ7FLOD.cjs.map +1 -0
  60. package/dist/{chunk-ON5ZMSU4.js → chunk-JQISFW6U.js} +3 -3
  61. package/dist/chunk-JQISFW6U.js.map +1 -0
  62. package/dist/chunk-K25XHMM3.js +566 -0
  63. package/dist/chunk-K25XHMM3.js.map +1 -0
  64. package/dist/{chunk-UYJ6TJHX.cjs → chunk-K623Q6WD.cjs} +181 -56
  65. package/dist/chunk-K623Q6WD.cjs.map +1 -0
  66. package/dist/{chunk-7A4CB7T3.cjs → chunk-MUNO67TT.cjs} +561 -91
  67. package/dist/chunk-MUNO67TT.cjs.map +1 -0
  68. package/dist/chunk-N32OWET6.cjs +327 -0
  69. package/dist/chunk-N32OWET6.cjs.map +1 -0
  70. package/dist/chunk-NUKJ54GA.cjs +245 -0
  71. package/dist/chunk-NUKJ54GA.cjs.map +1 -0
  72. package/dist/{chunk-XWIA3HVX.js → chunk-OBA2RYZN.js} +6 -1249
  73. package/dist/chunk-OBA2RYZN.js.map +1 -0
  74. package/dist/chunk-PMGOBS6X.cjs +408 -0
  75. package/dist/chunk-PMGOBS6X.cjs.map +1 -0
  76. package/dist/{chunk-OHYBNCVL.cjs → chunk-PXNTCCPE.cjs} +10 -1256
  77. package/dist/chunk-PXNTCCPE.cjs.map +1 -0
  78. package/dist/chunk-PYVFXCSD.js +1828 -0
  79. package/dist/chunk-PYVFXCSD.js.map +1 -0
  80. package/dist/{chunk-BU7SFHGP.js → chunk-QZGABF2M.js} +3 -149
  81. package/dist/chunk-QZGABF2M.js.map +1 -0
  82. package/dist/{chunk-E4YFJBM2.cjs → chunk-R4ILO3W6.cjs} +876 -829
  83. package/dist/chunk-R4ILO3W6.cjs.map +1 -0
  84. package/dist/chunk-RMRJGMDE.js +323 -0
  85. package/dist/chunk-RMRJGMDE.js.map +1 -0
  86. package/dist/chunk-RNZFGN4R.js +88 -0
  87. package/dist/chunk-RNZFGN4R.js.map +1 -0
  88. package/dist/chunk-RQ6N3FTV.js +900 -0
  89. package/dist/chunk-RQ6N3FTV.js.map +1 -0
  90. package/dist/{chunk-R4FOLLFB.cjs → chunk-TO6EY4P7.cjs} +8730 -11520
  91. package/dist/chunk-TO6EY4P7.cjs.map +1 -0
  92. package/dist/chunk-V464XBYS.js +154 -0
  93. package/dist/chunk-V464XBYS.js.map +1 -0
  94. package/dist/chunk-YA3TJ65D.cjs +575 -0
  95. package/dist/chunk-YA3TJ65D.cjs.map +1 -0
  96. package/dist/chunk-YP7GW2G5.cjs +866 -0
  97. package/dist/chunk-YP7GW2G5.cjs.map +1 -0
  98. package/dist/{collection-config-B4PG-AaF.d.cts → collection-config-JgHOpFCG.d.cts} +30 -2
  99. package/dist/{collection-config-B4PG-AaF.d.ts → collection-config-JgHOpFCG.d.ts} +30 -2
  100. package/dist/config-HFXANXCC.js +6 -0
  101. package/dist/config-HFXANXCC.js.map +1 -0
  102. package/dist/config-ON6FNMYX.cjs +19 -0
  103. package/dist/config-ON6FNMYX.cjs.map +1 -0
  104. package/dist/define-plugin-BzNHc1ZI.d.ts +1321 -0
  105. package/dist/define-plugin-IWDKYaVm.d.cts +1321 -0
  106. package/dist/document-projection-TDWRJX3Z.cjs +13 -0
  107. package/dist/document-projection-TDWRJX3Z.cjs.map +1 -0
  108. package/dist/document-projection-YYMC6I4U.js +4 -0
  109. package/dist/document-projection-YYMC6I4U.js.map +1 -0
  110. package/dist/index.cjs +13736 -4326
  111. package/dist/index.cjs.map +1 -1
  112. package/dist/index.d.cts +331 -493
  113. package/dist/index.d.ts +331 -493
  114. package/dist/index.js +13455 -4067
  115. package/dist/index.js.map +1 -1
  116. package/dist/middleware.cjs +38 -32
  117. package/dist/middleware.d.cts +50 -7
  118. package/dist/middleware.d.ts +50 -7
  119. package/dist/middleware.js +9 -3
  120. package/dist/migrations-2XHQEGOQ.cjs +13 -0
  121. package/dist/{migrations-566IIPS2.cjs.map → migrations-2XHQEGOQ.cjs.map} +1 -1
  122. package/dist/migrations-PE3CDVSM.js +4 -0
  123. package/dist/{migrations-H5IXZNCO.js.map → migrations-PE3CDVSM.js.map} +1 -1
  124. package/dist/{plugin-bootstrap-DfVerYV4.d.cts → plugin-bootstrap-B8ThJU21.d.cts} +4315 -1661
  125. package/dist/{plugin-bootstrap-P_ciLp_C.d.ts → plugin-bootstrap-qu8hJgUt.d.ts} +4315 -1661
  126. package/dist/plugins.cjs +171 -12
  127. package/dist/plugins.d.cts +36 -2
  128. package/dist/plugins.d.ts +36 -2
  129. package/dist/plugins.js +5 -2
  130. package/dist/rbac-O73MFKDA.js +5 -0
  131. package/dist/rbac-O73MFKDA.js.map +1 -0
  132. package/dist/rbac-VONLJJKB.cjs +14 -0
  133. package/dist/rbac-VONLJJKB.cjs.map +1 -0
  134. package/dist/routes.cjs +42 -46
  135. package/dist/routes.d.cts +56 -146
  136. package/dist/routes.d.ts +56 -146
  137. package/dist/routes.js +18 -10
  138. package/dist/services.cjs +43 -76
  139. package/dist/services.d.cts +93 -55
  140. package/dist/services.d.ts +93 -55
  141. package/dist/services.js +6 -3
  142. package/dist/{telemetry-B9vIV4wh.d.cts → telemetry-Cku1ax74.d.cts} +1 -1
  143. package/dist/{telemetry-B9vIV4wh.d.ts → telemetry-Cku1ax74.d.ts} +1 -1
  144. package/dist/templates.cjs +17 -29
  145. package/dist/templates.d.cts +2 -89
  146. package/dist/templates.d.ts +2 -89
  147. package/dist/templates.js +3 -3
  148. package/dist/types-Dea1eNxU.d.cts +286 -0
  149. package/dist/types-Dea1eNxU.d.ts +286 -0
  150. package/dist/types.d.cts +2 -2
  151. package/dist/types.d.ts +2 -2
  152. package/dist/utils.cjs +21 -20
  153. package/dist/utils.d.cts +2 -2
  154. package/dist/utils.d.ts +2 -2
  155. package/dist/utils.js +3 -2
  156. package/migrations/0001_core.sql +184 -0
  157. package/migrations/0002_documents.sql +163 -0
  158. package/package.json +12 -7
  159. package/dist/admin-layout-catalyst.template-HFD37TY5.cjs +0 -17
  160. package/dist/admin-layout-catalyst.template-UMTIN66R.js +0 -7
  161. package/dist/app-C9esKLmh.d.cts +0 -112
  162. package/dist/app-C9esKLmh.d.ts +0 -112
  163. package/dist/chunk-4NPCDK6B.js.map +0 -1
  164. package/dist/chunk-4ZSNJDLS.cjs.map +0 -1
  165. package/dist/chunk-55RDMDOP.js.map +0 -1
  166. package/dist/chunk-635JAMSE.cjs +0 -653
  167. package/dist/chunk-635JAMSE.cjs.map +0 -1
  168. package/dist/chunk-7A4CB7T3.cjs.map +0 -1
  169. package/dist/chunk-ABB34XUS.cjs.map +0 -1
  170. package/dist/chunk-BU7SFHGP.js.map +0 -1
  171. package/dist/chunk-E4YFJBM2.cjs.map +0 -1
  172. package/dist/chunk-EXNEW5US.js +0 -648
  173. package/dist/chunk-EXNEW5US.js.map +0 -1
  174. package/dist/chunk-JZV22DEV.js +0 -1783
  175. package/dist/chunk-JZV22DEV.js.map +0 -1
  176. package/dist/chunk-JZVHLLSI.cjs.map +0 -1
  177. package/dist/chunk-OCL3HMEG.js.map +0 -1
  178. package/dist/chunk-OHYBNCVL.cjs.map +0 -1
  179. package/dist/chunk-ON5ZMSU4.js.map +0 -1
  180. package/dist/chunk-QFWHAFEO.js +0 -1843
  181. package/dist/chunk-QFWHAFEO.js.map +0 -1
  182. package/dist/chunk-R4FOLLFB.cjs.map +0 -1
  183. package/dist/chunk-RLMUFFUD.cjs +0 -2219
  184. package/dist/chunk-RLMUFFUD.cjs.map +0 -1
  185. package/dist/chunk-TFNTM3OA.js.map +0 -1
  186. package/dist/chunk-UYJ6TJHX.cjs.map +0 -1
  187. package/dist/chunk-WAEQXGCX.cjs +0 -1898
  188. package/dist/chunk-WAEQXGCX.cjs.map +0 -1
  189. package/dist/chunk-XWIA3HVX.js.map +0 -1
  190. package/dist/chunk-ZYAYUIZE.js +0 -2217
  191. package/dist/chunk-ZYAYUIZE.js.map +0 -1
  192. package/dist/migrations-566IIPS2.cjs +0 -13
  193. package/dist/migrations-H5IXZNCO.js +0 -4
  194. package/dist/plugin-manager-BoM3Q7o7.d.cts +0 -328
  195. package/dist/plugin-manager-Efx9RyDX.d.ts +0 -328
  196. package/migrations/001_initial_schema.sql +0 -170
  197. package/migrations/002_faq_plugin.sql +0 -86
  198. package/migrations/003_stage5_enhancements.sql +0 -121
  199. package/migrations/004_stage6_user_management.sql +0 -183
  200. package/migrations/005_stage7_workflow_automation.sql +0 -294
  201. package/migrations/006_plugin_system.sql +0 -155
  202. package/migrations/007_demo_login_plugin.sql +0 -23
  203. package/migrations/008_fix_slug_validation.sql +0 -22
  204. package/migrations/009_system_logging.sql +0 -57
  205. package/migrations/011_config_managed_collections.sql +0 -15
  206. package/migrations/012_testimonials_plugin.sql +0 -80
  207. package/migrations/013_code_examples_plugin.sql +0 -177
  208. package/migrations/014_fix_plugin_registry.sql +0 -88
  209. package/migrations/015_add_remaining_plugins.sql +0 -89
  210. package/migrations/016_remove_duplicate_cache_plugin.sql +0 -17
  211. package/migrations/017_auth_configurable_fields.sql +0 -49
  212. package/migrations/018_settings_table.sql +0 -23
  213. package/migrations/019_remove_blog_posts_collection.sql +0 -15
  214. package/migrations/020_add_email_plugin.sql +0 -22
  215. package/migrations/021_add_magic_link_auth_plugin.sql +0 -42
  216. package/migrations/022_add_tinymce_plugin.sql +0 -25
  217. package/migrations/023_add_easy_mdx_plugin.sql +0 -25
  218. package/migrations/024_add_quill_editor_plugin.sql +0 -25
  219. package/migrations/025_add_easymde_plugin.sql +0 -25
  220. package/migrations/026_add_otp_login.sql +0 -42
  221. package/migrations/027_fix_slug_field_type.sql +0 -18
  222. package/migrations/028_fix_slug_field_type_in_schemas.sql +0 -30
  223. package/migrations/029_add_forms_system.sql +0 -184
  224. package/migrations/030_add_turnstile_to_forms.sql +0 -14
  225. package/migrations/031_ai_search_plugin.sql +0 -45
  226. package/migrations/032_user_profiles.sql +0 -37
  227. package/migrations/033_form_content_integration.sql +0 -19
  228. package/migrations/034_security_audit_plugin.sql +0 -27
  229. package/migrations/035_user_profiles_data_column.sql +0 -16
  230. package/migrations/036_analytics_events.sql +0 -22
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
  To create a new SonicJS project, use:
15
15
 
16
16
  ```bash
17
- npx create-sonicjs my-app
17
+ npx create-sonicjs@latest my-app
18
18
  ```
19
19
 
20
20
  This is the recommended way to get started with SonicJS. It sets up everything you need with a single command.
@@ -28,9 +28,9 @@ This is the recommended way to get started with SonicJS. It sets up everything y
28
28
  - 🔒 **Type-Safe**: Full TypeScript support with comprehensive type definitions
29
29
  - 🔌 **Plugin System**: Extensible architecture with hooks and middleware
30
30
  - ⚡ **Three-Tier Caching**: Memory, KV, and database layers for optimal performance
31
- - 🎨 **Admin Interface**: Beautiful glass morphism design system
32
- - 🔐 **Authentication**: JWT-based auth with role-based permissions
33
- - 📝 **Content Management**: Dynamic collections with versioning and workflows
31
+ - 🎨 **Admin Interface**: Glass-morphism design system
32
+ - 🔐 **Authentication**: Better Auth with session management and role-based permissions
33
+ - 📝 **Content Management**: Document-model collections with versioning
34
34
  - 🖼️ **Media Management**: R2 storage with automatic optimization
35
35
  - 🌐 **REST API**: Auto-generated endpoints for all collections
36
36
 
@@ -54,22 +54,24 @@ npm install wrangler drizzle-kit # For development
54
54
 
55
55
  ## 🚀 Quick Start
56
56
 
57
- ### 1. Create Your Application
57
+ ### 1. Register Collections and Create Your Application
58
58
 
59
59
  ```typescript
60
60
  // src/index.ts
61
- import { createSonicJSApp } from '@sonicjs-cms/core'
61
+ import {
62
+ createSonicJSApp,
63
+ registerCollections,
64
+ } from '@sonicjs-cms/core'
62
65
  import type { SonicJSConfig } from '@sonicjs-cms/core'
66
+ import blogPostsCollection from './collections/blog-posts.collection'
67
+
68
+ // Register code-defined collections before creating the app
69
+ registerCollections([blogPostsCollection])
63
70
 
64
71
  const config: SonicJSConfig = {
65
- collections: {
66
- directory: './src/collections',
67
- autoSync: true
68
- },
69
72
  plugins: {
70
- directory: './src/plugins',
71
- autoLoad: false
72
- }
73
+ register: [/* your plugins here */],
74
+ },
73
75
  }
74
76
 
75
77
  export default createSonicJSApp(config)
@@ -77,13 +79,16 @@ export default createSonicJSApp(config)
77
79
 
78
80
  ### 2. Define Collections
79
81
 
82
+ Collections are TypeScript config objects — no database table required.
83
+
80
84
  ```typescript
81
85
  // src/collections/blog-posts.collection.ts
82
86
  import type { CollectionConfig } from '@sonicjs-cms/core'
83
87
 
84
88
  export default {
85
- name: 'blog-posts',
86
- displayName: 'Blog Posts',
89
+ name: 'blog_post',
90
+ displayName: 'Blog Post',
91
+ slug: 'blog-posts',
87
92
  description: 'Manage your blog posts',
88
93
 
89
94
  schema: {
@@ -93,26 +98,23 @@ export default {
93
98
  type: 'string',
94
99
  title: 'Title',
95
100
  required: true,
96
- maxLength: 200
101
+ maxLength: 200,
97
102
  },
98
103
  content: {
99
- type: 'markdown',
104
+ type: 'lexical',
100
105
  title: 'Content',
101
- required: true
106
+ required: true,
102
107
  },
103
108
  publishedAt: {
104
109
  type: 'datetime',
105
- title: 'Published Date'
110
+ title: 'Published Date',
106
111
  },
107
- status: {
108
- type: 'select',
109
- title: 'Status',
110
- enum: ['draft', 'published', 'archived'],
111
- default: 'draft'
112
- }
113
112
  },
114
- required: ['title', 'content']
115
- }
113
+ required: ['title', 'content'],
114
+ },
115
+
116
+ managed: true,
117
+ isActive: true,
116
118
  } satisfies CollectionConfig
117
119
  ```
118
120
 
@@ -131,7 +133,7 @@ database_id = "your-database-id"
131
133
  migrations_dir = "./node_modules/@sonicjs-cms/core/migrations"
132
134
 
133
135
  [[r2_buckets]]
134
- binding = "BUCKET"
136
+ binding = "MEDIA_BUCKET"
135
137
  bucket_name = "my-sonicjs-media"
136
138
  ```
137
139
 
@@ -152,7 +154,7 @@ Visit `http://localhost:8787/admin` to access the admin interface.
152
154
  ### Main Application
153
155
 
154
156
  ```typescript
155
- import { createSonicJSApp } from '@sonicjs-cms/core'
157
+ import { createSonicJSApp, registerCollections } from '@sonicjs-cms/core'
156
158
  import type { SonicJSConfig, SonicJSApp, Bindings, Variables } from '@sonicjs-cms/core'
157
159
  ```
158
160
 
@@ -161,7 +163,6 @@ import type { SonicJSConfig, SonicJSApp, Bindings, Variables } from '@sonicjs-cm
161
163
  ```typescript
162
164
  import {
163
165
  loadCollectionConfigs,
164
- syncCollections,
165
166
  MigrationService,
166
167
  Logger,
167
168
  PluginService
@@ -223,8 +224,8 @@ import {
223
224
  import {
224
225
  createDb,
225
226
  users,
226
- collections,
227
227
  content,
228
+ contentVersions,
228
229
  media
229
230
  } from '@sonicjs-cms/core'
230
231
  ```
@@ -272,31 +273,29 @@ customRoutes.get('/api/custom', requireAuth(), async (c) => {
272
273
 
273
274
  // In your app config
274
275
  export default createSonicJSApp({
275
- routes: [{ path: '/custom', handler: customRoutes }]
276
+ plugins: {
277
+ register: [{ name: 'custom', version: '1.0.0', register: (app) => app.route('/custom', customRoutes) }],
278
+ },
276
279
  })
277
280
  ```
278
281
 
279
282
  ### Custom Plugin
280
283
 
281
284
  ```typescript
282
- import type { Plugin } from '@sonicjs-cms/core'
285
+ import type { Plugin, PluginContext } from '@sonicjs-cms/core'
283
286
 
284
287
  export default {
285
288
  name: 'my-plugin',
286
289
  version: '1.0.0',
287
290
  description: 'My custom plugin',
288
291
 
289
- async onActivate() {
292
+ async activate(context: PluginContext) {
290
293
  console.log('Plugin activated!')
291
294
  },
292
295
 
293
- hooks: {
294
- 'content.beforeSave': async (content) => {
295
- // Transform content before saving
296
- content.metadata = { modified: new Date() }
297
- return content
298
- }
299
- }
296
+ async install(context: PluginContext) {
297
+ // Run once on install — migrations, seed data, etc.
298
+ },
300
299
  } satisfies Plugin
301
300
  ```
302
301
 
@@ -309,7 +308,8 @@ const logger = new Logger({ category: 'custom', level: 'info' })
309
308
  logger.info('Application started')
310
309
 
311
310
  const migrationService = new MigrationService(db)
312
- await migrationService.runAllMigrations()
311
+ const status = await migrationService.getMigrationStatus()
312
+ await migrationService.ensureSchemaCompatibility()
313
313
  ```
314
314
 
315
315
  ## 🏗️ Architecture
@@ -400,24 +400,24 @@ migrations/*.sql → scripts/generate-migrations.ts → src/db/migrations-bundle
400
400
  The `generate-migrations.ts` script:
401
401
  - Reads all `.sql` files from `migrations/`
402
402
  - Generates `src/db/migrations-bundle.ts` with embedded SQL
403
- - Provides `getMigrationSQLById()` for runtime access
403
+ - Lets `MigrationService` compare bundled migrations against D1's `d1_migrations` status
404
404
 
405
- **Important**: Always rebuild after modifying migration files. The `.sql` files are not used at runtime.
405
+ **Important**: Cloudflare D1/Wrangler is the migration runner and `d1_migrations` is the canonical tracking table. Run migrations with `wrangler d1 migrations apply`; SonicJS only reports status and runs idempotent compatibility repairs at bootstrap.
406
406
 
407
407
  ## 🔄 Versioning
408
408
 
409
409
  SonicJS follows semantic versioning:
410
410
 
411
- - **v2.x.x** - Current npm package (core extracted)
412
- - **v1.x.x** - Legacy monolith (deprecated)
411
+ - **v3.x.x** - Current (document model, Better Auth, edge-first)
412
+ - **v2.x.x** - Legacy monolith (deprecated)
413
413
 
414
- **Current Version**: `2.0.0-alpha.1`
414
+ **Current Version**: `3.0.0-beta.9`
415
415
 
416
416
  ### Upgrade Path
417
417
 
418
418
  ```bash
419
- # Install the new package
420
- npm install @sonicjs-cms/core@2.0.0-alpha.1
419
+ # Install the latest package
420
+ npm install @sonicjs-cms/core@latest
421
421
 
422
422
  # Run any new migrations
423
423
  wrangler d1 migrations apply DB
@@ -466,12 +466,12 @@ MIT © SonicJS Team - See [LICENSE](./LICENSE) for details.
466
466
 
467
467
  ## 🛡️ Security
468
468
 
469
- - JWT authentication
470
- - Role-based access control (RBAC)
469
+ - Better Auth (sessions + RBAC)
470
+ - Role-based access control
471
471
  - Permission system
472
472
  - Secure headers
473
473
  - Input sanitization
474
474
 
475
475
  ---
476
476
 
477
- **Built with ❤️ for the edge** | v2.0.0-alpha.1
477
+ **Built with ❤️ for the edge** | v3.0.0-beta.9
@@ -0,0 +1,6 @@
1
+ export { renderDocumentFormPage, renderVersionHistoryFragment } from './chunk-RMRJGMDE.js';
2
+ import './chunk-5V62WT6M.js';
3
+ import './chunk-TQABQWOP.js';
4
+ import './chunk-V4OQ3NZ2.js';
5
+ //# sourceMappingURL=admin-documents-form.template-DDSH6ROU.js.map
6
+ //# sourceMappingURL=admin-documents-form.template-DDSH6ROU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-UMTIN66R.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-documents-form.template-DDSH6ROU.js"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var chunkN32OWET6_cjs = require('./chunk-N32OWET6.cjs');
4
+ require('./chunk-K623Q6WD.cjs');
5
+ require('./chunk-MNWKYY5E.cjs');
6
+ require('./chunk-IGJUBJBW.cjs');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "renderDocumentFormPage", {
11
+ enumerable: true,
12
+ get: function () { return chunkN32OWET6_cjs.renderDocumentFormPage; }
13
+ });
14
+ Object.defineProperty(exports, "renderVersionHistoryFragment", {
15
+ enumerable: true,
16
+ get: function () { return chunkN32OWET6_cjs.renderVersionHistoryFragment; }
17
+ });
18
+ //# sourceMappingURL=admin-documents-form.template-LSZKGA5J.cjs.map
19
+ //# sourceMappingURL=admin-documents-form.template-LSZKGA5J.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-HFD37TY5.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-documents-form.template-LSZKGA5J.cjs"}
@@ -1,3 +1,5 @@
1
+ import { HtmlEscapedString } from 'hono/utils/html';
2
+
1
3
  interface FormField {
2
4
  name: string;
3
5
  label: string;
@@ -138,4 +140,26 @@ interface FilterBarData {
138
140
  }
139
141
  declare function renderFilterBar(data: FilterBarData): string;
140
142
 
141
- export { type AlertData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type FilterBarData as a, type FilterOption as b, type FormData as c, type FormField as d, type TableData as e, renderConfirmationDialog as f, getConfirmationDialogScript as g, renderFilterBar as h, renderForm as i, renderFormField as j, renderPagination as k, renderTable as l, renderAlert as r };
143
+ interface AdminLayoutCatalystData {
144
+ title: string;
145
+ pageTitle?: string;
146
+ currentPath?: string;
147
+ version?: string;
148
+ enableExperimentalFeatures?: boolean;
149
+ user?: {
150
+ name: string;
151
+ email: string;
152
+ role: string;
153
+ };
154
+ scripts?: string[];
155
+ styles?: string[];
156
+ content: string | HtmlEscapedString;
157
+ dynamicMenuItems?: Array<{
158
+ label: string;
159
+ path: string;
160
+ icon: string;
161
+ }>;
162
+ }
163
+ declare function renderAdminLayoutCatalyst(data: AdminLayoutCatalystData): string;
164
+
165
+ export { type AdminLayoutCatalystData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type AlertData as a, type FilterBarData as b, type FilterOption as c, type FormData as d, type FormField as e, type TableData as f, getConfirmationDialogScript as g, renderAlert as h, renderConfirmationDialog as i, renderFilterBar as j, renderForm as k, renderFormField as l, renderPagination as m, renderTable as n, renderAdminLayoutCatalyst as r };
@@ -1,3 +1,5 @@
1
+ import { HtmlEscapedString } from 'hono/utils/html';
2
+
1
3
  interface FormField {
2
4
  name: string;
3
5
  label: string;
@@ -138,4 +140,26 @@ interface FilterBarData {
138
140
  }
139
141
  declare function renderFilterBar(data: FilterBarData): string;
140
142
 
141
- export { type AlertData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type FilterBarData as a, type FilterOption as b, type FormData as c, type FormField as d, type TableData as e, renderConfirmationDialog as f, getConfirmationDialogScript as g, renderFilterBar as h, renderForm as i, renderFormField as j, renderPagination as k, renderTable as l, renderAlert as r };
143
+ interface AdminLayoutCatalystData {
144
+ title: string;
145
+ pageTitle?: string;
146
+ currentPath?: string;
147
+ version?: string;
148
+ enableExperimentalFeatures?: boolean;
149
+ user?: {
150
+ name: string;
151
+ email: string;
152
+ role: string;
153
+ };
154
+ scripts?: string[];
155
+ styles?: string[];
156
+ content: string | HtmlEscapedString;
157
+ dynamicMenuItems?: Array<{
158
+ label: string;
159
+ path: string;
160
+ icon: string;
161
+ }>;
162
+ }
163
+ declare function renderAdminLayoutCatalyst(data: AdminLayoutCatalystData): string;
164
+
165
+ export { type AdminLayoutCatalystData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type AlertData as a, type FilterBarData as b, type FilterOption as c, type FormData as d, type FormField as e, type TableData as f, getConfirmationDialogScript as g, renderAlert as h, renderConfirmationDialog as i, renderFilterBar as j, renderForm as k, renderFormField as l, renderPagination as m, renderTable as n, renderAdminLayoutCatalyst as r };
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ var chunkK623Q6WD_cjs = require('./chunk-K623Q6WD.cjs');
4
+ require('./chunk-IGJUBJBW.cjs');
5
+
6
+ chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
7
+
8
+ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
9
+ enumerable: true,
10
+ get: function () { return chunkK623Q6WD_cjs.renderAdminLayoutCatalyst; }
11
+ });
12
+ Object.defineProperty(exports, "renderCatalystCheckbox", {
13
+ enumerable: true,
14
+ get: function () { return chunkK623Q6WD_cjs.renderCatalystCheckbox; }
15
+ });
16
+ Object.defineProperty(exports, "setBranchLabel", {
17
+ enumerable: true,
18
+ get: function () { return chunkK623Q6WD_cjs.setBranchLabel; }
19
+ });
20
+ //# sourceMappingURL=admin-layout-catalyst.template-KDHKVLXR.cjs.map
21
+ //# sourceMappingURL=admin-layout-catalyst.template-KDHKVLXR.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-KDHKVLXR.cjs"}
@@ -0,0 +1,7 @@
1
+ import { init_admin_layout_catalyst_template } from './chunk-5V62WT6M.js';
2
+ export { renderAdminLayoutCatalyst, renderCatalystCheckbox, setBranchLabel } from './chunk-5V62WT6M.js';
3
+ import './chunk-V4OQ3NZ2.js';
4
+
5
+ init_admin_layout_catalyst_template();
6
+ //# sourceMappingURL=admin-layout-catalyst.template-YQ4EMF2J.js.map
7
+ //# sourceMappingURL=admin-layout-catalyst.template-YQ4EMF2J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-YQ4EMF2J.js"}