veryfront 0.1.111 → 0.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +13 -0
- package/esm/cli/commands/analyze-chunks/command-help.d.ts.map +1 -1
- package/esm/cli/commands/analyze-chunks/command-help.js +1 -0
- package/esm/cli/commands/build/command-help.d.ts.map +1 -1
- package/esm/cli/commands/build/command-help.js +1 -0
- package/esm/cli/commands/build/command.d.ts.map +1 -1
- package/esm/cli/commands/build/command.js +47 -2
- package/esm/cli/commands/clean/command-help.d.ts.map +1 -1
- package/esm/cli/commands/clean/command-help.js +1 -0
- package/esm/cli/commands/completions/command-help.d.ts +3 -0
- package/esm/cli/commands/completions/command-help.d.ts.map +1 -0
- package/esm/cli/commands/completions/command-help.js +13 -0
- package/esm/cli/commands/completions/command.d.ts +28 -0
- package/esm/cli/commands/completions/command.d.ts.map +1 -0
- package/esm/cli/commands/completions/command.js +133 -0
- package/esm/cli/commands/completions/handler.d.ts +3 -0
- package/esm/cli/commands/completions/handler.d.ts.map +1 -0
- package/esm/cli/commands/completions/handler.js +20 -0
- package/esm/cli/commands/demo/command-help.d.ts.map +1 -1
- package/esm/cli/commands/demo/command-help.js +1 -0
- package/esm/cli/commands/deploy/command-help.d.ts.map +1 -1
- package/esm/cli/commands/deploy/command-help.js +1 -0
- package/esm/cli/commands/deploy/command.d.ts.map +1 -1
- package/esm/cli/commands/deploy/command.js +73 -1
- package/esm/cli/commands/dev/command-help.d.ts.map +1 -1
- package/esm/cli/commands/dev/command-help.js +1 -0
- package/esm/cli/commands/doctor/command-help.d.ts.map +1 -1
- package/esm/cli/commands/doctor/command-help.js +1 -0
- package/esm/cli/commands/files/command-help.d.ts.map +1 -1
- package/esm/cli/commands/files/command-help.js +1 -0
- package/esm/cli/commands/generate/command-help.d.ts.map +1 -1
- package/esm/cli/commands/generate/command-help.js +1 -0
- package/esm/cli/commands/init/command-help.d.ts.map +1 -1
- package/esm/cli/commands/init/command-help.js +1 -0
- package/esm/cli/commands/install/command-help.d.ts.map +1 -1
- package/esm/cli/commands/install/command-help.js +2 -0
- package/esm/cli/commands/issues/command-help.d.ts.map +1 -1
- package/esm/cli/commands/issues/command-help.js +1 -0
- package/esm/cli/commands/knowledge/command-help.d.ts.map +1 -1
- package/esm/cli/commands/knowledge/command-help.js +1 -0
- package/esm/cli/commands/lint/command-help.d.ts +3 -0
- package/esm/cli/commands/lint/command-help.d.ts.map +1 -0
- package/esm/cli/commands/lint/command-help.js +13 -0
- package/esm/cli/commands/lint/command.d.ts +24 -0
- package/esm/cli/commands/lint/command.d.ts.map +1 -0
- package/esm/cli/commands/lint/command.js +34 -0
- package/esm/cli/commands/lint/handler.d.ts +3 -0
- package/esm/cli/commands/lint/handler.d.ts.map +1 -0
- package/esm/cli/commands/lint/handler.js +33 -0
- package/esm/cli/commands/lock/command-help.d.ts.map +1 -1
- package/esm/cli/commands/lock/command-help.js +1 -0
- package/esm/cli/commands/login/command-help.d.ts.map +1 -1
- package/esm/cli/commands/login/command-help.js +1 -0
- package/esm/cli/commands/logout/command-help.d.ts.map +1 -1
- package/esm/cli/commands/logout/command-help.js +1 -0
- package/esm/cli/commands/mcp/command-help.d.ts.map +1 -1
- package/esm/cli/commands/mcp/command-help.js +1 -0
- package/esm/cli/commands/merge/command-help.d.ts.map +1 -1
- package/esm/cli/commands/merge/command-help.js +1 -0
- package/esm/cli/commands/pull/command-help.d.ts.map +1 -1
- package/esm/cli/commands/pull/command-help.js +1 -0
- package/esm/cli/commands/push/command-help.d.ts.map +1 -1
- package/esm/cli/commands/push/command-help.js +1 -0
- package/esm/cli/commands/routes/command-help.d.ts.map +1 -1
- package/esm/cli/commands/routes/command-help.js +1 -0
- package/esm/cli/commands/schema/command-help.d.ts +3 -0
- package/esm/cli/commands/schema/command-help.d.ts.map +1 -0
- package/esm/cli/commands/schema/command-help.js +15 -0
- package/esm/cli/commands/schema/command.d.ts +30 -0
- package/esm/cli/commands/schema/command.d.ts.map +1 -0
- package/esm/cli/commands/schema/command.js +39 -0
- package/esm/cli/commands/schema/handler.d.ts +3 -0
- package/esm/cli/commands/schema/handler.d.ts.map +1 -0
- package/esm/cli/commands/schema/handler.js +25 -0
- package/esm/cli/commands/serve/command-help.d.ts.map +1 -1
- package/esm/cli/commands/serve/command-help.js +1 -0
- package/esm/cli/commands/skills/command-help.d.ts +3 -0
- package/esm/cli/commands/skills/command-help.d.ts.map +1 -0
- package/esm/cli/commands/skills/command-help.js +21 -0
- package/esm/cli/commands/skills/command.d.ts +9 -0
- package/esm/cli/commands/skills/command.d.ts.map +1 -0
- package/esm/cli/commands/skills/command.js +17 -0
- package/esm/cli/commands/skills/create.d.ts +3 -0
- package/esm/cli/commands/skills/create.d.ts.map +1 -0
- package/esm/cli/commands/skills/create.js +65 -0
- package/esm/cli/commands/skills/handler.d.ts +3 -0
- package/esm/cli/commands/skills/handler.d.ts.map +1 -0
- package/esm/cli/commands/skills/handler.js +82 -0
- package/esm/cli/commands/skills/validate.d.ts +3 -0
- package/esm/cli/commands/skills/validate.d.ts.map +1 -0
- package/esm/cli/commands/skills/validate.js +91 -0
- package/esm/cli/commands/start/command-help.d.ts.map +1 -1
- package/esm/cli/commands/start/command-help.js +1 -0
- package/esm/cli/commands/studio/command-help.d.ts.map +1 -1
- package/esm/cli/commands/studio/command-help.js +1 -0
- package/esm/cli/commands/styles/command-help.d.ts.map +1 -1
- package/esm/cli/commands/styles/command-help.js +1 -0
- package/esm/cli/commands/task/command-help.d.ts.map +1 -1
- package/esm/cli/commands/task/command-help.js +1 -0
- package/esm/cli/commands/test/command-help.d.ts +3 -0
- package/esm/cli/commands/test/command-help.d.ts.map +1 -0
- package/esm/cli/commands/test/command-help.js +16 -0
- package/esm/cli/commands/test/command.d.ts +25 -0
- package/esm/cli/commands/test/command.d.ts.map +1 -0
- package/esm/cli/commands/test/command.js +68 -0
- package/esm/cli/commands/test/handler.d.ts +3 -0
- package/esm/cli/commands/test/handler.d.ts.map +1 -0
- package/esm/cli/commands/test/handler.js +61 -0
- package/esm/cli/commands/up/command-help.d.ts.map +1 -1
- package/esm/cli/commands/up/command-help.js +1 -0
- package/esm/cli/commands/uploads/command-help.d.ts.map +1 -1
- package/esm/cli/commands/uploads/command-help.js +1 -0
- package/esm/cli/commands/whoami/command-help.d.ts.map +1 -1
- package/esm/cli/commands/whoami/command-help.js +1 -0
- package/esm/cli/commands/workflow/command-help.d.ts.map +1 -1
- package/esm/cli/commands/workflow/command-help.js +1 -0
- package/esm/cli/help/command-definitions.d.ts.map +1 -1
- package/esm/cli/help/command-definitions.js +10 -0
- package/esm/cli/help/main-help.d.ts.map +1 -1
- package/esm/cli/help/main-help.js +38 -5
- package/esm/cli/help/types.d.ts +2 -0
- package/esm/cli/help/types.d.ts.map +1 -1
- package/esm/cli/mcp/advanced-tools.d.ts.map +1 -1
- package/esm/cli/mcp/advanced-tools.js +4 -0
- package/esm/cli/mcp/server.d.ts.map +1 -1
- package/esm/cli/mcp/server.js +68 -0
- package/esm/cli/mcp/standalone.d.ts +2 -0
- package/esm/cli/mcp/standalone.d.ts.map +1 -1
- package/esm/cli/mcp/standalone.js +117 -2
- package/esm/cli/mcp/tools/cicd-tools.d.ts +3 -0
- package/esm/cli/mcp/tools/cicd-tools.d.ts.map +1 -0
- package/esm/cli/mcp/tools/cicd-tools.js +75 -0
- package/esm/cli/mcp/tools/introspection-tools.d.ts +3 -0
- package/esm/cli/mcp/tools/introspection-tools.d.ts.map +1 -0
- package/esm/cli/mcp/tools/introspection-tools.js +38 -0
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +35 -1
- package/esm/cli/shared/args.d.ts +4 -0
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +2 -0
- package/esm/cli/shared/interactive.d.ts +13 -0
- package/esm/cli/shared/interactive.d.ts.map +1 -0
- package/esm/cli/shared/interactive.js +26 -0
- package/esm/cli/shared/json-output.d.ts +52 -0
- package/esm/cli/shared/json-output.d.ts.map +1 -0
- package/esm/cli/shared/json-output.js +58 -0
- package/esm/cli/shared/suggest.d.ts +8 -0
- package/esm/cli/shared/suggest.d.ts.map +1 -0
- package/esm/cli/shared/suggest.js +25 -0
- package/esm/cli/skills/core-skills.d.ts +9 -0
- package/esm/cli/skills/core-skills.d.ts.map +1 -0
- package/esm/cli/skills/core-skills.js +230 -0
- package/esm/cli/skills/loader.d.ts +13 -0
- package/esm/cli/skills/loader.d.ts.map +1 -0
- package/esm/cli/skills/loader.js +87 -0
- package/esm/cli/skills/types.d.ts +29 -0
- package/esm/cli/skills/types.d.ts.map +1 -0
- package/esm/cli/skills/types.js +25 -0
- package/esm/cli/utils/index.d.ts.map +1 -1
- package/esm/cli/utils/index.js +3 -0
- package/esm/deno.d.ts +2 -0
- package/esm/deno.js +3 -1
- package/esm/src/html/dev-scripts.d.ts.map +1 -1
- package/esm/src/html/dev-scripts.js +3 -2
- package/esm/src/html/html-injection.d.ts.map +1 -1
- package/esm/src/html/html-injection.js +2 -1
- package/esm/src/html/html-shell-generator.js +1 -1
- package/esm/src/html/hydration-script-builder/dev-client-renderer.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/dev-client-renderer.js +2 -1
- package/esm/src/html/hydration-script-builder/dev-component-manifest.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/dev-component-manifest.js +2 -1
- package/esm/src/html/hydration-script-builder/dev-error-logger.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/dev-error-logger.js +2 -1
- package/esm/src/html/hydration-script-builder/dev-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/dev-scripts.js +2 -1
- package/esm/src/html/hydration-script-builder/prod-hydration.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/prod-hydration.js +2 -1
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/prod-scripts.js +2 -1
- package/esm/src/html/styles-builder/dev-styles.d.ts.map +1 -1
- package/esm/src/html/styles-builder/dev-styles.js +2 -1
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.d.ts +10 -0
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.js +53 -26
- 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 +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +3 -3
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +94 -5
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +2 -2
- package/esm/src/rendering/rsc/client-boot.ts +30 -4
- package/esm/src/rendering/snippet-renderer.js +1 -1
- package/esm/src/security/http/response/security-handler.d.ts.map +1 -1
- package/esm/src/security/http/response/security-handler.js +3 -2
- package/esm/src/server/dev-server/error-overlay/html-template.d.ts +1 -1
- package/esm/src/server/dev-server/error-overlay/html-template.d.ts.map +1 -1
- package/esm/src/server/dev-server/error-overlay/html-template.js +4 -3
- package/esm/src/server/dev-server/error-overlay/overlay-renderer.d.ts +1 -1
- package/esm/src/server/dev-server/error-overlay/overlay-renderer.d.ts.map +1 -1
- package/esm/src/server/dev-server/error-overlay/overlay-renderer.js +2 -2
- package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
- package/esm/src/server/services/rendering/ssr.service.js +3 -3
- 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 +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts +1 -1
- 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 +10 -5
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +13 -10
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts +2 -2
- 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 +4 -4
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts +2 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.js +71 -50
- 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 +7 -5
- 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 +3 -2
- package/esm/src/utils/version.d.ts +1 -1
- package/esm/src/utils/version.js +1 -1
- package/package.json +1 -1
- package/src/cli/auth/login.ts +14 -0
- package/src/cli/commands/analyze-chunks/command-help.ts +1 -0
- package/src/cli/commands/build/command-help.ts +1 -0
- package/src/cli/commands/build/command.ts +47 -2
- package/src/cli/commands/clean/command-help.ts +1 -0
- package/src/cli/commands/completions/command-help.ts +15 -0
- package/src/cli/commands/completions/command.ts +163 -0
- package/src/cli/commands/completions/handler.ts +29 -0
- package/src/cli/commands/demo/command-help.ts +1 -0
- package/src/cli/commands/deploy/command-help.ts +1 -0
- package/src/cli/commands/deploy/command.ts +82 -1
- package/src/cli/commands/dev/command-help.ts +1 -0
- package/src/cli/commands/doctor/command-help.ts +1 -0
- package/src/cli/commands/files/command-help.ts +1 -0
- package/src/cli/commands/generate/command-help.ts +1 -0
- package/src/cli/commands/init/command-help.ts +1 -0
- package/src/cli/commands/install/command-help.ts +2 -0
- package/src/cli/commands/issues/command-help.ts +1 -0
- package/src/cli/commands/knowledge/command-help.ts +1 -0
- package/src/cli/commands/lint/command-help.ts +15 -0
- package/src/cli/commands/lint/command.ts +59 -0
- package/src/cli/commands/lint/handler.ts +36 -0
- package/src/cli/commands/lock/command-help.ts +1 -0
- package/src/cli/commands/login/command-help.ts +1 -0
- package/src/cli/commands/logout/command-help.ts +1 -0
- package/src/cli/commands/mcp/command-help.ts +1 -0
- package/src/cli/commands/merge/command-help.ts +1 -0
- package/src/cli/commands/pull/command-help.ts +1 -0
- package/src/cli/commands/push/command-help.ts +1 -0
- package/src/cli/commands/routes/command-help.ts +1 -0
- package/src/cli/commands/schema/command-help.ts +17 -0
- package/src/cli/commands/schema/command.ts +64 -0
- package/src/cli/commands/schema/handler.ts +32 -0
- package/src/cli/commands/serve/command-help.ts +1 -0
- package/src/cli/commands/skills/command-help.ts +23 -0
- package/src/cli/commands/skills/command.ts +23 -0
- package/src/cli/commands/skills/create.ts +87 -0
- package/src/cli/commands/skills/handler.ts +106 -0
- package/src/cli/commands/skills/validate.ts +110 -0
- package/src/cli/commands/start/command-help.ts +1 -0
- package/src/cli/commands/studio/command-help.ts +1 -0
- package/src/cli/commands/styles/command-help.ts +1 -0
- package/src/cli/commands/task/command-help.ts +1 -0
- package/src/cli/commands/test/command-help.ts +18 -0
- package/src/cli/commands/test/command.ts +90 -0
- package/src/cli/commands/test/handler.ts +70 -0
- package/src/cli/commands/up/command-help.ts +1 -0
- package/src/cli/commands/uploads/command-help.ts +1 -0
- package/src/cli/commands/whoami/command-help.ts +1 -0
- package/src/cli/commands/workflow/command-help.ts +1 -0
- package/src/cli/help/command-definitions.ts +10 -0
- package/src/cli/help/main-help.ts +48 -5
- package/src/cli/help/types.ts +9 -0
- package/src/cli/mcp/advanced-tools.ts +4 -0
- package/src/cli/mcp/server.ts +72 -0
- package/src/cli/mcp/standalone.ts +133 -1
- package/src/cli/mcp/tools/cicd-tools.ts +86 -0
- package/src/cli/mcp/tools/introspection-tools.ts +46 -0
- package/src/cli/router.ts +32 -1
- package/src/cli/shared/args.ts +2 -0
- package/src/cli/shared/interactive.ts +33 -0
- package/src/cli/shared/json-output.ts +96 -0
- package/src/cli/shared/suggest.ts +33 -0
- package/src/cli/skills/core-skills.ts +233 -0
- package/src/cli/skills/loader.ts +98 -0
- package/src/cli/skills/types.ts +39 -0
- package/src/cli/utils/index.ts +2 -0
- package/src/deno.js +3 -1
- package/src/src/html/dev-scripts.ts +4 -2
- package/src/src/html/html-injection.ts +2 -1
- package/src/src/html/html-shell-generator.ts +1 -1
- package/src/src/html/hydration-script-builder/dev-client-renderer.ts +2 -1
- package/src/src/html/hydration-script-builder/dev-component-manifest.ts +2 -1
- package/src/src/html/hydration-script-builder/dev-error-logger.ts +3 -1
- package/src/src/html/hydration-script-builder/dev-scripts.ts +2 -1
- package/src/src/html/hydration-script-builder/prod-hydration.ts +2 -1
- package/src/src/html/hydration-script-builder/prod-scripts.ts +2 -1
- package/src/src/html/styles-builder/dev-styles.ts +2 -1
- package/src/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.ts +65 -31
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +1 -0
- package/src/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.ts +4 -4
- package/src/src/rendering/orchestrator/html.ts +113 -4
- package/src/src/rendering/orchestrator/module-loader/index.ts +2 -1
- package/src/src/rendering/snippet-renderer.ts +1 -1
- package/src/src/security/http/response/security-handler.ts +3 -2
- package/src/src/server/dev-server/error-overlay/html-template.ts +4 -2
- package/src/src/server/dev-server/error-overlay/overlay-renderer.ts +2 -1
- package/src/src/server/services/rendering/ssr.service.ts +12 -7
- package/src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts +1 -1
- package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +15 -4
- package/src/src/transforms/mdx/esm-module-loader/cache-format.ts +24 -6
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.ts +10 -3
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.ts +98 -51
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +20 -4
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.ts +3 -1
- package/src/src/utils/version.ts +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { hashCodeHex } from "../../../utils/hash-utils.js";
|
|
2
2
|
import { createCacheNamespace } from "../../../utils/cache-namespace.js";
|
|
3
|
+
import { REACT_DEFAULT_VERSION } from "../../../utils/constants/cdn.js";
|
|
4
|
+
import { VERSION } from "../../../utils/version.js";
|
|
3
5
|
import { UNRESOLVED_VF_MODULES_PATTERN } from "./constants.js";
|
|
4
6
|
import { hashString } from "./utils/hash.js";
|
|
5
7
|
const ALL_FILE_URL_PATTERN_SOURCE = /file:\/\/([^"'\s]+)/.source;
|
|
6
8
|
const MJS_FILE_URL_PATTERN_SOURCE = /file:\/\/([^"'\s]+\.mjs)/.source;
|
|
7
9
|
const CACHE_NAMESPACE_SENTINEL = "__vf_cache_namespace__";
|
|
8
|
-
function formatMdxEsmTransformCacheKey(namespace, projectId, contentSourceId, normalizedPath, contentHash) {
|
|
9
|
-
return `${namespace}:${projectId}:${contentSourceId}:${normalizedPath}:${contentHash}:ssr`;
|
|
10
|
+
function formatMdxEsmTransformCacheKey(namespace, projectId, contentSourceId, reactVersion, normalizedPath, contentHash) {
|
|
11
|
+
return `${namespace}:${projectId}:${contentSourceId}:${reactVersion}:${normalizedPath}:${contentHash}:ssr`;
|
|
10
12
|
}
|
|
11
|
-
function formatMdxEsmPathCacheKey(namespace, normalizedPath) {
|
|
12
|
-
return `${namespace}:${normalizedPath}`;
|
|
13
|
+
function formatMdxEsmPathCacheKey(namespace, reactVersion, normalizedPath) {
|
|
14
|
+
return `${namespace}:${reactVersion}:${normalizedPath}`;
|
|
13
15
|
}
|
|
14
16
|
function formatMdxEsmModuleFileName(namespace, contentHash) {
|
|
15
17
|
return `vfmod-${namespace}-${contentHash}.mjs`;
|
|
@@ -25,8 +27,8 @@ function formatFrameworkVfModuleCacheFileName(namespace, pathHash, envKey, conte
|
|
|
25
27
|
}
|
|
26
28
|
function buildMdxEsmCacheSchemaSample() {
|
|
27
29
|
return {
|
|
28
|
-
transformKey: formatMdxEsmTransformCacheKey(CACHE_NAMESPACE_SENTINEL, "__vf_project__", "preview-main", "_vf_modules/pages/index.js", "deadbeef"),
|
|
29
|
-
pathKey: formatMdxEsmPathCacheKey(CACHE_NAMESPACE_SENTINEL, "_vf_modules/pages/index.js"),
|
|
30
|
+
transformKey: formatMdxEsmTransformCacheKey(CACHE_NAMESPACE_SENTINEL, "__vf_project__", "preview-main", "19.1.1", "_vf_modules/pages/index.js", "deadbeef"),
|
|
31
|
+
pathKey: formatMdxEsmPathCacheKey(CACHE_NAMESPACE_SENTINEL, REACT_DEFAULT_VERSION, "_vf_modules/pages/index.js"),
|
|
30
32
|
moduleFile: formatMdxEsmModuleFileName(CACHE_NAMESPACE_SENTINEL, "deadbeef"),
|
|
31
33
|
moduleRecoveryKey: formatMdxEsmModuleRecoveryCacheKey(CACHE_NAMESPACE_SENTINEL, "__vf_project__", "preview-main", formatMdxEsmModuleFileName(CACHE_NAMESPACE_SENTINEL, "deadbeef")),
|
|
32
34
|
jsxFile: formatMdxJsxCacheFileName(CACHE_NAMESPACE_SENTINEL, "/tmp/project/Button.tsx"),
|
|
@@ -37,6 +39,7 @@ function buildMdxEsmCacheSchemaSample() {
|
|
|
37
39
|
hashString("_vf_modules/pages/index.jsexport default 1;"),
|
|
38
40
|
hashString("/tmp/project/Button.tsx"),
|
|
39
41
|
],
|
|
42
|
+
frameworkVersion: VERSION,
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
45
|
function buildFrameworkVfModuleCacheSchemaSample() {
|
|
@@ -48,11 +51,11 @@ export const MDX_ESM_ALL_FILE_URL_PATTERN_SOURCE = ALL_FILE_URL_PATTERN_SOURCE;
|
|
|
48
51
|
export const MDX_ESM_MJS_FILE_URL_PATTERN_SOURCE = MJS_FILE_URL_PATTERN_SOURCE;
|
|
49
52
|
export const MDX_ESM_CACHE_NAMESPACE = createCacheNamespace("mdx-esm", buildMdxEsmCacheSchemaSample());
|
|
50
53
|
export const FRAMEWORK_VF_MODULE_CACHE_NAMESPACE = createCacheNamespace("vf-framework", buildFrameworkVfModuleCacheSchemaSample());
|
|
51
|
-
export function buildMdxEsmTransformCacheKey(projectId, contentSourceId, normalizedPath, contentHash) {
|
|
52
|
-
return formatMdxEsmTransformCacheKey(MDX_ESM_CACHE_NAMESPACE, projectId, contentSourceId, normalizedPath, contentHash);
|
|
54
|
+
export function buildMdxEsmTransformCacheKey(projectId, contentSourceId, reactVersion, normalizedPath, contentHash) {
|
|
55
|
+
return formatMdxEsmTransformCacheKey(MDX_ESM_CACHE_NAMESPACE, projectId, contentSourceId, reactVersion, normalizedPath, contentHash);
|
|
53
56
|
}
|
|
54
|
-
export function buildMdxEsmPathCacheKey(normalizedPath) {
|
|
55
|
-
return formatMdxEsmPathCacheKey(MDX_ESM_CACHE_NAMESPACE, normalizedPath);
|
|
57
|
+
export function buildMdxEsmPathCacheKey(normalizedPath, reactVersion = REACT_DEFAULT_VERSION) {
|
|
58
|
+
return formatMdxEsmPathCacheKey(MDX_ESM_CACHE_NAMESPACE, reactVersion, normalizedPath);
|
|
56
59
|
}
|
|
57
60
|
export function buildMdxEsmModuleFileName(contentHash) {
|
|
58
61
|
return formatMdxEsmModuleFileName(MDX_ESM_CACHE_NAMESPACE, contentHash);
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
* CRITICAL: The :ssr suffix is required to avoid cache collisions with browser-mode transforms
|
|
11
11
|
* that use relative paths (../lib/utils.js) instead of absolute paths (/_vf_modules/lib/utils.js).
|
|
12
12
|
*/
|
|
13
|
-
export declare function getTransformCacheKey(projectId: string, contentSourceId: string, normalizedPath: string, contentHash: string): string;
|
|
14
|
-
export declare function getVersionedPathCacheKey(normalizedPath: string): string;
|
|
13
|
+
export declare function getTransformCacheKey(projectId: string, contentSourceId: string, reactVersion: string, normalizedPath: string, contentHash: string): string;
|
|
14
|
+
export declare function getVersionedPathCacheKey(normalizedPath: string, reactVersion: string): string;
|
|
15
15
|
//# sourceMappingURL=cache-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-keys.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,MAAM,
|
|
1
|
+
{"version":3,"file":"cache-keys.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,MAAM,CAQR;AAED,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAE7F"}
|
|
@@ -11,9 +11,9 @@ import { buildMdxEsmPathCacheKey, buildMdxEsmTransformCacheKey } from "../cache-
|
|
|
11
11
|
* CRITICAL: The :ssr suffix is required to avoid cache collisions with browser-mode transforms
|
|
12
12
|
* that use relative paths (../lib/utils.js) instead of absolute paths (/_vf_modules/lib/utils.js).
|
|
13
13
|
*/
|
|
14
|
-
export function getTransformCacheKey(projectId, contentSourceId, normalizedPath, contentHash) {
|
|
15
|
-
return buildMdxEsmTransformCacheKey(projectId, contentSourceId, normalizedPath, contentHash);
|
|
14
|
+
export function getTransformCacheKey(projectId, contentSourceId, reactVersion, normalizedPath, contentHash) {
|
|
15
|
+
return buildMdxEsmTransformCacheKey(projectId, contentSourceId, reactVersion, normalizedPath, contentHash);
|
|
16
16
|
}
|
|
17
|
-
export function getVersionedPathCacheKey(normalizedPath) {
|
|
18
|
-
return buildMdxEsmPathCacheKey(normalizedPath);
|
|
17
|
+
export function getVersionedPathCacheKey(normalizedPath, reactVersion) {
|
|
18
|
+
return buildMdxEsmPathCacheKey(normalizedPath, reactVersion);
|
|
19
19
|
}
|
|
@@ -20,9 +20,8 @@ interface MdxRecoveryOptions {
|
|
|
20
20
|
* 2. HTTP bundle cache paths (file:///app/.cache/veryfront-http-bundle/...) that don't match local cache dir
|
|
21
21
|
* 3. MDX ESM cache paths (file:///app/.cache/veryfront-mdx-esm/...) that don't match local cache dir
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* the 'g' flag would cause interleaved exec() calls to skip paths.
|
|
23
|
+
* This check also walks transitively imported VF modules so nested stale paths
|
|
24
|
+
* are rejected before import-time failures.
|
|
26
25
|
*/
|
|
27
26
|
export declare function hasIncompatibleFrameworkPaths(code: string, log: Logger): Promise<boolean>;
|
|
28
27
|
/**
|
package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-validator.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"framework-validator.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAiBjE,UAAU,kBAAkB;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB;AAkGD;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAsB/F;AAED;;;;;;GAMG;AACH,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,CAAC,CAoBnB;AAYD,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,YAAY,EAAE,MAAM,EACpB,eAAe,CAAC,EAAE,kBAAkB,GACnC,OAAO,CAAC,OAAO,CAAC,CAgFlB"}
|
|
@@ -6,90 +6,119 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module transforms/mdx/esm-module-loader/module-fetcher/framework-validator
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { extractAllFilePaths, extractAllFilePathsRecursive, extractAllHttpBundlePathsRecursive, visitImportedVfModules, } from "../../../../modules/react-loader/ssr-module-loader/http-bundle-helpers.js";
|
|
10
|
+
import { getCacheBaseDir, getHttpBundleCacheDir, getMdxEsmCacheDir, } from "../../../../utils/cache-dir.js";
|
|
10
11
|
import { FRAMEWORK_ROOT, LOG_PREFIX_MDX_LOADER } from "../constants.js";
|
|
11
12
|
import { getLocalFs } from "../cache/index.js";
|
|
12
|
-
import { extractHttpBundlePaths } from "../../../../modules/react-loader/ssr-module-loader/http-bundle-helpers.js";
|
|
13
13
|
import { ensureHttpBundlesExist } from "../../../esm/http-cache.js";
|
|
14
|
-
import { MDX_ESM_MJS_FILE_URL_PATTERN_SOURCE } from "../cache-format.js";
|
|
15
14
|
import { ensureMdxModuleDependencies } from "./dependency-recovery.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Returns true if the cached code should be invalidated (has paths from a different environment).
|
|
19
|
-
*
|
|
20
|
-
* Checks for:
|
|
21
|
-
* 1. Framework source paths (file:///app/src/...) that don't match FRAMEWORK_ROOT
|
|
22
|
-
* 2. HTTP bundle cache paths (file:///app/.cache/veryfront-http-bundle/...) that don't match local cache dir
|
|
23
|
-
* 3. MDX ESM cache paths (file:///app/.cache/veryfront-mdx-esm/...) that don't match local cache dir
|
|
24
|
-
*
|
|
25
|
-
* IMPORTANT: This function creates a new RegExp on each call to avoid race conditions
|
|
26
|
-
* when multiple modules are processed concurrently. Using a shared global regex with
|
|
27
|
-
* the 'g' flag would cause interleaved exec() calls to skip paths.
|
|
28
|
-
*/
|
|
29
|
-
export async function hasIncompatibleFrameworkPaths(code, log) {
|
|
30
|
-
// Check for esm.sh URLs that reference /_vf_modules/ paths - these are invalid
|
|
31
|
-
// and indicate a cached transform from before the fix was deployed
|
|
32
|
-
if (/esm\.sh\/_?vf_modules\//.test(code)) {
|
|
33
|
-
log.debug(`${LOG_PREFIX_MDX_LOADER} Cached code has invalid esm.sh/_vf_modules URL`);
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
const localHttpCacheDir = getHttpBundleCacheDir();
|
|
37
|
-
const localMdxCacheDir = getMdxEsmCacheDir();
|
|
15
|
+
const INVALID_VFMOD_ESM_URL_PATTERN = /esm\.sh\/_?vf_modules\//;
|
|
16
|
+
async function hasIncompatibleFrameworkPathsInCode(code, log, options) {
|
|
38
17
|
const localFs = getLocalFs();
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let match;
|
|
44
|
-
while ((match = allFilePathsPattern.exec(code)) !== null) {
|
|
45
|
-
if (match[1])
|
|
46
|
-
allPaths.push(match[1]);
|
|
18
|
+
const sourceContext = options.sourcePath ? { vfModulePath: options.sourcePath } : {};
|
|
19
|
+
if (INVALID_VFMOD_ESM_URL_PATTERN.test(code)) {
|
|
20
|
+
log.debug(`${LOG_PREFIX_MDX_LOADER} Cached code has invalid esm.sh/_vf_modules URL`, sourceContext);
|
|
21
|
+
return true;
|
|
47
22
|
}
|
|
23
|
+
const allPaths = extractAllFilePaths(code);
|
|
48
24
|
for (const path of allPaths) {
|
|
49
25
|
if (path.includes("veryfront-http-bundle")) {
|
|
50
|
-
if (!path.startsWith(localHttpCacheDir)) {
|
|
26
|
+
if (!path.startsWith(options.localHttpCacheDir)) {
|
|
51
27
|
log.debug(`${LOG_PREFIX_MDX_LOADER} HTTP bundle path from different environment`, {
|
|
52
28
|
path,
|
|
53
|
-
expectedDir: localHttpCacheDir,
|
|
29
|
+
expectedDir: options.localHttpCacheDir,
|
|
30
|
+
...sourceContext,
|
|
54
31
|
});
|
|
55
32
|
return true;
|
|
56
33
|
}
|
|
57
34
|
continue;
|
|
58
35
|
}
|
|
59
36
|
if (path.includes("veryfront-mdx-esm")) {
|
|
60
|
-
if (!path.startsWith(localMdxCacheDir)) {
|
|
37
|
+
if (!path.startsWith(options.localMdxCacheDir)) {
|
|
61
38
|
log.debug(`${LOG_PREFIX_MDX_LOADER} MDX cache path from different environment`, {
|
|
62
39
|
path,
|
|
63
|
-
expectedDir: localMdxCacheDir,
|
|
40
|
+
expectedDir: options.localMdxCacheDir,
|
|
41
|
+
...sourceContext,
|
|
64
42
|
});
|
|
65
43
|
return true;
|
|
66
44
|
}
|
|
67
45
|
continue;
|
|
68
46
|
}
|
|
47
|
+
// Legacy cache entries sometimes point directly at pod-local .cache source files
|
|
48
|
+
// like file:///app/.cache/markdown.tsx. These paths are not portable across pods.
|
|
49
|
+
// Allow local cache-base paths so valid local file:// dependencies under .cache
|
|
50
|
+
// are not evicted on every read.
|
|
51
|
+
if (path.includes(".cache/") && !path.startsWith(options.localCacheBaseDir)) {
|
|
52
|
+
log.debug(`${LOG_PREFIX_MDX_LOADER} Legacy cache path is not portable`, {
|
|
53
|
+
path,
|
|
54
|
+
expectedBaseDir: options.localCacheBaseDir,
|
|
55
|
+
...sourceContext,
|
|
56
|
+
});
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
69
59
|
if (!path.includes("/src/") || path.includes(".cache"))
|
|
70
60
|
continue;
|
|
71
61
|
if (!path.startsWith(FRAMEWORK_ROOT)) {
|
|
72
62
|
log.debug(`${LOG_PREFIX_MDX_LOADER} Framework path from different environment`, {
|
|
73
63
|
path,
|
|
74
64
|
expectedRoot: FRAMEWORK_ROOT,
|
|
65
|
+
...sourceContext,
|
|
75
66
|
});
|
|
76
67
|
return true;
|
|
77
68
|
}
|
|
78
69
|
try {
|
|
79
70
|
const stat = await localFs.stat(path);
|
|
80
71
|
if (!stat?.isFile) {
|
|
81
|
-
log.debug(`${LOG_PREFIX_MDX_LOADER} Framework path does not exist`, {
|
|
72
|
+
log.debug(`${LOG_PREFIX_MDX_LOADER} Framework path does not exist`, {
|
|
73
|
+
path,
|
|
74
|
+
...sourceContext,
|
|
75
|
+
});
|
|
82
76
|
return true;
|
|
83
77
|
}
|
|
84
78
|
}
|
|
85
79
|
catch (_) {
|
|
86
80
|
/* expected: framework file may not exist in this environment */
|
|
87
|
-
log.debug(`${LOG_PREFIX_MDX_LOADER} Framework path not accessible`, {
|
|
81
|
+
log.debug(`${LOG_PREFIX_MDX_LOADER} Framework path not accessible`, {
|
|
82
|
+
path,
|
|
83
|
+
...sourceContext,
|
|
84
|
+
});
|
|
88
85
|
return true;
|
|
89
86
|
}
|
|
90
87
|
}
|
|
91
88
|
return false;
|
|
92
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Check if cached code has file:// paths that are incompatible with this environment.
|
|
92
|
+
* Returns true if the cached code should be invalidated (has paths from a different environment).
|
|
93
|
+
*
|
|
94
|
+
* Checks for:
|
|
95
|
+
* 1. Framework source paths (file:///app/src/...) that don't match FRAMEWORK_ROOT
|
|
96
|
+
* 2. HTTP bundle cache paths (file:///app/.cache/veryfront-http-bundle/...) that don't match local cache dir
|
|
97
|
+
* 3. MDX ESM cache paths (file:///app/.cache/veryfront-mdx-esm/...) that don't match local cache dir
|
|
98
|
+
*
|
|
99
|
+
* This check also walks transitively imported VF modules so nested stale paths
|
|
100
|
+
* are rejected before import-time failures.
|
|
101
|
+
*/
|
|
102
|
+
export async function hasIncompatibleFrameworkPaths(code, log) {
|
|
103
|
+
const options = {
|
|
104
|
+
localHttpCacheDir: getHttpBundleCacheDir(),
|
|
105
|
+
localMdxCacheDir: getMdxEsmCacheDir(),
|
|
106
|
+
localCacheBaseDir: getCacheBaseDir(),
|
|
107
|
+
};
|
|
108
|
+
if (await hasIncompatibleFrameworkPathsInCode(code, log, options)) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
let incompatible = false;
|
|
112
|
+
await visitImportedVfModules(code, async (vfModuleCode, vfModulePath) => {
|
|
113
|
+
if (incompatible)
|
|
114
|
+
return;
|
|
115
|
+
incompatible = await hasIncompatibleFrameworkPathsInCode(vfModuleCode, log, {
|
|
116
|
+
...options,
|
|
117
|
+
sourcePath: vfModulePath,
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
return incompatible;
|
|
121
|
+
}
|
|
93
122
|
/**
|
|
94
123
|
* Check if cached code has file:// paths that don't exist locally.
|
|
95
124
|
* Returns list of missing paths, or empty array if all exist.
|
|
@@ -99,17 +128,9 @@ export async function hasIncompatibleFrameworkPaths(code, log) {
|
|
|
99
128
|
*/
|
|
100
129
|
export async function findMissingFileDependenciesInCode(code, log) {
|
|
101
130
|
const localFs = getLocalFs();
|
|
102
|
-
const pattern = new RegExp(MDX_ESM_MJS_FILE_URL_PATTERN_SOURCE, "gi");
|
|
103
131
|
const missing = [];
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
while ((match = pattern.exec(code)) !== null) {
|
|
107
|
-
const path = match[1];
|
|
108
|
-
// Skip query parameters in paths
|
|
109
|
-
const cleanPath = path.replace(/\?.*$/, "");
|
|
110
|
-
if (checked.has(cleanPath))
|
|
111
|
-
continue;
|
|
112
|
-
checked.add(cleanPath);
|
|
132
|
+
const allPaths = await extractAllFilePathsRecursive(code);
|
|
133
|
+
for (const cleanPath of allPaths) {
|
|
113
134
|
try {
|
|
114
135
|
const stat = await localFs.stat(cleanPath);
|
|
115
136
|
if (!stat?.isFile) {
|
|
@@ -151,7 +172,7 @@ export async function validateCachedModule(normalizedPath, cachedPath, cachedCod
|
|
|
151
172
|
}
|
|
152
173
|
return false;
|
|
153
174
|
}
|
|
154
|
-
const bundlePaths =
|
|
175
|
+
const bundlePaths = await extractAllHttpBundlePathsRecursive(cachedCode);
|
|
155
176
|
if (bundlePaths.length > 0) {
|
|
156
177
|
const cacheDir = getHttpBundleCacheDir();
|
|
157
178
|
const failed = await ensureHttpBundlesExist(bundlePaths, cacheDir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAO5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAexD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAS5E;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAOtD;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,SAAS,EAAE,MAAM;CAI9B;AAcD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,oBAAoB,EAC7B,gBAAgB,CAAC,EAAE,MAAM,EACzB,OAAO,GAAE,GAAG,CAAC,MAAM,CAAa,GAC/B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwFxB;AAoSD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IACR,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,GACA,oBAAoB,CAUtB"}
|
|
@@ -16,6 +16,7 @@ import { transformToESM } from "../../../esm-transform.js";
|
|
|
16
16
|
import { cacheHttpImportsToLocal } from "../../../esm/http-cache.js";
|
|
17
17
|
import { loadImportMap } from "../../../../modules/import-map/index.js";
|
|
18
18
|
import { getHttpBundleCacheDir } from "../../../../utils/cache-dir.js";
|
|
19
|
+
import { REACT_DEFAULT_VERSION } from "../../../../utils/constants/cdn.js";
|
|
19
20
|
import { LOG_PREFIX_MDX_LOADER } from "../constants.js";
|
|
20
21
|
import { getLocalFs, getModulePathCache } from "../cache/index.js";
|
|
21
22
|
import { hashString } from "../utils/hash.js";
|
|
@@ -149,8 +150,9 @@ export async function fetchAndCacheModule(modulePath, context, parentModulePath,
|
|
|
149
150
|
async function doFetchAndCacheModule(normalizedPath, context, fetchAndCacheModuleFn, projectSlug, parentModulePath) {
|
|
150
151
|
const log = getLog(context);
|
|
151
152
|
const { esmCacheDir, adapter, projectDir, projectId, contentSourceId } = context;
|
|
153
|
+
const effectiveReactVersion = context.reactVersion ?? REACT_DEFAULT_VERSION;
|
|
152
154
|
const pathCache = await getModulePathCache(esmCacheDir);
|
|
153
|
-
const versionedKey = getVersionedPathCacheKey(normalizedPath);
|
|
155
|
+
const versionedKey = getVersionedPathCacheKey(normalizedPath, effectiveReactVersion);
|
|
154
156
|
const cachedPath = pathCache.get(versionedKey);
|
|
155
157
|
if (cachedPath) {
|
|
156
158
|
try {
|
|
@@ -178,7 +180,7 @@ async function doFetchAndCacheModule(normalizedPath, context, fetchAndCacheModul
|
|
|
178
180
|
if (!resolved) {
|
|
179
181
|
const moduleCode = await fetchModuleViaHTTP(normalizedPath, adapter, fetchAndCacheModuleFn, log, projectSlug, context.isLocalProject);
|
|
180
182
|
if (moduleCode) {
|
|
181
|
-
return await cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log);
|
|
183
|
+
return await cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log, effectiveReactVersion);
|
|
182
184
|
}
|
|
183
185
|
if (context.strictMissingModules ?? true) {
|
|
184
186
|
throw buildMissingModuleError({
|
|
@@ -192,7 +194,7 @@ async function doFetchAndCacheModule(normalizedPath, context, fetchAndCacheModul
|
|
|
192
194
|
const { sourceCode, actualFilePath } = resolved;
|
|
193
195
|
const contentHash = hashString(sourceCode);
|
|
194
196
|
const transformCacheKey = contentSourceId
|
|
195
|
-
? getTransformCacheKey(projectId, contentSourceId, normalizedPath, contentHash)
|
|
197
|
+
? getTransformCacheKey(projectId, contentSourceId, effectiveReactVersion, normalizedPath, contentHash)
|
|
196
198
|
: null;
|
|
197
199
|
let moduleCode = null;
|
|
198
200
|
let needsDistributedCacheWrite = false;
|
|
@@ -200,7 +202,7 @@ async function doFetchAndCacheModule(normalizedPath, context, fetchAndCacheModul
|
|
|
200
202
|
// Returns null only if no distributed backend is configured.
|
|
201
203
|
// Otherwise returns { code, distributedCache } where code may be null (miss).
|
|
202
204
|
const distResult = transformCacheKey
|
|
203
|
-
? await readDistributedCache(transformCacheKey, projectId, contentSourceId, normalizedPath, projectSlug, projectDir,
|
|
205
|
+
? await readDistributedCache(transformCacheKey, projectId, contentSourceId, normalizedPath, projectSlug, projectDir, effectiveReactVersion, log)
|
|
204
206
|
: null;
|
|
205
207
|
if (distResult?.code) {
|
|
206
208
|
moduleCode = distResult.code;
|
|
@@ -316,7 +318,7 @@ async function doFetchAndCacheModule(normalizedPath, context, fetchAndCacheModul
|
|
|
316
318
|
normalizedPath,
|
|
317
319
|
});
|
|
318
320
|
const cacheStart = performance.now();
|
|
319
|
-
const finalCachedPath = await cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log);
|
|
321
|
+
const finalCachedPath = await cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log, effectiveReactVersion);
|
|
320
322
|
log.debug(`${LOG_PREFIX_MDX_LOADER} [fetchAndCacheModule] cacheModule DONE`, {
|
|
321
323
|
projectSlug,
|
|
322
324
|
normalizedPath,
|
|
@@ -18,5 +18,5 @@ export declare function normalizePath(modulePath: string, parentModulePath?: str
|
|
|
18
18
|
* dependency resolution). Otherwise writes to the local filesystem cache
|
|
19
19
|
* and updates the path cache map.
|
|
20
20
|
*/
|
|
21
|
-
export declare function cacheModule(normalizedPath: string, moduleCode: string, esmCacheDir: string, pathCache: Map<string, string>, log: Logger): Promise<string | null>;
|
|
21
|
+
export declare function cacheModule(normalizedPath: string, moduleCode: string, esmCacheDir: string, pathCache: Map<string, string>, log: Logger, reactVersion?: string): Promise<string | null>;
|
|
22
22
|
//# sourceMappingURL=module-cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-cache.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"module-cache.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AASjE;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAanF;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,GAAG,EAAE,MAAM,EACX,YAAY,SAAwB,GACnC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmCxB"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { join } from "../../../../platform/compat/path/index.js";
|
|
10
10
|
import * as posix from "../../../../../deps/jsr.io/@std/path/1.1.4/posix/mod.js";
|
|
11
|
+
import { REACT_DEFAULT_VERSION } from "../../../../utils/constants/cdn.js";
|
|
11
12
|
import { LOG_PREFIX_MDX_LOADER } from "../constants.js";
|
|
12
13
|
import { getLocalFs, saveModulePathCache } from "../cache/index.js";
|
|
13
14
|
import { hashString } from "../utils/hash.js";
|
|
@@ -38,7 +39,7 @@ export function normalizePath(modulePath, parentModulePath) {
|
|
|
38
39
|
* dependency resolution). Otherwise writes to the local filesystem cache
|
|
39
40
|
* and updates the path cache map.
|
|
40
41
|
*/
|
|
41
|
-
export async function cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log) {
|
|
42
|
+
export async function cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log, reactVersion = REACT_DEFAULT_VERSION) {
|
|
42
43
|
const unresolved = hasUnresolvedImports(moduleCode);
|
|
43
44
|
if (unresolved.count > 0) {
|
|
44
45
|
log.warn(`${LOG_PREFIX_MDX_LOADER} Module has ${unresolved.count} unresolved imports, skipping cache`, { path: normalizedPath, unresolved: unresolved.paths });
|
|
@@ -46,7 +47,7 @@ export async function cacheModule(normalizedPath, moduleCode, esmCacheDir, pathC
|
|
|
46
47
|
}
|
|
47
48
|
const contentHash = hashString(normalizedPath + moduleCode);
|
|
48
49
|
const cachePath = join(esmCacheDir, buildMdxEsmModuleFileName(contentHash));
|
|
49
|
-
const pathCacheKey = buildMdxEsmPathCacheKey(normalizedPath);
|
|
50
|
+
const pathCacheKey = buildMdxEsmPathCacheKey(normalizedPath, reactVersion);
|
|
50
51
|
const localFs = getLocalFs();
|
|
51
52
|
try {
|
|
52
53
|
const stat = await localFs.stat(cachePath);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.113";
|
|
2
2
|
export declare function normalizeVeryfrontVersion(version: string | undefined): string | undefined;
|
|
3
3
|
export declare function resolveRuntimeVersion(options?: {
|
|
4
4
|
veryfrontVersion?: string;
|
package/esm/src/utils/version.js
CHANGED
|
@@ -2,7 +2,7 @@ import denoConfig from "../../deno.js";
|
|
|
2
2
|
import { getEnv } from "../platform/compat/process.js";
|
|
3
3
|
// Keep in sync with deno.json version.
|
|
4
4
|
// scripts/release.ts updates this constant during releases.
|
|
5
|
-
export const VERSION = "0.1.
|
|
5
|
+
export const VERSION = "0.1.113";
|
|
6
6
|
export function normalizeVeryfrontVersion(version) {
|
|
7
7
|
if (!version)
|
|
8
8
|
return undefined;
|
package/package.json
CHANGED
package/src/cli/auth/login.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { canOpenBrowser, openBrowser } from "./browser.js";
|
|
|
8
8
|
import { isTTY, promptUser } from "../utils/index.js";
|
|
9
9
|
import { brand, dim, error, muted, success, warning } from "../ui/colors.js";
|
|
10
10
|
import { DEFAULT_LOGIN_TIMEOUT_MS, getApiUrl } from "../shared/constants.js";
|
|
11
|
+
import { createSuccessEnvelope, isJsonMode, outputJson } from "../shared/json-output.js";
|
|
11
12
|
|
|
12
13
|
export type AuthMethod = "google" | "github" | "microsoft" | "token";
|
|
13
14
|
|
|
@@ -251,6 +252,10 @@ export async function whoami(
|
|
|
251
252
|
if (env.apiToken) {
|
|
252
253
|
const userInfo = await validateToken(env.apiToken);
|
|
253
254
|
if (userInfo) {
|
|
255
|
+
if (isJsonMode()) {
|
|
256
|
+
await outputJson(createSuccessEnvelope("whoami", { ...userInfo, source: "env" }));
|
|
257
|
+
return userInfo;
|
|
258
|
+
}
|
|
254
259
|
console.log();
|
|
255
260
|
console.log(" " + success("✓") + " Logged in as " + brand(userInfo.email));
|
|
256
261
|
console.log(" " + dim("(via VERYFRONT_API_TOKEN)"));
|
|
@@ -262,6 +267,10 @@ export async function whoami(
|
|
|
262
267
|
if (storedToken) {
|
|
263
268
|
const userInfo = await validateToken(storedToken);
|
|
264
269
|
if (userInfo) {
|
|
270
|
+
if (isJsonMode()) {
|
|
271
|
+
await outputJson(createSuccessEnvelope("whoami", { ...userInfo, source: "token-store" }));
|
|
272
|
+
return userInfo;
|
|
273
|
+
}
|
|
265
274
|
console.log();
|
|
266
275
|
console.log(" " + success("✓") + " Logged in as " + brand(userInfo.email));
|
|
267
276
|
console.log(" " + dim(`Token stored at: ${getTokenLocation()}`));
|
|
@@ -269,6 +278,11 @@ export async function whoami(
|
|
|
269
278
|
}
|
|
270
279
|
}
|
|
271
280
|
|
|
281
|
+
if (isJsonMode()) {
|
|
282
|
+
await outputJson(createSuccessEnvelope("whoami", { authenticated: false }));
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
|
|
272
286
|
console.log();
|
|
273
287
|
console.log(" " + warning("✗") + " Not logged in");
|
|
274
288
|
console.log(" " + dim("Run 'veryfront login' to authenticate"));
|
|
@@ -2,6 +2,7 @@ import type { CommandHelp } from "../../help/types.js";
|
|
|
2
2
|
|
|
3
3
|
export const analyzeChunksHelp: CommandHelp = {
|
|
4
4
|
name: "analyze-chunks",
|
|
5
|
+
category: "development",
|
|
5
6
|
description: "Analyze bundle chunks and sizes",
|
|
6
7
|
usage: "veryfront analyze-chunks [options]",
|
|
7
8
|
options: [
|
|
@@ -7,6 +7,7 @@ import { displayBuildConfig, displayBuildStart } from "./config-display.js";
|
|
|
7
7
|
import { handleBuildError } from "./error-handler.js";
|
|
8
8
|
import { displayBuildSuccess } from "./stats-display.js";
|
|
9
9
|
import type { BuildOptions } from "./types.js";
|
|
10
|
+
import { isJsonMode, streamJsonLine } from "../../shared/json-output.js";
|
|
10
11
|
|
|
11
12
|
export function buildCommand(options: BuildOptions): Promise<void> {
|
|
12
13
|
return withSpan(
|
|
@@ -17,12 +18,21 @@ export function buildCommand(options: BuildOptions): Promise<void> {
|
|
|
17
18
|
const dryRun = options.dryRun ?? false;
|
|
18
19
|
|
|
19
20
|
try {
|
|
20
|
-
|
|
21
|
+
if (isJsonMode()) {
|
|
22
|
+
streamJsonLine({ type: "step", name: "config", status: "started" });
|
|
23
|
+
} else {
|
|
24
|
+
displayBuildConfig({ ...options, outputDir });
|
|
25
|
+
}
|
|
21
26
|
|
|
22
27
|
const adapter = await runtime.get();
|
|
23
28
|
await getConfig(options.projectDir, adapter);
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
if (isJsonMode()) {
|
|
31
|
+
streamJsonLine({ type: "step", name: "config", status: "completed" });
|
|
32
|
+
streamJsonLine({ type: "step", name: "build", status: "started" });
|
|
33
|
+
} else {
|
|
34
|
+
displayBuildStart();
|
|
35
|
+
}
|
|
26
36
|
|
|
27
37
|
const stats = await buildProduction({
|
|
28
38
|
projectDir: options.projectDir,
|
|
@@ -36,8 +46,43 @@ export function buildCommand(options: BuildOptions): Promise<void> {
|
|
|
36
46
|
dryRun,
|
|
37
47
|
});
|
|
38
48
|
|
|
49
|
+
const elapsed = Date.now() - startTime;
|
|
50
|
+
|
|
51
|
+
if (isJsonMode()) {
|
|
52
|
+
streamJsonLine({
|
|
53
|
+
type: "step",
|
|
54
|
+
name: "build",
|
|
55
|
+
status: "completed",
|
|
56
|
+
duration_ms: elapsed,
|
|
57
|
+
});
|
|
58
|
+
streamJsonLine({
|
|
59
|
+
type: "result",
|
|
60
|
+
success: true,
|
|
61
|
+
data: {
|
|
62
|
+
pages: stats.pages,
|
|
63
|
+
chunks: stats.chunks,
|
|
64
|
+
assets: stats.assets,
|
|
65
|
+
totalSize: stats.totalSize,
|
|
66
|
+
duration_ms: elapsed,
|
|
67
|
+
outputDir,
|
|
68
|
+
dryRun,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
39
74
|
displayBuildSuccess(stats, startTime, outputDir, dryRun);
|
|
40
75
|
} catch (error) {
|
|
76
|
+
if (isJsonMode()) {
|
|
77
|
+
streamJsonLine({
|
|
78
|
+
type: "result",
|
|
79
|
+
success: false,
|
|
80
|
+
error: error instanceof Error ? error.message : String(error),
|
|
81
|
+
});
|
|
82
|
+
const { exit } = await import("../../../src/platform/index.js");
|
|
83
|
+
exit(1);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
41
86
|
handleBuildError(error);
|
|
42
87
|
}
|
|
43
88
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandHelp } from "../../help/types.js";
|
|
2
|
+
|
|
3
|
+
export const completionsHelp: CommandHelp = {
|
|
4
|
+
name: "completions",
|
|
5
|
+
category: "development",
|
|
6
|
+
description: "Generate shell completion scripts",
|
|
7
|
+
usage: "veryfront completions <shell>",
|
|
8
|
+
options: [],
|
|
9
|
+
examples: [
|
|
10
|
+
"veryfront completions bash",
|
|
11
|
+
"veryfront completions zsh",
|
|
12
|
+
"veryfront completions fish",
|
|
13
|
+
'eval "$(veryfront completions bash)"',
|
|
14
|
+
],
|
|
15
|
+
};
|