@pylonsync/create-pylon 0.22.74 → 0.22.76
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 +8 -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/functions/checkout.ts +9 -8
- 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
package/bin/create-pylon.js
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* Run via `npm create @pylonsync/pylon@latest [name]` (or
|
|
6
6
|
* yarn/pnpm/bun create @pylonsync/pylon).
|
|
7
7
|
*
|
|
8
|
-
* Picks
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Picks a template (barebones by default, saas to build a product, todo, …).
|
|
9
|
+
* Most templates are one full-stack app. `mobile` and `consumer --platforms
|
|
10
|
+
* ios,expo` are a monorepo: native apps that share a Pylon backend under
|
|
11
|
+
* apps/api, so `bun run dev` brings the whole project up.
|
|
11
12
|
*
|
|
12
13
|
* Templates live as real files under ../templates/<scope>/<template>.
|
|
13
14
|
* The scaffolder walks each requested template dir, substitutes
|
|
@@ -73,18 +74,15 @@ const PYLON_VERSION = JSON.parse(
|
|
|
73
74
|
// the monorepo instead (backend/<t> as apps/api plus one app per platform).
|
|
74
75
|
// ---------------------------------------------------------------------------
|
|
75
76
|
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
// server actions); `vite` is plain Vite + React for an SPA setup.
|
|
79
|
-
// Validation below rejects passing both.
|
|
80
|
-
const PLATFORMS_AVAILABLE = ["web", "vite", "ios", "mac", "expo"];
|
|
77
|
+
// The native apps a monorepo template can scaffold next to its backend.
|
|
78
|
+
const PLATFORMS_AVAILABLE = ["ios", "expo"];
|
|
81
79
|
|
|
82
80
|
const TEMPLATE_REGISTRY = {
|
|
83
81
|
barebones: {
|
|
84
82
|
blurb:
|
|
85
83
|
"Single entity, live list + optimistic create. The smallest SSR app, one port. THE DEFAULT.",
|
|
86
84
|
// `unified` templates are a single Pylon app (app.ts + app/ routes +
|
|
87
|
-
// functions/), NOT a monorepo of apps/api + apps
|
|
85
|
+
// functions/), NOT a monorepo of apps/api + native apps. `pylon dev`
|
|
88
86
|
// serves the SSR frontend and the API from one port. They take no
|
|
89
87
|
// `--platforms` — the app IS the whole stack.
|
|
90
88
|
platforms: [],
|
|
@@ -382,9 +380,9 @@ Usage: npm create @pylonsync/pylon@latest [name] -- [options]
|
|
|
382
380
|
--template <t> ${TEMPLATES_AVAILABLE.join(" | ")}
|
|
383
381
|
${tmplLines.join("\n")}
|
|
384
382
|
|
|
385
|
-
--platforms <list> comma list: ${PLATFORMS_AVAILABLE.join(",")}
|
|
386
|
-
|
|
387
|
-
|
|
383
|
+
--platforms <list> comma list: ${PLATFORMS_AVAILABLE.join(",")}
|
|
384
|
+
native apps for the mobile and consumer templates; every other
|
|
385
|
+
template is a single full-stack app and ignores it
|
|
388
386
|
--bun|--pnpm|--yarn|--npm
|
|
389
387
|
--skip-install scaffold only, don't run install
|
|
390
388
|
--skill | --no-skill add the Pylon skill to the project for Claude Code, Codex and Cursor
|
|
@@ -490,12 +488,11 @@ if (!isUnified && !flags.platforms) {
|
|
|
490
488
|
const ans = isInteractive
|
|
491
489
|
? (
|
|
492
490
|
await ask(
|
|
493
|
-
`Platforms for ${flags.template} (${supported}, comma-separated) [
|
|
491
|
+
`Platforms for ${flags.template} (${supported}, comma-separated) [${supported.split(", ")[0]}]: `,
|
|
494
492
|
)
|
|
495
493
|
).trim()
|
|
496
494
|
: "";
|
|
497
|
-
flags.platforms =
|
|
498
|
-
ans || (TEMPLATE_REGISTRY[flags.template].platforms[0] ?? "web");
|
|
495
|
+
flags.platforms = ans || TEMPLATE_REGISTRY[flags.template].platforms[0];
|
|
499
496
|
}
|
|
500
497
|
if (!flags.pm) {
|
|
501
498
|
const detected = detectPackageManager();
|
|
@@ -533,7 +530,7 @@ rl.close();
|
|
|
533
530
|
// everything else, parse + validate the platform list.
|
|
534
531
|
const platforms = isUnified
|
|
535
532
|
? []
|
|
536
|
-
: (flags.platforms ?? TEMPLATE_REGISTRY[flags.template].platforms[0]
|
|
533
|
+
: (flags.platforms ?? TEMPLATE_REGISTRY[flags.template].platforms[0])
|
|
537
534
|
.split(",")
|
|
538
535
|
.map((p) => p.trim().toLowerCase())
|
|
539
536
|
.filter(Boolean);
|
|
@@ -551,13 +548,6 @@ if (!isUnified) {
|
|
|
551
548
|
console.error(`\nError: at least one platform required.\n`);
|
|
552
549
|
exit(1);
|
|
553
550
|
}
|
|
554
|
-
if (platforms.includes("web") && platforms.includes("vite")) {
|
|
555
|
-
console.error(
|
|
556
|
-
`\nError: --platforms web and vite are mutually exclusive (both render into apps/web).\n` +
|
|
557
|
-
` Pick one: web for Next.js 16, vite for plain Vite + React.\n`,
|
|
558
|
-
);
|
|
559
|
-
exit(1);
|
|
560
|
-
}
|
|
561
551
|
}
|
|
562
552
|
if (!TEMPLATES_AVAILABLE.includes(flags.template)) {
|
|
563
553
|
console.error(
|
|
@@ -567,8 +557,7 @@ if (!TEMPLATES_AVAILABLE.includes(flags.template)) {
|
|
|
567
557
|
}
|
|
568
558
|
|
|
569
559
|
// Reject combos a template doesn't yet support — better to fail loud
|
|
570
|
-
// than to scaffold an incomplete tree
|
|
571
|
-
// would skip frontend entirely and leave a half-empty workspace).
|
|
560
|
+
// than to scaffold an incomplete tree.
|
|
572
561
|
const supportedPlatforms = wantsNative
|
|
573
562
|
? TEMPLATE_REGISTRY[flags.template].nativePlatforms
|
|
574
563
|
: TEMPLATE_REGISTRY[flags.template].platforms;
|
|
@@ -708,9 +697,8 @@ function mustCopy(srcSubpath, destSubpath = "", label = srcSubpath) {
|
|
|
708
697
|
// Apply templates in order:
|
|
709
698
|
// 1. _root — gitignore, env.example, README
|
|
710
699
|
// 2. backend/<t> — apps/api/* always present (one per template)
|
|
711
|
-
// 3.
|
|
712
|
-
// 4.
|
|
713
|
-
// 5. Root package.json — generated, not templated
|
|
700
|
+
// 3. <platform>/<t> — one per requested platform under apps/<platform>/
|
|
701
|
+
// 4. Root package.json — generated, not templated
|
|
714
702
|
// ---------------------------------------------------------------------------
|
|
715
703
|
|
|
716
704
|
if (isUnified) {
|
|
@@ -722,20 +710,7 @@ if (isUnified) {
|
|
|
722
710
|
mustCopy("_root");
|
|
723
711
|
mustCopy(`backend/${flags.template}`);
|
|
724
712
|
|
|
725
|
-
|
|
726
|
-
// the mutex check above guarantees at most one of them is set. Either
|
|
727
|
-
// way we also pull in packages/ui so the shared primitives are present.
|
|
728
|
-
if (platforms.includes("web")) {
|
|
729
|
-
mustCopy("ui");
|
|
730
|
-
mustCopy(`web/${flags.template}`);
|
|
731
|
-
}
|
|
732
|
-
if (platforms.includes("vite")) {
|
|
733
|
-
mustCopy("ui");
|
|
734
|
-
mustCopy(`vite/${flags.template}`);
|
|
735
|
-
}
|
|
736
|
-
for (const p of ["ios", "mac", "expo"]) {
|
|
737
|
-
if (platforms.includes(p)) mustCopy(`${p}/${flags.template}`);
|
|
738
|
-
}
|
|
713
|
+
for (const p of platforms) mustCopy(`${p}/${flags.template}`);
|
|
739
714
|
}
|
|
740
715
|
|
|
741
716
|
walkAndSubstitute(root);
|
|
@@ -748,20 +723,15 @@ walkAndSubstitute(root);
|
|
|
748
723
|
|
|
749
724
|
if (!isUnified) {
|
|
750
725
|
// Turborepo orchestrates the workspace. `turbo dev` runs the `dev`
|
|
751
|
-
// task in every package that defines one (apps/api always; apps/
|
|
752
|
-
//
|
|
753
|
-
// `
|
|
754
|
-
// dedicated escape-hatch scripts instead. turbo.json ships in
|
|
726
|
+
// task in every package that defines one (apps/api always; apps/expo
|
|
727
|
+
// when scaffolded). The iOS app is not `turbo dev`-shaped (Xcode and
|
|
728
|
+
// `swift run` block), so it gets its own script. turbo.json ships in
|
|
755
729
|
// _root/, so it's already in the project.
|
|
756
730
|
const helperScripts = {};
|
|
757
731
|
if (platforms.includes("ios")) {
|
|
758
732
|
helperScripts["dev:ios"] =
|
|
759
733
|
"echo 'cd apps/ios && xcodegen generate && open *.xcodeproj (or: swift run for a quick macOS preview)'";
|
|
760
734
|
}
|
|
761
|
-
if (platforms.includes("mac")) {
|
|
762
|
-
helperScripts["dev:mac"] =
|
|
763
|
-
"echo 'cd apps/mac && swift run (or: xcodegen generate && open *.xcodeproj)'";
|
|
764
|
-
}
|
|
765
735
|
|
|
766
736
|
// Turbo 2.x refuses to run without packageManager set. Pick a recent-
|
|
767
737
|
// stable for whichever PM the user picked. npm doesn't enforce this
|
|
@@ -778,13 +748,7 @@ if (!isUnified) {
|
|
|
778
748
|
private: true,
|
|
779
749
|
type: "module",
|
|
780
750
|
packageManager: PACKAGE_MANAGERS[flags.pm],
|
|
781
|
-
workspaces: ["apps/*",
|
|
782
|
-
// Only declare packages/* as a workspace if we actually scaffolded
|
|
783
|
-
// packages/ui — otherwise the empty match warns on bun install.
|
|
784
|
-
if (p === "packages/*")
|
|
785
|
-
return platforms.includes("web") || platforms.includes("vite");
|
|
786
|
-
return true;
|
|
787
|
-
}),
|
|
751
|
+
workspaces: ["apps/*"],
|
|
788
752
|
scripts: {
|
|
789
753
|
dev: "turbo dev",
|
|
790
754
|
build: "turbo build",
|
|
@@ -900,37 +864,23 @@ if (isUnified)
|
|
|
900
864
|
platformLines.push(" → app http://localhost:4321 (SSR frontend + API, one port)");
|
|
901
865
|
else
|
|
902
866
|
platformLines.push(" → api http://localhost:4321 (Pylon control plane)");
|
|
903
|
-
if (platforms.includes("web"))
|
|
904
|
-
platformLines.push(" → web http://localhost:3000 (Next.js)");
|
|
905
|
-
if (platforms.includes("vite"))
|
|
906
|
-
platformLines.push(" → web http://localhost:3000 (Vite + React)");
|
|
907
867
|
if (platforms.includes("expo"))
|
|
908
|
-
platformLines.push(` → expo ${runDev} (Metro + simulator, alongside
|
|
868
|
+
platformLines.push(` → expo ${runDev} (Metro + simulator, alongside the api)`);
|
|
909
869
|
if (platforms.includes("ios"))
|
|
910
870
|
platformLines.push(` → ios cd apps/ios && xcodegen generate && open *.xcodeproj`);
|
|
911
|
-
if (platforms.includes("mac"))
|
|
912
|
-
platformLines.push(` → mac cd apps/mac && swift run (or xcodegen for .app)`);
|
|
913
871
|
|
|
914
872
|
const layoutLines = isUnified
|
|
915
873
|
? [
|
|
916
874
|
" app.ts data model + manifest (entities, functions, routes)",
|
|
917
875
|
" app/ file-based SSR routes (app/page.tsx → /)",
|
|
918
876
|
" app/layout.tsx root layout (receives url + auth)",
|
|
877
|
+
" components/ reusable components; components/ui is built on ui-sdk",
|
|
919
878
|
" functions/ server functions (query/action)",
|
|
879
|
+
" /internal/design, /internal/components design tokens and the component gallery",
|
|
920
880
|
]
|
|
921
881
|
: [" apps/api schema + functions/ handlers"];
|
|
922
|
-
if (!isUnified && platforms.includes("web")) {
|
|
923
|
-
layoutLines.push(" apps/web Next.js 16 + React 19 + Tailwind v4");
|
|
924
|
-
layoutLines.push(" packages/ui shared UI primitives");
|
|
925
|
-
}
|
|
926
|
-
if (platforms.includes("vite")) {
|
|
927
|
-
layoutLines.push(" apps/web Vite + React 19 + Tailwind v4");
|
|
928
|
-
layoutLines.push(" packages/ui shared UI primitives");
|
|
929
|
-
}
|
|
930
882
|
if (platforms.includes("ios"))
|
|
931
883
|
layoutLines.push(" apps/ios Swift / SwiftUI (iOS)");
|
|
932
|
-
if (platforms.includes("mac"))
|
|
933
|
-
layoutLines.push(" apps/mac Swift / SwiftUI (macOS)");
|
|
934
884
|
if (platforms.includes("expo"))
|
|
935
885
|
layoutLines.push(" apps/expo Expo + React Native");
|
|
936
886
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pylonsync/create-pylon",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.76",
|
|
4
4
|
"description": "Scaffold a new Pylon app — realtime backend + web/mobile/expo frontends in one command. Run via `npm create @pylonsync/pylon@latest`.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
package/skill/SKILL.md
CHANGED
|
@@ -29,7 +29,7 @@ Use this skill whenever:
|
|
|
29
29
|
- The user's Swift project imports `PylonClient`, `PylonSync`, `PylonRealtime`, or `PylonSwiftUI`.
|
|
30
30
|
- The user's Unity or C# project uses `Pylon.PylonClient` or `Pylon.Realtime.ShardConnection`.
|
|
31
31
|
- The user says "Pylon", "Pylonsync", "realtime backend", or asks to build a live-syncing feature.
|
|
32
|
-
- The user runs `pylon dev`, `pylon
|
|
32
|
+
- The user runs `pylon dev`, `pylon deploy`, `pylon codegen`, or another `pylon` CLI command.
|
|
33
33
|
- The user mentions Stack0 Cloud, `cloud.stack0.dev`, or `pylon deploy --target cloud`.
|
|
34
34
|
|
|
35
35
|
## Core mental model
|
|
@@ -56,12 +56,12 @@ my-app/
|
|
|
56
56
|
blog/
|
|
57
57
|
page.tsx # route "/blog"
|
|
58
58
|
[slug]/page.tsx # dynamic route "/blog/:slug"
|
|
59
|
+
internal/ # /internal/design (tokens), /internal/components (gallery)
|
|
59
60
|
sitemap.ts # served at /sitemap.xml (optional)
|
|
60
61
|
robots.ts # served at /robots.txt (optional)
|
|
61
62
|
components/ # your components (see the layering table below)
|
|
62
|
-
ui/ #
|
|
63
|
-
# select, badge, table, textarea
|
|
64
|
-
components.json # shadcn config — `bunx shadcn@latest add <name>` works
|
|
63
|
+
ui/ # primitives built on @ui-sdk/react: button, dialog,
|
|
64
|
+
# input, label, select, badge, card, table, textarea
|
|
65
65
|
lib/utils.ts # `cn` (clsx + tailwind-merge)
|
|
66
66
|
public/ # static assets served verbatim at the root; a real file
|
|
67
67
|
# beats [param]/catch-all route matches (≥0.3.381),
|
|
@@ -781,15 +781,11 @@ Pylon natively server-renders React from the same server that runs your backend
|
|
|
781
781
|
|
|
782
782
|
Keeping the data boundary in exactly one module is what makes everything below it trivially testable. The `create-pylon` starters are generated in this shape — read one for a worked example.
|
|
783
783
|
|
|
784
|
-
- **Build on the UI kit that's already there.** Scaffolded apps ship `components/ui/` with
|
|
784
|
+
- **Build on the UI kit that's already there.** Scaffolded apps (≥0.22.76) ship `components/ui/` with primitives built on `@ui-sdk/react` (`button`, `dialog`, `input`, `label`, `select`, `badge`, `card`, `table`, `textarea`), `lib/utils.ts` (`cn`), and two reference pages: `/internal/components` shows every component with its variants, and `/internal/design` shows every design token. Open both before you write UI. Use the components, and style with the semantic tokens (`bg-background`, `bg-card`, `text-muted-foreground`, `border`) rather than hardcoded palette classes like `bg-zinc-50`. A raw `<input>` or a fixed color renders as an unstyled control next to the kit and breaks dark mode.
|
|
785
785
|
|
|
786
|
-
|
|
786
|
+
Every component is composable and reusable. Build it from small parts that nest and accept `children` and `className` (`Card`, `CardHeader`, `CardTitle`), make a visual variation a `cva` variant, and keep app data out of `components/ui/`. When the same markup appears on a second page, move it into `components/`.
|
|
787
787
|
|
|
788
|
-
|
|
789
|
-
bunx shadcn@latest add dialog # npx if you're on Node
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
`components.json` is preconfigured (new-york, zinc, `@/components/ui`), so the component lands with the right imports and tokens.
|
|
788
|
+
Need a primitive that isn't there (menu, tabs, popover, tooltip, combobox, …)? Build it in `components/ui/` on the matching `@ui-sdk/react` part. Do not write the focus handling, keyboard navigation or ARIA attributes by hand, and do not add a second component library. Read `node_modules/@ui-sdk/react/docs/llms.txt`, then that component's page in `docs/components/`. The parts have no styles: import from the component's own entry (`@ui-sdk/react/tabs`), style with Tailwind and the state attributes (`data-open`, `data-selected`, `data-starting-style`), and pass an element to `render` to change what a part renders (`<Button render={<Link href="/" />}>`). There is no `asChild`. Add a `Showcase` for the new component to `app/internal/components/page.tsx` in the same change.
|
|
793
789
|
|
|
794
790
|
- The page receives props: `{ pathname, host, params, searchParams, auth, response, serverData }` — type them with `PageProps<{ slug: string }>` from `@pylonsync/react` instead of hand-rolling. **`pathname` is the PATH only** (`/blog/hello`), never the query — the router strips the query before the render and hands it over already parsed as `searchParams`. So read a query parameter from `searchParams.next`, NEVER `new URL(props.pathname).searchParams.get("next")`, which compiles and returns null on every request. (`url` is the same value under the old name and is deprecated.) `auth` is `{ user_id, is_admin, tenant_id, roles }` resolved from the shared session. `host` is the request host, lowercased, when the server trusts it (its own URL, `PYLON_TRUSTED_HOSTS`, or a ready customer domain attached with `ctx.domains`), else `""` — it is part of the SSR cache key, so a platform app can pick the customer from it and stay cacheable. **The request's `headers` and `cookies` are intentionally NOT props** — they're server-only and stripped from the hydration payload (a session cookie must never reach client JS), so reading them in a component body would hydrate-mismatch. Read request-derived data through `serverData` or a server function.
|
|
795
791
|
|
|
@@ -909,6 +905,7 @@ export default async function sitemap(): Promise<Sitemap> {
|
|
|
909
905
|
Pages are **dynamic by default**. Two opt-ins make a render shareable (a hit skips the Bun render entirely):
|
|
910
906
|
|
|
911
907
|
- **Anonymous cache** — `export const revalidate = 60` (seconds). Stored + reused for ALL anonymous visitors. Cached ONLY if the render never read per-request identity — reading `props.auth`, setting a cookie via `response.setCookie`, a non-200, or streaming opts it out. (Request headers/cookies aren't page props, so there's nothing to accidentally read there.) `export const dynamic = "force-static"` caches until the next deploy; `"force-dynamic"` never caches. Use for fully public pages.
|
|
908
|
+
- **After the window (≥0.22.75):** the first visitor past `revalidate` gets the stored page at once (`X-Pylon-Cache: stale-while-revalidate`) and a new render runs in the background for the next visitor. Nobody waits for a re-render. A stored page older than `PYLON_SSR_STALE_MAX_SECS` (default 86400; `0` = always re-render first) is re-rendered before it is served. So `revalidate` is "refresh at most this often", not "never older than this".
|
|
912
909
|
- **Auth-bucketed cache** — `export const cache = "auth-bucketed"` + `export const revalidate = 60`. Caches TWO identity-free shells keyed on whether the request is signed in. Read `props.session.exists` (a binary signed-in bit, **never** identity) to render a signed-in vs signed-out shell and still get a per-bucket hit. Reading real `props.auth` still opts out (output would be identity-specific), and so does a signed-in render that calls `serverData.get/list/query/...` or `serverData.fn` (those return the caller's rows). Signed-out renders that read serverData still bucket; for public data on a signed-in shell, use `serverData.unsafe.*` only when the rows are public.
|
|
913
910
|
- **Purity contract:** an `auth-bucketed` page MUST be a pure function of its props. NEVER stash request data (auth/cookies/headers, or values derived from them) in module/global scope and render it on a later request — that leaks across users (same rule as Next: no request data in module scope).
|
|
914
911
|
- CDN: bucket responses are browser-`private` by default (the origin still skips the render). A shared-CDN hit requires the operator to set `PYLON_SSR_BUCKET_CDN=1` after adding a CDN cache-key rule on session-cookie presence.
|
|
@@ -7,12 +7,8 @@ Scaffolded by [@pylonsync/create-pylon](https://npmjs.com/@pylonsync/create-pylo
|
|
|
7
7
|
```
|
|
8
8
|
apps/
|
|
9
9
|
api/ Pylon backend — schema, policies, function handlers
|
|
10
|
-
|
|
11
|
-
mobile/ Swift / SwiftUI app (if you picked --platforms mobile)
|
|
10
|
+
ios/ Swift / SwiftUI app (if you picked --platforms ios)
|
|
12
11
|
expo/ Expo + React Native app (if you picked --platforms expo)
|
|
13
|
-
|
|
14
|
-
packages/
|
|
15
|
-
ui/ Shared shadcn-style React primitives (web only)
|
|
16
12
|
```
|
|
17
13
|
|
|
18
14
|
## Getting started
|
|
@@ -26,7 +22,6 @@ bun run dev
|
|
|
26
22
|
```
|
|
27
23
|
|
|
28
24
|
- **api:** http://localhost:4321, Pylon control plane
|
|
29
|
-
- **web:** http://localhost:3000, Next.js (if scaffolded)
|
|
30
25
|
- **expo** runs Metro on a separate port (if scaffolded)
|
|
31
26
|
- **mobile** lives in `apps/mobile/`; open it in Xcode or run `swift run`
|
|
32
27
|
|
|
@@ -34,8 +29,7 @@ bun run dev
|
|
|
34
29
|
|
|
35
30
|
- Edit `apps/api/schema.ts` to add entities + policies.
|
|
36
31
|
- Drop handlers into `apps/api/functions/` — auto-discovered by name.
|
|
37
|
-
- For
|
|
38
|
-
- For mobile: SwiftUI views in `apps/mobile/Sources/__APP_NAME_PASCAL__/`.
|
|
32
|
+
- For iOS: SwiftUI views in `apps/ios/Sources/__APP_NAME_PASCAL__/`.
|
|
39
33
|
- For expo: screens in `apps/expo/src/screens/`.
|
|
40
34
|
|
|
41
35
|
## Docs
|
|
@@ -25,6 +25,8 @@ this pass before the user has to ask.
|
|
|
25
25
|
- `app.ts`: data model + manifest (`entity()` + `field.*`, queries/actions/policies, `routes: await discoverAppRoutes()`). Ends with `console.log(JSON.stringify(manifest))` — that line is the manifest handoff (the CLI parses this file's stdout), not debug output. Never remove it.
|
|
26
26
|
- `app/`: file-based SSR routes. `app/page.tsx` → `/`, `app/about/page.tsx` → `/about`, `app/blog/[slug]/page.tsx` → `/blog/:slug`. A `(group)` directory is stripped from the URL — `app/(marketing)/about/page.tsx` still serves `/about` — so a group's `layout.tsx` gives one section its own chrome (nav, footer) without changing any path; routes outside the group render without it. `app/layout.tsx` is the document shell; `app/error.tsx` / `app/not-found.tsx` are boundaries.
|
|
27
27
|
- `app/globals.css`: Tailwind v4 entrypoint (auto-compiled and injected).
|
|
28
|
+
- `components/`: reusable React components. `components/ui/` holds the primitives, built on `@ui-sdk/react`.
|
|
29
|
+
- `app/internal/`: `/internal/design` shows the design tokens and `/internal/components` shows every component. See "UI: design tokens and components".
|
|
28
30
|
- `functions/`: server functions, one per file, `default`-exported.
|
|
29
31
|
- `.pylon/`: local dev state (SQLite, jobs, sessions, uploads). Created by `pylon dev`. Do not commit.
|
|
30
32
|
|
|
@@ -68,6 +70,21 @@ this pass before the user has to ask.
|
|
|
68
70
|
- **It's `db.useQueryOne`, not `useOne`.** Validators and field types have aliases: `v.bool`/`v.boolean`, `v.float`/`v.number`.
|
|
69
71
|
- **Use the supported file and scheduling APIs.** Files go through `<FileUpload>` and `/api/files/*`; an upload is readable by its uploader only, so pass `visibility: "public"` to `uploadFile` or `<FileUpload>` for files every visitor sees; there is no `ctx.files`. One-shot work uses `ctx.scheduler.runAfter`, `runAt`, or `cancel`; there is no `defineWorkflow` or `defineJob`. Recurring work uses `cron("0 * * * *", "fnName")` in `buildManifest({ crons: [...] })`, imported from `@pylonsync/sdk`. Make the target function `internal: true`. It runs with anonymous auth, but its own `ctx.db.*` calls are server-side and bypass policies. Use `ctx.auth.elevate({ admin: true, reason: "..." })`, with a mandatory reason, only when chaining another internal function through `ctx.scheduler`.
|
|
70
72
|
|
|
73
|
+
## UI: design tokens and components
|
|
74
|
+
|
|
75
|
+
Every screen is built from reusable components. Before you write UI, open `/internal/components` (the component gallery) and `/internal/design` (the design tokens) in the running app.
|
|
76
|
+
|
|
77
|
+
- **Reuse first.** Look in `components/` and on `/internal/components` before you write markup. If a component exists, use it. If it almost fits, extend it with a variant or a prop. Do not copy its markup into a page.
|
|
78
|
+
- **A page composes components.** A `page.tsx` holds data loading and layout. When the same markup appears a second time, move it into a component.
|
|
79
|
+
- **Two levels.** `components/ui/` holds primitives (Button, Dialog, Select). A primitive has no app data and makes no `db.*` or `callFn` call. `components/` holds the components of this product, built from the primitives.
|
|
80
|
+
- **Compose, do not configure.** Build a component from small parts that nest (`Card`, `CardHeader`, `CardTitle`) and accept `children`. Do not add a boolean prop for each layout variation. Each component accepts `className` and passes its other props to its root element. A visual variation is a `cva` variant.
|
|
81
|
+
- **Behavior comes from ui-sdk.** Build interactive primitives (dialogs, menus, selects, tabs, tooltips, comboboxes) on `@ui-sdk/react` parts. Do not write focus handling, keyboard navigation or ARIA attributes by hand, and do not add a second component library. Read `node_modules/@ui-sdk/react/docs/llms.txt` first, then the page of each component you use in `node_modules/@ui-sdk/react/docs/components/`. For a behavior with no ready-made component, read `core.md` and `rendering.md` in the same `docs/` directory.
|
|
82
|
+
- **ui-sdk conventions.** Import each component from its own entry (`@ui-sdk/react/dialog`). The parts have no styles. Style them with Tailwind classes and their state attributes (`data-open`, `data-disabled`, `data-highlighted`, `data-starting-style`, `data-ending-style`). To render a part as a different element, pass the element to `render`: `<Button render={<Link href="/" />}>Home</Button>`. There is no `asChild` prop. `@layer ui-sdk;` stays the first line of `app/globals.css`.
|
|
83
|
+
- **Tokens only.** Colors, radii and shadows come from the tokens in `app/globals.css` (`bg-primary`, `text-muted-foreground`, `rounded-lg`). Do not write a hex color in a new component. To add a token, add it to `app/globals.css` and to `app/internal/design/page.tsx`.
|
|
84
|
+
- **Keep the gallery current.** When you add or change a component, update its `Showcase` in `app/internal/components/page.tsx` and its entry in `app/internal/sections.ts` in the same change. Show each variant and each state.
|
|
85
|
+
|
|
86
|
+
The product does not link to `/internal/*`, and `app/robots.ts` and the page metadata keep search engines out. The pages are open to anyone who has the URL. To restrict them, read `auth` in `app/internal/layout.tsx` and call `response.notFound()`.
|
|
87
|
+
|
|
71
88
|
## Testing
|
|
72
89
|
|
|
73
90
|
`pylon test` discovers every `*.test.ts` / `*.test.tsx` file under `tests/` (or `functions/`) and runs it with **Bun's test runner** (`import { test, expect } from "bun:test"`). Run the suite with `pylon test` (or `npm test`); filter with `pylon test <substring>`. This template ships `bunfig.toml` + `tests/setup.ts` (registers happy-dom) so component tests render out of the box, plus starter tests under `tests/`; replace them with your own.
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* ui-sdk adds a small amount of CSS in this layer. The layer is declared
|
|
2
|
+
first so that every style in this file wins over it. */
|
|
3
|
+
@layer ui-sdk;
|
|
4
|
+
|
|
1
5
|
@import "tailwindcss";
|
|
2
6
|
@import "tw-animate-css";
|
|
3
7
|
|
|
@@ -11,7 +15,7 @@
|
|
|
11
15
|
|
|
12
16
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
13
17
|
|
|
14
|
-
/*
|
|
18
|
+
/* Design tokens (`/internal/design` shows every token) + the marketing site colors. The
|
|
15
19
|
marketing page is white with black type; `--brand` is used for links only,
|
|
16
20
|
`--paper` is the light grey band behind the contact form. app/layout.tsx
|
|
17
21
|
overrides these three from lib/site.config.ts on <html>. */
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type Metadata } from "@pylonsync/react";
|
|
3
|
+
import { Badge } from "@/components/ui/badge";
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardFooter,
|
|
10
|
+
CardHeader,
|
|
11
|
+
CardTitle,
|
|
12
|
+
} from "@/components/ui/card";
|
|
13
|
+
import {
|
|
14
|
+
Dialog,
|
|
15
|
+
DialogClose,
|
|
16
|
+
DialogContent,
|
|
17
|
+
DialogDescription,
|
|
18
|
+
DialogFooter,
|
|
19
|
+
DialogHeader,
|
|
20
|
+
DialogTitle,
|
|
21
|
+
DialogTrigger,
|
|
22
|
+
} from "@/components/ui/dialog";
|
|
23
|
+
import { Input } from "@/components/ui/input";
|
|
24
|
+
import { Label } from "@/components/ui/label";
|
|
25
|
+
import { Select } from "@/components/ui/select";
|
|
26
|
+
import {
|
|
27
|
+
Table,
|
|
28
|
+
TableBody,
|
|
29
|
+
TableCell,
|
|
30
|
+
TableHead,
|
|
31
|
+
TableHeader,
|
|
32
|
+
TableRow,
|
|
33
|
+
} from "@/components/ui/table";
|
|
34
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
35
|
+
import { Example, Showcase } from "../showcase";
|
|
36
|
+
|
|
37
|
+
export const metadata: Metadata = {
|
|
38
|
+
title: "Components",
|
|
39
|
+
robots: "noindex, nofollow",
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// `/internal/components` shows every reusable component in `components/`.
|
|
43
|
+
// Look here before you write UI. When you add a component, add a `Showcase`
|
|
44
|
+
// for it in the same commit.
|
|
45
|
+
|
|
46
|
+
const PLANS = [
|
|
47
|
+
{ value: "free", label: "Free" },
|
|
48
|
+
{ value: "pro", label: "Pro" },
|
|
49
|
+
{ value: "team", label: "Team" },
|
|
50
|
+
{ value: "enterprise", label: "Enterprise", disabled: true },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const OWNERS = [
|
|
54
|
+
{ value: "", label: "Unassigned" },
|
|
55
|
+
{ value: "ada", label: "Ada" },
|
|
56
|
+
{ value: "grace", label: "Grace" },
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
export default function ComponentsPage() {
|
|
60
|
+
return (
|
|
61
|
+
<div className="flex flex-col gap-10">
|
|
62
|
+
<header className="flex flex-col gap-2">
|
|
63
|
+
<h1 className="text-3xl font-semibold tracking-tight">Components</h1>
|
|
64
|
+
<p className="text-sm text-muted-foreground">
|
|
65
|
+
The reusable components in <code>components/</code>. A page composes
|
|
66
|
+
these components. Behavior comes from <code>@ui-sdk/react</code>.
|
|
67
|
+
Styles come from the design tokens.
|
|
68
|
+
</p>
|
|
69
|
+
</header>
|
|
70
|
+
|
|
71
|
+
<Showcase
|
|
72
|
+
id="button"
|
|
73
|
+
title="Button"
|
|
74
|
+
source="components/ui/button.tsx"
|
|
75
|
+
description="Use a button to start an action. Use the render prop to show a link as a button."
|
|
76
|
+
>
|
|
77
|
+
<Example label="Variants">
|
|
78
|
+
<Button>Default</Button>
|
|
79
|
+
<Button variant="secondary">Secondary</Button>
|
|
80
|
+
<Button variant="outline">Outline</Button>
|
|
81
|
+
<Button variant="ghost">Ghost</Button>
|
|
82
|
+
<Button variant="link">Link</Button>
|
|
83
|
+
<Button variant="destructive">Destructive</Button>
|
|
84
|
+
</Example>
|
|
85
|
+
<Example label="Sizes">
|
|
86
|
+
<Button size="sm">Small</Button>
|
|
87
|
+
<Button>Default</Button>
|
|
88
|
+
<Button size="lg">Large</Button>
|
|
89
|
+
</Example>
|
|
90
|
+
<Example label="States">
|
|
91
|
+
<Button disabled>Disabled</Button>
|
|
92
|
+
<Button
|
|
93
|
+
onClick={() => new Promise((resolve) => setTimeout(resolve, 1500))}
|
|
94
|
+
pendingAnnouncement="Saving"
|
|
95
|
+
>
|
|
96
|
+
Pending for 1.5 s
|
|
97
|
+
</Button>
|
|
98
|
+
<Button variant="outline" render={<a href="/internal/design" />}>
|
|
99
|
+
Link as button
|
|
100
|
+
</Button>
|
|
101
|
+
</Example>
|
|
102
|
+
</Showcase>
|
|
103
|
+
|
|
104
|
+
<Showcase
|
|
105
|
+
id="badge"
|
|
106
|
+
title="Badge"
|
|
107
|
+
source="components/ui/badge.tsx"
|
|
108
|
+
description="Use a badge to show a short status."
|
|
109
|
+
>
|
|
110
|
+
<Example label="Variants">
|
|
111
|
+
<Badge>Default</Badge>
|
|
112
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
113
|
+
<Badge variant="outline">Outline</Badge>
|
|
114
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
115
|
+
</Example>
|
|
116
|
+
</Showcase>
|
|
117
|
+
|
|
118
|
+
<Showcase
|
|
119
|
+
id="text-fields"
|
|
120
|
+
title="Input, Label and Textarea"
|
|
121
|
+
source="components/ui/input.tsx, label.tsx, textarea.tsx"
|
|
122
|
+
description="Use these components for text entry. Give each control a label."
|
|
123
|
+
>
|
|
124
|
+
<Example label="Input">
|
|
125
|
+
<div className="flex w-full flex-col gap-1.5">
|
|
126
|
+
<Label htmlFor="showcase-email">Email</Label>
|
|
127
|
+
<Input id="showcase-email" type="email" placeholder="you@example.com" />
|
|
128
|
+
</div>
|
|
129
|
+
</Example>
|
|
130
|
+
<Example label="Disabled input">
|
|
131
|
+
<Input aria-label="Disabled input" disabled placeholder="Disabled" />
|
|
132
|
+
</Example>
|
|
133
|
+
<Example label="Textarea">
|
|
134
|
+
<div className="flex w-full flex-col gap-1.5">
|
|
135
|
+
<Label htmlFor="showcase-notes">Notes</Label>
|
|
136
|
+
<Textarea id="showcase-notes" placeholder="Write a note" />
|
|
137
|
+
</div>
|
|
138
|
+
</Example>
|
|
139
|
+
</Showcase>
|
|
140
|
+
|
|
141
|
+
<Showcase
|
|
142
|
+
id="select"
|
|
143
|
+
title="Select"
|
|
144
|
+
source="components/ui/select.tsx"
|
|
145
|
+
description="Use a select to pick one value from a list of options."
|
|
146
|
+
>
|
|
147
|
+
<Example label="With a placeholder">
|
|
148
|
+
<div className="flex w-full flex-col gap-1.5">
|
|
149
|
+
<Label htmlFor="showcase-plan">Plan</Label>
|
|
150
|
+
<Select id="showcase-plan" items={PLANS} placeholder="Select a plan" />
|
|
151
|
+
</div>
|
|
152
|
+
</Example>
|
|
153
|
+
<Example label="With a default value">
|
|
154
|
+
<Select aria-label="Plan" items={PLANS} defaultValue="pro" />
|
|
155
|
+
</Example>
|
|
156
|
+
<Example label="With an option for no value">
|
|
157
|
+
<Select aria-label="Owner" items={OWNERS} defaultValue="" />
|
|
158
|
+
</Example>
|
|
159
|
+
<Example label="Disabled">
|
|
160
|
+
<Select aria-label="Plan" items={PLANS} defaultValue="free" disabled />
|
|
161
|
+
</Example>
|
|
162
|
+
</Showcase>
|
|
163
|
+
|
|
164
|
+
<Showcase
|
|
165
|
+
id="dialog"
|
|
166
|
+
title="Dialog"
|
|
167
|
+
source="components/ui/dialog.tsx"
|
|
168
|
+
description="Use a dialog for a task that needs the full attention of the user."
|
|
169
|
+
>
|
|
170
|
+
<Example label="Default">
|
|
171
|
+
<Dialog>
|
|
172
|
+
<DialogTrigger render={<Button variant="outline" />}>
|
|
173
|
+
Open the dialog
|
|
174
|
+
</DialogTrigger>
|
|
175
|
+
<DialogContent>
|
|
176
|
+
<DialogHeader>
|
|
177
|
+
<DialogTitle>Rename the item</DialogTitle>
|
|
178
|
+
<DialogDescription>
|
|
179
|
+
The new name shows in every list.
|
|
180
|
+
</DialogDescription>
|
|
181
|
+
</DialogHeader>
|
|
182
|
+
<div className="flex flex-col gap-1.5">
|
|
183
|
+
<Label htmlFor="showcase-name">Name</Label>
|
|
184
|
+
<Input id="showcase-name" defaultValue="First item" />
|
|
185
|
+
</div>
|
|
186
|
+
<DialogFooter>
|
|
187
|
+
<DialogClose render={<Button variant="outline" />}>
|
|
188
|
+
Cancel
|
|
189
|
+
</DialogClose>
|
|
190
|
+
<DialogClose render={<Button />}>Save</DialogClose>
|
|
191
|
+
</DialogFooter>
|
|
192
|
+
</DialogContent>
|
|
193
|
+
</Dialog>
|
|
194
|
+
</Example>
|
|
195
|
+
</Showcase>
|
|
196
|
+
|
|
197
|
+
<Showcase
|
|
198
|
+
id="card"
|
|
199
|
+
title="Card"
|
|
200
|
+
source="components/ui/card.tsx"
|
|
201
|
+
description="Use a card to group related content."
|
|
202
|
+
>
|
|
203
|
+
<Card className="w-full">
|
|
204
|
+
<CardHeader>
|
|
205
|
+
<CardTitle>Team plan</CardTitle>
|
|
206
|
+
<CardDescription>10 seats. Billed each month.</CardDescription>
|
|
207
|
+
</CardHeader>
|
|
208
|
+
<CardContent className="text-sm">
|
|
209
|
+
The plan renews on the first day of each month.
|
|
210
|
+
</CardContent>
|
|
211
|
+
<CardFooter>
|
|
212
|
+
<Button size="sm">Change the plan</Button>
|
|
213
|
+
</CardFooter>
|
|
214
|
+
</Card>
|
|
215
|
+
</Showcase>
|
|
216
|
+
|
|
217
|
+
<Showcase
|
|
218
|
+
id="table"
|
|
219
|
+
title="Table"
|
|
220
|
+
source="components/ui/table.tsx"
|
|
221
|
+
description="Use a table to show rows of records."
|
|
222
|
+
>
|
|
223
|
+
<Table>
|
|
224
|
+
<TableHeader>
|
|
225
|
+
<TableRow>
|
|
226
|
+
<TableHead>Name</TableHead>
|
|
227
|
+
<TableHead>Status</TableHead>
|
|
228
|
+
</TableRow>
|
|
229
|
+
</TableHeader>
|
|
230
|
+
<TableBody>
|
|
231
|
+
<TableRow>
|
|
232
|
+
<TableCell>First item</TableCell>
|
|
233
|
+
<TableCell>
|
|
234
|
+
<Badge variant="secondary">Open</Badge>
|
|
235
|
+
</TableCell>
|
|
236
|
+
</TableRow>
|
|
237
|
+
<TableRow>
|
|
238
|
+
<TableCell>Second item</TableCell>
|
|
239
|
+
<TableCell>
|
|
240
|
+
<Badge variant="outline">Closed</Badge>
|
|
241
|
+
</TableCell>
|
|
242
|
+
</TableRow>
|
|
243
|
+
</TableBody>
|
|
244
|
+
</Table>
|
|
245
|
+
</Showcase>
|
|
246
|
+
</div>
|
|
247
|
+
);
|
|
248
|
+
}
|