@constela/compiler 0.11.4 → 0.12.0
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/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,19 @@ interface CompiledRouteDefinition {
|
|
|
66
66
|
layout?: string;
|
|
67
67
|
layoutParams?: Record<string, Expression>;
|
|
68
68
|
meta?: Record<string, CompiledExpression>;
|
|
69
|
+
/** Canonical URL for SEO */
|
|
70
|
+
canonical?: CompiledExpression;
|
|
71
|
+
/** JSON-LD structured data for SEO */
|
|
72
|
+
jsonLd?: CompiledJsonLdDefinition;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Compiled JSON-LD structured data definition
|
|
76
|
+
*/
|
|
77
|
+
interface CompiledJsonLdDefinition {
|
|
78
|
+
/** Schema.org type (e.g., "Article", "WebPage", "Organization") */
|
|
79
|
+
type: string;
|
|
80
|
+
/** Compiled properties for the JSON-LD object */
|
|
81
|
+
properties: Record<string, CompiledExpression>;
|
|
69
82
|
}
|
|
70
83
|
interface CompiledLifecycleHooks {
|
|
71
84
|
onMount?: string;
|
package/dist/index.js
CHANGED
|
@@ -1743,6 +1743,19 @@ function transformRouteDefinition(route, ctx) {
|
|
|
1743
1743
|
compiled.meta[key] = transformExpression(value, ctx);
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
|
+
if (route.canonical) {
|
|
1747
|
+
compiled.canonical = transformExpression(route.canonical, ctx);
|
|
1748
|
+
}
|
|
1749
|
+
if (route.jsonLd) {
|
|
1750
|
+
const compiledProperties = {};
|
|
1751
|
+
for (const [key, value] of Object.entries(route.jsonLd.properties)) {
|
|
1752
|
+
compiledProperties[key] = transformExpression(value, ctx);
|
|
1753
|
+
}
|
|
1754
|
+
compiled.jsonLd = {
|
|
1755
|
+
type: route.jsonLd.type,
|
|
1756
|
+
properties: compiledProperties
|
|
1757
|
+
};
|
|
1758
|
+
}
|
|
1746
1759
|
return compiled;
|
|
1747
1760
|
}
|
|
1748
1761
|
function transformLifecycleHooks(lifecycle) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Compiler for Constela UI framework - AST to Program transformation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@constela/core": "0.
|
|
18
|
+
"@constela/core": "0.13.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^20.10.0",
|