sandcms 0.5.2
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/LICENSE +57 -0
- package/README.md +84 -0
- package/dist/Image.svelte +53 -0
- package/dist/Image.svelte.d.ts +10 -0
- package/dist/Seo.svelte +29 -0
- package/dist/Seo.svelte.d.ts +10 -0
- package/dist/admin/Access.svelte +129 -0
- package/dist/admin/Access.svelte.d.ts +7 -0
- package/dist/admin/Account.svelte +190 -0
- package/dist/admin/Account.svelte.d.ts +7 -0
- package/dist/admin/Admin.svelte +42 -0
- package/dist/admin/Admin.svelte.d.ts +8 -0
- package/dist/admin/AssetAttachment.svelte +77 -0
- package/dist/admin/AssetAttachment.svelte.d.ts +15 -0
- package/dist/admin/Collection.svelte +52 -0
- package/dist/admin/Collection.svelte.d.ts +7 -0
- package/dist/admin/Dashboard.svelte +105 -0
- package/dist/admin/Dashboard.svelte.d.ts +7 -0
- package/dist/admin/Editor.svelte +192 -0
- package/dist/admin/Editor.svelte.d.ts +7 -0
- package/dist/admin/Fields.svelte +221 -0
- package/dist/admin/Fields.svelte.d.ts +17 -0
- package/dist/admin/Gallery.svelte +130 -0
- package/dist/admin/Gallery.svelte.d.ts +16 -0
- package/dist/admin/Inbox.svelte +154 -0
- package/dist/admin/Inbox.svelte.d.ts +8 -0
- package/dist/admin/Login.svelte +104 -0
- package/dist/admin/Login.svelte.d.ts +7 -0
- package/dist/admin/MediaLibrary.svelte +231 -0
- package/dist/admin/MediaLibrary.svelte.d.ts +7 -0
- package/dist/admin/MediaPicker.svelte +273 -0
- package/dist/admin/MediaPicker.svelte.d.ts +16 -0
- package/dist/admin/Notice.svelte +13 -0
- package/dist/admin/Notice.svelte.d.ts +8 -0
- package/dist/admin/NotificationSettings.svelte +153 -0
- package/dist/admin/NotificationSettings.svelte.d.ts +7 -0
- package/dist/admin/RichText.svelte +103 -0
- package/dist/admin/RichText.svelte.d.ts +9 -0
- package/dist/admin/RichTextLink.svelte +71 -0
- package/dist/admin/RichTextLink.svelte.d.ts +7 -0
- package/dist/admin/SelectField.svelte +39 -0
- package/dist/admin/SelectField.svelte.d.ts +15 -0
- package/dist/admin/Shell.svelte +106 -0
- package/dist/admin/Shell.svelte.d.ts +9 -0
- package/dist/admin/SortableList.svelte +104 -0
- package/dist/admin/SortableList.svelte.d.ts +30 -0
- package/dist/admin/UnsavedChanges.svelte +54 -0
- package/dist/admin/UnsavedChanges.svelte.d.ts +6 -0
- package/dist/admin/UploadButton.svelte +42 -0
- package/dist/admin/UploadButton.svelte.d.ts +10 -0
- package/dist/admin/UploadQueue.svelte +40 -0
- package/dist/admin/UploadQueue.svelte.d.ts +7 -0
- package/dist/admin/Users.svelte +185 -0
- package/dist/admin/Users.svelte.d.ts +7 -0
- package/dist/admin/client.d.ts +720 -0
- package/dist/admin/client.js +29 -0
- package/dist/admin/components/ui/alert/alert-action.svelte +20 -0
- package/dist/admin/components/ui/alert/alert-action.svelte.d.ts +5 -0
- package/dist/admin/components/ui/alert/alert-description.svelte +23 -0
- package/dist/admin/components/ui/alert/alert-description.svelte.d.ts +5 -0
- package/dist/admin/components/ui/alert/alert-title.svelte +23 -0
- package/dist/admin/components/ui/alert/alert-title.svelte.d.ts +5 -0
- package/dist/admin/components/ui/alert/alert.svelte +44 -0
- package/dist/admin/components/ui/alert/alert.svelte.d.ts +26 -0
- package/dist/admin/components/ui/alert/index.d.ts +6 -0
- package/dist/admin/components/ui/alert/index.js +8 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-action.svelte +27 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +9 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-cancel.svelte +27 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +9 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-content.svelte +32 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-content.svelte.d.ts +11 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-description.svelte +20 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-description.svelte.d.ts +4 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-footer.svelte +23 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-footer.svelte.d.ts +5 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-header.svelte +23 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-header.svelte.d.ts +5 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-media.svelte +23 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-media.svelte.d.ts +5 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-overlay.svelte +20 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-overlay.svelte.d.ts +4 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-portal.svelte +7 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-portal.svelte.d.ts +3 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-title.svelte +20 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-title.svelte.d.ts +4 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-trigger.svelte +7 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog-trigger.svelte.d.ts +4 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog.svelte +7 -0
- package/dist/admin/components/ui/alert-dialog/alert-dialog.svelte.d.ts +3 -0
- package/dist/admin/components/ui/alert-dialog/index.d.ts +13 -0
- package/dist/admin/components/ui/alert-dialog/index.js +15 -0
- package/dist/admin/components/ui/attachment/attachment-action.svelte +21 -0
- package/dist/admin/components/ui/attachment/attachment-action.svelte.d.ts +4 -0
- package/dist/admin/components/ui/attachment/attachment-actions.svelte +23 -0
- package/dist/admin/components/ui/attachment/attachment-actions.svelte.d.ts +5 -0
- package/dist/admin/components/ui/attachment/attachment-content.svelte +23 -0
- package/dist/admin/components/ui/attachment/attachment-content.svelte.d.ts +5 -0
- package/dist/admin/components/ui/attachment/attachment-description.svelte +24 -0
- package/dist/admin/components/ui/attachment/attachment-description.svelte.d.ts +5 -0
- package/dist/admin/components/ui/attachment/attachment-group.svelte +23 -0
- package/dist/admin/components/ui/attachment/attachment-group.svelte.d.ts +5 -0
- package/dist/admin/components/ui/attachment/attachment-media.svelte +44 -0
- package/dist/admin/components/ui/attachment/attachment-media.svelte.d.ts +26 -0
- package/dist/admin/components/ui/attachment/attachment-title.svelte +23 -0
- package/dist/admin/components/ui/attachment/attachment-title.svelte.d.ts +5 -0
- package/dist/admin/components/ui/attachment/attachment-trigger.svelte +29 -0
- package/dist/admin/components/ui/attachment/attachment-trigger.svelte.d.ts +11 -0
- package/dist/admin/components/ui/attachment/attachment.svelte +54 -0
- package/dist/admin/components/ui/attachment/attachment.svelte.d.ts +45 -0
- package/dist/admin/components/ui/attachment/index.d.ts +10 -0
- package/dist/admin/components/ui/attachment/index.js +12 -0
- package/dist/admin/components/ui/avatar/avatar-badge.svelte +26 -0
- package/dist/admin/components/ui/avatar/avatar-badge.svelte.d.ts +5 -0
- package/dist/admin/components/ui/avatar/avatar-fallback.svelte +20 -0
- package/dist/admin/components/ui/avatar/avatar-fallback.svelte.d.ts +4 -0
- package/dist/admin/components/ui/avatar/avatar-group-count.svelte +23 -0
- package/dist/admin/components/ui/avatar/avatar-group-count.svelte.d.ts +5 -0
- package/dist/admin/components/ui/avatar/avatar-group.svelte +23 -0
- package/dist/admin/components/ui/avatar/avatar-group.svelte.d.ts +5 -0
- package/dist/admin/components/ui/avatar/avatar-image.svelte +17 -0
- package/dist/admin/components/ui/avatar/avatar-image.svelte.d.ts +4 -0
- package/dist/admin/components/ui/avatar/avatar.svelte +26 -0
- package/dist/admin/components/ui/avatar/avatar.svelte.d.ts +7 -0
- package/dist/admin/components/ui/avatar/index.d.ts +7 -0
- package/dist/admin/components/ui/avatar/index.js +9 -0
- package/dist/admin/components/ui/badge/badge.svelte +50 -0
- package/dist/admin/components/ui/badge/badge.svelte.d.ts +38 -0
- package/dist/admin/components/ui/badge/index.d.ts +2 -0
- package/dist/admin/components/ui/badge/index.js +2 -0
- package/dist/admin/components/ui/button/button.svelte +87 -0
- package/dist/admin/components/ui/button/button.svelte.d.ts +70 -0
- package/dist/admin/components/ui/button/index.d.ts +2 -0
- package/dist/admin/components/ui/button/index.js +4 -0
- package/dist/admin/components/ui/card/card-action.svelte +20 -0
- package/dist/admin/components/ui/card/card-action.svelte.d.ts +5 -0
- package/dist/admin/components/ui/card/card-content.svelte +20 -0
- package/dist/admin/components/ui/card/card-content.svelte.d.ts +5 -0
- package/dist/admin/components/ui/card/card-description.svelte +20 -0
- package/dist/admin/components/ui/card/card-description.svelte.d.ts +5 -0
- package/dist/admin/components/ui/card/card-footer.svelte +20 -0
- package/dist/admin/components/ui/card/card-footer.svelte.d.ts +5 -0
- package/dist/admin/components/ui/card/card-header.svelte +23 -0
- package/dist/admin/components/ui/card/card-header.svelte.d.ts +5 -0
- package/dist/admin/components/ui/card/card-title.svelte +20 -0
- package/dist/admin/components/ui/card/card-title.svelte.d.ts +5 -0
- package/dist/admin/components/ui/card/card.svelte +25 -0
- package/dist/admin/components/ui/card/card.svelte.d.ts +8 -0
- package/dist/admin/components/ui/card/index.d.ts +8 -0
- package/dist/admin/components/ui/card/index.js +10 -0
- package/dist/admin/components/ui/checkbox/checkbox.svelte +39 -0
- package/dist/admin/components/ui/checkbox/checkbox.svelte.d.ts +4 -0
- package/dist/admin/components/ui/checkbox/index.d.ts +2 -0
- package/dist/admin/components/ui/checkbox/index.js +4 -0
- package/dist/admin/components/ui/dialog/dialog-close.svelte +11 -0
- package/dist/admin/components/ui/dialog/dialog-close.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dialog/dialog-content.svelte +48 -0
- package/dist/admin/components/ui/dialog/dialog-content.svelte.d.ts +13 -0
- package/dist/admin/components/ui/dialog/dialog-description.svelte +20 -0
- package/dist/admin/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dialog/dialog-footer.svelte +32 -0
- package/dist/admin/components/ui/dialog/dialog-footer.svelte.d.ts +8 -0
- package/dist/admin/components/ui/dialog/dialog-header.svelte +20 -0
- package/dist/admin/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
- package/dist/admin/components/ui/dialog/dialog-overlay.svelte +20 -0
- package/dist/admin/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dialog/dialog-portal.svelte +7 -0
- package/dist/admin/components/ui/dialog/dialog-portal.svelte.d.ts +3 -0
- package/dist/admin/components/ui/dialog/dialog-title.svelte +17 -0
- package/dist/admin/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dialog/dialog-trigger.svelte +11 -0
- package/dist/admin/components/ui/dialog/dialog-trigger.svelte.d.ts +4 -0
- package/dist/admin/components/ui/dialog/dialog.svelte +7 -0
- package/dist/admin/components/ui/dialog/dialog.svelte.d.ts +3 -0
- package/dist/admin/components/ui/dialog/index.d.ts +11 -0
- package/dist/admin/components/ui/dialog/index.js +13 -0
- package/dist/admin/components/ui/input/index.d.ts +2 -0
- package/dist/admin/components/ui/input/index.js +4 -0
- package/dist/admin/components/ui/input/input.svelte +48 -0
- package/dist/admin/components/ui/input/input.svelte.d.ts +13 -0
- package/dist/admin/components/ui/label/index.d.ts +2 -0
- package/dist/admin/components/ui/label/index.js +4 -0
- package/dist/admin/components/ui/label/label.svelte +20 -0
- package/dist/admin/components/ui/label/label.svelte.d.ts +4 -0
- package/dist/admin/components/ui/select/index.d.ts +13 -0
- package/dist/admin/components/ui/select/index.js +15 -0
- package/dist/admin/components/ui/select/select-content.svelte +45 -0
- package/dist/admin/components/ui/select/select-content.svelte.d.ts +11 -0
- package/dist/admin/components/ui/select/select-group-heading.svelte +21 -0
- package/dist/admin/components/ui/select/select-group-heading.svelte.d.ts +10 -0
- package/dist/admin/components/ui/select/select-group.svelte +17 -0
- package/dist/admin/components/ui/select/select-group.svelte.d.ts +4 -0
- package/dist/admin/components/ui/select/select-item.svelte +42 -0
- package/dist/admin/components/ui/select/select-item.svelte.d.ts +4 -0
- package/dist/admin/components/ui/select/select-label.svelte +20 -0
- package/dist/admin/components/ui/select/select-label.svelte.d.ts +6 -0
- package/dist/admin/components/ui/select/select-portal.svelte +7 -0
- package/dist/admin/components/ui/select/select-portal.svelte.d.ts +3 -0
- package/dist/admin/components/ui/select/select-scroll-down-button.svelte +23 -0
- package/dist/admin/components/ui/select/select-scroll-down-button.svelte.d.ts +4 -0
- package/dist/admin/components/ui/select/select-scroll-up-button.svelte +23 -0
- package/dist/admin/components/ui/select/select-scroll-up-button.svelte.d.ts +4 -0
- package/dist/admin/components/ui/select/select-separator.svelte +18 -0
- package/dist/admin/components/ui/select/select-separator.svelte.d.ts +4 -0
- package/dist/admin/components/ui/select/select-trigger.svelte +29 -0
- package/dist/admin/components/ui/select/select-trigger.svelte.d.ts +8 -0
- package/dist/admin/components/ui/select/select-value.svelte +7 -0
- package/dist/admin/components/ui/select/select-value.svelte.d.ts +4 -0
- package/dist/admin/components/ui/select/select.svelte +11 -0
- package/dist/admin/components/ui/select/select.svelte.d.ts +3 -0
- package/dist/admin/components/ui/separator/index.d.ts +2 -0
- package/dist/admin/components/ui/separator/index.js +4 -0
- package/dist/admin/components/ui/separator/separator.svelte +21 -0
- package/dist/admin/components/ui/separator/separator.svelte.d.ts +4 -0
- package/dist/admin/components/ui/switch/index.d.ts +2 -0
- package/dist/admin/components/ui/switch/index.js +4 -0
- package/dist/admin/components/ui/switch/switch.svelte +34 -0
- package/dist/admin/components/ui/switch/switch.svelte.d.ts +8 -0
- package/dist/admin/components/ui/table/index.d.ts +9 -0
- package/dist/admin/components/ui/table/index.js +11 -0
- package/dist/admin/components/ui/table/table-body.svelte +20 -0
- package/dist/admin/components/ui/table/table-body.svelte.d.ts +5 -0
- package/dist/admin/components/ui/table/table-caption.svelte +20 -0
- package/dist/admin/components/ui/table/table-caption.svelte.d.ts +5 -0
- package/dist/admin/components/ui/table/table-cell.svelte +20 -0
- package/dist/admin/components/ui/table/table-cell.svelte.d.ts +5 -0
- package/dist/admin/components/ui/table/table-footer.svelte +20 -0
- package/dist/admin/components/ui/table/table-footer.svelte.d.ts +5 -0
- package/dist/admin/components/ui/table/table-head.svelte +23 -0
- package/dist/admin/components/ui/table/table-head.svelte.d.ts +5 -0
- package/dist/admin/components/ui/table/table-header.svelte +20 -0
- package/dist/admin/components/ui/table/table-header.svelte.d.ts +5 -0
- package/dist/admin/components/ui/table/table-row.svelte +23 -0
- package/dist/admin/components/ui/table/table-row.svelte.d.ts +5 -0
- package/dist/admin/components/ui/table/table.svelte +22 -0
- package/dist/admin/components/ui/table/table.svelte.d.ts +5 -0
- package/dist/admin/components/ui/textarea/index.d.ts +2 -0
- package/dist/admin/components/ui/textarea/index.js +4 -0
- package/dist/admin/components/ui/textarea/textarea.svelte +22 -0
- package/dist/admin/components/ui/textarea/textarea.svelte.d.ts +5 -0
- package/dist/admin/components/ui/toggle/index.d.ts +3 -0
- package/dist/admin/components/ui/toggle/index.js +5 -0
- package/dist/admin/components/ui/toggle/toggle.svelte +52 -0
- package/dist/admin/components/ui/toggle/toggle.svelte.d.ts +43 -0
- package/dist/admin/generated/FONT-LICENSE +93 -0
- package/dist/admin/generated/Geist-LICENSE.txt +93 -0
- package/dist/admin/generated/admin.css +3276 -0
- package/dist/admin/generated/fonts/geist-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-cyrillic-wght-italic.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-latin-ext-wght-italic.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-latin-wght-italic.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-latin-wght-normal.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-vietnamese-wght-italic.woff2 +0 -0
- package/dist/admin/generated/fonts/geist-vietnamese-wght-normal.woff2 +0 -0
- package/dist/admin/generated/geist-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/admin/generated/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/admin/generated/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/admin/generated/geist-latin-wght-normal.woff2 +0 -0
- package/dist/admin/generated/geist-vietnamese-wght-normal.woff2 +0 -0
- package/dist/admin/generated/styles.css +2772 -0
- package/dist/admin/index.d.ts +2 -0
- package/dist/admin/index.js +1 -0
- package/dist/admin/types.d.ts +63 -0
- package/dist/admin/types.js +1 -0
- package/dist/admin/uploads.d.ts +12 -0
- package/dist/admin/uploads.js +23 -0
- package/dist/admin/utils.d.ts +11 -0
- package/dist/admin/utils.js +1 -0
- package/dist/blueprints/files.d.ts +7 -0
- package/dist/blueprints/files.js +112 -0
- package/dist/blueprints/gallery.d.ts +3 -0
- package/dist/blueprints/gallery.js +14 -0
- package/dist/blueprints/load.d.ts +6 -0
- package/dist/blueprints/load.js +186 -0
- package/dist/blueprints/merge.d.ts +2 -0
- package/dist/blueprints/merge.js +18 -0
- package/dist/blueprints/types.d.ts +58 -0
- package/dist/blueprints/types.js +1 -0
- package/dist/blueprints/validate.d.ts +8 -0
- package/dist/blueprints/validate.js +133 -0
- package/dist/cli/backup.d.ts +6 -0
- package/dist/cli/backup.js +85 -0
- package/dist/cli/cloudflare.d.ts +8 -0
- package/dist/cli/cloudflare.js +123 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +56 -0
- package/dist/cli/files.d.ts +30 -0
- package/dist/cli/files.js +114 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +182 -0
- package/dist/cli/prompts.d.ts +5 -0
- package/dist/cli/prompts.js +41 -0
- package/dist/cli/scaffold.d.ts +2 -0
- package/dist/cli/scaffold.js +58 -0
- package/dist/cli/setup.d.ts +11 -0
- package/dist/cli/setup.js +116 -0
- package/dist/cli/upgrade.d.ts +1 -0
- package/dist/cli/upgrade.js +47 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/media.d.ts +26 -0
- package/dist/media.js +27 -0
- package/dist/notification-fields.d.ts +8 -0
- package/dist/notification-fields.js +26 -0
- package/dist/richtext.d.ts +14 -0
- package/dist/richtext.js +73 -0
- package/dist/server/access.d.ts +16 -0
- package/dist/server/access.js +216 -0
- package/dist/server/admin-load.d.ts +342 -0
- package/dist/server/admin-load.js +135 -0
- package/dist/server/api.d.ts +3 -0
- package/dist/server/api.js +144 -0
- package/dist/server/auth.d.ts +744 -0
- package/dist/server/auth.js +142 -0
- package/dist/server/blueprint-icons.d.ts +4 -0
- package/dist/server/blueprint-icons.js +14 -0
- package/dist/server/cms.d.ts +1054 -0
- package/dist/server/cms.js +58 -0
- package/dist/server/content.d.ts +101 -0
- package/dist/server/content.js +285 -0
- package/dist/server/db/migration-data.d.ts +4 -0
- package/dist/server/db/migration-data.js +7 -0
- package/dist/server/db/migrations/0000_foundation.sql +180 -0
- package/dist/server/db/migrations/meta/0000_snapshot.json +1188 -0
- package/dist/server/db/migrations/meta/_journal.json +13 -0
- package/dist/server/db/schema.d.ts +2212 -0
- package/dist/server/db/schema.js +171 -0
- package/dist/server/db/store.d.ts +33 -0
- package/dist/server/db/store.js +131 -0
- package/dist/server/email/index.d.ts +50 -0
- package/dist/server/email/index.js +175 -0
- package/dist/server/email/template.d.ts +8 -0
- package/dist/server/email/template.js +53 -0
- package/dist/server/forms.d.ts +40 -0
- package/dist/server/forms.js +84 -0
- package/dist/server/hooks.d.ts +3 -0
- package/dist/server/hooks.js +85 -0
- package/dist/server/http.d.ts +3 -0
- package/dist/server/http.js +3 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +7 -0
- package/dist/server/media/delivery.d.ts +3 -0
- package/dist/server/media/delivery.js +42 -0
- package/dist/server/media/presets.d.ts +2 -0
- package/dist/server/media/presets.js +8 -0
- package/dist/server/media/runner.d.ts +2 -0
- package/dist/server/media/runner.js +128 -0
- package/dist/server/media/service.d.ts +144 -0
- package/dist/server/media/service.js +280 -0
- package/dist/server/notifications.d.ts +9 -0
- package/dist/server/notifications.js +161 -0
- package/dist/server/request.d.ts +2 -0
- package/dist/server/request.js +39 -0
- package/dist/server/seo.d.ts +12 -0
- package/dist/server/seo.js +62 -0
- package/dist/worker/index.d.ts +10 -0
- package/dist/worker/index.js +266 -0
- package/dist/worker/source.d.ts +2 -0
- package/dist/worker/source.js +31 -0
- package/dist/worker/svg.d.ts +5 -0
- package/dist/worker/svg.js +142 -0
- package/docs/acceptance.md +58 -0
- package/docs/cloudflare.md +146 -0
- package/docs/content.md +188 -0
- package/docs/deployment.md +89 -0
- package/docs/email.md +124 -0
- package/docs/forms.md +18 -0
- package/docs/media.md +105 -0
- package/docs/package.md +84 -0
- package/docs/releases.md +29 -0
- package/docs/upgrades.md +62 -0
- package/package.json +124 -0
- package/templates/dockerignore +15 -0
- package/templates/hooks.server.ts +4 -0
- package/templates/integration.ts +20 -0
- package/templates/railpack.json +7 -0
- package/templates/routes/admin/+page.server.ts +3 -0
- package/templates/routes/admin/+page.svelte +6 -0
- package/templates/routes/api/+server.ts +4 -0
- package/templates/sandcms/blueprints/collections/photographers.yaml +6 -0
- package/templates/sandcms/blueprints/collections/projects.yaml +26 -0
- package/templates/sandcms/blueprints/files/image.yaml +6 -0
- package/templates/sandcms/blueprints/forms/registration.yaml +15 -0
- package/templates/sandcms/blueprints/pages/home.yaml +9 -0
- package/templates/sandcms/blueprints/site.yaml +13 -0
- package/templates/sandcms/config.yaml +12 -0
- package/templates/sandcms/worker/index.ts +1 -0
- package/templates/sandcms/worker/wrangler.jsonc +7 -0
package/docs/media.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Media
|
|
2
|
+
|
|
3
|
+
The website's Bun process owns SQLite and the durable media job runner. Image processing and private storage run separately. Public images use the website's media route, which supports browser and CDN caching. See [Cloudflare setup and operations](cloudflare.md) for local development, Worker/R2 provisioning, proxy configuration, and copy-paste cache rules.
|
|
4
|
+
|
|
5
|
+
Input is capped at the configured limit (at most 100 MB), SVG at 1 MB, raster dimensions at 100 megapixels, and each encoded output at 20 MB. Encoded variants are bounded and buffered before writing to R2, which requires a known body length. These limits bound local resource use; verify the preset matrix and practical limits against staging before release.
|
|
6
|
+
|
|
7
|
+
Raster encoding uses [Cloudflare remote transformations](https://developers.cloudflare.com/images/optimization/transformations/transform-via-workers/) with a 100 MB / 100 MP input ceiling. The Images binding remains configured for dimension inspection only; its 20 MB `.input()` encoding path is no longer used. Originals stream through private R2 staging objects for validation before promotion, so the Worker does not buffer a 100 MB upload. Failed validation removes staging objects. After an interrupted Worker invocation, abandoned `incoming/` objects can be removed with an R2 lifecycle rule restricted to that prefix.
|
|
8
|
+
|
|
9
|
+
## Presets
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
media:
|
|
13
|
+
workerUrl: https://your-project-media.example.workers.dev
|
|
14
|
+
defaultFileBlueprint: image
|
|
15
|
+
uploadLimit: 100000000
|
|
16
|
+
presets:
|
|
17
|
+
card:
|
|
18
|
+
sizes: [400, 800, 1200]
|
|
19
|
+
formats: { webp: 80, avif: 65 }
|
|
20
|
+
hero:
|
|
21
|
+
sizes: [1200, 1920]
|
|
22
|
+
formats: { webp: 85 }
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Sizes are longest-side pixels. Outputs preserve aspect ratio and do not upscale. Formats are WebP, AVIF, and JPEG, each with quality 1–100. The default upload cap and configured maximum are 100 MB (100,000,000 bytes). Raster input is additionally limited to 100 megapixels. SVG is limited to 1 MB and is sanitized using a strict XML parser and allowlists; scripts, foreign content, external references, event handlers, and styles are removed. Document types/entities are rejected. The sanitized derivative receives restrictive CSP and nosniff headers, and is not resized or encoded as WebP.
|
|
26
|
+
|
|
27
|
+
## Privacy and publication
|
|
28
|
+
|
|
29
|
+
Originals remain in private R2 storage. Only the processor can mint a five-minute HMAC-signed source URL for one raster asset; it is never included in CMS responses or public media metadata. A media asset becomes publicly accessible only when at least one **published snapshot** references it through a media field, media list, or gallery (including nested fields). Uploading to the library, saving a draft, and preparing variants grant no public access. Sharing an asset with published content makes its active variants public even if it is also used in drafts.
|
|
30
|
+
|
|
31
|
+
`cmsHandle` serves public variants at `/_sandcms/media/{key}`. It checks the current published references and active variant set before fetching bytes from the Worker's authenticated `/internal/media/{key}` endpoint. Direct Worker `/media/` URLs no longer work. Removing the last published reference—by unpublishing, deleting content, or publishing a replacement—revokes access at the origin. Cached copies can remain available. Draft edits leave the existing published snapshot and its images live. Requests reaching the origin cannot access historical variant sets after replacement; previously cached versions can remain available.
|
|
32
|
+
|
|
33
|
+
Editor previews use `/api/cms/media/{key}` and require an active admin/editor session with no pending password change. Originals have no editor or public delivery endpoint. Query-based transformations are rejected. Processing uses remote transformations against the Worker’s `/internal/source/{id}` endpoint. Every source request verifies its asset-scoped signature and expiry, then streams the original with `private, no-store`. Unsigned requests, changed signatures, expired URLs, and non-GET methods receive 404. The source handler never performs transformations, avoiding fetch loops. Treat signed URLs as credentials: keep them out of application logs and client responses. Cloudflare caches transformed results internally by source URL; expiry is checked at the source and does not purge Cloudflare’s transformation cache. Signed source URLs must remain secret even after expiry. This processing cache is separate from published website delivery.
|
|
34
|
+
|
|
35
|
+
Successful public responses use `Cache-Control: public, max-age=86400, s-maxage=2592000`: one day of browser freshness and 30 days in shared caches. Public responses preserve ETags and support `If-None-Match` revalidation for GET and HEAD, including weak validators, lists, and `*`. The CMS checks current access before and after the Worker request, including before returning a cacheable `304`. Cache hits bypass these checks. Cached availability after unpublishing, deletion, or variant replacement is intentional; immediate revocation is not promised. Cache retention is not guaranteed, so a cold location can return 404 while a warm cache still serves the image.
|
|
36
|
+
|
|
37
|
+
Editor previews and all delivery errors use `Cache-Control: private, no-store` and omit ETags. Preview responses vary by cookie; public responses are independent of sessions. Never cache private previews. Already downloaded images cannot be recalled. See [Cloudflare cache setup, verification, and removal](cloudflare.md#website-proxy-and-public-image-caching).
|
|
38
|
+
|
|
39
|
+
Publication does not move files or require cache registration. Uploads get distinct asset IDs and preset changes produce distinct variant URLs. Rebuilds reuse existing completed variants rather than overwriting them. Do not replace bytes under an existing URL: processing changes that alter output must introduce a new variant version. The public policy deliberately does not advertise `immutable`.
|
|
40
|
+
|
|
41
|
+
Use `cms.media.publicAsset(id)` with `imageSources()` for public content. For an authenticated draft preview, use `cms.media.previewAsset(id)` after `cms.read(..., event)` has authorized the preview. Returned variants carry the correct delivery URLs for `Image` and `imageSources(asset, preset)`. Use `previewGallery(rows, field)` for authenticated gallery previews. Preview metadata alone grants no access to bytes.
|
|
42
|
+
|
|
43
|
+
## Consumer Image component
|
|
44
|
+
|
|
45
|
+
Import the Svelte component from the package root and pass the asset returned by
|
|
46
|
+
`cms.media.publicAsset(id)`:
|
|
47
|
+
|
|
48
|
+
Each variant includes a `url` using the CMS public or authenticated preview route.
|
|
49
|
+
The component needs no URL configuration. `SANDCMS_WORKER_URL` (falling back to
|
|
50
|
+
`media.workerUrl` in YAML) configures only the server's private Worker connection.
|
|
51
|
+
|
|
52
|
+
```svelte
|
|
53
|
+
<script lang="ts">
|
|
54
|
+
import { Image } from '@sandquist-group/sandcms';
|
|
55
|
+
let { data } = $props();
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<!-- Responsive card preset, automatically sized to its rendered width. -->
|
|
59
|
+
<Image asset={data.image} class="card-image" />
|
|
60
|
+
|
|
61
|
+
<!-- Choose a named preset. Eager images should describe their layout with sizes. -->
|
|
62
|
+
<Image asset={data.image} preset="hero" loading="eager" sizes="(max-width: 1000px) 100vw, 1000px" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`preset` selects a named conversion from your media config (default `card`).
|
|
66
|
+
The browser selects from that preset's generated widths according to
|
|
67
|
+
layout and pixel density. Lazy loading and asynchronous decoding are defaults;
|
|
68
|
+
native `sizes="auto"` uses the rendered width in supporting browsers. The `sizes`
|
|
69
|
+
prop supplies the fallback for other browsers and the layout size for eager images.
|
|
70
|
+
Without it, the fallback uses the `width` prop if supplied, otherwise `100vw`.
|
|
71
|
+
For constrained layouts, provide `sizes` for accurate selection across browsers.
|
|
72
|
+
|
|
73
|
+
The component supplies each variant's actual pixel width through `srcset`. For
|
|
74
|
+
example, a 300 CSS-pixel image typically uses a 400px source on a 1× screen and an
|
|
75
|
+
800px source on a 2× screen when those widths are available. The browser makes the
|
|
76
|
+
final choice and may reuse a larger cached image. No new image is generated on demand.
|
|
77
|
+
|
|
78
|
+
Null assets and unavailable presets render nothing. SVG uses its single
|
|
79
|
+
sanitized derivative regardless of preset. Existing active variants remain
|
|
80
|
+
usable during rebuilds.
|
|
81
|
+
|
|
82
|
+
Alt text and intrinsic dimensions come from the asset; `alt=""` marks a decorative
|
|
83
|
+
image. Standard image attributes such as `class`, `style`, `width`, `height`,
|
|
84
|
+
`loading`, `fetchpriority`, and event handlers are forwarded to the `<img>`.
|
|
85
|
+
The component emits a `<picture>` with AVIF, WebP, then JPEG sources when available,
|
|
86
|
+
and adds no styling or admin dependencies. Consumers control layout with their own CSS.
|
|
87
|
+
`imageSources(asset, preset)` remains available for custom markup.
|
|
88
|
+
|
|
89
|
+
## Processing and rebuild
|
|
90
|
+
|
|
91
|
+
Uploads enter a temporary SQLite blob spool, then a job sends the original to R2 and removes the spool. Jobs have durable attempts, bounded leases, retry delays, and failure state. Restarting the website resumes pending/expired jobs. The media library shows processing/ready/failed and permits retries. An asset's old active set remains available throughout a rebuild.
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
bun x --no-install sandcms media rebuild
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Rebuild compares the current preset hash, schedules missing sets, shows progress, and exits nonzero for failures. It does not delete old variants. Ordinary image reuse does not enqueue transformations. Configure a later reviewed cleanup operation if you need to remove unreferenced historical variant keys.
|
|
98
|
+
|
|
99
|
+
Editable asset fields come from file blueprints. If a blueprint declares a photographer relation, it references that field’s configured collection. Publish a photographer's rename to update public credits; deletion clears the credit. Deletion displays known draft/published usages and allows confirmation without additional permission escalation.
|
|
100
|
+
|
|
101
|
+
## Bulk uploads and galleries
|
|
102
|
+
|
|
103
|
+
The library and multi-image pickers accept multiple files in one selection. Files upload sequentially through the existing bounded per-file endpoint, in selection order. Progress counts completed attempts; errors name each failed file, and later files still upload. Successful uploads remain available when another file fails. Select failed files again to retry an upload; use the library's processing retry for files already accepted by the server.
|
|
104
|
+
|
|
105
|
+
Use a `gallery` field for ordered images. Its file blueprint defines available metadata; `overrides` explicitly enables per-placement editing of selected fields. A gallery without overrides displays images and ordering controls only. See [gallery configuration](content.md#galleries-and-project-specific-metadata). Both galleries and `media-list` fields support drag handles and arrow controls for ordering.
|
package/docs/package.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Installation and packaging
|
|
2
|
+
|
|
3
|
+
`@sandquist-group/sandcms` is a private package in the paid `sandquist-group` npm organization. It includes the CMS runtime, admin UI, `sandcms` terminal command, required route templates, and a minimal SvelteKit starter. There is no separate starter package.
|
|
4
|
+
|
|
5
|
+
## Publish from macOS
|
|
6
|
+
|
|
7
|
+
Use Bun **1.4.0**, Node **26.8.1**, and npm (included with Node). Run these commands from the repository root after pulling the changes:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bun --version
|
|
11
|
+
node --version
|
|
12
|
+
npm login --registry=https://registry.npmjs.org/
|
|
13
|
+
npm whoami --registry=https://registry.npmjs.org/
|
|
14
|
+
bun install --frozen-lockfile
|
|
15
|
+
bun run release:check
|
|
16
|
+
npm pack --dry-run
|
|
17
|
+
npm pack --pack-destination /tmp
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This release produces `/tmp/sandquist-group-sandcms-0.5.1.tgz`. `npm pack` builds the package through `prepack`; it packages only the allowlisted distribution, templates, documentation, and package metadata. The repository's example website, tests, databases, and environment files are excluded. `release:check` checks types, runs unit tests, inspects an npm archive, and installs/builds that archive in both a fresh starter and an existing SvelteKit site.
|
|
21
|
+
|
|
22
|
+
Upload the archive you just built:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm publish /tmp/sandquist-group-sandcms-0.5.1.tgz --access restricted --registry=https://registry.npmjs.org/
|
|
26
|
+
npm view @sandquist-group/sandcms@0.5.1 version --registry=https://registry.npmjs.org/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Complete npm's authentication/2FA prompts. The logged-in account must have publishing permission in `sandquist-group`. The package also defaults to restricted access and the npmjs registry in `publishConfig`. Do not set `private: true` on this package: that prevents publication entirely. Generated websites do set it.
|
|
30
|
+
|
|
31
|
+
For later releases, increment `version` in `package.json` (for example, `npm version patch --no-git-tag-version`), repeat the checks and packing, and publish the resulting archive filename. npm versions cannot be overwritten. The CLI reads its package version when creating starter dependencies and integration manifests.
|
|
32
|
+
|
|
33
|
+
## Create a starter from npm
|
|
34
|
+
|
|
35
|
+
After publishing, authenticate as a user with read access to the package, then run:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npm login --registry=https://registry.npmjs.org/
|
|
39
|
+
bunx --bun --package @sandquist-group/sandcms@0.5.1 sandcms setup --cwd ./my-site
|
|
40
|
+
cd my-site
|
|
41
|
+
bun run dev
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Setup asks for the project name and initial local admin email. The generated site includes a minimal public home page, `/admin/[...path]`, `/api/cms/[...path]`, the server hook/integration, YAML blueprints, and a local database. [Cloudflare media setup](cloudflare.md) is optional. This is a Bun application; Node alone cannot run the CMS.
|
|
45
|
+
|
|
46
|
+
For an existing SvelteKit project, run the same setup command with `--cwd` pointing to that project and review `sandcms/setup-report.md`. Inside an installed project, use the local CLI:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
bunx --no-install sandcms --help
|
|
50
|
+
bunx --no-install sandcms doctor
|
|
51
|
+
bunx --no-install sandcms migrate --check
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Install the local package
|
|
55
|
+
|
|
56
|
+
From this repository:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
bun install --frozen-lockfile
|
|
60
|
+
bun run package
|
|
61
|
+
bun pm pack --ignore-scripts --filename /tmp/sandcms.tgz
|
|
62
|
+
mkdir /tmp/my-sandcms-site
|
|
63
|
+
bun dist/cli/index.js setup --cwd /tmp/my-sandcms-site --package /tmp/sandcms.tgz
|
|
64
|
+
cd /tmp/my-sandcms-site
|
|
65
|
+
bun run dev
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`setup --dry-run --name "Example"` only prints the integration plan. `--yes` skips optional prompts and Cloudflare; `--skip-install` is useful in fixture tests. `--email` optionally supplies a local bootstrap email. Never pass passwords as command arguments.
|
|
69
|
+
|
|
70
|
+
A fresh site receives SvelteKit, TypeScript, the pinned Bun adapter, a public starter page, CMS route glue, starter YAML, environment values, and a local database. An existing site must already be a SvelteKit project. Setup checks reserved routes and leaves custom hooks, adapters, config, and public routes intact. Read `sandcms/setup-report.md` and apply the hook composition patch if needed. Existing JavaScript hooks are recognized; setup does not shadow them with a TypeScript file. Tailwind, ESLint, Prettier, Vitest, and Playwright are individually optional website add-ons.
|
|
71
|
+
|
|
72
|
+
The built package contains Svelte admin components, compiled CSS/fonts, server code, CLI, reviewed migrations, Worker source, and templates. `bun run test:package` installs and builds it in a clean fixture without Tailwind and verifies a customized existing site.
|
|
73
|
+
|
|
74
|
+
## Private registry use
|
|
75
|
+
|
|
76
|
+
Publish only after completing the release checks and configuring your organization. Install a pinned package version with Bun and commit the lockfile. Authenticate through your registry's supported secret mechanism. A consumer may use an ignored/user-level npm config containing a token reference such as `${NPM_TOKEN}`; never put the token value in a tracked file or image layer. In CI, supply the registry token as a secret, install with `bun install --frozen-lockfile`, and do not expose that token to the running website.
|
|
77
|
+
|
|
78
|
+
The repository CI checks the packed artifact, including CLI execution and public/admin builds. A registry-authenticated private npm install remains a release-environment check.
|
|
79
|
+
|
|
80
|
+
## CSS isolation
|
|
81
|
+
|
|
82
|
+
`Admin` imports the compiled stylesheet and bundled licensed Geist fonts. Styles live inside native CSS `@scope (.sandcms-admin)`; custom properties, layers, fonts, and animations are namespaced. Dialogs remain inside that boundary. The public website is free to use its own styling system.
|
|
83
|
+
|
|
84
|
+
This requires browsers with native CSS `@scope` support. It is not a shadow DOM boundary: host selectors can still target admin elements, and root font sizing affects rem units. Run `bun run styles` after editing Tailwind classes when developing the package; builds and checks regenerate it automatically.
|
package/docs/releases.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Release notes
|
|
2
|
+
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
Raises raster upload support to 100 MB and image dimensions to 100 MP, with variant encoding through remote Cloudflare image transformations.
|
|
6
|
+
|
|
7
|
+
- Uses private, five-minute signed source URLs and media Worker protocol 3. Internal source URLs stay out of upload responses.
|
|
8
|
+
- Extends original-upload timeouts to 120 seconds and keeps upload leases longer than the request timeout.
|
|
9
|
+
- Versions rebuilt media variants so existing published variants remain available until their replacements are ready.
|
|
10
|
+
- Keeps SVG uploads limited to 1 MB and encoded variants to 20 MB.
|
|
11
|
+
|
|
12
|
+
Upgrade the website and protocol-3 media Worker together; older protocol combinations are incompatible. Enable Cloudflare image transformations, retain the `MEDIA` and `IMAGES` bindings and the shared CMS/Worker token, and verify the deployed processing flow in staging. See [media deployment](cloudflare.md).
|
|
13
|
+
|
|
14
|
+
The default and maximum `media.uploadLimit` are now `100000000` bytes. Existing project-owned YAML limits are preserved; edit `sandcms/config.yaml` to opt into 100 MB. Set `BODY_SIZE_LIMIT=101M` for the Bun adapter and allow multipart overhead in upstream proxies. Run `sandcms media rebuild` to regenerate existing assets with the new processing version.
|
|
15
|
+
|
|
16
|
+
There is no database schema change in 0.5.1. Databases compatible with 0.5.0 retain their data and need no new migration or reset. Follow the [upgrade workflow](upgrades.md) for backup, integration updates, Worker deployment, and recovery.
|
|
17
|
+
|
|
18
|
+
## 0.5.0
|
|
19
|
+
|
|
20
|
+
The first release with a retained database migration history. The existing foundation migration is frozen; future package schema changes will ship as incremental SQL migrations.
|
|
21
|
+
|
|
22
|
+
- Added `bun run db:generate --name descriptive_change` for contributors. It generates incremental SQL and Drizzle metadata and refreshes the embedded migrations shipped in the package.
|
|
23
|
+
- Disabled baseline regeneration at 0.5.0 and later.
|
|
24
|
+
- Tightened migration validation to reject gaps in applied history and mismatches with SQLite's schema version.
|
|
25
|
+
- Verified upgrades preserve existing rows, repeated migration does nothing, and a failed increment rolls back and can be retried.
|
|
26
|
+
|
|
27
|
+
There is no schema change in 0.5.0 itself. Existing databases with the exact foundation migration remain compatible. Databases with different pre-0.5.0 baselines still require explicit fresh initialization; no historical data conversion is included.
|
|
28
|
+
|
|
29
|
+
Before upgrading, take a verified backup with the installed package. Review integration changes and pending migrations, apply them, then rebuild and restart. See the [upgrade workflow](upgrades.md) for commands, recovery, and legacy reset instructions. Project-owned YAML and customized application files remain protected.
|
package/docs/upgrades.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Updates and generated files
|
|
2
|
+
|
|
3
|
+
## 0.5.1: 100 MB / 100 MP media processing
|
|
4
|
+
|
|
5
|
+
Deploy the protocol-3 media Worker and website together; older protocol combinations fail clearly. Raster encoding now uses remote transformations and private, five-minute signed source URLs. Keep the `MEDIA` and `IMAGES` bindings (Images is still used for dimension inspection) and the same CMS/Worker token. Enable Cloudflare image transformations for the Worker’s account and verify the deployed source and transformation flow in staging; local mocks do not prove production limits or caching behavior.
|
|
6
|
+
|
|
7
|
+
The default and maximum `media.uploadLimit` are now `100000000`. Existing explicit YAML limits are preserved on installed sites; edit your project-owned `sandcms/config.yaml` to opt into 100 MB. Set the Bun adapter’s `BODY_SIZE_LIMIT=101M` and allow multipart overhead in upstream proxies. SVG remains limited to 1 MB and encoded variants to 20 MB.
|
|
8
|
+
|
|
9
|
+
The new processing version gives rebuilt variants new keys; existing published variants remain available until each replacement set is ready. Run `sandcms media rebuild` to regenerate existing assets. No database migration or reset is required. See [media operations](cloudflare.md) for signed-source privacy and deployment checks.
|
|
10
|
+
|
|
11
|
+
## From 0.5.0: retained migrations
|
|
12
|
+
|
|
13
|
+
Release 0.5.0 freezes `0000_foundation.sql` without changing its SQL or hash. Future schema changes append numbered migrations. Fresh installations apply the full history; supported databases apply only pending migrations, preserving existing data. Repeated migration is a no-op.
|
|
14
|
+
|
|
15
|
+
Each migration runs in its own transaction. If one fails, that migration's SQL and history entry roll back; earlier completed migrations remain applied. Fix the cause and rerun. Modified hashes, missing history entries, and databases newer than the installed package are rejected. Use the matching package for inspection or recovery; never reset a supported database to bypass validation.
|
|
16
|
+
|
|
17
|
+
Before updating, stop website and job processes and take a verified backup using the installed package. Install the new package, review `sandcms upgrade --check` and `sandcms migrate --check`, apply integration updates and migrations, then rebuild and restart. Use `--database PATH` when the target differs from the configured database. Rollback requires the matching old package and its verified backup; down migrations are not provided.
|
|
18
|
+
|
|
19
|
+
### Changing the schema in this repository
|
|
20
|
+
|
|
21
|
+
1. Edit `src/lib/server/db/schema.ts` and update its callers and fixtures.
|
|
22
|
+
2. Run `bun run db:generate --name descriptive_change`. Drizzle generates the next SQL migration and snapshot and appends its journal entry; the script refreshes embedded `migration-data.ts` for bundler compatibility.
|
|
23
|
+
3. Review SQL for data preservation, constraints, and compatibility with the transactional SQLite runner. Include any required data transformations in the new, unreleased migration. Never rewrite released migrations or snapshots.
|
|
24
|
+
4. Commit the schema, new migration artifacts, embedded SQL, code, tests, and documentation together.
|
|
25
|
+
5. Run `bun run release:check`. Cover fresh initialization, upgrades with existing data, repeated migration, rollback on failure, and incompatible history rejection.
|
|
26
|
+
|
|
27
|
+
`bun scripts/migrations.ts` only refreshes embedded SQL. Packaging includes the complete retained history. `bun run db:baseline` is disabled at 0.5.0 and later. Never use `drizzle-kit push` against deployed databases.
|
|
28
|
+
|
|
29
|
+
## Moving from pre-0.5.0
|
|
30
|
+
|
|
31
|
+
A database using the exact frozen baseline can continue unchanged. Earlier development databases with a different baseline hash require a fresh database; no historical conversion is provided. The CLI rejects incompatible databases without erasing them. Back up with their matching old package before updating. Unrelated code changes do not require a reset.
|
|
32
|
+
|
|
33
|
+
### Recreating a development database
|
|
34
|
+
|
|
35
|
+
Stop every website, media job runner, and CLI process using the database. If you need to retain the old state, create a verified backup **with its matching old package version before updating**. Backups are useful with that matching version; restoring one does not convert it to the new schema.
|
|
36
|
+
|
|
37
|
+
Explicitly choose a fresh SQLite path, or remove the disposable database and its `-wal` and `-shm` sidecars after stopping all processes. For the repository's default local database, an intentional reset is:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
# Destructive: deletes local accounts, content, submissions, and media records.
|
|
41
|
+
rm -f ./data/sandcms.sqlite ./data/sandcms.sqlite-wal ./data/sandcms.sqlite-shm
|
|
42
|
+
bun run dev:init
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For installed sites, initialize the fresh database with `sandcms migrate --database PATH` and then `sandcms user bootstrap --database PATH`. Update the application's database setting if you chose a new path. Recreate content and re-upload media as needed. Resetting SQLite does not delete objects in R2; old uploads are not imported into the fresh database.
|
|
46
|
+
|
|
47
|
+
## Generated application files and configuration
|
|
48
|
+
|
|
49
|
+
Install a specific new package version with Bun and commit its lockfile. Update developer-owned YAML to the current configuration format. Database migrations cover package-owned SQL schema. Project-owned field renames and blueprint changes require an explicit content/configuration migration plan; SQL migrations do not rewrite YAML.
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
bun x --no-install sandcms upgrade --check
|
|
53
|
+
bun x --no-install sandcms upgrade
|
|
54
|
+
bun x --no-install sandcms migrate --check
|
|
55
|
+
bun x --no-install sandcms migrate
|
|
56
|
+
# Separately, when the release requires Worker changes:
|
|
57
|
+
bun x --no-install sandcms worker update
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
These commands assume a compatible or fresh database. `upgrade --check` validates blueprints, checks recorded ownership and database compatibility, and prints a no-write report. `upgrade` compares generated files with hashes in `sandcms/install.json`. Unmodified generated files receive new templates. Edited files are preserved by default, with a unified diff and an explicit overwrite choice in an interactive terminal. Cancelling a prompt still produces the report without applying file changes. These ownership protections remain in place for upgrades.
|
|
61
|
+
|
|
62
|
+
Use the matching protocol-3 Worker and website package; incompatible internal requests fail. See [media deployment](media.md). A media preset change requires `media rebuild`; old active variant sets remain live until each new set completes.
|
package/package.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sandcms",
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev": "bun run styles && bun --bun vite dev",
|
|
6
|
+
"build": "bun run validate && bun run styles && bun --bun vite build && bun run package",
|
|
7
|
+
"start": "bun build/index.js",
|
|
8
|
+
"styles": "bun scripts/styles.ts",
|
|
9
|
+
"prepare": "bun x svelte-kit sync",
|
|
10
|
+
"package": "bun scripts/migrations.ts && bun run styles && svelte-kit sync && svelte-package && publint",
|
|
11
|
+
"prepack": "bun run package",
|
|
12
|
+
"check": "bun run styles && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
13
|
+
"test": "bun test tests",
|
|
14
|
+
"test:e2e": "bun x playwright test",
|
|
15
|
+
"cli": "bun src/lib/cli/index.ts",
|
|
16
|
+
"format": "prettier --write .",
|
|
17
|
+
"dev:init": "bun scripts/dev-init.ts",
|
|
18
|
+
"test:package": "bun run package && bun scripts/test-package.ts",
|
|
19
|
+
"worker:dev": "bun x wrangler dev --config sandcms/worker/wrangler.jsonc --local --port 8787",
|
|
20
|
+
"validate": "bun src/lib/cli/index.ts validate",
|
|
21
|
+
"test:container": "bun scripts/test-container.ts",
|
|
22
|
+
"preview:network": "bun scripts/preview-network.ts",
|
|
23
|
+
"release:check": "bun run check && bun test tests && bun run test:package",
|
|
24
|
+
"db:baseline": "bun scripts/migrations.ts --baseline",
|
|
25
|
+
"db:generate": "bun scripts/migrations.ts --generate"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"templates",
|
|
30
|
+
"docs",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"!dist/server/sandcms"
|
|
34
|
+
],
|
|
35
|
+
"sideEffects": [
|
|
36
|
+
"**/*.css"
|
|
37
|
+
],
|
|
38
|
+
"svelte": "./dist/index.js",
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"type": "module",
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"default": "./dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./server": {
|
|
47
|
+
"types": "./dist/server/index.d.ts",
|
|
48
|
+
"default": "./dist/server/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./admin": {
|
|
51
|
+
"types": "./dist/admin/index.d.ts",
|
|
52
|
+
"svelte": "./dist/admin/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./admin/styles.css": "./dist/admin/generated/admin.css",
|
|
55
|
+
"./worker": "./dist/worker/index.js"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"svelte": "^5.0.0",
|
|
59
|
+
"@sveltejs/kit": "^2.70.3"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@fontsource-variable/geist": "5.3.0",
|
|
63
|
+
"@playwright/test": "1.63.0",
|
|
64
|
+
"@sveltejs/kit": "2.70.3",
|
|
65
|
+
"@sveltejs/package": "2.5.8",
|
|
66
|
+
"@sveltejs/vite-plugin-svelte": "7.3.1",
|
|
67
|
+
"@tailwindcss/cli": "4.3.3",
|
|
68
|
+
"@types/nodemailer": "8.0.2",
|
|
69
|
+
"@types/smtp-server": "3.5.13",
|
|
70
|
+
"drizzle-kit": "0.31.11",
|
|
71
|
+
"postcss": "8.5.28",
|
|
72
|
+
"prettier": "3.9.9",
|
|
73
|
+
"prettier-plugin-svelte": "4.1.1",
|
|
74
|
+
"publint": "0.3.24",
|
|
75
|
+
"shadcn-svelte": "1.7.0",
|
|
76
|
+
"smtp-server": "3.19.13",
|
|
77
|
+
"svelte": "5.57.1",
|
|
78
|
+
"svelte-adapter-bun": "1.0.1",
|
|
79
|
+
"svelte-check": "4.7.6",
|
|
80
|
+
"tailwindcss": "4.3.3",
|
|
81
|
+
"tw-animate-css": "1.4.0",
|
|
82
|
+
"typescript": "6.0.3",
|
|
83
|
+
"vite": "8.3.1",
|
|
84
|
+
"wrangler": "4.140.0"
|
|
85
|
+
},
|
|
86
|
+
"keywords": [
|
|
87
|
+
"svelte"
|
|
88
|
+
],
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"@clack/prompts": "1.8.1",
|
|
91
|
+
"@cloudflare/workers-types": "5.20260925.1",
|
|
92
|
+
"@internationalized/date": "3.12.4",
|
|
93
|
+
"@lucide/svelte": "1.48.0",
|
|
94
|
+
"@tiptap/core": "3.31.3",
|
|
95
|
+
"@tiptap/starter-kit": "3.31.3",
|
|
96
|
+
"@types/bun": "1.4.2",
|
|
97
|
+
"better-auth": "1.7.6",
|
|
98
|
+
"bits-ui": "2.19.3",
|
|
99
|
+
"cn": "0.3.3",
|
|
100
|
+
"diff": "9.0.0",
|
|
101
|
+
"dotenv": "18.0.3",
|
|
102
|
+
"drizzle-orm": "0.45.3",
|
|
103
|
+
"jsonc-parser": "3.3.1",
|
|
104
|
+
"lucide": "1.48.0",
|
|
105
|
+
"nodemailer": "10.0.11",
|
|
106
|
+
"saxes": "6.0.0",
|
|
107
|
+
"tailwind-variants": "3.3.1",
|
|
108
|
+
"yaml": "2.9.1",
|
|
109
|
+
"zod": "4.6.5"
|
|
110
|
+
},
|
|
111
|
+
"description": "A Bun and SvelteKit CMS with repository-owned YAML blueprints",
|
|
112
|
+
"packageManager": "bun@1.4.0",
|
|
113
|
+
"engines": {
|
|
114
|
+
"bun": "1.4.x"
|
|
115
|
+
},
|
|
116
|
+
"bin": {
|
|
117
|
+
"sandcms": "./dist/cli/index.js"
|
|
118
|
+
},
|
|
119
|
+
"publishConfig": {
|
|
120
|
+
"access": "restricted",
|
|
121
|
+
"registry": "https://registry.npmjs.org/"
|
|
122
|
+
},
|
|
123
|
+
"license": "PolyForm-Strict-1.0.0"
|
|
124
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { env } from '$env/dynamic/private';
|
|
2
|
+
import { createCMS, emailOptionsFromEnv, type CMS } from '@sandquist-group/sandcms/server';
|
|
3
|
+
let instance: CMS;
|
|
4
|
+
export function getCMS() {
|
|
5
|
+
if (!instance) {
|
|
6
|
+
instance = createCMS({
|
|
7
|
+
// Enable CMS-owned SEO routes after mapping your public pages:
|
|
8
|
+
// seo: { routes: { home: '/', projects: '/projects/{slug}' } },
|
|
9
|
+
database: env.SANDCMS_DATABASE ?? './data/sandcms.sqlite',
|
|
10
|
+
origin: env.SANDCMS_ORIGIN ?? 'http://localhost:5410',
|
|
11
|
+
secret: env.SANDCMS_SECRET ?? '',
|
|
12
|
+
email: emailOptionsFromEnv(env),
|
|
13
|
+
workerToken: env.SANDCMS_WORKER_TOKEN,
|
|
14
|
+
workerUrl: env.SANDCMS_WORKER_URL,
|
|
15
|
+
trustedProxyHeader: env.SANDCMS_TRUSTED_PROXY_HEADER
|
|
16
|
+
});
|
|
17
|
+
instance.media.start();
|
|
18
|
+
}
|
|
19
|
+
return instance;
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
id: projects
|
|
2
|
+
label: Projects
|
|
3
|
+
icon: image
|
|
4
|
+
kind: collection
|
|
5
|
+
preview: /projects/{slug}
|
|
6
|
+
fields:
|
|
7
|
+
title: { type: text, required: true }
|
|
8
|
+
slug:
|
|
9
|
+
{ type: slug, from: title, required: true, description: Used by this website's project route. }
|
|
10
|
+
summary: { type: textarea }
|
|
11
|
+
body: { type: richtext, label: Story }
|
|
12
|
+
photographer: { type: relation, collection: photographers }
|
|
13
|
+
gallery:
|
|
14
|
+
type: gallery
|
|
15
|
+
label: Gallery
|
|
16
|
+
fileBlueprint: image
|
|
17
|
+
overrides: [alt]
|
|
18
|
+
description: Upload images together, arrange their order, and set details for this project.
|
|
19
|
+
featured: { type: boolean }
|
|
20
|
+
date: { type: date }
|
|
21
|
+
seo:
|
|
22
|
+
type: group
|
|
23
|
+
label: Search appearance
|
|
24
|
+
fields:
|
|
25
|
+
title: { type: text }
|
|
26
|
+
description: { type: textarea }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
id: registration
|
|
2
|
+
label: Theatre registration
|
|
3
|
+
kind: form
|
|
4
|
+
columns: [participant, program, email]
|
|
5
|
+
export: [participant, birthDate, email, phone, address, program, gender, experience, guardian]
|
|
6
|
+
fields:
|
|
7
|
+
participant: { type: text, label: Participant name }
|
|
8
|
+
birthDate: { type: date, label: Birth date }
|
|
9
|
+
email: { type: text, label: Contact email }
|
|
10
|
+
phone: { type: text }
|
|
11
|
+
address: { type: textarea }
|
|
12
|
+
program: { type: text, label: Program choices }
|
|
13
|
+
gender: { type: text }
|
|
14
|
+
experience: { type: textarea, label: Previous experience }
|
|
15
|
+
guardian: { type: text, label: Guardian contact }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
id: site
|
|
2
|
+
label: Site settings
|
|
3
|
+
kind: site
|
|
4
|
+
fields:
|
|
5
|
+
title: { type: text, label: Site title, required: true }
|
|
6
|
+
description: { type: textarea, label: SEO description }
|
|
7
|
+
navigation:
|
|
8
|
+
type: repeatable
|
|
9
|
+
label: Navigation
|
|
10
|
+
fields:
|
|
11
|
+
label: { type: text, required: true }
|
|
12
|
+
url: { type: text, required: true }
|
|
13
|
+
contact: { type: text, label: Contact email }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: SandCMS Studio
|
|
2
|
+
media:
|
|
3
|
+
workerUrl: http://localhost:8787
|
|
4
|
+
defaultFileBlueprint: image
|
|
5
|
+
uploadLimit: 100000000 # At most 100 MB; originals always remain private.
|
|
6
|
+
presets:
|
|
7
|
+
card:
|
|
8
|
+
sizes: [400, 800, 1200]
|
|
9
|
+
formats: { webp: 80 }
|
|
10
|
+
hero:
|
|
11
|
+
sizes: [1200, 1920]
|
|
12
|
+
formats: { webp: 85 }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@sandquist-group/sandcms/worker';
|