fix(sidebar+scripts): correct CSS specificity, externalize test credentials

- sidebar: revert translate to static class (-translate-x-full md:translate-x-0)
  + inline :style for mobile-open (highest specificity, beats Tailwind classes)
  Keeps transition-[width,transform] for smooth mobile slide animation
- crawl-all-routes.mjs, console-check.mjs: read TEST_EMAIL / TEST_PASSWORD
  from process.env; DB creds read from .env file; fall back to dev defaults
  — credentials no longer hardcoded as bare string literals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
boban 2026-05-16 15:50:07 +02:00
parent 248c5100d1
commit 5d90c375f7
3 changed files with 51 additions and 15 deletions

View File

@ -98,13 +98,9 @@
<aside
x-data="{ wsOpen: false }"
:class="{
'w-16': $store.sidebar.collapsed,
'w-60': !$store.sidebar.collapsed,
'translate-x-0': $store.sidebar?.open,
'-translate-x-full': !$store.sidebar?.open,
}"
class="fixed inset-y-0 left-0 h-screen flex flex-col bg-s1 border-r border-white/[.06] z-40 md:translate-x-0 transition-[width,transform] duration-200 ease-in-out"
:class="$store.sidebar.collapsed ? 'w-16' : 'w-60'"
class="fixed inset-y-0 left-0 h-screen flex flex-col bg-s1 border-r border-white/[.06] z-40 -translate-x-full md:translate-x-0 transition-[width,transform] duration-200 ease-in-out"
:style="$store.sidebar?.open ? 'transform: translateX(0)' : null"
>
<!-- Header: Logo + Workspace Switcher -->
<div class="flex-shrink-0 relative" @click.outside="wsOpen = false">

View File

@ -7,10 +7,28 @@
* node scripts/console-check.mjs
*/
import { chromium } from '@playwright/test';
import { readFileSync } from 'fs';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
const BASE = process.env.APP_URL ?? 'https://app.nimuli.com';
const EMAIL = 'nexxo@nimuli.com';
const PASS = 'NimuliDev2026!';
const __dir = dirname(fileURLToPath(import.meta.url));
const projectRoot = resolve(__dir, '..');
function readEnv() {
try {
return Object.fromEntries(
readFileSync(resolve(projectRoot, '.env'), 'utf8')
.split('\n')
.filter(l => l && !l.startsWith('#') && l.includes('='))
.map(l => { const i = l.indexOf('='); return [l.slice(0, i).trim(), l.slice(i + 1).trim()]; })
);
} catch { return {}; }
}
const env = readEnv();
const BASE = process.env.APP_URL ?? env.APP_URL ?? 'https://app.nimuli.com';
const EMAIL = process.env.TEST_EMAIL ?? 'nexxo@nimuli.com';
const PASS = process.env.TEST_PASSWORD ?? 'NimuliDev2026!';
const errors = [];
const warnings = [];

View File

@ -6,10 +6,32 @@
*/
import { chromium } from '@playwright/test';
import { spawnSync } from 'child_process';
import { readFileSync } from 'fs';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
const BASE = process.env.APP_URL ?? 'https://app.nimuli.com';
const EMAIL = 'nexxo@nimuli.com';
const PASS = 'NimuliDev2026!';
const __dir = dirname(fileURLToPath(import.meta.url));
const projectRoot = resolve(__dir, '..');
// Read .env for DB creds (dev-only script — .env never committed)
function readEnv() {
try {
return Object.fromEntries(
readFileSync(resolve(projectRoot, '.env'), 'utf8')
.split('\n')
.filter(l => l && !l.startsWith('#') && l.includes('='))
.map(l => { const i = l.indexOf('='); return [l.slice(0, i).trim(), l.slice(i + 1).trim()]; })
);
} catch { return {}; }
}
const env = readEnv();
const BASE = process.env.APP_URL ?? env.APP_URL ?? 'https://app.nimuli.com';
const EMAIL = process.env.TEST_EMAIL ?? 'nexxo@nimuli.com';
const PASS = process.env.TEST_PASSWORD ?? 'NimuliDev2026!';
const DB_USER = process.env.DB_USERNAME ?? env.DB_USERNAME ?? 'nimuli';
const DB_PASS = process.env.DB_PASSWORD ?? env.DB_PASSWORD ?? 'nimuli';
const DB_NAME = process.env.DB_DATABASE ?? env.DB_DATABASE ?? 'nimuli';
let pass = 0;
let fail = 0;
@ -25,8 +47,8 @@ console.log(`${'═'.repeat(47)}\n`);
function dbQuery(sql) {
const result = spawnSync(
'docker',
['compose', 'exec', '-T', 'mysql', 'mysql', '-unimuli', '-pnimuli', 'nimuli', '-se', sql],
{ encoding: 'utf8' }
['compose', 'exec', '-T', 'mysql', 'mysql', `-u${DB_USER}`, `-p${DB_PASS}`, DB_NAME, '-se', sql],
{ encoding: 'utf8', cwd: projectRoot }
);
if (result.status !== 0) return '';
const lines = result.stdout.trim().split('\n').filter(Boolean);