feat: support WRN imports and dynamic public shell

This commit is contained in:
2026-07-21 11:15:06 +05:30
parent 0013c0771d
commit 2ca2d02b22
82 changed files with 959 additions and 174 deletions
+13
View File
@@ -56,6 +56,19 @@ component ThemeToggle {
assert.equal(declaration.diagnostic, undefined);
});
test("recognizes a WRN declaration after top-level imports", () => {
const source = `import { appUrl } from "@wrnexus/helpers";
import type { Context } from "@wrnexus/core";
page Home {
view { <PublicHeader signInHref="{appUrl('sso', '/sign-in')}" /> }
}`;
const declaration = findTopLevelDeclaration({}, source);
assert.equal(declaration.kind, "page");
assert.equal(declaration.name, "Home");
assert.equal(declaration.diagnostic, undefined);
});
test("masks only leading trivia and preserves source offsets", () => {
const source = "\uFEFF// Summary\r\npage Home {\n // member comment\n}";
const masked = maskLeadingTrivia(source);