veryfront 0.1.127 → 0.1.129
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/router.d.ts +0 -5
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +30 -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 +1 -0
- package/esm/src/html/dev-scripts.d.ts.map +1 -1
- package/esm/src/html/dev-scripts.js +8 -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.d.ts.map +1 -1
- package/esm/src/html/html-injection.js +13 -3
- 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 +43 -33
- 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/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/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/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/router.ts +41 -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 +9 -9
- package/src/src/html/html-escape.ts +4 -0
- package/src/src/html/html-injection.ts +22 -3
- package/src/src/html/html-shell-generator.ts +62 -29
- 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/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/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/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
|
@@ -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,3 +1,4 @@
|
|
|
1
|
+
export declare function getPreviewStylesheetLink(): string;
|
|
1
2
|
export declare function getDevStyles(nonce?: string): string;
|
|
2
3
|
export declare function getDevScripts(_hmrPort?: number, nonce?: string): string;
|
|
3
4
|
export declare function getProdScripts(slug: string, nonce?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-scripts.d.ts","sourceRoot":"","sources":["../../../src/src/html/dev-scripts.ts"],"names":[],"mappings":"AAEA,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"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildNonceAttribute } from "./html-escape.js";
|
|
2
|
+
export function getPreviewStylesheetLink() {
|
|
3
|
+
return `<link id="vf-tailwind-css" rel="stylesheet" href="/_vf_styles/styles.css?t=${Date.now()}">`;
|
|
4
|
+
}
|
|
2
5
|
export function getDevStyles(nonce) {
|
|
3
|
-
const nonceAttr =
|
|
6
|
+
const nonceAttr = buildNonceAttribute(nonce);
|
|
4
7
|
return `
|
|
5
8
|
<style${nonceAttr}>
|
|
6
9
|
.dev-indicator {
|
|
@@ -30,24 +33,21 @@ export function getDevStyles(nonce) {
|
|
|
30
33
|
}
|
|
31
34
|
</style>`;
|
|
32
35
|
}
|
|
33
|
-
function getNonceAttr(nonce) {
|
|
34
|
-
return nonce ? ` nonce="${escapeHtml(nonce)}"` : "";
|
|
35
|
-
}
|
|
36
36
|
export function getDevScripts(_hmrPort, nonce) {
|
|
37
|
-
const nonceAttr =
|
|
37
|
+
const nonceAttr = buildNonceAttribute(nonce);
|
|
38
38
|
return `
|
|
39
39
|
<script type="module" src="/_veryfront/rsc/client.js"${nonceAttr}></script>
|
|
40
40
|
<script type="module" src="/_veryfront/hmr.js"${nonceAttr}></script>`;
|
|
41
41
|
}
|
|
42
42
|
export function getProdScripts(slug, nonce) {
|
|
43
|
-
const nonceAttr =
|
|
43
|
+
const nonceAttr = buildNonceAttribute(nonce);
|
|
44
44
|
const encodedSlug = encodeURIComponent(slug);
|
|
45
45
|
return `
|
|
46
46
|
<script type="module" src="/_veryfront/rsc/client.js"${nonceAttr}></script>
|
|
47
47
|
<script type="module" src="/_veryfront/hydrate.js?slug=${encodedSlug}"${nonceAttr}></script>`;
|
|
48
48
|
}
|
|
49
49
|
export function getStudioScripts(options) {
|
|
50
|
-
const nonceAttr =
|
|
50
|
+
const nonceAttr = buildNonceAttribute(options.nonce);
|
|
51
51
|
const bridgeConfig = {
|
|
52
52
|
projectId: options.projectId,
|
|
53
53
|
pageId: options.pageId,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function escapeHTML(str: string): string;
|
|
2
2
|
export declare const escapeHtml: typeof escapeHTML;
|
|
3
3
|
export declare function buildAttributes(attrs: Record<string, string>): string;
|
|
4
|
+
export declare function buildNonceAttribute(nonce?: string): string;
|
|
4
5
|
//# sourceMappingURL=html-escape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-escape.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-escape.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,eAAO,MAAM,UAAU,mBAAa,CAAC;AAErC,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIrE"}
|
|
1
|
+
{"version":3,"file":"html-escape.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-escape.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,eAAO,MAAM,UAAU,mBAAa,CAAC;AAErC,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIrE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-injection.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"html-injection.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAkB/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IACvC,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAgBD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,wBAAwB,GAChC,MAAM,CA+FR"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { resolveRelativePath } from "../modules/react-loader/path-resolver.js";
|
|
2
2
|
import { determineClientModuleStrategy } from "../rendering/rsc/client-module-strategy.js";
|
|
3
3
|
import { generateLinkTags, generateMetaTags, generateScriptTags, generateStyleTags, } from "./tag-generators.js";
|
|
4
|
-
import {
|
|
5
|
-
import { getDevScripts, getDevStyles, getProdScripts, getStudioScripts } from "./dev-scripts.js";
|
|
4
|
+
import { buildNonceAttribute } from "./html-escape.js";
|
|
5
|
+
import { getDevScripts, getDevStyles, getPreviewStylesheetLink, getProdScripts, getStudioScripts, } from "./dev-scripts.js";
|
|
6
6
|
function toProjectRelativePath(absolutePath, projectDir) {
|
|
7
7
|
const normalizedPath = absolutePath.replace(/\\/g, "/");
|
|
8
8
|
if (!projectDir)
|
|
9
9
|
return normalizedPath.replace(/^\//, "");
|
|
10
10
|
return resolveRelativePath(normalizedPath, projectDir);
|
|
11
11
|
}
|
|
12
|
+
function hasProjectStylesheet(html) {
|
|
13
|
+
return /id=["']vf-tailwind-css["']/i.test(html) ||
|
|
14
|
+
/href=["'][^"']*\/_vf_styles\/styles\.css(?:\?[^"']*)?["']/i.test(html) ||
|
|
15
|
+
/href=["'][^"']*\/_vf\/css\/[^"']+\.css["']/i.test(html);
|
|
16
|
+
}
|
|
12
17
|
export function injectHTMLContent(template, content, metadata, options) {
|
|
13
18
|
let html = template;
|
|
14
19
|
html = html.replace(/{{\s*content\s*}}/gi, content);
|
|
@@ -28,10 +33,15 @@ export function injectHTMLContent(template, content, metadata, options) {
|
|
|
28
33
|
}
|
|
29
34
|
// Inject import map into <head> for ESM module resolution (must be before any module scripts)
|
|
30
35
|
if (options.importMapJson && /<\/head>/i.test(html)) {
|
|
31
|
-
const nonceAttr =
|
|
36
|
+
const nonceAttr = buildNonceAttribute(options.nonce);
|
|
32
37
|
const importMapTag = `<script type="importmap"${nonceAttr}>\n${options.importMapJson}\n</script>`;
|
|
33
38
|
html = html.replace(/<\/head>/i, `${importMapTag}\n</head>`);
|
|
34
39
|
}
|
|
40
|
+
const shouldUsePreviewStylesheet = options.mode === "development" ||
|
|
41
|
+
options.environment === "preview";
|
|
42
|
+
if (shouldUsePreviewStylesheet && /<\/head>/i.test(html) && !hasProjectStylesheet(html)) {
|
|
43
|
+
html = html.replace(/<\/head>/i, `${getPreviewStylesheetLink()}\n</head>`);
|
|
44
|
+
}
|
|
35
45
|
const hasBodyClose = /<\/body>/i.test(html);
|
|
36
46
|
// Inject hydration data for 'use client' pages (before scripts, so client.js can find it)
|
|
37
47
|
if (options.pagePath && options.isClientPage && hasBodyClose) {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { ComponentProps, RenderMetadata } from "../types/index.js";
|
|
2
|
+
import { getProjectCSS } from "./styles-builder/index.js";
|
|
2
3
|
import type { HTMLGenerationOptions } from "./types.js";
|
|
3
|
-
|
|
4
|
+
type ProjectCSSResult = Awaited<ReturnType<typeof getProjectCSS>> | null;
|
|
5
|
+
export declare function generateHTMLShellParts(meta: RenderMetadata, options: HTMLGenerationOptions, params?: Record<string, string | string[]>, props?: ComponentProps, contentForTailwind?: string, projectCSSPromise?: Promise<ProjectCSSResult>): Promise<{
|
|
4
6
|
start: string;
|
|
5
7
|
end: string;
|
|
6
8
|
}>;
|
|
7
|
-
export declare function wrapInHTMLShell(content: string, meta: RenderMetadata, options: HTMLGenerationOptions, params?: Record<string, string | string[]>, props?: ComponentProps): Promise<string>;
|
|
9
|
+
export declare function wrapInHTMLShell(content: string, meta: RenderMetadata, options: HTMLGenerationOptions, params?: Record<string, string | string[]>, props?: ComponentProps, projectCSSPromise?: Promise<ProjectCSSResult>): Promise<string>;
|
|
10
|
+
export {};
|
|
8
11
|
//# sourceMappingURL=html-shell-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-shell-generator.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-shell-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"html-shell-generator.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-shell-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAoBxE,OAAO,EAGL,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA0BxD,KAAK,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,GAAG,IAAI,CAAC;AA8DzE,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,qBAAqB,EAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC1C,KAAK,CAAC,EAAE,cAAc,EACtB,kBAAkB,CAAC,EAAE,MAAM,EAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAC5C,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBzC;AAoQD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,qBAAqB,EAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC1C,KAAK,CAAC,EAAE,cAAc,EACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAC5C,OAAO,CAAC,MAAM,CAAC,CAoBjB"}
|