feat(p1): complete P1 foundation stage
- monorepo: pnpm workspace + go.work + pyproject.toml + commitlint/husky - infra: docker-compose (minimal + full profiles) + init-sql + prometheus - arch-scan: multi-language scanner skeleton (TS/Go/Python/Proto) - shared-proto: buf v2 + classes.proto (ClassService CRUD contract) - api-gateway: Go/Gin + JWT HS256 auth + reverse proxy + request ID - classes: NestJS golden template (error system + observability + middleware + CRUD + tests) - teacher-portal: Next.js + paper-feel UI design system - CI/CD: 4 workflows (go/ts/py/proto) - docs: migration guide + project_rules + coding-standards + git-workflow + ui-design-system + 004 + 9 module READMEs + known-issues + spec/plan migration + roadmap
This commit is contained in:
33
scripts/arch-scan/scanner.ts
Normal file
33
scripts/arch-scan/scanner.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env tsx
|
||||
import { createDb } from './schema.js';
|
||||
import { scanTypeScript } from './scanners/ts-scanner.js';
|
||||
import { scanGo } from './scanners/go-scanner.js';
|
||||
import { scanPython } from './scanners/py-scanner.js';
|
||||
import { scanProtobuf } from './scanners/proto-scanner.js';
|
||||
import path from 'node:path';
|
||||
|
||||
const ROOT = process.cwd();
|
||||
|
||||
function main(): void {
|
||||
const db = createDb(path.join(ROOT, 'arch.db'));
|
||||
|
||||
console.log('🔍 arch-scan: 开始多语言扫描...');
|
||||
|
||||
// 串行扫描(并行会导致 FOREIGN KEY 错误)
|
||||
const tsStats = scanTypeScript(db, ROOT);
|
||||
console.log(` TypeScript: ${tsStats.modules} 模块, ${tsStats.symbols} 符号`);
|
||||
|
||||
const goStats = scanGo(db, ROOT);
|
||||
console.log(` Go: ${goStats.modules} 模块, ${goStats.symbols} 符号`);
|
||||
|
||||
const pyStats = scanPython(db, ROOT);
|
||||
console.log(` Python: ${pyStats.modules} 模块, ${pyStats.symbols} 符号`);
|
||||
|
||||
const protoStats = scanProtobuf(db, ROOT);
|
||||
console.log(` Protobuf: ${protoStats.contracts} 契约`);
|
||||
|
||||
console.log('✅ arch-scan 完成');
|
||||
db.close();
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user