d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
78 lines
2.5 KiB
TypeScript
78 lines
2.5 KiB
TypeScript
#!/usr/bin/env bun
|
|
import { readdir, readFile } from 'node:fs/promises'
|
|
import path from 'node:path'
|
|
|
|
const ROOT = path.resolve(import.meta.dir, '..')
|
|
const PACKAGES_DIR = path.join(ROOT, 'packages')
|
|
|
|
const FORBIDDEN_PATTERNS: Array<{ pattern: RegExp; description: string }> = [
|
|
{ pattern: /from\s+['"]@\/(?!\*)/g, description: "'@/' path alias (apps/sim-only)" },
|
|
{ pattern: /from\s+['"]\.\.\/\.\.\/apps\//g, description: 'relative import into apps/' },
|
|
{ pattern: /from\s+['"]apps\//g, description: "bare 'apps/' import" },
|
|
]
|
|
|
|
const SKIP_DIRS = new Set(['node_modules', 'dist', '.next', '.turbo', 'coverage'])
|
|
|
|
async function walk(dir: string, results: string[] = []): Promise<string[]> {
|
|
const entries = await readdir(dir, { withFileTypes: true })
|
|
for (const entry of entries) {
|
|
if (SKIP_DIRS.has(entry.name)) continue
|
|
const full = path.join(dir, entry.name)
|
|
if (entry.isDirectory()) {
|
|
await walk(full, results)
|
|
} else if (/\.(ts|tsx|mts|cts|js|jsx|mjs|cjs)$/.test(entry.name)) {
|
|
results.push(full)
|
|
}
|
|
}
|
|
return results
|
|
}
|
|
|
|
async function main() {
|
|
const packagesEntries = await readdir(PACKAGES_DIR, { withFileTypes: true })
|
|
const packageDirs = packagesEntries
|
|
.filter((entry) => entry.isDirectory())
|
|
.map((entry) => path.join(PACKAGES_DIR, entry.name))
|
|
|
|
const offenders: Array<{ file: string; line: number; description: string; snippet: string }> = []
|
|
|
|
for (const dir of packageDirs) {
|
|
const files = await walk(dir)
|
|
for (const file of files) {
|
|
const content = await readFile(file, 'utf8')
|
|
const lines = content.split('\n')
|
|
for (let i = 0; i < lines.length; i++) {
|
|
const line = lines[i]
|
|
for (const { pattern, description } of FORBIDDEN_PATTERNS) {
|
|
pattern.lastIndex = 0
|
|
if (pattern.test(line)) {
|
|
offenders.push({
|
|
file: path.relative(ROOT, file),
|
|
line: i + 1,
|
|
description,
|
|
snippet: line.trim(),
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (offenders.length === 0) {
|
|
console.log('✅ Monorepo boundaries OK: no package imports from apps/*')
|
|
return
|
|
}
|
|
|
|
console.error('❌ Monorepo boundary violations found:')
|
|
for (const offender of offenders) {
|
|
console.error(
|
|
` ${offender.file}:${offender.line} — ${offender.description}\n ${offender.snippet}`
|
|
)
|
|
}
|
|
process.exit(1)
|
|
}
|
|
|
|
void main().catch((error) => {
|
|
console.error('Monorepo boundary check failed:', error)
|
|
process.exit(1)
|
|
})
|