Initialize the session-viewer project — a tool for browsing, filtering, redacting, and exporting Claude Code session logs as self-contained HTML. Scaffolding includes: - package.json with Express server + React client dual-stack setup, dev/build/test/lint/typecheck scripts, and a CLI bin entry point - TypeScript configs: base tsconfig.json (ESNext, bundler resolution, strict, react-jsx) and tsconfig.server.json extending it for the Express server compilation target - Vite config: React plugin, Tailscale-aware dev server on :3847 with API proxy to :3848, client build output to dist/client - Vitest config: node environment, test discovery from tests/unit and src/client/components - ESLint flat config: typescript-eslint recommended, unused-vars with underscore exception - Tailwind CSS config scoped to src/client, PostCSS with autoprefixer - Playwright config: Chromium-only E2E against dev server - bin/session-viewer.js: CLI entry point that re-execs via tsx with browser-open flag Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
650 B
JavaScript
25 lines
650 B
JavaScript
#!/usr/bin/env node
|
|
|
|
// This bin script needs tsx to run TypeScript source directly.
|
|
// Use --import to register the tsx loader before importing our TS entry.
|
|
import { execFileSync } from "child_process";
|
|
import { fileURLToPath } from "url";
|
|
import path from "path";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const entryPoint = path.resolve(__dirname, "../src/server/index.ts");
|
|
|
|
// Re-exec with tsx if not already running under it
|
|
try {
|
|
execFileSync(
|
|
"npx",
|
|
["tsx", entryPoint],
|
|
{
|
|
stdio: "inherit",
|
|
env: { ...process.env, SESSION_VIEWER_OPEN_BROWSER: "1" },
|
|
}
|
|
);
|
|
} catch {
|
|
process.exit(1);
|
|
}
|