import { Path } from '@affine-tools/utils/path'; import { execAsync } from '@affine-tools/utils/process'; import type { Package, PackageName } from '@affine-tools/utils/workspace'; import { Option, PackageCommand } from './command'; interface RunScriptOptions { includeDependencies?: boolean; waitDependencies?: boolean; ignoreIfNotFound?: boolean; } const currentDir = Path.dir(import.meta.url); const serverRuntimeLoader = currentDir .join('../register.js') .toFileUrl() .toString(); const tsxRuntimeLoader = currentDir .join('../tsx-register.js') .toFileUrl() .toString(); const ignoreLoaderScripts = [ 'vitest', 'vite', 'tsx', 'prisma', 'cap', 'tsc', 'typedoc', /^r$/, /electron(?!-)/, ]; export class RunCommand extends PackageCommand { static override paths = [[], ['run'], ['r']]; static override usage = PackageCommand.Usage({ description: 'AFFiNE Monorepo scripts', details: ` \`affine web