@uniweb/build 0.7.1 → 0.7.2
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 +3 -3
- package/src/schema.js +18 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"sharp": "^0.33.2"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@uniweb/
|
|
53
|
+
"@uniweb/runtime": "0.6.0",
|
|
54
54
|
"@uniweb/schemas": "0.2.1",
|
|
55
|
-
"@uniweb/
|
|
55
|
+
"@uniweb/content-reader": "1.1.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
package/src/schema.js
CHANGED
|
@@ -476,14 +476,31 @@ export async function buildSchema(srcDir, componentPaths) {
|
|
|
476
476
|
// Discover layouts from src/layouts/
|
|
477
477
|
const layouts = await discoverLayoutsInPath(srcDir)
|
|
478
478
|
|
|
479
|
+
// Determine extension role
|
|
480
|
+
const isExtension = !!foundationConfig.extension
|
|
481
|
+
|
|
482
|
+
// Warn if extension declares things it shouldn't
|
|
483
|
+
if (isExtension) {
|
|
484
|
+
if (foundationConfig.vars && Object.keys(foundationConfig.vars).length > 0) {
|
|
485
|
+
console.warn(`Warning: Extension declares theme variables (vars). Extensions don't define theme variables — the primary foundation owns those.`)
|
|
486
|
+
}
|
|
487
|
+
if (Object.keys(layouts).length > 0) {
|
|
488
|
+
console.warn(`Warning: Extension provides layouts. Extensions don't provide layouts — the primary foundation owns the layout.`)
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Build _self, stripping the raw extension boolean in favor of normalized role
|
|
493
|
+
const { extension: _ext, ...configWithoutExtension } = foundationConfig
|
|
494
|
+
|
|
479
495
|
return {
|
|
480
496
|
_self: {
|
|
481
|
-
...
|
|
497
|
+
...configWithoutExtension,
|
|
482
498
|
...identity,
|
|
483
499
|
// foundation.js overrides package.json for editor-facing identity
|
|
484
500
|
...(foundationConfig.name && { name: foundationConfig.name }),
|
|
485
501
|
...(foundationConfig.description && { description: foundationConfig.description }),
|
|
486
502
|
...(foundationConfig.defaultLayout && { defaultLayout: foundationConfig.defaultLayout }),
|
|
503
|
+
...(isExtension && { role: 'extension' }),
|
|
487
504
|
},
|
|
488
505
|
// Layout metadata (full, for editor)
|
|
489
506
|
...(Object.keys(layouts).length > 0 && { _layouts: layouts }),
|