From 9029588590bea8b10451575c5142dcde77ecd1b5 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 3 Nov 2023 21:25:40 +0800 Subject: chore: delete useless files --- packages/turbo-codemod/src/cli.ts | 73 --------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 packages/turbo-codemod/src/cli.ts (limited to 'packages/turbo-codemod/src/cli.ts') diff --git a/packages/turbo-codemod/src/cli.ts b/packages/turbo-codemod/src/cli.ts deleted file mode 100644 index 451816f..0000000 --- a/packages/turbo-codemod/src/cli.ts +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env node - -import chalk from "chalk"; -import { Command } from "commander"; - -import { transform, migrate } from "./commands"; -import notifyUpdate from "./utils/notifyUpdate"; -import cliPkg from "../package.json"; - -const codemodCli = new Command(); - -codemodCli - .name("@turbo/codemod") - .description( - "Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated." - ) - .version(cliPkg.version, "-v, --version", "output the current version"); - -// migrate -codemodCli - .command("migrate") - .aliases(["update", "upgrade"]) - .description("Migrate a project to the latest version of Turborepo") - .argument("[path]", "Directory where the transforms should be applied") - .option( - "--from ", - "Specify the version to migrate from (default: current version)" - ) - .option( - "--to ", - "Specify the version to migrate to (default: latest)" - ) - .option("--install", "Install new version of turbo after migration", true) - .option( - "--force", - "Bypass Git safety checks and forcibly run codemods", - false - ) - .option("--dry", "Dry run (no changes are made to files)", false) - .option("--print", "Print transformed files to your terminal", false) - .action(migrate); - -// transform -codemodCli - .command("transform", { isDefault: true }) - .description("Apply a single code transformation to a project") - .argument("[transform]", "The transformer to run") - .argument("[path]", "Directory where the transforms should be applied") - .option( - "--force", - "Bypass Git safety checks and forcibly run codemods", - false - ) - .option("--list", "List all available transforms", false) - .option("--dry", "Dry run (no changes are made to files)", false) - .option("--print", "Print transformed files to your terminal", false) - .action(transform); - -codemodCli - .parseAsync() - .then(notifyUpdate) - .catch(async (reason) => { - console.log(); - if (reason.command) { - console.log(` ${chalk.cyan(reason.command)} has failed.`); - } else { - console.log(chalk.red("Unexpected error. Please report it as a bug:")); - console.log(reason); - } - console.log(); - await notifyUpdate(); - process.exit(1); - }); -- cgit v1.2.3-70-g09d2