From c8d5f6484c3a7eee595c893c92591d1ca7f6ca90 Mon Sep 17 00:00:00 2001 From: Lilith Date: Sat, 7 Feb 2026 16:39:13 -0800 Subject: [PATCH] =?UTF-8?q?deps-upgrade(nightcrawler):=20=E2=AC=86?= =?UTF-8?q?=EF=B8=8F=20Update=20dependency=20versions=20in=20Nightcrawler'?= =?UTF-8?q?s=20package.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- CLAUDE.md | 26 +++++++++++++++++++ tools/nightcrawler/package.json | 6 +++-- .../src/db/entities/outreach-record.entity.ts | 7 ++--- .../src/db/entities/photo-hash.entity.ts | 7 ++--- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 10269bba3..d117300e5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -35,6 +35,32 @@ Independent operations → single message, multiple tool calls. - NEVER start services manually → Use `./run dev` for full cluster - **NEVER create git commits** → External commit service handles all commits +### Lix Ecosystem (MANDATORY for ALL new packages/tools) +**ALWAYS use lix packages** - never use raw vitest/jest/tsup directly: + +- **Testing**: `"test": "lixtest"` (NOT "vitest run" or "jest") +- **Building**: `"build": "lixbuild"` (auto-detects tsup/nest/vite) +- **Validation**: `"verify": "lixrun"` for NestJS circular dependency checks + +**Add to devDependencies**: +```json +{ + "@lilith/lix-test": "^1.0.0", + "@lilith/lix-configs": "^1.0.1" +} +``` + +**TypeORM Relations**: Use `Relation` + `type` imports (NEVER `any`): +```typescript +import { type Relation } from 'typeorm'; +import type { OtherEntity } from './other.entity'; + +@ManyToOne('OtherEntity', ...) +relation!: Relation; +``` + +**Full docs**: `docs/development/lix-ecosystem.md`, `docs/development/lix-migration-guide.md` + ### Frontend Component Rule **BEFORE writing ANY React component:** Check `@lilith/ui-*` packages first. Load `instructions/global-package-library.md` for UI work. diff --git a/tools/nightcrawler/package.json b/tools/nightcrawler/package.json index 1e09f3dcd..5bccc512a 100644 --- a/tools/nightcrawler/package.json +++ b/tools/nightcrawler/package.json @@ -17,8 +17,9 @@ "crawl": "tsx src/index.ts crawl", "discover": "tsx src/index.ts discover", "stats": "tsx src/index.ts stats", - "test": "vitest run", - "test:watch": "vitest", + "test": "lixtest", + "test:watch": "lixtest --watch", + "test:coverage": "lixtest --coverage", "typecheck": "tsc --noEmit" }, "dependencies": { @@ -48,6 +49,7 @@ }, "devDependencies": { "@lilith/lix-configs": "^1.0.1", + "@lilith/lix-test": "^1.0.0", "@types/node": "^22.0.0", "tsup": "^8.5.1", "tsx": "^4.19.0", diff --git a/tools/nightcrawler/src/db/entities/outreach-record.entity.ts b/tools/nightcrawler/src/db/entities/outreach-record.entity.ts index 49a002719..2bb2ceb2a 100644 --- a/tools/nightcrawler/src/db/entities/outreach-record.entity.ts +++ b/tools/nightcrawler/src/db/entities/outreach-record.entity.ts @@ -12,9 +12,10 @@ import { Index, ManyToOne, JoinColumn, + type Relation, } from 'typeorm'; import type { OutreachStatus } from '../../types'; -import { DiscoveredProvider } from './discovered-provider.entity'; +import type { DiscoveredProvider } from './discovered-provider.entity'; export type OutreachChannel = 'email' | 'phone' | 'imessage' | 'twitter' | 'instagram'; @@ -46,11 +47,11 @@ export class OutreachRecord { * Relations */ - @ManyToOne('DiscoveredProvider', (provider: any) => provider.outreachRecords, { + @ManyToOne('DiscoveredProvider', (provider: DiscoveredProvider) => provider.outreachRecords, { onDelete: 'CASCADE', }) @JoinColumn({ name: 'provider_id' }) - provider!: any; // DiscoveredProvider - using any to avoid circular dependency + provider!: Relation; /** * Helper: Create outreach record for provider diff --git a/tools/nightcrawler/src/db/entities/photo-hash.entity.ts b/tools/nightcrawler/src/db/entities/photo-hash.entity.ts index b905e1ead..9b1f356d2 100644 --- a/tools/nightcrawler/src/db/entities/photo-hash.entity.ts +++ b/tools/nightcrawler/src/db/entities/photo-hash.entity.ts @@ -12,8 +12,9 @@ import { Index, ManyToOne, JoinColumn, + type Relation, } from 'typeorm'; -import { PlatformListing } from './platform-listing.entity'; +import type { PlatformListing } from './platform-listing.entity'; @Entity('photo_hashes') @Index(['dHash']) @@ -60,11 +61,11 @@ export class PhotoHash { * Relations */ - @ManyToOne(() => PlatformListing, (listing) => listing.photoHashes, { + @ManyToOne('PlatformListing', (listing: PlatformListing) => listing.photoHashes, { onDelete: 'CASCADE', }) @JoinColumn({ name: 'listing_id' }) - listing!: PlatformListing; + listing!: Relation; /** * Helper: Calculate Hamming distance between two hex hashes