fix: use patched compiler for docs deployment
This commit is contained in:
+37
-32
@@ -173,13 +173,13 @@ export interface Routes {
|
||||
}
|
||||
|
||||
export interface RouteNames {
|
||||
"index": "/";
|
||||
index: "/";
|
||||
"404": "/404";
|
||||
"access": "/access";
|
||||
"architecture": "/architecture";
|
||||
"benchmarks": "/benchmarks";
|
||||
"changelog": "/changelog";
|
||||
"examples": "/examples";
|
||||
access: "/access";
|
||||
architecture: "/architecture";
|
||||
benchmarks: "/benchmarks";
|
||||
changelog: "/changelog";
|
||||
examples: "/examples";
|
||||
"getting.started": "/getting-started";
|
||||
"guides.api.routes": "/guides/api-routes";
|
||||
"guides.authentication": "/guides/authentication";
|
||||
@@ -205,9 +205,9 @@ export interface RouteNames {
|
||||
"guides.upgrading": "/guides/upgrading";
|
||||
"guides.uploads": "/guides/uploads";
|
||||
"guides.workspaces.and.gateway": "/guides/workspaces-and-gateway";
|
||||
"language": "/language";
|
||||
"license": "/license";
|
||||
"packages": "/packages";
|
||||
language: "/language";
|
||||
license: "/license";
|
||||
packages: "/packages";
|
||||
"packages.ai": "/packages/ai";
|
||||
"packages.auth": "/packages/auth";
|
||||
"packages.authz": "/packages/authz";
|
||||
@@ -335,12 +335,12 @@ export interface RouteNames {
|
||||
"releases.0.6.0": "/releases/0.6.0";
|
||||
"releases.0.7.0": "/releases/0.7.0";
|
||||
"releases.0.8.0": "/releases/0.8.0";
|
||||
"roadmap": "/roadmap";
|
||||
"search": "/search";
|
||||
"security": "/security";
|
||||
"showcase": "/showcase";
|
||||
"support": "/support";
|
||||
"tutorial": "/tutorial";
|
||||
roadmap: "/roadmap";
|
||||
search: "/search";
|
||||
security: "/security";
|
||||
showcase: "/showcase";
|
||||
support: "/support";
|
||||
tutorial: "/tutorial";
|
||||
}
|
||||
|
||||
export interface RouteQueries {
|
||||
@@ -356,7 +356,11 @@ type RouteValue = string | readonly string[] | undefined;
|
||||
|
||||
function encodeRouteValue(value: RouteValue, catchAll: boolean): string {
|
||||
if (value === undefined) return "";
|
||||
const values = Array.isArray(value) ? value : catchAll ? String(value).split("/") : [String(value)];
|
||||
const values = Array.isArray(value)
|
||||
? value
|
||||
: catchAll
|
||||
? String(value).split("/")
|
||||
: [String(value)];
|
||||
return values.map((part) => encodeURIComponent(part)).join("/");
|
||||
}
|
||||
|
||||
@@ -386,7 +390,8 @@ function buildHref(path: string, params: Record<string, RouteValue> = {}): strin
|
||||
}
|
||||
const value = params[name];
|
||||
if (value === undefined && optional) continue;
|
||||
if (value === undefined) throw new Error(`WRN-ROUTE-MISSING-PARAM: Missing route parameter '${name}'.`);
|
||||
if (value === undefined)
|
||||
throw new Error(`WRN-ROUTE-MISSING-PARAM: Missing route parameter '${name}'.`);
|
||||
output.push(encodeRouteValue(value, catchAll));
|
||||
}
|
||||
return "/" + output.filter(Boolean).join("/");
|
||||
@@ -414,12 +419,12 @@ export function route<N extends RouteName>(
|
||||
): string {
|
||||
const paths: Record<RouteName, RoutePath> = {
|
||||
"404": "/404",
|
||||
"index": "/",
|
||||
"access": "/access",
|
||||
"architecture": "/architecture",
|
||||
"benchmarks": "/benchmarks",
|
||||
"changelog": "/changelog",
|
||||
"examples": "/examples",
|
||||
index: "/",
|
||||
access: "/access",
|
||||
architecture: "/architecture",
|
||||
benchmarks: "/benchmarks",
|
||||
changelog: "/changelog",
|
||||
examples: "/examples",
|
||||
"getting.started": "/getting-started",
|
||||
"guides.api.routes": "/guides/api-routes",
|
||||
"guides.authentication": "/guides/authentication",
|
||||
@@ -445,9 +450,9 @@ export function route<N extends RouteName>(
|
||||
"guides.upgrading": "/guides/upgrading",
|
||||
"guides.uploads": "/guides/uploads",
|
||||
"guides.workspaces.and.gateway": "/guides/workspaces-and-gateway",
|
||||
"language": "/language",
|
||||
"license": "/license",
|
||||
"packages": "/packages",
|
||||
language: "/language",
|
||||
license: "/license",
|
||||
packages: "/packages",
|
||||
"packages.ai": "/packages/ai",
|
||||
"packages.auth": "/packages/auth",
|
||||
"packages.authz": "/packages/authz",
|
||||
@@ -575,12 +580,12 @@ export function route<N extends RouteName>(
|
||||
"releases.0.6.0": "/releases/0.6.0",
|
||||
"releases.0.7.0": "/releases/0.7.0",
|
||||
"releases.0.8.0": "/releases/0.8.0",
|
||||
"roadmap": "/roadmap",
|
||||
"search": "/search",
|
||||
"security": "/security",
|
||||
"showcase": "/showcase",
|
||||
"support": "/support",
|
||||
"tutorial": "/tutorial"
|
||||
roadmap: "/roadmap",
|
||||
search: "/search",
|
||||
security: "/security",
|
||||
showcase: "/showcase",
|
||||
support: "/support",
|
||||
tutorial: "/tutorial",
|
||||
} as Record<RouteName, RoutePath>;
|
||||
const output = buildHref(paths[name], (args[0] ?? {}) as Record<string, RouteValue>);
|
||||
const query = args[1];
|
||||
|
||||
Vendored
+178
-20
@@ -11,32 +11,190 @@ declare namespace WRNexusGenerated {
|
||||
: T extends (db: any, ...rest: any[]) => infer R
|
||||
? { args: Record<string, never>; result: Awaited<R> }
|
||||
: never;
|
||||
type RealtimeMessage<T> = T extends import("@wrnexus/core").RoomDefinition<any, infer M> ? M : unknown;
|
||||
type RealtimeMessage<T> = T extends import("@wrnexus/core").RoomDefinition<any, infer M>
|
||||
? M
|
||||
: unknown;
|
||||
type QueuePayload<T> = T extends import("@wrnexus/queue").JobDefinition<infer I> ? I : unknown;
|
||||
type RouteName = "404" | "access" | "architecture" | "benchmarks" | "changelog" | "examples" | "getting.started" | "guides.api.routes" | "guides.authentication" | "guides.authorization" | "guides.configuration.and.profiles" | "guides.database" | "guides.deployment" | "guides.forms.and.validation" | "guides.i18n.and.themes" | "guides.middleware" | "guides.mobile" | "guides.observability" | "guides.pages.and.components" | "guides.project.structure" | "guides.pubsub" | "guides.queues" | "guides.realtime" | "guides.routing" | "guides.security" | "guides.server.data" | "guides.testing" | "guides.troubleshooting" | "guides.upgrading" | "guides.uploads" | "guides.workspaces.and.gateway" | "index" | "language" | "license" | "packages" | "packages.ai" | "packages.auth" | "packages.authz" | "packages.benchmark" | "packages.cache" | "packages.captcha" | "packages.cli" | "packages.compiler" | "packages.content" | "packages.core" | "packages.csr" | "packages.db" | "packages.dev.server" | "packages.dev.toolbar" | "packages.encryption" | "packages.graphql" | "packages.helpers" | "packages.i18n" | "packages.identity" | "packages.image" | "packages.jwt" | "packages.language.server" | "packages.mcp" | "packages.mobile" | "packages.native" | "packages.oauth" | "packages.observability" | "packages.playground" | "packages.plugin" | "packages.pubsub" | "packages.pwa" | "packages.queue" | "packages.reactive" | "packages.realtime" | "packages.router" | "packages.security" | "packages.ssr" | "packages.store" | "packages.styles" | "packages.syntax" | "packages.test" | "packages.tracking" | "packages.typecheck" | "packages.ui" | "packages.uploader" | "packages.validation" | "releases.0.2.15" | "releases.0.2.17" | "releases.0.2.18" | "releases.0.2.19" | "releases.0.2.20" | "releases.0.2.21" | "releases.0.2.22" | "releases.0.2.23" | "releases.0.2.24" | "releases.0.2.25" | "releases.0.2.26" | "releases.0.2.27" | "releases.0.2.28" | "releases.0.2.29" | "releases.0.2.30" | "releases.0.2.31" | "releases.0.2.32" | "releases.0.2.33" | "releases.0.2.34" | "releases.0.2.35" | "releases.0.2.36" | "releases.0.2.37" | "releases.0.2.38" | "releases.0.2.39" | "releases.0.2.40" | "releases.0.2.41" | "releases.0.2.42" | "releases.0.2.43" | "releases.0.2.44" | "releases.0.2.45" | "releases.0.2.46" | "releases.0.2.47" | "releases.0.2.48" | "releases.0.2.49" | "releases.0.2.50" | "releases.0.2.51" | "releases.0.2.52" | "releases.0.2.53" | "releases.0.2.54" | "releases.0.2.55" | "releases.0.2.56" | "releases.0.2.57" | "releases.0.2.58" | "releases.0.2.59" | "releases.0.2.60" | "releases.0.2.61" | "releases.0.2.62" | "releases.0.2.63" | "releases.0.2.64" | "releases.0.2.65" | "releases.0.2.66" | "releases.0.2.67" | "releases.0.2.68" | "releases.0.2.69" | "releases.0.2.70" | "releases.0.2.71" | "releases.0.2.72" | "releases.0.2.73" | "releases.0.2.74" | "releases.0.2.75" | "releases.0.2.76" | "releases.0.2.77" | "releases.0.2.78" | "releases.0.2.79" | "releases.0.3.0" | "releases.0.3.1" | "releases.0.3.2" | "releases.0.3.3" | "releases.0.3.4" | "releases.0.3.5" | "releases.0.3.6" | "releases.0.4.0" | "releases.0.5.0" | "releases.0.5.1" | "releases.0.5.10" | "releases.0.5.11" | "releases.0.5.12" | "releases.0.5.13" | "releases.0.6.0" | "releases.0.7.0" | "releases.0.8.0" | "roadmap" | "search" | "security" | "showcase" | "support" | "tutorial";
|
||||
type RouteName =
|
||||
| "404"
|
||||
| "access"
|
||||
| "architecture"
|
||||
| "benchmarks"
|
||||
| "changelog"
|
||||
| "examples"
|
||||
| "getting.started"
|
||||
| "guides.api.routes"
|
||||
| "guides.authentication"
|
||||
| "guides.authorization"
|
||||
| "guides.configuration.and.profiles"
|
||||
| "guides.database"
|
||||
| "guides.deployment"
|
||||
| "guides.forms.and.validation"
|
||||
| "guides.i18n.and.themes"
|
||||
| "guides.middleware"
|
||||
| "guides.mobile"
|
||||
| "guides.observability"
|
||||
| "guides.pages.and.components"
|
||||
| "guides.project.structure"
|
||||
| "guides.pubsub"
|
||||
| "guides.queues"
|
||||
| "guides.realtime"
|
||||
| "guides.routing"
|
||||
| "guides.security"
|
||||
| "guides.server.data"
|
||||
| "guides.testing"
|
||||
| "guides.troubleshooting"
|
||||
| "guides.upgrading"
|
||||
| "guides.uploads"
|
||||
| "guides.workspaces.and.gateway"
|
||||
| "index"
|
||||
| "language"
|
||||
| "license"
|
||||
| "packages"
|
||||
| "packages.ai"
|
||||
| "packages.auth"
|
||||
| "packages.authz"
|
||||
| "packages.benchmark"
|
||||
| "packages.cache"
|
||||
| "packages.captcha"
|
||||
| "packages.cli"
|
||||
| "packages.compiler"
|
||||
| "packages.content"
|
||||
| "packages.core"
|
||||
| "packages.csr"
|
||||
| "packages.db"
|
||||
| "packages.dev.server"
|
||||
| "packages.dev.toolbar"
|
||||
| "packages.encryption"
|
||||
| "packages.graphql"
|
||||
| "packages.helpers"
|
||||
| "packages.i18n"
|
||||
| "packages.identity"
|
||||
| "packages.image"
|
||||
| "packages.jwt"
|
||||
| "packages.language.server"
|
||||
| "packages.mcp"
|
||||
| "packages.mobile"
|
||||
| "packages.native"
|
||||
| "packages.oauth"
|
||||
| "packages.observability"
|
||||
| "packages.playground"
|
||||
| "packages.plugin"
|
||||
| "packages.pubsub"
|
||||
| "packages.pwa"
|
||||
| "packages.queue"
|
||||
| "packages.reactive"
|
||||
| "packages.realtime"
|
||||
| "packages.router"
|
||||
| "packages.security"
|
||||
| "packages.ssr"
|
||||
| "packages.store"
|
||||
| "packages.styles"
|
||||
| "packages.syntax"
|
||||
| "packages.test"
|
||||
| "packages.tracking"
|
||||
| "packages.typecheck"
|
||||
| "packages.ui"
|
||||
| "packages.uploader"
|
||||
| "packages.validation"
|
||||
| "releases.0.2.15"
|
||||
| "releases.0.2.17"
|
||||
| "releases.0.2.18"
|
||||
| "releases.0.2.19"
|
||||
| "releases.0.2.20"
|
||||
| "releases.0.2.21"
|
||||
| "releases.0.2.22"
|
||||
| "releases.0.2.23"
|
||||
| "releases.0.2.24"
|
||||
| "releases.0.2.25"
|
||||
| "releases.0.2.26"
|
||||
| "releases.0.2.27"
|
||||
| "releases.0.2.28"
|
||||
| "releases.0.2.29"
|
||||
| "releases.0.2.30"
|
||||
| "releases.0.2.31"
|
||||
| "releases.0.2.32"
|
||||
| "releases.0.2.33"
|
||||
| "releases.0.2.34"
|
||||
| "releases.0.2.35"
|
||||
| "releases.0.2.36"
|
||||
| "releases.0.2.37"
|
||||
| "releases.0.2.38"
|
||||
| "releases.0.2.39"
|
||||
| "releases.0.2.40"
|
||||
| "releases.0.2.41"
|
||||
| "releases.0.2.42"
|
||||
| "releases.0.2.43"
|
||||
| "releases.0.2.44"
|
||||
| "releases.0.2.45"
|
||||
| "releases.0.2.46"
|
||||
| "releases.0.2.47"
|
||||
| "releases.0.2.48"
|
||||
| "releases.0.2.49"
|
||||
| "releases.0.2.50"
|
||||
| "releases.0.2.51"
|
||||
| "releases.0.2.52"
|
||||
| "releases.0.2.53"
|
||||
| "releases.0.2.54"
|
||||
| "releases.0.2.55"
|
||||
| "releases.0.2.56"
|
||||
| "releases.0.2.57"
|
||||
| "releases.0.2.58"
|
||||
| "releases.0.2.59"
|
||||
| "releases.0.2.60"
|
||||
| "releases.0.2.61"
|
||||
| "releases.0.2.62"
|
||||
| "releases.0.2.63"
|
||||
| "releases.0.2.64"
|
||||
| "releases.0.2.65"
|
||||
| "releases.0.2.66"
|
||||
| "releases.0.2.67"
|
||||
| "releases.0.2.68"
|
||||
| "releases.0.2.69"
|
||||
| "releases.0.2.70"
|
||||
| "releases.0.2.71"
|
||||
| "releases.0.2.72"
|
||||
| "releases.0.2.73"
|
||||
| "releases.0.2.74"
|
||||
| "releases.0.2.75"
|
||||
| "releases.0.2.76"
|
||||
| "releases.0.2.77"
|
||||
| "releases.0.2.78"
|
||||
| "releases.0.2.79"
|
||||
| "releases.0.3.0"
|
||||
| "releases.0.3.1"
|
||||
| "releases.0.3.2"
|
||||
| "releases.0.3.3"
|
||||
| "releases.0.3.4"
|
||||
| "releases.0.3.5"
|
||||
| "releases.0.3.6"
|
||||
| "releases.0.4.0"
|
||||
| "releases.0.5.0"
|
||||
| "releases.0.5.1"
|
||||
| "releases.0.5.10"
|
||||
| "releases.0.5.11"
|
||||
| "releases.0.5.12"
|
||||
| "releases.0.5.13"
|
||||
| "releases.0.6.0"
|
||||
| "releases.0.7.0"
|
||||
| "releases.0.8.0"
|
||||
| "roadmap"
|
||||
| "search"
|
||||
| "security"
|
||||
| "showcase"
|
||||
| "support"
|
||||
| "tutorial";
|
||||
type ApiRoute = never;
|
||||
type RealtimeRoute = never;
|
||||
type EnvironmentKey = never;
|
||||
type TranslationKey = never;
|
||||
type QueueName = never;
|
||||
type CacheKey = never;
|
||||
interface Components {
|
||||
|
||||
}
|
||||
interface ApiContracts {
|
||||
|
||||
}
|
||||
interface MiddlewareContexts {
|
||||
|
||||
}
|
||||
interface DatabaseQueries {
|
||||
|
||||
}
|
||||
interface RealtimeMessages {
|
||||
|
||||
}
|
||||
interface QueuePayloads {
|
||||
|
||||
}
|
||||
interface Components {}
|
||||
interface ApiContracts {}
|
||||
interface MiddlewareContexts {}
|
||||
interface DatabaseQueries {}
|
||||
interface RealtimeMessages {}
|
||||
interface QueuePayloads {}
|
||||
type ApplicationConfig = (typeof import("../../wrnexus.config.ts"))["default"];
|
||||
}
|
||||
|
||||
-1
@@ -1,2 +1 @@
|
||||
// AUTO-GENERATED plugin type aggregation - do not edit.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"@wrnexus/benchmark": "^0.8.0",
|
||||
"@wrnexus/cache": "^0.8.0",
|
||||
"@wrnexus/captcha": "^0.8.0",
|
||||
"@wrnexus/compiler": "^0.8.0",
|
||||
"@wrnexus/compiler": "file:vendor/compiler",
|
||||
"@wrnexus/content": "^0.8.0",
|
||||
"@wrnexus/core": "^0.8.0",
|
||||
"@wrnexus/csr": "^0.8.0",
|
||||
@@ -67,6 +67,9 @@
|
||||
},
|
||||
},
|
||||
},
|
||||
"overrides": {
|
||||
"@wrnexus/compiler": "file:vendor/compiler",
|
||||
},
|
||||
"packages": {
|
||||
"@antfu/install-pkg": ["@antfu/install-pkg@1.1.0", "", { "dependencies": { "package-manager-detector": "^1.3.0", "tinyexec": "^1.0.1" } }, "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ=="],
|
||||
|
||||
@@ -246,7 +249,7 @@
|
||||
|
||||
"@wrnexus/cli": ["@wrnexus/cli@0.8.0", "", { "dependencies": { "@wrnexus/compiler": "^0.8.0", "@wrnexus/core": "^0.8.0", "@wrnexus/csr": "^0.8.0", "@wrnexus/db": "^0.8.0", "@wrnexus/dev-server": "^0.8.0", "@wrnexus/i18n": "^0.8.0", "@wrnexus/mcp": "^0.8.0", "@wrnexus/playground": "^0.8.0", "@wrnexus/plugin": "^0.8.0", "@wrnexus/router": "^0.8.0", "@wrnexus/security": "^0.8.0", "@wrnexus/styles": "^0.8.0", "@wrnexus/syntax": "^0.8.0", "@wrnexus/typecheck": "^0.8.0", "@wrnexus/ui": "^0.8.0", "@wrnexus/validation": "^0.8.0", "selfsigned": "^5.5.0" }, "bin": { "wrnexus": "dist/index.js" } }, "sha512-6BOf//IY17Gz/C2kzGVHTn0bF5zMAtJWxofVAW96L/pwJQWHzxioqOpNWLVk1bHh6m2Jh59NOzwWtuR3xBpGTQ=="],
|
||||
|
||||
"@wrnexus/compiler": ["@wrnexus/compiler@0.8.0", "", { "dependencies": { "@wrnexus/csr": "^0.8.0", "@wrnexus/store": "^0.8.0", "@wrnexus/syntax": "^0.8.0", "@wrnexus/validation": "^0.8.0" } }, "sha512-xRIUer9UrzfXxebLIvEkeIHiZ1VhRhb8/ium/m0ehqyLllLf1oOH8mFT3g6tdnwZs8B4UJXlwdrIfbBs/xWrvg=="],
|
||||
"@wrnexus/compiler": ["@wrnexus/compiler@file:vendor/compiler", { "dependencies": { "@wrnexus/csr": "^0.8.0", "@wrnexus/store": "^0.8.0", "@wrnexus/syntax": "^0.8.0", "@wrnexus/validation": "^0.8.0" } }],
|
||||
|
||||
"@wrnexus/content": ["@wrnexus/content@0.8.0", "", {}, "sha512-vE0LR53Pgu7ZVAxJF+QuiyGnlmL/1R9ZJ1fApRHTB6szCSFk1gaNvENiXH0H7LOYWEVvUXI9ITiC1cONfyHNRA=="],
|
||||
|
||||
@@ -618,6 +621,14 @@
|
||||
|
||||
"@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="],
|
||||
|
||||
"@wrnexus/cli/@wrnexus/compiler": ["@wrnexus/compiler@file:vendor/compiler", {}],
|
||||
|
||||
"@wrnexus/dev-server/@wrnexus/compiler": ["@wrnexus/compiler@file:vendor/compiler", {}],
|
||||
|
||||
"@wrnexus/playground/@wrnexus/compiler": ["@wrnexus/compiler@file:vendor/compiler", {}],
|
||||
|
||||
"@wrnexus/router/@wrnexus/compiler": ["@wrnexus/compiler@file:vendor/compiler", {}],
|
||||
|
||||
"csso/css-tree": ["css-tree@2.2.1", "", { "dependencies": { "mdn-data": "2.0.28", "source-map-js": "^1.0.1" } }, "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA=="],
|
||||
|
||||
"lightningcss/detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
|
||||
|
||||
@@ -9,7 +9,10 @@ export default tseslint.config(
|
||||
{
|
||||
ignores: [
|
||||
"node_modules/**",
|
||||
"vendor/**",
|
||||
"dist/**",
|
||||
"app/types/wrnexus.generated.d.ts",
|
||||
"app/types/wrnexus.plugins.generated.d.ts",
|
||||
".wrnexus/**",
|
||||
"**/.wrnexus/**",
|
||||
"mobile/android/**",
|
||||
|
||||
Generated
+17
-14
@@ -16,7 +16,7 @@
|
||||
"@wrnexus/benchmark": "^0.8.0",
|
||||
"@wrnexus/cache": "^0.8.0",
|
||||
"@wrnexus/captcha": "^0.8.0",
|
||||
"@wrnexus/compiler": "^0.8.0",
|
||||
"@wrnexus/compiler": "file:vendor/compiler",
|
||||
"@wrnexus/content": "^0.8.0",
|
||||
"@wrnexus/core": "^0.8.0",
|
||||
"@wrnexus/csr": "^0.8.0",
|
||||
@@ -1611,19 +1611,8 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@wrnexus/compiler": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@wrnexus/compiler/-/compiler-0.8.0.tgz",
|
||||
"integrity": "sha512-xRIUer9UrzfXxebLIvEkeIHiZ1VhRhb8/ium/m0ehqyLllLf1oOH8mFT3g6tdnwZs8B4UJXlwdrIfbBs/xWrvg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@wrnexus/csr": "^0.8.0",
|
||||
"@wrnexus/store": "^0.8.0",
|
||||
"@wrnexus/syntax": "^0.8.0",
|
||||
"@wrnexus/validation": "^0.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"bun": ">=1.3.0"
|
||||
}
|
||||
"resolved": "vendor/compiler",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@wrnexus/content": {
|
||||
"version": "0.8.0",
|
||||
@@ -3728,6 +3717,20 @@
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"vendor/compiler": {
|
||||
"name": "@wrnexus/compiler",
|
||||
"version": "0.8.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@wrnexus/csr": "^0.8.0",
|
||||
"@wrnexus/store": "^0.8.0",
|
||||
"@wrnexus/syntax": "^0.8.0",
|
||||
"@wrnexus/validation": "^0.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"bun": ">=1.3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -29,7 +29,7 @@
|
||||
"@iconify/tailwind4": "^1.2.3",
|
||||
"@wrnexus/ai": "^0.8.0",
|
||||
"@wrnexus/authz": "^0.8.0",
|
||||
"@wrnexus/compiler": "^0.8.0",
|
||||
"@wrnexus/compiler": "file:vendor/compiler",
|
||||
"@wrnexus/core": "^0.8.0",
|
||||
"@wrnexus/csr": "^0.8.0",
|
||||
"@wrnexus/db": "^0.8.0",
|
||||
@@ -87,5 +87,8 @@
|
||||
},
|
||||
"wrnexus": {
|
||||
"version": "0.8.0"
|
||||
},
|
||||
"overrides": {
|
||||
"@wrnexus/compiler": "file:vendor/compiler"
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+216
@@ -0,0 +1,216 @@
|
||||
# @wrnexus/compiler
|
||||
|
||||
## Partial-static rendering
|
||||
|
||||
Pages can select `render = "partial-static"` and divide their view with `<Static>` and
|
||||
`<Dynamic>` boundaries. The compiler emits a build-only shell renderer that never evaluates
|
||||
dynamic-boundary children. `wrnexus build` expands static component mounts into
|
||||
`dist/partial-shells.json`, records byte/region evidence in `build-report.json`, and embeds
|
||||
the shell in the production route manifest. At request time the production runtime retains
|
||||
request-aware layouts, locale/theme metadata and security nonces while streaming dynamic
|
||||
regions into stable placeholders.
|
||||
|
||||
> Compiler for the `.wrn` language — tokenizes, parses, and lowers `.wrn` page and component files to TypeScript.
|
||||
|
||||
Part of the **WrNexus** framework — an SSR-first, Bun-native full-stack web framework.
|
||||
|
||||
Production adapters use `analyzeRuntimeImports` before bundling. Edge, worker,
|
||||
service-worker, and browser targets reject Node filesystem, TCP, and process
|
||||
modules with `WRN-RUNTIME-CAPABILITY`. Package manifests can declare supported
|
||||
`wrnexus.runtimes` and required `wrnexus.requires` capabilities; discovery fails
|
||||
when the selected deployment cannot satisfy them.
|
||||
|
||||
## Server actions
|
||||
|
||||
```wrn
|
||||
action createUser using CreateUserSchema {
|
||||
const user = await users.create(input)
|
||||
invalidate("users")
|
||||
return user
|
||||
}
|
||||
|
||||
view {
|
||||
<form @submit="createUser">...</form>
|
||||
}
|
||||
```
|
||||
|
||||
The compiler produces a schema-aware server registry, a fully inferred action
|
||||
client, and progressively enhanced form metadata. The shared runtime performs
|
||||
validation, authentication/permission checks, CSRF verification, serialization,
|
||||
invalidation reporting, and browser lifecycle events.
|
||||
|
||||
## Overview
|
||||
|
||||
`@wrnexus/compiler` turns `.wrn` source into TypeScript that targets the framework's runtime primitives. A `.wrn` file declares either a `page` (a route) or a `component` (a reusable, prop-driven fragment) with blocks for `state`, `view` (plain HTML), `seo`, `style`, `functions`, `api`, `ssr`/`client` data bindings, and `realtime` websocket handlers. The pipeline is `source → Lexer → parse() → PageAst → generate() → TypeScript`. It is a build/server-side library — the WrNexus dev loader calls it to compile `.wrn` files on the fly, surfacing `ParseError` as a readable error page.
|
||||
|
||||
Static ES module imports may appear before the root declaration. Imported values are
|
||||
available to server-rendered expressions, including component props:
|
||||
|
||||
```wrn
|
||||
import { appUrl } from "@wrnexus/helpers";
|
||||
|
||||
layout PublicLayout {
|
||||
view {
|
||||
<PublicHeader signInHref="{appUrl('sso', '/sign-in')}" />
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @wrnexus/compiler
|
||||
```
|
||||
|
||||
> Private package — the machine must be authenticated to the `wrnexus` npm org
|
||||
> (a read token in `~/.npmrc`). Requires **Bun** (Node is not supported).
|
||||
|
||||
## API
|
||||
|
||||
All exports come from the package root (`@wrnexus/compiler`).
|
||||
|
||||
### `compileWireFile(source: string): string`
|
||||
|
||||
Compile `.wrn` source to a TypeScript module string. Throws `ParseError` on invalid input. The output is prefixed with a `// compiled from .wrn` comment.
|
||||
|
||||
### `compile(source: string): CompileResult`
|
||||
|
||||
Richer entry point that returns the generated code, the AST, and any diagnostics.
|
||||
|
||||
```ts
|
||||
interface CompileResult {
|
||||
code: string;
|
||||
ast: PageAst;
|
||||
diagnostics: string[];
|
||||
}
|
||||
```
|
||||
|
||||
On a `ParseError` it pushes the message into `diagnostics` and re-throws.
|
||||
|
||||
### `parse(source: string): PageAst`
|
||||
|
||||
Run the lexer + recursive-descent parser and return the AST. Throws `ParseError` (lexer `LexError`s are caught and rethrown as `ParseError`).
|
||||
|
||||
### `generate(ast: PageAst): string`
|
||||
|
||||
Lower a `PageAst` to TypeScript. `page` ASTs become a default-export page component (plus `meta`, optional `layout`, `__wrnexusApi`/method handlers, `websocket`, and SSR/CSR data bindings); `component` ASTs become a module exporting `render(props)` and `__wrnexusComponent`.
|
||||
|
||||
### `Lexer`
|
||||
|
||||
On-demand lexer for `.wrn`. Yields structural tokens and exposes raw-span readers for the parser.
|
||||
|
||||
```ts
|
||||
class Lexer {
|
||||
pos: number;
|
||||
constructor(src: string);
|
||||
next(): Token; // consume next structural token
|
||||
peek(): Token; // look ahead without consuming
|
||||
readPath(): string; // route path, e.g. /users/[id]
|
||||
readToLineEnd(): string; // rest of line (state/prop initializers)
|
||||
readBalancedBraces(): string; // inner text of a { ... } block, string-aware
|
||||
}
|
||||
```
|
||||
|
||||
`Token` is `{ type: TokenType; value: string; pos: number }`, where `TokenType` is one of `ident`, `string`, `lbrace`, `rbrace`, `lparen`, `rparen`, `at`, `eq`, `comma`, `eof`.
|
||||
|
||||
### Errors
|
||||
|
||||
| Class | Thrown by | Meaning |
|
||||
| ------------ | ------------------------------------------------- | --------------------------------------------------------------- |
|
||||
| `ParseError` | `parse`, `compile`, `compileWireFile`, `generate` | Invalid `.wrn` grammar or (rewrapped) lex failure. |
|
||||
| `LexError` | `Lexer` | Unexpected character / unterminated string / unbalanced braces. |
|
||||
|
||||
### AST types
|
||||
|
||||
Exported type-only symbols describing the parsed tree:
|
||||
|
||||
| Type | Description |
|
||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `PageAst` | Root node including top-level `imports`, `kind`, `name`, `types`, typed `props`, typed `states`, `view`, styles, functions, data APIs, lifecycle, and routes. |
|
||||
| `ViewNode` | `{ type: "text"; value }` or `{ type: "element"; tag; attrs; children }`. |
|
||||
| `Attr` | `{ name; value; event; boolean? }` — `event` marks `@event` bindings. |
|
||||
| `StateDecl` | `{ name; valueType?; expr }` — a typed `state x: Type = <expr>` declaration. |
|
||||
| `PropDecl` | `{ name; valueType?; required; default }` — a typed prop declaration. |
|
||||
| `SeoBlock` | `Record<string, string>` from the `seo { ... }` block. |
|
||||
| `ApiBlock` | `{ method; path; body }` — a top-level `api METHOD /path { ... }`. |
|
||||
| `DataApiBlock` | `{ mode; name; method; path; body }` — an `api` inside an `ssr`/`client` block. |
|
||||
| `DataMode` | `"ssr" \| "client"`. |
|
||||
| `ModeFunctionsBlock` | `{ mode; body }` — a `functions { ... }` inside an `ssr`/`client` block. |
|
||||
| `RealtimeBlock` | `{ name; handlers }` — a `realtime <name> { on evt(args) { ... } }` block. |
|
||||
|
||||
## Usage
|
||||
|
||||
Compile a page:
|
||||
|
||||
```ts
|
||||
import { compileWireFile } from "@wrnexus/compiler";
|
||||
|
||||
const ts = compileWireFile(`
|
||||
page Home {
|
||||
state count = 0
|
||||
seo { title = "Home" description = "Welcome" }
|
||||
view {
|
||||
<button @click="count++">Clicked {count} times</button>
|
||||
}
|
||||
}
|
||||
`);
|
||||
// ts is a TypeScript module: exports `meta`, and a default page component
|
||||
// returning an HTML string, wrapped in a data-scope for the reactive runtime.
|
||||
```
|
||||
|
||||
Inspect the AST and diagnostics:
|
||||
|
||||
```ts
|
||||
import { compile, ParseError } from "@wrnexus/compiler";
|
||||
|
||||
try {
|
||||
const { code, ast, diagnostics } = compile(source);
|
||||
console.log(ast.kind, ast.name, ast.states.length);
|
||||
} catch (err) {
|
||||
if (err instanceof ParseError) console.error(err.message);
|
||||
}
|
||||
```
|
||||
|
||||
Drive the parse/codegen stages directly:
|
||||
|
||||
```ts
|
||||
import { parse, generate } from "@wrnexus/compiler";
|
||||
|
||||
const ast = parse(componentSource); // ast.kind === "component"
|
||||
const module = generate(ast); // exports render(props) + __wrnexusComponent
|
||||
```
|
||||
|
||||
Use the lexer standalone:
|
||||
|
||||
```ts
|
||||
import { Lexer } from "@wrnexus/compiler";
|
||||
|
||||
const lx = new Lexer("page Home {");
|
||||
lx.next(); // { type: "ident", value: "page", pos: 0 }
|
||||
lx.next(); // { type: "ident", value: "Home", pos: 5 }
|
||||
lx.next(); // { type: "lbrace", value: "{", pos: 10 }
|
||||
```
|
||||
|
||||
## The `.wrn` language (as parsed)
|
||||
|
||||
A file opens with `page <Name>` or `component <Name>` followed by a `{ ... }` body containing zero or more members:
|
||||
|
||||
- `layout = "<name>"` — selects `app/layouts/<name>.wrn` (pages only).
|
||||
- `types { <TypeScript declarations> }` — reusable interfaces and aliases for the current file.
|
||||
- `props { name: Type = <default> ... }` — typed component props. Omit `= <default>` to make a prop required. Legacy inferred props remain supported.
|
||||
- `@event name = function` inside `props` — declares a public component event. Emit it from component behavior with `name(detail)` or `$emit("name", detail)`, and consume it with `<Component @name="handler(event)" />`.
|
||||
- `state <ident>: Type = <expr>` — typed reactive state seeded from a raw JS expression, including native array and object literals. The annotation is optional for backward compatibility.
|
||||
- `view { <html> }` — plain HTML with `{expr}` interpolation in text and attributes, JSX-style component props such as `items={items}`, `items={[...]}`, and `options={{...}}`, hyphenated attributes, boolean attributes, `@event="..."` client bindings, and `<!-- comments -->`. Structured component props are serialized safely for SSR; expressions that reference `state` retain their initial value and update reactively in the browser.
|
||||
- `seo { key = "value" ... }` — metadata merged into the generated `meta`.
|
||||
- `style { <raw css> }` — inlined page/component stylesheet (repeatable).
|
||||
- `functions { <TypeScript> }` — helpers with typed parameters and return values. Types remain in server output and are safely erased from browser behavior code.
|
||||
- `api <METHOD> <path> { <raw js> }` — route handler, lowered to a `METHOD` export (repeatable).
|
||||
- `ssr { ... }` / `client { ... }` — data blocks holding `api <name> <METHOD> <path> { ... }` bindings and their own `functions { ... }`.
|
||||
- `realtime <name> { on <evt>(<args>) { <raw js> } ... }` — websocket handlers, lowered to a `websocket` export.
|
||||
|
||||
`view` markup is parsed by a lenient dedicated HTML parser (`parseHtmlView`); HTML void elements (`<br>`, `<img>`, …) take no closing tag. Line comments (`//`) are skipped by the lexer.
|
||||
|
||||
## Requirements / Notes
|
||||
|
||||
- Pure TypeScript with no runtime dependencies; runs under **Bun** as part of the WrNexus toolchain (Node is not supported).
|
||||
- Generated modules target WrNexus runtime primitives (`data-scope`, `data-text`, `data-on-*`, `data-for`, `data-component`, `__wrnexus*`/`__wire*` helpers) — consume the output within a WrNexus app, e.g. via `@wrnexus/core`'s dev loader.
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "@wrnexus/compiler",
|
||||
"version": "0.8.0",
|
||||
"type": "module",
|
||||
"description": "@wrnexus/compiler — part of the WrNexus framework.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.workroot.in/WorkRoot/WRNexusJS.git",
|
||||
"directory": "packages/compiler"
|
||||
},
|
||||
"homepage": "https://wrnexusjs.dev/packages/compiler",
|
||||
"bugs": {
|
||||
"url": "https://git.workroot.in/WorkRoot/WRNexusJS/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"wrnexus",
|
||||
"bun",
|
||||
"typescript",
|
||||
"compiler"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"engines": {
|
||||
"bun": ">=1.3.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "restricted"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@wrnexus/csr": "^0.8.0",
|
||||
"@wrnexus/syntax": "^0.8.0",
|
||||
"@wrnexus/store": "^0.8.0",
|
||||
"@wrnexus/validation": "^0.8.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user