@wrikka/solid-framework 0.0.0-stage → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -3
- package/dist/vite.d.ts +661 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +10 -0
- package/dist/vite.js.map +1 -0
- package/package.json +247 -5
- package/src/actions/index.ts +5 -0
- package/src/actions/modules/action/adapters/http/handler.ts +80 -0
- package/src/actions/modules/action/application/index.ts +1 -0
- package/src/actions/modules/action/application/usecases/create-action.ts +92 -0
- package/src/actions/modules/action/application/usecases/index.ts +2 -0
- package/src/actions/modules/action/application/usecases/registry.ts +20 -0
- package/src/actions/modules/action/index.ts +2 -0
- package/src/actions/presentation/index.ts +1 -0
- package/src/actions/presentation/useSubmission.ts +46 -0
- package/src/actions/types/index.ts +35 -0
- package/src/app/index.ts +126 -0
- package/src/app/modules/ai/domain/operations/handler.ts +46 -0
- package/src/app/modules/ai/domain/operations/llms.ts +54 -0
- package/src/app/modules/ai/domain/operations/mcp.ts +134 -0
- package/src/app/modules/ai/index.ts +3 -0
- package/src/app/modules/api-docs/domain/operations/openapi.ts +113 -0
- package/src/app/modules/api-docs/index.ts +1 -0
- package/src/app/modules/app-def/index.ts +225 -0
- package/src/app/modules/auth/application/usecases/auth.ts +161 -0
- package/src/app/modules/auth/application/usecases/oauth.ts +105 -0
- package/src/app/modules/auth/index.ts +2 -0
- package/src/app/modules/cache/adapters/edge-kv.ts +55 -0
- package/src/app/modules/cache/adapters/fs.ts +58 -0
- package/src/app/modules/cache/adapters/memory.ts +13 -0
- package/src/app/modules/cache/domain/operations/tags.ts +114 -0
- package/src/app/modules/cache/index.ts +7 -0
- package/src/app/modules/cache/ports/store.ts +14 -0
- package/src/app/modules/config/domain/index.ts +1 -0
- package/src/app/modules/config/domain/models/config.ts +72 -0
- package/src/app/modules/config/domain/models/index.ts +1 -0
- package/src/app/modules/config/index.ts +1 -0
- package/src/app/modules/content/domain/operations/collection.ts +109 -0
- package/src/app/modules/content/index.ts +8 -0
- package/src/app/modules/content/presentation/Markdown.tsx +78 -0
- package/src/app/modules/conventions/domain/index.ts +1 -0
- package/src/app/modules/conventions/domain/operations/index.ts +1 -0
- package/src/app/modules/conventions/domain/operations/scan.ts +73 -0
- package/src/app/modules/conventions/index.ts +1 -0
- package/src/app/modules/db/application/usecases/db.ts +49 -0
- package/src/app/modules/db/index.ts +1 -0
- package/src/app/modules/deploy/adapters/aws-lambda.ts +54 -0
- package/src/app/modules/deploy/adapters/bun.ts +15 -0
- package/src/app/modules/deploy/adapters/cloudflare.ts +15 -0
- package/src/app/modules/deploy/adapters/deno.ts +15 -0
- package/src/app/modules/deploy/adapters/netlify.ts +18 -0
- package/src/app/modules/deploy/adapters/node.ts +63 -0
- package/src/app/modules/deploy/adapters/vercel.ts +22 -0
- package/src/app/modules/deploy/domain/models/preset.ts +38 -0
- package/src/app/modules/deploy/domain/operations/presets.ts +92 -0
- package/src/app/modules/deploy/index.ts +9 -0
- package/src/app/modules/draft/domain/operations/draft-mode.ts +125 -0
- package/src/app/modules/draft/index.ts +1 -0
- package/src/app/modules/env/domain/operations/create-env.ts +156 -0
- package/src/app/modules/env/index.ts +1 -0
- package/src/app/modules/file-routes/application/usecases/api-client.ts +120 -0
- package/src/app/modules/file-routes/domain/errors.ts +61 -0
- package/src/app/modules/file-routes/domain/index.ts +63 -0
- package/src/app/modules/file-routes/domain/models/index.ts +1 -0
- package/src/app/modules/file-routes/domain/models/route.ts +38 -0
- package/src/app/modules/file-routes/domain/operations/actions.ts +107 -0
- package/src/app/modules/file-routes/domain/operations/api.ts +87 -0
- package/src/app/modules/file-routes/domain/operations/codegen.ts +76 -0
- package/src/app/modules/file-routes/domain/operations/content.ts +61 -0
- package/src/app/modules/file-routes/domain/operations/defer.ts +245 -0
- package/src/app/modules/file-routes/domain/operations/index.ts +65 -0
- package/src/app/modules/file-routes/domain/operations/loader.ts +138 -0
- package/src/app/modules/file-routes/domain/operations/manifest.ts +229 -0
- package/src/app/modules/file-routes/domain/operations/match.ts +75 -0
- package/src/app/modules/file-routes/domain/operations/static-params.ts +58 -0
- package/src/app/modules/file-routes/domain/operations/typed.ts +127 -0
- package/src/app/modules/file-routes/index.ts +143 -0
- package/src/app/modules/file-routes/presentation/DevtoolsOverlay.tsx +234 -0
- package/src/app/modules/file-routes/presentation/FileRoutes.ts +254 -0
- package/src/app/modules/file-routes/presentation/Form.tsx +122 -0
- package/src/app/modules/file-routes/presentation/Link.tsx +132 -0
- package/src/app/modules/file-routes/presentation/ServerComponent.tsx +100 -0
- package/src/app/modules/file-routes/presentation/content-page.tsx +26 -0
- package/src/app/modules/file-routes/presentation/dev-events.ts +112 -0
- package/src/app/modules/file-routes/presentation/index.ts +98 -0
- package/src/app/modules/file-routes/presentation/loader-cache.ts +96 -0
- package/src/app/modules/file-routes/presentation/loader-data.ts +207 -0
- package/src/app/modules/file-routes/presentation/location.ts +217 -0
- package/src/app/modules/file-routes/presentation/normalize-route.ts +155 -0
- package/src/app/modules/file-routes/presentation/page-tree.ts +211 -0
- package/src/app/modules/file-routes/presentation/route-contexts.ts +89 -0
- package/src/app/modules/file-routes/presentation/route-def.ts +154 -0
- package/src/app/modules/file-routes/presentation/route-fallbacks.ts +66 -0
- package/src/app/modules/file-routes/presentation/route-modules.ts +138 -0
- package/src/app/modules/file-routes/presentation/slot.tsx +43 -0
- package/src/app/modules/file-routes/presentation/status.ts +13 -0
- package/src/app/modules/file-routes/presentation/use-action.ts +81 -0
- package/src/app/modules/file-routes/presentation/use-optimistic.ts +50 -0
- package/src/app/modules/file-routes/presentation/use-preload.ts +38 -0
- package/src/app/modules/file-routes/presentation/use-route.ts +254 -0
- package/src/app/modules/flash/domain/operations/flash.ts +70 -0
- package/src/app/modules/flash/index.ts +1 -0
- package/src/app/modules/fonts/domain/operations/font.ts +91 -0
- package/src/app/modules/fonts/index.ts +1 -0
- package/src/app/modules/i18n/domain/operations/i18n-middleware.ts +76 -0
- package/src/app/modules/i18n/domain/operations/locale.ts +39 -0
- package/src/app/modules/i18n/index.ts +3 -0
- package/src/app/modules/i18n/presentation/use-locale.ts +16 -0
- package/src/app/modules/middleware/domain/operations/request-id.ts +33 -0
- package/src/app/modules/middleware/domain/operations/run.ts +29 -0
- package/src/app/modules/middleware/index.ts +7 -0
- package/src/app/modules/route-rules/domain/index.ts +1 -0
- package/src/app/modules/route-rules/domain/operations/ab-variant.ts +58 -0
- package/src/app/modules/route-rules/domain/operations/index.ts +4 -0
- package/src/app/modules/route-rules/domain/operations/match.ts +51 -0
- package/src/app/modules/route-rules/domain/operations/rate-limit.ts +63 -0
- package/src/app/modules/route-rules/domain/operations/security.ts +67 -0
- package/src/app/modules/route-rules/index.ts +1 -0
- package/src/app/modules/runtime-config/application/index.ts +1 -0
- package/src/app/modules/runtime-config/application/usecases/index.ts +1 -0
- package/src/app/modules/runtime-config/application/usecases/runtime-config.ts +42 -0
- package/src/app/modules/runtime-config/index.ts +1 -0
- package/src/app/modules/seo/domain/operations/og.ts +66 -0
- package/src/app/modules/seo/domain/operations/site.ts +106 -0
- package/src/app/modules/seo/index.ts +2 -0
- package/src/app/modules/server-entry/application/index.ts +1 -0
- package/src/app/modules/server-entry/application/usecases/create-app-server.ts +205 -0
- package/src/app/modules/server-entry/application/usecases/devtools-handler.ts +31 -0
- package/src/app/modules/server-entry/application/usecases/image-handler.ts +38 -0
- package/src/app/modules/server-entry/application/usecases/index.ts +3 -0
- package/src/app/modules/server-entry/application/usecases/ops-handler.ts +55 -0
- package/src/app/modules/server-entry/application/usecases/prerender-cache.ts +59 -0
- package/src/app/modules/server-entry/application/usecases/route-render.ts +276 -0
- package/src/app/modules/server-entry/application/usecases/routed-entry.ts +194 -0
- package/src/app/modules/server-entry/application/usecases/static-handler.ts +20 -0
- package/src/app/modules/server-entry/application/usecases/zone-handler.ts +37 -0
- package/src/app/modules/server-entry/index.ts +1 -0
- package/src/app/modules/session/index.ts +77 -0
- package/src/app/modules/static/domain/operations/serve.ts +88 -0
- package/src/app/modules/static/index.ts +1 -0
- package/src/app/presentation/App.tsx +34 -0
- package/src/app/presentation/define-config.ts +11 -0
- package/src/app/presentation/index.ts +3 -0
- package/src/app/presentation/providers.ts +80 -0
- package/src/app/types/index.ts +273 -0
- package/src/assets/adapters/sharp.ts +83 -0
- package/src/assets/index.ts +6 -0
- package/src/assets/modules/assets/domain/index.ts +1 -0
- package/src/assets/modules/assets/domain/operations/image.ts +67 -0
- package/src/assets/modules/assets/domain/operations/index.ts +2 -0
- package/src/assets/modules/assets/domain/operations/manifest.ts +29 -0
- package/src/assets/modules/assets/index.ts +1 -0
- package/src/assets/presentation/Image.tsx +90 -0
- package/src/assets/presentation/index.ts +1 -0
- package/src/assets/types/index.ts +21 -0
- package/src/cli/bin.ts +8 -0
- package/src/cli/commands.ts +145 -0
- package/src/cli/doctor.ts +111 -0
- package/src/cli/index.ts +3 -0
- package/src/cli/infra.ts +38 -0
- package/src/cli/migrate.ts +119 -0
- package/src/cli/nav.ts +164 -0
- package/src/cli/ops.ts +135 -0
- package/src/cli/routes.ts +240 -0
- package/src/cli/scaffold.ts +217 -0
- package/src/devtools/App.tsx +14 -0
- package/src/devtools/adapters/connector.ts +23 -0
- package/src/devtools/adapters/index.ts +4 -0
- package/src/devtools/index.ts +26 -0
- package/src/devtools/modules/component-inspector/application/index.ts +4 -0
- package/src/devtools/modules/component-inspector/application/usecases/component-inspector.ts +67 -0
- package/src/devtools/modules/component-inspector/application/usecases/index.ts +5 -0
- package/src/devtools/modules/component-inspector/application/usecases/useComponentInspector.ts +52 -0
- package/src/devtools/modules/component-inspector/domain/events/component-events.ts +37 -0
- package/src/devtools/modules/component-inspector/domain/events/index.ts +4 -0
- package/src/devtools/modules/component-inspector/domain/index.ts +7 -0
- package/src/devtools/modules/component-inspector/domain/models/component-node.ts +30 -0
- package/src/devtools/modules/component-inspector/domain/models/component-tree.ts +20 -0
- package/src/devtools/modules/component-inspector/domain/models/index.ts +5 -0
- package/src/devtools/modules/component-inspector/domain/operations/component-operations.ts +63 -0
- package/src/devtools/modules/component-inspector/domain/operations/index.ts +4 -0
- package/src/devtools/modules/component-inspector/index.ts +7 -0
- package/src/devtools/modules/devtools/application/index.ts +4 -0
- package/src/devtools/modules/devtools/application/usecases/devtools.ts +60 -0
- package/src/devtools/modules/devtools/application/usecases/index.ts +5 -0
- package/src/devtools/modules/devtools/application/usecases/useDevtools.ts +47 -0
- package/src/devtools/modules/devtools/domain/events/devtools-events.ts +56 -0
- package/src/devtools/modules/devtools/domain/events/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/index.ts +8 -0
- package/src/devtools/modules/devtools/domain/models/devtools-state.ts +15 -0
- package/src/devtools/modules/devtools/domain/models/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/operations/devtools-operations.ts +27 -0
- package/src/devtools/modules/devtools/domain/operations/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/validators/devtools-validators.ts +36 -0
- package/src/devtools/modules/devtools/domain/validators/index.ts +4 -0
- package/src/devtools/modules/devtools/index.ts +7 -0
- package/src/devtools/modules/devtools/ports/connector.ts +10 -0
- package/src/devtools/modules/devtools/ports/index.ts +4 -0
- package/src/devtools/modules/timeline/application/index.ts +4 -0
- package/src/devtools/modules/timeline/application/usecases/index.ts +5 -0
- package/src/devtools/modules/timeline/application/usecases/timeline.ts +61 -0
- package/src/devtools/modules/timeline/application/usecases/useTimeline.ts +37 -0
- package/src/devtools/modules/timeline/domain/events/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/events/timeline-events.ts +34 -0
- package/src/devtools/modules/timeline/domain/index.ts +7 -0
- package/src/devtools/modules/timeline/domain/models/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/models/timeline-event.ts +27 -0
- package/src/devtools/modules/timeline/domain/operations/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/operations/timeline-operations.ts +28 -0
- package/src/devtools/modules/timeline/index.ts +7 -0
- package/src/devtools/presentation/DevtoolsPanel.tsx +80 -0
- package/src/devtools/presentation/components/ComponentTreeView.tsx +79 -0
- package/src/devtools/presentation/components/StateInspector.tsx +70 -0
- package/src/devtools/presentation/components/TimelineView.tsx +52 -0
- package/src/devtools/presentation/components/index.ts +7 -0
- package/src/devtools/presentation/composables/index.ts +7 -0
- package/src/devtools/presentation/composables/useComponentInspector.ts +52 -0
- package/src/devtools/presentation/index.ts +5 -0
- package/src/devtools/shared/errors/index.ts +23 -0
- package/src/devtools/shared/index.ts +7 -0
- package/src/devtools/shared/types/index.ts +6 -0
- package/src/devtools/shared/types/option.ts +58 -0
- package/src/devtools/shared/types/result.ts +53 -0
- package/src/devtools/shared/utils/index.ts +32 -0
- package/src/devtools/style.css +2 -0
- package/src/head/index.ts +5 -0
- package/src/head/modules/head/application/index.ts +1 -0
- package/src/head/modules/head/application/usecases/head-manager.ts +68 -0
- package/src/head/modules/head/application/usecases/index.ts +1 -0
- package/src/head/modules/head/domain/index.ts +3 -0
- package/src/head/modules/head/domain/models/head-tag.ts +73 -0
- package/src/head/modules/head/domain/models/index.ts +1 -0
- package/src/head/modules/head/domain/operations/dedupe.ts +18 -0
- package/src/head/modules/head/domain/operations/index.ts +2 -0
- package/src/head/modules/head/domain/operations/render-tags.ts +43 -0
- package/src/head/modules/head/domain/validators/index.ts +12 -0
- package/src/head/modules/head/index.ts +3 -0
- package/src/head/modules/head/ports/index.ts +11 -0
- package/src/head/presentation/HeadProvider.tsx +42 -0
- package/src/head/presentation/Tags.tsx +90 -0
- package/src/head/presentation/head-context.ts +11 -0
- package/src/head/presentation/index.ts +3 -0
- package/src/head/presentation/useHead.ts +77 -0
- package/src/head/shared/index.ts +1 -0
- package/src/head/shared/types/index.ts +5 -0
- package/src/head/types/index.ts +47 -0
- package/src/hooks/adapters/config/constants.ts +12 -0
- package/src/hooks/adapters/config/index.ts +48 -0
- package/src/hooks/adapters/index.ts +13 -0
- package/src/hooks/adapters/monaco/index.ts +96 -0
- package/src/hooks/adapters/qr/index.ts +65 -0
- package/src/hooks/index.ts +21 -0
- package/src/hooks/modules/array/application/index.ts +2 -0
- package/src/hooks/modules/array/application/usecases/index.ts +123 -0
- package/src/hooks/modules/array/domain/events/index.ts +5 -0
- package/src/hooks/modules/array/domain/index.ts +3 -0
- package/src/hooks/modules/array/domain/models/index.ts +2 -0
- package/src/hooks/modules/array/domain/operations/create.ts +10 -0
- package/src/hooks/modules/array/domain/operations/index.ts +31 -0
- package/src/hooks/modules/array/domain/operations/modify.ts +61 -0
- package/src/hooks/modules/array/domain/operations/query.ts +36 -0
- package/src/hooks/modules/array/domain/validators/index.ts +5 -0
- package/src/hooks/modules/array/index.ts +5 -0
- package/src/hooks/modules/array/types/index.ts +9 -0
- package/src/hooks/modules/counter/application/index.ts +12 -0
- package/src/hooks/modules/counter/application/usecases/index.ts +156 -0
- package/src/hooks/modules/counter/domain/events/index.ts +6 -0
- package/src/hooks/modules/counter/domain/index.ts +21 -0
- package/src/hooks/modules/counter/domain/models/index.ts +2 -0
- package/src/hooks/modules/counter/domain/operations/calculate.ts +22 -0
- package/src/hooks/modules/counter/domain/operations/create.ts +22 -0
- package/src/hooks/modules/counter/domain/operations/index.ts +25 -0
- package/src/hooks/modules/counter/domain/operations/modify.ts +78 -0
- package/src/hooks/modules/counter/domain/operations/query.ts +38 -0
- package/src/hooks/modules/counter/domain/operations/validate.ts +58 -0
- package/src/hooks/modules/counter/domain/validators/counter-validators.ts +19 -0
- package/src/hooks/modules/counter/domain/validators/index.ts +2 -0
- package/src/hooks/modules/counter/index.ts +6 -0
- package/src/hooks/modules/counter/ports/index.ts +7 -0
- package/src/hooks/modules/counter/types/index.ts +13 -0
- package/src/hooks/modules/editor/application/index.ts +6 -0
- package/src/hooks/modules/editor/application/useCodeEditor.ts +81 -0
- package/src/hooks/modules/editor/domain/events/editor-events.ts +16 -0
- package/src/hooks/modules/editor/domain/events/index.ts +6 -0
- package/src/hooks/modules/editor/domain/index.ts +7 -0
- package/src/hooks/modules/editor/domain/models/editor.ts +16 -0
- package/src/hooks/modules/editor/domain/models/index.ts +6 -0
- package/src/hooks/modules/editor/domain/validators/index.ts +34 -0
- package/src/hooks/modules/editor/index.ts +8 -0
- package/src/hooks/modules/editor/types/index.ts +34 -0
- package/src/hooks/modules/sensor/application/index.ts +2 -0
- package/src/hooks/modules/sensor/application/usecases/index.ts +25 -0
- package/src/hooks/modules/sensor/domain/events/index.ts +12 -0
- package/src/hooks/modules/sensor/domain/index.ts +10 -0
- package/src/hooks/modules/sensor/domain/models/index.ts +7 -0
- package/src/hooks/modules/sensor/domain/operations/gamepad.ts +16 -0
- package/src/hooks/modules/sensor/domain/operations/index.ts +12 -0
- package/src/hooks/modules/sensor/domain/operations/motion.ts +10 -0
- package/src/hooks/modules/sensor/domain/operations/orientation.ts +10 -0
- package/src/hooks/modules/sensor/domain/validators/index.ts +2 -0
- package/src/hooks/modules/sensor/index.ts +10 -0
- package/src/hooks/modules/sensor/ports/index.ts +8 -0
- package/src/hooks/modules/sensor/types/index.ts +29 -0
- package/src/hooks/modules/storage/application/index.ts +2 -0
- package/src/hooks/modules/storage/application/usecases/index.ts +18 -0
- package/src/hooks/modules/storage/domain/events/index.ts +5 -0
- package/src/hooks/modules/storage/domain/index.ts +6 -0
- package/src/hooks/modules/storage/domain/models/index.ts +6 -0
- package/src/hooks/modules/storage/domain/models/storage.ts +11 -0
- package/src/hooks/modules/storage/domain/operations/index.ts +8 -0
- package/src/hooks/modules/storage/domain/operations/serialize.ts +22 -0
- package/src/hooks/modules/storage/domain/operations/validate.ts +7 -0
- package/src/hooks/modules/storage/domain/validators/index.ts +2 -0
- package/src/hooks/modules/storage/index.ts +6 -0
- package/src/hooks/modules/storage/ports/index.ts +7 -0
- package/src/hooks/modules/storage/types/index.ts +6 -0
- package/src/hooks/modules/time/application/index.ts +2 -0
- package/src/hooks/modules/time/application/usecases/index.ts +5 -0
- package/src/hooks/modules/time/application/usecases/use-debounce.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-interval.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-throttle.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-timeout.ts +10 -0
- package/src/hooks/modules/time/domain/events/index.ts +6 -0
- package/src/hooks/modules/time/domain/index.ts +12 -0
- package/src/hooks/modules/time/domain/models/index.ts +6 -0
- package/src/hooks/modules/time/domain/models/time.ts +16 -0
- package/src/hooks/modules/time/domain/operations/calculate.ts +8 -0
- package/src/hooks/modules/time/domain/operations/index.ts +11 -0
- package/src/hooks/modules/time/domain/operations/validate.ts +11 -0
- package/src/hooks/modules/time/domain/validators/index.ts +2 -0
- package/src/hooks/modules/time/index.ts +5 -0
- package/src/hooks/modules/time/ports/index.ts +9 -0
- package/src/hooks/modules/time/types/index.ts +18 -0
- package/src/hooks/modules/toggle/application/index.ts +2 -0
- package/src/hooks/modules/toggle/application/usecases/index.ts +48 -0
- package/src/hooks/modules/toggle/domain/events/index.ts +4 -0
- package/src/hooks/modules/toggle/domain/index.ts +11 -0
- package/src/hooks/modules/toggle/domain/models/index.ts +7 -0
- package/src/hooks/modules/toggle/domain/operations/create.ts +11 -0
- package/src/hooks/modules/toggle/domain/operations/index.ts +12 -0
- package/src/hooks/modules/toggle/domain/operations/modify.ts +18 -0
- package/src/hooks/modules/toggle/domain/operations/query.ts +9 -0
- package/src/hooks/modules/toggle/domain/validators/index.ts +2 -0
- package/src/hooks/modules/toggle/index.ts +6 -0
- package/src/hooks/modules/toggle/ports/index.ts +5 -0
- package/src/hooks/modules/toggle/types/index.ts +9 -0
- package/src/hooks/presentation/index.ts +2 -0
- package/src/hooks/presentation/solid/animation/index.ts +11 -0
- package/src/hooks/presentation/solid/animation/useElapsedTime.ts +75 -0
- package/src/hooks/presentation/solid/animation/useInterval.ts +68 -0
- package/src/hooks/presentation/solid/animation/useIntervalFn.ts +54 -0
- package/src/hooks/presentation/solid/animation/useNow.ts +57 -0
- package/src/hooks/presentation/solid/animation/useRafFn.ts +57 -0
- package/src/hooks/presentation/solid/animation/useTimeout.ts +55 -0
- package/src/hooks/presentation/solid/animation/useTimeoutFn.ts +55 -0
- package/src/hooks/presentation/solid/animation/useTimestamp.ts +61 -0
- package/src/hooks/presentation/solid/animation/useTransition.ts +87 -0
- package/src/hooks/presentation/solid/array/index.ts +14 -0
- package/src/hooks/presentation/solid/array/useArrayConcat.ts +18 -0
- package/src/hooks/presentation/solid/array/useArrayEvery.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayFilter.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayFind.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayIncludes.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayMap.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayPop.ts +18 -0
- package/src/hooks/presentation/solid/array/useArrayPush.ts +15 -0
- package/src/hooks/presentation/solid/array/useArrayReduce.ts +9 -0
- package/src/hooks/presentation/solid/array/useArrayShift.ts +18 -0
- package/src/hooks/presentation/solid/array/useArraySome.ts +8 -0
- package/src/hooks/presentation/solid/array/useArraySort.ts +12 -0
- package/src/hooks/presentation/solid/browser/index.ts +35 -0
- package/src/hooks/presentation/solid/browser/useBarcode.ts +15 -0
- package/src/hooks/presentation/solid/browser/useBattery.ts +37 -0
- package/src/hooks/presentation/solid/browser/useBeacon.ts +4 -0
- package/src/hooks/presentation/solid/browser/useBluetooth.ts +15 -0
- package/src/hooks/presentation/solid/browser/useClipboard.ts +17 -0
- package/src/hooks/presentation/solid/browser/useClipboardAdvanced.ts +54 -0
- package/src/hooks/presentation/solid/browser/useConnection.ts +22 -0
- package/src/hooks/presentation/solid/browser/useCredential.ts +18 -0
- package/src/hooks/presentation/solid/browser/useDisplayMedia.ts +24 -0
- package/src/hooks/presentation/solid/browser/useFaceDetection.ts +20 -0
- package/src/hooks/presentation/solid/browser/useFullscreen.ts +33 -0
- package/src/hooks/presentation/solid/browser/useGeolocation.ts +64 -0
- package/src/hooks/presentation/solid/browser/useLocalStorage.ts +11 -0
- package/src/hooks/presentation/solid/browser/useMediaDevices.ts +24 -0
- package/src/hooks/presentation/solid/browser/useMemory.ts +9 -0
- package/src/hooks/presentation/solid/browser/useNetwork.ts +43 -0
- package/src/hooks/presentation/solid/browser/useNotification.ts +21 -0
- package/src/hooks/presentation/solid/browser/usePayment.ts +17 -0
- package/src/hooks/presentation/solid/browser/usePerformance.ts +13 -0
- package/src/hooks/presentation/solid/browser/usePush.ts +12 -0
- package/src/hooks/presentation/solid/browser/useQrCode.ts +11 -0
- package/src/hooks/presentation/solid/browser/useScreenOrientation.ts +37 -0
- package/src/hooks/presentation/solid/browser/useServiceWorker.ts +29 -0
- package/src/hooks/presentation/solid/browser/useSessionStorage.ts +11 -0
- package/src/hooks/presentation/solid/browser/useShare.ts +12 -0
- package/src/hooks/presentation/solid/browser/useSpeechRecognition.ts +71 -0
- package/src/hooks/presentation/solid/browser/useSpeechSynthesis.ts +54 -0
- package/src/hooks/presentation/solid/browser/useStorage.ts +22 -0
- package/src/hooks/presentation/solid/browser/useTextDetection.ts +20 -0
- package/src/hooks/presentation/solid/browser/useUsb.ts +15 -0
- package/src/hooks/presentation/solid/browser/useUserMedia.ts +24 -0
- package/src/hooks/presentation/solid/browser/useVibration.ts +12 -0
- package/src/hooks/presentation/solid/browser/useWakeLock.ts +29 -0
- package/src/hooks/presentation/solid/browser/useWebAuthn.ts +35 -0
- package/src/hooks/presentation/solid/elements/index.ts +51 -0
- package/src/hooks/presentation/solid/elements/useActive.ts +33 -0
- package/src/hooks/presentation/solid/elements/useAudio.ts +82 -0
- package/src/hooks/presentation/solid/elements/useBreakpoints.ts +56 -0
- package/src/hooks/presentation/solid/elements/useCanvas.ts +43 -0
- package/src/hooks/presentation/solid/elements/useClick.ts +49 -0
- package/src/hooks/presentation/solid/elements/useDrag.ts +56 -0
- package/src/hooks/presentation/solid/elements/useDraggable.ts +57 -0
- package/src/hooks/presentation/solid/elements/useDraggableHandle.ts +92 -0
- package/src/hooks/presentation/solid/elements/useDrop.ts +54 -0
- package/src/hooks/presentation/solid/elements/useDropZone.ts +67 -0
- package/src/hooks/presentation/solid/elements/useElementBounding.ts +52 -0
- package/src/hooks/presentation/solid/elements/useElementSize.ts +30 -0
- package/src/hooks/presentation/solid/elements/useElementVisibility.ts +33 -0
- package/src/hooks/presentation/solid/elements/useFileDialog.ts +33 -0
- package/src/hooks/presentation/solid/elements/useFileInput.ts +20 -0
- package/src/hooks/presentation/solid/elements/useFocus.ts +49 -0
- package/src/hooks/presentation/solid/elements/useHover.ts +33 -0
- package/src/hooks/presentation/solid/elements/useImagePreview.ts +27 -0
- package/src/hooks/presentation/solid/elements/useImageUpload.ts +66 -0
- package/src/hooks/presentation/solid/elements/useInfiniteScroll.ts +52 -0
- package/src/hooks/presentation/solid/elements/useIntersectionAdvanced.ts +43 -0
- package/src/hooks/presentation/solid/elements/useIntersectionObserver.ts +40 -0
- package/src/hooks/presentation/solid/elements/useLayout.ts +47 -0
- package/src/hooks/presentation/solid/elements/useLongPress.ts +54 -0
- package/src/hooks/presentation/solid/elements/useMagicKeys.ts +60 -0
- package/src/hooks/presentation/solid/elements/useMediaQuery.ts +24 -0
- package/src/hooks/presentation/solid/elements/useModal.ts +24 -0
- package/src/hooks/presentation/solid/elements/useMouse.ts +51 -0
- package/src/hooks/presentation/solid/elements/useMutationObserver.ts +38 -0
- package/src/hooks/presentation/solid/elements/useOnClickOutside.ts +25 -0
- package/src/hooks/presentation/solid/elements/useOnKeyStroke.ts +33 -0
- package/src/hooks/presentation/solid/elements/useParallax.ts +34 -0
- package/src/hooks/presentation/solid/elements/usePerformanceObserver.ts +30 -0
- package/src/hooks/presentation/solid/elements/usePinch.ts +61 -0
- package/src/hooks/presentation/solid/elements/usePopover.ts +54 -0
- package/src/hooks/presentation/solid/elements/useResize.ts +34 -0
- package/src/hooks/presentation/solid/elements/useResizeObserver.ts +42 -0
- package/src/hooks/presentation/solid/elements/useRotate.ts +42 -0
- package/src/hooks/presentation/solid/elements/useScroll.ts +97 -0
- package/src/hooks/presentation/solid/elements/useScrollTo.ts +30 -0
- package/src/hooks/presentation/solid/elements/useSortable.ts +22 -0
- package/src/hooks/presentation/solid/elements/useSplitter.ts +61 -0
- package/src/hooks/presentation/solid/elements/useSticky.ts +33 -0
- package/src/hooks/presentation/solid/elements/useSvg.ts +31 -0
- package/src/hooks/presentation/solid/elements/useSwipe.ts +87 -0
- package/src/hooks/presentation/solid/elements/useTabs.ts +44 -0
- package/src/hooks/presentation/solid/elements/useTooltip.ts +57 -0
- package/src/hooks/presentation/solid/elements/useVideo.ts +83 -0
- package/src/hooks/presentation/solid/elements/useVirtualList.ts +43 -0
- package/src/hooks/presentation/solid/elements/useWebgl.ts +36 -0
- package/src/hooks/presentation/solid/index.ts +11 -0
- package/src/hooks/presentation/solid/math/index.ts +10 -0
- package/src/hooks/presentation/solid/math/useAbs.ts +9 -0
- package/src/hooks/presentation/solid/math/useCeil.ts +9 -0
- package/src/hooks/presentation/solid/math/useClamp.ts +24 -0
- package/src/hooks/presentation/solid/math/useExp.ts +9 -0
- package/src/hooks/presentation/solid/math/useFloor.ts +9 -0
- package/src/hooks/presentation/solid/math/useLog.ts +21 -0
- package/src/hooks/presentation/solid/math/useMath.ts +3 -0
- package/src/hooks/presentation/solid/math/useOffset.ts +20 -0
- package/src/hooks/presentation/solid/math/usePow.ts +16 -0
- package/src/hooks/presentation/solid/math/useRound.ts +24 -0
- package/src/hooks/presentation/solid/math/useSign.ts +9 -0
- package/src/hooks/presentation/solid/math/useSqrt.ts +9 -0
- package/src/hooks/presentation/solid/network/index.ts +5 -0
- package/src/hooks/presentation/solid/network/useEventSource.ts +87 -0
- package/src/hooks/presentation/solid/network/useFetch.ts +187 -0
- package/src/hooks/presentation/solid/network/useWebSocket.ts +120 -0
- package/src/hooks/presentation/solid/sensors/index.ts +21 -0
- package/src/hooks/presentation/solid/sensors/useAbsoluteOrientation.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useAccelerometer.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useAmbientLight.ts +35 -0
- package/src/hooks/presentation/solid/sensors/useDeviceMotion.ts +50 -0
- package/src/hooks/presentation/solid/sensors/useDeviceOrientation.ts +38 -0
- package/src/hooks/presentation/solid/sensors/useGamepad.ts +52 -0
- package/src/hooks/presentation/solid/sensors/useGamepadRumble.ts +28 -0
- package/src/hooks/presentation/solid/sensors/useGravity.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useGyroscope.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useHID.ts +19 -0
- package/src/hooks/presentation/solid/sensors/useLinearAcceleration.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useMagnetometer.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useMotion.ts +31 -0
- package/src/hooks/presentation/solid/sensors/useNFC.ts +19 -0
- package/src/hooks/presentation/solid/sensors/usePressure.ts +35 -0
- package/src/hooks/presentation/solid/sensors/useProximity.ts +38 -0
- package/src/hooks/presentation/solid/sensors/useRelativeOrientation.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useSerial.ts +18 -0
- package/src/hooks/presentation/solid/sensors/useShake.ts +54 -0
- package/src/hooks/presentation/solid/sensors/useTilt.ts +31 -0
- package/src/hooks/presentation/solid/state/createSharedComposable.ts +24 -0
- package/src/hooks/presentation/solid/state/index.ts +14 -0
- package/src/hooks/presentation/solid/state/reactivity.ts +43 -0
- package/src/hooks/presentation/solid/state/refDebounced.ts +27 -0
- package/src/hooks/presentation/solid/state/refThrottled.ts +39 -0
- package/src/hooks/presentation/solid/state/syncRef.ts +24 -0
- package/src/hooks/presentation/solid/state/toRef.ts +18 -0
- package/src/hooks/presentation/solid/state/useArray.ts +55 -0
- package/src/hooks/presentation/solid/state/useCounter.ts +24 -0
- package/src/hooks/presentation/solid/state/useToggle.ts +20 -0
- package/src/hooks/presentation/solid/time/index.ts +6 -0
- package/src/hooks/presentation/solid/time/useDebounceFn.ts +18 -0
- package/src/hooks/presentation/solid/time/useInterval.ts +44 -0
- package/src/hooks/presentation/solid/time/useThrottleFn.ts +30 -0
- package/src/hooks/presentation/solid/time/useTimeout.ts +37 -0
- package/src/hooks/presentation/solid/time/watchDebounced.ts +19 -0
- package/src/hooks/presentation/solid/time/watchPausable.ts +29 -0
- package/src/hooks/presentation/solid/time/whenever.ts +13 -0
- package/src/hooks/presentation/solid/utilities/index.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayEvery.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayFilter.ts +11 -0
- package/src/hooks/presentation/solid/utilities/useArrayFind.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayIncludes.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayMap.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayReduce.ts +9 -0
- package/src/hooks/presentation/solid/utilities/useArraySome.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArraySort.ts +12 -0
- package/src/hooks/presentation/solid/utilities/useClamp.ts +24 -0
- package/src/hooks/presentation/solid/utilities/useDebounce.ts +32 -0
- package/src/hooks/presentation/solid/utilities/useEventBus.ts +57 -0
- package/src/hooks/presentation/solid/utilities/useMemoize.ts +15 -0
- package/src/hooks/presentation/solid/utilities/useOffset.ts +20 -0
- package/src/hooks/presentation/solid/utilities/useRound.ts +24 -0
- package/src/hooks/presentation/solid/utilities/useSorted.ts +12 -0
- package/src/hooks/presentation/solid/utilities/useThrottle.ts +44 -0
- package/src/hooks/presentation/solid/utilities/useToNumber.ts +11 -0
- package/src/hooks/presentation/solid/utilities/useToString.ts +10 -0
- package/src/hooks/realtime/use-sse.ts +70 -0
- package/src/hooks/shared/constants/index.ts +4 -0
- package/src/hooks/shared/errors/index.ts +1 -0
- package/src/hooks/shared/errors/validation-error.ts +28 -0
- package/src/hooks/shared/index.ts +8 -0
- package/src/hooks/shared/types/index.ts +17 -0
- package/src/hooks/shared/types/option.ts +17 -0
- package/src/hooks/shared/types/result.ts +34 -0
- package/src/hooks/shared/types/utilities.ts +102 -0
- package/src/hooks/shared/utils/identity.ts +2 -0
- package/src/hooks/shared/utils/index.ts +4 -0
- package/src/hooks/shared/utils/logger.ts +69 -0
- package/src/hooks/shared/utils/pipe.ts +5 -0
- package/src/hooks/shared/utils/result.ts +9 -0
- package/src/hooks/test/counter.test.ts +25 -0
- package/src/index.ts +16 -0
- package/src/internal.ts +61 -0
- package/src/query/adapters/devtools/index.ts +29 -0
- package/src/query/adapters/persistence/index.ts +62 -0
- package/src/query/adapters/solid/index.ts +10 -0
- package/src/query/adapters/solid/solid-query-context.ts +29 -0
- package/src/query/adapters/solid/solid-query-empty-result.ts +34 -0
- package/src/query/adapters/solid/solid-query-options.ts +52 -0
- package/src/query/adapters/solid/solid-query-use-infinite.ts +228 -0
- package/src/query/adapters/solid/solid-query-use-mutation.ts +54 -0
- package/src/query/adapters/solid/solid-query-use-query.ts +75 -0
- package/src/query/adapters/solid/solid.test.ts +53 -0
- package/src/query/adapters/validation/index.ts +20 -0
- package/src/query/index.test.ts +203 -0
- package/src/query/index.ts +4 -0
- package/src/query/modules/query/application/usecases/query-client-data.ts +29 -0
- package/src/query/modules/query/application/usecases/query-client-helpers.ts +49 -0
- package/src/query/modules/query/application/usecases/query-client-infinite.ts +39 -0
- package/src/query/modules/query/application/usecases/query-client.ts +251 -0
- package/src/query/modules/query/domain/models/mutation-cache.ts +115 -0
- package/src/query/modules/query/domain/models/mutation.ts +207 -0
- package/src/query/modules/query/domain/models/query-cache.ts +119 -0
- package/src/query/modules/query/domain/models/query-environment.ts +16 -0
- package/src/query/modules/query/domain/models/query-observer.ts +162 -0
- package/src/query/modules/query/domain/models/query-operations.ts +76 -0
- package/src/query/modules/query/domain/models/query.ts +239 -0
- package/src/query/modules/query/domain/operations/index.ts +76 -0
- package/src/query/modules/query/index.ts +9 -0
- package/src/query/modules/query/ports/index.ts +53 -0
- package/src/query/modules/query/types/index.ts +239 -0
- package/src/query/shared/index.ts +48 -0
- package/src/render/adapters/index.ts +1 -0
- package/src/render/adapters/solid-web/hydration.ts +35 -0
- package/src/render/adapters/solid-web/index.ts +3 -0
- package/src/render/adapters/solid-web/renderer.ts +20 -0
- package/src/render/index.ts +7 -0
- package/src/render/modules/render/application/index.ts +1 -0
- package/src/render/modules/render/application/usecases/index.ts +4 -0
- package/src/render/modules/render/application/usecases/remote-island.ts +46 -0
- package/src/render/modules/render/application/usecases/render-page.ts +86 -0
- package/src/render/modules/render/application/usecases/render-shell.ts +56 -0
- package/src/render/modules/render/application/usecases/stream-page.ts +159 -0
- package/src/render/modules/render/domain/index.ts +3 -0
- package/src/render/modules/render/domain/models/context.ts +34 -0
- package/src/render/modules/render/domain/models/document.ts +26 -0
- package/src/render/modules/render/domain/models/index.ts +2 -0
- package/src/render/modules/render/domain/operations/document.ts +58 -0
- package/src/render/modules/render/domain/operations/hydration.ts +58 -0
- package/src/render/modules/render/domain/operations/index.ts +3 -0
- package/src/render/modules/render/domain/operations/rsc.ts +53 -0
- package/src/render/modules/render/domain/validators/index.ts +11 -0
- package/src/render/modules/render/index.ts +3 -0
- package/src/render/modules/render/ports/index.ts +17 -0
- package/src/render/presentation/ClientComponent.tsx +42 -0
- package/src/render/presentation/Document.tsx +45 -0
- package/src/render/presentation/Island.tsx +146 -0
- package/src/render/presentation/RemoteIsland.tsx +68 -0
- package/src/render/presentation/entries.ts +83 -0
- package/src/render/presentation/index.ts +5 -0
- package/src/render/shared/index.ts +2 -0
- package/src/render/shared/types/index.ts +9 -0
- package/src/render/shared/utils/index.ts +1 -0
- package/src/render/shared/utils/result.ts +30 -0
- package/src/render/types/index.ts +58 -0
- package/src/router/adapters/index.ts +1 -0
- package/src/router/adapters/solid-start/index.ts +42 -0
- package/src/router/cli/bundle-analyzer.ts +142 -0
- package/src/router/cli/index.ts +3 -0
- package/src/router/cli/migration-cli.ts +217 -0
- package/src/router/cli/route-generator-config.ts +109 -0
- package/src/router/cli/route-generator-templates.ts +117 -0
- package/src/router/cli/route-generator-types.ts +9 -0
- package/src/router/cli/route-generator-utils.ts +40 -0
- package/src/router/cli/route-generator.ts +64 -0
- package/src/router/index.test.ts +7 -0
- package/src/router/index.ts +21 -0
- package/src/router/modules/navigation/application/index.ts +1 -0
- package/src/router/modules/navigation/application/usecases.ts +42 -0
- package/src/router/modules/navigation/domain/index.ts +2 -0
- package/src/router/modules/navigation/domain/models.ts +44 -0
- package/src/router/modules/navigation/domain/operations.ts +28 -0
- package/src/router/modules/navigation/index.ts +3 -0
- package/src/router/modules/navigation/types/index.ts +15 -0
- package/src/router/modules/route-cache/application/usecases/index.ts +74 -0
- package/src/router/modules/route-cache/domain/models/index.ts +63 -0
- package/src/router/modules/route-cache/domain/operations/cache-evict.ts +104 -0
- package/src/router/modules/route-cache/domain/operations/cache-invalidate.ts +101 -0
- package/src/router/modules/route-cache/domain/operations/cache-read.ts +74 -0
- package/src/router/modules/route-cache/domain/operations/cache-write.ts +62 -0
- package/src/router/modules/route-cache/domain/operations/index.ts +4 -0
- package/src/router/modules/route-cache/domain/validators/index.ts +25 -0
- package/src/router/modules/route-cache/index.ts +8 -0
- package/src/router/modules/route-cache/ports/index.ts +20 -0
- package/src/router/modules/route-cache/types/index.ts +8 -0
- package/src/router/modules/route-error-tracking/application/usecases/index.ts +182 -0
- package/src/router/modules/route-error-tracking/domain/index.ts +5 -0
- package/src/router/modules/route-error-tracking/domain/models/index.ts +130 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-cleanup.ts +50 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-queries.ts +103 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-recording.ts +112 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-reporting.ts +55 -0
- package/src/router/modules/route-error-tracking/domain/operations/index.ts +4 -0
- package/src/router/modules/route-error-tracking/domain/validators/index.ts +46 -0
- package/src/router/modules/route-error-tracking/index.ts +8 -0
- package/src/router/modules/route-error-tracking/ports/index.ts +20 -0
- package/src/router/modules/route-error-tracking/types/index.ts +6 -0
- package/src/router/modules/route-feature-flags/application/usecases/index.ts +159 -0
- package/src/router/modules/route-feature-flags/domain/index.ts +5 -0
- package/src/router/modules/route-feature-flags/domain/models/index.ts +102 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-audit.ts +37 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-conditions.ts +52 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-flags.ts +205 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-routes.ts +54 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-segments.ts +22 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-statistics.ts +22 -0
- package/src/router/modules/route-feature-flags/domain/operations/index.ts +6 -0
- package/src/router/modules/route-feature-flags/domain/validators/index.ts +40 -0
- package/src/router/modules/route-feature-flags/index.ts +8 -0
- package/src/router/modules/route-feature-flags/ports/index.ts +23 -0
- package/src/router/modules/route-feature-flags/types/index.ts +7 -0
- package/src/router/modules/route-i18n/application/usecases/index.ts +81 -0
- package/src/router/modules/route-i18n/domain/models/index.ts +85 -0
- package/src/router/modules/route-i18n/domain/operations/index.ts +201 -0
- package/src/router/modules/route-i18n/domain/validators/index.ts +43 -0
- package/src/router/modules/route-i18n/index.ts +8 -0
- package/src/router/modules/route-i18n/ports/index.ts +20 -0
- package/src/router/modules/route-i18n/types/index.ts +7 -0
- package/src/router/modules/route-navigation-timeline/application/usecases/index.ts +182 -0
- package/src/router/modules/route-navigation-timeline/domain/index.ts +5 -0
- package/src/router/modules/route-navigation-timeline/domain/models/index.ts +143 -0
- package/src/router/modules/route-navigation-timeline/domain/operations/index.ts +177 -0
- package/src/router/modules/route-navigation-timeline/domain/validators/index.ts +19 -0
- package/src/router/modules/route-navigation-timeline/index.ts +8 -0
- package/src/router/modules/route-navigation-timeline/ports/index.ts +30 -0
- package/src/router/modules/route-navigation-timeline/types/index.ts +5 -0
- package/src/router/modules/route-performance/application/usecases/index.ts +166 -0
- package/src/router/modules/route-performance/domain/models/index.ts +96 -0
- package/src/router/modules/route-performance/domain/operations/index.ts +5 -0
- package/src/router/modules/route-performance/domain/operations/performance-cleanup.ts +29 -0
- package/src/router/modules/route-performance/domain/operations/performance-queries.ts +91 -0
- package/src/router/modules/route-performance/domain/operations/performance-recording.ts +151 -0
- package/src/router/modules/route-performance/domain/operations/performance-reporting.ts +32 -0
- package/src/router/modules/route-performance/domain/operations/performance-tracking.ts +75 -0
- package/src/router/modules/route-performance/domain/validators/index.ts +55 -0
- package/src/router/modules/route-performance/index.ts +8 -0
- package/src/router/modules/route-performance/ports/index.ts +25 -0
- package/src/router/modules/route-performance/types/index.ts +6 -0
- package/src/router/modules/route-security/application/usecases/index.ts +153 -0
- package/src/router/modules/route-security/domain/models/index.ts +216 -0
- package/src/router/modules/route-security/domain/operations/index.ts +165 -0
- package/src/router/modules/route-security/domain/validators/index.ts +32 -0
- package/src/router/modules/route-security/index.ts +8 -0
- package/src/router/modules/route-security/ports/index.ts +31 -0
- package/src/router/modules/route-security/types/index.ts +11 -0
- package/src/router/modules/route-testing/application/usecases/index.ts +131 -0
- package/src/router/modules/route-testing/domain/models/index.ts +217 -0
- package/src/router/modules/route-testing/domain/operations/contract-testing-operations.ts +239 -0
- package/src/router/modules/route-testing/domain/operations/e2e-testing-operations.ts +167 -0
- package/src/router/modules/route-testing/domain/operations/index.ts +3 -0
- package/src/router/modules/route-testing/domain/operations/route-testing-core.ts +48 -0
- package/src/router/modules/route-testing/domain/validators/index.ts +34 -0
- package/src/router/modules/route-testing/index.ts +8 -0
- package/src/router/modules/route-testing/ports/index.ts +21 -0
- package/src/router/modules/route-testing/types/index.ts +13 -0
- package/src/router/modules/routing/application/index.ts +7 -0
- package/src/router/modules/routing/application/usecases.ts +49 -0
- package/src/router/modules/routing/domain/ab-testing.ts +86 -0
- package/src/router/modules/routing/domain/analytics.ts +88 -0
- package/src/router/modules/routing/domain/caching-evict.ts +104 -0
- package/src/router/modules/routing/domain/caching-invalidate.ts +101 -0
- package/src/router/modules/routing/domain/caching-read.ts +74 -0
- package/src/router/modules/routing/domain/caching-state.ts +38 -0
- package/src/router/modules/routing/domain/caching-types.ts +38 -0
- package/src/router/modules/routing/domain/caching-write.ts +62 -0
- package/src/router/modules/routing/domain/caching.ts +6 -0
- package/src/router/modules/routing/domain/code-splitting.ts +226 -0
- package/src/router/modules/routing/domain/contract-factory.ts +37 -0
- package/src/router/modules/routing/domain/contract-testing.ts +13 -0
- package/src/router/modules/routing/domain/contract-types.ts +32 -0
- package/src/router/modules/routing/domain/contract-validator.ts +246 -0
- package/src/router/modules/routing/domain/dynamic-imports.ts +67 -0
- package/src/router/modules/routing/domain/e2e-testing.ts +267 -0
- package/src/router/modules/routing/domain/error-boundaries.ts +54 -0
- package/src/router/modules/routing/domain/error-tracking.ts +277 -0
- package/src/router/modules/routing/domain/feature-flags.ts +255 -0
- package/src/router/modules/routing/domain/guards.ts +104 -0
- package/src/router/modules/routing/domain/i18n.ts +230 -0
- package/src/router/modules/routing/domain/index.ts +30 -0
- package/src/router/modules/routing/domain/interactive-docs-advanced-sections.ts +164 -0
- package/src/router/modules/routing/domain/interactive-docs-core-sections.ts +198 -0
- package/src/router/modules/routing/domain/interactive-docs.ts +154 -0
- package/src/router/modules/routing/domain/isr.ts +35 -0
- package/src/router/modules/routing/domain/middleware.ts +79 -0
- package/src/router/modules/routing/domain/models.ts +95 -0
- package/src/router/modules/routing/domain/navigation-timeline.ts +243 -0
- package/src/router/modules/routing/domain/operations.ts +36 -0
- package/src/router/modules/routing/domain/optimized-matcher.ts +75 -0
- package/src/router/modules/routing/domain/performance-alert-manager.ts +28 -0
- package/src/router/modules/routing/domain/performance-monitoring.ts +287 -0
- package/src/router/modules/routing/domain/performance-report.ts +29 -0
- package/src/router/modules/routing/domain/performance-types.ts +19 -0
- package/src/router/modules/routing/domain/predictive-preloading.ts +296 -0
- package/src/router/modules/routing/domain/rbac.ts +219 -0
- package/src/router/modules/routing/domain/resource-routes.ts +64 -0
- package/src/router/modules/routing/domain/route-autocomplete.ts +176 -0
- package/src/router/modules/routing/domain/route-groups.ts +63 -0
- package/src/router/modules/routing/domain/security-scanner.ts +225 -0
- package/src/router/modules/routing/domain/server-actions.ts +71 -0
- package/src/router/modules/routing/domain/testing.ts +80 -0
- package/src/router/modules/routing/domain/type-safe-links.ts +72 -0
- package/src/router/modules/routing/domain/validators.ts +23 -0
- package/src/router/modules/routing/index.ts +4 -0
- package/src/router/modules/routing/ports/index.ts +1 -0
- package/src/router/modules/routing/ports/router-port.ts +15 -0
- package/src/router/modules/routing/types/index.ts +14 -0
- package/src/router/modules/routing-core/application/usecases/index.ts +49 -0
- package/src/router/modules/routing-core/domain/models/index.ts +95 -0
- package/src/router/modules/routing-core/domain/operations/index.ts +36 -0
- package/src/router/modules/routing-core/domain/validators/index.ts +28 -0
- package/src/router/modules/routing-core/index.ts +8 -0
- package/src/router/modules/routing-core/ports/index.ts +16 -0
- package/src/router/modules/routing-core/types/index.ts +25 -0
- package/src/router/presentation/index.ts +1 -0
- package/src/router/presentation/solid/components/index.ts +1 -0
- package/src/router/presentation/solid/components/route-visualizer-details.tsx +37 -0
- package/src/router/presentation/solid/components/route-visualizer-helpers.ts +56 -0
- package/src/router/presentation/solid/components/route-visualizer-tree.tsx +99 -0
- package/src/router/presentation/solid/components/route-visualizer-types.ts +41 -0
- package/src/router/presentation/solid/components/route-visualizer.tsx +110 -0
- package/src/router/presentation/solid/components/router.ts +82 -0
- package/src/router/presentation/solid/devtools/index.ts +2 -0
- package/src/router/presentation/solid/devtools/router-devtools-panel.tsx +141 -0
- package/src/router/presentation/solid/devtools/router-inspector.ts +54 -0
- package/src/router/presentation/solid/hmr.ts +77 -0
- package/src/router/presentation/solid/index.ts +7 -0
- package/src/router/presentation/solid/lazy-loading.ts +111 -0
- package/src/router/presentation/solid/preloading.ts +81 -0
- package/src/router/presentation/solid/route-state.ts +58 -0
- package/src/router/presentation/solid/signals/index.ts +2 -0
- package/src/router/presentation/solid/signals/route-state.ts +39 -0
- package/src/router/presentation/solid/signals/search-params.ts +31 -0
- package/src/router/shared/constants/index.ts +6 -0
- package/src/router/shared/errors/enhanced-errors.ts +94 -0
- package/src/router/shared/errors/index.ts +30 -0
- package/src/router/shared/index.ts +4 -0
- package/src/router/shared/types/either.ts +55 -0
- package/src/router/shared/types/index.ts +5 -0
- package/src/router/shared/types/option.ts +20 -0
- package/src/router/shared/types/result.ts +34 -0
- package/src/router/shared/types/route-inference.ts +49 -0
- package/src/router/shared/types/routing.ts +31 -0
- package/src/router/shared/utils/index.ts +3 -0
- package/src/router/shared/utils/path.ts +43 -0
- package/src/router/shared/utils/result.ts +5 -0
- package/src/router/shared/utils/time-condition.ts +53 -0
- package/src/router/vite-plugin/index.ts +2 -0
- package/src/router/vite-plugin/vite-plugin-core.ts +79 -0
- package/src/router/vite-plugin/vite-plugin-options-advanced.ts +127 -0
- package/src/router/vite-plugin/vite-plugin-options-features.ts +117 -0
- package/src/router/vite-plugin/vite-plugin-options-routing.ts +70 -0
- package/src/router/vite-plugin/vite-plugin-options.ts +23 -0
- package/src/server/adapters/index.ts +2 -0
- package/src/server/adapters/platforms.ts +79 -0
- package/src/server/adapters/web-server/index.ts +281 -0
- package/src/server/index.ts +13 -0
- package/src/server/modules/http/domain/operations/cookies.ts +151 -0
- package/src/server/modules/http/domain/operations/metrics.ts +103 -0
- package/src/server/modules/http/domain/operations/request-context.ts +36 -0
- package/src/server/modules/http/domain/operations/session-store.ts +98 -0
- package/src/server/modules/http/index.ts +15 -0
- package/src/server/modules/loaders/application/index.ts +1 -0
- package/src/server/modules/loaders/application/usecases/create-route-loader.ts +88 -0
- package/src/server/modules/loaders/application/usecases/dehydrate.ts +21 -0
- package/src/server/modules/loaders/application/usecases/index.ts +2 -0
- package/src/server/modules/loaders/index.ts +1 -0
- package/src/server/modules/realtime/domain/operations/channels.ts +241 -0
- package/src/server/modules/realtime/domain/operations/sse.ts +63 -0
- package/src/server/modules/realtime/index.ts +2 -0
- package/src/server/modules/server-functions/adapters/http/handler.ts +128 -0
- package/src/server/modules/server-functions/application/index.ts +1 -0
- package/src/server/modules/server-functions/application/usecases/batch.ts +135 -0
- package/src/server/modules/server-functions/application/usecases/create-server-fn.ts +272 -0
- package/src/server/modules/server-functions/application/usecases/csrf.ts +67 -0
- package/src/server/modules/server-functions/application/usecases/index.ts +6 -0
- package/src/server/modules/server-functions/application/usecases/live.ts +172 -0
- package/src/server/modules/server-functions/application/usecases/registry.ts +22 -0
- package/src/server/modules/server-functions/application/usecases/scheduler.ts +115 -0
- package/src/server/modules/server-functions/domain/index.ts +24 -0
- package/src/server/modules/server-functions/domain/models/execution-result.ts +18 -0
- package/src/server/modules/server-functions/domain/models/index.ts +1 -0
- package/src/server/modules/server-functions/domain/operations/result.ts +61 -0
- package/src/server/modules/server-functions/domain/operations/serialize.ts +134 -0
- package/src/server/modules/server-functions/domain/operations/stream.ts +107 -0
- package/src/server/modules/server-functions/index.ts +3 -0
- package/src/server/modules/server-only/index.ts +30 -0
- package/src/server/node.ts +10 -0
- package/src/server/shared/errors/index.ts +1 -0
- package/src/server/shared/errors/server-fn-error.ts +27 -0
- package/src/server/shared/index.ts +2 -0
- package/src/server/shared/types/index.ts +5 -0
- package/src/server/types/index.ts +65 -0
- package/src/stores/adapters/analytics/index.ts +5 -0
- package/src/stores/adapters/analytics/monitoring.ts +164 -0
- package/src/stores/adapters/devtools/index.ts +80 -0
- package/src/stores/adapters/persistence/index.ts +5 -0
- package/src/stores/adapters/persistence/versioning.ts +142 -0
- package/src/stores/adapters/router/index.ts +144 -0
- package/src/stores/adapters/storage/index.ts +6 -0
- package/src/stores/adapters/storage/indexed-db.ts +83 -0
- package/src/stores/adapters/storage/local-storage.ts +44 -0
- package/src/stores/adapters/storage/session-storage.ts +44 -0
- package/src/stores/adapters/sync/index.ts +5 -0
- package/src/stores/adapters/sync/tab-sync.ts +148 -0
- package/src/stores/adapters/validation/arktype-validator.ts +32 -0
- package/src/stores/adapters/validation/error-handling.ts +27 -0
- package/src/stores/adapters/validation/index.ts +61 -0
- package/src/stores/adapters/validation/schemas/api-schemas.ts +30 -0
- package/src/stores/adapters/validation/schemas/common-schemas.ts +32 -0
- package/src/stores/adapters/validation/schemas/config-schemas.ts +22 -0
- package/src/stores/adapters/validation/schemas/constraint-schemas.ts +34 -0
- package/src/stores/adapters/validation/schemas/ecommerce-schemas.ts +43 -0
- package/src/stores/adapters/validation/schemas/form-schemas.ts +27 -0
- package/src/stores/adapters/validation/schemas/primitive-schemas.ts +9 -0
- package/src/stores/adapters/validation/schemas/store-schemas.ts +52 -0
- package/src/stores/adapters/validation/schemas.ts +11 -0
- package/src/stores/index.ts +13 -0
- package/src/stores/modules/query/index.ts +24 -0
- package/src/stores/modules/query/mutation-state.ts +33 -0
- package/src/stores/modules/query/mutation-store.ts +59 -0
- package/src/stores/modules/query/query-builder.ts +25 -0
- package/src/stores/modules/query/query-cache.ts +65 -0
- package/src/stores/modules/query/query-manager.ts +103 -0
- package/src/stores/modules/query/query-state.ts +39 -0
- package/src/stores/modules/query/query-store.ts +81 -0
- package/src/stores/modules/store/application/usecases/index.ts +217 -0
- package/src/stores/modules/store/domain/models/index.ts +38 -0
- package/src/stores/modules/store/domain/operations/actions.ts +120 -0
- package/src/stores/modules/store/domain/operations/composition.ts +205 -0
- package/src/stores/modules/store/domain/operations/derived-operations.ts +21 -0
- package/src/stores/modules/store/domain/operations/diffing.ts +272 -0
- package/src/stores/modules/store/domain/operations/event-bus.ts +255 -0
- package/src/stores/modules/store/domain/operations/history-operations.ts +101 -0
- package/src/stores/modules/store/domain/operations/hydration.ts +159 -0
- package/src/stores/modules/store/domain/operations/immutable.ts +173 -0
- package/src/stores/modules/store/domain/operations/index.ts +21 -0
- package/src/stores/modules/store/domain/operations/middleware.ts +193 -0
- package/src/stores/modules/store/domain/operations/mutations.ts +14 -0
- package/src/stores/modules/store/domain/operations/normalization.ts +195 -0
- package/src/stores/modules/store/domain/operations/optimistic.ts +171 -0
- package/src/stores/modules/store/domain/operations/persistence-operations.ts +26 -0
- package/src/stores/modules/store/domain/operations/queries.ts +296 -0
- package/src/stores/modules/store/domain/operations/selectors.ts +112 -0
- package/src/stores/modules/store/domain/operations/store-operations.ts +52 -0
- package/src/stores/modules/store/domain/operations/time-machine.ts +240 -0
- package/src/stores/modules/store/domain/operations/transactions.ts +198 -0
- package/src/stores/modules/store/domain/validators/action-validators.ts +20 -0
- package/src/stores/modules/store/domain/validators/history-validators.ts +19 -0
- package/src/stores/modules/store/domain/validators/index.ts +7 -0
- package/src/stores/modules/store/domain/validators/persistence-validators.ts +23 -0
- package/src/stores/modules/store/domain/validators/store-validators.ts +41 -0
- package/src/stores/modules/store/index.ts +9 -0
- package/src/stores/modules/store/ports/index.ts +104 -0
- package/src/stores/modules/store/types/index.ts +35 -0
- package/src/stores/shared/constants/index.ts +50 -0
- package/src/stores/shared/errors/index.ts +122 -0
- package/src/stores/shared/index.ts +7 -0
- package/src/stores/shared/schema-generator.ts +262 -0
- package/src/stores/shared/types/index.ts +147 -0
- package/src/testing/index.ts +90 -0
- package/src/vite/auto-imports.ts +65 -0
- package/src/vite/client.d.ts +25 -0
- package/src/vite/dev-middleware.ts +142 -0
- package/src/vite/index.ts +9 -0
- package/src/vite/plugin.ts +277 -0
- package/src/vite/prerender.ts +72 -0
- package/src/vite/server-fn-ids.ts +52 -0
- package/src/vite/types/index.ts +24 -0
- package/src/vite/virtual-modules.ts +68 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Commands — public surface + `runCli` dispatch.
|
|
3
|
+
* `solid dev|build|start|generate` — thin orchestration over Vite + Bun.
|
|
4
|
+
*
|
|
5
|
+
* Implementations live in the sibling modules; this file only re-exports
|
|
6
|
+
* them (the import surface is stable) and maps argv → command.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { doctor } from "./doctor";
|
|
10
|
+
import type { CliResult } from "./infra";
|
|
11
|
+
import { migrate } from "./migrate";
|
|
12
|
+
import { bench, testNav, watch } from "./nav";
|
|
13
|
+
import { build, dev, envCheck, preview, printConfig, size, start } from "./ops";
|
|
14
|
+
import {
|
|
15
|
+
diffRoutes,
|
|
16
|
+
eject,
|
|
17
|
+
generate,
|
|
18
|
+
inspect,
|
|
19
|
+
manifestDump,
|
|
20
|
+
renameRoute,
|
|
21
|
+
routes,
|
|
22
|
+
sitemap,
|
|
23
|
+
} from "./routes";
|
|
24
|
+
import { add, adopt, scaffold, scaffoldTests } from "./scaffold";
|
|
25
|
+
|
|
26
|
+
export { doctor } from "./doctor";
|
|
27
|
+
export type { CliResult } from "./infra";
|
|
28
|
+
export { migrate } from "./migrate";
|
|
29
|
+
export { bench, testNav, watch } from "./nav";
|
|
30
|
+
export {
|
|
31
|
+
build,
|
|
32
|
+
dev,
|
|
33
|
+
envCheck,
|
|
34
|
+
preview,
|
|
35
|
+
printConfig,
|
|
36
|
+
size,
|
|
37
|
+
start,
|
|
38
|
+
} from "./ops";
|
|
39
|
+
export {
|
|
40
|
+
diffRoutes,
|
|
41
|
+
eject,
|
|
42
|
+
generate,
|
|
43
|
+
inspect,
|
|
44
|
+
manifestDump,
|
|
45
|
+
renameRoute,
|
|
46
|
+
routes,
|
|
47
|
+
sitemap,
|
|
48
|
+
} from "./routes";
|
|
49
|
+
export { add, adopt, scaffold, scaffoldTests } from "./scaffold";
|
|
50
|
+
|
|
51
|
+
export const runCli = (argv: string[] = process.argv.slice(2)): CliResult => {
|
|
52
|
+
const [command, ...rest] = argv;
|
|
53
|
+
switch (command) {
|
|
54
|
+
case "dev":
|
|
55
|
+
return dev();
|
|
56
|
+
case "build":
|
|
57
|
+
return build();
|
|
58
|
+
case "start":
|
|
59
|
+
return start(rest[0]);
|
|
60
|
+
case "generate":
|
|
61
|
+
return generate();
|
|
62
|
+
case "doctor":
|
|
63
|
+
return doctor(
|
|
64
|
+
"src/routes",
|
|
65
|
+
rest.includes("--fix"),
|
|
66
|
+
rest.includes("--deep"),
|
|
67
|
+
);
|
|
68
|
+
case "env":
|
|
69
|
+
return envCheck();
|
|
70
|
+
case "manifest":
|
|
71
|
+
return manifestDump("src/routes");
|
|
72
|
+
case "diff":
|
|
73
|
+
return diffRoutes("src/routes");
|
|
74
|
+
case "sitemap":
|
|
75
|
+
return sitemap(rest.find((a) => !a.startsWith("-")) ?? "");
|
|
76
|
+
case "bench":
|
|
77
|
+
return bench(rest);
|
|
78
|
+
case "watch":
|
|
79
|
+
return watch(rest[0]);
|
|
80
|
+
case "eject":
|
|
81
|
+
return eject(rest[0]);
|
|
82
|
+
case "routes":
|
|
83
|
+
return routes("src/routes", rest.includes("--json"));
|
|
84
|
+
case "inspect":
|
|
85
|
+
return inspect(
|
|
86
|
+
rest.find((a) => !a.startsWith("-")),
|
|
87
|
+
"src/routes",
|
|
88
|
+
rest.includes("--json"),
|
|
89
|
+
);
|
|
90
|
+
case "scaffold":
|
|
91
|
+
return scaffold(rest[0] ?? "");
|
|
92
|
+
case "add":
|
|
93
|
+
return add(rest[0], rest[1]);
|
|
94
|
+
case "test":
|
|
95
|
+
return scaffoldTests();
|
|
96
|
+
case "test-nav":
|
|
97
|
+
return testNav(rest);
|
|
98
|
+
case "migrate":
|
|
99
|
+
return migrate(rest);
|
|
100
|
+
case "adopt":
|
|
101
|
+
return adopt(
|
|
102
|
+
rest.find((a) => !a.startsWith("-")),
|
|
103
|
+
rest.includes("--write"),
|
|
104
|
+
);
|
|
105
|
+
case "size":
|
|
106
|
+
return size(rest[0]);
|
|
107
|
+
case "rename":
|
|
108
|
+
return renameRoute(rest[0] ?? "", rest[1] ?? "");
|
|
109
|
+
case "preview":
|
|
110
|
+
return preview(rest[0] ? Number(rest[0]) : undefined);
|
|
111
|
+
case "config":
|
|
112
|
+
return printConfig();
|
|
113
|
+
default:
|
|
114
|
+
console.log(
|
|
115
|
+
[
|
|
116
|
+
"@wrikka/solid-framework CLI",
|
|
117
|
+
"",
|
|
118
|
+
" solid dev Start dev server with SSR middleware",
|
|
119
|
+
" solid build Build client + server bundles",
|
|
120
|
+
" solid start Run the production server",
|
|
121
|
+
" solid generate Regenerate route manifest and types",
|
|
122
|
+
" solid test Scaffold a test file per route into test/routes/",
|
|
123
|
+
" solid test-nav Run every route's loader chain headlessly (--max ms)",
|
|
124
|
+
" solid migrate Rewrite flat route exports into page() defs (--dry)",
|
|
125
|
+
" solid adopt Scan an app and print the adoption scaffold",
|
|
126
|
+
" solid doctor Health check — routes, generated types, deps (--fix, --deep)",
|
|
127
|
+
" solid env Diff .env against .env.example (keys only)",
|
|
128
|
+
" solid manifest Dump routes + counts as JSON",
|
|
129
|
+
" solid diff Route files added/removed vs HEAD",
|
|
130
|
+
" solid sitemap Generate sitemap.xml — solid sitemap <origin>",
|
|
131
|
+
" solid watch Watch routes dir — regen types + test-nav on change",
|
|
132
|
+
" solid eject Dump resolved manifest + types to .solid/eject/",
|
|
133
|
+
" solid routes Print the route tree (path, kind, middleware, file) (--json)",
|
|
134
|
+
" solid inspect Show which route matches a URL — solid inspect /users/1",
|
|
135
|
+
" solid scaffold Create a minimal app — solid scaffold my-app",
|
|
136
|
+
" solid size Report dist/ bundle sizes (top 20)",
|
|
137
|
+
" solid rename Rename a route file + regen types — solid rename a.tsx b.tsx",
|
|
138
|
+
" solid preview Serve the production build locally (dist/)",
|
|
139
|
+
" solid config Print the resolved config (solid.config.ts)",
|
|
140
|
+
" solid add Scaffold route|api|middleware — solid add route blog",
|
|
141
|
+
].join("\n"),
|
|
142
|
+
);
|
|
143
|
+
return { code: command ? 1 : 0 };
|
|
144
|
+
}
|
|
145
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `solid doctor` — project health check: routes dir, generated types
|
|
3
|
+
* staleness, config/entry presence, resolvable deps. `--fix` regenerates
|
|
4
|
+
* .solid types; `--deep` runs the loader chains via test-nav.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { buildRouteManifest } from "#app/modules/file-routes";
|
|
10
|
+
import type { CliResult } from "./infra";
|
|
11
|
+
import { listFiles } from "./infra";
|
|
12
|
+
import { testNav } from "./nav";
|
|
13
|
+
import { generate } from "./routes";
|
|
14
|
+
|
|
15
|
+
export const doctor = (
|
|
16
|
+
routesDir = "src/routes",
|
|
17
|
+
fix = false,
|
|
18
|
+
deep = false,
|
|
19
|
+
): CliResult => {
|
|
20
|
+
// Health check — routesDir, manifest, generated types staleness,
|
|
21
|
+
// optional peer deps; prints findings, exits 1 on errors.
|
|
22
|
+
// --fix regenerates .solid types when missing/stale
|
|
23
|
+
let failures = 0;
|
|
24
|
+
const ok = (msg: string) => console.log(` ✓ ${msg}`);
|
|
25
|
+
const warn = (msg: string) => console.log(` ! ${msg}`);
|
|
26
|
+
const fail = (msg: string) => {
|
|
27
|
+
failures += 1;
|
|
28
|
+
console.log(` ✗ ${msg}`);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (!existsSync(routesDir)) {
|
|
32
|
+
fail(`${routesDir} not found`);
|
|
33
|
+
} else {
|
|
34
|
+
const files = listFiles(routesDir);
|
|
35
|
+
const manifest = buildRouteManifest(files, routesDir);
|
|
36
|
+
const pages = manifest.filter((r) => r.kind !== "api");
|
|
37
|
+
const apis = manifest.filter((r) => r.kind === "api");
|
|
38
|
+
ok(`${pages.length} page route(s), ${apis.length} api route(s)`);
|
|
39
|
+
if (pages.length === 0) warn("no page routes — nothing will render");
|
|
40
|
+
|
|
41
|
+
const routesDts = join(".solid", "routes.d.ts");
|
|
42
|
+
if (!existsSync(routesDts)) {
|
|
43
|
+
if (fix) {
|
|
44
|
+
generate(routesDir);
|
|
45
|
+
ok(".solid/routes.d.ts regenerated (--fix)");
|
|
46
|
+
} else {
|
|
47
|
+
warn(".solid/routes.d.ts missing — run `solid generate`");
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
// staleness — newer route files than the generated types
|
|
51
|
+
const newest = Math.max(...files.map((f) => statSync(f).mtimeMs), 0);
|
|
52
|
+
const dtsMtime = statSync(routesDts).mtimeMs;
|
|
53
|
+
if (newest > dtsMtime) {
|
|
54
|
+
if (fix) {
|
|
55
|
+
generate(routesDir);
|
|
56
|
+
ok(".solid/routes.d.ts regenerated (--fix)");
|
|
57
|
+
} else {
|
|
58
|
+
warn(".solid/routes.d.ts stale — routes newer than generated types");
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
ok(".solid/routes.d.ts present");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Duplicate paths after normalization (e.g. index.tsx + (grp)/index.tsx)
|
|
66
|
+
const seen = new Map<string, number>();
|
|
67
|
+
for (const r of pages) seen.set(r.path, (seen.get(r.path) ?? 0) + 1);
|
|
68
|
+
for (const [path, n] of seen) {
|
|
69
|
+
if (n > 1) fail(`duplicate route path ${path} (${n} files)`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Page route files need a default export (component or page() def)
|
|
73
|
+
for (const r of pages) {
|
|
74
|
+
if (r.kind === "content" || !existsSync(r.file)) continue;
|
|
75
|
+
const src = readFileSync(r.file, "utf8");
|
|
76
|
+
if (!/export\s+default/.test(src)) {
|
|
77
|
+
warn(`${r.path} has no default export — nothing renders`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// solid.config.* presence — adopt hint when absent
|
|
83
|
+
const hasConfig = ["solid.config.tsx", "solid.config.ts"].some((f) =>
|
|
84
|
+
existsSync(f),
|
|
85
|
+
);
|
|
86
|
+
if (hasConfig) ok("solid.config present");
|
|
87
|
+
else warn("no solid.config.* — run `solid adopt` for the scaffold");
|
|
88
|
+
|
|
89
|
+
// Entry points — the vite plugin expects both
|
|
90
|
+
for (const entry of ["src/entry-server.tsx", "src/entry-client.tsx"]) {
|
|
91
|
+
if (existsSync(entry)) ok(`${entry} present`);
|
|
92
|
+
else warn(`${entry} missing — \`solid scaffold\` creates it`);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
for (const pkg of ["solid-js", "@wrikka/ui", "@wrikka/web-server-toolkit"]) {
|
|
96
|
+
try {
|
|
97
|
+
import.meta.resolve(pkg);
|
|
98
|
+
ok(`${pkg} resolvable`);
|
|
99
|
+
} catch {
|
|
100
|
+
warn(`${pkg} not resolvable from here`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (deep) {
|
|
105
|
+
console.log(" deep: running loader chains (test-nav)");
|
|
106
|
+
const nav = testNav([routesDir]);
|
|
107
|
+
if (nav.code !== 0) failures++;
|
|
108
|
+
}
|
|
109
|
+
console.log(failures ? `doctor: ${failures} error(s)` : "doctor: healthy");
|
|
110
|
+
return { code: failures ? 1 : 0 };
|
|
111
|
+
};
|
package/src/cli/index.ts
ADDED
package/src/cli/infra.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI infrastructure — process spawning and route-dir scanning shared by
|
|
3
|
+
* every command module.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
8
|
+
import { join, sep } from "node:path";
|
|
9
|
+
|
|
10
|
+
export interface CliResult {
|
|
11
|
+
code: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const run = (
|
|
15
|
+
cmd: string,
|
|
16
|
+
args: string[],
|
|
17
|
+
env?: NodeJS.ProcessEnv,
|
|
18
|
+
): CliResult => {
|
|
19
|
+
const result = spawnSync(cmd, args, {
|
|
20
|
+
stdio: "inherit",
|
|
21
|
+
env: { ...process.env, ...env },
|
|
22
|
+
});
|
|
23
|
+
return { code: result.status ?? 1 };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const vite = (args: string[], env?: NodeJS.ProcessEnv): CliResult =>
|
|
27
|
+
run("bunx", ["vite", ...args], env);
|
|
28
|
+
|
|
29
|
+
export const listFiles = (dir: string): string[] => {
|
|
30
|
+
if (!existsSync(dir)) return [];
|
|
31
|
+
const out: string[] = [];
|
|
32
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
33
|
+
const full = join(dir, entry.name);
|
|
34
|
+
if (entry.isDirectory()) out.push(...listFiles(full));
|
|
35
|
+
else out.push(full.split(sep).join("/"));
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `solid migrate [routesDir] [--dry]` — rewrite flat route modules
|
|
3
|
+
* (`export const loader`/`beforeLoad`/`schema`/`action` + default
|
|
4
|
+
* component) into the single `page({...})` definition. Skips files
|
|
5
|
+
* it cannot transform safely.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
9
|
+
import type { CliResult } from "./infra";
|
|
10
|
+
import { listFiles } from "./infra";
|
|
11
|
+
|
|
12
|
+
const FLAT_EXPORTS = [
|
|
13
|
+
"loader",
|
|
14
|
+
"beforeLoad",
|
|
15
|
+
"loaderCache",
|
|
16
|
+
"schema",
|
|
17
|
+
"validateSearch",
|
|
18
|
+
"action",
|
|
19
|
+
"prerender",
|
|
20
|
+
"staticParams",
|
|
21
|
+
"head",
|
|
22
|
+
"meta",
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
const migrateRouteFile = (
|
|
26
|
+
file: string,
|
|
27
|
+
): { changed: boolean; skipped?: string; out?: string } => {
|
|
28
|
+
const src = readFileSync(file, "utf8");
|
|
29
|
+
if (/export\s+default\s+page\s*\(/.test(src))
|
|
30
|
+
return { changed: false, skipped: "already page()" };
|
|
31
|
+
|
|
32
|
+
let out = src;
|
|
33
|
+
let component: string | undefined;
|
|
34
|
+
|
|
35
|
+
const namedFn = out.match(/export\s+default\s+function\s+(\w+)\s*\(/);
|
|
36
|
+
if (namedFn) {
|
|
37
|
+
component = namedFn[1];
|
|
38
|
+
out = out.replace(
|
|
39
|
+
/export\s+default\s+function\s+(\w+)\s*\(/,
|
|
40
|
+
"const $1 = function $1(",
|
|
41
|
+
);
|
|
42
|
+
} else if (/export\s+default\s+function\s*\(/.test(out)) {
|
|
43
|
+
component = "__default";
|
|
44
|
+
out = out.replace(
|
|
45
|
+
/export\s+default\s+function\s*\(/,
|
|
46
|
+
"const __default = function (",
|
|
47
|
+
);
|
|
48
|
+
} else if (/export\s+default\s*[(=]|export\s+default\s+async\b/.test(out)) {
|
|
49
|
+
component = "__default";
|
|
50
|
+
out = out.replace(/export\s+default\s*/, "const __default = ");
|
|
51
|
+
} else {
|
|
52
|
+
const ident = out.match(/export\s+default\s+(\w+)\s*;/);
|
|
53
|
+
if (ident) {
|
|
54
|
+
component = ident[1];
|
|
55
|
+
out = out.replace(/export\s+default\s+\w+\s*;/, "");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (!component) return { changed: false, skipped: "no default export" };
|
|
59
|
+
|
|
60
|
+
const found = FLAT_EXPORTS.filter((n) =>
|
|
61
|
+
new RegExp(`export\\s+const\\s+${n}\\b`).test(out),
|
|
62
|
+
);
|
|
63
|
+
for (const n of found) {
|
|
64
|
+
out = out.replace(new RegExp(`export\\s+(const\\s+${n}\\b)`), "$1");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const fields = [
|
|
68
|
+
`component: ${component}`,
|
|
69
|
+
found.includes("loader") && "load: loader",
|
|
70
|
+
found.includes("beforeLoad") && "before: beforeLoad",
|
|
71
|
+
found.includes("loaderCache") && "cache: loaderCache",
|
|
72
|
+
found.includes("schema") && "params: schema?.params",
|
|
73
|
+
found.includes("schema") && "body: schema?.body",
|
|
74
|
+
found.includes("validateSearch") && "search: validateSearch",
|
|
75
|
+
found.includes("action") && "actions: { default: action }",
|
|
76
|
+
found.includes("prerender") && "prerender",
|
|
77
|
+
found.includes("staticParams") && "staticParams",
|
|
78
|
+
found.includes("head") && "head",
|
|
79
|
+
found.includes("meta") && "meta",
|
|
80
|
+
].filter(Boolean);
|
|
81
|
+
|
|
82
|
+
if (
|
|
83
|
+
!/import\s*{[^}]*\bpage\b[^}]*}\s*from\s*["']@wrikka\/solid-framework\/app["']/.test(
|
|
84
|
+
out,
|
|
85
|
+
)
|
|
86
|
+
) {
|
|
87
|
+
out = `import { page } from "@wrikka/solid-framework/app";\n${out}`;
|
|
88
|
+
}
|
|
89
|
+
out = `${out.trimEnd()}\n\nexport default page({\n\t${fields.join(",\n\t")},\n});\n`;
|
|
90
|
+
return { changed: true, out };
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const migrate = (args: string[] = []): CliResult => {
|
|
94
|
+
const routesDir = args.find((a) => !a.startsWith("-")) ?? "src/routes";
|
|
95
|
+
const dry = args.includes("--dry");
|
|
96
|
+
const showDiff = args.includes("--diff") || dry;
|
|
97
|
+
const files = listFiles(routesDir).filter((f) => /\.tsx?$/.test(f));
|
|
98
|
+
let changed = 0;
|
|
99
|
+
let skipped = 0;
|
|
100
|
+
for (const file of files) {
|
|
101
|
+
const res = migrateRouteFile(file);
|
|
102
|
+
if (res.changed && res.out !== undefined) {
|
|
103
|
+
changed++;
|
|
104
|
+
if (showDiff) {
|
|
105
|
+
const tail = res.out.split("\n").slice(-8).join("\n");
|
|
106
|
+
console.log(`--- ${file}\n${tail}`);
|
|
107
|
+
}
|
|
108
|
+
if (!dry) writeFileSync(file, res.out);
|
|
109
|
+
console.log(` + ${file}`);
|
|
110
|
+
} else if (res.skipped) {
|
|
111
|
+
skipped++;
|
|
112
|
+
console.log(` - ${file}: ${res.skipped}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
console.log(
|
|
116
|
+
`[solid] migrate: ${changed} rewritten, ${skipped} skipped${dry ? " (dry-run)" : ""}`,
|
|
117
|
+
);
|
|
118
|
+
return { code: 0 };
|
|
119
|
+
};
|
package/src/cli/nav.ts
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation commands — `solid test-nav`, `solid bench`, `solid watch`.
|
|
3
|
+
* These spawn `bun -e` with an embedded script that runs each route's
|
|
4
|
+
* loader chain headlessly.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { existsSync, watch as fsWatch } from "node:fs";
|
|
8
|
+
import type { CliResult } from "./infra";
|
|
9
|
+
import { run } from "./infra";
|
|
10
|
+
import { generate } from "./routes";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `solid test-nav [routesDir] [--max <ms>]` — headless navigation
|
|
14
|
+
* assertions: runs every page route's beforeLoad/loader chain in
|
|
15
|
+
* Bun and fails on throws, redirects-into-errors, or loader time
|
|
16
|
+
* over `--max` (default 1000ms)
|
|
17
|
+
*/
|
|
18
|
+
export const testNav = (args: string[] = []): CliResult => {
|
|
19
|
+
const routesDir = args.find((a) => !a.startsWith("-")) ?? "src/routes";
|
|
20
|
+
const maxIdx = args.indexOf("--max");
|
|
21
|
+
const maxMs = maxIdx >= 0 ? Number(args[maxIdx + 1]) || 1000 : 1000;
|
|
22
|
+
const html = args.includes("--html");
|
|
23
|
+
const filterIdx = args.indexOf("--filter");
|
|
24
|
+
const filter = filterIdx >= 0 ? args[filterIdx + 1] : undefined;
|
|
25
|
+
const json = args.includes("--json");
|
|
26
|
+
const pathsIdx = args.indexOf("--paths");
|
|
27
|
+
const onlyPaths =
|
|
28
|
+
pathsIdx >= 0 ? (args[pathsIdx + 1] ?? "").split(",") : undefined;
|
|
29
|
+
const code = `
|
|
30
|
+
const { buildRouteManifest, runFileRouteLoader, normalizeRouteModule } = await import("@wrikka/solid-framework/app");
|
|
31
|
+
const { readdirSync, existsSync } = await import("node:fs");
|
|
32
|
+
if (!existsSync(${JSON.stringify(routesDir)})) { console.log("[solid] no routes dir: " + ${JSON.stringify(routesDir)}); process.exit(1); }
|
|
33
|
+
const files = [];
|
|
34
|
+
const walk = (d) => { for (const e of readdirSync(d, { withFileTypes: true })) { const f = d + "/" + e.name; e.isDirectory() ? walk(f) : files.push(f); } };
|
|
35
|
+
walk(${JSON.stringify(routesDir)});
|
|
36
|
+
const manifest = buildRouteManifest(files, ${JSON.stringify(routesDir)});
|
|
37
|
+
let pages = manifest.filter((r) => r.kind !== "api");
|
|
38
|
+
if (${JSON.stringify(filter ?? null)}) pages = pages.filter((r) => r.path.includes(${JSON.stringify(filter ?? "")}));
|
|
39
|
+
if (${JSON.stringify(onlyPaths ?? null)}) pages = pages.filter((r) => ${JSON.stringify(onlyPaths ?? [])}.includes(r.path));
|
|
40
|
+
let fails = 0;
|
|
41
|
+
const results = [];
|
|
42
|
+
const urlFor = (p) => p.replace(/:([^/]+)/g, "1").replace(/\\*[^/]+/g, "x");
|
|
43
|
+
for (const route of pages) {
|
|
44
|
+
if (route.kind === "content") {
|
|
45
|
+
try {
|
|
46
|
+
const { readFileSync } = await import("node:fs");
|
|
47
|
+
const raw = readFileSync(route.file, "utf8");
|
|
48
|
+
if (!raw.trim()) throw new Error("empty content");
|
|
49
|
+
results.push({ path: route.path, ms: 0, ok: true });
|
|
50
|
+
console.log(" ✓ " + route.path.padEnd(24) + " content");
|
|
51
|
+
} catch (e) {
|
|
52
|
+
fails++;
|
|
53
|
+
results.push({ path: route.path, ok: false, error: e.message });
|
|
54
|
+
console.log(" ✗ " + route.path.padEnd(24) + " " + e.message);
|
|
55
|
+
}
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const url = urlFor(route.path);
|
|
59
|
+
const modules = {};
|
|
60
|
+
for (const f of [...(route.layouts ?? []), route.file]) {
|
|
61
|
+
try { modules[f] = normalizeRouteModule(await import("./" + f)); }
|
|
62
|
+
catch (e) { console.log(" ✗ " + route.path + " import failed: " + e.message); fails++; continue; }
|
|
63
|
+
}
|
|
64
|
+
const t = performance.now();
|
|
65
|
+
try {
|
|
66
|
+
await runFileRouteLoader(url, manifest, modules, new Request("http://test" + url));
|
|
67
|
+
if (${JSON.stringify(html)} ) {
|
|
68
|
+
const mod = modules[route.file];
|
|
69
|
+
const Comp = mod?.default;
|
|
70
|
+
if (typeof Comp === "function") {
|
|
71
|
+
const { renderToString } = await import("solid-js/web");
|
|
72
|
+
const htmlOut = renderToString(() => Comp({ params: {}, data: () => undefined }));
|
|
73
|
+
if (!htmlOut || !htmlOut.trim()) throw new Error("empty render");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const ms = Math.round(performance.now() - t);
|
|
77
|
+
const slow = ms > ${maxMs};
|
|
78
|
+
if (slow) fails++;
|
|
79
|
+
results.push({ path: route.path, ms, ok: !slow });
|
|
80
|
+
console.log(" " + (slow ? "✗" : "✓") + " " + route.path.padEnd(24) + " " + ms + "ms" + (slow ? " > ${maxMs}ms" : ""));
|
|
81
|
+
} catch (e) {
|
|
82
|
+
fails++;
|
|
83
|
+
const m = e instanceof Response ? "Response " + e.status : e.message;
|
|
84
|
+
results.push({ path: route.path, ok: false, error: m });
|
|
85
|
+
console.log(" ✗ " + route.path.padEnd(24) + " " + m);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (${JSON.stringify(json)}) console.log(JSON.stringify(results, null, 2));
|
|
89
|
+
console.log(fails ? "test-nav: " + fails + " failure(s)" : "test-nav: " + pages.length + " route(s) ok");
|
|
90
|
+
process.exit(fails ? 1 : 0);`;
|
|
91
|
+
return run("bun", ["-e", code]);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* `solid bench [routesDir] [--iter <n>] [--filter <s>] [--paths a,b]` —
|
|
96
|
+
* loader benchmark: runs each route's beforeLoad/loader chain N times
|
|
97
|
+
* and reports avg ms per route
|
|
98
|
+
*/
|
|
99
|
+
export const bench = (args: string[] = []): CliResult => {
|
|
100
|
+
const routesDir = args.find((a) => !a.startsWith("-")) ?? "src/routes";
|
|
101
|
+
const iterIdx = args.indexOf("--iter");
|
|
102
|
+
const iter = iterIdx >= 0 ? Number(args[iterIdx + 1]) || 5 : 5;
|
|
103
|
+
const filterIdx = args.indexOf("--filter");
|
|
104
|
+
const filter = filterIdx >= 0 ? args[filterIdx + 1] : undefined;
|
|
105
|
+
const pathsIdx = args.indexOf("--paths");
|
|
106
|
+
const onlyPaths =
|
|
107
|
+
pathsIdx >= 0 ? (args[pathsIdx + 1] ?? "").split(",") : undefined;
|
|
108
|
+
const code = `
|
|
109
|
+
const { buildRouteManifest, runFileRouteLoader, normalizeRouteModule } = await import("@wrikka/solid-framework/app");
|
|
110
|
+
const { readdirSync, existsSync } = await import("node:fs");
|
|
111
|
+
if (!existsSync(${JSON.stringify(routesDir)})) { console.log("[solid] no routes dir: " + ${JSON.stringify(routesDir)}); process.exit(1); }
|
|
112
|
+
const files = [];
|
|
113
|
+
const walk = (d) => { for (const e of readdirSync(d, { withFileTypes: true })) { const f = d + "/" + e.name; e.isDirectory() ? walk(f) : files.push(f); } };
|
|
114
|
+
walk(${JSON.stringify(routesDir)});
|
|
115
|
+
const manifest = buildRouteManifest(files, ${JSON.stringify(routesDir)});
|
|
116
|
+
let pages = manifest.filter((r) => r.kind === "page");
|
|
117
|
+
if (${JSON.stringify(filter ?? null)}) pages = pages.filter((r) => r.path.includes(${JSON.stringify(filter ?? "")}));
|
|
118
|
+
if (${JSON.stringify(onlyPaths ?? null)}) pages = pages.filter((r) => ${JSON.stringify(onlyPaths ?? [])}.includes(r.path));
|
|
119
|
+
const urlFor = (p) => p.replace(/:([^/]+)/g, "1").replace(/\\*[^/]+/g, "x");
|
|
120
|
+
let n = 0;
|
|
121
|
+
for (const route of pages) {
|
|
122
|
+
const url = urlFor(route.path);
|
|
123
|
+
const modules = {};
|
|
124
|
+
for (const f of [...(route.layouts ?? []), route.file]) {
|
|
125
|
+
try { modules[f] = normalizeRouteModule(await import("./" + f)); }
|
|
126
|
+
catch (e) { console.log(" ✗ " + route.path + " import failed: " + e.message); continue; }
|
|
127
|
+
}
|
|
128
|
+
let total = 0;
|
|
129
|
+
for (let i = 0; i < ${iter}; i++) {
|
|
130
|
+
const t = performance.now();
|
|
131
|
+
try { await runFileRouteLoader(url, manifest, modules, new Request("http://test" + url)); }
|
|
132
|
+
catch { /* bench measures timing, not correctness — test-nav checks that */ }
|
|
133
|
+
total += performance.now() - t;
|
|
134
|
+
}
|
|
135
|
+
n++;
|
|
136
|
+
console.log(" " + route.path.padEnd(24) + " " + (Math.round((total / ${iter}) * 100) / 100) + "ms avg (" + ${iter} + " iters)");
|
|
137
|
+
}
|
|
138
|
+
console.log(n ? "bench: " + n + " route(s) measured" : "bench: no routes");
|
|
139
|
+
process.exit(0);`;
|
|
140
|
+
return run("bun", ["-e", code]);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* `solid watch [routesDir]` — regenerate route types and re-run
|
|
145
|
+
* test-nav whenever a route file changes (dev DX without vite)
|
|
146
|
+
*/
|
|
147
|
+
export const watch = (routesDir = "src/routes"): CliResult => {
|
|
148
|
+
if (!existsSync(routesDir)) {
|
|
149
|
+
console.log(`[solid] no routes dir: ${routesDir}`);
|
|
150
|
+
return { code: 1 };
|
|
151
|
+
}
|
|
152
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
153
|
+
const rerun = () => {
|
|
154
|
+
clearTimeout(timer);
|
|
155
|
+
timer = setTimeout(() => {
|
|
156
|
+
generate(routesDir);
|
|
157
|
+
testNav([routesDir]);
|
|
158
|
+
}, 150);
|
|
159
|
+
};
|
|
160
|
+
fsWatch(routesDir, { recursive: true }, rerun);
|
|
161
|
+
console.log(`[solid] watching ${routesDir} — generate + test-nav on change`);
|
|
162
|
+
generate(routesDir);
|
|
163
|
+
return { code: 0 };
|
|
164
|
+
};
|