release: WRNexusJS 0.5.10

This commit is contained in:
2026-07-30 13:36:29 +05:30
parent 8fc6f15402
commit d1b0c55b53
159 changed files with 7509 additions and 604 deletions
+20
View File
@@ -67,6 +67,26 @@ test("loadEnv layers .env files by precedence; real env always wins", () => {
}
});
test("loadAppConfig loads env before evaluating the config module", async () => {
const dir = mkdtempSync(join(tmpdir(), "wire-config-env-"));
writeFileSync(join(dir, ".env"), "DATABASE_URL=postgres://pms-from-env\n");
writeFileSync(
join(dir, "wrnexus.config.mjs"),
`export default {
db: { driver: "postgres", url: process.env.DATABASE_URL },
};`,
);
try {
delete process.env.DATABASE_URL;
const config = await loadAppConfig(dir, "development");
expect(config.db?.url).toBe("postgres://pms-from-env");
} finally {
delete process.env.DATABASE_URL;
rmSync(dir, { recursive: true, force: true });
}
});
test("package-aware styles add relative imports and Tailwind scan sources", async () => {
const root = mkdtempSync(join(tmpdir(), "wrnexus-styles-"));
try {
+12
View File
@@ -54,6 +54,17 @@ test("resolveThemeConfig merges user tokens over built-in light/dark", () => {
expect(t.themes.dark["color-bg"]).toBeDefined(); // built-in kept
});
test("built-in themes use Plus Jakarta Sans and neutral black dark surfaces", () => {
const t = resolveThemeConfig();
expect(t.themes.light["font-sans"]).toBe(
'"Plus Jakarta Sans",ui-sans-serif,system-ui,sans-serif',
);
expect(t.themes.dark["font-sans"]).toBe('"Plus Jakarta Sans",ui-sans-serif,system-ui,sans-serif');
expect(t.themes.dark["color-bg"]).toBe("#000000");
expect(t.themes.dark["color-surface"]).toBe("#0a0a0a");
expect(t.themes.dark["color-surface-2"]).toBe("#171717");
});
test("resolveThemeName validates against configured names", () => {
const t = resolveThemeConfig();
expect(resolveThemeName("light", t)).toBe("light");
@@ -71,6 +82,7 @@ test("renderThemeCss emits :root + per-theme blocks and --wire-* vars", () => {
expect(css).toContain('[data-theme="dark"]{');
expect(css).toContain("--wire-color-primary:#6c8cff");
expect(css).toContain("color-scheme:dark"); // reserved token → native property
expect(css).toContain("font-family:var(--wire-font-sans");
});
test("renderThemeRuntime bakes the theme names for cycling", () => {