veryfront 0.1.128 → 0.1.130
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/esm/cli/commands/config/command-help.d.ts +3 -0
- package/esm/cli/commands/config/command-help.d.ts.map +1 -0
- package/esm/cli/commands/config/command-help.js +13 -0
- package/esm/cli/commands/config/handler.d.ts +5 -0
- package/esm/cli/commands/config/handler.d.ts.map +1 -0
- package/esm/cli/commands/config/handler.js +70 -0
- package/esm/cli/commands/open/command-help.d.ts +3 -0
- package/esm/cli/commands/open/command-help.d.ts.map +1 -0
- package/esm/cli/commands/open/command-help.js +17 -0
- package/esm/cli/commands/open/command.d.ts +14 -0
- package/esm/cli/commands/open/command.d.ts.map +1 -0
- package/esm/cli/commands/open/command.js +22 -0
- package/esm/cli/commands/open/handler.d.ts +3 -0
- package/esm/cli/commands/open/handler.d.ts.map +1 -0
- package/esm/cli/commands/open/handler.js +29 -0
- package/esm/cli/help/command-definitions.d.ts.map +1 -1
- package/esm/cli/help/command-definitions.js +4 -0
- package/esm/cli/router.d.ts +0 -5
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +34 -2
- package/esm/cli/shared/update-check.d.ts +4 -0
- package/esm/cli/shared/update-check.d.ts.map +1 -0
- package/esm/cli/shared/update-check.js +97 -0
- package/esm/deno.d.ts +5 -0
- package/esm/deno.js +13 -8
- package/esm/src/channels/control-plane.d.ts.map +1 -1
- package/esm/src/channels/control-plane.js +5 -5
- package/esm/src/channels/invoke.d.ts +1 -1
- package/esm/src/channels/invoke.d.ts.map +1 -1
- package/esm/src/channels/invoke.js +6 -6
- package/esm/src/chat/index.d.ts +12 -24
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +5 -25
- package/esm/src/config/env.d.ts.map +1 -1
- package/esm/src/config/env.js +18 -10
- package/esm/src/data/static-data-fetcher.d.ts +3 -0
- package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/static-data-fetcher.js +29 -25
- package/esm/src/data/static-paths-fetcher.d.ts.map +1 -1
- package/esm/src/data/static-paths-fetcher.js +3 -2
- package/esm/src/errors/logging.d.ts.map +1 -1
- package/esm/src/errors/logging.js +16 -7
- package/esm/src/errors/user-friendly/error-formatter.d.ts.map +1 -1
- package/esm/src/errors/user-friendly/error-formatter.js +9 -25
- package/esm/src/fs/index.d.ts +11 -12
- package/esm/src/fs/index.d.ts.map +1 -1
- package/esm/src/fs/index.js +11 -24
- package/esm/src/html/dev-scripts.d.ts.map +1 -1
- package/esm/src/html/dev-scripts.js +5 -8
- package/esm/src/html/html-escape.d.ts +1 -0
- package/esm/src/html/html-escape.d.ts.map +1 -1
- package/esm/src/html/html-escape.js +3 -0
- package/esm/src/html/html-injection.js +2 -2
- package/esm/src/html/html-shell-generator.d.ts +5 -2
- package/esm/src/html/html-shell-generator.d.ts.map +1 -1
- package/esm/src/html/html-shell-generator.js +41 -30
- package/esm/src/html/hydration-script-builder/dev-client-renderer.js +2 -2
- package/esm/src/html/hydration-script-builder/dev-component-manifest.js +2 -2
- package/esm/src/html/hydration-script-builder/dev-error-logger.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/dev-error-logger.js +2 -6
- package/esm/src/html/hydration-script-builder/dev-scripts.js +2 -2
- package/esm/src/html/hydration-script-builder/hydration-data-generator.d.ts +3 -1
- package/esm/src/html/hydration-script-builder/hydration-data-generator.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/hydration-data-generator.js +2 -2
- package/esm/src/html/hydration-script-builder/index.d.ts +1 -1
- package/esm/src/html/hydration-script-builder/index.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/index.js +1 -1
- package/esm/src/html/hydration-script-builder/prod-hydration.js +2 -2
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts +2 -0
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/prod-scripts.js +14 -14
- package/esm/src/html/schemas/html.schema.d.ts +2 -0
- package/esm/src/html/schemas/html.schema.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.js +2 -0
- package/esm/src/html/styles-builder/css-pregeneration.d.ts +17 -1
- package/esm/src/html/styles-builder/css-pregeneration.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-pregeneration.js +103 -1
- package/esm/src/html/styles-builder/dev-styles.js +2 -2
- package/esm/src/html/utils.d.ts +2 -0
- package/esm/src/html/utils.d.ts.map +1 -1
- package/esm/src/html/utils.js +49 -28
- package/esm/src/integrations/remote-tools.d.ts.map +1 -1
- package/esm/src/integrations/remote-tools.js +32 -39
- package/esm/src/internal-agents/ag-ui-sse.d.ts +0 -1
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +2 -16
- package/esm/src/internal-agents/control-plane-auth.d.ts.map +1 -1
- package/esm/src/internal-agents/control-plane-auth.js +5 -3
- package/esm/src/internal-agents/request-body.d.ts.map +1 -1
- package/esm/src/internal-agents/request-body.js +6 -3
- package/esm/src/internal-agents/session-manager.d.ts +1 -0
- package/esm/src/internal-agents/session-manager.d.ts.map +1 -1
- package/esm/src/internal-agents/session-manager.js +12 -18
- package/esm/src/issues/core.d.ts.map +1 -1
- package/esm/src/issues/core.js +24 -23
- package/esm/src/issues/schemas/issue.schema.d.ts.map +1 -1
- package/esm/src/issues/schemas/issue.schema.js +2 -1
- package/esm/src/jobs/runtime-env.d.ts.map +1 -1
- package/esm/src/jobs/runtime-env.js +21 -44
- package/esm/src/markdown/index.d.ts +1 -2
- package/esm/src/markdown/index.d.ts.map +1 -1
- package/esm/src/markdown/index.js +1 -6
- package/esm/src/mcp/server.d.ts +0 -1
- package/esm/src/mcp/server.d.ts.map +1 -1
- package/esm/src/mcp/server.js +40 -41
- package/esm/src/mdx/index.d.ts +3 -2
- package/esm/src/mdx/index.d.ts.map +1 -1
- package/esm/src/mdx/index.js +3 -5
- package/esm/src/middleware/builtin/logger.d.ts.map +1 -1
- package/esm/src/middleware/builtin/logger.js +31 -28
- package/esm/src/middleware/builtin/security/rate-limit.d.ts.map +1 -1
- package/esm/src/middleware/builtin/security/rate-limit.js +17 -12
- package/esm/src/middleware/builtin/timeout.d.ts.map +1 -1
- package/esm/src/middleware/builtin/timeout.js +17 -10
- package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.js +4 -3
- package/esm/src/oauth/handlers/callback-handler.d.ts +0 -5
- package/esm/src/oauth/handlers/callback-handler.d.ts.map +1 -1
- package/esm/src/oauth/handlers/callback-handler.js +9 -14
- package/esm/src/oauth/handlers/index.d.ts +1 -1
- package/esm/src/oauth/handlers/index.js +1 -1
- package/esm/src/oauth/handlers/init-handler.d.ts.map +1 -1
- package/esm/src/oauth/handlers/init-handler.js +32 -20
- package/esm/src/oauth/providers/index.d.ts +1 -1
- package/esm/src/oauth/providers/index.js +1 -1
- package/esm/src/oauth/schemas/index.d.ts +1 -1
- package/esm/src/oauth/schemas/index.js +1 -1
- package/esm/src/oauth/token-store/index.d.ts +1 -1
- package/esm/src/oauth/token-store/index.js +1 -1
- package/esm/src/oauth/token-store/memory.d.ts +1 -1
- package/esm/src/oauth/token-store/memory.d.ts.map +1 -1
- package/esm/src/oauth/token-store/memory.js +8 -8
- package/esm/src/observability/request-profiler.d.ts +31 -0
- package/esm/src/observability/request-profiler.d.ts.map +1 -0
- package/esm/src/observability/request-profiler.js +94 -0
- package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -1
- package/esm/src/observability/tracing/otlp-setup.js +16 -21
- package/esm/src/platform/compat/framework-source-resolver.d.ts +8 -0
- package/esm/src/platform/compat/framework-source-resolver.d.ts.map +1 -1
- package/esm/src/platform/compat/framework-source-resolver.js +77 -1
- package/esm/src/prompt/factory.d.ts.map +1 -1
- package/esm/src/prompt/factory.js +10 -12
- package/esm/src/prompt/registry.d.ts.map +1 -1
- package/esm/src/prompt/registry.js +12 -10
- package/esm/src/prompt/schemas/prompt.schema.d.ts.map +1 -1
- package/esm/src/prompt/schemas/prompt.schema.js +0 -2
- package/esm/src/prompt/types.d.ts +1 -1
- package/esm/src/prompt/types.d.ts.map +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.js +3 -8
- package/esm/src/provider/local/env.d.ts +4 -6
- package/esm/src/provider/local/env.d.ts.map +1 -1
- package/esm/src/provider/local/env.js +14 -1
- package/esm/src/provider/local/local-engine.d.ts.map +1 -1
- package/esm/src/provider/local/local-engine.js +2 -7
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +2 -7
- package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.js +1 -7
- package/esm/src/provider/veryfront-cloud/shared.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/shared.js +9 -11
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +56 -57
- package/esm/src/react/compat/hooks-adapter.d.ts +1 -7
- package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
- package/esm/src/react/compat/hooks-adapter.js +35 -40
- package/esm/src/react/components/Head.d.ts +1 -26
- package/esm/src/react/components/Head.d.ts.map +1 -1
- package/esm/src/react/components/Head.js +1 -172
- package/esm/src/react/context/index.d.ts +2 -46
- package/esm/src/react/context/index.d.ts.map +1 -1
- package/esm/src/react/context/index.js +1 -44
- package/esm/src/react/head-collector.d.ts +1 -10
- package/esm/src/react/head-collector.d.ts.map +1 -1
- package/esm/src/react/head-collector.js +4 -0
- package/esm/src/react/router/index.d.ts +2 -45
- package/esm/src/react/router/index.d.ts.map +1 -1
- package/esm/src/react/router/index.js +1 -49
- package/esm/src/react/runtime/core.d.ts +49 -0
- package/esm/src/react/runtime/core.d.ts.map +1 -0
- package/esm/src/react/runtime/core.js +200 -0
- package/esm/src/rendering/orchestrator/html.d.ts +2 -0
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +69 -12
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/ssr-orchestrator.js +4 -0
- package/esm/src/rendering/orchestrator/types.d.ts +4 -0
- package/esm/src/rendering/orchestrator/types.d.ts.map +1 -1
- package/esm/src/repositories/types.d.ts.map +1 -1
- package/esm/src/resource/factory.d.ts.map +1 -1
- package/esm/src/resource/factory.js +12 -9
- package/esm/src/resource/registry.d.ts +3 -3
- package/esm/src/resource/registry.d.ts.map +1 -1
- package/esm/src/resource/registry.js +7 -7
- package/esm/src/schemas/common.d.ts.map +1 -1
- package/esm/src/schemas/common.js +7 -4
- package/esm/src/security/http/config.d.ts +0 -1
- package/esm/src/security/http/config.d.ts.map +1 -1
- package/esm/src/security/http/config.js +3 -16
- package/esm/src/security/http/response/security-handler.d.ts +1 -0
- package/esm/src/security/http/response/security-handler.d.ts.map +1 -1
- package/esm/src/security/http/response/security-handler.js +17 -12
- package/esm/src/security/index.d.ts +4 -2
- package/esm/src/security/index.d.ts.map +1 -1
- package/esm/src/security/index.js +3 -1
- package/esm/src/server/handlers/dev/styles-css.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/styles-css.handler.js +8 -7
- package/esm/src/server/handlers/monitoring/metrics.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/metrics.handler.js +3 -1
- package/esm/src/server/handlers/request/module/module-server-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/module/module-server-handler.js +18 -15
- package/esm/src/server/handlers/request/prod-hydration-module.handler.d.ts +8 -0
- package/esm/src/server/handlers/request/prod-hydration-module.handler.d.ts.map +1 -0
- package/esm/src/server/handlers/request/prod-hydration-module.handler.js +41 -0
- package/esm/src/server/handlers/request/ssr/ssr.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/ssr.handler.js +3 -0
- package/esm/src/server/production-server.d.ts.map +1 -1
- package/esm/src/server/production-server.js +65 -0
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts +1 -1
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.d.ts +1 -1
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +36 -11
- package/esm/src/server/runtime-handler/request-utils.d.ts +7 -0
- package/esm/src/server/runtime-handler/request-utils.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-utils.js +10 -0
- package/esm/src/server/services/rendering/ssr.service.d.ts +1 -0
- package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
- package/esm/src/server/services/rendering/ssr.service.js +12 -5
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +1 -1
- package/esm/src/skill/allowed-tools.d.ts +3 -8
- package/esm/src/skill/allowed-tools.d.ts.map +1 -1
- package/esm/src/skill/executor.js +2 -2
- package/esm/src/skill/parser.d.ts.map +1 -1
- package/esm/src/skill/parser.js +12 -12
- package/esm/src/skill/path-safety.js +1 -1
- package/esm/src/skill/tools.d.ts.map +1 -1
- package/esm/src/skill/tools.js +18 -11
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
- package/esm/src/task/discovery.d.ts.map +1 -1
- package/esm/src/task/discovery.js +73 -95
- package/esm/src/tool/executor.d.ts.map +1 -1
- package/esm/src/tool/executor.js +8 -7
- package/esm/src/tool/factory.d.ts.map +1 -1
- package/esm/src/tool/factory.js +13 -16
- package/esm/src/transforms/esm/import-parser.d.ts.map +1 -1
- package/esm/src/transforms/esm/import-parser.js +6 -0
- package/esm/src/transforms/esm/package-registry.d.ts +4 -0
- package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
- package/esm/src/transforms/esm/package-registry.js +34 -17
- package/esm/src/transforms/import-rewriter/strategies/veryfront-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/veryfront-strategy.js +2 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +26 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.js +3 -0
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.d.ts +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.js +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.d.ts +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.js +10 -66
- package/esm/src/transforms/veryfront-module-urls.d.ts.map +1 -1
- package/esm/src/transforms/veryfront-module-urls.js +7 -3
- package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
- package/esm/src/types/entities/getEntityInfo.js +79 -127
- package/esm/src/utils/path-utils.d.ts +1 -1
- package/esm/src/utils/path-utils.d.ts.map +1 -1
- package/esm/src/utils/path-utils.js +16 -7
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/utils/version.d.ts.map +1 -1
- package/esm/src/utils/version.js +0 -1
- package/esm/src/workflow/worker/dynamic-job-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/dynamic-job-entrypoint.js +5 -72
- package/esm/src/workflow/worker/job-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/job-entrypoint.js +5 -72
- package/esm/src/workflow/worker/shared.d.ts +18 -0
- package/esm/src/workflow/worker/shared.d.ts.map +1 -0
- package/esm/src/workflow/worker/shared.js +77 -0
- package/package.json +1 -1
- package/src/cli/commands/config/command-help.ts +15 -0
- package/src/cli/commands/config/handler.ts +90 -0
- package/src/cli/commands/open/command-help.ts +19 -0
- package/src/cli/commands/open/command.ts +28 -0
- package/src/cli/commands/open/handler.ts +38 -0
- package/src/cli/help/command-definitions.ts +4 -0
- package/src/cli/router.ts +45 -2
- package/src/cli/shared/update-check.ts +110 -0
- package/src/deno.js +13 -8
- package/src/src/channels/control-plane.ts +6 -10
- package/src/src/channels/invoke.ts +7 -7
- package/src/src/chat/index.ts +96 -132
- package/src/src/config/env.ts +24 -11
- package/src/src/data/static-data-fetcher.ts +59 -34
- package/src/src/data/static-paths-fetcher.ts +4 -2
- package/src/src/errors/logging.ts +21 -7
- package/src/src/errors/user-friendly/error-formatter.ts +14 -29
- package/src/src/fs/index.ts +21 -30
- package/src/src/html/dev-scripts.ts +5 -9
- package/src/src/html/html-escape.ts +4 -0
- package/src/src/html/html-injection.ts +2 -2
- package/src/src/html/html-shell-generator.ts +60 -26
- package/src/src/html/hydration-script-builder/dev-client-renderer.ts +2 -2
- package/src/src/html/hydration-script-builder/dev-component-manifest.ts +2 -2
- package/src/src/html/hydration-script-builder/dev-error-logger.ts +2 -8
- package/src/src/html/hydration-script-builder/dev-scripts.ts +2 -2
- package/src/src/html/hydration-script-builder/hydration-data-generator.ts +2 -1
- package/src/src/html/hydration-script-builder/index.ts +5 -1
- package/src/src/html/hydration-script-builder/prod-hydration.ts +2 -2
- package/src/src/html/hydration-script-builder/prod-scripts.ts +16 -15
- package/src/src/html/schemas/html.schema.ts +2 -0
- package/src/src/html/styles-builder/css-pregeneration.ts +133 -1
- package/src/src/html/styles-builder/dev-styles.ts +2 -2
- package/src/src/html/utils.ts +62 -29
- package/src/src/integrations/remote-tools.ts +39 -37
- package/src/src/internal-agents/ag-ui-sse.ts +2 -17
- package/src/src/internal-agents/control-plane-auth.ts +8 -6
- package/src/src/internal-agents/request-body.ts +7 -5
- package/src/src/internal-agents/session-manager.ts +16 -20
- package/src/src/issues/core.ts +24 -27
- package/src/src/issues/schemas/issue.schema.ts +3 -1
- package/src/src/jobs/runtime-env.ts +24 -50
- package/src/src/markdown/index.ts +5 -8
- package/src/src/mcp/server.ts +50 -53
- package/src/src/mdx/index.ts +7 -8
- package/src/src/middleware/builtin/logger.ts +44 -29
- package/src/src/middleware/builtin/security/rate-limit.ts +20 -11
- package/src/src/middleware/builtin/timeout.ts +22 -13
- package/src/src/modules/import-map/default-import-map.ts +4 -3
- package/src/src/oauth/handlers/callback-handler.ts +9 -16
- package/src/src/oauth/handlers/index.ts +1 -1
- package/src/src/oauth/handlers/init-handler.ts +56 -27
- package/src/src/oauth/providers/index.ts +1 -1
- package/src/src/oauth/schemas/index.ts +1 -1
- package/src/src/oauth/token-store/index.ts +1 -1
- package/src/src/oauth/token-store/memory.ts +8 -8
- package/src/src/observability/request-profiler.ts +140 -0
- package/src/src/observability/tracing/otlp-setup.ts +16 -22
- package/src/src/platform/compat/framework-source-resolver.ts +101 -1
- package/src/src/prompt/factory.ts +16 -14
- package/src/src/prompt/registry.ts +14 -13
- package/src/src/prompt/schemas/prompt.schema.ts +0 -4
- package/src/src/prompt/types.ts +1 -2
- package/src/src/provider/local/ai-sdk-adapter.ts +3 -10
- package/src/src/provider/local/env.ts +22 -2
- package/src/src/provider/local/local-engine.ts +2 -9
- package/src/src/provider/model-registry.ts +2 -9
- package/src/src/provider/veryfront-cloud/provider.ts +1 -8
- package/src/src/provider/veryfront-cloud/shared.ts +12 -15
- package/src/src/proxy/handler.ts +90 -74
- package/src/src/react/compat/hooks-adapter.ts +43 -44
- package/src/src/react/components/Head.tsx +1 -181
- package/src/src/react/context/index.tsx +2 -83
- package/src/src/react/head-collector.ts +9 -0
- package/src/src/react/router/index.tsx +2 -100
- package/src/src/react/runtime/core.ts +303 -0
- package/src/src/rendering/orchestrator/html.ts +122 -18
- package/src/src/rendering/orchestrator/ssr-orchestrator.ts +8 -0
- package/src/src/rendering/orchestrator/types.ts +4 -0
- package/src/src/repositories/types.ts +0 -4
- package/src/src/resource/factory.ts +15 -11
- package/src/src/resource/registry.ts +7 -7
- package/src/src/schemas/common.ts +8 -5
- package/src/src/security/http/config.ts +3 -19
- package/src/src/security/http/response/security-handler.ts +22 -13
- package/src/src/security/index.ts +4 -7
- package/src/src/server/handlers/dev/styles-css.handler.ts +32 -14
- package/src/src/server/handlers/monitoring/metrics.handler.ts +3 -1
- package/src/src/server/handlers/request/module/module-server-handler.ts +24 -17
- package/src/src/server/handlers/request/prod-hydration-module.handler.ts +61 -0
- package/src/src/server/handlers/request/ssr/ssr.handler.ts +3 -0
- package/src/src/server/production-server.ts +84 -0
- package/src/src/server/runtime-handler/handler-context-builder.ts +1 -1
- package/src/src/server/runtime-handler/index.ts +44 -13
- package/src/src/server/runtime-handler/request-utils.ts +11 -0
- package/src/src/server/services/rendering/ssr.service.ts +31 -18
- package/src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts +1 -1
- package/src/src/skill/allowed-tools.ts +1 -8
- package/src/src/skill/executor.ts +2 -2
- package/src/src/skill/parser.ts +13 -20
- package/src/src/skill/path-safety.ts +1 -1
- package/src/src/skill/tools.ts +27 -20
- package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
- package/src/src/task/discovery.ts +97 -97
- package/src/src/tool/executor.ts +10 -8
- package/src/src/tool/factory.ts +21 -22
- package/src/src/tool/types.ts +0 -17
- package/src/src/transforms/esm/import-parser.ts +12 -0
- package/src/src/transforms/esm/package-registry.ts +52 -20
- package/src/src/transforms/import-rewriter/strategies/veryfront-strategy.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/cache-format.ts +34 -1
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +1 -1
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.ts +4 -0
- package/src/src/transforms/pipeline/stages/ssr-vf-modules/index.ts +1 -1
- package/src/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.ts +10 -69
- package/src/src/transforms/veryfront-module-urls.ts +6 -2
- package/src/src/types/entities/getEntityInfo.ts +131 -152
- package/src/src/utils/path-utils.ts +16 -7
- package/src/src/utils/version-constant.ts +1 -1
- package/src/src/utils/version.ts +0 -1
- package/src/src/workflow/worker/dynamic-job-entrypoint.ts +18 -84
- package/src/src/workflow/worker/job-entrypoint.ts +18 -85
- package/src/src/workflow/worker/shared.ts +127 -0
- package/esm/src/prompt/schemas/index.d.ts +0 -7
- package/esm/src/prompt/schemas/index.d.ts.map +0 -1
- package/esm/src/prompt/schemas/index.js +0 -6
- package/esm/src/security/http/handlers-index.d.ts +0 -5
- package/esm/src/security/http/handlers-index.d.ts.map +0 -1
- package/esm/src/security/http/handlers-index.js +0 -3
- package/src/src/prompt/schemas/index.ts +0 -7
- package/src/src/security/http/handlers-index.ts +0 -4
package/esm/src/chat/index.d.ts
CHANGED
|
@@ -48,29 +48,17 @@
|
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
50
|
import "../../_dnt.polyfills.js";
|
|
51
|
-
export { Chat, ChatComponents } from "../react/components/ai/chat.js";
|
|
52
|
-
export type
|
|
53
|
-
export {
|
|
54
|
-
export type
|
|
55
|
-
export {
|
|
56
|
-
export
|
|
57
|
-
export {
|
|
58
|
-
export type { AttachmentInfo, AttachmentPillProps, BranchPickerProps, ChatSidebarProps, ChatTab, ChatWithSidebarAttachmentConfig, ChatWithSidebarChatController, ChatWithSidebarFeatureConfig, ChatWithSidebarGroupedProps, ChatWithSidebarMessageConfig, ChatWithSidebarModelConfig, ChatWithSidebarProps, ChatWithSidebarQuickActionsConfig, ChatWithSidebarSidebarConfig, ChatWithSidebarTabsConfig, ChatWithSidebarVoiceConfig, CodeBlockProps, ConversationEmptyStateProps, ConversationScrollButtonProps, DropZoneOverlayProps, FeedbackValue, InferenceBadgeProps, InlineCitationProps, MessageActionsProps, MessageEditFormProps, MessageFeedbackProps, ModelOption, ModelSelectorProps, PartGroup, QuickAction, QuickActionsProps, SkillBadgeProps, Source, SourcesProps, StepIndicatorProps, SuggestionProps, SuggestionsProps, TabSwitcherProps, Thread, UpgradeCTAProps, UploadedFile, UploadsPanelProps, UseThreadsOptions, UseThreadsResult, } from "../react/components/ai/chat.js";
|
|
59
|
-
export { Message as StandaloneMessage, StreamingMessage, } from "../react/components/ai/message.js";
|
|
60
|
-
export type { MessageProps, StreamingMessageProps, } from "../react/components/ai/message.js";
|
|
61
|
-
export { AgentCard } from "../react/components/ai/agent-card.js";
|
|
62
|
-
export type { AgentCardProps } from "../react/components/ai/agent-card.js";
|
|
63
|
-
export { AIErrorBoundary, useAIErrorHandler, } from "../react/components/ai/error-boundary.js";
|
|
64
|
-
export type { AIErrorBoundaryProps } from "../react/components/ai/error-boundary.js";
|
|
51
|
+
export { Chat, ChatComponents, type ChatProps } from "../react/components/ai/chat.js";
|
|
52
|
+
export { ChatComposer, type ChatComposerProps, ChatEmpty, type ChatEmptyProps, ChatIf, type ChatIfProps, ChatMessageList, type ChatMessageListProps, ChatRoot, type ChatRootProps, ErrorBanner, type ErrorBannerProps, Message, type MessageRootProps, ModelAvatar, type ModelAvatarProps, } from "../react/components/ai/chat.js";
|
|
53
|
+
export { ChatContextProvider, type ChatContextValue, ComposerContextProvider, type ComposerContextValue, MessageContextProvider, type MessageContextValue, ThreadListContextProvider, type ThreadListContextValue, useChatContext, useChatContextOptional, useComposerContext, useComposerContextOptional, useMessageContext, useMessageContextOptional, useThreadListContext, useThreadListContextOptional, } from "../react/components/ai/chat.js";
|
|
54
|
+
export { type AttachmentInfo, AttachmentPill, type AttachmentPillProps, BranchPicker, type BranchPickerProps, ChatSidebar, type ChatSidebarProps, type ChatTab, ChatWithSidebar, type ChatWithSidebarAttachmentConfig, type ChatWithSidebarChatController, type ChatWithSidebarFeatureConfig, type ChatWithSidebarGroupedProps, type ChatWithSidebarMessageConfig, type ChatWithSidebarModelConfig, type ChatWithSidebarProps, type ChatWithSidebarQuickActionsConfig, type ChatWithSidebarSidebarConfig, type ChatWithSidebarTabsConfig, type ChatWithSidebarVoiceConfig, type CodeBlockProps, ConversationEmptyState, type ConversationEmptyStateProps, ConversationScrollButton, type ConversationScrollButtonProps, downloadMarkdown, DropZoneOverlay, type DropZoneOverlayProps, exportAsMarkdown, extractSourcesFromParts, FadeIn, type FeedbackValue, getTextContent, groupPartsInOrder, InferenceBadge, type InferenceBadgeProps, InlineCitation, type InlineCitationProps, isReasoningPart, isSkillToolPart, isToolPart, Loader, MessageActions, type MessageActionsProps, MessageEditForm, type MessageEditFormProps, MessageFeedback, type MessageFeedbackProps, type ModelOption, ModelSelector, type ModelSelectorProps, type PartGroup, type QuickAction, QuickActions, type QuickActionsProps, ReasoningCard, RichCodeBlock, Shimmer, SkillBadge, type SkillBadgeProps, type Source, Sources, type SourcesProps, StepIndicator, type StepIndicatorProps, Suggestion, type SuggestionProps, Suggestions, type SuggestionsProps, TabSwitcher, type TabSwitcherProps, type Thread, ToolCallCard, ToolStatusBadge, UpgradeCTA, type UpgradeCTAProps, type UploadedFile, UploadsPanel, type UploadsPanelProps, useThreads, type UseThreadsOptions, type UseThreadsResult, } from "../react/components/ai/chat.js";
|
|
55
|
+
export { Message as StandaloneMessage, type MessageProps, StreamingMessage, type StreamingMessageProps, } from "../react/components/ai/message.js";
|
|
56
|
+
export { AgentCard, type AgentCardProps } from "../react/components/ai/agent-card.js";
|
|
57
|
+
export { AIErrorBoundary, type AIErrorBoundaryProps, useAIErrorHandler, } from "../react/components/ai/error-boundary.js";
|
|
65
58
|
export type { AgentTheme, ChatTheme } from "../react/components/ai/theme.js";
|
|
66
|
-
export { useChat } from "../agent/react/use-chat/index.js";
|
|
67
|
-
export
|
|
68
|
-
export {
|
|
69
|
-
export type
|
|
70
|
-
export {
|
|
71
|
-
export type { UseCompletionOptions, UseCompletionResult, } from "../agent/react/use-completion.js";
|
|
72
|
-
export { useStreaming } from "../agent/react/use-streaming.js";
|
|
73
|
-
export type { UseStreamingOptions, UseStreamingResult, } from "../agent/react/use-streaming.js";
|
|
74
|
-
export { useVoiceInput } from "../agent/react/use-voice-input.js";
|
|
75
|
-
export type { UseVoiceInputOptions, UseVoiceInputResult, } from "../agent/react/use-voice-input.js";
|
|
59
|
+
export { type BranchInfo, type BrowserInferenceStatus, type DynamicToolUIPart, type InferenceMode, type OnToolCallArg, type ReasoningUIPart, type StepUIPart, type TextUIPart, type ToolOutput, type ToolResultUIPart, type ToolState, type ToolUIPart, type UIMessage, type UIMessagePart, useChat, type UseChatOptions, type UseChatResult, } from "../agent/react/use-chat/index.js";
|
|
60
|
+
export { useAgent, type UseAgentOptions, type UseAgentResult, } from "../agent/react/use-agent.js";
|
|
61
|
+
export { useCompletion, type UseCompletionOptions, type UseCompletionResult, } from "../agent/react/use-completion.js";
|
|
62
|
+
export { useStreaming, type UseStreamingOptions, type UseStreamingResult, } from "../agent/react/use-streaming.js";
|
|
63
|
+
export { useVoiceInput, type UseVoiceInputOptions, type UseVoiceInputResult, } from "../agent/react/use-voice-input.js";
|
|
76
64
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,SAAS,EACT,KAAK,cAAc,EACnB,MAAM,EACN,K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K,aAAa,GACnB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,mCAAmC,CAAC"}
|
package/esm/src/chat/index.js
CHANGED
|
@@ -47,36 +47,16 @@
|
|
|
47
47
|
* </Message.Root>
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
|
-
// veryfront/chat — Chat UI components + hooks
|
|
51
|
-
//
|
|
52
|
-
// Merges components/ai (UI) and agent/react (hooks) into a single
|
|
53
|
-
// product-oriented import path.
|
|
54
|
-
// ---------------------------------------------------------------------------
|
|
55
|
-
// Core preset + compound
|
|
56
|
-
// ---------------------------------------------------------------------------
|
|
57
50
|
import "../../_dnt.polyfills.js";
|
|
58
51
|
export { Chat, ChatComponents } from "../react/components/ai/chat.js";
|
|
59
|
-
// ---------------------------------------------------------------------------
|
|
60
|
-
// Composition building blocks
|
|
61
|
-
// ---------------------------------------------------------------------------
|
|
62
52
|
export { ChatComposer, ChatEmpty, ChatIf, ChatMessageList, ChatRoot, ErrorBanner, Message, ModelAvatar, } from "../react/components/ai/chat.js";
|
|
63
|
-
// ---------------------------------------------------------------------------
|
|
64
|
-
// Contexts
|
|
65
|
-
// ---------------------------------------------------------------------------
|
|
66
53
|
export { ChatContextProvider, ComposerContextProvider, MessageContextProvider, ThreadListContextProvider, useChatContext, useChatContextOptional, useComposerContext, useComposerContextOptional, useMessageContext, useMessageContextOptional, useThreadListContext, useThreadListContextOptional, } from "../react/components/ai/chat.js";
|
|
67
|
-
// ---------------------------------------------------------------------------
|
|
68
|
-
// Sub-components
|
|
69
|
-
// ---------------------------------------------------------------------------
|
|
70
54
|
export { AttachmentPill, BranchPicker, ChatSidebar, ChatWithSidebar, ConversationEmptyState, ConversationScrollButton, downloadMarkdown, DropZoneOverlay, exportAsMarkdown, extractSourcesFromParts, FadeIn, getTextContent, groupPartsInOrder, InferenceBadge, InlineCitation, isReasoningPart, isSkillToolPart, isToolPart, Loader, MessageActions, MessageEditForm, MessageFeedback, ModelSelector, QuickActions, ReasoningCard, RichCodeBlock, Shimmer, SkillBadge, Sources, StepIndicator, Suggestion, Suggestions, TabSwitcher, ToolCallCard, ToolStatusBadge, UpgradeCTA, UploadsPanel, useThreads, } from "../react/components/ai/chat.js";
|
|
71
|
-
// Message (standalone bubble, not the chat compound)
|
|
72
55
|
export { Message as StandaloneMessage, StreamingMessage, } from "../react/components/ai/message.js";
|
|
73
56
|
export { AgentCard } from "../react/components/ai/agent-card.js";
|
|
74
57
|
export { AIErrorBoundary, useAIErrorHandler, } from "../react/components/ai/error-boundary.js";
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
export {
|
|
80
|
-
export { useCompletion } from "../agent/react/use-completion.js";
|
|
81
|
-
export { useStreaming } from "../agent/react/use-streaming.js";
|
|
82
|
-
export { useVoiceInput } from "../agent/react/use-voice-input.js";
|
|
58
|
+
export { useChat, } from "../agent/react/use-chat/index.js";
|
|
59
|
+
export { useAgent, } from "../agent/react/use-agent.js";
|
|
60
|
+
export { useCompletion, } from "../agent/react/use-completion.js";
|
|
61
|
+
export { useStreaming, } from "../agent/react/use-streaming.js";
|
|
62
|
+
export { useVoiceInput, } from "../agent/react/use-voice-input.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/src/config/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAA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B,CAOA"}
|
package/esm/src/config/env.js
CHANGED
|
@@ -12,6 +12,18 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { getEnvironmentConfig } from "./environment-config.js";
|
|
14
14
|
import { getEnv } from "../platform/compat/process.js";
|
|
15
|
+
function toEnabledFlag(enabled, truthyValue) {
|
|
16
|
+
return enabled ? truthyValue : undefined;
|
|
17
|
+
}
|
|
18
|
+
function toCliBooleanFlag(enabled) {
|
|
19
|
+
return toEnabledFlag(enabled, "1");
|
|
20
|
+
}
|
|
21
|
+
function getBaseOtelConfig(env) {
|
|
22
|
+
return {
|
|
23
|
+
veryfrontFlag: toCliBooleanFlag(env.otelEnabled),
|
|
24
|
+
endpoint: env.otelEndpoint,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
15
27
|
export function getDisableLruIntervalEnv(env = getEnvironmentConfig()) {
|
|
16
28
|
return env.disableLruInterval;
|
|
17
29
|
}
|
|
@@ -69,10 +81,10 @@ export function isDenoTestingEnv(env = getEnvironmentConfig()) {
|
|
|
69
81
|
return env.denoTesting;
|
|
70
82
|
}
|
|
71
83
|
export function getNoColorEnv(env = getEnvironmentConfig()) {
|
|
72
|
-
return env.noColor
|
|
84
|
+
return toCliBooleanFlag(env.noColor);
|
|
73
85
|
}
|
|
74
86
|
export function getForceColorEnv(env = getEnvironmentConfig()) {
|
|
75
|
-
return env.forceColor
|
|
87
|
+
return toCliBooleanFlag(env.forceColor);
|
|
76
88
|
}
|
|
77
89
|
export function isRscExperimentalEnabled(env = getEnvironmentConfig()) {
|
|
78
90
|
return env.experimentalRsc;
|
|
@@ -84,13 +96,10 @@ export function getEnvironmentFromEnv(env = getEnvironmentConfig()) {
|
|
|
84
96
|
return env.veryfrontEnv || env.nodeEnv;
|
|
85
97
|
}
|
|
86
98
|
export function getOtelTracingConfig(env = getEnvironmentConfig()) {
|
|
87
|
-
const enabledFlag = env.otelEnabled ? "true" : undefined;
|
|
88
|
-
const veryfrontFlag = env.otelEnabled ? "1" : undefined;
|
|
89
99
|
return {
|
|
90
|
-
enabledFlag,
|
|
91
|
-
|
|
100
|
+
enabledFlag: toEnabledFlag(env.otelEnabled, "true"),
|
|
101
|
+
...getBaseOtelConfig(env),
|
|
92
102
|
serviceName: env.otelServiceName,
|
|
93
|
-
endpoint: env.otelEndpoint,
|
|
94
103
|
tracesEndpoint: env.otelTracesEndpoint,
|
|
95
104
|
exporter: env.otelTracesExporter,
|
|
96
105
|
headers: env.otelHeaders,
|
|
@@ -99,9 +108,8 @@ export function getOtelTracingConfig(env = getEnvironmentConfig()) {
|
|
|
99
108
|
}
|
|
100
109
|
export function getOtelMetricsConfig(env = getEnvironmentConfig()) {
|
|
101
110
|
return {
|
|
102
|
-
enabledFlag: env.otelMetricsEnabled
|
|
103
|
-
|
|
104
|
-
endpoint: env.otelEndpoint,
|
|
111
|
+
enabledFlag: toCliBooleanFlag(env.otelMetricsEnabled),
|
|
112
|
+
...getBaseOtelConfig(env),
|
|
105
113
|
metricsEndpoint: env.otelMetricsEndpoint,
|
|
106
114
|
exporter: env.otelMetricsExporter,
|
|
107
115
|
};
|
|
@@ -5,6 +5,9 @@ export declare class StaticDataFetcher {
|
|
|
5
5
|
private pendingRevalidations;
|
|
6
6
|
constructor(cacheManager: CacheManager);
|
|
7
7
|
fetch(pageModule: PageWithData, context: DataContext): Promise<DataResult>;
|
|
8
|
+
private createStaticDataContext;
|
|
9
|
+
private executeStaticData;
|
|
10
|
+
private storeCacheEntry;
|
|
8
11
|
private fetchFreshNoCache;
|
|
9
12
|
private fetchFresh;
|
|
10
13
|
private revalidateInBackground;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-data-fetcher.d.ts","sourceRoot":"","sources":["../../../src/src/data/static-data-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"static-data-fetcher.d.ts","sourceRoot":"","sources":["../../../src/src/data/static-data-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsDxE,qBAAa,iBAAiB;IAGhB,OAAO,CAAC,YAAY;IAFhC,OAAO,CAAC,oBAAoB,CAAoC;gBAE5C,YAAY,EAAE,YAAY;IAExC,KAAK,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IA4ChF,OAAO,CAAC,uBAAuB;IAM/B,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,eAAe;YAQT,iBAAiB;YA+BjB,UAAU;YAqEV,sBAAsB;IAoEpC;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CAIjB"}
|
|
@@ -34,7 +34,7 @@ function releaseRevalidationSlot(projectId) {
|
|
|
34
34
|
}
|
|
35
35
|
projectRevalidationCounts.set(projectId, current - 1);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function resolveProjectId(context, fallback) {
|
|
38
38
|
return context.request?.headers?.get("x-project-id") ?? context.url?.hostname ?? fallback;
|
|
39
39
|
}
|
|
40
40
|
export class StaticDataFetcher {
|
|
@@ -44,13 +44,14 @@ export class StaticDataFetcher {
|
|
|
44
44
|
this.cacheManager = cacheManager;
|
|
45
45
|
}
|
|
46
46
|
async fetch(pageModule, context) {
|
|
47
|
-
|
|
47
|
+
const getStaticData = pageModule.getStaticData;
|
|
48
|
+
if (typeof getStaticData !== "function")
|
|
48
49
|
return { props: {} };
|
|
49
50
|
const pathname = context.url?.pathname ?? "unknown";
|
|
50
51
|
const cacheKey = this.cacheManager.createCacheKey(context);
|
|
51
52
|
// No caching in preview mode (cacheKey is null)
|
|
52
53
|
if (!cacheKey) {
|
|
53
|
-
return withSpan("data.fetch_static", () => this.fetchFreshNoCache(
|
|
54
|
+
return withSpan("data.fetch_static", () => this.fetchFreshNoCache(getStaticData, context), {
|
|
54
55
|
"data.fetch_method": "getStaticData",
|
|
55
56
|
"data.pathname": pathname,
|
|
56
57
|
"data.cache": "disabled",
|
|
@@ -58,22 +59,35 @@ export class StaticDataFetcher {
|
|
|
58
59
|
}
|
|
59
60
|
const cached = await withSpan(SpanNames.DATA_CACHE_GET, () => Promise.resolve(this.cacheManager.get(cacheKey)), { "data.cache_key": cacheKey, "data.pathname": pathname });
|
|
60
61
|
if (!cached) {
|
|
61
|
-
return withSpan("data.fetch_static", () => this.fetchFresh(
|
|
62
|
+
return withSpan("data.fetch_static", () => this.fetchFresh(getStaticData, context, cacheKey), {
|
|
62
63
|
"data.fetch_method": "getStaticData",
|
|
63
64
|
"data.pathname": pathname,
|
|
64
65
|
"data.cache": "miss",
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
if (this.cacheManager.shouldRevalidate(cached) && !this.pendingRevalidations.has(cacheKey)) {
|
|
68
|
-
this.pendingRevalidations.set(cacheKey, this.revalidateInBackground(
|
|
69
|
+
this.pendingRevalidations.set(cacheKey, this.revalidateInBackground(getStaticData, context, cacheKey));
|
|
69
70
|
}
|
|
70
71
|
return cached.data;
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
+
createStaticDataContext(context) {
|
|
74
|
+
return { params: context.params, url: context.url };
|
|
75
|
+
}
|
|
76
|
+
executeStaticData(getStaticData, context, timeoutMs, label) {
|
|
77
|
+
return withTimeoutThrow(Promise.resolve(getStaticData(this.createStaticDataContext(context))), timeoutMs, label);
|
|
78
|
+
}
|
|
79
|
+
storeCacheEntry(cacheKey, result) {
|
|
80
|
+
this.cacheManager.set(cacheKey, {
|
|
81
|
+
data: result,
|
|
82
|
+
timestamp: Date.now(),
|
|
83
|
+
revalidate: result.revalidate,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async fetchFreshNoCache(getStaticData, context) {
|
|
73
87
|
const pathname = context.url?.pathname ?? "unknown";
|
|
74
88
|
const start = performance.now();
|
|
75
89
|
try {
|
|
76
|
-
return await
|
|
90
|
+
return await this.executeStaticData(getStaticData, context, DATA_FETCH_TIMEOUT_MS, `getStaticData for ${pathname}`);
|
|
77
91
|
}
|
|
78
92
|
catch (error) {
|
|
79
93
|
const durationMs = Math.round(performance.now() - start);
|
|
@@ -89,10 +103,10 @@ export class StaticDataFetcher {
|
|
|
89
103
|
throw error;
|
|
90
104
|
}
|
|
91
105
|
}
|
|
92
|
-
async fetchFresh(
|
|
106
|
+
async fetchFresh(getStaticData, context, cacheKey) {
|
|
93
107
|
const pathname = context.url?.pathname ?? "unknown";
|
|
94
108
|
// Extract projectId from request headers (set by proxy) for proper circuit breaker isolation
|
|
95
|
-
const projectId =
|
|
109
|
+
const projectId = resolveProjectId(context, "default");
|
|
96
110
|
const start = performance.now();
|
|
97
111
|
// Circuit breaker per project to prevent cascade failures
|
|
98
112
|
const circuitBreaker = getCircuitBreaker(`static-data-fetch:${projectId}`, {
|
|
@@ -101,13 +115,9 @@ export class StaticDataFetcher {
|
|
|
101
115
|
successThreshold: 2,
|
|
102
116
|
});
|
|
103
117
|
try {
|
|
104
|
-
const result = await circuitBreaker.execute(() =>
|
|
118
|
+
const result = await circuitBreaker.execute(() => this.executeStaticData(getStaticData, context, DATA_FETCH_TIMEOUT_MS, `getStaticData for ${pathname}`));
|
|
105
119
|
await withSpan(SpanNames.DATA_CACHE_SET, () => {
|
|
106
|
-
this.
|
|
107
|
-
data: result,
|
|
108
|
-
timestamp: Date.now(),
|
|
109
|
-
revalidate: result.revalidate,
|
|
110
|
-
});
|
|
120
|
+
this.storeCacheEntry(cacheKey, result);
|
|
111
121
|
return Promise.resolve();
|
|
112
122
|
}, { "data.cache_key": cacheKey, "data.revalidate": result.revalidate ?? 0 });
|
|
113
123
|
return result;
|
|
@@ -140,12 +150,10 @@ export class StaticDataFetcher {
|
|
|
140
150
|
throw error;
|
|
141
151
|
}
|
|
142
152
|
}
|
|
143
|
-
async revalidateInBackground(
|
|
144
|
-
if (typeof pageModule.getStaticData !== "function")
|
|
145
|
-
return;
|
|
153
|
+
async revalidateInBackground(getStaticData, context, cacheKey) {
|
|
146
154
|
const pathname = context.url?.pathname ?? "unknown";
|
|
147
155
|
// Use projectId from request headers for proper per-project fairness
|
|
148
|
-
const projectId =
|
|
156
|
+
const projectId = resolveProjectId(context, "unknown");
|
|
149
157
|
// Check per-project limit before acquiring global semaphore
|
|
150
158
|
if (!acquireRevalidationSlot(projectId)) {
|
|
151
159
|
serverLogger.debug("DATA_REVALIDATION_SKIPPED per-project limit reached", {
|
|
@@ -161,12 +169,8 @@ export class StaticDataFetcher {
|
|
|
161
169
|
await revalidationSemaphore.acquire(async () => {
|
|
162
170
|
const start = performance.now();
|
|
163
171
|
try {
|
|
164
|
-
const result = await
|
|
165
|
-
this.
|
|
166
|
-
data: result,
|
|
167
|
-
timestamp: Date.now(),
|
|
168
|
-
revalidate: result.revalidate,
|
|
169
|
-
});
|
|
172
|
+
const result = await this.executeStaticData(getStaticData, context, REVALIDATION_TIMEOUT_MS, `getStaticData revalidation for ${pathname}`);
|
|
173
|
+
this.storeCacheEntry(cacheKey, result);
|
|
170
174
|
}
|
|
171
175
|
catch (error) {
|
|
172
176
|
const durationMs = Math.round(performance.now() - start);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-paths-fetcher.d.ts","sourceRoot":"","sources":["../../../src/src/data/static-paths-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"static-paths-fetcher.d.ts","sourceRoot":"","sources":["../../../src/src/data/static-paths-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAQlE,qBAAa,kBAAkB;IAC7B,KAAK,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CAyBnE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { serverLogger } from "../utils/index.js";
|
|
2
2
|
import { withSpan } from "../observability/tracing/otlp-setup.js";
|
|
3
3
|
import { SpanNames } from "../observability/tracing/span-names.js";
|
|
4
|
+
const EMPTY_STATIC_PATHS_RESULT = { paths: [], fallback: false };
|
|
4
5
|
export class StaticPathsFetcher {
|
|
5
6
|
fetch(pageModule) {
|
|
6
7
|
const getStaticPaths = pageModule.getStaticPaths;
|
|
@@ -10,13 +11,13 @@ export class StaticPathsFetcher {
|
|
|
10
11
|
return withSpan(SpanNames.DATA_FETCH_STATIC_PATHS, async (span) => {
|
|
11
12
|
try {
|
|
12
13
|
const result = await getStaticPaths();
|
|
13
|
-
const finalResult = result ??
|
|
14
|
+
const finalResult = result ?? EMPTY_STATIC_PATHS_RESULT;
|
|
14
15
|
span?.setAttribute("data.paths_count", finalResult.paths?.length ?? 0);
|
|
15
16
|
span?.setAttribute("data.fallback", String(finalResult.fallback ?? false));
|
|
16
17
|
return finalResult;
|
|
17
18
|
}
|
|
18
19
|
catch (error) {
|
|
19
|
-
serverLogger.error("
|
|
20
|
+
serverLogger.error("DATA_FETCH_STATIC_PATHS_ERROR getStaticPaths failed", {}, error);
|
|
20
21
|
throw error;
|
|
21
22
|
}
|
|
22
23
|
}, { "data.fetch_method": "getStaticPaths" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/src/errors/logging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/src/errors/logging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAoBD;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAiCN;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAMN"}
|
|
@@ -6,6 +6,19 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { isProduction } from "../build/config/environment.js";
|
|
8
8
|
import { serverLogger } from "../utils/logger/logger.js";
|
|
9
|
+
function toContextRecord(value) {
|
|
10
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
11
|
+
? value
|
|
12
|
+
: undefined;
|
|
13
|
+
}
|
|
14
|
+
function mergeContext(errorContext, extraContext) {
|
|
15
|
+
const baseContext = toContextRecord(errorContext);
|
|
16
|
+
if (!baseContext)
|
|
17
|
+
return extraContext;
|
|
18
|
+
if (!extraContext)
|
|
19
|
+
return baseContext;
|
|
20
|
+
return { ...baseContext, ...extraContext };
|
|
21
|
+
}
|
|
9
22
|
/**
|
|
10
23
|
* Log a VeryfrontError with structured formatting
|
|
11
24
|
*
|
|
@@ -16,6 +29,7 @@ import { serverLogger } from "../utils/logger/logger.js";
|
|
|
16
29
|
* @param context - Additional context to include in logs
|
|
17
30
|
*/
|
|
18
31
|
export function logError(error, context) {
|
|
32
|
+
const mergedContext = mergeContext(error.context, context);
|
|
19
33
|
const entry = {
|
|
20
34
|
level: "error",
|
|
21
35
|
slug: error.slug,
|
|
@@ -24,11 +38,9 @@ export function logError(error, context) {
|
|
|
24
38
|
detail: error.detail,
|
|
25
39
|
suggestion: error.suggestion,
|
|
26
40
|
status: error.status,
|
|
27
|
-
docs:
|
|
41
|
+
docs: error.getDocsUrl(),
|
|
28
42
|
timestamp: new Date().toISOString(),
|
|
29
|
-
context:
|
|
30
|
-
? { ...(error.context ?? {}), ...context }
|
|
31
|
-
: error.context,
|
|
43
|
+
context: mergedContext,
|
|
32
44
|
};
|
|
33
45
|
if (isProduction()) {
|
|
34
46
|
// Direct JSON output — this module owns its own structured format
|
|
@@ -45,9 +57,6 @@ export function logError(error, context) {
|
|
|
45
57
|
serverLogger.error(` 💡 Suggestion: ${error.suggestion}`);
|
|
46
58
|
}
|
|
47
59
|
serverLogger.error(` 📚 Docs: ${entry.docs}`);
|
|
48
|
-
const mergedContext = context
|
|
49
|
-
? { ...(error.context ?? {}), ...context }
|
|
50
|
-
: error.context;
|
|
51
60
|
if (mergedContext) {
|
|
52
61
|
serverLogger.error(` Context: ${JSON.stringify(mergedContext, null, 2)}`);
|
|
53
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-formatter.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/user-friendly/error-formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-formatter.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/user-friendly/error-formatter.ts"],"names":[],"mappings":"AAoCA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAuBnD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAyBpD"}
|
|
@@ -3,27 +3,22 @@ import { box } from "../../utils/box.js";
|
|
|
3
3
|
import { ERROR_SOLUTIONS } from "./error-catalog.js";
|
|
4
4
|
import { identifyError } from "./error-identifier.js";
|
|
5
5
|
const errorColor = "\x1b[38;2;239;68;68m"; // Red
|
|
6
|
-
function
|
|
6
|
+
function buildSolutionDetailsLines(solution, options) {
|
|
7
7
|
const lines = [];
|
|
8
|
-
if (solution.message) {
|
|
9
|
-
lines.push(yellow("Problem: ") + solution.message, "");
|
|
10
|
-
}
|
|
11
8
|
if (solution.steps?.length) {
|
|
12
|
-
lines.push(cyan("How to fix:"));
|
|
9
|
+
lines.push("", cyan("How to fix:"));
|
|
13
10
|
for (const [i, step] of solution.steps.entries()) {
|
|
14
11
|
lines.push(` ${dim(`${i + 1}.`)} ${step}`);
|
|
15
12
|
}
|
|
16
|
-
lines.push("");
|
|
17
13
|
}
|
|
18
14
|
if (solution.example) {
|
|
19
|
-
lines.push(cyan("Example:")
|
|
15
|
+
lines.push("", options?.exampleLabel ?? cyan("Example:"));
|
|
20
16
|
for (const line of solution.example.split("\n")) {
|
|
21
17
|
lines.push(` ${dim(line)}`);
|
|
22
18
|
}
|
|
23
|
-
lines.push("");
|
|
24
19
|
}
|
|
25
20
|
if (solution.docs) {
|
|
26
|
-
lines.push(dim("Learn more: ") + cyan(solution.docs)
|
|
21
|
+
lines.push("", dim("Learn more: ") + cyan(solution.docs));
|
|
27
22
|
}
|
|
28
23
|
return lines;
|
|
29
24
|
}
|
|
@@ -41,21 +36,7 @@ export function formatErrorBox(error) {
|
|
|
41
36
|
if (solution.message) {
|
|
42
37
|
content.push("", dim(solution.message));
|
|
43
38
|
}
|
|
44
|
-
|
|
45
|
-
content.push("", cyan("How to fix:"));
|
|
46
|
-
for (const [i, step] of solution.steps.entries()) {
|
|
47
|
-
content.push(` ${dim(`${i + 1}.`)} ${step}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (solution.example) {
|
|
51
|
-
content.push("", dim("Example:"));
|
|
52
|
-
for (const line of solution.example.split("\n")) {
|
|
53
|
-
content.push(` ${dim(line)}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (solution.docs) {
|
|
57
|
-
content.push("", dim("Learn more: ") + cyan(solution.docs));
|
|
58
|
-
}
|
|
39
|
+
content.push(...buildSolutionDetailsLines(solution, { exampleLabel: dim("Example:") }));
|
|
59
40
|
}
|
|
60
41
|
return box(content.join("\n"), {
|
|
61
42
|
style: "rounded",
|
|
@@ -74,7 +55,10 @@ export function formatUserError(error) {
|
|
|
74
55
|
const errorKey = identifyError(error);
|
|
75
56
|
const solution = ERROR_SOLUTIONS[errorKey];
|
|
76
57
|
if (solution) {
|
|
77
|
-
|
|
58
|
+
if (solution.message) {
|
|
59
|
+
output.push(yellow("Problem: ") + solution.message);
|
|
60
|
+
}
|
|
61
|
+
output.push(...buildSolutionDetailsLines(solution), "");
|
|
78
62
|
return output.join("\n");
|
|
79
63
|
}
|
|
80
64
|
if (error.stack) {
|
package/esm/src/fs/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Public filesystem, path, and cwd utilities.
|
|
3
3
|
*
|
|
4
4
|
* @module fs
|
|
5
5
|
*
|
|
6
6
|
* @example File operations
|
|
7
7
|
* ```ts
|
|
8
|
-
* import {
|
|
8
|
+
* import { exists, mkdir, readTextFile, writeTextFile } from "veryfront/fs";
|
|
9
9
|
*
|
|
10
10
|
* const content = await readTextFile("./data/config.json");
|
|
11
11
|
* await writeTextFile("./output/result.json", JSON.stringify(data));
|
|
@@ -19,17 +19,16 @@
|
|
|
19
19
|
* const filePath = join("src", "pages", "index.tsx");
|
|
20
20
|
* const dir = dirname(filePath); // "src/pages"
|
|
21
21
|
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Working directory
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { cwd, resolve } from "veryfront/fs";
|
|
26
|
+
*
|
|
27
|
+
* const configPath = resolve(cwd(), "veryfront.config.ts");
|
|
28
|
+
* ```
|
|
22
29
|
*/
|
|
23
30
|
import "../../_dnt.polyfills.js";
|
|
24
|
-
export { createFileSystem } from "../platform/compat/fs.js";
|
|
25
|
-
export {
|
|
26
|
-
export { writeTextFile } from "../platform/compat/fs.js";
|
|
27
|
-
export { mkdir } from "../platform/compat/fs.js";
|
|
28
|
-
export { exists } from "../platform/compat/fs.js";
|
|
29
|
-
export { remove } from "../platform/compat/fs.js";
|
|
30
|
-
export { readDir } from "../platform/compat/fs.js";
|
|
31
|
-
export type { FileSystem } from "../platform/compat/fs.js";
|
|
32
|
-
export { basename, dirname, extname, join, } from "../platform/compat/path/basic-operations.js";
|
|
33
|
-
export { resolve } from "../platform/compat/path/resolution.js";
|
|
31
|
+
export { createFileSystem, exists, type FileSystem, mkdir, readDir, readTextFile, remove, writeTextFile, } from "../platform/compat/fs.js";
|
|
32
|
+
export { basename, dirname, extname, join, resolve, } from "../platform/compat/path/index.js";
|
|
34
33
|
export { cwd } from "../platform/compat/process.js";
|
|
35
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/fs/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/fs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,KAAK,UAAU,EACf,KAAK,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,GACR,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC"}
|
package/esm/src/fs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Public filesystem, path, and cwd utilities.
|
|
3
3
|
*
|
|
4
4
|
* @module fs
|
|
5
5
|
*
|
|
6
6
|
* @example File operations
|
|
7
7
|
* ```ts
|
|
8
|
-
* import {
|
|
8
|
+
* import { exists, mkdir, readTextFile, writeTextFile } from "veryfront/fs";
|
|
9
9
|
*
|
|
10
10
|
* const content = await readTextFile("./data/config.json");
|
|
11
11
|
* await writeTextFile("./output/result.json", JSON.stringify(data));
|
|
@@ -19,28 +19,15 @@
|
|
|
19
19
|
* const filePath = join("src", "pages", "index.tsx");
|
|
20
20
|
* const dir = dirname(filePath); // "src/pages"
|
|
21
21
|
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Working directory
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { cwd, resolve } from "veryfront/fs";
|
|
26
|
+
*
|
|
27
|
+
* const configPath = resolve(cwd(), "veryfront.config.ts");
|
|
28
|
+
* ```
|
|
22
29
|
*/
|
|
23
|
-
// veryfront/fs — Filesystem operations + path utilities
|
|
24
|
-
//
|
|
25
|
-
// Slim public surface for file I/O, path manipulation, and
|
|
26
|
-
// project context (cwd). Re-exports from the platform compat layer.
|
|
27
|
-
// ---------------------------------------------------------------------------
|
|
28
|
-
// Filesystem
|
|
29
|
-
// ---------------------------------------------------------------------------
|
|
30
30
|
import "../../_dnt.polyfills.js";
|
|
31
|
-
export { createFileSystem } from "../platform/compat/fs.js";
|
|
32
|
-
export {
|
|
33
|
-
export { writeTextFile } from "../platform/compat/fs.js";
|
|
34
|
-
export { mkdir } from "../platform/compat/fs.js";
|
|
35
|
-
export { exists } from "../platform/compat/fs.js";
|
|
36
|
-
export { remove } from "../platform/compat/fs.js";
|
|
37
|
-
export { readDir } from "../platform/compat/fs.js";
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
39
|
-
// Path utilities
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
export { basename, dirname, extname, join, } from "../platform/compat/path/basic-operations.js";
|
|
42
|
-
export { resolve } from "../platform/compat/path/resolution.js";
|
|
43
|
-
// ---------------------------------------------------------------------------
|
|
44
|
-
// Project context
|
|
45
|
-
// ---------------------------------------------------------------------------
|
|
31
|
+
export { createFileSystem, exists, mkdir, readDir, readTextFile, remove, writeTextFile, } from "../platform/compat/fs.js";
|
|
32
|
+
export { basename, dirname, extname, join, resolve, } from "../platform/compat/path/index.js";
|
|
46
33
|
export { cwd } from "../platform/compat/process.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-scripts.d.ts","sourceRoot":"","sources":["../../../src/src/html/dev-scripts.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CA+BnD;
|
|
1
|
+
{"version":3,"file":"dev-scripts.d.ts","sourceRoot":"","sources":["../../../src/src/html/dev-scripts.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CA+BnD;AAED,wBAAgB,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAMvE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAwBrE"}
|