release: prepare WRNexusJS 0.8.8
Quality / quality (ubuntu-latest) (push) Failing after 9m49s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-11 13:40:03 +05:30
parent 816594a58b
commit feff30a2b5
97 changed files with 769 additions and 10487 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@wrnexus/typecheck",
"version": "0.8.7",
"version": "0.8.8",
"type": "module",
"main": "src/index.ts",
"exports": {
+4
View File
@@ -239,6 +239,10 @@ export function virtualTypeScriptModule(
append(retainedImports(ast), ast.imports[0]);
append(ast.types.join("\n\n"), ast.types[0]?.trim());
// Pages, components, and stores are rendered with the framework request
// context in scope. Mirror the compiler-generated function parameter here so
// expressions such as `state user = ctx.user` type-check in the editor.
append('declare const ctx: import("@wrnexus/core").Context;');
for (const prop of ast.props) {
// JavaScript keywords such as the conventional `class` component prop are
+12
View File
@@ -73,3 +73,15 @@ test("treats omitted runtime parameter types as dynamic JavaScript values", () =
);
expect(diagnostics.filter((diagnostic) => diagnostic.code.startsWith("WRN-TYPE-"))).toEqual([]);
});
test("provides the framework context to page state expressions", () => {
const root = app();
const diagnostics = checkWrnSource(
`page AccountPage {
state user = ctx.user
view { <main></main> }
}`,
{ appRoot: root, filePath: join(root, "app", "pages", "account.wrn") },
);
expect(diagnostics.some((diagnostic) => diagnostic.code === "WRN-TYPE-2304")).toBe(false);
});