Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

762 B
Raw Blame
import { execSync } from 'node:child_process'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'

function packagesDefiningTest(): string[] {
    const listed = execSync('npx turbo ls --filter=!api --output=json', { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'] })
    const { packages }: { packages: { items: { name: string, path: string }[] } } = JSON.parse(listed)
    return packages.items
        .filter(({ path }) => {
            const { scripts }: { scripts?: Record<string, string> } = JSON.parse(readFileSync(join(path, 'package.json'), 'utf-8'))
            return scripts?.test !== undefined
        })
        .map(({ name }) => name)
}

console.log(packagesDefiningTest().map((name) => `--filter=${name}`).join(' '))