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
|
@@ -36,50 +36,28 @@ function extractVfModulePaths(code: string): string[] {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* Visit VF module code blocks imported by the given module, including nested VF modules.
|
|
40
|
+
* The visitor receives both the module code and the absolute vfmod file path.
|
|
41
41
|
*/
|
|
42
|
-
export async function
|
|
42
|
+
export async function visitImportedVfModules(
|
|
43
43
|
code: string,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const seenHashes = new Set<string>();
|
|
44
|
+
visitor: (vfModuleCode: string, vfModulePath?: string) => void | Promise<void>,
|
|
45
|
+
): Promise<void> {
|
|
47
46
|
const seenVfModules = new Set<string>();
|
|
48
|
-
const fs = createFileSystem();
|
|
49
|
-
|
|
50
|
-
// Helper to add bundles without duplicates
|
|
51
|
-
const addBundles = (bundles: Array<{ path: string; hash: string }>) => {
|
|
52
|
-
for (const bundle of bundles) {
|
|
53
|
-
if (!seenHashes.has(bundle.hash)) {
|
|
54
|
-
seenHashes.add(bundle.hash);
|
|
55
|
-
allBundles.push(bundle);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// Process initial code
|
|
61
|
-
const directBundles = extractHttpBundlePaths(code);
|
|
62
|
-
addBundles(directBundles);
|
|
63
|
-
|
|
64
|
-
// Process VF module imports recursively
|
|
65
47
|
const pendingVfModules = extractVfModulePaths(code);
|
|
48
|
+
const fs = createFileSystem();
|
|
66
49
|
|
|
67
50
|
while (pendingVfModules.length > 0) {
|
|
68
51
|
const vfModulePath = pendingVfModules.pop()!;
|
|
69
52
|
if (seenVfModules.has(vfModulePath)) continue;
|
|
70
53
|
seenVfModules.add(vfModulePath);
|
|
71
54
|
|
|
72
|
-
// Check if the VF module exists locally
|
|
73
55
|
if (!(await exists(vfModulePath))) continue;
|
|
74
56
|
|
|
75
57
|
try {
|
|
76
58
|
const vfModuleCode = await fs.readTextFile(vfModulePath);
|
|
59
|
+
await visitor(vfModuleCode, vfModulePath);
|
|
77
60
|
|
|
78
|
-
// Extract HTTP bundles from this VF module
|
|
79
|
-
const vfBundles = extractHttpBundlePaths(vfModuleCode);
|
|
80
|
-
addBundles(vfBundles);
|
|
81
|
-
|
|
82
|
-
// Extract more VF modules for recursive processing
|
|
83
61
|
const nestedVfModules = extractVfModulePaths(vfModuleCode);
|
|
84
62
|
for (const nestedPath of nestedVfModules) {
|
|
85
63
|
if (!seenVfModules.has(nestedPath)) {
|
|
@@ -90,6 +68,37 @@ export async function extractAllHttpBundlePathsRecursive(
|
|
|
90
68
|
/* expected: VF module file may fail to read */
|
|
91
69
|
}
|
|
92
70
|
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Recursively extract all HTTP bundle paths from code and any VF modules it imports.
|
|
75
|
+
* This ensures transitive HTTP bundle dependencies through VF modules are discovered.
|
|
76
|
+
*/
|
|
77
|
+
export async function extractAllHttpBundlePathsRecursive(
|
|
78
|
+
code: string,
|
|
79
|
+
): Promise<Array<{ path: string; hash: string }>> {
|
|
80
|
+
const allBundles: Array<{ path: string; hash: string }> = [];
|
|
81
|
+
const seenHashes = new Set<string>();
|
|
82
|
+
|
|
83
|
+
// Helper to add bundles without duplicates
|
|
84
|
+
const addBundles = (bundles: Array<{ path: string; hash: string }>) => {
|
|
85
|
+
for (const bundle of bundles) {
|
|
86
|
+
if (!seenHashes.has(bundle.hash)) {
|
|
87
|
+
seenHashes.add(bundle.hash);
|
|
88
|
+
allBundles.push(bundle);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// Process initial code
|
|
94
|
+
const directBundles = extractHttpBundlePaths(code);
|
|
95
|
+
addBundles(directBundles);
|
|
96
|
+
|
|
97
|
+
await visitImportedVfModules(code, (vfModuleCode) => {
|
|
98
|
+
// Extract HTTP bundles from this VF module
|
|
99
|
+
const vfBundles = extractHttpBundlePaths(vfModuleCode);
|
|
100
|
+
addBundles(vfBundles);
|
|
101
|
+
});
|
|
93
102
|
|
|
94
103
|
return allBundles;
|
|
95
104
|
}
|
|
@@ -134,14 +143,14 @@ export function extractHttpBundlePaths(code: string): Array<{ path: string; hash
|
|
|
134
143
|
*/
|
|
135
144
|
export function extractAllFilePaths(code: string): string[] {
|
|
136
145
|
// Create regex per call to avoid shared lastIndex state across concurrent calls.
|
|
137
|
-
const allFilePathsPattern = /file:\/\/([^"'\s]+\.(?:mjs|js))/gi;
|
|
146
|
+
const allFilePathsPattern = /file:\/\/([^"'\s]+\.(?:mjs|js|tsx|ts|jsx)(?:\?[^"'\s]*)?)/gi;
|
|
138
147
|
|
|
139
148
|
const paths: string[] = [];
|
|
140
149
|
const seen = new Set<string>();
|
|
141
150
|
|
|
142
151
|
let match: RegExpExecArray | null;
|
|
143
152
|
while ((match = allFilePathsPattern.exec(code)) !== null) {
|
|
144
|
-
const path = match[1];
|
|
153
|
+
const path = match[1]?.replace(/\?.*$/, "");
|
|
145
154
|
|
|
146
155
|
if (!path || seen.has(path)) continue;
|
|
147
156
|
|
|
@@ -152,6 +161,31 @@ export function extractAllFilePaths(code: string): string[] {
|
|
|
152
161
|
return paths;
|
|
153
162
|
}
|
|
154
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Extract all file:// paths from cached code and any transitively imported VF modules.
|
|
166
|
+
* This catches stale pod-local paths that only appear in nested vfmod dependencies.
|
|
167
|
+
*/
|
|
168
|
+
export async function extractAllFilePathsRecursive(code: string): Promise<string[]> {
|
|
169
|
+
const paths: string[] = [];
|
|
170
|
+
const seen = new Set<string>();
|
|
171
|
+
|
|
172
|
+
const addPaths = (entries: string[]) => {
|
|
173
|
+
for (const path of entries) {
|
|
174
|
+
if (seen.has(path)) continue;
|
|
175
|
+
seen.add(path);
|
|
176
|
+
paths.push(path);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
addPaths(extractAllFilePaths(code));
|
|
181
|
+
|
|
182
|
+
await visitImportedVfModules(code, (vfModuleCode) => {
|
|
183
|
+
addPaths(extractAllFilePaths(vfModuleCode));
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
return paths;
|
|
187
|
+
}
|
|
188
|
+
|
|
155
189
|
/**
|
|
156
190
|
* Track modules whose HTTP bundles have been verified, keyed by tempPath:contentHash.
|
|
157
191
|
* Bounded LRU to prevent unbounded memory growth in long-running pods.
|
|
@@ -20,8 +20,8 @@ import { ensureHttpBundlesExist } from "../../../transforms/esm/http-cache.js";
|
|
|
20
20
|
import { getHttpBundleCacheDir, getMdxEsmCacheDir } from "../../../utils/cache-dir.js";
|
|
21
21
|
import { globalModuleCache, globalTmpDirs } from "./cache/index.js";
|
|
22
22
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
extractAllFilePathsRecursive,
|
|
24
|
+
extractAllHttpBundlePathsRecursive,
|
|
25
25
|
verifiedHttpBundlePaths,
|
|
26
26
|
} from "./http-bundle-helpers.js";
|
|
27
27
|
import { buildTempModulePath, buildTmpDirPath, getTmpDirCacheKey } from "./tmp-paths.js";
|
|
@@ -219,7 +219,7 @@ export class SSRCacheManager {
|
|
|
219
219
|
filePath: string,
|
|
220
220
|
source: "memory-cache" | "redis-cache",
|
|
221
221
|
): Promise<boolean> {
|
|
222
|
-
const bundlePaths =
|
|
222
|
+
const bundlePaths = await extractAllHttpBundlePathsRecursive(code);
|
|
223
223
|
if (bundlePaths.length === 0) return false;
|
|
224
224
|
|
|
225
225
|
const cacheDir = getHttpBundleCacheDir();
|
|
@@ -237,7 +237,7 @@ export class SSRCacheManager {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
private async hasMissingLocalPaths(code: string, filePath: string): Promise<boolean> {
|
|
240
|
-
const allPaths =
|
|
240
|
+
const allPaths = await extractAllFilePathsRecursive(code);
|
|
241
241
|
let hasMissingPath = false;
|
|
242
242
|
|
|
243
243
|
for (const path of allPaths) {
|
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
PageBundle,
|
|
20
20
|
} from "../../types/index.js";
|
|
21
21
|
import { DEFAULT_DASHBOARD_PORT, rendererLogger } from "../../utils/index.js";
|
|
22
|
+
import { escapeHtml } from "../../utils/html-escape.js";
|
|
22
23
|
import type { RenderOptions } from "./types.js";
|
|
23
24
|
import { injectElementSelectors } from "../../studio/element-selector-injector.js";
|
|
24
25
|
import { computeSourceHash } from "../../studio/hash-utils.js";
|
|
@@ -36,6 +37,108 @@ import type { ResolvedContentContext } from "../../platform/adapters/fs/veryfron
|
|
|
36
37
|
|
|
37
38
|
const logger = rendererLogger.component("html-generator");
|
|
38
39
|
|
|
40
|
+
function findTagEnd(html: string, start: number): number {
|
|
41
|
+
let activeQuote: '"' | "'" | null = null;
|
|
42
|
+
|
|
43
|
+
for (let index = start + 1; index < html.length; index++) {
|
|
44
|
+
const char = html[index];
|
|
45
|
+
|
|
46
|
+
if (activeQuote) {
|
|
47
|
+
if (char === activeQuote) activeQuote = null;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (char === '"' || char === "'") {
|
|
52
|
+
activeQuote = char;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (char === ">") return index;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return -1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getOpeningTagName(tag: string): "script" | "style" | undefined {
|
|
63
|
+
const match = /^<\s*([a-zA-Z][\w:-]*)/u.exec(tag);
|
|
64
|
+
const tagName = match?.[1]?.toLowerCase();
|
|
65
|
+
if (tagName === "script" || tagName === "style") return tagName;
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function injectNonceIntoOpeningTag(tag: string, escapedNonce: string): string {
|
|
70
|
+
if (/\bnonce\s*=/iu.test(tag)) return tag;
|
|
71
|
+
|
|
72
|
+
const closeIndex = tag.lastIndexOf(">");
|
|
73
|
+
if (closeIndex === -1) return tag;
|
|
74
|
+
|
|
75
|
+
const insertAt = /\/\s*>$/u.test(tag) ? closeIndex - 1 : closeIndex;
|
|
76
|
+
return `${tag.slice(0, insertAt)} nonce="${escapedNonce}"${tag.slice(insertAt)}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function addNonceToRenderedTags(html: string, nonce?: string): string {
|
|
80
|
+
if (!nonce) return html;
|
|
81
|
+
|
|
82
|
+
const escapedNonce = escapeHtml(nonce);
|
|
83
|
+
const lowerHtml = html.toLowerCase();
|
|
84
|
+
let result = "";
|
|
85
|
+
let index = 0;
|
|
86
|
+
let rawTextTag: "script" | "style" | null = null;
|
|
87
|
+
|
|
88
|
+
while (index < html.length) {
|
|
89
|
+
if (rawTextTag) {
|
|
90
|
+
const closingIndex = lowerHtml.indexOf(`</${rawTextTag}`, index);
|
|
91
|
+
if (closingIndex === -1) {
|
|
92
|
+
result += html.slice(index);
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
result += html.slice(index, closingIndex);
|
|
97
|
+
index = closingIndex;
|
|
98
|
+
rawTextTag = null;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (html.startsWith("<!--", index)) {
|
|
103
|
+
const commentEnd = html.indexOf("-->", index + 4);
|
|
104
|
+
const endIndex = commentEnd === -1 ? html.length : commentEnd + 3;
|
|
105
|
+
result += html.slice(index, endIndex);
|
|
106
|
+
index = endIndex;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (html[index] !== "<") {
|
|
111
|
+
result += html[index];
|
|
112
|
+
index++;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const tagEnd = findTagEnd(html, index);
|
|
117
|
+
if (tagEnd === -1) {
|
|
118
|
+
result += html.slice(index);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const tag = html.slice(index, tagEnd + 1);
|
|
123
|
+
const tagName = getOpeningTagName(tag);
|
|
124
|
+
|
|
125
|
+
if (!tagName) {
|
|
126
|
+
result += tag;
|
|
127
|
+
index = tagEnd + 1;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
result += injectNonceIntoOpeningTag(tag, escapedNonce);
|
|
132
|
+
index = tagEnd + 1;
|
|
133
|
+
|
|
134
|
+
if (!/\/\s*>$/u.test(tag)) {
|
|
135
|
+
rawTextTag = tagName;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
|
|
39
142
|
export interface HTMLGeneratorConfig {
|
|
40
143
|
projectDir: string;
|
|
41
144
|
adapter: RuntimeAdapter;
|
|
@@ -69,11 +172,13 @@ export class HTMLGenerator {
|
|
|
69
172
|
const html = isFullHTMLDocument(context.html)
|
|
70
173
|
? await this.handleFullHTMLDocument(context)
|
|
71
174
|
: await this.wrapHTMLFragment(context);
|
|
175
|
+
const finalHtml = context.options?.studioEmbed ? injectElementSelectors(html) : html;
|
|
72
176
|
|
|
73
|
-
if (
|
|
177
|
+
if (context.options?.studioEmbed) {
|
|
178
|
+
logger.debug("Injected element selectors for Studio");
|
|
179
|
+
}
|
|
74
180
|
|
|
75
|
-
|
|
76
|
-
return injectElementSelectors(html);
|
|
181
|
+
return addNonceToRenderedTags(finalHtml, context.options?.nonce);
|
|
77
182
|
}
|
|
78
183
|
|
|
79
184
|
async generateHTMLStream(
|
|
@@ -104,7 +209,10 @@ export class HTMLGenerator {
|
|
|
104
209
|
);
|
|
105
210
|
|
|
106
211
|
const encoder = new TextEncoder();
|
|
107
|
-
const fullHtml =
|
|
212
|
+
const fullHtml = addNonceToRenderedTags(
|
|
213
|
+
`${start}${reactContent}${end}`,
|
|
214
|
+
context.options?.nonce,
|
|
215
|
+
);
|
|
108
216
|
|
|
109
217
|
return new ReadableStream({
|
|
110
218
|
start(controller) {
|
|
@@ -135,6 +243,7 @@ export class HTMLGenerator {
|
|
|
135
243
|
devPort: this.config.config?.dev?.port || DEFAULT_DASHBOARD_PORT,
|
|
136
244
|
pagePath,
|
|
137
245
|
isClientPage,
|
|
246
|
+
nonce: context.options?.nonce,
|
|
138
247
|
importMapJson,
|
|
139
248
|
});
|
|
140
249
|
|
|
@@ -234,6 +234,7 @@ export async function transformModuleWithDeps(
|
|
|
234
234
|
contentSourceId,
|
|
235
235
|
}
|
|
236
236
|
: undefined,
|
|
237
|
+
config.reactVersion,
|
|
237
238
|
);
|
|
238
239
|
if (mdxCacheResult.status === "hit") {
|
|
239
240
|
moduleCache.set(cacheKey, mdxCacheResult.path);
|
|
@@ -466,7 +467,7 @@ export async function transformModuleWithDeps(
|
|
|
466
467
|
|
|
467
468
|
if (contentSourceId) {
|
|
468
469
|
const normalizedPath = `_vf_modules/${relativePath.replace(/\.(tsx?|jsx|mdx)$/, ".js")}`;
|
|
469
|
-
const mdxCacheKey = buildMdxEsmPathCacheKey(normalizedPath);
|
|
470
|
+
const mdxCacheKey = buildMdxEsmPathCacheKey(normalizedPath, config.reactVersion);
|
|
470
471
|
const cache = await getModulePathCache(tmpDir);
|
|
471
472
|
cache.set(mdxCacheKey, tempFilePath);
|
|
472
473
|
|
|
@@ -329,7 +329,7 @@ export function renderSnippet(
|
|
|
329
329
|
function generateErrorHTML(error: unknown, options: SnippetRenderOptions): string {
|
|
330
330
|
const message = error instanceof Error ? error.message : String(error);
|
|
331
331
|
const stack = error instanceof Error ? error.stack : undefined;
|
|
332
|
-
const nonce = options.nonce ? ` nonce="${options.nonce}"` : "";
|
|
332
|
+
const nonce = options.nonce ? ` nonce="${escapeHtml(options.nonce)}"` : "";
|
|
333
333
|
const stackHtml = options.mode === "development" && stack
|
|
334
334
|
? `<div class="error-stack">${escapeHtml(stack)}</div>`
|
|
335
335
|
: "";
|
|
@@ -21,8 +21,8 @@ export function generateNonce(): string {
|
|
|
21
21
|
* - Scripts: nonce-based + cdn.jsdelivr.net (Scalar API docs, html2canvas,
|
|
22
22
|
* React UMD, browser inference)
|
|
23
23
|
* - Styles: 'self' + 'unsafe-inline' + nonce + Google Fonts + cdn.veryfront.com
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* plus style-src-attr 'unsafe-inline' so React style="" attributes remain
|
|
25
|
+
* compatible while inline <style> tags continue to use the nonce
|
|
26
26
|
* - Images/media/fonts: 'self' + data: + https: + cdn.veryfront.com
|
|
27
27
|
* - Connections: 'self' + wss: + https: (WebSocket for HMR/live reload, API calls)
|
|
28
28
|
* - Objects: 'none' (block Flash/plugins)
|
|
@@ -36,6 +36,7 @@ function buildDefaultCSP(nonce: string): string {
|
|
|
36
36
|
`default-src 'self'`,
|
|
37
37
|
`script-src 'self' 'nonce-${nonce}' https://cdn.jsdelivr.net`,
|
|
38
38
|
`style-src 'self' 'unsafe-inline' 'nonce-${nonce}' https://fonts.googleapis.com https://cdn.veryfront.com`,
|
|
39
|
+
`style-src-attr 'unsafe-inline'`,
|
|
39
40
|
`img-src 'self' data: https:`,
|
|
40
41
|
`font-src 'self' data: https://fonts.gstatic.com https://cdn.veryfront.com`,
|
|
41
42
|
`connect-src 'self' wss: https:`,
|
|
@@ -212,6 +212,7 @@ export function generateErrorHTML(
|
|
|
212
212
|
errorInfo: ErrorInfo,
|
|
213
213
|
suggestion?: string,
|
|
214
214
|
projectSlug?: string,
|
|
215
|
+
nonce?: string,
|
|
215
216
|
): string {
|
|
216
217
|
const errorType = escapeHtml(formatErrorType(errorInfo.type));
|
|
217
218
|
const errorName = escapeHtml(errorInfo.error.name);
|
|
@@ -221,6 +222,7 @@ export function generateErrorHTML(
|
|
|
221
222
|
const errorColumn = errorInfo.column ? escapeHtml(String(errorInfo.column)) : "";
|
|
222
223
|
const errorSuggestion = suggestion ? escapeHtml(suggestion) : "";
|
|
223
224
|
const errorStack = errorInfo.error.stack ? escapeHtml(errorInfo.error.stack) : "";
|
|
225
|
+
const nonceAttr = nonce ? ` nonce="${escapeHtml(nonce)}"` : "";
|
|
224
226
|
|
|
225
227
|
const fileSection = errorFile
|
|
226
228
|
? `
|
|
@@ -258,7 +260,7 @@ export function generateErrorHTML(
|
|
|
258
260
|
<head>
|
|
259
261
|
<meta charset="UTF-8">
|
|
260
262
|
<title>${errorType} Error - Veryfront</title>
|
|
261
|
-
<style>
|
|
263
|
+
<style${nonceAttr}>
|
|
262
264
|
body {
|
|
263
265
|
margin: 0;
|
|
264
266
|
padding: 20px;
|
|
@@ -365,7 +367,7 @@ export function generateErrorHTML(
|
|
|
365
367
|
</div>
|
|
366
368
|
${fixButtonHtml}
|
|
367
369
|
</div>
|
|
368
|
-
<script>${
|
|
370
|
+
<script${nonceAttr}>${
|
|
369
371
|
projectSlug
|
|
370
372
|
? `
|
|
371
373
|
(function() {
|
|
@@ -4,11 +4,12 @@ import { generateErrorHTML, generateRuntimeScript } from "./html-template.js";
|
|
|
4
4
|
export const ErrorOverlay = {
|
|
5
5
|
getRuntime: generateRuntimeScript,
|
|
6
6
|
getSuggestion,
|
|
7
|
-
createHTML(errorInfo: ErrorInfo, projectSlug?: string): string {
|
|
7
|
+
createHTML(errorInfo: ErrorInfo, projectSlug?: string, nonce?: string): string {
|
|
8
8
|
return generateErrorHTML(
|
|
9
9
|
errorInfo,
|
|
10
10
|
errorInfo.suggestion ?? getSuggestion(errorInfo.error),
|
|
11
11
|
projectSlug,
|
|
12
|
+
nonce,
|
|
12
13
|
);
|
|
13
14
|
},
|
|
14
15
|
};
|
|
@@ -205,7 +205,7 @@ export class SSRService implements SSRServiceLike {
|
|
|
205
205
|
};
|
|
206
206
|
} catch (error) {
|
|
207
207
|
endRenderSession(renderSessionId);
|
|
208
|
-
return this.handleRenderError(error, ctx, slug, request);
|
|
208
|
+
return this.handleRenderError(error, ctx, slug, request, nonce);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -214,6 +214,7 @@ export class SSRService implements SSRServiceLike {
|
|
|
214
214
|
ctx: HandlerContext,
|
|
215
215
|
slug: string,
|
|
216
216
|
request: dntShim.Request,
|
|
217
|
+
nonce?: string,
|
|
217
218
|
): SSRRenderResult {
|
|
218
219
|
const errorObj = error instanceof Error ? error : new Error(String(error));
|
|
219
220
|
const isDev = ctx.isLocalProject || ctx.requestContext?.mode === "preview";
|
|
@@ -275,12 +276,16 @@ export class SSRService implements SSRServiceLike {
|
|
|
275
276
|
const location = sourceFile ? parseErrorLocation(errorObj, sourceFile) : {};
|
|
276
277
|
return {
|
|
277
278
|
status: HTTP_INTERNAL_SERVER_ERROR,
|
|
278
|
-
html: ErrorOverlay.createHTML(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
279
|
+
html: ErrorOverlay.createHTML(
|
|
280
|
+
{
|
|
281
|
+
error: errorObj,
|
|
282
|
+
type: "runtime",
|
|
283
|
+
...(sourceFile ? { file: sourceFile } : {}),
|
|
284
|
+
...location,
|
|
285
|
+
},
|
|
286
|
+
ctx.projectSlug,
|
|
287
|
+
nonce,
|
|
288
|
+
),
|
|
284
289
|
isStreaming: false,
|
|
285
290
|
cacheStrategy: "no-cache",
|
|
286
291
|
error: errorObj,
|