release: WRNexusJS 0.2.28
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ai",
|
"name": "@wrnexus/ai",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.",
|
"description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/authz",
|
"name": "@wrnexus/authz",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/authz — part of the WrNexus framework.",
|
"description": "@wrnexus/authz — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
+11
-11
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/cli",
|
"name": "@wrnexus/cli",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/cli — part of the WrNexus framework.",
|
"description": "@wrnexus/cli — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -28,16 +28,16 @@
|
|||||||
"wrnexus": "./dist/index.js"
|
"wrnexus": "./dist/index.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27",
|
"@wrnexus/core": "^0.2.28",
|
||||||
"@wrnexus/router": "^0.2.27",
|
"@wrnexus/router": "^0.2.28",
|
||||||
"@wrnexus/csr": "^0.2.27",
|
"@wrnexus/csr": "^0.2.28",
|
||||||
"@wrnexus/compiler": "^0.2.27",
|
"@wrnexus/compiler": "^0.2.28",
|
||||||
"@wrnexus/styles": "^0.2.27",
|
"@wrnexus/styles": "^0.2.28",
|
||||||
"@wrnexus/dev-server": "^0.2.27",
|
"@wrnexus/dev-server": "^0.2.28",
|
||||||
"@wrnexus/ui": "^0.2.27",
|
"@wrnexus/ui": "^0.2.28",
|
||||||
"@wrnexus/validation": "^0.2.27",
|
"@wrnexus/validation": "^0.2.28",
|
||||||
"@wrnexus/i18n": "^0.2.27",
|
"@wrnexus/i18n": "^0.2.28",
|
||||||
"@wrnexus/db": "^0.2.27"
|
"@wrnexus/db": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/compiler",
|
"name": "@wrnexus/compiler",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/compiler — part of the WrNexus framework.",
|
"description": "@wrnexus/compiler — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/core",
|
"name": "@wrnexus/core",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/core — part of the WrNexus framework.",
|
"description": "@wrnexus/core — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/csr",
|
"name": "@wrnexus/csr",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/csr — part of the WrNexus framework.",
|
"description": "@wrnexus/csr — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27"
|
"@wrnexus/core": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/db",
|
"name": "@wrnexus/db",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/db — part of the WrNexus framework.",
|
"description": "@wrnexus/db — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/dev-server",
|
"name": "@wrnexus/dev-server",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/dev-server — part of the WrNexus framework.",
|
"description": "@wrnexus/dev-server — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -25,18 +25,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27",
|
"@wrnexus/core": "^0.2.28",
|
||||||
"@wrnexus/router": "^0.2.27",
|
"@wrnexus/router": "^0.2.28",
|
||||||
"@wrnexus/ssr": "^0.2.27",
|
"@wrnexus/ssr": "^0.2.28",
|
||||||
"@wrnexus/csr": "^0.2.27",
|
"@wrnexus/csr": "^0.2.28",
|
||||||
"@wrnexus/compiler": "^0.2.27",
|
"@wrnexus/compiler": "^0.2.28",
|
||||||
"@wrnexus/styles": "^0.2.27",
|
"@wrnexus/styles": "^0.2.28",
|
||||||
"@wrnexus/ui": "^0.2.27",
|
"@wrnexus/ui": "^0.2.28",
|
||||||
"@wrnexus/validation": "^0.2.27",
|
"@wrnexus/validation": "^0.2.28",
|
||||||
"@wrnexus/i18n": "^0.2.27",
|
"@wrnexus/i18n": "^0.2.28",
|
||||||
"@wrnexus/db": "^0.2.27",
|
"@wrnexus/db": "^0.2.28",
|
||||||
"@wrnexus/pubsub": "^0.2.27",
|
"@wrnexus/pubsub": "^0.2.28",
|
||||||
"@wrnexus/uploader": "^0.2.27"
|
"@wrnexus/uploader": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/encryption",
|
"name": "@wrnexus/encryption",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/encryption — part of the WrNexus framework.",
|
"description": "@wrnexus/encryption — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/helpers",
|
"name": "@wrnexus/helpers",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Safe convenience helpers for WrNexus request contexts and common application flows.",
|
"description": "Safe convenience helpers for WrNexus request contexts and common application flows.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27"
|
"@wrnexus/core": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/i18n",
|
"name": "@wrnexus/i18n",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/i18n — part of the WrNexus framework.",
|
"description": "@wrnexus/i18n — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27"
|
"@wrnexus/core": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/jwt",
|
"name": "@wrnexus/jwt",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/jwt — part of the WrNexus framework.",
|
"description": "@wrnexus/jwt — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/mobile",
|
"name": "@wrnexus/mobile",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/mobile — part of the WrNexus framework.",
|
"description": "@wrnexus/mobile — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/native": "^0.2.27"
|
"@wrnexus/native": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/native",
|
"name": "@wrnexus/native",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/native — part of the WrNexus framework.",
|
"description": "@wrnexus/native — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/oauth",
|
"name": "@wrnexus/oauth",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/oauth — part of the WrNexus framework.",
|
"description": "@wrnexus/oauth — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/pubsub",
|
"name": "@wrnexus/pubsub",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/pubsub — part of the WrNexus framework.",
|
"description": "@wrnexus/pubsub — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/queue",
|
"name": "@wrnexus/queue",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/queue — part of the WrNexus framework.",
|
"description": "@wrnexus/queue — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/reactive",
|
"name": "@wrnexus/reactive",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/reactive — part of the WrNexus framework.",
|
"description": "@wrnexus/reactive — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/router",
|
"name": "@wrnexus/router",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/router — part of the WrNexus framework.",
|
"description": "@wrnexus/router — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/compiler": "^0.2.27",
|
"@wrnexus/compiler": "^0.2.28",
|
||||||
"@wrnexus/core": "^0.2.27"
|
"@wrnexus/core": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ssr",
|
"name": "@wrnexus/ssr",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/ssr — part of the WrNexus framework.",
|
"description": "@wrnexus/ssr — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27"
|
"@wrnexus/core": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/styles",
|
"name": "@wrnexus/styles",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/styles — part of the WrNexus framework.",
|
"description": "@wrnexus/styles — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/uploader": "^0.2.27"
|
"@wrnexus/uploader": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/test",
|
"name": "@wrnexus/test",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/test — part of the WrNexus framework.",
|
"description": "@wrnexus/test — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/tracking",
|
"name": "@wrnexus/tracking",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/tracking — part of the WrNexus framework.",
|
"description": "@wrnexus/tracking — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ui",
|
"name": "@wrnexus/ui",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/ui — part of the WrNexus framework.",
|
"description": "@wrnexus/ui — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"./ui.css": "./ui.css"
|
"./ui.css": "./ui.css"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27"
|
"@wrnexus/core": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/uploader",
|
"name": "@wrnexus/uploader",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/uploader — part of the WrNexus framework.",
|
"description": "@wrnexus/uploader — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "^0.2.27"
|
"@wrnexus/core": "^0.2.28"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/validation",
|
"name": "@wrnexus/validation",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "@wrnexus/validation — part of the WrNexus framework.",
|
"description": "@wrnexus/validation — part of the WrNexus framework.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ai",
|
"name": "@wrnexus/ai",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.",
|
"description": "Zero-dependency Claude (Anthropic) client for WrNexus apps.",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/authz",
|
"name": "@wrnexus/authz",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/cli",
|
"name": "@wrnexus/cli",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -321,6 +321,14 @@ const MIGRATIONS: Migration[] = [
|
|||||||
// No project file migration is required for this framework release.
|
// No project file migration is required for this framework release.
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
version: "0.2.28",
|
||||||
|
id: "layout-component-improvements",
|
||||||
|
description: "Added new block layout for component and improved component rendering.",
|
||||||
|
apply() {
|
||||||
|
// No project file migration is required for this framework release.
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/** Release tooling uses this to require an explicit migration entry per version. */
|
/** Release tooling uses this to require an explicit migration entry per version. */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/compiler",
|
"name": "@wrnexus/compiler",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -599,7 +599,9 @@ async function __wrnexusRenderSsrBindings(html: string, ctx: any): Promise<strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function generate(ast: PageAst): string {
|
export function generate(ast: PageAst): string {
|
||||||
if (ast.kind === "component") return generateComponent(ast);
|
if (ast.kind === "component" || ast.kind === "layout") {
|
||||||
|
return generateComponent(ast);
|
||||||
|
}
|
||||||
|
|
||||||
const out: string[] = [];
|
const out: string[] = [];
|
||||||
const ssrBindings: SsrBinding[] = [];
|
const ssrBindings: SsrBinding[] = [];
|
||||||
@@ -903,6 +905,8 @@ function compileText(raw: string, ctx: CompCtx): string {
|
|||||||
escLit(`<span data-text="${attrEscape(expr)}">`) +
|
escLit(`<span data-text="${attrEscape(expr)}">`) +
|
||||||
`\${__wireHtml(${ctx.resolveExpr(expr)})}` +
|
`\${__wireHtml(${ctx.resolveExpr(expr)})}` +
|
||||||
escLit(`</span>`);
|
escLit(`</span>`);
|
||||||
|
} else if (expr === "content") {
|
||||||
|
out += `\${__wireRaw(${ctx.resolveExpr(expr)})}`;
|
||||||
} else {
|
} else {
|
||||||
out += `\${__wireHtml(${ctx.resolveExpr(expr)})}`;
|
out += `\${__wireHtml(${ctx.resolveExpr(expr)})}`;
|
||||||
}
|
}
|
||||||
@@ -1024,9 +1028,22 @@ function renderComponentNode(node: ViewNode, ctx: CompCtx): string {
|
|||||||
function generateComponent(ast: PageAst): string {
|
function generateComponent(ast: PageAst): string {
|
||||||
const out: string[] = [];
|
const out: string[] = [];
|
||||||
|
|
||||||
|
const effectiveProps =
|
||||||
|
ast.kind === "layout" && !ast.props.some((prop) => prop.name === "content")
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
name: "content",
|
||||||
|
default: '""',
|
||||||
|
},
|
||||||
|
...ast.props,
|
||||||
|
]
|
||||||
|
: ast.props;
|
||||||
|
|
||||||
const stateNames = new Set(ast.states.map((s) => s.name));
|
const stateNames = new Set(ast.states.map((s) => s.name));
|
||||||
const nameRefs = new Map<string, string>();
|
const nameRefs = new Map<string, string>();
|
||||||
for (const p of ast.props) nameRefs.set(p.name, safeRef(p.name));
|
for (const p of effectiveProps) {
|
||||||
|
nameRefs.set(p.name, safeRef(p.name));
|
||||||
|
}
|
||||||
for (const s of ast.states) nameRefs.set(s.name, safeRef(s.name));
|
for (const s of ast.states) nameRefs.set(s.name, safeRef(s.name));
|
||||||
const resolveExpr = (expr: string): string => {
|
const resolveExpr = (expr: string): string => {
|
||||||
let result = expr;
|
let result = expr;
|
||||||
@@ -1050,10 +1067,13 @@ function generateComponent(ast: PageAst): string {
|
|||||||
// Prop-driven text/attributes are baked server-side, so static components ship
|
// Prop-driven text/attributes are baked server-side, so static components ship
|
||||||
// no JavaScript at all.
|
// no JavaScript at all.
|
||||||
const needsScope = ast.states.length > 0 || viewHasEvents(ast.view);
|
const needsScope = ast.states.length > 0 || viewHasEvents(ast.view);
|
||||||
const scopeKeys = [...ast.props.map((p) => p.name), ...ast.states.map((s) => s.name)];
|
const scopeKeys = [
|
||||||
|
...effectiveProps.map((prop) => prop.name),
|
||||||
|
...ast.states.map((state) => state.name),
|
||||||
|
];
|
||||||
|
|
||||||
const decls: string[] = [];
|
const decls: string[] = [];
|
||||||
for (const prop of ast.props) {
|
for (const prop of effectiveProps) {
|
||||||
decls.push(
|
decls.push(
|
||||||
` const ${nameRefs.get(prop.name)} = __coerce(__p[${JSON.stringify(prop.name)}], (${resolveExpr(prop.default)}));`,
|
` const ${nameRefs.get(prop.name)} = __coerce(__p[${JSON.stringify(prop.name)}], (${resolveExpr(prop.default)}));`,
|
||||||
);
|
);
|
||||||
@@ -1073,7 +1093,11 @@ function generateComponent(ast: PageAst): string {
|
|||||||
? ` const __scope = "";\n`
|
? ` const __scope = "";\n`
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
out.push(`export const __wrnexusComponent = ${JSON.stringify(ast.name)};`);
|
if (ast.kind === "layout") {
|
||||||
|
out.push(`export const __wrnexusLayout = ${JSON.stringify(ast.name)};`);
|
||||||
|
} else {
|
||||||
|
out.push(`export const __wrnexusComponent = ${JSON.stringify(ast.name)};`);
|
||||||
|
}
|
||||||
out.push(`function __coerce(v: any, def: any): any {
|
out.push(`function __coerce(v: any, def: any): any {
|
||||||
if (v === undefined || v === null) return def;
|
if (v === undefined || v === null) return def;
|
||||||
if (typeof def === "number") return Number(v);
|
if (typeof def === "number") return Number(v);
|
||||||
@@ -1116,3 +1140,13 @@ function __wireAttr(v: any): string {
|
|||||||
|
|
||||||
return out.join("\n\n") + "\n";
|
return out.join("\n\n") + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __wireHtml(v: any): string {
|
||||||
|
return String(v == null ? "" : v).replace(/[&<>]/g, (c) =>
|
||||||
|
c === "&" ? "&" : c === "<" ? "<" : ">",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function __wireRaw(v: any): string {
|
||||||
|
return String(v == null ? "" : v);
|
||||||
|
}
|
||||||
|
|||||||
@@ -124,8 +124,11 @@ export interface PropDecl {
|
|||||||
|
|
||||||
export interface PageAst {
|
export interface PageAst {
|
||||||
type: "page";
|
type: "page";
|
||||||
/** `page` (a route) or `component` (a reusable, prop-driven fragment). */
|
/**
|
||||||
kind: "page" | "component";
|
* `page` is a route, `component` is a reusable fragment,
|
||||||
|
* and `layout` is a reusable page wrapper.
|
||||||
|
*/
|
||||||
|
kind: "page" | "component" | "layout";
|
||||||
name: string;
|
name: string;
|
||||||
/** Name of the page layout (`app/layouts/<layout>.wrn`), if the page sets one. */
|
/** Name of the page layout (`app/layouts/<layout>.wrn`), if the page sets one. */
|
||||||
layout?: string;
|
layout?: string;
|
||||||
@@ -183,14 +186,18 @@ export function parse(source: string): PageAst {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// A file is either a `page` (a route) or a `component` (a reusable fragment).
|
// A file may contain a page, reusable component, or reusable layout.
|
||||||
const opener = lx.next();
|
const opener = lx.next();
|
||||||
if (opener.type !== "ident" || (opener.value !== "page" && opener.value !== "component")) {
|
|
||||||
|
if (opener.type !== "ident" || !["page", "component", "layout"].includes(opener.value)) {
|
||||||
throw new ParseError(
|
throw new ParseError(
|
||||||
`Expected 'page' or 'component' but got '${opener.value || opener.type}' at offset ${opener.pos}`,
|
`Expected 'page', 'component', or 'layout' but got '${
|
||||||
|
opener.value || opener.type
|
||||||
|
}' at offset ${opener.pos}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const kind: "page" | "component" = opener.value === "component" ? "component" : "page";
|
|
||||||
|
const kind = opener.value as "page" | "component" | "layout";
|
||||||
const name = expect("ident").value;
|
const name = expect("ident").value;
|
||||||
expect("lbrace");
|
expect("lbrace");
|
||||||
|
|
||||||
|
|||||||
@@ -212,3 +212,34 @@ component ParentCard {
|
|||||||
|
|
||||||
expect(output).toContain('title="${__wireAttr(title)}"');
|
expect(output).toContain('title="${__wireAttr(title)}"');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("parses a layout block", () => {
|
||||||
|
const ast = parse(`
|
||||||
|
layout AppLayout {
|
||||||
|
view {
|
||||||
|
<main>{content}</main>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
|
||||||
|
expect(ast.kind).toBe("layout");
|
||||||
|
expect(ast.name).toBe("AppLayout");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("layouts compile as reusable render modules", () => {
|
||||||
|
const output = generate(
|
||||||
|
parse(`
|
||||||
|
layout AppLayout {
|
||||||
|
view {
|
||||||
|
<main>{content}</main>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`),
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(output).toContain('export const __wrnexusLayout = "AppLayout"');
|
||||||
|
|
||||||
|
expect(output).toContain("${__wireRaw(content)}");
|
||||||
|
|
||||||
|
expect(output).toContain("export function render");
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/core",
|
"name": "@wrnexus/core",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/csr",
|
"name": "@wrnexus/csr",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/db",
|
"name": "@wrnexus/db",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/dev-server",
|
"name": "@wrnexus/dev-server",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/encryption",
|
"name": "@wrnexus/encryption",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/helpers",
|
"name": "@wrnexus/helpers",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Safe convenience helpers for WrNexus request contexts and common application flows.",
|
"description": "Safe convenience helpers for WrNexus request contexts and common application flows.",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/i18n",
|
"name": "@wrnexus/i18n",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/jwt",
|
"name": "@wrnexus/jwt",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/mobile",
|
"name": "@wrnexus/mobile",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/native",
|
"name": "@wrnexus/native",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/oauth",
|
"name": "@wrnexus/oauth",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/pubsub",
|
"name": "@wrnexus/pubsub",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/queue",
|
"name": "@wrnexus/queue",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/reactive",
|
"name": "@wrnexus/reactive",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/router",
|
"name": "@wrnexus/router",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ssr",
|
"name": "@wrnexus/ssr",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/styles",
|
"name": "@wrnexus/styles",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/test",
|
"name": "@wrnexus/test",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/tracking",
|
"name": "@wrnexus/tracking",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ui",
|
"name": "@wrnexus/ui",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/uploader",
|
"name": "@wrnexus/uploader",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/validation",
|
"name": "@wrnexus/validation",
|
||||||
"version": "0.2.27",
|
"version": "0.2.28",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user