Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat(theme): render Halloween for everyone while in season
naveenkasha5c26ff05b1d
diff --git a/.claude/rules/coding-conventions.md b/.claude/rules/coding-conventions.mdindex 0d9422d1d3..9c5c62a2f6 100644--- a/.claude/rules/coding-conventions.md+++ b/.claude/rules/coding-conventions.md@@ -224,9 +224,12 @@ variables (`--primary`, `--background`, `--foreground`, `--card`, `--popover`,`green`, `blue`, `violet`, plus seasonal ones.The choice is a `theme` cookie per browser, never a database column. Each app's-`getTheme` (`services/theme.server.ts`) reads it through `resolveTheme`, which+`getTheme` (`services/theme.server.ts`) resolves through `resolveTheme`, whichreturns the default for a name no longer in `themes`, so removing a theme-needs no migration and breaks no browser that still holds it.+needs no migration and breaks no browser that still holds it. **For now+`getTheme` ignores the cookie** and renders `halloween` for everyone while it+is in season (the default outside its window); the pickers still write the+cookie, which takes effect again once `getTheme` reads it.A seasonal theme lives in `seasonalThemes`, not `themes`, and carries an`available` window (`ThemeWindow`, month and day, inside one calendar year).diff --git a/apps/erp/app/services/theme.server.ts b/apps/erp/app/services/theme.server.tsindex e792bfb242..be28525550 100644--- a/apps/erp/app/services/theme.server.ts+++ b/apps/erp/app/services/theme.server.ts@@ -4,16 +4,17 @@import { DOMAIN, getCookieDomain } from "@carbon/auth";import type { ThemeName } from "@carbon/utils";-import { resolveTheme } from "@carbon/utils";+import { halloweenTheme, resolveTheme } from "@carbon/utils";import * as cookie from "cookie";const cookieName = "theme";-/** The theme to render: the cookie's, or the default when it names none we offer now. */-export function getTheme(request: Request): ThemeName {- const cookieHeader = request.headers.get("cookie");- const stored = cookieHeader ? cookie.parse(cookieHeader)[cookieName] : null;- return resolveTheme(stored).name;+/**+ * The theme to render: Halloween for everyone while it is in season, whatever+ * the cookie holds; the default outside its window.+ */+export function getTheme(_request: Request): ThemeName {+ return resolveTheme(halloweenTheme.name).name;}export function setTheme(theme: string) {diff --git a/apps/mes/app/services/theme.server.ts b/apps/mes/app/services/theme.server.tsindex 98b0ad1ac2..38122bcdce 100644--- a/apps/mes/app/services/theme.server.ts+++ b/apps/mes/app/services/theme.server.ts@@ -4,16 +4,17 @@import { DOMAIN, getCookieDomain } from "@carbon/auth";import type { ThemeName } from "@carbon/utils";-import { resolveTheme } from "@carbon/utils";+import { halloweenTheme, resolveTheme } from "@carbon/utils";import * as cookie from "cookie";const cookieName = "theme";-/** The theme to render: the cookie's, or the default when it names none we offer now. */-export function getTheme(request: Request): ThemeName {- const cookieHeader = request.headers.get("cookie");- const stored = cookieHeader ? cookie.parse(cookieHeader)[cookieName] : null;- return resolveTheme(stored).name;+/**+ * The theme to render: Halloween for everyone while it is in season, whatever+ * the cookie holds; the default outside its window.+ */+export function getTheme(_request: Request): ThemeName {+ return resolveTheme(halloweenTheme.name).name;}export function setTheme(theme: string) {diff --git a/apps/starter/app/services/theme.server.ts b/apps/starter/app/services/theme.server.tsindex b106f2b424..3a3f9c54ea 100644--- a/apps/starter/app/services/theme.server.ts+++ b/apps/starter/app/services/theme.server.ts@@ -3,16 +3,17 @@// including ports, remain AGPLv3; serving them over a network requires releasing their source.import type { ThemeName } from "@carbon/utils";-import { resolveTheme } from "@carbon/utils";+import { halloweenTheme, resolveTheme } from "@carbon/utils";import * as cookie from "cookie";const cookieName = "theme";-/** The theme to render: the cookie's, or the default when it names none we offer now. */-export function getTheme(request: Request): ThemeName {- const cookieHeader = request.headers.get("cookie");- const stored = cookieHeader ? cookie.parse(cookieHeader)[cookieName] : null;- return resolveTheme(stored).name;+/**+ * The theme to render: Halloween for everyone while it is in season, whatever+ * the cookie holds; the default outside its window.+ */+export function getTheme(_request: Request): ThemeName {+ return resolveTheme(halloweenTheme.name).name;}export function setTheme(theme: string) {