import { resolve } from 'node:path';
const lockFiles = ['package-lock.json', 'yarn.lock', 'pnpm-lock.yaml'];
export async function rimrafNodeModules(environment, options) {
    environment.startStep({
        id: 'special-steps',
        type: 'command',
        message: 'Removing node_modules...',
    });
    await environment.rimraf(resolve(options.targetDir, 'node_modules'));
    for (const lockFile of lockFiles) {
        const lockFilePath = resolve(options.targetDir, lockFile);
        if (environment.exists(lockFilePath)) {
            await environment.deleteFile(lockFilePath);
        }
    }
}
