import { Command } from "commander"; import { genComponent } from "./commands/genComponent"; import { wrapComponent } from "./commands/wrapComponent"; import { swapComponent } from "./commands/swapComponent"; import { init } from "./commands/init"; import { initApp } from "./commands/initApp"; import { updateBundleId } from "./commands/updateBundleId"; import { customizeComponent } from "./commands/customizeComponent"; const program = new Command(); program .command("gen ") .description("generate a react component") .option( "--pwd ", "Which directory is the project root, normally use for testing" ) .action(genComponent); program .command("wrap ") .description("wrap a react component into a directory") .option( "-i, --ignore", "with a gitignore file to ignore package.json and a default package.json point to index.js" ) .action(wrapComponent); program .command("swap [srcDstPair...]") .description("swap React components using package.json") .action(swapComponent); program .command("custom ") .description("create a customized version for src component") .option( "--dst ", "Which directory is the project root, normally use for testing" ) .action(customizeComponent); program .command("init ") .description("initialize a new gatsby project") .action(init); program .command("initApp ") .description("initialize a new react-native project") .action(initApp); program .command("updateBundleId ") .description( "update bundleId (packageName for Android) for your react native app" ) .option( "--pwd ", "Which directory is the project root, normally use for testing" ) .action(updateBundleId); program.parse();