betterstart-cli 0.0.97 → 0.0.98
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/dist/assets/adapters/next/integrations/mailchimp/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/r2/actions/r2.ts +1 -1
- package/dist/assets/adapters/next/integrations/r2/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/railway-bucket/actions/railway-bucket.ts +1 -1
- package/dist/assets/adapters/next/integrations/railway-bucket/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/resend/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/vercel-blob/actions/vercel-blob.ts +1 -1
- package/dist/assets/adapters/next/integrations/vercel-blob/integration.ts +1 -1
- package/dist/assets/adapters/next/presets/blog/preset.ts +1 -1
- package/dist/assets/adapters/next/presets/portfolio/preset.ts +1 -1
- package/dist/assets/adapters/next/templates/init/api/storage-read-route.ts +2 -1
- package/dist/assets/adapters/next/templates/init/api/upload-route.ts +3 -2
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-providers.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar-nav-link-skeleton.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-grid.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table-pagination.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table.tsx +2 -5
- package/dist/assets/adapters/next/templates/init/components/shared/delete-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/copyable-code-block.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/dev-mode-code-mirror.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/lifecycle-hooks-tab.tsx +7 -17
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/snippets-tab.tsx +3 -13
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode-integrate.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/components/shared/entity-filters-bar.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-version-restore-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-versions-button.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/edit-media-dialog-content.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/edit-media-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-delete-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-delete-drawer.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-filters-bar.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-gallery-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-item.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-pagination.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-preview.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-url-importer.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/search-input.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-dialog.tsx +3 -4
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-item.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-blockquote.ts +1 -70
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-code-block.ts +1 -77
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-color-highlight.ts +3 -51
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-media-insertion.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-slash-menu.ts +6 -8
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-source-mode.tsx +10 -8
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-table-add-controls.ts +4 -4
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor.ts +7 -4
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-heading-dropdown-menu.ts +3 -66
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-heading.ts +1 -41
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-is-breakpoint.ts +0 -8
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-link-popover.ts +1 -83
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-list-dropdown-menu.ts +3 -61
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-list.ts +1 -43
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-mark.ts +1 -72
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-menu-navigation.ts +0 -35
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-table-button.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-tiptap-editor.ts +0 -11
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-undo-redo.ts +1 -65
- package/dist/assets/adapters/next/templates/init/hooks/use-admin-theme.tsx +2 -4
- package/dist/assets/adapters/next/templates/init/hooks/use-dev-mode-integration.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-entity-versions.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-local-storage.ts +2 -7
- package/dist/assets/adapters/next/templates/init/hooks/use-media-filters-bar.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-media.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/use-page-boundary-blur-visibility.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-page-scroll-threshold.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-table-utils.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/use-upload.ts +6 -12
- package/dist/assets/adapters/next/templates/init/hooks/use-users.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-webhooks.ts +3 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/audit/cleanup-audit-logs.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/audit/get-audit-logs.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/audit/record-audit-event.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/auth/auth.ts +4 -4
- package/dist/assets/adapters/next/templates/init/lib/actions/auth/middleware.ts +2 -10
- package/dist/assets/adapters/next/templates/init/lib/actions/email/form-delivery.ts +2 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/email/provider.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/entity-versions/get-entity-versions.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/entity-versions/internal-create-entity-version.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/forms/get-all-form-settings.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/forms/get-form-settings.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/forms/upsert-form-settings.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/create-media.ts +2 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/delete-media-bulk.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/delete-media.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/get-media-by-id.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/get-media-by-ids.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/get-media.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/update-media.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/profile/change-own-password.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/profile/update-email.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/storage/provider.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/upload/upload-files.ts +2 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/upload/upload-media-from-url.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/change-user-password.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/create-user.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/delete-user.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/get-users.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/update-user-role.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/create-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/delete-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/dispatch.ts +1 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhook-deliveries.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhook-secret.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhook-subscriptions.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhooks.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/regenerate-webhook-secret.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/register.ts +2 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/send-test-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/update-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/db/client.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/db/core/schema.ts +0 -24
- package/dist/assets/adapters/next/templates/init/lib/lifecycle-hooks/register.ts +0 -7
- package/dist/assets/adapters/next/templates/init/lib/lifecycle-hooks/runner.ts +1 -1
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/login-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/media/media-page-content.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/reset-password-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-columns.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-page-content.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-table.tsx +3 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-page-content.tsx +3 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-table.tsx +4 -3
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhook-endpoint-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-columns.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-columns.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-page-content.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-table.tsx +2 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-page-content.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-table.tsx +2 -1
- package/dist/assets/adapters/next/templates/init/pages/users/change-password-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/columns.tsx +3 -2
- package/dist/assets/adapters/next/templates/init/pages/users/create-user-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/delete-user-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/edit-role-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/users-page-content.tsx +2 -1
- package/dist/assets/adapters/next/templates/init/pages/users/users-table.tsx +4 -3
- package/dist/assets/adapters/next/templates/init/types/index.ts +0 -5
- package/dist/assets/adapters/next/templates/init/utils/date/date.ts +1 -6
- package/dist/assets/adapters/next/templates/init/utils/editor/content-editor-rich-extensions.ts +2 -2
- package/dist/assets/adapters/next/templates/init/utils/editor/markdown.ts +5 -5
- package/dist/assets/adapters/next/templates/init/utils/editor/slash-commands.ts +2 -2
- package/dist/assets/adapters/next/templates/init/utils/editor/table-add-controls.ts +1 -1
- package/dist/assets/adapters/next/templates/init/utils/editor/tiptap.ts +8 -127
- package/dist/assets/adapters/next/templates/init/utils/media/query.ts +1 -1
- package/dist/assets/adapters/next/templates/init/utils/seo/seo.ts +0 -10
- package/dist/assets/adapters/next/templates/init/utils/shared/cn.ts +2 -1
- package/dist/assets/adapters/next/templates/init/utils/validation/validation.ts +0 -12
- package/dist/assets/shared-assets/react-admin/custom/content-editor/editor-toolbar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/horizontal-rule-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/index.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/main-toolbar-content.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-bubble-menu.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-editor-controls.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-popover-button.tsx +4 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/remove-table-part-icon.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/selection-bubble-menu.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/slash-command-menu.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode-dropdown-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode.tsx +5 -11
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-add-controls.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-bubble-menu.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-extension/node-background-extension.ts +2 -25
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-node/media-gallery-placeholder-node/media-gallery-placeholder-node-extension.ts +0 -20
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-node/media-gallery-placeholder-node/media-gallery-placeholder-node.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-node/removable-image-node/removable-image-node.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/blockquote-button/blockquote-button.tsx +3 -18
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/code-block-button/code-block-button.tsx +3 -18
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-button/color-highlight-button.tsx +2 -37
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-button.tsx +3 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content.tsx +3 -9
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +6 -12
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/highlight-color-button.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/highlight-colors.ts +2 -4
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/source-color-highlight-popover.tsx +4 -9
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu-item.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +4 -19
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-button.tsx +3 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-content.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-control-popover.tsx +5 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-main.tsx +1 -13
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-popover.tsx +5 -16
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu-item.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +4 -19
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/mark-button/mark-button.tsx +3 -19
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/undo-redo-button/undo-redo-button.tsx +3 -19
- package/dist/assets/shared-assets/react-admin/custom/date-picker.tsx +1 -3
- package/dist/assets/shared-assets/react-admin/custom/date-range-picker.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/gallery-field.tsx +5 -10
- package/dist/assets/shared-assets/react-admin/custom/icon-picker.tsx +7 -4
- package/dist/assets/shared-assets/react-admin/custom/media-field-empty-state.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/media-field.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/nested-object-list-field.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/placeholder-card.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/placeholder.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/progressive-blur.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/sortable-gallery-item.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/upload-dropzone.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/accordion.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/alert-dialog.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/alert.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/avatar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/badge.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/breadcrumb.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/button-group.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/button.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/calendar.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/card.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/carousel.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/chart.tsx +1 -2
- package/dist/assets/shared-assets/react-admin/ui/checkbox.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/combobox.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/command.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/context-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/dialog.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/direction.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/drawer.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/dropdown-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/empty.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/field.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/form.tsx +4 -10
- package/dist/assets/shared-assets/react-admin/ui/hover-card.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/input-group.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/input-otp.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/input.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/item.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/label.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/menubar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/native-select.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/navigation-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/pagination.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/popover.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/progress.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/radio-group.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/resizable.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/scroll-area.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/select.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/separator.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sheet.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sidebar.tsx +3 -10
- package/dist/assets/shared-assets/react-admin/ui/slider.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sonner.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/switch.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/table.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/tabs.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/textarea.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/toggle-group.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/toggle.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/tooltip.tsx +1 -1
- package/dist/{chunk-MJWUGEMK.js → chunk-AIQWGMU7.js} +136 -5
- package/dist/chunk-AIQWGMU7.js.map +1 -0
- package/dist/cli.js +1097 -1194
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{template-reader-R2JIWUNK.js → template-reader-F2VFSDKV.js} +2 -2
- package/package.json +3 -3
- package/dist/assets/shared-assets/react-admin/dependencies.ts +0 -74
- package/dist/chunk-MJWUGEMK.js.map +0 -1
- /package/dist/{template-reader-R2JIWUNK.js.map → template-reader-F2VFSDKV.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
ACCEPT_TERMS_URL_PATTERN,
|
|
4
|
+
ADMIN_SHADOW_INPUT_UTILITY,
|
|
5
|
+
ADMIN_THEME_BLOCK,
|
|
6
|
+
ANSI_ESCAPE_PATTERN,
|
|
7
|
+
BETTERSTART_ASSET_HOST,
|
|
8
|
+
CLI_PACKAGE_NAME,
|
|
9
|
+
CONFIG_IMPORT_PATTERN,
|
|
10
|
+
CONFIG_IMPORT_SHIM,
|
|
11
|
+
CONFIG_OBJECT_PATTERNS,
|
|
12
|
+
DATABASE_URL_PLACEHOLDER,
|
|
3
13
|
DEFAULT_ADMIN_NAMESPACE,
|
|
14
|
+
DEFAULT_DEV_PORT,
|
|
15
|
+
DEPRECATED_ADMIN_PATH_ALIAS_SUFFIXES,
|
|
16
|
+
DEV_PORT_ENV_PATTERN,
|
|
17
|
+
DEV_PORT_FLAG_PATTERN,
|
|
18
|
+
LEGACY_DEFAULT_AUTH_URL,
|
|
19
|
+
LOCAL_PROTOCOL_PATTERN,
|
|
20
|
+
MAIN_CSS_CANDIDATES,
|
|
21
|
+
R2_ENV_KEYS,
|
|
22
|
+
RAILWAY_BUCKET_ENV_KEYS,
|
|
23
|
+
REDACTED,
|
|
24
|
+
REMOVABLE_NAMESPACE_PATTERN,
|
|
25
|
+
SCHEMA_NAME_PATTERN,
|
|
26
|
+
TERMS_ACCEPTED_PATTERN,
|
|
27
|
+
TIPTAP_CONTENT_EDITOR_DIRECTORIES,
|
|
4
28
|
applyAdminNamespaceToContent,
|
|
5
29
|
applyAdminNamespaceToPath,
|
|
6
30
|
applyNextCacheApiForVersion,
|
|
@@ -21,20 +45,50 @@ import {
|
|
|
21
45
|
toPascalCase,
|
|
22
46
|
validateAdminDashboardPath,
|
|
23
47
|
validateAdminNamespace
|
|
24
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-AIQWGMU7.js";
|
|
25
49
|
|
|
26
50
|
// cli.ts
|
|
27
|
-
import { readFileSync } from "fs";
|
|
28
51
|
import * as p31 from "@clack/prompts";
|
|
52
|
+
import { readFileSync } from "fs";
|
|
29
53
|
|
|
30
54
|
// core-engine/commands/default-action.ts
|
|
31
55
|
import * as p from "@clack/prompts";
|
|
32
56
|
|
|
57
|
+
// constants/commands.ts
|
|
58
|
+
var ADD_COMMAND = "add";
|
|
59
|
+
var CREATE_COMMAND = "create";
|
|
60
|
+
var GENERATE_COMMAND = "generate";
|
|
61
|
+
var INIT_COMMAND = "init";
|
|
62
|
+
var REMOVE_COMMAND = "remove";
|
|
63
|
+
var REMOVE_SCHEMA_COMMAND = "remove-schema";
|
|
64
|
+
var UPDATE_COMMAND = "update";
|
|
65
|
+
var ALL_FLAG = "--all";
|
|
66
|
+
var CANCELLED = /* @__PURE__ */ Symbol("cancelled");
|
|
67
|
+
var CREATE_SCHEMA_KINDS = ["entity", "single", "form"];
|
|
68
|
+
|
|
33
69
|
// core-engine/config/resolver.ts
|
|
34
70
|
import fs from "fs";
|
|
35
71
|
import path from "path";
|
|
36
72
|
import { fileURLToPath } from "url";
|
|
73
|
+
|
|
74
|
+
// constants/paths.ts
|
|
75
|
+
var BETTERSTART_DIR = ".betterstart";
|
|
37
76
|
var CONFIG_FILE_NAME = "betterstart.config.ts";
|
|
77
|
+
var DEVELOPMENT_ENV_FILES = [
|
|
78
|
+
".env.development.local",
|
|
79
|
+
".env.local",
|
|
80
|
+
".env.development",
|
|
81
|
+
".env"
|
|
82
|
+
];
|
|
83
|
+
var LOCKFILE_MAP = {
|
|
84
|
+
"pnpm-lock.yaml": "pnpm",
|
|
85
|
+
"package-lock.json": "npm",
|
|
86
|
+
"yarn.lock": "yarn",
|
|
87
|
+
"bun.lockb": "bun",
|
|
88
|
+
"bun.lock": "bun"
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// core-engine/config/resolver.ts
|
|
38
92
|
function findConfigFile(cwd) {
|
|
39
93
|
const filePath = path.join(cwd, CONFIG_FILE_NAME);
|
|
40
94
|
return fs.existsSync(filePath) ? filePath : void 0;
|
|
@@ -59,148 +113,7 @@ function isInteractiveTerminalSession() {
|
|
|
59
113
|
return isInteractiveSession() && Boolean(process.stdout.isTTY);
|
|
60
114
|
}
|
|
61
115
|
|
|
62
|
-
// core-engine/commands/runtime.ts
|
|
63
|
-
import { Argument, Command } from "commander";
|
|
64
|
-
var CREATE_SCHEMA_KINDS = ["entity", "single", "form"];
|
|
65
|
-
function createAddCommand(runtime) {
|
|
66
|
-
return new Command("add").description("Install BetterStart presets or integrations into an existing Admin").argument("<items...>", "Preset or integration IDs to install (e.g. blog, r2)").option("-y, --yes", "Skip interactive configuration prompts", false).option("--integration", "Install integration IDs instead of content preset IDs", false).option(
|
|
67
|
-
"--skip-migration",
|
|
68
|
-
"Skip running db:push after installing schema-backed presets",
|
|
69
|
-
false
|
|
70
|
-
).option("--cwd <path>", "Project root path").addHelpText(
|
|
71
|
-
"after",
|
|
72
|
-
`
|
|
73
|
-
Examples:
|
|
74
|
-
$ betterstart add blog
|
|
75
|
-
$ betterstart add r2 --integration`
|
|
76
|
-
).action((items, options) => runtime.runAdd(items, options));
|
|
77
|
-
}
|
|
78
|
-
function collectRepeatedOption(value, previous = []) {
|
|
79
|
-
return [...previous, value];
|
|
80
|
-
}
|
|
81
|
-
function createAddFieldCommand(runtime) {
|
|
82
|
-
return new Command("add-field").description("Add one field to an existing Generated schema").argument("[schema]", "Generated schema name (e.g. posts, settings, contact)").option("--cwd <path>", "Project root path").option("--skip-migration", "Skip running db:push after generation", false).option(
|
|
83
|
-
"--accept-generated",
|
|
84
|
-
"Accept generated output for files that would otherwise get merge conflicts",
|
|
85
|
-
false
|
|
86
|
-
).option("-y, --yes", "Confirm warning cases in non-interactive mode", false).option("--type <type>", "Field type").option("--field <name>", "Field identifier").option("--label <label>", "Field label").option("--slot <main|sidebar>", "Entity or Single layout slot").option("--step <name>", "Form step target for multi-step form schemas").option("--before <field>", "Insert before an existing field in the selected target").option("--after <field>", "Insert after an existing field in the selected target").option("--required", "Mark the field as required", false).option("--multiple", "Enable multiple values for supported field types", false).option("--creatable", "Enable creatable options for Entity or Single select fields", false).option("--option <value:Label>", "Static select option", collectRepeatedOption, []).option("--relationship <schema>", "Relationship target schema").action(
|
|
87
|
-
(schemaName, options) => runtime.runAddField(schemaName, options)
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
function createCreateCommand(runtime) {
|
|
91
|
-
return new Command("create").description("Interactively create and generate a user-authored schema").addArgument(
|
|
92
|
-
new Argument("<kind>", "Schema kind: entity, single, or form").choices(CREATE_SCHEMA_KINDS)
|
|
93
|
-
).argument("[name]", "Optional schema name override (derived from label when omitted)").option("--cwd <path>", "Project root path").option("--skip-migration", "Skip running db:push after generation", false).option(
|
|
94
|
-
"--accept-generated",
|
|
95
|
-
"Accept generated output for files that would otherwise get merge conflicts",
|
|
96
|
-
false
|
|
97
|
-
).addHelpText(
|
|
98
|
-
"after",
|
|
99
|
-
`
|
|
100
|
-
Examples:
|
|
101
|
-
$ betterstart create entity
|
|
102
|
-
$ betterstart create form contact`
|
|
103
|
-
).action(
|
|
104
|
-
(kind, schemaName, options) => runtime.runCreate(kind, schemaName, options)
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
function createGenerateCommand(runtime) {
|
|
108
|
-
return new Command("generate").alias("g").description("Generate entity or form from a JSON schema").argument("[schema]", "Schema name (e.g. posts, categories, contact)").option("-f, --force", "Overwrite existing generated files", false).option(
|
|
109
|
-
"--accept-generated",
|
|
110
|
-
"Accept generated output for files that would otherwise get merge conflicts",
|
|
111
|
-
false
|
|
112
|
-
).option("-a, --all", "Regenerate all schemas", false).option("--interactive", "Prompt during generate --all", false).option("--skip-migration", "Skip running db:push after generation", false).option("--cwd <path>", "Project root path").addHelpText(
|
|
113
|
-
"after",
|
|
114
|
-
`
|
|
115
|
-
Examples:
|
|
116
|
-
$ betterstart generate posts
|
|
117
|
-
$ betterstart generate --all --skip-migration`
|
|
118
|
-
).action(
|
|
119
|
-
(schemaName, options) => runtime.runGenerate(schemaName, options)
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
function createInitCommand(runtime) {
|
|
123
|
-
return new Command("init").description("Scaffold Admin into a new or existing Next.js app").argument("[name]", "Project name (creates new directory if fresh project)").option("--presets <presets>", "Comma-separated content preset IDs (e.g. blog)").option("--integrations <integrations>", "Comma-separated integration IDs (e.g. r2,resend)").option("--namespace <name>", "Generated admin namespace (e.g. admin, dashboard)").option("-y, --yes", "Skip prompts (defaults to manual database, local storage, and no deploy)").option("--json", "With --yes, print a machine-readable setup result on stdout", false).option("--skip-migration", "Skip running drizzle-kit push after scaffolding").option("--skip-admin-creation", "Skip prompting to create the initial admin user").option("--skip-dev-server-start", "Skip prompting to start the development server").option(
|
|
124
|
-
"--database-url <url>",
|
|
125
|
-
"PostgreSQL database connection string (postgres:// or postgresql://)"
|
|
126
|
-
).option("--database-provider <provider>", "Database provider: vercel, railway, or manual").option(
|
|
127
|
-
"--storage-provider <provider>",
|
|
128
|
-
"Storage provider: vercel-blob, railway-bucket, r2, or local"
|
|
129
|
-
).option("--deploy-provider <provider>", "Deploy provider: vercel, railway, or none").option(
|
|
130
|
-
"--use-existing-resources",
|
|
131
|
-
"Require database/storage credentials from existing project env files; never provision them"
|
|
132
|
-
).option("--database-plan <id>", "Neon plan id for a Vercel-provisioned database").option("--railway-workspace <id-or-name>", "Railway workspace for a new project").option("--railway-project <id-or-name>", "Existing Railway project to intentionally reuse").option("--railway-environment <id-or-name>", "Railway environment (default: production)").option("--railway-service <id-or-name>", "Railway app service (default: web)").option(
|
|
133
|
-
"--railway-bucket-region <region>",
|
|
134
|
-
"Railway bucket region: sjc, iad, ams, or sin (default: iad)"
|
|
135
|
-
).option("--force", "Overwrite all existing Admin files (nuclear option)").addHelpText(
|
|
136
|
-
"after",
|
|
137
|
-
`
|
|
138
|
-
Examples:
|
|
139
|
-
$ betterstart init
|
|
140
|
-
$ betterstart init my-app --yes --database-url <url>
|
|
141
|
-
$ betterstart init --yes --database-provider vercel --deploy-provider vercel --json`
|
|
142
|
-
).action(
|
|
143
|
-
(name, options) => runtime.runInit(name, options)
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
function createListPresetsCommand(runtime) {
|
|
147
|
-
return new Command("list-presets").description("List available BetterStart presets").option("--json", "Print presets as JSON on stdout", false).option("--cwd <path>", "Project root path").action((options) => runtime.runListPresets(options));
|
|
148
|
-
}
|
|
149
|
-
function createListIntegrationsCommand(runtime) {
|
|
150
|
-
return new Command("list-integrations").description("List available BetterStart integrations").option("--json", "Print integrations as JSON on stdout", false).option("--cwd <path>", "Project root path").action((options) => runtime.runListIntegrations(options));
|
|
151
|
-
}
|
|
152
|
-
function createRemoveCommand(runtime) {
|
|
153
|
-
return new Command("remove").description("Remove installed BetterStart presets or integrations").argument("<items...>", "Preset or integration IDs to remove (e.g. blog r2)").option("-f, --force", "Skip confirmation prompt", false).option("--integration", "Remove integration IDs instead of content preset IDs", false).option("--cwd <path>", "Project root path").action((items, options) => runtime.runRemove(items, options));
|
|
154
|
-
}
|
|
155
|
-
function createRemoveSchemaCommand(runtime) {
|
|
156
|
-
return new Command("remove-schema").description("Remove generated files for a user-authored schema").argument("<schema>", "Schema name to remove (e.g. posts, categories, contact)").option("-f, --force", "Skip confirmation prompt", false).option("--cwd <path>", "Project root path").action(
|
|
157
|
-
(schemaName, options) => runtime.runRemoveSchema(schemaName, options)
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
function createSeedCommand(runtime) {
|
|
161
|
-
return new Command("seed").description("Create the initial admin user").option("--email <email>", "Admin email (required off-TTY)").option(
|
|
162
|
-
"--name <name>",
|
|
163
|
-
'Admin display name (defaults to "Admin"); set the password via BETTERSTART_ADMIN_PASSWORD off-TTY'
|
|
164
|
-
).option("--cwd <path>", "Project root path").addHelpText(
|
|
165
|
-
"after",
|
|
166
|
-
`
|
|
167
|
-
Examples:
|
|
168
|
-
$ betterstart seed
|
|
169
|
-
$ BETTERSTART_ADMIN_PASSWORD=<password> betterstart seed --email admin@example.com`
|
|
170
|
-
).action((options) => runtime.runSeed(options));
|
|
171
|
-
}
|
|
172
|
-
function createUninstallCommand(runtime) {
|
|
173
|
-
return new Command("uninstall").description("Remove all Admin files and undo modifications made by betterstart init").option("-f, --force", "Skip all confirmation prompts", false).option("--cwd <path>", "Project root path").action((options) => runtime.runUninstall(options));
|
|
174
|
-
}
|
|
175
|
-
function createUpdateCommand(runtime) {
|
|
176
|
-
return new Command("update").alias("update-component").description("Update Admin components from the latest CLI templates").argument("[components...]", "Component names to update (e.g., media-field button)").option("--list", "List all available components").option("--json", "With --list, print components as JSON on stdout", false).option("--all", "Update all components").option("--shadcn-preset <preset>", "Apply a shadcn preset to Admin UI components").option("--only <parts>", "Apply only supported shadcn preset parts: theme").option("-y, --yes", "Skip the overwrite confirmation", false).option("--cwd <path>", "Project root path").addHelpText(
|
|
177
|
-
"after",
|
|
178
|
-
`
|
|
179
|
-
Examples:
|
|
180
|
-
$ betterstart update --list
|
|
181
|
-
$ betterstart update media-field
|
|
182
|
-
$ betterstart update --all --yes`
|
|
183
|
-
).action(
|
|
184
|
-
(components, options) => runtime.runUpdate(components, options)
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
function createUpdateDepsCommand(runtime) {
|
|
188
|
-
return new Command("update-deps").description("Install or update all Admin dependencies").option("--cwd <path>", "Project root path").action((options) => runtime.runUpdateDeps(options));
|
|
189
|
-
}
|
|
190
|
-
function createUpdateStylesCommand(runtime) {
|
|
191
|
-
return new Command("update-styles").description("Replace admin-globals.css with the latest version from the CLI").option("--cwd <path>", "Project root path").action((options) => runtime.runUpdateStyles(options));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
116
|
// core-engine/commands/default-action.ts
|
|
195
|
-
var ADD_COMMAND = "add";
|
|
196
|
-
var CREATE_COMMAND = "create";
|
|
197
|
-
var GENERATE_COMMAND = "generate";
|
|
198
|
-
var INIT_COMMAND = "init";
|
|
199
|
-
var REMOVE_COMMAND = "remove";
|
|
200
|
-
var REMOVE_SCHEMA_COMMAND = "remove-schema";
|
|
201
|
-
var UPDATE_COMMAND = "update";
|
|
202
|
-
var ALL_FLAG = "--all";
|
|
203
|
-
var CANCELLED = /* @__PURE__ */ Symbol("cancelled");
|
|
204
117
|
function cancelled(value) {
|
|
205
118
|
return value === CANCELLED;
|
|
206
119
|
}
|
|
@@ -351,33 +264,179 @@ async function promptInstallableFamily(presets2, integrations2) {
|
|
|
351
264
|
}
|
|
352
265
|
|
|
353
266
|
// core-engine/commands/require-init.ts
|
|
354
|
-
import path2 from "path";
|
|
355
267
|
import * as p2 from "@clack/prompts";
|
|
356
|
-
|
|
268
|
+
import path2 from "path";
|
|
357
269
|
function resolveCommandCwd(command) {
|
|
358
270
|
const options = command.opts();
|
|
359
271
|
return typeof options.cwd === "string" ? path2.resolve(options.cwd) : process.cwd();
|
|
360
272
|
}
|
|
361
|
-
function requireInitializedProject(command) {
|
|
362
|
-
if (command.name() ===
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
const cwd = resolveCommandCwd(command);
|
|
366
|
-
if (findConfigFile(cwd)) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
p2.log.error("Couldn't find betterstart project. Please run `betterstart init` first.");
|
|
370
|
-
process.exit(1);
|
|
273
|
+
function requireInitializedProject(command) {
|
|
274
|
+
if (command.name() === INIT_COMMAND) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const cwd = resolveCommandCwd(command);
|
|
278
|
+
if (findConfigFile(cwd)) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
p2.log.error("Couldn't find betterstart project. Please run `betterstart init` first.");
|
|
282
|
+
process.exit(1);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// core-engine/commands/runtime.ts
|
|
286
|
+
import { Argument, Command } from "commander";
|
|
287
|
+
function createAddCommand(runtime) {
|
|
288
|
+
return new Command("add").description("Install BetterStart presets or integrations into an existing Admin").argument("<items...>", "Preset or integration IDs to install (e.g. blog, r2)").option("-y, --yes", "Skip interactive configuration prompts", false).option("--integration", "Install integration IDs instead of content preset IDs", false).option(
|
|
289
|
+
"--skip-migration",
|
|
290
|
+
"Skip running db:push after installing schema-backed presets",
|
|
291
|
+
false
|
|
292
|
+
).option("--cwd <path>", "Project root path").addHelpText(
|
|
293
|
+
"after",
|
|
294
|
+
`
|
|
295
|
+
Examples:
|
|
296
|
+
$ betterstart add blog
|
|
297
|
+
$ betterstart add r2 --integration`
|
|
298
|
+
).action((items, options) => runtime.runAdd(items, options));
|
|
299
|
+
}
|
|
300
|
+
function collectRepeatedOption(value, previous = []) {
|
|
301
|
+
return [...previous, value];
|
|
302
|
+
}
|
|
303
|
+
function createAddFieldCommand(runtime) {
|
|
304
|
+
return new Command("add-field").description("Add one field to an existing Generated schema").argument("[schema]", "Generated schema name (e.g. posts, settings, contact)").option("--cwd <path>", "Project root path").option("--skip-migration", "Skip running db:push after generation", false).option(
|
|
305
|
+
"--accept-generated",
|
|
306
|
+
"Accept generated output for files that would otherwise get merge conflicts",
|
|
307
|
+
false
|
|
308
|
+
).option("-y, --yes", "Confirm warning cases in non-interactive mode", false).option("--type <type>", "Field type").option("--field <name>", "Field identifier").option("--label <label>", "Field label").option("--slot <main|sidebar>", "Entity or Single layout slot").option("--step <name>", "Form step target for multi-step form schemas").option("--before <field>", "Insert before an existing field in the selected target").option("--after <field>", "Insert after an existing field in the selected target").option("--required", "Mark the field as required", false).option("--multiple", "Enable multiple values for supported field types", false).option("--creatable", "Enable creatable options for Entity or Single select fields", false).option("--option <value:Label>", "Static select option", collectRepeatedOption, []).option("--relationship <schema>", "Relationship target schema").action(
|
|
309
|
+
(schemaName, options) => runtime.runAddField(schemaName, options)
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
function createCreateCommand(runtime) {
|
|
313
|
+
return new Command("create").description("Interactively create and generate a user-authored schema").addArgument(
|
|
314
|
+
new Argument("<kind>", "Schema kind: entity, single, or form").choices(CREATE_SCHEMA_KINDS)
|
|
315
|
+
).argument("[name]", "Optional schema name override (derived from label when omitted)").option("--cwd <path>", "Project root path").option("--skip-migration", "Skip running db:push after generation", false).option(
|
|
316
|
+
"--accept-generated",
|
|
317
|
+
"Accept generated output for files that would otherwise get merge conflicts",
|
|
318
|
+
false
|
|
319
|
+
).addHelpText(
|
|
320
|
+
"after",
|
|
321
|
+
`
|
|
322
|
+
Examples:
|
|
323
|
+
$ betterstart create entity
|
|
324
|
+
$ betterstart create form contact`
|
|
325
|
+
).action(
|
|
326
|
+
(kind, schemaName, options) => runtime.runCreate(kind, schemaName, options)
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
function createGenerateCommand(runtime) {
|
|
330
|
+
return new Command("generate").alias("g").description("Generate entity or form from a JSON schema").argument("[schema]", "Schema name (e.g. posts, categories, contact)").option("-f, --force", "Overwrite existing generated files", false).option(
|
|
331
|
+
"--accept-generated",
|
|
332
|
+
"Accept generated output for files that would otherwise get merge conflicts",
|
|
333
|
+
false
|
|
334
|
+
).option("-a, --all", "Regenerate all schemas", false).option("--interactive", "Prompt during generate --all", false).option("--skip-migration", "Skip running db:push after generation", false).option("--cwd <path>", "Project root path").addHelpText(
|
|
335
|
+
"after",
|
|
336
|
+
`
|
|
337
|
+
Examples:
|
|
338
|
+
$ betterstart generate posts
|
|
339
|
+
$ betterstart generate --all --skip-migration`
|
|
340
|
+
).action(
|
|
341
|
+
(schemaName, options) => runtime.runGenerate(schemaName, options)
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
function createInitCommand(runtime) {
|
|
345
|
+
return new Command("init").description("Scaffold Admin into a new or existing Next.js app").argument("[name]", "Project name (creates new directory if fresh project)").option("--presets <presets>", "Comma-separated content preset IDs (e.g. blog)").option("--integrations <integrations>", "Comma-separated integration IDs (e.g. r2,resend)").option("--namespace <name>", "Generated admin namespace (e.g. admin, dashboard)").option("-y, --yes", "Skip prompts (defaults to manual database, local storage, and no deploy)").option("--json", "With --yes, print a machine-readable setup result on stdout", false).option("--skip-migration", "Skip running drizzle-kit push after scaffolding").option("--skip-admin-creation", "Skip prompting to create the initial admin user").option("--skip-dev-server-start", "Skip prompting to start the development server").option(
|
|
346
|
+
"--database-url <url>",
|
|
347
|
+
"PostgreSQL database connection string (postgres:// or postgresql://)"
|
|
348
|
+
).option("--database-provider <provider>", "Database provider: vercel, railway, or manual").option(
|
|
349
|
+
"--storage-provider <provider>",
|
|
350
|
+
"Storage provider: vercel-blob, railway-bucket, r2, or local"
|
|
351
|
+
).option("--deploy-provider <provider>", "Deploy provider: vercel, railway, or none").option(
|
|
352
|
+
"--use-existing-resources",
|
|
353
|
+
"Require database/storage credentials from existing project env files; never provision them"
|
|
354
|
+
).option("--database-plan <id>", "Neon plan id for a Vercel-provisioned database").option("--railway-workspace <id-or-name>", "Railway workspace for a new project").option("--railway-project <id-or-name>", "Existing Railway project to intentionally reuse").option("--railway-environment <id-or-name>", "Railway environment (default: production)").option("--railway-service <id-or-name>", "Railway app service (default: web)").option(
|
|
355
|
+
"--railway-bucket-region <region>",
|
|
356
|
+
"Railway bucket region: sjc, iad, ams, or sin (default: iad)"
|
|
357
|
+
).option("--force", "Overwrite all existing Admin files (nuclear option)").addHelpText(
|
|
358
|
+
"after",
|
|
359
|
+
`
|
|
360
|
+
Examples:
|
|
361
|
+
$ betterstart init
|
|
362
|
+
$ betterstart init my-app --yes --database-url <url>
|
|
363
|
+
$ betterstart init --yes --database-provider vercel --deploy-provider vercel --json`
|
|
364
|
+
).action(
|
|
365
|
+
(name, options) => runtime.runInit(name, options)
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
function createListPresetsCommand(runtime) {
|
|
369
|
+
return new Command("list-presets").description("List available BetterStart presets").option("--json", "Print presets as JSON on stdout", false).option("--cwd <path>", "Project root path").action((options) => runtime.runListPresets(options));
|
|
370
|
+
}
|
|
371
|
+
function createListIntegrationsCommand(runtime) {
|
|
372
|
+
return new Command("list-integrations").description("List available BetterStart integrations").option("--json", "Print integrations as JSON on stdout", false).option("--cwd <path>", "Project root path").action((options) => runtime.runListIntegrations(options));
|
|
373
|
+
}
|
|
374
|
+
function createRemoveCommand(runtime) {
|
|
375
|
+
return new Command("remove").description("Remove installed BetterStart presets or integrations").argument("<items...>", "Preset or integration IDs to remove (e.g. blog r2)").option("-f, --force", "Skip confirmation prompt", false).option("--integration", "Remove integration IDs instead of content preset IDs", false).option("--cwd <path>", "Project root path").action((items, options) => runtime.runRemove(items, options));
|
|
376
|
+
}
|
|
377
|
+
function createRemoveSchemaCommand(runtime) {
|
|
378
|
+
return new Command("remove-schema").description("Remove generated files for a user-authored schema").argument("<schema>", "Schema name to remove (e.g. posts, categories, contact)").option("-f, --force", "Skip confirmation prompt", false).option("--cwd <path>", "Project root path").action(
|
|
379
|
+
(schemaName, options) => runtime.runRemoveSchema(schemaName, options)
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
function createSeedCommand(runtime) {
|
|
383
|
+
return new Command("seed").description("Create the initial admin user").option("--email <email>", "Admin email (required off-TTY)").option(
|
|
384
|
+
"--name <name>",
|
|
385
|
+
'Admin display name (defaults to "Admin"); set the password via BETTERSTART_ADMIN_PASSWORD off-TTY'
|
|
386
|
+
).option("--cwd <path>", "Project root path").addHelpText(
|
|
387
|
+
"after",
|
|
388
|
+
`
|
|
389
|
+
Examples:
|
|
390
|
+
$ betterstart seed
|
|
391
|
+
$ BETTERSTART_ADMIN_PASSWORD=<password> betterstart seed --email admin@example.com`
|
|
392
|
+
).action((options) => runtime.runSeed(options));
|
|
393
|
+
}
|
|
394
|
+
function createUninstallCommand(runtime) {
|
|
395
|
+
return new Command("uninstall").description("Remove all Admin files and undo modifications made by betterstart init").option("-f, --force", "Skip all confirmation prompts", false).option("--cwd <path>", "Project root path").action((options) => runtime.runUninstall(options));
|
|
396
|
+
}
|
|
397
|
+
function createUpdateCommand(runtime) {
|
|
398
|
+
return new Command("update").alias("update-component").description("Update Admin components from the latest CLI templates").argument("[components...]", "Component names to update (e.g., media-field button)").option("--list", "List all available components").option("--json", "With --list, print components as JSON on stdout", false).option("--all", "Update all components").option("--shadcn-preset <preset>", "Apply a shadcn preset to Admin UI components").option("--only <parts>", "Apply only supported shadcn preset parts: theme").option("-y, --yes", "Skip the overwrite confirmation", false).option("--cwd <path>", "Project root path").addHelpText(
|
|
399
|
+
"after",
|
|
400
|
+
`
|
|
401
|
+
Examples:
|
|
402
|
+
$ betterstart update --list
|
|
403
|
+
$ betterstart update media-field
|
|
404
|
+
$ betterstart update --all --yes`
|
|
405
|
+
).action(
|
|
406
|
+
(components, options) => runtime.runUpdate(components, options)
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
function createUpdateDepsCommand(runtime) {
|
|
410
|
+
return new Command("update-deps").description("Install or update all Admin dependencies").option("--cwd <path>", "Project root path").action((options) => runtime.runUpdateDeps(options));
|
|
411
|
+
}
|
|
412
|
+
function createUpdateStylesCommand(runtime) {
|
|
413
|
+
return new Command("update-styles").description("Replace admin-globals.css with the latest version from the CLI").option("--cwd <path>", "Project root path").action((options) => runtime.runUpdateStyles(options));
|
|
371
414
|
}
|
|
372
415
|
|
|
373
416
|
// adapters/next/commands/add-field.ts
|
|
374
|
-
import path31 from "path";
|
|
375
417
|
import * as p11 from "@clack/prompts";
|
|
418
|
+
import path31 from "path";
|
|
376
419
|
|
|
377
|
-
//
|
|
378
|
-
|
|
420
|
+
// constants/prompt-copy.ts
|
|
421
|
+
var ADD_FIELD_PROMPT_CONTEXT = {
|
|
422
|
+
cancelMessage: "Add field cancelled."
|
|
423
|
+
};
|
|
424
|
+
var CREATE_PROMPT_CONTEXT = {
|
|
425
|
+
cancelMessage: "Create schema cancelled."
|
|
426
|
+
};
|
|
427
|
+
var CREATE_FIELD_PROMPT_OPTIONS = {
|
|
428
|
+
deriveName: true,
|
|
429
|
+
derivePlaceholder: true,
|
|
430
|
+
promptAdvancedOptions: false,
|
|
431
|
+
promptHeight: false,
|
|
432
|
+
promptHint: false,
|
|
433
|
+
typeFirst: true
|
|
434
|
+
};
|
|
435
|
+
var SCHEMA_NAME_VALIDATION_MESSAGE = "Use letters, numbers, and hyphens, starting with a lowercase letter.";
|
|
436
|
+
var ADD_FIELD_CONFIRM_INITIAL_VALUE = true;
|
|
437
|
+
var VERCEL_NEON_URL = "https://vercel.com/dashboard/integrations/checkout/neon";
|
|
379
438
|
|
|
380
|
-
//
|
|
439
|
+
// constants/schema.ts
|
|
381
440
|
var FIELD_TYPES = {
|
|
382
441
|
STRING: "string",
|
|
383
442
|
EMAIL: "email",
|
|
@@ -408,11 +467,6 @@ var FIELD_TYPES = {
|
|
|
408
467
|
};
|
|
409
468
|
var LAYOUT_FIELD_TYPES = [FIELD_TYPES.SEPARATOR];
|
|
410
469
|
var NESTED_FIELD_TYPES = [FIELD_TYPES.GROUP, FIELD_TYPES.TABS, FIELD_TYPES.LIST];
|
|
411
|
-
var RICH_TEXT_FIELD_TYPES = [
|
|
412
|
-
FIELD_TYPES.MARKDOWN,
|
|
413
|
-
FIELD_TYPES.RICHTEXT,
|
|
414
|
-
FIELD_TYPES.TEXT
|
|
415
|
-
];
|
|
416
470
|
var LONG_TEXT_FIELD_TYPES = [
|
|
417
471
|
FIELD_TYPES.TEXT,
|
|
418
472
|
FIELD_TYPES.MARKDOWN,
|
|
@@ -470,6 +524,112 @@ var DRIZZLE_DEFAULTS = {
|
|
|
470
524
|
DECIMAL_PRECISION: 10,
|
|
471
525
|
DECIMAL_SCALE: 2
|
|
472
526
|
};
|
|
527
|
+
var ENTITY_SINGLE_ADD_FIELD_TYPES = [
|
|
528
|
+
"string",
|
|
529
|
+
"email",
|
|
530
|
+
"varchar",
|
|
531
|
+
"text",
|
|
532
|
+
"markdown",
|
|
533
|
+
"richtext",
|
|
534
|
+
"number",
|
|
535
|
+
"decimal",
|
|
536
|
+
"boolean",
|
|
537
|
+
"date",
|
|
538
|
+
"timestamp",
|
|
539
|
+
"time",
|
|
540
|
+
"image",
|
|
541
|
+
"video",
|
|
542
|
+
"media",
|
|
543
|
+
"gallery",
|
|
544
|
+
"icon",
|
|
545
|
+
"select",
|
|
546
|
+
"relationship",
|
|
547
|
+
"list",
|
|
548
|
+
"group",
|
|
549
|
+
"section",
|
|
550
|
+
"tabs",
|
|
551
|
+
"separator"
|
|
552
|
+
];
|
|
553
|
+
var FORM_ADD_FIELD_TYPES = [
|
|
554
|
+
"text",
|
|
555
|
+
"textarea",
|
|
556
|
+
"email",
|
|
557
|
+
"phone",
|
|
558
|
+
"number",
|
|
559
|
+
"url",
|
|
560
|
+
"date",
|
|
561
|
+
"select",
|
|
562
|
+
"radio",
|
|
563
|
+
"checkbox",
|
|
564
|
+
"file"
|
|
565
|
+
];
|
|
566
|
+
var FORM_OPTION_FIELD_TYPES = ["select", "radio", "checkbox"];
|
|
567
|
+
var FORM_OPTION_FIELD_TYPE_SET = new Set(FORM_OPTION_FIELD_TYPES);
|
|
568
|
+
var FORM_REQUIRED_OPTION_FIELD_TYPES = /* @__PURE__ */ new Set(["select", "radio"]);
|
|
569
|
+
var NON_INTERACTIVE_CONTAINER_TYPES = /* @__PURE__ */ new Set(["group", "section", "tabs", "list"]);
|
|
570
|
+
var SYSTEM_FIELD_NAMES = /* @__PURE__ */ new Set([
|
|
571
|
+
"id",
|
|
572
|
+
"uuid",
|
|
573
|
+
"serial",
|
|
574
|
+
"slug",
|
|
575
|
+
"createdAt",
|
|
576
|
+
"updatedAt",
|
|
577
|
+
"published",
|
|
578
|
+
"submittedAt",
|
|
579
|
+
"ipAddress",
|
|
580
|
+
"userAgent",
|
|
581
|
+
"createdBy",
|
|
582
|
+
"updatedBy",
|
|
583
|
+
"createdByUser",
|
|
584
|
+
"updatedByUser"
|
|
585
|
+
]);
|
|
586
|
+
var SCHEMA_LAYOUT_TYPES = /* @__PURE__ */ new Set(["group", "section", "tabs", "separator"]);
|
|
587
|
+
var FORM_LAYOUT_TYPES = /* @__PURE__ */ new Set(["group"]);
|
|
588
|
+
var RESERVED_AUTHORSHIP_FIELD_NAMES = /* @__PURE__ */ new Set([
|
|
589
|
+
"createdBy",
|
|
590
|
+
"updatedBy",
|
|
591
|
+
"createdByUser",
|
|
592
|
+
"updatedByUser"
|
|
593
|
+
]);
|
|
594
|
+
var FORM_COLUMN_TYPES = /* @__PURE__ */ new Set(["text", "date", "email", "number", "badge"]);
|
|
595
|
+
var GENERATED_SCHEMA_TITLE_FIELD_NAME = "title";
|
|
596
|
+
var ENTITY_SLUG_FIELD_NAME = "slug";
|
|
597
|
+
var ENTITY_SLUG_FIELD_TYPES = /* @__PURE__ */ new Set(["string", "varchar", "text"]);
|
|
598
|
+
var GENERATED_SCHEMA_TITLE_FIELD_TYPES = /* @__PURE__ */ new Set(["string", "varchar", "text"]);
|
|
599
|
+
var FORM_SCHEMA_TITLE_FIELD_TYPES = /* @__PURE__ */ new Set(["text"]);
|
|
600
|
+
var FORM_SUBMISSION_COLUMN_NAMES = [
|
|
601
|
+
AUTO_FIELDS.ID,
|
|
602
|
+
FORM_SUBMISSION_FIELDS.SUBMITTED_AT,
|
|
603
|
+
FORM_SUBMISSION_FIELDS.IP_ADDRESS,
|
|
604
|
+
FORM_SUBMISSION_FIELDS.USER_AGENT,
|
|
605
|
+
AUTO_FIELDS.CREATED_AT,
|
|
606
|
+
AUTO_FIELDS.UPDATED_AT
|
|
607
|
+
];
|
|
608
|
+
var USER_RELATIONSHIP_TARGET = "users";
|
|
609
|
+
var AUTO_ID_FIELD = {
|
|
610
|
+
name: "id",
|
|
611
|
+
type: "uuid",
|
|
612
|
+
primaryKey: true
|
|
613
|
+
};
|
|
614
|
+
var DEFAULT_WALK_OPTIONS = {
|
|
615
|
+
includeLists: true,
|
|
616
|
+
includeGroups: true,
|
|
617
|
+
includeTabs: true
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
// constants/snapshots.ts
|
|
621
|
+
var BARREL_SCOPE = "_barrels";
|
|
622
|
+
var REMOVED_SCOPE = "_removed";
|
|
623
|
+
var UNSUPPORTED_PROJECT_STATE_MESSAGE = "Project state is unsupported or incomplete. Re-run `betterstart init --force` to create the current snapshot-backed layout.";
|
|
624
|
+
var SNAPSHOT_COMMENT = "# BetterStart: snapshot files are local-only; manifest is committed";
|
|
625
|
+
var SNAPSHOT_IGNORE = `${BETTERSTART_DIR}/`;
|
|
626
|
+
var SNAPSHOT_ATTRIBUTES = `${BETTERSTART_DIR}/** text eol=lf`;
|
|
627
|
+
var RENAME_MAX_EDIT_DISTANCE = 3;
|
|
628
|
+
|
|
629
|
+
// core-engine/schema/add-field.ts
|
|
630
|
+
import fs3 from "fs";
|
|
631
|
+
|
|
632
|
+
// core-engine/schema/field-type-guards.ts
|
|
473
633
|
function isFieldType(value) {
|
|
474
634
|
return Object.values(FIELD_TYPES).includes(value);
|
|
475
635
|
}
|
|
@@ -488,11 +648,6 @@ import fs2 from "fs";
|
|
|
488
648
|
import path3 from "path";
|
|
489
649
|
|
|
490
650
|
// core-engine/schema/field-helpers/walking.ts
|
|
491
|
-
var DEFAULT_WALK_OPTIONS = {
|
|
492
|
-
includeLists: true,
|
|
493
|
-
includeGroups: true,
|
|
494
|
-
includeTabs: true
|
|
495
|
-
};
|
|
496
651
|
function walkFields(fields, callback, options = DEFAULT_WALK_OPTIONS) {
|
|
497
652
|
function walk(fieldsToWalk, depth, parent) {
|
|
498
653
|
for (const field of fieldsToWalk) {
|
|
@@ -539,11 +694,6 @@ function hasAnyFieldType(fields, types, options) {
|
|
|
539
694
|
}
|
|
540
695
|
|
|
541
696
|
// core-engine/schema/field-helpers/flattening.ts
|
|
542
|
-
var AUTO_ID_FIELD = {
|
|
543
|
-
name: "id",
|
|
544
|
-
type: "uuid",
|
|
545
|
-
primaryKey: true
|
|
546
|
-
};
|
|
547
697
|
function ensureIdField(fields) {
|
|
548
698
|
const hasId = fields.some((f) => f.primaryKey || f.name === "id");
|
|
549
699
|
return hasId ? fields : [AUTO_ID_FIELD, ...fields];
|
|
@@ -754,26 +904,6 @@ function listSchemaNames(schemasDir) {
|
|
|
754
904
|
}
|
|
755
905
|
return Array.from(names).sort();
|
|
756
906
|
}
|
|
757
|
-
var RESERVED_AUTHORSHIP_FIELD_NAMES = /* @__PURE__ */ new Set([
|
|
758
|
-
"createdBy",
|
|
759
|
-
"updatedBy",
|
|
760
|
-
"createdByUser",
|
|
761
|
-
"updatedByUser"
|
|
762
|
-
]);
|
|
763
|
-
var FORM_COLUMN_TYPES = /* @__PURE__ */ new Set(["text", "date", "email", "number", "badge"]);
|
|
764
|
-
var GENERATED_SCHEMA_TITLE_FIELD_NAME = "title";
|
|
765
|
-
var ENTITY_SLUG_FIELD_NAME = "slug";
|
|
766
|
-
var ENTITY_SLUG_FIELD_TYPES = /* @__PURE__ */ new Set(["string", "varchar", "text"]);
|
|
767
|
-
var GENERATED_SCHEMA_TITLE_FIELD_TYPES = /* @__PURE__ */ new Set(["string", "varchar", "text"]);
|
|
768
|
-
var FORM_SCHEMA_TITLE_FIELD_TYPES = /* @__PURE__ */ new Set(["text"]);
|
|
769
|
-
var FORM_SUBMISSION_COLUMN_NAMES = [
|
|
770
|
-
AUTO_FIELDS.ID,
|
|
771
|
-
FORM_SUBMISSION_FIELDS.SUBMITTED_AT,
|
|
772
|
-
FORM_SUBMISSION_FIELDS.IP_ADDRESS,
|
|
773
|
-
FORM_SUBMISSION_FIELDS.USER_AGENT,
|
|
774
|
-
AUTO_FIELDS.CREATED_AT,
|
|
775
|
-
AUTO_FIELDS.UPDATED_AT
|
|
776
|
-
];
|
|
777
907
|
function isEntitySlugField(field) {
|
|
778
908
|
return field.name === ENTITY_SLUG_FIELD_NAME;
|
|
779
909
|
}
|
|
@@ -1357,14 +1487,11 @@ function walkSlot(field, fieldPath, errors) {
|
|
|
1357
1487
|
collectSlotLayoutErrors(tab.slot, `${tabPath}.slot`, currentErrors);
|
|
1358
1488
|
}
|
|
1359
1489
|
},
|
|
1360
|
-
// `collectSlotLayoutErrors` already walks the slot's own fields, under the
|
|
1361
|
-
// `<tab>.slot.<area>.fields.<name>` path.
|
|
1362
1490
|
descendTabSlots: false
|
|
1363
1491
|
});
|
|
1364
1492
|
}
|
|
1365
1493
|
|
|
1366
1494
|
// core-engine/schema/system-relationships.ts
|
|
1367
|
-
var USER_RELATIONSHIP_TARGET = "users";
|
|
1368
1495
|
function isUserRelationshipTarget(relationship) {
|
|
1369
1496
|
return relationship === USER_RELATIONSHIP_TARGET;
|
|
1370
1497
|
}
|
|
@@ -1389,67 +1516,6 @@ function compactShortStringArrays(json) {
|
|
|
1389
1516
|
}
|
|
1390
1517
|
|
|
1391
1518
|
// core-engine/schema/add-field.ts
|
|
1392
|
-
var ENTITY_SINGLE_ADD_FIELD_TYPES = [
|
|
1393
|
-
"string",
|
|
1394
|
-
"email",
|
|
1395
|
-
"varchar",
|
|
1396
|
-
"text",
|
|
1397
|
-
"markdown",
|
|
1398
|
-
"richtext",
|
|
1399
|
-
"number",
|
|
1400
|
-
"decimal",
|
|
1401
|
-
"boolean",
|
|
1402
|
-
"date",
|
|
1403
|
-
"timestamp",
|
|
1404
|
-
"time",
|
|
1405
|
-
"image",
|
|
1406
|
-
"video",
|
|
1407
|
-
"media",
|
|
1408
|
-
"gallery",
|
|
1409
|
-
"icon",
|
|
1410
|
-
"select",
|
|
1411
|
-
"relationship",
|
|
1412
|
-
"list",
|
|
1413
|
-
"group",
|
|
1414
|
-
"section",
|
|
1415
|
-
"tabs",
|
|
1416
|
-
"separator"
|
|
1417
|
-
];
|
|
1418
|
-
var FORM_ADD_FIELD_TYPES = [
|
|
1419
|
-
"text",
|
|
1420
|
-
"textarea",
|
|
1421
|
-
"email",
|
|
1422
|
-
"phone",
|
|
1423
|
-
"number",
|
|
1424
|
-
"url",
|
|
1425
|
-
"date",
|
|
1426
|
-
"select",
|
|
1427
|
-
"radio",
|
|
1428
|
-
"checkbox",
|
|
1429
|
-
"file"
|
|
1430
|
-
];
|
|
1431
|
-
var FORM_OPTION_FIELD_TYPES = ["select", "radio", "checkbox"];
|
|
1432
|
-
var FORM_OPTION_FIELD_TYPE_SET = new Set(FORM_OPTION_FIELD_TYPES);
|
|
1433
|
-
var FORM_REQUIRED_OPTION_FIELD_TYPES = /* @__PURE__ */ new Set(["select", "radio"]);
|
|
1434
|
-
var NON_INTERACTIVE_CONTAINER_TYPES = /* @__PURE__ */ new Set(["group", "section", "tabs", "list"]);
|
|
1435
|
-
var SYSTEM_FIELD_NAMES = /* @__PURE__ */ new Set([
|
|
1436
|
-
"id",
|
|
1437
|
-
"uuid",
|
|
1438
|
-
"serial",
|
|
1439
|
-
"slug",
|
|
1440
|
-
"createdAt",
|
|
1441
|
-
"updatedAt",
|
|
1442
|
-
"published",
|
|
1443
|
-
"submittedAt",
|
|
1444
|
-
"ipAddress",
|
|
1445
|
-
"userAgent",
|
|
1446
|
-
"createdBy",
|
|
1447
|
-
"updatedBy",
|
|
1448
|
-
"createdByUser",
|
|
1449
|
-
"updatedByUser"
|
|
1450
|
-
]);
|
|
1451
|
-
var SCHEMA_LAYOUT_TYPES = /* @__PURE__ */ new Set(["group", "section", "tabs", "separator"]);
|
|
1452
|
-
var FORM_LAYOUT_TYPES = /* @__PURE__ */ new Set(["group"]);
|
|
1453
1519
|
function normalizeAddFieldSlot(slot) {
|
|
1454
1520
|
if (slot === void 0) {
|
|
1455
1521
|
return void 0;
|
|
@@ -1983,16 +2049,11 @@ import path5 from "path";
|
|
|
1983
2049
|
|
|
1984
2050
|
// core-engine/utils/project-dir.ts
|
|
1985
2051
|
import path4 from "path";
|
|
1986
|
-
var BETTERSTART_DIR = ".betterstart";
|
|
1987
2052
|
function betterstartDir(cwd, ...segments) {
|
|
1988
2053
|
return path4.join(cwd, BETTERSTART_DIR, ...segments);
|
|
1989
2054
|
}
|
|
1990
2055
|
|
|
1991
2056
|
// core-engine/snapshots/store.ts
|
|
1992
|
-
var SNAPSHOTS_DIR = `${BETTERSTART_DIR}/snapshots`;
|
|
1993
|
-
var BARREL_SCOPE = "_barrels";
|
|
1994
|
-
var REMOVED_SCOPE = "_removed";
|
|
1995
|
-
var UNSUPPORTED_PROJECT_STATE_MESSAGE = "Project state is unsupported or incomplete. Re-run `betterstart init --force` to create the current snapshot-backed layout.";
|
|
1996
2057
|
function normalizeLineEndings(content) {
|
|
1997
2058
|
return content.replace(/\r\n/g, "\n");
|
|
1998
2059
|
}
|
|
@@ -2115,30 +2176,115 @@ function getAllTrackedFilePaths(cwd) {
|
|
|
2115
2176
|
paths.add(file.path);
|
|
2116
2177
|
}
|
|
2117
2178
|
}
|
|
2118
|
-
return Array.from(paths).sort();
|
|
2179
|
+
return Array.from(paths).sort();
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
// preset-engine/ownership.ts
|
|
2183
|
+
import fs5 from "fs";
|
|
2184
|
+
import path6 from "path";
|
|
2185
|
+
function ownershipPath(cwd) {
|
|
2186
|
+
return betterstartDir(cwd, "schemas", "ownership.json");
|
|
2187
|
+
}
|
|
2188
|
+
function loadSchemaOwnershipIndex(cwd) {
|
|
2189
|
+
const filePath = ownershipPath(cwd);
|
|
2190
|
+
if (!fs5.existsSync(filePath)) {
|
|
2191
|
+
return {
|
|
2192
|
+
version: 1,
|
|
2193
|
+
schemas: {}
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
return JSON.parse(fs5.readFileSync(filePath, "utf-8"));
|
|
2197
|
+
}
|
|
2198
|
+
function saveSchemaOwnershipIndex(cwd, index) {
|
|
2199
|
+
const filePath = ownershipPath(cwd);
|
|
2200
|
+
fs5.mkdirSync(path6.dirname(filePath), { recursive: true });
|
|
2201
|
+
fs5.writeFileSync(filePath, stringifyProjectJson(index), "utf-8");
|
|
2202
|
+
}
|
|
2203
|
+
function getSchemaOwner(cwd, schemaName) {
|
|
2204
|
+
return loadSchemaOwnershipIndex(cwd).schemas[schemaName];
|
|
2205
|
+
}
|
|
2206
|
+
function setSchemaOwner(cwd, schemaName, owner) {
|
|
2207
|
+
const index = loadSchemaOwnershipIndex(cwd);
|
|
2208
|
+
index.schemas[schemaName] = owner;
|
|
2209
|
+
saveSchemaOwnershipIndex(cwd, index);
|
|
2210
|
+
}
|
|
2211
|
+
function removeSchemaOwner(cwd, schemaName) {
|
|
2212
|
+
const index = loadSchemaOwnershipIndex(cwd);
|
|
2213
|
+
delete index.schemas[schemaName];
|
|
2214
|
+
saveSchemaOwnershipIndex(cwd, index);
|
|
2119
2215
|
}
|
|
2120
2216
|
|
|
2121
2217
|
// adapters/next/config.ts
|
|
2122
|
-
import fs6 from "fs";
|
|
2123
|
-
import path7 from "path";
|
|
2124
2218
|
import * as clack from "@clack/prompts";
|
|
2219
|
+
import fs7 from "fs";
|
|
2220
|
+
import path8 from "path";
|
|
2125
2221
|
|
|
2126
2222
|
// adapters/next/config/detect.ts
|
|
2127
|
-
import
|
|
2128
|
-
import
|
|
2223
|
+
import fs6 from "fs";
|
|
2224
|
+
import path7 from "path";
|
|
2225
|
+
|
|
2226
|
+
// constants/lint-configs.ts
|
|
2129
2227
|
var NEXT_CONFIG_FILES = ["next.config.ts", "next.config.js", "next.config.mjs"];
|
|
2228
|
+
var OXLINT_CONFIG_FILES = [
|
|
2229
|
+
".oxlintrc.json",
|
|
2230
|
+
".oxlintrc.jsonc",
|
|
2231
|
+
".oxfmtrc.json",
|
|
2232
|
+
".oxfmtrc.jsonc"
|
|
2233
|
+
];
|
|
2234
|
+
var BIOME_CONFIG_FILES = ["biome.json", "biome.jsonc"];
|
|
2235
|
+
var ESLINT_CONFIG_FILES = [
|
|
2236
|
+
"eslint.config.js",
|
|
2237
|
+
"eslint.config.mjs",
|
|
2238
|
+
"eslint.config.cjs",
|
|
2239
|
+
"eslint.config.ts",
|
|
2240
|
+
".eslintrc.json",
|
|
2241
|
+
".eslintrc.js",
|
|
2242
|
+
".eslintrc.cjs",
|
|
2243
|
+
".eslintrc.yml",
|
|
2244
|
+
".eslintrc.yaml",
|
|
2245
|
+
".eslintrc"
|
|
2246
|
+
];
|
|
2247
|
+
var OXFMT_CONFIG_FILE = ".oxfmtrc.json";
|
|
2248
|
+
var OXLINT_CONFIG_FILE = ".oxlintrc.json";
|
|
2249
|
+
var IGNORE_PATTERNS = [
|
|
2250
|
+
"**/node_modules/**",
|
|
2251
|
+
"**/.next/**",
|
|
2252
|
+
"**/dist/**",
|
|
2253
|
+
"**/build/**",
|
|
2254
|
+
"**/out/**",
|
|
2255
|
+
"**/coverage/**",
|
|
2256
|
+
"**/.turbo/**",
|
|
2257
|
+
"**/.vercel/**",
|
|
2258
|
+
"**/.betterstart/snapshots/**/files/**",
|
|
2259
|
+
"**/*.tsbuildinfo",
|
|
2260
|
+
"**/next-env.d.ts"
|
|
2261
|
+
];
|
|
2262
|
+
var OXFMT_FORMATTABLE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
2263
|
+
".cjs",
|
|
2264
|
+
".cts",
|
|
2265
|
+
".js",
|
|
2266
|
+
".json",
|
|
2267
|
+
".jsonc",
|
|
2268
|
+
".jsx",
|
|
2269
|
+
".mjs",
|
|
2270
|
+
".mts",
|
|
2271
|
+
".ts",
|
|
2272
|
+
".tsx"
|
|
2273
|
+
]);
|
|
2274
|
+
|
|
2275
|
+
// adapters/next/config/detect.ts
|
|
2130
2276
|
function detectProjectName(cwd) {
|
|
2131
|
-
const pkgPath =
|
|
2132
|
-
if (
|
|
2277
|
+
const pkgPath = path7.join(cwd, "package.json");
|
|
2278
|
+
if (fs6.existsSync(pkgPath)) {
|
|
2133
2279
|
try {
|
|
2134
|
-
const pkg = JSON.parse(
|
|
2280
|
+
const pkg = JSON.parse(fs6.readFileSync(pkgPath, "utf-8"));
|
|
2135
2281
|
if (typeof pkg.name === "string" && pkg.name.length > 0) {
|
|
2136
2282
|
return formatProjectName(pkg.name);
|
|
2137
2283
|
}
|
|
2138
2284
|
} catch {
|
|
2139
2285
|
}
|
|
2140
2286
|
}
|
|
2141
|
-
return formatProjectName(
|
|
2287
|
+
return formatProjectName(path7.basename(cwd));
|
|
2142
2288
|
}
|
|
2143
2289
|
function formatProjectName(name) {
|
|
2144
2290
|
const base = name.includes("/") ? name.split("/").pop() : name;
|
|
@@ -2146,21 +2292,21 @@ function formatProjectName(name) {
|
|
|
2146
2292
|
}
|
|
2147
2293
|
function detectProject(cwd, namespaceValue = DEFAULT_ADMIN_NAMESPACE) {
|
|
2148
2294
|
const namespace = validateAdminNamespace(namespaceValue);
|
|
2149
|
-
const isExisting = NEXT_CONFIG_FILES.some((f) =>
|
|
2150
|
-
const hasSrcDir =
|
|
2151
|
-
const hasTypeScript =
|
|
2295
|
+
const isExisting = NEXT_CONFIG_FILES.some((f) => fs6.existsSync(path7.join(cwd, f)));
|
|
2296
|
+
const hasSrcDir = fs6.existsSync(path7.join(cwd, "src"));
|
|
2297
|
+
const hasTypeScript = fs6.existsSync(path7.join(cwd, "tsconfig.json")) || fs6.existsSync(path7.join(cwd, "tsconfig.app.json"));
|
|
2152
2298
|
const hasTailwind = detectTailwind(cwd);
|
|
2153
2299
|
const linter = detectLinter(cwd);
|
|
2154
2300
|
const conflicts = [];
|
|
2155
2301
|
if (isExisting) {
|
|
2156
|
-
if (
|
|
2302
|
+
if (fs6.existsSync(path7.join(cwd, namespace))) {
|
|
2157
2303
|
conflicts.push(`${namespace}/ directory already exists`);
|
|
2158
2304
|
}
|
|
2159
|
-
if (
|
|
2305
|
+
if (fs6.existsSync(path7.join(cwd, CONFIG_FILE_NAME))) {
|
|
2160
2306
|
conflicts.push(`${CONFIG_FILE_NAME} already exists`);
|
|
2161
2307
|
}
|
|
2162
2308
|
const appBase = hasSrcDir ? "src/app" : "app";
|
|
2163
|
-
if (
|
|
2309
|
+
if (fs6.existsSync(path7.join(cwd, appBase, `(${namespace})`))) {
|
|
2164
2310
|
conflicts.push(`${appBase}/(${namespace})/ route group already exists`);
|
|
2165
2311
|
}
|
|
2166
2312
|
if (hasTsconfigAdminAliases(cwd, namespace)) {
|
|
@@ -2169,40 +2315,26 @@ function detectProject(cwd, namespaceValue = DEFAULT_ADMIN_NAMESPACE) {
|
|
|
2169
2315
|
}
|
|
2170
2316
|
return { isExisting, hasSrcDir, hasTypeScript, hasTailwind, linter, conflicts };
|
|
2171
2317
|
}
|
|
2172
|
-
var OXLINT_CONFIG_FILES = [".oxlintrc.json", ".oxlintrc.jsonc", ".oxfmtrc.json", ".oxfmtrc.jsonc"];
|
|
2173
|
-
var BIOME_CONFIG_FILES = ["biome.json", "biome.jsonc"];
|
|
2174
|
-
var ESLINT_CONFIG_FILES = [
|
|
2175
|
-
"eslint.config.js",
|
|
2176
|
-
"eslint.config.mjs",
|
|
2177
|
-
"eslint.config.cjs",
|
|
2178
|
-
"eslint.config.ts",
|
|
2179
|
-
".eslintrc.json",
|
|
2180
|
-
".eslintrc.js",
|
|
2181
|
-
".eslintrc.cjs",
|
|
2182
|
-
".eslintrc.yml",
|
|
2183
|
-
".eslintrc.yaml",
|
|
2184
|
-
".eslintrc"
|
|
2185
|
-
];
|
|
2186
2318
|
function detectLinter(cwd) {
|
|
2187
2319
|
for (const f of OXLINT_CONFIG_FILES) {
|
|
2188
|
-
if (
|
|
2320
|
+
if (fs6.existsSync(path7.join(cwd, f))) {
|
|
2189
2321
|
return { type: "oxlint", configFile: f };
|
|
2190
2322
|
}
|
|
2191
2323
|
}
|
|
2192
2324
|
for (const f of BIOME_CONFIG_FILES) {
|
|
2193
|
-
if (
|
|
2325
|
+
if (fs6.existsSync(path7.join(cwd, f))) {
|
|
2194
2326
|
return { type: "biome", configFile: f };
|
|
2195
2327
|
}
|
|
2196
2328
|
}
|
|
2197
2329
|
for (const f of ESLINT_CONFIG_FILES) {
|
|
2198
|
-
if (
|
|
2330
|
+
if (fs6.existsSync(path7.join(cwd, f))) {
|
|
2199
2331
|
return { type: "eslint", configFile: f };
|
|
2200
2332
|
}
|
|
2201
2333
|
}
|
|
2202
|
-
const pkgPath =
|
|
2203
|
-
if (
|
|
2334
|
+
const pkgPath = path7.join(cwd, "package.json");
|
|
2335
|
+
if (fs6.existsSync(pkgPath)) {
|
|
2204
2336
|
try {
|
|
2205
|
-
const pkg = JSON.parse(
|
|
2337
|
+
const pkg = JSON.parse(fs6.readFileSync(pkgPath, "utf-8"));
|
|
2206
2338
|
if (pkg.eslintConfig) {
|
|
2207
2339
|
return { type: "eslint", configFile: "package.json (eslintConfig)" };
|
|
2208
2340
|
}
|
|
@@ -2213,14 +2345,14 @@ function detectLinter(cwd) {
|
|
|
2213
2345
|
}
|
|
2214
2346
|
function detectTailwind(cwd) {
|
|
2215
2347
|
const cssFiles = ["globals.css", "app.css", "index.css"].flatMap((f) => [
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2348
|
+
path7.join(cwd, "src", "app", f),
|
|
2349
|
+
path7.join(cwd, "app", f),
|
|
2350
|
+
path7.join(cwd, "src", f),
|
|
2351
|
+
path7.join(cwd, f)
|
|
2220
2352
|
]);
|
|
2221
2353
|
for (const cssFile of cssFiles) {
|
|
2222
|
-
if (
|
|
2223
|
-
const content =
|
|
2354
|
+
if (fs6.existsSync(cssFile)) {
|
|
2355
|
+
const content = fs6.readFileSync(cssFile, "utf-8");
|
|
2224
2356
|
if (content.includes('@import "tailwindcss"') || content.includes("@import 'tailwindcss'") || content.includes("@theme")) {
|
|
2225
2357
|
return true;
|
|
2226
2358
|
}
|
|
@@ -2228,8 +2360,8 @@ function detectTailwind(cwd) {
|
|
|
2228
2360
|
}
|
|
2229
2361
|
const postcssFiles = ["postcss.config.js", "postcss.config.mjs", "postcss.config.cjs"];
|
|
2230
2362
|
for (const f of postcssFiles) {
|
|
2231
|
-
if (
|
|
2232
|
-
const content =
|
|
2363
|
+
if (fs6.existsSync(path7.join(cwd, f))) {
|
|
2364
|
+
const content = fs6.readFileSync(path7.join(cwd, f), "utf-8");
|
|
2233
2365
|
if (content.includes("tailwindcss") || content.includes("@tailwindcss")) {
|
|
2234
2366
|
return true;
|
|
2235
2367
|
}
|
|
@@ -2238,20 +2370,20 @@ function detectTailwind(cwd) {
|
|
|
2238
2370
|
return false;
|
|
2239
2371
|
}
|
|
2240
2372
|
function hasTsconfigAdminAliases(cwd, namespace) {
|
|
2241
|
-
const tsconfigPath =
|
|
2242
|
-
if (!
|
|
2373
|
+
const tsconfigPath = path7.join(cwd, "tsconfig.json");
|
|
2374
|
+
if (!fs6.existsSync(tsconfigPath)) return false;
|
|
2243
2375
|
try {
|
|
2244
|
-
const content =
|
|
2376
|
+
const content = fs6.readFileSync(tsconfigPath, "utf-8");
|
|
2245
2377
|
return content.includes(`@${namespace}/`);
|
|
2246
2378
|
} catch {
|
|
2247
2379
|
return false;
|
|
2248
2380
|
}
|
|
2249
2381
|
}
|
|
2250
2382
|
function detectNextMajorVersion(cwd) {
|
|
2251
|
-
const pkgPath =
|
|
2252
|
-
if (!
|
|
2383
|
+
const pkgPath = path7.join(cwd, "package.json");
|
|
2384
|
+
if (!fs6.existsSync(pkgPath)) return 16;
|
|
2253
2385
|
try {
|
|
2254
|
-
const pkg = JSON.parse(
|
|
2386
|
+
const pkg = JSON.parse(fs6.readFileSync(pkgPath, "utf-8"));
|
|
2255
2387
|
const version2 = pkg.dependencies?.next ?? pkg.devDependencies?.next;
|
|
2256
2388
|
if (typeof version2 !== "string") return 16;
|
|
2257
2389
|
const match = version2.match(/(\d+)/);
|
|
@@ -2314,7 +2446,7 @@ async function resolveConfig(cwd) {
|
|
|
2314
2446
|
const workingDir = cwd ?? process.cwd();
|
|
2315
2447
|
const configPath = findConfigFile(workingDir);
|
|
2316
2448
|
const nextMajorVersion = detectNextMajorVersion(workingDir);
|
|
2317
|
-
const hasSrc =
|
|
2449
|
+
const hasSrc = fs7.existsSync(path8.join(workingDir, "src"));
|
|
2318
2450
|
const defaultConfig = getDefaultConfig(hasSrc, nextMajorVersion);
|
|
2319
2451
|
if (!configPath) {
|
|
2320
2452
|
return defaultConfig;
|
|
@@ -2372,7 +2504,7 @@ async function resolveConfigOrExit(cwd) {
|
|
|
2372
2504
|
}
|
|
2373
2505
|
|
|
2374
2506
|
// adapters/next/config/paths.ts
|
|
2375
|
-
import
|
|
2507
|
+
import path9 from "path";
|
|
2376
2508
|
function trimDotSlash(value) {
|
|
2377
2509
|
return value.replace(/^[.][/\\]/, "");
|
|
2378
2510
|
}
|
|
@@ -2382,9 +2514,9 @@ function resolveExtensionNamespace(schemaName, outputNamespace) {
|
|
|
2382
2514
|
function resolveSchemaActionDir(actionsDir, schemaName, outputNamespace) {
|
|
2383
2515
|
const namespace = resolveExtensionNamespace(schemaName, outputNamespace);
|
|
2384
2516
|
if (namespace === "core") {
|
|
2385
|
-
return
|
|
2517
|
+
return path9.posix.join(actionsDir, schemaName);
|
|
2386
2518
|
}
|
|
2387
|
-
return namespace === schemaName ?
|
|
2519
|
+
return namespace === schemaName ? path9.posix.join(actionsDir, schemaName) : path9.posix.join(actionsDir, namespace, schemaName);
|
|
2388
2520
|
}
|
|
2389
2521
|
function resolveSchemaActionImportPath(schemaName, outputNamespace) {
|
|
2390
2522
|
const namespace = resolveExtensionNamespace(schemaName, outputNamespace);
|
|
@@ -2398,77 +2530,421 @@ function resolveProjectPaths(config) {
|
|
|
2398
2530
|
const adminDir = trimDotSlash(config.paths?.admin ?? "./admin");
|
|
2399
2531
|
const pagesDir = trimDotSlash(config.paths?.pages ?? "./src/app/(admin)/admin/(authenticated)");
|
|
2400
2532
|
const schemasDir = trimDotSlash(config.paths?.schemas ?? "./admin/schemas");
|
|
2401
|
-
const adminDbDir =
|
|
2402
|
-
const adminDbCoreDir =
|
|
2403
|
-
const adminUtilsAppDir =
|
|
2404
|
-
const adminTypesDir =
|
|
2405
|
-
const adminNavigationFile =
|
|
2406
|
-
const adminNavigationDir =
|
|
2407
|
-
const adminWebhookEventsFile =
|
|
2408
|
-
const adminWebhookEventsDir =
|
|
2409
|
-
const adminActionsDir =
|
|
2533
|
+
const adminDbDir = path9.posix.join(adminDir, "lib", "db");
|
|
2534
|
+
const adminDbCoreDir = path9.posix.join(adminDbDir, "core");
|
|
2535
|
+
const adminUtilsAppDir = path9.posix.join(adminDir, "utils", "app");
|
|
2536
|
+
const adminTypesDir = path9.posix.join(adminDir, "types");
|
|
2537
|
+
const adminNavigationFile = path9.posix.join(adminDir, "data", "navigation.ts");
|
|
2538
|
+
const adminNavigationDir = path9.posix.join(adminDir, "data", "navigation");
|
|
2539
|
+
const adminWebhookEventsFile = path9.posix.join(adminDir, "data", "webhook-events.ts");
|
|
2540
|
+
const adminWebhookEventsDir = path9.posix.join(adminDir, "data", "webhook-events");
|
|
2541
|
+
const adminActionsDir = path9.posix.join(adminDir, "lib", "actions");
|
|
2410
2542
|
return {
|
|
2411
2543
|
adminDir,
|
|
2412
2544
|
pagesDir,
|
|
2413
2545
|
schemasDir,
|
|
2414
2546
|
adminDbDir,
|
|
2415
2547
|
adminDbCoreDir,
|
|
2416
|
-
adminDbCoreFile:
|
|
2417
|
-
adminDbSchemaFile:
|
|
2548
|
+
adminDbCoreFile: path9.posix.join(adminDbCoreDir, "schema.ts"),
|
|
2549
|
+
adminDbSchemaFile: path9.posix.join(adminDbDir, "schema.ts"),
|
|
2418
2550
|
adminUtilsAppDir,
|
|
2419
2551
|
adminTypesDir,
|
|
2420
|
-
adminDataFile:
|
|
2552
|
+
adminDataFile: path9.posix.join(adminUtilsAppDir, `${namespace.camel}.ts`),
|
|
2421
2553
|
adminDataNavigationFile: adminNavigationFile,
|
|
2422
|
-
adminTypesNavigationFile:
|
|
2554
|
+
adminTypesNavigationFile: path9.posix.join(adminTypesDir, "navigation.ts"),
|
|
2423
2555
|
adminNavigationFile,
|
|
2424
2556
|
adminNavigationDir,
|
|
2425
2557
|
adminWebhookEventsFile,
|
|
2426
2558
|
adminWebhookEventsDir,
|
|
2427
2559
|
adminActionsDir,
|
|
2428
|
-
adminEmailTemplatesDir:
|
|
2429
|
-
adminHooksDir:
|
|
2560
|
+
adminEmailTemplatesDir: path9.posix.join(adminDir, "components", "email-templates"),
|
|
2561
|
+
adminHooksDir: path9.posix.join(adminDir, "hooks")
|
|
2430
2562
|
};
|
|
2431
2563
|
}
|
|
2432
2564
|
|
|
2433
|
-
// preset-engine/ownership.ts
|
|
2434
|
-
import fs7 from "fs";
|
|
2435
|
-
import path9 from "path";
|
|
2436
|
-
function ownershipPath(cwd) {
|
|
2437
|
-
return betterstartDir(cwd, "schemas", "ownership.json");
|
|
2438
|
-
}
|
|
2439
|
-
function loadSchemaOwnershipIndex(cwd) {
|
|
2440
|
-
const filePath = ownershipPath(cwd);
|
|
2441
|
-
if (!fs7.existsSync(filePath)) {
|
|
2442
|
-
return {
|
|
2443
|
-
version: 1,
|
|
2444
|
-
schemas: {}
|
|
2445
|
-
};
|
|
2446
|
-
}
|
|
2447
|
-
return JSON.parse(fs7.readFileSync(filePath, "utf-8"));
|
|
2448
|
-
}
|
|
2449
|
-
function saveSchemaOwnershipIndex(cwd, index) {
|
|
2450
|
-
const filePath = ownershipPath(cwd);
|
|
2451
|
-
fs7.mkdirSync(path9.dirname(filePath), { recursive: true });
|
|
2452
|
-
fs7.writeFileSync(filePath, stringifyProjectJson(index), "utf-8");
|
|
2453
|
-
}
|
|
2454
|
-
function getSchemaOwner(cwd, schemaName) {
|
|
2455
|
-
return loadSchemaOwnershipIndex(cwd).schemas[schemaName];
|
|
2456
|
-
}
|
|
2457
|
-
function setSchemaOwner(cwd, schemaName, owner) {
|
|
2458
|
-
const index = loadSchemaOwnershipIndex(cwd);
|
|
2459
|
-
index.schemas[schemaName] = owner;
|
|
2460
|
-
saveSchemaOwnershipIndex(cwd, index);
|
|
2461
|
-
}
|
|
2462
|
-
function removeSchemaOwner(cwd, schemaName) {
|
|
2463
|
-
const index = loadSchemaOwnershipIndex(cwd);
|
|
2464
|
-
delete index.schemas[schemaName];
|
|
2465
|
-
saveSchemaOwnershipIndex(cwd, index);
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
2565
|
// adapters/next/commands/generate.ts
|
|
2566
|
+
import * as p9 from "@clack/prompts";
|
|
2469
2567
|
import fs26 from "fs";
|
|
2470
2568
|
import path30 from "path";
|
|
2471
|
-
|
|
2569
|
+
|
|
2570
|
+
// constants/deps.ts
|
|
2571
|
+
var NEXT_ADAPTER_DEPS = [
|
|
2572
|
+
"@hookform/resolvers",
|
|
2573
|
+
"@tanstack/react-query",
|
|
2574
|
+
"@tanstack/react-table",
|
|
2575
|
+
"@tanstack/react-virtual",
|
|
2576
|
+
"better-auth",
|
|
2577
|
+
"class-variance-authority",
|
|
2578
|
+
"clsx",
|
|
2579
|
+
"date-fns",
|
|
2580
|
+
"drizzle-orm",
|
|
2581
|
+
"fuse.js",
|
|
2582
|
+
"geist",
|
|
2583
|
+
"kysely@0.28.17",
|
|
2584
|
+
"lucide-react@1.7.0",
|
|
2585
|
+
"nuqs",
|
|
2586
|
+
"postgres",
|
|
2587
|
+
"react-dropzone",
|
|
2588
|
+
"react-hook-form",
|
|
2589
|
+
"shadcn",
|
|
2590
|
+
"sonner",
|
|
2591
|
+
"tailwind-merge",
|
|
2592
|
+
"tw-animate-css",
|
|
2593
|
+
"usehooks-ts",
|
|
2594
|
+
"zod"
|
|
2595
|
+
];
|
|
2596
|
+
var NEXT_ADAPTER_DEV_DEPS = ["drizzle-kit", "pg", "tsx"];
|
|
2597
|
+
var REACT_ADMIN_DEPS = [
|
|
2598
|
+
"@base-ui/react",
|
|
2599
|
+
"@codemirror/commands",
|
|
2600
|
+
"@codemirror/lang-javascript",
|
|
2601
|
+
"@codemirror/lang-json",
|
|
2602
|
+
"@codemirror/lang-markdown",
|
|
2603
|
+
"@codemirror/state",
|
|
2604
|
+
"@codemirror/view",
|
|
2605
|
+
"@dnd-kit/core",
|
|
2606
|
+
"@dnd-kit/sortable",
|
|
2607
|
+
"@dnd-kit/utilities",
|
|
2608
|
+
"@floating-ui/react",
|
|
2609
|
+
"@radix-ui/react-accordion",
|
|
2610
|
+
"@radix-ui/react-alert-dialog",
|
|
2611
|
+
"@radix-ui/react-aspect-ratio",
|
|
2612
|
+
"@radix-ui/react-avatar",
|
|
2613
|
+
"@radix-ui/react-checkbox",
|
|
2614
|
+
"@radix-ui/react-collapsible",
|
|
2615
|
+
"@radix-ui/react-context-menu",
|
|
2616
|
+
"@radix-ui/react-dialog",
|
|
2617
|
+
"@radix-ui/react-dropdown-menu",
|
|
2618
|
+
"@radix-ui/react-hover-card",
|
|
2619
|
+
"@radix-ui/react-label",
|
|
2620
|
+
"@radix-ui/react-menubar",
|
|
2621
|
+
"@radix-ui/react-navigation-menu",
|
|
2622
|
+
"@radix-ui/react-popover",
|
|
2623
|
+
"@radix-ui/react-progress",
|
|
2624
|
+
"@radix-ui/react-radio-group",
|
|
2625
|
+
"@radix-ui/react-scroll-area",
|
|
2626
|
+
"@radix-ui/react-select",
|
|
2627
|
+
"@radix-ui/react-separator",
|
|
2628
|
+
"@radix-ui/react-slider",
|
|
2629
|
+
"@radix-ui/react-slot",
|
|
2630
|
+
"@radix-ui/react-switch",
|
|
2631
|
+
"@radix-ui/react-tabs",
|
|
2632
|
+
"@radix-ui/react-toast",
|
|
2633
|
+
"@radix-ui/react-toggle",
|
|
2634
|
+
"@radix-ui/react-toggle-group",
|
|
2635
|
+
"@radix-ui/react-tooltip",
|
|
2636
|
+
"@tiptap/core",
|
|
2637
|
+
"@tiptap/extension-underline",
|
|
2638
|
+
"@tiptap/extension-highlight",
|
|
2639
|
+
"@tiptap/extension-horizontal-rule",
|
|
2640
|
+
"@tiptap/extension-image",
|
|
2641
|
+
"@tiptap/extension-list",
|
|
2642
|
+
"@tiptap/extension-placeholder",
|
|
2643
|
+
"@tiptap/extension-table",
|
|
2644
|
+
"@tiptap/extension-table-cell",
|
|
2645
|
+
"@tiptap/extension-table-header",
|
|
2646
|
+
"@tiptap/extension-table-row",
|
|
2647
|
+
"@tiptap/extension-typography",
|
|
2648
|
+
"@tiptap/extensions",
|
|
2649
|
+
"@tiptap/markdown",
|
|
2650
|
+
"@tiptap/pm",
|
|
2651
|
+
"@tiptap/react",
|
|
2652
|
+
"@tiptap/starter-kit",
|
|
2653
|
+
"@uiw/codemirror-theme-github",
|
|
2654
|
+
"@uiw/react-codemirror",
|
|
2655
|
+
"cmdk",
|
|
2656
|
+
"embla-carousel-react",
|
|
2657
|
+
"input-otp",
|
|
2658
|
+
"katex",
|
|
2659
|
+
"lodash.throttle",
|
|
2660
|
+
"motion",
|
|
2661
|
+
"next-themes",
|
|
2662
|
+
"radix-ui",
|
|
2663
|
+
"react-day-picker",
|
|
2664
|
+
"react-hotkeys-hook",
|
|
2665
|
+
"react-resizable-panels",
|
|
2666
|
+
"recharts",
|
|
2667
|
+
"vaul"
|
|
2668
|
+
];
|
|
2669
|
+
var REACT_ADMIN_DEV_DEPS = ["@tailwindcss/typography"];
|
|
2670
|
+
var CORE_DEPS = Array.from(/* @__PURE__ */ new Set([...NEXT_ADAPTER_DEPS, ...REACT_ADMIN_DEPS]));
|
|
2671
|
+
var DEV_DEPS = Array.from(/* @__PURE__ */ new Set([...NEXT_ADAPTER_DEV_DEPS, ...REACT_ADMIN_DEV_DEPS]));
|
|
2672
|
+
var LINTER_DEV_DEPS = ["oxlint", "oxfmt"];
|
|
2673
|
+
var POSTGRES_RUNTIME_DEP = "postgres";
|
|
2674
|
+
var DRIZZLE_KIT_POSTGRES_DRIVER_DEP = "pg";
|
|
2675
|
+
var FRESH_PNPM_ALLOWED_BUILDS = [
|
|
2676
|
+
"@parcel/watcher",
|
|
2677
|
+
"esbuild",
|
|
2678
|
+
"msgpackr-extract",
|
|
2679
|
+
"msw",
|
|
2680
|
+
"sharp"
|
|
2681
|
+
];
|
|
2682
|
+
var LOCAL_PACKAGE_PREFIXES = ["workspace:", "link:", "file:", "portal:"];
|
|
2683
|
+
var TIPTAP_PACKAGE_PREFIX = "@tiptap/";
|
|
2684
|
+
var TIPTAP_PACKAGE_VERSION_SPEC = "^3.26.0";
|
|
2685
|
+
var CODEMIRROR_PACKAGE_SPECS = {
|
|
2686
|
+
"@codemirror/commands": "^6.10.3",
|
|
2687
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
2688
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
2689
|
+
"@codemirror/lang-markdown": "^6.5.0",
|
|
2690
|
+
"@codemirror/state": "^6.6.0",
|
|
2691
|
+
"@codemirror/view": "^6.43.0",
|
|
2692
|
+
"@uiw/codemirror-theme-github": "^4.25.10",
|
|
2693
|
+
"@uiw/react-codemirror": "^4.25.10"
|
|
2694
|
+
};
|
|
2695
|
+
var PNPM_PACKAGE_EXTENSION_DEFINITIONS = [
|
|
2696
|
+
{
|
|
2697
|
+
packageName: "@uiw/codemirror-theme-github",
|
|
2698
|
+
selector: "@uiw/codemirror-theme-github@*",
|
|
2699
|
+
extension: {
|
|
2700
|
+
dependencies: {
|
|
2701
|
+
"@babel/runtime": ">=7.11.0",
|
|
2702
|
+
"@lezer/highlight": "*"
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
];
|
|
2707
|
+
var STATIC_CUSTOM_DEPENDENCIES = {
|
|
2708
|
+
"content-editor": [
|
|
2709
|
+
"admin-globals",
|
|
2710
|
+
"content-editor/main-toolbar-content",
|
|
2711
|
+
"content-editor-utils",
|
|
2712
|
+
"content-editor-rich-extensions",
|
|
2713
|
+
"content-editor-editor-view-utils",
|
|
2714
|
+
"markdown-utils",
|
|
2715
|
+
"media-field",
|
|
2716
|
+
"use-content-editor",
|
|
2717
|
+
"use-content-editor-table-add-controls",
|
|
2718
|
+
"use-content-editor-source-mode",
|
|
2719
|
+
"use-content-editor-mobile-toolbar",
|
|
2720
|
+
"use-content-editor-slash-menu",
|
|
2721
|
+
"use-admin-theme",
|
|
2722
|
+
"use-mobile",
|
|
2723
|
+
"tiptap",
|
|
2724
|
+
"tiptap-utils"
|
|
2725
|
+
],
|
|
2726
|
+
"content-editor/tiptap-ui/blockquote-button/blockquote-button": ["use-blockquote"],
|
|
2727
|
+
"content-editor/tiptap-ui/code-block-button/code-block-button": ["use-code-block"],
|
|
2728
|
+
"content-editor/tiptap-ui/color-highlight-button/color-highlight-button": ["use-color-highlight"],
|
|
2729
|
+
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover": [
|
|
2730
|
+
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-button",
|
|
2731
|
+
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content",
|
|
2732
|
+
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors",
|
|
2733
|
+
"content-editor/tiptap-ui/color-highlight-popover/source-color-highlight-popover",
|
|
2734
|
+
"use-color-highlight"
|
|
2735
|
+
],
|
|
2736
|
+
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content": [
|
|
2737
|
+
"content-editor/tiptap-ui/color-highlight-popover/highlight-color-button",
|
|
2738
|
+
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors",
|
|
2739
|
+
"content-editor/use-menu-navigation",
|
|
2740
|
+
"use-color-highlight"
|
|
2741
|
+
],
|
|
2742
|
+
"content-editor/tiptap-ui/color-highlight-popover/highlight-color-button": [
|
|
2743
|
+
"content-editor/tiptap-ui/color-highlight-button/color-highlight-button",
|
|
2744
|
+
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors"
|
|
2745
|
+
],
|
|
2746
|
+
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors": ["use-color-highlight"],
|
|
2747
|
+
"content-editor/tiptap-ui/color-highlight-popover/source-color-highlight-popover": [
|
|
2748
|
+
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-button",
|
|
2749
|
+
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content",
|
|
2750
|
+
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors"
|
|
2751
|
+
],
|
|
2752
|
+
"content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu": [
|
|
2753
|
+
"content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu-item",
|
|
2754
|
+
"use-heading",
|
|
2755
|
+
"use-heading-dropdown-menu"
|
|
2756
|
+
],
|
|
2757
|
+
"content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu-item": ["use-heading"],
|
|
2758
|
+
"content-editor/tiptap-ui/link-popover/link-content": [
|
|
2759
|
+
"content-editor/tiptap-ui/link-popover/link-main",
|
|
2760
|
+
"use-link-popover"
|
|
2761
|
+
],
|
|
2762
|
+
"content-editor/tiptap-ui/link-popover/link-control-popover": [
|
|
2763
|
+
"content-editor/tiptap-ui/link-popover/link-button",
|
|
2764
|
+
"content-editor/tiptap-ui/link-popover/link-main"
|
|
2765
|
+
],
|
|
2766
|
+
"content-editor/tiptap-ui/link-popover/link-popover": [
|
|
2767
|
+
"content-editor/tiptap-ui/link-popover/link-content",
|
|
2768
|
+
"content-editor/tiptap-ui/link-popover/link-control-popover",
|
|
2769
|
+
"use-link-popover"
|
|
2770
|
+
],
|
|
2771
|
+
"content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu": [
|
|
2772
|
+
"content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu-item",
|
|
2773
|
+
"use-list",
|
|
2774
|
+
"use-list-dropdown-menu"
|
|
2775
|
+
],
|
|
2776
|
+
"content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu-item": ["use-list"],
|
|
2777
|
+
"content-editor/tiptap-ui/mark-button/mark-button": ["use-mark"],
|
|
2778
|
+
"content-editor/tiptap-ui/undo-redo-button/undo-redo-button": ["use-undo-redo"],
|
|
2779
|
+
"content-editor/main-toolbar-content": [
|
|
2780
|
+
"content-editor",
|
|
2781
|
+
"content-editor/math-popover",
|
|
2782
|
+
"use-content-editor-media-insertion"
|
|
2783
|
+
],
|
|
2784
|
+
"content-editor/math-popover": [
|
|
2785
|
+
"content-editor/math-bubble-menu",
|
|
2786
|
+
"content-editor/math-button",
|
|
2787
|
+
"content-editor/math-editor-controls",
|
|
2788
|
+
"content-editor/math-popover-button",
|
|
2789
|
+
"content-editor/use-tiptap-editor",
|
|
2790
|
+
"markdown-utils",
|
|
2791
|
+
"tiptap-utils"
|
|
2792
|
+
],
|
|
2793
|
+
"content-editor/math-bubble-menu": [
|
|
2794
|
+
"content-editor/math-editor-controls",
|
|
2795
|
+
"content-editor/use-tiptap-editor",
|
|
2796
|
+
"markdown-utils",
|
|
2797
|
+
"tiptap-utils"
|
|
2798
|
+
],
|
|
2799
|
+
"content-editor/math-popover-button": [
|
|
2800
|
+
"content-editor/math-button",
|
|
2801
|
+
"content-editor/math-editor-controls",
|
|
2802
|
+
"content-editor/use-tiptap-editor",
|
|
2803
|
+
"tiptap-utils"
|
|
2804
|
+
],
|
|
2805
|
+
"content-editor/media-gallery-block": ["media-field"],
|
|
2806
|
+
"content-editor/mobile-toolbar-content": [
|
|
2807
|
+
"content-editor/math-popover",
|
|
2808
|
+
"content-editor/use-tiptap-editor",
|
|
2809
|
+
"tiptap-utils"
|
|
2810
|
+
],
|
|
2811
|
+
"content-editor/selection-bubble-menu": ["content-editor/math-popover"],
|
|
2812
|
+
"content-editor/slash-command-menu": ["content-editor-slash-commands-utils", "tiptap-utils"],
|
|
2813
|
+
"content-editor/source-mode": [
|
|
2814
|
+
"content-editor/math-popover",
|
|
2815
|
+
"use-content-editor-source-mode",
|
|
2816
|
+
"tiptap"
|
|
2817
|
+
],
|
|
2818
|
+
"content-editor/table-bubble-menu": [
|
|
2819
|
+
"content-editor-table-bubble-utils",
|
|
2820
|
+
"content-editor/remove-table-part-icon",
|
|
2821
|
+
"tiptap-utils"
|
|
2822
|
+
],
|
|
2823
|
+
"content-editor/table-button": [
|
|
2824
|
+
"content-editor-table-input-utils",
|
|
2825
|
+
"tiptap-utils",
|
|
2826
|
+
"use-table-button"
|
|
2827
|
+
],
|
|
2828
|
+
"date-range-picker": ["date-utils"],
|
|
2829
|
+
"gallery-field": [
|
|
2830
|
+
"card",
|
|
2831
|
+
"carousel",
|
|
2832
|
+
"media-field",
|
|
2833
|
+
"media-field-empty-state",
|
|
2834
|
+
"media-gallery-dialog",
|
|
2835
|
+
"skeleton",
|
|
2836
|
+
"sortable-gallery-item",
|
|
2837
|
+
"use-media"
|
|
2838
|
+
],
|
|
2839
|
+
"icon-picker": ["icons-column-skeleton", "icons-data"],
|
|
2840
|
+
"media-field": [
|
|
2841
|
+
"media-field-empty-state",
|
|
2842
|
+
"media-gallery-dialog",
|
|
2843
|
+
"media-preview",
|
|
2844
|
+
"media-fallback-utils",
|
|
2845
|
+
"use-copy-to-clipboard",
|
|
2846
|
+
"use-media"
|
|
2847
|
+
],
|
|
2848
|
+
"media-field-empty-state": ["button", "card", "cn", "media-gallery-dialog"],
|
|
2849
|
+
"nested-object-list-field": ["form-list-field-utils"],
|
|
2850
|
+
"progressive-blur": ["use-page-boundary-blur-visibility"],
|
|
2851
|
+
"upload-dropzone": ["upload-utils"]
|
|
2852
|
+
};
|
|
2853
|
+
var TIPTAP_TEMPLATE_DEPENDENCIES = [
|
|
2854
|
+
"use-blockquote",
|
|
2855
|
+
"use-code-block",
|
|
2856
|
+
"use-color-highlight",
|
|
2857
|
+
"content-editor/use-is-breakpoint",
|
|
2858
|
+
"content-editor/use-menu-navigation",
|
|
2859
|
+
"content-editor/use-tiptap-editor",
|
|
2860
|
+
"use-content-editor-table-add-controls",
|
|
2861
|
+
"use-table-button",
|
|
2862
|
+
"content-editor-editor-view-utils",
|
|
2863
|
+
"use-heading",
|
|
2864
|
+
"use-heading-dropdown-menu",
|
|
2865
|
+
"use-link-popover",
|
|
2866
|
+
"use-list",
|
|
2867
|
+
"use-list-dropdown-menu",
|
|
2868
|
+
"use-mark",
|
|
2869
|
+
"use-undo-redo",
|
|
2870
|
+
"content-editor-node-attrs-utils",
|
|
2871
|
+
"content-editor-slash-commands-utils",
|
|
2872
|
+
"content-editor-table-add-controls-utils",
|
|
2873
|
+
"content-editor-table-bubble-utils",
|
|
2874
|
+
"content-editor-table-input-utils",
|
|
2875
|
+
"content-editor-task-item-utils",
|
|
2876
|
+
"content-editor-source-media-utils",
|
|
2877
|
+
"content-editor/main-toolbar-content",
|
|
2878
|
+
"content-editor/source-mode",
|
|
2879
|
+
"tiptap-utils",
|
|
2880
|
+
"content-editor/media-gallery-block",
|
|
2881
|
+
"media-field"
|
|
2882
|
+
];
|
|
2883
|
+
var CODEMIRROR_PACKAGE_DEPS = [
|
|
2884
|
+
"@codemirror/commands",
|
|
2885
|
+
"@codemirror/lang-javascript",
|
|
2886
|
+
"@codemirror/lang-json",
|
|
2887
|
+
"@codemirror/lang-markdown",
|
|
2888
|
+
"@codemirror/state",
|
|
2889
|
+
"@codemirror/view",
|
|
2890
|
+
"@uiw/codemirror-theme-github",
|
|
2891
|
+
"@uiw/react-codemirror"
|
|
2892
|
+
];
|
|
2893
|
+
var TIPTAP_PACKAGE_DEPS = [
|
|
2894
|
+
"@tiptap/core",
|
|
2895
|
+
"@tiptap/extension-underline",
|
|
2896
|
+
"@tiptap/extension-highlight",
|
|
2897
|
+
"@tiptap/extension-horizontal-rule",
|
|
2898
|
+
"@tiptap/extension-image",
|
|
2899
|
+
"@tiptap/extension-list",
|
|
2900
|
+
"@tiptap/extension-placeholder",
|
|
2901
|
+
"@tiptap/extension-table",
|
|
2902
|
+
"@tiptap/extension-table-cell",
|
|
2903
|
+
"@tiptap/extension-table-header",
|
|
2904
|
+
"@tiptap/extension-table-row",
|
|
2905
|
+
"@tiptap/extension-typography",
|
|
2906
|
+
"@tiptap/extensions",
|
|
2907
|
+
"@tiptap/markdown",
|
|
2908
|
+
"@tiptap/pm",
|
|
2909
|
+
"@tiptap/react",
|
|
2910
|
+
"@tiptap/starter-kit"
|
|
2911
|
+
];
|
|
2912
|
+
var KATEX_PACKAGE_DEPS = ["katex"];
|
|
2913
|
+
var TAILWIND_TYPOGRAPHY_PACKAGE_DEPS = ["@tailwindcss/typography"];
|
|
2914
|
+
var COMPONENT_PACKAGE_DEPENDENCIES = {
|
|
2915
|
+
"admin-globals": [...TAILWIND_TYPOGRAPHY_PACKAGE_DEPS, ...KATEX_PACKAGE_DEPS],
|
|
2916
|
+
"content-editor": [
|
|
2917
|
+
...TIPTAP_PACKAGE_DEPS,
|
|
2918
|
+
...CODEMIRROR_PACKAGE_DEPS,
|
|
2919
|
+
...TAILWIND_TYPOGRAPHY_PACKAGE_DEPS,
|
|
2920
|
+
...KATEX_PACKAGE_DEPS
|
|
2921
|
+
],
|
|
2922
|
+
"content-editor-rich-extensions": KATEX_PACKAGE_DEPS,
|
|
2923
|
+
"use-content-editor": [
|
|
2924
|
+
...TIPTAP_PACKAGE_DEPS,
|
|
2925
|
+
...TAILWIND_TYPOGRAPHY_PACKAGE_DEPS,
|
|
2926
|
+
...KATEX_PACKAGE_DEPS
|
|
2927
|
+
],
|
|
2928
|
+
"use-content-editor-media-insertion": ["react-hotkeys-hook"],
|
|
2929
|
+
"use-color-highlight": ["react-hotkeys-hook"],
|
|
2930
|
+
"dev-mode-integrate": CODEMIRROR_PACKAGE_DEPS,
|
|
2931
|
+
"dev-mode-code-mirror": CODEMIRROR_PACKAGE_DEPS,
|
|
2932
|
+
"use-content-editor-table-add-controls": ["@tiptap/pm", "@tiptap/react"],
|
|
2933
|
+
"use-table-button": ["@tiptap/core"],
|
|
2934
|
+
"use-content-editor-source-mode": CODEMIRROR_PACKAGE_DEPS,
|
|
2935
|
+
"content-editor/use-menu-navigation": ["@tiptap/react"],
|
|
2936
|
+
"content-editor/use-tiptap-editor": ["@tiptap/react"],
|
|
2937
|
+
tiptap: TIPTAP_PACKAGE_DEPS,
|
|
2938
|
+
"upload-dropzone": ["react-dropzone"]
|
|
2939
|
+
};
|
|
2940
|
+
var MARKDOWN_IT_RENDERER_SPEC = "markdown-it@^13.0.2";
|
|
2941
|
+
var MARKDOWN_RENDERER_DEPS = [
|
|
2942
|
+
"katex",
|
|
2943
|
+
MARKDOWN_IT_RENDERER_SPEC,
|
|
2944
|
+
"markdown-it-dollarmath",
|
|
2945
|
+
"sanitize-html"
|
|
2946
|
+
];
|
|
2947
|
+
var MARKDOWN_RENDERER_DEV_DEPS = ["@types/markdown-it@13", "@types/sanitize-html"];
|
|
2472
2948
|
|
|
2473
2949
|
// core-engine/snapshots/ast-substitution.ts
|
|
2474
2950
|
import { Node, Project } from "ts-morph";
|
|
@@ -2785,9 +3261,6 @@ function buildRenamePlanAliasMap(plan) {
|
|
|
2785
3261
|
// core-engine/snapshots/gitignore.ts
|
|
2786
3262
|
import fs8 from "fs";
|
|
2787
3263
|
import path10 from "path";
|
|
2788
|
-
var SNAPSHOT_COMMENT = "# BetterStart: snapshot files are local-only; manifest is committed";
|
|
2789
|
-
var SNAPSHOT_IGNORE = `${BETTERSTART_DIR}/`;
|
|
2790
|
-
var SNAPSHOT_ATTRIBUTES = `${BETTERSTART_DIR}/** text eol=lf`;
|
|
2791
3264
|
function ensureLine(filePath, line, comment) {
|
|
2792
3265
|
const existing = fs8.existsSync(filePath) ? fs8.readFileSync(filePath, "utf-8") : "";
|
|
2793
3266
|
const lines = existing === "" ? [] : existing.split("\n");
|
|
@@ -2830,7 +3303,6 @@ function levenshtein(a, b) {
|
|
|
2830
3303
|
}
|
|
2831
3304
|
return matrix[a.length][b.length];
|
|
2832
3305
|
}
|
|
2833
|
-
var RENAME_MAX_EDIT_DISTANCE = 3;
|
|
2834
3306
|
function detectRenames(removed, added, name, isComparable = () => true) {
|
|
2835
3307
|
const candidates = [];
|
|
2836
3308
|
const consumed = /* @__PURE__ */ new Set();
|
|
@@ -2911,13 +3383,6 @@ function diffSchemas(before, after) {
|
|
|
2911
3383
|
import { execFileSync } from "child_process";
|
|
2912
3384
|
import fs9 from "fs";
|
|
2913
3385
|
import path11 from "path";
|
|
2914
|
-
var LOCKFILE_MAP = {
|
|
2915
|
-
"pnpm-lock.yaml": "pnpm",
|
|
2916
|
-
"package-lock.json": "npm",
|
|
2917
|
-
"yarn.lock": "yarn",
|
|
2918
|
-
"bun.lockb": "bun",
|
|
2919
|
-
"bun.lock": "bun"
|
|
2920
|
-
};
|
|
2921
3386
|
function detectPackageManager(cwd) {
|
|
2922
3387
|
let dir = path11.resolve(cwd);
|
|
2923
3388
|
const root = path11.parse(dir).root;
|
|
@@ -2964,10 +3429,18 @@ function createNextAppCommand() {
|
|
|
2964
3429
|
}
|
|
2965
3430
|
|
|
2966
3431
|
// core-engine/utils/spinner.ts
|
|
2967
|
-
import { stripVTControlCharacters } from "util";
|
|
2968
3432
|
import * as p3 from "@clack/prompts";
|
|
3433
|
+
import { stripVTControlCharacters } from "util";
|
|
3434
|
+
|
|
3435
|
+
// constants/prompt-theme.ts
|
|
3436
|
+
var GREEN_STEP_SUBMIT = "\x1B[32m\u25C7\x1B[39m";
|
|
3437
|
+
var GREEN_CHECK = "\x1B[32m\u2713\x1B[39m";
|
|
2969
3438
|
var RENDER_OVERHEAD = 7;
|
|
2970
3439
|
var MIN_MESSAGE_WIDTH = 8;
|
|
3440
|
+
var CLACK_LINE_ROWS = 2;
|
|
3441
|
+
var LOG_PREFIX_WIDTH = 3;
|
|
3442
|
+
|
|
3443
|
+
// core-engine/utils/spinner.ts
|
|
2971
3444
|
function fitSpinnerMessage(message) {
|
|
2972
3445
|
const normalized = message.replace(/\t/g, " ");
|
|
2973
3446
|
const columns = process.stdout.columns ?? 80;
|
|
@@ -2976,8 +3449,6 @@ function fitSpinnerMessage(message) {
|
|
|
2976
3449
|
if (visible.length <= max) return normalized;
|
|
2977
3450
|
return `${visible.slice(0, max - 1)}\u2026`;
|
|
2978
3451
|
}
|
|
2979
|
-
var CLACK_LINE_ROWS = 2;
|
|
2980
|
-
var LOG_PREFIX_WIDTH = 3;
|
|
2981
3452
|
function clackPromptRows(message, value) {
|
|
2982
3453
|
const columns = process.stdout.columns ?? 80;
|
|
2983
3454
|
const rows = (text7) => Math.max(1, Math.ceil((stripVTControlCharacters(text7).length + LOG_PREFIX_WIDTH) / columns));
|
|
@@ -3054,6 +3525,32 @@ function createGeneratedFile(filePath, content) {
|
|
|
3054
3525
|
};
|
|
3055
3526
|
}
|
|
3056
3527
|
|
|
3528
|
+
// constants/generators.ts
|
|
3529
|
+
var ENTITY_ACTION_FIELD_EXCLUSIONS = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt", "sortOrder"]);
|
|
3530
|
+
var SINGLE_ACTION_FIELD_EXCLUSIONS = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt"]);
|
|
3531
|
+
var DEFAULT_ADMIN_IMPORT_ALIAS = "@admin";
|
|
3532
|
+
var SAMPLE_UUID = "00000000-0000-4000-8000-000000000001";
|
|
3533
|
+
var SINGLETON_ID = "00000000-0000-0000-0000-000000000001";
|
|
3534
|
+
var SAMPLE_FORMATTED_TIMESTAMP = "Jan 01, 2026";
|
|
3535
|
+
var AUTHORSHIP_FIELD_NAMES = ["createdBy", "updatedBy"];
|
|
3536
|
+
var EXCLUSIVE_DATE_UPPER_BOUND_SOURCE = `function getExclusiveDateUpperBound(value?: string): string | null {
|
|
3537
|
+
if (!value) return null
|
|
3538
|
+
|
|
3539
|
+
const date = new Date(\`\${value}T00:00:00.000Z\`)
|
|
3540
|
+
if (Number.isNaN(date.getTime())) return null
|
|
3541
|
+
|
|
3542
|
+
date.setUTCDate(date.getUTCDate() + 1)
|
|
3543
|
+
return date.toISOString().slice(0, 10)
|
|
3544
|
+
}`;
|
|
3545
|
+
var TABLE_COLUMN_SIZE_PRESETS = {
|
|
3546
|
+
sm: 120,
|
|
3547
|
+
default: 220,
|
|
3548
|
+
lg: 320,
|
|
3549
|
+
xl: 420
|
|
3550
|
+
};
|
|
3551
|
+
var NO_NAV_SCHEMAS = /* @__PURE__ */ new Set(["settings"]);
|
|
3552
|
+
var NO_WEBHOOK_SCHEMAS = /* @__PURE__ */ new Set(["settings"]);
|
|
3553
|
+
|
|
3057
3554
|
// core-engine/schema/type-mappers/column-defaults.ts
|
|
3058
3555
|
function resolveVarcharLength(field) {
|
|
3059
3556
|
return field.length ?? DRIZZLE_DEFAULTS.VARCHAR_LENGTH;
|
|
@@ -3381,7 +3878,6 @@ function formFieldToZodType(field, options = {}) {
|
|
|
3381
3878
|
}
|
|
3382
3879
|
|
|
3383
3880
|
// adapters/next/generators/actions/action-helpers.ts
|
|
3384
|
-
var AUTHORSHIP_FIELD_NAMES = ["createdBy", "updatedBy"];
|
|
3385
3881
|
function isAuthorshipFieldName(name) {
|
|
3386
3882
|
return AUTHORSHIP_FIELD_NAMES.includes(name);
|
|
3387
3883
|
}
|
|
@@ -3663,8 +4159,7 @@ function findListFieldsWithRelationships(fields) {
|
|
|
3663
4159
|
function generatePopulateListRelsFunction(queries, Singular) {
|
|
3664
4160
|
const blocks = queries.map((q) => {
|
|
3665
4161
|
const v = `${q.fieldPath}_${q.relField.name}`;
|
|
3666
|
-
return `
|
|
3667
|
-
const ${v}Ids = record.${q.listFieldName} && Array.isArray(record.${q.listFieldName})
|
|
4162
|
+
return ` const ${v}Ids = record.${q.listFieldName} && Array.isArray(record.${q.listFieldName})
|
|
3668
4163
|
? (record.${q.listFieldName} as Record<string, unknown>[])
|
|
3669
4164
|
.map((item) => item.${q.relField.name})
|
|
3670
4165
|
.filter((id) => id != null && id !== '')
|
|
@@ -3688,9 +4183,6 @@ function generatePopulateListRelsFunction(queries, Singular) {
|
|
|
3688
4183
|
}`;
|
|
3689
4184
|
});
|
|
3690
4185
|
return `
|
|
3691
|
-
/**
|
|
3692
|
-
* Populate relationship fields inside list (JSONB) fields
|
|
3693
|
-
*/
|
|
3694
4186
|
async function populate${Singular}ListRelationships(record: ${Singular}): Promise<${Singular}> {
|
|
3695
4187
|
${blocks.join("\n\n")}
|
|
3696
4188
|
|
|
@@ -3699,7 +4191,7 @@ ${blocks.join("\n\n")}
|
|
|
3699
4191
|
`;
|
|
3700
4192
|
}
|
|
3701
4193
|
|
|
3702
|
-
//
|
|
4194
|
+
// constants/schema-codegen.ts
|
|
3703
4195
|
var FILTERABLE_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
3704
4196
|
"string",
|
|
3705
4197
|
"email",
|
|
@@ -3714,6 +4206,52 @@ var FILTERABLE_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
|
3714
4206
|
"select"
|
|
3715
4207
|
]);
|
|
3716
4208
|
var BUILT_IN_FILTER_KEYS = /* @__PURE__ */ new Set(["status", "createdAt"]);
|
|
4209
|
+
var SEARCHABLE_FORM_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
4210
|
+
"text",
|
|
4211
|
+
"textarea",
|
|
4212
|
+
"email",
|
|
4213
|
+
"phone",
|
|
4214
|
+
"url",
|
|
4215
|
+
"select",
|
|
4216
|
+
"radio"
|
|
4217
|
+
]);
|
|
4218
|
+
var SORTABLE_FORM_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
4219
|
+
"text",
|
|
4220
|
+
"textarea",
|
|
4221
|
+
"email",
|
|
4222
|
+
"phone",
|
|
4223
|
+
"number",
|
|
4224
|
+
"url",
|
|
4225
|
+
"date",
|
|
4226
|
+
"select",
|
|
4227
|
+
"radio",
|
|
4228
|
+
"checkbox",
|
|
4229
|
+
"timezone"
|
|
4230
|
+
]);
|
|
4231
|
+
var ENTER_PLACEHOLDER_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
4232
|
+
"string",
|
|
4233
|
+
"email",
|
|
4234
|
+
"varchar",
|
|
4235
|
+
"text",
|
|
4236
|
+
"markdown",
|
|
4237
|
+
"richtext",
|
|
4238
|
+
"number",
|
|
4239
|
+
"decimal",
|
|
4240
|
+
"textarea",
|
|
4241
|
+
"phone",
|
|
4242
|
+
"url"
|
|
4243
|
+
]);
|
|
4244
|
+
var SELECT_PLACEHOLDER_FIELD_TYPES = /* @__PURE__ */ new Set(["select", "multiselect"]);
|
|
4245
|
+
var NON_PLACEHOLDER_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
4246
|
+
"group",
|
|
4247
|
+
"section",
|
|
4248
|
+
"tabs",
|
|
4249
|
+
"separator",
|
|
4250
|
+
"list",
|
|
4251
|
+
"dynamicFields"
|
|
4252
|
+
]);
|
|
4253
|
+
|
|
4254
|
+
// adapters/next/generators/entity-filters.ts
|
|
3717
4255
|
function createAutoField(name, type) {
|
|
3718
4256
|
return {
|
|
3719
4257
|
name,
|
|
@@ -4535,11 +5073,11 @@ ${providerOpen}
|
|
|
4535
5073
|
`;
|
|
4536
5074
|
return `'use client'
|
|
4537
5075
|
|
|
5076
|
+
import * as React from 'react'
|
|
4538
5077
|
import { standardSchemaResolver } from '@hookform/resolvers/standard-schema'
|
|
4539
5078
|
import { ChevronLeft, ChevronRight${p32.hasListFields ? ", Trash2" : ""} } from 'lucide-react'
|
|
4540
5079
|
import { createParser, useQueryState } from 'nuqs'
|
|
4541
5080
|
import { NuqsAdapter } from 'nuqs/adapters/next/app'
|
|
4542
|
-
import * as React from 'react'
|
|
4543
5081
|
${p32.rhfImport}
|
|
4544
5082
|
import { z } from 'zod/v3'
|
|
4545
5083
|
import { create${p32.pascal}Submission } from '@admin/actions/${p32.actionImportPath}'
|
|
@@ -4620,7 +5158,6 @@ ${p32.fieldArraySetup}${p32.watchSetup}
|
|
|
4620
5158
|
|
|
4621
5159
|
return (
|
|
4622
5160
|
<form onSubmit={(event) => event.preventDefault()} className="space-y-8">
|
|
4623
|
-
{/* Step header */}
|
|
4624
5161
|
<div>
|
|
4625
5162
|
<h3 className="text-lg font-semibold">{STEPS[currentStep].label}</h3>
|
|
4626
5163
|
{'description' in STEPS[currentStep] && STEPS[currentStep].description && (
|
|
@@ -4628,7 +5165,6 @@ ${p32.fieldArraySetup}${p32.watchSetup}
|
|
|
4628
5165
|
)}
|
|
4629
5166
|
</div>
|
|
4630
5167
|
|
|
4631
|
-
{/* Step content */}
|
|
4632
5168
|
<div key={currentStep} className="animate-in fade-in duration-300 space-y-6">
|
|
4633
5169
|
${p32.stepContentBlocks}
|
|
4634
5170
|
</div>
|
|
@@ -4637,7 +5173,6 @@ ${p32.stepContentBlocks}
|
|
|
4637
5173
|
<p className="text-sm text-destructive">{form.formState.errors.root.message}</p>
|
|
4638
5174
|
)}
|
|
4639
5175
|
|
|
4640
|
-
{/* Navigation */}
|
|
4641
5176
|
<div className="flex justify-between">
|
|
4642
5177
|
<button
|
|
4643
5178
|
type="button"
|
|
@@ -4702,8 +5237,8 @@ ${buildFieldArrayDecls(listFields)}
|
|
|
4702
5237
|
import { Trash2 } from 'lucide-react'` : "";
|
|
4703
5238
|
return `'use client'
|
|
4704
5239
|
|
|
4705
|
-
import { standardSchemaResolver } from '@hookform/resolvers/standard-schema'${lucideImport}
|
|
4706
5240
|
import * as React from 'react'
|
|
5241
|
+
import { standardSchemaResolver } from '@hookform/resolvers/standard-schema'${lucideImport}
|
|
4707
5242
|
${rhfImport}
|
|
4708
5243
|
import { z } from 'zod/v3'
|
|
4709
5244
|
import { create${pascal}Submission } from '@admin/actions/${actionImportPath}'
|
|
@@ -4772,12 +5307,6 @@ ${fieldJSX}
|
|
|
4772
5307
|
}
|
|
4773
5308
|
|
|
4774
5309
|
// adapters/next/generators/dev-mode-integration.ts
|
|
4775
|
-
var ENTITY_ACTION_FIELD_EXCLUSIONS = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt", "sortOrder"]);
|
|
4776
|
-
var SINGLE_ACTION_FIELD_EXCLUSIONS = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt"]);
|
|
4777
|
-
var DEFAULT_ADMIN_IMPORT_ALIAS = "@admin";
|
|
4778
|
-
var SAMPLE_UUID = "00000000-0000-4000-8000-000000000001";
|
|
4779
|
-
var SINGLETON_ID = "00000000-0000-0000-0000-000000000001";
|
|
4780
|
-
var SAMPLE_FORMATTED_TIMESTAMP = "Jan 01, 2026";
|
|
4781
5310
|
function isActionField(field, exclusions) {
|
|
4782
5311
|
return !field.primaryKey && !exclusions.has(field.name) && !isAuthorshipFieldName(field.name) && !isLayoutField(field.type);
|
|
4783
5312
|
}
|
|
@@ -4833,9 +5362,7 @@ function formatTsObject(value, indent = 0) {
|
|
|
4833
5362
|
const childIndent = " ".repeat(indent + 2);
|
|
4834
5363
|
const currentIndent = " ".repeat(indent);
|
|
4835
5364
|
return `{
|
|
4836
|
-
${entries.map(
|
|
4837
|
-
([key, entryValue]) => `${childIndent}${formatPropertyName(key)}: ${formatTsValue(entryValue, indent + 2)}`
|
|
4838
|
-
).join(",\n")}
|
|
5365
|
+
${entries.map(([key, entryValue]) => `${childIndent}${formatPropertyName(key)}: ${formatTsValue(entryValue, indent + 2)}`).join(",\n")}
|
|
4839
5366
|
${currentIndent}}`;
|
|
4840
5367
|
}
|
|
4841
5368
|
function sampleSchemaFieldValue(field) {
|
|
@@ -5741,6 +6268,7 @@ export default async function ${pascal}Submissions() {
|
|
|
5741
6268
|
import * as React from 'react'
|
|
5742
6269
|
import { delete${pascal}Submission } from '${actionModulePath}'
|
|
5743
6270
|
|
|
6271
|
+
import { DEFAULT_ADMIN_IMPORT_ALIAS, ENTITY_ACTION_FIELD_EXCLUSIONS, SAMPLE_FORMATTED_TIMESTAMP, SAMPLE_UUID, SINGLETON_ID, SINGLE_ACTION_FIELD_EXCLUSIONS } from '@cli-constants/generators.js'
|
|
5744
6272
|
export function Delete${pascal}SubmissionButton({ id }: { id: string }) {
|
|
5745
6273
|
const [isPending, startTransition] = React.useTransition()
|
|
5746
6274
|
|
|
@@ -5796,12 +6324,6 @@ function buildSortableHeaderDef(headerText, options = {}) {
|
|
|
5796
6324
|
}
|
|
5797
6325
|
|
|
5798
6326
|
// adapters/next/generators/table-column-size.ts
|
|
5799
|
-
var TABLE_COLUMN_SIZE_PRESETS = {
|
|
5800
|
-
sm: 120,
|
|
5801
|
-
default: 220,
|
|
5802
|
-
lg: 320,
|
|
5803
|
-
xl: 420
|
|
5804
|
-
};
|
|
5805
6327
|
function getTableColumnSize(size) {
|
|
5806
6328
|
return TABLE_COLUMN_SIZE_PRESETS[size ?? "default"] ?? TABLE_COLUMN_SIZE_PRESETS.default;
|
|
5807
6329
|
}
|
|
@@ -6122,15 +6644,6 @@ ${bulkDeleteActions}
|
|
|
6122
6644
|
}
|
|
6123
6645
|
|
|
6124
6646
|
// adapters/next/generators/emitted-helpers.ts
|
|
6125
|
-
var EXCLUSIVE_DATE_UPPER_BOUND_SOURCE = `function getExclusiveDateUpperBound(value?: string): string | null {
|
|
6126
|
-
if (!value) return null
|
|
6127
|
-
|
|
6128
|
-
const date = new Date(\`\${value}T00:00:00.000Z\`)
|
|
6129
|
-
if (Number.isNaN(date.getTime())) return null
|
|
6130
|
-
|
|
6131
|
-
date.setUTCDate(date.getUTCDate() + 1)
|
|
6132
|
-
return date.toISOString().slice(0, 10)
|
|
6133
|
-
}`;
|
|
6134
6647
|
function buildLoadingSkeletonSource(componentName, label) {
|
|
6135
6648
|
return `export function ${componentName}() {
|
|
6136
6649
|
return (
|
|
@@ -6914,28 +7427,6 @@ function afterHook(event, context) {
|
|
|
6914
7427
|
}
|
|
6915
7428
|
|
|
6916
7429
|
// adapters/next/generators/form-pipeline/form-actions.ts
|
|
6917
|
-
var SEARCHABLE_FORM_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
6918
|
-
"text",
|
|
6919
|
-
"textarea",
|
|
6920
|
-
"email",
|
|
6921
|
-
"phone",
|
|
6922
|
-
"url",
|
|
6923
|
-
"select",
|
|
6924
|
-
"radio"
|
|
6925
|
-
]);
|
|
6926
|
-
var SORTABLE_FORM_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
6927
|
-
"text",
|
|
6928
|
-
"textarea",
|
|
6929
|
-
"email",
|
|
6930
|
-
"phone",
|
|
6931
|
-
"number",
|
|
6932
|
-
"url",
|
|
6933
|
-
"date",
|
|
6934
|
-
"select",
|
|
6935
|
-
"radio",
|
|
6936
|
-
"checkbox",
|
|
6937
|
-
"timezone"
|
|
6938
|
-
]);
|
|
6939
7430
|
function getSearchableSubmissionFields(fields) {
|
|
6940
7431
|
return Array.from(
|
|
6941
7432
|
new Set(
|
|
@@ -6973,7 +7464,6 @@ function generateMailchimpCode(schema, fields) {
|
|
|
6973
7464
|
emailFieldName = emailField.name;
|
|
6974
7465
|
}
|
|
6975
7466
|
return `
|
|
6976
|
-
// Add to Mailchimp audience (fire-and-forget, non-blocking)
|
|
6977
7467
|
addToMailchimpAudience(data.${emailFieldName})`;
|
|
6978
7468
|
}
|
|
6979
7469
|
function generateFormActions(schema, actionsDir, options) {
|
|
@@ -7387,6 +7877,8 @@ export async function deleteBulk${pascal}Submissions(ids: string[]): Promise<Del
|
|
|
7387
7877
|
|
|
7388
7878
|
import { get${pascal}Submissions } from './get-${kebab}-submissions'
|
|
7389
7879
|
|
|
7880
|
+
import { EXCLUSIVE_DATE_UPPER_BOUND_SOURCE } from '@cli-constants/generators.js'
|
|
7881
|
+
import { SEARCHABLE_FORM_FIELD_TYPES, SORTABLE_FORM_FIELD_TYPES } from '@cli-constants/schema-codegen.js'
|
|
7390
7882
|
export async function export${pascal}SubmissionsCSV(): Promise<string> {
|
|
7391
7883
|
const { submissions } = await get${pascal}Submissions()
|
|
7392
7884
|
if (submissions.length === 0) return ''
|
|
@@ -7802,7 +8294,6 @@ function namespaceGeneratedFiles(files, namespace) {
|
|
|
7802
8294
|
}
|
|
7803
8295
|
|
|
7804
8296
|
// adapters/next/generators/webhook-events.ts
|
|
7805
|
-
var NO_WEBHOOK_SCHEMAS = /* @__PURE__ */ new Set(["settings"]);
|
|
7806
8297
|
function renderExtract(schemaName, kind, label, events, settingsKey) {
|
|
7807
8298
|
const lines = [
|
|
7808
8299
|
` schema: '${schemaName}'`,
|
|
@@ -8422,7 +8913,6 @@ ${ctx.searchBlock}${ctx.filterConditions}
|
|
|
8422
8913
|
|
|
8423
8914
|
const baseQuery = ${ctx.listSelectClause}
|
|
8424
8915
|
|
|
8425
|
-
// Determine sort order: use requested column or default to sortOrder
|
|
8426
8916
|
const sortColumn = query?.orderBy && query.orderBy in SORTABLE_COLUMNS
|
|
8427
8917
|
? SORTABLE_COLUMNS[query.orderBy as keyof typeof SORTABLE_COLUMNS]
|
|
8428
8918
|
: ${ctx.tableVar}.sortOrder
|
|
@@ -9320,33 +9810,24 @@ export async function bulkUpdate${ctx.Plural}SortOrder(
|
|
|
9320
9810
|
${beforeHook("beforeReorder", "lifecycleContext")}
|
|
9321
9811
|
|
|
9322
9812
|
try {
|
|
9323
|
-
// Sort the provided items by their new position
|
|
9324
9813
|
const sorted = [...updates].sort((a, b) => a.sortOrder - b.sortOrder)
|
|
9325
9814
|
const updatedIds = sorted.map((u) => u.id)
|
|
9326
9815
|
|
|
9327
|
-
// Fetch all items NOT in the update set, preserving their current order
|
|
9328
9816
|
const remaining = await db
|
|
9329
9817
|
.select({ id: ${ctx.tableVar}.id })
|
|
9330
9818
|
.from(${ctx.tableVar})
|
|
9331
9819
|
.where(updatedIds.length > 0 ? notInArray(${ctx.tableVar}.id, updatedIds) : undefined)
|
|
9332
9820
|
.orderBy(asc(${ctx.tableVar}.sortOrder))
|
|
9333
9821
|
|
|
9334
|
-
// Merge: place updated items at their new positions, append remaining after
|
|
9335
|
-
// The updated items define positions 0..N-1 within the loaded window.
|
|
9336
|
-
// Remaining items (not loaded by the client) keep their relative order and
|
|
9337
|
-
// are appended after the last updated item's position.
|
|
9338
9822
|
const maxUpdatedPosition = Math.max(...sorted.map((u) => u.sortOrder))
|
|
9339
9823
|
const allIds: string[] = new Array(maxUpdatedPosition + 1 + remaining.length)
|
|
9340
9824
|
|
|
9341
|
-
// Place updated items at their requested positions
|
|
9342
9825
|
for (const u of sorted) {
|
|
9343
9826
|
allIds[u.sortOrder] = u.id
|
|
9344
9827
|
}
|
|
9345
9828
|
|
|
9346
|
-
// Fill remaining items into empty slots, then append the rest
|
|
9347
9829
|
let fillIndex = 0
|
|
9348
9830
|
let remainingIndex = 0
|
|
9349
|
-
// First fill any gaps before maxUpdatedPosition
|
|
9350
9831
|
while (fillIndex <= maxUpdatedPosition && remainingIndex < remaining.length) {
|
|
9351
9832
|
if (allIds[fillIndex] === undefined) {
|
|
9352
9833
|
allIds[fillIndex] = remaining[remainingIndex].id as string
|
|
@@ -9354,7 +9835,6 @@ export async function bulkUpdate${ctx.Plural}SortOrder(
|
|
|
9354
9835
|
}
|
|
9355
9836
|
fillIndex++
|
|
9356
9837
|
}
|
|
9357
|
-
// Append remaining items after the updated window
|
|
9358
9838
|
let appendIndex = maxUpdatedPosition + 1
|
|
9359
9839
|
while (remainingIndex < remaining.length) {
|
|
9360
9840
|
allIds[appendIndex] = remaining[remainingIndex].id as string
|
|
@@ -9362,7 +9842,6 @@ export async function bulkUpdate${ctx.Plural}SortOrder(
|
|
|
9362
9842
|
appendIndex++
|
|
9363
9843
|
}
|
|
9364
9844
|
|
|
9365
|
-
// Renumber all items gap-free
|
|
9366
9845
|
const appliedOrder = allIds
|
|
9367
9846
|
.filter(Boolean)
|
|
9368
9847
|
.map((id, index) => ({ id, sortOrder: index }))
|
|
@@ -12675,9 +13154,7 @@ function renderNestedObjectListField(field, indent, label, path64, depth) {
|
|
|
12675
13154
|
const titlePathSuffix = titlePath ? `.${titlePath.join(".")}` : "";
|
|
12676
13155
|
const renderTitleProp = titlePath ? `
|
|
12677
13156
|
${indent} renderTitle={(${itemIndexVar}) =>
|
|
12678
|
-
${indent} String(form.watch(\`${path64.map((part) => typeof part === "string" ? part : `\${${part.expression}}`).join(
|
|
12679
|
-
"."
|
|
12680
|
-
)}.\${${itemIndexVar}}${titlePathSuffix}\` as never) || \`${singularLabel} \${${itemIndexVar} + 1}\`)
|
|
13157
|
+
${indent} String(form.watch(\`${path64.map((part) => typeof part === "string" ? part : `\${${part.expression}}`).join(".")}.\${${itemIndexVar}}${titlePathSuffix}\` as never) || \`${singularLabel} \${${itemIndexVar} + 1}\`)
|
|
12681
13158
|
${indent} }` : "";
|
|
12682
13159
|
const nestedFieldsJSX = (field.fields ?? []).map(
|
|
12683
13160
|
(child) => renderNestedField(
|
|
@@ -13121,9 +13598,7 @@ function renderMultiSelectField(field, indent, label, hintJSX, context) {
|
|
|
13121
13598
|
const isCreatable = field.creatable && context.creatableSelectFieldNames?.has(field.name);
|
|
13122
13599
|
const defaultValueFromHandler = defaultValueFromSourceHandler(field, context);
|
|
13123
13600
|
const optionsVar = isCreatable ? `${field.name}Options` : "staticOptions";
|
|
13124
|
-
const staticOptions = `[${(field.options ?? []).map(
|
|
13125
|
-
(option) => `{ label: ${JSON.stringify(option.label)}, value: ${JSON.stringify(option.value)} }`
|
|
13126
|
-
).join(", ")}]`;
|
|
13601
|
+
const staticOptions = `[${(field.options ?? []).map((option) => `{ label: ${JSON.stringify(option.label)}, value: ${JSON.stringify(option.value)} }`).join(", ")}]`;
|
|
13127
13602
|
const openVar = `${field.name}Open`;
|
|
13128
13603
|
const setOpenVar = `set${fieldPascal}Open`;
|
|
13129
13604
|
const searchVar = `${field.name}Search`;
|
|
@@ -15323,7 +15798,6 @@ export function use${Singular}(options: Use${Singular}Options = {}): UseQueryRes
|
|
|
15323
15798
|
}
|
|
15324
15799
|
|
|
15325
15800
|
// adapters/next/generators/navigation.ts
|
|
15326
|
-
var NO_NAV_SCHEMAS = /* @__PURE__ */ new Set(["settings"]);
|
|
15327
15801
|
function updateNavigation(schema, navigationDir, options = {}) {
|
|
15328
15802
|
if (NO_NAV_SCHEMAS.has(schema.name)) {
|
|
15329
15803
|
return { files: [] };
|
|
@@ -15345,9 +15819,7 @@ function updateNavigation(schema, navigationDir, options = {}) {
|
|
|
15345
15819
|
|
|
15346
15820
|
// adapters/next/generators/page-content.ts
|
|
15347
15821
|
function formatSelectOptions(options) {
|
|
15348
|
-
return `[${options.map(
|
|
15349
|
-
(option) => `{ "label": ${JSON.stringify(option.label)}, "value": ${JSON.stringify(option.value)} }`
|
|
15350
|
-
).join(", ")}]`;
|
|
15822
|
+
return `[${options.map((option) => `{ "label": ${JSON.stringify(option.label)}, "value": ${JSON.stringify(option.value)} }`).join(", ")}]`;
|
|
15351
15823
|
}
|
|
15352
15824
|
function formatPropertyAccess(objectName, key) {
|
|
15353
15825
|
return /^[A-Za-z_$][\w$]*$/.test(key) ? `${objectName}.${key}` : `${objectName}[${JSON.stringify(key)}]`;
|
|
@@ -15422,12 +15894,7 @@ ${hasDelete ? `import { deleteBulk${Plural} } from '@admin/actions/${actionImpor
|
|
|
15422
15894
|
` : ""}import { ${Plural}Table } from './${toKebabCase(plural)}-table'
|
|
15423
15895
|
`;
|
|
15424
15896
|
const filterStateLogic = hasFilters ? ` const filterParsers = {
|
|
15425
|
-
${resolvedFilters.flatMap(
|
|
15426
|
-
(filter) => filter.type === "date-range" ? [
|
|
15427
|
-
` '${filter.key}From': parseAsString.withDefault('')`,
|
|
15428
|
-
` '${filter.key}To': parseAsString.withDefault('')`
|
|
15429
|
-
] : [` '${filter.key}': parseAsString.withDefault('')`]
|
|
15430
|
-
).join(",\n")}
|
|
15897
|
+
${resolvedFilters.flatMap((filter) => filter.type === "date-range" ? [` '${filter.key}From': parseAsString.withDefault('')`, ` '${filter.key}To': parseAsString.withDefault('')`] : [` '${filter.key}': parseAsString.withDefault('')`]).join(",\n")}
|
|
15431
15898
|
} as const
|
|
15432
15899
|
const [filterValues, setFilters] = useQueryStates(filterParsers)
|
|
15433
15900
|
${resolvedFilters.flatMap(
|
|
@@ -15455,9 +15922,7 @@ ${resolvedFilters.map(
|
|
|
15455
15922
|
const clearFilterObject = resolvedFilters.flatMap(
|
|
15456
15923
|
(filter) => filter.type === "date-range" ? [` '${filter.key}From': null`, ` '${filter.key}To': null`] : [` '${filter.key}': null`]
|
|
15457
15924
|
).join(",\n");
|
|
15458
|
-
const activeFilterCountExpr = `[search${resolvedFilters.map(
|
|
15459
|
-
(filter) => filter.type === "date-range" ? `, (${filter.fromVariableName} || ${filter.toVariableName})` : `, ${filter.variableName}`
|
|
15460
|
-
).join("")}].filter(Boolean).length`;
|
|
15925
|
+
const activeFilterCountExpr = `[search${resolvedFilters.map((filter) => filter.type === "date-range" ? `, (${filter.fromVariableName} || ${filter.toVariableName})` : `, ${filter.variableName}`).join("")}].filter(Boolean).length`;
|
|
15461
15926
|
const filterConfigEntries = hasFilters ? resolvedFilters.map((filter) => {
|
|
15462
15927
|
if (filter.type === "date-range") {
|
|
15463
15928
|
return ` { key: '${filter.key}', label: '${filter.label}', type: 'date-range' as const, from: ${filter.fromVariableName}, to: ${filter.toVariableName} }`;
|
|
@@ -16194,11 +16659,27 @@ function runSinglePipeline(schema, cwd, config, options = {}) {
|
|
|
16194
16659
|
}
|
|
16195
16660
|
|
|
16196
16661
|
// adapters/next/generators/post-generate.ts
|
|
16662
|
+
import * as p6 from "@clack/prompts";
|
|
16197
16663
|
import { execFile } from "child_process";
|
|
16198
16664
|
import fs12 from "fs";
|
|
16199
16665
|
import path16 from "path";
|
|
16200
16666
|
import { promisify } from "util";
|
|
16201
|
-
|
|
16667
|
+
|
|
16668
|
+
// constants/timeouts.ts
|
|
16669
|
+
var WHOAMI_TIMEOUT_MS = 3e4;
|
|
16670
|
+
var LOGIN_TIMEOUT_MS = 3e5;
|
|
16671
|
+
var DEPLOY_TIMEOUT_MS = 9e5;
|
|
16672
|
+
var ENV_TIMEOUT_MS = 3e4;
|
|
16673
|
+
var ENV_ADD_TIMEOUT_MS = 3e4;
|
|
16674
|
+
var ENV_PULL_TIMEOUT_MS = 6e4;
|
|
16675
|
+
var PROVISION_TIMEOUT_MS = 18e4;
|
|
16676
|
+
var INTERACTIVE_PROVISION_TIMEOUT_MS = 6e5;
|
|
16677
|
+
var INSPECT_TIMEOUT_MS = 3e4;
|
|
16678
|
+
var FORMAT_TIMEOUT_MS = 3e4;
|
|
16679
|
+
var OXFMT_FORMAT_TIMEOUT_MS = 15e3;
|
|
16680
|
+
var LOCKFILE_REFRESH_TIMEOUT_MS = 12e4;
|
|
16681
|
+
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
16682
|
+
var DEFAULT_CAPTURE_TIMEOUT_MS = 12e4;
|
|
16202
16683
|
|
|
16203
16684
|
// adapters/next/init/scaffolders/dependencies.ts
|
|
16204
16685
|
import { spawn } from "child_process";
|
|
@@ -16206,33 +16687,11 @@ import fs11 from "fs";
|
|
|
16206
16687
|
import { createRequire } from "module";
|
|
16207
16688
|
import path14 from "path";
|
|
16208
16689
|
|
|
16209
|
-
//
|
|
16210
|
-
var
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
"@tanstack/react-virtual",
|
|
16215
|
-
"better-auth",
|
|
16216
|
-
"class-variance-authority",
|
|
16217
|
-
"clsx",
|
|
16218
|
-
"date-fns",
|
|
16219
|
-
"drizzle-orm",
|
|
16220
|
-
"fuse.js",
|
|
16221
|
-
"geist",
|
|
16222
|
-
"kysely@0.28.17",
|
|
16223
|
-
"lucide-react@1.7.0",
|
|
16224
|
-
"nuqs",
|
|
16225
|
-
"postgres",
|
|
16226
|
-
"react-dropzone",
|
|
16227
|
-
"react-hook-form",
|
|
16228
|
-
"shadcn",
|
|
16229
|
-
"sonner",
|
|
16230
|
-
"tailwind-merge",
|
|
16231
|
-
"tw-animate-css",
|
|
16232
|
-
"usehooks-ts",
|
|
16233
|
-
"zod"
|
|
16234
|
-
];
|
|
16235
|
-
var NEXT_ADAPTER_DEV_DEPS = ["drizzle-kit", "pg", "tsx"];
|
|
16690
|
+
// constants/tool-versions.ts
|
|
16691
|
+
var RAILWAY_CLI_VERSION = "5.26.4";
|
|
16692
|
+
var VERCEL_CLI_VERSION = "latest";
|
|
16693
|
+
var PINNED_PNPM_PACKAGE_MANAGER = "pnpm@11.9.0";
|
|
16694
|
+
var MIN_SUPPORTED_PNPM_MAJOR = 9;
|
|
16236
16695
|
|
|
16237
16696
|
// core-engine/installable/registry.ts
|
|
16238
16697
|
function createRegistry(registry, noun) {
|
|
@@ -16537,129 +16996,14 @@ function packageNameFromSpec(spec) {
|
|
|
16537
16996
|
if (spec.startsWith("@")) {
|
|
16538
16997
|
const versionSeparator2 = spec.indexOf("@", 1);
|
|
16539
16998
|
return versionSeparator2 === -1 ? spec : spec.slice(0, versionSeparator2);
|
|
16540
|
-
}
|
|
16541
|
-
const versionSeparator = spec.indexOf("@");
|
|
16542
|
-
return versionSeparator === -1 ? spec : spec.slice(0, versionSeparator);
|
|
16543
|
-
}
|
|
16544
|
-
|
|
16545
|
-
// shared-assets/react-admin/dependencies.ts
|
|
16546
|
-
var REACT_ADMIN_DEPS = [
|
|
16547
|
-
"@base-ui/react",
|
|
16548
|
-
"@codemirror/commands",
|
|
16549
|
-
"@codemirror/lang-javascript",
|
|
16550
|
-
"@codemirror/lang-json",
|
|
16551
|
-
"@codemirror/lang-markdown",
|
|
16552
|
-
"@codemirror/state",
|
|
16553
|
-
"@codemirror/view",
|
|
16554
|
-
"@dnd-kit/core",
|
|
16555
|
-
"@dnd-kit/sortable",
|
|
16556
|
-
"@dnd-kit/utilities",
|
|
16557
|
-
"@floating-ui/react",
|
|
16558
|
-
"@radix-ui/react-accordion",
|
|
16559
|
-
"@radix-ui/react-alert-dialog",
|
|
16560
|
-
"@radix-ui/react-aspect-ratio",
|
|
16561
|
-
"@radix-ui/react-avatar",
|
|
16562
|
-
"@radix-ui/react-checkbox",
|
|
16563
|
-
"@radix-ui/react-collapsible",
|
|
16564
|
-
"@radix-ui/react-context-menu",
|
|
16565
|
-
"@radix-ui/react-dialog",
|
|
16566
|
-
"@radix-ui/react-dropdown-menu",
|
|
16567
|
-
"@radix-ui/react-hover-card",
|
|
16568
|
-
"@radix-ui/react-label",
|
|
16569
|
-
"@radix-ui/react-menubar",
|
|
16570
|
-
"@radix-ui/react-navigation-menu",
|
|
16571
|
-
"@radix-ui/react-popover",
|
|
16572
|
-
"@radix-ui/react-progress",
|
|
16573
|
-
"@radix-ui/react-radio-group",
|
|
16574
|
-
"@radix-ui/react-scroll-area",
|
|
16575
|
-
"@radix-ui/react-select",
|
|
16576
|
-
"@radix-ui/react-separator",
|
|
16577
|
-
"@radix-ui/react-slider",
|
|
16578
|
-
"@radix-ui/react-slot",
|
|
16579
|
-
"@radix-ui/react-switch",
|
|
16580
|
-
"@radix-ui/react-tabs",
|
|
16581
|
-
"@radix-ui/react-toast",
|
|
16582
|
-
"@radix-ui/react-toggle",
|
|
16583
|
-
"@radix-ui/react-toggle-group",
|
|
16584
|
-
"@radix-ui/react-tooltip",
|
|
16585
|
-
"@tiptap/core",
|
|
16586
|
-
"@tiptap/extension-underline",
|
|
16587
|
-
"@tiptap/extension-highlight",
|
|
16588
|
-
"@tiptap/extension-horizontal-rule",
|
|
16589
|
-
"@tiptap/extension-image",
|
|
16590
|
-
"@tiptap/extension-list",
|
|
16591
|
-
"@tiptap/extension-placeholder",
|
|
16592
|
-
"@tiptap/extension-table",
|
|
16593
|
-
"@tiptap/extension-table-cell",
|
|
16594
|
-
"@tiptap/extension-table-header",
|
|
16595
|
-
"@tiptap/extension-table-row",
|
|
16596
|
-
"@tiptap/extension-typography",
|
|
16597
|
-
"@tiptap/extensions",
|
|
16598
|
-
"@tiptap/markdown",
|
|
16599
|
-
"@tiptap/pm",
|
|
16600
|
-
"@tiptap/react",
|
|
16601
|
-
"@tiptap/starter-kit",
|
|
16602
|
-
"@uiw/codemirror-theme-github",
|
|
16603
|
-
"@uiw/react-codemirror",
|
|
16604
|
-
"cmdk",
|
|
16605
|
-
"embla-carousel-react",
|
|
16606
|
-
"input-otp",
|
|
16607
|
-
"katex",
|
|
16608
|
-
"lodash.throttle",
|
|
16609
|
-
"motion",
|
|
16610
|
-
"next-themes",
|
|
16611
|
-
"radix-ui",
|
|
16612
|
-
"react-day-picker",
|
|
16613
|
-
"react-hotkeys-hook",
|
|
16614
|
-
"react-resizable-panels",
|
|
16615
|
-
"recharts",
|
|
16616
|
-
"vaul"
|
|
16617
|
-
];
|
|
16618
|
-
var REACT_ADMIN_DEV_DEPS = ["@tailwindcss/typography"];
|
|
16999
|
+
}
|
|
17000
|
+
const versionSeparator = spec.indexOf("@");
|
|
17001
|
+
return versionSeparator === -1 ? spec : spec.slice(0, versionSeparator);
|
|
17002
|
+
}
|
|
16619
17003
|
|
|
16620
17004
|
// adapters/next/init/scaffolders/dependencies.ts
|
|
16621
17005
|
import { parseDocument } from "yaml";
|
|
16622
|
-
var CLI_PACKAGE_NAME = "betterstart-cli";
|
|
16623
|
-
var LOCAL_PACKAGE_PREFIXES = ["workspace:", "link:", "file:", "portal:"];
|
|
16624
|
-
var MIN_SUPPORTED_PNPM_MAJOR = 9;
|
|
16625
|
-
var PINNED_PNPM_PACKAGE_MANAGER = "pnpm@11.9.0";
|
|
16626
|
-
var FRESH_PNPM_ALLOWED_BUILDS = [
|
|
16627
|
-
"@parcel/watcher",
|
|
16628
|
-
"esbuild",
|
|
16629
|
-
"msgpackr-extract",
|
|
16630
|
-
"msw",
|
|
16631
|
-
"sharp"
|
|
16632
|
-
];
|
|
16633
|
-
var TIPTAP_PACKAGE_PREFIX = "@tiptap/";
|
|
16634
|
-
var TIPTAP_PACKAGE_VERSION_SPEC = "^3.26.0";
|
|
16635
|
-
var CODEMIRROR_PACKAGE_SPECS = {
|
|
16636
|
-
"@codemirror/commands": "^6.10.3",
|
|
16637
|
-
"@codemirror/lang-javascript": "^6.2.5",
|
|
16638
|
-
"@codemirror/lang-json": "^6.0.2",
|
|
16639
|
-
"@codemirror/lang-markdown": "^6.5.0",
|
|
16640
|
-
"@codemirror/state": "^6.6.0",
|
|
16641
|
-
"@codemirror/view": "^6.43.0",
|
|
16642
|
-
"@uiw/codemirror-theme-github": "^4.25.10",
|
|
16643
|
-
"@uiw/react-codemirror": "^4.25.10"
|
|
16644
|
-
};
|
|
16645
17006
|
var requireFromCli = createRequire(import.meta.url);
|
|
16646
|
-
var PNPM_PACKAGE_EXTENSION_DEFINITIONS = [
|
|
16647
|
-
{
|
|
16648
|
-
packageName: "@uiw/codemirror-theme-github",
|
|
16649
|
-
selector: "@uiw/codemirror-theme-github@*",
|
|
16650
|
-
extension: {
|
|
16651
|
-
dependencies: {
|
|
16652
|
-
"@babel/runtime": ">=7.11.0",
|
|
16653
|
-
"@lezer/highlight": "*"
|
|
16654
|
-
}
|
|
16655
|
-
}
|
|
16656
|
-
}
|
|
16657
|
-
];
|
|
16658
|
-
var CORE_DEPS = Array.from(/* @__PURE__ */ new Set([...NEXT_ADAPTER_DEPS, ...REACT_ADMIN_DEPS]));
|
|
16659
|
-
var DEV_DEPS = Array.from(/* @__PURE__ */ new Set([...NEXT_ADAPTER_DEV_DEPS, ...REACT_ADMIN_DEV_DEPS]));
|
|
16660
|
-
var LINTER_DEV_DEPS = ["oxlint", "oxfmt"];
|
|
16661
|
-
var POSTGRES_RUNTIME_DEP = "postgres";
|
|
16662
|
-
var DRIZZLE_KIT_POSTGRES_DRIVER_DEP = "pg";
|
|
16663
17007
|
function findPnpmWorkspacePath(cwd) {
|
|
16664
17008
|
let currentDir = path14.resolve(cwd);
|
|
16665
17009
|
const filesystemRoot = path14.parse(currentDir).root;
|
|
@@ -17126,9 +17470,11 @@ async function syncProjectCliDependency(cwd, pm) {
|
|
|
17126
17470
|
}
|
|
17127
17471
|
|
|
17128
17472
|
// adapters/next/utils/drizzle-push.ts
|
|
17473
|
+
import * as p4 from "@clack/prompts";
|
|
17129
17474
|
import { spawn as spawn2 } from "child_process";
|
|
17130
17475
|
import path15 from "path";
|
|
17131
|
-
|
|
17476
|
+
|
|
17477
|
+
// constants/process-output.ts
|
|
17132
17478
|
var PG_SSL_WARNING_START = "Warning: SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.";
|
|
17133
17479
|
var PG_SSL_WARNING_END = "See https://www.postgresql.org/docs/current/libpq-ssl.html for libpq SSL mode definitions.";
|
|
17134
17480
|
var NODE_TRACE_WARNING_HINT = "(Use `node --trace-warnings";
|
|
@@ -17146,11 +17492,23 @@ var SUPPRESSIBLE_LINE_STARTS = [
|
|
|
17146
17492
|
"(node:",
|
|
17147
17493
|
"["
|
|
17148
17494
|
];
|
|
17149
|
-
var
|
|
17495
|
+
var DRIZZLE_TTY_PROMPT_ERROR = "Interactive prompts require a TTY terminal";
|
|
17496
|
+
var LOGIN_NOISE_PATTERNS = [
|
|
17497
|
+
/^vercel cli \d/i,
|
|
17498
|
+
/^>?$/,
|
|
17499
|
+
/^npm (warn|notice)/i,
|
|
17500
|
+
/congratulations! you are now signed in/i,
|
|
17501
|
+
/^to deploy something/i,
|
|
17502
|
+
/to deploy every commit automatically/i,
|
|
17503
|
+
/connect a git repository/i,
|
|
17504
|
+
/vercel\.link\/git/i
|
|
17505
|
+
];
|
|
17506
|
+
var DETAIL_MAX_LINES = 15;
|
|
17507
|
+
|
|
17508
|
+
// adapters/next/utils/drizzle-push.ts
|
|
17150
17509
|
function resolveDrizzlePushStdio(interactive) {
|
|
17151
17510
|
return interactive ? ["inherit", "pipe", "pipe"] : "pipe";
|
|
17152
17511
|
}
|
|
17153
|
-
var DRIZZLE_TTY_PROMPT_ERROR = "Interactive prompts require a TTY terminal";
|
|
17154
17512
|
function createTtyPromptErrorSuppressor(forward) {
|
|
17155
17513
|
let inStack = false;
|
|
17156
17514
|
let saw = false;
|
|
@@ -17363,7 +17721,6 @@ function printNextSteps(options) {
|
|
|
17363
17721
|
}
|
|
17364
17722
|
|
|
17365
17723
|
// adapters/next/generators/post-generate.ts
|
|
17366
|
-
var FORMAT_TIMEOUT_MS = 3e4;
|
|
17367
17724
|
var execFileAsync = promisify(execFile);
|
|
17368
17725
|
function loadEnvFile(cwd) {
|
|
17369
17726
|
const envPath = path16.join(cwd, ".env.local");
|
|
@@ -17614,9 +17971,9 @@ async function runPostGenerate(cwd, schemaName, options = {}) {
|
|
|
17614
17971
|
}
|
|
17615
17972
|
|
|
17616
17973
|
// adapters/next/integration-runtime.ts
|
|
17974
|
+
import * as p7 from "@clack/prompts";
|
|
17617
17975
|
import fs19 from "fs";
|
|
17618
17976
|
import path23 from "path";
|
|
17619
|
-
import * as p7 from "@clack/prompts";
|
|
17620
17977
|
|
|
17621
17978
|
// core-engine/config/serialize.ts
|
|
17622
17979
|
import fs13 from "fs";
|
|
@@ -17738,12 +18095,6 @@ function normalizeManagedFileContent(content) {
|
|
|
17738
18095
|
import fs14 from "fs";
|
|
17739
18096
|
import path18 from "path";
|
|
17740
18097
|
import { parseEnv } from "util";
|
|
17741
|
-
var DEVELOPMENT_ENV_FILES = [
|
|
17742
|
-
".env.development.local",
|
|
17743
|
-
".env.local",
|
|
17744
|
-
".env.development",
|
|
17745
|
-
".env"
|
|
17746
|
-
];
|
|
17747
18098
|
function readEnvVar(cwd, key) {
|
|
17748
18099
|
const envPath = path18.join(cwd, ".env.local");
|
|
17749
18100
|
if (!fs14.existsSync(envPath)) {
|
|
@@ -17993,11 +18344,6 @@ function createInstallableRuntime({
|
|
|
17993
18344
|
return {
|
|
17994
18345
|
resolveProjectPath,
|
|
17995
18346
|
namespaceContent,
|
|
17996
|
-
/**
|
|
17997
|
-
* Refuse to install over a file the user owns. An existing file is only
|
|
17998
|
-
* acceptable when it already matches this installable's template or the
|
|
17999
|
-
* core template the installable is about to replace.
|
|
18000
|
-
*/
|
|
18001
18347
|
ensureDirectFileTargetsAvailable(cwd, config, definition) {
|
|
18002
18348
|
for (const file of definition.files) {
|
|
18003
18349
|
const projectRelativePath = resolveProjectPath(config, file.outputPath);
|
|
@@ -18054,11 +18400,6 @@ function createInstallableRuntime({
|
|
|
18054
18400
|
betterstartDir(projectRoot, "snapshots")
|
|
18055
18401
|
]);
|
|
18056
18402
|
},
|
|
18057
|
-
/**
|
|
18058
|
-
* Hand a managed file back: restore the core template when the output has
|
|
18059
|
-
* one, otherwise delete. Returns the deleted path so callers can feed the
|
|
18060
|
-
* empty-dir cleanup, or `null` when the file was restored.
|
|
18061
|
-
*/
|
|
18062
18403
|
restoreOrDeleteFile(cwd, config, relativeOutputPath) {
|
|
18063
18404
|
const projectRelativePath = resolveProjectPath(config, relativeOutputPath);
|
|
18064
18405
|
const fullPath = toProjectAbsolutePath(cwd, projectRelativePath);
|
|
@@ -18073,10 +18414,6 @@ function createInstallableRuntime({
|
|
|
18073
18414
|
return existed ? projectRelativePath : null;
|
|
18074
18415
|
}
|
|
18075
18416
|
},
|
|
18076
|
-
/**
|
|
18077
|
-
* Re-derive the definition-owned fields of each installed manifest so a CLI
|
|
18078
|
-
* upgrade that changes a definition does not leave stale manifests behind.
|
|
18079
|
-
*/
|
|
18080
18417
|
syncInstalledManifests(cwd, config, installedIds) {
|
|
18081
18418
|
for (const id of installedIds) {
|
|
18082
18419
|
const manifest = loadManifest2(cwd, id);
|
|
@@ -18099,12 +18436,6 @@ function createInstallableRuntime({
|
|
|
18099
18436
|
}
|
|
18100
18437
|
}
|
|
18101
18438
|
},
|
|
18102
|
-
/**
|
|
18103
|
-
* Dependencies the removed installable brought in that nothing else still
|
|
18104
|
-
* needs. Both the remaining same-family ids and the cross-family ids are
|
|
18105
|
-
* passed explicitly rather than read back off `config`, which may already
|
|
18106
|
-
* have been mutated by the in-progress removal.
|
|
18107
|
-
*/
|
|
18108
18439
|
getUnusedDependencies(remainingIds, removedId, crossSetIds) {
|
|
18109
18440
|
const remainingDefinitions = remainingIds.map((id) => getDefinition(id));
|
|
18110
18441
|
const crossDefinitions = crossSetIds.map((id) => getCrossDefinition(id));
|
|
@@ -18980,6 +19311,18 @@ function listAvailableIntegrations() {
|
|
|
18980
19311
|
import fs25 from "fs";
|
|
18981
19312
|
import path29 from "path";
|
|
18982
19313
|
|
|
19314
|
+
// preset-engine/manifests.ts
|
|
19315
|
+
var presetManifestStore = createInstallableManifestStore("presets");
|
|
19316
|
+
function loadInstalledPresetManifest(cwd, presetId) {
|
|
19317
|
+
return presetManifestStore.load(cwd, presetId);
|
|
19318
|
+
}
|
|
19319
|
+
function saveInstalledPresetManifest(cwd, manifest) {
|
|
19320
|
+
presetManifestStore.save(cwd, manifest);
|
|
19321
|
+
}
|
|
19322
|
+
function deleteInstalledPresetManifest(cwd, presetId) {
|
|
19323
|
+
presetManifestStore.remove(cwd, presetId);
|
|
19324
|
+
}
|
|
19325
|
+
|
|
18983
19326
|
// adapters/next/preset-template-reader.ts
|
|
18984
19327
|
import fs20 from "fs";
|
|
18985
19328
|
import path24 from "path";
|
|
@@ -18989,9 +19332,9 @@ function readPresetTemplate(presetId, relativePath) {
|
|
|
18989
19332
|
}
|
|
18990
19333
|
|
|
18991
19334
|
// adapters/next/snapshots/apply.ts
|
|
19335
|
+
import * as p8 from "@clack/prompts";
|
|
18992
19336
|
import fs24 from "fs";
|
|
18993
19337
|
import path28 from "path";
|
|
18994
|
-
import * as p8 from "@clack/prompts";
|
|
18995
19338
|
|
|
18996
19339
|
// core-engine/snapshots/merge.ts
|
|
18997
19340
|
import fs21 from "fs";
|
|
@@ -19045,19 +19388,6 @@ function hasConflictMarkers(content) {
|
|
|
19045
19388
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
19046
19389
|
import fs22 from "fs";
|
|
19047
19390
|
import path26 from "path";
|
|
19048
|
-
var OXFMT_FORMAT_TIMEOUT_MS = 15e3;
|
|
19049
|
-
var OXFMT_FORMATTABLE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
19050
|
-
".cjs",
|
|
19051
|
-
".cts",
|
|
19052
|
-
".js",
|
|
19053
|
-
".json",
|
|
19054
|
-
".jsonc",
|
|
19055
|
-
".jsx",
|
|
19056
|
-
".mjs",
|
|
19057
|
-
".mts",
|
|
19058
|
-
".ts",
|
|
19059
|
-
".tsx"
|
|
19060
|
-
]);
|
|
19061
19391
|
function findOxfmtBin(cwd) {
|
|
19062
19392
|
const oxfmtBin = path26.join(
|
|
19063
19393
|
cwd,
|
|
@@ -19562,18 +19892,6 @@ async function applyGeneratedFiles({
|
|
|
19562
19892
|
return summary;
|
|
19563
19893
|
}
|
|
19564
19894
|
|
|
19565
|
-
// preset-engine/manifests.ts
|
|
19566
|
-
var presetManifestStore = createInstallableManifestStore("presets");
|
|
19567
|
-
function loadInstalledPresetManifest(cwd, presetId) {
|
|
19568
|
-
return presetManifestStore.load(cwd, presetId);
|
|
19569
|
-
}
|
|
19570
|
-
function saveInstalledPresetManifest(cwd, manifest) {
|
|
19571
|
-
presetManifestStore.save(cwd, manifest);
|
|
19572
|
-
}
|
|
19573
|
-
function deleteInstalledPresetManifest(cwd, presetId) {
|
|
19574
|
-
presetManifestStore.remove(cwd, presetId);
|
|
19575
|
-
}
|
|
19576
|
-
|
|
19577
19895
|
// adapters/next/preset-runtime.ts
|
|
19578
19896
|
var presetFiles = createInstallableRuntime({
|
|
19579
19897
|
familySegment: "presets",
|
|
@@ -19707,9 +20025,7 @@ function removePresetSchemas(cwd, config, manifest) {
|
|
|
19707
20025
|
}
|
|
19708
20026
|
if (missingManifests.length > 0) {
|
|
19709
20027
|
throw new Error(
|
|
19710
|
-
`Cannot remove ${manifest.id}. Missing snapshot manifest${missingManifests.length === 1 ? "" : "s"} for preset-owned schema${missingManifests.length === 1 ? "" : "s"}: ${missingManifests.join(
|
|
19711
|
-
", "
|
|
19712
|
-
)}. Re-run \`pnpm betterstart init --force\` to restore snapshot state before removing the preset.`
|
|
20028
|
+
`Cannot remove ${manifest.id}. Missing snapshot manifest${missingManifests.length === 1 ? "" : "s"} for preset-owned schema${missingManifests.length === 1 ? "" : "s"}: ${missingManifests.join(", ")}. Re-run \`pnpm betterstart init --force\` to restore snapshot state before removing the preset.`
|
|
19713
20029
|
);
|
|
19714
20030
|
}
|
|
19715
20031
|
for (const schemaName of manifest.ownedSchemas) {
|
|
@@ -19987,14 +20303,6 @@ function listAvailablePresets() {
|
|
|
19987
20303
|
function isStoredSchemaJson(schemaJson) {
|
|
19988
20304
|
return "fields" in schemaJson;
|
|
19989
20305
|
}
|
|
19990
|
-
var MARKDOWN_IT_RENDERER_SPEC = "markdown-it@^13.0.2";
|
|
19991
|
-
var MARKDOWN_RENDERER_DEPS = [
|
|
19992
|
-
"katex",
|
|
19993
|
-
MARKDOWN_IT_RENDERER_SPEC,
|
|
19994
|
-
"markdown-it-dollarmath",
|
|
19995
|
-
"sanitize-html"
|
|
19996
|
-
];
|
|
19997
|
-
var MARKDOWN_RENDERER_DEV_DEPS = ["@types/markdown-it@13", "@types/sanitize-html"];
|
|
19998
20306
|
function getGeneratedSchemaRoutePath(loaded, adminRoutePath) {
|
|
19999
20307
|
const schemaPath = toKebabCase(loaded.schema.name);
|
|
20000
20308
|
return loaded.type === "form" ? `${adminRoutePath}/forms/${schemaPath}` : `${adminRoutePath}/${schemaPath}`;
|
|
@@ -20696,29 +21004,6 @@ async function promptFieldName(context, label) {
|
|
|
20696
21004
|
}
|
|
20697
21005
|
});
|
|
20698
21006
|
}
|
|
20699
|
-
var ENTER_PLACEHOLDER_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
20700
|
-
"string",
|
|
20701
|
-
"email",
|
|
20702
|
-
"varchar",
|
|
20703
|
-
"text",
|
|
20704
|
-
"markdown",
|
|
20705
|
-
"richtext",
|
|
20706
|
-
"number",
|
|
20707
|
-
"decimal",
|
|
20708
|
-
"textarea",
|
|
20709
|
-
"phone",
|
|
20710
|
-
"url"
|
|
20711
|
-
]);
|
|
20712
|
-
var SELECT_PLACEHOLDER_FIELD_TYPES = /* @__PURE__ */ new Set(["select", "multiselect"]);
|
|
20713
|
-
var NON_PLACEHOLDER_FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
20714
|
-
"group",
|
|
20715
|
-
"section",
|
|
20716
|
-
"tabs",
|
|
20717
|
-
"separator",
|
|
20718
|
-
"list",
|
|
20719
|
-
"dynamicFields"
|
|
20720
|
-
]);
|
|
20721
|
-
var FORM_OPTION_FIELD_TYPE_SET2 = new Set(FORM_OPTION_FIELD_TYPES);
|
|
20722
21007
|
function derivePlaceholderFromLabel(type, label) {
|
|
20723
21008
|
const normalizedLabel = label.trim();
|
|
20724
21009
|
if (!normalizedLabel) {
|
|
@@ -20783,7 +21068,7 @@ async function promptMultiple(context, kind, type) {
|
|
|
20783
21068
|
return ["select", "relationship"].includes(type) ? promptConfirm2(context, "Allow multiple values?", false) : false;
|
|
20784
21069
|
}
|
|
20785
21070
|
async function promptFieldOptions(context, kind, type, creatable) {
|
|
20786
|
-
const requiresOptions = kind === "form" ?
|
|
21071
|
+
const requiresOptions = kind === "form" ? FORM_OPTION_FIELD_TYPE_SET.has(type) : type === "select";
|
|
20787
21072
|
if (!requiresOptions) {
|
|
20788
21073
|
return [];
|
|
20789
21074
|
}
|
|
@@ -21189,9 +21474,6 @@ function displayLabel(field) {
|
|
|
21189
21474
|
}
|
|
21190
21475
|
|
|
21191
21476
|
// adapters/next/commands/add-field.ts
|
|
21192
|
-
var ADD_FIELD_PROMPT_CONTEXT = {
|
|
21193
|
-
cancelMessage: "Add field cancelled."
|
|
21194
|
-
};
|
|
21195
21477
|
function hasNonInteractiveFieldOptions(options) {
|
|
21196
21478
|
return Boolean(
|
|
21197
21479
|
options.type || options.field || options.label || options.slot || options.step || options.before || options.after || options.required || options.multiple || options.creatable || options.relationship || options.option && options.option.length > 0
|
|
@@ -21473,8 +21755,8 @@ ${validationErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
21473
21755
|
}
|
|
21474
21756
|
|
|
21475
21757
|
// adapters/next/commands/add.ts
|
|
21476
|
-
import path32 from "path";
|
|
21477
21758
|
import * as p12 from "@clack/prompts";
|
|
21759
|
+
import path32 from "path";
|
|
21478
21760
|
function printAddNextSteps(installKind, hasSchemaChanges, result, adminRoutePath) {
|
|
21479
21761
|
printNextSteps({
|
|
21480
21762
|
reviewLabel: `the installed ${installKind} files`,
|
|
@@ -21593,23 +21875,9 @@ async function runAddCommand(items, options) {
|
|
|
21593
21875
|
}
|
|
21594
21876
|
|
|
21595
21877
|
// adapters/next/commands/create.ts
|
|
21878
|
+
import * as p13 from "@clack/prompts";
|
|
21596
21879
|
import fs27 from "fs";
|
|
21597
21880
|
import path33 from "path";
|
|
21598
|
-
import * as p13 from "@clack/prompts";
|
|
21599
|
-
var CREATE_PROMPT_CONTEXT = {
|
|
21600
|
-
cancelMessage: "Create schema cancelled."
|
|
21601
|
-
};
|
|
21602
|
-
var SCHEMA_NAME_PATTERN = /^[a-z][a-zA-Z0-9-]*$/;
|
|
21603
|
-
var SCHEMA_NAME_VALIDATION_MESSAGE = "Use letters, numbers, and hyphens, starting with a lowercase letter.";
|
|
21604
|
-
var ADD_FIELD_CONFIRM_INITIAL_VALUE = true;
|
|
21605
|
-
var CREATE_FIELD_PROMPT_OPTIONS = {
|
|
21606
|
-
deriveName: true,
|
|
21607
|
-
derivePlaceholder: true,
|
|
21608
|
-
promptAdvancedOptions: false,
|
|
21609
|
-
promptHeight: false,
|
|
21610
|
-
promptHint: false,
|
|
21611
|
-
typeFirst: true
|
|
21612
|
-
};
|
|
21613
21881
|
function normalizeKind(kind) {
|
|
21614
21882
|
if (kind === "entity" || kind === "single" || kind === "form") {
|
|
21615
21883
|
return kind;
|
|
@@ -22063,11 +22331,11 @@ ${validationErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
22063
22331
|
}
|
|
22064
22332
|
|
|
22065
22333
|
// adapters/next/commands/init.ts
|
|
22334
|
+
import * as p26 from "@clack/prompts";
|
|
22066
22335
|
import { execFileSync as execFileSync4, spawn as spawn6 } from "child_process";
|
|
22067
22336
|
import fs44 from "fs";
|
|
22068
22337
|
import path54 from "path";
|
|
22069
22338
|
import { PassThrough } from "stream";
|
|
22070
|
-
import * as p26 from "@clack/prompts";
|
|
22071
22339
|
|
|
22072
22340
|
// core-engine/utils/cancel-guard.ts
|
|
22073
22341
|
import * as p14 from "@clack/prompts";
|
|
@@ -22096,8 +22364,6 @@ function redirectStdoutToStderr() {
|
|
|
22096
22364
|
}
|
|
22097
22365
|
|
|
22098
22366
|
// core-engine/utils/prompt-theme.ts
|
|
22099
|
-
var GREEN_STEP_SUBMIT = "\x1B[32m\u25C7\x1B[39m";
|
|
22100
|
-
var GREEN_CHECK = "\x1B[32m\u2713\x1B[39m";
|
|
22101
22367
|
function restyleStepSubmitSymbols(text7) {
|
|
22102
22368
|
return text7.split(GREEN_STEP_SUBMIT).join(GREEN_CHECK);
|
|
22103
22369
|
}
|
|
@@ -22119,7 +22385,6 @@ function installPromptCheckmarks() {
|
|
|
22119
22385
|
}
|
|
22120
22386
|
|
|
22121
22387
|
// core-engine/utils/redact.ts
|
|
22122
|
-
var REDACTED = "[redacted]";
|
|
22123
22388
|
function redactSecrets(text7) {
|
|
22124
22389
|
return text7.replace(/(\b[a-z][a-z0-9+.-]*:\/\/[^\s:@/]+:)[^\s@]+@/gi, `$1${REDACTED}@`).replace(/\b(bearer\s+)[a-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(
|
|
22125
22390
|
/(\b[\w-]*(?:token|secret|password|passwd|api[-_]?key|apikey)[\w-]*\s*[=:]\s*)(["']?)[^\s"']{4,}\2/gi,
|
|
@@ -22128,10 +22393,9 @@ function redactSecrets(text7) {
|
|
|
22128
22393
|
}
|
|
22129
22394
|
|
|
22130
22395
|
// adapters/next/init/prompts/database.ts
|
|
22131
|
-
import { execFileSync as execFileSync3 } from "child_process";
|
|
22132
22396
|
import * as p15 from "@clack/prompts";
|
|
22397
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
22133
22398
|
import pc from "picocolors";
|
|
22134
|
-
var VERCEL_NEON_URL = "https://vercel.com/dashboard/integrations/checkout/neon";
|
|
22135
22399
|
async function promptServices() {
|
|
22136
22400
|
const choice = await p15.select({
|
|
22137
22401
|
message: "Connect a PostgreSQL Database",
|
|
@@ -22227,9 +22491,6 @@ import crypto2 from "crypto";
|
|
|
22227
22491
|
// adapters/next/init/scaffolders/dev-server.ts
|
|
22228
22492
|
import fs28 from "fs";
|
|
22229
22493
|
import path34 from "path";
|
|
22230
|
-
var DEFAULT_DEV_PORT = 4242;
|
|
22231
|
-
var DEV_PORT_FLAG_PATTERN = /(?:^|\s)(?:--port(?:=|\s+)|-p(?:=|\s+)?)(\d+)(?=\s|$)/;
|
|
22232
|
-
var DEV_PORT_ENV_PATTERN = /(?:^|\s)PORT=(\d+)(?=\s|$)/;
|
|
22233
22494
|
function detectDevPort(cwd) {
|
|
22234
22495
|
const pkg = readProjectPackageJson(cwd);
|
|
22235
22496
|
if (!pkg) return DEFAULT_DEV_PORT;
|
|
@@ -22295,8 +22556,6 @@ function isValidPort(port) {
|
|
|
22295
22556
|
}
|
|
22296
22557
|
|
|
22297
22558
|
// adapters/next/init/scaffolders/env.ts
|
|
22298
|
-
var LEGACY_DEFAULT_AUTH_URL = "http://localhost:3000";
|
|
22299
|
-
var DATABASE_URL_PLACEHOLDER = "postgresql://...";
|
|
22300
22559
|
function isPlaceholderValue(value) {
|
|
22301
22560
|
return value === DATABASE_URL_PLACEHOLDER || value.startsWith("your_");
|
|
22302
22561
|
}
|
|
@@ -22441,9 +22700,7 @@ async function promptPresets(cwd, options = {}) {
|
|
|
22441
22700
|
} else {
|
|
22442
22701
|
if (existingToken) {
|
|
22443
22702
|
p16.log.info(
|
|
22444
|
-
`Using the existing BLOB_READ_WRITE_TOKEN from .env.local ${pc2.dim(
|
|
22445
|
-
`(${maskBlobToken(existingToken)})`
|
|
22446
|
-
)}`
|
|
22703
|
+
`Using the existing BLOB_READ_WRITE_TOKEN from .env.local ${pc2.dim(`(${maskBlobToken(existingToken)})`)}`
|
|
22447
22704
|
);
|
|
22448
22705
|
}
|
|
22449
22706
|
mergeIntegrationConfig(await collectIntegrationConfig(cwd, ["vercel-blob"]));
|
|
@@ -22513,11 +22770,19 @@ async function promptProject(defaultName) {
|
|
|
22513
22770
|
|
|
22514
22771
|
// adapters/next/init/providers.ts
|
|
22515
22772
|
import * as p18 from "@clack/prompts";
|
|
22773
|
+
|
|
22774
|
+
// constants/providers.ts
|
|
22516
22775
|
var DATABASE_PROVIDERS = ["vercel", "railway", "manual"];
|
|
22517
22776
|
var STORAGE_PROVIDERS = ["vercel-blob", "railway-bucket", "r2", "local"];
|
|
22518
22777
|
var DEPLOY_PROVIDERS = ["vercel", "railway", "none"];
|
|
22519
22778
|
var RAILWAY_BUCKET_REGIONS = ["sjc", "iad", "ams", "sin"];
|
|
22520
|
-
var STORAGE_INTEGRATIONS = /* @__PURE__ */ new Set([
|
|
22779
|
+
var STORAGE_INTEGRATIONS = /* @__PURE__ */ new Set([
|
|
22780
|
+
"vercel-blob",
|
|
22781
|
+
"railway-bucket",
|
|
22782
|
+
"r2"
|
|
22783
|
+
]);
|
|
22784
|
+
|
|
22785
|
+
// adapters/next/init/providers.ts
|
|
22521
22786
|
function assertChoice(label, value, choices) {
|
|
22522
22787
|
if (value && !choices.includes(value)) {
|
|
22523
22788
|
throw new Error(`Invalid ${label} "${value}". Choose one of: ${choices.join(", ")}.`);
|
|
@@ -22603,17 +22868,27 @@ async function promptDeployProvider(initialValue = "none") {
|
|
|
22603
22868
|
}
|
|
22604
22869
|
|
|
22605
22870
|
// adapters/next/init/railway/deploy.ts
|
|
22606
|
-
import path36 from "path";
|
|
22607
22871
|
import * as p20 from "@clack/prompts";
|
|
22872
|
+
import path36 from "path";
|
|
22873
|
+
|
|
22874
|
+
// constants/env-sync.ts
|
|
22875
|
+
var RAILWAY_ENV_SYNC_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
22876
|
+
"VERCEL_OIDC_TOKEN",
|
|
22877
|
+
"RAILWAY_TOKEN",
|
|
22878
|
+
"RAILWAY_API_TOKEN",
|
|
22879
|
+
"BETTERSTART_AUTH_URL",
|
|
22880
|
+
"NEXT_PUBLIC_BETTERSTART_AUTH_URL"
|
|
22881
|
+
]);
|
|
22882
|
+
var VERCEL_ENV_SYNC_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
22883
|
+
"VERCEL_OIDC_TOKEN",
|
|
22884
|
+
"BETTERSTART_AUTH_URL",
|
|
22885
|
+
"NEXT_PUBLIC_BETTERSTART_AUTH_URL"
|
|
22886
|
+
]);
|
|
22608
22887
|
|
|
22609
22888
|
// adapters/next/init/deploy/guard.ts
|
|
22610
22889
|
import { spawn as spawn3 } from "child_process";
|
|
22611
22890
|
import fs29 from "fs";
|
|
22612
22891
|
import path35 from "path";
|
|
22613
|
-
var LOCAL_PROTOCOL_PATTERN = /^(workspace|link|file|portal):/;
|
|
22614
|
-
var CONFIG_IMPORT_PATTERN = /^import\s+\{[^}]*\bdefineConfig\b[^}]*\}\s+from\s+['"]betterstart-cli['"];?[^\S\n]*$/m;
|
|
22615
|
-
var CONFIG_IMPORT_SHIM = "const defineConfig = <T>(config: T): T => config";
|
|
22616
|
-
var LOCKFILE_REFRESH_TIMEOUT_MS = 12e4;
|
|
22617
22892
|
async function guardProjectForDeploy(cwd, refreshLockfile = runPnpmLockfileOnly) {
|
|
22618
22893
|
const restores = [];
|
|
22619
22894
|
const { localSpecDeps, removedCliDep } = guardPackageJson(cwd, restores);
|
|
@@ -22703,6 +22978,12 @@ function guardBetterstartConfig(cwd, restores) {
|
|
|
22703
22978
|
// adapters/next/init/railway/project.ts
|
|
22704
22979
|
import * as p19 from "@clack/prompts";
|
|
22705
22980
|
|
|
22981
|
+
// constants/limits.ts
|
|
22982
|
+
var MAX_PROJECT_NAME_ATTEMPTS = 10;
|
|
22983
|
+
var MAX_STORE_NAME_ATTEMPTS = 10;
|
|
22984
|
+
var MAX_NAME_ATTEMPTS = 10;
|
|
22985
|
+
var MAX_OVERWRITE_PREVIEW_ROWS = 20;
|
|
22986
|
+
|
|
22706
22987
|
// adapters/next/init/railway/runner.ts
|
|
22707
22988
|
import { spawn as spawn4 } from "child_process";
|
|
22708
22989
|
import { stripVTControlCharacters as stripVTControlCharacters3 } from "util";
|
|
@@ -22734,8 +23015,6 @@ function extractOutermostJson(text7) {
|
|
|
22734
23015
|
}
|
|
22735
23016
|
|
|
22736
23017
|
// adapters/next/init/railway/runner.ts
|
|
22737
|
-
var RAILWAY_CLI_VERSION = "5.26.4";
|
|
22738
|
-
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
22739
23018
|
function pathRunner(version2) {
|
|
22740
23019
|
return { bin: "railway", prefix: [], source: "path", version: version2 };
|
|
22741
23020
|
}
|
|
@@ -22880,7 +23159,6 @@ function parseProjectSummary(value) {
|
|
|
22880
23159
|
}
|
|
22881
23160
|
return { id: project2.id, name: project2.name, workspace };
|
|
22882
23161
|
}
|
|
22883
|
-
var MAX_PROJECT_NAME_ATTEMPTS = 10;
|
|
22884
23162
|
function versionedRailwayProjectName(base, attempt) {
|
|
22885
23163
|
return attempt <= 1 ? base : `${base}-v${attempt}`;
|
|
22886
23164
|
}
|
|
@@ -23307,15 +23585,6 @@ function parseDotenvFile(filePath) {
|
|
|
23307
23585
|
|
|
23308
23586
|
// adapters/next/init/railway/deploy.ts
|
|
23309
23587
|
import pc4 from "picocolors";
|
|
23310
|
-
var DEPLOY_TIMEOUT_MS = 9e5;
|
|
23311
|
-
var ENV_TIMEOUT_MS = 3e4;
|
|
23312
|
-
var ENV_SYNC_SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
23313
|
-
"VERCEL_OIDC_TOKEN",
|
|
23314
|
-
"RAILWAY_TOKEN",
|
|
23315
|
-
"RAILWAY_API_TOKEN",
|
|
23316
|
-
"BETTERSTART_AUTH_URL",
|
|
23317
|
-
"NEXT_PUBLIC_BETTERSTART_AUTH_URL"
|
|
23318
|
-
]);
|
|
23319
23588
|
function buildRailwayProviderOverrides(options) {
|
|
23320
23589
|
const overrides = {};
|
|
23321
23590
|
if (options.databaseServiceName) {
|
|
@@ -23344,7 +23613,7 @@ function collectRailwayDeployEnvVars(cwd, existingKeys, providerOverrides) {
|
|
|
23344
23613
|
const variables = [];
|
|
23345
23614
|
const local = parseDotenvFile(path36.join(cwd, ".env.local"));
|
|
23346
23615
|
for (const [key, value] of local) {
|
|
23347
|
-
if (
|
|
23616
|
+
if (RAILWAY_ENV_SYNC_SKIP_KEYS.has(key) || !value || isPlaceholderValue(value)) continue;
|
|
23348
23617
|
if (key in providerOverrides) continue;
|
|
23349
23618
|
if (existingKeys.has(key)) continue;
|
|
23350
23619
|
variables.push({ key, value, overwrite: false });
|
|
@@ -23477,7 +23746,12 @@ async function readFailedDeploymentLogs(session, cwd, service) {
|
|
|
23477
23746
|
"100",
|
|
23478
23747
|
"--json"
|
|
23479
23748
|
],
|
|
23480
|
-
{
|
|
23749
|
+
{
|
|
23750
|
+
cwd,
|
|
23751
|
+
mode: "capture",
|
|
23752
|
+
timeoutMs: 6e4,
|
|
23753
|
+
env: session.env
|
|
23754
|
+
}
|
|
23481
23755
|
);
|
|
23482
23756
|
return railwayOutputTail(`${logs.stdout}
|
|
23483
23757
|
${logs.stderr}`);
|
|
@@ -23604,8 +23878,6 @@ ${deploy.stderr}`) ?? deploy.errorMessage
|
|
|
23604
23878
|
// adapters/next/init/railway/auth.ts
|
|
23605
23879
|
import * as p21 from "@clack/prompts";
|
|
23606
23880
|
import pc5 from "picocolors";
|
|
23607
|
-
var WHOAMI_TIMEOUT_MS = 3e4;
|
|
23608
|
-
var LOGIN_TIMEOUT_MS = 3e5;
|
|
23609
23881
|
function isRailwayAccount(value) {
|
|
23610
23882
|
if (!value || typeof value !== "object") return false;
|
|
23611
23883
|
const account = value;
|
|
@@ -24759,7 +25031,6 @@ function scaffoldLayout({ cwd, config }) {
|
|
|
24759
25031
|
// adapters/next/init/scaffolders/next-config.ts
|
|
24760
25032
|
import fs34 from "fs";
|
|
24761
25033
|
import path45 from "path";
|
|
24762
|
-
var BETTERSTART_ASSET_HOST = "assets.betterstart.dev";
|
|
24763
25034
|
function scaffoldNextConfig({
|
|
24764
25035
|
cwd,
|
|
24765
25036
|
nextMajorVersion
|
|
@@ -25039,16 +25310,6 @@ function removeTopLevelProperty(content, configObject, propertyName) {
|
|
|
25039
25310
|
changed: true
|
|
25040
25311
|
};
|
|
25041
25312
|
}
|
|
25042
|
-
var CONFIG_OBJECT_PATTERNS = [
|
|
25043
|
-
/\b(?:const|let|var)\s+\w+\s*:\s*NextConfig\s*=\s*\{/g,
|
|
25044
|
-
/\b(?:const|let|var)\s+nextConfig\s*=\s*\{/g,
|
|
25045
|
-
/\b(?:const|let|var)\s+\w+\s*:\s*NextConfig\s*=\s*(?:[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\(\s*)+\{/g,
|
|
25046
|
-
/\b(?:const|let|var)\s+nextConfig\s*=\s*(?:[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\(\s*)+\{/g,
|
|
25047
|
-
/export\s+default\s+\{/g,
|
|
25048
|
-
/export\s+default\s+(?:[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\(\s*)+\{/g,
|
|
25049
|
-
/module\.exports\s*=\s*\{/g,
|
|
25050
|
-
/module\.exports\s*=\s*(?:[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\(\s*)+\{/g
|
|
25051
|
-
];
|
|
25052
25313
|
function findConfigObject(content) {
|
|
25053
25314
|
let openingBrace = -1;
|
|
25054
25315
|
let earliestMatch = Number.POSITIVE_INFINITY;
|
|
@@ -25240,21 +25501,6 @@ function isIdentifierBoundary(char) {
|
|
|
25240
25501
|
// adapters/next/init/scaffolders/oxfmt.ts
|
|
25241
25502
|
import fs35 from "fs";
|
|
25242
25503
|
import path46 from "path";
|
|
25243
|
-
var OXFMT_CONFIG_FILE = ".oxfmtrc.json";
|
|
25244
|
-
var OXLINT_CONFIG_FILE = ".oxlintrc.json";
|
|
25245
|
-
var IGNORE_PATTERNS = [
|
|
25246
|
-
"**/node_modules/**",
|
|
25247
|
-
"**/.next/**",
|
|
25248
|
-
"**/dist/**",
|
|
25249
|
-
"**/build/**",
|
|
25250
|
-
"**/out/**",
|
|
25251
|
-
"**/coverage/**",
|
|
25252
|
-
"**/.turbo/**",
|
|
25253
|
-
"**/.vercel/**",
|
|
25254
|
-
"**/.betterstart/snapshots/**/files/**",
|
|
25255
|
-
"**/*.tsbuildinfo",
|
|
25256
|
-
"**/next-env.d.ts"
|
|
25257
|
-
];
|
|
25258
25504
|
function scaffoldOxfmt(cwd, linter, adminDir) {
|
|
25259
25505
|
if (linter.type !== "none") {
|
|
25260
25506
|
return {
|
|
@@ -25273,14 +25519,34 @@ function scaffoldOxfmt(cwd, linter, adminDir) {
|
|
|
25273
25519
|
$schema: "./node_modules/oxfmt/configuration_schema.json",
|
|
25274
25520
|
useTabs: false,
|
|
25275
25521
|
tabWidth: 2,
|
|
25522
|
+
// oxfmt's maximum, so import statements stay on one line instead of exploding into a
|
|
25523
|
+
// specifier block.
|
|
25276
25524
|
printWidth: 100,
|
|
25277
25525
|
singleQuote: true,
|
|
25278
25526
|
semi: false,
|
|
25279
|
-
// Matches how the CLI's own templates are formatted, so a fresh init is
|
|
25280
|
-
// format-clean before the first `lint:fix` ever runs.
|
|
25281
25527
|
trailingComma: "none",
|
|
25528
|
+
// Mirrors the CLI's own `.oxfmtrc.json`, so generated code is format-clean the moment it lands.
|
|
25282
25529
|
sortImports: {
|
|
25283
|
-
newlinesBetween: false
|
|
25530
|
+
newlinesBetween: false,
|
|
25531
|
+
customGroups: [
|
|
25532
|
+
{ groupName: "wildcard", modifiers: ["wildcard"] },
|
|
25533
|
+
{
|
|
25534
|
+
groupName: "admin",
|
|
25535
|
+
modifiers: ["value"],
|
|
25536
|
+
elementNamePattern: [`@${namespace}`, `@${namespace}/**`]
|
|
25537
|
+
}
|
|
25538
|
+
],
|
|
25539
|
+
groups: [
|
|
25540
|
+
"type",
|
|
25541
|
+
"wildcard",
|
|
25542
|
+
"builtin",
|
|
25543
|
+
"admin",
|
|
25544
|
+
"external",
|
|
25545
|
+
["internal", "subpath"],
|
|
25546
|
+
"style",
|
|
25547
|
+
"unknown",
|
|
25548
|
+
["parent", "sibling", "index"]
|
|
25549
|
+
]
|
|
25284
25550
|
},
|
|
25285
25551
|
sortPackageJson: false,
|
|
25286
25552
|
sortTailwindcss: {
|
|
@@ -25302,7 +25568,7 @@ function scaffoldOxfmt(cwd, linter, adminDir) {
|
|
|
25302
25568
|
};
|
|
25303
25569
|
const lintConfig = {
|
|
25304
25570
|
$schema: "./node_modules/oxlint/configuration_schema.json",
|
|
25305
|
-
plugins: ["typescript", "unicorn", "oxc", "react", "jsx-a11y", "nextjs"],
|
|
25571
|
+
plugins: ["typescript", "unicorn", "oxc", "react", "jsx-a11y", "nextjs", "import"],
|
|
25306
25572
|
categories: {
|
|
25307
25573
|
correctness: "error"
|
|
25308
25574
|
},
|
|
@@ -25314,11 +25580,13 @@ function scaffoldOxfmt(cwd, linter, adminDir) {
|
|
|
25314
25580
|
},
|
|
25315
25581
|
rules: {
|
|
25316
25582
|
"react/react-in-jsx-scope": "off",
|
|
25317
|
-
"typescript/no-non-null-assertion": "off"
|
|
25583
|
+
"typescript/no-non-null-assertion": "off",
|
|
25584
|
+
// Inline `type` specifiers become their own `import type` statement, which
|
|
25585
|
+
// oxfmt then hoists via the `type` group above.
|
|
25586
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
|
25318
25587
|
},
|
|
25319
|
-
// The generated admin vendors shadcn and Tiptap primitives whose a11y and
|
|
25320
|
-
//
|
|
25321
|
-
// only, so the rest of the project stays fully linted.
|
|
25588
|
+
// The generated admin vendors shadcn and Tiptap primitives whose a11y and hook shapes
|
|
25589
|
+
// BetterStart owns, so the rest of the project stays fully linted.
|
|
25322
25590
|
overrides: [
|
|
25323
25591
|
{
|
|
25324
25592
|
files: [`**/${admin}/**`, `**/(${namespace})/**`],
|
|
@@ -25359,7 +25627,10 @@ function addLintScripts(cwd) {
|
|
|
25359
25627
|
pkg.scripts = {
|
|
25360
25628
|
...pkg.scripts,
|
|
25361
25629
|
lint: "oxlint && oxfmt --check",
|
|
25362
|
-
|
|
25630
|
+
// oxlint only applies non-overlapping fixes per pass, so an import with
|
|
25631
|
+
// several inline `type` specifiers needs one pass each; the trailing
|
|
25632
|
+
// `oxlint` reports whatever stayed unfixable.
|
|
25633
|
+
"lint:fix": "for _ in 1 2 3 4 5; do oxlint --fix --silent && break; done; oxfmt && oxlint",
|
|
25363
25634
|
format: "oxfmt"
|
|
25364
25635
|
};
|
|
25365
25636
|
const newline = raw.includes("\r\n") ? "\r\n" : "\n";
|
|
@@ -25372,16 +25643,6 @@ import fs37 from "fs";
|
|
|
25372
25643
|
// adapters/next/utils/main-css.ts
|
|
25373
25644
|
import fs36 from "fs";
|
|
25374
25645
|
import path47 from "path";
|
|
25375
|
-
var MAIN_CSS_CANDIDATES = [
|
|
25376
|
-
"src/app/globals.css",
|
|
25377
|
-
"app/globals.css",
|
|
25378
|
-
"src/app/global.css",
|
|
25379
|
-
"app/global.css",
|
|
25380
|
-
"src/app/app.css",
|
|
25381
|
-
"app/app.css",
|
|
25382
|
-
"src/globals.css",
|
|
25383
|
-
"globals.css"
|
|
25384
|
-
];
|
|
25385
25646
|
function findMainCss(cwd) {
|
|
25386
25647
|
for (const candidate of MAIN_CSS_CANDIDATES) {
|
|
25387
25648
|
const filePath = path47.join(cwd, candidate);
|
|
@@ -25394,53 +25655,6 @@ function findMainCss(cwd) {
|
|
|
25394
25655
|
function getSourceLines(namespace, hasSrcDir) {
|
|
25395
25656
|
return hasSrcDir ? [`@source "../../${namespace}/**/*.{ts,tsx}";`, `@source "./(${namespace})/**/*.{ts,tsx}";`] : [`@source "../${namespace}/**/*.{ts,tsx}";`, `@source "./(${namespace})/**/*.{ts,tsx}";`];
|
|
25396
25657
|
}
|
|
25397
|
-
var ADMIN_THEME_BLOCK = `
|
|
25398
|
-
@theme inline {
|
|
25399
|
-
--color-background: var(--background);
|
|
25400
|
-
--color-foreground: var(--foreground);
|
|
25401
|
-
--color-card: var(--card);
|
|
25402
|
-
--color-card-foreground: var(--card-foreground);
|
|
25403
|
-
--color-popover: var(--popover);
|
|
25404
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
25405
|
-
--color-primary: var(--primary);
|
|
25406
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
25407
|
-
--color-secondary: var(--secondary);
|
|
25408
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
25409
|
-
--color-muted: var(--muted);
|
|
25410
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
25411
|
-
--color-accent: var(--accent);
|
|
25412
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
25413
|
-
--color-destructive: var(--destructive);
|
|
25414
|
-
--color-destructive-foreground: var(--destructive-foreground);
|
|
25415
|
-
--color-border: var(--border);
|
|
25416
|
-
--color-input: var(--input);
|
|
25417
|
-
--color-input-border: var(--input-border);
|
|
25418
|
-
--color-ring: var(--ring);
|
|
25419
|
-
--color-chart-1: var(--chart-1);
|
|
25420
|
-
--color-chart-2: var(--chart-2);
|
|
25421
|
-
--color-chart-3: var(--chart-3);
|
|
25422
|
-
--color-chart-4: var(--chart-4);
|
|
25423
|
-
--color-chart-5: var(--chart-5);
|
|
25424
|
-
--color-sidebar: var(--sidebar);
|
|
25425
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
25426
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
25427
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
25428
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
25429
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
25430
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
25431
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
25432
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
25433
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
25434
|
-
--radius-lg: var(--radius);
|
|
25435
|
-
--radius-xl: calc(var(--radius) + 4px);
|
|
25436
|
-
}`;
|
|
25437
|
-
var ADMIN_SHADOW_INPUT_UTILITY = `
|
|
25438
|
-
@utility shadow-input {
|
|
25439
|
-
--admin-shadow-input: rgba(0, 0, 0, 0.02) 0px 4px 8px -2px;
|
|
25440
|
-
--tw-shadow: var(--admin-shadow-input);
|
|
25441
|
-
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
|
|
25442
|
-
var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
25443
|
-
}`;
|
|
25444
25658
|
function getAdminThemeVars() {
|
|
25445
25659
|
return ADMIN_THEME_BLOCK.split("\n").filter((line) => line.trim().startsWith("--"));
|
|
25446
25660
|
}
|
|
@@ -25573,7 +25787,6 @@ function createAdminPathAliases(config) {
|
|
|
25573
25787
|
[`${namespace.alias}/utils/*`]: [`${adminPath}/utils/*`]
|
|
25574
25788
|
};
|
|
25575
25789
|
}
|
|
25576
|
-
var DEPRECATED_ADMIN_PATH_ALIAS_SUFFIXES = ["/data/*", "/auth", "/auth/middleware"];
|
|
25577
25790
|
function sameTargets(a, b) {
|
|
25578
25791
|
return Boolean(a && a.length === b.length && a.every((value, index) => value === b[index]));
|
|
25579
25792
|
}
|
|
@@ -25640,8 +25853,6 @@ import pc6 from "picocolors";
|
|
|
25640
25853
|
// adapters/next/init/vercel/runner.ts
|
|
25641
25854
|
import { spawn as spawn5 } from "child_process";
|
|
25642
25855
|
import { stripVTControlCharacters as stripVTControlCharacters4 } from "util";
|
|
25643
|
-
var VERCEL_CLI_VERSION = "latest";
|
|
25644
|
-
var DEFAULT_CAPTURE_TIMEOUT_MS = 12e4;
|
|
25645
25856
|
function pathRunner2() {
|
|
25646
25857
|
return { bin: "vercel", prefix: [], source: "path" };
|
|
25647
25858
|
}
|
|
@@ -25804,18 +26015,6 @@ function parseVercelJson(stdout) {
|
|
|
25804
26015
|
}
|
|
25805
26016
|
|
|
25806
26017
|
// adapters/next/init/vercel/auth.ts
|
|
25807
|
-
var WHOAMI_TIMEOUT_MS2 = 3e4;
|
|
25808
|
-
var LOGIN_TIMEOUT_MS2 = 3e5;
|
|
25809
|
-
var LOGIN_NOISE_PATTERNS = [
|
|
25810
|
-
/^vercel cli \d/i,
|
|
25811
|
-
/^>?$/,
|
|
25812
|
-
/^npm (warn|notice)/i,
|
|
25813
|
-
/congratulations! you are now signed in/i,
|
|
25814
|
-
/^to deploy something/i,
|
|
25815
|
-
/to deploy every commit automatically/i,
|
|
25816
|
-
/connect a git repository/i,
|
|
25817
|
-
/vercel\.link\/git/i
|
|
25818
|
-
];
|
|
25819
26018
|
function showVercelLoginLine(line) {
|
|
25820
26019
|
return !LOGIN_NOISE_PATTERNS.some((pattern) => pattern.test(line));
|
|
25821
26020
|
}
|
|
@@ -25823,7 +26022,7 @@ async function checkVercelAuth(runner, cwd, env) {
|
|
|
25823
26022
|
const result = await runVercel(runner, ["whoami"], {
|
|
25824
26023
|
cwd,
|
|
25825
26024
|
mode: "capture",
|
|
25826
|
-
timeoutMs:
|
|
26025
|
+
timeoutMs: WHOAMI_TIMEOUT_MS,
|
|
25827
26026
|
env
|
|
25828
26027
|
});
|
|
25829
26028
|
if (result.success) {
|
|
@@ -25868,7 +26067,7 @@ async function ensureVercelAuth(runner, cwd, options) {
|
|
|
25868
26067
|
if (show) streamedRows += 1;
|
|
25869
26068
|
return show;
|
|
25870
26069
|
},
|
|
25871
|
-
timeoutMs:
|
|
26070
|
+
timeoutMs: LOGIN_TIMEOUT_MS,
|
|
25872
26071
|
env
|
|
25873
26072
|
});
|
|
25874
26073
|
if (!login.success) {
|
|
@@ -25897,7 +26096,6 @@ import pc7 from "picocolors";
|
|
|
25897
26096
|
import fs39 from "fs";
|
|
25898
26097
|
import os from "os";
|
|
25899
26098
|
import path49 from "path";
|
|
25900
|
-
var ENV_PULL_TIMEOUT_MS = 6e4;
|
|
25901
26099
|
async function pullVercelEnvValue(runner, cwd, read, env, environment = "development") {
|
|
25902
26100
|
const tmpDir = fs39.mkdtempSync(path49.join(os.tmpdir(), "betterstart-vercel-"));
|
|
25903
26101
|
const tmpEnv = path49.join(tmpDir, ".env.pull");
|
|
@@ -25924,8 +26122,6 @@ function sanitizeVercelProjectName(name) {
|
|
|
25924
26122
|
const cleaned = name.trim().toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[-_.]+/, "").replace(/[-_.]+$/, "").slice(0, 100);
|
|
25925
26123
|
return cleaned || "my-app";
|
|
25926
26124
|
}
|
|
25927
|
-
var MAX_NAME_ATTEMPTS = 10;
|
|
25928
|
-
var INSPECT_TIMEOUT_MS = 3e4;
|
|
25929
26125
|
function versionedVercelProjectName(base, attempt) {
|
|
25930
26126
|
if (attempt <= 1) return base;
|
|
25931
26127
|
const suffix = `-v${attempt}`;
|
|
@@ -26033,9 +26229,6 @@ function readLinkedProjectJson(cwd) {
|
|
|
26033
26229
|
}
|
|
26034
26230
|
|
|
26035
26231
|
// adapters/next/init/vercel/blob.ts
|
|
26036
|
-
var PROVISION_TIMEOUT_MS = 18e4;
|
|
26037
|
-
var INTERACTIVE_PROVISION_TIMEOUT_MS = 6e5;
|
|
26038
|
-
var MAX_STORE_NAME_ATTEMPTS = 10;
|
|
26039
26232
|
function blobStoreName(projectName) {
|
|
26040
26233
|
return sanitizeVercelProjectName(`${projectName}-blob`);
|
|
26041
26234
|
}
|
|
@@ -26120,9 +26313,7 @@ async function provisionBlobStoreInteractive(runner, cwd, options) {
|
|
|
26120
26313
|
terminalFallbackRan = true;
|
|
26121
26314
|
quietSpinner.clear();
|
|
26122
26315
|
p23.log.info(
|
|
26123
|
-
`Create your Blob store in the Vercel prompts below ${pc7.dim(
|
|
26124
|
-
"(connect it to all environments)."
|
|
26125
|
-
)}`
|
|
26316
|
+
`Create your Blob store in the Vercel prompts below ${pc7.dim("(connect it to all environments).")}`
|
|
26126
26317
|
);
|
|
26127
26318
|
const add = await runVercel(runner, ["blob", "create-store", storeName, "--access", "public"], {
|
|
26128
26319
|
cwd,
|
|
@@ -26195,19 +26386,11 @@ function readBlobTokenFromDotenv(filePath) {
|
|
|
26195
26386
|
import fs41 from "fs";
|
|
26196
26387
|
import path51 from "path";
|
|
26197
26388
|
import { stripVTControlCharacters as stripVTControlCharacters5 } from "util";
|
|
26198
|
-
var DEPLOY_TIMEOUT_MS2 = 9e5;
|
|
26199
|
-
var ENV_ADD_TIMEOUT_MS = 3e4;
|
|
26200
|
-
var DETAIL_MAX_LINES = 15;
|
|
26201
|
-
var ENV_SYNC_SKIP_KEYS2 = /* @__PURE__ */ new Set([
|
|
26202
|
-
"VERCEL_OIDC_TOKEN",
|
|
26203
|
-
"BETTERSTART_AUTH_URL",
|
|
26204
|
-
"NEXT_PUBLIC_BETTERSTART_AUTH_URL"
|
|
26205
|
-
]);
|
|
26206
26389
|
function collectDeployEnvVars(cwd, existingProductionKeys) {
|
|
26207
26390
|
const local = parseDotenvFile(path51.join(cwd, ".env.local"));
|
|
26208
26391
|
const vars = [];
|
|
26209
26392
|
for (const [key, value] of local) {
|
|
26210
|
-
if (
|
|
26393
|
+
if (VERCEL_ENV_SYNC_SKIP_KEYS.has(key)) continue;
|
|
26211
26394
|
if (!value || isPlaceholderValue(value)) continue;
|
|
26212
26395
|
if (existingProductionKeys.has(key)) continue;
|
|
26213
26396
|
vars.push({ key, value });
|
|
@@ -26245,11 +26428,7 @@ function ensureVercelJsonFramework(cwd) {
|
|
|
26245
26428
|
}
|
|
26246
26429
|
fs41.writeFileSync(
|
|
26247
26430
|
vercelJsonPath,
|
|
26248
|
-
`${JSON.stringify(
|
|
26249
|
-
{ $schema: "https://openapi.vercel.sh/vercel.json", framework: "nextjs" },
|
|
26250
|
-
null,
|
|
26251
|
-
2
|
|
26252
|
-
)}
|
|
26431
|
+
`${JSON.stringify({ $schema: "https://openapi.vercel.sh/vercel.json", framework: "nextjs" }, null, 2)}
|
|
26253
26432
|
`,
|
|
26254
26433
|
"utf-8"
|
|
26255
26434
|
);
|
|
@@ -26268,7 +26447,7 @@ async function deployVercelProject(runner, cwd, options = {}) {
|
|
|
26268
26447
|
const deploy = await runVercel(runner, ["deploy", "--prod", "--yes"], {
|
|
26269
26448
|
cwd,
|
|
26270
26449
|
mode: "capture",
|
|
26271
|
-
timeoutMs:
|
|
26450
|
+
timeoutMs: DEPLOY_TIMEOUT_MS,
|
|
26272
26451
|
env: options.env,
|
|
26273
26452
|
onOutputLine: options.onLogLine
|
|
26274
26453
|
});
|
|
@@ -26317,10 +26496,6 @@ function guardEnvLocal(cwd) {
|
|
|
26317
26496
|
// adapters/next/init/vercel/neon.ts
|
|
26318
26497
|
import * as p24 from "@clack/prompts";
|
|
26319
26498
|
import pc8 from "picocolors";
|
|
26320
|
-
var PROVISION_TIMEOUT_MS2 = 18e4;
|
|
26321
|
-
var INTERACTIVE_PROVISION_TIMEOUT_MS2 = 6e5;
|
|
26322
|
-
var ACCEPT_TERMS_URL_PATTERN = /https:\/\/vercel\.com\/\S+\/integrations\/accept-terms\/\S+/i;
|
|
26323
|
-
var TERMS_ACCEPTED_PATTERN = /terms accepted/i;
|
|
26324
26499
|
function findAcceptTermsUrl(line) {
|
|
26325
26500
|
return ACCEPT_TERMS_URL_PATTERN.exec(line)?.[0];
|
|
26326
26501
|
}
|
|
@@ -26339,13 +26514,13 @@ async function provisionNeonInteractive(runner, cwd, options) {
|
|
|
26339
26514
|
const quiet = await runVercel(runner, neonAddArgs(options), {
|
|
26340
26515
|
cwd,
|
|
26341
26516
|
mode: "capture",
|
|
26342
|
-
timeoutMs:
|
|
26517
|
+
timeoutMs: PROVISION_TIMEOUT_MS,
|
|
26343
26518
|
env: options.env,
|
|
26344
26519
|
onOutputLine: (line, run) => {
|
|
26345
26520
|
if (!termsNotice) {
|
|
26346
26521
|
const termsUrl = findAcceptTermsUrl(line);
|
|
26347
26522
|
if (!termsUrl) return;
|
|
26348
|
-
run.extendTimeout(
|
|
26523
|
+
run.extendTimeout(INTERACTIVE_PROVISION_TIMEOUT_MS);
|
|
26349
26524
|
const message = "Please accept the Neon terms in your browser";
|
|
26350
26525
|
termsNotice = {
|
|
26351
26526
|
text: `${message}
|
|
@@ -26370,14 +26545,12 @@ ${pc8.dim(termsUrl)}`,
|
|
|
26370
26545
|
}
|
|
26371
26546
|
quietSpinner.clear();
|
|
26372
26547
|
p24.log.info(
|
|
26373
|
-
`Create your Neon database in the Vercel prompts below ${pc8.dim(
|
|
26374
|
-
"(the Free plan is recommended)."
|
|
26375
|
-
)}`
|
|
26548
|
+
`Create your Neon database in the Vercel prompts below ${pc8.dim("(the Free plan is recommended).")}`
|
|
26376
26549
|
);
|
|
26377
26550
|
const add = await runVercel(runner, connectedNeonAddArgs(options), {
|
|
26378
26551
|
cwd,
|
|
26379
26552
|
mode: "inherit",
|
|
26380
|
-
timeoutMs:
|
|
26553
|
+
timeoutMs: INTERACTIVE_PROVISION_TIMEOUT_MS,
|
|
26381
26554
|
env: options.env
|
|
26382
26555
|
});
|
|
26383
26556
|
if (!add.success) {
|
|
@@ -26391,7 +26564,7 @@ async function provisionNeon(runner, cwd, options) {
|
|
|
26391
26564
|
const add = await runVercel(runner, neonAddArgs(options), {
|
|
26392
26565
|
cwd,
|
|
26393
26566
|
mode: "capture",
|
|
26394
|
-
timeoutMs:
|
|
26567
|
+
timeoutMs: PROVISION_TIMEOUT_MS,
|
|
26395
26568
|
env: options.env
|
|
26396
26569
|
});
|
|
26397
26570
|
if (!add.success) {
|
|
@@ -26664,20 +26837,18 @@ function neonFailureMessage(reason) {
|
|
|
26664
26837
|
import pc10 from "picocolors";
|
|
26665
26838
|
|
|
26666
26839
|
// adapters/next/commands/seed.ts
|
|
26840
|
+
import * as clack2 from "@clack/prompts";
|
|
26667
26841
|
import fs43 from "fs";
|
|
26668
26842
|
import path53 from "path";
|
|
26669
|
-
import * as clack2 from "@clack/prompts";
|
|
26670
26843
|
function buildSeedScript(authBasePath = "/api/admin/auth") {
|
|
26671
26844
|
return `/**
|
|
26672
|
-
* BetterStart
|
|
26673
|
-
* Creates the initial admin user
|
|
26674
|
-
* AUTO-GENERATED \u2014 safe to delete after running
|
|
26845
|
+
* AUTO-GENERATED by BetterStart \u2014 safe to delete after running.
|
|
26675
26846
|
*/
|
|
26676
26847
|
|
|
26677
26848
|
import { readFileSync } from 'node:fs'
|
|
26678
26849
|
import { resolve } from 'node:path'
|
|
26679
26850
|
|
|
26680
|
-
//
|
|
26851
|
+
// Parsed by hand to avoid a @next/env dependency in the generated project.
|
|
26681
26852
|
for (const envFile of ['.env.local', '.env']) {
|
|
26682
26853
|
try {
|
|
26683
26854
|
const content = readFileSync(resolve(process.cwd(), envFile), 'utf-8')
|
|
@@ -26779,7 +26950,6 @@ async function main() {
|
|
|
26779
26950
|
process.exit(1)
|
|
26780
26951
|
}
|
|
26781
26952
|
|
|
26782
|
-
// Check if a user already exists with the requested email
|
|
26783
26953
|
const existingUser = await db
|
|
26784
26954
|
.select({ id: schema.user.id, name: schema.user.name })
|
|
26785
26955
|
.from(schema.user)
|
|
@@ -27004,8 +27174,6 @@ async function runSeedCommand(options) {
|
|
|
27004
27174
|
}
|
|
27005
27175
|
|
|
27006
27176
|
// adapters/next/commands/init.ts
|
|
27007
|
-
var ANSI_ESCAPE_PATTERN2 = /\u001B\[[0-?]*[ -/]*[@-~]/g;
|
|
27008
|
-
var REMOVABLE_NAMESPACE_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
27009
27177
|
function addVersionToBoxBottomBorder(box2, version2) {
|
|
27010
27178
|
const lines = box2.split("\n");
|
|
27011
27179
|
const bottomLineIndex = lines.length - 2;
|
|
@@ -27684,7 +27852,7 @@ async function runInitCommandInternal(name, options, jsonContext) {
|
|
|
27684
27852
|
const drizzleConfigPath = path54.join(cwd, "drizzle.config.ts");
|
|
27685
27853
|
if (!dbFiles.includes("drizzle.config.ts") && fs44.existsSync(drizzleConfigPath)) {
|
|
27686
27854
|
if (forceMode) {
|
|
27687
|
-
const { readNamespacedTemplate } = await import("./template-reader-
|
|
27855
|
+
const { readNamespacedTemplate } = await import("./template-reader-F2VFSDKV.js");
|
|
27688
27856
|
fs44.writeFileSync(
|
|
27689
27857
|
drizzleConfigPath,
|
|
27690
27858
|
readNamespacedTemplate("drizzle.config.ts", namespace),
|
|
@@ -27697,7 +27865,7 @@ async function runInitCommandInternal(name, options, jsonContext) {
|
|
|
27697
27865
|
initialValue: true
|
|
27698
27866
|
});
|
|
27699
27867
|
if (!p26.isCancel(overwrite) && overwrite) {
|
|
27700
|
-
const { readNamespacedTemplate } = await import("./template-reader-
|
|
27868
|
+
const { readNamespacedTemplate } = await import("./template-reader-F2VFSDKV.js");
|
|
27701
27869
|
fs44.writeFileSync(
|
|
27702
27870
|
drizzleConfigPath,
|
|
27703
27871
|
readNamespacedTemplate("drizzle.config.ts", namespace),
|
|
@@ -27736,9 +27904,6 @@ async function runInitCommandInternal(name, options, jsonContext) {
|
|
|
27736
27904
|
config: resolvedPresetInstallResult.config,
|
|
27737
27905
|
pm,
|
|
27738
27906
|
integrationIds: presetSelection.integrations,
|
|
27739
|
-
// Secrets were already collected up front and persisted/written to
|
|
27740
|
-
// .env.local, so the install runs without prompting (rule: no
|
|
27741
|
-
// mid-scaffold input).
|
|
27742
27907
|
interactive: false,
|
|
27743
27908
|
includeLinter: project2.linter.type === "none",
|
|
27744
27909
|
dependenciesInstalled: true
|
|
@@ -28124,21 +28289,6 @@ function hasDbUrl(cwd) {
|
|
|
28124
28289
|
}
|
|
28125
28290
|
return false;
|
|
28126
28291
|
}
|
|
28127
|
-
var RAILWAY_BUCKET_ENV_KEYS = [
|
|
28128
|
-
"BETTERSTART_RAILWAY_BUCKET_ENDPOINT",
|
|
28129
|
-
"BETTERSTART_RAILWAY_BUCKET_ACCESS_KEY_ID",
|
|
28130
|
-
"BETTERSTART_RAILWAY_BUCKET_SECRET_ACCESS_KEY",
|
|
28131
|
-
"BETTERSTART_RAILWAY_BUCKET_NAME",
|
|
28132
|
-
"BETTERSTART_RAILWAY_BUCKET_REGION",
|
|
28133
|
-
"BETTERSTART_RAILWAY_BUCKET_URL_STYLE"
|
|
28134
|
-
];
|
|
28135
|
-
var R2_ENV_KEYS = [
|
|
28136
|
-
"BETTERSTART_R2_ACCOUNT_ID",
|
|
28137
|
-
"BETTERSTART_R2_ACCESS_KEY_ID",
|
|
28138
|
-
"BETTERSTART_R2_SECRET_ACCESS_KEY",
|
|
28139
|
-
"BETTERSTART_R2_BUCKET_NAME",
|
|
28140
|
-
"BETTERSTART_R2_PUBLIC_URL"
|
|
28141
|
-
];
|
|
28142
28292
|
function hasRailwayBucketConfig(cwd) {
|
|
28143
28293
|
return RAILWAY_BUCKET_ENV_KEYS.every((key) => Boolean(readProjectEnvVar(cwd, key)?.trim()));
|
|
28144
28294
|
}
|
|
@@ -28461,7 +28611,7 @@ function runQuietCommand(bin, args, options) {
|
|
|
28461
28611
|
});
|
|
28462
28612
|
}
|
|
28463
28613
|
function stripAnsi2(value) {
|
|
28464
|
-
return value.replace(
|
|
28614
|
+
return value.replace(ANSI_ESCAPE_PATTERN, "");
|
|
28465
28615
|
}
|
|
28466
28616
|
function printAdminReadyNote(state) {
|
|
28467
28617
|
const lines = [`Admin: ${pc10.cyan(state.adminLoginUrl)}`];
|
|
@@ -28582,8 +28732,8 @@ function startManagedDevServer(cwd, devCmd, adminLoginUrl, adminCredentials) {
|
|
|
28582
28732
|
}
|
|
28583
28733
|
|
|
28584
28734
|
// adapters/next/commands/list-integrations.ts
|
|
28585
|
-
import path55 from "path";
|
|
28586
28735
|
import * as p27 from "@clack/prompts";
|
|
28736
|
+
import path55 from "path";
|
|
28587
28737
|
|
|
28588
28738
|
// core-engine/utils/table.ts
|
|
28589
28739
|
function renderTableRows(rows) {
|
|
@@ -28637,8 +28787,8 @@ async function runListIntegrationsCommand(options) {
|
|
|
28637
28787
|
}
|
|
28638
28788
|
|
|
28639
28789
|
// adapters/next/commands/list-presets.ts
|
|
28640
|
-
import path56 from "path";
|
|
28641
28790
|
import * as p28 from "@clack/prompts";
|
|
28791
|
+
import path56 from "path";
|
|
28642
28792
|
async function runListPresetsCommand(options) {
|
|
28643
28793
|
const cwd = options.cwd ? path56.resolve(options.cwd) : process.cwd();
|
|
28644
28794
|
if (options.json) {
|
|
@@ -28676,246 +28826,11 @@ async function runListPresetsCommand(options) {
|
|
|
28676
28826
|
import path58 from "path";
|
|
28677
28827
|
|
|
28678
28828
|
// adapters/next/commands/update-component.ts
|
|
28829
|
+
import * as clack3 from "@clack/prompts";
|
|
28679
28830
|
import { execFileSync as execFileSync5 } from "child_process";
|
|
28680
28831
|
import fs45 from "fs";
|
|
28681
28832
|
import path57 from "path";
|
|
28682
|
-
import * as clack3 from "@clack/prompts";
|
|
28683
28833
|
import fsExtra from "fs-extra";
|
|
28684
|
-
var STATIC_CUSTOM_DEPENDENCIES = {
|
|
28685
|
-
"content-editor": [
|
|
28686
|
-
"admin-globals",
|
|
28687
|
-
"content-editor/main-toolbar-content",
|
|
28688
|
-
"content-editor-utils",
|
|
28689
|
-
"content-editor-rich-extensions",
|
|
28690
|
-
"content-editor-editor-view-utils",
|
|
28691
|
-
"markdown-utils",
|
|
28692
|
-
"media-field",
|
|
28693
|
-
"use-content-editor",
|
|
28694
|
-
"use-content-editor-table-add-controls",
|
|
28695
|
-
"use-content-editor-source-mode",
|
|
28696
|
-
"use-content-editor-mobile-toolbar",
|
|
28697
|
-
"use-content-editor-slash-menu",
|
|
28698
|
-
"use-admin-theme",
|
|
28699
|
-
"use-mobile",
|
|
28700
|
-
"tiptap",
|
|
28701
|
-
"tiptap-utils"
|
|
28702
|
-
],
|
|
28703
|
-
"content-editor/tiptap-ui/blockquote-button/blockquote-button": ["use-blockquote"],
|
|
28704
|
-
"content-editor/tiptap-ui/code-block-button/code-block-button": ["use-code-block"],
|
|
28705
|
-
"content-editor/tiptap-ui/color-highlight-button/color-highlight-button": ["use-color-highlight"],
|
|
28706
|
-
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover": [
|
|
28707
|
-
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-button",
|
|
28708
|
-
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content",
|
|
28709
|
-
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors",
|
|
28710
|
-
"content-editor/tiptap-ui/color-highlight-popover/source-color-highlight-popover",
|
|
28711
|
-
"use-color-highlight"
|
|
28712
|
-
],
|
|
28713
|
-
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content": [
|
|
28714
|
-
"content-editor/tiptap-ui/color-highlight-popover/highlight-color-button",
|
|
28715
|
-
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors",
|
|
28716
|
-
"content-editor/use-menu-navigation",
|
|
28717
|
-
"use-color-highlight"
|
|
28718
|
-
],
|
|
28719
|
-
"content-editor/tiptap-ui/color-highlight-popover/highlight-color-button": [
|
|
28720
|
-
"content-editor/tiptap-ui/color-highlight-button/color-highlight-button",
|
|
28721
|
-
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors"
|
|
28722
|
-
],
|
|
28723
|
-
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors": ["use-color-highlight"],
|
|
28724
|
-
"content-editor/tiptap-ui/color-highlight-popover/source-color-highlight-popover": [
|
|
28725
|
-
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-button",
|
|
28726
|
-
"content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content",
|
|
28727
|
-
"content-editor/tiptap-ui/color-highlight-popover/highlight-colors"
|
|
28728
|
-
],
|
|
28729
|
-
"content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu": [
|
|
28730
|
-
"content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu-item",
|
|
28731
|
-
"use-heading",
|
|
28732
|
-
"use-heading-dropdown-menu"
|
|
28733
|
-
],
|
|
28734
|
-
"content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu-item": ["use-heading"],
|
|
28735
|
-
"content-editor/tiptap-ui/link-popover/link-content": [
|
|
28736
|
-
"content-editor/tiptap-ui/link-popover/link-main",
|
|
28737
|
-
"use-link-popover"
|
|
28738
|
-
],
|
|
28739
|
-
"content-editor/tiptap-ui/link-popover/link-control-popover": [
|
|
28740
|
-
"content-editor/tiptap-ui/link-popover/link-button",
|
|
28741
|
-
"content-editor/tiptap-ui/link-popover/link-main"
|
|
28742
|
-
],
|
|
28743
|
-
"content-editor/tiptap-ui/link-popover/link-popover": [
|
|
28744
|
-
"content-editor/tiptap-ui/link-popover/link-content",
|
|
28745
|
-
"content-editor/tiptap-ui/link-popover/link-control-popover",
|
|
28746
|
-
"use-link-popover"
|
|
28747
|
-
],
|
|
28748
|
-
"content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu": [
|
|
28749
|
-
"content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu-item",
|
|
28750
|
-
"use-list",
|
|
28751
|
-
"use-list-dropdown-menu"
|
|
28752
|
-
],
|
|
28753
|
-
"content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu-item": ["use-list"],
|
|
28754
|
-
"content-editor/tiptap-ui/mark-button/mark-button": ["use-mark"],
|
|
28755
|
-
"content-editor/tiptap-ui/undo-redo-button/undo-redo-button": ["use-undo-redo"],
|
|
28756
|
-
"content-editor/main-toolbar-content": [
|
|
28757
|
-
"content-editor",
|
|
28758
|
-
"content-editor/math-popover",
|
|
28759
|
-
"use-content-editor-media-insertion"
|
|
28760
|
-
],
|
|
28761
|
-
"content-editor/math-popover": [
|
|
28762
|
-
"content-editor/math-bubble-menu",
|
|
28763
|
-
"content-editor/math-button",
|
|
28764
|
-
"content-editor/math-editor-controls",
|
|
28765
|
-
"content-editor/math-popover-button",
|
|
28766
|
-
"content-editor/use-tiptap-editor",
|
|
28767
|
-
"markdown-utils",
|
|
28768
|
-
"tiptap-utils"
|
|
28769
|
-
],
|
|
28770
|
-
"content-editor/math-bubble-menu": [
|
|
28771
|
-
"content-editor/math-editor-controls",
|
|
28772
|
-
"content-editor/use-tiptap-editor",
|
|
28773
|
-
"markdown-utils",
|
|
28774
|
-
"tiptap-utils"
|
|
28775
|
-
],
|
|
28776
|
-
"content-editor/math-popover-button": [
|
|
28777
|
-
"content-editor/math-button",
|
|
28778
|
-
"content-editor/math-editor-controls",
|
|
28779
|
-
"content-editor/use-tiptap-editor",
|
|
28780
|
-
"tiptap-utils"
|
|
28781
|
-
],
|
|
28782
|
-
"content-editor/media-gallery-block": ["media-field"],
|
|
28783
|
-
"content-editor/mobile-toolbar-content": [
|
|
28784
|
-
"content-editor/math-popover",
|
|
28785
|
-
"content-editor/use-tiptap-editor",
|
|
28786
|
-
"tiptap-utils"
|
|
28787
|
-
],
|
|
28788
|
-
"content-editor/selection-bubble-menu": ["content-editor/math-popover"],
|
|
28789
|
-
"content-editor/slash-command-menu": ["content-editor-slash-commands-utils", "tiptap-utils"],
|
|
28790
|
-
"content-editor/source-mode": [
|
|
28791
|
-
"content-editor/math-popover",
|
|
28792
|
-
"use-content-editor-source-mode",
|
|
28793
|
-
"tiptap"
|
|
28794
|
-
],
|
|
28795
|
-
"content-editor/table-bubble-menu": [
|
|
28796
|
-
"content-editor-table-bubble-utils",
|
|
28797
|
-
"content-editor/remove-table-part-icon",
|
|
28798
|
-
"tiptap-utils"
|
|
28799
|
-
],
|
|
28800
|
-
"content-editor/table-button": [
|
|
28801
|
-
"content-editor-table-input-utils",
|
|
28802
|
-
"tiptap-utils",
|
|
28803
|
-
"use-table-button"
|
|
28804
|
-
],
|
|
28805
|
-
"date-range-picker": ["date-utils"],
|
|
28806
|
-
"gallery-field": [
|
|
28807
|
-
"card",
|
|
28808
|
-
"carousel",
|
|
28809
|
-
"media-field",
|
|
28810
|
-
"media-field-empty-state",
|
|
28811
|
-
"media-gallery-dialog",
|
|
28812
|
-
"skeleton",
|
|
28813
|
-
"sortable-gallery-item",
|
|
28814
|
-
"use-media"
|
|
28815
|
-
],
|
|
28816
|
-
"icon-picker": ["icons-column-skeleton", "icons-data"],
|
|
28817
|
-
"media-field": [
|
|
28818
|
-
"media-field-empty-state",
|
|
28819
|
-
"media-gallery-dialog",
|
|
28820
|
-
"media-preview",
|
|
28821
|
-
"media-fallback-utils",
|
|
28822
|
-
"use-copy-to-clipboard",
|
|
28823
|
-
"use-media"
|
|
28824
|
-
],
|
|
28825
|
-
"media-field-empty-state": ["button", "card", "cn", "media-gallery-dialog"],
|
|
28826
|
-
"nested-object-list-field": ["form-list-field-utils"],
|
|
28827
|
-
"progressive-blur": ["use-page-boundary-blur-visibility"],
|
|
28828
|
-
"upload-dropzone": ["upload-utils"]
|
|
28829
|
-
};
|
|
28830
|
-
var TIPTAP_TEMPLATE_DEPENDENCIES = [
|
|
28831
|
-
"use-blockquote",
|
|
28832
|
-
"use-code-block",
|
|
28833
|
-
"use-color-highlight",
|
|
28834
|
-
"content-editor/use-is-breakpoint",
|
|
28835
|
-
"content-editor/use-menu-navigation",
|
|
28836
|
-
"content-editor/use-tiptap-editor",
|
|
28837
|
-
"use-content-editor-table-add-controls",
|
|
28838
|
-
"use-table-button",
|
|
28839
|
-
"content-editor-editor-view-utils",
|
|
28840
|
-
"use-heading",
|
|
28841
|
-
"use-heading-dropdown-menu",
|
|
28842
|
-
"use-link-popover",
|
|
28843
|
-
"use-list",
|
|
28844
|
-
"use-list-dropdown-menu",
|
|
28845
|
-
"use-mark",
|
|
28846
|
-
"use-undo-redo",
|
|
28847
|
-
"content-editor-node-attrs-utils",
|
|
28848
|
-
"content-editor-slash-commands-utils",
|
|
28849
|
-
"content-editor-table-add-controls-utils",
|
|
28850
|
-
"content-editor-table-bubble-utils",
|
|
28851
|
-
"content-editor-table-input-utils",
|
|
28852
|
-
"content-editor-task-item-utils",
|
|
28853
|
-
"content-editor-source-media-utils",
|
|
28854
|
-
"content-editor/main-toolbar-content",
|
|
28855
|
-
"content-editor/source-mode",
|
|
28856
|
-
"tiptap-utils",
|
|
28857
|
-
"content-editor/media-gallery-block",
|
|
28858
|
-
"media-field"
|
|
28859
|
-
];
|
|
28860
|
-
var TIPTAP_CONTENT_EDITOR_DIRECTORIES = ["tiptap-extension", "tiptap-node", "tiptap-ui"];
|
|
28861
|
-
var MAX_OVERWRITE_PREVIEW_ROWS = 20;
|
|
28862
|
-
var CODEMIRROR_PACKAGE_DEPS = [
|
|
28863
|
-
"@codemirror/commands",
|
|
28864
|
-
"@codemirror/lang-javascript",
|
|
28865
|
-
"@codemirror/lang-json",
|
|
28866
|
-
"@codemirror/lang-markdown",
|
|
28867
|
-
"@codemirror/state",
|
|
28868
|
-
"@codemirror/view",
|
|
28869
|
-
"@uiw/codemirror-theme-github",
|
|
28870
|
-
"@uiw/react-codemirror"
|
|
28871
|
-
];
|
|
28872
|
-
var TIPTAP_PACKAGE_DEPS = [
|
|
28873
|
-
"@tiptap/core",
|
|
28874
|
-
"@tiptap/extension-underline",
|
|
28875
|
-
"@tiptap/extension-highlight",
|
|
28876
|
-
"@tiptap/extension-horizontal-rule",
|
|
28877
|
-
"@tiptap/extension-image",
|
|
28878
|
-
"@tiptap/extension-list",
|
|
28879
|
-
"@tiptap/extension-placeholder",
|
|
28880
|
-
"@tiptap/extension-table",
|
|
28881
|
-
"@tiptap/extension-table-cell",
|
|
28882
|
-
"@tiptap/extension-table-header",
|
|
28883
|
-
"@tiptap/extension-table-row",
|
|
28884
|
-
"@tiptap/extension-typography",
|
|
28885
|
-
"@tiptap/extensions",
|
|
28886
|
-
"@tiptap/markdown",
|
|
28887
|
-
"@tiptap/pm",
|
|
28888
|
-
"@tiptap/react",
|
|
28889
|
-
"@tiptap/starter-kit"
|
|
28890
|
-
];
|
|
28891
|
-
var KATEX_PACKAGE_DEPS = ["katex"];
|
|
28892
|
-
var TAILWIND_TYPOGRAPHY_PACKAGE_DEPS = ["@tailwindcss/typography"];
|
|
28893
|
-
var COMPONENT_PACKAGE_DEPENDENCIES = {
|
|
28894
|
-
"admin-globals": [...TAILWIND_TYPOGRAPHY_PACKAGE_DEPS, ...KATEX_PACKAGE_DEPS],
|
|
28895
|
-
"content-editor": [
|
|
28896
|
-
...TIPTAP_PACKAGE_DEPS,
|
|
28897
|
-
...CODEMIRROR_PACKAGE_DEPS,
|
|
28898
|
-
...TAILWIND_TYPOGRAPHY_PACKAGE_DEPS,
|
|
28899
|
-
...KATEX_PACKAGE_DEPS
|
|
28900
|
-
],
|
|
28901
|
-
"content-editor-rich-extensions": KATEX_PACKAGE_DEPS,
|
|
28902
|
-
"use-content-editor": [
|
|
28903
|
-
...TIPTAP_PACKAGE_DEPS,
|
|
28904
|
-
...TAILWIND_TYPOGRAPHY_PACKAGE_DEPS,
|
|
28905
|
-
...KATEX_PACKAGE_DEPS
|
|
28906
|
-
],
|
|
28907
|
-
"use-content-editor-media-insertion": ["react-hotkeys-hook"],
|
|
28908
|
-
"use-color-highlight": ["react-hotkeys-hook"],
|
|
28909
|
-
"dev-mode-integrate": CODEMIRROR_PACKAGE_DEPS,
|
|
28910
|
-
"dev-mode-code-mirror": CODEMIRROR_PACKAGE_DEPS,
|
|
28911
|
-
"use-content-editor-table-add-controls": ["@tiptap/pm", "@tiptap/react"],
|
|
28912
|
-
"use-table-button": ["@tiptap/core"],
|
|
28913
|
-
"use-content-editor-source-mode": CODEMIRROR_PACKAGE_DEPS,
|
|
28914
|
-
"content-editor/use-menu-navigation": ["@tiptap/react"],
|
|
28915
|
-
"content-editor/use-tiptap-editor": ["@tiptap/react"],
|
|
28916
|
-
tiptap: TIPTAP_PACKAGE_DEPS,
|
|
28917
|
-
"upload-dropzone": ["react-dropzone"]
|
|
28918
|
-
};
|
|
28919
28834
|
function applyNamespaceToTemplateEntry(entry, config, cwd) {
|
|
28920
28835
|
const namespace = config.frameworkConfig.next.namespace;
|
|
28921
28836
|
const context = { config, cwd };
|
|
@@ -28961,12 +28876,10 @@ function hasDeclaredPackage2(pkg, name) {
|
|
|
28961
28876
|
return Object.hasOwn(pkg.dependencies ?? {}, name) || Object.hasOwn(pkg.devDependencies ?? {}, name) || Object.hasOwn(pkg.optionalDependencies ?? {}, name);
|
|
28962
28877
|
}
|
|
28963
28878
|
var TEMPLATE_REGISTRY = {
|
|
28964
|
-
// CSS
|
|
28965
28879
|
"admin-globals": {
|
|
28966
28880
|
relPath: "admin-globals.css",
|
|
28967
28881
|
content: () => readTemplate("admin-globals.css")
|
|
28968
28882
|
},
|
|
28969
|
-
// Layout
|
|
28970
28883
|
"admin-providers": {
|
|
28971
28884
|
relPath: "components/layouts/admin-providers.tsx",
|
|
28972
28885
|
content: () => readTemplate("components/layouts/admin-providers.tsx")
|
|
@@ -29036,7 +28949,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29036
28949
|
relPath: "components/layouts/content-skeleton.tsx",
|
|
29037
28950
|
content: () => readTemplate("components/layouts/content-skeleton.tsx")
|
|
29038
28951
|
},
|
|
29039
|
-
// Shared
|
|
29040
28952
|
"page-header": {
|
|
29041
28953
|
relPath: "components/shared/page-header.tsx",
|
|
29042
28954
|
content: () => readTemplate("components/shared/page-header.tsx")
|
|
@@ -29170,7 +29082,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29170
29082
|
relPath: "components/shared/sort-order-types.ts",
|
|
29171
29083
|
content: () => readTemplate("components/shared/sort-order-types.ts")
|
|
29172
29084
|
},
|
|
29173
|
-
// Media
|
|
29174
29085
|
"media-preview": {
|
|
29175
29086
|
relPath: "components/shared/media/media-preview.tsx",
|
|
29176
29087
|
content: () => readTemplate("components/shared/media/media-preview.tsx"),
|
|
@@ -29239,7 +29150,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29239
29150
|
content: () => readTemplate("components/shared/media/media-url-importer.tsx"),
|
|
29240
29151
|
dependencies: ["media-utils"]
|
|
29241
29152
|
},
|
|
29242
|
-
// Data table
|
|
29243
29153
|
"data-table": {
|
|
29244
29154
|
relPath: "components/shared/data-table/data-table.tsx",
|
|
29245
29155
|
content: () => readTemplate("components/shared/data-table/data-table.tsx"),
|
|
@@ -29253,7 +29163,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29253
29163
|
relPath: "components/shared/data-table/data-table-pagination.tsx",
|
|
29254
29164
|
content: () => readTemplate("components/shared/data-table/data-table-pagination.tsx")
|
|
29255
29165
|
},
|
|
29256
|
-
// Hooks
|
|
29257
29166
|
"use-upload": {
|
|
29258
29167
|
relPath: "hooks/use-upload.ts",
|
|
29259
29168
|
content: () => readTemplate("hooks/use-upload.ts")
|
|
@@ -29440,7 +29349,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29440
29349
|
relPath: "hooks/use-page-scroll-threshold.ts",
|
|
29441
29350
|
content: () => readTemplate("hooks/use-page-scroll-threshold.ts")
|
|
29442
29351
|
},
|
|
29443
|
-
// Types
|
|
29444
29352
|
"types-index": {
|
|
29445
29353
|
relPath: "types/index.ts",
|
|
29446
29354
|
content: () => readTemplate("types/index.ts")
|
|
@@ -29461,7 +29369,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29461
29369
|
relPath: "types/webhooks.ts",
|
|
29462
29370
|
content: () => readTemplate("types/webhooks.ts")
|
|
29463
29371
|
},
|
|
29464
|
-
// Utils
|
|
29465
29372
|
"app-admin": {
|
|
29466
29373
|
relPath: ({ config }) => `utils/app/${resolveAdminNamespace(config.frameworkConfig.next.namespace).camel}.ts`,
|
|
29467
29374
|
displayPath: "utils/app/<namespaceCamel>.ts",
|
|
@@ -29641,7 +29548,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29641
29548
|
requiredIntegration: "mailchimp",
|
|
29642
29549
|
content: () => readIntegrationTemplate("mailchimp", "actions/mailchimp.ts")
|
|
29643
29550
|
},
|
|
29644
|
-
// Auth
|
|
29645
29551
|
"auth-server": {
|
|
29646
29552
|
relPath: "lib/actions/auth/server.ts",
|
|
29647
29553
|
content: () => readTemplate("lib/actions/auth/auth.ts")
|
|
@@ -29708,7 +29614,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29708
29614
|
base: "cwd",
|
|
29709
29615
|
dependencies: ["profile-action"]
|
|
29710
29616
|
},
|
|
29711
|
-
// Password reset
|
|
29712
29617
|
"login-page": {
|
|
29713
29618
|
relPath: "app/(admin)/admin/(auth)/login/page.tsx",
|
|
29714
29619
|
content: () => readTemplate("pages/login-page.tsx"),
|
|
@@ -29952,7 +29857,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
29952
29857
|
base: "cwd",
|
|
29953
29858
|
dependencies: ["webhooks-action"]
|
|
29954
29859
|
},
|
|
29955
|
-
// Lib
|
|
29956
29860
|
"email-index": {
|
|
29957
29861
|
relPath: "lib/actions/email/index.ts",
|
|
29958
29862
|
content: (context) => context ? renderCoreEmailProviderIndex(context.config) : readTemplate("lib/actions/email/index.ts")
|
|
@@ -30394,7 +30298,6 @@ var TEMPLATE_REGISTRY = {
|
|
|
30394
30298
|
"users-action-types"
|
|
30395
30299
|
]
|
|
30396
30300
|
},
|
|
30397
|
-
// API routes
|
|
30398
30301
|
"auth-route": {
|
|
30399
30302
|
relPath: "app/(admin)/api/admin/auth/[...all]/route.ts",
|
|
30400
30303
|
content: () => readTemplate("api/auth-route.ts"),
|
|
@@ -31086,8 +30989,8 @@ async function listComponentChoices(cwd) {
|
|
|
31086
30989
|
}
|
|
31087
30990
|
|
|
31088
30991
|
// adapters/next/commands/remove-schema.ts
|
|
31089
|
-
import path59 from "path";
|
|
31090
30992
|
import * as clack4 from "@clack/prompts";
|
|
30993
|
+
import path59 from "path";
|
|
31091
30994
|
function cleanupSchemaEmptyDirs(cwd, deletedPaths, configPaths) {
|
|
31092
30995
|
cleanupEmptyDirs(cwd, deletedPaths, [
|
|
31093
30996
|
toProjectAbsolutePath(cwd, configPaths.adminDir),
|
|
@@ -31201,8 +31104,8 @@ Schema JSON preserved.`
|
|
|
31201
31104
|
}
|
|
31202
31105
|
|
|
31203
31106
|
// adapters/next/commands/remove.ts
|
|
31204
|
-
import path60 from "path";
|
|
31205
31107
|
import * as p29 from "@clack/prompts";
|
|
31108
|
+
import path60 from "path";
|
|
31206
31109
|
async function runRemoveCommand(items, options) {
|
|
31207
31110
|
const removeIntegrationsMode = Boolean(options.integration);
|
|
31208
31111
|
if (!removeIntegrationsMode && items.includes("core")) {
|
|
@@ -31279,9 +31182,9 @@ async function runRemoveCommand(items, options) {
|
|
|
31279
31182
|
}
|
|
31280
31183
|
|
|
31281
31184
|
// adapters/next/commands/uninstall.ts
|
|
31185
|
+
import * as p30 from "@clack/prompts";
|
|
31282
31186
|
import fs47 from "fs";
|
|
31283
31187
|
import path61 from "path";
|
|
31284
|
-
import * as p30 from "@clack/prompts";
|
|
31285
31188
|
import pc11 from "picocolors";
|
|
31286
31189
|
|
|
31287
31190
|
// adapters/next/commands/uninstall-cleaners.ts
|
|
@@ -31563,8 +31466,8 @@ async function runUninstallCommand(options) {
|
|
|
31563
31466
|
}
|
|
31564
31467
|
|
|
31565
31468
|
// adapters/next/commands/update-deps.ts
|
|
31566
|
-
import path62 from "path";
|
|
31567
31469
|
import * as clack5 from "@clack/prompts";
|
|
31470
|
+
import path62 from "path";
|
|
31568
31471
|
async function runUpdateDepsCommand(options) {
|
|
31569
31472
|
const cwd = options.cwd ? path62.resolve(options.cwd) : process.cwd();
|
|
31570
31473
|
clack5.intro("BetterStart Update Dependencies");
|
|
@@ -31600,9 +31503,9 @@ async function runUpdateDepsCommand(options) {
|
|
|
31600
31503
|
}
|
|
31601
31504
|
|
|
31602
31505
|
// adapters/next/commands/update-styles.ts
|
|
31506
|
+
import * as clack6 from "@clack/prompts";
|
|
31603
31507
|
import fs48 from "fs";
|
|
31604
31508
|
import path63 from "path";
|
|
31605
|
-
import * as clack6 from "@clack/prompts";
|
|
31606
31509
|
async function runUpdateStylesCommand(options) {
|
|
31607
31510
|
const cwd = options.cwd ? path63.resolve(options.cwd) : process.cwd();
|
|
31608
31511
|
clack6.intro("BetterStart Update Styles");
|