diff options
| author | 2023-11-03 21:25:40 +0800 | |
|---|---|---|
| committer | 2023-11-03 21:25:40 +0800 | |
| commit | 9029588590bea8b10451575c5142dcde77ecd1b5 (patch) | |
| tree | 04cf8aee56c23fd225ff19d340f7cee621d874ef /packages/turbo-codemod/src/cli.ts | |
| parent | 94071d7ce16c56641d67d488e2bac6be84ffe731 (diff) | |
| download | HydroRoll-9029588590bea8b10451575c5142dcde77ecd1b5.tar.gz HydroRoll-9029588590bea8b10451575c5142dcde77ecd1b5.zip | |
chore: delete useless files
Diffstat (limited to 'packages/turbo-codemod/src/cli.ts')
| -rw-r--r-- | packages/turbo-codemod/src/cli.ts | 73 |
1 files changed, 0 insertions, 73 deletions
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 <version>", - "Specify the version to migrate from (default: current version)" - ) - .option( - "--to <version>", - "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); - }); |
