Files
soroush.asadi 3fc7bf2b97
Build backend images / build content-svc (push) Failing after 3m39s
Build backend images / build file-svc (push) Failing after 52s
Build backend images / build gateway (push) Failing after 58s
Build backend images / build identity-svc (push) Failing after 1m21s
Build backend images / build notification-svc (push) Failing after 1m0s
Build backend images / build render-svc (push) Failing after 58s
Build backend images / build studio-svc (push) Failing after 55s
feat: AI SEO generator, full admin panel, i18n sweep, new logo + auth/RTL fixes
AI SEO content generator
- content-svc: per-tenant OpenAI config (ai_settings) + /v1/ai endpoints
  (settings GET/PUT, seo-post) with SEO-expert prompt → structured article
- admin UI to configure token/base-url/model and generate + save as blog
- configurable base URL for restricted networks

Full data-driven admin panel
- generic /api/admin/resource proxy + reusable AdminResource component
- categories/tags/fonts/blogs (CRUD), users (list + ban), plans/slides
- AI content section; nav + i18n

i18n localization sweep
- localized 116 user-facing + studio/editor components to next-intl (fa+en)
  under the auto.* namespace; merge tooling in scripts/merge-i18n.js

Branding + assets
- Monoline F logo (LogoMark + favicon)
- offline SVG placeholder generator (/api/placeholder), dropped picsum.photos

Fixes
- JWT issuer mismatch on content/studio (flatrender → flatrender-identity)
- missing role claim → [Authorize(Roles="Admin")] now works (RBAC)
- Secure cookies broke HTTP sessions → gated behind AUTH_COOKIE_SECURE
- Radix RTL via DirectionProvider (right-aligned menus in fa)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 09:35:14 +03:30

48 lines
2.3 KiB
JavaScript

// One-off: merge workflow localization output into messages/{fa,en}.json under "auto",
// then report any auto.* namespaces referenced in src/ but missing from messages (orphans
// from failed batches that edited files without returning keys).
const fs = require("fs");
const path = require("path");
const cp = require("child_process");
const ROOT = path.resolve(__dirname, "..");
const outFile = process.argv[2];
if (!outFile) { console.error("usage: node merge-i18n.js <workflow-output-file>"); process.exit(1); }
// 1. Extract the result JSON from the workflow output file (whole file is valid JSON).
const raw = fs.readFileSync(outFile, "utf8");
const parsed = JSON.parse(raw);
const result = parsed.result || parsed;
const localized = result.localized || [];
console.log(`workflow result: localized=${localized.length} skipped=${(result.skipped||[]).length}`);
// 2. Merge into messages, preserving existing keys; create "auto" namespace.
for (const locale of ["fa", "en"]) {
const file = path.join(ROOT, "messages", `${locale}.json`);
const msg = JSON.parse(fs.readFileSync(file, "utf8"));
msg.auto = msg.auto || {};
let added = 0;
for (const item of localized) {
if (!item.pathKey) continue;
const payload = locale === "fa" ? item.fa : item.en;
if (payload && typeof payload === "object") { msg.auto[item.pathKey] = payload; added++; }
}
fs.writeFileSync(file, JSON.stringify(msg, null, 2) + "\n");
console.log(`${locale}.json: merged ${added} namespaces (auto.* total=${Object.keys(msg.auto).length})`);
}
// 3. Find auto.* namespaces referenced in src but missing from merged en.json → orphans.
const en = JSON.parse(fs.readFileSync(path.join(ROOT, "messages", "en.json"), "utf8"));
const present = new Set(Object.keys(en.auto || {}));
const grep = cp.spawnSync(
"grep",
["-rhoE", "(useTranslations|getTranslations)\\(\"auto\\.[a-zA-Z0-9]+\"", path.join(ROOT, "src")],
{ encoding: "utf8" }
);
const referenced = new Set();
for (const m of (grep.stdout || "").matchAll(/auto\.([a-zA-Z0-9]+)/g)) referenced.add(m[1]);
const orphans = [...referenced].filter((ns) => !present.has(ns));
console.log(`\nreferenced auto.* namespaces: ${referenced.size}`);
console.log(`ORPHANS (referenced but missing keys): ${orphans.length}`);
orphans.forEach((o) => console.log(" - auto." + o));