veryfront 0.1.1237 → 0.1.1239
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/auth/login.d.ts +24 -2
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +444 -35
- package/esm/cli/commands/build/error-handler.d.ts.map +1 -1
- package/esm/cli/commands/build/error-handler.js +41 -3
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +1 -1
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +14 -1
- package/esm/cli/commands/dev/inference-status.d.ts +6 -0
- package/esm/cli/commands/dev/inference-status.d.ts.map +1 -1
- package/esm/cli/commands/dev/inference-status.js +14 -2
- package/esm/cli/commands/generate/command.d.ts.map +1 -1
- package/esm/cli/commands/generate/command.js +61 -0
- package/esm/cli/commands/init/init-command.d.ts.map +1 -1
- package/esm/cli/commands/init/init-command.js +23 -31
- package/esm/cli/commands/install/registry.d.ts.map +1 -1
- package/esm/cli/commands/install/registry.js +6 -9
- package/esm/cli/commands/login/command-help.d.ts.map +1 -1
- package/esm/cli/commands/login/command-help.js +3 -1
- package/esm/cli/commands/pull/command.d.ts +1 -0
- package/esm/cli/commands/pull/command.d.ts.map +1 -1
- package/esm/cli/commands/pull/command.js +49 -6
- package/esm/cli/commands/push/command-help.d.ts.map +1 -1
- package/esm/cli/commands/push/command-help.js +7 -0
- package/esm/cli/commands/push/command.d.ts +23 -12
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +461 -44
- package/esm/cli/commands/push/plan.d.ts +35 -0
- package/esm/cli/commands/push/plan.d.ts.map +1 -0
- package/esm/cli/commands/push/plan.js +96 -0
- package/esm/cli/commands/schedule/handler.d.ts +21 -2
- package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
- package/esm/cli/commands/schedule/handler.js +74 -27
- package/esm/cli/commands/schema/command-help.js +1 -1
- package/esm/cli/commands/up/command.js +1 -1
- package/esm/cli/commands/webhook/handler.d.ts.map +1 -1
- package/esm/cli/commands/webhook/handler.js +3 -1
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +27 -5
- package/esm/cli/shared/args.d.ts +15 -1
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +56 -3
- package/esm/cli/shared/config.d.ts +11 -2
- package/esm/cli/shared/config.d.ts.map +1 -1
- package/esm/cli/shared/config.js +72 -27
- package/esm/cli/shared/project-creation.js +1 -1
- package/esm/cli/sync/state.d.ts +20 -0
- package/esm/cli/sync/state.d.ts.map +1 -0
- package/esm/cli/sync/state.js +193 -0
- package/esm/deno.js +2 -2
- package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.d.ts.map +1 -1
- package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.js +852 -21
- package/esm/extensions/ext-observability-sentry/src/policy.d.ts +2 -0
- package/esm/extensions/ext-observability-sentry/src/policy.d.ts.map +1 -1
- package/esm/extensions/ext-observability-sentry/src/policy.js +214 -3
- package/esm/src/agent/conversation/delegation-policy.d.ts +2 -0
- package/esm/src/agent/conversation/delegation-policy.d.ts.map +1 -1
- package/esm/src/agent/conversation/delegation-policy.js +13 -3
- package/esm/src/agent/conversation/hosted-terminal.d.ts.map +1 -1
- package/esm/src/agent/conversation/hosted-terminal.js +6 -2
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-chunk-mirror.js +14 -2
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +22 -11
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +2 -0
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +6 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +2 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.js +6 -3
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +12 -3
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-step-message-preparation.js +16 -3
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts +1 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.js +3 -3
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +11 -0
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-child-tools.js +2 -3
- package/esm/src/agent/hosted/cloud-agent-config.d.ts +1 -0
- package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts +16 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.js +13 -3
- package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -1
- package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-chat-runtime.js +18 -7
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts +2 -1
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-invoke-agent-tool.js +11 -3
- package/esm/src/agent/hosted/default-project-steering-refresh.d.ts +2 -1
- package/esm/src/agent/hosted/default-project-steering-refresh.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-project-steering-refresh.js +4 -1
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts +6 -4
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts.map +1 -1
- package/esm/src/agent/hosted/runtime-state-resolver.js +8 -11
- package/esm/src/agent/index.d.ts +3 -3
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/project/agent-runtime.d.ts.map +1 -1
- package/esm/src/agent/project/agent-runtime.js +6 -3
- package/esm/src/agent/runtime/agent-definition.d.ts +68 -66
- package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-definition.js +15 -2
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts +2 -0
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-markdown-adapter.js +1 -1
- package/esm/src/agent/runtime/agent-runtime-step.d.ts +11 -5
- package/esm/src/agent/runtime/agent-runtime-step.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-runtime-step.js +23 -6
- package/esm/src/agent/runtime/call-context.d.ts +42 -11
- package/esm/src/agent/runtime/call-context.d.ts.map +1 -1
- package/esm/src/agent/runtime/call-context.js +480 -42
- package/esm/src/agent/runtime/chat-stream-handler.d.ts +18 -0
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +38 -18
- package/esm/src/agent/runtime/effective-agent-system.d.ts +13 -4
- package/esm/src/agent/runtime/effective-agent-system.d.ts.map +1 -1
- package/esm/src/agent/runtime/effective-agent-system.js +29 -0
- package/esm/src/agent/runtime/index.d.ts +1 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +638 -53
- package/esm/src/agent/runtime/load-skill-tool.d.ts +33 -3
- package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -1
- package/esm/src/agent/runtime/load-skill-tool.js +152 -21
- package/esm/src/agent/runtime/model-resolution.d.ts +3 -0
- package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-resolution.js +14 -0
- package/esm/src/agent/runtime/model-transport.d.ts +1 -0
- package/esm/src/agent/runtime/model-transport.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-transport.js +5 -2
- package/esm/src/agent/runtime/run-runtime-context.d.ts +4 -0
- package/esm/src/agent/runtime/run-runtime-context.d.ts.map +1 -1
- package/esm/src/agent/runtime/run-runtime-context.js +9 -3
- package/esm/src/agent/runtime/runtime-tool-config.d.ts +1 -0
- package/esm/src/agent/runtime/runtime-tool-config.d.ts.map +1 -1
- package/esm/src/agent/runtime/skill-prompt.d.ts +3 -0
- package/esm/src/agent/runtime/skill-prompt.d.ts.map +1 -1
- package/esm/src/agent/runtime/skill-prompt.js +113 -25
- package/esm/src/agent/runtime/streamed-assistant-message.d.ts +22 -2
- package/esm/src/agent/runtime/streamed-assistant-message.d.ts.map +1 -1
- package/esm/src/agent/runtime/streamed-assistant-message.js +26 -5
- package/esm/src/agent/runtime/tool-inventory.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-inventory.js +13 -9
- package/esm/src/agent/runtime/tool-result-continuation.d.ts +4 -2
- package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-result-continuation.js +24 -20
- package/esm/src/agent/schemas/agent.schema.d.ts +2 -2
- package/esm/src/agent/service/runtime.js +1 -1
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts +5 -4
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts.map +1 -1
- package/esm/src/agent/types.d.ts +14 -1
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/chat/chat-ui-message-helpers.d.ts.map +1 -1
- package/esm/src/chat/chat-ui-message-helpers.js +75 -16
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +37 -1
- package/esm/src/errors/catalog/build-errors.d.ts.map +1 -1
- package/esm/src/errors/catalog/build-errors.js +14 -0
- package/esm/src/errors/error-registry/build.d.ts +2 -0
- package/esm/src/errors/error-registry/build.d.ts.map +1 -1
- package/esm/src/errors/error-registry/build.js +8 -0
- package/esm/src/errors/error-registry/deploy.d.ts +4 -0
- package/esm/src/errors/error-registry/deploy.d.ts.map +1 -1
- package/esm/src/errors/error-registry/deploy.js +16 -0
- package/esm/src/errors/error-registry.d.ts +3 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/index.d.ts +2 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +4 -3
- package/esm/src/errors/tenant-classification.d.ts +25 -0
- package/esm/src/errors/tenant-classification.d.ts.map +1 -0
- package/esm/src/errors/tenant-classification.js +61 -0
- package/esm/src/extensions/builtin-extensions.d.ts +10 -15
- package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
- package/esm/src/extensions/builtin-extensions.js +32 -26
- package/esm/src/extensions/deferred-extension.d.ts +4 -4
- package/esm/src/extensions/deferred-extension.js +4 -4
- package/esm/src/extensions/index.d.ts +1 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +1 -0
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/integrations/_data.d.ts.map +1 -1
- package/esm/src/integrations/_data.js +6 -0
- package/esm/src/integrations/schema.d.ts +8 -0
- package/esm/src/integrations/schema.d.ts.map +1 -1
- package/esm/src/integrations/schema.js +3 -0
- package/esm/src/integrations/types.d.ts +2 -0
- package/esm/src/integrations/types.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +35 -20
- package/esm/src/internal-agents/run-system-prompt.d.ts +7 -2
- package/esm/src/internal-agents/run-system-prompt.d.ts.map +1 -1
- package/esm/src/internal-agents/run-system-prompt.js +19 -13
- package/esm/src/internal-agents/schema.d.ts +2 -0
- package/esm/src/internal-agents/schema.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +2 -18
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts +11 -0
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.js +53 -6
- package/esm/src/observability/application-error-contract.d.ts +4 -0
- package/esm/src/observability/application-error-contract.d.ts.map +1 -1
- package/esm/src/observability/application-errors.d.ts.map +1 -1
- package/esm/src/observability/application-errors.js +64 -3
- package/esm/src/platform/adapters/runtime/deno/http-server.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/http-server.js +2 -10
- package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts +14 -0
- package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/request-peer.js +82 -0
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/provider/runtime-loader/provider-http.d.ts +5 -1
- package/esm/src/provider/runtime-loader/provider-http.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader/provider-http.js +55 -17
- package/esm/src/provider/shared/index.d.ts +1 -0
- package/esm/src/provider/shared/index.d.ts.map +1 -1
- package/esm/src/provider/shared/index.js +2 -0
- package/esm/src/provider/types.d.ts +1 -0
- package/esm/src/provider/types.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/combobox.js +204 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.js +20 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.js +21 -0
- package/esm/src/react/components/ui/adapter/builtin/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/builtin/index.js +10 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.js +28 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.js +73 -0
- package/esm/src/react/components/ui/adapter/context.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/context.js +10 -0
- package/esm/src/react/components/ui/adapter/contract.d.ts +212 -0
- package/esm/src/react/components/ui/adapter/contract.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/token-scope.d.ts +24 -0
- package/esm/src/react/components/ui/adapter/token-scope.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/token-scope.js +26 -0
- package/esm/src/react/components/ui/alert-dialog.d.ts +101 -0
- package/esm/src/react/components/ui/alert-dialog.d.ts.map +1 -0
- package/esm/src/react/components/ui/alert-dialog.js +181 -0
- package/esm/src/react/components/ui/aspect-ratio.d.ts +18 -0
- package/esm/src/react/components/ui/aspect-ratio.d.ts.map +1 -0
- package/esm/src/react/components/ui/aspect-ratio.js +13 -0
- package/esm/src/react/components/ui/autocomplete.d.ts +67 -0
- package/esm/src/react/components/ui/autocomplete.d.ts.map +1 -0
- package/esm/src/react/components/ui/autocomplete.js +59 -0
- package/esm/src/react/components/ui/breadcrumb.d.ts +86 -0
- package/esm/src/react/components/ui/breadcrumb.d.ts.map +1 -0
- package/esm/src/react/components/ui/breadcrumb.js +67 -0
- package/esm/src/react/components/ui/calendar.d.ts +40 -0
- package/esm/src/react/components/ui/calendar.d.ts.map +1 -0
- package/esm/src/react/components/ui/calendar.js +170 -0
- package/esm/src/react/components/ui/combobox.d.ts +74 -0
- package/esm/src/react/components/ui/combobox.d.ts.map +1 -0
- package/esm/src/react/components/ui/combobox.js +100 -0
- package/esm/src/react/components/ui/context-menu.d.ts +116 -0
- package/esm/src/react/components/ui/context-menu.d.ts.map +1 -0
- package/esm/src/react/components/ui/context-menu.js +168 -0
- package/esm/src/react/components/ui/date-picker.d.ts +69 -0
- package/esm/src/react/components/ui/date-picker.d.ts.map +1 -0
- package/esm/src/react/components/ui/date-picker.js +96 -0
- package/esm/src/react/components/ui/dialog.d.ts +41 -11
- package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
- package/esm/src/react/components/ui/dialog.js +47 -28
- package/esm/src/react/components/ui/drawer.d.ts +31 -8
- package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
- package/esm/src/react/components/ui/drawer.js +33 -22
- package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
- package/esm/src/react/components/ui/dropdown-menu.js +7 -75
- package/esm/src/react/components/ui/field.d.ts +70 -0
- package/esm/src/react/components/ui/field.d.ts.map +1 -0
- package/esm/src/react/components/ui/field.js +161 -0
- package/esm/src/react/components/ui/file-type.d.ts +9 -8
- package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
- package/esm/src/react/components/ui/file-type.js +8 -8
- package/esm/src/react/components/ui/hover-card.d.ts +82 -0
- package/esm/src/react/components/ui/hover-card.d.ts.map +1 -0
- package/esm/src/react/components/ui/hover-card.js +140 -0
- package/esm/src/react/components/ui/index.d.ts +23 -2
- package/esm/src/react/components/ui/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/index.js +21 -0
- package/esm/src/react/components/ui/input-otp.d.ts +37 -0
- package/esm/src/react/components/ui/input-otp.d.ts.map +1 -0
- package/esm/src/react/components/ui/input-otp.js +42 -0
- package/esm/src/react/components/ui/menu-keyboard.d.ts +8 -0
- package/esm/src/react/components/ui/menu-keyboard.d.ts.map +1 -0
- package/esm/src/react/components/ui/menu-keyboard.js +76 -0
- package/esm/src/react/components/ui/menubar.d.ts +98 -0
- package/esm/src/react/components/ui/menubar.d.ts.map +1 -0
- package/esm/src/react/components/ui/menubar.js +173 -0
- package/esm/src/react/components/ui/meter.d.ts +45 -0
- package/esm/src/react/components/ui/meter.d.ts.map +1 -0
- package/esm/src/react/components/ui/meter.js +59 -0
- package/esm/src/react/components/ui/modal-surface.d.ts +7 -1
- package/esm/src/react/components/ui/modal-surface.d.ts.map +1 -1
- package/esm/src/react/components/ui/modal-surface.js +23 -6
- package/esm/src/react/components/ui/navigation-menu.d.ts +101 -0
- package/esm/src/react/components/ui/navigation-menu.d.ts.map +1 -0
- package/esm/src/react/components/ui/navigation-menu.js +195 -0
- package/esm/src/react/components/ui/number-field.d.ts +46 -0
- package/esm/src/react/components/ui/number-field.d.ts.map +1 -0
- package/esm/src/react/components/ui/number-field.js +121 -0
- package/esm/src/react/components/ui/pagination.d.ts +77 -0
- package/esm/src/react/components/ui/pagination.d.ts.map +1 -0
- package/esm/src/react/components/ui/pagination.js +62 -0
- package/esm/src/react/components/ui/popover.d.ts +42 -13
- package/esm/src/react/components/ui/popover.d.ts.map +1 -1
- package/esm/src/react/components/ui/popover.js +25 -12
- package/esm/src/react/components/ui/scroll-area.d.ts +38 -0
- package/esm/src/react/components/ui/scroll-area.d.ts.map +1 -0
- package/esm/src/react/components/ui/scroll-area.js +35 -0
- package/esm/src/react/components/ui/separator.d.ts +20 -0
- package/esm/src/react/components/ui/separator.d.ts.map +1 -0
- package/esm/src/react/components/ui/separator.js +13 -0
- package/esm/src/react/components/ui/slider.d.ts +44 -0
- package/esm/src/react/components/ui/slider.d.ts.map +1 -0
- package/esm/src/react/components/ui/slider.js +46 -0
- package/esm/src/react/components/ui/status.d.ts +6 -5
- package/esm/src/react/components/ui/status.d.ts.map +1 -1
- package/esm/src/react/components/ui/status.js +4 -4
- package/esm/src/react/components/ui/tabs.d.ts +32 -9
- package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
- package/esm/src/react/components/ui/tabs.js +46 -22
- package/esm/src/react/components/ui/toggle.d.ts +26 -0
- package/esm/src/react/components/ui/toggle.d.ts.map +1 -0
- package/esm/src/react/components/ui/toggle.js +29 -0
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts +2 -1
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.js +6 -3
- package/esm/src/rendering/chunk-optimizer/source-imports.d.ts.map +1 -1
- package/esm/src/rendering/chunk-optimizer/source-imports.js +4 -114
- package/esm/src/rendering/orchestrator/css-candidate-manifest.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/css-candidate-manifest.js +30 -1
- package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts +10 -0
- package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/build-failure.js +50 -3
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +21 -6
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +190 -7
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +4 -0
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +374 -7
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +12 -1
- package/esm/src/runs/runs-client.d.ts +2 -4
- package/esm/src/runs/runs-client.d.ts.map +1 -1
- package/esm/src/runs/schemas.d.ts +18 -8
- package/esm/src/runs/schemas.d.ts.map +1 -1
- package/esm/src/runs/schemas.js +26 -0
- package/esm/src/runtime/model-call-context.d.ts +6 -1
- package/esm/src/runtime/model-call-context.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.js +133 -15
- package/esm/src/schedule/factory.d.ts +8 -2
- package/esm/src/schedule/factory.d.ts.map +1 -1
- package/esm/src/schedule/factory.js +0 -8
- package/esm/src/schedule/index.d.ts +10 -1
- package/esm/src/schedule/index.d.ts.map +1 -1
- package/esm/src/schedule/index.js +9 -0
- package/esm/src/schedule/types.d.ts +30 -11
- package/esm/src/schedule/types.d.ts.map +1 -1
- package/esm/src/schedule/validation.d.ts +17 -0
- package/esm/src/schedule/validation.d.ts.map +1 -1
- package/esm/src/schedule/validation.js +93 -5
- package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
- package/esm/src/security/sandbox/worker-pool.js +6 -1
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +6 -0
- package/esm/src/server/dev-server/index.d.ts +1 -1
- package/esm/src/server/dev-server/index.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.d.ts +7 -3
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +12 -3
- package/esm/src/server/dev-server/types.d.ts +7 -1
- package/esm/src/server/dev-server/types.d.ts.map +1 -1
- package/esm/src/server/dev-server.d.ts +1 -1
- package/esm/src/server/dev-server.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +2509 -34
- package/esm/src/server/handlers/dev/projects/index.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/index.js +3 -0
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/agent-stream.handler.js +29 -24
- package/esm/src/server/index.d.ts +3 -3
- package/esm/src/server/index.d.ts.map +1 -1
- package/esm/src/server/index.js +10 -5
- package/esm/src/server/node-handler.d.ts.map +1 -1
- package/esm/src/server/node-handler.js +4 -1
- package/esm/src/server/production-server.d.ts.map +1 -1
- package/esm/src/server/production-server.js +2 -1
- package/esm/src/server/project-env/cache.d.ts +17 -0
- package/esm/src/server/project-env/cache.d.ts.map +1 -1
- package/esm/src/server/project-env/cache.js +78 -2
- package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
- package/esm/src/server/project-env/fetcher.js +24 -14
- package/esm/src/server/project-env/index.d.ts +1 -1
- package/esm/src/server/project-env/index.d.ts.map +1 -1
- package/esm/src/server/project-env/index.js +1 -1
- package/esm/src/server/project-env/internal-authorization.d.ts +7 -0
- package/esm/src/server/project-env/internal-authorization.d.ts.map +1 -0
- package/esm/src/server/project-env/internal-authorization.js +32 -0
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +1 -1
- package/esm/src/server/runtime-handler/projects-handler.d.ts +1 -1
- package/esm/src/server/runtime-handler/projects-handler.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/projects-handler.js +4 -2
- package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-bundler.js +6 -5
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +11 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +35 -0
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +16 -10
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +87 -7
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.js +11 -6
- package/esm/src/transforms/md/compiler/md-compiler.d.ts.map +1 -1
- package/esm/src/transforms/md/compiler/md-compiler.js +12 -5
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +2 -0
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +33 -1
- package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/mdx-compiler.js +46 -7
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +8 -2
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +1 -0
- 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 +3 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +44 -8
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +5 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.js +50 -11
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts +24 -12
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.js +201 -18
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +5 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts +22 -2
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.js +2080 -129
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts +11 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +32 -15
- package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/compile.js +44 -0
- package/esm/src/transforms/shared/specifier-suffix.d.ts +25 -0
- package/esm/src/transforms/shared/specifier-suffix.d.ts.map +1 -0
- package/esm/src/transforms/shared/specifier-suffix.js +43 -0
- package/esm/src/trigger/index.d.ts +2 -2
- package/esm/src/trigger/index.d.ts.map +1 -1
- package/esm/src/trigger/index.js +1 -1
- package/esm/src/trigger/local-runner.d.ts +2 -2
- package/esm/src/trigger/local-runner.d.ts.map +1 -1
- package/esm/src/trigger/local-runner.js +11 -4
- package/esm/src/trigger/target.d.ts +97 -5
- package/esm/src/trigger/target.d.ts.map +1 -1
- package/esm/src/trigger/target.js +175 -5
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/webhook/types.d.ts +21 -6
- package/esm/src/webhook/types.d.ts.map +1 -1
- package/esm/src/webhook/validation.d.ts.map +1 -1
- package/esm/src/webhook/validation.js +27 -39
- package/esm/templates/index.d.ts +1 -1
- package/esm/templates/index.d.ts.map +1 -1
- package/esm/templates/loader.d.ts +6 -6
- package/esm/templates/loader.d.ts.map +1 -1
- package/esm/templates/loader.js +34 -18
- package/esm/templates/manifest.generated.d.ts +3 -0
- package/esm/templates/manifest.generated.d.ts.map +1 -0
- package/esm/templates/manifest.generated.js +2 -0
- package/package.json +8 -8
- package/esm/templates/manifest.d.ts +0 -664
- package/esm/templates/manifest.d.ts.map +0 -1
- package/esm/templates/manifest.js +0 -662
|
@@ -1,8 +1,43 @@
|
|
|
1
1
|
import { rendererLogger } from "../../../utils/index.js";
|
|
2
2
|
import { resolve as resolveContract } from "../../../extensions/contracts.js";
|
|
3
|
-
import {
|
|
3
|
+
import { MDX_COMPILE_ERROR, VeryfrontError } from "../../../errors/index.js";
|
|
4
4
|
import { withSpan } from "../../../observability/tracing/otlp-setup.js";
|
|
5
|
+
import { isFrontmatterSyntaxError } from "./frontmatter-extractor.js";
|
|
5
6
|
const logger = rendererLogger.component("mdx-compiler");
|
|
7
|
+
const ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
8
|
+
const ReflectApply = Reflect.apply;
|
|
9
|
+
const ReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
|
|
10
|
+
function readOwnDataProperty(value, key) {
|
|
11
|
+
try {
|
|
12
|
+
const descriptor = ReflectGetOwnPropertyDescriptor(value, key);
|
|
13
|
+
if (descriptor !== undefined &&
|
|
14
|
+
ReflectApply(ObjectPrototypeHasOwnProperty, descriptor, ["value"]) === true) {
|
|
15
|
+
return descriptor.value;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// A hostile proxy cannot provide trusted source-diagnostic evidence.
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function isMdxSourceCompileError(error) {
|
|
24
|
+
const source = readOwnDataProperty(error, "source");
|
|
25
|
+
const ruleId = readOwnDataProperty(error, "ruleId");
|
|
26
|
+
const line = readOwnDataProperty(error, "line");
|
|
27
|
+
const column = readOwnDataProperty(error, "column");
|
|
28
|
+
const isMdxParserError = typeof source === "string" &&
|
|
29
|
+
/(?:^|-)mdx(?:-|$)|micromark|remark|recma|rehype/.test(source) &&
|
|
30
|
+
typeof ruleId === "string" &&
|
|
31
|
+
Number.isSafeInteger(line) &&
|
|
32
|
+
Number.isSafeInteger(column);
|
|
33
|
+
// Frontmatter failures are identified by the symbol `extractFrontmatter`
|
|
34
|
+
// stamps at the throw site, not by matching stack-frame paths: `extract()` is
|
|
35
|
+
// the only frontmatter path and it tags every SyntaxError it raises. A
|
|
36
|
+
// stack-path heuristic would only add false positives (any SyntaxError whose
|
|
37
|
+
// stack happened to pass through the YAML shim) and does not survive
|
|
38
|
+
// `deno compile` anyway.
|
|
39
|
+
return isMdxParserError || isFrontmatterSyntaxError(error);
|
|
40
|
+
}
|
|
6
41
|
export function compileMDXRuntime(mode, projectDir, content, frontmatter, filePath, target = "server", baseUrl, studioEmbed) {
|
|
7
42
|
return withSpan("transforms.compileMDXRuntime", async () => {
|
|
8
43
|
try {
|
|
@@ -19,15 +54,19 @@ export function compileMDXRuntime(mode, projectDir, content, frontmatter, filePa
|
|
|
19
54
|
});
|
|
20
55
|
}
|
|
21
56
|
catch (error) {
|
|
57
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
22
58
|
logger.error("Compilation failed:", {
|
|
23
59
|
filePath,
|
|
24
|
-
error:
|
|
25
|
-
stack:
|
|
60
|
+
error: err.message,
|
|
61
|
+
stack: err.stack,
|
|
62
|
+
});
|
|
63
|
+
if (err instanceof VeryfrontError || !isMdxSourceCompileError(err)) {
|
|
64
|
+
throw err;
|
|
65
|
+
}
|
|
66
|
+
throw MDX_COMPILE_ERROR.create({
|
|
67
|
+
detail: `MDX compilation error: ${err.message} | file: ${filePath ?? "<memory>"}`,
|
|
68
|
+
cause: err,
|
|
26
69
|
});
|
|
27
|
-
throw toError(createError({
|
|
28
|
-
type: "build",
|
|
29
|
-
message: `MDX compilation error: ${error instanceof Error ? error.message : String(error)} | file: ${filePath ?? "<memory>"}`,
|
|
30
|
-
}));
|
|
31
70
|
}
|
|
32
71
|
}, {
|
|
33
72
|
"mdx.filePath": filePath ?? "memory",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAe5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAK9D,eAAO,MAAM,kBAAkB,wBAE7B,CAAC;AAgIH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAOvF;AAUD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,CAM1F;AAqBD,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAsBvF;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAezE;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C;AAQD,2DAA2D;AAC3D,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAElD;AAuBD,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CA+ElE;AA+ED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,YAAY,SAAwB,EACpC,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAaT;AAED,wBAAsB,mCAAmC,CACvD,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,YAAY,SAAwB,EACpC,SAAS,GAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAiD,EAChF,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC,CAwBlB;AAOD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAevD;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CAkEf;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAc1D;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAOzD;AAoBD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EAMnB,YAAY,CAAC,EAAE,MAAM,EACrB,eAAe,CAAC,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,EAChE,YAAY,SAAwB,EACpC,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC,CA+J5B"}
|
|
@@ -14,7 +14,7 @@ import { LOG_PREFIX_MDX_LOADER } from "../constants.js";
|
|
|
14
14
|
import { LRUCache } from "../../../../utils/lru-wrapper.js";
|
|
15
15
|
import { registerCache } from "../../../../utils/memory/index.js";
|
|
16
16
|
import { hashCodeHex } from "../../../../utils/hash-utils.js";
|
|
17
|
-
import { buildMdxEsmPathCacheKey, MDX_ESM_ALL_FILE_URL_PATTERN_SOURCE } from "../cache-format.js";
|
|
17
|
+
import { buildMdxEsmPathCacheKey, MDX_ESM_ALL_FILE_URL_PATTERN_SOURCE, UNRESOLVED_IMPORTS_SIDECAR_SUFFIX, } from "../cache-format.js";
|
|
18
18
|
import { ensureMdxModuleDependencies } from "../module-fetcher/dependency-recovery.js";
|
|
19
19
|
import { findStaticImportFromSpans } from "../utils/source-spans.js";
|
|
20
20
|
import { formatCacheVersionSegment, isCacheVersionSegment, } from "../../../../utils/cache-version.js";
|
|
@@ -299,7 +299,7 @@ export function invalidateModulePaths(changedPaths) {
|
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
// Delete stale
|
|
302
|
+
// Delete stale modules and their tenant-attribution evidence from disk.
|
|
303
303
|
for (const mjsPath of staleMjsFiles) {
|
|
304
304
|
try {
|
|
305
305
|
await localFs.remove(mjsPath);
|
|
@@ -308,6 +308,12 @@ export function invalidateModulePaths(changedPaths) {
|
|
|
308
308
|
catch (_) {
|
|
309
309
|
/* expected: file may already be gone */
|
|
310
310
|
}
|
|
311
|
+
try {
|
|
312
|
+
await localFs.remove(`${mjsPath}${UNRESOLVED_IMPORTS_SIDECAR_SUFFIX}`);
|
|
313
|
+
}
|
|
314
|
+
catch (_) {
|
|
315
|
+
/* expected: most modules have no unresolved-import evidence */
|
|
316
|
+
}
|
|
311
317
|
}
|
|
312
318
|
};
|
|
313
319
|
_pendingDiskCleanup = _pendingDiskCleanup.then(cleanup, cleanup).catch((error) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const UNRESOLVED_IMPORTS_SIDECAR_SUFFIX = ".unresolved-imports.json";
|
|
1
2
|
export declare const MDX_ESM_ALL_FILE_URL_PATTERN_SOURCE: string;
|
|
2
3
|
export declare const MDX_ESM_MJS_FILE_URL_PATTERN_SOURCE: string;
|
|
3
4
|
export declare const MDX_ESM_CACHE_NAMESPACE: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-format.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/cache-format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cache-format.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/cache-format.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAuI5E,eAAO,MAAM,mCAAmC,QAA8B,CAAC;AAC/E,eAAO,MAAM,mCAAmC,QAA8B,CAAC;AAE/E,eAAO,MAAM,uBAAuB,QAGnC,CAAC;AAEF,eAAO,MAAM,mCAAmC,QAG/C,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAUR;AAED,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,MAAM,EACtB,YAAY,SAAwB,EACpC,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAOR;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,GACf,MAAM,CAOR;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAErF;AAED,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,MAAM,CAOR"}
|
|
@@ -8,6 +8,8 @@ import { hashString } from "./utils/hash.js";
|
|
|
8
8
|
const ALL_FILE_URL_PATTERN_SOURCE = /file:\/\/([^"'\s]+)/.source;
|
|
9
9
|
const MJS_FILE_URL_PATTERN_SOURCE = /file:\/\/([^"'\s]+\.mjs)/.source;
|
|
10
10
|
const CACHE_NAMESPACE_SENTINEL = "__vf_cache_namespace__";
|
|
11
|
+
export const UNRESOLVED_IMPORTS_SIDECAR_SUFFIX = ".unresolved-imports.json";
|
|
12
|
+
const MDX_ESM_PATH_CACHE_ATTRIBUTION_SCHEMA = "unresolved-import-sidecars-v1";
|
|
11
13
|
const PUBLIC_RUNTIME_SPECIFIERS = [
|
|
12
14
|
"veryfront/head",
|
|
13
15
|
"veryfront/router",
|
|
@@ -52,6 +54,7 @@ function buildMdxEsmCacheSchemaSample() {
|
|
|
52
54
|
unresolvedVfModulesPattern: UNRESOLVED_VF_MODULES_PATTERN.source,
|
|
53
55
|
allFileUrlPattern: ALL_FILE_URL_PATTERN_SOURCE,
|
|
54
56
|
mjsFileUrlPattern: MJS_FILE_URL_PATTERN_SOURCE,
|
|
57
|
+
pathCacheAttributionSchema: MDX_ESM_PATH_CACHE_ATTRIBUTION_SCHEMA,
|
|
55
58
|
sourceHashing: [
|
|
56
59
|
hashString("_vf_modules/pages/index.jsexport default 1;"),
|
|
57
60
|
hashString("/tmp/project/Button.tsx\0export default function Button() {}"),
|
|
@@ -25,8 +25,10 @@ export declare function initializeCacheDir(context: ESMLoaderContext): Promise<s
|
|
|
25
25
|
export declare function findVfModuleImports(code: string): Array<{
|
|
26
26
|
original: string;
|
|
27
27
|
path: string;
|
|
28
|
+
suffix: string;
|
|
28
29
|
start: number;
|
|
29
30
|
end: number;
|
|
31
|
+
isDynamic?: boolean;
|
|
30
32
|
}>;
|
|
31
33
|
/**
|
|
32
34
|
* Process /_vf_modules/ imports and replace them with file:// paths.
|
|
@@ -34,7 +36,9 @@ export declare function findVfModuleImports(code: string): Array<{
|
|
|
34
36
|
export declare function processVfModuleImports(code: string, imports: Array<{
|
|
35
37
|
original: string;
|
|
36
38
|
path: string;
|
|
39
|
+
suffix?: string;
|
|
37
40
|
start: number;
|
|
38
41
|
end: number;
|
|
42
|
+
isDynamic?: boolean;
|
|
39
43
|
}>, context: ESMLoaderContext, projectDir: string, strictMissingModules: boolean): Promise<string>;
|
|
40
44
|
//# sourceMappingURL=loader-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/loader-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"loader-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/loader-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwBH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASnD;;;GAGG;AACH,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAapF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAWnE;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgCnF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GACX,KAAK,CAAC;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC,CAoBD;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC,EACF,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,MAAM,EAClB,oBAAoB,EAAE,OAAO,GAC5B,OAAO,CAAC,MAAM,CAAC,CA4JjB"}
|
|
@@ -17,11 +17,13 @@ import { exists as fsExists } from "../../../platform/compat/fs.js";
|
|
|
17
17
|
import { LOG_PREFIX_MDX_LOADER } from "./constants.js";
|
|
18
18
|
import { getLocalFs } from "./cache/index.js";
|
|
19
19
|
import { createStubModule } from "./utils/stub-module.js";
|
|
20
|
-
import { findStaticImportFromSpans, replaceSourceSpans, } from "./utils/source-spans.js";
|
|
20
|
+
import { findDynamicImportSpans, findStaticImportFromSpans, replaceSourceSpans, } from "./utils/source-spans.js";
|
|
21
21
|
import { createModuleFetcherContext, fetchAndCacheModule } from "./module-fetcher/index.js";
|
|
22
22
|
import { buildMissingModuleError } from "./missing-module.js";
|
|
23
|
+
import { dynamicDependencyFailure, toImportStringLiteral, } from "./module-fetcher/nested-imports.js";
|
|
23
24
|
import { parallelMap } from "../../../utils/parallel.js";
|
|
24
25
|
import { assertMdxModuleImportCount, MAX_MDX_MODULE_IMPORTS_PER_FILE, MAX_MDX_MODULE_TRANSFORM_CONCURRENCY, } from "./module-fetcher/limits.js";
|
|
26
|
+
import { splitSpecifierSuffix } from "../../shared/specifier-suffix.js";
|
|
25
27
|
/**
|
|
26
28
|
* Check which framework bundles are missing from disk.
|
|
27
29
|
* Returns the list of missing file paths.
|
|
@@ -92,7 +94,15 @@ export async function initializeCacheDir(context) {
|
|
|
92
94
|
* Find /_vf_modules/ imports in code.
|
|
93
95
|
*/
|
|
94
96
|
export function findVfModuleImports(code) {
|
|
95
|
-
|
|
97
|
+
const matchVfModule = (specifier) => specifier.match(/^\/?(_vf_modules\/.+)$/)?.[1] ?? null;
|
|
98
|
+
const staticImports = findStaticImportFromSpans(code, matchVfModule, MAX_MDX_MODULE_IMPORTS_PER_FILE + 1);
|
|
99
|
+
const dynamicImports = findDynamicImportSpans(code, matchVfModule, MAX_MDX_MODULE_IMPORTS_PER_FILE + 1).map((importSpan) => ({ ...importSpan, isDynamic: true }));
|
|
100
|
+
return [...staticImports, ...dynamicImports]
|
|
101
|
+
.map((importSpan) => {
|
|
102
|
+
const { path, suffix } = splitSpecifierSuffix(importSpan.path);
|
|
103
|
+
return { ...importSpan, path, suffix };
|
|
104
|
+
})
|
|
105
|
+
.sort((left, right) => left.start - right.start);
|
|
96
106
|
}
|
|
97
107
|
/**
|
|
98
108
|
* Process /_vf_modules/ imports and replace them with file:// paths.
|
|
@@ -137,7 +147,7 @@ export async function processVfModuleImports(code, imports, context, projectDir,
|
|
|
137
147
|
strictMissingModules,
|
|
138
148
|
});
|
|
139
149
|
const fetchStart = performance.now();
|
|
140
|
-
const results = await parallelMap(imports, async ({ original, path, start, end }, index) => {
|
|
150
|
+
const results = await parallelMap(imports, async ({ original, path, suffix, start, end, isDynamic }, index) => {
|
|
141
151
|
return await withSpan(SpanNames.MDX_FETCH_MODULE, async () => {
|
|
142
152
|
const moduleStart = performance.now();
|
|
143
153
|
logger.debug(`${LOG_PREFIX_MDX_LOADER} Fetching module START`, {
|
|
@@ -145,14 +155,26 @@ export async function processVfModuleImports(code, imports, context, projectDir,
|
|
|
145
155
|
index,
|
|
146
156
|
path,
|
|
147
157
|
});
|
|
148
|
-
|
|
158
|
+
let filePath;
|
|
159
|
+
let deferredError;
|
|
160
|
+
try {
|
|
161
|
+
filePath = await fetchAndCacheModule(path, fetcherContext);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
if (!isDynamic)
|
|
165
|
+
throw error;
|
|
166
|
+
deferredError = dynamicDependencyFailure(path, error) ?? undefined;
|
|
167
|
+
if (!deferredError)
|
|
168
|
+
throw error;
|
|
169
|
+
filePath = null;
|
|
170
|
+
}
|
|
149
171
|
logger.debug(`${LOG_PREFIX_MDX_LOADER} Fetching module DONE`, {
|
|
150
172
|
projectSlug,
|
|
151
173
|
index,
|
|
152
174
|
path,
|
|
153
175
|
durationMs: (performance.now() - moduleStart).toFixed(1),
|
|
154
176
|
});
|
|
155
|
-
return { original, start, end, filePath, path };
|
|
177
|
+
return { original, start, end, filePath, path, suffix, isDynamic, deferredError };
|
|
156
178
|
}, {
|
|
157
179
|
"mdx.module_path": path,
|
|
158
180
|
"mdx.module_index": index,
|
|
@@ -165,16 +187,29 @@ export async function processVfModuleImports(code, imports, context, projectDir,
|
|
|
165
187
|
durationMs: (performance.now() - fetchStart).toFixed(1),
|
|
166
188
|
});
|
|
167
189
|
const replacements = [];
|
|
168
|
-
for (const { original, start, end, filePath, path } of results) {
|
|
190
|
+
for (const { original, start, end, filePath, path, suffix, isDynamic, deferredError } of results) {
|
|
169
191
|
if (filePath) {
|
|
192
|
+
const importTarget = toImportStringLiteral(`file://${filePath}${suffix ?? ""}`);
|
|
170
193
|
replacements.push({
|
|
171
194
|
start,
|
|
172
195
|
end,
|
|
173
196
|
expected: original,
|
|
174
|
-
replacement: `from
|
|
197
|
+
replacement: isDynamic ? importTarget : `from ${importTarget}`,
|
|
175
198
|
});
|
|
176
199
|
continue;
|
|
177
200
|
}
|
|
201
|
+
if (isDynamic) {
|
|
202
|
+
const deferredPath = await createStubModule(path, code, original, context.esmCacheDir, { failOnImport: strictMissingModules, deferredError });
|
|
203
|
+
if (deferredPath) {
|
|
204
|
+
replacements.push({
|
|
205
|
+
start,
|
|
206
|
+
end,
|
|
207
|
+
expected: original,
|
|
208
|
+
replacement: toImportStringLiteral(`file://${deferredPath}${suffix ?? ""}`),
|
|
209
|
+
});
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
178
213
|
if (strictMissingModules) {
|
|
179
214
|
throw buildMissingModuleError({
|
|
180
215
|
modulePath: path,
|
|
@@ -186,11 +221,12 @@ export async function processVfModuleImports(code, imports, context, projectDir,
|
|
|
186
221
|
}
|
|
187
222
|
const stubPath = await createStubModule(path, code, original, context.esmCacheDir);
|
|
188
223
|
if (stubPath) {
|
|
224
|
+
const importTarget = toImportStringLiteral(`file://${stubPath}${suffix ?? ""}`);
|
|
189
225
|
replacements.push({
|
|
190
226
|
start,
|
|
191
227
|
end,
|
|
192
228
|
expected: original,
|
|
193
|
-
replacement: `from
|
|
229
|
+
replacement: isDynamic ? importTarget : `from ${importTarget}`,
|
|
194
230
|
});
|
|
195
231
|
}
|
|
196
232
|
}
|
|
@@ -9,5 +9,7 @@ type MissingModuleContext = {
|
|
|
9
9
|
projectSlug?: string;
|
|
10
10
|
};
|
|
11
11
|
export declare function buildMissingModuleError(ctx: MissingModuleContext): Error;
|
|
12
|
+
/** Return true only for missing-module errors produced by this loader. */
|
|
13
|
+
export declare function isMdxMissingModuleError(error: unknown): boolean;
|
|
12
14
|
export {};
|
|
13
15
|
//# sourceMappingURL=missing-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"missing-module.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/missing-module.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAcF,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,oBAAoB,GAAG,KAAK,CA4BxE"}
|
|
1
|
+
{"version":3,"file":"missing-module.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/esm-module-loader/missing-module.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAcF,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,oBAAoB,GAAG,KAAK,CA4BxE;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE/D"}
|
|
@@ -39,3 +39,7 @@ export function buildMissingModuleError(ctx) {
|
|
|
39
39
|
}
|
|
40
40
|
return error;
|
|
41
41
|
}
|
|
42
|
+
/** Return true only for missing-module errors produced by this loader. */
|
|
43
|
+
export function isMdxMissingModuleError(error) {
|
|
44
|
+
return error instanceof Error && error.name === "MissingModuleError";
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-fallback.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,KAAK,oBAAoB,GAAG,OAAO,kBAAkB,CAAC;AACtD,KAAK,kBAAkB,GAAG,OAAO,WAAW,CAAC;AAE7C,MAAM,WAAW,2CAA2C;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;CACvC;AAED;;GAEG;AACH,wBAAsB,sCAAsC,CAC1D,KAAK,EAAE,2CAA2C,GACjD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"http-fallback.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,KAAK,oBAAoB,GAAG,OAAO,kBAAkB,CAAC;AACtD,KAAK,kBAAkB,GAAG,OAAO,WAAW,CAAC;AAE7C,MAAM,WAAW,2CAA2C;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;CACvC;AAED;;GAEG;AACH,wBAAsB,sCAAsC,CAC1D,KAAK,EAAE,2CAA2C,GACjD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyCxB"}
|
|
@@ -12,7 +12,11 @@ import { cacheModule } from "./module-cache.js";
|
|
|
12
12
|
export async function resolveUnresolvedModuleViaHttpFallback(input) {
|
|
13
13
|
const fetchViaHttp = input.fetchViaHttp ?? fetchModuleViaHTTP;
|
|
14
14
|
const cacheLocalModule = input.cacheLocalModule ?? cacheModule;
|
|
15
|
-
const moduleCode = await fetchViaHttp(input.normalizedPath, input.adapter, input.fetchAndCacheModule, input.log, input.projectSlug, input.isLocalProject, input.dependencyPinningCacheKey, {
|
|
15
|
+
const moduleCode = await fetchViaHttp(input.normalizedPath, input.adapter, input.fetchAndCacheModule, input.log, input.projectSlug, input.isLocalProject, input.dependencyPinningCacheKey, {
|
|
16
|
+
esmCacheDir: input.esmCacheDir,
|
|
17
|
+
moduleServerOrigin: input.moduleServerOrigin,
|
|
18
|
+
strictMissingModules: input.strictMissingModules ?? true,
|
|
19
|
+
});
|
|
16
20
|
if (moduleCode) {
|
|
17
21
|
return await cacheLocalModule(input.normalizedPath, moduleCode, input.esmCacheDir, input.pathCache, input.log, input.reactVersion, input.dependencyPinningCacheKey, input.moduleServerOrigin);
|
|
18
22
|
}
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
import type { Logger } from "../../../../utils/index.js";
|
|
10
10
|
import type { RuntimeAdapter } from "../../../../platform/adapters/base.js";
|
|
11
11
|
export interface FetchModuleViaHttpOptions {
|
|
12
|
+
esmCacheDir?: string;
|
|
12
13
|
fetchFn?: typeof fetch;
|
|
13
14
|
moduleServerOrigin?: string;
|
|
15
|
+
strictMissingModules?: boolean;
|
|
14
16
|
timeoutMs?: number;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-fetcher.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"http-fetcher.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAkB5E,MAAM,WAAW,yBAAyB;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6GD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,cAAc,EACvB,qBAAqB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,EAChF,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,OAAO,EACxB,yBAAyB,CAAC,EAAE,MAAM,EAClC,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8KxB"}
|
|
@@ -10,7 +10,7 @@ import { SpanNames } from "../../../../observability/index.js";
|
|
|
10
10
|
import { withSpan } from "../../../../observability/tracing/otlp-setup.js";
|
|
11
11
|
import { LOG_PREFIX_MDX_LOADER } from "../constants.js";
|
|
12
12
|
import { rewriteVeryfrontImports } from "./import-rewriter.js";
|
|
13
|
-
import { findNestedImports } from "./nested-imports.js";
|
|
13
|
+
import { dynamicDependencyFailure, findNestedImports, toImportStringLiteral, } from "./nested-imports.js";
|
|
14
14
|
import { replaceSourceSpans } from "../utils/source-spans.js";
|
|
15
15
|
import { HTTP_FETCH_TIMEOUT_MS } from "../../../../utils/constants/http.js";
|
|
16
16
|
import { readHttpModuleText } from "../../../shared/http-module-response.js";
|
|
@@ -19,6 +19,7 @@ import { MAX_TIMER_DELAY_MS } from "../../../../utils/constants/limits.js";
|
|
|
19
19
|
import { parallelMap } from "../../../../utils/parallel.js";
|
|
20
20
|
import { Semaphore } from "../../../../modules/react-loader/ssr-module-loader/concurrency/semaphore.js";
|
|
21
21
|
import { assertMdxModuleImportCount, MAX_MDX_MODULE_TRANSFORM_CONCURRENCY } from "./limits.js";
|
|
22
|
+
import { createStubModule } from "../utils/stub-module.js";
|
|
22
23
|
function discardResponseBody(response) {
|
|
23
24
|
try {
|
|
24
25
|
const cancellation = response.body?.cancel();
|
|
@@ -76,7 +77,7 @@ function isNameResolutionError(error) {
|
|
|
76
77
|
* RFC 6761 only *recommends* that resolvers map the `.localhost` tree to
|
|
77
78
|
* loopback. macOS, systemd-resolved and CI honour it for arbitrary subdomains,
|
|
78
79
|
* but a plain glibc NSS setup can resolve only the bare name and fail
|
|
79
|
-
* `<slug>.localhost` with EAI_AGAIN/ENOTFOUND
|
|
80
|
+
* `<slug>.localhost` with EAI_AGAIN/ENOTFOUND, which would make this fallback
|
|
80
81
|
* unable to reach the dev server at all.
|
|
81
82
|
*
|
|
82
83
|
* Pinning the connection to 127.0.0.1 while keeping subdomain routing is not an
|
|
@@ -85,8 +86,8 @@ function isNameResolutionError(error) {
|
|
|
85
86
|
*
|
|
86
87
|
* The retry therefore carries the project in `x-project-slug`, which the dev
|
|
87
88
|
* server reads inbound (see server/context/request-context.ts and
|
|
88
|
-
* server/runtime-handler/project-resolution.ts) and which fetch
|
|
89
|
-
*
|
|
89
|
+
* server/runtime-handler/project-resolution.ts) and which fetch, unlike `Host`,
|
|
90
|
+
* is allowed to set. Without it a multi-project workspace would lose tenant
|
|
90
91
|
* identity, because resolveDefaultProjectSlug() returns undefined there.
|
|
91
92
|
*/
|
|
92
93
|
async function fetchModuleWithLoopbackFallback(fetchFn, url, init, log, projectSlug) {
|
|
@@ -164,36 +165,74 @@ export async function fetchModuleViaHTTP(normalizedPath, adapter, fetchAndCacheM
|
|
|
164
165
|
const moduleCode = rewriteVeryfrontImports(await readHttpModuleText(response, MAX_MDX_MODULE_CODE_BYTES, controller.signal));
|
|
165
166
|
const { vfModules, relative } = findNestedImports(moduleCode);
|
|
166
167
|
const allImports = [
|
|
167
|
-
...vfModules.map(({ original, path, start, end }) => ({
|
|
168
|
+
...vfModules.map(({ original, path, suffix, start, end, isDynamic, isSideEffect }) => ({
|
|
168
169
|
original,
|
|
169
170
|
path,
|
|
171
|
+
suffix,
|
|
170
172
|
start,
|
|
171
173
|
end,
|
|
174
|
+
isDynamic,
|
|
175
|
+
isSideEffect,
|
|
172
176
|
key: "nestedPath",
|
|
173
177
|
})),
|
|
174
|
-
...relative.map(({ original, path, start, end }) => ({
|
|
178
|
+
...relative.map(({ original, path, suffix, start, end, isDynamic, isSideEffect }) => ({
|
|
175
179
|
original,
|
|
176
180
|
path,
|
|
181
|
+
suffix,
|
|
177
182
|
start,
|
|
178
183
|
end,
|
|
184
|
+
isDynamic,
|
|
185
|
+
isSideEffect,
|
|
179
186
|
key: "relativePath",
|
|
180
187
|
})),
|
|
181
188
|
];
|
|
182
189
|
assertMdxModuleImportCount(normalizedPath, allImports.length);
|
|
183
|
-
const results = await parallelMap(allImports, async ({ original, path, start, end, key }) => {
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
const results = await parallelMap(allImports, async ({ original, path, suffix, start, end, isDynamic, isSideEffect, key }) => {
|
|
191
|
+
let nestedFilePath;
|
|
192
|
+
let deferredError;
|
|
193
|
+
try {
|
|
194
|
+
nestedFilePath = await fetchAndCacheModuleFn(path, normalizedPath);
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
deferredError = isDynamic
|
|
198
|
+
? dynamicDependencyFailure(path, error) ?? undefined
|
|
199
|
+
: undefined;
|
|
200
|
+
if (!deferredError || !options.esmCacheDir)
|
|
201
|
+
throw error;
|
|
202
|
+
nestedFilePath = null;
|
|
203
|
+
}
|
|
204
|
+
if (!nestedFilePath && isDynamic && options.esmCacheDir) {
|
|
205
|
+
nestedFilePath = await createStubModule(path, moduleCode, original, options.esmCacheDir, { failOnImport: options.strictMissingModules ?? true, deferredError });
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
original,
|
|
209
|
+
start,
|
|
210
|
+
end,
|
|
211
|
+
suffix,
|
|
212
|
+
isDynamic,
|
|
213
|
+
isSideEffect,
|
|
214
|
+
nestedFilePath,
|
|
215
|
+
[key]: path,
|
|
216
|
+
};
|
|
186
217
|
}, {
|
|
187
218
|
semaphore: new Semaphore(MAX_MDX_MODULE_TRANSFORM_CONCURRENCY),
|
|
188
219
|
});
|
|
189
220
|
const replacements = [];
|
|
190
|
-
for (const { original, start, end, nestedFilePath } of results) {
|
|
221
|
+
for (const { original, start, end, suffix, isDynamic, isSideEffect, nestedFilePath } of results) {
|
|
191
222
|
if (nestedFilePath) {
|
|
223
|
+
// The suffix and the cache path are author- and filesystem-controlled.
|
|
224
|
+
// Interpolating either into a hand-written double-quoted literal emits
|
|
225
|
+
// a module that fails to parse whenever one contains `"` or `\`.
|
|
226
|
+
const importTarget = toImportStringLiteral(`file://${nestedFilePath}${suffix ?? ""}`);
|
|
192
227
|
replacements.push({
|
|
193
228
|
start,
|
|
194
229
|
end,
|
|
195
230
|
expected: original,
|
|
196
|
-
replacement:
|
|
231
|
+
replacement: isDynamic
|
|
232
|
+
? importTarget
|
|
233
|
+
: isSideEffect
|
|
234
|
+
? `import ${importTarget}`
|
|
235
|
+
: `from ${importTarget}`,
|
|
197
236
|
});
|
|
198
237
|
}
|
|
199
238
|
}
|
|
@@ -4,24 +4,35 @@
|
|
|
4
4
|
* @module transforms/mdx/esm-module-loader/module-fetcher/nested-imports
|
|
5
5
|
*/
|
|
6
6
|
import type { NestedImportResult } from "../types.js";
|
|
7
|
+
import { type DeferredImportErrorDescriptor } from "../utils/stub-module.js";
|
|
7
8
|
import type { Logger } from "../../../../utils/index.js";
|
|
9
|
+
type NestedImportSpan = {
|
|
10
|
+
original: string;
|
|
11
|
+
path: string;
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
suffix?: string;
|
|
15
|
+
isDynamic?: boolean;
|
|
16
|
+
isSideEffect?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/** Return the sanitized runtime failure for a dependency error that can stay lazy. */
|
|
19
|
+
export declare function dynamicDependencyFailure(modulePath: string, error: unknown): DeferredImportErrorDescriptor | null;
|
|
20
|
+
/**
|
|
21
|
+
* Serialize a resolved module URL as a JavaScript string literal.
|
|
22
|
+
*
|
|
23
|
+
* A preserved suffix is author-controlled text (`?label="x"`, a backslash in a
|
|
24
|
+
* cache path). Wrapping it in quotes by hand emits a module that fails to
|
|
25
|
+
* parse, taking every other import in the file down with it, so every emitted
|
|
26
|
+
* specifier must go through this.
|
|
27
|
+
*/
|
|
28
|
+
export declare function toImportStringLiteral(url: string): string;
|
|
8
29
|
/**
|
|
9
30
|
* Find nested module imports in code.
|
|
10
31
|
* Matches both /_vf_modules/... and file:///_vf_modules/... patterns.
|
|
11
32
|
*/
|
|
12
33
|
export declare function findNestedImports(moduleCode: string): {
|
|
13
|
-
vfModules:
|
|
14
|
-
|
|
15
|
-
path: string;
|
|
16
|
-
start: number;
|
|
17
|
-
end: number;
|
|
18
|
-
}>;
|
|
19
|
-
relative: Array<{
|
|
20
|
-
original: string;
|
|
21
|
-
path: string;
|
|
22
|
-
start: number;
|
|
23
|
-
end: number;
|
|
24
|
-
}>;
|
|
34
|
+
vfModules: NestedImportSpan[];
|
|
35
|
+
relative: NestedImportSpan[];
|
|
25
36
|
};
|
|
26
37
|
/**
|
|
27
38
|
* Check for unresolved /_vf_modules/ imports.
|
|
@@ -68,4 +79,5 @@ export declare function resolveNestedImportBase(normalizedPath: string, actualFi
|
|
|
68
79
|
* Resolve nested /_vf_modules and relative imports into local file:// cache paths.
|
|
69
80
|
*/
|
|
70
81
|
export declare function resolveNestedModuleImports(input: ResolveNestedModuleImportsInput): Promise<string>;
|
|
82
|
+
export {};
|
|
71
83
|
//# sourceMappingURL=nested-imports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested-imports.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"nested-imports.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAoB,KAAK,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAW/F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAezD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAQF,sFAAsF;AACtF,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,GACb,6BAA6B,GAAG,IAAI,CAgDtC;AAaD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GACjB;IACD,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAoIA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAoC3F;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kBAAkB,EAAE,EAC7B,WAAW,EAAE,MAAM,EACnB,oBAAoB,EAAE,OAAO,EAC7B,gBAAgB,CAAC,EAAE,MAAM,EACzB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CA+EjB;AAED,MAAM,WAAW,+BAA+B;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAoBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,MAAM,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CAKR;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC,MAAM,CAAC,CAyFjB"}
|