veryfront 0.1.1239 → 0.1.1241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/cli/commands/build/command-help.d.ts.map +1 -1
- package/esm/cli/commands/build/command-help.js +4 -0
- package/esm/cli/commands/build/command.d.ts +3 -1
- package/esm/cli/commands/build/command.d.ts.map +1 -1
- package/esm/cli/commands/build/command.js +13 -5
- package/esm/cli/commands/build/handler.d.ts +17 -0
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +188 -9
- package/esm/cli/commands/generate/command.d.ts.map +1 -1
- package/esm/cli/commands/generate/command.js +40 -0
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +24 -16
- package/esm/cli/shared/ensure-content-processor.d.ts +16 -1
- package/esm/cli/shared/ensure-content-processor.d.ts.map +1 -1
- package/esm/cli/shared/ensure-content-processor.js +39 -5
- package/esm/cli/shared/project-creation.d.ts.map +1 -1
- package/esm/cli/shared/project-creation.js +29 -1
- package/esm/deno.d.ts +14 -5
- package/esm/deno.js +23 -7
- package/esm/extensions/ext-llm-openai/src/openai-chat-stream.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-chat-stream.js +16 -6
- package/esm/extensions/ext-llm-openai/src/openai-provider.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-provider.js +11 -2
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts +2 -14
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.js +1 -72
- package/esm/extensions/ext-schema-zod/src/adapter.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/browser-aliases.d.ts +164 -0
- package/esm/src/agent/ag-ui/browser-aliases.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/browser-aliases.js +68 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts +35 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{chat-ui-chunk-browser-encoder.js → chat-ui-chunk-encoder.js} +11 -11
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts +8 -6
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.js +5 -4
- package/esm/src/agent/ag-ui/chunk-encoder.d.ts +26 -0
- package/esm/src/agent/ag-ui/chunk-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-chunk-encoder.js → chunk-encoder.js} +3 -2
- package/esm/src/agent/ag-ui/{browser-encoder.d.ts → encoder.d.ts} +33 -19
- package/esm/src/agent/ag-ui/encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-encoder.js → encoder.js} +81 -27
- package/esm/src/agent/ag-ui/finalize-tracker.d.ts +15 -0
- package/esm/src/agent/ag-ui/finalize-tracker.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-finalize-tracker.js → finalize-tracker.js} +4 -4
- package/esm/src/agent/ag-ui/response-stream.d.ts +36 -0
- package/esm/src/agent/ag-ui/response-stream.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-response-stream.js → response-stream.js} +6 -3
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts +1 -1
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts +7 -7
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.js +4 -4
- package/esm/src/agent/ag-ui/runtime-response.d.ts +20 -0
- package/esm/src/agent/ag-ui/runtime-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/runtime-response.js +16 -0
- package/esm/src/agent/ag-ui/sse-parser.d.ts +1 -1
- package/esm/src/agent/ag-ui/sse-parser.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/sse-parser.js +3 -3
- package/esm/src/agent/ag-ui/tracked-response.d.ts +11 -0
- package/esm/src/agent/ag-ui/tracked-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{tracked-browser-response.js → tracked-response.js} +6 -4
- package/esm/src/agent/conversation/hosted-lifecycle.d.ts.map +1 -1
- package/esm/src/agent/conversation/hosted-lifecycle.js +2 -1
- package/esm/src/agent/conversation/lifecycle-run-event-adapter.d.ts.map +1 -1
- package/esm/src/agent/conversation/lifecycle-run-event-adapter.js +2 -0
- package/esm/src/agent/conversation/private-run-event.d.ts.map +1 -1
- package/esm/src/agent/conversation/private-run-event.js +174 -3
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts +2 -0
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-chunk-mirror.js +13 -6
- package/esm/src/agent/conversation/run-events.d.ts +8 -0
- package/esm/src/agent/conversation/run-events.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-events.js +54 -4
- package/esm/src/agent/conversation/run-stream-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-stream-mirror.js +5 -2
- package/esm/src/agent/hosted/durable-run-event-sink.d.ts +2 -1
- package/esm/src/agent/hosted/durable-run-event-sink.d.ts.map +1 -1
- package/esm/src/agent/hosted/durable-run-event-sink.js +9 -7
- package/esm/src/agent/hosted/prepared-chat-execution.js +2 -2
- package/esm/src/agent/index.d.ts +9 -8
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +9 -8
- package/esm/src/agent/memory/memory.d.ts.map +1 -1
- package/esm/src/agent/memory/memory.js +7 -6
- package/esm/src/agent/react/use-chat/types.d.ts +2 -0
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +3 -2
- package/esm/src/agent/runtime/ag-ui-contract.d.ts +2 -2
- package/esm/src/agent/runtime/ag-ui-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/ag-ui-contract.js +2 -2
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +34 -4
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +15 -6
- package/esm/src/agent/streaming/data-stream.d.ts +1 -1
- package/esm/src/agent/streaming/data-stream.d.ts.map +1 -1
- package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts +1 -1
- package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/live-adapter.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/live-adapter.js +2 -0
- package/esm/src/agent/streaming/lifecycle/reducer.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/reducer.js +7 -0
- package/esm/src/agent/streaming/lifecycle/runtime-provider-adapter.js +4 -0
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +1 -1
- package/esm/src/cache/request-cache-batcher.d.ts +1 -0
- package/esm/src/cache/request-cache-batcher.d.ts.map +1 -1
- package/esm/src/cache/request-cache-batcher.js +21 -7
- package/esm/src/chat/ag-ui.d.ts +1 -1
- package/esm/src/chat/index.d.ts +2 -2
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +1 -1
- package/esm/src/config/config-shim.d.ts +1 -1
- package/esm/src/config/config-shim.d.ts.map +1 -1
- package/esm/src/config/config-shim.js +1 -1
- package/esm/src/config/declarative-evaluator-worker-protocol.d.ts.map +1 -1
- package/esm/src/config/env.js +1 -1
- package/esm/src/config/environment-config.js +1 -1
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +4 -4
- package/esm/src/config/schemas/config.schema.d.ts +20 -0
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +27 -0
- package/esm/src/config/server-external-packages.d.ts +11 -0
- package/esm/src/config/server-external-packages.d.ts.map +1 -0
- package/esm/src/config/server-external-packages.js +53 -0
- package/esm/src/data/data-fetcher.d.ts.map +1 -1
- package/esm/src/data/data-fetcher.js +9 -4
- package/esm/src/data/data-result-validation.d.ts +5 -0
- package/esm/src/data/data-result-validation.d.ts.map +1 -0
- package/esm/src/data/data-result-validation.js +56 -0
- package/esm/src/data/helpers.d.ts +5 -5
- package/esm/src/data/helpers.d.ts.map +1 -1
- package/esm/src/data/helpers.js +22 -68
- package/esm/src/data/index.d.ts +1 -1
- package/esm/src/data/index.d.ts.map +1 -1
- package/esm/src/data/response-metadata.d.ts +23 -0
- package/esm/src/data/response-metadata.d.ts.map +1 -0
- package/esm/src/data/response-metadata.js +311 -0
- package/esm/src/data/schemas/data.schema.d.ts +95 -6
- package/esm/src/data/schemas/data.schema.d.ts.map +1 -1
- package/esm/src/data/schemas/data.schema.js +57 -3
- package/esm/src/data/schemas/index.d.ts +1 -1
- package/esm/src/data/schemas/index.d.ts.map +1 -1
- package/esm/src/data/schemas/index.js +1 -1
- package/esm/src/data/server-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/server-data-fetcher.js +5 -5
- package/esm/src/data/static-data-fetcher.d.ts +2 -2
- package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/static-data-fetcher.js +6 -3
- package/esm/src/data/types.d.ts +1 -1
- package/esm/src/data/types.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +81 -26
- package/esm/src/discovery/handlers/task-handler.d.ts +1 -1
- package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -1
- package/esm/src/discovery/handlers/task-handler.js +6 -3
- package/esm/src/discovery/types.d.ts +6 -4
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/errors/error-registry/runtime.d.ts +2 -0
- package/esm/src/errors/error-registry/runtime.d.ts.map +1 -1
- package/esm/src/errors/error-registry/runtime.js +8 -0
- package/esm/src/errors/error-registry.d.ts +1 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/index.d.ts +1 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +1 -1
- package/esm/src/errors/user-friendly/error-wrapper.js +1 -1
- package/esm/src/errors/veryfront-error.d.ts.map +1 -1
- package/esm/src/extensions/index.d.ts +2 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +1 -0
- package/esm/src/extensions/parser/code-parser.d.ts +9 -0
- package/esm/src/extensions/parser/code-parser.d.ts.map +1 -1
- package/esm/src/extensions/parser/defaults.d.ts +5 -0
- package/esm/src/extensions/parser/defaults.d.ts.map +1 -1
- package/esm/src/extensions/parser/defaults.js +23 -11
- package/esm/src/fs/index.d.ts +50 -1
- package/esm/src/fs/index.d.ts.map +1 -1
- package/esm/src/fs/index.js +50 -1
- package/esm/src/html/html-injection.d.ts +2 -0
- package/esm/src/html/html-injection.d.ts.map +1 -1
- package/esm/src/html/html-injection.js +4 -1
- package/esm/src/html/html-shell-generator.d.ts.map +1 -1
- package/esm/src/html/html-shell-generator.js +11 -3
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts +23 -0
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts.map +1 -0
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.js +55 -0
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts +2 -0
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/prod-scripts.js +12 -3
- package/esm/src/html/schemas/html.schema.d.ts +2 -0
- package/esm/src/html/schemas/html.schema.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.js +2 -0
- package/esm/src/html/styles-builder/css-hash-cache.d.ts +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.js +1 -1
- package/esm/src/index.client.d.ts +2 -2
- package/esm/src/index.client.d.ts.map +1 -1
- package/esm/src/index.client.js +3 -1
- package/esm/src/index.d.ts +1 -1
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.d.ts +7 -7
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +17 -9
- package/esm/src/internal-agents/control-plane-auth.js +1 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +15 -9
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +2 -2
- package/esm/src/modules/import-map/merger.js +2 -2
- package/esm/src/modules/import-map/preloader.js +2 -2
- 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/ssr-module-loader/loader.d.ts +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 +3 -2
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +7 -1
- 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/transformed-module-coordinator.d.ts.map +1 -1
- package/esm/src/modules/react-loader/transformed-module-coordinator.js +2 -1
- package/esm/src/modules/react-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/server/module-response-cache.d.ts +1 -0
- package/esm/src/modules/server/module-response-cache.d.ts.map +1 -1
- package/esm/src/modules/server/module-response-cache.js +5 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +4 -0
- package/esm/src/modules/server/module-transform.d.ts.map +1 -1
- package/esm/src/modules/server/module-transform.js +2 -0
- package/esm/src/observability/metrics/config.js +1 -1
- package/esm/src/observability/request-profiler.js +1 -1
- package/esm/src/observability/telemetry-error.js +2 -2
- package/esm/src/observability/tracing/telemetry-env.js +1 -1
- package/esm/src/platform/adapters/fs/cache/file-cache.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/cache/file-cache.js +5 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts +39 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +209 -40
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.js +0 -14
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +0 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +0 -3
- package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations.js +1 -4
- package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/request-context.js +4 -0
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.js +9 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.js +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +2 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +97 -66
- package/esm/src/platform/compat/dns.d.ts +10 -0
- package/esm/src/platform/compat/dns.d.ts.map +1 -1
- package/esm/src/platform/compat/dns.js +50 -0
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/platform/compat/process/lifecycle.d.ts +10 -0
- package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -1
- package/esm/src/platform/compat/process/lifecycle.js +23 -0
- package/esm/src/platform/compat/process.d.ts +1 -1
- package/esm/src/platform/compat/process.d.ts.map +1 -1
- package/esm/src/platform/compat/process.js +1 -1
- package/esm/src/platform/compat/proxy-topology.js +1 -1
- package/esm/src/platform/request-context-access.d.ts +24 -0
- package/esm/src/platform/request-context-access.d.ts.map +1 -0
- package/esm/src/platform/request-context-access.js +26 -0
- package/esm/src/provider/shared/openai-reasoning.d.ts +16 -0
- package/esm/src/provider/shared/openai-reasoning.d.ts.map +1 -0
- package/esm/src/provider/shared/openai-reasoning.js +73 -0
- package/esm/src/provider/types.d.ts +2 -0
- package/esm/src/provider/types.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.js +45 -18
- package/esm/src/proxy/handler.d.ts +1 -0
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +17 -4
- package/esm/src/proxy/proxy-error-context.d.ts +1 -0
- package/esm/src/proxy/proxy-error-context.d.ts.map +1 -1
- package/esm/src/proxy/proxy-error-context.js +1 -0
- package/esm/src/proxy/request-host.d.ts +3 -0
- package/esm/src/proxy/request-host.d.ts.map +1 -1
- package/esm/src/proxy/request-host.js +28 -8
- package/esm/src/proxy/routing-invalidation-redis.d.ts.map +1 -1
- package/esm/src/proxy/routing-invalidation-redis.js +38 -4
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +27 -3
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +29 -7
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +15 -6
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +37 -4
- package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts +12 -1
- package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +3 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +17 -6
- package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts +12 -5
- package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +18 -5
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.js +65 -1
- package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts +6 -3
- package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/use-composer-value.js +56 -5
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +7 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +14 -4
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +10 -1
- package/esm/src/react/components/chat/chat/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/persistence/conversation-codec.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.d.ts +1 -1
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/server-render-context.d.ts.map +1 -1
- package/esm/src/release-assets/dependency-artifact-builder.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.d.ts +2 -2
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +4 -3
- package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-coordinator.js +1 -0
- package/esm/src/rendering/cache/cache-payload.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-payload.js +44 -0
- package/esm/src/rendering/component-handling.d.ts +4 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +13 -6
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +3 -1
- package/esm/src/rendering/layouts/layout-collector.d.ts +1 -0
- package/esm/src/rendering/layouts/layout-collector.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-collector.js +201 -4
- 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/applicator.js +3 -3
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +2 -2
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.js +12 -4
- package/esm/src/rendering/orchestrator/file-resolver/index.d.ts +3 -1
- package/esm/src/rendering/orchestrator/file-resolver/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/file-resolver/index.js +13 -5
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +26 -10
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.js +2 -2
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +20 -2
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +6 -3
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts +3 -2
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.js +6 -6
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +1 -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 +2 -2
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.js +7 -1
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +58 -10
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts +3 -0
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/render-result-assembly.js +3 -1
- package/esm/src/rendering/page-renderer.d.ts +2 -0
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.js +4 -1
- package/esm/src/rendering/page-rendering.d.ts +2 -0
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.js +1 -0
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +31 -1
- package/esm/src/rendering/script-page-handling.d.ts +2 -0
- package/esm/src/rendering/script-page-handling.d.ts.map +1 -1
- package/esm/src/rendering/script-page-handling.js +17 -1
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +3 -0
- package/esm/src/rendering/snippet-renderer.d.ts +10 -0
- package/esm/src/rendering/snippet-renderer.d.ts.map +1 -1
- package/esm/src/rendering/snippet-renderer.js +40 -18
- 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 +13 -6
- package/esm/src/rendering/ssr-outcome.d.ts +4 -3
- package/esm/src/rendering/ssr-outcome.d.ts.map +1 -1
- package/esm/src/rendering/ssr-outcome.js +25 -8
- package/esm/src/routing/api/handler.d.ts +1 -1
- package/esm/src/routing/api/handler.d.ts.map +1 -1
- package/esm/src/routing/api/handler.js +6 -1
- package/esm/src/runtime/model-call-context.d.ts +37 -2
- package/esm/src/runtime/model-call-context.d.ts.map +1 -1
- package/esm/src/runtime/model-call-context.js +42 -1
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.js +108 -8
- package/esm/src/sandbox/shell-tools.d.ts.map +1 -1
- package/esm/src/sandbox/shell-tools.js +16 -6
- package/esm/src/schedule/validation.d.ts +9 -1
- package/esm/src/schedule/validation.d.ts.map +1 -1
- package/esm/src/schedule/validation.js +167 -80
- package/esm/src/schemas/json-value.d.ts.map +1 -1
- package/esm/src/schemas/json-value.js +81 -37
- package/esm/src/security/http/base-handler.js +1 -1
- package/esm/src/security/sandbox/project-worker.d.ts +1 -0
- package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
- package/esm/src/security/sandbox/project-worker.js +6 -0
- package/esm/src/security/sandbox/worker-read-scope.d.ts +20 -0
- package/esm/src/security/sandbox/worker-read-scope.d.ts.map +1 -0
- package/esm/src/security/sandbox/worker-read-scope.js +127 -0
- package/esm/src/security/sandbox/worker-types.d.ts +12 -0
- package/esm/src/security/sandbox/worker-types.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.js +70 -3
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +5 -0
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.js +61 -3
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +227 -29
- package/esm/src/server/handlers/request/api/pages-api-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/pages-api-handler.js +20 -2
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +32 -15
- package/esm/src/server/handlers/request/prod-hydration-module.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/prod-hydration-module.handler.js +10 -3
- package/esm/src/server/handlers/request/project-run-execute.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/project-run-execute.handler.js +1 -0
- package/esm/src/server/handlers/request/snippet.handler.d.ts +6 -0
- package/esm/src/server/handlers/request/snippet.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/snippet.handler.js +8 -1
- package/esm/src/server/handlers/request/ssr/error-page-fallback.js +1 -0
- package/esm/src/server/handlers/request/ssr/ssr-response-builder.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/ssr-response-builder.js +10 -6
- package/esm/src/server/handlers/request/ssr/ssr.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/ssr.handler.js +22 -10
- package/esm/src/server/handlers/request/static.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/static.handler.js +1 -0
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts +2 -0
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/handler-context-builder.js +1 -0
- package/esm/src/server/runtime-handler/project-runtime-context.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/project-runtime-context.js +6 -2
- package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-tracker.js +10 -3
- package/esm/src/server/services/rendering/ssr.service.d.ts +5 -0
- package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
- package/esm/src/server/services/rendering/ssr.service.js +71 -16
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/server/services/rsc/orchestrators/handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/handler.js +1 -0
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts +1 -0
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/render-handler.js +2 -0
- package/esm/src/server/services/static/static-file.service.d.ts +4 -1
- package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
- package/esm/src/server/services/static/static-file.service.js +48 -22
- package/esm/src/server/shared/browser-module-bundler.d.ts.map +1 -1
- package/esm/src/server/shared/browser-module-bundler.js +10 -0
- package/esm/src/server/utils/request-host.d.ts +6 -0
- package/esm/src/server/utils/request-host.d.ts.map +1 -1
- package/esm/src/server/utils/request-host.js +42 -1
- package/esm/src/skill/tools.d.ts.map +1 -1
- package/esm/src/task/definition-snapshot.d.ts +8 -0
- package/esm/src/task/definition-snapshot.d.ts.map +1 -0
- package/esm/src/task/definition-snapshot.js +154 -0
- package/esm/src/task/discovery.d.ts.map +1 -1
- package/esm/src/task/discovery.js +47 -21
- package/esm/src/task/types.d.ts +3 -0
- package/esm/src/task/types.d.ts.map +1 -1
- package/esm/src/task/types.js +7 -16
- package/esm/src/tool/remote-mcp.d.ts.map +1 -1
- package/esm/src/tool/remote-mcp.js +86 -5
- package/esm/src/transforms/esm/bundle-recovery.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-recovery.js +1 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +3 -1
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +18 -2
- package/esm/src/transforms/esm/http-cache-wrapper.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-wrapper.js +23 -0
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +2 -1
- 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/import-rewriter/commonjs-policy.d.ts +22 -0
- package/esm/src/transforms/import-rewriter/commonjs-policy.d.ts.map +1 -0
- package/esm/src/transforms/import-rewriter/commonjs-policy.js +75 -0
- package/esm/src/transforms/import-rewriter/core.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/core.js +29 -1
- package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/ssr-adapter.js +79 -10
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.js +14 -4
- package/esm/src/transforms/import-rewriter/types.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/types.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.d.ts +2 -19
- package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.js +2 -67
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts +3 -2
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.js +39 -8
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +1 -1
- 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 +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts +3 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.js +14 -6
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.js +2 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts +1 -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 +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 +6 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.js +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.js +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.js +15 -7
- 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 -0
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +2 -1
- package/esm/src/transforms/pipeline/cache-identity.d.ts +1 -0
- package/esm/src/transforms/pipeline/cache-identity.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/cache-identity.js +15 -0
- package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +2 -0
- package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/index.js +1 -0
- package/esm/src/transforms/pipeline/stages/resolve-imports.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/resolve-imports.js +1 -0
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +1 -0
- package/esm/src/transforms/pipeline/types.d.ts +4 -0
- package/esm/src/transforms/pipeline/types.d.ts.map +1 -1
- package/esm/src/transforms/shared/esm-sh-specifier.d.ts +18 -0
- package/esm/src/transforms/shared/esm-sh-specifier.d.ts.map +1 -0
- package/esm/src/transforms/shared/esm-sh-specifier.js +253 -0
- package/esm/src/transforms/shared/package-specifier.d.ts.map +1 -1
- package/esm/src/transforms/shared/package-specifier.js +9 -2
- package/esm/src/transforms/shared/server-only-packages.d.ts +25 -1
- package/esm/src/transforms/shared/server-only-packages.d.ts.map +1 -1
- package/esm/src/transforms/shared/server-only-packages.js +176 -4
- package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
- package/esm/src/types/index.d.ts +5 -0
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/types/server.d.ts +6 -0
- package/esm/src/types/server.d.ts.map +1 -1
- package/esm/src/utils/env-loader.d.ts.map +1 -1
- package/esm/src/utils/env-loader.js +2 -1
- package/esm/src/utils/feature-flags.js +1 -1
- package/esm/src/utils/lru-wrapper.js +2 -2
- package/esm/src/utils/memory/profiler.d.ts +20 -0
- package/esm/src/utils/memory/profiler.d.ts.map +1 -1
- package/esm/src/utils/memory/profiler.js +43 -5
- package/esm/src/utils/perf-timer.js +1 -1
- package/esm/src/utils/redirect-policy.d.ts +18 -0
- package/esm/src/utils/redirect-policy.d.ts.map +1 -0
- package/esm/src/utils/redirect-policy.js +92 -0
- package/esm/src/utils/redis-client.d.ts.map +1 -1
- package/esm/src/utils/redis-client.js +6 -3
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/claude-code/tool.d.ts +27 -27
- package/esm/src/workflow/claude-code/tool.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/wire-protocol.d.ts.map +1 -1
- package/esm/src/workflow/dsl/workflow.d.ts +3 -0
- package/esm/src/workflow/dsl/workflow.d.ts.map +1 -1
- package/esm/src/workflow/dsl/workflow.js +2 -1
- package/esm/src/workflow/executor/workflow-definition-snapshot.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-definition-snapshot.js +88 -39
- package/esm/src/workflow/registry.d.ts +4 -1
- package/esm/src/workflow/registry.d.ts.map +1 -1
- package/esm/src/workflow/registry.js +10 -8
- package/esm/src/workflow/types.d.ts +3 -0
- package/esm/src/workflow/types.d.ts.map +1 -1
- package/esm/templates/index.d.ts.map +1 -1
- package/esm/templates/index.js +7 -0
- package/esm/templates/manifest.generated.d.ts.map +1 -1
- package/esm/templates/manifest.generated.js +1 -1
- package/package.json +16 -9
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts +0 -24
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts +0 -15
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts +0 -33
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts +0 -35
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts +0 -20
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/runtime-browser-response.js +0 -16
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts +0 -11
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE,WAwDvB,CAAC"}
|
|
@@ -42,6 +42,10 @@ export const buildHelp = {
|
|
|
42
42
|
description: "Select build preset (e.g. embedded)",
|
|
43
43
|
},
|
|
44
44
|
],
|
|
45
|
+
notes: [
|
|
46
|
+
"--preset embedded emits a single bundle, so of the build flags it honours only -o/--output and build.outDir. Global flags such as --json, --verbose and --quiet are unaffected.",
|
|
47
|
+
"It rejects --dry-run, --split/--no-split, --compress/--no-compress, --prefetch, --ssg/--no-ssg, --include and --exclude rather than ignoring them.",
|
|
48
|
+
],
|
|
45
49
|
examples: [
|
|
46
50
|
"veryfront build",
|
|
47
51
|
"veryfront build --output dist",
|
|
@@ -30,6 +30,8 @@ export declare function formatBuildOutputPath(projectDir: string, outputDir: str
|
|
|
30
30
|
* nothing. A relative `outDir` resolves against the project directory, which
|
|
31
31
|
* is how a config file naturally reads.
|
|
32
32
|
*/
|
|
33
|
-
export declare function resolveBuildOutputDir(projectDir: string, explicitOutputDir: string | undefined, config: Pick<VeryfrontConfig, "build"
|
|
33
|
+
export declare function resolveBuildOutputDir(projectDir: string, explicitOutputDir: string | undefined, config: Pick<VeryfrontConfig, "build">, options?: {
|
|
34
|
+
clearsOutputDir?: boolean;
|
|
35
|
+
}): string;
|
|
34
36
|
export declare function buildCommand(options: BuildOptions): Promise<void>;
|
|
35
37
|
//# sourceMappingURL=command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQ/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,gBAAgB;AAChB,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,WAAW,GAAE,MAAM,OAAO,CAAC,IAAI,CAG9B,GACA,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE;IAAE,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,GAAG,SAAS,GACvD,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,iBAAiB,EAAE,MAAM,GAAG,SAAS,EACrC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQ/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,gBAAgB;AAChB,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,WAAW,GAAE,MAAM,OAAO,CAAC,IAAI,CAG9B,GACA,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE;IAAE,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,GAAG,SAAS,GACvD,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,iBAAiB,EAAE,MAAM,GAAG,SAAS,EACrC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EACtC,OAAO,GAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1C,MAAM,CASR;AA4CD,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4GjE"}
|
|
@@ -73,9 +73,14 @@ export function formatBuildOutputPath(projectDir, outputDir) {
|
|
|
73
73
|
* nothing. A relative `outDir` resolves against the project directory, which
|
|
74
74
|
* is how a config file naturally reads.
|
|
75
75
|
*/
|
|
76
|
-
export function resolveBuildOutputDir(projectDir, explicitOutputDir, config) {
|
|
76
|
+
export function resolveBuildOutputDir(projectDir, explicitOutputDir, config, options = {}) {
|
|
77
77
|
const outputDir = explicitOutputDir ?? resolveConfiguredOutputDir(projectDir, config);
|
|
78
|
-
|
|
78
|
+
// The guard below exists because the caller wipes the directory first. A
|
|
79
|
+
// caller that only writes into it is not dangerous, and rejecting it would
|
|
80
|
+
// block legitimate invocations — see the embedded preset.
|
|
81
|
+
if (options.clearsOutputDir !== false) {
|
|
82
|
+
assertOutputDirExcludesProject(projectDir, outputDir, explicitOutputDir !== undefined);
|
|
83
|
+
}
|
|
79
84
|
return outputDir;
|
|
80
85
|
}
|
|
81
86
|
function resolveConfiguredOutputDir(projectDir, config) {
|
|
@@ -87,9 +92,12 @@ function resolveConfiguredOutputDir(projectDir, config) {
|
|
|
87
92
|
/**
|
|
88
93
|
* Refuse an output directory that is the project directory or an ancestor of it.
|
|
89
94
|
*
|
|
90
|
-
* The build clears its output directory before writing
|
|
91
|
-
*
|
|
92
|
-
*
|
|
95
|
+
* The production build clears its output directory before writing
|
|
96
|
+
* (`build-setup.ts` removes it recursively), so an `outDir` of `.` or `..`
|
|
97
|
+
* would recursively delete the project's own source — or the workspace above
|
|
98
|
+
* it. This is why the check is opt-out via `clearsOutputDir`: a caller that
|
|
99
|
+
* only writes into the directory, like the embedded preset, carries no such
|
|
100
|
+
* risk and must not be blocked. That was unreachable while `build.outDir` was ignored; now that the
|
|
93
101
|
* config value is honored, a stale compatibility-era config could reach it.
|
|
94
102
|
* Failing loudly is the only safe answer: silently substituting `dist` would
|
|
95
103
|
* reintroduce the ignored-configuration bug this change exists to fix.
|
|
@@ -52,5 +52,22 @@ export declare const parseBuildArgs: (args: ParsedArgs) => import("../../shared/
|
|
|
52
52
|
exclude: import("../../../src/internal-agents/schema.js").Schema<string[] | undefined>;
|
|
53
53
|
dryRun: import("../../../src/internal-agents/schema.js").Schema<boolean>;
|
|
54
54
|
}>>;
|
|
55
|
+
/**
|
|
56
|
+
* Refuse an embedded build that was given a flag the preset cannot honour.
|
|
57
|
+
*
|
|
58
|
+
* Reads `__explicit` from the *raw* args rather than the parsed options on
|
|
59
|
+
* purpose. The schema defaults `split`, `compress` and `prefetch` to `true`
|
|
60
|
+
* and `dryRun`, `noSplit`, `noCompress` and `noSsg` to `false`, so the parsed
|
|
61
|
+
* object cannot tell a typed flag from a default — keying off it would reject
|
|
62
|
+
* every embedded build, including a bare one.
|
|
63
|
+
*
|
|
64
|
+
* The message starts with `Invalid ` so the router maps it to exit code 2 as a
|
|
65
|
+
* usage error, matching `parseArgsOrThrow`.
|
|
66
|
+
*
|
|
67
|
+
* @param args raw parsed argv, carrying `__explicit`
|
|
68
|
+
* @param preset the lowercased `--preset` value, if any
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export declare function assertEmbeddedPresetFlags(args: ParsedArgs, preset: string | undefined): void;
|
|
55
72
|
export declare function handleBuildCommand(args: ParsedArgs): Promise<void>;
|
|
56
73
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAO3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;GAe9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;GAAiC,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;GAaA,CAAC;AA6B5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,IAAI,CAYN;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCxE"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
2
2
|
import { dim } from "../../ui/index.js";
|
|
3
|
-
import { join } from "../../../src/platform/compat/path/index.js";
|
|
4
3
|
import { cliLogger, isVerbose, logSuccess } from "../../utils/index.js";
|
|
5
|
-
import { cwd } from "../../../src/platform/index.js";
|
|
4
|
+
import { cwd, runtime } from "../../../src/platform/index.js";
|
|
6
5
|
import { CommonArgs, createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
7
6
|
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
8
7
|
import { showHeader } from "../../utils/index.js";
|
|
9
8
|
import { ensureBuiltinContentProcessor } from "../../shared/ensure-content-processor.js";
|
|
9
|
+
import { isJsonMode, streamJsonLine } from "../../shared/json-output.js";
|
|
10
10
|
/**
|
|
11
11
|
* Schema factory for build command arguments
|
|
12
12
|
*/
|
|
@@ -42,12 +42,68 @@ export const parseBuildArgs = createArgParser(BuildArgsSchema, {
|
|
|
42
42
|
exclude: { keys: ["exclude"], type: "array" },
|
|
43
43
|
dryRun: CommonArgs.dryRun,
|
|
44
44
|
}, { rejectUnknown: true });
|
|
45
|
+
/**
|
|
46
|
+
* Flags the embedded preset cannot honour, in the spelling the user types.
|
|
47
|
+
*
|
|
48
|
+
* The embedded preset emits one esbuild bundle: there is nothing to split,
|
|
49
|
+
* no compression pass, no prefetch manifest and no prerender step, so
|
|
50
|
+
* `--split`, `--compress`, `--prefetch`, `--ssg`, `--include` and `--exclude`
|
|
51
|
+
* describe stages it does not have. `--dry-run` is different in kind — the
|
|
52
|
+
* preset simply never implemented it, and a flag whose whole contract is
|
|
53
|
+
* "changes nothing" writing to disk is the worst outcome of the three.
|
|
54
|
+
*
|
|
55
|
+
* Rejecting is the honest answer for all of them. Accepting a flag and
|
|
56
|
+
* dropping it, which is what this path used to do, tells the user the build
|
|
57
|
+
* ran the way they asked when it did not.
|
|
58
|
+
*/
|
|
59
|
+
const UNSUPPORTED_EMBEDDED_FLAGS = [
|
|
60
|
+
"dry-run",
|
|
61
|
+
"split",
|
|
62
|
+
"no-split",
|
|
63
|
+
"compress",
|
|
64
|
+
"no-compress",
|
|
65
|
+
"prefetch",
|
|
66
|
+
"ssg",
|
|
67
|
+
"no-ssg",
|
|
68
|
+
"include",
|
|
69
|
+
"exclude",
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
72
|
+
* Refuse an embedded build that was given a flag the preset cannot honour.
|
|
73
|
+
*
|
|
74
|
+
* Reads `__explicit` from the *raw* args rather than the parsed options on
|
|
75
|
+
* purpose. The schema defaults `split`, `compress` and `prefetch` to `true`
|
|
76
|
+
* and `dryRun`, `noSplit`, `noCompress` and `noSsg` to `false`, so the parsed
|
|
77
|
+
* object cannot tell a typed flag from a default — keying off it would reject
|
|
78
|
+
* every embedded build, including a bare one.
|
|
79
|
+
*
|
|
80
|
+
* The message starts with `Invalid ` so the router maps it to exit code 2 as a
|
|
81
|
+
* usage error, matching `parseArgsOrThrow`.
|
|
82
|
+
*
|
|
83
|
+
* @param args raw parsed argv, carrying `__explicit`
|
|
84
|
+
* @param preset the lowercased `--preset` value, if any
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
export function assertEmbeddedPresetFlags(args, preset) {
|
|
88
|
+
if (preset !== "embedded")
|
|
89
|
+
return;
|
|
90
|
+
const explicit = args.__explicit ?? {};
|
|
91
|
+
const unsupported = UNSUPPORTED_EMBEDDED_FLAGS
|
|
92
|
+
.filter((flag) => explicit[flag] === true)
|
|
93
|
+
.map((flag) => `--${flag}`);
|
|
94
|
+
if (unsupported.length === 0)
|
|
95
|
+
return;
|
|
96
|
+
throw new Error(`Invalid build arguments: the embedded preset does not support ${unsupported.join(", ")}`);
|
|
97
|
+
}
|
|
45
98
|
export async function handleBuildCommand(args) {
|
|
46
99
|
showHeader();
|
|
47
100
|
const opts = parseArgsOrThrow(parseBuildArgs, "build", args);
|
|
101
|
+
const preset = opts.preset?.toLowerCase();
|
|
102
|
+
// Before any bundler setup, so a rejected build touches nothing and returns
|
|
103
|
+
// immediately.
|
|
104
|
+
assertEmbeddedPresetFlags(args, preset);
|
|
48
105
|
await ensureCliBundlerContracts();
|
|
49
106
|
const projectDir = cwd();
|
|
50
|
-
const preset = opts.preset?.toLowerCase();
|
|
51
107
|
if (preset === "embedded") {
|
|
52
108
|
await ensureBuiltinContentProcessor();
|
|
53
109
|
await handleEmbeddedBuild(projectDir, opts.output);
|
|
@@ -69,19 +125,142 @@ export async function handleBuildCommand(args) {
|
|
|
69
125
|
dryRun: opts.dryRun,
|
|
70
126
|
});
|
|
71
127
|
}
|
|
128
|
+
/** The synthetic shell route `buildEmbeddedPreset` prepends to every manifest. */
|
|
129
|
+
const EMBEDDED_APP_SHELL_FILE = "embedded/app.js";
|
|
130
|
+
/**
|
|
131
|
+
* Total bytes of the artifacts the embedded manifest declares.
|
|
132
|
+
*
|
|
133
|
+
* The production build reports the size of what it emitted, so the embedded
|
|
134
|
+
* preset reports the same thing rather than leaving the field at zero. The
|
|
135
|
+
* manifest is the artifact list, so it cannot drift from what was written.
|
|
136
|
+
* A file the preset failed to emit is skipped: `buildEmbeddedPreset` only warns
|
|
137
|
+
* when an RSC bundle or a route fails, and a size roll-up must not turn that
|
|
138
|
+
* warning into a hard error.
|
|
139
|
+
*/
|
|
140
|
+
async function sumEmbeddedOutputSize(outDir, manifest) {
|
|
141
|
+
const { join } = await import("../../../src/platform/compat/path/index.js");
|
|
142
|
+
const { createFileSystem } = await import("../../../src/platform/index.js");
|
|
143
|
+
const fs = createFileSystem();
|
|
144
|
+
const files = new Set(["embedded/manifest.json"]);
|
|
145
|
+
for (const route of manifest.routes)
|
|
146
|
+
files.add(route.file);
|
|
147
|
+
for (const asset of manifest.assets)
|
|
148
|
+
files.add(asset.file);
|
|
149
|
+
let total = 0;
|
|
150
|
+
for (const file of files) {
|
|
151
|
+
try {
|
|
152
|
+
total += (await fs.stat(join(outDir, file))).size;
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
// Not emitted — already reported by the preset as a warning.
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return total;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Run the embedded build, terminating the NDJSON stream ourselves in JSON mode.
|
|
162
|
+
*
|
|
163
|
+
* Once a `step` line has reached stdout, the router's error envelope must not
|
|
164
|
+
* also be written: it is a different, multi-line shape, so a consumer gets a
|
|
165
|
+
* partial NDJSON stream followed by something that is not NDJSON at all. The
|
|
166
|
+
* default path solves this by streaming its own `result` and calling `exit(1)`
|
|
167
|
+
* rather than rethrowing, and this matches it — including for failures in the
|
|
168
|
+
* config phase, which happen after the first `step` line is already out.
|
|
169
|
+
*/
|
|
72
170
|
async function handleEmbeddedBuild(projectDir, outputDir) {
|
|
171
|
+
if (!isJsonMode()) {
|
|
172
|
+
await runEmbeddedBuild(projectDir, outputDir);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
await runEmbeddedBuild(projectDir, outputDir);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
streamJsonLine({
|
|
180
|
+
type: "result",
|
|
181
|
+
success: false,
|
|
182
|
+
error: error instanceof Error ? error.message : String(error),
|
|
183
|
+
});
|
|
184
|
+
const { exit } = await import("../../../src/platform/index.js");
|
|
185
|
+
exit(1);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async function runEmbeddedBuild(projectDir, outputDir) {
|
|
73
189
|
const { buildEmbeddedPreset } = await import("../../../src/build/index.js");
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
190
|
+
const { getConfig } = await import("../../../src/config/index.js");
|
|
191
|
+
const { resolveBuildOutputDir } = await import("./command.js");
|
|
192
|
+
const startTime = Date.now();
|
|
193
|
+
// Failures are terminated by the caller, which streams the error result and
|
|
194
|
+
// exits rather than letting the router print a second envelope.
|
|
195
|
+
const json = isJsonMode();
|
|
196
|
+
if (json)
|
|
197
|
+
streamJsonLine({ type: "step", name: "config", status: "started" });
|
|
198
|
+
// The config was never loaded on this path, so `build.outDir` was ignored
|
|
199
|
+
// and the preset always wrote `dist`. Resolving through the same helper the
|
|
200
|
+
// default path uses also brings its guard against an output directory that
|
|
201
|
+
// contains the project.
|
|
202
|
+
const adapter = await runtime.get();
|
|
203
|
+
const config = await getConfig(projectDir, adapter);
|
|
204
|
+
// `clearsOutputDir: false` because `buildEmbeddedPreset` only mkdir's and
|
|
205
|
+
// writes into the target; unlike the production build it never removes it.
|
|
206
|
+
// Without this, `--preset embedded -o .` — a plausible call for a preset
|
|
207
|
+
// whose whole purpose is embedding into a host project — hard-fails on a
|
|
208
|
+
// deletion hazard that does not exist on this path.
|
|
209
|
+
const finalOutput = resolveBuildOutputDir(projectDir, outputDir, config, {
|
|
210
|
+
clearsOutputDir: false,
|
|
211
|
+
});
|
|
212
|
+
if (json) {
|
|
213
|
+
streamJsonLine({ type: "step", name: "config", status: "completed" });
|
|
214
|
+
streamJsonLine({ type: "step", name: "build", status: "started" });
|
|
79
215
|
}
|
|
80
|
-
|
|
216
|
+
else {
|
|
217
|
+
cliLogger.info("Building embedded preset...");
|
|
218
|
+
if (isVerbose()) {
|
|
219
|
+
cliLogger.info(` ${dim("Project:")} ${projectDir}`);
|
|
220
|
+
cliLogger.info(` ${dim("Output:")} ${finalOutput}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
const { manifest } = await buildEmbeddedPreset({
|
|
81
224
|
projectDir,
|
|
82
225
|
outDir: finalOutput,
|
|
83
226
|
runtime: "deno",
|
|
227
|
+
config,
|
|
84
228
|
});
|
|
229
|
+
if (json) {
|
|
230
|
+
const elapsed = Date.now() - startTime;
|
|
231
|
+
streamJsonLine({
|
|
232
|
+
type: "step",
|
|
233
|
+
name: "build",
|
|
234
|
+
status: "completed",
|
|
235
|
+
duration_ms: elapsed,
|
|
236
|
+
});
|
|
237
|
+
// Same event and payload shape as the default build path in command.ts:
|
|
238
|
+
// one command must not answer `--json` with two different result lines.
|
|
239
|
+
streamJsonLine({
|
|
240
|
+
type: "result",
|
|
241
|
+
success: true,
|
|
242
|
+
data: {
|
|
243
|
+
// `buildEmbeddedPreset` unshifts a synthetic `/` -> `embedded/app.js`
|
|
244
|
+
// shell route on top of the discovered ones, so counting every
|
|
245
|
+
// `type: "page"` reports one more page than the project has. Measured
|
|
246
|
+
// on a two-page fixture: routes are the shell, `/about`, and `/`, so
|
|
247
|
+
// the naive count says 3.
|
|
248
|
+
pages: manifest.routes.filter((route) => route.type === "page" && route.file !== EMBEDDED_APP_SHELL_FILE).length,
|
|
249
|
+
// The default path reports 0 for a build with no splitting stage, and
|
|
250
|
+
// the embedded preset has none — which is why `--split` is rejected for
|
|
251
|
+
// it above. Reporting 1 here would answer the same field differently
|
|
252
|
+
// from the command this is supposed to match.
|
|
253
|
+
chunks: 0,
|
|
254
|
+
assets: manifest.assets.length,
|
|
255
|
+
totalSize: await sumEmbeddedOutputSize(finalOutput, manifest),
|
|
256
|
+
duration_ms: elapsed,
|
|
257
|
+
outputDir: finalOutput,
|
|
258
|
+
// `--dry-run` is rejected for this preset, so a build that got here ran.
|
|
259
|
+
dryRun: false,
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
85
264
|
logSuccess("Built embedded preset");
|
|
86
265
|
cliLogger.info(` ${finalOutput}\n`);
|
|
87
266
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/generate/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/generate/command.ts"],"names":[],"mappings":"AA8FA,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAqCf"}
|
|
@@ -5,6 +5,7 @@ import { parseExtensionManifest } from "../../../src/extensions/index.js";
|
|
|
5
5
|
import { exists, join, readTextFile } from "../../../src/fs/index.js";
|
|
6
6
|
import { generateIntegration } from "./integration-generator.js";
|
|
7
7
|
import { isScaffoldType, scaffoldProjectFile } from "../../scaffold/engine.js";
|
|
8
|
+
const MDX_EXTENSION_PACKAGE = "@veryfront/ext-content-mdx";
|
|
8
9
|
const PROJECT_MARKERS = [
|
|
9
10
|
"veryfront.config.ts",
|
|
10
11
|
"veryfront.config.js",
|
|
@@ -106,4 +107,43 @@ export async function generateCommand(projectDir, type, name) {
|
|
|
106
107
|
}
|
|
107
108
|
for (const file of result.files)
|
|
108
109
|
cliLogger.info(`Created ${file.path}`);
|
|
110
|
+
await warnIfMdxExtensionMissing(projectDir, result.files.map((file) => file.path));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Tell the user to install the MDX extension when we have just written an
|
|
114
|
+
* `.mdx` file into a project that does not declare it.
|
|
115
|
+
*
|
|
116
|
+
* The pages router scaffolds `.mdx` for `page` and `layout`. Since
|
|
117
|
+
* `@veryfront/ext-content-mdx` became an optional peer of the npm package, a
|
|
118
|
+
* project that never installed it renders those routes as an error — while
|
|
119
|
+
* this command has just reported "Created" and exited 0. The compile path
|
|
120
|
+
* already throws a typed error naming the package, but by then the developer
|
|
121
|
+
* is debugging a route they were told was fine.
|
|
122
|
+
*
|
|
123
|
+
* Best-effort: a project without a readable package.json (a Deno project, say)
|
|
124
|
+
* gets no warning rather than a false one.
|
|
125
|
+
*/
|
|
126
|
+
async function warnIfMdxExtensionMissing(projectDir, paths) {
|
|
127
|
+
if (!paths.some((path) => path.endsWith(".mdx")))
|
|
128
|
+
return;
|
|
129
|
+
try {
|
|
130
|
+
const raw = await readTextFile(join(projectDir, "package.json"));
|
|
131
|
+
const manifest = JSON.parse(raw);
|
|
132
|
+
const declared = [
|
|
133
|
+
manifest.dependencies,
|
|
134
|
+
manifest.devDependencies,
|
|
135
|
+
manifest.peerDependencies,
|
|
136
|
+
manifest.optionalDependencies,
|
|
137
|
+
].some((group) => group?.[MDX_EXTENSION_PACKAGE] !== undefined);
|
|
138
|
+
if (declared)
|
|
139
|
+
return;
|
|
140
|
+
// Lockfile-aware: hard-coding `npm install` in a pnpm/yarn/bun project
|
|
141
|
+
// writes a competing package-lock.json and leaves the real lockfile stale.
|
|
142
|
+
const { detectProjectInstallTarget, formatInstallCommand } = await import("../../../src/extensions/index.js");
|
|
143
|
+
const install = formatInstallCommand(MDX_EXTENSION_PACKAGE, detectProjectInstallTarget(projectDir));
|
|
144
|
+
cliLogger.warn(`This project does not depend on ${MDX_EXTENSION_PACKAGE}, so the generated .mdx file will not render. Install it with: ${install}`);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// No readable package.json: say nothing rather than warn wrongly.
|
|
148
|
+
}
|
|
109
149
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/push/command.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAK3E,OAAO,EACL,KAAK,SAAS,EAId,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAsBhC,OAAO,EAAuB,KAAK,aAAa,EAAsB,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAKL,KAAK,SAAS,EAKf,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAmB,MAAM,WAAW,CAAC;AAcpF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;IAK1B,4EAA4E;;;;;GAM/E,CAAC;AAEF,eAAO,MAAM,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content for remote file "${file.path}". No files were pushed.`);
|
|
427
427
|
}
|
|
428
|
+
function findRemoteFilesMissingLocally(remoteFiles, localPaths, ignoreChecker) {
|
|
429
|
+
return remoteFiles
|
|
430
|
+
.map((file) => file.path)
|
|
431
|
+
.filter((path) => ignoreChecker.isSupportedExtension(path) &&
|
|
432
|
+
!ignoreChecker.isIgnored(path) &&
|
|
433
|
+
!localPaths.has(path));
|
|
434
|
+
}
|
|
435
|
+
function requirePreservedRemoteContent(remoteFiles, localPaths, deletePaths) {
|
|
436
|
+
for (const file of remoteFiles) {
|
|
437
|
+
if (!localPaths.has(file.path) && !deletePaths.has(file.path)) {
|
|
438
|
+
requireRemoteContent(file);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
428
442
|
async function buildManagedRemoteSnapshot(files, ignoreChecker, includeVersion = true) {
|
|
429
443
|
const snapshot = new Map();
|
|
430
444
|
for (const file of files) {
|
|
@@ -645,6 +659,10 @@ export function pushCommand(options = {}) {
|
|
|
645
659
|
};
|
|
646
660
|
let remoteFilesAreBaseline = !isMainBranch && !target.branchExists;
|
|
647
661
|
if (!dryRun && !isMainBranch && !target.branchId) {
|
|
662
|
+
// Branch creation is a remote mutation. Validate every inherited file
|
|
663
|
+
// that later planning or receipt generation can require before the POST.
|
|
664
|
+
for (const file of target.remoteFiles)
|
|
665
|
+
requireRemoteContent(file);
|
|
648
666
|
spinner.update(`Creating branch "${branchName}"...`);
|
|
649
667
|
try {
|
|
650
668
|
const preparedBranch = await ensureBranch(client, projectApiReference(config), branchName);
|
|
@@ -672,24 +690,14 @@ export function pushCommand(options = {}) {
|
|
|
672
690
|
throw new Error(`Failed to prepare branch "${branchName}": ${message}`);
|
|
673
691
|
}
|
|
674
692
|
}
|
|
675
|
-
const remoteFilesMissingLocally = target.remoteFiles
|
|
676
|
-
.map((file) => file.path)
|
|
677
|
-
.filter((path) => ignoreChecker.isSupportedExtension(path) &&
|
|
678
|
-
!ignoreChecker.isIgnored(path) &&
|
|
679
|
-
!localPaths.has(path));
|
|
693
|
+
const remoteFilesMissingLocally = findRemoteFilesMissingLocally(target.remoteFiles, localPaths, ignoreChecker);
|
|
680
694
|
const toDelete = pruneRemoteMissing ? remoteFilesMissingLocally : [];
|
|
695
|
+
// Preflight: fail before any remote mutation if a preserved remote file
|
|
696
|
+
// is missing content, so the digest computations after upload/delete
|
|
697
|
+
// cannot be the first to discover it.
|
|
681
698
|
const deletePaths = new Set(toDelete);
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
.map((file) => {
|
|
685
|
-
if (typeof file.content !== "string") {
|
|
686
|
-
throw new Error(`Veryfront returned invalid content for preserved remote file "${file.path}".`);
|
|
687
|
-
}
|
|
688
|
-
return { path: file.path, content: file.content };
|
|
689
|
-
});
|
|
690
|
-
let pushedSourceDigest = preservedRemoteFiles.length === 0
|
|
691
|
-
? sourceSnapshot.sourceDigest
|
|
692
|
-
: await computeSourceDigest([...ops, ...preservedRemoteFiles]);
|
|
699
|
+
requirePreservedRemoteContent(target.remoteFiles, localPaths, deletePaths);
|
|
700
|
+
let pushedSourceDigest;
|
|
693
701
|
const project = outcome.kind === "planned-create" ? null : outcome.project;
|
|
694
702
|
const baseline = project
|
|
695
703
|
? await readSyncTarget(projectDir, {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { ContentProcessor } from "../../src/extensions/content/index.js";
|
|
2
|
+
type ContentMdxExtensionModule = {
|
|
3
|
+
MdxContentProcessor: new () => ContentProcessor;
|
|
4
|
+
};
|
|
1
5
|
/**
|
|
2
6
|
* Start loading ext-mdx before the server accepts requests. Registration must
|
|
3
7
|
* still happen after server start (bootstrap `reset()` clears the contract
|
|
@@ -13,6 +17,17 @@ export declare function prefetchBuiltinContentProcessor(): void;
|
|
|
13
17
|
* `setupAll` to `teardownAll` to `reset()` clears the contract registry, so this
|
|
14
18
|
* must run *after* the server-start (or `getConfig`) call returns. We skip
|
|
15
19
|
* registration when a user-provided extension already supplied the contract.
|
|
20
|
+
*
|
|
21
|
+
* The npm distribution declares @veryfront/ext-content-mdx as an *optional
|
|
22
|
+
* peer* (see scripts/build/npm-package-metadata.ts), so a plain
|
|
23
|
+
* `npm install veryfront` does not install it. Every server start calls this,
|
|
24
|
+
* including projects with no .mdx or .md file at all, so a missing package must
|
|
25
|
+
* not be fatal here. Leaving the contract unregistered defers the report to the
|
|
26
|
+
* compile path, which throws the typed MISSING_EXTENSION_ERROR naming
|
|
27
|
+
* @veryfront/ext-content-mdx only when content is actually rendered.
|
|
28
|
+
*
|
|
29
|
+
* `load` is a test seam and defaults to the real module loader.
|
|
16
30
|
*/
|
|
17
|
-
export declare function ensureBuiltinContentProcessor(): Promise<void>;
|
|
31
|
+
export declare function ensureBuiltinContentProcessor(load?: () => Promise<ContentMdxExtensionModule>): Promise<void>;
|
|
32
|
+
export {};
|
|
18
33
|
//# sourceMappingURL=ensure-content-processor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-content-processor.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/ensure-content-processor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ensure-content-processor.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/ensure-content-processor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAO9E,KAAK,yBAAyB,GAAG;IAC/B,mBAAmB,EAAE,UAAU,gBAAgB,CAAC;CACjD,CAAC;AAmCF;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAItD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,GAAE,MAAM,OAAO,CAAC,yBAAyB,CAAwB,GACpE,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { tryResolve } from "../../src/extensions/index.js";
|
|
2
2
|
import { register } from "../../src/extensions/contracts.js";
|
|
3
|
-
import { importFirstPartyExtensionModule } from "../../src/extensions/first-party-import.js";
|
|
3
|
+
import { firstPartyExtensionSourceSpecifiers, importFirstPartyExtensionModule, isMissingFirstPartyExtensionModule, } from "../../src/extensions/first-party-import.js";
|
|
4
|
+
const CONTENT_MDX_DIRECTORY = "ext-content-mdx";
|
|
5
|
+
const CONTENT_MDX_PACKAGE = `@veryfront/${CONTENT_MDX_DIRECTORY}`;
|
|
6
|
+
/**
|
|
7
|
+
* Specifiers a "not installed" failure is allowed to name: the npm package and
|
|
8
|
+
* the workspace source entries the loader tries first. Derived rather than
|
|
9
|
+
* written out so they stay in step with the loader, and so this module keeps
|
|
10
|
+
* naming no extension source path of its own.
|
|
11
|
+
*
|
|
12
|
+
* A load failure naming anything else — a broken transitive dependency inside
|
|
13
|
+
* an installed ext-content-mdx, say — is a real error and must not be
|
|
14
|
+
* swallowed.
|
|
15
|
+
*/
|
|
16
|
+
const CONTENT_MDX_SPECIFIERS = [
|
|
17
|
+
CONTENT_MDX_PACKAGE,
|
|
18
|
+
...firstPartyExtensionSourceSpecifiers(CONTENT_MDX_DIRECTORY).map((specifier) => specifier.replace(/^(?:\.\.\/)+/, "")),
|
|
19
|
+
];
|
|
4
20
|
let contentMdxModulePromise;
|
|
5
21
|
function loadContentMdxModule() {
|
|
6
|
-
contentMdxModulePromise ??= importFirstPartyExtensionModule(
|
|
22
|
+
contentMdxModulePromise ??= importFirstPartyExtensionModule(CONTENT_MDX_DIRECTORY, CONTENT_MDX_PACKAGE).catch((error) => {
|
|
7
23
|
contentMdxModulePromise = undefined;
|
|
8
24
|
throw error;
|
|
9
25
|
});
|
|
@@ -28,10 +44,28 @@ export function prefetchBuiltinContentProcessor() {
|
|
|
28
44
|
* `setupAll` to `teardownAll` to `reset()` clears the contract registry, so this
|
|
29
45
|
* must run *after* the server-start (or `getConfig`) call returns. We skip
|
|
30
46
|
* registration when a user-provided extension already supplied the contract.
|
|
47
|
+
*
|
|
48
|
+
* The npm distribution declares @veryfront/ext-content-mdx as an *optional
|
|
49
|
+
* peer* (see scripts/build/npm-package-metadata.ts), so a plain
|
|
50
|
+
* `npm install veryfront` does not install it. Every server start calls this,
|
|
51
|
+
* including projects with no .mdx or .md file at all, so a missing package must
|
|
52
|
+
* not be fatal here. Leaving the contract unregistered defers the report to the
|
|
53
|
+
* compile path, which throws the typed MISSING_EXTENSION_ERROR naming
|
|
54
|
+
* @veryfront/ext-content-mdx only when content is actually rendered.
|
|
55
|
+
*
|
|
56
|
+
* `load` is a test seam and defaults to the real module loader.
|
|
31
57
|
*/
|
|
32
|
-
export async function ensureBuiltinContentProcessor() {
|
|
58
|
+
export async function ensureBuiltinContentProcessor(load = loadContentMdxModule) {
|
|
33
59
|
if (tryResolve("ContentProcessor"))
|
|
34
60
|
return;
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
let module;
|
|
62
|
+
try {
|
|
63
|
+
module = await load();
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (isMissingFirstPartyExtensionModule(error, CONTENT_MDX_SPECIFIERS))
|
|
67
|
+
return;
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
register("ContentProcessor", new module.MdxContentProcessor());
|
|
37
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-creation.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/project-creation.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,6BAA6B,CAAC;AAcrC,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EAEf,YAAY,EACb,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAA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AM,CAAC,CAAC;IAC3C,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,wFAAwF;AACxF,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,QAAQ,EAAE,YAAY,CAAC;IACvB,iDAAiD;IACjD,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CA6D/B"}
|
|
@@ -128,6 +128,7 @@ function dedupeEnvVars(envVars) {
|
|
|
128
128
|
return true;
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
+
const MDX_EXTENSION_PACKAGE = "@veryfront/ext-content-mdx";
|
|
131
132
|
async function loadTemplateFiles(template) {
|
|
132
133
|
const { getAiRuleTemplate, getTemplate, getTemplateConfig } = await import("../../templates/index.js");
|
|
133
134
|
let files = await getTemplate(template);
|
|
@@ -150,6 +151,33 @@ async function loadTemplateFiles(template) {
|
|
|
150
151
|
firstPartyExtensions: templateConfig?.firstPartyExtensions,
|
|
151
152
|
};
|
|
152
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Declare `@veryfront/ext-content-mdx` whenever the assembled project actually
|
|
156
|
+
* contains an `.mdx` file.
|
|
157
|
+
*
|
|
158
|
+
* The extension is an optional peer of the npm package — it drags
|
|
159
|
+
* `@types/mdx`, which breaks `tsc --noEmit` for every library consumer — so a
|
|
160
|
+
* project that renders MDX has to install it or those routes fail at runtime.
|
|
161
|
+
*
|
|
162
|
+
* Two ways a project ends up needing it, and the template config sees neither
|
|
163
|
+
* on its own:
|
|
164
|
+
*
|
|
165
|
+
* - A scaffolded `.mdx` file. The `minimal` starter ships `app/about/page.mdx`.
|
|
166
|
+
* - The `mdx` feature. It scaffolds no files — it sets `mdx.enabled` in the
|
|
167
|
+
* config and tips the user to "Create .mdx files in app/ directory" — so a
|
|
168
|
+
* user who follows that advice on any template would hit a runtime failure
|
|
169
|
+
* with nothing in `package.json` to explain it.
|
|
170
|
+
*/
|
|
171
|
+
function withMdxExtension(firstPartyExtensions, files, features) {
|
|
172
|
+
const needsMdx = features.includes("mdx") ||
|
|
173
|
+
files.some((file) => file.path.endsWith(".mdx"));
|
|
174
|
+
if (!needsMdx)
|
|
175
|
+
return firstPartyExtensions;
|
|
176
|
+
const existing = firstPartyExtensions ?? [];
|
|
177
|
+
if (existing.includes(MDX_EXTENSION_PACKAGE))
|
|
178
|
+
return existing;
|
|
179
|
+
return [...existing, MDX_EXTENSION_PACKAGE];
|
|
180
|
+
}
|
|
153
181
|
async function assembleFeatureFiles(features, templateFiles, allEnvVars) {
|
|
154
182
|
let files = templateFiles;
|
|
155
183
|
const tips = [];
|
|
@@ -309,7 +337,7 @@ async function assembleScaffold(request) {
|
|
|
309
337
|
tips: [...featureAssembly.tips, ...integrationAssembly.tips],
|
|
310
338
|
packageJsonOptions: {
|
|
311
339
|
dependencies: template.dependencies,
|
|
312
|
-
firstPartyExtensions: template.firstPartyExtensions,
|
|
340
|
+
firstPartyExtensions: withMdxExtension(template.firstPartyExtensions, integrationAssembly.files, request.features),
|
|
313
341
|
integrations: integrationAssembly.loadedIntegrations.map((integration) => ({
|
|
314
342
|
name: integration.config.name,
|
|
315
343
|
npmDependencies: integration.config.npmDependencies,
|