feat: support WRN imports and dynamic public shell
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user