refactor: migrate legacy wire namespace to wrn
Quality / quality (ubuntu-latest) (push) Failing after 9m49s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-12 18:51:15 +05:30
parent ec23dd4c93
commit 2c960fc1dc
488 changed files with 27306 additions and 19063 deletions
+34 -34
View File
@@ -1,6 +1,6 @@
"use strict";
// Generated by scripts/build-editor-compiler.mjs. Do not edit directly.
// WRN editor compiler source hash: 196a514b18fb6e31fdd8f4ca667a76b0b62cab547af33725ba78564d70bbc01b
// WRN editor compiler source hash: 55b8301cff11aaee86a6692d86801e583eae0764af059dc10fdd83c047f4891b
// WRN editor compiler generator hash: c71e7fe4258c97b73b384ff14b321f0cf0b30cc2ed0322f5f84b04e757159b18
// Generated with TypeScript: 5.9.3
const __nodeRequire = require;
@@ -1172,7 +1172,7 @@ function compileIfExpr(node) {
}
/**
* Collect every server-control expression in a view (recursively): `{#each}` list
* expressions and `{#if}` conditions. Used to wire up raw SSR data consts.
* expressions and `{#if}` conditions. Used to wrn up raw SSR data consts.
*/
function collectControlExprs(nodes, out = []) {
for (const node of nodes) {
@@ -1330,7 +1330,7 @@ function renderNestedComponentInvocation(node, ctx) {
.map((attr) => {
const spread = /^\{\.\.\.([A-Za-z_$][\w$]*)\}$/.exec(attr.name);
if (spread) {
return `\${__wireSpreadAttrs(${ctx.resolveExpr(spread[1])})}`;
return `\${__wrnSpreadAttrs(${ctx.resolveExpr(spread[1])})}`;
}
if (attr.event) {
return (escLit(` ${componentEventAttribute(attr.name)}="`) +
@@ -1342,7 +1342,7 @@ function renderNestedComponentInvocation(node, ctx) {
}
const wholeExpression = wholeAttributeExpression(attr.value);
const compiledValue = wholeExpression
? `\${__wireProp(${ctx.resolveExpr(wholeExpression)})}`
? `\${__wrnProp(${ctx.resolveExpr(wholeExpression)})}`
: compileAttrValue(attr.value, ctx);
const rendered = ` ${attr.name}="${compiledValue}"`;
if (!attr.value.includes("{") ||
@@ -1363,7 +1363,7 @@ function renderNestedComponentInvocation(node, ctx) {
: { ...ctx, forwardRestAttrs: false };
const inner = node.children.map((child) => renderComponentNode(child, childCtx)).join("");
return (`<div data-component="${attrEscape(node.tag)}"` +
`${ctx.forwardRestAttrs ? "${__wireSpreadAttrs(__attrs)}" : ""}` +
`${ctx.forwardRestAttrs ? "${__wrnSpreadAttrs(__attrs)}" : ""}` +
`${attrs}>${inner}</div>`);
}
function ssrMarker(bindings, binding) {
@@ -2291,7 +2291,7 @@ function viewHasRestAttributeSpread(nodes) {
/**
* Compile a text node. Interpolations that reference state stay as client
* mustaches (`{expr}`, hydrated by the reactive runtime); interpolations of
* props/constants are baked server-side (`${__wireHtml(expr)}`), so static
* props/constants are baked server-side (`${__wrnHtml(expr)}`), so static
* components render correct HTML with zero JavaScript.
*/
function compileText(raw, ctx) {
@@ -2312,7 +2312,7 @@ function compileText(raw, ctx) {
out += escLit(`{${expr}}`);
}
else if (expr === "content") {
out += `\${__wireRaw(${ctx.resolveExpr(expr)})}`;
out += `\${__wrnRaw(${ctx.resolveExpr(expr)})}`;
}
else if (exprRefsComponentReactiveValue(expr, ctx)) {
// State interpolation: bake the initial value AND keep it reactive via a
@@ -2320,11 +2320,11 @@ function compileText(raw, ctx) {
// updates it in place. `count` → `<span data-text="count">0</span>`.
out +=
escLit(`<span data-text="${attrEscape(expr)}">`) +
`\${__wireHtml(${ctx.resolveExpr(expr)})}` +
`\${__wrnHtml(${ctx.resolveExpr(expr)})}` +
escLit(`</span>`);
}
else {
out += `\${__wireHtml(${ctx.resolveExpr(expr)})}`;
out += `\${__wrnHtml(${ctx.resolveExpr(expr)})}`;
}
last = m.index + m[0].length;
}
@@ -2345,7 +2345,7 @@ function compileAttrValue(raw, ctx) {
out += escLit(`{${expr}}`); // hydrated per-item by the list renderer
}
else {
out += `\${__wireAttr(${ctx.resolveExpr(expr)})}`;
out += `\${__wrnAttr(${ctx.resolveExpr(expr)})}`;
}
last = m.index + m[0].length;
}
@@ -2497,7 +2497,7 @@ function renderComponentNode(node, ctx) {
.map((a) => {
const spread = /^\{\.\.\.([A-Za-z_$][\w$]*)\}$/.exec(a.name);
if (spread) {
return `\${__wireSpreadAttrs(${elementContext.resolveExpr(spread[1])})}`;
return `\${__wrnSpreadAttrs(${elementContext.resolveExpr(spread[1])})}`;
}
if (a.event) {
return ` ${eventAttribute(a.name)}="${escLit(attrEscape(a.value))}"`;
@@ -2520,7 +2520,7 @@ function renderComponentNode(node, ctx) {
: "";
/*
* A boolean attribute whose expression names a loop variable cannot
* be resolved on the server: __wireBooleanAttr runs at render time,
* be resolved on the server: __wrnBooleanAttr runs at render time,
* where `row` or `item` simply does not exist, and the emitted
* module blew up. Leave the attribute off the server output and let
* the client bind set it -- the runtime toggles boolean attributes
@@ -2530,7 +2530,7 @@ function renderComponentNode(node, ctx) {
if (referencesLoopVariable) {
return ` data-wrn-bind-${bindIndex++}="${escLit(attrEscape(JSON.stringify([a.name, a.value])))}"`;
}
return `\${__wireBooleanAttr(${JSON.stringify(a.name)}, ${elementContext.resolveExpr(expression)})}${marker}`;
return `\${__wrnBooleanAttr(${JSON.stringify(a.name)}, ${elementContext.resolveExpr(expression)})}${marker}`;
}
if (a.value === "false")
return "";
@@ -2553,7 +2553,7 @@ function renderComponentNode(node, ctx) {
return ` data-show="${escLit(attrEscape(wholeExpression))}"`;
}
const compiledValue = isExplicitComponentMount && wholeExpression
? `\${__wireProp(${elementContext.resolveExpr(wholeExpression)})}`
? `\${__wrnProp(${elementContext.resolveExpr(wholeExpression)})}`
: compileAttrValue(a.value, elementContext);
const rendered = ` ${a.name}="${compiledValue}"`;
const referencesState = exprRefsComponentReactiveValue(a.value, ctx);
@@ -2608,7 +2608,7 @@ function renderComponentNode(node, ctx) {
.join("");
const loopLocalsAttribute = serverLoopLocalsAttribute(ctx);
const allAttrs = `${loopLocalsAttribute}` +
`${ctx.forwardRestAttrs ? "${__wireSpreadAttrs(__attrs)}" : ""}` +
`${ctx.forwardRestAttrs ? "${__wrnSpreadAttrs(__attrs)}" : ""}` +
`${ctx.eventNames?.length ? ` data-wrn-events="${attrEscape(ctx.eventNames.join(","))}"` : ""}` +
`${classAttribute}` +
`${classReactiveBinding}` +
@@ -2843,7 +2843,7 @@ function __restProps(
);
}
function __wireHtml(v: unknown): string {
function __wrnHtml(v: unknown): string {
return String(v == null ? "" : v).replace(
/[&<>]/g,
(c) =>
@@ -2855,7 +2855,7 @@ function __wireHtml(v: unknown): string {
);
}
function __wireAttr(v: unknown): string {
function __wrnAttr(v: unknown): string {
return String(v == null ? "" : v).replace(
/[&<>"]/g,
(c) =>
@@ -2869,7 +2869,7 @@ function __wireAttr(v: unknown): string {
);
}
function __wireBooleanAttr(name: string, value: unknown): string {
function __wrnBooleanAttr(name: string, value: unknown): string {
return value === true ||
value === "true" ||
value === "" ||
@@ -2880,7 +2880,7 @@ function __wireBooleanAttr(name: string, value: unknown): string {
: "";
}
function __wireSpreadAttrs(value: unknown): string {
function __wrnSpreadAttrs(value: unknown): string {
if (value === null || typeof value !== "object" || Array.isArray(value)) return "";
const booleanAttributes = new Set(${JSON.stringify([...HTML_BOOLEAN_ATTRIBUTES])});
@@ -2905,27 +2905,27 @@ function __wireSpreadAttrs(value: unknown): string {
}
if (booleanAttributes.has(lowerName)) {
attributes.push(__wireBooleanAttr(name, raw));
attributes.push(__wrnBooleanAttr(name, raw));
continue;
}
if (raw === false || raw === null || raw === undefined) continue;
attributes.push(" " + name + '="' + __wireAttr(raw) + '"');
attributes.push(" " + name + '="' + __wrnAttr(raw) + '"');
}
return attributes.join("");
}
function __wireProp(v: unknown): string {
function __wrnProp(v: unknown): string {
const value =
v !== null && typeof v === "object"
? JSON.stringify(v)
: String(v == null ? "" : v);
return __wireAttr(value);
return __wrnAttr(value);
}
function __wireRaw(v: unknown): string {
function __wrnRaw(v: unknown): string {
return String(v == null ? "" : v);
}`);
if (hasServerEach) {
@@ -2996,22 +2996,22 @@ function __wireRaw(v: unknown): string {
out.push(`export default { name: ${JSON.stringify(ast.name)}, kind: ${JSON.stringify(ast.kind)}, render };`);
return out.join("\n\n") + "\n";
}
function __wireRaw(v) {
function __wrnRaw(v) {
return String(v == null ? "" : v);
}
function wholeAttributeExpression(value) {
const match = /^\s*\{([\s\S]+)\}\s*$/.exec(value);
return match?.[1]?.trim() || null;
}
function __wireHtml(v) {
function __wrnHtml(v) {
return String(v == null ? "" : v).replace(/[&<>]/g, (c) => c === "&" ? "&amp;" : c === "<" ? "&lt;" : "&gt;");
}
function __wireAttr(v) {
function __wrnAttr(v) {
return String(v == null ? "" : v).replace(/[&<>"]/g, (c) => c === "&" ? "&amp;" : c === "<" ? "&lt;" : c === ">" ? "&gt;" : "&quot;");
}
function __wireProp(v) {
function __wrnProp(v) {
const value = v !== null && typeof v === "object" ? JSON.stringify(v) : String(v == null ? "" : v);
return __wireAttr(value);
return __wrnAttr(value);
}
function renderPageComponentAttr(attr, dynamicExpressions) {
if (attr.event) {
@@ -3163,8 +3163,8 @@ function resolveWrnImports(declarations, importer, options) {
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DependencyGraph = exports.createCompilationCache = exports.compilationKey = exports.runtimeTypeOf = exports.inferredRuntimeType = exports.eraseFunctionTypes = exports.LexError = exports.Lexer = exports.NativeCompileError = exports.generateNative = exports.runtimeCapabilities = exports.analyzeRuntimeImports = exports.optimizeAst = exports.analyzeRuntimeRequirements = exports.analyzeOptimizations = exports.createWrnSourceMap = exports.resolveWrnImports = exports.resolveWrnImport = exports.createComponentContract = exports.generateStoreModule = exports.generateStoreBrowserModule = exports.generateDeclarations = exports.rpcManifest = exports.generateServerFunctionsModule = exports.generateBrowserModule = exports.generateTargets = exports.generate = exports.ParseError = exports.parse = exports.formatDiagnostic = exports.diagnosticFromError = exports.diagnose = exports.assertValidAst = exports.formatWrn = void 0;
exports.compileNativeWireFile = compileNativeWireFile;
exports.compileWireFile = compileWireFile;
exports.compileNativeWrnFile = compileNativeWrnFile;
exports.compileWrnFile = compileWrnFile;
exports.compile = compile;
const syntax_1 = require("@wrnexus/syntax");
var syntax_2 = require("@wrnexus/syntax");
@@ -3217,7 +3217,7 @@ Object.defineProperty(exports, "eraseFunctionTypes", { enumerable: true, get: fu
Object.defineProperty(exports, "inferredRuntimeType", { enumerable: true, get: function () { return syntax_5.inferredRuntimeType; } });
Object.defineProperty(exports, "runtimeTypeOf", { enumerable: true, get: function () { return syntax_5.runtimeTypeOf; } });
/** Compile `.wrn` source into an Expo Router React Native screen. */
function compileNativeWireFile(source) {
function compileNativeWrnFile(source) {
const ast = (0, syntax_1.parse)(source);
(0, syntax_1.assertValidAst)(ast);
return (0, native_codegen_ts_1.generateNative)(ast);
@@ -3226,7 +3226,7 @@ function compileNativeWireFile(source) {
* Compile `.wrn` source into TypeScript source. Errors include a stable code,
* source location, code frame, and actionable hint whenever available.
*/
function compileWireFile(source, filePath = "<inline .wrn>") {
function compileWrnFile(source, filePath = "<inline .wrn>") {
try {
const ast = (0, syntax_1.parse)(source);
(0, syntax_1.assertValidAst)(ast, { file: filePath, accessibility: true });
@@ -3829,7 +3829,7 @@ function __diagnostic(code, message, details) {
}
function __csrfToken() {
if (typeof document === "undefined") return undefined;
const match = /(?:^|;\\s*)wire-csrf=([^;]+)/.exec(document.cookie || "");
const match = /(?:^|;\\s*)wrn-csrf=([^;]+)/.exec(document.cookie || "");
return match ? decodeURIComponent(match[1]) : undefined;
}
async function __callServerFunction(storeName, functionName, args, options) {
+2 -2
View File
@@ -1,4 +1,4 @@
// WRN editor extension source hash: b455291b3d69fabfba7d10889ff628f90579432d07cd871f9e39c336e6c8851f
// WRN editor extension source hash: 1f978c42851411e8a985eb6c865b706e52f6063f067c3245946b4f55bc1a7d11
// WRN editor extension generator hash: 456d1d614e44e5fb1f19b784176c09cf2ade9b64ef73a17934c2698150b62728
"use strict";
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
@@ -22710,7 +22710,7 @@ var client;
async function recoverWrnLanguage(document) {
if (!document.fileName.toLowerCase().endsWith(".wrn"))
return;
if (!["plaintext", "wire"].includes(document.languageId))
if (!["plaintext", "wrn"].includes(document.languageId))
return;
try {
await vscode.languages.setTextDocumentLanguage(document, WRN_LANGUAGE_ID);
+1 -1
View File
@@ -12,7 +12,7 @@ let client;
/** @param {vscode.TextDocument} document */
async function recoverWrnLanguage(document) {
if (!document.fileName.toLowerCase().endsWith(".wrn")) return;
if (!["plaintext", "wire"].includes(document.languageId)) return;
if (!["plaintext", "wrn"].includes(document.languageId)) return;
try {
await vscode.languages.setTextDocumentLanguage(document, WRN_LANGUAGE_ID);
} catch (error) {
+2 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env node
// WRN editor language server source hash: da83a5e1dbf90523ee0fe9a0d232182b0a78d025f3be8d07c324728d1cdcc17c
// WRN editor language server source hash: 13b4b0b80a52f1e883211f1b5193ad6ab28c582f526f0a28747ebf71307bbc0d
// WRN editor language server generator hash: f593a44aaf05495b789ce7a3086bee1eebb951b884d41c0e017bbcfe5f547e72
// @bun @bun-cjs
(function(exports, require, module, __filename, __dirname) {var __create = Object.create;
@@ -172362,7 +172362,7 @@ var import_node_path3 = require("node:path");
var SKIPPED_DIRECTORIES = new Set([
".git",
".wrnexus",
".wirefw",
".wrnfw",
"build",
"coverage",
"dist",