@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
package/dist/vite.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{existsSync as e,mkdirSync as t,readdirSync as n,writeFileSync as r}from"node:fs";import{basename as i,dirname as a,join as o,sep as s}from"node:path";import{pathToFileURL as c}from"node:url";import{createHash as l}from"node:crypto";const u={Title:`@wrikka/solid-framework/head`,Meta:`@wrikka/solid-framework/head`,Link:`@wrikka/solid-framework/head`,useHead:`@wrikka/solid-framework/head`,useSeoMeta:`@wrikka/solid-framework/head`,createServerFn:`@wrikka/solid-framework/server`,createRouteLoader:`@wrikka/solid-framework/server`,serverOnly:`@wrikka/solid-framework/server`,createAction:`@wrikka/solid-framework/actions`,useSubmission:`@wrikka/solid-framework/actions`,Island:`@wrikka/solid-framework/render`},d=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),f=(e,t)=>{let n=/* @__PURE__ */ new Map;for(let[r,i]of Object.entries(t))if(RegExp(`(\\b${d(r)}\\s*[(<]|<${d(r)}[\\s>/])`).test(e)&&!RegExp(`(?:import[\\s\\S]*\\b${d(r)}\\b[\\s\\S]*from|(?:const|let|var|function|class)\\s+${d(r)}\\b)`).test(e))for(let e of Array.isArray(i)?i:[i]){let t=n.get(e)??/* @__PURE__ */ new Set;t.add(r),n.set(e,t)}return n.size===0?null:`${[...n.entries()].map(([e,t])=>`import { ${[...t].sort().join(`, `)} } from "${e}";`).join(`
|
|
2
|
+
`)}\n${e}`},p=async e=>{let t=`http://${e.headers.host??`localhost`}${e.url??`/`}`,n=e.method??`GET`,r=new Headers;for(let[t,n]of Object.entries(e.headers))n!==void 0&&r.set(t,Array.isArray(n)?n.join(`, `):n);if(n===`GET`||n===`HEAD`)return new Request(t,{method:n,headers:r});let i=[];for await(let t of e)i.push(t);return new Request(t,{method:n,headers:r,body:Buffer.concat(i)})},m=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`),h=e=>`<!doctype html><html><head><meta charset="utf-8"><title>SSR Error</title><style>body{margin:0;font:14px/1.5 ui-monospace,monospace;background:#1a0505;color:#fca5a5}.wrap{padding:2rem;max-width:960px;margin:auto}h1{color:#ef4444;font-size:1.25rem}pre{background:#2a0a0a;border:1px solid #7f1d1d;border-radius:8px;padding:1rem;overflow:auto;white-space:pre-wrap}</style></head><body><div class="wrap"><h1>[solid-framework] SSR render error</h1><pre>${m(e.stack??e.message)}</pre></div></body></html>`,g=async(e,t)=>{if(e.statusCode=t.status,t.headers.forEach((t,n)=>{e.setHeader(n,t)}),!t.body){e.end();return}let n=t.body.getReader();try{for(;;){let{done:t,value:r}=await n.read();if(t)break;e.write(Buffer.from(r))}}finally{e.end()}},_=(e,t)=>(n,r,i)=>{let a=n.url?.split(`?`)[0]??`/`;if(!(a===`/sitemap.xml`||a===`/robots.txt`||a===`/favicon.ico`||a.startsWith(`/_server/`)||a.startsWith(`/_docs/`)||a===`/_og`||a===`/_image`)&&(a.startsWith(`/@`)||a.startsWith(`/node_modules/`)||a.startsWith(`/src/`)||a.includes(`.`)&&!a.endsWith(`/`))){i();return}(async()=>{try{let i=await e.ssrLoadModule(`/${t.entries.server}`),a=i.default??i.fetch??i.handler;if(!a)throw Error(`[solid-framework] ${t.entries.server} must export a fetch handler (default, fetch, or handler)`);let o=await a(await p(n));await g(r,o)}catch(t){e.ssrFixStacktrace(t),r.statusCode=500,r.setHeader(`Content-Type`,`text/html; charset=utf-8`),r.end(h(t))}})()},v={routesDir:`src/routes`,renderMode:`stream`,rules:{},apiPrefixes:[`/api`],head:{},autoImports:!0,entries:{server:`src/entry-server.tsx`,client:`src/entry-client.tsx`},publicEnvPrefixes:[`PUBLIC_`]},y=(e,t)=>({...e,...t,head:{...e.head,...t.head},entries:{...e.entries,...t.entries},rules:{...e.rules,...t.routeRules,...t.rules},routeRules:{...e.routeRules,...t.routeRules},middleware:[...e.middleware??[],...t.middleware??[]],plugins:[...e.plugins??[],...t.plugins??[]],extends:[...e.extends??[],...t.extends??[]]}),b=(e={})=>{let t={},n=e=>{for(let t of e.extends??[])n(t);t=y(t,e)};n(e);let r=t.extends,i={...v,...t,head:{...v.head,...t.head},entries:{...v.entries,...t.entries},publicEnvPrefixes:t.publicEnvPrefixes??v.publicEnvPrefixes,apiPrefixes:t.apiPrefixes??v.apiPrefixes,rules:{...t.routeRules,...t.rules},extends:r};for(let e of i.plugins??[]){let t=e.config?.(i);t&&(i={...i,...t,plugins:i.plugins})}return i},x=/\.(tsx|ts|jsx|js|md|mdx)$/,S=/\.(md|mdx)$/,ee=/^\[\.\.\.(.+)\]$/,C=/^\[(.+)\]$/,w=/^\(.+\)$/,T=/^\(\.+\)(.+)$/,E=/^@(.+)$/,D=/^_/,O=/* @__PURE__ */ new Set([`layout`,`error`,`loading`,`not-found`,`middleware`]),k=e=>e.replace(/\\/g,`/`),A=e=>e.replace(x,``),j=e=>A(k(e)).split(`/`),M=e=>{let t=e.match(T);if(t)return{text:t[1]??e,kind:`static`,group:!1};if(E.test(e))return{text:e,kind:`static`,group:!0};if(w.test(e))return{text:``,kind:`static`,group:!0};let n=e.match(ee);if(n)return{text:n[1]??`all`,kind:`splat`,group:!1};let r=e.match(C);return r?{text:r[1]??``,kind:`param`,group:!1}:{text:e,kind:`static`,group:!1}},N=(e,t)=>!O.has(t)&&!e.some(e=>D.test(e.text))&&!D.test(t),te=e=>e.reduce((e,t)=>e*4+(t.kind===`static`?3:t.kind===`param`?2:1),0),ne=e=>{let t=k(e).split(`/`);return t.pop(),t},re=(e,t)=>{let n=ne(e),r=[];for(let e=n.length;e>=0;e--){let i=n.slice(0,e).join(`/`);r.push(i?`${t}/${i}`:t)}return r},P=e=>{let t=/* @__PURE__ */ new Map;for(let n of e){let e=k(n),r=A(e.split(`/`).pop()??``);if(!O.has(r))continue;let i=e.replace(/\/[^/]*$/,``),a=t.get(i)??/* @__PURE__ */ new Map;a.set(r,n),t.set(i,a)}return t},F=(e,t,n)=>{for(let r of t){let t=e.get(r)?.get(n);if(t)return t}},I=(e,t)=>{let n=[];for(let r of[...t].reverse()){let t=e.get(r)?.get(`middleware`);t&&n.push(t)}return n},L=(e,t)=>{let n=[];for(let r of[...t].reverse()){let t=e.get(r)?.get(`layout`);t&&n.push(t)}return n},R=(e,t=`src/routes`)=>{let n=k(t).replace(/\/$/,``),r=P(e),i=[];for(let t of e){let e=k(t);if(!e.startsWith(`${n}/`))continue;let a=e.slice(n.length+1),o=j(a).map(M),s=A(a.split(`/`).pop()??``);if(!N(o,s))continue;let c=s.endsWith(`.api`),l=S.test(e),u=c?s.slice(0,-4):s,d=u===`index`||u===`page`?o.slice(0,-1):[...o.slice(0,-1),M(u)],f=[],p=[];for(let e of d)e.group||(e.kind===`param`?(f.push(e.text),p.push(`:${e.text}`)):e.kind===`splat`?(f.push(e.text),p.push(`*${e.text}`)):p.push(e.text));let m=re(a,n),h=j(a),g=h.some(e=>T.test(e)),_=h.map(e=>e.match(E)).find(Boolean)?.[1],v={path:`/${p.join(`/`)}`.replace(/\/$/,``)||`/`,file:t,...g?{intercepted:!0}:{},..._?{slot:_}:{},...c?{kind:`api`}:{},...l?{kind:`content`}:{},layouts:c?[]:L(r,m),middleware:I(r,m),params:f,score:te(d.filter(e=>!e.group))};if(!c){let e=F(r,m,`error`),t=F(r,m,`loading`),n=F(r,m,`not-found`);e&&(v.error=e),t&&(v.loading=t),n&&(v.notFound=n)}i.push(v)}return i.sort((e,t)=>t.score-e.score)};function z(e={}){let{routesDir:t=`src/routes`,routeExtensions:n=[`.tsx`,`.ts`,`.jsx`,`.js`],autoImport:r=!0,devTools:i=!0,performanceMonitoring:a=!1,codeSplitting:o=!0,i18n:s=!1,featureFlags:c=!1,securityScanning:l=!1,caching:u=!0,predictivePreloading:d=!1,errorTracking:f=!1,generateTypes:p=!0,typesOutputDir:m=`src/types`,hmr:h=!0,logger:g}=e;return{name:`solid-framework:app-router`,config(e,{command:t}){let n=t===`serve`;return{resolve:{alias:{"@wrikka/solid-framework/router":new URL(`../src/index.ts`,import.meta.url).href}},define:{__SOLID_ROUTER_DEVTOOLS__:JSON.stringify(n&&(i??!0)),__SOLID_ROUTER_PERFORMANCE__:JSON.stringify(a),__SOLID_ROUTER_CODE_SPLITTING__:JSON.stringify(o),__SOLID_ROUTER_I18N__:JSON.stringify(s),__SOLID_ROUTER_FEATURE_FLAGS__:JSON.stringify(c),__SOLID_ROUTER_SECURITY__:JSON.stringify(l),__SOLID_ROUTER_CACHING__:JSON.stringify(u),__SOLID_ROUTER_PRELOADING__:JSON.stringify(d),__SOLID_ROUTER_ERROR_TRACKING__:JSON.stringify(f),__SOLID_ROUTER_HMR__:JSON.stringify(n&&h)}}},async buildStart(){p&&g?.log(`Route types generation enabled for ${t} -> ${m}`)},configureServer(e){h&&e.watcher.on(`change`,async n=>{n.startsWith(t)&&e.ws.send({type:`full-reload`,path:`*`})})}}}const B=e=>{let t=/* @__PURE__ */ new Set;for(let n of e.matchAll(/href="(\/[^"#]*)"/g)){let e=(n[1]??``).split(`?`)[0];e&&!e.startsWith(`//`)&&t.add(e)}return[...t]},V=(e,t)=>o(e,t===`/`?`index.html`:`${t.replace(/^\/+|\/+$/g,``)}/index.html`),H=async(e,n)=>{let i=n.base??`http://localhost`,o=[...n.routes??[`/`]],s=/* @__PURE__ */ new Set,c=[];for(;o.length>0;){let l=o.shift();if(s.has(l))continue;s.add(l);let u=await e(new Request(`${i}${l}`));if(!u.ok)continue;let d=await u.text(),f=V(n.outDir,l);if(t(a(f),{recursive:!0}),r(f,d),c.push({path:l,file:f,status:u.status}),n.crawlLinks)for(let e of B(d))s.has(e)||o.push(e)}return c},U=(e,t)=>`sf_${l(`sha256`).update(`${e}#${t}`).digest(`hex`).slice(0,12)}`,W=(e,t)=>{let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(t===`{`)n++;else if(t===`}`&&(n--,n===0))return r}return-1},G=(e,t)=>{if(!e.includes(`createServerFn(`))return e;let n=/createServerFn\s*\(\s*\{/g,r=``,i=0,a=0,o;for(;(o=n.exec(e))!==null;){let n=o.index+o[0].length-1,s=W(e,n);if(s===-1)break;let c=e.slice(n+1,s);a++,!/(^|[\s,}])id\s*:/.test(c)&&(r+=e.slice(i,n+1),r+=`id: "${U(t,a)}",`,i=n+1)}return i>0?r+e.slice(i):e},K=`virtual:solid-framework/config`,q=`virtual:solid-framework/routes`,J=`virtual:solid-framework/server-fns`,Y=(e,t)=>t?[`import * as _instr from ${JSON.stringify(t)};`,`export default Object.assign(${JSON.stringify(e)}, {`,` instrumentation: {`,` register: _instr.register,`,` onRequest: _instr.onRequest,`,` onError: _instr.onError,`,` },`,`});`].join(`
|
|
3
|
+
`):`export default ${JSON.stringify(e)};`,X=e=>[`import { buildRouteManifest, preloadFileRoute } from "@wrikka/solid-framework/internal";`,`const modules = import.meta.glob("/${e}/**/*.{tsx,ts,jsx,js}");`,`export const routeFiles = Object.keys(modules).map((file) => file.slice(1));`,`export const routeModules = Object.fromEntries(Object.entries(modules).map(([k, v]) => [k.slice(1), v]));`,`export const manifest = buildRouteManifest(routeFiles, ${JSON.stringify(e)});`,`export const preloadRoute = (path) => preloadFileRoute(path, manifest, routeModules);`,`export default manifest;`].join(`
|
|
4
|
+
`),Z=()=>[`const modules = import.meta.glob("/src/**/*.{server,fn}.{ts,tsx}", { eager: true });`,`export const serverModules = modules;`,`export default modules;`].join(`
|
|
5
|
+
`),Q=e=>[`throw new Error(`,` "[solid-framework] \\"${e}\\" is a .server module and cannot be imported from the client. Move the import into a loader, createServerFn handler, or .server.ts file."`,`);`].join(`
|
|
6
|
+
`),$=e=>/\.server\.(ts|tsx|js|jsx|mts|cts)$/.test(e.split(`?`)[0]??e),ie=e=>`${e}`,ae=(t={})=>{let r=b(t.config),a=t.autoImports===!1?null:{...u,...typeof t.autoImports==`object`?t.autoImports:{}},l=``,d=`dist/server`,p,m=[{name:`solid-framework`,enforce:`pre`,configResolved(t){l=t.root,process.env.SOLID_SSR_BUILD===`1`&&(d=t.build.outDir);for(let n of[t.root,o(t.root,`src`)])for(let t of[`ts`,`tsx`]){let r=o(n,`instrumentation.${t}`);e(r)&&(p=r.split(s).join(`/`))}},config(e,t){return{ssr:{noExternal:[`@wrikka/solid-framework`]},...t.isSsrBuild===!0?{build:{rollupOptions:{external:[`@wrikka/web-server-toolkit`,/^bun(:|$)/]}}}:{},server:{watch:{ignored:[`**/dist/**`]}}}},resolveId(e,t,n){return e===`virtual:solid-framework/config`||e===`virtual:solid-framework/routes`||e===`virtual:solid-framework/server-fns`?ie(e):e===`@wrikka/web-server-toolkit`&&n?.ssr!==!0?`\0web-server`:null},load(e,t){if(e.startsWith(`\0`)){let n=e.slice(1);return n===`virtual:solid-framework/config`?Y(r,t?.ssr===!0?p:void 0):n===`virtual:solid-framework/routes`?X(r.routesDir):n===`virtual:solid-framework/server-fns`?Z():n===`web-server`?`const fail = () => { throw new Error("[solid-framework] @wrikka/web-server-toolkit is server-only and cannot run on the client"); };
|
|
7
|
+
export const createRequestHandler = fail;
|
|
8
|
+
export default fail;
|
|
9
|
+
`:null}return $(e)&&t?.ssr!==!0?Q(e):null},transform(e,t){if(!/\.[jt]sx?$/.test(t)||t.includes(`node_modules`)||$(t))return null;let n=a?f(e,a):null,i=n??e,o=G(i,t);o!==i&&(i=o,n=i);for(let e of r.plugins??[]){let r=e.transform?.(i,t);r!=null&&(i=r,n=r)}return n===null?null:{code:i,map:null}},buildStart(){if(!e(r.routesDir))return;let t=[],i=e=>{for(let r of n(e,{withFileTypes:!0})){let n=o(e,r.name);r.isDirectory()?i(n):t.push(n.split(s).join(`/`))}};i(r.routesDir);let a=R(t,r.routesDir);for(let e of r.plugins??[])e.routesResolved?.(a)},handleHotUpdate({file:e,server:t}){let n=`${r.routesDir.split(`/`).join(s)}${s}`;e.split(`/`).join(s).startsWith(n)&&t.ws.send({type:`full-reload`})},configureServer(e){t.ssrMiddleware!==!1&&e.middlewares.use(_(e,r))},generateBundle(e,t){if(process.env.SOLID_SSR_BUILD===`1`)return;let n=Object.values(t).filter(e=>e.type===`chunk`&&e.isEntry||e.fileName.endsWith(`.css`)).map(e=>`/${e.fileName}`);if(n.length&&this.emitFile({type:`asset`,fileName:`preload-manifest.json`,source:JSON.stringify({preloads:n})}),!r.pwa)return;let i=r.pwa,a=[`/`,...i.precache??[],...i.manifest?[`/manifest.webmanifest`]:[]];this.emitFile({type:`asset`,fileName:`sw.js`,source:`const CACHE="sf-v1";const PRECACHE=${JSON.stringify(a)};self.addEventListener("install",e=>{e.waitUntil(caches.open(CACHE).then(c=>c.addAll(PRECACHE)).then(()=>self.skipWaiting()))});self.addEventListener("activate",e=>{e.waitUntil(self.clients.claim())});self.addEventListener("fetch",e=>{if(e.request.method!=="GET")return;const nav=e.request.mode==="navigate"||(e.request.headers.get("accept")||"").includes("text/html");if(nav){e.respondWith(fetch(e.request).then(res=>{const copy=res.clone();caches.open(CACHE).then(c=>c.put(e.request,copy));return res}).catch(()=>caches.match(e.request).then(r=>r||caches.match("/"))));return}e.respondWith(caches.match(e.request).then(r=>r||fetch(e.request).then(res=>{const copy=res.clone();caches.open(CACHE).then(c=>c.put(e.request,copy));return res})))});`}),i.manifest&&this.emitFile({type:`asset`,fileName:`manifest.webmanifest`,source:JSON.stringify({name:i.manifest.name??`app`,short_name:i.manifest.shortName??i.manifest.name??`app`,start_url:i.manifest.startUrl??`/`,display:i.manifest.display??`standalone`,background_color:i.manifest.background??`#ffffff`,theme_color:i.manifest.theme??`#000000`,icons:i.manifest.icons??[]})})},async closeBundle(){if(process.env.SOLID_SSR_BUILD!==`1`||!r.prerender)return;let e=r.prerender;if(!e.routes?.length&&!e.crawlLinks)return;let t=o(l||`.`,d,i(r.entries.server).replace(/\.[jt]sx?$/,`.js`)),n=(await import(c(t).href)).default;if(typeof n!=`function`){console.warn(`[solid-framework] prerender skipped — server entry has no default fetch handler`);return}let a=await H(n,{routes:e.routes,crawlLinks:e.crawlLinks,outDir:e.outDir??o(l||`.`,`dist`)});console.log(`[solid-framework] prerendered ${a.length} route(s): ${a.map(e=>e.path).join(`, `)}`)}}];return t.router!==!1&&m.push(z(t.router??{})),m};export{u as FRAMEWORK_AUTO_IMPORTS,K as VIRTUAL_CONFIG,q as VIRTUAL_ROUTES,J as VIRTUAL_SERVER_FNS,Y as configModuleCode,_ as createSsrMiddleware,B as extractLinks,f as injectAutoImports,G as injectServerFnIds,$ as isServerModuleId,H as prerenderToDisk,X as routesModuleCode,Z as serverFnsModuleCode,Q as serverStubCode,ae as solidFramework};
|
|
10
|
+
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","names":["FRAMEWORK_AUTO_IMPORTS","escapeRegExp","value","injectAutoImports","additions","name","specifier","map","code","source","names","toWebRequest","url","req","method","headers","key","chunks","chunk","escapeHtml","text","errorOverlayHtml","error","writeResponse","response","res","reader","done","createSsrMiddleware","pathname","next","mod","server","config","handler","defaultConfig","mergeLayer","base","layer","resolveConfig","merged","visit","cfg","user","layers","plugin","patch","MODULE_EXT","CONTENT_EXT","CATCH_ALL","PARAM","GROUP","INTERCEPT","SLOT","PRIVATE","CONVENTION_NAMES","normalize","file","stripExt","splitSegments","relative","parseSegment","intercepted","raw","splat","param","isRouteFile","fileName","segments","s","scoreRoute","score","seg","dirSegments","segs","ancestorDirs","dirs","chain","i","dir","root","conventionIndex","index","files","rel","entry","findConvention","ancestors","found","middlewareChain","mw","layoutChain","layout","buildRouteManifest","routesDir","conventions","routes","relPath","isApi","isContent","routeName","urlSegments","params","parts","rawSegs","slotSeg","route","loading","notFound","b","a","solidRouterPlugin","_routeExtensions","_autoImport","options","isDev","command","devTools","performanceMonitoring","codeSplitting","i18n","featureFlags","securityScanning","caching","predictivePreloading","errorTracking","hmr","generateTypes","logger","typesOutputDir","extractLinks","links","match","html","path","outFile","join","outDir","prerenderToDisk","queue","seen","written","mkdirSync","dirname","writeFileSync","link","stableId","createHash","fileId","matchingBrace","depth","open","ch","injectServerFnIds","pattern","out","cursor","close","body","VIRTUAL_CONFIG","VIRTUAL_ROUTES","VIRTUAL_SERVER_FNS","configModuleCode","instrumentationPath","routesModuleCode","serverFnsModuleCode","serverStubCode","id","isServerModuleId","resolveVirtualId","solidFramework","autoImportMap","rootDir","ssrOutDir","plugins","resolved","ext","candidate","existsSync","sep","env","resolveOptions","virtual","loadOptions","current","withIds","walk","readdirSync","full","manifest","routesRoot","entries","bundle","o","pwa","precache","pre","entryFile","basename","pathToFileURL","w"],"sources":["../src/vite/auto-imports.ts","../src/vite/dev-middleware.ts","../src/app/modules/config/domain/models/config.ts","../src/app/modules/file-routes/domain/operations/manifest.ts","../src/router/vite-plugin/vite-plugin-core.ts","../src/vite/prerender.ts","../src/vite/server-fn-ids.ts","../src/vite/types/index.ts","../src/vite/virtual-modules.ts","../src/vite/plugin.ts"],"sourcesContent":["/**\n * Auto Imports\n * Conservative transform: inject framework imports for configured identifiers\n * that are used but not declared — the Nuxt auto-import equivalent\n */\n\nexport const FRAMEWORK_AUTO_IMPORTS: Record<string, string> = {\n\t// head\n\tTitle: \"@wrikka/solid-framework/head\",\n\tMeta: \"@wrikka/solid-framework/head\",\n\tLink: \"@wrikka/solid-framework/head\",\n\tuseHead: \"@wrikka/solid-framework/head\",\n\tuseSeoMeta: \"@wrikka/solid-framework/head\",\n\t// server\n\tcreateServerFn: \"@wrikka/solid-framework/server\",\n\tcreateRouteLoader: \"@wrikka/solid-framework/server\",\n\tserverOnly: \"@wrikka/solid-framework/server\",\n\t// actions\n\tcreateAction: \"@wrikka/solid-framework/actions\",\n\tuseSubmission: \"@wrikka/solid-framework/actions\",\n\t// render\n\tIsland: \"@wrikka/solid-framework/render\",\n};\n\nconst escapeRegExp = (value: string): string =>\n\tvalue.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Returns the import statements to prepend, or null when nothing is needed.\n * Only injects names that are (a) called/used, (b) not already imported,\n * (c) not locally declared (const/let/function/class/import).\n */\nexport const injectAutoImports = (\n\tcode: string,\n\tmap: Record<string, string | string[]>,\n): string | null => {\n\tconst additions = new Map<string, Set<string>>();\n\n\tfor (const [name, specifier] of Object.entries(map)) {\n\t\t// used = called/generically-typed (`name(`, `name<`) or JSX (`<Name`)\n\t\tconst used = new RegExp(\n\t\t\t`(\\\\b${escapeRegExp(name)}\\\\s*[(<]|<${escapeRegExp(name)}[\\\\s>/])`,\n\t\t).test(code);\n\t\tif (!used) continue;\n\n\t\tconst declared = new RegExp(\n\t\t\t`(?:import[\\\\s\\\\S]*\\\\b${escapeRegExp(name)}\\\\b[\\\\s\\\\S]*from|(?:const|let|var|function|class)\\\\s+${escapeRegExp(name)}\\\\b)`,\n\t\t).test(code);\n\t\tif (declared) continue;\n\n\t\tfor (const source of Array.isArray(specifier) ? specifier : [specifier]) {\n\t\t\tconst names = additions.get(source) ?? new Set<string>();\n\t\t\tnames.add(name);\n\t\t\tadditions.set(source, names);\n\t\t}\n\t}\n\n\tif (additions.size === 0) return null;\n\n\tconst lines = [...additions.entries()].map(\n\t\t([source, names]) =>\n\t\t\t`import { ${[...names].sort().join(\", \")} } from \"${source}\";`,\n\t);\n\treturn `${lines.join(\"\\n\")}\\n${code}`;\n};\n","/**\n * Dev SSR Middleware\n * Runs the app server entry inside the Vite dev server\n */\n\nimport type { IncomingMessage, ServerResponse } from \"node:http\";\nimport type { ViteDevServer } from \"vite\";\nimport type { SolidFrameworkConfig } from \"#app/types\";\n\ninterface ServerEntryModule {\n\tdefault?: (request: Request) => Promise<Response>;\n\tfetch?: (request: Request) => Promise<Response>;\n\thandler?: (request: Request) => Promise<Response>;\n}\n\nconst toWebRequest = async (req: IncomingMessage): Promise<Request> => {\n\tconst host = req.headers.host ?? \"localhost\";\n\tconst url = `http://${host}${req.url ?? \"/\"}`;\n\tconst method = req.method ?? \"GET\";\n\n\tconst headers = new Headers();\n\tfor (const [key, value] of Object.entries(req.headers)) {\n\t\tif (value === undefined) continue;\n\t\theaders.set(key, Array.isArray(value) ? value.join(\", \") : value);\n\t}\n\n\tif (method === \"GET\" || method === \"HEAD\") {\n\t\treturn new Request(url, { method, headers });\n\t}\n\n\tconst chunks: Buffer[] = [];\n\tfor await (const chunk of req) chunks.push(chunk as Buffer);\n\treturn new Request(url, {\n\t\tmethod,\n\t\theaders,\n\t\tbody: Buffer.concat(chunks),\n\t});\n};\n\nconst escapeHtml = (text: string): string =>\n\ttext.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\");\n\n/**\n * Dev error overlay — styled page with the SSR stack, mirroring the\n * vite error overlay experience for render-time failures\n */\nconst errorOverlayHtml = (error: Error): string =>\n\t`<!doctype html><html><head><meta charset=\"utf-8\"><title>SSR Error</title>` +\n\t`<style>body{margin:0;font:14px/1.5 ui-monospace,monospace;background:#1a0505;color:#fca5a5}` +\n\t`.wrap{padding:2rem;max-width:960px;margin:auto}h1{color:#ef4444;font-size:1.25rem}` +\n\t`pre{background:#2a0a0a;border:1px solid #7f1d1d;border-radius:8px;padding:1rem;overflow:auto;white-space:pre-wrap}</style>` +\n\t`</head><body><div class=\"wrap\"><h1>[solid-framework] SSR render error</h1>` +\n\t`<pre>${escapeHtml(error.stack ?? error.message)}</pre></div></body></html>`;\n\nconst writeResponse = async (\n\tres: ServerResponse,\n\tresponse: Response,\n): Promise<void> => {\n\tres.statusCode = response.status;\n\tresponse.headers.forEach((value, key) => {\n\t\tres.setHeader(key, value);\n\t});\n\n\tif (!response.body) {\n\t\tres.end();\n\t\treturn;\n\t}\n\n\tconst reader = response.body.getReader();\n\ttry {\n\t\tfor (;;) {\n\t\t\tconst { done, value } = await reader.read();\n\t\t\tif (done) break;\n\t\t\tres.write(Buffer.from(value));\n\t\t}\n\t} finally {\n\t\tres.end();\n\t}\n};\n\n/**\n * Vite middleware factory — SSRs page requests through the app server entry\n */\nexport const createSsrMiddleware = (\n\tserver: ViteDevServer,\n\tconfig: SolidFrameworkConfig,\n): ((\n\treq: IncomingMessage,\n\tres: ServerResponse,\n\tnext: (err?: unknown) => void,\n) => void) => {\n\treturn (req, res, next) => {\n\t\tconst pathname = req.url?.split(\"?\")[0] ?? \"/\";\n\n\t\t// Framework endpoints carry dots too (sitemap.xml, openapi.json)\n\t\t// — they must reach the server entry, not Vite's static fallback\n\t\tconst frameworkPath =\n\t\t\tpathname === \"/sitemap.xml\" ||\n\t\t\tpathname === \"/robots.txt\" ||\n\t\t\tpathname === \"/favicon.ico\" ||\n\t\t\tpathname.startsWith(\"/_server/\") ||\n\t\t\tpathname.startsWith(\"/_docs/\") ||\n\t\t\tpathname === \"/_og\" ||\n\t\t\tpathname === \"/_image\";\n\n\t\t// Let Vite internals and static assets pass through — everything\n\t\t// else (pages, api prefixes, server fns, actions) goes to the entry\n\t\tif (\n\t\t\t!frameworkPath &&\n\t\t\t(pathname.startsWith(\"/@\") ||\n\t\t\t\tpathname.startsWith(\"/node_modules/\") ||\n\t\t\t\tpathname.startsWith(\"/src/\") ||\n\t\t\t\t(pathname.includes(\".\") && !pathname.endsWith(\"/\")))\n\t\t) {\n\t\t\tnext();\n\t\t\treturn;\n\t\t}\n\n\t\tvoid (async () => {\n\t\t\ttry {\n\t\t\t\tconst mod = (await server.ssrLoadModule(\n\t\t\t\t\t`/${config.entries.server}`,\n\t\t\t\t)) as ServerEntryModule;\n\t\t\t\tconst handler = mod.default ?? mod.fetch ?? mod.handler;\n\t\t\t\tif (!handler) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`[solid-framework] ${config.entries.server} must export a fetch handler (default, fetch, or handler)`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst request = await toWebRequest(req);\n\t\t\t\tconst response = await handler(request);\n\t\t\t\tawait writeResponse(res, response);\n\t\t\t} catch (error) {\n\t\t\t\tserver.ssrFixStacktrace(error as Error);\n\t\t\t\tres.statusCode = 500;\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\tres.end(errorOverlayHtml(error as Error));\n\t\t\t}\n\t\t})();\n\t};\n};\n","/**\n * Config Model\n * Framework configuration with defaults — the nuxt.config/next.config equivalent\n */\n\nimport type { SolidFrameworkConfig } from \"#app/types\";\n\nexport const defaultConfig: SolidFrameworkConfig = {\n\troutesDir: \"src/routes\",\n\trenderMode: \"stream\",\n\trules: {},\n\tapiPrefixes: [\"/api\"],\n\thead: {},\n\tautoImports: true,\n\tentries: {\n\t\tserver: \"src/entry-server.tsx\",\n\t\tclient: \"src/entry-client.tsx\",\n\t},\n\tpublicEnvPrefixes: [\"PUBLIC_\"],\n};\n\nexport type UserConfig = Partial<SolidFrameworkConfig>;\n\n/** Shallow-merge layer configs — later entries win over earlier */\nconst mergeLayer = (base: UserConfig, layer: UserConfig): UserConfig => ({\n\t...base,\n\t...layer,\n\thead: { ...base.head, ...layer.head },\n\tentries: {\n\t\t...base.entries,\n\t\t...layer.entries,\n\t} as SolidFrameworkConfig[\"entries\"],\n\trules: { ...base.rules, ...layer.routeRules, ...layer.rules },\n\trouteRules: { ...base.routeRules, ...layer.routeRules },\n\tmiddleware: [...(base.middleware ?? []), ...(layer.middleware ?? [])],\n\tplugins: [...(base.plugins ?? []), ...(layer.plugins ?? [])],\n\textends: [...(base.extends ?? []), ...(layer.extends ?? [])],\n});\n\nexport const resolveConfig = (user: UserConfig = {}): SolidFrameworkConfig => {\n\t// Layers — `extends` configs merge base→derived; user config wins last\n\tlet merged: UserConfig = {};\n\tconst visit = (cfg: UserConfig): void => {\n\t\tfor (const layer of cfg.extends ?? []) visit(layer);\n\t\tmerged = mergeLayer(merged, cfg);\n\t};\n\tvisit(user);\n\tconst layers = merged.extends;\n\n\tlet config: SolidFrameworkConfig = {\n\t\t...defaultConfig,\n\t\t...merged,\n\t\thead: { ...defaultConfig.head, ...merged.head },\n\t\tentries: { ...defaultConfig.entries, ...merged.entries },\n\t\tpublicEnvPrefixes:\n\t\t\tmerged.publicEnvPrefixes ?? defaultConfig.publicEnvPrefixes,\n\t\tapiPrefixes: merged.apiPrefixes ?? defaultConfig.apiPrefixes,\n\t\t// `rules` wins; `routeRules` kept for back-compat\n\t\trules: { ...merged.routeRules, ...merged.rules },\n\t\textends: layers,\n\t};\n\n\t// Plugin config hooks — each plugin may patch the resolved config\n\tfor (const plugin of config.plugins ?? []) {\n\t\tconst patch = plugin.config?.(config);\n\t\tif (patch) {\n\t\t\tconfig = { ...config, ...patch, plugins: config.plugins };\n\t\t}\n\t}\n\n\treturn config;\n};\n","/**\n * Route Manifest Builder\n * Maps files inside routesDir to route entries using filesystem\n * conventions — SolidStart/Nuxt style:\n *\n * src/routes/index.tsx → /\n * src/routes/about.tsx → /about\n * src/routes/users/[id].tsx → /users/:id\n * src/routes/blog/[...slug].tsx → /blog/*slug (catch-all)\n * src/routes/(mkt)/home.tsx → /home (pathless group)\n * src/routes/users/[id]/edit.tsx → /users/:id/edit\n *\n * Non-route files: layout.tsx, error.tsx, loading.tsx, not-found.tsx,\n * and anything starting with \"_\" or inside \"_\" directories.\n */\n\nimport type { FileRoute, RouteManifest } from \"../models\";\n\nconst MODULE_EXT = /\\.(tsx|ts|jsx|js|md|mdx)$/;\nconst CONTENT_EXT = /\\.(md|mdx)$/;\nconst CATCH_ALL = /^\\[\\.\\.\\.(.+)\\]$/;\nconst PARAM = /^\\[(.+)\\]$/;\nconst GROUP = /^\\(.+\\)$/;\nconst INTERCEPT = /^\\(\\.+\\)(.+)$/;\nconst SLOT = /^@(.+)$/;\nconst PRIVATE = /^_/;\n\nconst CONVENTION_NAMES = new Set([\n\t\"layout\",\n\t\"error\",\n\t\"loading\",\n\t\"not-found\",\n\t\"middleware\",\n]);\n\nconst normalize = (file: string): string => file.replace(/\\\\/g, \"/\");\n\nconst stripExt = (file: string): string => file.replace(MODULE_EXT, \"\");\n\nconst splitSegments = (relative: string): string[] =>\n\tstripExt(normalize(relative)).split(\"/\");\n\ninterface Segment {\n\t/** url segment text, or param name when dynamic */\n\ttext: string;\n\tkind: \"static\" | \"param\" | \"splat\";\n\t/** group segments contribute no url text but can hold conventions */\n\tgroup: boolean;\n}\n\nconst parseSegment = (raw: string): Segment => {\n\t// `(.)name` — intercepted route: contributes url text like a plain\n\t// segment; the route is flagged intercepted for modal rendering\n\tconst intercepted = raw.match(INTERCEPT);\n\tif (intercepted) {\n\t\treturn { text: intercepted[1] ?? raw, kind: \"static\", group: false };\n\t}\n\t// `@slot` — parallel-route dir: no url text (like a group) but the\n\t// route records its slot name\n\tif (SLOT.test(raw)) return { text: raw, kind: \"static\", group: true };\n\tif (GROUP.test(raw)) return { text: \"\", kind: \"static\", group: true };\n\tconst splat = raw.match(CATCH_ALL);\n\tif (splat) return { text: splat[1] ?? \"all\", kind: \"splat\", group: false };\n\tconst param = raw.match(PARAM);\n\tif (param) return { text: param[1] ?? \"\", kind: \"param\", group: false };\n\treturn { text: raw, kind: \"static\", group: false };\n};\n\nconst API_SUFFIX = \".api\";\n\nconst isRouteFile = (segments: Segment[], fileName: string): boolean => {\n\tif (CONVENTION_NAMES.has(fileName)) return false;\n\treturn !segments.some((s) => PRIVATE.test(s.text)) && !PRIVATE.test(fileName);\n};\n\n/** Specificity — static beats param beats splat; longer paths tie-break later */\nconst scoreRoute = (segments: Segment[]): number =>\n\tsegments.reduce(\n\t\t(score, seg) =>\n\t\t\tscore * 4 + (seg.kind === \"static\" ? 3 : seg.kind === \"param\" ? 2 : 1),\n\t\t0,\n\t);\n\nconst dirSegments = (relative: string): string[] => {\n\tconst segs = normalize(relative).split(\"/\");\n\tsegs.pop();\n\treturn segs;\n};\n\nconst ancestorDirs = (relative: string, root: string): string[] => {\n\t// \"users/[id]/edit.tsx\" → [\"root/users/[id]\", \"root/users\", \"root\"]\n\tconst dirs = dirSegments(relative);\n\tconst chain: string[] = [];\n\tfor (let i = dirs.length; i >= 0; i--) {\n\t\tconst dir = dirs.slice(0, i).join(\"/\");\n\t\tchain.push(dir ? `${root}/${dir}` : root);\n\t}\n\treturn chain;\n};\n\nconst conventionIndex = (files: string[]): Map<string, Map<string, string>> => {\n\t// dir → convention name → file\n\tconst index = new Map<string, Map<string, string>>();\n\tfor (const file of files) {\n\t\tconst rel = normalize(file);\n\t\tconst name = stripExt(rel.split(\"/\").pop() ?? \"\");\n\t\tif (!CONVENTION_NAMES.has(name)) continue;\n\t\tconst dir = rel.replace(/\\/[^/]*$/, \"\");\n\t\tconst entry = index.get(dir) ?? new Map<string, string>();\n\t\tentry.set(name, file);\n\t\tindex.set(dir, entry);\n\t}\n\treturn index;\n};\n\nconst findConvention = (\n\tindex: Map<string, Map<string, string>>,\n\tancestors: string[],\n\tname: string,\n): string | undefined => {\n\tfor (const dir of ancestors) {\n\t\tconst found = index.get(dir)?.get(name);\n\t\tif (found) return found;\n\t}\n\treturn undefined;\n};\n\nconst middlewareChain = (\n\tindex: Map<string, Map<string, string>>,\n\tancestors: string[],\n): string[] => {\n\t// every ancestor's _middleware applies — outermost → innermost\n\tconst chain: string[] = [];\n\tfor (const dir of [...ancestors].reverse()) {\n\t\tconst mw = index.get(dir)?.get(\"middleware\");\n\t\tif (mw) chain.push(mw);\n\t}\n\treturn chain;\n};\n\nconst layoutChain = (\n\tindex: Map<string, Map<string, string>>,\n\tancestors: string[],\n): string[] => {\n\t// ancestors are innermost → outermost; layouts render outermost first\n\tconst chain: string[] = [];\n\tfor (const dir of [...ancestors].reverse()) {\n\t\tconst layout = index.get(dir)?.get(\"layout\");\n\t\tif (layout) chain.push(layout);\n\t}\n\treturn chain;\n};\n\nexport const buildRouteManifest = (\n\tfiles: string[],\n\troutesDir = \"src/routes\",\n): RouteManifest => {\n\tconst root = normalize(routesDir).replace(/\\/$/, \"\");\n\tconst conventions = conventionIndex(files);\n\tconst routes: RouteManifest = [];\n\n\tfor (const file of files) {\n\t\tconst rel = normalize(file);\n\t\tif (!rel.startsWith(`${root}/`)) continue;\n\t\tconst relPath = rel.slice(root.length + 1);\n\t\tconst segments = splitSegments(relPath).map(parseSegment);\n\t\tconst fileName = stripExt(relPath.split(\"/\").pop() ?? \"\");\n\n\t\tif (!isRouteFile(segments, fileName)) continue;\n\n\t\t// \"*.api.ts\" files are API endpoints — path drops the .api suffix\n\t\tconst isApi = fileName.endsWith(API_SUFFIX);\n\t\t// \"*.md\" pages render markdown content — `kind: \"content\"`\n\t\tconst isContent = CONTENT_EXT.test(rel);\n\t\tconst routeName = isApi ? fileName.slice(0, -API_SUFFIX.length) : fileName;\n\n\t\t// \"index\" or \"page\" collapses to the directory path\n\t\tconst urlSegments =\n\t\t\trouteName === \"index\" || routeName === \"page\"\n\t\t\t\t? segments.slice(0, -1)\n\t\t\t\t: [...segments.slice(0, -1), parseSegment(routeName)];\n\n\t\tconst params: string[] = [];\n\t\tconst parts: string[] = [];\n\t\tfor (const seg of urlSegments) {\n\t\t\tif (seg.group) continue;\n\t\t\tif (seg.kind === \"param\") {\n\t\t\t\tparams.push(seg.text);\n\t\t\t\tparts.push(`:${seg.text}`);\n\t\t\t} else if (seg.kind === \"splat\") {\n\t\t\t\tparams.push(seg.text);\n\t\t\t\tparts.push(`*${seg.text}`);\n\t\t\t} else {\n\t\t\t\tparts.push(seg.text);\n\t\t\t}\n\t\t}\n\n\t\tconst ancestors = ancestorDirs(relPath, root); // innermost → root\n\t\tconst rawSegs = splitSegments(relPath);\n\t\tconst intercepted = rawSegs.some((s) => INTERCEPT.test(s));\n\t\tconst slotSeg = rawSegs.map((s) => s.match(SLOT)).find(Boolean)?.[1];\n\t\tconst route: FileRoute = {\n\t\t\tpath: `/${parts.join(\"/\")}`.replace(/\\/$/, \"\") || \"/\",\n\t\t\tfile,\n\t\t\t...(intercepted ? { intercepted: true as const } : {}),\n\t\t\t...(slotSeg ? { slot: slotSeg } : {}),\n\t\t\t...(isApi ? { kind: \"api\" as const } : {}),\n\t\t\t...(isContent ? { kind: \"content\" as const } : {}),\n\t\t\t// API endpoints serve raw responses — page conventions don't apply\n\t\t\tlayouts: isApi ? [] : layoutChain(conventions, ancestors),\n\t\t\tmiddleware: middlewareChain(conventions, ancestors),\n\t\t\tparams,\n\t\t\tscore: scoreRoute(urlSegments.filter((s) => !s.group)),\n\t\t};\n\n\t\tif (!isApi) {\n\t\t\tconst error = findConvention(conventions, ancestors, \"error\");\n\t\t\tconst loading = findConvention(conventions, ancestors, \"loading\");\n\t\t\tconst notFound = findConvention(conventions, ancestors, \"not-found\");\n\t\t\tif (error) route.error = error;\n\t\t\tif (loading) route.loading = loading;\n\t\t\tif (notFound) route.notFound = notFound;\n\t\t}\n\n\t\troutes.push(route);\n\t}\n\n\treturn routes.sort((a, b) => b.score - a.score);\n};\n","import type { Plugin } from \"vite\";\nimport type { SolidRouterPluginOptions } from \"./vite-plugin-options\";\n\nexport function solidRouterPlugin(\n\toptions: SolidRouterPluginOptions = {},\n): Plugin {\n\tconst {\n\t\troutesDir = \"src/routes\",\n\t\trouteExtensions: _routeExtensions = [\".tsx\", \".ts\", \".jsx\", \".js\"],\n\t\tautoImport: _autoImport = true,\n\t\tdevTools = true,\n\t\tperformanceMonitoring = false,\n\t\tcodeSplitting = true,\n\t\ti18n = false,\n\t\tfeatureFlags = false,\n\t\tsecurityScanning = false,\n\t\tcaching = true,\n\t\tpredictivePreloading = false,\n\t\terrorTracking = false,\n\t\tgenerateTypes = true,\n\t\ttypesOutputDir = \"src/types\",\n\t\thmr = true,\n\t\tlogger,\n\t} = options;\n\n\treturn {\n\t\tname: \"solid-framework:app-router\",\n\n\t\tconfig(_config, { command }) {\n\t\t\tconst isDev = command === \"serve\";\n\n\t\t\treturn {\n\t\t\t\tresolve: {\n\t\t\t\t\talias: {\n\t\t\t\t\t\t\"@wrikka/solid-framework/router\": new URL(\n\t\t\t\t\t\t\t\"../src/index.ts\",\n\t\t\t\t\t\t\timport.meta.url,\n\t\t\t\t\t\t).href,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefine: {\n\t\t\t\t\t__SOLID_ROUTER_DEVTOOLS__: JSON.stringify(\n\t\t\t\t\t\tisDev && (devTools ?? true),\n\t\t\t\t\t),\n\t\t\t\t\t__SOLID_ROUTER_PERFORMANCE__: JSON.stringify(performanceMonitoring),\n\t\t\t\t\t__SOLID_ROUTER_CODE_SPLITTING__: JSON.stringify(codeSplitting),\n\t\t\t\t\t__SOLID_ROUTER_I18N__: JSON.stringify(i18n),\n\t\t\t\t\t__SOLID_ROUTER_FEATURE_FLAGS__: JSON.stringify(featureFlags),\n\t\t\t\t\t__SOLID_ROUTER_SECURITY__: JSON.stringify(securityScanning),\n\t\t\t\t\t__SOLID_ROUTER_CACHING__: JSON.stringify(caching),\n\t\t\t\t\t__SOLID_ROUTER_PRELOADING__: JSON.stringify(predictivePreloading),\n\t\t\t\t\t__SOLID_ROUTER_ERROR_TRACKING__: JSON.stringify(errorTracking),\n\t\t\t\t\t__SOLID_ROUTER_HMR__: JSON.stringify(isDev && hmr),\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\n\t\tasync buildStart() {\n\t\t\tif (generateTypes) {\n\t\t\t\tlogger?.log(\n\t\t\t\t\t`Route types generation enabled for ${routesDir} -> ${typesOutputDir}`,\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\tconfigureServer(server) {\n\t\t\tif (hmr) {\n\t\t\t\tserver.watcher.on(\"change\", async (file) => {\n\t\t\t\t\tif (file.startsWith(routesDir)) {\n\t\t\t\t\t\tserver.ws.send({\n\t\t\t\t\t\t\ttype: \"full-reload\",\n\t\t\t\t\t\t\tpath: \"*\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t};\n}\n","/**\n * Build-time Prerender\n * Renders routes through the built server entry and writes static\n * HTML to outDir — the SSG equivalent of Nitro's prerender, with\n * crawlLinks discovering pages from rendered anchors\n */\n\nimport { mkdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\n/** Same-origin links found in rendered HTML — `href=\"/path\"` */\nexport const extractLinks = (html: string): string[] => {\n\tconst links = new Set<string>();\n\tfor (const match of html.matchAll(/href=\"(\\/[^\"#]*)\"/g)) {\n\t\tconst path = (match[1] ?? \"\").split(\"?\")[0];\n\t\tif (path && !path.startsWith(\"//\")) links.add(path);\n\t}\n\treturn [...links];\n};\n\nexport interface PrerenderResult {\n\tpath: string;\n\tfile: string;\n\tstatus: number;\n}\n\nconst outFile = (outDir: string, path: string): string =>\n\tjoin(\n\t\toutDir,\n\t\tpath === \"/\"\n\t\t\t? \"index.html\"\n\t\t\t: `${path.replace(/^\\/+|\\/+$/g, \"\")}/index.html`,\n\t);\n\nexport const prerenderToDisk = async (\n\thandler: (request: Request) => Promise<Response>,\n\toptions: {\n\t\troutes?: string[];\n\t\tcrawlLinks?: boolean;\n\t\toutDir: string;\n\t\t/** Base origin for constructed requests — default http://localhost */\n\t\tbase?: string;\n\t},\n): Promise<PrerenderResult[]> => {\n\tconst base = options.base ?? \"http://localhost\";\n\tconst queue = [...(options.routes ?? [\"/\"])];\n\tconst seen = new Set<string>();\n\tconst written: PrerenderResult[] = [];\n\n\twhile (queue.length > 0) {\n\t\tconst path = queue.shift() as string;\n\t\tif (seen.has(path)) continue;\n\t\tseen.add(path);\n\n\t\tconst response = await handler(new Request(`${base}${path}`));\n\t\tif (!response.ok) continue;\n\n\t\tconst html = await response.text();\n\t\tconst file = outFile(options.outDir, path);\n\t\tmkdirSync(dirname(file), { recursive: true });\n\t\twriteFileSync(file, html);\n\t\twritten.push({ path, file, status: response.status });\n\n\t\tif (options.crawlLinks) {\n\t\t\tfor (const link of extractLinks(html)) {\n\t\t\t\tif (!seen.has(link)) queue.push(link);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn written;\n};\n","/**\n * Server Fn Id Transform\n * Injects stable ids into `createServerFn({ ... })` calls that omit\n * `id` — the hash derives from file path + call index so the client\n * and server bundles agree without a runtime handshake\n */\n\nimport { createHash } from \"node:crypto\";\n\nconst stableId = (fileId: string, index: number): string =>\n\t`sf_${createHash(\"sha256\").update(`${fileId}#${index}`).digest(\"hex\").slice(0, 12)}`;\n\n/** Find the closing brace for an object literal starting at `open` */\nconst matchingBrace = (code: string, open: number): number => {\n\tlet depth = 0;\n\tfor (let i = open; i < code.length; i++) {\n\t\tconst ch = code[i];\n\t\tif (ch === \"{\") depth++;\n\t\telse if (ch === \"}\") {\n\t\t\tdepth--;\n\t\t\tif (depth === 0) return i;\n\t\t}\n\t}\n\treturn -1;\n};\n\nexport const injectServerFnIds = (code: string, fileId: string): string => {\n\tif (!code.includes(\"createServerFn(\")) return code;\n\n\tconst pattern = /createServerFn\\s*\\(\\s*\\{/g;\n\tlet out = \"\";\n\tlet cursor = 0;\n\tlet index = 0;\n\tlet match: RegExpExecArray | null;\n\n\t// biome-ignore lint/suspicious/noAssignInExpressions: classic exec loop\n\twhile ((match = pattern.exec(code)) !== null) {\n\t\tconst open = match.index + match[0].length - 1; // position of \"{\"\n\t\tconst close = matchingBrace(code, open);\n\t\tif (close === -1) break;\n\t\tconst body = code.slice(open + 1, close);\n\t\tindex++;\n\n\t\tif (/(^|[\\s,}])id\\s*:/.test(body)) continue; // explicit id kept\n\n\t\tout += code.slice(cursor, open + 1);\n\t\tout += `id: \"${stableId(fileId, index)}\",`;\n\t\tcursor = open + 1;\n\t}\n\n\treturn cursor > 0 ? out + code.slice(cursor) : code;\n};\n","/**\n * Vite Plugin Types\n */\n\nimport type { SolidFrameworkConfig } from \"#app/types\";\nimport type { SolidRouterPluginOptions } from \"#router/vite-plugin\";\n\nexport interface SolidFrameworkPluginOptions {\n\t/** Framework config (also emitted to virtual:solid-framework/config) */\n\tconfig?: Partial<SolidFrameworkConfig>;\n\t/** Router plugin options — pass false to disable route codegen plugin */\n\trouter?: SolidRouterPluginOptions | false;\n\t/**\n\t * Auto-import map: export name → module specifier.\n\t * true = framework defaults; false = disabled; object = merged with defaults\n\t */\n\tautoImports?: Record<string, string | string[]> | boolean;\n\t/** Serve SSR through the dev middleware — default true */\n\tssrMiddleware?: boolean;\n}\n\nexport const VIRTUAL_CONFIG = \"virtual:solid-framework/config\";\nexport const VIRTUAL_ROUTES = \"virtual:solid-framework/routes\";\nexport const VIRTUAL_SERVER_FNS = \"virtual:solid-framework/server-fns\";\n","/**\n * Virtual Modules\n * Code emitted for framework virtual imports\n */\n\nimport type { SolidFrameworkConfig } from \"#app/types\";\n\nexport const configModuleCode = (\n\tconfig: SolidFrameworkConfig,\n\tinstrumentationPath?: string,\n): string =>\n\tinstrumentationPath\n\t\t? [\n\t\t\t\t`import * as _instr from ${JSON.stringify(instrumentationPath)};`,\n\t\t\t\t`export default Object.assign(${JSON.stringify(config)}, {`,\n\t\t\t\t\"\tinstrumentation: {\",\n\t\t\t\t\"\t\tregister: _instr.register,\",\n\t\t\t\t\"\t\tonRequest: _instr.onRequest,\",\n\t\t\t\t\"\t\tonError: _instr.onError,\",\n\t\t\t\t\"\t},\",\n\t\t\t\t\"});\",\n\t\t\t].join(\"\\n\")\n\t\t: `export default ${JSON.stringify(config)};`;\n\n/**\n * Route manifest — Vite glob import over the routes directory, plus a\n * prebuilt RouteManifest for <FileRoutes>. Convention files\n * (error/loading/not-found/layout) are included in the modules map.\n */\nexport const routesModuleCode = (routesDir: string): string =>\n\t[\n\t\t'import { buildRouteManifest, preloadFileRoute } from \"@wrikka/solid-framework/internal\";',\n\t\t`const modules = import.meta.glob(\"/${routesDir}/**/*.{tsx,ts,jsx,js}\");`,\n\t\t`export const routeFiles = Object.keys(modules).map((file) => file.slice(1));`,\n\t\t`export const routeModules = Object.fromEntries(Object.entries(modules).map(([k, v]) => [k.slice(1), v]));`,\n\t\t`export const manifest = buildRouteManifest(routeFiles, ${JSON.stringify(routesDir)});`,\n\t\t\"export const preloadRoute = (path) => preloadFileRoute(path, manifest, routeModules);\",\n\t\t\"export default manifest;\",\n\t].join(\"\\n\");\n\n/**\n * Server function registry — eager glob of server modules so every\n * createServerFn descriptor registers itself on the server bundle.\n * Conventions:\n * *.server.ts — server-only code (stubbed out of client bundles)\n * *.fn.ts — isomorphic createServerFn definitions (client ships the\n * remote caller only; handler executes server-side)\n */\nexport const serverFnsModuleCode = (): string =>\n\t[\n\t\t'const modules = import.meta.glob(\"/src/**/*.{server,fn}.{ts,tsx}\", { eager: true });',\n\t\t\"export const serverModules = modules;\",\n\t\t\"export default modules;\",\n\t].join(\"\\n\");\n\n/**\n * Stub emitted when a .server module leaks into the client bundle\n */\nexport const serverStubCode = (id: string): string =>\n\t[\n\t\t`throw new Error(`,\n\t\t` \"[solid-framework] \\\\\"${id}\\\\\" is a .server module and cannot be imported from the client. ` +\n\t\t\t`Move the import into a loader, createServerFn handler, or .server.ts file.\"`,\n\t\t`);`,\n\t].join(\"\\n\");\n\nexport const isServerModuleId = (id: string): boolean =>\n\t/\\.server\\.(ts|tsx|js|jsx|mts|cts)$/.test(id.split(\"?\")[0] ?? id);\n","/**\n * solidFramework Vite Plugin\n * Single orchestrating plugin — router codegen, virtual modules,\n * server-module boundary, auto-imports and the dev SSR middleware\n */\n\nimport { existsSync, readdirSync } from \"node:fs\";\nimport { basename, join, sep } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { Plugin } from \"vite\";\nimport { resolveConfig } from \"#app/modules/config\";\nimport { buildRouteManifest } from \"#app/modules/file-routes\";\nimport { solidRouterPlugin } from \"#router/vite-plugin\";\nimport { FRAMEWORK_AUTO_IMPORTS, injectAutoImports } from \"./auto-imports\";\nimport { createSsrMiddleware } from \"./dev-middleware\";\nimport { prerenderToDisk } from \"./prerender\";\nimport { injectServerFnIds } from \"./server-fn-ids\";\nimport type { SolidFrameworkPluginOptions } from \"./types\";\nimport { VIRTUAL_CONFIG, VIRTUAL_ROUTES, VIRTUAL_SERVER_FNS } from \"./types\";\nimport {\n\tconfigModuleCode,\n\tisServerModuleId,\n\troutesModuleCode,\n\tserverFnsModuleCode,\n\tserverStubCode,\n} from \"./virtual-modules\";\n\nconst RESOLVED_PREFIX = \"\\0\";\n\nconst resolveVirtualId = (id: string): string => `${RESOLVED_PREFIX}${id}`;\n\nexport const solidFramework = (\n\toptions: SolidFrameworkPluginOptions = {},\n): Plugin[] => {\n\tconst config = resolveConfig(options.config);\n\n\tconst autoImportMap =\n\t\toptions.autoImports === false\n\t\t\t? null\n\t\t\t: {\n\t\t\t\t\t...FRAMEWORK_AUTO_IMPORTS,\n\t\t\t\t\t...(typeof options.autoImports === \"object\"\n\t\t\t\t\t\t? options.autoImports\n\t\t\t\t\t\t: {}),\n\t\t\t\t};\n\n\tlet rootDir = \"\";\n\tlet ssrOutDir = \"dist/server\";\n\t// `instrumentation.ts` convention — discovered at project/src root\n\tlet instrumentationPath: string | undefined;\n\n\tconst core: Plugin = {\n\t\tname: \"solid-framework\",\n\t\tenforce: \"pre\",\n\n\t\tconfigResolved(resolved) {\n\t\t\trootDir = resolved.root;\n\t\t\tif (process.env.SOLID_SSR_BUILD === \"1\") {\n\t\t\t\tssrOutDir = resolved.build.outDir;\n\t\t\t}\n\t\t\t// instrumentation.ts convention — first match wins\n\t\t\tfor (const dir of [resolved.root, join(resolved.root, \"src\")]) {\n\t\t\t\tfor (const ext of [\"ts\", \"tsx\"]) {\n\t\t\t\t\tconst candidate = join(dir, `instrumentation.${ext}`);\n\t\t\t\t\tif (existsSync(candidate)) {\n\t\t\t\t\t\tinstrumentationPath = candidate.split(sep).join(\"/\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tconfig(_userConfig, env) {\n\t\t\treturn {\n\t\t\t\tssr: {\n\t\t\t\t\tnoExternal: [\"@wrikka/solid-framework\"],\n\t\t\t\t},\n\t\t\t\t// @wrikka/web-server-toolkit is a runtime (bun) dependency — keep it\n\t\t\t\t// external in SSR builds so rolldown never opens its dist bundle\n\t\t\t\t...(env.isSsrBuild === true\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tbuild: {\n\t\t\t\t\t\t\t\trollupOptions: {\n\t\t\t\t\t\t\t\t\texternal: [\"@wrikka/web-server-toolkit\", /^bun(:|$)/],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t\tserver: {\n\t\t\t\t\twatch: { ignored: [\"**/dist/**\"] },\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\n\t\tresolveId(id, _importer, resolveOptions) {\n\t\t\tif (\n\t\t\t\tid === VIRTUAL_CONFIG ||\n\t\t\t\tid === VIRTUAL_ROUTES ||\n\t\t\t\tid === VIRTUAL_SERVER_FNS\n\t\t\t) {\n\t\t\t\treturn resolveVirtualId(id);\n\t\t\t}\n\t\t\t// @wrikka/web-server-toolkit is server-only — stub it out of client bundles\n\t\t\tif (id === \"@wrikka/web-server-toolkit\" && resolveOptions?.ssr !== true) {\n\t\t\t\treturn `${RESOLVED_PREFIX}web-server`;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\n\t\tload(id, loadOptions) {\n\t\t\tif (id.startsWith(RESOLVED_PREFIX)) {\n\t\t\t\tconst virtual = id.slice(RESOLVED_PREFIX.length);\n\t\t\t\tif (virtual === VIRTUAL_CONFIG)\n\t\t\t\t\t// instrumentation hooks are server-only — merge only in SSR builds\n\t\t\t\t\treturn configModuleCode(\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t\tloadOptions?.ssr === true ? instrumentationPath : undefined,\n\t\t\t\t\t);\n\t\t\t\tif (virtual === VIRTUAL_ROUTES)\n\t\t\t\t\treturn routesModuleCode(config.routesDir);\n\t\t\t\tif (virtual === VIRTUAL_SERVER_FNS) return serverFnsModuleCode();\n\t\t\t\tif (virtual === \"web-server\") {\n\t\t\t\t\treturn `const fail = () => { throw new Error(\"[solid-framework] @wrikka/web-server-toolkit is server-only and cannot run on the client\"); };\\nexport const createRequestHandler = fail;\\nexport default fail;\\n`;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// .server.ts boundary — stub server-only modules outside SSR builds\n\t\t\tif (isServerModuleId(id) && loadOptions?.ssr !== true) {\n\t\t\t\treturn serverStubCode(id);\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\n\t\ttransform(code, id) {\n\t\t\tif (!/\\.[jt]sx?$/.test(id) || id.includes(\"node_modules\")) return null;\n\t\t\tif (isServerModuleId(id)) return null;\n\n\t\t\tlet next = autoImportMap ? injectAutoImports(code, autoImportMap) : null;\n\t\t\tlet current = next ?? code;\n\t\t\tconst withIds = injectServerFnIds(current, id);\n\t\t\tif (withIds !== current) {\n\t\t\t\tcurrent = withIds;\n\t\t\t\tnext = current;\n\t\t\t}\n\t\t\tfor (const plugin of config.plugins ?? []) {\n\t\t\t\tconst out = plugin.transform?.(current, id);\n\t\t\t\tif (out != null) {\n\t\t\t\t\tcurrent = out;\n\t\t\t\t\tnext = out;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn next === null ? null : { code: current, map: null };\n\t\t},\n\n\t\tbuildStart() {\n\t\t\t// Notify plugins of the resolved route manifest — scan runs on\n\t\t\t// the node side so build/dev share one source of truth\n\t\t\tif (!existsSync(config.routesDir)) return;\n\t\t\tconst files: string[] = [];\n\t\t\tconst walk = (dir: string) => {\n\t\t\t\tfor (const entry of readdirSync(dir, { withFileTypes: true })) {\n\t\t\t\t\tconst full = join(dir, entry.name);\n\t\t\t\t\tif (entry.isDirectory()) walk(full);\n\t\t\t\t\telse files.push(full.split(sep).join(\"/\"));\n\t\t\t\t}\n\t\t\t};\n\t\t\twalk(config.routesDir);\n\t\t\tconst manifest = buildRouteManifest(files, config.routesDir);\n\t\t\tfor (const plugin of config.plugins ?? []) {\n\t\t\t\tplugin.routesResolved?.(manifest);\n\t\t\t}\n\t\t},\n\n\t\thandleHotUpdate({ file, server }) {\n\t\t\t// Route file edits trigger a full reload — the manifest and\n\t\t\t// convention wiring (layouts/boundaries) can change shape\n\t\t\tconst routesRoot = `${config.routesDir.split(\"/\").join(sep)}${sep}`;\n\t\t\tif (file.split(\"/\").join(sep).startsWith(routesRoot)) {\n\t\t\t\tserver.ws.send({ type: \"full-reload\" });\n\t\t\t}\n\t\t},\n\n\t\tconfigureServer(server) {\n\t\t\tif (options.ssrMiddleware === false) return;\n\t\t\tserver.middlewares.use(createSsrMiddleware(server, config));\n\t\t},\n\n\t\tgenerateBundle(_options, bundle) {\n\t\t\tif (process.env.SOLID_SSR_BUILD === \"1\") return;\n\t\t\t// Preload manifest — entry chunks + css for head hints\n\t\t\tconst entries = Object.values(bundle)\n\t\t\t\t.filter(\n\t\t\t\t\t(o) =>\n\t\t\t\t\t\t(o.type === \"chunk\" && o.isEntry) || o.fileName.endsWith(\".css\"),\n\t\t\t\t)\n\t\t\t\t.map((o) => `/${o.fileName}`);\n\t\t\tif (entries.length) {\n\t\t\t\tthis.emitFile({\n\t\t\t\t\ttype: \"asset\",\n\t\t\t\t\tfileName: \"preload-manifest.json\",\n\t\t\t\t\tsource: JSON.stringify({ preloads: entries }),\n\t\t\t\t});\n\t\t\t}\n\t\t\t// PWA — emit sw.js + manifest.webmanifest into the client build\n\t\t\tif (!config.pwa) return;\n\t\t\tconst pwa = config.pwa;\n\t\t\tconst precache = [\n\t\t\t\t\"/\",\n\t\t\t\t...(pwa.precache ?? []),\n\t\t\t\t...(pwa.manifest ? [\"/manifest.webmanifest\"] : []),\n\t\t\t];\n\t\t\tthis.emitFile({\n\t\t\t\ttype: \"asset\",\n\t\t\t\tfileName: \"sw.js\",\n\t\t\t\tsource: `const CACHE=\"sf-v1\";const PRECACHE=${JSON.stringify(precache)};self.addEventListener(\"install\",e=>{e.waitUntil(caches.open(CACHE).then(c=>c.addAll(PRECACHE)).then(()=>self.skipWaiting()))});self.addEventListener(\"activate\",e=>{e.waitUntil(self.clients.claim())});self.addEventListener(\"fetch\",e=>{if(e.request.method!==\"GET\")return;const nav=e.request.mode===\"navigate\"||(e.request.headers.get(\"accept\")||\"\").includes(\"text/html\");if(nav){e.respondWith(fetch(e.request).then(res=>{const copy=res.clone();caches.open(CACHE).then(c=>c.put(e.request,copy));return res}).catch(()=>caches.match(e.request).then(r=>r||caches.match(\"/\"))));return}e.respondWith(caches.match(e.request).then(r=>r||fetch(e.request).then(res=>{const copy=res.clone();caches.open(CACHE).then(c=>c.put(e.request,copy));return res})))});`,\n\t\t\t});\n\t\t\tif (pwa.manifest) {\n\t\t\t\tthis.emitFile({\n\t\t\t\t\ttype: \"asset\",\n\t\t\t\t\tfileName: \"manifest.webmanifest\",\n\t\t\t\t\tsource: JSON.stringify({\n\t\t\t\t\t\tname: pwa.manifest.name ?? \"app\",\n\t\t\t\t\t\tshort_name: pwa.manifest.shortName ?? pwa.manifest.name ?? \"app\",\n\t\t\t\t\t\tstart_url: pwa.manifest.startUrl ?? \"/\",\n\t\t\t\t\t\tdisplay: pwa.manifest.display ?? \"standalone\",\n\t\t\t\t\t\tbackground_color: pwa.manifest.background ?? \"#ffffff\",\n\t\t\t\t\t\ttheme_color: pwa.manifest.theme ?? \"#000000\",\n\t\t\t\t\t\ticons: pwa.manifest.icons ?? [],\n\t\t\t\t\t}),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\tasync closeBundle() {\n\t\t\t// Build-time prerender — after the SSR bundle is written, load\n\t\t\t// the built server entry and render configured routes to disk\n\t\t\tif (process.env.SOLID_SSR_BUILD !== \"1\" || !config.prerender) return;\n\t\t\tconst pre = config.prerender;\n\t\t\tif (!pre.routes?.length && !pre.crawlLinks) return;\n\n\t\t\tconst entryFile = join(\n\t\t\t\trootDir || \".\",\n\t\t\t\tssrOutDir,\n\t\t\t\tbasename(config.entries.server).replace(/\\.[jt]sx?$/, \".js\"),\n\t\t\t);\n\t\t\tconst mod = (await import(pathToFileURL(entryFile).href)) as {\n\t\t\t\tdefault?: (request: Request) => Promise<Response>;\n\t\t\t};\n\t\t\tconst handler = mod.default;\n\t\t\tif (typeof handler !== \"function\") {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"[solid-framework] prerender skipped — server entry has no default fetch handler\",\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst written = await prerenderToDisk(handler, {\n\t\t\t\troutes: pre.routes,\n\t\t\t\tcrawlLinks: pre.crawlLinks,\n\t\t\t\toutDir: pre.outDir ?? join(rootDir || \".\", \"dist\"),\n\t\t\t});\n\t\t\tconsole.log(\n\t\t\t\t`[solid-framework] prerendered ${written.length} route(s): ${written\n\t\t\t\t\t.map((w) => w.path)\n\t\t\t\t\t.join(\", \")}`,\n\t\t\t);\n\t\t},\n\t};\n\n\tconst plugins: Plugin[] = [core];\n\n\tif (options.router !== false) {\n\t\tplugins.push(solidRouterPlugin(options.router ?? {}));\n\t}\n\n\treturn plugins;\n};\n"],"mappings":"+OAMA,MAAaA,EAAiD,CAE7D,MAAO,+BACP,KAAM,+BACN,KAAM,+BACN,QAAS,+BACT,WAAY,+BAEZ,eAAgB,iCAChB,kBAAmB,iCACnB,WAAY,iCAEZ,aAAc,kCACd,cAAe,kCAEf,OAAQ,gCACT,EAEMC,EAAgB,GACrBC,EAAM,QAAQ,sBAAuB,MAAM,EAO/BC,GACZ,EACA,I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B,QACpB,GAAI,OAAOnK,GAAY,WAAY,CAClC,QAAQ,KACP,iFACD,EACA,MACD,CAEA,IAAM2G,EAAU,MAAMH,EAAgBxG,EAAS,CAC9C,OAAQkK,EAAI,OACZ,WAAYA,EAAI,WAChB,OAAQA,EAAI,QAAU5D,EAAKoC,GAAW,IAAK,MAAM,CAClD,CAAC,EACD,QAAQ,IACP,iCAAiC/B,EAAQ,OAAO,aAAaA,EAC3D,IAAK,GAAM2D,EAAE,IAAI,CAAC,CAClB,KAAK,IAAI,GACZ,CACD,CAG6B,CAAC,EAM/B,OAJItF,EAAQ,SAAW,IACtB4D,EAAQ,KAAK/D,EAAkBG,EAAQ,QAAU,CAAC,CAAC,CAAC,EAG9C4D,CACR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,248 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@wrikka/solid-framework",
|
|
3
|
+
"version": "0.15.0",
|
|
4
|
+
"description": "SolidJS fullstack meta-framework — file routes, loaders, actions, SSR/stream/islands, server functions, auth, realtime, ops probes, AI surface (llms.txt+MCP), stores, query, hooks, devtools",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"imports": {
|
|
9
|
+
"#router": "./src/router/index.ts",
|
|
10
|
+
"#router/*": "./src/router/*",
|
|
11
|
+
"#stores": "./src/stores/index.ts",
|
|
12
|
+
"#stores/*": "./src/stores/*",
|
|
13
|
+
"#query": "./src/query/index.ts",
|
|
14
|
+
"#query/*": "./src/query/*",
|
|
15
|
+
"#hooks": "./src/hooks/index.ts",
|
|
16
|
+
"#hooks/*": "./src/hooks/*",
|
|
17
|
+
"#devtools": "./src/devtools/index.ts",
|
|
18
|
+
"#devtools/*": "./src/devtools/*",
|
|
19
|
+
"#render": "./src/render/index.ts",
|
|
20
|
+
"#render/*": "./src/render/*",
|
|
21
|
+
"#head": "./src/head/index.ts",
|
|
22
|
+
"#head/*": "./src/head/*",
|
|
23
|
+
"#server": "./src/server/index.ts",
|
|
24
|
+
"#server/*": "./src/server/*",
|
|
25
|
+
"#app": "./src/app/index.ts",
|
|
26
|
+
"#app/*": "./src/app/*",
|
|
27
|
+
"#actions": "./src/actions/index.ts",
|
|
28
|
+
"#actions/*": "./src/actions/*",
|
|
29
|
+
"#assets": "./src/assets/index.ts",
|
|
30
|
+
"#assets/*": "./src/assets/*",
|
|
31
|
+
"#vite": "./src/vite/index.ts",
|
|
32
|
+
"#vite/*": "./src/vite/*",
|
|
33
|
+
"#cli": "./src/cli/index.ts",
|
|
34
|
+
"#cli/*": "./src/cli/*"
|
|
35
|
+
},
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./src/index.ts",
|
|
39
|
+
"default": "./src/index.ts"
|
|
40
|
+
},
|
|
41
|
+
"./router": {
|
|
42
|
+
"types": "./src/router/index.ts",
|
|
43
|
+
"default": "./src/router/index.ts"
|
|
44
|
+
},
|
|
45
|
+
"./stores": {
|
|
46
|
+
"types": "./src/stores/index.ts",
|
|
47
|
+
"default": "./src/stores/index.ts"
|
|
48
|
+
},
|
|
49
|
+
"./stores/storage": {
|
|
50
|
+
"types": "./src/stores/adapters/storage/index.ts",
|
|
51
|
+
"default": "./src/stores/adapters/storage/index.ts"
|
|
52
|
+
},
|
|
53
|
+
"./stores/validation": {
|
|
54
|
+
"types": "./src/stores/adapters/validation/index.ts",
|
|
55
|
+
"default": "./src/stores/adapters/validation/index.ts"
|
|
56
|
+
},
|
|
57
|
+
"./stores/persistence": {
|
|
58
|
+
"types": "./src/stores/adapters/persistence/index.ts",
|
|
59
|
+
"default": "./src/stores/adapters/persistence/index.ts"
|
|
60
|
+
},
|
|
61
|
+
"./stores/devtools": {
|
|
62
|
+
"types": "./src/stores/adapters/devtools/index.ts",
|
|
63
|
+
"default": "./src/stores/adapters/devtools/index.ts"
|
|
64
|
+
},
|
|
65
|
+
"./stores/router": {
|
|
66
|
+
"types": "./src/stores/adapters/router/index.ts",
|
|
67
|
+
"default": "./src/stores/adapters/router/index.ts"
|
|
68
|
+
},
|
|
69
|
+
"./stores/sync": {
|
|
70
|
+
"types": "./src/stores/adapters/sync/index.ts",
|
|
71
|
+
"default": "./src/stores/adapters/sync/index.ts"
|
|
72
|
+
},
|
|
73
|
+
"./stores/analytics": {
|
|
74
|
+
"types": "./src/stores/adapters/analytics/index.ts",
|
|
75
|
+
"default": "./src/stores/adapters/analytics/index.ts"
|
|
76
|
+
},
|
|
77
|
+
"./query": {
|
|
78
|
+
"types": "./src/query/index.ts",
|
|
79
|
+
"default": "./src/query/index.ts"
|
|
80
|
+
},
|
|
81
|
+
"./query/solid": {
|
|
82
|
+
"types": "./src/query/adapters/solid/index.ts",
|
|
83
|
+
"default": "./src/query/adapters/solid/index.ts"
|
|
84
|
+
},
|
|
85
|
+
"./query/persistence": {
|
|
86
|
+
"types": "./src/query/adapters/persistence/index.ts",
|
|
87
|
+
"default": "./src/query/adapters/persistence/index.ts"
|
|
88
|
+
},
|
|
89
|
+
"./query/validation": {
|
|
90
|
+
"types": "./src/query/adapters/validation/index.ts",
|
|
91
|
+
"default": "./src/query/adapters/validation/index.ts"
|
|
92
|
+
},
|
|
93
|
+
"./query/devtools": {
|
|
94
|
+
"types": "./src/query/adapters/devtools/index.ts",
|
|
95
|
+
"default": "./src/query/adapters/devtools/index.ts"
|
|
96
|
+
},
|
|
97
|
+
"./hooks": {
|
|
98
|
+
"types": "./src/hooks/index.ts",
|
|
99
|
+
"default": "./src/hooks/index.ts"
|
|
100
|
+
},
|
|
101
|
+
"./devtools": {
|
|
102
|
+
"types": "./src/devtools/index.ts",
|
|
103
|
+
"default": "./src/devtools/index.ts"
|
|
104
|
+
},
|
|
105
|
+
"./devtools/components": {
|
|
106
|
+
"types": "./src/devtools/presentation/DevtoolsPanel.tsx",
|
|
107
|
+
"default": "./src/devtools/presentation/DevtoolsPanel.tsx"
|
|
108
|
+
},
|
|
109
|
+
"./render": {
|
|
110
|
+
"types": "./src/render/index.ts",
|
|
111
|
+
"default": "./src/render/index.ts"
|
|
112
|
+
},
|
|
113
|
+
"./head": {
|
|
114
|
+
"types": "./src/head/index.ts",
|
|
115
|
+
"default": "./src/head/index.ts"
|
|
116
|
+
},
|
|
117
|
+
"./server": {
|
|
118
|
+
"types": "./src/server/index.ts",
|
|
119
|
+
"default": "./src/server/index.ts"
|
|
120
|
+
},
|
|
121
|
+
"./server/node": {
|
|
122
|
+
"types": "./src/server/node.ts",
|
|
123
|
+
"default": "./src/server/node.ts"
|
|
124
|
+
},
|
|
125
|
+
"./app": {
|
|
126
|
+
"types": "./src/app/index.ts",
|
|
127
|
+
"default": "./src/app/index.ts"
|
|
128
|
+
},
|
|
129
|
+
"./actions": {
|
|
130
|
+
"types": "./src/actions/index.ts",
|
|
131
|
+
"default": "./src/actions/index.ts"
|
|
132
|
+
},
|
|
133
|
+
"./assets": {
|
|
134
|
+
"types": "./src/assets/index.ts",
|
|
135
|
+
"default": "./src/assets/index.ts"
|
|
136
|
+
},
|
|
137
|
+
"./vite": {
|
|
138
|
+
"types": "./dist/vite.d.ts",
|
|
139
|
+
"default": "./dist/vite.js"
|
|
140
|
+
},
|
|
141
|
+
"./vite/client": {
|
|
142
|
+
"types": "./src/vite/client.d.ts"
|
|
143
|
+
},
|
|
144
|
+
"./cli": {
|
|
145
|
+
"types": "./src/cli/index.ts",
|
|
146
|
+
"default": "./src/cli/index.ts"
|
|
147
|
+
},
|
|
148
|
+
"./testing": {
|
|
149
|
+
"types": "./src/testing/index.ts",
|
|
150
|
+
"default": "./src/testing/index.ts"
|
|
151
|
+
},
|
|
152
|
+
"./internal": {
|
|
153
|
+
"types": "./src/internal.ts",
|
|
154
|
+
"default": "./src/internal.ts"
|
|
155
|
+
},
|
|
156
|
+
"./package.json": "./package.json"
|
|
157
|
+
},
|
|
158
|
+
"bin": {
|
|
159
|
+
"solid": "./src/cli/bin.ts"
|
|
160
|
+
},
|
|
161
|
+
"files": [
|
|
162
|
+
"src",
|
|
163
|
+
"dist",
|
|
164
|
+
"README.md"
|
|
165
|
+
],
|
|
166
|
+
"scripts": {
|
|
167
|
+
"dev": "tsdown --watch",
|
|
168
|
+
"build": "tsdown",
|
|
169
|
+
"typecheck": "tsrs --noEmit",
|
|
170
|
+
"lint": "biome check",
|
|
171
|
+
"lint:fix": "biome check --write",
|
|
172
|
+
"format": "biome check --write",
|
|
173
|
+
"test": "vitest run --passWithNoTests",
|
|
174
|
+
"test:watch": "vitest",
|
|
175
|
+
"test:coverage": "vitest run --coverage",
|
|
176
|
+
"scan": "echo 'No ast-grep rules configured; skipping scan.'",
|
|
177
|
+
"check": "bun run lint && bun run typecheck && bun run scan",
|
|
178
|
+
"verify": "bun run check && bun run test",
|
|
179
|
+
"ci": "bun run verify && bun run build",
|
|
180
|
+
"clean": "bunx rimraf node_modules dist",
|
|
181
|
+
"deps:analyze": "bunx depcheck",
|
|
182
|
+
"deps:update": "taze -r -w"
|
|
183
|
+
},
|
|
184
|
+
"dependencies": {
|
|
185
|
+
"@wrikka/fx": "0.4.0",
|
|
186
|
+
"@wrikka/ui": "0.1.0",
|
|
187
|
+
"@wrikka/web-server-toolkit": "0.2.0",
|
|
188
|
+
"arktype": "^2.2.3"
|
|
189
|
+
},
|
|
190
|
+
"peerDependencies": {
|
|
191
|
+
"jsqr": ">=1.4.0",
|
|
192
|
+
"monaco-editor": ">=0.52.0",
|
|
193
|
+
"qrcode": ">=1.5.0",
|
|
194
|
+
"solid-js": "^1.9.0"
|
|
195
|
+
},
|
|
196
|
+
"peerDependenciesMeta": {
|
|
197
|
+
"jsqr": {
|
|
198
|
+
"optional": true
|
|
199
|
+
},
|
|
200
|
+
"monaco-editor": {
|
|
201
|
+
"optional": true
|
|
202
|
+
},
|
|
203
|
+
"qrcode": {
|
|
204
|
+
"optional": true
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"devDependencies": {
|
|
208
|
+
"@biomejs/biome": "^2.5.13",
|
|
209
|
+
"@types/bun": "^1.4.2",
|
|
210
|
+
"@types/qrcode": "^1.5.6",
|
|
211
|
+
"bun-types": "latest",
|
|
212
|
+
"depcheck": "^1.4.7",
|
|
213
|
+
"jsqr": "^1.4.0",
|
|
214
|
+
"monaco-editor": "^0.56.0",
|
|
215
|
+
"qrcode": "^1.5.4",
|
|
216
|
+
"rimraf": "^6.1.3",
|
|
217
|
+
"solid-js": "^1.9.15",
|
|
218
|
+
"taze": "^21.1.0",
|
|
219
|
+
"tsdown": "^0.23.0",
|
|
220
|
+
"typescript": "^7.0.2",
|
|
221
|
+
"unocss": "^66.10.4",
|
|
222
|
+
"unplugin-solid": "^2.0.0",
|
|
223
|
+
"vite": "^8.3.0",
|
|
224
|
+
"vite-plugin-solid": "^2.11.14",
|
|
225
|
+
"vitest": "^5.0.1"
|
|
226
|
+
},
|
|
227
|
+
"sideEffects": false,
|
|
228
|
+
"keywords": [
|
|
229
|
+
"solidjs",
|
|
230
|
+
"framework",
|
|
231
|
+
"router",
|
|
232
|
+
"stores",
|
|
233
|
+
"query",
|
|
234
|
+
"hooks",
|
|
235
|
+
"devtools",
|
|
236
|
+
"clean-architecture"
|
|
237
|
+
],
|
|
238
|
+
"engines": {
|
|
239
|
+
"bun": ">=1.3.10",
|
|
240
|
+
"node": ">=20"
|
|
241
|
+
},
|
|
242
|
+
"license": "MIT",
|
|
243
|
+
"repository": {
|
|
244
|
+
"type": "git",
|
|
245
|
+
"url": "https://github.com/wrikka/bun-packages",
|
|
246
|
+
"directory": "packages/solid-framework"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action HTTP Handler
|
|
3
|
+
* Dispatches `/_server/action/<id>` — fetch calls get JSON, native form
|
|
4
|
+
* posts get a 303 redirect back to the referer (progressive enhancement)
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ACTION_BASE } from "../../application/usecases/create-action";
|
|
8
|
+
import { getAction } from "../../application/usecases/registry";
|
|
9
|
+
|
|
10
|
+
export const isActionRequest = (request: Request): boolean =>
|
|
11
|
+
new URL(request.url).pathname.startsWith(`${ACTION_BASE}/`);
|
|
12
|
+
|
|
13
|
+
const jsonError = (status: number, message: string): Response =>
|
|
14
|
+
new Response(JSON.stringify({ error: { code: "ERROR", message } }), {
|
|
15
|
+
status,
|
|
16
|
+
headers: { "Content-Type": "application/json" },
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const readActionInput = async (request: Request): Promise<unknown> => {
|
|
20
|
+
const contentType = request.headers.get("Content-Type") ?? "";
|
|
21
|
+
if (contentType.includes("application/json")) {
|
|
22
|
+
const body = (await request.json()) as { input?: unknown };
|
|
23
|
+
return body.input ?? null;
|
|
24
|
+
}
|
|
25
|
+
return request.formData();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const wantsRedirect = (request: Request): boolean =>
|
|
29
|
+
(request.headers.get("Accept") ?? "").includes("text/html") &&
|
|
30
|
+
!request.headers.has("X-Requested-With");
|
|
31
|
+
|
|
32
|
+
export const createActionHandler = (): ((
|
|
33
|
+
request: Request,
|
|
34
|
+
) => Promise<Response>) => {
|
|
35
|
+
return async (request: Request): Promise<Response> => {
|
|
36
|
+
const url = new URL(request.url);
|
|
37
|
+
const id = decodeURIComponent(url.pathname.slice(ACTION_BASE.length + 1));
|
|
38
|
+
|
|
39
|
+
const descriptor = getAction(id);
|
|
40
|
+
if (!descriptor) {
|
|
41
|
+
return jsonError(404, `Unknown action: ${id}`);
|
|
42
|
+
}
|
|
43
|
+
if (request.method !== "POST") {
|
|
44
|
+
return jsonError(405, `Action ${id} expects POST`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const input = await readActionInput(request);
|
|
49
|
+
const formData = input instanceof FormData ? input : undefined;
|
|
50
|
+
const result = await descriptor.handler(input, {
|
|
51
|
+
request,
|
|
52
|
+
formData,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (wantsRedirect(request)) {
|
|
56
|
+
const back = request.headers.get("Referer") ?? "/";
|
|
57
|
+
return new Response(null, {
|
|
58
|
+
status: 303,
|
|
59
|
+
headers: { Location: back },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return new Response(JSON.stringify({ result }), {
|
|
64
|
+
headers: { "Content-Type": "application/json" },
|
|
65
|
+
});
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (wantsRedirect(request)) {
|
|
68
|
+
const back = request.headers.get("Referer") ?? "/";
|
|
69
|
+
return new Response(null, {
|
|
70
|
+
status: 303,
|
|
71
|
+
headers: { Location: back },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return jsonError(
|
|
75
|
+
500,
|
|
76
|
+
error instanceof Error ? error.message : "Action failed",
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./usecases";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createAction
|
|
3
|
+
* Mutation that works both as a typed call and as a native form action
|
|
4
|
+
*
|
|
5
|
+
* - As a function: `await action(input)` — dispatched to `/_server/action/<id>`
|
|
6
|
+
* - As form props: `<form {...action.form}>` — posts FormData, redirects back
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { isServer } from "solid-js/web";
|
|
10
|
+
import type {
|
|
11
|
+
ActionDescriptor,
|
|
12
|
+
ActionHandler,
|
|
13
|
+
FormActionProps,
|
|
14
|
+
} from "#actions/types";
|
|
15
|
+
import { ServerFnError } from "#server/shared/errors";
|
|
16
|
+
import { registerAction } from "./registry";
|
|
17
|
+
|
|
18
|
+
export const ACTION_BASE = "/_server/action";
|
|
19
|
+
|
|
20
|
+
export interface CreateActionOptions {
|
|
21
|
+
id: string;
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
fetch?: typeof fetch;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Action<TInput, TOutput> {
|
|
27
|
+
(input: TInput): Promise<TOutput>;
|
|
28
|
+
/** Spread onto <form> for progressive enhancement */
|
|
29
|
+
form: FormActionProps;
|
|
30
|
+
/** The form action URL */
|
|
31
|
+
url: string;
|
|
32
|
+
id: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const callRemote = async <TInput, TOutput>(
|
|
36
|
+
options: CreateActionOptions,
|
|
37
|
+
input: TInput,
|
|
38
|
+
): Promise<TOutput> => {
|
|
39
|
+
const fetchFn = options.fetch ?? fetch;
|
|
40
|
+
const url = `${options.baseUrl ?? ""}${ACTION_BASE}/${encodeURIComponent(options.id)}`;
|
|
41
|
+
|
|
42
|
+
const isFormData =
|
|
43
|
+
typeof FormData !== "undefined" && input instanceof FormData;
|
|
44
|
+
|
|
45
|
+
const response = await fetchFn(url, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: isFormData ? undefined : { "Content-Type": "application/json" },
|
|
48
|
+
body: isFormData ? (input as FormData) : JSON.stringify({ input }),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const body = (await response.json()) as {
|
|
52
|
+
result?: TOutput;
|
|
53
|
+
error?: { code?: string; message?: string; data?: unknown };
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (!response.ok || body.error) {
|
|
57
|
+
throw ServerFnError.fromJson(
|
|
58
|
+
body.error ?? { message: response.statusText },
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return body.result as TOutput;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const createAction = <TInput, TOutput>(
|
|
65
|
+
options: CreateActionOptions,
|
|
66
|
+
handler: ActionHandler<TInput, TOutput>,
|
|
67
|
+
): Action<TInput, TOutput> => {
|
|
68
|
+
const descriptor: ActionDescriptor<TInput, TOutput> = {
|
|
69
|
+
id: options.id,
|
|
70
|
+
handler,
|
|
71
|
+
};
|
|
72
|
+
if (isServer) registerAction(descriptor);
|
|
73
|
+
|
|
74
|
+
const url = `${ACTION_BASE}/${encodeURIComponent(options.id)}`;
|
|
75
|
+
|
|
76
|
+
const action = (async (input: TInput) => {
|
|
77
|
+
if (isServer) {
|
|
78
|
+
return handler(input, { request: new Request("http://localhost") });
|
|
79
|
+
}
|
|
80
|
+
return callRemote<TInput, TOutput>(options, input);
|
|
81
|
+
}) as Action<TInput, TOutput>;
|
|
82
|
+
|
|
83
|
+
action.id = options.id;
|
|
84
|
+
action.url = url;
|
|
85
|
+
action.form = {
|
|
86
|
+
action: url,
|
|
87
|
+
method: "post",
|
|
88
|
+
enctype: "application/x-www-form-urlencoded",
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return action;
|
|
92
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action Registry
|
|
3
|
+
* Server-side registry for form actions
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ActionDescriptor } from "#actions/types";
|
|
7
|
+
|
|
8
|
+
const registry = new Map<string, ActionDescriptor<unknown, unknown>>();
|
|
9
|
+
|
|
10
|
+
export const registerAction = <TInput, TOutput>(
|
|
11
|
+
descriptor: ActionDescriptor<TInput, TOutput>,
|
|
12
|
+
): void => {
|
|
13
|
+
registry.set(descriptor.id, descriptor as ActionDescriptor<unknown, unknown>);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const getAction = (
|
|
17
|
+
id: string,
|
|
18
|
+
): ActionDescriptor<unknown, unknown> | undefined => registry.get(id);
|
|
19
|
+
|
|
20
|
+
export const clearActionRegistry = (): void => registry.clear();
|