gorsee 0.2.4 → 0.2.6
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 +283 -212
- package/dist-pkg/ai/artifact-lifecycle.d.ts +25 -0
- package/dist-pkg/ai/artifact-lifecycle.js +98 -0
- package/dist-pkg/ai/bridge.d.ts +26 -0
- package/dist-pkg/ai/bridge.js +82 -0
- package/dist-pkg/ai/bundle.d.ts +46 -0
- package/dist-pkg/ai/bundle.js +247 -0
- package/dist-pkg/ai/contracts.d.ts +1 -0
- package/dist-pkg/ai/contracts.js +1 -0
- package/dist-pkg/ai/ide.d.ts +37 -0
- package/dist-pkg/ai/ide.js +56 -0
- package/dist-pkg/ai/index.d.ts +85 -0
- package/dist-pkg/ai/index.js +267 -0
- package/dist-pkg/ai/json.d.ts +6 -0
- package/dist-pkg/ai/json.js +14 -0
- package/dist-pkg/ai/mcp.d.ts +28 -0
- package/dist-pkg/ai/mcp.js +173 -0
- package/dist-pkg/ai/session-pack.d.ts +28 -0
- package/dist-pkg/ai/session-pack.js +57 -0
- package/dist-pkg/ai/store.d.ts +67 -0
- package/dist-pkg/ai/store.js +174 -0
- package/dist-pkg/ai/summary.d.ts +57 -0
- package/dist-pkg/ai/summary.js +148 -0
- package/dist-pkg/ai/watch.d.ts +15 -0
- package/dist-pkg/ai/watch.js +66 -0
- package/dist-pkg/auth/action-tokens.d.ts +50 -0
- package/dist-pkg/auth/action-tokens.js +79 -0
- package/dist-pkg/auth/index.d.ts +70 -0
- package/dist-pkg/auth/index.js +199 -0
- package/dist-pkg/auth/redis-session-store.d.ts +7 -0
- package/dist-pkg/auth/redis-session-store.js +42 -0
- package/dist-pkg/auth/signing.d.ts +4 -0
- package/dist-pkg/auth/signing.js +33 -0
- package/dist-pkg/auth/sqlite-session-store.d.ts +12 -0
- package/dist-pkg/auth/sqlite-session-store.js +83 -0
- package/dist-pkg/auth/store-utils.d.ts +2 -0
- package/dist-pkg/auth/store-utils.js +20 -0
- package/dist-pkg/bin/gorsee.js +2 -0
- package/dist-pkg/build/backends/experimental-rolldown.d.ts +6 -0
- package/dist-pkg/build/backends/experimental-rolldown.js +9 -0
- package/dist-pkg/build/backends/register.d.ts +7 -0
- package/dist-pkg/build/backends/register.js +24 -0
- package/dist-pkg/build/backends/rolldown.d.ts +16 -0
- package/dist-pkg/build/backends/rolldown.js +176 -0
- package/dist-pkg/build/client-backend.d.ts +31 -0
- package/dist-pkg/build/client-backend.js +97 -0
- package/dist-pkg/build/client.d.ts +12 -0
- package/dist-pkg/build/client.js +93 -0
- package/dist-pkg/build/css-modules.d.ts +10 -0
- package/dist-pkg/build/css-modules.js +51 -0
- package/dist-pkg/build/devalue-parse.d.ts +1 -0
- package/dist-pkg/build/devalue-parse.js +1 -0
- package/dist-pkg/build/diagnostics.d.ts +20 -0
- package/dist-pkg/build/diagnostics.js +35 -0
- package/dist-pkg/build/fixtures.d.ts +7 -0
- package/dist-pkg/build/fixtures.js +60 -0
- package/dist-pkg/build/framework-imports.d.ts +4 -0
- package/dist-pkg/build/framework-imports.js +58 -0
- package/dist-pkg/build/init.d.ts +1 -0
- package/dist-pkg/build/init.js +6 -0
- package/dist-pkg/build/manifest.d.ts +3 -0
- package/dist-pkg/build/manifest.js +23 -0
- package/dist-pkg/build/parity.d.ts +32 -0
- package/dist-pkg/build/parity.js +71 -0
- package/dist-pkg/build/plugin.d.ts +11 -0
- package/dist-pkg/build/plugin.js +8 -0
- package/dist-pkg/build/readiness.d.ts +11 -0
- package/dist-pkg/build/readiness.js +18 -0
- package/dist-pkg/build/route-client-transform.d.ts +17 -0
- package/dist-pkg/build/route-client-transform.js +48 -0
- package/dist-pkg/build/route-metadata.d.ts +6 -0
- package/dist-pkg/build/route-metadata.js +8 -0
- package/dist-pkg/build/rpc-transform.d.ts +1 -0
- package/dist-pkg/build/rpc-transform.js +44 -0
- package/dist-pkg/build/server-bundle.d.ts +4 -0
- package/dist-pkg/build/server-bundle.js +261 -0
- package/dist-pkg/build/server-strip.d.ts +2 -0
- package/dist-pkg/build/server-strip.js +32 -0
- package/dist-pkg/build/ssg.d.ts +12 -0
- package/dist-pkg/build/ssg.js +36 -0
- package/dist-pkg/cli/bun-plugin.d.ts +2 -0
- package/dist-pkg/cli/bun-plugin.js +14 -0
- package/dist-pkg/cli/canonical-import-rewrite.d.ts +18 -0
- package/dist-pkg/cli/canonical-import-rewrite.js +94 -0
- package/dist-pkg/cli/canonical-imports.d.ts +8 -0
- package/dist-pkg/cli/canonical-imports.js +131 -0
- package/dist-pkg/cli/check-ast.d.ts +20 -0
- package/dist-pkg/cli/check-ast.js +126 -0
- package/dist-pkg/cli/cmd-ai.d.ts +4 -0
- package/dist-pkg/cli/cmd-ai.js +290 -0
- package/dist-pkg/cli/cmd-build.d.ts +12 -0
- package/dist-pkg/cli/cmd-build.js +198 -0
- package/dist-pkg/cli/cmd-check.d.ts +25 -0
- package/dist-pkg/cli/cmd-check.js +573 -0
- package/dist-pkg/cli/cmd-create.d.ts +6 -0
- package/dist-pkg/cli/cmd-create.js +600 -0
- package/dist-pkg/cli/cmd-deploy.d.ts +6 -0
- package/dist-pkg/cli/cmd-deploy.js +381 -0
- package/dist-pkg/cli/cmd-dev.d.ts +5 -0
- package/dist-pkg/cli/cmd-dev.js +5 -0
- package/dist-pkg/cli/cmd-docs.d.ts +50 -0
- package/dist-pkg/cli/cmd-docs.js +122 -0
- package/dist-pkg/cli/cmd-generate.d.ts +12 -0
- package/dist-pkg/cli/cmd-generate.js +320 -0
- package/dist-pkg/cli/cmd-migrate.d.ts +7 -0
- package/dist-pkg/cli/cmd-migrate.js +42 -0
- package/dist-pkg/cli/cmd-routes.d.ts +6 -0
- package/dist-pkg/cli/cmd-routes.js +24 -0
- package/dist-pkg/cli/cmd-start.d.ts +13 -0
- package/dist-pkg/cli/cmd-start.js +32 -0
- package/dist-pkg/cli/cmd-test.d.ts +20 -0
- package/dist-pkg/cli/cmd-test.js +103 -0
- package/dist-pkg/cli/cmd-typegen.d.ts +7 -0
- package/dist-pkg/cli/cmd-typegen.js +66 -0
- package/dist-pkg/cli/cmd-upgrade.d.ts +38 -0
- package/dist-pkg/cli/cmd-upgrade.js +232 -0
- package/dist-pkg/cli/context.d.ts +4 -0
- package/dist-pkg/cli/context.js +4 -0
- package/dist-pkg/cli/framework-md.d.ts +1 -0
- package/dist-pkg/cli/framework-md.js +391 -0
- package/dist-pkg/cli/index.d.ts +6 -0
- package/dist-pkg/cli/index.js +106 -0
- package/dist-pkg/cli/release-version.d.ts +2 -0
- package/dist-pkg/cli/release-version.js +33 -0
- package/dist-pkg/client.d.ts +16 -0
- package/dist-pkg/client.js +71 -0
- package/dist-pkg/compat.d.ts +1 -0
- package/dist-pkg/compat.js +1 -0
- package/dist-pkg/compiler/analysis-backend.d.ts +20 -0
- package/dist-pkg/compiler/analysis-backend.js +164 -0
- package/dist-pkg/compiler/backends/experimental-oxc.d.ts +6 -0
- package/dist-pkg/compiler/backends/experimental-oxc.js +9 -0
- package/dist-pkg/compiler/backends/oxc.d.ts +16 -0
- package/dist-pkg/compiler/backends/oxc.js +198 -0
- package/dist-pkg/compiler/backends/register.d.ts +7 -0
- package/dist-pkg/compiler/backends/register.js +22 -0
- package/dist-pkg/compiler/fixtures.d.ts +2 -0
- package/dist-pkg/compiler/fixtures.js +118 -0
- package/dist-pkg/compiler/init.d.ts +1 -0
- package/dist-pkg/compiler/init.js +6 -0
- package/dist-pkg/compiler/module-analysis.d.ts +13 -0
- package/dist-pkg/compiler/module-analysis.js +50 -0
- package/dist-pkg/compiler/parity.d.ts +35 -0
- package/dist-pkg/compiler/parity.js +89 -0
- package/dist-pkg/compiler/readiness.d.ts +11 -0
- package/dist-pkg/compiler/readiness.js +18 -0
- package/dist-pkg/compiler/route-facts.d.ts +34 -0
- package/dist-pkg/compiler/route-facts.js +75 -0
- package/dist-pkg/content/index.d.ts +27 -0
- package/dist-pkg/content/index.js +287 -0
- package/dist-pkg/db/index.d.ts +3 -0
- package/dist-pkg/db/index.js +6 -0
- package/dist-pkg/db/migrate.d.ts +7 -0
- package/dist-pkg/db/migrate.js +53 -0
- package/dist-pkg/db/postgres.d.ts +29 -0
- package/dist-pkg/db/postgres.js +59 -0
- package/dist-pkg/db/sqlite.d.ts +10 -0
- package/dist-pkg/db/sqlite.js +22 -0
- package/dist-pkg/deploy/cloudflare.d.ts +8 -0
- package/{src/deploy/cloudflare.ts → dist-pkg/deploy/cloudflare.js} +44 -28
- package/dist-pkg/deploy/conformance.d.ts +21 -0
- package/dist-pkg/deploy/conformance.js +98 -0
- package/dist-pkg/deploy/dockerfile.d.ts +3 -0
- package/{src/deploy/dockerfile.ts → dist-pkg/deploy/dockerfile.js} +8 -10
- package/dist-pkg/deploy/fly.d.ts +3 -0
- package/{src/deploy/fly.ts → dist-pkg/deploy/fly.js} +11 -12
- package/dist-pkg/deploy/index.d.ts +6 -0
- package/dist-pkg/deploy/index.js +26 -0
- package/dist-pkg/deploy/netlify.d.ts +2 -0
- package/{src/deploy/netlify.ts → dist-pkg/deploy/netlify.js} +17 -11
- package/dist-pkg/deploy/runtime.d.ts +2 -0
- package/dist-pkg/deploy/runtime.js +3 -0
- package/dist-pkg/deploy/vercel.d.ts +22 -0
- package/dist-pkg/deploy/vercel.js +53 -0
- package/dist-pkg/dev/error-overlay.d.ts +1 -0
- package/{src/dev/error-overlay.ts → dist-pkg/dev/error-overlay.js} +13 -23
- package/dist-pkg/dev/hmr.d.ts +30 -0
- package/dist-pkg/dev/hmr.js +86 -0
- package/dist-pkg/dev/partial-handler.d.ts +9 -0
- package/dist-pkg/dev/partial-handler.js +24 -0
- package/dist-pkg/dev/request-handler.d.ts +30 -0
- package/dist-pkg/dev/request-handler.js +67 -0
- package/dist-pkg/dev/watcher.d.ts +6 -0
- package/dist-pkg/dev/watcher.js +34 -0
- package/dist-pkg/dev.d.ts +11 -0
- package/dist-pkg/dev.js +268 -0
- package/dist-pkg/env/index.d.ts +3 -0
- package/dist-pkg/env/index.js +57 -0
- package/dist-pkg/errors/catalog.d.ts +9 -0
- package/{src/errors/catalog.ts → dist-pkg/errors/catalog.js} +8 -24
- package/dist-pkg/errors/formatter.d.ts +22 -0
- package/dist-pkg/errors/formatter.js +43 -0
- package/dist-pkg/errors/index.d.ts +2 -0
- package/dist-pkg/errors/index.js +2 -0
- package/dist-pkg/forms/action.d.ts +15 -0
- package/dist-pkg/forms/action.js +20 -0
- package/dist-pkg/forms/index.d.ts +4 -0
- package/dist-pkg/forms/index.js +12 -0
- package/dist-pkg/i18n/index.d.ts +61 -0
- package/dist-pkg/i18n/index.js +147 -0
- package/dist-pkg/index-client.d.ts +1 -0
- package/dist-pkg/index-client.js +1 -0
- package/dist-pkg/index.d.ts +32 -0
- package/dist-pkg/index.js +79 -0
- package/dist-pkg/jsx-runtime-client.d.ts +8 -0
- package/dist-pkg/jsx-runtime-client.js +1 -0
- package/dist-pkg/jsx-runtime.d.ts +13 -0
- package/dist-pkg/jsx-runtime.js +5 -0
- package/dist-pkg/jsx-types-html.d.ts +221 -0
- package/dist-pkg/jsx-types-html.js +0 -0
- package/dist-pkg/log/index.d.ts +8 -0
- package/dist-pkg/log/index.js +55 -0
- package/dist-pkg/plugins/drizzle.d.ts +16 -0
- package/dist-pkg/plugins/drizzle.js +53 -0
- package/dist-pkg/plugins/index.d.ts +62 -0
- package/dist-pkg/plugins/index.js +159 -0
- package/dist-pkg/plugins/lucia.d.ts +26 -0
- package/dist-pkg/plugins/lucia.js +63 -0
- package/dist-pkg/plugins/prisma.d.ts +14 -0
- package/dist-pkg/plugins/prisma.js +60 -0
- package/dist-pkg/plugins/resend.d.ts +21 -0
- package/dist-pkg/plugins/resend.js +45 -0
- package/dist-pkg/plugins/s3.d.ts +18 -0
- package/dist-pkg/plugins/s3.js +63 -0
- package/dist-pkg/plugins/stripe.d.ts +32 -0
- package/dist-pkg/plugins/stripe.js +69 -0
- package/dist-pkg/plugins/tailwind.d.ts +15 -0
- package/dist-pkg/plugins/tailwind.js +58 -0
- package/dist-pkg/prod.d.ts +21 -0
- package/dist-pkg/prod.js +347 -0
- package/dist-pkg/reactive/computed.d.ts +3 -0
- package/dist-pkg/reactive/computed.js +15 -0
- package/dist-pkg/reactive/data.d.ts +25 -0
- package/dist-pkg/reactive/data.js +56 -0
- package/dist-pkg/reactive/diagnostics.d.ts +100 -0
- package/dist-pkg/reactive/diagnostics.js +363 -0
- package/dist-pkg/reactive/effect.d.ts +3 -0
- package/dist-pkg/reactive/effect.js +6 -0
- package/dist-pkg/reactive/index.d.ts +9 -0
- package/dist-pkg/reactive/index.js +18 -0
- package/dist-pkg/reactive/live.d.ts +15 -0
- package/dist-pkg/reactive/live.js +70 -0
- package/dist-pkg/reactive/optimistic.d.ts +20 -0
- package/dist-pkg/reactive/optimistic.js +67 -0
- package/dist-pkg/reactive/resource.d.ts +25 -0
- package/dist-pkg/reactive/resource.js +153 -0
- package/dist-pkg/reactive/signal.d.ts +4 -0
- package/dist-pkg/reactive/signal.js +17 -0
- package/dist-pkg/reactive/store.d.ts +6 -0
- package/dist-pkg/reactive/store.js +19 -0
- package/dist-pkg/router/index.d.ts +2 -0
- package/dist-pkg/router/index.js +2 -0
- package/dist-pkg/router/matcher.d.ts +7 -0
- package/dist-pkg/router/matcher.js +40 -0
- package/dist-pkg/router/scanner.d.ts +14 -0
- package/dist-pkg/router/scanner.js +141 -0
- package/dist-pkg/routes/index.d.ts +1 -0
- package/dist-pkg/routes/index.js +10 -0
- package/dist-pkg/runtime/app-config.d.ts +26 -0
- package/dist-pkg/runtime/app-config.js +69 -0
- package/dist-pkg/runtime/client.d.ts +3 -0
- package/dist-pkg/runtime/client.js +42 -0
- package/dist-pkg/runtime/devtools.d.ts +64 -0
- package/dist-pkg/runtime/devtools.js +132 -0
- package/dist-pkg/runtime/error-boundary.d.ts +6 -0
- package/dist-pkg/runtime/error-boundary.js +17 -0
- package/dist-pkg/runtime/event-replay.d.ts +3 -0
- package/{src/runtime/event-replay.ts → dist-pkg/runtime/event-replay.js} +20 -22
- package/dist-pkg/runtime/event-source.d.ts +7 -0
- package/dist-pkg/runtime/event-source.js +24 -0
- package/dist-pkg/runtime/form.d.ts +24 -0
- package/dist-pkg/runtime/form.js +65 -0
- package/dist-pkg/runtime/head.d.ts +7 -0
- package/dist-pkg/runtime/head.js +90 -0
- package/dist-pkg/runtime/html-escape.d.ts +7 -0
- package/dist-pkg/runtime/html-escape.js +39 -0
- package/dist-pkg/runtime/hydration.d.ts +15 -0
- package/dist-pkg/runtime/hydration.js +103 -0
- package/dist-pkg/runtime/image.d.ts +49 -0
- package/dist-pkg/runtime/image.js +144 -0
- package/dist-pkg/runtime/index.d.ts +17 -0
- package/dist-pkg/runtime/index.js +59 -0
- package/dist-pkg/runtime/island-hydrator.d.ts +12 -0
- package/dist-pkg/runtime/island-hydrator.js +74 -0
- package/dist-pkg/runtime/island.d.ts +19 -0
- package/dist-pkg/runtime/island.js +36 -0
- package/dist-pkg/runtime/jsx-runtime.d.ts +12 -0
- package/dist-pkg/runtime/jsx-runtime.js +176 -0
- package/dist-pkg/runtime/link.d.ts +16 -0
- package/dist-pkg/runtime/link.js +47 -0
- package/dist-pkg/runtime/project.d.ts +37 -0
- package/dist-pkg/runtime/project.js +36 -0
- package/dist-pkg/runtime/renderable.d.ts +6 -0
- package/dist-pkg/runtime/renderable.js +0 -0
- package/dist-pkg/runtime/router.d.ts +47 -0
- package/dist-pkg/runtime/router.js +487 -0
- package/dist-pkg/runtime/server.d.ts +8 -0
- package/dist-pkg/runtime/server.js +71 -0
- package/dist-pkg/runtime/stream.d.ts +29 -0
- package/dist-pkg/runtime/stream.js +106 -0
- package/dist-pkg/runtime/suspense.d.ts +6 -0
- package/dist-pkg/runtime/suspense.js +16 -0
- package/dist-pkg/runtime/typed-routes.d.ts +24 -0
- package/dist-pkg/runtime/typed-routes.js +77 -0
- package/dist-pkg/runtime/validated-form.d.ts +40 -0
- package/dist-pkg/runtime/validated-form.js +120 -0
- package/dist-pkg/security/cors.d.ts +10 -0
- package/dist-pkg/security/cors.js +56 -0
- package/dist-pkg/security/csrf.d.ts +9 -0
- package/dist-pkg/security/csrf.js +53 -0
- package/dist-pkg/security/headers.d.ts +11 -0
- package/dist-pkg/security/headers.js +31 -0
- package/dist-pkg/security/index.d.ts +5 -0
- package/dist-pkg/security/index.js +5 -0
- package/dist-pkg/security/rate-limit.d.ts +10 -0
- package/dist-pkg/security/rate-limit.js +49 -0
- package/dist-pkg/security/redis-rate-limit.d.ts +14 -0
- package/dist-pkg/security/redis-rate-limit.js +23 -0
- package/dist-pkg/server/action.d.ts +21 -0
- package/dist-pkg/server/action.js +64 -0
- package/dist-pkg/server/cache-utils.d.ts +2 -0
- package/dist-pkg/server/cache-utils.js +26 -0
- package/dist-pkg/server/cache.d.ts +33 -0
- package/dist-pkg/server/cache.js +236 -0
- package/dist-pkg/server/compress.d.ts +2 -0
- package/dist-pkg/server/compress.js +77 -0
- package/dist-pkg/server/endpoint-execution.d.ts +28 -0
- package/dist-pkg/server/endpoint-execution.js +37 -0
- package/dist-pkg/server/etag.d.ts +3 -0
- package/dist-pkg/server/etag.js +18 -0
- package/dist-pkg/server/guard.d.ts +16 -0
- package/dist-pkg/server/guard.js +45 -0
- package/dist-pkg/server/html-shell.d.ts +12 -0
- package/dist-pkg/server/html-shell.js +52 -0
- package/dist-pkg/server/index.d.ts +36 -0
- package/dist-pkg/server/index.js +170 -0
- package/dist-pkg/server/jobs.d.ts +41 -0
- package/dist-pkg/server/jobs.js +83 -0
- package/dist-pkg/server/manifest.d.ts +19 -0
- package/dist-pkg/server/manifest.js +36 -0
- package/dist-pkg/server/middleware.d.ts +39 -0
- package/dist-pkg/server/middleware.js +127 -0
- package/dist-pkg/server/mime.d.ts +1 -0
- package/{src/server/mime.ts → dist-pkg/server/mime.js} +6 -17
- package/dist-pkg/server/not-found.d.ts +6 -0
- package/dist-pkg/server/not-found.js +27 -0
- package/dist-pkg/server/page-render.d.ts +29 -0
- package/dist-pkg/server/page-render.js +70 -0
- package/dist-pkg/server/partial-navigation.d.ts +4 -0
- package/dist-pkg/server/partial-navigation.js +16 -0
- package/dist-pkg/server/pipe.d.ts +9 -0
- package/dist-pkg/server/pipe.js +32 -0
- package/dist-pkg/server/redis-cache-store.d.ts +10 -0
- package/dist-pkg/server/redis-cache-store.js +73 -0
- package/dist-pkg/server/redis-client.d.ts +37 -0
- package/dist-pkg/server/redis-client.js +37 -0
- package/dist-pkg/server/request-policy.d.ts +55 -0
- package/dist-pkg/server/request-policy.js +216 -0
- package/dist-pkg/server/request-preflight.d.ts +23 -0
- package/dist-pkg/server/request-preflight.js +46 -0
- package/dist-pkg/server/request-security-policy.d.ts +17 -0
- package/dist-pkg/server/request-security-policy.js +34 -0
- package/dist-pkg/server/request-surface.d.ts +8 -0
- package/dist-pkg/server/request-surface.js +19 -0
- package/dist-pkg/server/route-request.d.ts +31 -0
- package/dist-pkg/server/route-request.js +112 -0
- package/dist-pkg/server/route-response.d.ts +22 -0
- package/dist-pkg/server/route-response.js +61 -0
- package/dist-pkg/server/rpc-hash.d.ts +2 -0
- package/dist-pkg/server/rpc-hash.js +7 -0
- package/dist-pkg/server/rpc-protocol.d.ts +22 -0
- package/dist-pkg/server/rpc-protocol.js +28 -0
- package/dist-pkg/server/rpc-utils.d.ts +2 -0
- package/dist-pkg/server/rpc-utils.js +26 -0
- package/dist-pkg/server/rpc.d.ts +20 -0
- package/dist-pkg/server/rpc.js +147 -0
- package/dist-pkg/server/runtime-dispatch.d.ts +19 -0
- package/dist-pkg/server/runtime-dispatch.js +67 -0
- package/dist-pkg/server/server-execution.d.ts +22 -0
- package/dist-pkg/server/server-execution.js +53 -0
- package/dist-pkg/server/sqlite-cache-store.d.ts +13 -0
- package/dist-pkg/server/sqlite-cache-store.js +88 -0
- package/dist-pkg/server/sse.d.ts +9 -0
- package/dist-pkg/server/sse.js +34 -0
- package/dist-pkg/server/static-file.d.ts +9 -0
- package/dist-pkg/server/static-file.js +43 -0
- package/dist-pkg/server/ws.d.ts +18 -0
- package/dist-pkg/server/ws.js +40 -0
- package/dist-pkg/server-entry.d.ts +19 -0
- package/dist-pkg/server-entry.js +93 -0
- package/dist-pkg/testing/index.d.ts +98 -0
- package/dist-pkg/testing/index.js +257 -0
- package/dist-pkg/types/index.d.ts +4 -0
- package/dist-pkg/types/index.js +4 -0
- package/dist-pkg/types/safe-html.d.ts +7 -0
- package/dist-pkg/types/safe-html.js +19 -0
- package/dist-pkg/types/safe-sql.d.ts +8 -0
- package/dist-pkg/types/safe-sql.js +14 -0
- package/dist-pkg/types/safe-url.d.ts +7 -0
- package/dist-pkg/types/safe-url.js +20 -0
- package/dist-pkg/types/user-input.d.ts +9 -0
- package/dist-pkg/types/user-input.js +3 -0
- package/dist-pkg/unsafe/index.d.ts +12 -0
- package/dist-pkg/unsafe/index.js +6 -0
- package/package.json +110 -45
- package/bin/gorsee.js +0 -2
- package/src/auth/index.ts +0 -178
- package/src/auth/redis-session-store.ts +0 -46
- package/src/auth/sqlite-session-store.ts +0 -98
- package/src/auth/store-utils.ts +0 -21
- package/src/build/client.ts +0 -139
- package/src/build/css-modules.ts +0 -69
- package/src/build/devalue-parse.ts +0 -2
- package/src/build/manifest.ts +0 -34
- package/src/build/route-metadata.ts +0 -12
- package/src/build/rpc-transform.ts +0 -62
- package/src/build/server-strip.ts +0 -87
- package/src/build/ssg.ts +0 -70
- package/src/cli/bun-plugin.ts +0 -58
- package/src/cli/cmd-build.ts +0 -153
- package/src/cli/cmd-check.ts +0 -239
- package/src/cli/cmd-create.ts +0 -328
- package/src/cli/cmd-deploy.ts +0 -149
- package/src/cli/cmd-dev.ts +0 -13
- package/src/cli/cmd-docs.ts +0 -152
- package/src/cli/cmd-generate.ts +0 -155
- package/src/cli/cmd-migrate.ts +0 -53
- package/src/cli/cmd-routes.ts +0 -36
- package/src/cli/cmd-start.ts +0 -30
- package/src/cli/cmd-test.ts +0 -129
- package/src/cli/cmd-typegen.ts +0 -93
- package/src/cli/cmd-upgrade.ts +0 -143
- package/src/cli/context.ts +0 -12
- package/src/cli/framework-md.ts +0 -223
- package/src/cli/index.ts +0 -107
- package/src/client.ts +0 -26
- package/src/db/index.ts +0 -2
- package/src/db/migrate.ts +0 -89
- package/src/db/sqlite.ts +0 -40
- package/src/deploy/index.ts +0 -31
- package/src/deploy/vercel.ts +0 -94
- package/src/dev/hmr.ts +0 -31
- package/src/dev/partial-handler.ts +0 -52
- package/src/dev/request-handler.ts +0 -127
- package/src/dev/watcher.ts +0 -48
- package/src/dev.ts +0 -208
- package/src/env/index.ts +0 -74
- package/src/errors/formatter.ts +0 -63
- package/src/errors/index.ts +0 -2
- package/src/i18n/index.ts +0 -72
- package/src/index-client.ts +0 -4
- package/src/index.ts +0 -43
- package/src/jsx-runtime-client.ts +0 -13
- package/src/jsx-runtime.ts +0 -20
- package/src/jsx-types-html.ts +0 -242
- package/src/log/index.ts +0 -44
- package/src/plugins/drizzle.ts +0 -84
- package/src/plugins/index.ts +0 -86
- package/src/plugins/lucia.ts +0 -111
- package/src/plugins/prisma.ts +0 -85
- package/src/plugins/resend.ts +0 -78
- package/src/plugins/s3.ts +0 -102
- package/src/plugins/stripe.ts +0 -133
- package/src/plugins/tailwind.ts +0 -92
- package/src/prod.ts +0 -252
- package/src/reactive/computed.ts +0 -7
- package/src/reactive/effect.ts +0 -7
- package/src/reactive/index.ts +0 -7
- package/src/reactive/live.ts +0 -97
- package/src/reactive/optimistic.ts +0 -83
- package/src/reactive/resource.ts +0 -138
- package/src/reactive/signal.ts +0 -20
- package/src/reactive/store.ts +0 -36
- package/src/router/index.ts +0 -2
- package/src/router/matcher.ts +0 -53
- package/src/router/scanner.ts +0 -206
- package/src/runtime/client.ts +0 -28
- package/src/runtime/error-boundary.ts +0 -35
- package/src/runtime/form.ts +0 -49
- package/src/runtime/head.ts +0 -113
- package/src/runtime/html-escape.ts +0 -30
- package/src/runtime/hydration.ts +0 -95
- package/src/runtime/image.ts +0 -48
- package/src/runtime/index.ts +0 -12
- package/src/runtime/island-hydrator.ts +0 -84
- package/src/runtime/island.ts +0 -88
- package/src/runtime/jsx-runtime.ts +0 -167
- package/src/runtime/link.ts +0 -45
- package/src/runtime/project.ts +0 -73
- package/src/runtime/router.ts +0 -224
- package/src/runtime/server.ts +0 -102
- package/src/runtime/stream.ts +0 -182
- package/src/runtime/suspense.ts +0 -37
- package/src/runtime/typed-routes.ts +0 -26
- package/src/runtime/validated-form.ts +0 -106
- package/src/security/cors.ts +0 -80
- package/src/security/csrf.ts +0 -85
- package/src/security/headers.ts +0 -50
- package/src/security/index.ts +0 -4
- package/src/security/rate-limit.ts +0 -80
- package/src/server/action.ts +0 -48
- package/src/server/cache-utils.ts +0 -23
- package/src/server/cache.ts +0 -125
- package/src/server/compress.ts +0 -60
- package/src/server/etag.ts +0 -23
- package/src/server/guard.ts +0 -69
- package/src/server/html-shell.ts +0 -69
- package/src/server/index.ts +0 -57
- package/src/server/manifest.ts +0 -36
- package/src/server/middleware.ts +0 -159
- package/src/server/not-found.ts +0 -35
- package/src/server/page-render.ts +0 -123
- package/src/server/pipe.ts +0 -46
- package/src/server/redis-cache-store.ts +0 -87
- package/src/server/redis-client.ts +0 -71
- package/src/server/request-preflight.ts +0 -45
- package/src/server/route-request.ts +0 -72
- package/src/server/rpc-hash.ts +0 -17
- package/src/server/rpc-utils.ts +0 -27
- package/src/server/rpc.ts +0 -177
- package/src/server/sqlite-cache-store.ts +0 -109
- package/src/server/sse.ts +0 -96
- package/src/server/static-file.ts +0 -63
- package/src/server/ws.ts +0 -56
- package/src/server-entry.ts +0 -36
- package/src/testing/index.ts +0 -74
- package/src/types/index.ts +0 -4
- package/src/types/safe-html.ts +0 -32
- package/src/types/safe-sql.ts +0 -28
- package/src/types/safe-url.ts +0 -40
- package/src/types/user-input.ts +0 -12
- package/src/unsafe/index.ts +0 -18
package/src/cli/framework-md.ts
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
// Generates FRAMEWORK.md -- AI context file optimized for LLM consumption
|
|
2
|
-
|
|
3
|
-
export function generateFrameworkMD(projectName: string): string {
|
|
4
|
-
return `# ${projectName} -- Gorsee.js Framework Reference
|
|
5
|
-
|
|
6
|
-
> This file is auto-generated. It provides complete context for AI assistants.
|
|
7
|
-
> Include this file in your AI context window for best results.
|
|
8
|
-
|
|
9
|
-
## Quick Reference
|
|
10
|
-
|
|
11
|
-
\`\`\`
|
|
12
|
-
Runtime: Bun | Language: TypeScript + JSX | Reactivity: Signals (no VDOM)
|
|
13
|
-
\`\`\`
|
|
14
|
-
|
|
15
|
-
## Project Structure
|
|
16
|
-
|
|
17
|
-
\`\`\`
|
|
18
|
-
routes/ Page and API routes (file-based routing)
|
|
19
|
-
index.ts / (home page)
|
|
20
|
-
about.tsx /about
|
|
21
|
-
users/
|
|
22
|
-
index.tsx /users
|
|
23
|
-
[id].tsx /users/:id (dynamic)
|
|
24
|
-
api/
|
|
25
|
-
health.ts API endpoint (no UI)
|
|
26
|
-
_layout.tsx Layout wrapper for folder
|
|
27
|
-
_middleware.ts Middleware for folder
|
|
28
|
-
shared/ Shared types and utilities
|
|
29
|
-
middleware/ Global middleware
|
|
30
|
-
migrations/ Database migrations (SQL)
|
|
31
|
-
public/ Static files
|
|
32
|
-
app.config.ts Configuration
|
|
33
|
-
\`\`\`
|
|
34
|
-
|
|
35
|
-
## Imports
|
|
36
|
-
|
|
37
|
-
\`\`\`typescript
|
|
38
|
-
// Browser-safe route code
|
|
39
|
-
import { createSignal, createComputed, createEffect, createResource, createStore } from "gorsee/client"
|
|
40
|
-
|
|
41
|
-
// Server-only code
|
|
42
|
-
import { server, middleware, type Context, createDB, createAuth, cors, log } from "gorsee/server"
|
|
43
|
-
\`\`\`
|
|
44
|
-
|
|
45
|
-
## Import Boundaries
|
|
46
|
-
|
|
47
|
-
- \`gorsee/client\` for route components, islands, navigation, forms, and reactive primitives
|
|
48
|
-
- \`gorsee/server\` for middleware, loaders, RPC, auth, db, security, env, and logging
|
|
49
|
-
- Root \`gorsee\` is compatibility-only and should not be used in new code
|
|
50
|
-
- \`gorsee/compat\` is available as an explicit legacy migration entrypoint
|
|
51
|
-
|
|
52
|
-
## Adapter Recipes
|
|
53
|
-
|
|
54
|
-
\`\`\`typescript
|
|
55
|
-
import { createClient } from "redis"
|
|
56
|
-
import {
|
|
57
|
-
createAuth,
|
|
58
|
-
createRedisSessionStore,
|
|
59
|
-
createRedisCacheStore,
|
|
60
|
-
createNodeRedisLikeClient,
|
|
61
|
-
routeCache,
|
|
62
|
-
} from "gorsee/server"
|
|
63
|
-
|
|
64
|
-
const redis = createClient({ url: process.env.REDIS_URL })
|
|
65
|
-
await redis.connect()
|
|
66
|
-
const redisClient = createNodeRedisLikeClient(redis)
|
|
67
|
-
|
|
68
|
-
const auth = createAuth({
|
|
69
|
-
secret: process.env.SESSION_SECRET!,
|
|
70
|
-
store: createRedisSessionStore(redisClient, { prefix: "app:sessions" }),
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
export const cache = routeCache({
|
|
74
|
-
maxAge: 60,
|
|
75
|
-
staleWhileRevalidate: 300,
|
|
76
|
-
store: createRedisCacheStore(redisClient, {
|
|
77
|
-
prefix: "app:cache",
|
|
78
|
-
maxEntryAgeMs: 360_000,
|
|
79
|
-
}),
|
|
80
|
-
})
|
|
81
|
-
\`\`\`
|
|
82
|
-
|
|
83
|
-
- SQLite adapters are the default persistent single-node path
|
|
84
|
-
- Redis adapters are the default multi-instance path
|
|
85
|
-
- \`createNodeRedisLikeClient()\` and \`createIORedisLikeClient()\` normalize real Redis SDK clients to the framework adapter contract
|
|
86
|
-
- RPC handlers remain process-local by design; do not try to distribute closures through Redis
|
|
87
|
-
|
|
88
|
-
## Patterns
|
|
89
|
-
|
|
90
|
-
### Page Route
|
|
91
|
-
|
|
92
|
-
\`\`\`typescript
|
|
93
|
-
// routes/users/index.tsx
|
|
94
|
-
import { ssrJsx as h } from "gorsee/runtime"
|
|
95
|
-
import { SafeSQL } from "gorsee/types"
|
|
96
|
-
import { createDB } from "gorsee/db"
|
|
97
|
-
|
|
98
|
-
const db = createDB()
|
|
99
|
-
|
|
100
|
-
export default function UsersPage() {
|
|
101
|
-
const users = db.all<User>(SafeSQL\`SELECT * FROM users\`)
|
|
102
|
-
return h("ul", {
|
|
103
|
-
children: users.map(u => h("li", { children: u.name }))
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
\`\`\`
|
|
107
|
-
|
|
108
|
-
### Dynamic Route
|
|
109
|
-
|
|
110
|
-
\`\`\`typescript
|
|
111
|
-
// routes/users/[id].tsx
|
|
112
|
-
export default function UserPage(props: { params: { id: string } }) {
|
|
113
|
-
const user = db.get<User>(SafeSQL\`SELECT * FROM users WHERE id = \${Number(props.params.id)}\`)
|
|
114
|
-
if (!user) return h("div", { children: "Not found" })
|
|
115
|
-
return h("h1", { children: user.name })
|
|
116
|
-
}
|
|
117
|
-
\`\`\`
|
|
118
|
-
|
|
119
|
-
### API Route
|
|
120
|
-
|
|
121
|
-
\`\`\`typescript
|
|
122
|
-
// routes/api/users.ts
|
|
123
|
-
import type { Context } from "gorsee/server"
|
|
124
|
-
|
|
125
|
-
export function GET(ctx: Context): Response {
|
|
126
|
-
return Response.json({ users: [] })
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function POST(ctx: Context): Response {
|
|
130
|
-
return Response.json({ created: true }, { status: 201 })
|
|
131
|
-
}
|
|
132
|
-
\`\`\`
|
|
133
|
-
|
|
134
|
-
### Server Function
|
|
135
|
-
|
|
136
|
-
\`\`\`typescript
|
|
137
|
-
import { server } from "gorsee/server"
|
|
138
|
-
|
|
139
|
-
const getUsers = server(async () => {
|
|
140
|
-
return db.all<User>(SafeSQL\`SELECT * FROM users\`)
|
|
141
|
-
})
|
|
142
|
-
// Client: getUsers() becomes fetch("/api/_rpc/...")
|
|
143
|
-
// Server: runs directly
|
|
144
|
-
\`\`\`
|
|
145
|
-
|
|
146
|
-
### Middleware
|
|
147
|
-
|
|
148
|
-
\`\`\`typescript
|
|
149
|
-
// routes/_middleware.ts
|
|
150
|
-
import { middleware } from "gorsee/server"
|
|
151
|
-
|
|
152
|
-
export default middleware(async (ctx, next) => {
|
|
153
|
-
const session = ctx.cookies.get("session")
|
|
154
|
-
if (!session) return ctx.redirect("/login")
|
|
155
|
-
ctx.locals.user = await getUser(session)
|
|
156
|
-
return next()
|
|
157
|
-
})
|
|
158
|
-
\`\`\`
|
|
159
|
-
|
|
160
|
-
### Signals
|
|
161
|
-
|
|
162
|
-
\`\`\`typescript
|
|
163
|
-
const [count, setCount] = createSignal(0) // reactive value
|
|
164
|
-
const doubled = createComputed(() => count() * 2) // derived
|
|
165
|
-
createEffect(() => console.log(count())) // side effect
|
|
166
|
-
const [data] = createResource(fetchData) // async resource
|
|
167
|
-
const [store, setStore] = createStore({ a: 1 }) // reactive object
|
|
168
|
-
\`\`\`
|
|
169
|
-
|
|
170
|
-
### SafeSQL (prevents SQL injection at compile time)
|
|
171
|
-
|
|
172
|
-
\`\`\`typescript
|
|
173
|
-
// OK:
|
|
174
|
-
db.get(SafeSQL\`SELECT * FROM users WHERE id = \${id}\`)
|
|
175
|
-
|
|
176
|
-
// COMPILE ERROR -- string not assignable to SafeSQL:
|
|
177
|
-
db.get(\`SELECT * FROM users WHERE id = \${id}\`)
|
|
178
|
-
db.get("SELECT * FROM users WHERE id = " + id)
|
|
179
|
-
\`\`\`
|
|
180
|
-
|
|
181
|
-
## Configuration (app.config.ts)
|
|
182
|
-
|
|
183
|
-
\`\`\`typescript
|
|
184
|
-
export default {
|
|
185
|
-
port: 3000,
|
|
186
|
-
db: { driver: "sqlite", url: "./data.sqlite" },
|
|
187
|
-
log: "info", // off | error | info | verbose | debug
|
|
188
|
-
security: { csp: true, hsts: true, csrf: true, rateLimit: { requests: 100, window: "1m" } },
|
|
189
|
-
deploy: { target: "bun" }, // bun | cloudflare | deno | node
|
|
190
|
-
}
|
|
191
|
-
\`\`\`
|
|
192
|
-
|
|
193
|
-
## CLI
|
|
194
|
-
|
|
195
|
-
\`\`\`
|
|
196
|
-
gorsee dev Start dev server
|
|
197
|
-
gorsee build Production build
|
|
198
|
-
gorsee check Type + safety + structure check
|
|
199
|
-
gorsee routes List all routes
|
|
200
|
-
gorsee migrate Run database migrations
|
|
201
|
-
gorsee generate X Generate CRUD for entity X
|
|
202
|
-
\`\`\`
|
|
203
|
-
|
|
204
|
-
## Error Codes
|
|
205
|
-
|
|
206
|
-
| Code | Category | Description |
|
|
207
|
-
|------|----------|-------------|
|
|
208
|
-
| E001 | SafeSQL | Raw string in SQL query |
|
|
209
|
-
| E002 | SafeHTML | Unsanitized HTML |
|
|
210
|
-
| E003 | Server | Closure captures client variable |
|
|
211
|
-
| E004 | URL | Invalid URL |
|
|
212
|
-
| E005 | URL | Disallowed protocol |
|
|
213
|
-
|
|
214
|
-
## Security (enabled by default)
|
|
215
|
-
|
|
216
|
-
- CSP with nonce (no inline scripts except framework)
|
|
217
|
-
- HSTS (production)
|
|
218
|
-
- CSRF tokens (auto for POST)
|
|
219
|
-
- Rate limiting (100 req/min default)
|
|
220
|
-
- X-Frame-Options: DENY
|
|
221
|
-
- X-Content-Type-Options: nosniff
|
|
222
|
-
`
|
|
223
|
-
}
|
package/src/cli/index.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
// Gorsee.js CLI
|
|
3
|
-
|
|
4
|
-
const args = process.argv.slice(2)
|
|
5
|
-
const command = args[0]
|
|
6
|
-
|
|
7
|
-
const COMMANDS: Record<string, string> = {
|
|
8
|
-
create: "Create a new Gorsee.js project",
|
|
9
|
-
dev: "Start development server with HMR",
|
|
10
|
-
build: "Production build (client + server)",
|
|
11
|
-
start: "Start production server",
|
|
12
|
-
check: "Check project: types, safety, structure",
|
|
13
|
-
routes: "List all routes with render modes",
|
|
14
|
-
migrate: "Run database migrations",
|
|
15
|
-
generate: "Generate CRUD scaffold for entity",
|
|
16
|
-
typegen: "Generate typed route definitions",
|
|
17
|
-
deploy: "Generate deploy config (vercel/fly/cloudflare/netlify/docker)",
|
|
18
|
-
test: "Run tests (unit/integration/e2e)",
|
|
19
|
-
docs: "Generate API documentation from routes",
|
|
20
|
-
upgrade: "Upgrade Gorsee.js to latest version",
|
|
21
|
-
help: "Show this help message",
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async function main() {
|
|
25
|
-
switch (command) {
|
|
26
|
-
case "create":
|
|
27
|
-
const { runCreate } = await import("./cmd-create.ts")
|
|
28
|
-
await runCreate(args.slice(1))
|
|
29
|
-
break
|
|
30
|
-
case "dev":
|
|
31
|
-
const { runDev } = await import("./cmd-dev.ts")
|
|
32
|
-
await runDev(args.slice(1))
|
|
33
|
-
break
|
|
34
|
-
case "build":
|
|
35
|
-
const { runBuild } = await import("./cmd-build.ts")
|
|
36
|
-
await runBuild(args.slice(1))
|
|
37
|
-
break
|
|
38
|
-
case "start":
|
|
39
|
-
const { runStart } = await import("./cmd-start.ts")
|
|
40
|
-
await runStart(args.slice(1))
|
|
41
|
-
break
|
|
42
|
-
case "check":
|
|
43
|
-
const { runCheck } = await import("./cmd-check.ts")
|
|
44
|
-
await runCheck(args.slice(1))
|
|
45
|
-
break
|
|
46
|
-
case "routes":
|
|
47
|
-
const { runRoutes } = await import("./cmd-routes.ts")
|
|
48
|
-
await runRoutes(args.slice(1))
|
|
49
|
-
break
|
|
50
|
-
case "migrate":
|
|
51
|
-
const { runMigrate } = await import("./cmd-migrate.ts")
|
|
52
|
-
await runMigrate(args.slice(1))
|
|
53
|
-
break
|
|
54
|
-
case "generate":
|
|
55
|
-
const { runGenerate } = await import("./cmd-generate.ts")
|
|
56
|
-
await runGenerate(args.slice(1))
|
|
57
|
-
break
|
|
58
|
-
case "typegen":
|
|
59
|
-
const { runTypegen } = await import("./cmd-typegen.ts")
|
|
60
|
-
await runTypegen(args.slice(1))
|
|
61
|
-
break
|
|
62
|
-
case "deploy":
|
|
63
|
-
const { runDeploy } = await import("./cmd-deploy.ts")
|
|
64
|
-
await runDeploy(args.slice(1))
|
|
65
|
-
break
|
|
66
|
-
case "test": {
|
|
67
|
-
const { runTest } = await import("./cmd-test.ts")
|
|
68
|
-
await runTest(args.slice(1))
|
|
69
|
-
break
|
|
70
|
-
}
|
|
71
|
-
case "docs": {
|
|
72
|
-
const { runDocs } = await import("./cmd-docs.ts")
|
|
73
|
-
await runDocs(args.slice(1))
|
|
74
|
-
break
|
|
75
|
-
}
|
|
76
|
-
case "upgrade": {
|
|
77
|
-
const { runUpgrade } = await import("./cmd-upgrade.ts")
|
|
78
|
-
await runUpgrade(args.slice(1))
|
|
79
|
-
break
|
|
80
|
-
}
|
|
81
|
-
case "help":
|
|
82
|
-
case undefined:
|
|
83
|
-
case "--help":
|
|
84
|
-
case "-h":
|
|
85
|
-
printHelp()
|
|
86
|
-
break
|
|
87
|
-
default:
|
|
88
|
-
console.error(`Unknown command: ${command}`)
|
|
89
|
-
printHelp()
|
|
90
|
-
process.exit(1)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function printHelp() {
|
|
95
|
-
console.log("\n gorsee - Full-stack TypeScript framework\n")
|
|
96
|
-
console.log(" Usage: gorsee <command> [options]\n")
|
|
97
|
-
console.log(" Commands:")
|
|
98
|
-
for (const [cmd, desc] of Object.entries(COMMANDS)) {
|
|
99
|
-
console.log(` ${cmd.padEnd(12)} ${desc}`)
|
|
100
|
-
}
|
|
101
|
-
console.log()
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
main().catch((err) => {
|
|
105
|
-
console.error(err)
|
|
106
|
-
process.exit(1)
|
|
107
|
-
})
|
package/src/client.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Explicit browser-safe public entrypoint.
|
|
2
|
-
// Use this in route components and client-facing modules.
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
createSignal,
|
|
6
|
-
createComputed,
|
|
7
|
-
createEffect,
|
|
8
|
-
createResource,
|
|
9
|
-
createStore,
|
|
10
|
-
createLive,
|
|
11
|
-
invalidateResource,
|
|
12
|
-
invalidateAll,
|
|
13
|
-
createMutation,
|
|
14
|
-
} from "./reactive/index.ts"
|
|
15
|
-
|
|
16
|
-
export { Suspense } from "./runtime/suspense.ts"
|
|
17
|
-
export { Link } from "./runtime/link.ts"
|
|
18
|
-
export { Head } from "./runtime/head.ts"
|
|
19
|
-
export { navigate, onNavigate, beforeNavigate, getCurrentPath } from "./runtime/router.ts"
|
|
20
|
-
export { useFormAction } from "./runtime/form.ts"
|
|
21
|
-
export { Image } from "./runtime/image.ts"
|
|
22
|
-
export { ErrorBoundary } from "./runtime/error-boundary.ts"
|
|
23
|
-
export { island } from "./runtime/island.ts"
|
|
24
|
-
export { createEventSource } from "./server/sse.ts"
|
|
25
|
-
export { typedLink, typedNavigate } from "./runtime/typed-routes.ts"
|
|
26
|
-
export { defineForm, validateForm, fieldAttrs } from "./runtime/validated-form.ts"
|
package/src/db/index.ts
DELETED
package/src/db/migrate.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Database migration runner
|
|
2
|
-
// Reads SQL files from migrations/ dir, applies in order
|
|
3
|
-
// Tracks applied migrations in _migrations table
|
|
4
|
-
|
|
5
|
-
import { Database } from "bun:sqlite"
|
|
6
|
-
import { readdir, readFile } from "node:fs/promises"
|
|
7
|
-
import { join, extname } from "node:path"
|
|
8
|
-
|
|
9
|
-
interface MigrationRecord {
|
|
10
|
-
name: string
|
|
11
|
-
applied_at: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface MigrationResult {
|
|
15
|
-
applied: string[]
|
|
16
|
-
skipped: string[]
|
|
17
|
-
errors: string[]
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export async function runMigrations(dbPath: string, migrationsDir: string): Promise<MigrationResult> {
|
|
21
|
-
const db = new Database(dbPath)
|
|
22
|
-
db.run("PRAGMA journal_mode=WAL;")
|
|
23
|
-
|
|
24
|
-
// Create migrations table if not exists
|
|
25
|
-
db.run(`CREATE TABLE IF NOT EXISTS _migrations (
|
|
26
|
-
name TEXT PRIMARY KEY,
|
|
27
|
-
applied_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
28
|
-
)`)
|
|
29
|
-
|
|
30
|
-
// Get already applied
|
|
31
|
-
const applied = new Set(
|
|
32
|
-
db.query("SELECT name FROM _migrations ORDER BY name").all()
|
|
33
|
-
.map((r) => (r as MigrationRecord).name)
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
// Read migration files
|
|
37
|
-
let files: string[]
|
|
38
|
-
try {
|
|
39
|
-
files = await readdir(migrationsDir)
|
|
40
|
-
} catch {
|
|
41
|
-
db.close()
|
|
42
|
-
return { applied: [], skipped: [], errors: ["migrations/ directory not found"] }
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const sqlFiles = files
|
|
46
|
-
.filter((f) => extname(f) === ".sql")
|
|
47
|
-
.sort()
|
|
48
|
-
|
|
49
|
-
const result: MigrationResult = { applied: [], skipped: [], errors: [] }
|
|
50
|
-
|
|
51
|
-
for (const file of sqlFiles) {
|
|
52
|
-
if (applied.has(file)) {
|
|
53
|
-
result.skipped.push(file)
|
|
54
|
-
continue
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
const sql = await readFile(join(migrationsDir, file), "utf-8")
|
|
59
|
-
db.run("BEGIN")
|
|
60
|
-
try {
|
|
61
|
-
db.run(sql)
|
|
62
|
-
db.run("INSERT INTO _migrations (name) VALUES (?)", [file])
|
|
63
|
-
db.run("COMMIT")
|
|
64
|
-
result.applied.push(file)
|
|
65
|
-
} catch (err) {
|
|
66
|
-
db.run("ROLLBACK")
|
|
67
|
-
throw err
|
|
68
|
-
}
|
|
69
|
-
} catch (err) {
|
|
70
|
-
result.errors.push(`${file}: ${err instanceof Error ? err.message : String(err)}`)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
db.close()
|
|
75
|
-
return result
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export async function createMigration(migrationsDir: string, name: string): Promise<string> {
|
|
79
|
-
const { mkdir, writeFile } = await import("node:fs/promises")
|
|
80
|
-
await mkdir(migrationsDir, { recursive: true })
|
|
81
|
-
|
|
82
|
-
const timestamp = new Date().toISOString().replace(/[-:T]/g, "").slice(0, 14)
|
|
83
|
-
const safeName = name.replace(/[^a-zA-Z0-9_-]/g, "_").toLowerCase()
|
|
84
|
-
const filename = `${timestamp}_${safeName}.sql`
|
|
85
|
-
const filepath = join(migrationsDir, filename)
|
|
86
|
-
|
|
87
|
-
await writeFile(filepath, `-- Migration: ${name}\n-- Created: ${new Date().toISOString()}\n\n`)
|
|
88
|
-
return filename
|
|
89
|
-
}
|
package/src/db/sqlite.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Database, type SQLQueryBindings } from "bun:sqlite"
|
|
2
|
-
import type { SafeSQLValue } from "../types/safe-sql.ts"
|
|
3
|
-
|
|
4
|
-
export interface DB {
|
|
5
|
-
get<T>(query: SafeSQLValue): T | null
|
|
6
|
-
all<T>(query: SafeSQLValue): T[]
|
|
7
|
-
run(query: SafeSQLValue): { changes: number }
|
|
8
|
-
close(): void
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function toBindings(params: readonly unknown[]): SQLQueryBindings[] {
|
|
12
|
-
return params as SQLQueryBindings[]
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function createDB(path: string = ":memory:"): DB {
|
|
16
|
-
const sqlite = new Database(path)
|
|
17
|
-
sqlite.run("PRAGMA journal_mode=WAL;")
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
get<T>(query: SafeSQLValue): T | null {
|
|
21
|
-
const stmt = sqlite.prepare(query.text)
|
|
22
|
-
return stmt.get(...toBindings(query.params)) as T | null
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
all<T>(query: SafeSQLValue): T[] {
|
|
26
|
-
const stmt = sqlite.prepare(query.text)
|
|
27
|
-
return stmt.all(...toBindings(query.params)) as T[]
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
run(query: SafeSQLValue): { changes: number } {
|
|
31
|
-
const stmt = sqlite.prepare(query.text)
|
|
32
|
-
const result = stmt.run(...toBindings(query.params))
|
|
33
|
-
return { changes: (result as { changes?: number }).changes ?? 0 }
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
close(): void {
|
|
37
|
-
sqlite.close()
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
}
|
package/src/deploy/index.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Gorsee.js — Deploy adapters barrel export
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
generateDockerfile,
|
|
5
|
-
generateDockerignore,
|
|
6
|
-
} from "./dockerfile.ts"
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
generateVercelConfig,
|
|
10
|
-
generateVercelServerlessEntry,
|
|
11
|
-
generateVercelBuildOutput,
|
|
12
|
-
type VercelConfig,
|
|
13
|
-
type VercelOutputConfig,
|
|
14
|
-
} from "./vercel.ts"
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
generateFlyConfig,
|
|
18
|
-
generateFlyDockerfile,
|
|
19
|
-
} from "./fly.ts"
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
generateWranglerConfig,
|
|
23
|
-
generateCloudflareEntry,
|
|
24
|
-
generateCloudflareStaticAssets,
|
|
25
|
-
type CloudflareRoutesConfig,
|
|
26
|
-
} from "./cloudflare.ts"
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
generateNetlifyConfig,
|
|
30
|
-
generateNetlifyFunction,
|
|
31
|
-
} from "./netlify.ts"
|
package/src/deploy/vercel.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
// Gorsee.js — Vercel deploy adapter
|
|
2
|
-
|
|
3
|
-
export interface VercelConfig {
|
|
4
|
-
version: number
|
|
5
|
-
framework: null
|
|
6
|
-
buildCommand: string
|
|
7
|
-
outputDirectory: string
|
|
8
|
-
routes: Array<{ src: string; dest?: string; headers?: Record<string, string> }>
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function generateVercelConfig(): VercelConfig {
|
|
12
|
-
return {
|
|
13
|
-
version: 2,
|
|
14
|
-
framework: null,
|
|
15
|
-
buildCommand: "bun run build",
|
|
16
|
-
outputDirectory: ".vercel/output",
|
|
17
|
-
routes: [
|
|
18
|
-
{
|
|
19
|
-
src: "/_gorsee/(.*)",
|
|
20
|
-
headers: { "Cache-Control": "public, max-age=31536000, immutable" },
|
|
21
|
-
},
|
|
22
|
-
{ src: "/(.*)", dest: "/api/index" },
|
|
23
|
-
],
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function generateVercelServerlessEntry(): string {
|
|
28
|
-
return `// Gorsee.js — Vercel serverless entry
|
|
29
|
-
// Auto-generated by \`gorsee deploy vercel\`
|
|
30
|
-
|
|
31
|
-
import { startProductionServer } from "./dist/prod.js"
|
|
32
|
-
|
|
33
|
-
let initialized = false
|
|
34
|
-
|
|
35
|
-
async function ensureInit() {
|
|
36
|
-
if (!initialized) {
|
|
37
|
-
initialized = true
|
|
38
|
-
// Production server setup without Bun.serve()
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default async function handler(request: Request): Promise<Response> {
|
|
43
|
-
await ensureInit()
|
|
44
|
-
|
|
45
|
-
const url = new URL(request.url)
|
|
46
|
-
|
|
47
|
-
// Serve static client assets
|
|
48
|
-
if (url.pathname.startsWith("/_gorsee/")) {
|
|
49
|
-
return new Response(null, { status: 404 })
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Forward to Gorsee production handler
|
|
53
|
-
const { createRouter, matchRoute, buildStaticMap } = await import("./dist/router/index.js")
|
|
54
|
-
const { renderToString, ssrJsx } = await import("./dist/runtime/server.js")
|
|
55
|
-
const { handleRPCRequest } = await import("./dist/server/rpc.js")
|
|
56
|
-
|
|
57
|
-
// RPC handling
|
|
58
|
-
const rpcResponse = await handleRPCRequest(request)
|
|
59
|
-
if (rpcResponse) return rpcResponse
|
|
60
|
-
|
|
61
|
-
// Return placeholder — full implementation wires into prod.ts handler
|
|
62
|
-
return new Response("Gorsee on Vercel", {
|
|
63
|
-
headers: { "Content-Type": "text/html" },
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
`
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface VercelOutputConfig {
|
|
70
|
-
version: number
|
|
71
|
-
routes: Array<{ src: string; dest?: string; headers?: Record<string, string> }>
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function generateVercelBuildOutput(routes: string[]): VercelOutputConfig {
|
|
75
|
-
const outputRoutes: VercelOutputConfig["routes"] = [
|
|
76
|
-
{
|
|
77
|
-
src: "/_gorsee/(.*)",
|
|
78
|
-
dest: "/static/_gorsee/$1",
|
|
79
|
-
headers: { "Cache-Control": "public, max-age=31536000, immutable" },
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
src: "/favicon\\.ico|/robots\\.txt|/styles\\.css",
|
|
83
|
-
dest: "/static/$0",
|
|
84
|
-
},
|
|
85
|
-
]
|
|
86
|
-
|
|
87
|
-
for (const route of routes) {
|
|
88
|
-
outputRoutes.push({ src: route, dest: "/functions/index" })
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
outputRoutes.push({ src: "/(.*)", dest: "/functions/index" })
|
|
92
|
-
|
|
93
|
-
return { version: 3, routes: outputRoutes }
|
|
94
|
-
}
|
package/src/dev/hmr.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// HMR (Hot Module Reload) via WebSocket
|
|
2
|
-
// Server pushes "reload" messages, client refreshes the page
|
|
3
|
-
|
|
4
|
-
export const HMR_CLIENT_SCRIPT = `<script data-g-hmr>
|
|
5
|
-
(function(){
|
|
6
|
-
var ws = new WebSocket((location.protocol==="https:"?"wss://":"ws://") + location.host + "/__gorsee_hmr");
|
|
7
|
-
ws.onmessage = function(e) {
|
|
8
|
-
if (e.data === "reload") location.reload();
|
|
9
|
-
};
|
|
10
|
-
ws.onclose = function() {
|
|
11
|
-
setTimeout(function(){ location.reload(); }, 1000);
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
</script>`
|
|
15
|
-
|
|
16
|
-
// Set of connected WebSocket clients
|
|
17
|
-
const clients = new Set<{ send(data: string): void }>()
|
|
18
|
-
|
|
19
|
-
export function addHMRClient(ws: { send(data: string): void }): void {
|
|
20
|
-
clients.add(ws)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function removeHMRClient(ws: { send(data: string): void }): void {
|
|
24
|
-
clients.delete(ws)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function notifyReload(): void {
|
|
28
|
-
for (const ws of clients) {
|
|
29
|
-
try { ws.send("reload") } catch {}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Handles partial navigation requests (X-Gorsee-Navigate: partial)
|
|
2
|
-
// Returns JSON with rendered HTML + metadata instead of full page
|
|
3
|
-
|
|
4
|
-
import { createContext } from "../server/middleware.ts"
|
|
5
|
-
import {
|
|
6
|
-
buildPartialResponsePayload,
|
|
7
|
-
createClientScriptPath,
|
|
8
|
-
renderPageDocument,
|
|
9
|
-
resolvePageRoute,
|
|
10
|
-
} from "../server/page-render.ts"
|
|
11
|
-
import type { MatchResult } from "../router/matcher.ts"
|
|
12
|
-
import type { BuildResult } from "../build/client.ts"
|
|
13
|
-
|
|
14
|
-
interface PartialRenderOptions {
|
|
15
|
-
match: MatchResult
|
|
16
|
-
request: Request
|
|
17
|
-
clientBuild: BuildResult
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export async function handlePartialNavigation(opts: PartialRenderOptions): Promise<Response> {
|
|
21
|
-
const { match, request, clientBuild } = opts
|
|
22
|
-
const mod = await import(match.route.filePath)
|
|
23
|
-
const ctx = createContext(request, match.params)
|
|
24
|
-
|
|
25
|
-
// API routes don't support partial navigation
|
|
26
|
-
if (typeof mod.GET === "function" || typeof mod.POST === "function") {
|
|
27
|
-
return new Response("Not a page route", { status: 400 })
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const resolved = await resolvePageRoute(mod, match, ctx)
|
|
31
|
-
if (!resolved) {
|
|
32
|
-
return new Response(JSON.stringify({ error: "Route has no default export" }), {
|
|
33
|
-
status: 500,
|
|
34
|
-
headers: { "Content-Type": "application/json" },
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const { pageComponent, loaderData, cssFiles } = resolved
|
|
39
|
-
const rendered = renderPageDocument(pageComponent, ctx, match.params, loaderData)
|
|
40
|
-
const clientScript = createClientScriptPath(clientBuild.entryMap.get(match.route.path))
|
|
41
|
-
const result = buildPartialResponsePayload(
|
|
42
|
-
rendered,
|
|
43
|
-
loaderData,
|
|
44
|
-
match.params,
|
|
45
|
-
cssFiles,
|
|
46
|
-
clientScript,
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
return new Response(JSON.stringify(result), {
|
|
50
|
-
headers: { "Content-Type": "application/json" },
|
|
51
|
-
})
|
|
52
|
-
}
|