veryfront 0.0.97 → 0.0.99

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.
Files changed (41) hide show
  1. package/esm/_dnt.shims.d.ts +14 -14
  2. package/esm/_dnt.shims.d.ts.map +1 -1
  3. package/esm/deno.js +1 -1
  4. package/esm/src/cli/mcp/advanced-tools.d.ts +2 -2
  5. package/esm/src/cli/templates/manifest.d.ts +448 -448
  6. package/esm/src/cli/templates/manifest.js +480 -480
  7. package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
  8. package/esm/src/modules/server/ssr-import-rewriter.js +11 -2
  9. package/esm/src/platform/compat/path-helper.d.ts +7 -7
  10. package/esm/src/platform/compat/path-helper.d.ts.map +1 -1
  11. package/esm/src/react/components/ai/agent-card.d.ts +1 -1
  12. package/esm/src/react/components/ai/agent-card.d.ts.map +1 -1
  13. package/esm/src/react/components/ai/chat/composition/api.d.ts +5 -4
  14. package/esm/src/react/components/ai/chat/composition/api.d.ts.map +1 -1
  15. package/esm/src/react/components/ai/chat/index.d.ts +7 -2
  16. package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
  17. package/esm/src/react/components/ai/message.d.ts +2 -2
  18. package/esm/src/react/components/ai/message.d.ts.map +1 -1
  19. package/esm/src/react/primitives/agent-primitives.d.ts +3 -3
  20. package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
  21. package/esm/src/react/primitives/chat-container.d.ts +1 -1
  22. package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
  23. package/esm/src/react/primitives/input-box.d.ts +3 -3
  24. package/esm/src/react/primitives/input-box.d.ts.map +1 -1
  25. package/esm/src/react/primitives/message-list.d.ts +4 -4
  26. package/esm/src/react/primitives/message-list.d.ts.map +1 -1
  27. package/esm/src/react/primitives/tool-primitives.d.ts +3 -3
  28. package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
  29. package/esm/src/rendering/ssr-globals/context.d.ts +6 -1
  30. package/esm/src/rendering/ssr-globals/context.d.ts.map +1 -1
  31. package/esm/src/transforms/esm/package-registry.d.ts +2 -1
  32. package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
  33. package/esm/src/transforms/esm/package-registry.js +2 -1
  34. package/esm/src/transforms/esm/react-imports.d.ts.map +1 -1
  35. package/esm/src/transforms/esm/react-imports.js +8 -2
  36. package/package.json +1 -1
  37. package/src/deno.js +1 -1
  38. package/src/src/cli/templates/manifest.js +480 -480
  39. package/src/src/modules/server/ssr-import-rewriter.ts +11 -2
  40. package/src/src/transforms/esm/package-registry.ts +2 -1
  41. package/src/src/transforms/esm/react-imports.ts +9 -2
@@ -1,5 +1,6 @@
1
1
  import { getReactImportMap, getReactVersion } from "../../transforms/esm/package-registry.js";
2
2
  import { isDeno } from "../../platform/compat/runtime.js";
3
+ import { getLocalReactPaths } from "../../platform/compat/react-paths.js";
3
4
 
4
5
  export interface SSRRewriteOptions {
5
6
  /** Project slug for multi-project routing */
@@ -41,8 +42,16 @@ function shouldKeepBareSpecifier(specifier: string): boolean {
41
42
  }
42
43
 
43
44
  function resolveReactForRuntime(specifier: string, version?: string): string | null {
44
- // Always rewrite React imports to esm.sh URLs for SSR modules.
45
- // NO npm: specifiers - use esm.sh URLs only for consistent React instance.
45
+ // On Node.js/Bun, use local React paths from veryfront's node_modules.
46
+ // On Deno, use esm.sh URLs (Deno supports HTTP imports natively).
47
+ if (!isDeno) {
48
+ const localPaths = getLocalReactPaths();
49
+ const localPath = localPaths[specifier];
50
+ if (localPath) return localPath;
51
+ // If not found in local paths, fall through to esm.sh for subpath imports
52
+ }
53
+
54
+ // For Deno or subpath imports not in local paths, use esm.sh URLs
46
55
  const v = version ?? getReactVersion();
47
56
  const reactMap = getReactImportMap(v);
48
57
 
@@ -60,8 +60,9 @@ export const REACT_VERSION = DEFAULT_REACT_VERSION;
60
60
  * v11: Add HTTP bundle hash→URL mapping for cross-pod recovery
61
61
  * v12: Store HTTP bundle code by hash for direct recovery (code:{hash})
62
62
  * v13: Fix npm: specifiers for Node.js (convert to esm.sh or local React)
63
+ * v14: Fix SSR pipeline to use local React paths on Node.js (not esm.sh URLs)
63
64
  */
64
- export const TRANSFORM_CACHE_VERSION = 13;
65
+ export const TRANSFORM_CACHE_VERSION = 14;
65
66
 
66
67
  /** csstype version - must match deno.json for type consistency */
67
68
  export const CSSTYPE_VERSION = "3.2.3";
@@ -1,5 +1,7 @@
1
1
  import { replaceSpecifiers } from "./lexer.js";
2
2
  import { getReactImportMap, REACT_VERSION } from "./package-registry.js";
3
+ import { getLocalReactPaths } from "../../platform/compat/react-paths.js";
4
+ import { isDeno } from "../../platform/compat/runtime.js";
3
5
 
4
6
  const srcDir = new URL(".", import.meta.url).pathname.replace(
5
7
  /\/(build|src)\/transforms\/esm\/?$/,
@@ -26,10 +28,15 @@ export async function resolveReactImports(
26
28
  return replaceSpecifiers(code, (specifier) => reactImports[specifier] ?? null);
27
29
  }
28
30
 
29
- // For SSR: Use esm.sh URLs consistently (NO npm: specifiers per plan requirements)
31
+ // For SSR: On Node.js/Bun, use local React paths from veryfront's node_modules.
32
+ // On Deno, use esm.sh URLs (Deno supports HTTP imports natively).
33
+ // This ensures the same React instance is used by both user code and react-dom-server.
34
+ const localReactPaths = getLocalReactPaths();
35
+ const ssrReactImports = isDeno ? reactImports : { ...reactImports, ...localReactPaths };
36
+
30
37
  const ssrImports: Record<string, string> = {
31
38
  ...getVeryfrontModulePaths(),
32
- ...reactImports,
39
+ ...ssrReactImports,
33
40
  };
34
41
 
35
42
  return replaceSpecifiers(code, (specifier) => ssrImports[specifier] ?? null);