veryfront 0.0.97 → 0.0.98

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/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.0.97",
3
+ "version": "0.0.98",
4
4
  "nodeModulesDir": "auto",
5
5
  "exclude": [
6
6
  "npm/",
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-import-rewriter.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/ssr-import-rewriter.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA8FD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAK5F"}
1
+ {"version":3,"file":"ssr-import-rewriter.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/ssr-import-rewriter.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAsGD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAK5F"}
@@ -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
  function shouldKeepBareSpecifier(specifier) {
4
5
  // npm: specifiers are only supported in Deno, not Node.js
5
6
  // In Node.js, we need to convert them to esm.sh URLs (handled in rewriteBareImports)
@@ -21,8 +22,16 @@ function shouldKeepBareSpecifier(specifier) {
21
22
  return false;
22
23
  }
23
24
  function resolveReactForRuntime(specifier, version) {
24
- // Always rewrite React imports to esm.sh URLs for SSR modules.
25
- // NO npm: specifiers - use esm.sh URLs only for consistent React instance.
25
+ // On Node.js/Bun, use local React paths from veryfront's node_modules.
26
+ // On Deno, use esm.sh URLs (Deno supports HTTP imports natively).
27
+ if (!isDeno) {
28
+ const localPaths = getLocalReactPaths();
29
+ const localPath = localPaths[specifier];
30
+ if (localPath)
31
+ return localPath;
32
+ // If not found in local paths, fall through to esm.sh for subpath imports
33
+ }
34
+ // For Deno or subpath imports not in local paths, use esm.sh URLs
26
35
  const v = version ?? getReactVersion();
27
36
  const reactMap = getReactImportMap(v);
28
37
  const mapped = reactMap[specifier];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.0.97",
3
+ "version": "0.0.98",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.0.97",
3
+ "version": "0.0.98",
4
4
  "nodeModulesDir": "auto",
5
5
  "exclude": [
6
6
  "npm/",
@@ -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