import { execSync } from 'node:child_process' import * as fs from 'node:fs' import * as path from 'node:path' const WORKSPACE_YAML_PATH = path.join(process.cwd(), 'pnpm-workspace.yaml') export const LOCKFILE_PATH = path.join(process.cwd(), 'pnpm-lock.yaml') export function compareSemver(a: string, b: string): number { const pa = a.split('.').map(Number) const pb = b.split('.').map(Number) for (let i = 0; i < 3; i++) { if (pa[i] !== pb[i]) return pa[i] - pb[i] } return 0 } /** * Reinstalls from the current lockfile so node_modules matches it again after a revert. * Without this, the next `pnpm