@ekrist1/vulse 0.1.6-alpha.3
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 +21 -0
- package/README.md +104 -0
- package/dist/admin/client/active-locale.d.ts +3 -0
- package/dist/admin/client/active-locale.d.ts.map +1 -0
- package/dist/admin/client/active-locale.js +14 -0
- package/dist/admin/client/api.d.ts +14 -0
- package/dist/admin/client/api.d.ts.map +1 -0
- package/dist/admin/client/api.js +26 -0
- package/dist/admin/client/form-from-zod.d.ts +2 -0
- package/dist/admin/client/form-from-zod.d.ts.map +1 -0
- package/dist/admin/client/form-from-zod.js +1 -0
- package/dist/admin/client/live-preview-enabled.d.ts +3 -0
- package/dist/admin/client/live-preview-enabled.d.ts.map +1 -0
- package/dist/admin/client/live-preview-enabled.js +6 -0
- package/dist/cli/collection-scaffold.d.ts +14 -0
- package/dist/cli/collection-scaffold.d.ts.map +1 -0
- package/dist/cli/collection-scaffold.js +44 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +74 -0
- package/dist/cli/migrate.d.ts +5 -0
- package/dist/cli/migrate.d.ts.map +1 -0
- package/dist/cli/migrate.js +10 -0
- package/dist/cli/platform.d.ts +12 -0
- package/dist/cli/platform.d.ts.map +1 -0
- package/dist/cli/platform.js +38 -0
- package/dist/cli/seed-admin.d.ts +19 -0
- package/dist/cli/seed-admin.d.ts.map +1 -0
- package/dist/cli/seed-admin.js +59 -0
- package/dist/cli/setup.d.ts +29 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +254 -0
- package/dist/core/access.d.ts +5 -0
- package/dist/core/access.d.ts.map +1 -0
- package/dist/core/access.js +6 -0
- package/dist/core/blocks/schema.d.ts +81 -0
- package/dist/core/blocks/schema.d.ts.map +1 -0
- package/dist/core/blocks/schema.js +54 -0
- package/dist/core/blueprints/code-to-definition.d.ts +6 -0
- package/dist/core/blueprints/code-to-definition.d.ts.map +1 -0
- package/dist/core/blueprints/code-to-definition.js +147 -0
- package/dist/core/blueprints/compile.d.ts +10 -0
- package/dist/core/blueprints/compile.d.ts.map +1 -0
- package/dist/core/blueprints/compile.js +153 -0
- package/dist/core/blueprints/define.d.ts +6 -0
- package/dist/core/blueprints/define.d.ts.map +1 -0
- package/dist/core/blueprints/define.js +8 -0
- package/dist/core/blueprints/definition.d.ts +963 -0
- package/dist/core/blueprints/definition.d.ts.map +1 -0
- package/dist/core/blueprints/definition.js +151 -0
- package/dist/core/blueprints/load.d.ts +11 -0
- package/dist/core/blueprints/load.d.ts.map +1 -0
- package/dist/core/blueprints/load.js +137 -0
- package/dist/core/blueprints/mutations.d.ts +8 -0
- package/dist/core/blueprints/mutations.d.ts.map +1 -0
- package/dist/core/blueprints/mutations.js +191 -0
- package/dist/core/blueprints/preview-path.d.ts +15 -0
- package/dist/core/blueprints/preview-path.d.ts.map +1 -0
- package/dist/core/blueprints/preview-path.js +25 -0
- package/dist/core/blueprints/reflect-fields.d.ts +36 -0
- package/dist/core/blueprints/reflect-fields.d.ts.map +1 -0
- package/dist/core/blueprints/reflect-fields.js +229 -0
- package/dist/core/blueprints/registry.d.ts +9 -0
- package/dist/core/blueprints/registry.d.ts.map +1 -0
- package/dist/core/blueprints/registry.js +11 -0
- package/dist/core/blueprints/seed.d.ts +5 -0
- package/dist/core/blueprints/seed.d.ts.map +1 -0
- package/dist/core/blueprints/seed.js +17 -0
- package/dist/core/blueprints/select-helpers.d.ts +10 -0
- package/dist/core/blueprints/select-helpers.d.ts.map +1 -0
- package/dist/core/blueprints/select-helpers.js +26 -0
- package/dist/core/blueprints/seo.d.ts +41 -0
- package/dist/core/blueprints/seo.d.ts.map +1 -0
- package/dist/core/blueprints/seo.js +125 -0
- package/dist/core/blueprints/types.d.ts +60 -0
- package/dist/core/blueprints/types.d.ts.map +1 -0
- package/dist/core/blueprints/types.js +1 -0
- package/dist/core/blueprints/zod-helpers.d.ts +79 -0
- package/dist/core/blueprints/zod-helpers.d.ts.map +1 -0
- package/dist/core/blueprints/zod-helpers.js +72 -0
- package/dist/core/db.d.ts +7 -0
- package/dist/core/db.d.ts.map +1 -0
- package/dist/core/db.js +8 -0
- package/dist/core/errors.d.ts +21 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +29 -0
- package/dist/core/forms/compile.d.ts +9 -0
- package/dist/core/forms/compile.d.ts.map +1 -0
- package/dist/core/forms/compile.js +80 -0
- package/dist/core/forms/definition.d.ts +226 -0
- package/dist/core/forms/definition.d.ts.map +1 -0
- package/dist/core/forms/definition.js +83 -0
- package/dist/core/forms/rate-limit.d.ts +10 -0
- package/dist/core/forms/rate-limit.d.ts.map +1 -0
- package/dist/core/forms/rate-limit.js +31 -0
- package/dist/core/forms/unique.d.ts +5 -0
- package/dist/core/forms/unique.d.ts.map +1 -0
- package/dist/core/forms/unique.js +30 -0
- package/dist/core/globals/compile.d.ts +13 -0
- package/dist/core/globals/compile.d.ts.map +1 -0
- package/dist/core/globals/compile.js +17 -0
- package/dist/core/globals/definition.d.ts +161 -0
- package/dist/core/globals/definition.d.ts.map +1 -0
- package/dist/core/globals/definition.js +23 -0
- package/dist/core/locales.d.ts +14 -0
- package/dist/core/locales.d.ts.map +1 -0
- package/dist/core/locales.js +35 -0
- package/dist/core/migrations.d.ts +3 -0
- package/dist/core/migrations.d.ts.map +1 -0
- package/dist/core/migrations.js +41 -0
- package/dist/core/parse-content.d.ts +14 -0
- package/dist/core/parse-content.d.ts.map +1 -0
- package/dist/core/parse-content.js +68 -0
- package/dist/core/plugins/definition.d.ts +99 -0
- package/dist/core/plugins/definition.d.ts.map +1 -0
- package/dist/core/plugins/definition.js +10 -0
- package/dist/core/preview-content.d.ts +16 -0
- package/dist/core/preview-content.d.ts.map +1 -0
- package/dist/core/preview-content.js +8 -0
- package/dist/core/repos/entries.d.ts +102 -0
- package/dist/core/repos/entries.d.ts.map +1 -0
- package/dist/core/repos/entries.js +393 -0
- package/dist/core/repos/forms.d.ts +82 -0
- package/dist/core/repos/forms.d.ts.map +1 -0
- package/dist/core/repos/forms.js +199 -0
- package/dist/core/repos/globals.d.ts +31 -0
- package/dist/core/repos/globals.d.ts.map +1 -0
- package/dist/core/repos/globals.js +150 -0
- package/dist/core/repos/media.d.ts +39 -0
- package/dist/core/repos/media.d.ts.map +1 -0
- package/dist/core/repos/media.js +81 -0
- package/dist/core/repos/preview-sessions.d.ts +35 -0
- package/dist/core/repos/preview-sessions.d.ts.map +1 -0
- package/dist/core/repos/preview-sessions.js +85 -0
- package/dist/core/repos/revisions.d.ts +24 -0
- package/dist/core/repos/revisions.d.ts.map +1 -0
- package/dist/core/repos/revisions.js +44 -0
- package/dist/core/repos/settings.d.ts +9 -0
- package/dist/core/repos/settings.d.ts.map +1 -0
- package/dist/core/repos/settings.js +21 -0
- package/dist/core/schema.d.ts +2717 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +220 -0
- package/dist/core/sets/compile.d.ts +8 -0
- package/dist/core/sets/compile.d.ts.map +1 -0
- package/dist/core/sets/compile.js +4 -0
- package/dist/core/sets/definition.d.ts +53 -0
- package/dist/core/sets/definition.d.ts.map +1 -0
- package/dist/core/sets/definition.js +7 -0
- package/dist/core/sets/service.d.ts +13 -0
- package/dist/core/sets/service.d.ts.map +1 -0
- package/dist/core/sets/service.js +68 -0
- package/dist/core/sets/validate-tree.d.ts +4 -0
- package/dist/core/sets/validate-tree.d.ts.map +1 -0
- package/dist/core/sets/validate-tree.js +40 -0
- package/dist/core/slug.d.ts +5 -0
- package/dist/core/slug.d.ts.map +1 -0
- package/dist/core/slug.js +25 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/integration/cron.d.ts +4 -0
- package/dist/integration/cron.d.ts.map +1 -0
- package/dist/integration/cron.js +2 -0
- package/dist/integration/index.d.ts +9 -0
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +63 -0
- package/dist/integration/inject-admin-routes.d.ts +12 -0
- package/dist/integration/inject-admin-routes.d.ts.map +1 -0
- package/dist/integration/inject-admin-routes.js +35 -0
- package/dist/integration/inject-routes.d.ts +11 -0
- package/dist/integration/inject-routes.d.ts.map +1 -0
- package/dist/integration/inject-routes.js +51 -0
- package/dist/integration/install-hook.d.ts +2 -0
- package/dist/integration/install-hook.d.ts.map +1 -0
- package/dist/integration/install-hook.js +74 -0
- package/dist/integration/live-preview-middleware-helpers.d.ts +29 -0
- package/dist/integration/live-preview-middleware-helpers.d.ts.map +1 -0
- package/dist/integration/live-preview-middleware-helpers.js +75 -0
- package/dist/integration/loader-binding.d.ts +6 -0
- package/dist/integration/loader-binding.d.ts.map +1 -0
- package/dist/integration/loader-binding.js +15 -0
- package/dist/integration/middleware.d.ts +2 -0
- package/dist/integration/middleware.d.ts.map +1 -0
- package/dist/integration/middleware.js +51 -0
- package/dist/integration/type-gen.d.ts +2 -0
- package/dist/integration/type-gen.d.ts.map +1 -0
- package/dist/integration/type-gen.js +26 -0
- package/dist/integration/vite-plugin-blueprints.d.ts +3 -0
- package/dist/integration/vite-plugin-blueprints.d.ts.map +1 -0
- package/dist/integration/vite-plugin-blueprints.js +33 -0
- package/dist/integration/wrangler-patch.d.ts +6 -0
- package/dist/integration/wrangler-patch.d.ts.map +1 -0
- package/dist/integration/wrangler-patch.js +18 -0
- package/dist/integration.d.ts +3 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +1 -0
- package/dist/loader.d.ts +3 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +1 -0
- package/dist/package-name.d.ts +3 -0
- package/dist/package-name.d.ts.map +1 -0
- package/dist/package-name.js +2 -0
- package/dist/scaffold/collection-write.d.ts +14 -0
- package/dist/scaffold/collection-write.d.ts.map +1 -0
- package/dist/scaffold/collection-write.js +59 -0
- package/dist/scaffold/collection.d.ts +36 -0
- package/dist/scaffold/collection.d.ts.map +1 -0
- package/dist/scaffold/collection.js +231 -0
- package/dist/server/assets/live-preview-bridge.content.d.ts +2 -0
- package/dist/server/assets/live-preview-bridge.content.d.ts.map +1 -0
- package/dist/server/assets/live-preview-bridge.content.js +2 -0
- package/dist/server/better-auth.d.ts +71 -0
- package/dist/server/better-auth.d.ts.map +1 -0
- package/dist/server/better-auth.js +68 -0
- package/dist/server/cf-images.d.ts +12 -0
- package/dist/server/cf-images.d.ts.map +1 -0
- package/dist/server/cf-images.js +27 -0
- package/dist/server/cron.d.ts +9 -0
- package/dist/server/cron.d.ts.map +1 -0
- package/dist/server/cron.js +26 -0
- package/dist/server/email.d.ts +10 -0
- package/dist/server/email.d.ts.map +1 -0
- package/dist/server/email.js +9 -0
- package/dist/server/endpoints/api-auth.d.ts +5 -0
- package/dist/server/endpoints/api-auth.d.ts.map +1 -0
- package/dist/server/endpoints/api-auth.js +7 -0
- package/dist/server/endpoints/api-vulse-blueprints.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-blueprints.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-blueprints.js +19 -0
- package/dist/server/endpoints/api-vulse-entries-locales.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-entries-locales.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-locales.js +9 -0
- package/dist/server/endpoints/api-vulse-entries-move.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-entries-move.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-move.js +5 -0
- package/dist/server/endpoints/api-vulse-entries-publish.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-entries-publish.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-publish.js +5 -0
- package/dist/server/endpoints/api-vulse-entries-tree.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-entries-tree.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-tree.js +5 -0
- package/dist/server/endpoints/api-vulse-entries.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-entries.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries.js +19 -0
- package/dist/server/endpoints/api-vulse-form-handle.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-form-handle.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-handle.js +27 -0
- package/dist/server/endpoints/api-vulse-form-public.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-form-public.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-public.js +5 -0
- package/dist/server/endpoints/api-vulse-form-submit.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-form-submit.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-submit.js +5 -0
- package/dist/server/endpoints/api-vulse-form-upload.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-form-upload.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-upload.js +5 -0
- package/dist/server/endpoints/api-vulse-forms.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-forms.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-forms.js +9 -0
- package/dist/server/endpoints/api-vulse-globals-handle.d.ts +5 -0
- package/dist/server/endpoints/api-vulse-globals-handle.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-handle.js +19 -0
- package/dist/server/endpoints/api-vulse-globals-public-handle.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-globals-public-handle.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-public-handle.js +5 -0
- package/dist/server/endpoints/api-vulse-globals-public.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-globals-public.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-public.js +5 -0
- package/dist/server/endpoints/api-vulse-globals-value.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-globals-value.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-value.js +7 -0
- package/dist/server/endpoints/api-vulse-globals.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-globals.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals.js +9 -0
- package/dist/server/endpoints/api-vulse-media-file.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-media-file.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-media-file.js +5 -0
- package/dist/server/endpoints/api-vulse-media-id.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-media-id.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-media-id.js +9 -0
- package/dist/server/endpoints/api-vulse-media.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-media.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-media.js +9 -0
- package/dist/server/endpoints/api-vulse-preview-bridge.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-bridge.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-bridge.js +9 -0
- package/dist/server/endpoints/api-vulse-preview-sessions-id.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-sessions-id.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-sessions-id.js +10 -0
- package/dist/server/endpoints/api-vulse-preview-sessions.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-sessions.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-sessions.js +5 -0
- package/dist/server/endpoints/api-vulse-preview-start.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-start.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-start.js +5 -0
- package/dist/server/endpoints/api-vulse-preview-stop.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-stop.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-stop.js +5 -0
- package/dist/server/endpoints/api-vulse-revisions-restore.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-revisions-restore.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-revisions-restore.js +5 -0
- package/dist/server/endpoints/api-vulse-revisions.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-revisions.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-revisions.js +5 -0
- package/dist/server/endpoints/api-vulse-search.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-search.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-search.js +5 -0
- package/dist/server/endpoints/api-vulse-sets.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-sets.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-sets.js +19 -0
- package/dist/server/endpoints/api-vulse-settings.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-settings.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-settings.js +9 -0
- package/dist/server/endpoints/api-vulse-users-id.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-users-id.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users-id.js +9 -0
- package/dist/server/endpoints/api-vulse-users-reset-password.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-users-reset-password.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users-reset-password.js +5 -0
- package/dist/server/endpoints/api-vulse-users-role.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-users-role.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users-role.js +6 -0
- package/dist/server/endpoints/api-vulse-users.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-users.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users.js +5 -0
- package/dist/server/endpoints/with-runtime.d.ts +2 -0
- package/dist/server/endpoints/with-runtime.d.ts.map +1 -0
- package/dist/server/endpoints/with-runtime.js +10 -0
- package/dist/server/env.d.ts +16 -0
- package/dist/server/env.d.ts.map +1 -0
- package/dist/server/env.js +9 -0
- package/dist/server/envelope.d.ts +15 -0
- package/dist/server/envelope.d.ts.map +1 -0
- package/dist/server/envelope.js +16 -0
- package/dist/server/forms/email.d.ts +8 -0
- package/dist/server/forms/email.d.ts.map +1 -0
- package/dist/server/forms/email.js +6 -0
- package/dist/server/forms/process-submission.d.ts +8 -0
- package/dist/server/forms/process-submission.d.ts.map +1 -0
- package/dist/server/forms/process-submission.js +75 -0
- package/dist/server/forms/queue.d.ts +8 -0
- package/dist/server/forms/queue.d.ts.map +1 -0
- package/dist/server/forms/queue.js +17 -0
- package/dist/server/forms/templates.d.ts +9 -0
- package/dist/server/forms/templates.d.ts.map +1 -0
- package/dist/server/forms/templates.js +14 -0
- package/dist/server/forms/webhook.d.ts +2 -0
- package/dist/server/forms/webhook.d.ts.map +1 -0
- package/dist/server/forms/webhook.js +17 -0
- package/dist/server/handler.d.ts +17 -0
- package/dist/server/handler.d.ts.map +1 -0
- package/dist/server/handler.js +45 -0
- package/dist/server/image-probe.d.ts +6 -0
- package/dist/server/image-probe.d.ts.map +1 -0
- package/dist/server/image-probe.js +38 -0
- package/dist/server/loader.d.ts +10 -0
- package/dist/server/loader.d.ts.map +1 -0
- package/dist/server/loader.js +42 -0
- package/dist/server/plugins.d.ts +17 -0
- package/dist/server/plugins.d.ts.map +1 -0
- package/dist/server/plugins.js +134 -0
- package/dist/server/preview.d.ts +7 -0
- package/dist/server/preview.d.ts.map +1 -0
- package/dist/server/preview.js +22 -0
- package/dist/server/r2.d.ts +8 -0
- package/dist/server/r2.d.ts.map +1 -0
- package/dist/server/r2.js +9 -0
- package/dist/server/routes/blueprints.d.ts +10 -0
- package/dist/server/routes/blueprints.d.ts.map +1 -0
- package/dist/server/routes/blueprints.js +46 -0
- package/dist/server/routes/entries.d.ts +16 -0
- package/dist/server/routes/entries.d.ts.map +1 -0
- package/dist/server/routes/entries.js +262 -0
- package/dist/server/routes/form-submit.d.ts +10 -0
- package/dist/server/routes/form-submit.d.ts.map +1 -0
- package/dist/server/routes/form-submit.js +155 -0
- package/dist/server/routes/form-upload.d.ts +11 -0
- package/dist/server/routes/form-upload.d.ts.map +1 -0
- package/dist/server/routes/form-upload.js +87 -0
- package/dist/server/routes/forms.d.ts +14 -0
- package/dist/server/routes/forms.d.ts.map +1 -0
- package/dist/server/routes/forms.js +78 -0
- package/dist/server/routes/globals-public.d.ts +6 -0
- package/dist/server/routes/globals-public.d.ts.map +1 -0
- package/dist/server/routes/globals-public.js +30 -0
- package/dist/server/routes/globals.d.ts +11 -0
- package/dist/server/routes/globals.d.ts.map +1 -0
- package/dist/server/routes/globals.js +84 -0
- package/dist/server/routes/media.d.ts +23 -0
- package/dist/server/routes/media.d.ts.map +1 -0
- package/dist/server/routes/media.js +129 -0
- package/dist/server/routes/preview-sessions.d.ts +9 -0
- package/dist/server/routes/preview-sessions.d.ts.map +1 -0
- package/dist/server/routes/preview-sessions.js +74 -0
- package/dist/server/routes/preview.d.ts +6 -0
- package/dist/server/routes/preview.d.ts.map +1 -0
- package/dist/server/routes/preview.js +37 -0
- package/dist/server/routes/revisions.d.ts +7 -0
- package/dist/server/routes/revisions.d.ts.map +1 -0
- package/dist/server/routes/revisions.js +26 -0
- package/dist/server/routes/search.d.ts +6 -0
- package/dist/server/routes/search.d.ts.map +1 -0
- package/dist/server/routes/search.js +28 -0
- package/dist/server/routes/sets.d.ts +10 -0
- package/dist/server/routes/sets.d.ts.map +1 -0
- package/dist/server/routes/sets.js +33 -0
- package/dist/server/routes/settings.d.ts +7 -0
- package/dist/server/routes/settings.d.ts.map +1 -0
- package/dist/server/routes/settings.js +21 -0
- package/dist/server/routes/users.d.ts +10 -0
- package/dist/server/routes/users.d.ts.map +1 -0
- package/dist/server/routes/users.js +113 -0
- package/dist/server/runtime.d.ts +49 -0
- package/dist/server/runtime.d.ts.map +1 -0
- package/dist/server/runtime.js +69 -0
- package/dist/server/sdk/collections.d.ts +25 -0
- package/dist/server/sdk/collections.d.ts.map +1 -0
- package/dist/server/sdk/collections.js +76 -0
- package/dist/server/sdk/index.d.ts +45 -0
- package/dist/server/sdk/index.d.ts.map +1 -0
- package/dist/server/sdk/index.js +13 -0
- package/dist/server/sdk/media.d.ts +7 -0
- package/dist/server/sdk/media.d.ts.map +1 -0
- package/dist/server/sdk/media.js +9 -0
- package/dist/server/sdk/search.d.ts +19 -0
- package/dist/server/sdk/search.d.ts.map +1 -0
- package/dist/server/sdk/search.js +58 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +6 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/migrations/0000_init.sql +114 -0
- package/migrations/0001_collections_sets.sql +21 -0
- package/migrations/0003_fts.sql +22 -0
- package/migrations/0004_forms.sql +58 -0
- package/migrations/0005_globals.sql +16 -0
- package/migrations/0006_preview_sessions.sql +16 -0
- package/migrations/meta/0000_snapshot.json +672 -0
- package/migrations/meta/_journal.json +13 -0
- package/package.json +130 -0
- package/src/client/BlockRenderer.astro +40 -0
- package/src/client/BlockRenderer.vue +42 -0
- package/src/client/Node.vue +21 -0
- package/src/client/ProseMirrorRenderer.vue +31 -0
- package/src/client/auth.ts +28 -0
- package/src/client/blocks/Blockquote.vue +12 -0
- package/src/client/blocks/BulletList.vue +12 -0
- package/src/client/blocks/CodeBlock.vue +12 -0
- package/src/client/blocks/Emoji.vue +14 -0
- package/src/client/blocks/HardBreak.vue +1 -0
- package/src/client/blocks/Heading.vue +17 -0
- package/src/client/blocks/ListItem.vue +12 -0
- package/src/client/blocks/OrderedList.vue +12 -0
- package/src/client/blocks/Paragraph.vue +12 -0
- package/src/client/blocks/Text.vue +33 -0
- package/src/client/blocks/VulseAccordion.vue +16 -0
- package/src/client/blocks/VulseAccordionGroup.vue +12 -0
- package/src/client/blocks/VulseCallout.vue +14 -0
- package/src/client/blocks/VulseIframe.vue +65 -0
- package/src/client/blocks/VulseImage.vue +30 -0
- package/src/client/blocks/VulseSet.vue +26 -0
- package/src/client/blocks/VulseVideo.vue +18 -0
- package/src/client/components/ForgotPasswordForm.astro +71 -0
- package/src/client/components/FormRenderer.astro +40 -0
- package/src/client/components/ResetPasswordForm.astro +72 -0
- package/src/client/components/SessionGuard.astro +27 -0
- package/src/client/components/SignInForm.astro +57 -0
- package/src/client/components/SignOutButton.astro +22 -0
- package/src/client/components/SignUpForm.astro +61 -0
- package/src/client/components/VulseImage.vue +25 -0
- package/src/client/embed.ts +52 -0
- package/src/client/index.ts +2 -0
- package/src/client/inject.ts +4 -0
- package/src/client/live-preview-bridge.ts +20 -0
- package/src/client/pm-defaults.ts +38 -0
- package/src/client/pm-types.ts +21 -0
- package/src/client/render-pm-html.ts +154 -0
- package/src/client/url.ts +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ekrist1
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Vulse
|
|
2
|
+
|
|
3
|
+
**Vulse** is an Astro-native, Vue Based, Cloudflare-hosted headless CMS. One deploy serves your public site, the admin UI (`/admin`), and the REST API (`/api/vulse/*`). Content lives in D1, assets in R2, search uses SQLite FTS5, and delivery uses Astro's Content Layer (build/sync) plus a runtime SDK (SSR / members-only content).
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- **Cloudflare-native** — D1, R2, Queues, Cron, Pages or Workers. Single deploy.
|
|
8
|
+
- **Astro-first** — installs as an Astro integration; uses the Content Layer for SSG and a typed SDK for SSR.
|
|
9
|
+
- **Schema editor** — define collections in code or at runtime in the admin UI (with safe field renames).
|
|
10
|
+
- **Rich blocks** — TipTap/ProseMirror editor with reusable Sets and Replicators.
|
|
11
|
+
- **Drafts + Live preview** — split-panel live editor preview and signed saved-draft preview links.
|
|
12
|
+
- **i18n** — each entry can carry multiple locale translations with per-locale slugs and statuses.
|
|
13
|
+
- **Forms** — first-party form builder with submissions, file uploads, async hooks via Queues.
|
|
14
|
+
- **Auth** — Better Auth under the hood; role-based access (`admin` / `editor` / `member`).
|
|
15
|
+
- **Globals** — site-wide content sets exposed via a public read API.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
> **Alpha:** install the `alpha` dist-tag until 1.0:
|
|
20
|
+
>
|
|
21
|
+
> `pnpm astro add @ekrist1/vulse@alpha`
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm astro add @ekrist1/vulse@alpha
|
|
25
|
+
pnpm astro add cloudflare
|
|
26
|
+
wrangler d1 create vulse-db
|
|
27
|
+
wrangler r2 bucket create vulse-media
|
|
28
|
+
npx vulse migrate
|
|
29
|
+
npx vulse seed:admin --email you@example.com
|
|
30
|
+
pnpm dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Sign in at `http://localhost:4321/admin/login`.
|
|
34
|
+
|
|
35
|
+
The full setup (Cloudflare resources, secrets, first admin) is documented in [`docs/installation.md`](https://github.com/ekrist1/vulseastro/blob/main/docs/installation.md).
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
Vulse's documentation lives on GitHub:
|
|
40
|
+
|
|
41
|
+
| Page | Purpose |
|
|
42
|
+
|------|---------|
|
|
43
|
+
| [Installation](https://github.com/ekrist1/vulseastro/blob/main/docs/installation.md) | Prerequisites, install, Cloudflare resources, first admin |
|
|
44
|
+
| [Upgrading](https://github.com/ekrist1/vulseastro/blob/main/docs/upgrading.md) | Updates and migrations |
|
|
45
|
+
| [Configuration](https://github.com/ekrist1/vulseastro/blob/main/docs/configuration.md) | `wrangler.toml` bindings, env vars, runtime settings |
|
|
46
|
+
| [Control panel](https://github.com/ekrist1/vulseastro/blob/main/docs/control-panel.md) | Admin UI walkthrough |
|
|
47
|
+
| [Content modeling](https://github.com/ekrist1/vulseastro/blob/main/docs/content-modeling.md) | Blueprints, sets, replicators, globals, locales |
|
|
48
|
+
| [Frontend](https://github.com/ekrist1/vulseastro/blob/main/docs/frontend.md) | Wiring Vulse into Astro |
|
|
49
|
+
| [Live preview](https://github.com/ekrist1/vulseastro/blob/main/docs/live-preview.md) | Live preview and saved-draft preview |
|
|
50
|
+
| [Forms](https://github.com/ekrist1/vulseastro/blob/main/docs/forms.md) | Form builder, spam, queues, hooks |
|
|
51
|
+
| [Plugins](https://github.com/ekrist1/vulseastro/blob/main/docs/plugins.md) | Native Vulse plugins for forms, auth, CRM, and email workflows |
|
|
52
|
+
| [API reference](https://github.com/ekrist1/vulseastro/blob/main/docs/api-reference.md) | REST endpoints |
|
|
53
|
+
| [CLI reference](https://github.com/ekrist1/vulseastro/blob/main/docs/cli.md) | `vulse migrate`, `seed:admin`, `collection:scaffold` |
|
|
54
|
+
| [Deployment](https://github.com/ekrist1/vulseastro/blob/main/docs/deployment.md) | Cloudflare deploy + production checklist |
|
|
55
|
+
| [Directory structure](https://github.com/ekrist1/vulseastro/blob/main/docs/directory-structure.md) | What files and folders mean |
|
|
56
|
+
| [Troubleshooting](https://github.com/ekrist1/vulseastro/blob/main/docs/troubleshooting.md) | FAQ and common errors |
|
|
57
|
+
|
|
58
|
+
## Quick example
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
// src/vulse/collections/post.ts
|
|
62
|
+
import { defineCollection, z, blocks, media } from '@ekrist1/vulse'
|
|
63
|
+
|
|
64
|
+
export default defineCollection({
|
|
65
|
+
name: 'post',
|
|
66
|
+
label: 'Blog post',
|
|
67
|
+
schema: z.object({
|
|
68
|
+
title: z.string().min(1),
|
|
69
|
+
slug: z.string(),
|
|
70
|
+
cover: media().optional(),
|
|
71
|
+
body: blocks(),
|
|
72
|
+
}),
|
|
73
|
+
admin: { titleField: 'title', listColumns: ['title', 'slug'] },
|
|
74
|
+
access: {
|
|
75
|
+
read: ({ entry, user }) => entry?.status === 'published' || !!user,
|
|
76
|
+
create: ({ user }) => user?.role === 'admin' || user?.role === 'editor',
|
|
77
|
+
},
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```astro
|
|
82
|
+
---
|
|
83
|
+
// src/pages/blog/[slug].astro
|
|
84
|
+
import { getCollection } from 'astro:content'
|
|
85
|
+
import BlockRenderer from '@ekrist1/vulse/client/BlockRenderer.astro'
|
|
86
|
+
|
|
87
|
+
const posts = await getCollection('post')
|
|
88
|
+
const post = posts.find((p) => p.data.slug === Astro.params.slug)
|
|
89
|
+
if (!post) return Astro.redirect('/404')
|
|
90
|
+
---
|
|
91
|
+
<h1>{post.data.title}</h1>
|
|
92
|
+
<BlockRenderer blocks={post.data.body ?? []} />
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Requirements
|
|
96
|
+
|
|
97
|
+
- Node.js 22+
|
|
98
|
+
- pnpm 9+
|
|
99
|
+
- Astro 6 with `@astrojs/cloudflare` in server-output mode
|
|
100
|
+
- Cloudflare account (free tier is enough to develop)
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT — see [LICENSE](https://github.com/ekrist1/vulseastro/blob/main/LICENSE).
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Resolve the active locale for admin entry editing. Prefer the URL on the client (source of truth after navigation). */
|
|
2
|
+
export declare function resolveActiveLocale(supportedLocales: string[] | undefined, entryLocale: string | undefined, defaultLocale: string | undefined): string;
|
|
3
|
+
//# sourceMappingURL=active-locale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-locale.d.ts","sourceRoot":"","sources":["../../../src/admin/client/active-locale.ts"],"names":[],"mappings":"AAMA,0HAA0H;AAC1H,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,EACtC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,CAKR"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function readUrlLocaleParam() {
|
|
2
|
+
const search = globalThis.location?.search;
|
|
3
|
+
if (!search)
|
|
4
|
+
return null;
|
|
5
|
+
return new URLSearchParams(search).get('locale');
|
|
6
|
+
}
|
|
7
|
+
/** Resolve the active locale for admin entry editing. Prefer the URL on the client (source of truth after navigation). */
|
|
8
|
+
export function resolveActiveLocale(supportedLocales, entryLocale, defaultLocale) {
|
|
9
|
+
const fallback = entryLocale ?? defaultLocale ?? 'default';
|
|
10
|
+
const raw = readUrlLocaleParam();
|
|
11
|
+
if (raw && (supportedLocales ?? []).includes(raw))
|
|
12
|
+
return raw;
|
|
13
|
+
return fallback;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class AdminApiError extends Error {
|
|
2
|
+
code: string;
|
|
3
|
+
details?: unknown | undefined;
|
|
4
|
+
status?: number | undefined;
|
|
5
|
+
constructor(code: string, message: string, details?: unknown | undefined, status?: number | undefined);
|
|
6
|
+
}
|
|
7
|
+
export declare const adminApi: {
|
|
8
|
+
get: <T>(path: string) => Promise<T>;
|
|
9
|
+
post: <T>(path: string, body: unknown) => Promise<T>;
|
|
10
|
+
put: <T>(path: string, body: unknown) => Promise<T>;
|
|
11
|
+
patch: <T>(path: string, body: unknown) => Promise<T>;
|
|
12
|
+
delete: <T>(path: string) => Promise<T>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/admin/client/api.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;IACnB,IAAI,EAAE,MAAM;IAA0B,OAAO,CAAC,EAAE,OAAO;IAAS,MAAM,CAAC,EAAE,MAAM;gBAA/E,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAS,OAAO,CAAC,EAAE,OAAO,YAAA,EAAS,MAAM,CAAC,EAAE,MAAM,YAAA;CAInG;AASD,eAAO,MAAM,QAAQ;UACb,CAAC,QAAQ,MAAM;WACd,CAAC,QAAQ,MAAM,QAAQ,OAAO;UAC/B,CAAC,QAAQ,MAAM,QAAQ,OAAO;YAC5B,CAAC,QAAQ,MAAM,QAAQ,OAAO;aAC7B,CAAC,QAAQ,MAAM;CACzB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class AdminApiError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
details;
|
|
4
|
+
status;
|
|
5
|
+
constructor(code, message, details, status) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.details = details;
|
|
9
|
+
this.status = status;
|
|
10
|
+
this.name = 'AdminApiError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function request(path, init) {
|
|
14
|
+
const res = await fetch(path, { credentials: 'same-origin', ...init });
|
|
15
|
+
const body = await res.json();
|
|
16
|
+
if (body.ok)
|
|
17
|
+
return body.data;
|
|
18
|
+
throw new AdminApiError(body.error.code, body.error.message, body.error.details, res.status);
|
|
19
|
+
}
|
|
20
|
+
export const adminApi = {
|
|
21
|
+
get: (path) => request(path),
|
|
22
|
+
post: (path, body) => request(path, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) }),
|
|
23
|
+
put: (path, body) => request(path, { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) }),
|
|
24
|
+
patch: (path, body) => request(path, { method: 'PATCH', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) }),
|
|
25
|
+
delete: (path) => request(path, { method: 'DELETE' }),
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-from-zod.d.ts","sourceRoot":"","sources":["../../../src/admin/client/form-from-zod.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,6BAA6B,EAC7B,+BAA+B,EAC/B,KAAK,eAAe,EACpB,KAAK,MAAM,GACZ,MAAM,yCAAyC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { reflectFields, fieldDescriptorsFromBlueprint, fieldDescriptorsFromDefinitions, } from '../../core/blueprints/reflect-fields.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-preview-enabled.d.ts","sourceRoot":"","sources":["../../../src/admin/client/live-preview-enabled.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAG5D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface CollectionScaffoldCliOptions {
|
|
2
|
+
handle: string;
|
|
3
|
+
route?: string;
|
|
4
|
+
index?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
titleField?: string;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
skipBlueprint?: boolean;
|
|
9
|
+
skipPages?: boolean;
|
|
10
|
+
skipContentConfig?: boolean;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function runCollectionScaffold(opts: CollectionScaffoldCliOptions): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=collection-scaffold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-scaffold.d.ts","sourceRoot":"","sources":["../../src/cli/collection-scaffold.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAUD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC7F"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { writeCollectionScaffold } from '../scaffold/collection-write.js';
|
|
2
|
+
import { defaultScaffoldRoutes } from '../scaffold/collection.js';
|
|
3
|
+
function titleCaseHandle(handle) {
|
|
4
|
+
return handle
|
|
5
|
+
.split(/[-_]/g)
|
|
6
|
+
.filter(Boolean)
|
|
7
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
8
|
+
.join(' ');
|
|
9
|
+
}
|
|
10
|
+
export async function runCollectionScaffold(opts) {
|
|
11
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
12
|
+
const defaults = defaultScaffoldRoutes(opts.handle);
|
|
13
|
+
const showRoute = opts.route ?? defaults.showRoute;
|
|
14
|
+
const indexRoute = opts.index !== undefined ? opts.index : defaults.indexRoute;
|
|
15
|
+
const result = await writeCollectionScaffold(cwd, {
|
|
16
|
+
handle: opts.handle,
|
|
17
|
+
label: opts.label ?? titleCaseHandle(opts.handle),
|
|
18
|
+
showRoute,
|
|
19
|
+
indexRoute,
|
|
20
|
+
...(opts.titleField ? { titleField: opts.titleField } : {}),
|
|
21
|
+
}, {
|
|
22
|
+
...(opts.force ? { force: true } : {}),
|
|
23
|
+
...(opts.skipBlueprint ? { skipBlueprint: true } : {}),
|
|
24
|
+
...(opts.skipPages ? { skipPages: true } : {}),
|
|
25
|
+
...(opts.skipContentConfig ? { skipContentConfig: true } : {}),
|
|
26
|
+
});
|
|
27
|
+
console.log(`\nScaffolded collection "${opts.handle}"`);
|
|
28
|
+
if (result.written.length) {
|
|
29
|
+
console.log('\nCreated:');
|
|
30
|
+
for (const path of result.written)
|
|
31
|
+
console.log(` + ${path}`);
|
|
32
|
+
}
|
|
33
|
+
if (result.patched.length) {
|
|
34
|
+
console.log('\nUpdated:');
|
|
35
|
+
for (const path of result.patched)
|
|
36
|
+
console.log(` ~ ${path}`);
|
|
37
|
+
}
|
|
38
|
+
if (result.skipped.length) {
|
|
39
|
+
console.log('\nSkipped (already exists — use --force to overwrite):');
|
|
40
|
+
for (const path of result.skipped)
|
|
41
|
+
console.log(` - ${path}`);
|
|
42
|
+
}
|
|
43
|
+
console.log('\nNext: restart dev server, then create entries in Admin → Collections.\n');
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { VULSE_VERSION } from '../version.js';
|
|
4
|
+
const program = new Command();
|
|
5
|
+
program.name('vulse').description('Vulse CMS command-line tools').version(VULSE_VERSION);
|
|
6
|
+
program
|
|
7
|
+
.command('setup')
|
|
8
|
+
.description('Interactive first-run setup: configure D1, R2, secrets, run migrations, seed admin')
|
|
9
|
+
.option('-y, --yes', 'Accept all defaults and skip prompts', false)
|
|
10
|
+
.option('--email <email>', 'Admin email for the seeded user')
|
|
11
|
+
.option('--password <password>', 'Admin password (generated if omitted)')
|
|
12
|
+
.option('--skip-migrate', 'Skip running migrations', false)
|
|
13
|
+
.option('--skip-seed', 'Skip seeding the first admin user', false)
|
|
14
|
+
.action(async (opts) => {
|
|
15
|
+
const { runSetup } = await import('./setup.js');
|
|
16
|
+
await runSetup({
|
|
17
|
+
yes: !!opts.yes,
|
|
18
|
+
...(opts.email !== undefined ? { email: opts.email } : {}),
|
|
19
|
+
...(opts.password !== undefined ? { password: opts.password } : {}),
|
|
20
|
+
skipMigrate: !!opts.skipMigrate,
|
|
21
|
+
skipSeed: !!opts.skipSeed,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
program
|
|
25
|
+
.command('migrate')
|
|
26
|
+
.description('Apply Drizzle migrations to the configured D1 database')
|
|
27
|
+
.option('--remote', 'Run against the remote D1 instead of local miniflare', false)
|
|
28
|
+
.action(async (opts) => {
|
|
29
|
+
const { runMigrate } = await import('./migrate.js');
|
|
30
|
+
await runMigrate({ remote: !!opts.remote });
|
|
31
|
+
});
|
|
32
|
+
program
|
|
33
|
+
.command('seed:admin')
|
|
34
|
+
.description('Create the first admin user')
|
|
35
|
+
.option('--email <email>', 'Admin email (required)')
|
|
36
|
+
.option('--password <password>', 'Password (generated if omitted)')
|
|
37
|
+
.option('--remote', 'Run against the remote D1', false)
|
|
38
|
+
.action(async (opts) => {
|
|
39
|
+
const { runSeedAdmin } = await import('./seed-admin.js');
|
|
40
|
+
await runSeedAdmin({
|
|
41
|
+
email: opts.email,
|
|
42
|
+
...(opts.password !== undefined ? { password: opts.password } : {}),
|
|
43
|
+
remote: !!opts.remote,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
program
|
|
47
|
+
.command('collection:scaffold <handle>')
|
|
48
|
+
.description('Scaffold a code blueprint, Astro index/show pages, and content.config entry')
|
|
49
|
+
.option('--route <path>', 'Show route template, e.g. /blog/{slug}')
|
|
50
|
+
.option('--index <path>', 'Index route, e.g. /blog (omit for show-only)')
|
|
51
|
+
.option('--label <label>', 'Collection label for generated files')
|
|
52
|
+
.option('--title-field <field>', 'Title field used in templates')
|
|
53
|
+
.option('--force', 'Overwrite existing scaffold files', false)
|
|
54
|
+
.option('--skip-blueprint', 'Skip src/vulse/collections/<handle>.ts', false)
|
|
55
|
+
.option('--skip-pages', 'Skip Astro page files', false)
|
|
56
|
+
.option('--skip-content-config', 'Skip content.config.ts update', false)
|
|
57
|
+
.action(async (handle, opts) => {
|
|
58
|
+
const { runCollectionScaffold } = await import('./collection-scaffold.js');
|
|
59
|
+
await runCollectionScaffold({
|
|
60
|
+
handle,
|
|
61
|
+
...(opts.route !== undefined ? { route: opts.route } : {}),
|
|
62
|
+
...(opts.index !== undefined ? { index: opts.index } : {}),
|
|
63
|
+
...(opts.label !== undefined ? { label: opts.label } : {}),
|
|
64
|
+
...(opts.titleField !== undefined ? { titleField: opts.titleField } : {}),
|
|
65
|
+
force: !!opts.force,
|
|
66
|
+
skipBlueprint: !!opts.skipBlueprint,
|
|
67
|
+
skipPages: !!opts.skipPages,
|
|
68
|
+
skipContentConfig: !!opts.skipContentConfig,
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
program.parseAsync().catch((err) => {
|
|
72
|
+
console.error(err instanceof Error ? err.message : err);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/cli/migrate.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAAG,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE;AAEpD,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { join, dirname } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { execSync } from 'node:child_process';
|
|
4
|
+
const MIGRATIONS_DIR = join(dirname(fileURLToPath(import.meta.url)), '../../migrations');
|
|
5
|
+
export async function runMigrate(opts) {
|
|
6
|
+
const flag = opts.remote ? '--remote' : '--local';
|
|
7
|
+
const cmd = `wrangler d1 migrations apply DB ${flag}`;
|
|
8
|
+
console.log(`> ${cmd}`);
|
|
9
|
+
execSync(cmd, { stdio: 'inherit' });
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Walk up from cwd to find wrangler.toml (same resolution wrangler uses). */
|
|
2
|
+
export declare function findWranglerConfig(cwd?: string): Promise<string>;
|
|
3
|
+
export interface CliPlatform {
|
|
4
|
+
db: D1Database;
|
|
5
|
+
env: Record<string, unknown>;
|
|
6
|
+
dispose: () => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
/** Resolves the D1 binding via wrangler (local miniflare or remote). */
|
|
9
|
+
export declare function resolveCliPlatform(opts?: {
|
|
10
|
+
remote?: boolean;
|
|
11
|
+
}): Promise<CliPlatform>;
|
|
12
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/cli/platform.ts"],"names":[],"mappings":"AAYA,8EAA8E;AAC9E,wBAAsB,kBAAkB,CAAC,GAAG,SAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAW7E;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,UAAU,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7B;AAED,wEAAwE;AACxE,wBAAsB,kBAAkB,CAAC,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAU9F"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { access } from 'node:fs/promises';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
async function fileExists(path) {
|
|
4
|
+
try {
|
|
5
|
+
await access(path);
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** Walk up from cwd to find wrangler.toml (same resolution wrangler uses). */
|
|
13
|
+
export async function findWranglerConfig(cwd = process.cwd()) {
|
|
14
|
+
let dir = cwd;
|
|
15
|
+
for (;;) {
|
|
16
|
+
const configPath = join(dir, 'wrangler.toml');
|
|
17
|
+
if (await fileExists(configPath))
|
|
18
|
+
return configPath;
|
|
19
|
+
const parent = dirname(dir);
|
|
20
|
+
if (parent === dir) {
|
|
21
|
+
throw new Error('No wrangler.toml found. Run this command from your Astro project root.');
|
|
22
|
+
}
|
|
23
|
+
dir = parent;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** Resolves the D1 binding via wrangler (local miniflare or remote). */
|
|
27
|
+
export async function resolveCliPlatform(opts = {}) {
|
|
28
|
+
const configPath = await findWranglerConfig();
|
|
29
|
+
const { getPlatformProxy } = await import('wrangler');
|
|
30
|
+
const proxy = await getPlatformProxy({
|
|
31
|
+
configPath,
|
|
32
|
+
remoteBindings: !!opts.remote,
|
|
33
|
+
});
|
|
34
|
+
const db = proxy.env.DB;
|
|
35
|
+
if (!db)
|
|
36
|
+
throw new Error('D1 binding "DB" not found in wrangler.toml');
|
|
37
|
+
return { db, env: proxy.env, dispose: proxy.dispose };
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface SeedOptions {
|
|
2
|
+
email?: string;
|
|
3
|
+
remote?: boolean;
|
|
4
|
+
password?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SeedResult {
|
|
7
|
+
email: string;
|
|
8
|
+
tempPassword: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SeedAdminUserOptions {
|
|
11
|
+
email: string;
|
|
12
|
+
password?: string;
|
|
13
|
+
secret?: string;
|
|
14
|
+
baseURL?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Creates an admin user with a Better Auth–compatible password hash. */
|
|
17
|
+
export declare function seedAdminUser(db: D1Database, opts: SeedAdminUserOptions): Promise<SeedResult>;
|
|
18
|
+
export declare function runSeedAdmin(opts: SeedOptions): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=seed-admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-admin.d.ts","sourceRoot":"","sources":["../../src/cli/seed-admin.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAAG,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;AACpF,MAAM,WAAW,UAAU;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE;AAEnE,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAMD,yEAAyE;AACzE,wBAAsB,aAAa,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAsBnG;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCnE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid';
|
|
2
|
+
import { createDb } from '../core/db.js';
|
|
3
|
+
import { ConflictError } from '../core/errors.js';
|
|
4
|
+
import { createAuth } from '../server/better-auth.js';
|
|
5
|
+
function generatePassword() {
|
|
6
|
+
return nanoid(16);
|
|
7
|
+
}
|
|
8
|
+
/** Creates an admin user with a Better Auth–compatible password hash. */
|
|
9
|
+
export async function seedAdminUser(db, opts) {
|
|
10
|
+
const existing = await db.prepare(`SELECT id FROM user WHERE email = ?`).bind(opts.email).first();
|
|
11
|
+
if (existing)
|
|
12
|
+
throw new ConflictError(`User with email ${opts.email} already exists`);
|
|
13
|
+
const tempPassword = opts.password ?? generatePassword();
|
|
14
|
+
const secret = opts.secret ?? 'dev-secret-change-me-in-production-32chars';
|
|
15
|
+
const baseURL = opts.baseURL ?? 'http://localhost';
|
|
16
|
+
const auth = await createAuth(createDb(db), { baseURL, secret, allowSignUp: true });
|
|
17
|
+
const res = await auth.handler(new Request(`${baseURL}/api/auth/sign-up/email`, {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
headers: { 'content-type': 'application/json', origin: baseURL },
|
|
20
|
+
body: JSON.stringify({ email: opts.email, password: tempPassword, name: 'Admin' }),
|
|
21
|
+
}));
|
|
22
|
+
if (!res.ok) {
|
|
23
|
+
const detail = await res.text().catch(() => '');
|
|
24
|
+
throw new Error(`Failed to create admin user (${res.status})${detail ? `: ${detail}` : ''}`);
|
|
25
|
+
}
|
|
26
|
+
await db.prepare(`UPDATE user SET role = 'admin' WHERE email = ?`).bind(opts.email).run();
|
|
27
|
+
return { email: opts.email, tempPassword };
|
|
28
|
+
}
|
|
29
|
+
export async function runSeedAdmin(opts) {
|
|
30
|
+
if (!opts.email) {
|
|
31
|
+
process.stderr.write('Error: --email is required.\n');
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
const { resolveCliPlatform } = await import('./platform.js');
|
|
35
|
+
const { db, env, dispose } = await resolveCliPlatform(opts.remote !== undefined ? { remote: opts.remote } : {});
|
|
36
|
+
try {
|
|
37
|
+
const secret = env.BETTER_AUTH_SECRET;
|
|
38
|
+
if (typeof secret !== 'string' || !secret) {
|
|
39
|
+
throw new Error('BETTER_AUTH_SECRET missing from wrangler.toml [vars] (or secrets).');
|
|
40
|
+
}
|
|
41
|
+
const result = await seedAdminUser(db, {
|
|
42
|
+
email: opts.email,
|
|
43
|
+
...(opts.password !== undefined ? { password: opts.password } : {}),
|
|
44
|
+
secret,
|
|
45
|
+
});
|
|
46
|
+
const scope = opts.remote ? 'remote' : 'local';
|
|
47
|
+
process.stdout.write(`
|
|
48
|
+
✅ Admin user created (${scope} D1).
|
|
49
|
+
|
|
50
|
+
Email: ${result.email}
|
|
51
|
+
Password: ${result.tempPassword}
|
|
52
|
+
|
|
53
|
+
Sign in at /admin/login with these credentials.
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
await dispose();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface SetupOptions {
|
|
2
|
+
yes?: boolean;
|
|
3
|
+
email?: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
skipMigrate?: boolean;
|
|
6
|
+
skipSeed?: boolean;
|
|
7
|
+
cwd?: string;
|
|
8
|
+
}
|
|
9
|
+
/** 32 random bytes → 64-char hex string. Suitable for BETTER_AUTH_SECRET. */
|
|
10
|
+
export declare function generateSecret(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Set the D1 `database_id` in wrangler.toml. Replaces the placeholder if
|
|
13
|
+
* present; otherwise replaces the existing id under the `# vulse:d1` block.
|
|
14
|
+
* Idempotent: writing the same id twice yields the same output.
|
|
15
|
+
*/
|
|
16
|
+
export declare function setDatabaseId(toml: string, id: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Set/replace KEY=VALUE entries in a `.dev.vars`-style file. Existing entries
|
|
19
|
+
* for the same key are replaced in place; unknown keys are appended. Values
|
|
20
|
+
* are written as `KEY="value"` (double-quoted) to handle special chars safely.
|
|
21
|
+
* Pre-existing keys not in `vars` are left untouched.
|
|
22
|
+
*/
|
|
23
|
+
export declare function applyDevVars(existing: string, vars: Record<string, string>): string;
|
|
24
|
+
/** Ensure `.dev.vars` (and `.dev.vars.*`) appear in .gitignore. */
|
|
25
|
+
export declare function ensureGitignored(existing: string, entry?: string): string;
|
|
26
|
+
/** Pull a database_id out of `wrangler d1 create` JSON-ish output. */
|
|
27
|
+
export declare function parseDatabaseId(output: string): string | null;
|
|
28
|
+
export declare function runSetup(opts?: SetupOptions): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/cli/setup.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAiBD,6EAA6E;AAC7E,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAgBnF;AAED,mEAAmE;AACnE,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAc,GAAG,MAAM,CAK9E;AAuCD,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG7D;AAED,wBAAsB,QAAQ,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsJrE"}
|