silgi 0.43.29 → 0.50.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 +103 -1
- package/dist/_virtual/_rolldown/runtime.mjs +5 -0
- package/dist/adapters/_fetch-adapter.d.mts +18 -0
- package/dist/adapters/_fetch-adapter.mjs +53 -0
- package/dist/adapters/astro.d.mts +15 -0
- package/dist/adapters/astro.mjs +31 -0
- package/dist/adapters/aws-lambda.d.mts +42 -0
- package/dist/adapters/aws-lambda.mjs +92 -0
- package/dist/adapters/express.d.mts +16 -0
- package/dist/adapters/express.mjs +110 -0
- package/dist/adapters/message-port.d.mts +42 -0
- package/dist/adapters/message-port.mjs +132 -0
- package/dist/adapters/nestjs.d.mts +25 -0
- package/dist/adapters/nestjs.mjs +83 -0
- package/dist/adapters/nextjs.d.mts +14 -0
- package/dist/adapters/nextjs.mjs +29 -0
- package/dist/adapters/peer.d.mts +27 -0
- package/dist/adapters/peer.mjs +36 -0
- package/dist/adapters/remix.d.mts +15 -0
- package/dist/adapters/remix.mjs +30 -0
- package/dist/adapters/solidstart.d.mts +12 -0
- package/dist/adapters/solidstart.mjs +29 -0
- package/dist/adapters/sveltekit.d.mts +14 -0
- package/dist/adapters/sveltekit.mjs +30 -0
- package/dist/broker/index.d.mts +62 -0
- package/dist/broker/index.mjs +153 -0
- package/dist/broker/nats.d.mts +33 -0
- package/dist/broker/nats.mjs +31 -0
- package/dist/broker/redis.d.mts +51 -0
- package/dist/broker/redis.mjs +92 -0
- package/dist/builder.d.mts +55 -0
- package/dist/builder.mjs +70 -0
- package/dist/callable.d.mts +19 -0
- package/dist/callable.mjs +42 -0
- package/dist/caller.mjs +90 -0
- package/dist/client/adapters/fetch/index.d.mts +15 -0
- package/dist/client/adapters/fetch/index.mjs +57 -0
- package/dist/client/adapters/ofetch/index.d.mts +55 -0
- package/dist/client/adapters/ofetch/index.mjs +91 -0
- package/dist/client/adapters/websocket/index.d.mts +20 -0
- package/dist/client/adapters/websocket/index.mjs +101 -0
- package/dist/client/client.d.mts +37 -0
- package/dist/client/client.mjs +80 -0
- package/dist/client/consume.d.mts +50 -0
- package/dist/client/consume.mjs +66 -0
- package/dist/client/dynamic-link.d.mts +16 -0
- package/dist/client/dynamic-link.mjs +19 -0
- package/dist/client/index.d.mts +6 -0
- package/dist/client/index.mjs +5 -0
- package/dist/client/interceptor.d.mts +31 -0
- package/dist/client/interceptor.mjs +34 -0
- package/dist/client/openapi.d.mts +29 -0
- package/dist/client/openapi.mjs +89 -0
- package/dist/client/plugins/batch.d.mts +26 -0
- package/dist/client/plugins/batch.mjs +64 -0
- package/dist/client/plugins/circuit-breaker.d.mts +24 -0
- package/dist/client/plugins/circuit-breaker.mjs +60 -0
- package/dist/client/plugins/csrf.d.mts +13 -0
- package/dist/client/plugins/csrf.mjs +20 -0
- package/dist/client/plugins/dedupe.d.mts +10 -0
- package/dist/client/plugins/dedupe.mjs +28 -0
- package/dist/client/plugins/index.d.mts +8 -0
- package/dist/client/plugins/index.mjs +8 -0
- package/dist/client/plugins/otel.d.mts +12 -0
- package/dist/client/plugins/otel.mjs +27 -0
- package/dist/client/plugins/retry.d.mts +34 -0
- package/dist/client/plugins/retry.mjs +79 -0
- package/dist/client/plugins/timeout.d.mts +10 -0
- package/dist/client/plugins/timeout.mjs +14 -0
- package/dist/client/server.d.mts +16 -0
- package/dist/client/server.mjs +59 -0
- package/dist/client/types.d.mts +29 -0
- package/dist/codec/devalue.d.mts +21 -0
- package/dist/codec/devalue.mjs +33 -0
- package/dist/codec/msgpack.d.mts +18 -0
- package/dist/codec/msgpack.mjs +45 -0
- package/dist/codec/sanitize.mjs +38 -0
- package/dist/codegen/emitters.d.mts +51 -0
- package/dist/codegen/emitters.mjs +143 -0
- package/dist/codegen/generate.d.mts +25 -0
- package/dist/codegen/generate.mjs +224 -0
- package/dist/codegen/index.d.mts +44 -0
- package/dist/codegen/index.mjs +103 -0
- package/dist/codegen/parse.d.mts +124 -0
- package/dist/codegen/parse.mjs +135 -0
- package/dist/codegen/preserve.d.mts +21 -0
- package/dist/codegen/preserve.mjs +62 -0
- package/dist/codegen/schema-to-code.d.mts +57 -0
- package/dist/codegen/schema-to-code.mjs +167 -0
- package/dist/compile.d.mts +46 -0
- package/dist/compile.mjs +332 -0
- package/dist/core/codec.mjs +67 -0
- package/dist/core/context-bridge.mjs +11 -0
- package/dist/core/dispatch.mjs +62 -0
- package/dist/core/error.d.mts +99 -60
- package/dist/core/error.mjs +125 -92
- package/dist/core/handler.d.mts +6 -0
- package/dist/core/handler.mjs +153 -0
- package/dist/core/input.mjs +49 -0
- package/dist/core/iterator.d.mts +17 -0
- package/dist/core/iterator.mjs +79 -0
- package/dist/core/router-utils.mjs +22 -0
- package/dist/core/schema.d.mts +20 -0
- package/dist/core/schema.mjs +33 -0
- package/dist/core/serve.d.mts +51 -0
- package/dist/core/serve.mjs +76 -0
- package/dist/core/sse.d.mts +18 -0
- package/dist/core/sse.mjs +110 -0
- package/dist/core/storage.d.mts +17 -4
- package/dist/core/storage.mjs +60 -13
- package/dist/core/task.d.mts +62 -0
- package/dist/core/task.mjs +165 -0
- package/dist/core/trace-map.d.mts +13 -0
- package/dist/core/trace-map.mjs +13 -0
- package/dist/core/url.mjs +28 -0
- package/dist/core/utils.mjs +24 -0
- package/dist/index.d.mts +17 -21
- package/dist/index.mjs +14 -22
- package/dist/integrations/ai/index.d.mts +25 -0
- package/dist/integrations/ai/index.mjs +117 -0
- package/dist/integrations/better-auth/index.d.mts +41 -0
- package/dist/integrations/better-auth/index.mjs +331 -0
- package/dist/integrations/drizzle/index.d.mts +27 -0
- package/dist/integrations/drizzle/index.mjs +285 -0
- package/dist/integrations/hey-api/index.d.mts +2 -0
- package/dist/integrations/hey-api/index.mjs +2 -0
- package/dist/integrations/hey-api/to-client.d.mts +20 -0
- package/dist/integrations/hey-api/to-client.mjs +39 -0
- package/dist/integrations/pinia-colada/general-utils.d.mts +13 -0
- package/dist/integrations/pinia-colada/general-utils.mjs +9 -0
- package/dist/integrations/pinia-colada/index.d.mts +6 -0
- package/dist/integrations/pinia-colada/index.mjs +5 -0
- package/dist/integrations/pinia-colada/key.d.mts +11 -0
- package/dist/integrations/pinia-colada/key.mjs +11 -0
- package/dist/integrations/pinia-colada/procedure-utils.d.mts +25 -0
- package/dist/integrations/pinia-colada/procedure-utils.mjs +33 -0
- package/dist/integrations/pinia-colada/router-utils.d.mts +17 -0
- package/dist/integrations/pinia-colada/router-utils.mjs +30 -0
- package/dist/integrations/pinia-colada/types.d.mts +25 -0
- package/dist/integrations/react/index.d.mts +83 -0
- package/dist/integrations/react/index.mjs +196 -0
- package/dist/integrations/tanstack-query/index.d.mts +120 -0
- package/dist/integrations/tanstack-query/index.mjs +100 -0
- package/dist/integrations/tanstack-query/ssr.d.mts +60 -0
- package/dist/integrations/tanstack-query/ssr.mjs +102 -0
- package/dist/integrations/zod/converter.d.mts +75 -0
- package/dist/integrations/zod/converter.mjs +345 -0
- package/dist/integrations/zod/index.d.mts +2 -0
- package/dist/integrations/zod/index.mjs +2 -0
- package/dist/lazy.d.mts +22 -0
- package/dist/lazy.mjs +34 -0
- package/dist/lifecycle.d.mts +36 -0
- package/dist/lifecycle.mjs +46 -0
- package/dist/map-input.d.mts +17 -0
- package/dist/map-input.mjs +47 -0
- package/dist/plugins/analytics/accumulator.d.mts +24 -0
- package/dist/plugins/analytics/accumulator.mjs +91 -0
- package/dist/plugins/analytics/alerts.d.mts +59 -0
- package/dist/plugins/analytics/alerts.mjs +140 -0
- package/dist/plugins/analytics/collector.d.mts +38 -0
- package/dist/plugins/analytics/collector.mjs +275 -0
- package/dist/plugins/analytics/cost.d.mts +61 -0
- package/dist/plugins/analytics/cost.mjs +97 -0
- package/dist/plugins/analytics/export.d.mts +7 -0
- package/dist/plugins/analytics/export.mjs +86 -0
- package/dist/plugins/analytics/normalize.mjs +144 -0
- package/dist/plugins/analytics/query.mjs +164 -0
- package/dist/plugins/analytics/request-id.mjs +34 -0
- package/dist/plugins/analytics/routes.d.mts +11 -0
- package/dist/plugins/analytics/routes.mjs +211 -0
- package/dist/plugins/analytics/sse.d.mts +31 -0
- package/dist/plugins/analytics/sse.mjs +74 -0
- package/dist/plugins/analytics/store.mjs +103 -0
- package/dist/plugins/analytics/timeseries.d.mts +50 -0
- package/dist/plugins/analytics/timeseries.mjs +169 -0
- package/dist/plugins/analytics/trace.d.mts +48 -0
- package/dist/plugins/analytics/trace.mjs +83 -0
- package/dist/plugins/analytics/types.d.mts +145 -0
- package/dist/plugins/analytics/types.mjs +40 -0
- package/dist/plugins/analytics/utils.d.mts +4 -0
- package/dist/plugins/analytics/utils.mjs +56 -0
- package/dist/plugins/analytics.d.mts +18 -0
- package/dist/plugins/analytics.mjs +188 -0
- package/dist/plugins/batch-server.d.mts +20 -0
- package/dist/plugins/batch-server.mjs +91 -0
- package/dist/plugins/body-limit.d.mts +19 -0
- package/dist/plugins/body-limit.mjs +49 -0
- package/dist/plugins/cache.d.mts +170 -0
- package/dist/plugins/cache.mjs +212 -0
- package/dist/plugins/coerce.d.mts +24 -0
- package/dist/plugins/coerce.mjs +70 -0
- package/dist/plugins/cookies.d.mts +14 -0
- package/dist/plugins/cookies.mjs +48 -0
- package/dist/plugins/cors.d.mts +43 -0
- package/dist/plugins/cors.mjs +62 -0
- package/dist/plugins/file-upload.d.mts +38 -0
- package/dist/plugins/file-upload.mjs +102 -0
- package/dist/plugins/index.d.mts +18 -0
- package/dist/plugins/index.mjs +17 -0
- package/dist/plugins/otel.d.mts +35 -0
- package/dist/plugins/otel.mjs +40 -0
- package/dist/plugins/pino.d.mts +60 -0
- package/dist/plugins/pino.mjs +42 -0
- package/dist/plugins/pubsub.d.mts +50 -0
- package/dist/plugins/pubsub.mjs +53 -0
- package/dist/plugins/ratelimit.d.mts +53 -0
- package/dist/plugins/ratelimit.mjs +92 -0
- package/dist/plugins/signing.d.mts +41 -0
- package/dist/plugins/signing.mjs +118 -0
- package/dist/plugins/strict-get.d.mts +10 -0
- package/dist/plugins/strict-get.mjs +33 -0
- package/dist/scalar.d.mts +49 -0
- package/dist/scalar.mjs +311 -0
- package/dist/silgi.d.mts +144 -0
- package/dist/silgi.mjs +164 -0
- package/dist/trpc-interop.d.mts +22 -0
- package/dist/trpc-interop.mjs +68 -0
- package/dist/types.d.mts +108 -0
- package/dist/ws.d.mts +88 -0
- package/dist/ws.mjs +205 -0
- package/lib/dashboard/index.html +120 -0
- package/lib/ocache.d.mts +1 -0
- package/lib/ocache.mjs +1 -0
- package/lib/ofetch.d.mts +1 -0
- package/lib/ofetch.mjs +1 -0
- package/lib/srvx.d.mts +1 -0
- package/lib/srvx.mjs +1 -0
- package/lib/unstorage.d.mts +1 -0
- package/lib/unstorage.mjs +1 -0
- package/package.json +314 -150
- package/dist/build.d.mts +0 -3
- package/dist/build.mjs +0 -4
- package/dist/cli/build/build.mjs +0 -15
- package/dist/cli/build/dev.d.mts +0 -10
- package/dist/cli/build/dev.mjs +0 -92
- package/dist/cli/build/prepare.d.mts +0 -6
- package/dist/cli/build/prepare.mjs +0 -15
- package/dist/cli/commands/commands.mjs +0 -90
- package/dist/cli/commands/env.mjs +0 -53
- package/dist/cli/commands/init.mjs +0 -84
- package/dist/cli/commands/install.mjs +0 -52
- package/dist/cli/commands/prepare.mjs +0 -65
- package/dist/cli/commands/reset.mjs +0 -46
- package/dist/cli/commands/run.mjs +0 -31
- package/dist/cli/commands/watch.mjs +0 -153
- package/dist/cli/config/defaults.mjs +0 -117
- package/dist/cli/config/index.d.mts +0 -3
- package/dist/cli/config/index.mjs +0 -4
- package/dist/cli/config/loader.d.mts +0 -6
- package/dist/cli/config/loader.mjs +0 -71
- package/dist/cli/config/resolvers/compatibility.mjs +0 -71
- package/dist/cli/config/resolvers/imports.mjs +0 -35
- package/dist/cli/config/resolvers/paths.mjs +0 -98
- package/dist/cli/config/resolvers/storage.mjs +0 -23
- package/dist/cli/config/resolvers/url.mjs +0 -9
- package/dist/cli/config/types.d.mts +0 -14
- package/dist/cli/config/types.mjs +0 -147
- package/dist/cli/core/apiful.mjs +0 -36
- package/dist/cli/core/devServer.mjs +0 -10
- package/dist/cli/core/env.mjs +0 -68
- package/dist/cli/core/installPackage.mjs +0 -60
- package/dist/cli/core/runtimeConfig.mjs +0 -70
- package/dist/cli/core/scan.mjs +0 -35
- package/dist/cli/core/silgi.mjs +0 -111
- package/dist/cli/framework/emptyFramework.mjs +0 -7
- package/dist/cli/framework/h3.mjs +0 -55
- package/dist/cli/framework/index.mjs +0 -15
- package/dist/cli/framework/nitro.mjs +0 -24
- package/dist/cli/framework/nuxt.mjs +0 -10
- package/dist/cli/index.d.mts +0 -1
- package/dist/cli/index.mjs +0 -29
- package/dist/cli/module/exportScan.mjs +0 -180
- package/dist/cli/module/install.mjs +0 -49
- package/dist/cli/module/scan.mjs +0 -193
- package/dist/cli/scan/prepareCommands.mjs +0 -40
- package/dist/cli/scan/prepareConfigs.mjs +0 -33
- package/dist/cli/scan/prepareCoreFile.mjs +0 -118
- package/dist/cli/scan/prepareScanFile.mjs +0 -59
- package/dist/cli/scan/prepareSchema.mjs +0 -128
- package/dist/cli/scan/scanExportFile.mjs +0 -288
- package/dist/cli/scan/writeCoreFile.mjs +0 -22
- package/dist/cli/scan/writeTypesAndFiles.mjs +0 -72
- package/dist/cli/utils/cancel.mjs +0 -14
- package/dist/cli/utils/common.mjs +0 -15
- package/dist/cli/utils/compatibility.mjs +0 -33
- package/dist/cli/utils/debug.mjs +0 -11
- package/dist/cli/utils/ignore.mjs +0 -56
- package/dist/cli/utils/processManager.mjs +0 -170
- package/dist/cli/utils/readScanFile.mjs +0 -58
- package/dist/cli/utils/storage.mjs +0 -23
- package/dist/core/context.d.mts +0 -30
- package/dist/core/context.mjs +0 -32
- package/dist/core/createSilgi.d.mts +0 -6
- package/dist/core/createSilgi.mjs +0 -153
- package/dist/core/event.d.mts +0 -26
- package/dist/core/event.mjs +0 -44
- package/dist/core/index.d.mts +0 -25
- package/dist/core/index.mjs +0 -30
- package/dist/core/orchestrate.mjs +0 -115
- package/dist/core/response.d.mts +0 -20
- package/dist/core/response.mjs +0 -105
- package/dist/core/silgi.d.mts +0 -19
- package/dist/core/silgi.mjs +0 -141
- package/dist/core/silgiApp.d.mts +0 -9
- package/dist/core/silgiApp.mjs +0 -23
- package/dist/core/unctx.d.mts +0 -21
- package/dist/core/unctx.mjs +0 -35
- package/dist/core/utils/event-stream.d.mts +0 -53
- package/dist/core/utils/event-stream.mjs +0 -38
- package/dist/core/utils/event.d.mts +0 -8
- package/dist/core/utils/event.mjs +0 -12
- package/dist/core/utils/internal/event-stream.d.mts +0 -45
- package/dist/core/utils/internal/event-stream.mjs +0 -137
- package/dist/core/utils/internal/obj.mjs +0 -9
- package/dist/core/utils/internal/object.mjs +0 -29
- package/dist/core/utils/internal/query.mjs +0 -73
- package/dist/core/utils/internal/req.mjs +0 -35
- package/dist/core/utils/merge.d.mts +0 -14
- package/dist/core/utils/merge.mjs +0 -27
- package/dist/core/utils/middleware.d.mts +0 -14
- package/dist/core/utils/middleware.mjs +0 -12
- package/dist/core/utils/request.mjs +0 -35
- package/dist/core/utils/resolver.d.mts +0 -7
- package/dist/core/utils/resolver.mjs +0 -29
- package/dist/core/utils/runtime.d.mts +0 -7
- package/dist/core/utils/runtime.mjs +0 -20
- package/dist/core/utils/sanitize.mjs +0 -22
- package/dist/core/utils/schema.d.mts +0 -34
- package/dist/core/utils/schema.mjs +0 -33
- package/dist/core/utils/service.d.mts +0 -13
- package/dist/core/utils/service.mjs +0 -19
- package/dist/core/utils/shared.d.mts +0 -6
- package/dist/core/utils/shared.mjs +0 -7
- package/dist/core/utils/storage.d.mts +0 -24
- package/dist/core/utils/storage.mjs +0 -54
- package/dist/kit/add/add-commands.d.mts +0 -6
- package/dist/kit/add/add-commands.mjs +0 -12
- package/dist/kit/add/add-core-file.d.mts +0 -9
- package/dist/kit/add/add-core-file.mjs +0 -11
- package/dist/kit/add/add-imports.d.mts +0 -14
- package/dist/kit/add/add-imports.mjs +0 -56
- package/dist/kit/add/add-npm.d.mts +0 -14
- package/dist/kit/add/add-npm.mjs +0 -23
- package/dist/kit/define.d.mts +0 -28
- package/dist/kit/define.mjs +0 -25
- package/dist/kit/errors.d.mts +0 -6
- package/dist/kit/errors.mjs +0 -11
- package/dist/kit/esm.d.mts +0 -11
- package/dist/kit/esm.mjs +0 -21
- package/dist/kit/fs.d.mts +0 -4
- package/dist/kit/fs.mjs +0 -13
- package/dist/kit/function-utils.d.mts +0 -27
- package/dist/kit/function-utils.mjs +0 -75
- package/dist/kit/gen.d.mts +0 -5
- package/dist/kit/gen.mjs +0 -26
- package/dist/kit/hash.d.mts +0 -4
- package/dist/kit/hash.mjs +0 -10
- package/dist/kit/index.d.mts +0 -22
- package/dist/kit/index.mjs +0 -23
- package/dist/kit/isFramework.d.mts +0 -6
- package/dist/kit/isFramework.mjs +0 -21
- package/dist/kit/logger.d.mts +0 -6
- package/dist/kit/logger.mjs +0 -10
- package/dist/kit/migration.d.mts +0 -113
- package/dist/kit/migration.mjs +0 -301
- package/dist/kit/module.d.mts +0 -14
- package/dist/kit/module.mjs +0 -53
- package/dist/kit/path.d.mts +0 -7
- package/dist/kit/path.mjs +0 -26
- package/dist/kit/preset.d.mts +0 -8
- package/dist/kit/preset.mjs +0 -11
- package/dist/kit/resolve.d.mts +0 -37
- package/dist/kit/resolve.mjs +0 -82
- package/dist/kit/template.d.mts +0 -19
- package/dist/kit/template.mjs +0 -91
- package/dist/kit/useRequest.d.mts +0 -19
- package/dist/kit/useRequest.mjs +0 -63
- package/dist/kit/utils.d.mts +0 -34
- package/dist/kit/utils.mjs +0 -91
- package/dist/package.mjs +0 -176
- package/dist/presets/_all.gen.d.mts +0 -6
- package/dist/presets/_all.gen.mjs +0 -18
- package/dist/presets/_resolve.d.mts +0 -12
- package/dist/presets/_resolve.mjs +0 -57
- package/dist/presets/_types.gen.d.mts +0 -8
- package/dist/presets/_types.gen.mjs +0 -5
- package/dist/presets/h3/preset.d.mts +0 -6
- package/dist/presets/h3/preset.mjs +0 -35
- package/dist/presets/hono/preset.d.mts +0 -6
- package/dist/presets/hono/preset.mjs +0 -30
- package/dist/presets/index.d.mts +0 -3
- package/dist/presets/index.mjs +0 -3
- package/dist/presets/nitro/preset.d.mts +0 -6
- package/dist/presets/nitro/preset.mjs +0 -37
- package/dist/presets/npmpackage/preset.d.mts +0 -6
- package/dist/presets/npmpackage/preset.mjs +0 -29
- package/dist/presets/nuxt/preset.d.mts +0 -6
- package/dist/presets/nuxt/preset.mjs +0 -41
- package/dist/runtime/index.d.mts +0 -4
- package/dist/runtime/index.mjs +0 -5
- package/dist/runtime/internal/config.d.mts +0 -11
- package/dist/runtime/internal/config.mjs +0 -97
- package/dist/runtime/internal/debug.d.mts +0 -6
- package/dist/runtime/internal/debug.mjs +0 -11
- package/dist/runtime/internal/defu.d.mts +0 -4
- package/dist/runtime/internal/defu.mjs +0 -9
- package/dist/runtime/internal/index.d.mts +0 -7
- package/dist/runtime/internal/index.mjs +0 -8
- package/dist/runtime/internal/nitro.d.mts +0 -6
- package/dist/runtime/internal/nitro.mjs +0 -36
- package/dist/runtime/internal/nuxt.d.mts +0 -12
- package/dist/runtime/internal/nuxt.mjs +0 -16
- package/dist/runtime/internal/ofetch.d.mts +0 -8
- package/dist/runtime/internal/ofetch.mjs +0 -39
- package/dist/runtime/internal/plugin.d.mts +0 -7
- package/dist/runtime/internal/plugin.mjs +0 -8
- package/dist/types/cliConfig.d.mts +0 -288
- package/dist/types/cliConfig.mjs +0 -0
- package/dist/types/cliHooks.d.mts +0 -142
- package/dist/types/cliHooks.mjs +0 -0
- package/dist/types/compatibility.d.mts +0 -13
- package/dist/types/compatibility.mjs +0 -0
- package/dist/types/config.d.mts +0 -46
- package/dist/types/config.mjs +0 -0
- package/dist/types/dotenv.d.mts +0 -29
- package/dist/types/dotenv.mjs +0 -0
- package/dist/types/event.d.mts +0 -63
- package/dist/types/event.mjs +0 -0
- package/dist/types/global.d.mts +0 -24
- package/dist/types/global.mjs +0 -0
- package/dist/types/helper.d.mts +0 -25
- package/dist/types/helper.mjs +0 -0
- package/dist/types/hooks.d.mts +0 -37
- package/dist/types/hooks.mjs +0 -0
- package/dist/types/index.d.mts +0 -26
- package/dist/types/index.mjs +0 -0
- package/dist/types/kits.d.mts +0 -32
- package/dist/types/kits.mjs +0 -0
- package/dist/types/middleware.d.mts +0 -31
- package/dist/types/middleware.mjs +0 -0
- package/dist/types/module.d.mts +0 -102
- package/dist/types/module.mjs +0 -0
- package/dist/types/preset.d.mts +0 -20
- package/dist/types/preset.mjs +0 -0
- package/dist/types/route.d.mts +0 -59
- package/dist/types/route.mjs +0 -0
- package/dist/types/runtime/index.d.mts +0 -5
- package/dist/types/runtime/index.mjs +0 -0
- package/dist/types/runtime/nuxt.d.mts +0 -13
- package/dist/types/runtime/nuxt.mjs +0 -0
- package/dist/types/runtime/ofetch.d.mts +0 -14
- package/dist/types/runtime/ofetch.mjs +0 -0
- package/dist/types/runtime/plugin.d.mts +0 -8
- package/dist/types/runtime/plugin.mjs +0 -0
- package/dist/types/runtime/silgi.d.mts +0 -11
- package/dist/types/runtime/silgi.mjs +0 -0
- package/dist/types/schema.d.mts +0 -86
- package/dist/types/schema.mjs +0 -0
- package/dist/types/service.d.mts +0 -102
- package/dist/types/service.mjs +0 -0
- package/dist/types/shared.d.mts +0 -19
- package/dist/types/shared.mjs +0 -0
- package/dist/types/silgi.d.mts +0 -71
- package/dist/types/silgi.mjs +0 -0
- package/dist/types/silgiCLI.d.mts +0 -118
- package/dist/types/silgiCLI.mjs +0 -0
- package/dist/types/standard-schema.d.mts +0 -61
- package/dist/types/standard-schema.mjs +0 -0
- package/dist/types/storage.d.mts +0 -30
- package/dist/types/storage.mjs +0 -0
- package/dist/types/tree-kill.d.mts +0 -18
- package/dist/types/tree-kill.mjs +0 -0
- package/lib/config.d.mts +0 -7
- package/lib/config.mjs +0 -5
- package/lib/meta.d.mts +0 -4
- package/lib/meta.mjs +0 -6
- package/lib/runtime-meta.d.mts +0 -4
- package/lib/runtime-meta.mjs +0 -32
package/dist/kit/template.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { basename, dirname, parse, resolve } from "pathe";
|
|
2
|
-
import { useSilgiCLI } from "silgi";
|
|
3
|
-
import { hash } from "silgi/kit";
|
|
4
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
-
|
|
6
|
-
//#region src/kit/template.ts
|
|
7
|
-
/**
|
|
8
|
-
* Writes a template file to disk immediately
|
|
9
|
-
*/
|
|
10
|
-
function writeTemplate$1(_template) {
|
|
11
|
-
const template = normalizeTemplate(_template);
|
|
12
|
-
writeTemplateNow(template).catch((err) => {
|
|
13
|
-
console.error("Error writing template:", err);
|
|
14
|
-
});
|
|
15
|
-
return template;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Simple file writing with CLI error checking (replaces fs.ts writeFile)
|
|
19
|
-
*/
|
|
20
|
-
async function writeFile$1(file, contents, log = false) {
|
|
21
|
-
const silgi = useSilgiCLI();
|
|
22
|
-
if (silgi.errors.length) return;
|
|
23
|
-
const filename = basename(file);
|
|
24
|
-
writeTemplate$1({
|
|
25
|
-
filename,
|
|
26
|
-
dst: file,
|
|
27
|
-
getContents: () => contents.toString(),
|
|
28
|
-
write: true
|
|
29
|
-
});
|
|
30
|
-
if (log) silgi.logger.info("Generated", file);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Write template to disk
|
|
34
|
-
*/
|
|
35
|
-
async function writeTemplateNow(template) {
|
|
36
|
-
if (template.skipIfExists && existsSync(template.dst)) return;
|
|
37
|
-
let contents;
|
|
38
|
-
if (template.src) contents = readFileSync(template.src, "utf-8");
|
|
39
|
-
else if (template.getContents) {
|
|
40
|
-
const silgi = useSilgiCLI();
|
|
41
|
-
const result = template.getContents({
|
|
42
|
-
app: silgi,
|
|
43
|
-
options: template.options
|
|
44
|
-
});
|
|
45
|
-
contents = await Promise.resolve(result);
|
|
46
|
-
} else throw new Error(`Template must have either 'src' or 'getContents'`);
|
|
47
|
-
mkdirSync(dirname(template.dst), { recursive: true });
|
|
48
|
-
writeFileSync(template.dst, contents, "utf8");
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Normalize a silgi template object
|
|
52
|
-
*/
|
|
53
|
-
function normalizeTemplate(template, buildDir) {
|
|
54
|
-
if (!template) throw new Error(`Invalid template: ${JSON.stringify(template)}`);
|
|
55
|
-
if (typeof template === "string") template = { src: template };
|
|
56
|
-
else template = { ...template };
|
|
57
|
-
if (template.src) {
|
|
58
|
-
if (!existsSync(template.src)) throw new Error(`Template not found: ${template.src}`);
|
|
59
|
-
if (!template.filename) {
|
|
60
|
-
const srcPath = parse(template.src);
|
|
61
|
-
template.filename = template.fileName || `${basename(srcPath.dir)}.${srcPath.name}.${hash(template.src)}${srcPath.ext}`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (!template.src && !template.getContents) throw new Error(`Invalid template. Either \`getContents\` or \`src\` should be provided: ${JSON.stringify(template)}`);
|
|
65
|
-
if (!template.filename) throw new Error(`Invalid template. \`filename\` must be provided: ${JSON.stringify(template)}`);
|
|
66
|
-
if (template.filename.endsWith(".d.ts")) template.write = true;
|
|
67
|
-
if (!template.dst) {
|
|
68
|
-
const silgi = useSilgiCLI();
|
|
69
|
-
let dir;
|
|
70
|
-
switch (template.where) {
|
|
71
|
-
case ".silgi":
|
|
72
|
-
dir = silgi.options.build.dir;
|
|
73
|
-
break;
|
|
74
|
-
case "server":
|
|
75
|
-
dir = silgi.options.silgi.serverDir;
|
|
76
|
-
break;
|
|
77
|
-
case "client":
|
|
78
|
-
dir = silgi.options.silgi.clientDir;
|
|
79
|
-
break;
|
|
80
|
-
case "root":
|
|
81
|
-
dir = silgi.options.rootDir;
|
|
82
|
-
break;
|
|
83
|
-
default: dir = silgi.options.silgi.serverDir;
|
|
84
|
-
}
|
|
85
|
-
template.dst = resolve(buildDir ?? dir, template.filename);
|
|
86
|
-
}
|
|
87
|
-
return template;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
export { normalizeTemplate, writeFile$1 as writeFile, writeTemplate$1 as writeTemplate };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SilgiEvent } from "silgi/types";
|
|
2
|
-
import { IncomingMessage } from "node:http";
|
|
3
|
-
|
|
4
|
-
//#region src/kit/useRequest.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
declare function useRequest<T extends IncomingMessage>(event: SilgiEvent): T | (IncomingMessage & {
|
|
10
|
-
originalUrl?: string;
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* Extract the client's IP address from request headers with high accuracy
|
|
14
|
-
* @param req - The incoming HTTP request (Fetch API Request)
|
|
15
|
-
* @returns The client's IP address or empty string if not found
|
|
16
|
-
*/
|
|
17
|
-
declare function getIpAddress(req: Request): string;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { getIpAddress as getIpAddress$1, useRequest as useRequest$1 };
|
package/dist/kit/useRequest.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { useSilgi } from "silgi";
|
|
2
|
-
|
|
3
|
-
//#region src/kit/useRequest.ts
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated
|
|
6
|
-
*/
|
|
7
|
-
function useRequest(event) {
|
|
8
|
-
const silgi = useSilgi();
|
|
9
|
-
if (silgi.options.present === "nuxt" || silgi.options.present === "nitro" || silgi.options.present === "h3") return event.node.req;
|
|
10
|
-
return event;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Extract the client's IP address from request headers with high accuracy
|
|
14
|
-
* @param req - The incoming HTTP request (Fetch API Request)
|
|
15
|
-
* @returns The client's IP address or empty string if not found
|
|
16
|
-
*/
|
|
17
|
-
function getIpAddress(req) {
|
|
18
|
-
const headers = [
|
|
19
|
-
"cf-connecting-ip",
|
|
20
|
-
"true-client-ip",
|
|
21
|
-
"x-real-ip",
|
|
22
|
-
"x-forwarded-for",
|
|
23
|
-
"x-client-ip",
|
|
24
|
-
"x-forwarded",
|
|
25
|
-
"forwarded",
|
|
26
|
-
"forwarded-for",
|
|
27
|
-
"x-appengine-user-ip",
|
|
28
|
-
"x-cluster-client-ip",
|
|
29
|
-
"fastly-client-ip",
|
|
30
|
-
"x-azure-clientip",
|
|
31
|
-
"x-original-forwarded-for",
|
|
32
|
-
"x-lb-forwarded-for",
|
|
33
|
-
"cdn-loop"
|
|
34
|
-
];
|
|
35
|
-
for (const header of headers) {
|
|
36
|
-
const value = req.headers.get(header);
|
|
37
|
-
if (!value) continue;
|
|
38
|
-
let ip;
|
|
39
|
-
if (header === "x-forwarded-for" || header === "forwarded-for" || header === "x-original-forwarded-for") ip = value.split(",")[0];
|
|
40
|
-
else if (header === "forwarded") {
|
|
41
|
-
const match = value.match(/for=([^;]+)/);
|
|
42
|
-
ip = match?.[1]?.trim().replace(/^\[|\]$/g, "") ?? "";
|
|
43
|
-
} else ip = value;
|
|
44
|
-
const cleanIp = ip.trim();
|
|
45
|
-
if (cleanIp && isValidIp(cleanIp)) return cleanIp;
|
|
46
|
-
}
|
|
47
|
-
return "";
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Validates if a string is a valid IPv4 or IPv6 address
|
|
51
|
-
* Optimized for performance in high-traffic applications
|
|
52
|
-
* @param ip - The IP address to validate
|
|
53
|
-
* @returns true if the IP is valid
|
|
54
|
-
*/
|
|
55
|
-
function isValidIp(ip) {
|
|
56
|
-
if (ip === "::1" || ip === "localhost" || ip === "127.0.0.1") return true;
|
|
57
|
-
if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(ip)) return true;
|
|
58
|
-
if (/^[0-9a-f:]+$/i.test(ip)) return true;
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
export { getIpAddress, useRequest };
|
package/dist/kit/utils.d.mts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { PresetName } from "silgi/presets";
|
|
2
|
-
import { SilgiCLI } from "silgi/types";
|
|
3
|
-
|
|
4
|
-
//#region src/kit/utils.d.ts
|
|
5
|
-
declare function relativeWithDot(from: string, to: string): string;
|
|
6
|
-
declare function toArray<T>(value: T | T[]): T[];
|
|
7
|
-
/**
|
|
8
|
-
* Filter out items from an array in place. This function mutates the array.
|
|
9
|
-
* `predicate` get through the array from the end to the start for performance.
|
|
10
|
-
*
|
|
11
|
-
* This function should be faster than `Array.prototype.filter` on large arrays.
|
|
12
|
-
*/
|
|
13
|
-
declare function filterInPlace<T>(array: T[], predicate: (item: T, index: number, arr: T[]) => unknown): T[];
|
|
14
|
-
declare const MODE_RE: RegExp;
|
|
15
|
-
/**
|
|
16
|
-
* Check if a Silgi module is installed by name.
|
|
17
|
-
*
|
|
18
|
-
* This will check both the installed modules and the modules to be installed. Note
|
|
19
|
-
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
20
|
-
*/
|
|
21
|
-
declare function hasSilgiModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
22
|
-
declare function hasInstalledModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
23
|
-
declare const baseHeaderBannerComment: string[];
|
|
24
|
-
declare function processFilePath(src: string): string;
|
|
25
|
-
declare function isPresents(names: PresetName[]): boolean;
|
|
26
|
-
declare function isRuntimePresents(names: PresetName[]): boolean;
|
|
27
|
-
declare function removeExtension(filePath: string, force?: boolean): string;
|
|
28
|
-
declare function getServicePath(_route: string): {
|
|
29
|
-
method: string;
|
|
30
|
-
type: string;
|
|
31
|
-
route: string;
|
|
32
|
-
};
|
|
33
|
-
//#endregion
|
|
34
|
-
export { MODE_RE as MODE_RE$1, baseHeaderBannerComment as baseHeaderBannerComment$1, filterInPlace as filterInPlace$1, getServicePath as getServicePath$1, hasInstalledModule as hasInstalledModule$2, hasSilgiModule as hasSilgiModule$1, isPresents as isPresents$1, isRuntimePresents as isRuntimePresents$1, processFilePath as processFilePath$1, relativeWithDot as relativeWithDot$1, removeExtension as removeExtension$1, toArray as toArray$1 };
|
package/dist/kit/utils.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { extname, relative } from "pathe";
|
|
2
|
-
import { useSilgi, useSilgiCLI } from "silgi";
|
|
3
|
-
|
|
4
|
-
//#region src/kit/utils.ts
|
|
5
|
-
const RELATIVE_RE = /^([^.])/;
|
|
6
|
-
function relativeWithDot(from, to) {
|
|
7
|
-
return relative(from, to).replace(RELATIVE_RE, "./$1") || ".";
|
|
8
|
-
}
|
|
9
|
-
function toArray(value) {
|
|
10
|
-
return Array.isArray(value) ? value : [value];
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Filter out items from an array in place. This function mutates the array.
|
|
14
|
-
* `predicate` get through the array from the end to the start for performance.
|
|
15
|
-
*
|
|
16
|
-
* This function should be faster than `Array.prototype.filter` on large arrays.
|
|
17
|
-
*/
|
|
18
|
-
function filterInPlace(array, predicate) {
|
|
19
|
-
for (let i = array.length; i--;) if (!predicate(array[i], i, array)) array.splice(i, 1);
|
|
20
|
-
return array;
|
|
21
|
-
}
|
|
22
|
-
const MODE_RE = /\.(server|client)(\.\w+)*$/;
|
|
23
|
-
/**
|
|
24
|
-
* Check if a Silgi module is installed by name.
|
|
25
|
-
*
|
|
26
|
-
* This will check both the installed modules and the modules to be installed. Note
|
|
27
|
-
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
28
|
-
*/
|
|
29
|
-
function hasSilgiModule(moduleKey, silgi = useSilgiCLI()) {
|
|
30
|
-
return silgi.scanModules.some(({ meta }) => meta.configKey === moduleKey) || Object.keys(silgi.scanModules).includes(moduleKey);
|
|
31
|
-
}
|
|
32
|
-
function hasInstalledModule(moduleKey, silgi = useSilgiCLI()) {
|
|
33
|
-
const find = silgi.scanModules.find(({ meta }) => meta.configKey === moduleKey);
|
|
34
|
-
return find?.installed ?? false;
|
|
35
|
-
}
|
|
36
|
-
const baseHeaderBannerComment = [
|
|
37
|
-
"/* eslint-disable eslint-comments/no-unlimited-disable */",
|
|
38
|
-
"// DO NOT EDIT THIS FILE",
|
|
39
|
-
"// This file is generated by Silgi",
|
|
40
|
-
"/* eslint-disable */",
|
|
41
|
-
"/* prettier-ignore */",
|
|
42
|
-
"/* tslint:disable */"
|
|
43
|
-
];
|
|
44
|
-
function processFilePath(src) {
|
|
45
|
-
const silgi = useSilgiCLI();
|
|
46
|
-
if (silgi.options.typescript.removeFileExtension) {
|
|
47
|
-
src = src.replace(/\.ts$/, "");
|
|
48
|
-
return src;
|
|
49
|
-
}
|
|
50
|
-
return src;
|
|
51
|
-
}
|
|
52
|
-
function isPresents(names) {
|
|
53
|
-
const silgi = useSilgiCLI();
|
|
54
|
-
return names.filter((name) => silgi.options.preset.includes(name)).length > 0;
|
|
55
|
-
}
|
|
56
|
-
function isRuntimePresents(names) {
|
|
57
|
-
const silgi = useSilgi();
|
|
58
|
-
return names.includes(silgi.options.present);
|
|
59
|
-
}
|
|
60
|
-
function removeExtension(filePath, force = false) {
|
|
61
|
-
const silgi = useSilgiCLI();
|
|
62
|
-
if (silgi.options.typescript.removeFileExtension || force) {
|
|
63
|
-
const ext = extname(filePath);
|
|
64
|
-
return ext ? filePath.slice(0, -ext.length) : filePath;
|
|
65
|
-
}
|
|
66
|
-
return filePath;
|
|
67
|
-
}
|
|
68
|
-
function getServicePath(_route) {
|
|
69
|
-
let method = "";
|
|
70
|
-
let type = "";
|
|
71
|
-
let route = _route;
|
|
72
|
-
const parts = route.split(":");
|
|
73
|
-
if (parts.length === 3) {
|
|
74
|
-
type = parts[0] ? parts[0].toLowerCase() : "";
|
|
75
|
-
method = parts[1] ? parts[1].toUpperCase() : "";
|
|
76
|
-
if (method === "GLOBAL" || method === "ALL") method = "";
|
|
77
|
-
route = parts[2] ?? "";
|
|
78
|
-
} else if (parts.length === 2) {
|
|
79
|
-
method = parts[0] ? parts[0].toUpperCase() : "";
|
|
80
|
-
if (method === "GLOBAL" || method === "ALL") method = "";
|
|
81
|
-
route = parts[1] ?? "";
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
method,
|
|
85
|
-
type,
|
|
86
|
-
route
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
export { MODE_RE, baseHeaderBannerComment, filterInPlace, getServicePath, hasInstalledModule, hasSilgiModule, isPresents, isRuntimePresents, processFilePath, relativeWithDot, removeExtension, toArray };
|
package/dist/package.mjs
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
//#region package.json
|
|
2
|
-
var name = "silgi";
|
|
3
|
-
var type = "module";
|
|
4
|
-
var version = "0.43.29";
|
|
5
|
-
var private$1 = false;
|
|
6
|
-
var packageManager = "pnpm@10.12.4";
|
|
7
|
-
var sideEffects = false;
|
|
8
|
-
var exports = {
|
|
9
|
-
"./package.json": "./package.json",
|
|
10
|
-
".": "./dist/core/index.mjs",
|
|
11
|
-
"./core": "./dist/core/index.mjs",
|
|
12
|
-
"./build": "./dist/build.mjs",
|
|
13
|
-
"./cli": "./dist/cli/index.mjs",
|
|
14
|
-
"./cli/config": "./dist/cli/config/index.mjs",
|
|
15
|
-
"./kit": "./dist/kit/index.mjs",
|
|
16
|
-
"./config": "./lib/config.mjs",
|
|
17
|
-
"./types": "./dist/types/index.d.mts",
|
|
18
|
-
"./meta": "./lib/meta.mjs",
|
|
19
|
-
"./presets": { "import": "./dist/presets/index.mjs" },
|
|
20
|
-
"./runtime": { "import": "./dist/runtime/index.mjs" },
|
|
21
|
-
"./runtime/internal/nitro": { "import": "./dist/runtime/internal/nitro.mjs" },
|
|
22
|
-
"./runtime/internal/debug": { "import": "./dist/runtime/internal/debug.mjs" },
|
|
23
|
-
"./runtime/internal": { "import": "./dist/runtime/internal/index.mjs" },
|
|
24
|
-
"./runtime/internal/nuxt": { "import": "./dist/runtime/internal/nuxt.mjs" },
|
|
25
|
-
"./runtime/meta": "./lib/runtime-meta.mjs"
|
|
26
|
-
};
|
|
27
|
-
var main = "./dist/core/index.mjs";
|
|
28
|
-
var types = "./dist/types/index.d.mts";
|
|
29
|
-
var bin = { "silgi": "./dist/cli/index.mjs" };
|
|
30
|
-
var files = [
|
|
31
|
-
"bin",
|
|
32
|
-
"dist",
|
|
33
|
-
"lib"
|
|
34
|
-
];
|
|
35
|
-
var scripts = {
|
|
36
|
-
"build:package": "tsdown",
|
|
37
|
-
"build": "pnpm gen-presets && pnpm build:package",
|
|
38
|
-
"build:prepare": "pnpm watch",
|
|
39
|
-
"typecheck": "tsc --noEmit",
|
|
40
|
-
"watch": "pnpm gen-presets && tsdown --watch",
|
|
41
|
-
"dev:k6": "k6 run ./__tests__/k6.js",
|
|
42
|
-
"test": "vitest",
|
|
43
|
-
"test:coverage": "vitest run --coverage.enabled true",
|
|
44
|
-
"lint": "eslint .",
|
|
45
|
-
"lint:fix": "eslint . --fix",
|
|
46
|
-
"silgi": "tsx cli/index.ts",
|
|
47
|
-
"release": "pnpm gen-presets && pnpm tsdown && pnpm publish --no-git-checks --access public",
|
|
48
|
-
"release:beta": "pnpm release --tag beta",
|
|
49
|
-
"generate": "pnpm --filter './examples/**' silgi:prepare",
|
|
50
|
-
"gen-presets": "pnpm jiti scripts/gen-presets.ts",
|
|
51
|
-
"all:delete": "find . -type d \\( -name \"node_modules\" -o -name \"dist\" \\) -prune -exec rm -rf {} +"
|
|
52
|
-
};
|
|
53
|
-
var peerDependencies = {
|
|
54
|
-
"@fastify/deepmerge": ">=3.0.0",
|
|
55
|
-
"@nuxt/kit": ">=3.16.1",
|
|
56
|
-
"@nuxt/schema": ">=3.16.1",
|
|
57
|
-
"@silgi/ecosystem": ">=0.4.4",
|
|
58
|
-
"h3": ">=1.15.1",
|
|
59
|
-
"nitropack": ">=2.11.7",
|
|
60
|
-
"nuxt": ">=3.16.1",
|
|
61
|
-
"typescript": ">=5.8.2",
|
|
62
|
-
"vue": ">=3.5.13",
|
|
63
|
-
"zod": ">=3.24.2"
|
|
64
|
-
};
|
|
65
|
-
var peerDependenciesMeta = {
|
|
66
|
-
"@nuxt/kit": { "optional": true },
|
|
67
|
-
"@nuxt/schema": { "optional": true },
|
|
68
|
-
"h3": { "optional": true },
|
|
69
|
-
"nitropack": { "optional": true },
|
|
70
|
-
"nuxt": { "optional": true },
|
|
71
|
-
"vue": { "optional": true },
|
|
72
|
-
"zod": { "optional": true }
|
|
73
|
-
};
|
|
74
|
-
var dependencies = {
|
|
75
|
-
"@antfu/ni": "^25.0.0",
|
|
76
|
-
"@clack/prompts": "catalog:",
|
|
77
|
-
"@fastify/deepmerge": "catalog:",
|
|
78
|
-
"@graphql-tools/utils": "^10.8.6",
|
|
79
|
-
"@standard-community/standard-json": "^0.2.0",
|
|
80
|
-
"apiful": "^3.4.0",
|
|
81
|
-
"c12": "catalog:",
|
|
82
|
-
"chokidar": "catalog:",
|
|
83
|
-
"citty": "catalog:",
|
|
84
|
-
"compatx": "catalog:",
|
|
85
|
-
"consola": "catalog:",
|
|
86
|
-
"crossws": "^0.4.1",
|
|
87
|
-
"defu": "catalog:",
|
|
88
|
-
"destr": "catalog:",
|
|
89
|
-
"dev-jiti": "catalog:",
|
|
90
|
-
"dot-prop": "catalog:",
|
|
91
|
-
"dotenv": "catalog:",
|
|
92
|
-
"escape-string-regexp": "catalog:",
|
|
93
|
-
"execa": "^9.6.0",
|
|
94
|
-
"exsolve": "^1.0.7",
|
|
95
|
-
"graphql": "^16.11.0",
|
|
96
|
-
"hookable": "catalog:",
|
|
97
|
-
"ignore": "catalog:",
|
|
98
|
-
"klona": "catalog:",
|
|
99
|
-
"knitwork": "catalog:",
|
|
100
|
-
"magicast": "^0.3.5",
|
|
101
|
-
"micromatch": "^4.0.8",
|
|
102
|
-
"mlly": "catalog:",
|
|
103
|
-
"ofetch": "catalog:",
|
|
104
|
-
"ohash": "catalog:",
|
|
105
|
-
"oxc-parser": "^0.75.1",
|
|
106
|
-
"pathe": "catalog:",
|
|
107
|
-
"perfect-debounce": "^1.0.0",
|
|
108
|
-
"picocolors": "catalog:",
|
|
109
|
-
"pkg-types": "catalog:",
|
|
110
|
-
"rfc6902": "^5.1.2",
|
|
111
|
-
"rou3": "^0.7.3",
|
|
112
|
-
"scule": "catalog:",
|
|
113
|
-
"semver": "catalog:",
|
|
114
|
-
"srvx": "^0.8.2",
|
|
115
|
-
"std-env": "catalog:",
|
|
116
|
-
"tinyglobby": "^0.2.14",
|
|
117
|
-
"ufo": "catalog:",
|
|
118
|
-
"unadapter": "^0.1.2",
|
|
119
|
-
"unctx": "catalog:",
|
|
120
|
-
"unimport": "catalog:",
|
|
121
|
-
"unstorage": "catalog:",
|
|
122
|
-
"untyped": "catalog:"
|
|
123
|
-
};
|
|
124
|
-
var devDependencies = {
|
|
125
|
-
"@antfu/eslint-config": "catalog:",
|
|
126
|
-
"@nuxt/kit": "catalog:",
|
|
127
|
-
"@nuxt/schema": "catalog:",
|
|
128
|
-
"@silgi/ecosystem": "catalog:",
|
|
129
|
-
"@types/micromatch": "^4.0.9",
|
|
130
|
-
"@types/node": "catalog:",
|
|
131
|
-
"@types/semver": "catalog:",
|
|
132
|
-
"@vitest/coverage-v8": "catalog:",
|
|
133
|
-
"eslint": "catalog:",
|
|
134
|
-
"h3": "catalog:",
|
|
135
|
-
"nitropack": "catalog:",
|
|
136
|
-
"nuxt": "catalog:",
|
|
137
|
-
"tsdown": "^0.12.9",
|
|
138
|
-
"typescript": "catalog:",
|
|
139
|
-
"vitest": "catalog:",
|
|
140
|
-
"vue": "catalog:",
|
|
141
|
-
"zod": "catalog:"
|
|
142
|
-
};
|
|
143
|
-
var pnpm = {
|
|
144
|
-
"onlyBuiltDependencies": [
|
|
145
|
-
"@parcel/watcher",
|
|
146
|
-
"esbuild",
|
|
147
|
-
"vue-demi"
|
|
148
|
-
],
|
|
149
|
-
"overrides": { "silgi": "link:." }
|
|
150
|
-
};
|
|
151
|
-
var resolutions = { "silgi": "link:." };
|
|
152
|
-
var publishConfig = { "access": "public" };
|
|
153
|
-
var package_default = {
|
|
154
|
-
name,
|
|
155
|
-
type,
|
|
156
|
-
version,
|
|
157
|
-
private: private$1,
|
|
158
|
-
packageManager,
|
|
159
|
-
sideEffects,
|
|
160
|
-
exports,
|
|
161
|
-
main,
|
|
162
|
-
types,
|
|
163
|
-
bin,
|
|
164
|
-
files,
|
|
165
|
-
scripts,
|
|
166
|
-
peerDependencies,
|
|
167
|
-
peerDependenciesMeta,
|
|
168
|
-
dependencies,
|
|
169
|
-
devDependencies,
|
|
170
|
-
pnpm,
|
|
171
|
-
resolutions,
|
|
172
|
-
publishConfig
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
//#endregion
|
|
176
|
-
export { package_default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import preset_default from "./h3/preset.mjs";
|
|
2
|
-
import preset_default$1 from "./hono/preset.mjs";
|
|
3
|
-
import preset_default$2 from "./nitro/preset.mjs";
|
|
4
|
-
import preset_default$3 from "./npmpackage/preset.mjs";
|
|
5
|
-
import preset_default$4 from "./nuxt/preset.mjs";
|
|
6
|
-
|
|
7
|
-
//#region src/presets/_all.gen.ts
|
|
8
|
-
const presets = [
|
|
9
|
-
...preset_default,
|
|
10
|
-
...preset_default$1,
|
|
11
|
-
...preset_default$2,
|
|
12
|
-
...preset_default$3,
|
|
13
|
-
...preset_default$4
|
|
14
|
-
];
|
|
15
|
-
var _all_gen_default = presets;
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export { _all_gen_default as default };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CompatibilityDateSpec } from "compatx";
|
|
2
|
-
import { SilgiPreset, SilgiPresetMeta } from "silgi/types";
|
|
3
|
-
|
|
4
|
-
//#region src/presets/_resolve.d.ts
|
|
5
|
-
declare function resolvePreset(name: string, opts: {
|
|
6
|
-
static?: boolean;
|
|
7
|
-
compatibilityDate?: false | CompatibilityDateSpec;
|
|
8
|
-
}): Promise<(SilgiPreset & {
|
|
9
|
-
_meta?: SilgiPresetMeta;
|
|
10
|
-
}) | undefined>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { resolvePreset };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import _all_gen_default from "./_all.gen.mjs";
|
|
2
|
-
import { formatCompatibilityDate, resolveCompatibilityDatesFromEnv } from "compatx";
|
|
3
|
-
import { provider } from "std-env";
|
|
4
|
-
import { kebabCase } from "scule";
|
|
5
|
-
|
|
6
|
-
//#region src/presets/_resolve.ts
|
|
7
|
-
const _stdProviderMap = {
|
|
8
|
-
aws_amplify: "aws",
|
|
9
|
-
azure_static: "azure",
|
|
10
|
-
cloudflare_pages: "cloudflare"
|
|
11
|
-
};
|
|
12
|
-
function hasMetaProperty(preset) {
|
|
13
|
-
return typeof preset !== "function" && preset._meta !== void 0;
|
|
14
|
-
}
|
|
15
|
-
async function resolvePreset(name, opts) {
|
|
16
|
-
const _name = kebabCase(name) || provider;
|
|
17
|
-
const _compatDates = opts.compatibilityDate ? resolveCompatibilityDatesFromEnv(opts.compatibilityDate) : false;
|
|
18
|
-
const matches = _all_gen_default.filter((preset$1) => {
|
|
19
|
-
if (!hasMetaProperty(preset$1)) return false;
|
|
20
|
-
const names = [
|
|
21
|
-
preset$1._meta.name,
|
|
22
|
-
preset$1._meta.stdName,
|
|
23
|
-
...preset$1._meta.aliases || []
|
|
24
|
-
].filter(Boolean);
|
|
25
|
-
if (!names.includes(_name)) return false;
|
|
26
|
-
if (_compatDates) {
|
|
27
|
-
const _date = _compatDates[_stdProviderMap[preset$1._meta.stdName]] || _compatDates[preset$1._meta.stdName] || _compatDates[preset$1._meta.name] || _compatDates.default;
|
|
28
|
-
if (_date && preset$1._meta.compatibilityDate && new Date(preset$1._meta.compatibilityDate) > new Date(_date)) return false;
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
}).sort((a, b) => {
|
|
32
|
-
if (!hasMetaProperty(a) || !hasMetaProperty(b)) return 0;
|
|
33
|
-
const aDate = new Date(a._meta.compatibilityDate || 0);
|
|
34
|
-
const bDate = new Date(b._meta.compatibilityDate || 0);
|
|
35
|
-
return bDate > aDate ? 1 : -1;
|
|
36
|
-
});
|
|
37
|
-
const preset = matches.find((p) => hasMetaProperty(p) && (p._meta.static || false) === (opts?.static || false)) || matches[0];
|
|
38
|
-
if (typeof preset === "function") return preset();
|
|
39
|
-
if (!name && !preset) return opts?.static ? resolvePreset("static", opts) : resolvePreset("node-server", opts);
|
|
40
|
-
if (name && !preset) {
|
|
41
|
-
const options = _all_gen_default.filter((p) => hasMetaProperty(p) && (p._meta.name === name || p._meta.stdName === name || p._meta.aliases?.includes(name))).sort((a, b) => {
|
|
42
|
-
if (!hasMetaProperty(a) || !hasMetaProperty(b)) return 0;
|
|
43
|
-
return (a._meta.compatibilityDate || 0) > (b._meta.compatibilityDate || 0) ? 1 : -1;
|
|
44
|
-
});
|
|
45
|
-
if (options.length > 0) {
|
|
46
|
-
let msg = `Preset "${name}" cannot be resolved with current compatibilityDate: ${formatCompatibilityDate(_compatDates || "")}.\n\n`;
|
|
47
|
-
for (const option of options) if (hasMetaProperty(option)) msg += `\n- ${option._meta.name} (requires compatibilityDate >= ${option._meta.compatibilityDate})`;
|
|
48
|
-
const err = new Error(msg);
|
|
49
|
-
Error.captureStackTrace?.(err, resolvePreset);
|
|
50
|
-
throw err;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return preset;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
export { resolvePreset };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region src/presets/_types.gen.d.ts
|
|
2
|
-
// Auto-generated using gen-presets script
|
|
3
|
-
interface PresetOptions {}
|
|
4
|
-
declare const presetsWithConfig: readonly [];
|
|
5
|
-
type PresetName = "h3" | "hono" | "nitro" | "npm-package" | "nuxt";
|
|
6
|
-
type PresetNameInput = "h3" | "hono" | "nitro" | "npm-package" | "nuxt";
|
|
7
|
-
//#endregion
|
|
8
|
-
export { PresetName, PresetNameInput, PresetOptions, presetsWithConfig };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { addNPMPackage, defineSilgiPreset } from "silgi/kit";
|
|
2
|
-
|
|
3
|
-
//#region src/presets/h3/preset.ts
|
|
4
|
-
const h3 = defineSilgiPreset({
|
|
5
|
-
static: true,
|
|
6
|
-
output: {
|
|
7
|
-
dir: "{{ rootDir }}/.output",
|
|
8
|
-
publicDir: "{{ output.dir }}/public"
|
|
9
|
-
},
|
|
10
|
-
prerender: { crawlLinks: true },
|
|
11
|
-
hooks: { ready: async () => {
|
|
12
|
-
await addNPMPackage({
|
|
13
|
-
name: "h3",
|
|
14
|
-
isDev: true
|
|
15
|
-
});
|
|
16
|
-
} },
|
|
17
|
-
imports: { dirs: [
|
|
18
|
-
"!{{ serverDir }}/runtime/**",
|
|
19
|
-
"!{{ serverDir }}/api/**",
|
|
20
|
-
"!{{ serverDir }}/routes/**",
|
|
21
|
-
"!{{ serverDir }}/modules/**",
|
|
22
|
-
"!{{ serverDir }}/assets/**",
|
|
23
|
-
"!{{ serverDir }}/public/**",
|
|
24
|
-
"!{{ silgi.serverDir }}/**"
|
|
25
|
-
] }
|
|
26
|
-
}, {
|
|
27
|
-
name: "h3",
|
|
28
|
-
static: true,
|
|
29
|
-
url: import.meta.url
|
|
30
|
-
});
|
|
31
|
-
const presets = [h3];
|
|
32
|
-
var preset_default = presets;
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
export { preset_default as default };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineSilgiPreset } from "silgi/kit";
|
|
2
|
-
|
|
3
|
-
//#region src/presets/hono/preset.ts
|
|
4
|
-
const hono = defineSilgiPreset({
|
|
5
|
-
serverDir: "{{ rootDir }}/src/server",
|
|
6
|
-
envOptions: {
|
|
7
|
-
prefix: "HONO_",
|
|
8
|
-
altPrefix: "SILGI_"
|
|
9
|
-
},
|
|
10
|
-
imports: { dirs: [
|
|
11
|
-
"!{{ serverDir }}/runtime/**",
|
|
12
|
-
"!{{ serverDir }}/api/**",
|
|
13
|
-
"!{{ serverDir }}/routes/**",
|
|
14
|
-
"!{{ serverDir }}/modules/**",
|
|
15
|
-
"!{{ serverDir }}/assets/**",
|
|
16
|
-
"!{{ serverDir }}/public/**",
|
|
17
|
-
"!{{ silgi.serverDir }}/**"
|
|
18
|
-
] },
|
|
19
|
-
hooks: { ready: async () => {} },
|
|
20
|
-
storages: []
|
|
21
|
-
}, {
|
|
22
|
-
name: "hono",
|
|
23
|
-
static: true,
|
|
24
|
-
url: import.meta.url
|
|
25
|
-
});
|
|
26
|
-
const presets = [hono];
|
|
27
|
-
var preset_default = presets;
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { preset_default as default };
|
package/dist/presets/index.d.mts
DELETED