@pylonsync/create-pylon 0.22.75 → 0.22.77
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/bin/create-pylon.js +24 -74
- package/package.json +1 -1
- package/skill/SKILL.md +7 -11
- package/templates/_root/README.md +2 -8
- package/templates/agency/AGENTS.md +17 -0
- package/templates/agency/app/globals.css +5 -1
- package/templates/agency/app/internal/components/page.tsx +248 -0
- package/templates/agency/app/internal/design/page.tsx +169 -0
- package/templates/agency/app/internal/layout.tsx +89 -0
- package/templates/agency/app/internal/sections.ts +26 -0
- package/templates/agency/app/internal/showcase.tsx +43 -0
- package/templates/agency/app/robots.ts +1 -1
- package/templates/agency/components/ui/button.tsx +22 -20
- package/templates/agency/components/ui/dialog.tsx +77 -64
- package/templates/agency/components/ui/input.tsx +5 -5
- package/templates/agency/components/ui/label.tsx +5 -3
- package/templates/agency/components/ui/select.tsx +81 -19
- package/templates/agency/components/ui/textarea.tsx +5 -3
- package/templates/agency/lib/utils.ts +4 -4
- package/templates/agency/package.json +3 -3
- package/templates/ai-chat/AGENTS.md +17 -0
- package/templates/ai-chat/app/globals.css +5 -1
- package/templates/ai-chat/app/internal/components/page.tsx +248 -0
- package/templates/ai-chat/app/internal/design/page.tsx +173 -0
- package/templates/ai-chat/app/internal/layout.tsx +89 -0
- package/templates/ai-chat/app/internal/sections.ts +26 -0
- package/templates/ai-chat/app/internal/showcase.tsx +43 -0
- package/templates/ai-chat/app/robots.ts +1 -1
- package/templates/ai-chat/components/ui/button.tsx +22 -20
- package/templates/ai-chat/components/ui/dialog.tsx +77 -64
- package/templates/ai-chat/components/ui/input.tsx +5 -5
- package/templates/ai-chat/components/ui/label.tsx +5 -3
- package/templates/ai-chat/components/ui/select.tsx +81 -19
- package/templates/ai-chat/components/ui/textarea.tsx +5 -3
- package/templates/ai-chat/lib/utils.ts +4 -4
- package/templates/ai-chat/package.json +4 -4
- package/templates/ai-studio/AGENTS.md +17 -0
- package/templates/ai-studio/app/globals.css +5 -1
- package/templates/ai-studio/app/internal/components/page.tsx +248 -0
- package/templates/ai-studio/app/internal/design/page.tsx +168 -0
- package/templates/ai-studio/app/internal/layout.tsx +89 -0
- package/templates/ai-studio/app/internal/sections.ts +26 -0
- package/templates/ai-studio/app/internal/showcase.tsx +43 -0
- package/templates/ai-studio/app/robots.ts +1 -1
- package/templates/ai-studio/components/ui/button.tsx +22 -20
- package/templates/ai-studio/components/ui/dialog.tsx +77 -64
- package/templates/ai-studio/components/ui/input.tsx +5 -5
- package/templates/ai-studio/components/ui/label.tsx +5 -3
- package/templates/ai-studio/components/ui/select.tsx +81 -19
- package/templates/ai-studio/components/ui/textarea.tsx +5 -3
- package/templates/ai-studio/lib/utils.ts +4 -4
- package/templates/ai-studio/package.json +4 -4
- package/templates/barebones/AGENTS.md +17 -0
- package/templates/barebones/README.md +6 -3
- package/templates/barebones/app/(app)/layout.tsx +16 -0
- package/templates/barebones/app/{page.tsx → (app)/page.tsx} +2 -2
- package/templates/barebones/app/error.tsx +1 -1
- package/templates/barebones/app/globals.css +9 -7
- package/templates/barebones/app/internal/components/page.tsx +248 -0
- package/templates/barebones/app/internal/design/page.tsx +165 -0
- package/templates/barebones/app/internal/layout.tsx +89 -0
- package/templates/barebones/app/internal/sections.ts +26 -0
- package/templates/barebones/app/internal/showcase.tsx +43 -0
- package/templates/barebones/app/layout.tsx +4 -6
- package/templates/barebones/app/not-found.tsx +2 -4
- package/templates/barebones/app/robots.ts +1 -1
- package/templates/barebones/components/ui/button.tsx +22 -20
- package/templates/barebones/components/ui/dialog.tsx +77 -64
- package/templates/barebones/components/ui/input.tsx +5 -5
- package/templates/barebones/components/ui/label.tsx +5 -3
- package/templates/barebones/components/ui/select.tsx +81 -19
- package/templates/barebones/components/ui/textarea.tsx +5 -3
- package/templates/barebones/lib/utils.ts +4 -4
- package/templates/barebones/package.json +3 -3
- package/templates/chat/AGENTS.md +17 -0
- package/templates/chat/app/globals.css +7 -5
- package/templates/chat/app/internal/components/page.tsx +248 -0
- package/templates/chat/app/internal/design/page.tsx +170 -0
- package/templates/chat/app/internal/layout.tsx +89 -0
- package/templates/chat/app/internal/sections.ts +26 -0
- package/templates/chat/app/internal/showcase.tsx +43 -0
- package/templates/chat/app/not-found.tsx +1 -3
- package/templates/chat/app/robots.ts +1 -1
- package/templates/chat/components/ui/button.tsx +22 -20
- package/templates/chat/components/ui/dialog.tsx +77 -64
- package/templates/chat/components/ui/input.tsx +5 -5
- package/templates/chat/components/ui/label.tsx +5 -3
- package/templates/chat/components/ui/select.tsx +81 -19
- package/templates/chat/components/ui/textarea.tsx +5 -3
- package/templates/chat/lib/utils.ts +4 -4
- package/templates/chat/package.json +4 -4
- package/templates/consumer/AGENTS.md +17 -0
- package/templates/consumer/app/globals.css +9 -7
- package/templates/consumer/app/internal/components/page.tsx +248 -0
- package/templates/consumer/app/internal/design/page.tsx +167 -0
- package/templates/consumer/app/internal/layout.tsx +89 -0
- package/templates/consumer/app/internal/sections.ts +26 -0
- package/templates/consumer/app/internal/showcase.tsx +43 -0
- package/templates/consumer/app/robots.ts +1 -1
- package/templates/consumer/components/ui/button.tsx +22 -20
- package/templates/consumer/components/ui/dialog.tsx +77 -64
- package/templates/consumer/components/ui/input.tsx +5 -5
- package/templates/consumer/components/ui/label.tsx +5 -3
- package/templates/consumer/components/ui/select.tsx +81 -19
- package/templates/consumer/components/ui/textarea.tsx +5 -3
- package/templates/consumer/lib/utils.ts +4 -4
- package/templates/consumer/package.json +4 -4
- package/templates/creator/AGENTS.md +17 -0
- package/templates/creator/app/globals.css +5 -1
- package/templates/creator/app/internal/components/page.tsx +248 -0
- package/templates/creator/app/internal/design/page.tsx +171 -0
- package/templates/creator/app/internal/layout.tsx +89 -0
- package/templates/creator/app/internal/sections.ts +26 -0
- package/templates/creator/app/internal/showcase.tsx +43 -0
- package/templates/creator/app/robots.ts +1 -1
- package/templates/creator/components/ui/button.tsx +22 -20
- package/templates/creator/components/ui/dialog.tsx +77 -64
- package/templates/creator/components/ui/input.tsx +5 -5
- package/templates/creator/components/ui/label.tsx +5 -3
- package/templates/creator/components/ui/select.tsx +81 -19
- package/templates/creator/components/ui/textarea.tsx +5 -3
- package/templates/creator/lib/utils.ts +4 -4
- package/templates/creator/package.json +4 -4
- package/templates/crm/AGENTS.md +17 -0
- package/templates/crm/README.md +3 -4
- package/templates/crm/app/deals/[id]/deal-view.tsx +9 -14
- package/templates/crm/app/globals.css +5 -2
- package/templates/crm/app/internal/components/page.tsx +282 -0
- package/templates/crm/app/internal/design/page.tsx +163 -0
- package/templates/crm/app/internal/layout.tsx +89 -0
- package/templates/crm/app/internal/sections.ts +27 -0
- package/templates/crm/app/internal/showcase.tsx +43 -0
- package/templates/crm/app/not-found.tsx +1 -3
- package/templates/crm/app/robots.ts +1 -1
- package/templates/crm/components/activity-timeline.tsx +6 -8
- package/templates/crm/components/app-shell.tsx +25 -26
- package/templates/crm/components/deal-dialog.tsx +15 -17
- package/templates/crm/components/record-dialog.tsx +10 -11
- package/templates/crm/components/ui/button.tsx +22 -20
- package/templates/crm/components/ui/dialog.tsx +77 -64
- package/templates/crm/components/ui/input.tsx +5 -5
- package/templates/crm/components/ui/label.tsx +5 -3
- package/templates/crm/components/ui/select.tsx +81 -19
- package/templates/crm/components/ui/sheet.tsx +64 -0
- package/templates/crm/components/ui/textarea.tsx +5 -3
- package/templates/crm/lib/utils.ts +4 -4
- package/templates/crm/package.json +4 -4
- package/templates/directory/AGENTS.md +17 -0
- package/templates/directory/app/globals.css +5 -1
- package/templates/directory/app/internal/components/page.tsx +248 -0
- package/templates/directory/app/internal/design/page.tsx +168 -0
- package/templates/directory/app/internal/layout.tsx +89 -0
- package/templates/directory/app/internal/sections.ts +26 -0
- package/templates/directory/app/internal/showcase.tsx +43 -0
- package/templates/directory/app/robots.ts +1 -1
- package/templates/directory/components/ui/button.tsx +22 -20
- package/templates/directory/components/ui/dialog.tsx +77 -64
- package/templates/directory/components/ui/input.tsx +5 -5
- package/templates/directory/components/ui/label.tsx +5 -3
- package/templates/directory/components/ui/select.tsx +81 -19
- package/templates/directory/components/ui/textarea.tsx +5 -3
- package/templates/directory/lib/utils.ts +4 -4
- package/templates/directory/package.json +4 -4
- package/templates/helpdesk/AGENTS.md +17 -0
- package/templates/helpdesk/README.md +1 -1
- package/templates/helpdesk/app/globals.css +5 -2
- package/templates/helpdesk/app/internal/components/page.tsx +282 -0
- package/templates/helpdesk/app/internal/design/page.tsx +163 -0
- package/templates/helpdesk/app/internal/layout.tsx +89 -0
- package/templates/helpdesk/app/internal/sections.ts +27 -0
- package/templates/helpdesk/app/internal/showcase.tsx +43 -0
- package/templates/helpdesk/app/not-found.tsx +1 -3
- package/templates/helpdesk/app/robots.ts +1 -1
- package/templates/helpdesk/app/tickets/[id]/ticket-view.tsx +22 -29
- package/templates/helpdesk/components/app-shell.tsx +25 -26
- package/templates/helpdesk/components/new-ticket-dialog.tsx +15 -17
- package/templates/helpdesk/components/record-dialog.tsx +10 -11
- package/templates/helpdesk/components/ui/button.tsx +22 -20
- package/templates/helpdesk/components/ui/dialog.tsx +77 -64
- package/templates/helpdesk/components/ui/input.tsx +5 -5
- package/templates/helpdesk/components/ui/label.tsx +5 -3
- package/templates/helpdesk/components/ui/select.tsx +81 -19
- package/templates/helpdesk/components/ui/sheet.tsx +64 -0
- package/templates/helpdesk/components/ui/textarea.tsx +5 -3
- package/templates/helpdesk/lib/utils.ts +4 -4
- package/templates/helpdesk/package.json +4 -4
- package/templates/imessage/AGENTS.md +17 -0
- package/templates/imessage/app/globals.css +4 -0
- package/templates/imessage/app/internal/components/page.tsx +248 -0
- package/templates/imessage/app/internal/design/page.tsx +163 -0
- package/templates/imessage/app/internal/layout.tsx +89 -0
- package/templates/imessage/app/internal/sections.ts +26 -0
- package/templates/imessage/app/internal/showcase.tsx +43 -0
- package/templates/imessage/components/ui/button.tsx +22 -20
- package/templates/imessage/components/ui/dialog.tsx +77 -64
- package/templates/imessage/components/ui/input.tsx +5 -5
- package/templates/imessage/components/ui/label.tsx +5 -3
- package/templates/imessage/components/ui/select.tsx +81 -19
- package/templates/imessage/components/ui/textarea.tsx +5 -3
- package/templates/imessage/lib/utils.ts +4 -4
- package/templates/imessage/package.json +4 -4
- package/templates/inventory/AGENTS.md +17 -0
- package/templates/inventory/README.md +1 -1
- package/templates/inventory/app/globals.css +5 -2
- package/templates/inventory/app/internal/components/page.tsx +282 -0
- package/templates/inventory/app/internal/design/page.tsx +163 -0
- package/templates/inventory/app/internal/layout.tsx +89 -0
- package/templates/inventory/app/internal/sections.ts +27 -0
- package/templates/inventory/app/internal/showcase.tsx +43 -0
- package/templates/inventory/app/not-found.tsx +1 -3
- package/templates/inventory/app/products/[id]/product-view.tsx +1 -3
- package/templates/inventory/app/robots.ts +1 -1
- package/templates/inventory/components/app-shell.tsx +25 -26
- package/templates/inventory/components/movement-dialog.tsx +15 -17
- package/templates/inventory/components/record-dialog.tsx +10 -11
- package/templates/inventory/components/ui/button.tsx +22 -20
- package/templates/inventory/components/ui/dialog.tsx +77 -64
- package/templates/inventory/components/ui/input.tsx +5 -5
- package/templates/inventory/components/ui/label.tsx +5 -3
- package/templates/inventory/components/ui/select.tsx +81 -19
- package/templates/inventory/components/ui/sheet.tsx +64 -0
- package/templates/inventory/components/ui/textarea.tsx +5 -3
- package/templates/inventory/lib/utils.ts +4 -4
- package/templates/inventory/package.json +4 -4
- package/templates/inventory/tests/components.test.tsx +27 -14
- package/templates/invoices/AGENTS.md +17 -0
- package/templates/invoices/README.md +1 -1
- package/templates/invoices/app/globals.css +5 -2
- package/templates/invoices/app/internal/components/page.tsx +282 -0
- package/templates/invoices/app/internal/design/page.tsx +163 -0
- package/templates/invoices/app/internal/layout.tsx +89 -0
- package/templates/invoices/app/internal/sections.ts +27 -0
- package/templates/invoices/app/internal/showcase.tsx +43 -0
- package/templates/invoices/app/invoices/[id]/invoice-view.tsx +20 -26
- package/templates/invoices/app/not-found.tsx +1 -3
- package/templates/invoices/app/robots.ts +1 -1
- package/templates/invoices/components/app-shell.tsx +25 -26
- package/templates/invoices/components/payment-dialog.tsx +6 -8
- package/templates/invoices/components/record-dialog.tsx +10 -11
- package/templates/invoices/components/ui/button.tsx +22 -20
- package/templates/invoices/components/ui/dialog.tsx +77 -64
- package/templates/invoices/components/ui/input.tsx +5 -5
- package/templates/invoices/components/ui/label.tsx +5 -3
- package/templates/invoices/components/ui/select.tsx +81 -19
- package/templates/invoices/components/ui/sheet.tsx +64 -0
- package/templates/invoices/components/ui/textarea.tsx +5 -3
- package/templates/invoices/lib/utils.ts +4 -4
- package/templates/invoices/package.json +4 -4
- package/templates/local-service/AGENTS.md +17 -0
- package/templates/local-service/app/globals.css +5 -1
- package/templates/local-service/app/internal/components/page.tsx +248 -0
- package/templates/local-service/app/internal/design/page.tsx +170 -0
- package/templates/local-service/app/internal/layout.tsx +89 -0
- package/templates/local-service/app/internal/sections.ts +26 -0
- package/templates/local-service/app/internal/showcase.tsx +43 -0
- package/templates/local-service/app/robots.ts +1 -1
- package/templates/local-service/components/ui/button.tsx +22 -20
- package/templates/local-service/components/ui/dialog.tsx +77 -64
- package/templates/local-service/components/ui/input.tsx +5 -5
- package/templates/local-service/components/ui/label.tsx +5 -3
- package/templates/local-service/components/ui/select.tsx +81 -19
- package/templates/local-service/components/ui/textarea.tsx +5 -3
- package/templates/local-service/lib/utils.ts +4 -4
- package/templates/local-service/package.json +4 -4
- package/templates/marketplace/AGENTS.md +17 -0
- package/templates/marketplace/README.md +8 -5
- package/templates/marketplace/app/(market)/layout.tsx +113 -0
- package/templates/marketplace/app/{listing → (market)/listing}/[id]/page.tsx +7 -7
- package/templates/marketplace/app/{me → (market)/me}/page.tsx +1 -1
- package/templates/marketplace/app/{not-found.tsx → (market)/not-found.tsx} +1 -3
- package/templates/marketplace/app/{page.tsx → (market)/page.tsx} +5 -5
- package/templates/marketplace/app/{sell → (market)/sell}/page.tsx +1 -1
- package/templates/marketplace/app/error.tsx +1 -3
- package/templates/marketplace/app/globals.css +4 -0
- package/templates/marketplace/app/internal/components/page.tsx +335 -0
- package/templates/marketplace/app/internal/design/page.tsx +158 -0
- package/templates/marketplace/app/internal/layout.tsx +89 -0
- package/templates/marketplace/app/internal/sections.ts +30 -0
- package/templates/marketplace/app/internal/showcase.tsx +43 -0
- package/templates/marketplace/app/layout.tsx +4 -100
- package/templates/marketplace/app/robots.ts +1 -1
- package/templates/marketplace/client/ListingCard.tsx +1 -1
- package/templates/marketplace/components/ui/button.tsx +22 -21
- package/templates/marketplace/components/ui/dialog.tsx +77 -64
- package/templates/marketplace/components/ui/input.tsx +5 -5
- package/templates/marketplace/components/ui/label.tsx +5 -4
- package/templates/marketplace/components/ui/select.tsx +101 -0
- package/templates/marketplace/components/ui/separator.tsx +5 -8
- package/templates/marketplace/components/ui/textarea.tsx +5 -3
- package/templates/marketplace/lib/utils.ts +4 -4
- package/templates/marketplace/package.json +3 -5
- package/templates/projects/AGENTS.md +17 -0
- package/templates/projects/README.md +1 -1
- package/templates/projects/app/globals.css +5 -2
- package/templates/projects/app/internal/components/page.tsx +282 -0
- package/templates/projects/app/internal/design/page.tsx +163 -0
- package/templates/projects/app/internal/layout.tsx +89 -0
- package/templates/projects/app/internal/sections.ts +27 -0
- package/templates/projects/app/internal/showcase.tsx +43 -0
- package/templates/projects/app/not-found.tsx +1 -3
- package/templates/projects/app/projects/[id]/project-view.tsx +9 -14
- package/templates/projects/app/robots.ts +1 -1
- package/templates/projects/components/app-shell.tsx +25 -26
- package/templates/projects/components/record-dialog.tsx +10 -11
- package/templates/projects/components/time-dialog.tsx +6 -8
- package/templates/projects/components/ui/button.tsx +22 -20
- package/templates/projects/components/ui/dialog.tsx +77 -64
- package/templates/projects/components/ui/input.tsx +5 -5
- package/templates/projects/components/ui/label.tsx +5 -3
- package/templates/projects/components/ui/select.tsx +81 -19
- package/templates/projects/components/ui/sheet.tsx +64 -0
- package/templates/projects/components/ui/textarea.tsx +5 -3
- package/templates/projects/lib/utils.ts +4 -4
- package/templates/projects/package.json +4 -4
- package/templates/restaurant/AGENTS.md +17 -0
- package/templates/restaurant/app/globals.css +5 -1
- package/templates/restaurant/app/internal/components/page.tsx +248 -0
- package/templates/restaurant/app/internal/design/page.tsx +168 -0
- package/templates/restaurant/app/internal/layout.tsx +89 -0
- package/templates/restaurant/app/internal/sections.ts +26 -0
- package/templates/restaurant/app/internal/showcase.tsx +43 -0
- package/templates/restaurant/app/robots.ts +1 -1
- package/templates/restaurant/components/ui/button.tsx +22 -20
- package/templates/restaurant/components/ui/dialog.tsx +77 -64
- package/templates/restaurant/components/ui/input.tsx +5 -5
- package/templates/restaurant/components/ui/label.tsx +5 -3
- package/templates/restaurant/components/ui/select.tsx +81 -19
- package/templates/restaurant/components/ui/textarea.tsx +5 -3
- package/templates/restaurant/lib/utils.ts +4 -4
- package/templates/restaurant/package.json +4 -4
- package/templates/saas/AGENTS.md +17 -0
- package/templates/saas/README.md +1 -1
- package/templates/saas/app/(marketing)/not-found.tsx +1 -3
- package/templates/saas/app/dashboard/board-client.tsx +32 -42
- package/templates/saas/app/globals.css +9 -7
- package/templates/saas/app/internal/components/page.tsx +282 -0
- package/templates/saas/app/internal/design/page.tsx +168 -0
- package/templates/saas/app/internal/layout.tsx +89 -0
- package/templates/saas/app/internal/sections.ts +27 -0
- package/templates/saas/app/internal/showcase.tsx +43 -0
- package/templates/saas/app/robots.ts +1 -1
- package/templates/saas/components/dashboard-shell.tsx +28 -21
- package/templates/saas/components/ui/button.tsx +22 -20
- package/templates/saas/components/ui/dialog.tsx +77 -64
- package/templates/saas/components/ui/input.tsx +5 -5
- package/templates/saas/components/ui/label.tsx +5 -3
- package/templates/saas/components/ui/select.tsx +81 -19
- package/templates/saas/components/ui/sheet.tsx +64 -0
- package/templates/saas/components/ui/textarea.tsx +5 -3
- package/templates/saas/lib/utils.ts +4 -4
- package/templates/saas/package.json +4 -4
- package/templates/shop/AGENTS.md +17 -0
- package/templates/shop/app/globals.css +5 -1
- package/templates/shop/app/internal/components/page.tsx +248 -0
- package/templates/shop/app/internal/design/page.tsx +173 -0
- package/templates/shop/app/internal/layout.tsx +89 -0
- package/templates/shop/app/internal/sections.ts +26 -0
- package/templates/shop/app/internal/showcase.tsx +43 -0
- package/templates/shop/app/robots.ts +1 -1
- package/templates/shop/components/ui/button.tsx +22 -20
- package/templates/shop/components/ui/dialog.tsx +77 -64
- package/templates/shop/components/ui/input.tsx +5 -5
- package/templates/shop/components/ui/label.tsx +5 -3
- package/templates/shop/components/ui/select.tsx +81 -19
- package/templates/shop/components/ui/textarea.tsx +5 -3
- package/templates/shop/lib/utils.ts +4 -4
- package/templates/shop/package.json +4 -4
- package/templates/todo/AGENTS.md +17 -0
- package/templates/todo/README.md +7 -4
- package/templates/todo/app/(app)/layout.tsx +16 -0
- package/templates/todo/app/{page.tsx → (app)/page.tsx} +2 -2
- package/templates/todo/app/error.tsx +1 -1
- package/templates/todo/app/globals.css +9 -7
- package/templates/todo/app/internal/components/page.tsx +248 -0
- package/templates/todo/app/internal/design/page.tsx +165 -0
- package/templates/todo/app/internal/layout.tsx +89 -0
- package/templates/todo/app/internal/sections.ts +26 -0
- package/templates/todo/app/internal/showcase.tsx +43 -0
- package/templates/todo/app/layout.tsx +5 -7
- package/templates/todo/app/not-found.tsx +2 -4
- package/templates/todo/app/robots.ts +1 -1
- package/templates/todo/components/ui/button.tsx +22 -20
- package/templates/todo/components/ui/dialog.tsx +77 -64
- package/templates/todo/components/ui/input.tsx +5 -5
- package/templates/todo/components/ui/label.tsx +5 -3
- package/templates/todo/components/ui/select.tsx +81 -19
- package/templates/todo/components/ui/textarea.tsx +5 -3
- package/templates/todo/lib/utils.ts +4 -4
- package/templates/todo/package.json +4 -4
- package/templates/waitlist/AGENTS.md +17 -0
- package/templates/waitlist/app/globals.css +5 -1
- package/templates/waitlist/app/internal/components/page.tsx +248 -0
- package/templates/waitlist/app/internal/design/page.tsx +173 -0
- package/templates/waitlist/app/internal/layout.tsx +89 -0
- package/templates/waitlist/app/internal/sections.ts +26 -0
- package/templates/waitlist/app/internal/showcase.tsx +43 -0
- package/templates/waitlist/app/robots.ts +1 -1
- package/templates/waitlist/components/ui/button.tsx +22 -20
- package/templates/waitlist/components/ui/dialog.tsx +77 -64
- package/templates/waitlist/components/ui/input.tsx +5 -5
- package/templates/waitlist/components/ui/label.tsx +5 -3
- package/templates/waitlist/components/ui/select.tsx +81 -19
- package/templates/waitlist/components/ui/textarea.tsx +5 -3
- package/templates/waitlist/lib/utils.ts +4 -4
- package/templates/waitlist/package.json +4 -4
- package/templates/agency/components.json +0 -20
- package/templates/ai-chat/components.json +0 -20
- package/templates/ai-studio/components.json +0 -20
- package/templates/backend/b2b/apps/api/functions/archiveProject.ts +0 -13
- package/templates/backend/b2b/apps/api/functions/createOrg.ts +0 -44
- package/templates/backend/b2b/apps/api/functions/createProject.ts +0 -22
- package/templates/backend/b2b/apps/api/functions/inviteMember.ts +0 -41
- package/templates/backend/b2b/apps/api/functions/myOrgs.ts +0 -37
- package/templates/backend/b2b/apps/api/functions/orgMembers.ts +0 -13
- package/templates/backend/b2b/apps/api/functions/orgProjects.ts +0 -15
- package/templates/backend/b2b/apps/api/functions/removeMember.ts +0 -25
- package/templates/backend/b2b/apps/api/functions/setMemberRole.ts +0 -33
- package/templates/backend/b2b/apps/api/package.json +0 -20
- package/templates/backend/b2b/apps/api/schema.ts +0 -182
- package/templates/backend/b2b/apps/api/tsconfig.json +0 -13
- package/templates/backend/barebones/apps/api/functions/createWidget.ts +0 -26
- package/templates/backend/barebones/apps/api/functions/listWidgets.ts +0 -19
- package/templates/backend/barebones/apps/api/package.json +0 -20
- package/templates/backend/barebones/apps/api/schema.ts +0 -64
- package/templates/backend/barebones/apps/api/tsconfig.json +0 -13
- package/templates/backend/chat/apps/api/functions/createRoom.ts +0 -32
- package/templates/backend/chat/apps/api/functions/listRooms.ts +0 -15
- package/templates/backend/chat/apps/api/functions/roomMessages.ts +0 -20
- package/templates/backend/chat/apps/api/functions/sendMessage.ts +0 -37
- package/templates/backend/chat/apps/api/package.json +0 -20
- package/templates/backend/chat/apps/api/schema.ts +0 -99
- package/templates/backend/chat/apps/api/tsconfig.json +0 -13
- package/templates/backend/todo/apps/api/functions/addTodo.ts +0 -31
- package/templates/backend/todo/apps/api/functions/deleteTodo.ts +0 -15
- package/templates/backend/todo/apps/api/functions/editTodo.ts +0 -17
- package/templates/backend/todo/apps/api/functions/listTodos.ts +0 -25
- package/templates/backend/todo/apps/api/functions/reorderTodo.ts +0 -15
- package/templates/backend/todo/apps/api/functions/toggleTodo.ts +0 -14
- package/templates/backend/todo/apps/api/package.json +0 -20
- package/templates/backend/todo/apps/api/schema.ts +0 -88
- package/templates/backend/todo/apps/api/tsconfig.json +0 -13
- package/templates/barebones/components.json +0 -20
- package/templates/chat/components.json +0 -20
- package/templates/consumer/components.json +0 -20
- package/templates/creator/components.json +0 -20
- package/templates/crm/components.json +0 -20
- package/templates/directory/components.json +0 -20
- package/templates/expo/barebones/apps/expo/App.tsx +0 -166
- package/templates/expo/barebones/apps/expo/app.json +0 -31
- package/templates/expo/barebones/apps/expo/babel.config.js +0 -6
- package/templates/expo/barebones/apps/expo/package.json +0 -31
- package/templates/expo/barebones/apps/expo/tsconfig.json +0 -16
- package/templates/expo/chat/apps/expo/App.tsx +0 -391
- package/templates/expo/chat/apps/expo/app.json +0 -25
- package/templates/expo/chat/apps/expo/babel.config.js +0 -6
- package/templates/expo/chat/apps/expo/package.json +0 -32
- package/templates/expo/chat/apps/expo/tsconfig.json +0 -16
- package/templates/expo/todo/apps/expo/App.tsx +0 -287
- package/templates/expo/todo/apps/expo/app.json +0 -25
- package/templates/expo/todo/apps/expo/babel.config.js +0 -6
- package/templates/expo/todo/apps/expo/package.json +0 -31
- package/templates/expo/todo/apps/expo/tsconfig.json +0 -16
- package/templates/helpdesk/components.json +0 -20
- package/templates/imessage/components.json +0 -20
- package/templates/inventory/components.json +0 -20
- package/templates/invoices/components.json +0 -20
- package/templates/ios/barebones/apps/ios/Package.swift +0 -34
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -98
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
- package/templates/ios/barebones/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -34
- package/templates/ios/barebones/apps/ios/project.yml +0 -42
- package/templates/ios/chat/apps/ios/Package.swift +0 -24
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -116
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
- package/templates/ios/chat/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
- package/templates/ios/chat/apps/ios/project.yml +0 -44
- package/templates/ios/todo/apps/ios/Package.swift +0 -23
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/Models.swift +0 -18
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -230
- package/templates/ios/todo/apps/ios/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -28
- package/templates/ios/todo/apps/ios/project.yml +0 -32
- package/templates/local-service/components.json +0 -20
- package/templates/mac/b2b/apps/mac/Package.swift +0 -22
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -15
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/OrgPickerView.swift +0 -178
- package/templates/mac/b2b/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/b2b/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/b2b/apps/mac/project.yml +0 -34
- package/templates/mac/barebones/apps/mac/Package.swift +0 -33
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/ContentView.swift +0 -104
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -17
- package/templates/mac/barebones/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/barebones/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/barebones/apps/mac/project.yml +0 -34
- package/templates/mac/chat/apps/mac/Package.swift +0 -34
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/ChatRootView.swift +0 -143
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -26
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/RoomView.swift +0 -136
- package/templates/mac/chat/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -58
- package/templates/mac/chat/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/chat/apps/mac/project.yml +0 -36
- package/templates/mac/consumer/apps/mac/Package.swift +0 -34
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/FeedView.swift +0 -199
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -34
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/ProfileSetupView.swift +0 -68
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/RootView.swift +0 -40
- package/templates/mac/consumer/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -59
- package/templates/mac/consumer/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/consumer/apps/mac/project.yml +0 -36
- package/templates/mac/todo/apps/mac/Package.swift +0 -33
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/Models.swift +0 -19
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/TodoListView.swift +0 -244
- package/templates/mac/todo/apps/mac/Sources/__APP_NAME_PASCAL__/__APP_NAME_PASCAL__App.swift +0 -30
- package/templates/mac/todo/apps/mac/__APP_NAME_PASCAL__.entitlements +0 -13
- package/templates/mac/todo/apps/mac/project.yml +0 -34
- package/templates/marketplace/components/ui/native-select.tsx +0 -62
- package/templates/marketplace/components.json +0 -20
- package/templates/projects/components.json +0 -20
- package/templates/restaurant/components.json +0 -20
- package/templates/saas/components.json +0 -20
- package/templates/shop/components.json +0 -20
- package/templates/todo/components.json +0 -20
- package/templates/ui/packages/ui/package.json +0 -26
- package/templates/ui/packages/ui/src/button.tsx +0 -44
- package/templates/ui/packages/ui/src/card.tsx +0 -39
- package/templates/ui/packages/ui/src/cn.ts +0 -12
- package/templates/ui/packages/ui/src/index.ts +0 -4
- package/templates/ui/packages/ui/src/input.tsx +0 -19
- package/templates/ui/packages/ui/tsconfig.json +0 -15
- package/templates/vite/todo/apps/web/index.html +0 -12
- package/templates/vite/todo/apps/web/package.json +0 -31
- package/templates/vite/todo/apps/web/src/App.tsx +0 -16
- package/templates/vite/todo/apps/web/src/components/TodoList.tsx +0 -281
- package/templates/vite/todo/apps/web/src/index.css +0 -14
- package/templates/vite/todo/apps/web/src/main.tsx +0 -20
- package/templates/vite/todo/apps/web/tsconfig.json +0 -24
- package/templates/vite/todo/apps/web/vite.config.ts +0 -41
- package/templates/waitlist/components.json +0 -20
- package/templates/web/b2b/apps/web/next-env.d.ts +0 -2
- package/templates/web/b2b/apps/web/next.config.ts +0 -24
- package/templates/web/b2b/apps/web/package.json +0 -27
- package/templates/web/b2b/apps/web/postcss.config.mjs +0 -3
- package/templates/web/b2b/apps/web/src/app/components/OrgPicker.tsx +0 -171
- package/templates/web/b2b/apps/web/src/app/globals.css +0 -6
- package/templates/web/b2b/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/b2b/apps/web/src/app/page.tsx +0 -39
- package/templates/web/b2b/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/b2b/apps/web/tsconfig.json +0 -26
- package/templates/web/barebones/apps/web/next-env.d.ts +0 -2
- package/templates/web/barebones/apps/web/next.config.ts +0 -40
- package/templates/web/barebones/apps/web/package.json +0 -27
- package/templates/web/barebones/apps/web/postcss.config.mjs +0 -3
- package/templates/web/barebones/apps/web/src/app/components/WidgetList.tsx +0 -81
- package/templates/web/barebones/apps/web/src/app/globals.css +0 -6
- package/templates/web/barebones/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/barebones/apps/web/src/app/page.tsx +0 -43
- package/templates/web/barebones/apps/web/src/lib/pylon.ts +0 -14
- package/templates/web/barebones/apps/web/tsconfig.json +0 -26
- package/templates/web/chat/apps/web/next-env.d.ts +0 -2
- package/templates/web/chat/apps/web/next.config.ts +0 -24
- package/templates/web/chat/apps/web/package.json +0 -27
- package/templates/web/chat/apps/web/postcss.config.mjs +0 -3
- package/templates/web/chat/apps/web/src/app/components/ChatRoom.tsx +0 -231
- package/templates/web/chat/apps/web/src/app/globals.css +0 -6
- package/templates/web/chat/apps/web/src/app/layout.tsx +0 -22
- package/templates/web/chat/apps/web/src/app/page.tsx +0 -12
- package/templates/web/chat/apps/web/src/app/providers.tsx +0 -25
- package/templates/web/chat/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/chat/apps/web/tsconfig.json +0 -26
- package/templates/web/consumer/apps/web/next-env.d.ts +0 -2
- package/templates/web/consumer/apps/web/next.config.ts +0 -24
- package/templates/web/consumer/apps/web/package.json +0 -27
- package/templates/web/consumer/apps/web/postcss.config.mjs +0 -3
- package/templates/web/consumer/apps/web/src/app/components/Feed.tsx +0 -315
- package/templates/web/consumer/apps/web/src/app/globals.css +0 -6
- package/templates/web/consumer/apps/web/src/app/layout.tsx +0 -22
- package/templates/web/consumer/apps/web/src/app/page.tsx +0 -21
- package/templates/web/consumer/apps/web/src/app/providers.tsx +0 -25
- package/templates/web/consumer/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/consumer/apps/web/tsconfig.json +0 -26
- package/templates/web/todo/apps/web/next-env.d.ts +0 -2
- package/templates/web/todo/apps/web/next.config.ts +0 -26
- package/templates/web/todo/apps/web/package.json +0 -30
- package/templates/web/todo/apps/web/postcss.config.mjs +0 -3
- package/templates/web/todo/apps/web/src/app/components/TodoList.tsx +0 -310
- package/templates/web/todo/apps/web/src/app/globals.css +0 -6
- package/templates/web/todo/apps/web/src/app/layout.tsx +0 -21
- package/templates/web/todo/apps/web/src/app/page.tsx +0 -36
- package/templates/web/todo/apps/web/src/lib/pylon.ts +0 -5
- package/templates/web/todo/apps/web/tsconfig.json +0 -26
- /package/templates/barebones/app/{items-client.tsx → (app)/items-client.tsx} +0 -0
- /package/templates/marketplace/{app/_components → components}/CategoryIcon.tsx +0 -0
- /package/templates/todo/app/{todo-app.tsx → (app)/todo-app.tsx} +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { mutation, v } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
/** Remove a member. Keep the founding owner in the organization. */
|
|
4
|
-
export default mutation({
|
|
5
|
-
args: { orgId: v.id("Org"), userId: v.id("User") },
|
|
6
|
-
async handler(ctx, args: { orgId: string; userId: string }) {
|
|
7
|
-
await ctx.requireMember(args.orgId, { entity: "Membership", role: ["owner", "admin"] });
|
|
8
|
-
const org = (await ctx.db.get("Org", args.orgId)) as any;
|
|
9
|
-
if (!org) throw ctx.error("NOT_FOUND", "org not found");
|
|
10
|
-
if (org.ownerId === args.userId) {
|
|
11
|
-
throw ctx.error(
|
|
12
|
-
"OWNER_CANT_LEAVE",
|
|
13
|
-
"the org owner can't be removed; transfer ownership first",
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
const memberships = (await ctx.db.query("Membership", {
|
|
17
|
-
orgId: args.orgId,
|
|
18
|
-
userId: args.userId,
|
|
19
|
-
})) as any[];
|
|
20
|
-
for (const m of memberships) {
|
|
21
|
-
await ctx.db.delete("Membership", m.id);
|
|
22
|
-
}
|
|
23
|
-
return memberships[0] ?? null;
|
|
24
|
-
},
|
|
25
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { mutation, v } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
const ROLES = new Set(["owner", "admin", "member"]);
|
|
4
|
-
|
|
5
|
-
/** Change a membership role after checking organization administration access. */
|
|
6
|
-
export default mutation({
|
|
7
|
-
args: {
|
|
8
|
-
orgId: v.id("Org"),
|
|
9
|
-
userId: v.id("User"),
|
|
10
|
-
role: v.string(),
|
|
11
|
-
},
|
|
12
|
-
async handler(
|
|
13
|
-
ctx,
|
|
14
|
-
args: { orgId: string; userId: string; role: string },
|
|
15
|
-
) {
|
|
16
|
-
if (!ROLES.has(args.role)) {
|
|
17
|
-
throw ctx.error(
|
|
18
|
-
"INVALID_ROLE",
|
|
19
|
-
`role must be one of ${[...ROLES].join(", ")}`,
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
await ctx.requireMember(args.orgId, { entity: "Membership", role: ["owner", "admin"] });
|
|
23
|
-
const memberships = (await ctx.db.query("Membership", {
|
|
24
|
-
orgId: args.orgId,
|
|
25
|
-
userId: args.userId,
|
|
26
|
-
})) as any[];
|
|
27
|
-
if (memberships.length === 0) {
|
|
28
|
-
throw ctx.error("NOT_A_MEMBER", "user is not a member of this org");
|
|
29
|
-
}
|
|
30
|
-
await ctx.db.update("Membership", memberships[0].id, { role: args.role });
|
|
31
|
-
return await ctx.db.get("Membership", memberships[0].id);
|
|
32
|
-
},
|
|
33
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@__APP_NAME_KEBAB__/api",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "pylon dev",
|
|
8
|
-
"build": "pylon build",
|
|
9
|
-
"schema:push": "pylon schema push --sqlite .pylon/dev.db",
|
|
10
|
-
"schema:inspect": "pylon schema inspect --sqlite .pylon/dev.db"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@pylonsync/sdk": "^__PYLON_VERSION__",
|
|
14
|
-
"@pylonsync/functions": "^__PYLON_VERSION__"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@pylonsync/cli": "^__PYLON_VERSION__",
|
|
18
|
-
"typescript": "^5.5.0"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
entity,
|
|
3
|
-
field,
|
|
4
|
-
query,
|
|
5
|
-
action,
|
|
6
|
-
policy,
|
|
7
|
-
buildManifest,
|
|
8
|
-
} from "@pylonsync/sdk";
|
|
9
|
-
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
// Multi-tenant SaaS schema. The shape:
|
|
12
|
-
//
|
|
13
|
-
// User — global, one per real person (auth-managed)
|
|
14
|
-
// Org — a tenant. Has a unique slug. Owner is the founding User.
|
|
15
|
-
// Membership — pivot row: which Users belong to which Orgs, and at
|
|
16
|
-
// what role (owner | admin | member).
|
|
17
|
-
// Project — an org-scoped resource. Every row belongs to one Org;
|
|
18
|
-
// policies enforce that a query without `orgId` returns
|
|
19
|
-
// nothing.
|
|
20
|
-
//
|
|
21
|
-
// Pylon's policy expression language can read `auth.userId` and any
|
|
22
|
-
// columns on the row. Cross-row checks (e.g. "is the caller a member
|
|
23
|
-
// of this org?") are expressed by joining a Membership probe into the
|
|
24
|
-
// allowRead/allowInsert/etc. expression.
|
|
25
|
-
// ---------------------------------------------------------------------------
|
|
26
|
-
|
|
27
|
-
const Org = entity("Org", {
|
|
28
|
-
slug: field.string(),
|
|
29
|
-
name: field.string(),
|
|
30
|
-
// `.readonly()` blocks HTTP PATCH from rewriting ownership. Server-side
|
|
31
|
-
// ctx.db.update still goes through, so admin migrations + transfers work.
|
|
32
|
-
ownerId: field.id("User").readonly(),
|
|
33
|
-
createdAt: field.datetime().readonly(),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const Membership = entity("Membership", {
|
|
37
|
-
orgId: field.id("Org").readonly(),
|
|
38
|
-
userId: field.id("User").readonly(),
|
|
39
|
-
role: field.enum_(["owner", "admin", "member"]),
|
|
40
|
-
createdAt: field.datetime().readonly(),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const Project = entity("Project", {
|
|
44
|
-
orgId: field.id("Org").readonly(),
|
|
45
|
-
name: field.string(),
|
|
46
|
-
createdBy: field.id("User").readonly(),
|
|
47
|
-
archived: field.bool(),
|
|
48
|
-
createdAt: field.datetime().readonly(),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// ---------------------------------------------------------------------------
|
|
52
|
-
// Function declarations
|
|
53
|
-
// ---------------------------------------------------------------------------
|
|
54
|
-
|
|
55
|
-
const myOrgs = query("myOrgs");
|
|
56
|
-
const orgMembers = query("orgMembers");
|
|
57
|
-
const orgProjects = query("orgProjects");
|
|
58
|
-
|
|
59
|
-
const createOrg = action("createOrg", {
|
|
60
|
-
input: [
|
|
61
|
-
{ name: "slug", type: "string" },
|
|
62
|
-
{ name: "name", type: "string" },
|
|
63
|
-
],
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const inviteMember = action("inviteMember", {
|
|
67
|
-
input: [
|
|
68
|
-
{ name: "orgId", type: "id(Org)" },
|
|
69
|
-
{ name: "userId", type: "id(User)" },
|
|
70
|
-
{ name: "role", type: "string" },
|
|
71
|
-
],
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const removeMember = action("removeMember", {
|
|
75
|
-
input: [
|
|
76
|
-
{ name: "orgId", type: "id(Org)" },
|
|
77
|
-
{ name: "userId", type: "id(User)" },
|
|
78
|
-
],
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const setMemberRole = action("setMemberRole", {
|
|
82
|
-
input: [
|
|
83
|
-
{ name: "orgId", type: "id(Org)" },
|
|
84
|
-
{ name: "userId", type: "id(User)" },
|
|
85
|
-
{ name: "role", type: "string" },
|
|
86
|
-
],
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
const createProject = action("createProject", {
|
|
90
|
-
input: [
|
|
91
|
-
{ name: "orgId", type: "id(Org)" },
|
|
92
|
-
{ name: "name", type: "string" },
|
|
93
|
-
],
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const archiveProject = action("archiveProject", {
|
|
97
|
-
input: [{ name: "id", type: "id(Project)" }],
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// ---------------------------------------------------------------------------
|
|
101
|
-
// Policies — RBAC enforced on every read/write.
|
|
102
|
-
//
|
|
103
|
-
// Each entity's policy hooks read `auth.userId` and check membership
|
|
104
|
-
// of the row's `orgId` via the Membership table. Pylon evaluates
|
|
105
|
-
// policy expressions against the database, so a `Membership(orgId,
|
|
106
|
-
// userId)` probe is a join the planner pushes into the same query —
|
|
107
|
-
// no per-request round trip.
|
|
108
|
-
// ---------------------------------------------------------------------------
|
|
109
|
-
|
|
110
|
-
const orgPolicy = policy({
|
|
111
|
-
name: "org_membership",
|
|
112
|
-
entity: "Org",
|
|
113
|
-
// Anyone can read an org if they're a member; only the owner can
|
|
114
|
-
// update / delete. Update + delete pin `existing.ownerId` (the row's
|
|
115
|
-
// current value) not `data.ownerId` (the payload), so an attacker
|
|
116
|
-
// can't PATCH `{ownerId: <them>}` past the check.
|
|
117
|
-
allowRead: "exists(Membership where orgId = data.id and userId = auth.userId)",
|
|
118
|
-
allowInsert: "auth.userId == data.ownerId",
|
|
119
|
-
allowUpdate: "existing.ownerId == auth.userId",
|
|
120
|
-
allowDelete: "existing.ownerId == auth.userId",
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
const membershipPolicy = policy({
|
|
124
|
-
name: "membership_admin",
|
|
125
|
-
entity: "Membership",
|
|
126
|
-
// You can see your own memberships, plus all memberships in any org
|
|
127
|
-
// where you're an owner/admin (so the admin UI can list everyone).
|
|
128
|
-
// Update/delete pin `existing.orgId` (not the payload); `orgId` +
|
|
129
|
-
// `userId` are `.readonly()` too, so `setMemberRole` writes only `role`.
|
|
130
|
-
allowRead:
|
|
131
|
-
"data.userId == auth.userId or exists(Membership where orgId = data.orgId and userId = auth.userId and (role = 'owner' or role = 'admin'))",
|
|
132
|
-
allowInsert:
|
|
133
|
-
"exists(Membership where orgId = data.orgId and userId = auth.userId and (role = 'owner' or role = 'admin'))",
|
|
134
|
-
allowUpdate:
|
|
135
|
-
"exists(Membership where orgId = existing.orgId and userId = auth.userId and (role = 'owner' or role = 'admin'))",
|
|
136
|
-
allowDelete:
|
|
137
|
-
"exists(Membership where orgId = existing.orgId and userId = auth.userId and (role = 'owner' or role = 'admin'))",
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
const projectPolicy = policy({
|
|
141
|
-
name: "project_org_scope",
|
|
142
|
-
entity: "Project",
|
|
143
|
-
// Tenant scope: you can only touch a project if you're a member of
|
|
144
|
-
// its org. Update/delete pin `existing.orgId` (not the payload) so a
|
|
145
|
-
// project can't be "imported" into a foreign org; insert uses
|
|
146
|
-
// `data.orgId` since there's no `existing` row yet.
|
|
147
|
-
allowRead:
|
|
148
|
-
"exists(Membership where orgId = data.orgId and userId = auth.userId)",
|
|
149
|
-
allowInsert:
|
|
150
|
-
"exists(Membership where orgId = data.orgId and userId = auth.userId)",
|
|
151
|
-
// Only owners/admins can rename or archive.
|
|
152
|
-
allowUpdate:
|
|
153
|
-
"exists(Membership where orgId = existing.orgId and userId = auth.userId and (role = 'owner' or role = 'admin'))",
|
|
154
|
-
allowDelete:
|
|
155
|
-
"exists(Membership where orgId = existing.orgId and userId = auth.userId and (role = 'owner' or role = 'admin'))",
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// ---------------------------------------------------------------------------
|
|
159
|
-
// Manifest
|
|
160
|
-
// ---------------------------------------------------------------------------
|
|
161
|
-
|
|
162
|
-
const manifest = buildManifest({
|
|
163
|
-
name: "__APP_NAME_SNAKE__",
|
|
164
|
-
version: "0.0.1",
|
|
165
|
-
entities: [Org, Membership, Project],
|
|
166
|
-
queries: [myOrgs, orgMembers, orgProjects],
|
|
167
|
-
actions: [
|
|
168
|
-
createOrg,
|
|
169
|
-
inviteMember,
|
|
170
|
-
removeMember,
|
|
171
|
-
setMemberRole,
|
|
172
|
-
createProject,
|
|
173
|
-
archiveProject,
|
|
174
|
-
],
|
|
175
|
-
policies: [orgPolicy, membershipPolicy, projectPolicy],
|
|
176
|
-
routes: [],
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
// Not a debug leftover: the CLI runs `bun run` on this file and parses stdout
|
|
180
|
-
// as your manifest (see crates/cli/src/bun.rs). Deleting this line breaks every
|
|
181
|
-
// pylon command that reads your schema.
|
|
182
|
-
console.log(JSON.stringify(manifest));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true
|
|
11
|
-
},
|
|
12
|
-
"include": ["schema.ts", "functions/**/*.ts"]
|
|
13
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { mutation, v } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Insert a new Widget. Initializes count to 0 and stamps the time.
|
|
5
|
-
* Returns the inserted row so the client can render it without a
|
|
6
|
-
* follow-up read.
|
|
7
|
-
*/
|
|
8
|
-
export default mutation({
|
|
9
|
-
// `public` matches the wide-open Widget policy in schema.ts so this
|
|
10
|
-
// demo works without sign-in. When you wire auth, switch to "user"
|
|
11
|
-
// (the framework default) and add a session flow.
|
|
12
|
-
auth: "public",
|
|
13
|
-
args: { name: v.string() },
|
|
14
|
-
async handler(ctx, args: { name: string }) {
|
|
15
|
-
const trimmed = args.name.trim();
|
|
16
|
-
if (!trimmed) {
|
|
17
|
-
throw ctx.error("EMPTY_NAME", "name cannot be empty");
|
|
18
|
-
}
|
|
19
|
-
const id = await ctx.db.insert("Widget", {
|
|
20
|
-
name: trimmed,
|
|
21
|
-
count: 0,
|
|
22
|
-
createdAt: new Date().toISOString(),
|
|
23
|
-
});
|
|
24
|
-
return await ctx.db.get("Widget", id);
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { query } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Live query — every Widget, newest first. Subscribed via the React
|
|
5
|
-
* `useQuery` / Swift `PylonQuery` / RN `useQuery` hooks; rerenders
|
|
6
|
-
* whenever a row is inserted, updated, or deleted.
|
|
7
|
-
*/
|
|
8
|
-
export default query({
|
|
9
|
-
auth: "public",
|
|
10
|
-
args: {},
|
|
11
|
-
async handler(ctx) {
|
|
12
|
-
const rows = await ctx.db.query("Widget", {});
|
|
13
|
-
return [...rows].sort((a: any, b: any) => {
|
|
14
|
-
const ad = Date.parse(a.createdAt) || 0;
|
|
15
|
-
const bd = Date.parse(b.createdAt) || 0;
|
|
16
|
-
return bd - ad;
|
|
17
|
-
});
|
|
18
|
-
},
|
|
19
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@__APP_NAME_KEBAB__/api",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "pylon dev",
|
|
8
|
-
"build": "pylon build",
|
|
9
|
-
"schema:push": "pylon schema push --sqlite .pylon/dev.db",
|
|
10
|
-
"schema:inspect": "pylon schema inspect --sqlite .pylon/dev.db"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@pylonsync/sdk": "^__PYLON_VERSION__",
|
|
14
|
-
"@pylonsync/functions": "^__PYLON_VERSION__"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@pylonsync/cli": "^__PYLON_VERSION__",
|
|
18
|
-
"typescript": "^5.5.0"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
entity,
|
|
3
|
-
field,
|
|
4
|
-
query,
|
|
5
|
-
action,
|
|
6
|
-
policy,
|
|
7
|
-
buildManifest,
|
|
8
|
-
} from "@pylonsync/sdk";
|
|
9
|
-
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
// Schema — one entity, two operations. The smallest thing that
|
|
12
|
-
// demonstrates the loop: declare → handler → live query.
|
|
13
|
-
// ---------------------------------------------------------------------------
|
|
14
|
-
|
|
15
|
-
const Widget = entity("Widget", {
|
|
16
|
-
name: field.string(),
|
|
17
|
-
count: field.int(),
|
|
18
|
-
createdAt: field.datetime(),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
|
-
// Function declarations — names only. Implementations live under
|
|
23
|
-
// functions/<name>.ts and are auto-discovered by the runtime.
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
|
|
26
|
-
const listWidgets = query("listWidgets");
|
|
27
|
-
|
|
28
|
-
const createWidget = action("createWidget", {
|
|
29
|
-
input: [{ name: "name", type: "string" }],
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// ---------------------------------------------------------------------------
|
|
33
|
-
// Policies — wide-open by default. Tighten for production.
|
|
34
|
-
// ---------------------------------------------------------------------------
|
|
35
|
-
|
|
36
|
-
const widgetPolicy = policy({
|
|
37
|
-
name: "widget_open",
|
|
38
|
-
entity: "Widget",
|
|
39
|
-
allowRead: "true",
|
|
40
|
-
allowInsert: "true",
|
|
41
|
-
allowUpdate: "true",
|
|
42
|
-
allowDelete: "true",
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// ---------------------------------------------------------------------------
|
|
46
|
-
// Manifest — pylon codegen reads this and emits pylon.manifest.json.
|
|
47
|
-
// pylon dev / pylon codegen run `bun run schema.ts` and read the
|
|
48
|
-
// manifest off stdout — every entry file ends with this console.log.
|
|
49
|
-
// ---------------------------------------------------------------------------
|
|
50
|
-
|
|
51
|
-
const manifest = buildManifest({
|
|
52
|
-
name: "__APP_NAME_SNAKE__",
|
|
53
|
-
version: "0.0.1",
|
|
54
|
-
entities: [Widget],
|
|
55
|
-
queries: [listWidgets],
|
|
56
|
-
actions: [createWidget],
|
|
57
|
-
policies: [widgetPolicy],
|
|
58
|
-
routes: [],
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
// Not a debug leftover: the CLI runs `bun run` on this file and parses stdout
|
|
62
|
-
// as your manifest (see crates/cli/src/bun.rs). Deleting this line breaks every
|
|
63
|
-
// pylon command that reads your schema.
|
|
64
|
-
console.log(JSON.stringify(manifest));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true
|
|
11
|
-
},
|
|
12
|
-
"include": ["schema.ts", "functions/**/*.ts"]
|
|
13
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { mutation, v } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Create a chat room. Slug must be unique (lowercase + dashes).
|
|
5
|
-
*/
|
|
6
|
-
export default mutation({
|
|
7
|
-
args: { slug: v.string(), name: v.string() },
|
|
8
|
-
async handler(ctx, args: { slug: string; name: string }) {
|
|
9
|
-
if (!ctx.auth.userId) {
|
|
10
|
-
throw ctx.error("UNAUTHENTICATED", "log in first");
|
|
11
|
-
}
|
|
12
|
-
const slug = args.slug.trim().toLowerCase();
|
|
13
|
-
if (!/^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$/.test(slug)) {
|
|
14
|
-
throw ctx.error(
|
|
15
|
-
"INVALID_SLUG",
|
|
16
|
-
"slug must be 3–32 chars: lowercase letters, digits, dashes",
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
const name = args.name.trim();
|
|
20
|
-
if (!name) throw ctx.error("EMPTY_NAME", "room name cannot be empty");
|
|
21
|
-
const dup = (await ctx.db.query("Room", { slug })) as any[];
|
|
22
|
-
if (dup.length > 0) {
|
|
23
|
-
throw ctx.error("SLUG_TAKEN", `room slug "${slug}" is taken`);
|
|
24
|
-
}
|
|
25
|
-
const id = await ctx.db.insert("Room", {
|
|
26
|
-
slug,
|
|
27
|
-
name,
|
|
28
|
-
createdAt: new Date().toISOString(),
|
|
29
|
-
});
|
|
30
|
-
return await ctx.db.get("Room", id);
|
|
31
|
-
},
|
|
32
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { query } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Every room, oldest first (so the General room created on first run
|
|
5
|
-
* stays at the top regardless of activity).
|
|
6
|
-
*/
|
|
7
|
-
export default query({
|
|
8
|
-
args: {},
|
|
9
|
-
async handler(ctx) {
|
|
10
|
-
const rows = (await ctx.db.query("Room", {})) as any[];
|
|
11
|
-
return rows.sort(
|
|
12
|
-
(a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt),
|
|
13
|
-
);
|
|
14
|
-
},
|
|
15
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { query, v } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Last 200 messages in a room, oldest first (chat-conventional —
|
|
5
|
-
* scroll up for history). For a real chat app, paginate via cursor;
|
|
6
|
-
* the scaffold caps at 200 since rendering more in a single FlatList
|
|
7
|
-
* / SwiftUI List without virtualization gets expensive.
|
|
8
|
-
*/
|
|
9
|
-
export default query({
|
|
10
|
-
args: { roomId: v.id("Room") },
|
|
11
|
-
async handler(ctx, args: { roomId: string }) {
|
|
12
|
-
const rows = (await ctx.db.query("Message", {
|
|
13
|
-
roomId: args.roomId,
|
|
14
|
-
})) as any[];
|
|
15
|
-
const sorted = [...rows].sort(
|
|
16
|
-
(a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt),
|
|
17
|
-
);
|
|
18
|
-
return sorted.slice(-200);
|
|
19
|
-
},
|
|
20
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { mutation, v } from "@pylonsync/functions";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Append a message. authorId comes from `ctx.auth.userId`; the
|
|
5
|
-
* authorName the client passes is denormalized into the row so we
|
|
6
|
-
* don't have to join Profile (or any equivalent table) on every
|
|
7
|
-
* read. For real apps, swap this for a Profile join — denormalized
|
|
8
|
-
* names go stale when the user renames themselves.
|
|
9
|
-
*/
|
|
10
|
-
export default mutation({
|
|
11
|
-
args: {
|
|
12
|
-
roomId: v.id("Room"),
|
|
13
|
-
body: v.string(),
|
|
14
|
-
authorName: v.string(),
|
|
15
|
-
},
|
|
16
|
-
async handler(
|
|
17
|
-
ctx,
|
|
18
|
-
args: { roomId: string; body: string; authorName: string },
|
|
19
|
-
) {
|
|
20
|
-
if (!ctx.auth.userId) {
|
|
21
|
-
throw ctx.error("UNAUTHENTICATED", "log in first");
|
|
22
|
-
}
|
|
23
|
-
const body = args.body.trim();
|
|
24
|
-
if (!body) throw ctx.error("EMPTY_BODY", "message body cannot be empty");
|
|
25
|
-
if (body.length > 2000) {
|
|
26
|
-
throw ctx.error("TOO_LONG", "message capped at 2000 chars");
|
|
27
|
-
}
|
|
28
|
-
const id = await ctx.db.insert("Message", {
|
|
29
|
-
roomId: args.roomId,
|
|
30
|
-
authorId: ctx.auth.userId,
|
|
31
|
-
authorName: args.authorName.trim() || "anonymous",
|
|
32
|
-
body,
|
|
33
|
-
createdAt: new Date().toISOString(),
|
|
34
|
-
});
|
|
35
|
-
return await ctx.db.get("Message", id);
|
|
36
|
-
},
|
|
37
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@__APP_NAME_KEBAB__/api",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "pylon dev",
|
|
8
|
-
"build": "pylon build",
|
|
9
|
-
"schema:push": "pylon schema push --sqlite .pylon/dev.db",
|
|
10
|
-
"schema:inspect": "pylon schema inspect --sqlite .pylon/dev.db"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@pylonsync/sdk": "^__PYLON_VERSION__",
|
|
14
|
-
"@pylonsync/functions": "^__PYLON_VERSION__"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@pylonsync/cli": "^__PYLON_VERSION__",
|
|
18
|
-
"typescript": "^5.5.0"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
entity,
|
|
3
|
-
field,
|
|
4
|
-
query,
|
|
5
|
-
action,
|
|
6
|
-
policy,
|
|
7
|
-
buildManifest,
|
|
8
|
-
} from "@pylonsync/sdk";
|
|
9
|
-
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
// Realtime chat schema. The shape:
|
|
12
|
-
//
|
|
13
|
-
// Room — a chat channel. slug + name.
|
|
14
|
-
// Message — one row per message. roomId + authorId + body.
|
|
15
|
-
//
|
|
16
|
-
// Public reads inside a room (anyone can browse). Writes require a
|
|
17
|
-
// signed-in user. For private rooms in production, add a Membership
|
|
18
|
-
// entity and gate Room reads on it (the standard multi-tenant pattern).
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
const Room = entity("Room", {
|
|
22
|
-
slug: field.string(),
|
|
23
|
-
name: field.string(),
|
|
24
|
-
createdAt: field.datetime(),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const Message = entity("Message", {
|
|
28
|
-
// `.readonly()` on identity fields blocks HTTP PATCH from
|
|
29
|
-
// rewriting authorship / message location. Server-side
|
|
30
|
-
// ctx.db.update still goes through inside actions.
|
|
31
|
-
roomId: field.id("Room").readonly(),
|
|
32
|
-
authorId: field.id("User").readonly(),
|
|
33
|
-
authorName: field.string(),
|
|
34
|
-
body: field.string(),
|
|
35
|
-
createdAt: field.datetime().readonly(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
39
|
-
// Function declarations
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
|
|
42
|
-
const listRooms = query("listRooms");
|
|
43
|
-
const roomMessages = query("roomMessages");
|
|
44
|
-
|
|
45
|
-
const createRoom = action("createRoom", {
|
|
46
|
-
input: [
|
|
47
|
-
{ name: "slug", type: "string" },
|
|
48
|
-
{ name: "name", type: "string" },
|
|
49
|
-
],
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const sendMessage = action("sendMessage", {
|
|
53
|
-
input: [
|
|
54
|
-
{ name: "roomId", type: "id(Room)" },
|
|
55
|
-
{ name: "body", type: "string" },
|
|
56
|
-
{ name: "authorName", type: "string" },
|
|
57
|
-
],
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// ---------------------------------------------------------------------------
|
|
61
|
-
// Policies — wide-open reads, signed-in writes.
|
|
62
|
-
// ---------------------------------------------------------------------------
|
|
63
|
-
|
|
64
|
-
const roomPolicy = policy({
|
|
65
|
-
name: "room_public",
|
|
66
|
-
entity: "Room",
|
|
67
|
-
allowRead: "true",
|
|
68
|
-
allowInsert: "auth.userId != null",
|
|
69
|
-
allowUpdate: "false",
|
|
70
|
-
allowDelete: "false",
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const messagePolicy = policy({
|
|
74
|
-
name: "message_public",
|
|
75
|
-
entity: "Message",
|
|
76
|
-
allowRead: "true",
|
|
77
|
-
allowInsert: "auth.userId != null and data.authorId == auth.userId",
|
|
78
|
-
allowUpdate: "false",
|
|
79
|
-
allowDelete: "data.authorId == auth.userId",
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// ---------------------------------------------------------------------------
|
|
83
|
-
// Manifest
|
|
84
|
-
// ---------------------------------------------------------------------------
|
|
85
|
-
|
|
86
|
-
const manifest = buildManifest({
|
|
87
|
-
name: "__APP_NAME_SNAKE__",
|
|
88
|
-
version: "0.0.1",
|
|
89
|
-
entities: [Room, Message],
|
|
90
|
-
queries: [listRooms, roomMessages],
|
|
91
|
-
actions: [createRoom, sendMessage],
|
|
92
|
-
policies: [roomPolicy, messagePolicy],
|
|
93
|
-
routes: [],
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// Not a debug leftover: the CLI runs `bun run` on this file and parses stdout
|
|
97
|
-
// as your manifest (see crates/cli/src/bun.rs). Deleting this line breaks every
|
|
98
|
-
// pylon command that reads your schema.
|
|
99
|
-
console.log(JSON.stringify(manifest));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true
|
|
11
|
-
},
|
|
12
|
-
"include": ["schema.ts", "functions/**/*.ts"]
|
|
13
|
-
}
|