feat: support WRN imports and dynamic public shell

This commit is contained in:
Clintchiz committed 2026-07-21 11:15:06 +05:30
1 parent 0013c0771d
commit 2ca2d02b22
82 files changed
+959 -174

No files matched your search

+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);