@wrikka/solid-framework 0.0.0-stage → 0.15.0
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/README.md +104 -3
- package/dist/vite.d.ts +661 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +10 -0
- package/dist/vite.js.map +1 -0
- package/package.json +247 -5
- package/src/actions/index.ts +5 -0
- package/src/actions/modules/action/adapters/http/handler.ts +80 -0
- package/src/actions/modules/action/application/index.ts +1 -0
- package/src/actions/modules/action/application/usecases/create-action.ts +92 -0
- package/src/actions/modules/action/application/usecases/index.ts +2 -0
- package/src/actions/modules/action/application/usecases/registry.ts +20 -0
- package/src/actions/modules/action/index.ts +2 -0
- package/src/actions/presentation/index.ts +1 -0
- package/src/actions/presentation/useSubmission.ts +46 -0
- package/src/actions/types/index.ts +35 -0
- package/src/app/index.ts +126 -0
- package/src/app/modules/ai/domain/operations/handler.ts +46 -0
- package/src/app/modules/ai/domain/operations/llms.ts +54 -0
- package/src/app/modules/ai/domain/operations/mcp.ts +134 -0
- package/src/app/modules/ai/index.ts +3 -0
- package/src/app/modules/api-docs/domain/operations/openapi.ts +113 -0
- package/src/app/modules/api-docs/index.ts +1 -0
- package/src/app/modules/app-def/index.ts +225 -0
- package/src/app/modules/auth/application/usecases/auth.ts +161 -0
- package/src/app/modules/auth/application/usecases/oauth.ts +105 -0
- package/src/app/modules/auth/index.ts +2 -0
- package/src/app/modules/cache/adapters/edge-kv.ts +55 -0
- package/src/app/modules/cache/adapters/fs.ts +58 -0
- package/src/app/modules/cache/adapters/memory.ts +13 -0
- package/src/app/modules/cache/domain/operations/tags.ts +114 -0
- package/src/app/modules/cache/index.ts +7 -0
- package/src/app/modules/cache/ports/store.ts +14 -0
- package/src/app/modules/config/domain/index.ts +1 -0
- package/src/app/modules/config/domain/models/config.ts +72 -0
- package/src/app/modules/config/domain/models/index.ts +1 -0
- package/src/app/modules/config/index.ts +1 -0
- package/src/app/modules/content/domain/operations/collection.ts +109 -0
- package/src/app/modules/content/index.ts +8 -0
- package/src/app/modules/content/presentation/Markdown.tsx +78 -0
- package/src/app/modules/conventions/domain/index.ts +1 -0
- package/src/app/modules/conventions/domain/operations/index.ts +1 -0
- package/src/app/modules/conventions/domain/operations/scan.ts +73 -0
- package/src/app/modules/conventions/index.ts +1 -0
- package/src/app/modules/db/application/usecases/db.ts +49 -0
- package/src/app/modules/db/index.ts +1 -0
- package/src/app/modules/deploy/adapters/aws-lambda.ts +54 -0
- package/src/app/modules/deploy/adapters/bun.ts +15 -0
- package/src/app/modules/deploy/adapters/cloudflare.ts +15 -0
- package/src/app/modules/deploy/adapters/deno.ts +15 -0
- package/src/app/modules/deploy/adapters/netlify.ts +18 -0
- package/src/app/modules/deploy/adapters/node.ts +63 -0
- package/src/app/modules/deploy/adapters/vercel.ts +22 -0
- package/src/app/modules/deploy/domain/models/preset.ts +38 -0
- package/src/app/modules/deploy/domain/operations/presets.ts +92 -0
- package/src/app/modules/deploy/index.ts +9 -0
- package/src/app/modules/draft/domain/operations/draft-mode.ts +125 -0
- package/src/app/modules/draft/index.ts +1 -0
- package/src/app/modules/env/domain/operations/create-env.ts +156 -0
- package/src/app/modules/env/index.ts +1 -0
- package/src/app/modules/file-routes/application/usecases/api-client.ts +120 -0
- package/src/app/modules/file-routes/domain/errors.ts +61 -0
- package/src/app/modules/file-routes/domain/index.ts +63 -0
- package/src/app/modules/file-routes/domain/models/index.ts +1 -0
- package/src/app/modules/file-routes/domain/models/route.ts +38 -0
- package/src/app/modules/file-routes/domain/operations/actions.ts +107 -0
- package/src/app/modules/file-routes/domain/operations/api.ts +87 -0
- package/src/app/modules/file-routes/domain/operations/codegen.ts +76 -0
- package/src/app/modules/file-routes/domain/operations/content.ts +61 -0
- package/src/app/modules/file-routes/domain/operations/defer.ts +245 -0
- package/src/app/modules/file-routes/domain/operations/index.ts +65 -0
- package/src/app/modules/file-routes/domain/operations/loader.ts +138 -0
- package/src/app/modules/file-routes/domain/operations/manifest.ts +229 -0
- package/src/app/modules/file-routes/domain/operations/match.ts +75 -0
- package/src/app/modules/file-routes/domain/operations/static-params.ts +58 -0
- package/src/app/modules/file-routes/domain/operations/typed.ts +127 -0
- package/src/app/modules/file-routes/index.ts +143 -0
- package/src/app/modules/file-routes/presentation/DevtoolsOverlay.tsx +234 -0
- package/src/app/modules/file-routes/presentation/FileRoutes.ts +254 -0
- package/src/app/modules/file-routes/presentation/Form.tsx +122 -0
- package/src/app/modules/file-routes/presentation/Link.tsx +132 -0
- package/src/app/modules/file-routes/presentation/ServerComponent.tsx +100 -0
- package/src/app/modules/file-routes/presentation/content-page.tsx +26 -0
- package/src/app/modules/file-routes/presentation/dev-events.ts +112 -0
- package/src/app/modules/file-routes/presentation/index.ts +98 -0
- package/src/app/modules/file-routes/presentation/loader-cache.ts +96 -0
- package/src/app/modules/file-routes/presentation/loader-data.ts +207 -0
- package/src/app/modules/file-routes/presentation/location.ts +217 -0
- package/src/app/modules/file-routes/presentation/normalize-route.ts +155 -0
- package/src/app/modules/file-routes/presentation/page-tree.ts +211 -0
- package/src/app/modules/file-routes/presentation/route-contexts.ts +89 -0
- package/src/app/modules/file-routes/presentation/route-def.ts +154 -0
- package/src/app/modules/file-routes/presentation/route-fallbacks.ts +66 -0
- package/src/app/modules/file-routes/presentation/route-modules.ts +138 -0
- package/src/app/modules/file-routes/presentation/slot.tsx +43 -0
- package/src/app/modules/file-routes/presentation/status.ts +13 -0
- package/src/app/modules/file-routes/presentation/use-action.ts +81 -0
- package/src/app/modules/file-routes/presentation/use-optimistic.ts +50 -0
- package/src/app/modules/file-routes/presentation/use-preload.ts +38 -0
- package/src/app/modules/file-routes/presentation/use-route.ts +254 -0
- package/src/app/modules/flash/domain/operations/flash.ts +70 -0
- package/src/app/modules/flash/index.ts +1 -0
- package/src/app/modules/fonts/domain/operations/font.ts +91 -0
- package/src/app/modules/fonts/index.ts +1 -0
- package/src/app/modules/i18n/domain/operations/i18n-middleware.ts +76 -0
- package/src/app/modules/i18n/domain/operations/locale.ts +39 -0
- package/src/app/modules/i18n/index.ts +3 -0
- package/src/app/modules/i18n/presentation/use-locale.ts +16 -0
- package/src/app/modules/middleware/domain/operations/request-id.ts +33 -0
- package/src/app/modules/middleware/domain/operations/run.ts +29 -0
- package/src/app/modules/middleware/index.ts +7 -0
- package/src/app/modules/route-rules/domain/index.ts +1 -0
- package/src/app/modules/route-rules/domain/operations/ab-variant.ts +58 -0
- package/src/app/modules/route-rules/domain/operations/index.ts +4 -0
- package/src/app/modules/route-rules/domain/operations/match.ts +51 -0
- package/src/app/modules/route-rules/domain/operations/rate-limit.ts +63 -0
- package/src/app/modules/route-rules/domain/operations/security.ts +67 -0
- package/src/app/modules/route-rules/index.ts +1 -0
- package/src/app/modules/runtime-config/application/index.ts +1 -0
- package/src/app/modules/runtime-config/application/usecases/index.ts +1 -0
- package/src/app/modules/runtime-config/application/usecases/runtime-config.ts +42 -0
- package/src/app/modules/runtime-config/index.ts +1 -0
- package/src/app/modules/seo/domain/operations/og.ts +66 -0
- package/src/app/modules/seo/domain/operations/site.ts +106 -0
- package/src/app/modules/seo/index.ts +2 -0
- package/src/app/modules/server-entry/application/index.ts +1 -0
- package/src/app/modules/server-entry/application/usecases/create-app-server.ts +205 -0
- package/src/app/modules/server-entry/application/usecases/devtools-handler.ts +31 -0
- package/src/app/modules/server-entry/application/usecases/image-handler.ts +38 -0
- package/src/app/modules/server-entry/application/usecases/index.ts +3 -0
- package/src/app/modules/server-entry/application/usecases/ops-handler.ts +55 -0
- package/src/app/modules/server-entry/application/usecases/prerender-cache.ts +59 -0
- package/src/app/modules/server-entry/application/usecases/route-render.ts +276 -0
- package/src/app/modules/server-entry/application/usecases/routed-entry.ts +194 -0
- package/src/app/modules/server-entry/application/usecases/static-handler.ts +20 -0
- package/src/app/modules/server-entry/application/usecases/zone-handler.ts +37 -0
- package/src/app/modules/server-entry/index.ts +1 -0
- package/src/app/modules/session/index.ts +77 -0
- package/src/app/modules/static/domain/operations/serve.ts +88 -0
- package/src/app/modules/static/index.ts +1 -0
- package/src/app/presentation/App.tsx +34 -0
- package/src/app/presentation/define-config.ts +11 -0
- package/src/app/presentation/index.ts +3 -0
- package/src/app/presentation/providers.ts +80 -0
- package/src/app/types/index.ts +273 -0
- package/src/assets/adapters/sharp.ts +83 -0
- package/src/assets/index.ts +6 -0
- package/src/assets/modules/assets/domain/index.ts +1 -0
- package/src/assets/modules/assets/domain/operations/image.ts +67 -0
- package/src/assets/modules/assets/domain/operations/index.ts +2 -0
- package/src/assets/modules/assets/domain/operations/manifest.ts +29 -0
- package/src/assets/modules/assets/index.ts +1 -0
- package/src/assets/presentation/Image.tsx +90 -0
- package/src/assets/presentation/index.ts +1 -0
- package/src/assets/types/index.ts +21 -0
- package/src/cli/bin.ts +8 -0
- package/src/cli/commands.ts +145 -0
- package/src/cli/doctor.ts +111 -0
- package/src/cli/index.ts +3 -0
- package/src/cli/infra.ts +38 -0
- package/src/cli/migrate.ts +119 -0
- package/src/cli/nav.ts +164 -0
- package/src/cli/ops.ts +135 -0
- package/src/cli/routes.ts +240 -0
- package/src/cli/scaffold.ts +217 -0
- package/src/devtools/App.tsx +14 -0
- package/src/devtools/adapters/connector.ts +23 -0
- package/src/devtools/adapters/index.ts +4 -0
- package/src/devtools/index.ts +26 -0
- package/src/devtools/modules/component-inspector/application/index.ts +4 -0
- package/src/devtools/modules/component-inspector/application/usecases/component-inspector.ts +67 -0
- package/src/devtools/modules/component-inspector/application/usecases/index.ts +5 -0
- package/src/devtools/modules/component-inspector/application/usecases/useComponentInspector.ts +52 -0
- package/src/devtools/modules/component-inspector/domain/events/component-events.ts +37 -0
- package/src/devtools/modules/component-inspector/domain/events/index.ts +4 -0
- package/src/devtools/modules/component-inspector/domain/index.ts +7 -0
- package/src/devtools/modules/component-inspector/domain/models/component-node.ts +30 -0
- package/src/devtools/modules/component-inspector/domain/models/component-tree.ts +20 -0
- package/src/devtools/modules/component-inspector/domain/models/index.ts +5 -0
- package/src/devtools/modules/component-inspector/domain/operations/component-operations.ts +63 -0
- package/src/devtools/modules/component-inspector/domain/operations/index.ts +4 -0
- package/src/devtools/modules/component-inspector/index.ts +7 -0
- package/src/devtools/modules/devtools/application/index.ts +4 -0
- package/src/devtools/modules/devtools/application/usecases/devtools.ts +60 -0
- package/src/devtools/modules/devtools/application/usecases/index.ts +5 -0
- package/src/devtools/modules/devtools/application/usecases/useDevtools.ts +47 -0
- package/src/devtools/modules/devtools/domain/events/devtools-events.ts +56 -0
- package/src/devtools/modules/devtools/domain/events/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/index.ts +8 -0
- package/src/devtools/modules/devtools/domain/models/devtools-state.ts +15 -0
- package/src/devtools/modules/devtools/domain/models/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/operations/devtools-operations.ts +27 -0
- package/src/devtools/modules/devtools/domain/operations/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/validators/devtools-validators.ts +36 -0
- package/src/devtools/modules/devtools/domain/validators/index.ts +4 -0
- package/src/devtools/modules/devtools/index.ts +7 -0
- package/src/devtools/modules/devtools/ports/connector.ts +10 -0
- package/src/devtools/modules/devtools/ports/index.ts +4 -0
- package/src/devtools/modules/timeline/application/index.ts +4 -0
- package/src/devtools/modules/timeline/application/usecases/index.ts +5 -0
- package/src/devtools/modules/timeline/application/usecases/timeline.ts +61 -0
- package/src/devtools/modules/timeline/application/usecases/useTimeline.ts +37 -0
- package/src/devtools/modules/timeline/domain/events/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/events/timeline-events.ts +34 -0
- package/src/devtools/modules/timeline/domain/index.ts +7 -0
- package/src/devtools/modules/timeline/domain/models/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/models/timeline-event.ts +27 -0
- package/src/devtools/modules/timeline/domain/operations/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/operations/timeline-operations.ts +28 -0
- package/src/devtools/modules/timeline/index.ts +7 -0
- package/src/devtools/presentation/DevtoolsPanel.tsx +80 -0
- package/src/devtools/presentation/components/ComponentTreeView.tsx +79 -0
- package/src/devtools/presentation/components/StateInspector.tsx +70 -0
- package/src/devtools/presentation/components/TimelineView.tsx +52 -0
- package/src/devtools/presentation/components/index.ts +7 -0
- package/src/devtools/presentation/composables/index.ts +7 -0
- package/src/devtools/presentation/composables/useComponentInspector.ts +52 -0
- package/src/devtools/presentation/index.ts +5 -0
- package/src/devtools/shared/errors/index.ts +23 -0
- package/src/devtools/shared/index.ts +7 -0
- package/src/devtools/shared/types/index.ts +6 -0
- package/src/devtools/shared/types/option.ts +58 -0
- package/src/devtools/shared/types/result.ts +53 -0
- package/src/devtools/shared/utils/index.ts +32 -0
- package/src/devtools/style.css +2 -0
- package/src/head/index.ts +5 -0
- package/src/head/modules/head/application/index.ts +1 -0
- package/src/head/modules/head/application/usecases/head-manager.ts +68 -0
- package/src/head/modules/head/application/usecases/index.ts +1 -0
- package/src/head/modules/head/domain/index.ts +3 -0
- package/src/head/modules/head/domain/models/head-tag.ts +73 -0
- package/src/head/modules/head/domain/models/index.ts +1 -0
- package/src/head/modules/head/domain/operations/dedupe.ts +18 -0
- package/src/head/modules/head/domain/operations/index.ts +2 -0
- package/src/head/modules/head/domain/operations/render-tags.ts +43 -0
- package/src/head/modules/head/domain/validators/index.ts +12 -0
- package/src/head/modules/head/index.ts +3 -0
- package/src/head/modules/head/ports/index.ts +11 -0
- package/src/head/presentation/HeadProvider.tsx +42 -0
- package/src/head/presentation/Tags.tsx +90 -0
- package/src/head/presentation/head-context.ts +11 -0
- package/src/head/presentation/index.ts +3 -0
- package/src/head/presentation/useHead.ts +77 -0
- package/src/head/shared/index.ts +1 -0
- package/src/head/shared/types/index.ts +5 -0
- package/src/head/types/index.ts +47 -0
- package/src/hooks/adapters/config/constants.ts +12 -0
- package/src/hooks/adapters/config/index.ts +48 -0
- package/src/hooks/adapters/index.ts +13 -0
- package/src/hooks/adapters/monaco/index.ts +96 -0
- package/src/hooks/adapters/qr/index.ts +65 -0
- package/src/hooks/index.ts +21 -0
- package/src/hooks/modules/array/application/index.ts +2 -0
- package/src/hooks/modules/array/application/usecases/index.ts +123 -0
- package/src/hooks/modules/array/domain/events/index.ts +5 -0
- package/src/hooks/modules/array/domain/index.ts +3 -0
- package/src/hooks/modules/array/domain/models/index.ts +2 -0
- package/src/hooks/modules/array/domain/operations/create.ts +10 -0
- package/src/hooks/modules/array/domain/operations/index.ts +31 -0
- package/src/hooks/modules/array/domain/operations/modify.ts +61 -0
- package/src/hooks/modules/array/domain/operations/query.ts +36 -0
- package/src/hooks/modules/array/domain/validators/index.ts +5 -0
- package/src/hooks/modules/array/index.ts +5 -0
- package/src/hooks/modules/array/types/index.ts +9 -0
- package/src/hooks/modules/counter/application/index.ts +12 -0
- package/src/hooks/modules/counter/application/usecases/index.ts +156 -0
- package/src/hooks/modules/counter/domain/events/index.ts +6 -0
- package/src/hooks/modules/counter/domain/index.ts +21 -0
- package/src/hooks/modules/counter/domain/models/index.ts +2 -0
- package/src/hooks/modules/counter/domain/operations/calculate.ts +22 -0
- package/src/hooks/modules/counter/domain/operations/create.ts +22 -0
- package/src/hooks/modules/counter/domain/operations/index.ts +25 -0
- package/src/hooks/modules/counter/domain/operations/modify.ts +78 -0
- package/src/hooks/modules/counter/domain/operations/query.ts +38 -0
- package/src/hooks/modules/counter/domain/operations/validate.ts +58 -0
- package/src/hooks/modules/counter/domain/validators/counter-validators.ts +19 -0
- package/src/hooks/modules/counter/domain/validators/index.ts +2 -0
- package/src/hooks/modules/counter/index.ts +6 -0
- package/src/hooks/modules/counter/ports/index.ts +7 -0
- package/src/hooks/modules/counter/types/index.ts +13 -0
- package/src/hooks/modules/editor/application/index.ts +6 -0
- package/src/hooks/modules/editor/application/useCodeEditor.ts +81 -0
- package/src/hooks/modules/editor/domain/events/editor-events.ts +16 -0
- package/src/hooks/modules/editor/domain/events/index.ts +6 -0
- package/src/hooks/modules/editor/domain/index.ts +7 -0
- package/src/hooks/modules/editor/domain/models/editor.ts +16 -0
- package/src/hooks/modules/editor/domain/models/index.ts +6 -0
- package/src/hooks/modules/editor/domain/validators/index.ts +34 -0
- package/src/hooks/modules/editor/index.ts +8 -0
- package/src/hooks/modules/editor/types/index.ts +34 -0
- package/src/hooks/modules/sensor/application/index.ts +2 -0
- package/src/hooks/modules/sensor/application/usecases/index.ts +25 -0
- package/src/hooks/modules/sensor/domain/events/index.ts +12 -0
- package/src/hooks/modules/sensor/domain/index.ts +10 -0
- package/src/hooks/modules/sensor/domain/models/index.ts +7 -0
- package/src/hooks/modules/sensor/domain/operations/gamepad.ts +16 -0
- package/src/hooks/modules/sensor/domain/operations/index.ts +12 -0
- package/src/hooks/modules/sensor/domain/operations/motion.ts +10 -0
- package/src/hooks/modules/sensor/domain/operations/orientation.ts +10 -0
- package/src/hooks/modules/sensor/domain/validators/index.ts +2 -0
- package/src/hooks/modules/sensor/index.ts +10 -0
- package/src/hooks/modules/sensor/ports/index.ts +8 -0
- package/src/hooks/modules/sensor/types/index.ts +29 -0
- package/src/hooks/modules/storage/application/index.ts +2 -0
- package/src/hooks/modules/storage/application/usecases/index.ts +18 -0
- package/src/hooks/modules/storage/domain/events/index.ts +5 -0
- package/src/hooks/modules/storage/domain/index.ts +6 -0
- package/src/hooks/modules/storage/domain/models/index.ts +6 -0
- package/src/hooks/modules/storage/domain/models/storage.ts +11 -0
- package/src/hooks/modules/storage/domain/operations/index.ts +8 -0
- package/src/hooks/modules/storage/domain/operations/serialize.ts +22 -0
- package/src/hooks/modules/storage/domain/operations/validate.ts +7 -0
- package/src/hooks/modules/storage/domain/validators/index.ts +2 -0
- package/src/hooks/modules/storage/index.ts +6 -0
- package/src/hooks/modules/storage/ports/index.ts +7 -0
- package/src/hooks/modules/storage/types/index.ts +6 -0
- package/src/hooks/modules/time/application/index.ts +2 -0
- package/src/hooks/modules/time/application/usecases/index.ts +5 -0
- package/src/hooks/modules/time/application/usecases/use-debounce.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-interval.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-throttle.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-timeout.ts +10 -0
- package/src/hooks/modules/time/domain/events/index.ts +6 -0
- package/src/hooks/modules/time/domain/index.ts +12 -0
- package/src/hooks/modules/time/domain/models/index.ts +6 -0
- package/src/hooks/modules/time/domain/models/time.ts +16 -0
- package/src/hooks/modules/time/domain/operations/calculate.ts +8 -0
- package/src/hooks/modules/time/domain/operations/index.ts +11 -0
- package/src/hooks/modules/time/domain/operations/validate.ts +11 -0
- package/src/hooks/modules/time/domain/validators/index.ts +2 -0
- package/src/hooks/modules/time/index.ts +5 -0
- package/src/hooks/modules/time/ports/index.ts +9 -0
- package/src/hooks/modules/time/types/index.ts +18 -0
- package/src/hooks/modules/toggle/application/index.ts +2 -0
- package/src/hooks/modules/toggle/application/usecases/index.ts +48 -0
- package/src/hooks/modules/toggle/domain/events/index.ts +4 -0
- package/src/hooks/modules/toggle/domain/index.ts +11 -0
- package/src/hooks/modules/toggle/domain/models/index.ts +7 -0
- package/src/hooks/modules/toggle/domain/operations/create.ts +11 -0
- package/src/hooks/modules/toggle/domain/operations/index.ts +12 -0
- package/src/hooks/modules/toggle/domain/operations/modify.ts +18 -0
- package/src/hooks/modules/toggle/domain/operations/query.ts +9 -0
- package/src/hooks/modules/toggle/domain/validators/index.ts +2 -0
- package/src/hooks/modules/toggle/index.ts +6 -0
- package/src/hooks/modules/toggle/ports/index.ts +5 -0
- package/src/hooks/modules/toggle/types/index.ts +9 -0
- package/src/hooks/presentation/index.ts +2 -0
- package/src/hooks/presentation/solid/animation/index.ts +11 -0
- package/src/hooks/presentation/solid/animation/useElapsedTime.ts +75 -0
- package/src/hooks/presentation/solid/animation/useInterval.ts +68 -0
- package/src/hooks/presentation/solid/animation/useIntervalFn.ts +54 -0
- package/src/hooks/presentation/solid/animation/useNow.ts +57 -0
- package/src/hooks/presentation/solid/animation/useRafFn.ts +57 -0
- package/src/hooks/presentation/solid/animation/useTimeout.ts +55 -0
- package/src/hooks/presentation/solid/animation/useTimeoutFn.ts +55 -0
- package/src/hooks/presentation/solid/animation/useTimestamp.ts +61 -0
- package/src/hooks/presentation/solid/animation/useTransition.ts +87 -0
- package/src/hooks/presentation/solid/array/index.ts +14 -0
- package/src/hooks/presentation/solid/array/useArrayConcat.ts +18 -0
- package/src/hooks/presentation/solid/array/useArrayEvery.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayFilter.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayFind.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayIncludes.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayMap.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayPop.ts +18 -0
- package/src/hooks/presentation/solid/array/useArrayPush.ts +15 -0
- package/src/hooks/presentation/solid/array/useArrayReduce.ts +9 -0
- package/src/hooks/presentation/solid/array/useArrayShift.ts +18 -0
- package/src/hooks/presentation/solid/array/useArraySome.ts +8 -0
- package/src/hooks/presentation/solid/array/useArraySort.ts +12 -0
- package/src/hooks/presentation/solid/browser/index.ts +35 -0
- package/src/hooks/presentation/solid/browser/useBarcode.ts +15 -0
- package/src/hooks/presentation/solid/browser/useBattery.ts +37 -0
- package/src/hooks/presentation/solid/browser/useBeacon.ts +4 -0
- package/src/hooks/presentation/solid/browser/useBluetooth.ts +15 -0
- package/src/hooks/presentation/solid/browser/useClipboard.ts +17 -0
- package/src/hooks/presentation/solid/browser/useClipboardAdvanced.ts +54 -0
- package/src/hooks/presentation/solid/browser/useConnection.ts +22 -0
- package/src/hooks/presentation/solid/browser/useCredential.ts +18 -0
- package/src/hooks/presentation/solid/browser/useDisplayMedia.ts +24 -0
- package/src/hooks/presentation/solid/browser/useFaceDetection.ts +20 -0
- package/src/hooks/presentation/solid/browser/useFullscreen.ts +33 -0
- package/src/hooks/presentation/solid/browser/useGeolocation.ts +64 -0
- package/src/hooks/presentation/solid/browser/useLocalStorage.ts +11 -0
- package/src/hooks/presentation/solid/browser/useMediaDevices.ts +24 -0
- package/src/hooks/presentation/solid/browser/useMemory.ts +9 -0
- package/src/hooks/presentation/solid/browser/useNetwork.ts +43 -0
- package/src/hooks/presentation/solid/browser/useNotification.ts +21 -0
- package/src/hooks/presentation/solid/browser/usePayment.ts +17 -0
- package/src/hooks/presentation/solid/browser/usePerformance.ts +13 -0
- package/src/hooks/presentation/solid/browser/usePush.ts +12 -0
- package/src/hooks/presentation/solid/browser/useQrCode.ts +11 -0
- package/src/hooks/presentation/solid/browser/useScreenOrientation.ts +37 -0
- package/src/hooks/presentation/solid/browser/useServiceWorker.ts +29 -0
- package/src/hooks/presentation/solid/browser/useSessionStorage.ts +11 -0
- package/src/hooks/presentation/solid/browser/useShare.ts +12 -0
- package/src/hooks/presentation/solid/browser/useSpeechRecognition.ts +71 -0
- package/src/hooks/presentation/solid/browser/useSpeechSynthesis.ts +54 -0
- package/src/hooks/presentation/solid/browser/useStorage.ts +22 -0
- package/src/hooks/presentation/solid/browser/useTextDetection.ts +20 -0
- package/src/hooks/presentation/solid/browser/useUsb.ts +15 -0
- package/src/hooks/presentation/solid/browser/useUserMedia.ts +24 -0
- package/src/hooks/presentation/solid/browser/useVibration.ts +12 -0
- package/src/hooks/presentation/solid/browser/useWakeLock.ts +29 -0
- package/src/hooks/presentation/solid/browser/useWebAuthn.ts +35 -0
- package/src/hooks/presentation/solid/elements/index.ts +51 -0
- package/src/hooks/presentation/solid/elements/useActive.ts +33 -0
- package/src/hooks/presentation/solid/elements/useAudio.ts +82 -0
- package/src/hooks/presentation/solid/elements/useBreakpoints.ts +56 -0
- package/src/hooks/presentation/solid/elements/useCanvas.ts +43 -0
- package/src/hooks/presentation/solid/elements/useClick.ts +49 -0
- package/src/hooks/presentation/solid/elements/useDrag.ts +56 -0
- package/src/hooks/presentation/solid/elements/useDraggable.ts +57 -0
- package/src/hooks/presentation/solid/elements/useDraggableHandle.ts +92 -0
- package/src/hooks/presentation/solid/elements/useDrop.ts +54 -0
- package/src/hooks/presentation/solid/elements/useDropZone.ts +67 -0
- package/src/hooks/presentation/solid/elements/useElementBounding.ts +52 -0
- package/src/hooks/presentation/solid/elements/useElementSize.ts +30 -0
- package/src/hooks/presentation/solid/elements/useElementVisibility.ts +33 -0
- package/src/hooks/presentation/solid/elements/useFileDialog.ts +33 -0
- package/src/hooks/presentation/solid/elements/useFileInput.ts +20 -0
- package/src/hooks/presentation/solid/elements/useFocus.ts +49 -0
- package/src/hooks/presentation/solid/elements/useHover.ts +33 -0
- package/src/hooks/presentation/solid/elements/useImagePreview.ts +27 -0
- package/src/hooks/presentation/solid/elements/useImageUpload.ts +66 -0
- package/src/hooks/presentation/solid/elements/useInfiniteScroll.ts +52 -0
- package/src/hooks/presentation/solid/elements/useIntersectionAdvanced.ts +43 -0
- package/src/hooks/presentation/solid/elements/useIntersectionObserver.ts +40 -0
- package/src/hooks/presentation/solid/elements/useLayout.ts +47 -0
- package/src/hooks/presentation/solid/elements/useLongPress.ts +54 -0
- package/src/hooks/presentation/solid/elements/useMagicKeys.ts +60 -0
- package/src/hooks/presentation/solid/elements/useMediaQuery.ts +24 -0
- package/src/hooks/presentation/solid/elements/useModal.ts +24 -0
- package/src/hooks/presentation/solid/elements/useMouse.ts +51 -0
- package/src/hooks/presentation/solid/elements/useMutationObserver.ts +38 -0
- package/src/hooks/presentation/solid/elements/useOnClickOutside.ts +25 -0
- package/src/hooks/presentation/solid/elements/useOnKeyStroke.ts +33 -0
- package/src/hooks/presentation/solid/elements/useParallax.ts +34 -0
- package/src/hooks/presentation/solid/elements/usePerformanceObserver.ts +30 -0
- package/src/hooks/presentation/solid/elements/usePinch.ts +61 -0
- package/src/hooks/presentation/solid/elements/usePopover.ts +54 -0
- package/src/hooks/presentation/solid/elements/useResize.ts +34 -0
- package/src/hooks/presentation/solid/elements/useResizeObserver.ts +42 -0
- package/src/hooks/presentation/solid/elements/useRotate.ts +42 -0
- package/src/hooks/presentation/solid/elements/useScroll.ts +97 -0
- package/src/hooks/presentation/solid/elements/useScrollTo.ts +30 -0
- package/src/hooks/presentation/solid/elements/useSortable.ts +22 -0
- package/src/hooks/presentation/solid/elements/useSplitter.ts +61 -0
- package/src/hooks/presentation/solid/elements/useSticky.ts +33 -0
- package/src/hooks/presentation/solid/elements/useSvg.ts +31 -0
- package/src/hooks/presentation/solid/elements/useSwipe.ts +87 -0
- package/src/hooks/presentation/solid/elements/useTabs.ts +44 -0
- package/src/hooks/presentation/solid/elements/useTooltip.ts +57 -0
- package/src/hooks/presentation/solid/elements/useVideo.ts +83 -0
- package/src/hooks/presentation/solid/elements/useVirtualList.ts +43 -0
- package/src/hooks/presentation/solid/elements/useWebgl.ts +36 -0
- package/src/hooks/presentation/solid/index.ts +11 -0
- package/src/hooks/presentation/solid/math/index.ts +10 -0
- package/src/hooks/presentation/solid/math/useAbs.ts +9 -0
- package/src/hooks/presentation/solid/math/useCeil.ts +9 -0
- package/src/hooks/presentation/solid/math/useClamp.ts +24 -0
- package/src/hooks/presentation/solid/math/useExp.ts +9 -0
- package/src/hooks/presentation/solid/math/useFloor.ts +9 -0
- package/src/hooks/presentation/solid/math/useLog.ts +21 -0
- package/src/hooks/presentation/solid/math/useMath.ts +3 -0
- package/src/hooks/presentation/solid/math/useOffset.ts +20 -0
- package/src/hooks/presentation/solid/math/usePow.ts +16 -0
- package/src/hooks/presentation/solid/math/useRound.ts +24 -0
- package/src/hooks/presentation/solid/math/useSign.ts +9 -0
- package/src/hooks/presentation/solid/math/useSqrt.ts +9 -0
- package/src/hooks/presentation/solid/network/index.ts +5 -0
- package/src/hooks/presentation/solid/network/useEventSource.ts +87 -0
- package/src/hooks/presentation/solid/network/useFetch.ts +187 -0
- package/src/hooks/presentation/solid/network/useWebSocket.ts +120 -0
- package/src/hooks/presentation/solid/sensors/index.ts +21 -0
- package/src/hooks/presentation/solid/sensors/useAbsoluteOrientation.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useAccelerometer.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useAmbientLight.ts +35 -0
- package/src/hooks/presentation/solid/sensors/useDeviceMotion.ts +50 -0
- package/src/hooks/presentation/solid/sensors/useDeviceOrientation.ts +38 -0
- package/src/hooks/presentation/solid/sensors/useGamepad.ts +52 -0
- package/src/hooks/presentation/solid/sensors/useGamepadRumble.ts +28 -0
- package/src/hooks/presentation/solid/sensors/useGravity.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useGyroscope.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useHID.ts +19 -0
- package/src/hooks/presentation/solid/sensors/useLinearAcceleration.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useMagnetometer.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useMotion.ts +31 -0
- package/src/hooks/presentation/solid/sensors/useNFC.ts +19 -0
- package/src/hooks/presentation/solid/sensors/usePressure.ts +35 -0
- package/src/hooks/presentation/solid/sensors/useProximity.ts +38 -0
- package/src/hooks/presentation/solid/sensors/useRelativeOrientation.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useSerial.ts +18 -0
- package/src/hooks/presentation/solid/sensors/useShake.ts +54 -0
- package/src/hooks/presentation/solid/sensors/useTilt.ts +31 -0
- package/src/hooks/presentation/solid/state/createSharedComposable.ts +24 -0
- package/src/hooks/presentation/solid/state/index.ts +14 -0
- package/src/hooks/presentation/solid/state/reactivity.ts +43 -0
- package/src/hooks/presentation/solid/state/refDebounced.ts +27 -0
- package/src/hooks/presentation/solid/state/refThrottled.ts +39 -0
- package/src/hooks/presentation/solid/state/syncRef.ts +24 -0
- package/src/hooks/presentation/solid/state/toRef.ts +18 -0
- package/src/hooks/presentation/solid/state/useArray.ts +55 -0
- package/src/hooks/presentation/solid/state/useCounter.ts +24 -0
- package/src/hooks/presentation/solid/state/useToggle.ts +20 -0
- package/src/hooks/presentation/solid/time/index.ts +6 -0
- package/src/hooks/presentation/solid/time/useDebounceFn.ts +18 -0
- package/src/hooks/presentation/solid/time/useInterval.ts +44 -0
- package/src/hooks/presentation/solid/time/useThrottleFn.ts +30 -0
- package/src/hooks/presentation/solid/time/useTimeout.ts +37 -0
- package/src/hooks/presentation/solid/time/watchDebounced.ts +19 -0
- package/src/hooks/presentation/solid/time/watchPausable.ts +29 -0
- package/src/hooks/presentation/solid/time/whenever.ts +13 -0
- package/src/hooks/presentation/solid/utilities/index.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayEvery.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayFilter.ts +11 -0
- package/src/hooks/presentation/solid/utilities/useArrayFind.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayIncludes.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayMap.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayReduce.ts +9 -0
- package/src/hooks/presentation/solid/utilities/useArraySome.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArraySort.ts +12 -0
- package/src/hooks/presentation/solid/utilities/useClamp.ts +24 -0
- package/src/hooks/presentation/solid/utilities/useDebounce.ts +32 -0
- package/src/hooks/presentation/solid/utilities/useEventBus.ts +57 -0
- package/src/hooks/presentation/solid/utilities/useMemoize.ts +15 -0
- package/src/hooks/presentation/solid/utilities/useOffset.ts +20 -0
- package/src/hooks/presentation/solid/utilities/useRound.ts +24 -0
- package/src/hooks/presentation/solid/utilities/useSorted.ts +12 -0
- package/src/hooks/presentation/solid/utilities/useThrottle.ts +44 -0
- package/src/hooks/presentation/solid/utilities/useToNumber.ts +11 -0
- package/src/hooks/presentation/solid/utilities/useToString.ts +10 -0
- package/src/hooks/realtime/use-sse.ts +70 -0
- package/src/hooks/shared/constants/index.ts +4 -0
- package/src/hooks/shared/errors/index.ts +1 -0
- package/src/hooks/shared/errors/validation-error.ts +28 -0
- package/src/hooks/shared/index.ts +8 -0
- package/src/hooks/shared/types/index.ts +17 -0
- package/src/hooks/shared/types/option.ts +17 -0
- package/src/hooks/shared/types/result.ts +34 -0
- package/src/hooks/shared/types/utilities.ts +102 -0
- package/src/hooks/shared/utils/identity.ts +2 -0
- package/src/hooks/shared/utils/index.ts +4 -0
- package/src/hooks/shared/utils/logger.ts +69 -0
- package/src/hooks/shared/utils/pipe.ts +5 -0
- package/src/hooks/shared/utils/result.ts +9 -0
- package/src/hooks/test/counter.test.ts +25 -0
- package/src/index.ts +16 -0
- package/src/internal.ts +61 -0
- package/src/query/adapters/devtools/index.ts +29 -0
- package/src/query/adapters/persistence/index.ts +62 -0
- package/src/query/adapters/solid/index.ts +10 -0
- package/src/query/adapters/solid/solid-query-context.ts +29 -0
- package/src/query/adapters/solid/solid-query-empty-result.ts +34 -0
- package/src/query/adapters/solid/solid-query-options.ts +52 -0
- package/src/query/adapters/solid/solid-query-use-infinite.ts +228 -0
- package/src/query/adapters/solid/solid-query-use-mutation.ts +54 -0
- package/src/query/adapters/solid/solid-query-use-query.ts +75 -0
- package/src/query/adapters/solid/solid.test.ts +53 -0
- package/src/query/adapters/validation/index.ts +20 -0
- package/src/query/index.test.ts +203 -0
- package/src/query/index.ts +4 -0
- package/src/query/modules/query/application/usecases/query-client-data.ts +29 -0
- package/src/query/modules/query/application/usecases/query-client-helpers.ts +49 -0
- package/src/query/modules/query/application/usecases/query-client-infinite.ts +39 -0
- package/src/query/modules/query/application/usecases/query-client.ts +251 -0
- package/src/query/modules/query/domain/models/mutation-cache.ts +115 -0
- package/src/query/modules/query/domain/models/mutation.ts +207 -0
- package/src/query/modules/query/domain/models/query-cache.ts +119 -0
- package/src/query/modules/query/domain/models/query-environment.ts +16 -0
- package/src/query/modules/query/domain/models/query-observer.ts +162 -0
- package/src/query/modules/query/domain/models/query-operations.ts +76 -0
- package/src/query/modules/query/domain/models/query.ts +239 -0
- package/src/query/modules/query/domain/operations/index.ts +76 -0
- package/src/query/modules/query/index.ts +9 -0
- package/src/query/modules/query/ports/index.ts +53 -0
- package/src/query/modules/query/types/index.ts +239 -0
- package/src/query/shared/index.ts +48 -0
- package/src/render/adapters/index.ts +1 -0
- package/src/render/adapters/solid-web/hydration.ts +35 -0
- package/src/render/adapters/solid-web/index.ts +3 -0
- package/src/render/adapters/solid-web/renderer.ts +20 -0
- package/src/render/index.ts +7 -0
- package/src/render/modules/render/application/index.ts +1 -0
- package/src/render/modules/render/application/usecases/index.ts +4 -0
- package/src/render/modules/render/application/usecases/remote-island.ts +46 -0
- package/src/render/modules/render/application/usecases/render-page.ts +86 -0
- package/src/render/modules/render/application/usecases/render-shell.ts +56 -0
- package/src/render/modules/render/application/usecases/stream-page.ts +159 -0
- package/src/render/modules/render/domain/index.ts +3 -0
- package/src/render/modules/render/domain/models/context.ts +34 -0
- package/src/render/modules/render/domain/models/document.ts +26 -0
- package/src/render/modules/render/domain/models/index.ts +2 -0
- package/src/render/modules/render/domain/operations/document.ts +58 -0
- package/src/render/modules/render/domain/operations/hydration.ts +58 -0
- package/src/render/modules/render/domain/operations/index.ts +3 -0
- package/src/render/modules/render/domain/operations/rsc.ts +53 -0
- package/src/render/modules/render/domain/validators/index.ts +11 -0
- package/src/render/modules/render/index.ts +3 -0
- package/src/render/modules/render/ports/index.ts +17 -0
- package/src/render/presentation/ClientComponent.tsx +42 -0
- package/src/render/presentation/Document.tsx +45 -0
- package/src/render/presentation/Island.tsx +146 -0
- package/src/render/presentation/RemoteIsland.tsx +68 -0
- package/src/render/presentation/entries.ts +83 -0
- package/src/render/presentation/index.ts +5 -0
- package/src/render/shared/index.ts +2 -0
- package/src/render/shared/types/index.ts +9 -0
- package/src/render/shared/utils/index.ts +1 -0
- package/src/render/shared/utils/result.ts +30 -0
- package/src/render/types/index.ts +58 -0
- package/src/router/adapters/index.ts +1 -0
- package/src/router/adapters/solid-start/index.ts +42 -0
- package/src/router/cli/bundle-analyzer.ts +142 -0
- package/src/router/cli/index.ts +3 -0
- package/src/router/cli/migration-cli.ts +217 -0
- package/src/router/cli/route-generator-config.ts +109 -0
- package/src/router/cli/route-generator-templates.ts +117 -0
- package/src/router/cli/route-generator-types.ts +9 -0
- package/src/router/cli/route-generator-utils.ts +40 -0
- package/src/router/cli/route-generator.ts +64 -0
- package/src/router/index.test.ts +7 -0
- package/src/router/index.ts +21 -0
- package/src/router/modules/navigation/application/index.ts +1 -0
- package/src/router/modules/navigation/application/usecases.ts +42 -0
- package/src/router/modules/navigation/domain/index.ts +2 -0
- package/src/router/modules/navigation/domain/models.ts +44 -0
- package/src/router/modules/navigation/domain/operations.ts +28 -0
- package/src/router/modules/navigation/index.ts +3 -0
- package/src/router/modules/navigation/types/index.ts +15 -0
- package/src/router/modules/route-cache/application/usecases/index.ts +74 -0
- package/src/router/modules/route-cache/domain/models/index.ts +63 -0
- package/src/router/modules/route-cache/domain/operations/cache-evict.ts +104 -0
- package/src/router/modules/route-cache/domain/operations/cache-invalidate.ts +101 -0
- package/src/router/modules/route-cache/domain/operations/cache-read.ts +74 -0
- package/src/router/modules/route-cache/domain/operations/cache-write.ts +62 -0
- package/src/router/modules/route-cache/domain/operations/index.ts +4 -0
- package/src/router/modules/route-cache/domain/validators/index.ts +25 -0
- package/src/router/modules/route-cache/index.ts +8 -0
- package/src/router/modules/route-cache/ports/index.ts +20 -0
- package/src/router/modules/route-cache/types/index.ts +8 -0
- package/src/router/modules/route-error-tracking/application/usecases/index.ts +182 -0
- package/src/router/modules/route-error-tracking/domain/index.ts +5 -0
- package/src/router/modules/route-error-tracking/domain/models/index.ts +130 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-cleanup.ts +50 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-queries.ts +103 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-recording.ts +112 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-reporting.ts +55 -0
- package/src/router/modules/route-error-tracking/domain/operations/index.ts +4 -0
- package/src/router/modules/route-error-tracking/domain/validators/index.ts +46 -0
- package/src/router/modules/route-error-tracking/index.ts +8 -0
- package/src/router/modules/route-error-tracking/ports/index.ts +20 -0
- package/src/router/modules/route-error-tracking/types/index.ts +6 -0
- package/src/router/modules/route-feature-flags/application/usecases/index.ts +159 -0
- package/src/router/modules/route-feature-flags/domain/index.ts +5 -0
- package/src/router/modules/route-feature-flags/domain/models/index.ts +102 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-audit.ts +37 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-conditions.ts +52 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-flags.ts +205 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-routes.ts +54 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-segments.ts +22 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-statistics.ts +22 -0
- package/src/router/modules/route-feature-flags/domain/operations/index.ts +6 -0
- package/src/router/modules/route-feature-flags/domain/validators/index.ts +40 -0
- package/src/router/modules/route-feature-flags/index.ts +8 -0
- package/src/router/modules/route-feature-flags/ports/index.ts +23 -0
- package/src/router/modules/route-feature-flags/types/index.ts +7 -0
- package/src/router/modules/route-i18n/application/usecases/index.ts +81 -0
- package/src/router/modules/route-i18n/domain/models/index.ts +85 -0
- package/src/router/modules/route-i18n/domain/operations/index.ts +201 -0
- package/src/router/modules/route-i18n/domain/validators/index.ts +43 -0
- package/src/router/modules/route-i18n/index.ts +8 -0
- package/src/router/modules/route-i18n/ports/index.ts +20 -0
- package/src/router/modules/route-i18n/types/index.ts +7 -0
- package/src/router/modules/route-navigation-timeline/application/usecases/index.ts +182 -0
- package/src/router/modules/route-navigation-timeline/domain/index.ts +5 -0
- package/src/router/modules/route-navigation-timeline/domain/models/index.ts +143 -0
- package/src/router/modules/route-navigation-timeline/domain/operations/index.ts +177 -0
- package/src/router/modules/route-navigation-timeline/domain/validators/index.ts +19 -0
- package/src/router/modules/route-navigation-timeline/index.ts +8 -0
- package/src/router/modules/route-navigation-timeline/ports/index.ts +30 -0
- package/src/router/modules/route-navigation-timeline/types/index.ts +5 -0
- package/src/router/modules/route-performance/application/usecases/index.ts +166 -0
- package/src/router/modules/route-performance/domain/models/index.ts +96 -0
- package/src/router/modules/route-performance/domain/operations/index.ts +5 -0
- package/src/router/modules/route-performance/domain/operations/performance-cleanup.ts +29 -0
- package/src/router/modules/route-performance/domain/operations/performance-queries.ts +91 -0
- package/src/router/modules/route-performance/domain/operations/performance-recording.ts +151 -0
- package/src/router/modules/route-performance/domain/operations/performance-reporting.ts +32 -0
- package/src/router/modules/route-performance/domain/operations/performance-tracking.ts +75 -0
- package/src/router/modules/route-performance/domain/validators/index.ts +55 -0
- package/src/router/modules/route-performance/index.ts +8 -0
- package/src/router/modules/route-performance/ports/index.ts +25 -0
- package/src/router/modules/route-performance/types/index.ts +6 -0
- package/src/router/modules/route-security/application/usecases/index.ts +153 -0
- package/src/router/modules/route-security/domain/models/index.ts +216 -0
- package/src/router/modules/route-security/domain/operations/index.ts +165 -0
- package/src/router/modules/route-security/domain/validators/index.ts +32 -0
- package/src/router/modules/route-security/index.ts +8 -0
- package/src/router/modules/route-security/ports/index.ts +31 -0
- package/src/router/modules/route-security/types/index.ts +11 -0
- package/src/router/modules/route-testing/application/usecases/index.ts +131 -0
- package/src/router/modules/route-testing/domain/models/index.ts +217 -0
- package/src/router/modules/route-testing/domain/operations/contract-testing-operations.ts +239 -0
- package/src/router/modules/route-testing/domain/operations/e2e-testing-operations.ts +167 -0
- package/src/router/modules/route-testing/domain/operations/index.ts +3 -0
- package/src/router/modules/route-testing/domain/operations/route-testing-core.ts +48 -0
- package/src/router/modules/route-testing/domain/validators/index.ts +34 -0
- package/src/router/modules/route-testing/index.ts +8 -0
- package/src/router/modules/route-testing/ports/index.ts +21 -0
- package/src/router/modules/route-testing/types/index.ts +13 -0
- package/src/router/modules/routing/application/index.ts +7 -0
- package/src/router/modules/routing/application/usecases.ts +49 -0
- package/src/router/modules/routing/domain/ab-testing.ts +86 -0
- package/src/router/modules/routing/domain/analytics.ts +88 -0
- package/src/router/modules/routing/domain/caching-evict.ts +104 -0
- package/src/router/modules/routing/domain/caching-invalidate.ts +101 -0
- package/src/router/modules/routing/domain/caching-read.ts +74 -0
- package/src/router/modules/routing/domain/caching-state.ts +38 -0
- package/src/router/modules/routing/domain/caching-types.ts +38 -0
- package/src/router/modules/routing/domain/caching-write.ts +62 -0
- package/src/router/modules/routing/domain/caching.ts +6 -0
- package/src/router/modules/routing/domain/code-splitting.ts +226 -0
- package/src/router/modules/routing/domain/contract-factory.ts +37 -0
- package/src/router/modules/routing/domain/contract-testing.ts +13 -0
- package/src/router/modules/routing/domain/contract-types.ts +32 -0
- package/src/router/modules/routing/domain/contract-validator.ts +246 -0
- package/src/router/modules/routing/domain/dynamic-imports.ts +67 -0
- package/src/router/modules/routing/domain/e2e-testing.ts +267 -0
- package/src/router/modules/routing/domain/error-boundaries.ts +54 -0
- package/src/router/modules/routing/domain/error-tracking.ts +277 -0
- package/src/router/modules/routing/domain/feature-flags.ts +255 -0
- package/src/router/modules/routing/domain/guards.ts +104 -0
- package/src/router/modules/routing/domain/i18n.ts +230 -0
- package/src/router/modules/routing/domain/index.ts +30 -0
- package/src/router/modules/routing/domain/interactive-docs-advanced-sections.ts +164 -0
- package/src/router/modules/routing/domain/interactive-docs-core-sections.ts +198 -0
- package/src/router/modules/routing/domain/interactive-docs.ts +154 -0
- package/src/router/modules/routing/domain/isr.ts +35 -0
- package/src/router/modules/routing/domain/middleware.ts +79 -0
- package/src/router/modules/routing/domain/models.ts +95 -0
- package/src/router/modules/routing/domain/navigation-timeline.ts +243 -0
- package/src/router/modules/routing/domain/operations.ts +36 -0
- package/src/router/modules/routing/domain/optimized-matcher.ts +75 -0
- package/src/router/modules/routing/domain/performance-alert-manager.ts +28 -0
- package/src/router/modules/routing/domain/performance-monitoring.ts +287 -0
- package/src/router/modules/routing/domain/performance-report.ts +29 -0
- package/src/router/modules/routing/domain/performance-types.ts +19 -0
- package/src/router/modules/routing/domain/predictive-preloading.ts +296 -0
- package/src/router/modules/routing/domain/rbac.ts +219 -0
- package/src/router/modules/routing/domain/resource-routes.ts +64 -0
- package/src/router/modules/routing/domain/route-autocomplete.ts +176 -0
- package/src/router/modules/routing/domain/route-groups.ts +63 -0
- package/src/router/modules/routing/domain/security-scanner.ts +225 -0
- package/src/router/modules/routing/domain/server-actions.ts +71 -0
- package/src/router/modules/routing/domain/testing.ts +80 -0
- package/src/router/modules/routing/domain/type-safe-links.ts +72 -0
- package/src/router/modules/routing/domain/validators.ts +23 -0
- package/src/router/modules/routing/index.ts +4 -0
- package/src/router/modules/routing/ports/index.ts +1 -0
- package/src/router/modules/routing/ports/router-port.ts +15 -0
- package/src/router/modules/routing/types/index.ts +14 -0
- package/src/router/modules/routing-core/application/usecases/index.ts +49 -0
- package/src/router/modules/routing-core/domain/models/index.ts +95 -0
- package/src/router/modules/routing-core/domain/operations/index.ts +36 -0
- package/src/router/modules/routing-core/domain/validators/index.ts +28 -0
- package/src/router/modules/routing-core/index.ts +8 -0
- package/src/router/modules/routing-core/ports/index.ts +16 -0
- package/src/router/modules/routing-core/types/index.ts +25 -0
- package/src/router/presentation/index.ts +1 -0
- package/src/router/presentation/solid/components/index.ts +1 -0
- package/src/router/presentation/solid/components/route-visualizer-details.tsx +37 -0
- package/src/router/presentation/solid/components/route-visualizer-helpers.ts +56 -0
- package/src/router/presentation/solid/components/route-visualizer-tree.tsx +99 -0
- package/src/router/presentation/solid/components/route-visualizer-types.ts +41 -0
- package/src/router/presentation/solid/components/route-visualizer.tsx +110 -0
- package/src/router/presentation/solid/components/router.ts +82 -0
- package/src/router/presentation/solid/devtools/index.ts +2 -0
- package/src/router/presentation/solid/devtools/router-devtools-panel.tsx +141 -0
- package/src/router/presentation/solid/devtools/router-inspector.ts +54 -0
- package/src/router/presentation/solid/hmr.ts +77 -0
- package/src/router/presentation/solid/index.ts +7 -0
- package/src/router/presentation/solid/lazy-loading.ts +111 -0
- package/src/router/presentation/solid/preloading.ts +81 -0
- package/src/router/presentation/solid/route-state.ts +58 -0
- package/src/router/presentation/solid/signals/index.ts +2 -0
- package/src/router/presentation/solid/signals/route-state.ts +39 -0
- package/src/router/presentation/solid/signals/search-params.ts +31 -0
- package/src/router/shared/constants/index.ts +6 -0
- package/src/router/shared/errors/enhanced-errors.ts +94 -0
- package/src/router/shared/errors/index.ts +30 -0
- package/src/router/shared/index.ts +4 -0
- package/src/router/shared/types/either.ts +55 -0
- package/src/router/shared/types/index.ts +5 -0
- package/src/router/shared/types/option.ts +20 -0
- package/src/router/shared/types/result.ts +34 -0
- package/src/router/shared/types/route-inference.ts +49 -0
- package/src/router/shared/types/routing.ts +31 -0
- package/src/router/shared/utils/index.ts +3 -0
- package/src/router/shared/utils/path.ts +43 -0
- package/src/router/shared/utils/result.ts +5 -0
- package/src/router/shared/utils/time-condition.ts +53 -0
- package/src/router/vite-plugin/index.ts +2 -0
- package/src/router/vite-plugin/vite-plugin-core.ts +79 -0
- package/src/router/vite-plugin/vite-plugin-options-advanced.ts +127 -0
- package/src/router/vite-plugin/vite-plugin-options-features.ts +117 -0
- package/src/router/vite-plugin/vite-plugin-options-routing.ts +70 -0
- package/src/router/vite-plugin/vite-plugin-options.ts +23 -0
- package/src/server/adapters/index.ts +2 -0
- package/src/server/adapters/platforms.ts +79 -0
- package/src/server/adapters/web-server/index.ts +281 -0
- package/src/server/index.ts +13 -0
- package/src/server/modules/http/domain/operations/cookies.ts +151 -0
- package/src/server/modules/http/domain/operations/metrics.ts +103 -0
- package/src/server/modules/http/domain/operations/request-context.ts +36 -0
- package/src/server/modules/http/domain/operations/session-store.ts +98 -0
- package/src/server/modules/http/index.ts +15 -0
- package/src/server/modules/loaders/application/index.ts +1 -0
- package/src/server/modules/loaders/application/usecases/create-route-loader.ts +88 -0
- package/src/server/modules/loaders/application/usecases/dehydrate.ts +21 -0
- package/src/server/modules/loaders/application/usecases/index.ts +2 -0
- package/src/server/modules/loaders/index.ts +1 -0
- package/src/server/modules/realtime/domain/operations/channels.ts +241 -0
- package/src/server/modules/realtime/domain/operations/sse.ts +63 -0
- package/src/server/modules/realtime/index.ts +2 -0
- package/src/server/modules/server-functions/adapters/http/handler.ts +128 -0
- package/src/server/modules/server-functions/application/index.ts +1 -0
- package/src/server/modules/server-functions/application/usecases/batch.ts +135 -0
- package/src/server/modules/server-functions/application/usecases/create-server-fn.ts +272 -0
- package/src/server/modules/server-functions/application/usecases/csrf.ts +67 -0
- package/src/server/modules/server-functions/application/usecases/index.ts +6 -0
- package/src/server/modules/server-functions/application/usecases/live.ts +172 -0
- package/src/server/modules/server-functions/application/usecases/registry.ts +22 -0
- package/src/server/modules/server-functions/application/usecases/scheduler.ts +115 -0
- package/src/server/modules/server-functions/domain/index.ts +24 -0
- package/src/server/modules/server-functions/domain/models/execution-result.ts +18 -0
- package/src/server/modules/server-functions/domain/models/index.ts +1 -0
- package/src/server/modules/server-functions/domain/operations/result.ts +61 -0
- package/src/server/modules/server-functions/domain/operations/serialize.ts +134 -0
- package/src/server/modules/server-functions/domain/operations/stream.ts +107 -0
- package/src/server/modules/server-functions/index.ts +3 -0
- package/src/server/modules/server-only/index.ts +30 -0
- package/src/server/node.ts +10 -0
- package/src/server/shared/errors/index.ts +1 -0
- package/src/server/shared/errors/server-fn-error.ts +27 -0
- package/src/server/shared/index.ts +2 -0
- package/src/server/shared/types/index.ts +5 -0
- package/src/server/types/index.ts +65 -0
- package/src/stores/adapters/analytics/index.ts +5 -0
- package/src/stores/adapters/analytics/monitoring.ts +164 -0
- package/src/stores/adapters/devtools/index.ts +80 -0
- package/src/stores/adapters/persistence/index.ts +5 -0
- package/src/stores/adapters/persistence/versioning.ts +142 -0
- package/src/stores/adapters/router/index.ts +144 -0
- package/src/stores/adapters/storage/index.ts +6 -0
- package/src/stores/adapters/storage/indexed-db.ts +83 -0
- package/src/stores/adapters/storage/local-storage.ts +44 -0
- package/src/stores/adapters/storage/session-storage.ts +44 -0
- package/src/stores/adapters/sync/index.ts +5 -0
- package/src/stores/adapters/sync/tab-sync.ts +148 -0
- package/src/stores/adapters/validation/arktype-validator.ts +32 -0
- package/src/stores/adapters/validation/error-handling.ts +27 -0
- package/src/stores/adapters/validation/index.ts +61 -0
- package/src/stores/adapters/validation/schemas/api-schemas.ts +30 -0
- package/src/stores/adapters/validation/schemas/common-schemas.ts +32 -0
- package/src/stores/adapters/validation/schemas/config-schemas.ts +22 -0
- package/src/stores/adapters/validation/schemas/constraint-schemas.ts +34 -0
- package/src/stores/adapters/validation/schemas/ecommerce-schemas.ts +43 -0
- package/src/stores/adapters/validation/schemas/form-schemas.ts +27 -0
- package/src/stores/adapters/validation/schemas/primitive-schemas.ts +9 -0
- package/src/stores/adapters/validation/schemas/store-schemas.ts +52 -0
- package/src/stores/adapters/validation/schemas.ts +11 -0
- package/src/stores/index.ts +13 -0
- package/src/stores/modules/query/index.ts +24 -0
- package/src/stores/modules/query/mutation-state.ts +33 -0
- package/src/stores/modules/query/mutation-store.ts +59 -0
- package/src/stores/modules/query/query-builder.ts +25 -0
- package/src/stores/modules/query/query-cache.ts +65 -0
- package/src/stores/modules/query/query-manager.ts +103 -0
- package/src/stores/modules/query/query-state.ts +39 -0
- package/src/stores/modules/query/query-store.ts +81 -0
- package/src/stores/modules/store/application/usecases/index.ts +217 -0
- package/src/stores/modules/store/domain/models/index.ts +38 -0
- package/src/stores/modules/store/domain/operations/actions.ts +120 -0
- package/src/stores/modules/store/domain/operations/composition.ts +205 -0
- package/src/stores/modules/store/domain/operations/derived-operations.ts +21 -0
- package/src/stores/modules/store/domain/operations/diffing.ts +272 -0
- package/src/stores/modules/store/domain/operations/event-bus.ts +255 -0
- package/src/stores/modules/store/domain/operations/history-operations.ts +101 -0
- package/src/stores/modules/store/domain/operations/hydration.ts +159 -0
- package/src/stores/modules/store/domain/operations/immutable.ts +173 -0
- package/src/stores/modules/store/domain/operations/index.ts +21 -0
- package/src/stores/modules/store/domain/operations/middleware.ts +193 -0
- package/src/stores/modules/store/domain/operations/mutations.ts +14 -0
- package/src/stores/modules/store/domain/operations/normalization.ts +195 -0
- package/src/stores/modules/store/domain/operations/optimistic.ts +171 -0
- package/src/stores/modules/store/domain/operations/persistence-operations.ts +26 -0
- package/src/stores/modules/store/domain/operations/queries.ts +296 -0
- package/src/stores/modules/store/domain/operations/selectors.ts +112 -0
- package/src/stores/modules/store/domain/operations/store-operations.ts +52 -0
- package/src/stores/modules/store/domain/operations/time-machine.ts +240 -0
- package/src/stores/modules/store/domain/operations/transactions.ts +198 -0
- package/src/stores/modules/store/domain/validators/action-validators.ts +20 -0
- package/src/stores/modules/store/domain/validators/history-validators.ts +19 -0
- package/src/stores/modules/store/domain/validators/index.ts +7 -0
- package/src/stores/modules/store/domain/validators/persistence-validators.ts +23 -0
- package/src/stores/modules/store/domain/validators/store-validators.ts +41 -0
- package/src/stores/modules/store/index.ts +9 -0
- package/src/stores/modules/store/ports/index.ts +104 -0
- package/src/stores/modules/store/types/index.ts +35 -0
- package/src/stores/shared/constants/index.ts +50 -0
- package/src/stores/shared/errors/index.ts +122 -0
- package/src/stores/shared/index.ts +7 -0
- package/src/stores/shared/schema-generator.ts +262 -0
- package/src/stores/shared/types/index.ts +147 -0
- package/src/testing/index.ts +90 -0
- package/src/vite/auto-imports.ts +65 -0
- package/src/vite/client.d.ts +25 -0
- package/src/vite/dev-middleware.ts +142 -0
- package/src/vite/index.ts +9 -0
- package/src/vite/plugin.ts +277 -0
- package/src/vite/prerender.ts +72 -0
- package/src/vite/server-fn-ids.ts +52 -0
- package/src/vite/types/index.ts +24 -0
- package/src/vite/virtual-modules.ts +68 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import type { RouteConfig } from "../../../shared/types";
|
|
2
|
+
|
|
3
|
+
export interface E2ETestStep {
|
|
4
|
+
action: "navigate" | "click" | "fill" | "wait" | "assert";
|
|
5
|
+
selector?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
assertion?: string;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface E2ETest {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
route: string;
|
|
15
|
+
steps: E2ETestStep[];
|
|
16
|
+
expectedResult: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface E2ETestResult {
|
|
20
|
+
testName: string;
|
|
21
|
+
success: boolean;
|
|
22
|
+
duration: number;
|
|
23
|
+
error?: string;
|
|
24
|
+
steps: Array<{
|
|
25
|
+
step: E2ETestStep;
|
|
26
|
+
success: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class E2ERouteTester {
|
|
32
|
+
private tests: E2ETest[] = [];
|
|
33
|
+
private results: E2ETestResult[] = [];
|
|
34
|
+
|
|
35
|
+
addTest(test: E2ETest): void {
|
|
36
|
+
this.tests.push(test);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getTests(): E2ETest[] {
|
|
40
|
+
return this.tests;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async runTest(
|
|
44
|
+
test: E2ETest,
|
|
45
|
+
startTime: number,
|
|
46
|
+
endTime: number,
|
|
47
|
+
): Promise<E2ETestResult> {
|
|
48
|
+
const stepResults: Array<{
|
|
49
|
+
step: E2ETestStep;
|
|
50
|
+
success: boolean;
|
|
51
|
+
error?: string;
|
|
52
|
+
}> = [];
|
|
53
|
+
|
|
54
|
+
for (const step of test.steps) {
|
|
55
|
+
try {
|
|
56
|
+
await this.executeStep(step);
|
|
57
|
+
stepResults.push({ step, success: true });
|
|
58
|
+
} catch (error) {
|
|
59
|
+
const errorMessage =
|
|
60
|
+
error instanceof Error ? error.message : String(error);
|
|
61
|
+
stepResults.push({ step, success: false, error: errorMessage });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const duration = endTime - startTime;
|
|
66
|
+
const allStepsSucceeded = stepResults.every((r) => r.success);
|
|
67
|
+
const firstError = stepResults.find((r) => !r.success)?.error;
|
|
68
|
+
|
|
69
|
+
const result: E2ETestResult = {
|
|
70
|
+
testName: test.name,
|
|
71
|
+
success: allStepsSucceeded,
|
|
72
|
+
duration,
|
|
73
|
+
steps: stepResults,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
if (firstError !== undefined) {
|
|
77
|
+
result.error = firstError;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
this.results.push(result);
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async runAllTests(
|
|
85
|
+
startTime: number,
|
|
86
|
+
endTime: number,
|
|
87
|
+
): Promise<E2ETestResult[]> {
|
|
88
|
+
const results: E2ETestResult[] = [];
|
|
89
|
+
|
|
90
|
+
for (const test of this.tests) {
|
|
91
|
+
const result = await this.runTest(test, startTime, endTime);
|
|
92
|
+
results.push(result);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return results;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private async executeStep(step: E2ETestStep): Promise<void> {
|
|
99
|
+
switch (step.action) {
|
|
100
|
+
case "navigate":
|
|
101
|
+
await this.navigate(step.value || "");
|
|
102
|
+
break;
|
|
103
|
+
case "click":
|
|
104
|
+
await this.click(step.selector || "");
|
|
105
|
+
break;
|
|
106
|
+
case "fill":
|
|
107
|
+
await this.fill(step.selector || "", step.value || "");
|
|
108
|
+
break;
|
|
109
|
+
case "wait":
|
|
110
|
+
await this.wait(step.timeout || 1000);
|
|
111
|
+
break;
|
|
112
|
+
case "assert":
|
|
113
|
+
await this.assert(step.assertion || "");
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private async navigate(path: string): Promise<void> {
|
|
119
|
+
// Navigate to the specified path
|
|
120
|
+
window.history.pushState({}, "", path);
|
|
121
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private async click(selector: string): Promise<void> {
|
|
125
|
+
const element = document.querySelector(selector);
|
|
126
|
+
if (!element) {
|
|
127
|
+
throw new Error(`Element not found: ${selector}`);
|
|
128
|
+
}
|
|
129
|
+
(element as HTMLElement).click();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private async fill(selector: string, value: string): Promise<void> {
|
|
133
|
+
const element = document.querySelector(selector) as HTMLInputElement;
|
|
134
|
+
if (!element) {
|
|
135
|
+
throw new Error(`Element not found: ${selector}`);
|
|
136
|
+
}
|
|
137
|
+
element.value = value;
|
|
138
|
+
element.dispatchEvent(new Event("input", { bubbles: true }));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private async wait(timeout: number): Promise<void> {
|
|
142
|
+
return new Promise((resolve) => setTimeout(resolve, timeout));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private async assert(assertion: string): Promise<void> {
|
|
146
|
+
// Simple assertion implementation
|
|
147
|
+
// In a real implementation, this would evaluate the assertion
|
|
148
|
+
if (!assertion) {
|
|
149
|
+
throw new Error("Assertion is empty");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
getResults(): E2ETestResult[] {
|
|
154
|
+
return this.results;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
getTestStatistics(): {
|
|
158
|
+
total: number;
|
|
159
|
+
passed: number;
|
|
160
|
+
failed: number;
|
|
161
|
+
passRate: number;
|
|
162
|
+
averageDuration: number;
|
|
163
|
+
} {
|
|
164
|
+
const total = this.results.length;
|
|
165
|
+
const passed = this.results.filter((r) => r.success).length;
|
|
166
|
+
const failed = total - passed;
|
|
167
|
+
const passRate = total > 0 ? (passed / total) * 100 : 0;
|
|
168
|
+
const averageDuration =
|
|
169
|
+
total > 0
|
|
170
|
+
? this.results.reduce((sum, r) => sum + r.duration, 0) / total
|
|
171
|
+
: 0;
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
total,
|
|
175
|
+
passed,
|
|
176
|
+
failed,
|
|
177
|
+
passRate,
|
|
178
|
+
averageDuration,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
generateTestReport(): string {
|
|
183
|
+
const stats = this.getTestStatistics();
|
|
184
|
+
let report = "E2E Test Report\n";
|
|
185
|
+
report += "================\n\n";
|
|
186
|
+
report += `Total Tests: ${stats.total}\n`;
|
|
187
|
+
report += `Passed: ${stats.passed}\n`;
|
|
188
|
+
report += `Failed: ${stats.failed}\n`;
|
|
189
|
+
report += `Pass Rate: ${stats.passRate.toFixed(2)}%\n`;
|
|
190
|
+
report += `Average Duration: ${stats.averageDuration.toFixed(2)}ms\n\n`;
|
|
191
|
+
|
|
192
|
+
for (const result of this.results) {
|
|
193
|
+
report += `Test: ${result.testName}\n`;
|
|
194
|
+
report += `Status: ${result.success ? "PASSED" : "FAILED"}\n`;
|
|
195
|
+
report += `Duration: ${result.duration}ms\n`;
|
|
196
|
+
if (result.error) {
|
|
197
|
+
report += `Error: ${result.error}\n`;
|
|
198
|
+
}
|
|
199
|
+
report += "\n";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return report;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
clearResults(): void {
|
|
206
|
+
this.results = [];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
generateTestFromRoute(route: RouteConfig): E2ETest {
|
|
210
|
+
return {
|
|
211
|
+
name: `Test ${route.path}`,
|
|
212
|
+
description: `E2E test for route ${route.path}`,
|
|
213
|
+
route: route.path,
|
|
214
|
+
steps: [
|
|
215
|
+
{
|
|
216
|
+
action: "navigate",
|
|
217
|
+
value: route.path,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
action: "wait",
|
|
221
|
+
timeout: 1000,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
action: "assert",
|
|
225
|
+
assertion: "Page loaded successfully",
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
expectedResult: "Page should load without errors",
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
generateTestsFromRoutes(routes: RouteConfig[]): E2ETest[] {
|
|
233
|
+
return routes.map((route) => this.generateTestFromRoute(route));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export const createE2ERouteTester = (): E2ERouteTester => {
|
|
238
|
+
return new E2ERouteTester();
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// Helper function to create a test step
|
|
242
|
+
export function createTestStep(
|
|
243
|
+
action: E2ETestStep["action"],
|
|
244
|
+
options: Partial<E2ETestStep> = {},
|
|
245
|
+
): E2ETestStep {
|
|
246
|
+
return {
|
|
247
|
+
action,
|
|
248
|
+
...options,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Helper function to create an E2E test
|
|
253
|
+
export function createE2ETest(
|
|
254
|
+
name: string,
|
|
255
|
+
route: string,
|
|
256
|
+
steps: E2ETestStep[],
|
|
257
|
+
description = "",
|
|
258
|
+
expectedResult = "",
|
|
259
|
+
): E2ETest {
|
|
260
|
+
return {
|
|
261
|
+
name,
|
|
262
|
+
description,
|
|
263
|
+
route,
|
|
264
|
+
steps,
|
|
265
|
+
expectedResult,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { RouteMatch } from "../../../shared/types";
|
|
2
|
+
import { type Result, success } from "../../../shared/types";
|
|
3
|
+
|
|
4
|
+
export type ErrorHandler = (error: Error, route: RouteMatch) => void;
|
|
5
|
+
export type ErrorFallback = (error: Error, route: RouteMatch) => unknown;
|
|
6
|
+
|
|
7
|
+
export class RouteErrorBoundary {
|
|
8
|
+
private errorHandlers: Map<string, ErrorHandler> = new Map();
|
|
9
|
+
private errorFallbacks: Map<string, ErrorFallback> = new Map();
|
|
10
|
+
private globalErrorHandler?: ErrorHandler;
|
|
11
|
+
private globalErrorFallback?: ErrorFallback;
|
|
12
|
+
|
|
13
|
+
setGlobalErrorHandler(handler: ErrorHandler): void {
|
|
14
|
+
this.globalErrorHandler = handler;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
setGlobalErrorFallback(fallback: ErrorFallback): void {
|
|
18
|
+
this.globalErrorFallback = fallback;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
addErrorHandler(path: string, handler: ErrorHandler): void {
|
|
22
|
+
this.errorHandlers.set(path, handler);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
addErrorFallback(path: string, fallback: ErrorFallback): void {
|
|
26
|
+
this.errorFallbacks.set(path, fallback);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
handleError(error: Error, route: RouteMatch): Result<void> {
|
|
30
|
+
const handler =
|
|
31
|
+
this.errorHandlers.get(route.path) || this.globalErrorHandler;
|
|
32
|
+
if (handler) {
|
|
33
|
+
handler(error, route);
|
|
34
|
+
}
|
|
35
|
+
return success(undefined);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getErrorFallback(route: RouteMatch): ErrorFallback | null {
|
|
39
|
+
return (
|
|
40
|
+
this.errorFallbacks.get(route.path) || this.globalErrorFallback || null
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const createRouteErrorBoundary = (): RouteErrorBoundary => {
|
|
46
|
+
return new RouteErrorBoundary();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const createDefaultErrorFallback: ErrorFallback = (error) => {
|
|
50
|
+
return {
|
|
51
|
+
error: error.message,
|
|
52
|
+
stack: error.stack,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
export interface RouteError {
|
|
2
|
+
timestamp: number;
|
|
3
|
+
route: string;
|
|
4
|
+
error: Error;
|
|
5
|
+
errorType: string;
|
|
6
|
+
stackTrace?: string;
|
|
7
|
+
userAgent?: string;
|
|
8
|
+
userContext?: Record<string, unknown>;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ErrorAggregation {
|
|
13
|
+
route: string;
|
|
14
|
+
errorType: string;
|
|
15
|
+
count: number;
|
|
16
|
+
firstSeen: number;
|
|
17
|
+
lastSeen: number;
|
|
18
|
+
affectedUsers: Set<string>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class RouteErrorTracker {
|
|
22
|
+
private errors: RouteError[] = [];
|
|
23
|
+
private aggregations: Map<string, ErrorAggregation> = new Map();
|
|
24
|
+
private maxErrors = 1000;
|
|
25
|
+
private maxAggregations = 100;
|
|
26
|
+
|
|
27
|
+
recordError(
|
|
28
|
+
route: string,
|
|
29
|
+
error: Error,
|
|
30
|
+
now: number,
|
|
31
|
+
userContext?: Record<string, unknown>,
|
|
32
|
+
metadata?: Record<string, unknown>,
|
|
33
|
+
userAgent?: string,
|
|
34
|
+
): void {
|
|
35
|
+
const routeError: RouteError = {
|
|
36
|
+
timestamp: now,
|
|
37
|
+
route,
|
|
38
|
+
error,
|
|
39
|
+
errorType: error.name,
|
|
40
|
+
...(error.stack !== undefined && { stackTrace: error.stack }),
|
|
41
|
+
...(userAgent !== undefined && { userAgent }),
|
|
42
|
+
...(userContext !== undefined && { userContext }),
|
|
43
|
+
...(metadata !== undefined && { metadata }),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
this.errors.push(routeError);
|
|
47
|
+
|
|
48
|
+
// Keep only last maxErrors
|
|
49
|
+
if (this.errors.length > this.maxErrors) {
|
|
50
|
+
this.errors = this.errors.slice(-this.maxErrors);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Update aggregation
|
|
54
|
+
this.updateAggregation(routeError);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private updateAggregation(error: RouteError): void {
|
|
58
|
+
const key = `${error.route}:${error.errorType}`;
|
|
59
|
+
const existing = this.aggregations.get(key);
|
|
60
|
+
|
|
61
|
+
if (existing) {
|
|
62
|
+
existing.count++;
|
|
63
|
+
existing.lastSeen = error.timestamp;
|
|
64
|
+
if (error.userContext?.userId) {
|
|
65
|
+
existing.affectedUsers.add(String(error.userContext.userId));
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
const affectedUsers = new Set<string>();
|
|
69
|
+
if (error.userContext?.userId) {
|
|
70
|
+
affectedUsers.add(String(error.userContext.userId));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
this.aggregations.set(key, {
|
|
74
|
+
route: error.route,
|
|
75
|
+
errorType: error.errorType,
|
|
76
|
+
count: 1,
|
|
77
|
+
firstSeen: error.timestamp,
|
|
78
|
+
lastSeen: error.timestamp,
|
|
79
|
+
affectedUsers,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Keep only last maxAggregations
|
|
83
|
+
if (this.aggregations.size > this.maxAggregations) {
|
|
84
|
+
const oldestKey = this.getOldestAggregationKey();
|
|
85
|
+
if (oldestKey) {
|
|
86
|
+
this.aggregations.delete(oldestKey);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private getOldestAggregationKey(): string | null {
|
|
93
|
+
let oldestKey: string | null = null;
|
|
94
|
+
let oldestTime = Infinity;
|
|
95
|
+
|
|
96
|
+
for (const [key, agg] of this.aggregations) {
|
|
97
|
+
if (agg.firstSeen < oldestTime) {
|
|
98
|
+
oldestTime = agg.firstSeen;
|
|
99
|
+
oldestKey = key;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return oldestKey;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
getErrors(route?: string): RouteError[] {
|
|
107
|
+
if (route) {
|
|
108
|
+
return this.errors.filter((e) => e.route === route);
|
|
109
|
+
}
|
|
110
|
+
return [...this.errors];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
getErrorsByType(errorType: string): RouteError[] {
|
|
114
|
+
return this.errors.filter((e) => e.errorType === errorType);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
getErrorsInTimeRange(startTime: number, endTime: number): RouteError[] {
|
|
118
|
+
return this.errors.filter(
|
|
119
|
+
(e) => e.timestamp >= startTime && e.timestamp <= endTime,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
getAggregations(): ErrorAggregation[] {
|
|
124
|
+
return Array.from(this.aggregations.values());
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
getAggregationsByRoute(route: string): ErrorAggregation[] {
|
|
128
|
+
return this.getAggregations().filter((a) => a.route === route);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
getTopErrors(limit = 10): ErrorAggregation[] {
|
|
132
|
+
return this.getAggregations()
|
|
133
|
+
.sort((a, b) => b.count - a.count)
|
|
134
|
+
.slice(0, limit);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
getErrorRate(route: string, now: number, timeWindowMs = 60000): number {
|
|
138
|
+
const recentErrors = this.errors.filter(
|
|
139
|
+
(e) => e.route === route && e.timestamp >= now - timeWindowMs,
|
|
140
|
+
);
|
|
141
|
+
return recentErrors.length;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
getErrorStatistics(now: number): {
|
|
145
|
+
totalErrors: number;
|
|
146
|
+
uniqueRoutes: number;
|
|
147
|
+
uniqueErrorTypes: number;
|
|
148
|
+
topError: string | null;
|
|
149
|
+
errorRate: number;
|
|
150
|
+
} {
|
|
151
|
+
const uniqueRoutes = new Set(this.errors.map((e) => e.route)).size;
|
|
152
|
+
const uniqueErrorTypes = new Set(this.errors.map((e) => e.errorType)).size;
|
|
153
|
+
const topError = this.getTopErrors(1)[0] || null;
|
|
154
|
+
|
|
155
|
+
// Calculate error rate (errors per minute in last hour)
|
|
156
|
+
const lastHourErrors = this.errors.filter(
|
|
157
|
+
(e) => e.timestamp >= now - 3600000,
|
|
158
|
+
);
|
|
159
|
+
const errorRate = lastHourErrors.length / 60;
|
|
160
|
+
|
|
161
|
+
return {
|
|
162
|
+
totalErrors: this.errors.length,
|
|
163
|
+
uniqueRoutes,
|
|
164
|
+
uniqueErrorTypes,
|
|
165
|
+
topError: topError ? `${topError.route}:${topError.errorType}` : null,
|
|
166
|
+
errorRate,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
clearErrors(route?: string): void {
|
|
171
|
+
if (route) {
|
|
172
|
+
this.errors = this.errors.filter((e) => e.route !== route);
|
|
173
|
+
} else {
|
|
174
|
+
this.errors = [];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
clearAggregations(route?: string): void {
|
|
179
|
+
if (route) {
|
|
180
|
+
for (const [key, agg] of this.aggregations) {
|
|
181
|
+
if (agg.route === route) {
|
|
182
|
+
this.aggregations.delete(key);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} else {
|
|
186
|
+
this.aggregations.clear();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
clearAll(): void {
|
|
191
|
+
this.errors = [];
|
|
192
|
+
this.aggregations.clear();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
setMaxErrors(max: number): void {
|
|
196
|
+
this.maxErrors = max;
|
|
197
|
+
if (this.errors.length > max) {
|
|
198
|
+
this.errors = this.errors.slice(-max);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
setMaxAggregations(max: number): void {
|
|
203
|
+
this.maxAggregations = max;
|
|
204
|
+
while (this.aggregations.size > max) {
|
|
205
|
+
const oldestKey = this.getOldestAggregationKey();
|
|
206
|
+
if (oldestKey) {
|
|
207
|
+
this.aggregations.delete(oldestKey);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
generateErrorReport(now: number): string {
|
|
213
|
+
const stats = this.getErrorStatistics(now);
|
|
214
|
+
let report = "Route Error Report\n";
|
|
215
|
+
report += "===================\n\n";
|
|
216
|
+
report += `Total Errors: ${stats.totalErrors}\n`;
|
|
217
|
+
report += `Unique Routes: ${stats.uniqueRoutes}\n`;
|
|
218
|
+
report += `Unique Error Types: ${stats.uniqueErrorTypes}\n`;
|
|
219
|
+
report += `Error Rate: ${stats.errorRate.toFixed(2)}/min\n`;
|
|
220
|
+
if (stats.topError) {
|
|
221
|
+
report += `Top Error: ${stats.topError}\n`;
|
|
222
|
+
}
|
|
223
|
+
report += "\n";
|
|
224
|
+
|
|
225
|
+
report += "Top Errors:\n";
|
|
226
|
+
const topErrors = this.getTopErrors(5);
|
|
227
|
+
for (const error of topErrors) {
|
|
228
|
+
report += `\n${error.route} - ${error.errorType}\n`;
|
|
229
|
+
report += ` Count: ${error.count}\n`;
|
|
230
|
+
report += ` Affected Users: ${error.affectedUsers.size}\n`;
|
|
231
|
+
report += ` First Seen: ${new Date(error.firstSeen).toISOString()}\n`;
|
|
232
|
+
report += ` Last Seen: ${new Date(error.lastSeen).toISOString()}\n`;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return report;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
exportErrorsAsJSON(now: number): string {
|
|
239
|
+
return JSON.stringify(
|
|
240
|
+
{
|
|
241
|
+
statistics: this.getErrorStatistics(now),
|
|
242
|
+
aggregations: this.getAggregations().map((a) => ({
|
|
243
|
+
...a,
|
|
244
|
+
affectedUsers: Array.from(a.affectedUsers),
|
|
245
|
+
})),
|
|
246
|
+
recentErrors: this.errors.slice(-50),
|
|
247
|
+
},
|
|
248
|
+
null,
|
|
249
|
+
2,
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export const createRouteErrorTracker = (): RouteErrorTracker => {
|
|
255
|
+
return new RouteErrorTracker();
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// Helper function to create a route error
|
|
259
|
+
export function createRouteError(
|
|
260
|
+
route: string,
|
|
261
|
+
error: Error,
|
|
262
|
+
now: number,
|
|
263
|
+
userContext?: Record<string, unknown>,
|
|
264
|
+
metadata?: Record<string, unknown>,
|
|
265
|
+
userAgent?: string,
|
|
266
|
+
): RouteError {
|
|
267
|
+
return {
|
|
268
|
+
timestamp: now,
|
|
269
|
+
route,
|
|
270
|
+
error,
|
|
271
|
+
errorType: error.name,
|
|
272
|
+
...(error.stack !== undefined && { stackTrace: error.stack }),
|
|
273
|
+
...(userAgent !== undefined && { userAgent }),
|
|
274
|
+
...(userContext !== undefined && { userContext }),
|
|
275
|
+
...(metadata !== undefined && { metadata }),
|
|
276
|
+
};
|
|
277
|
+
}
|