docs: move component reference to showcase

This commit is contained in:
2026-07-29 13:31:10 +05:30
parent 19e20408db
commit 5a75e88f73
161 changed files with 17507 additions and 37637 deletions
+17 -18
View File
@@ -60,25 +60,17 @@ test("every package page contains installation, guide, and complete API sections
}
});
test("UI components have a dedicated catalog and complete detail pages", () => {
test("UI components use the dedicated external showcase", () => {
const reference = JSON.parse(
readFileSync(join(root, "node_modules", "@wrnexus", "ui", "component-reference.json"), "utf8"),
) as { count: number; components: Array<{ name: string; props: unknown[] }> };
const catalog = readFileSync(join(root, "app", "pages", "components.wrn"), "utf8");
const details = readdirSync(join(root, "app", "pages", "components")).filter((file) =>
file.endsWith(".wrn"),
);
expect(catalog).toContain(`@wrnexus/ui · ${reference.count} components`);
expect(catalog.match(/class="component-card"/g)).toHaveLength(reference.count);
expect(details).toHaveLength(reference.count);
const button = readFileSync(join(root, "app", "pages", "components", "button.wrn"), "utf8");
expect(button).toContain("Props and attributes");
expect(button).toContain("Requirement");
expect(button).toContain("Default");
expect(button).toContain('id="usage"');
expect(button).toContain('id="source"');
expect(existsSync(join(root, "app", "pages", "components.wrn"))).toBe(false);
expect(
readdirSync(join(root, "app", "pages", "components")).filter((file) => file.endsWith(".wrn")),
).toHaveLength(0);
const uiPackage = readFileSync(join(packagePages, "ui.wrn"), "utf8");
expect(uiPackage).toContain('href="/components"');
expect(uiPackage).toContain('href="https://component.wrnexusjs.dev/"');
expect(reference.count).toBeGreaterThan(0);
expect(uiPackage).not.toContain("All 901 UI components and props");
});
@@ -88,7 +80,9 @@ test("primary navigation exposes the component catalog", () => {
join(root, "app", "pages", "getting-started.wrn"),
join(root, "app", "pages", "packages", "core.wrn"),
]) {
expect(readFileSync(file, "utf8")).toContain('<a href="/components">Components</a>');
expect(readFileSync(file, "utf8")).toContain(
'<a href="https://component.wrnexusjs.dev/">Components</a>',
);
}
});
@@ -152,9 +146,14 @@ test("portal exposes truthful access and machine discovery", () => {
const llms = readFileSync(join(root, "public", "llms.txt"), "utf8");
expect(llms).toContain(`# WRNexusJS documentation ${frameworkVersion}`);
expect(llms).toContain("# Installed package documentation");
expect(llms).toContain("## @wrnexus/helpers");
expect(llms).toContain("# Installed package index");
expect(llms).toContain("- @wrnexus/helpers");
expect(llms).toContain("redirectToLogin");
expect(llms).toContain("https://component.wrnexusjs.dev/");
const llmsFull = readFileSync(join(root, "public", "llms-full.txt"), "utf8");
expect(llmsFull).toContain("# Installed package documentation");
expect(llmsFull).toContain("# Complete @wrnexus/ui component reference and source contracts");
expect(llmsFull).toContain("### Complete .wrn source contract");
});
test("workspace guide documents app addition and safe forward-auth redirects", () => {