@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,444 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stacks-utils
|
|
3
|
+
description: Use when needing general utility functions in Stacks — deep merge, debounce/throttle, color output, byte formatting, markdown tables, YAML parsing, Pipeline class, ResizeObserver, Macroable, project initialization, indentation detection, or the comprehensive utility toolkit. Covers @stacksjs/utils.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
|
+
allowed-tools: Read Edit Write Bash Grep Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Stacks Utilities
|
|
10
|
+
|
|
11
|
+
Umbrella package providing utility functions plus re-exports from specialized packages.
|
|
12
|
+
|
|
13
|
+
## Key Paths
|
|
14
|
+
- Core package: `storage/framework/core/utils/src/`
|
|
15
|
+
- Package: `@stacksjs/utils`
|
|
16
|
+
|
|
17
|
+
## Architecture
|
|
18
|
+
|
|
19
|
+
The `index.ts` re-exports from these local modules:
|
|
20
|
+
- `clean.ts` — project cleanup (`cleanProject()`)
|
|
21
|
+
- `config.ts` — config builder re-exports from `@stacksjs/config`
|
|
22
|
+
- `equal.ts` — deep equality
|
|
23
|
+
- `export-size.ts` — re-exports from `size.ts`
|
|
24
|
+
- `find.ts` — find Stacks projects on filesystem
|
|
25
|
+
- `git.ts` — git status check
|
|
26
|
+
- `hash.ts` — path hashing for cloud deploy
|
|
27
|
+
- `helpers.ts` — project helpers (env, YAML, version, npm scripts, etc.)
|
|
28
|
+
- `macroable.ts` — dynamic method registration on classes
|
|
29
|
+
- `versions.ts` — semver comparison via `Bun.semver`
|
|
30
|
+
- `merge.ts` — deep object merge (defu replacement)
|
|
31
|
+
- `detect.ts` — indentation and newline detection
|
|
32
|
+
- `debounce.ts` — debounce, throttle, delay
|
|
33
|
+
- `bytes.ts` — byte formatting and parsing
|
|
34
|
+
- `colors.ts` — ANSI terminal color output
|
|
35
|
+
- `markdown.ts` — markdown table generation
|
|
36
|
+
- `size.ts` — file/export size calculation
|
|
37
|
+
- `observer.ts` — ResizeObserver polyfill
|
|
38
|
+
- `pipeline.ts` — Pipeline class for data transformation chains
|
|
39
|
+
|
|
40
|
+
Also re-exports from `@stacksjs/browser`:
|
|
41
|
+
```typescript
|
|
42
|
+
export * as browserUtils from '@stacksjs/browser'
|
|
43
|
+
export { clamp, notNullish, retry, useOnline } from '@stacksjs/browser'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Deep Merge (`merge.ts`)
|
|
47
|
+
|
|
48
|
+
Replacement for `defu`. Arrays are concatenated, objects are recursively merged, special objects (Date, RegExp, Error, Promise, Map, Set, WeakMap, WeakSet, ArrayBuffer views) are NOT deeply merged.
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { merge, mergeDefaults, createMerger, defu } from '@stacksjs/utils'
|
|
52
|
+
|
|
53
|
+
merge({ a: 1 }, { b: 2 }) // { a: 1, b: 2 }
|
|
54
|
+
merge({ a: [1] }, { a: [2] }) // { a: [1, 2] } -- arrays concatenated
|
|
55
|
+
merge({ a: { x: 1 } }, { a: { y: 2 } }) // { a: { x: 1, y: 2 } } -- objects merged
|
|
56
|
+
|
|
57
|
+
mergeDefaults(obj, defaults1, defaults2) // merge defaults first, obj wins
|
|
58
|
+
const merger = createMerger(defaults) // reusable merger function
|
|
59
|
+
defu(obj, defaults1, defaults2) // alias for mergeDefaults
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Key behavior: `undefined` values in source objects are skipped. Later arguments take precedence in `merge()`, but the first argument takes precedence in `mergeDefaults()`/`defu()`.
|
|
63
|
+
|
|
64
|
+
## Debounce & Throttle (`debounce.ts`)
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
interface DebounceOptions {
|
|
68
|
+
leading?: boolean // default: false
|
|
69
|
+
trailing?: boolean // default: true
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const debouncedFn = debounce(fn, 300, { leading: false, trailing: true })
|
|
73
|
+
debouncedFn.cancel() // cancel pending invocation
|
|
74
|
+
debouncedFn.flush() // immediately invoke pending, returns result
|
|
75
|
+
|
|
76
|
+
const throttledFn = throttle(fn, 100)
|
|
77
|
+
throttledFn.cancel() // cancel pending invocation
|
|
78
|
+
|
|
79
|
+
await delay(1000) // sleep for 1 second (returns Promise<void>)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Note: unlike some implementations, this debounce does NOT support `maxWait`. The throttle uses `Date.now()` for timing, not setTimeout stacking.
|
|
83
|
+
|
|
84
|
+
## Color Output (`colors.ts`)
|
|
85
|
+
|
|
86
|
+
ANSI terminal color library. Auto-detects support via `process.env.NO_COLOR`, `process.env.FORCE_COLOR`, and `process.stdout.isTTY`.
|
|
87
|
+
|
|
88
|
+
### Text Colors
|
|
89
|
+
```typescript
|
|
90
|
+
black('text'), red('text'), green('text'), yellow('text')
|
|
91
|
+
blue('text'), magenta('text'), cyan('text'), white('text')
|
|
92
|
+
gray('text'), grey('text') // grey is alias for gray
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Bright Text Colors
|
|
96
|
+
```typescript
|
|
97
|
+
lightRed('text'), lightGreen('text'), lightYellow('text'), lightBlue('text')
|
|
98
|
+
lightMagenta('text'), lightCyan('text'), lightGray('text'), lightGrey('text')
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Background Colors
|
|
102
|
+
```typescript
|
|
103
|
+
bgBlack('text'), bgRed('text'), bgGreen('text'), bgYellow('text')
|
|
104
|
+
bgBlue('text'), bgMagenta('text'), bgCyan('text'), bgWhite('text')
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Bright Background Colors
|
|
108
|
+
```typescript
|
|
109
|
+
bgLightRed('text'), bgLightGreen('text'), bgLightYellow('text'), bgLightBlue('text')
|
|
110
|
+
bgLightMagenta('text'), bgLightCyan('text')
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Text Formatting
|
|
114
|
+
```typescript
|
|
115
|
+
bold('text'), dim('text'), italic('text'), underline('text')
|
|
116
|
+
inverse('text'), hidden('text'), strikethrough('text'), reset('text')
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Utilities
|
|
120
|
+
```typescript
|
|
121
|
+
stripColors(coloredText) // remove all ANSI escape codes
|
|
122
|
+
supportsColor() // boolean -- is color output supported?
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
All color functions accept `string | number` and return `string`. When colors are unsupported, they return `String(text)` unchanged.
|
|
126
|
+
|
|
127
|
+
## Byte Formatting (`bytes.ts`)
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
interface BytesOptions {
|
|
131
|
+
precision?: number // default: 1
|
|
132
|
+
binary?: boolean // use KiB/MiB/GiB (default: false, uses KB/MB/GB)
|
|
133
|
+
space?: boolean // space between number and unit (default: true)
|
|
134
|
+
locale?: string // number formatting locale (default: 'en-US')
|
|
135
|
+
minimumFractionDigits?: number // default: 0
|
|
136
|
+
maximumFractionDigits?: number // default: precision
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
formatBytes(1024) // '1 KB'
|
|
140
|
+
formatBytes(1024, { binary: true }) // '1 KiB'
|
|
141
|
+
formatBytes(1234567, { precision: 2 }) // '1.23 MB'
|
|
142
|
+
formatBytes(-1024) // '-1 KB'
|
|
143
|
+
formatBytes(0.5) // '0.5 B'
|
|
144
|
+
|
|
145
|
+
parseBytes('1 KB') // 1000
|
|
146
|
+
parseBytes('1 KiB') // 1024
|
|
147
|
+
parseBytes('1.5 MB') // 1500000
|
|
148
|
+
|
|
149
|
+
compareBytes('1 MB', '1 GB') // negative number (a < b)
|
|
150
|
+
compareBytes(1024, '1 KB') // 24 (a > b)
|
|
151
|
+
|
|
152
|
+
// Aliases
|
|
153
|
+
prettyBytes(1024) // alias for formatBytes
|
|
154
|
+
readableSize(1024) // alias for formatBytes
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Units: B, KB, MB, GB, TB, PB, EB, ZB, YB (decimal) or B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB (binary).
|
|
158
|
+
|
|
159
|
+
## Export Size Calculation (`size.ts`)
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
interface ExportSize {
|
|
163
|
+
name: string // relative path
|
|
164
|
+
size: number // bytes
|
|
165
|
+
readable: string // human-readable
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface PackageExportsSizeResult {
|
|
169
|
+
totalSize: number
|
|
170
|
+
totalReadable: string
|
|
171
|
+
exports: ExportSize[] // sorted by size descending
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
await getFileSize('/path/to/file') // number (bytes), returns 0 on error
|
|
175
|
+
const result = await getExportsSize('./dist') // PackageExportsSizeResult
|
|
176
|
+
estimateGzipSize(size) // Math.floor(size * 0.3)
|
|
177
|
+
estimateBrotliSize(size) // Math.floor(size * 0.25)
|
|
178
|
+
formatExportSizes(result) // formatted multi-line string with table
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`getExportsSize` scans a directory for `.js`, `.mjs`, `.cjs` files and calculates their sizes.
|
|
182
|
+
|
|
183
|
+
## Pipeline (`pipeline.ts`)
|
|
184
|
+
|
|
185
|
+
Laravel-inspired pipeline for chaining data transformations.
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
type PipeFunction<T> = (data: T, next: (data: T) => T) => T
|
|
189
|
+
interface PipeClass<T> { handle: PipeFunction<T> }
|
|
190
|
+
|
|
191
|
+
// Array-based chaining
|
|
192
|
+
const result = Pipeline.send(data)
|
|
193
|
+
.through([transform1, transform2, transform3])
|
|
194
|
+
.via('process') // method name on pipe classes (default: 'handle')
|
|
195
|
+
.then((data) => data) // final transformation
|
|
196
|
+
|
|
197
|
+
// Fluent pipe chaining
|
|
198
|
+
const result2 = Pipeline.send(data)
|
|
199
|
+
.pipe(fn1)
|
|
200
|
+
.pipe(fn2)
|
|
201
|
+
.thenReturn() // returns data as-is after pipeline
|
|
202
|
+
|
|
203
|
+
// Pipes can be functions or objects with a handle/via method
|
|
204
|
+
Pipeline.send('hello')
|
|
205
|
+
.through([
|
|
206
|
+
(data, next) => next(data.toUpperCase()),
|
|
207
|
+
(data, next) => next(data + '!'),
|
|
208
|
+
])
|
|
209
|
+
.then(data => data) // 'HELLO!'
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Internally uses `reduceRight` so pipes execute in order (first pipe wraps outermost).
|
|
213
|
+
|
|
214
|
+
## Markdown Tables (`markdown.ts`)
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
interface MarkdownTableOptions {
|
|
218
|
+
align?: Array<'l' | 'c' | 'r' | 'left' | 'center' | 'right' | null>
|
|
219
|
+
padding?: boolean // default: true
|
|
220
|
+
delimiter?: string // default: '|'
|
|
221
|
+
delimiterStart?: boolean // default: true
|
|
222
|
+
delimiterEnd?: boolean // default: true
|
|
223
|
+
alignDelimiter?: string // default: '-'
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
markdownTable([
|
|
227
|
+
['Name', 'Age', 'City'],
|
|
228
|
+
['Alice', '30', 'NYC'],
|
|
229
|
+
['Bob', '25', 'LA']
|
|
230
|
+
])
|
|
231
|
+
// | Name | Age | City |
|
|
232
|
+
// | ----- | --- | ---- |
|
|
233
|
+
// | Alice | 30 | NYC |
|
|
234
|
+
// | Bob | 25 | LA |
|
|
235
|
+
|
|
236
|
+
markdownTable([['Left', 'Center', 'Right'], ['a', 'b', 'c']], { align: ['l', 'c', 'r'] })
|
|
237
|
+
// Uses :--- for left, :---: for center, ---: for right
|
|
238
|
+
|
|
239
|
+
markdownTableFromObjects([
|
|
240
|
+
{ name: 'Alice', age: 30 },
|
|
241
|
+
{ name: 'Bob', age: 25 }
|
|
242
|
+
])
|
|
243
|
+
// Auto-generates header from object keys
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Cell values can be `string | number | boolean | null | undefined` -- all are converted to strings.
|
|
247
|
+
|
|
248
|
+
## YAML (`helpers.ts`)
|
|
249
|
+
|
|
250
|
+
Uses `Bun.YAML` natively:
|
|
251
|
+
```typescript
|
|
252
|
+
parseYaml(yamlString) // Bun.YAML.parse(content)
|
|
253
|
+
loadYaml(content) // alias for parseYaml
|
|
254
|
+
dumpYaml(object) // Bun.YAML.stringify(content), falls back to JSON.stringify
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Macroable (`macroable.ts`)
|
|
258
|
+
|
|
259
|
+
Laravel-inspired dynamic method registration on classes.
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
import { Macroable, createMacroable, macroable } from '@stacksjs/utils'
|
|
263
|
+
|
|
264
|
+
// Option 1: Extend Macroable
|
|
265
|
+
class MyClass extends Macroable {}
|
|
266
|
+
|
|
267
|
+
MyClass.macro('greet', function() { return 'Hello!' })
|
|
268
|
+
const instance = new MyClass()
|
|
269
|
+
;(instance as any).greet() // 'Hello!'
|
|
270
|
+
|
|
271
|
+
MyClass.hasMacro('greet') // true
|
|
272
|
+
MyClass.getMacros() // ['greet']
|
|
273
|
+
MyClass.flushMacros() // remove all macros
|
|
274
|
+
|
|
275
|
+
// Mixin multiple methods from an object
|
|
276
|
+
MyClass.mixin({ hello() { return 'hi' }, bye() { return 'bye' } })
|
|
277
|
+
// replace parameter (default: true for mixin, false for macro)
|
|
278
|
+
MyClass.macro('greet', newFn, true) // replace existing
|
|
279
|
+
|
|
280
|
+
// Option 2: Create macroable from existing class
|
|
281
|
+
const MacroClass = createMacroable(BaseClass)
|
|
282
|
+
|
|
283
|
+
// Option 3: Add macroable functionality to existing class
|
|
284
|
+
const Enhanced = macroable(ExistingClass)
|
|
285
|
+
Enhanced.macro('newMethod', fn)
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Static methods: `macro(name, fn, replace?)`, `mixin(obj, replace?)`, `hasMacro(name)`, `flushMacros()`, `getMacros()`.
|
|
289
|
+
|
|
290
|
+
## ResizeObserver (`observer.ts`)
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
isResizeObserverSupported() // boolean
|
|
294
|
+
const RO = getResizeObserver() // native or polyfill class
|
|
295
|
+
|
|
296
|
+
const cleanup = createResizeObserver(callback, element)
|
|
297
|
+
const cleanup2 = createResizeObserver(callback, [el1, el2]) // multiple elements
|
|
298
|
+
cleanup() // disconnect observer
|
|
299
|
+
|
|
300
|
+
const stop = observeElementSize(element, (entry) => {
|
|
301
|
+
console.log(entry.contentRect.width, entry.contentRect.height)
|
|
302
|
+
})
|
|
303
|
+
stop() // stop observing
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
The polyfill uses `requestAnimationFrame` (or `setTimeout` fallback) to poll element sizes via `getBoundingClientRect()`.
|
|
307
|
+
|
|
308
|
+
## Deep Equality (`equal.ts`)
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
isDeepEqual(obj1, obj2) // deep structural equality
|
|
312
|
+
isDeepEqual([1, 2], [1, 2]) // true
|
|
313
|
+
isDeepEqual({ a: 1 }, { a: 1 }) // true
|
|
314
|
+
isDeepEqual(NaN, NaN) // true (uses Object.is)
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Compares arrays element-by-element, objects key-by-key, primitives with `Object.is`.
|
|
318
|
+
|
|
319
|
+
## Version Comparison (`versions.ts`)
|
|
320
|
+
|
|
321
|
+
Uses `Bun.semver` natively:
|
|
322
|
+
```typescript
|
|
323
|
+
const semver: typeof Bun.semver = Bun.semver
|
|
324
|
+
|
|
325
|
+
isVersionGreaterThan('2.0.0', '1.0.0') // true
|
|
326
|
+
isVersionLessThan('1.0.0', '2.0.0') // true
|
|
327
|
+
isVersionEqual('1.0.0', '1.0.0') // true
|
|
328
|
+
isVersionGreaterThanOrEqual('1.0.0', '1.0.0') // true
|
|
329
|
+
isVersionLessThanOrEqual('1.0.0', '2.0.0') // true
|
|
330
|
+
|
|
331
|
+
// Also exports the framework version
|
|
332
|
+
import { version } from '@stacksjs/utils' // from package.json
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Detection Utilities (`detect.ts`)
|
|
336
|
+
|
|
337
|
+
Separate from the strings package detection -- this is the utils-specific implementation:
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
interface IndentInfo {
|
|
341
|
+
amount: number
|
|
342
|
+
type: 'space' | 'tab' | null
|
|
343
|
+
indent: string
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
detectIndent(text: string): IndentInfo
|
|
347
|
+
detectNewline(text: string): '\r\n' | '\n' | '\r' | null
|
|
348
|
+
detectNewlineGraceful(text, fallback?): '\r\n' | '\n' | '\r' // fallback default: '\n'
|
|
349
|
+
normalizeNewlines(text, '\n'): string // replace all newlines with specified type
|
|
350
|
+
countNewlines(text): { crlf, lf, cr, total }
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## Project Utilities (`helpers.ts`)
|
|
354
|
+
|
|
355
|
+
```typescript
|
|
356
|
+
await packageManager() // reads from framework package.json
|
|
357
|
+
await frameworkVersion() // reads version from framework package.json
|
|
358
|
+
await isAppKeySet() // checks .env for APP_KEY with length > 16
|
|
359
|
+
await initProject() // generates application key via Action.KeyGenerate
|
|
360
|
+
await ensureProjectIsInitialized() // copies .env.example if needed, checks app key
|
|
361
|
+
await installIfVersionMismatch() // currently a no-op (placeholder)
|
|
362
|
+
await setEnvValue('KEY', 'value') // set/update value in .env file
|
|
363
|
+
await runNpmScript('build', options?) // run npm script via bun, validates script exists
|
|
364
|
+
hasScript(manifest, 'test') // check if script exists in package.json manifest
|
|
365
|
+
determineDebugLevel(options?) // returns true if --verbose or app.debug === true
|
|
366
|
+
determineResetPreset(preset?) // returns CSS reset import array for UnoCSS
|
|
367
|
+
isManifest(obj) // type guard for package.json manifest
|
|
368
|
+
isOptionalString(value) // type guard for string | null | undefined
|
|
369
|
+
isIpv6(address) // check if AddressInfo is IPv6 (handles node >=18 quirks)
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Find Stacks Projects (`find.ts`)
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
await findStacksProjects(dir?, options?) // recursively search for Stacks projects
|
|
376
|
+
// A Stacks project = directory with 'buddy' file + 'storage/framework/core/buddy' structure
|
|
377
|
+
// Excludes: node_modules, dist, vendor, storage/framework, ~/Documents, ~/Pictures, ~/Library, ~/.Trash, dotfolders
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Git Utilities (`git.ts`)
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
isGitClean(): boolean // runs `git diff-index --quiet HEAD --`, returns true if clean
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
## Clean Project (`clean.ts`)
|
|
387
|
+
|
|
388
|
+
```typescript
|
|
389
|
+
await cleanProject() // removes bun.lock, yarn.lock, node_modules, dist, cdk.out, etc.
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## Config Builders (re-exported from `@stacksjs/config`)
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
defineApp()
|
|
396
|
+
defineCache()
|
|
397
|
+
defineCdn()
|
|
398
|
+
defineChat()
|
|
399
|
+
defineCli()
|
|
400
|
+
defineDatabase()
|
|
401
|
+
defineDependencies()
|
|
402
|
+
defineDns()
|
|
403
|
+
defineEmail()
|
|
404
|
+
defineEmailConfig()
|
|
405
|
+
defineGit()
|
|
406
|
+
defineHashing()
|
|
407
|
+
defineLibrary()
|
|
408
|
+
defineNotification()
|
|
409
|
+
definePayment()
|
|
410
|
+
defineQueue()
|
|
411
|
+
defineSearchEngine()
|
|
412
|
+
defineServices()
|
|
413
|
+
defineSms()
|
|
414
|
+
defineFilesystems()
|
|
415
|
+
defineUi()
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
## Hash Utilities (`hash.ts`)
|
|
419
|
+
|
|
420
|
+
Internal cloud deployment helpers:
|
|
421
|
+
```typescript
|
|
422
|
+
originRequestFunctionHash() // hash of cloud edge function source
|
|
423
|
+
websiteSourceHash() // hash of website/docs source (depends on docMode config)
|
|
424
|
+
docsSourceHash() // hash of docs source
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## Glob (re-export)
|
|
428
|
+
|
|
429
|
+
```typescript
|
|
430
|
+
export { glob } from '@stacksjs/storage'
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## Gotchas
|
|
434
|
+
- `merge()` concatenates arrays instead of replacing them -- this differs from spread/Object.assign behavior
|
|
435
|
+
- `mergeDefaults()`/`defu()` gives precedence to the FIRST argument (the object), not the defaults
|
|
436
|
+
- Color functions only work in terminal environments -- check `supportsColor()` first
|
|
437
|
+
- `debounce` does NOT support `maxWait` -- use throttle if you need guaranteed maximum delay
|
|
438
|
+
- `throttle.cancel()` exists but there is no `throttle.flush()`
|
|
439
|
+
- Pipeline uses `reduceRight` internally so pipes execute in array order, not reverse
|
|
440
|
+
- YAML operations use `Bun.YAML` -- `dumpYaml` falls back to `JSON.stringify` if `Bun.YAML.stringify` is unavailable
|
|
441
|
+
- `detectIndent` in utils (`detect.ts`) is a different, simpler implementation than the one in strings (`detect-indent.ts`)
|
|
442
|
+
- `isDeepEqual` uses `getTypeName` from `@stacksjs/types` for type checking
|
|
443
|
+
- Version comparison uses `Bun.semver.order()` which returns -1, 0, or 1
|
|
444
|
+
- `cleanProject()` uses `Bun.$` shell -- destructive operation that removes lock files, node_modules, and dist
|