Improvements: remove dead config, fix ESM, add URL validation, unify types, add missing logging
Deploy / release (push) Skipped
Deploy / deploy (push) Successful in 1m52s

- Remove .prettierrc (dead config, Biome replaces Prettier)
- Rename lighthouserc.json to lighthouserc.cjs with module.exports for ESM compat
- Add logger.warn to empty catch blocks in auth, register, site-settings, prisma-cache, redis, security, rate-limit
- Unify ActionResult type: action-helper.ts uses 'ok' consistent with safe-action-shared.ts
- Add noUnusedLocals + noUnusedParameters to tsconfig + fix 25 pre-existing unused vars
- Replace barrel export src/types/index.ts with direct @/types/common imports
- Make trustHost conditional (development only) in auth.ts
- Add pre-flight URL validation to update-Nitrov3.sh to catch image.library.url misconfigurations
- Improve NITRO_IMAGE_LIBRARY_URL content validation in pre-flight & post-compute checks
This commit is contained in:
openhands committed 2026-07-26 20:28:11 +02:00
1 parent b922f6d49f
commit 17847545dd
292 files changed
+69195 -67915

No files matched your search

+51 -47
View File
@@ -65,13 +65,13 @@ describe("built-in theme presets", () => {
}
});
it.each([
"#22c55e",
"#ef4444",
])("derives readable text for default button %s", (background) => {
const foreground = readableColor("#ffffff", [background]);
expect(contrastRatio(foreground, background)).toBeGreaterThanOrEqual(4.5);
});
it.each(["#22c55e", "#ef4444"])(
"derives readable text for default button %s",
(background) => {
const foreground = readableColor("#ffffff", [background]);
expect(contrastRatio(foreground, background)).toBeGreaterThanOrEqual(4.5);
},
);
});
describe("readableColor", () => {
@@ -101,25 +101,26 @@ describe("readableColor", () => {
});
describe("deriveAdminPalette", () => {
it.each(
Object.entries(PRESETS),
)("keeps admin text readable for %s", (_name, preset) => {
for (const palette of [preset.light, preset.dark]) {
const admin = deriveAdminPalette(palette);
expect(contrastRatio(admin.text, admin.canvas)).toBeGreaterThanOrEqual(
4.5,
);
expect(contrastRatio(admin.text, admin.surface)).toBeGreaterThanOrEqual(
4.5,
);
expect(contrastRatio(admin.muted, admin.surface)).toBeGreaterThanOrEqual(
4.5,
);
expect(
contrastRatio(admin.accentForeground, admin.accent),
).toBeGreaterThanOrEqual(4.5);
}
});
it.each(Object.entries(PRESETS))(
"keeps admin text readable for %s",
(_name, preset) => {
for (const palette of [preset.light, preset.dark]) {
const admin = deriveAdminPalette(palette);
expect(contrastRatio(admin.text, admin.canvas)).toBeGreaterThanOrEqual(
4.5,
);
expect(contrastRatio(admin.text, admin.surface)).toBeGreaterThanOrEqual(
4.5,
);
expect(
contrastRatio(admin.muted, admin.surface),
).toBeGreaterThanOrEqual(4.5);
expect(
contrastRatio(admin.accentForeground, admin.accent),
).toBeGreaterThanOrEqual(4.5);
}
},
);
it("does not copy hostile public structural colors into admin surfaces", () => {
const admin = deriveAdminPalette({
@@ -153,9 +154,9 @@ describe("deriveAdminPalette", () => {
expect(admin.canvas).toBe("#eef1f4");
expect(admin.surface).toBe("#f5f7fa");
expect(contrastRatio(admin.text, admin.canvas)).toBeGreaterThanOrEqual(4.5);
expect(contrastRatio(admin.sidebarText, admin.sidebar)).toBeGreaterThanOrEqual(
4.5,
);
expect(
contrastRatio(admin.sidebarText, admin.sidebar),
).toBeGreaterThanOrEqual(4.5);
});
it("ignores dark admin overrides while in light mode", () => {
@@ -184,7 +185,9 @@ describe("deriveAdminPalette", () => {
},
);
expect(contrastRatio(admin.text, admin.canvas)).toBeGreaterThanOrEqual(4.5);
expect(contrastRatio(admin.text, admin.surface)).toBeGreaterThanOrEqual(4.5);
expect(contrastRatio(admin.text, admin.surface)).toBeGreaterThanOrEqual(
4.5,
);
expect(contrastRatio(admin.muted, admin.surface)).toBeGreaterThanOrEqual(
4.5,
);
@@ -249,19 +252,20 @@ describe("ensureReadableThemeColors", () => {
});
describe("derivePublicForegrounds", () => {
it.each(
Object.entries(PRESETS),
)("makes every semantic pair readable for %s", (_name, preset) => {
for (const palette of [preset.light, preset.dark]) {
const result = derivePublicForegrounds(palette);
for (const pair of result.pairs) {
expect(
contrastRatio(pair.foreground, pair.background),
pair.name,
).toBeGreaterThanOrEqual(4.5);
it.each(Object.entries(PRESETS))(
"makes every semantic pair readable for %s",
(_name, preset) => {
for (const palette of [preset.light, preset.dark]) {
const result = derivePublicForegrounds(palette);
for (const pair of result.pairs) {
expect(
contrastRatio(pair.foreground, pair.background),
pair.name,
).toBeGreaterThanOrEqual(4.5);
}
}
}
});
},
);
it("covers admin hierarchy and every semantic status", () => {
const required = [
@@ -286,11 +290,11 @@ describe("derivePublicForegrounds", () => {
(candidate) => candidate.name === name,
);
expect(pair, `missing ${name}`).toBeDefined();
const safePair = pair as NonNullable<typeof pair>;
expect(
contrastRatio(safePair.foreground, safePair.background),
name,
).toBeGreaterThanOrEqual(4.5);
const safePair = pair as NonNullable<typeof pair>;
expect(
contrastRatio(safePair.foreground, safePair.background),
name,
).toBeGreaterThanOrEqual(4.5);
}
}
}