@stacksjs/defaults 0.70.206 → 0.70.208
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/TODO.md +21 -0
- package/ai/AGENTS.md +79 -0
- package/ai/README.md +45 -0
- package/ai/claude/launch.json +12 -0
- package/ai/skills/stacks-actions/SKILL.md +128 -0
- package/ai/skills/stacks-ai/SKILL.md +276 -0
- package/ai/skills/stacks-alias/SKILL.md +94 -0
- package/ai/skills/stacks-analytics/SKILL.md +91 -0
- package/ai/skills/stacks-api/SKILL.md +738 -0
- package/ai/skills/stacks-arrays/SKILL.md +277 -0
- package/ai/skills/stacks-auth/SKILL.md +422 -0
- package/ai/skills/stacks-auto-imports/SKILL.md +138 -0
- package/ai/skills/stacks-brandkit/SKILL.md +811 -0
- package/ai/skills/stacks-browse/SKILL.md +127 -0
- package/ai/skills/stacks-browse/scripts/browse.ts +492 -0
- package/ai/skills/stacks-browser/SKILL.md +145 -0
- package/ai/skills/stacks-buddy/SKILL.md +676 -0
- package/ai/skills/stacks-build/SKILL.md +163 -0
- package/ai/skills/stacks-cache/SKILL.md +125 -0
- package/ai/skills/stacks-calendar/SKILL.md +113 -0
- package/ai/skills/stacks-chat/SKILL.md +371 -0
- package/ai/skills/stacks-cli/SKILL.md +112 -0
- package/ai/skills/stacks-cloud/SKILL.md +192 -0
- package/ai/skills/stacks-cms/SKILL.md +217 -0
- package/ai/skills/stacks-collections/SKILL.md +82 -0
- package/ai/skills/stacks-commerce/SKILL.md +114 -0
- package/ai/skills/stacks-composables/SKILL.md +161 -0
- package/ai/skills/stacks-config/SKILL.md +144 -0
- package/ai/skills/stacks-configuration/SKILL.md +154 -0
- package/ai/skills/stacks-cron/SKILL.md +123 -0
- package/ai/skills/stacks-crosswind/SKILL.md +190 -0
- package/ai/skills/stacks-dashboard/SKILL.md +173 -0
- package/ai/skills/stacks-database/SKILL.md +286 -0
- package/ai/skills/stacks-datetime/SKILL.md +269 -0
- package/ai/skills/stacks-dependencies/SKILL.md +111 -0
- package/ai/skills/stacks-deploy/SKILL.md +102 -0
- package/ai/skills/stacks-design-brutalist/SKILL.md +110 -0
- package/ai/skills/stacks-design-minimalist/SKILL.md +115 -0
- package/ai/skills/stacks-design-output/SKILL.md +55 -0
- package/ai/skills/stacks-design-soft/SKILL.md +156 -0
- package/ai/skills/stacks-design-taste/SKILL.md +1012 -0
- package/ai/skills/stacks-design-taste-codex/SKILL.md +294 -0
- package/ai/skills/stacks-desktop/SKILL.md +78 -0
- package/ai/skills/stacks-development/SKILL.md +298 -0
- package/ai/skills/stacks-dns/SKILL.md +149 -0
- package/ai/skills/stacks-docs/SKILL.md +109 -0
- package/ai/skills/stacks-email/SKILL.md +236 -0
- package/ai/skills/stacks-enums/SKILL.md +100 -0
- package/ai/skills/stacks-env/SKILL.md +181 -0
- package/ai/skills/stacks-error-handling/SKILL.md +137 -0
- package/ai/skills/stacks-events/SKILL.md +228 -0
- package/ai/skills/stacks-faker/SKILL.md +158 -0
- package/ai/skills/stacks-git/SKILL.md +158 -0
- package/ai/skills/stacks-guard/SKILL.md +98 -0
- package/ai/skills/stacks-health/SKILL.md +75 -0
- package/ai/skills/stacks-http/SKILL.md +316 -0
- package/ai/skills/stacks-i18n/SKILL.md +198 -0
- package/ai/skills/stacks-image-to-code/SKILL.md +629 -0
- package/ai/skills/stacks-imagegen-mobile/SKILL.md +1474 -0
- package/ai/skills/stacks-imagegen-web/SKILL.md +998 -0
- package/ai/skills/stacks-investigate/SKILL.md +119 -0
- package/ai/skills/stacks-jobs/SKILL.md +136 -0
- package/ai/skills/stacks-lint/SKILL.md +184 -0
- package/ai/skills/stacks-listeners/SKILL.md +99 -0
- package/ai/skills/stacks-logging/SKILL.md +78 -0
- package/ai/skills/stacks-mail/SKILL.md +120 -0
- package/ai/skills/stacks-middleware/SKILL.md +249 -0
- package/ai/skills/stacks-migrations/SKILL.md +105 -0
- package/ai/skills/stacks-models/SKILL.md +267 -0
- package/ai/skills/stacks-new-feature/SKILL.md +206 -0
- package/ai/skills/stacks-notifications/SKILL.md +210 -0
- package/ai/skills/stacks-objects/SKILL.md +205 -0
- package/ai/skills/stacks-office-hours/SKILL.md +134 -0
- package/ai/skills/stacks-orm/SKILL.md +342 -0
- package/ai/skills/stacks-path/SKILL.md +118 -0
- package/ai/skills/stacks-payments/SKILL.md +373 -0
- package/ai/skills/stacks-plan-review/SKILL.md +152 -0
- package/ai/skills/stacks-plugins/SKILL.md +149 -0
- package/ai/skills/stacks-push/SKILL.md +376 -0
- package/ai/skills/stacks-query-builder/SKILL.md +128 -0
- package/ai/skills/stacks-queue/SKILL.md +559 -0
- package/ai/skills/stacks-realtime/SKILL.md +442 -0
- package/ai/skills/stacks-redesign/SKILL.md +182 -0
- package/ai/skills/stacks-registry/SKILL.md +58 -0
- package/ai/skills/stacks-repl/SKILL.md +80 -0
- package/ai/skills/stacks-retro/SKILL.md +122 -0
- package/ai/skills/stacks-review/SKILL.md +135 -0
- package/ai/skills/stacks-router/SKILL.md +231 -0
- package/ai/skills/stacks-routes/SKILL.md +105 -0
- package/ai/skills/stacks-scaffolding/SKILL.md +162 -0
- package/ai/skills/stacks-scheduler/SKILL.md +363 -0
- package/ai/skills/stacks-search-engine/SKILL.md +112 -0
- package/ai/skills/stacks-security/SKILL.md +129 -0
- package/ai/skills/stacks-security-audit/SKILL.md +128 -0
- package/ai/skills/stacks-server/SKILL.md +458 -0
- package/ai/skills/stacks-shell/SKILL.md +62 -0
- package/ai/skills/stacks-slug/SKILL.md +87 -0
- package/ai/skills/stacks-sms/SKILL.md +385 -0
- package/ai/skills/stacks-socials/SKILL.md +303 -0
- package/ai/skills/stacks-storage/SKILL.md +576 -0
- package/ai/skills/stacks-strings/SKILL.md +416 -0
- package/ai/skills/stacks-stx/SKILL.md +176 -0
- package/ai/skills/stacks-technical-diagrams/LICENSE +22 -0
- package/ai/skills/stacks-technical-diagrams/SKILL.md +290 -0
- package/ai/skills/stacks-technical-diagrams/agents/openai.yaml +4 -0
- package/ai/skills/stacks-technical-diagrams/assets/template.html +1252 -0
- package/ai/skills/stacks-technical-diagrams/bin/technical-diagrams.mjs +289 -0
- package/ai/skills/stacks-technical-diagrams/bunfig.toml +1 -0
- package/ai/skills/stacks-technical-diagrams/examples/agent-run.lifecycle.json +64 -0
- package/ai/skills/stacks-technical-diagrams/examples/agent-tool-call.workflow.json +88 -0
- package/ai/skills/stacks-technical-diagrams/examples/cache-miss-request.sequence.json +75 -0
- package/ai/skills/stacks-technical-diagrams/examples/product-analytics.dataflow.json +70 -0
- package/ai/skills/stacks-technical-diagrams/examples/web-app.architecture.json +41 -0
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/grid.mjs +62 -0
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/render-architecture.mjs +371 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/README.md +82 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/render-dataflow.mjs +295 -0
- package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/README.md +91 -0
- package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/render-lifecycle.mjs +384 -0
- package/ai/skills/stacks-technical-diagrams/renderers/sequence/README.md +84 -0
- package/ai/skills/stacks-technical-diagrams/renderers/sequence/render-sequence.mjs +257 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/cli.mjs +42 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/generated-validators.mjs +13 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/geometry.mjs +230 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/layout-report.mjs +40 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/utils.mjs +88 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/validator.mjs +40 -0
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/README.md +103 -0
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/render-workflow.mjs +481 -0
- package/ai/skills/stacks-technical-diagrams/schemas/README.md +68 -0
- package/ai/skills/stacks-technical-diagrams/schemas/architecture.schema.json +121 -0
- package/ai/skills/stacks-technical-diagrams/schemas/common.schema.json +43 -0
- package/ai/skills/stacks-technical-diagrams/schemas/dataflow.schema.json +221 -0
- package/ai/skills/stacks-technical-diagrams/schemas/lifecycle.schema.json +241 -0
- package/ai/skills/stacks-technical-diagrams/schemas/sequence.schema.json +186 -0
- package/ai/skills/stacks-technical-diagrams/schemas/workflow.schema.json +332 -0
- package/ai/skills/stacks-technical-diagrams/scripts/check-render-output.mjs +297 -0
- package/ai/skills/stacks-technical-diagrams/scripts/render-examples.mjs +28 -0
- package/ai/skills/stacks-testing/SKILL.md +129 -0
- package/ai/skills/stacks-tunnel/SKILL.md +125 -0
- package/ai/skills/stacks-types/SKILL.md +178 -0
- package/ai/skills/stacks-ui/SKILL.md +246 -0
- package/ai/skills/stacks-utils/SKILL.md +444 -0
- package/ai/skills/stacks-validation/SKILL.md +371 -0
- package/ai/skills/stacks-whois/SKILL.md +315 -0
- package/assets/world-map-data.ts +121 -0
- package/bootstrap.ts +114 -0
- package/docs/api-examples.md +46 -0
- package/docs/index.md +24 -0
- package/docs/markdown-examples.md +87 -0
- package/functions/analytics.ts +97 -0
- package/functions/api.ts +143 -0
- package/functions/auth.ts +208 -0
- package/functions/billing/payments.ts +149 -0
- package/functions/blog.ts +120 -0
- package/functions/cms/categorizables.ts +107 -0
- package/functions/cms/pages.ts +108 -0
- package/functions/cms/posts.ts +100 -0
- package/functions/cms/taggables.ts +102 -0
- package/functions/commerce/coupons.ts +128 -0
- package/functions/commerce/customers.ts +128 -0
- package/functions/commerce/gift-cards.ts +119 -0
- package/functions/commerce/orders.ts +112 -0
- package/functions/commerce/payments.ts +119 -0
- package/functions/commerce/products/categories.ts +123 -0
- package/functions/commerce/products/manufacturers.ts +123 -0
- package/functions/commerce/products/products.ts +123 -0
- package/functions/commerce/products/reviews.ts +123 -0
- package/functions/commerce/products/units.ts +123 -0
- package/functions/commerce/products/variants.ts +123 -0
- package/functions/commerce/shippings/delivery-routes.ts +123 -0
- package/functions/commerce/shippings/digital-deliveries.ts +119 -0
- package/functions/commerce/shippings/drivers.ts +123 -0
- package/functions/commerce/shippings/license-keys.ts +123 -0
- package/functions/commerce/shippings/shipping-methods.ts +123 -0
- package/functions/commerce/shippings/shipping-rates.ts +119 -0
- package/functions/commerce/shippings/shipping-zones.ts +119 -0
- package/functions/commerce/taxes.ts +119 -0
- package/functions/commerce/waitlist/products.ts +123 -0
- package/functions/commerce/waitlist/restaurants.ts +123 -0
- package/functions/craft.ts +107 -0
- package/functions/dashboard.ts +153 -0
- package/functions/inbox.ts +95 -0
- package/functions/jobs.ts +86 -0
- package/functions/monitoring/errors.ts +295 -0
- package/functions/queue.ts +111 -0
- package/functions/realtime/websockets.ts +96 -0
- package/functions/realtime.ts +52 -0
- package/functions/releases.ts +49 -0
- package/functions/search.ts +126 -0
- package/functions/toasts.ts +95 -0
- package/functions/uploads.ts +216 -0
- package/ide/.gitignore +4 -0
- package/ide/cursor/rules/auto-imports.mdc +574 -0
- package/ide/cursor/rules/code-style.mdc +12 -0
- package/ide/cursor/rules/documentation.mdc +9 -0
- package/ide/cursor/rules/error-handling-validation.mdc +11 -0
- package/ide/cursor/rules/key-conventions.mdc +11 -0
- package/ide/cursor/rules/project-structure.mdc +169 -0
- package/ide/cursor/rules/readme.mdc +318 -0
- package/ide/cursor/rules/syntax-formatting.mdc +9 -0
- package/ide/cursor/rules/testing.mdc +10 -0
- package/ide/cursor/rules/typescript.mdc +9 -0
- package/ide/cursor/rules/ui-styling.mdc +0 -0
- package/ide/dictionary.txt +397 -0
- package/ide/jetbrains/.fleet/settings.json +4 -0
- package/ide/jetbrains/.idea/.gitignore +5 -0
- package/ide/jetbrains/.idea/.name +1 -0
- package/ide/jetbrains/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/ide/jetbrains/.idea/jsLinters/eslint.xml +7 -0
- package/ide/jetbrains/.idea/modules.xml +8 -0
- package/ide/jetbrains/.idea/stacks.iml +22 -0
- package/ide/jetbrains/.idea/vcs.xml +6 -0
- package/ide/jetbrains/.idea/webResources.xml +14 -0
- package/ide/jetbrains/IntelliJ IDEA Global Settings +0 -0
- package/ide/jetbrains/installed.txt +4 -0
- package/ide/jetbrains/options/github-copilot.xml +5 -0
- package/ide/jetbrains/options/nodejs.xml +7 -0
- package/ide/jetbrains/options/templates.xml +124 -0
- package/ide/jetbrains/templates/JavaScript.xml +6 -0
- package/ide/jetbrains/templates/Stacks.xml +8 -0
- package/ide/vscode/.vscode/README.md +23 -0
- package/ide/vscode/.vscode/extensions.json +5 -0
- package/ide/vscode/.vscode/settings.json +176 -0
- package/ide/vscode/.vscode/stacks.code-snippets +181 -0
- package/ide/vscode/LICENSE.md +21 -0
- package/ide/vscode/README.md +36 -0
- package/ide/vscode/logo.png +0 -0
- package/ide/vscode/package.json +79 -0
- package/ide/zed/.zed/settings.json +139 -0
- package/lang/README.md +28 -0
- package/lang/de.yml +14 -0
- package/lang/en.yml +15 -0
- package/package.json +19 -3
- package/project/bootstrap +161 -0
- package/project/buddy +175 -0
- package/project/storage/framework/tsconfig.app.json +50 -0
- package/project/storage/framework/tsconfig.base.json +58 -0
- package/routes/core.ts +78 -0
- package/routes/dashboard-api.ts +233 -0
- package/routes/dashboard.ts +739 -0
- package/routes/email.ts +129 -0
- package/stores/[name].stx +16 -0
- package/stores/git.ts +71 -0
- package/stores/payment.ts +474 -0
- package/stores/queue.ts +43 -0
- package/stores/user.ts +29 -0
- package/stx-components-plugin.ts +25 -0
- package/styles/design-tokens.css +597 -0
- package/types/dashboard.ts +70 -0
- package/types/defaults.ts +438 -0
- package/vcs/github/CODE_OF_CONDUCT.md +83 -0
- package/vcs/github/CONTRIBUTING.md +187 -0
- package/vcs/github/EXPLANATIONS.md +41 -0
- package/vcs/github/FUNDING.yml +1 -0
- package/vcs/github/ISSUE_TEMPLATE/bug_report.yml +49 -0
- package/vcs/github/ISSUE_TEMPLATE/config.yml +10 -0
- package/vcs/github/ISSUE_TEMPLATE/feature_request.yml +44 -0
- package/vcs/github/SECURITY.md +70 -0
- package/vcs/github/renovate.json +5 -0
- package/vcs/github/stale.yml +14 -0
- package/vcs/github/workflows/README.md +16 -0
- package/vcs/github/workflows/ci.yml +114 -0
- package/vcs/github/workflows/export-size.yml +25 -0
- package/vcs/github/workflows/labeler.yml +13 -0
- package/vcs/github/workflows/release.yml +219 -0
- package/views/[...all].stx +8 -0
- package/views/about.md +3 -0
- package/views/auth/login.stx +1 -0
- package/views/auth/signup.stx +85 -0
- package/views/dashboard/.discovered-models.json +542 -0
- package/views/dashboard/AUDIT.md +904 -0
- package/views/dashboard/[...all].stx +89 -0
- package/views/dashboard/access-tokens/index.stx +177 -0
- package/views/dashboard/actions/index.stx +129 -0
- package/views/dashboard/analytics/blog/index.stx +356 -0
- package/views/dashboard/analytics/browsers/index.stx +263 -0
- package/views/dashboard/analytics/commerce/sales/index.stx +329 -0
- package/views/dashboard/analytics/commerce/web/index.stx +379 -0
- package/views/dashboard/analytics/countries/index.stx +289 -0
- package/views/dashboard/analytics/devices/index.stx +305 -0
- package/views/dashboard/analytics/events/index.stx +536 -0
- package/views/dashboard/analytics/index.stx +88 -0
- package/views/dashboard/analytics/marketing/index.stx +315 -0
- package/views/dashboard/analytics/pages/index.stx +271 -0
- package/views/dashboard/analytics/referrers/index.stx +319 -0
- package/views/dashboard/analytics/web/index.stx +356 -0
- package/views/dashboard/buddy/index.stx +198 -0
- package/views/dashboard/ci/index.stx +462 -0
- package/views/dashboard/cloud/index.stx +452 -0
- package/views/dashboard/commands/index.stx +295 -0
- package/views/dashboard/commerce/categories/index.stx +406 -0
- package/views/dashboard/commerce/coupons/index.stx +485 -0
- package/views/dashboard/commerce/customers/index.stx +410 -0
- package/views/dashboard/commerce/dashboard/index.stx +287 -0
- package/views/dashboard/commerce/delivery/delivery-routes.stx +305 -0
- package/views/dashboard/commerce/delivery/digital-delivery.stx +332 -0
- package/views/dashboard/commerce/delivery/drivers.stx +397 -0
- package/views/dashboard/commerce/delivery/index.stx +18 -0
- package/views/dashboard/commerce/delivery/license-keys.stx +380 -0
- package/views/dashboard/commerce/delivery/shipping-methods.stx +346 -0
- package/views/dashboard/commerce/delivery/shipping-rates.stx +338 -0
- package/views/dashboard/commerce/delivery/shipping-zones.stx +302 -0
- package/views/dashboard/commerce/delivery/tabs.ts +25 -0
- package/views/dashboard/commerce/gift-cards/index.stx +561 -0
- package/views/dashboard/commerce/manufacturers/index.stx +308 -0
- package/views/dashboard/commerce/orders/index.stx +247 -0
- package/views/dashboard/commerce/payments/index.stx +535 -0
- package/views/dashboard/commerce/pos/index.stx +653 -0
- package/views/dashboard/commerce/printers/devices/index.stx +273 -0
- package/views/dashboard/commerce/printers/receipts/index.stx +308 -0
- package/views/dashboard/commerce/products/detail.stx +563 -0
- package/views/dashboard/commerce/products/index.stx +370 -0
- package/views/dashboard/commerce/reviews/index.stx +656 -0
- package/views/dashboard/commerce/reviews/index.ts +0 -0
- package/views/dashboard/commerce/taxes/index.stx +377 -0
- package/views/dashboard/commerce/units/index.stx +317 -0
- package/views/dashboard/commerce/variants/index.stx +319 -0
- package/views/dashboard/commerce/waitlist/products.stx +942 -0
- package/views/dashboard/commerce/waitlist/restaurant.stx +1024 -0
- package/views/dashboard/components/index.stx +330 -0
- package/views/dashboard/composables/index.ts +19 -0
- package/views/dashboard/composables/useChart.ts +77 -0
- package/views/dashboard/composables/useNavigation.ts +99 -0
- package/views/dashboard/composables/useRole.ts +58 -0
- package/views/dashboard/composables/useTheme.ts +74 -0
- package/views/dashboard/content/authors/index.stx +171 -0
- package/views/dashboard/content/blog/index.stx +493 -0
- package/views/dashboard/content/categories/index.stx +169 -0
- package/views/dashboard/content/comments/index.stx +189 -0
- package/views/dashboard/content/dashboard.stx +383 -0
- package/views/dashboard/content/files/index.stx +706 -0
- package/views/dashboard/content/pages/index.stx +174 -0
- package/views/dashboard/content/posts/index.stx +269 -0
- package/views/dashboard/content/seo/index.stx +240 -0
- package/views/dashboard/content/tags/index.stx +167 -0
- package/views/dashboard/data/activity/index.stx +261 -0
- package/views/dashboard/data/dashboard/index.stx +116 -0
- package/views/dashboard/data/subscribers.stx +270 -0
- package/views/dashboard/data/teams.stx +275 -0
- package/views/dashboard/data/users.stx +279 -0
- package/views/dashboard/dependencies/index.stx +178 -0
- package/views/dashboard/deployments/[id].stx +234 -0
- package/views/dashboard/deployments/index.stx +9 -0
- package/views/dashboard/dns/index.stx +163 -0
- package/views/dashboard/environment/index.stx +283 -0
- package/views/dashboard/errors/index.stx +274 -0
- package/views/dashboard/forgot-password.stx +57 -0
- package/views/dashboard/functions/index.stx +159 -0
- package/views/dashboard/health/index.stx +248 -0
- package/views/dashboard/inbox/activity.stx +350 -0
- package/views/dashboard/inbox/index.stx +452 -0
- package/views/dashboard/inbox/settings.stx +290 -0
- package/views/dashboard/index.stx +252 -0
- package/views/dashboard/insights/index.stx +529 -0
- package/views/dashboard/jobs/[id].stx +430 -0
- package/views/dashboard/jobs/history.stx +222 -0
- package/views/dashboard/jobs/index.stx +214 -0
- package/views/dashboard/kanban/[id].stx +899 -0
- package/views/dashboard/kanban/index.stx +260 -0
- package/views/dashboard/layouts/default.stx +565 -0
- package/views/dashboard/layouts/guest.stx +10 -0
- package/views/dashboard/login.stx +48 -0
- package/views/dashboard/logs/index.stx +540 -0
- package/views/dashboard/mailboxes/index.stx +149 -0
- package/views/dashboard/management/permissions/index.stx +490 -0
- package/views/dashboard/marketing/campaigns/index.stx +604 -0
- package/views/dashboard/marketing/lists/index.stx +514 -0
- package/views/dashboard/marketing/reviews/index.stx +475 -0
- package/views/dashboard/marketing/social-posts/index.stx +560 -0
- package/views/dashboard/models/[model].stx +195 -0
- package/views/dashboard/models/index.stx +159 -0
- package/views/dashboard/monitoring/errors/index.stx +415 -0
- package/views/dashboard/notifications/dashboard.stx +383 -0
- package/views/dashboard/notifications/email.stx +336 -0
- package/views/dashboard/notifications/history.stx +373 -0
- package/views/dashboard/notifications/sms.stx +332 -0
- package/views/dashboard/packages/index.stx +195 -0
- package/views/dashboard/queries/[id].stx +381 -0
- package/views/dashboard/queries/history.stx +227 -0
- package/views/dashboard/queries/index.stx +335 -0
- package/views/dashboard/queries/slow.stx +318 -0
- package/views/dashboard/queue/index.stx +427 -0
- package/views/dashboard/realtime/index.stx +429 -0
- package/views/dashboard/register.stx +46 -0
- package/views/dashboard/releases/index.stx +389 -0
- package/views/dashboard/requests/index.stx +462 -0
- package/views/dashboard/serverless/index.stx +475 -0
- package/views/dashboard/servers/[id].stx +299 -0
- package/views/dashboard/servers/index.stx +483 -0
- package/views/dashboard/settings/billing.stx +50 -0
- package/views/dashboard/settings/index.stx +256 -0
- package/views/dashboard/settings/mail.stx +252 -0
- package/views/dashboard/stores/auth.ts +123 -0
- package/views/dashboard/stores/ci.ts +342 -0
- package/views/dashboard/stores/index.ts +129 -0
- package/views/dashboard/stores/kanban.ts +723 -0
- package/views/dashboard/stores/rbac.ts +350 -0
- package/views/dashboard/stx.config.ts +34 -0
- package/views/dashboard/teams/[id].stx +170 -0
- package/views/forum/category.stx +92 -0
- package/views/forum/index.stx +209 -0
- package/views/forum/new-topic.stx +113 -0
- package/views/forum/profile.stx +1 -0
- package/views/forum/topic.stx +143 -0
- package/views/hello-world/[name].stx +47 -0
- package/views/index.stx +21 -0
- package/views/system-tray/index.stx +147 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stacks-testing
|
|
3
|
+
description: Use when writing or running tests in Stacks — test setup, database test utilities (setup, refresh, truncate), DynamoDB testing, feature test patterns, the test CLI commands, test configuration in bunfig.toml, or test environment setup. Covers @stacksjs/testing and tests/.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
|
+
allowed-tools: Read Edit Write Bash Grep Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Stacks Testing
|
|
10
|
+
|
|
11
|
+
Uses Bun's built-in test runner with Stacks-specific test utilities.
|
|
12
|
+
|
|
13
|
+
## Key Paths
|
|
14
|
+
- Core package: `storage/framework/core/testing/src/`
|
|
15
|
+
- Test directory: `tests/`
|
|
16
|
+
- Test setup: `tests/setup.ts`
|
|
17
|
+
- Package: `@stacksjs/testing`
|
|
18
|
+
|
|
19
|
+
## Test Setup
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { setupTestEnvironment, setupDatabase, refreshDatabase } from '@stacksjs/testing'
|
|
23
|
+
|
|
24
|
+
// Set NODE_ENV and APP_ENV to 'test'
|
|
25
|
+
setupTestEnvironment()
|
|
26
|
+
|
|
27
|
+
// Create testing database (SQLite: database/stacks_testing.sqlite)
|
|
28
|
+
await setupDatabase()
|
|
29
|
+
|
|
30
|
+
// Refresh database (drop and re-migrate)
|
|
31
|
+
await refreshDatabase()
|
|
32
|
+
|
|
33
|
+
// Truncate tables
|
|
34
|
+
await truncateSqlite() // for SQLite
|
|
35
|
+
await truncateMysql() // for MySQL
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## DynamoDB Testing
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { launchServer, createStacksTable, deleteStacksTable, delay } from '@stacksjs/testing'
|
|
42
|
+
|
|
43
|
+
// Launch DynamoDB Local
|
|
44
|
+
const { server, endpoint } = await launchServer()
|
|
45
|
+
|
|
46
|
+
// Create test table
|
|
47
|
+
await createStacksTable()
|
|
48
|
+
|
|
49
|
+
// Cleanup
|
|
50
|
+
await deleteStacksTable()
|
|
51
|
+
|
|
52
|
+
// Utility
|
|
53
|
+
await delay(1000) // wait for async operations
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Writing Tests
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { describe, test, it, expect, beforeAll, afterAll, beforeEach } from 'bun:test'
|
|
60
|
+
|
|
61
|
+
describe('User Model', () => {
|
|
62
|
+
beforeAll(async () => {
|
|
63
|
+
await setupDatabase()
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
afterAll(async () => {
|
|
67
|
+
await refreshDatabase()
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
test('can create a user', async () => {
|
|
71
|
+
const user = await User.create({ name: 'John', email: 'john@test.com' })
|
|
72
|
+
expect(user.name).toBe('John')
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
test('validates email uniqueness', async () => {
|
|
76
|
+
await expect(User.create({ email: 'duplicate@test.com' }))
|
|
77
|
+
.rejects.toThrow()
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Queue Testing
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { fake, restore, runTestJob, expectJobToFail } from '@stacksjs/queue'
|
|
86
|
+
|
|
87
|
+
test('dispatches welcome email job', async () => {
|
|
88
|
+
const fakeQueue = fake()
|
|
89
|
+
await SendWelcomeEmail.dispatch({ email: 'test@test.com' })
|
|
90
|
+
fakeQueue.assertDispatched('SendWelcomeEmail')
|
|
91
|
+
restore()
|
|
92
|
+
})
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## CLI Commands
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
buddy test # run all tests
|
|
99
|
+
buddy test --unit # unit tests only
|
|
100
|
+
buddy test --feature # feature tests only
|
|
101
|
+
bun run test # via npm script
|
|
102
|
+
bun run test:ui # UI tests
|
|
103
|
+
bun run test:coverage # with coverage
|
|
104
|
+
bun run test:types # type tests
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Configuration (bunfig.toml)
|
|
108
|
+
|
|
109
|
+
```toml
|
|
110
|
+
[test]
|
|
111
|
+
preload = ["./tests/setup.ts"]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Test File Conventions
|
|
115
|
+
- Test files: `*.test.ts` or `*.spec.ts`
|
|
116
|
+
- Located in `tests/` directory
|
|
117
|
+
- Setup/teardown in `tests/setup.ts`
|
|
118
|
+
- Unit tests in `tests/unit/`
|
|
119
|
+
- Feature tests in `tests/feature/`
|
|
120
|
+
|
|
121
|
+
## Gotchas
|
|
122
|
+
- Uses Bun's native test runner, NOT Jest or Vitest
|
|
123
|
+
- Test preload runs `tests/setup.ts` before each test file
|
|
124
|
+
- SQLite testing database is at `database/stacks_testing.sqlite`
|
|
125
|
+
- `refreshDatabase()` drops ALL tables — use in test setup only
|
|
126
|
+
- DynamoDB Local must be installed for DynamoDB tests
|
|
127
|
+
- Queue testing uses `fake()`/`restore()` pattern — affects global state
|
|
128
|
+
- `@stacksjs/faker` provides test data generation
|
|
129
|
+
- Coverage reports with `bun run test:coverage`
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stacks-tunnel
|
|
3
|
+
description: Use when setting up tunnels in Stacks — local development tunnels for webhook testing, custom cloud tunnel deployment to AWS EC2, tunnel event callbacks (onConnect, onRequest, onResponse, onError), subdomain configuration, or the buddy share command. Covers @stacksjs/tunnel.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
|
+
allowed-tools: Read Edit Write Bash Grep Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Stacks Tunnel
|
|
10
|
+
|
|
11
|
+
Local and cloud-deployed development tunnels for exposing local servers.
|
|
12
|
+
|
|
13
|
+
## Key Paths
|
|
14
|
+
- Core package: `storage/framework/core/tunnel/src/`
|
|
15
|
+
- External tool: ~/Code/Tools/localtunnels/
|
|
16
|
+
|
|
17
|
+
## Local Tunnel (Quick)
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { createLocalTunnel } from '@stacksjs/tunnel'
|
|
21
|
+
|
|
22
|
+
const url = await createLocalTunnel(3000)
|
|
23
|
+
// Returns: 'https://abc123.loca.lt'
|
|
24
|
+
console.log(`Share this URL: ${url}`)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Advanced Local Tunnel
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { localTunnel } from '@stacksjs/tunnel'
|
|
31
|
+
|
|
32
|
+
const tunnel = await localTunnel({
|
|
33
|
+
port: 3000, // required
|
|
34
|
+
server: 'https://localtunnel.me', // tunnel server
|
|
35
|
+
subdomain: 'my-app', // request specific subdomain
|
|
36
|
+
verbose: true,
|
|
37
|
+
timeout: 30000, // connection timeout (ms)
|
|
38
|
+
maxReconnectAttempts: 5,
|
|
39
|
+
|
|
40
|
+
// Event callbacks
|
|
41
|
+
onConnect: (url) => {
|
|
42
|
+
console.log(`Tunnel connected: ${url}`)
|
|
43
|
+
},
|
|
44
|
+
onRequest: (info) => {
|
|
45
|
+
console.log(`Request: ${info.method} ${info.path}`)
|
|
46
|
+
},
|
|
47
|
+
onResponse: (info) => {
|
|
48
|
+
console.log(`Response: ${info.status}`)
|
|
49
|
+
},
|
|
50
|
+
onError: (error) => {
|
|
51
|
+
console.error('Tunnel error:', error)
|
|
52
|
+
},
|
|
53
|
+
onReconnecting: (attempt) => {
|
|
54
|
+
console.log(`Reconnecting... attempt ${attempt}`)
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// Access tunnel info
|
|
59
|
+
console.log(tunnel.url) // public URL
|
|
60
|
+
console.log(tunnel.subdomain) // assigned subdomain
|
|
61
|
+
|
|
62
|
+
// Close tunnel
|
|
63
|
+
tunnel.close()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Cloud Tunnel Deployment (AWS)
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { deployTunnelServer, destroyTunnelServer } from '@stacksjs/tunnel'
|
|
70
|
+
|
|
71
|
+
// Deploy custom tunnel server to EC2
|
|
72
|
+
await deployTunnelServer({
|
|
73
|
+
region: 'us-east-1',
|
|
74
|
+
instanceType: 't3.micro',
|
|
75
|
+
domain: 'tunnel.myapp.com'
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// Tear down
|
|
79
|
+
await destroyTunnelServer({
|
|
80
|
+
region: 'us-east-1'
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## CLI Command
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
buddy share # start tunnel for dev server
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## TunnelOptions Interface
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
interface TunnelOptions {
|
|
94
|
+
port: number // local port to tunnel
|
|
95
|
+
server?: string // tunnel relay server URL
|
|
96
|
+
subdomain?: string // requested subdomain
|
|
97
|
+
verbose?: boolean // debug output
|
|
98
|
+
timeout?: number // connection timeout (ms)
|
|
99
|
+
maxReconnectAttempts?: number // retry limit
|
|
100
|
+
|
|
101
|
+
onConnect?: (url: string) => void
|
|
102
|
+
onRequest?: (info: RequestInfo) => void
|
|
103
|
+
onResponse?: (info: ResponseInfo) => void
|
|
104
|
+
onError?: (error: Error) => void
|
|
105
|
+
onReconnecting?: (attempt: number) => void
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface LocalTunnel {
|
|
109
|
+
url: string // public tunnel URL
|
|
110
|
+
subdomain: string // assigned subdomain
|
|
111
|
+
client: TunnelClient // underlying client
|
|
112
|
+
close: () => void // close tunnel
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Gotchas
|
|
117
|
+
- Tunnels are for development only — not production use
|
|
118
|
+
- `createLocalTunnel()` is the simple version — returns just the URL
|
|
119
|
+
- `localTunnel()` is the full version with callbacks and control
|
|
120
|
+
- Cloud deployment creates an EC2 instance — incurs AWS costs
|
|
121
|
+
- Tunnel URLs are temporary — change between sessions unless subdomain is configured
|
|
122
|
+
- Ensure dev server is running before starting the tunnel
|
|
123
|
+
- `maxReconnectAttempts` prevents infinite reconnection loops
|
|
124
|
+
- The underlying tool is from ~/Code/Tools/localtunnels/
|
|
125
|
+
- `buddy share` wraps `createLocalTunnel()` for the configured dev port
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stacks-types
|
|
3
|
+
description: Use when working with TypeScript type definitions in a Stacks application — model types, request types, environment variables, event types, billing types, attribute types, or auto-imported globals. Covers storage/framework/types/ and storage/framework/core/types/src/.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
|
+
allowed-tools: Read Edit Write Bash Grep Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Stacks Types
|
|
10
|
+
|
|
11
|
+
## Key Paths
|
|
12
|
+
- Core types: `storage/framework/core/types/src/`
|
|
13
|
+
- Generated types: `storage/framework/types/`
|
|
14
|
+
- ORM globals: `storage/framework/types/orm-globals.d.ts`
|
|
15
|
+
- Environment: `storage/framework/types/env.d.ts`
|
|
16
|
+
- Actions: `storage/framework/types/actions.d.ts` (generated `ActionPath` union)
|
|
17
|
+
- Model traits: `storage/framework/types/traits.d.ts`
|
|
18
|
+
- Model attributes: `storage/framework/types/attributes.d.ts`
|
|
19
|
+
- Events: `storage/framework/types/events.ts`
|
|
20
|
+
- Attributes: `storage/framework/types/attributes.ts`
|
|
21
|
+
|
|
22
|
+
## Authentication Types (auth.ts)
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
interface AuthConfig {
|
|
26
|
+
default: string
|
|
27
|
+
guards: { [key: string]: { driver: 'session' | 'token', provider: string } }
|
|
28
|
+
providers: { [key: string]: { driver: 'database', table: string } }
|
|
29
|
+
username: string
|
|
30
|
+
password: string
|
|
31
|
+
tokenExpiry: number // 30 days
|
|
32
|
+
tokenRotation: number // 7 days
|
|
33
|
+
defaultAbilities: string[]
|
|
34
|
+
defaultTokenName: string
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## ORM Global Types (orm-globals.d.ts)
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
// Full database row — model attributes + system fields + FK columns
|
|
42
|
+
type ModelRow<T> = { id: number, uuid: string, created_at: string, updated_at: string } & ModelAttributes<T>
|
|
43
|
+
|
|
44
|
+
// Insertable data — all fields optional
|
|
45
|
+
type NewModelData<T> = Partial<ModelAttributes<T>>
|
|
46
|
+
|
|
47
|
+
// Updateable data — all fields optional
|
|
48
|
+
type UpdateModelData<T> = Partial<ModelAttributes<T>>
|
|
49
|
+
|
|
50
|
+
// Model-aware request — narrows field names to model's attributes
|
|
51
|
+
interface RequestInstance<TModel> {
|
|
52
|
+
get(key: keyof TModel): any
|
|
53
|
+
all(): TModel
|
|
54
|
+
validate(): Promise<void>
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Environment Types (env.d.ts)
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Application
|
|
62
|
+
APP_NAME, APP_ENV: 'local' | 'dev' | 'stage' | 'prod', APP_KEY, APP_URL, PORT, DEBUG
|
|
63
|
+
|
|
64
|
+
// Database
|
|
65
|
+
DB_CONNECTION: 'mysql' | 'sqlite' | 'postgres' | 'dynamodb'
|
|
66
|
+
DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD
|
|
67
|
+
|
|
68
|
+
// AWS
|
|
69
|
+
AWS_ACCOUNT_ID, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION
|
|
70
|
+
|
|
71
|
+
// Mail
|
|
72
|
+
MAIL_MAILER: 'smtp' | 'mailgun' | 'ses' | 'postmark' | 'sendmail' | 'log'
|
|
73
|
+
MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_FROM_NAME, MAIL_FROM_ADDRESS
|
|
74
|
+
|
|
75
|
+
// Search
|
|
76
|
+
SEARCH_ENGINE_DRIVER: 'meilisearch' | 'algolia' | 'typesense'
|
|
77
|
+
MEILISEARCH_HOST, MEILISEARCH_KEY
|
|
78
|
+
|
|
79
|
+
// Frontend
|
|
80
|
+
FRONTEND_APP_ENV: 'development' | 'staging' | 'production', FRONTEND_APP_URL
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Event Types (events.ts)
|
|
84
|
+
|
|
85
|
+
All model CRUD events: `model:created`, `model:updated`, `model:deleted`
|
|
86
|
+
|
|
87
|
+
- **Content**: author, post, page
|
|
88
|
+
- **Core**: user, activity, campaign, comment, email-list, notification, social-post, subscription, tag
|
|
89
|
+
- **Commerce (30+ models)**: cart, cart-item, category, coupon, customer, order, order-item, payment, product, product-variant, review, shipping-method, shipping-rate, tax-rate, transaction, gift-card, license-key, and more
|
|
90
|
+
|
|
91
|
+
All payloads are `Record<string, any>`.
|
|
92
|
+
|
|
93
|
+
## Billing Types (billing.ts)
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
interface TransactionHistory {
|
|
97
|
+
id?, uuid?, name, description?, amount, type, provider_id?, user_id?, paymentmethod_id?, created_at, updated_at?
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface PaymentMethod {
|
|
101
|
+
id?, uuid?, type, last_four, brand, exp_month, exp_year, is_default?, provider_id?, user_id?
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface Product {
|
|
105
|
+
id?, uuid?, name, key, unit_price?, status?, image?, provider_id?
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface Subscription {
|
|
109
|
+
id?, uuid?, type, provider_id, provider_status, provider_type, unit_price?, quantity?, trial_ends_at?, ends_at?, user_id?
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Attribute Types (attributes.ts)
|
|
114
|
+
|
|
115
|
+
200+ attribute definitions covering all models:
|
|
116
|
+
|
|
117
|
+
| Category | Fields |
|
|
118
|
+
|----------|--------|
|
|
119
|
+
| Basic | name, slug, description, title, subject, content, body |
|
|
120
|
+
| Dates | created_at, updated_at, published_at, scheduled_at, expires_at |
|
|
121
|
+
| Commerce | unit_price, price, amount, tax_amount, discount_amount, total, currency |
|
|
122
|
+
| User | email, password, phone, avatar, author_name, author_email |
|
|
123
|
+
| Shipping | delivery_address, delivery_fee, region, countries |
|
|
124
|
+
| Loyalty | loyalty_points_earned, loyalty_points_redeemed, points_required |
|
|
125
|
+
| Analytics | views, conversions, clicks, reach, likes, shares |
|
|
126
|
+
|
|
127
|
+
## Request Types (traits.d.ts)
|
|
128
|
+
|
|
129
|
+
Auto-generated per model:
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
interface PasskeysRequestType extends Request {
|
|
133
|
+
get(key: 'id' | 'cred_public_key' | 'user_id' | 'counter' | ...): any
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface CommentablesRequestType extends Request {
|
|
137
|
+
get(key: 'title' | 'body' | 'status' | 'commentables_id' | ...): any
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Auto-Imported Globals
|
|
142
|
+
|
|
143
|
+
### Framework Modules
|
|
144
|
+
`Action`, `response`, `route`, `Router`, `schema`, `validate`, `slug`, `camelCase`, `pascalCase`, `snakeCase`, `kebabCase`, `titleCase`, `path`, `storage`, `log`, `handleError`, `Auth`, `register`
|
|
145
|
+
|
|
146
|
+
### 60+ ORM Models (globally available)
|
|
147
|
+
User, Team, Post, Page, Author, Comment, Product, Order, Cart, Customer, Coupon, Category, Tag, Payment, Subscription, Driver, ShippingRate, GiftCard, LicenseKey, Job, FailedJob, Error, Log, Notification, and many more.
|
|
148
|
+
|
|
149
|
+
### stx components
|
|
150
|
+
Components under `resources/components/` are resolved by the stx plugin and used directly in templates (`<Card />`) - no import, no global registration step. Editor metadata is generated into `storage/framework/core/web-types.json` and `custom-elements.json` by `buddy generate:web-types` / `generate:custom-data`. There is no `components.d.ts`.
|
|
151
|
+
|
|
152
|
+
### Actions Type
|
|
153
|
+
```typescript
|
|
154
|
+
type ActionPath = 'Actions/LogAction' | 'Actions/HealthAction' | 'Actions/ExampleAction' | (string & {})
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## CLI Types (cli.ts)
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
interface CliOptions {
|
|
161
|
+
verbose?: boolean, silent?: boolean, quiet?: boolean
|
|
162
|
+
cwd?: string, background?: boolean, timeoutMs?: number, project?: string
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface CleanOptions extends CliOptions {}
|
|
166
|
+
interface CommitOptions extends CliOptions {}
|
|
167
|
+
interface FreshOptions extends CliOptions { dryRun?: boolean }
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Gotchas
|
|
171
|
+
- **Types are auto-generated** — many files in `storage/framework/types/` are generated from model definitions
|
|
172
|
+
- **ORM globals are truly global** — `ModelRow<T>`, `NewModelData<T>` available without imports
|
|
173
|
+
- **RequestInstance is model-aware** — `.get()` and `.all()` narrowed to model's fields when typed
|
|
174
|
+
- **Event payloads are untyped** — all `Record<string, any>`, not strongly typed per-model
|
|
175
|
+
- **Env types augment Bun.env** — `Bun.env.DB_CONNECTION` is typed
|
|
176
|
+
- **Attributes is a shared type** — 200+ fields covering ALL models, not per-model
|
|
177
|
+
- **Router types auto-generated** — 130+ typed route definitions, regenerated when routes change
|
|
178
|
+
- **Components.d.ts has 150+ entries** — globally registered, no imports needed
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stacks-ui
|
|
3
|
+
description: Use when working with UI in a Stacks application — components, composables, reactivity (refs/watch/computed), Craft native components, Crosswind CSS, Crosswind utility framework, accessibility, or the STX templating engine. Covers @stacksjs/ui, @stacksjs/stx, and related UI tooling.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
|
+
allowed-tools: Read Edit Write Bash Grep Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Stacks UI
|
|
10
|
+
|
|
11
|
+
## Design & anti-slop skills
|
|
12
|
+
|
|
13
|
+
For premium, non-templated UI (layout, typography, color, motion) built on stx + Crosswind, reach for the design-taste skill family:
|
|
14
|
+
- `stacks-design-taste` - flagship anti-slop frontend skill (brief inference, the three dials, layout/type/color discipline, strict pre-flight check)
|
|
15
|
+
- Aesthetic presets: `stacks-design-soft`, `stacks-design-minimalist`, `stacks-design-brutalist`
|
|
16
|
+
- `stacks-redesign` - audit-first upgrade of an existing UI; `stacks-design-output` - full-output enforcement (no placeholder or truncated components)
|
|
17
|
+
- Image-first: `stacks-image-to-code`, plus reference-image generators `stacks-imagegen-web`, `stacks-imagegen-mobile`, `stacks-brandkit`
|
|
18
|
+
|
|
19
|
+
## Key Paths
|
|
20
|
+
- Core package: `storage/framework/core/ui/src/`
|
|
21
|
+
- Components: `storage/framework/core/ui/src/components/`
|
|
22
|
+
- UI config: `config/ui.ts` (Crosswind)
|
|
23
|
+
- STX config: `config/ui.ts`
|
|
24
|
+
- STX engine: `node_modules/@stacksjs/stx/`
|
|
25
|
+
- Crosswind: `node_modules/@cwcss/crosswind/`
|
|
26
|
+
- Editor metadata: `storage/framework/core/web-types.json`, `storage/framework/core/custom-elements.json`
|
|
27
|
+
|
|
28
|
+
## Source Files
|
|
29
|
+
```
|
|
30
|
+
ui/src/
|
|
31
|
+
├── index.ts # Re-exports from @stacksjs/stx
|
|
32
|
+
├── components.ts # Component re-exports
|
|
33
|
+
└── components/
|
|
34
|
+
├── autocomplete.ts # Combobox, ComboboxInput, ComboboxOption, ComboboxOptions
|
|
35
|
+
├── disclosure.ts # Disclosure, DisclosureButton, DisclosurePanel
|
|
36
|
+
├── menu.ts # Menu, MenuButton, MenuItem, MenuItems
|
|
37
|
+
├── modal.ts # Dialog, DialogDescription, DialogPanel, DialogTitle
|
|
38
|
+
├── popover.ts # Popover, PopoverButton, PopoverPanel
|
|
39
|
+
├── radio-group.ts # RadioGroup, RadioGroupLabel, RadioGroupOption
|
|
40
|
+
├── select.ts # Combobox-based select
|
|
41
|
+
├── tabs.ts # Tab, TabGroup, TabList, TabPanel, TabPanels
|
|
42
|
+
├── toggle.ts # Switch
|
|
43
|
+
└── transition.ts # TransitionChild, TransitionRoot
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Headless Components
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { Combobox, ComboboxInput, ComboboxOption, ComboboxOptions } from '@stacksjs/ui'
|
|
50
|
+
import { Dialog, DialogDescription, DialogPanel, DialogTitle } from '@stacksjs/ui'
|
|
51
|
+
import { Menu, MenuButton, MenuItem, MenuItems } from '@stacksjs/ui'
|
|
52
|
+
import { Tab, TabGroup, TabList, TabPanel, TabPanels } from '@stacksjs/ui'
|
|
53
|
+
import { Switch } from '@stacksjs/ui'
|
|
54
|
+
import { TransitionChild, TransitionRoot } from '@stacksjs/ui'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Craft Native Components
|
|
58
|
+
|
|
59
|
+
Built-in components with native HTML fallbacks:
|
|
60
|
+
|
|
61
|
+
| Component | Fallback | Key Props |
|
|
62
|
+
|-----------|----------|-----------|
|
|
63
|
+
| `craft-button` | `<button>` | variant (primary/secondary/outline) |
|
|
64
|
+
| `craft-text-input` | `<input>` | placeholder, value, type, disabled |
|
|
65
|
+
| `craft-textarea` | `<textarea>` | placeholder, value, rows |
|
|
66
|
+
| `craft-checkbox` | `<input type="checkbox">` | checked, disabled, label |
|
|
67
|
+
| `craft-select` | `<select>` | value, options, placeholder |
|
|
68
|
+
| `craft-modal` | `<dialog>` | open, title, closable, size |
|
|
69
|
+
| `craft-tabs` | `<div>` | activeTab, tabs |
|
|
70
|
+
| `craft-table` | `<table>` | columns, rows, sortable, selectable |
|
|
71
|
+
| `craft-card` | `<div>` | title, subtitle, variant |
|
|
72
|
+
| `craft-alert` | `<div>` | variant, title, dismissible |
|
|
73
|
+
| `craft-toast` | `<div>` | variant, duration, position |
|
|
74
|
+
| `craft-tooltip` | `<span>` | content, position |
|
|
75
|
+
| `craft-pagination` | `<nav>` | total, page, pageSize |
|
|
76
|
+
| `craft-code-editor` | `<textarea>` | value, language, theme, lineNumbers |
|
|
77
|
+
| `craft-date-picker` | `<input type="date">` | value, min, max, format |
|
|
78
|
+
| `craft-color-picker` | `<input type="color">` | value, format |
|
|
79
|
+
| `craft-badge` | `<span>` | variant, size |
|
|
80
|
+
| `craft-avatar` | `<div>` | src, alt, size, fallback |
|
|
81
|
+
| `craft-progress` | `<div>` | value, max, variant |
|
|
82
|
+
| `craft-spinner` | `<div>` | size |
|
|
83
|
+
| `craft-accordion` | `<details>` | open, title |
|
|
84
|
+
| `craft-divider` | `<hr>` | orientation, variant |
|
|
85
|
+
| `craft-breadcrumb` | `<nav>` | items, separator |
|
|
86
|
+
| `craft-menu` | `<nav>` | items, orientation |
|
|
87
|
+
| `craft-tree` | `<div>` | nodes, expandable, selectable |
|
|
88
|
+
| `craft-list` | `<ul>` | items, selectable |
|
|
89
|
+
| `craft-slider` | `<input type="range">` | value, min, max, step |
|
|
90
|
+
| `craft-radio` | `<input type="radio">` | checked, name, value, label |
|
|
91
|
+
| `craft-file-browser` | `<div>` | path, showHidden, selectable |
|
|
92
|
+
|
|
93
|
+
## Reactivity System
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { ref, namedRef, computed, watch } from '@stacksjs/stx'
|
|
97
|
+
|
|
98
|
+
const count = ref(0)
|
|
99
|
+
count.value = 5
|
|
100
|
+
|
|
101
|
+
const doubled = computed(() => count.value * 2)
|
|
102
|
+
|
|
103
|
+
const stop = watch(
|
|
104
|
+
() => count.value,
|
|
105
|
+
(newVal, oldVal) => console.log(`${oldVal} → ${newVal}`),
|
|
106
|
+
{ immediate: false }
|
|
107
|
+
)
|
|
108
|
+
stop() // cleanup
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Types
|
|
112
|
+
```typescript
|
|
113
|
+
interface Ref<T> { value: T | null, readonly current: T | null }
|
|
114
|
+
|
|
115
|
+
interface ComponentInstance {
|
|
116
|
+
id: string, element: Element | null
|
|
117
|
+
mountHooks: LifecycleHook[], destroyHooks: CleanupFn[], updateHooks: LifecycleHook[]
|
|
118
|
+
refs: Map<string, Ref<any>>, watchers: Array<{ stop: () => void }>
|
|
119
|
+
isMounted: boolean
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Lifecycle Hooks
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { onMount, onDestroy, onUpdate } from '@stacksjs/stx'
|
|
127
|
+
// Aliases: onMounted, onUnmounted, onUpdated
|
|
128
|
+
|
|
129
|
+
onMount(() => {
|
|
130
|
+
console.log('mounted')
|
|
131
|
+
return () => console.log('cleanup') // optional
|
|
132
|
+
})
|
|
133
|
+
onDestroy(() => console.log('destroyed'))
|
|
134
|
+
onUpdate(() => console.log('updated'))
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Dependency Injection
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { provide, inject, createInjectionKey, withInjectionScope } from '@stacksjs/stx'
|
|
141
|
+
|
|
142
|
+
const ThemeKey = createInjectionKey<string>('theme')
|
|
143
|
+
provide(ThemeKey, 'dark')
|
|
144
|
+
const theme = inject(ThemeKey) // 'dark'
|
|
145
|
+
const theme = inject(ThemeKey, 'light') // with default
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Browser Composables
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import {
|
|
152
|
+
useLocalStorage, useSessionStorage, useEventListener,
|
|
153
|
+
useClickOutside, useWindowSize, useMediaQuery,
|
|
154
|
+
usePrefersDark, useOnline
|
|
155
|
+
} from '@stacksjs/stx'
|
|
156
|
+
|
|
157
|
+
const { value, remove } = useLocalStorage('key', defaultValue)
|
|
158
|
+
const { width, height } = useWindowSize()
|
|
159
|
+
const isDark = usePrefersDark()
|
|
160
|
+
const isOnline = useOnline()
|
|
161
|
+
const cleanup = useClickOutside(elementRef, handler)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Crosswind Configuration (config/ui.ts)
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
export default {
|
|
168
|
+
content: [
|
|
169
|
+
'./resources/**/*.{html,js,ts,jsx,tsx,stx}',
|
|
170
|
+
'./storage/framework/defaults/**/*.{html,js,ts,jsx,tsx,stx}',
|
|
171
|
+
'./storage/framework/views/**/*.{html,js,ts,jsx,tsx,stx}',
|
|
172
|
+
],
|
|
173
|
+
output: './storage/framework/assets/headwind.css',
|
|
174
|
+
minify: false,
|
|
175
|
+
} satisfies CrosswindOptions
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## STX Configuration (config/ui.ts)
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
export default {
|
|
182
|
+
componentsDir: 'resources/components',
|
|
183
|
+
layoutsDir: 'resources/layouts',
|
|
184
|
+
partialsDir: 'resources/partials',
|
|
185
|
+
} satisfies StxOptions
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Full StxConfig
|
|
189
|
+
```typescript
|
|
190
|
+
interface StxConfig {
|
|
191
|
+
enabled: boolean, debug: boolean
|
|
192
|
+
templatesDir?, componentsDir, partialsDir, layoutsDir?, defaultLayout?
|
|
193
|
+
ssr?: boolean, cache?: boolean, cachePath: string
|
|
194
|
+
i18n?: Partial<I18nConfig>
|
|
195
|
+
webComponents?: Partial<WebComponentConfig>
|
|
196
|
+
streaming?: Partial<StreamingConfig>
|
|
197
|
+
hydration?: Partial<HydrationConfig>
|
|
198
|
+
a11y?: Partial<A11yConfig>
|
|
199
|
+
seo?: Partial<SeoFeatureConfig>
|
|
200
|
+
animation?: Partial<AnimationConfig>
|
|
201
|
+
markdown?: Partial<MarkdownConfig>
|
|
202
|
+
pwa?: Partial<PwaConfig>
|
|
203
|
+
strict?: boolean | StrictModeConfig
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Accessibility
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
import { checkA11y, autoFixA11y, scanA11yIssues } from '@stacksjs/stx'
|
|
211
|
+
|
|
212
|
+
const violations = await checkA11y(html, filePath)
|
|
213
|
+
const result = autoFixA11y(html, config)
|
|
214
|
+
const issues = await scanA11yIssues('./resources', { recursive: true })
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
interface A11yConfig {
|
|
219
|
+
enabled: boolean, addSrOnlyStyles: boolean
|
|
220
|
+
level: 'AA' | 'AAA', ignoreChecks?: string[], autoFix: boolean
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Crosswind CSS Framework
|
|
225
|
+
|
|
226
|
+
Utility-first CSS (like Tailwind), built into Stacks:
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
import { buildCrosswindCSS, extractClassNames, generateCrosswindCSS } from '@stacksjs/stx'
|
|
230
|
+
|
|
231
|
+
const css = await buildCrosswindCSS(cwd)
|
|
232
|
+
const classNames = extractClassNames(htmlContent)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Features: theme config, 40+ variant modifiers, custom rules, shortcuts, attributify mode, bracket syntax, presets.
|
|
236
|
+
|
|
237
|
+
## Gotchas
|
|
238
|
+
- **@stacksjs/ui re-exports from @stacksjs/stx** — the UI package is thin, the engine is in STX
|
|
239
|
+
- **Craft components use native fallbacks** — `preferNative: true` renders plain HTML
|
|
240
|
+
- **Refs are not Vue refs** — similar API but custom reactive implementation
|
|
241
|
+
- **Lifecycle hooks require component context** — must be called within `setupComponent()`
|
|
242
|
+
- **Crosswind is not Tailwind** — Stacks' own CSS utility implementation
|
|
243
|
+
- **Crosswind is the utility engine** — handles class extraction, CSS generation, purging
|
|
244
|
+
- **STX is the templating engine** — handles `.stx` files, SSR, streaming, hydration
|
|
245
|
+
- **Two CSS systems coexist** — Crosswind (config) and Crosswind (engine)
|
|
246
|
+
- **150+ globally registered Vue components** — no imports needed
|