@treenity/react 3.0.8 → 3.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treenity/react",
3
- "version": "3.0.8",
3
+ "version": "3.0.9",
4
4
  "description": "React binding for Treenity — reactive hooks, admin UI, and context-based component rendering.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -32,10 +32,7 @@
32
32
  "./src/*.ts",
33
33
  "./src/*.tsx"
34
34
  ],
35
- "default": [
36
- "./dist/*.js",
37
- "./dist/*.jsx"
38
- ]
35
+ "default": "./dist/*.js"
39
36
  }
40
37
  },
41
38
  "exports": {
@@ -58,12 +55,8 @@
58
55
  "./src/*.ts",
59
56
  "./src/*.tsx"
60
57
  ],
61
- "types": [
62
- "./dist/*.d.ts"
63
- ],
64
- "default": [
65
- "./dist/*.js"
66
- ]
58
+ "types": "./dist/*.d.ts",
59
+ "default": "./dist/*.js"
67
60
  }
68
61
  },
69
62
  "treenity": {
@@ -174,9 +174,16 @@ export default function treenityPlugin(opts?: { modsDirs?: string[] }): Plugin {
174
174
  if (id === VIRTUAL_ID) return RESOLVED_ID;
175
175
  if (!importer) return;
176
176
 
177
- // Block server.ts from frontend
177
+ // Block server.ts from frontend + resolve relative imports in @treenity packages
178
178
  if (id.startsWith('.')) {
179
179
  const resolved = resolve(importer, '..', id).replace(/\\/g, '/');
180
+
181
+ // Relative imports within @treenity packages: resolve explicitly so module IDs
182
+ // match plugin-resolved @treenity/* paths (prevents ?v= hash mismatch → dual modules)
183
+ if (importer.includes('/node_modules/@treenity/')) {
184
+ return tryResolve([resolved]);
185
+ }
186
+
180
187
  if (SERVER_RE.test(resolved)) {
181
188
  this.error(
182
189
  `Server module imported in frontend build: "${id}"\n` +