veryfront 0.0.84 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -44
- package/esm/deno.d.ts +0 -1
- package/esm/deno.js +8 -9
- package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +2 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts.map +1 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
- package/esm/deps/esm.sh/react@19.1.1.d.ts +2 -0
- package/esm/deps/esm.sh/react@19.1.1.d.ts.map +1 -0
- package/esm/deps/esm.sh/react@19.1.1.js +3 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts +2 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts.map +1 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.js +3 -0
- package/esm/proxy/main.d.ts +2 -0
- package/esm/proxy/main.d.ts.map +1 -0
- package/esm/proxy/main.js +400 -0
- package/esm/src/agent/react/use-agent.js +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +1 -1
- package/esm/src/agent/react/use-completion.js +1 -1
- package/esm/src/agent/react/use-streaming.js +1 -1
- package/esm/src/agent/react/use-voice-input.js +1 -1
- package/esm/src/cli/app/components/list-select.js +2 -2
- package/esm/src/cli/app/index.d.ts +1 -1
- package/esm/src/cli/app/index.d.ts.map +1 -1
- package/esm/src/cli/app/index.js +26 -33
- package/esm/src/cli/app/state.d.ts +3 -0
- package/esm/src/cli/app/state.d.ts.map +1 -1
- package/esm/src/cli/app/state.js +4 -0
- package/esm/src/cli/app/views/dashboard.d.ts.map +1 -1
- package/esm/src/cli/app/views/dashboard.js +45 -57
- package/esm/src/cli/app/views/startup.d.ts +39 -0
- package/esm/src/cli/app/views/startup.d.ts.map +1 -0
- package/esm/src/cli/app/views/startup.js +103 -0
- package/esm/src/cli/commands/init/config-generator.js +1 -1
- package/esm/src/cli/index/arg-parser.d.ts.map +1 -1
- package/esm/src/cli/index/arg-parser.js +1 -0
- package/esm/src/cli/index/command-router.d.ts.map +1 -1
- package/esm/src/cli/index/command-router.js +54 -39
- package/esm/src/cli/index/types.d.ts +4 -0
- package/esm/src/cli/index/types.d.ts.map +1 -1
- package/esm/src/cli/mcp/advanced-tools.d.ts +2 -2
- package/esm/src/cli/ui/colors.d.ts +8 -0
- package/esm/src/cli/ui/colors.d.ts.map +1 -1
- package/esm/src/cli/ui/colors.js +34 -0
- package/esm/src/cli/ui/dot-matrix.d.ts +8 -0
- package/esm/src/cli/ui/dot-matrix.d.ts.map +1 -1
- package/esm/src/cli/ui/dot-matrix.js +67 -2
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +5 -4
- package/esm/src/html/utils.js +2 -2
- package/esm/src/modules/component-registry/registry.d.ts +1 -1
- package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.d.ts +1 -11
- package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.js +3 -20
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +7 -22
- package/esm/src/modules/import-map/resolver.d.ts.map +1 -1
- package/esm/src/modules/import-map/resolver.js +12 -8
- package/esm/src/modules/react-loader/component-loader.d.ts +1 -1
- package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/component-loader.js +2 -0
- package/esm/src/modules/react-loader/extract-component.d.ts +1 -1
- package/esm/src/modules/react-loader/extract-component.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +2 -7
- 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 +68 -38
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/types.d.ts +3 -1
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/unified-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/unified-loader.js +7 -4
- package/esm/src/modules/server/module-batch-handler.d.ts +2 -0
- package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
- package/esm/src/modules/server/module-batch-handler.js +3 -1
- package/esm/src/modules/server/module-server.d.ts +2 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +4 -2
- package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
- package/esm/src/modules/server/ssr-import-rewriter.js +9 -17
- package/esm/src/react/compat/hooks-adapter.d.ts +1 -1
- package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
- package/esm/src/react/compat/hooks-adapter.js +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts +5 -5
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.js +2 -2
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.js +1 -1
- package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
- package/esm/src/react/components/AppWrapper.d.ts +1 -1
- package/esm/src/react/components/AppWrapper.d.ts.map +1 -1
- package/esm/src/react/components/AppWrapper.js +1 -1
- package/esm/src/react/components/Head.d.ts +1 -1
- package/esm/src/react/components/Head.d.ts.map +1 -1
- package/esm/src/react/components/Head.js +7 -3
- package/esm/src/react/components/LayoutComponent.d.ts +1 -1
- package/esm/src/react/components/LayoutComponent.d.ts.map +1 -1
- package/esm/src/react/components/LayoutComponent.js +1 -1
- package/esm/src/react/components/Link.d.ts +1 -1
- package/esm/src/react/components/Link.d.ts.map +1 -1
- package/esm/src/react/components/Link.js +1 -1
- package/esm/src/react/components/MDXProvider.d.ts +1 -1
- package/esm/src/react/components/MDXProvider.d.ts.map +1 -1
- package/esm/src/react/components/MDXProvider.js +2 -2
- package/esm/src/react/components/ProviderComponent.d.ts +1 -1
- package/esm/src/react/components/ProviderComponent.d.ts.map +1 -1
- package/esm/src/react/components/ProviderComponent.js +1 -1
- package/esm/src/react/components/ai/agent-card.d.ts +2 -2
- package/esm/src/react/components/ai/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/ai/agent-card.js +1 -1
- package/esm/src/react/components/ai/chat/components/animations.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/animations.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/animations.js +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.js +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.js +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.js +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.js +1 -1
- package/esm/src/react/components/ai/chat/composition/api.d.ts +5 -4
- package/esm/src/react/components/ai/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/composition/api.js +1 -1
- package/esm/src/react/components/ai/chat/index.d.ts +8 -3
- package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.js +1 -1
- package/esm/src/react/components/ai/error-boundary.d.ts +1 -1
- package/esm/src/react/components/ai/error-boundary.d.ts.map +1 -1
- package/esm/src/react/components/ai/error-boundary.js +1 -1
- package/esm/src/react/components/ai/icons/index.d.ts +1 -1
- package/esm/src/react/components/ai/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/icons/index.js +1 -1
- package/esm/src/react/components/ai/markdown.d.ts +1 -1
- package/esm/src/react/components/ai/markdown.d.ts.map +1 -1
- package/esm/src/react/components/ai/markdown.js +1 -1
- package/esm/src/react/components/ai/message.d.ts +3 -3
- package/esm/src/react/components/ai/message.d.ts.map +1 -1
- package/esm/src/react/components/ai/message.js +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.js +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.js +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.js +1 -1
- package/esm/src/react/context/index.d.ts +1 -1
- package/esm/src/react/context/index.d.ts.map +1 -1
- package/esm/src/react/context/index.js +1 -1
- package/esm/src/react/fonts/index.d.ts +1 -1
- package/esm/src/react/fonts/index.d.ts.map +1 -1
- package/esm/src/react/fonts/index.js +1 -1
- package/esm/src/react/primitives/agent-primitives.d.ts +4 -4
- package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/agent-primitives.js +1 -1
- package/esm/src/react/primitives/chat-container.d.ts +2 -2
- package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
- package/esm/src/react/primitives/chat-container.js +1 -1
- package/esm/src/react/primitives/input-box.d.ts +4 -4
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +7 -3
- package/esm/src/react/primitives/message-list.d.ts +5 -5
- package/esm/src/react/primitives/message-list.d.ts.map +1 -1
- package/esm/src/react/primitives/message-list.js +1 -1
- package/esm/src/react/primitives/tool-primitives.d.ts +4 -4
- package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/tool-primitives.js +1 -1
- package/esm/src/react/router/index.d.ts +1 -1
- package/esm/src/react/router/index.d.ts.map +1 -1
- package/esm/src/react/router/index.js +1 -1
- package/esm/src/rendering/app-reserved.d.ts +1 -1
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +1 -1
- package/esm/src/rendering/client/router.js +1 -1
- package/esm/src/rendering/client/state-bridge.d.ts +1 -1
- package/esm/src/rendering/client/state-bridge.d.ts.map +1 -1
- package/esm/src/rendering/client/state-bridge.js +1 -1
- package/esm/src/rendering/component-handling.d.ts +3 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +4 -2
- package/esm/src/rendering/element-validator/element-normalizer.d.ts +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.js +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.js +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +2 -0
- package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.d.ts +1 -1
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +3 -0
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +74 -19
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +2 -0
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts +1 -1
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.d.ts +1 -1
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.d.ts +1 -1
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.js +4 -2
- package/esm/src/rendering/snippet-renderer.js +2 -2
- package/esm/src/rendering/ssr/component-registry.d.ts +1 -1
- package/esm/src/rendering/ssr/component-registry.d.ts.map +1 -1
- package/esm/src/rendering/ssr/component-registry.js +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
- package/esm/src/rendering/utils/react-helpers.d.ts +1 -1
- package/esm/src/rendering/utils/react-helpers.d.ts.map +1 -1
- package/esm/src/rendering/utils/react-helpers.js +1 -1
- package/esm/src/server/handlers/request/ssr/error-page-fallback.js +1 -1
- package/esm/src/server/handlers/request/ssr/not-found-fallback.js +1 -1
- package/esm/src/transforms/esm/http-bundler.d.ts +15 -4
- package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-bundler.js +105 -12
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +51 -44
- package/esm/src/transforms/esm/import-rewriter.d.ts.map +1 -1
- package/esm/src/transforms/esm/import-rewriter.js +3 -3
- package/esm/src/transforms/esm/package-registry.d.ts +15 -13
- package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
- package/esm/src/transforms/esm/package-registry.js +45 -32
- package/esm/src/transforms/esm/react-imports.d.ts.map +1 -1
- package/esm/src/transforms/esm/react-imports.js +3 -7
- package/esm/src/transforms/esm/types.d.ts +2 -0
- package/esm/src/transforms/esm/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts +14 -0
- 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 +67 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -0
- 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 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.d.ts +1 -1
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +1 -1
- package/esm/src/transforms/mdx/mdx-cache-adapter.js +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/types.d.ts +2 -2
- package/esm/src/transforms/mdx/types.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +7 -15
- package/esm/src/transforms/pipeline/stages/finalize.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/finalize.js +1 -1
- package/esm/src/types/app.d.ts +1 -1
- package/esm/src/types/app.d.ts.map +1 -1
- package/esm/src/types/global-guards.d.ts +1 -1
- package/esm/src/types/global-guards.d.ts.map +1 -1
- package/esm/src/types/index.d.ts +1 -1
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/utils/constants/cdn.d.ts.map +1 -1
- package/esm/src/utils/constants/cdn.js +22 -11
- package/esm/src/utils/hash-utils.d.ts +2 -0
- package/esm/src/utils/hash-utils.d.ts.map +1 -1
- package/esm/src/utils/hash-utils.js +4 -0
- package/esm/src/workflow/react/use-approval.js +1 -1
- package/esm/src/workflow/react/use-workflow-list.js +1 -1
- package/esm/src/workflow/react/use-workflow-start.js +1 -1
- package/esm/src/workflow/react/use-workflow.js +1 -1
- package/package.json +2 -1
- package/src/deno.js +8 -9
- package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/client.d.ts +105 -0
- package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/server.d.ts +162 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/global.d.ts +165 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/index.d.ts +4267 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/global.d.ts +165 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/index.d.ts +4267 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/jsx-runtime.d.ts +36 -0
- package/src/deps/esm.sh/@types/scheduler@0.26.0/index.d.ts +30 -0
- package/src/deps/esm.sh/csstype@3.2.3/index.d.ts +22569 -0
- package/src/deps/esm.sh/react-dom@19.1.1/client.d.ts +105 -0
- package/src/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
- package/src/deps/esm.sh/react-dom@19.1.1/server.d.ts +162 -0
- package/src/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
- package/src/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +36 -0
- package/src/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
- package/src/deps/esm.sh/react@19.1.1.d.ts +4267 -0
- package/src/deps/esm.sh/react@19.1.1.js +3 -0
- package/src/deps/esm.sh/scheduler@^0.26.0.d.ts +30 -0
- package/src/deps/esm.sh/scheduler@^0.26.0.js +3 -0
- package/src/proxy/main.ts +471 -0
- package/src/src/agent/react/use-agent.ts +1 -1
- package/src/src/agent/react/use-chat/use-chat.ts +1 -1
- package/src/src/agent/react/use-completion.ts +1 -1
- package/src/src/agent/react/use-streaming.ts +1 -1
- package/src/src/agent/react/use-voice-input.ts +1 -1
- package/src/src/cli/app/components/list-select.ts +2 -2
- package/src/src/cli/app/index.ts +34 -35
- package/src/src/cli/app/state.ts +7 -0
- package/src/src/cli/app/views/dashboard.ts +46 -60
- package/src/src/cli/app/views/startup.ts +132 -0
- package/src/src/cli/commands/init/config-generator.ts +1 -1
- package/src/src/cli/index/arg-parser.ts +1 -0
- package/src/src/cli/index/command-router.ts +57 -40
- package/src/src/cli/index/types.ts +5 -0
- package/src/src/cli/ui/colors.ts +37 -0
- package/src/src/cli/ui/dot-matrix.ts +77 -1
- package/src/src/config/loader.ts +5 -4
- package/src/src/html/utils.ts +2 -2
- package/src/src/modules/component-registry/registry.ts +1 -1
- package/src/src/modules/import-map/default-import-map.ts +3 -25
- package/src/src/modules/import-map/loader.ts +7 -23
- package/src/src/modules/import-map/resolver.ts +13 -8
- package/src/src/modules/react-loader/component-loader.ts +3 -1
- package/src/src/modules/react-loader/extract-component.ts +1 -1
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +95 -68
- package/src/src/modules/react-loader/ssr-module-loader/types.ts +2 -0
- package/src/src/modules/react-loader/types.ts +3 -1
- package/src/src/modules/react-loader/unified-loader.ts +7 -4
- package/src/src/modules/server/module-batch-handler.ts +7 -0
- package/src/src/modules/server/module-server.ts +6 -1
- package/src/src/modules/server/ssr-import-rewriter.ts +9 -17
- package/src/src/react/compat/hooks-adapter.ts +1 -1
- package/src/src/react/compat/ssr-adapter/response-builder.ts +1 -1
- package/src/src/react/compat/ssr-adapter/server-loader.ts +10 -10
- package/src/src/react/compat/ssr-adapter/stream-renderer.ts +2 -2
- package/src/src/react/compat/ssr-adapter/string-renderer.ts +3 -3
- package/src/src/react/compat/version-detector/feature-detector.ts +1 -1
- package/src/src/react/components/AppWrapper.tsx +1 -1
- package/src/src/react/components/Head.tsx +7 -3
- package/src/src/react/components/LayoutComponent.tsx +2 -2
- package/src/src/react/components/Link.tsx +1 -1
- package/src/src/react/components/MDXProvider.tsx +2 -2
- package/src/src/react/components/ProviderComponent.tsx +2 -2
- package/src/src/react/components/ai/agent-card.tsx +1 -1
- package/src/src/react/components/ai/chat/components/animations.tsx +1 -1
- package/src/src/react/components/ai/chat/components/empty-state.tsx +1 -1
- package/src/src/react/components/ai/chat/components/message-actions.tsx +1 -1
- package/src/src/react/components/ai/chat/components/reasoning.tsx +1 -1
- package/src/src/react/components/ai/chat/components/tool-ui.tsx +1 -1
- package/src/src/react/components/ai/chat/composition/api.tsx +1 -1
- package/src/src/react/components/ai/chat/index.tsx +1 -1
- package/src/src/react/components/ai/error-boundary.tsx +1 -1
- package/src/src/react/components/ai/icons/index.ts +1 -1
- package/src/src/react/components/ai/markdown.tsx +1 -1
- package/src/src/react/components/ai/message.tsx +1 -1
- package/src/src/react/components/optimized-image/OptimizedBackgroundImage.tsx +1 -1
- package/src/src/react/components/optimized-image/OptimizedImage.tsx +1 -1
- package/src/src/react/components/optimized-image/SimpleOptimizedImage.tsx +1 -1
- package/src/src/react/components/optimized-image/utils.tsx +1 -1
- package/src/src/react/context/index.ts +1 -1
- package/src/src/react/fonts/index.ts +1 -1
- package/src/src/react/primitives/agent-primitives.tsx +1 -1
- package/src/src/react/primitives/chat-container.tsx +1 -1
- package/src/src/react/primitives/input-box.tsx +5 -3
- package/src/src/react/primitives/message-list.tsx +1 -1
- package/src/src/react/primitives/tool-primitives.tsx +1 -1
- package/src/src/react/router/index.ts +1 -1
- package/src/src/rendering/app-reserved.ts +1 -1
- package/src/src/rendering/client/router.ts +2 -2
- package/src/src/rendering/client/state-bridge.ts +2 -2
- package/src/src/rendering/component-handling.ts +7 -1
- package/src/src/rendering/element-validator/element-inspector.ts +1 -1
- package/src/src/rendering/element-validator/element-normalizer.ts +1 -1
- package/src/src/rendering/element-validator/primitive-checks.ts +1 -1
- package/src/src/rendering/element-validator/validator-core.ts +1 -1
- package/src/src/rendering/layouts/layout-applicator.ts +5 -6
- package/src/src/rendering/layouts/utils/applicator.ts +1 -1
- package/src/src/rendering/layouts/utils/component-loader.ts +1 -1
- package/src/src/rendering/layouts/utils/ensure-valid-child.ts +1 -1
- package/src/src/rendering/orchestrator/layout.ts +1 -1
- package/src/src/rendering/orchestrator/module-loader/index.ts +91 -20
- package/src/src/rendering/orchestrator/pipeline.ts +2 -0
- package/src/src/rendering/orchestrator/ssr-orchestrator.ts +2 -2
- package/src/src/rendering/page-renderer.ts +1 -1
- package/src/src/rendering/page-rendering.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/component-detector.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/rsc-renderer.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/tree-processor.ts +14 -4
- package/src/src/rendering/snippet-renderer.ts +2 -2
- package/src/src/rendering/ssr/component-registry.ts +1 -1
- package/src/src/rendering/ssr-renderer.ts +1 -1
- package/src/src/rendering/utils/react-helpers.ts +1 -1
- package/src/src/server/build-app-route-renderer.ts +2 -2
- package/src/src/server/handlers/request/rsc/handlers/render-handler.ts +1 -1
- package/src/src/server/handlers/request/ssr/error-page-fallback.ts +2 -2
- package/src/src/server/handlers/request/ssr/not-found-fallback.ts +1 -1
- package/src/src/transforms/esm/http-bundler.ts +101 -11
- package/src/src/transforms/esm/http-cache.ts +53 -45
- package/src/src/transforms/esm/import-rewriter.ts +5 -3
- package/src/src/transforms/esm/package-registry.ts +46 -32
- package/src/src/transforms/esm/react-imports.ts +3 -7
- package/src/src/transforms/esm/types.ts +2 -0
- package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +84 -0
- package/src/src/transforms/mdx/esm-module-loader/loader.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/types.ts +4 -0
- package/src/src/transforms/mdx/index.ts +1 -1
- package/src/src/transforms/mdx/mdx-cache-adapter.ts +1 -1
- package/src/src/transforms/mdx/module-loader/types.ts +1 -1
- package/src/src/transforms/mdx/types.ts +2 -2
- package/src/src/transforms/pipeline/context.ts +7 -18
- package/src/src/transforms/pipeline/stages/finalize.ts +6 -1
- package/src/src/transforms/plugins/babel-node-positions.ts +2 -2
- package/src/src/types/app.ts +1 -1
- package/src/src/types/global-guards.ts +1 -1
- package/src/src/types/index.ts +1 -1
- package/src/src/utils/constants/cdn.ts +21 -12
- package/src/src/utils/hash-utils.ts +5 -0
- package/src/src/workflow/react/use-approval.ts +1 -1
- package/src/src/workflow/react/use-workflow-list.ts +1 -1
- package/src/src/workflow/react/use-workflow-start.ts +1 -1
- package/src/src/workflow/react/use-workflow.ts +1 -1
|
@@ -134,40 +134,133 @@ export function createHTTPPlugin() {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
|
-
* Ensure esm.sh URLs have
|
|
138
|
-
* This makes them import React as
|
|
137
|
+
* Ensure esm.sh URLs have external=react,react-dom for SSR.
|
|
138
|
+
* This makes them import React as bare specifiers, which the import map resolves.
|
|
139
139
|
*
|
|
140
140
|
* Uses two esm.sh features:
|
|
141
|
-
* - `external=react` - Don't bundle React, let import map resolve
|
|
141
|
+
* - `external=react,react-dom` - Don't bundle React/ReactDOM, let import map resolve them
|
|
142
142
|
* - `deps=react@X,react-dom@X` - Pin dependency versions to prevent mismatches
|
|
143
|
+
*
|
|
144
|
+
* Logic for external handling:
|
|
145
|
+
* 1. If no `external=` param → add `external=react,react-dom`
|
|
146
|
+
* 2. If `external=X` exists but no `react` → append `,react,react-dom`
|
|
147
|
+
* 3. If has `react` but no `react-dom` → append `,react-dom`
|
|
148
|
+
* 4. If has both `react` AND `react-dom` → leave alone
|
|
149
|
+
*
|
|
150
|
+
* @param code - Source code to process
|
|
151
|
+
* @param _cacheDir - Unused (kept for API compatibility)
|
|
152
|
+
* @param hash - Hash for logging
|
|
153
|
+
* @param reactVersion - React version for deps param (defaults to REACT_VERSION)
|
|
143
154
|
*/
|
|
144
|
-
export function bundleHttpImports(code, _cacheDir, hash) {
|
|
155
|
+
export function bundleHttpImports(code, _cacheDir, hash, reactVersion) {
|
|
145
156
|
const has = hasHttpImports(code);
|
|
146
157
|
logger.debug(`${LOG_PREFIX} Check: hasHttp=${has}, hash=${hash.slice(0, 8)}`);
|
|
147
158
|
if (!has)
|
|
148
159
|
return code;
|
|
160
|
+
const version = reactVersion ?? REACT_VERSION;
|
|
149
161
|
return replaceSpecifiers(code, (specifier) => {
|
|
162
|
+
// Handle relative esm.sh paths like "/react-dom?target=es2022" or "/hoist-non-react-statics@..."
|
|
163
|
+
// These are returned by esm.sh stub modules and need to be converted to full URLs
|
|
164
|
+
if (specifier.startsWith("/") && !specifier.startsWith("//")) {
|
|
165
|
+
const fullUrl = `https://esm.sh${specifier}`;
|
|
166
|
+
// Recursively process as full URL (will add external params if needed)
|
|
167
|
+
const isReactPackage = /^\/react(-dom)?(@|\/|\?|$)/.test(specifier);
|
|
168
|
+
if (isReactPackage) {
|
|
169
|
+
// React packages - just ensure target and return full URL
|
|
170
|
+
if (!specifier.includes("target=")) {
|
|
171
|
+
const joiner = specifier.includes("?") ? "&" : "?";
|
|
172
|
+
return `${fullUrl}${joiner}target=es2022`;
|
|
173
|
+
}
|
|
174
|
+
return fullUrl;
|
|
175
|
+
}
|
|
176
|
+
// Non-React packages - add external params
|
|
177
|
+
const params = [];
|
|
178
|
+
if (!specifier.includes("target="))
|
|
179
|
+
params.push("target=es2022");
|
|
180
|
+
if (!specifier.includes("external="))
|
|
181
|
+
params.push("external=react,react-dom");
|
|
182
|
+
if (!specifier.includes("deps="))
|
|
183
|
+
params.push(`deps=react@${version},react-dom@${version}`);
|
|
184
|
+
if (params.length === 0)
|
|
185
|
+
return fullUrl;
|
|
186
|
+
const joiner = specifier.includes("?") ? "&" : "?";
|
|
187
|
+
return `${fullUrl}${joiner}${params.join("&")}`;
|
|
188
|
+
}
|
|
150
189
|
const isEsmSh = specifier.startsWith("https://esm.sh/") ||
|
|
151
190
|
specifier.startsWith("http://esm.sh/");
|
|
152
191
|
const isVfEsm = specifier.startsWith("https://esm.veryfront.com/");
|
|
153
192
|
if (!isEsmSh && !isVfEsm)
|
|
154
193
|
return null;
|
|
194
|
+
// Don't modify React/ReactDOM package URLs themselves
|
|
155
195
|
const isReactPackage = /\/react(-dom)?(@|\/|$)/.test(specifier);
|
|
196
|
+
if (isReactPackage) {
|
|
197
|
+
// Just ensure target is set for React packages
|
|
198
|
+
if (!specifier.includes("target=")) {
|
|
199
|
+
const joiner = specifier.includes("?") ? "&" : "?";
|
|
200
|
+
return `${specifier}${joiner}target=es2022`;
|
|
201
|
+
}
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
// For non-React packages: ensure external=react,react-dom and deps
|
|
156
205
|
const params = [];
|
|
157
206
|
if (!specifier.includes("target=")) {
|
|
158
207
|
params.push("target=es2022");
|
|
159
208
|
}
|
|
160
|
-
//
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
209
|
+
// Handle external param - ensure both react AND react-dom are externalized
|
|
210
|
+
const hasExternal = specifier.includes("external=");
|
|
211
|
+
const hasReactExternal = specifier.includes("external=react") ||
|
|
212
|
+
/external=[^&]*\breact\b/.test(specifier);
|
|
213
|
+
const hasReactDomExternal = /external=[^&]*react-dom/.test(specifier);
|
|
214
|
+
if (!hasExternal) {
|
|
215
|
+
// No external param - add both
|
|
216
|
+
params.push("external=react,react-dom");
|
|
217
|
+
}
|
|
218
|
+
else if (!hasReactExternal) {
|
|
219
|
+
// Has external but no react - append react,react-dom
|
|
220
|
+
// This requires modifying existing param, so we'll use URL parsing
|
|
221
|
+
try {
|
|
222
|
+
const url = new URL(specifier);
|
|
223
|
+
const existing = url.searchParams.get("external") || "";
|
|
224
|
+
url.searchParams.set("external", `${existing},react,react-dom`);
|
|
225
|
+
// Return full modified URL and skip other param additions
|
|
226
|
+
if (!specifier.includes("target=")) {
|
|
227
|
+
url.searchParams.set("target", "es2022");
|
|
228
|
+
}
|
|
229
|
+
if (!specifier.includes("deps=")) {
|
|
230
|
+
url.searchParams.set("deps", `react@${version},react-dom@${version}`);
|
|
231
|
+
}
|
|
232
|
+
logger.debug(`${LOG_PREFIX} ${specifier} -> ${url.toString()}`);
|
|
233
|
+
return url.toString();
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
// Fallback: just add as new param (may create duplicate)
|
|
237
|
+
params.push("external=react,react-dom");
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else if (!hasReactDomExternal) {
|
|
241
|
+
// Has react but not react-dom - append react-dom
|
|
242
|
+
try {
|
|
243
|
+
const url = new URL(specifier);
|
|
244
|
+
const existing = url.searchParams.get("external") || "";
|
|
245
|
+
url.searchParams.set("external", `${existing},react-dom`);
|
|
246
|
+
if (!specifier.includes("target=")) {
|
|
247
|
+
url.searchParams.set("target", "es2022");
|
|
248
|
+
}
|
|
249
|
+
if (!specifier.includes("deps=")) {
|
|
250
|
+
url.searchParams.set("deps", `react@${version},react-dom@${version}`);
|
|
251
|
+
}
|
|
252
|
+
logger.debug(`${LOG_PREFIX} ${specifier} -> ${url.toString()}`);
|
|
253
|
+
return url.toString();
|
|
166
254
|
}
|
|
167
|
-
|
|
168
|
-
|
|
255
|
+
catch {
|
|
256
|
+
// Fallback
|
|
257
|
+
params.push("external=react-dom");
|
|
169
258
|
}
|
|
170
259
|
}
|
|
260
|
+
// else: has both react and react-dom - no external changes needed
|
|
261
|
+
if (!specifier.includes("deps=")) {
|
|
262
|
+
params.push(`deps=react@${version},react-dom@${version}`);
|
|
263
|
+
}
|
|
171
264
|
if (params.length === 0)
|
|
172
265
|
return null;
|
|
173
266
|
const joiner = specifier.includes("?") ? "&" : "?";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAezE,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAoVF;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA8D9F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAClD,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAiInB"}
|
|
@@ -10,23 +10,26 @@ import * as dntShim from "../../../_dnt.shims.js";
|
|
|
10
10
|
import { createFileSystem, exists } from "../../platform/compat/fs.js";
|
|
11
11
|
import { isAbsolute, join } from "../../platform/compat/path/index.js";
|
|
12
12
|
import { cwd } from "../../platform/compat/process.js";
|
|
13
|
+
import { isDeno } from "../../platform/compat/runtime.js";
|
|
13
14
|
import { rendererLogger as logger } from "../../utils/index.js";
|
|
14
15
|
import { simpleHash } from "../../utils/hash-utils.js";
|
|
15
16
|
import { LRUCache } from "../../utils/lru-wrapper.js";
|
|
16
17
|
import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
17
18
|
import { SpanNames } from "../../observability/tracing/span-names.js";
|
|
18
19
|
import { resolveImport } from "../../modules/import-map/resolver.js";
|
|
19
|
-
import {
|
|
20
|
-
import { getDenoNpmReactMap, getReactImportMap, REACT_VERSION } from "./package-registry.js";
|
|
20
|
+
import { getReactImportMap, REACT_VERSION } from "./package-registry.js";
|
|
21
21
|
import { parseImports, replaceSpecifiers } from "./lexer.js";
|
|
22
22
|
import { CacheBackends, createDistributedCacheAccessor } from "../../cache/backend.js";
|
|
23
23
|
import { HTTP_MODULE_CACHE_MAX_ENTRIES, HTTP_MODULE_DISTRIBUTED_TTL_SEC, } from "../../utils/constants/cache.js";
|
|
24
24
|
/** Lazy-loaded distributed cache backend for cross-pod sharing */
|
|
25
25
|
const getDistributedCache = createDistributedCacheAccessor(() => CacheBackends.httpModule(), "HTTP-CACHE");
|
|
26
|
-
/** TTL for cached modules in distributed cache (uses centralized config) */
|
|
27
|
-
const DISTRIBUTED_CACHE_TTL_SECONDS = HTTP_MODULE_DISTRIBUTED_TTL_SEC;
|
|
28
26
|
const cachedPaths = new LRUCache({ maxEntries: HTTP_MODULE_CACHE_MAX_ENTRIES });
|
|
29
27
|
const processingStack = new Set();
|
|
28
|
+
/** Tracks last TTL refresh per hash. Refresh every 4h to keep 20h+ remaining (24h total). */
|
|
29
|
+
const lastDistributedRefresh = new LRUCache({
|
|
30
|
+
maxEntries: HTTP_MODULE_CACHE_MAX_ENTRIES,
|
|
31
|
+
});
|
|
32
|
+
const DISTRIBUTED_REFRESH_INTERVAL_MS = 4 * 60 * 60 * 1000;
|
|
30
33
|
function ensureAbsoluteDir(path) {
|
|
31
34
|
return isAbsolute(path) ? path : join(cwd(), path);
|
|
32
35
|
}
|
|
@@ -36,13 +39,24 @@ function isHttpUrl(specifier) {
|
|
|
36
39
|
/**
|
|
37
40
|
* Check if a URL is for React core packages.
|
|
38
41
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* React instance.
|
|
42
|
+
* React core modules (react, react-dom) must NOT be cached/bundled.
|
|
43
|
+
* Instead, all packages use external=react and import from the same esm.sh URL.
|
|
44
|
+
* This prevents multiple React instances which causes "useContext is null" errors.
|
|
43
45
|
*/
|
|
44
|
-
function isReactCoreUrl(
|
|
45
|
-
|
|
46
|
+
function isReactCoreUrl(url) {
|
|
47
|
+
try {
|
|
48
|
+
const parsed = new URL(url);
|
|
49
|
+
if (!parsed.hostname.includes("esm.sh"))
|
|
50
|
+
return false;
|
|
51
|
+
// Extract package name from esm.sh pathname
|
|
52
|
+
// Formats: /react@version, /v150/react@version, /stable/react@version
|
|
53
|
+
const pathname = parsed.pathname.replace(/^\/(v\d+|stable)\//, "/");
|
|
54
|
+
const match = pathname.match(/^\/(react|react-dom)(@[\d.]+)?(?:\/|$|\?)/);
|
|
55
|
+
return match !== null;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
46
60
|
}
|
|
47
61
|
function isExternalScheme(specifier) {
|
|
48
62
|
return specifier.startsWith("node:") ||
|
|
@@ -98,25 +112,8 @@ function toEsmShUrlFromNpm(specifier) {
|
|
|
98
112
|
return `https://esm.sh/${specifier.slice(4)}`;
|
|
99
113
|
}
|
|
100
114
|
function resolveBareSpecifier(specifier, importMap, reactVersion = REACT_VERSION) {
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
// See: https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong
|
|
104
|
-
if (isDeno) {
|
|
105
|
-
const denoReactMap = getDenoNpmReactMap(reactVersion);
|
|
106
|
-
const denoMatch = denoReactMap[specifier];
|
|
107
|
-
if (denoMatch)
|
|
108
|
-
return denoMatch;
|
|
109
|
-
// For unknown react/* or react-dom/* subpaths, construct npm: specifiers
|
|
110
|
-
if (specifier.startsWith("react/") && !specifier.startsWith("react-dom")) {
|
|
111
|
-
const subpath = specifier.slice("react/".length);
|
|
112
|
-
return `npm:react@${reactVersion}/${subpath}`;
|
|
113
|
-
}
|
|
114
|
-
if (specifier.startsWith("react-dom/")) {
|
|
115
|
-
const subpath = specifier.slice("react-dom/".length);
|
|
116
|
-
return `npm:react-dom@${reactVersion}/${subpath}`;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
// For non-Deno runtimes: Use esm.sh URLs with consistent versioning.
|
|
115
|
+
// Use esm.sh URLs for React - NO npm: specifiers per plan requirements.
|
|
116
|
+
// All packages use external=react to share the same React instance.
|
|
120
117
|
const reactMap = getReactImportMap(reactVersion);
|
|
121
118
|
const reactMapped = reactMap[specifier];
|
|
122
119
|
if (reactMapped)
|
|
@@ -151,23 +148,28 @@ async function cacheHttpModule(url, options) {
|
|
|
151
148
|
const fs = createFileSystem();
|
|
152
149
|
if (await exists(cachePath)) {
|
|
153
150
|
cachedPaths.set(cacheKey, cachePath);
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
// Synchronous to guarantee data is stored before other pods need it
|
|
151
|
+
// Refresh distributed cache TTL so bundles outlive transforms that reference them.
|
|
152
|
+
// Without this, bundles expire (24h) while SSR transforms (6h) are still valid.
|
|
157
153
|
const distributed = await getDistributedCache();
|
|
158
154
|
if (distributed) {
|
|
159
155
|
const hash = simpleHash(normalizedUrl);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
156
|
+
const hashStr = String(hash);
|
|
157
|
+
const now = Date.now();
|
|
158
|
+
const lastRefresh = lastDistributedRefresh.get(hashStr);
|
|
159
|
+
const needsRefresh = !lastRefresh || (now - lastRefresh > DISTRIBUTED_REFRESH_INTERVAL_MS);
|
|
160
|
+
if (needsRefresh) {
|
|
161
|
+
try {
|
|
163
162
|
const code = await fs.readTextFile(cachePath);
|
|
164
|
-
await
|
|
165
|
-
|
|
163
|
+
await Promise.all([
|
|
164
|
+
distributed.set(`code:${hash}`, code, HTTP_MODULE_DISTRIBUTED_TTL_SEC),
|
|
165
|
+
distributed.set(`hash:${hash}`, normalizedUrl, HTTP_MODULE_DISTRIBUTED_TTL_SEC),
|
|
166
|
+
]);
|
|
167
|
+
lastDistributedRefresh.set(hashStr, now);
|
|
168
|
+
logger.debug("[HTTP-CACHE] Refreshed distributed cache TTL", { hash });
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
logger.debug("[HTTP-CACHE] Distributed cache refresh failed", { hash, error });
|
|
166
172
|
}
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
// Log but don't fail - backfill is best-effort
|
|
170
|
-
logger.debug("[HTTP-CACHE] Backfill failed, continuing", { hash, error });
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
return cachePath;
|
|
@@ -232,9 +234,9 @@ async function cacheHttpModule(url, options) {
|
|
|
232
234
|
const hash = simpleHash(normalizedUrl);
|
|
233
235
|
try {
|
|
234
236
|
await Promise.all([
|
|
235
|
-
distributed.set(normalizedUrl, code,
|
|
236
|
-
distributed.set(`code:${hash}`, code,
|
|
237
|
-
distributed.set(`hash:${hash}`, normalizedUrl,
|
|
237
|
+
distributed.set(normalizedUrl, code, HTTP_MODULE_DISTRIBUTED_TTL_SEC),
|
|
238
|
+
distributed.set(`code:${hash}`, code, HTTP_MODULE_DISTRIBUTED_TTL_SEC),
|
|
239
|
+
distributed.set(`hash:${hash}`, normalizedUrl, HTTP_MODULE_DISTRIBUTED_TTL_SEC),
|
|
238
240
|
]);
|
|
239
241
|
}
|
|
240
242
|
catch (error) {
|
|
@@ -264,6 +266,11 @@ async function resolveSpecifier(specifier, baseUrl, options) {
|
|
|
264
266
|
if (!baseUrl || !isHttpUrl(baseUrl))
|
|
265
267
|
return null;
|
|
266
268
|
const resolved = new URL(specifier, baseUrl).toString();
|
|
269
|
+
// For React core URLs: return the full esm.sh URL (not cached, to prevent multiple instances)
|
|
270
|
+
// This transforms relative paths like "/react-dom?..." to "https://esm.sh/react-dom?..."
|
|
271
|
+
if (isReactCoreUrl(resolved)) {
|
|
272
|
+
return normalizeHttpUrl(resolved);
|
|
273
|
+
}
|
|
267
274
|
const cached = await cacheHttpModule(resolved, options);
|
|
268
275
|
return cached ? `file://${cached}` : null;
|
|
269
276
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/import-rewriter.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB1F;
|
|
1
|
+
{"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/import-rewriter.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB1F;AAoDD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB3F;AAWD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAgEjB"}
|
|
@@ -40,9 +40,9 @@ function normalizeVersionedSpecifier(specifier) {
|
|
|
40
40
|
}
|
|
41
41
|
const REACT_IMPORT_MAP = {
|
|
42
42
|
react: `https://esm.sh/react@${REACT_DEFAULT_VERSION}?target=es2022`,
|
|
43
|
-
"react-dom": `https://esm.sh/react-dom@${REACT_DEFAULT_VERSION}?target=es2022`,
|
|
44
|
-
"react-dom/client": `https://esm.sh/react-dom@${REACT_DEFAULT_VERSION}/client?target=es2022`,
|
|
45
|
-
"react-dom/server": `https://esm.sh/react-dom@${REACT_DEFAULT_VERSION}/server?target=es2022`,
|
|
43
|
+
"react-dom": `https://esm.sh/react-dom@${REACT_DEFAULT_VERSION}?external=react&target=es2022`,
|
|
44
|
+
"react-dom/client": `https://esm.sh/react-dom@${REACT_DEFAULT_VERSION}/client?external=react&target=es2022`,
|
|
45
|
+
"react-dom/server": `https://esm.sh/react-dom@${REACT_DEFAULT_VERSION}/server?external=react&target=es2022`,
|
|
46
46
|
"react/jsx-runtime": `https://esm.sh/react@${REACT_DEFAULT_VERSION}/jsx-runtime?target=es2022`,
|
|
47
47
|
"react/jsx-dev-runtime": `https://esm.sh/react@${REACT_DEFAULT_VERSION}/jsx-dev-runtime?target=es2022`,
|
|
48
48
|
};
|
|
@@ -8,13 +8,20 @@
|
|
|
8
8
|
export declare const DEFAULT_REACT_VERSION = "19.1.1";
|
|
9
9
|
export declare const TAILWIND_VERSION = "4.1.8";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Validate React version format (semver: X.Y.Z).
|
|
12
|
+
* Returns true if valid, false otherwise.
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function isValidReactVersion(version: string): boolean;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* Returns
|
|
16
|
+
* Validate and normalize React version.
|
|
17
|
+
* Returns the version if valid, or DEFAULT_REACT_VERSION if invalid.
|
|
18
|
+
* Logs a warning if the version is invalid.
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeReactVersion(version: string | undefined): string;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Global React version is no longer supported.
|
|
23
|
+
* Use config.react.version passed through TransformOptions instead.
|
|
24
|
+
* This function now always returns DEFAULT_REACT_VERSION.
|
|
18
25
|
*/
|
|
19
26
|
export declare function getReactVersion(): string;
|
|
20
27
|
/** @deprecated Use DEFAULT_REACT_VERSION or getReactVersion() */
|
|
@@ -66,14 +73,9 @@ export declare function getReactUrls(version?: string): Record<string, string>;
|
|
|
66
73
|
*/
|
|
67
74
|
export declare function getReactImportMap(version?: string): Record<string, string>;
|
|
68
75
|
/**
|
|
69
|
-
* Get React
|
|
70
|
-
* Uses
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* Benefits over esm.sh:
|
|
74
|
-
* - Automatic semantic version deduplication (like Node's node_modules)
|
|
75
|
-
* - No manual external= flags or shared-*.ts wrapper files needed
|
|
76
|
-
* - Native support in Deno 2+
|
|
76
|
+
* Get React esm.sh URLs for Deno SSR.
|
|
77
|
+
* Uses esm.sh for both SSR and browser to ensure identical React instances.
|
|
78
|
+
* All sub-packages use external=react to share the same React instance.
|
|
77
79
|
*
|
|
78
80
|
* @param version - React version to use (defaults to REACT_VERSION)
|
|
79
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-registry.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/package-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,gBAAgB,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"package-registry.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/package-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAOzE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa,WAAwB,CAAC;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAa1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAI9F;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO1E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU3E"}
|
|
@@ -7,21 +7,33 @@
|
|
|
7
7
|
/** Default React version - used when not specified in project config */
|
|
8
8
|
export const DEFAULT_REACT_VERSION = "19.1.1";
|
|
9
9
|
export const TAILWIND_VERSION = "4.1.8";
|
|
10
|
-
/** Cached React version from project config */
|
|
11
|
-
let configuredReactVersion = null;
|
|
12
10
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Validate React version format (semver: X.Y.Z).
|
|
12
|
+
* Returns true if valid, false otherwise.
|
|
15
13
|
*/
|
|
16
|
-
export function
|
|
17
|
-
|
|
14
|
+
export function isValidReactVersion(version) {
|
|
15
|
+
return /^\d+\.\d+\.\d+$/.test(version);
|
|
18
16
|
}
|
|
19
17
|
/**
|
|
20
|
-
*
|
|
21
|
-
* Returns
|
|
18
|
+
* Validate and normalize React version.
|
|
19
|
+
* Returns the version if valid, or DEFAULT_REACT_VERSION if invalid.
|
|
20
|
+
* Logs a warning if the version is invalid.
|
|
21
|
+
*/
|
|
22
|
+
export function normalizeReactVersion(version) {
|
|
23
|
+
if (!version)
|
|
24
|
+
return DEFAULT_REACT_VERSION;
|
|
25
|
+
if (isValidReactVersion(version))
|
|
26
|
+
return version;
|
|
27
|
+
console.warn(`[VERYFRONT] Invalid React version format "${version}" (expected X.Y.Z). Using default: ${DEFAULT_REACT_VERSION}`);
|
|
28
|
+
return DEFAULT_REACT_VERSION;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Global React version is no longer supported.
|
|
32
|
+
* Use config.react.version passed through TransformOptions instead.
|
|
33
|
+
* This function now always returns DEFAULT_REACT_VERSION.
|
|
22
34
|
*/
|
|
23
35
|
export function getReactVersion() {
|
|
24
|
-
return
|
|
36
|
+
return DEFAULT_REACT_VERSION;
|
|
25
37
|
}
|
|
26
38
|
/** @deprecated Use DEFAULT_REACT_VERSION or getReactVersion() */
|
|
27
39
|
export const REACT_VERSION = DEFAULT_REACT_VERSION;
|
|
@@ -43,8 +55,14 @@ export const REACT_VERSION = DEFAULT_REACT_VERSION;
|
|
|
43
55
|
* v12: Store HTTP bundle code by hash for direct recovery (code:{hash})
|
|
44
56
|
*/
|
|
45
57
|
export const TRANSFORM_CACHE_VERSION = 12;
|
|
46
|
-
|
|
47
|
-
|
|
58
|
+
/** csstype version - must match deno.json for type consistency */
|
|
59
|
+
const CSSTYPE_VERSION = "3.2.3";
|
|
60
|
+
/** Build esm.sh URL with deps=csstype for React packages (ensures type consistency) */
|
|
61
|
+
function esmShReact(pkg, version, path = "", external = false) {
|
|
62
|
+
const params = external
|
|
63
|
+
? [`external=react`, `target=es2022`, `deps=csstype@${CSSTYPE_VERSION}`]
|
|
64
|
+
: [`target=es2022`, `deps=csstype@${CSSTYPE_VERSION}`];
|
|
65
|
+
return `https://esm.sh/${pkg}@${version}${path}?${params.join("&")}`;
|
|
48
66
|
}
|
|
49
67
|
/**
|
|
50
68
|
* Generate esm.sh URL for browser.
|
|
@@ -70,12 +88,12 @@ export function getEsmShUrl(pkg, version, external) {
|
|
|
70
88
|
export function getReactUrls(version) {
|
|
71
89
|
const v = version ?? getReactVersion();
|
|
72
90
|
return {
|
|
73
|
-
react:
|
|
74
|
-
"react-dom":
|
|
75
|
-
"react-dom/client":
|
|
76
|
-
"react-dom/server":
|
|
77
|
-
"react/jsx-runtime":
|
|
78
|
-
"react/jsx-dev-runtime":
|
|
91
|
+
react: esmShReact("react", v),
|
|
92
|
+
"react-dom": esmShReact("react-dom", v, "", true),
|
|
93
|
+
"react-dom/client": esmShReact("react-dom", v, "/client", true),
|
|
94
|
+
"react-dom/server": esmShReact("react-dom", v, "/server", true),
|
|
95
|
+
"react/jsx-runtime": esmShReact("react", v, "/jsx-runtime", true),
|
|
96
|
+
"react/jsx-dev-runtime": esmShReact("react", v, "/jsx-dev-runtime", true),
|
|
79
97
|
};
|
|
80
98
|
}
|
|
81
99
|
/**
|
|
@@ -93,29 +111,24 @@ export function getReactImportMap(version) {
|
|
|
93
111
|
return {
|
|
94
112
|
...getReactUrls(v),
|
|
95
113
|
// Prefix match for any react/* subpath imports
|
|
96
|
-
"react/":
|
|
114
|
+
"react/": esmShReact("react", v, "/", true),
|
|
97
115
|
};
|
|
98
116
|
}
|
|
99
117
|
/**
|
|
100
|
-
* Get React
|
|
101
|
-
* Uses
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* Benefits over esm.sh:
|
|
105
|
-
* - Automatic semantic version deduplication (like Node's node_modules)
|
|
106
|
-
* - No manual external= flags or shared-*.ts wrapper files needed
|
|
107
|
-
* - Native support in Deno 2+
|
|
118
|
+
* Get React esm.sh URLs for Deno SSR.
|
|
119
|
+
* Uses esm.sh for both SSR and browser to ensure identical React instances.
|
|
120
|
+
* All sub-packages use external=react to share the same React instance.
|
|
108
121
|
*
|
|
109
122
|
* @param version - React version to use (defaults to REACT_VERSION)
|
|
110
123
|
*/
|
|
111
124
|
export function getDenoNpmReactMap(version) {
|
|
112
125
|
const v = version ?? getReactVersion();
|
|
113
126
|
return {
|
|
114
|
-
"react":
|
|
115
|
-
"react-dom":
|
|
116
|
-
"react-dom/client":
|
|
117
|
-
"react-dom/server":
|
|
118
|
-
"react/jsx-runtime":
|
|
119
|
-
"react/jsx-dev-runtime":
|
|
127
|
+
"react": esmShReact("react", v),
|
|
128
|
+
"react-dom": esmShReact("react-dom", v, "", true),
|
|
129
|
+
"react-dom/client": esmShReact("react-dom", v, "/client", true),
|
|
130
|
+
"react-dom/server": esmShReact("react-dom", v, "/server", true),
|
|
131
|
+
"react/jsx-runtime": esmShReact("react", v, "/jsx-runtime", true),
|
|
132
|
+
"react/jsx-dev-runtime": esmShReact("react", v, "/jsx-dev-runtime", true),
|
|
120
133
|
};
|
|
121
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-imports.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/react-imports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-imports.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/react-imports.ts"],"names":[],"mappings":"AAiBA,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,OAAe,EACvB,YAAY,GAAE,MAAsB,GACnC,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,OAAe,EACxB,YAAY,GAAE,MAAsB,GACnC,OAAO,CAAC,MAAM,CAAC,CASjB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { replaceSpecifiers } from "./lexer.js";
|
|
2
|
-
import {
|
|
3
|
-
import { isDeno } from "../../platform/compat/runtime.js";
|
|
4
|
-
import { getLocalReactPaths } from "../../platform/compat/react-paths.js";
|
|
2
|
+
import { getReactImportMap, REACT_VERSION } from "./package-registry.js";
|
|
5
3
|
const srcDir = new URL(".", globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).url).pathname.replace(/\/(build|src)\/transforms\/esm\/?$/, "");
|
|
6
4
|
function getVeryfrontModulePaths() {
|
|
7
5
|
return {
|
|
@@ -16,12 +14,10 @@ export async function resolveReactImports(code, forSSR = false, reactVersion = R
|
|
|
16
14
|
if (!forSSR) {
|
|
17
15
|
return replaceSpecifiers(code, (specifier) => reactImports[specifier] ?? null);
|
|
18
16
|
}
|
|
19
|
-
// For
|
|
20
|
-
// For Node/Bun SSR: Use local node_modules paths (auto-deduplicated by Node)
|
|
21
|
-
// See: https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong
|
|
17
|
+
// For SSR: Use esm.sh URLs consistently (NO npm: specifiers per plan requirements)
|
|
22
18
|
const ssrImports = {
|
|
23
19
|
...getVeryfrontModulePaths(),
|
|
24
|
-
...
|
|
20
|
+
...reactImports,
|
|
25
21
|
};
|
|
26
22
|
return replaceSpecifiers(code, (specifier) => ssrImports[specifier] ?? null);
|
|
27
23
|
}
|
|
@@ -8,6 +8,8 @@ export interface TransformOptions {
|
|
|
8
8
|
ssr?: boolean;
|
|
9
9
|
apiBaseUrl?: string;
|
|
10
10
|
studioEmbed?: boolean;
|
|
11
|
+
/** React version for transforms (from project config, defaults to DEFAULT_REACT_VERSION) */
|
|
12
|
+
reactVersion?: string;
|
|
11
13
|
}
|
|
12
14
|
export interface TransformContext {
|
|
13
15
|
source: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -35,4 +35,18 @@ export declare function invalidateModulePaths(changedPaths: string[]): void;
|
|
|
35
35
|
* Called when files are updated via Studio to ensure fresh content is served.
|
|
36
36
|
*/
|
|
37
37
|
export declare function clearESMDiskCache(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Look up a module in the MDX-ESM cache.
|
|
40
|
+
*
|
|
41
|
+
* This allows other loaders (like SSR loader) to reuse modules that
|
|
42
|
+
* MDX-ESM has already transformed and cached, preventing duplicate
|
|
43
|
+
* module instances (which breaks React context, etc.).
|
|
44
|
+
*
|
|
45
|
+
* @param filePath - Project-relative file path like "lib/ChatContext.tsx"
|
|
46
|
+
* @param cacheDir - The MDX-ESM cache directory for this project/contentSource
|
|
47
|
+
* @param projectDir - Project directory to strip from absolute paths
|
|
48
|
+
* @param contentHash - Optional content hash to validate cached file freshness
|
|
49
|
+
* @returns The cached file path if found and valid, null otherwise
|
|
50
|
+
*/
|
|
51
|
+
export declare function lookupMdxEsmCache(filePath: string, cacheDir: string, projectDir?: string, contentHash?: string): Promise<string | null>;
|
|
38
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAKH,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,mCAAmC,CAAC;AAQ3C;;GAEG;AACH,wBAAgB,UAAU,IAAI,UAAU,CAGvC;AAOD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAsBvF;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAezE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAgClE;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAevD;AAyBD;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwCxB"}
|