@uniweb/runtime 0.6.0 → 0.6.1

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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.jsx +6 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/runtime",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -31,7 +31,7 @@
31
31
  "node": ">=20.19"
32
32
  },
33
33
  "dependencies": {
34
- "@uniweb/core": "0.5.0"
34
+ "@uniweb/core": "0.5.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@vitejs/plugin-react": "^4.5.2",
package/src/index.jsx CHANGED
@@ -118,9 +118,7 @@ async function loadFoundation(source) {
118
118
  import(/* @vite-ignore */ url)
119
119
  ])
120
120
 
121
- const componentNames = foundation.components
122
- ? Object.keys(foundation.components)
123
- : 'unknown'
121
+ const componentNames = Object.keys(foundation).filter(k => k !== 'default')
124
122
  console.log('[Runtime] Foundation loaded. Available components:', componentNames)
125
123
 
126
124
  return foundation
@@ -424,12 +422,7 @@ async function initRuntime(foundationSource, options = {}) {
424
422
  // Promise (legacy Module Federation support)
425
423
  const remoteModule = await foundationSource
426
424
  // Handle double default wrapping
427
- const innerModule = remoteModule?.default?.default ? remoteModule.default : remoteModule
428
- // Convert to foundation interface with components object
429
- foundation = {
430
- components: innerModule.default || {},
431
- ...innerModule
432
- }
425
+ foundation = remoteModule?.default?.default ? remoteModule.default : remoteModule
433
426
  } else if (foundationSource && typeof foundationSource === 'object') {
434
427
  // Already a foundation module
435
428
  foundation = foundationSource
@@ -443,13 +436,13 @@ async function initRuntime(foundationSource, options = {}) {
443
436
  uniwebInstance.setFoundation(foundation)
444
437
 
445
438
  // Set foundation capabilities (layouts, props, etc.) if provided
446
- if (foundation.capabilities) {
447
- uniwebInstance.setFoundationConfig(foundation.capabilities)
439
+ if (foundation.default?.capabilities) {
440
+ uniwebInstance.setFoundationConfig(foundation.default.capabilities)
448
441
  }
449
442
 
450
443
  // Attach layout metadata (areas, transitions, defaults) from foundation entry point
451
- if (foundation.layoutMeta && uniwebInstance.foundationConfig) {
452
- uniwebInstance.foundationConfig.layoutMeta = foundation.layoutMeta
444
+ if (foundation.default?.layoutMeta && uniwebInstance.foundationConfig) {
445
+ uniwebInstance.foundationConfig.layoutMeta = foundation.default.layoutMeta
453
446
  }
454
447
 
455
448
  // Load extensions (secondary foundations)