{"version":3,"sources":["jsdelivr-header.js","/npm/react-native-help-create@2.7.0/bin/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;ACJA,MAAM,MAAQ,QAAQ,UAChB,gBACJ,gBAAe,iBACf,iBAAgB,iBAChB,iBAAgB,aAChB,aAAY,aACZ,aAAY,cACZ,cAAa,aACb,cACE,QAAQ,aACN,iBACJ,iBAAgB,cAChB,cAAa,iBACb,iBAAgB,eAChB,eAAc,cACd,cAAa,iBACb,iBAAgB,aAChB,cACE,QAAQ,aACN,kBAAE,kBAAiB,eAAE,gBAAmB,QAAQ,cAChD,WAAE,WAAU,YAAE,YAAW,gBAAE,iBAAoB,QAAQ,WAE7D,MACG,WAAW,QACX,MAAM,yBACN,QACC,gBACA,oEACC,IACC,EACG,WAAW,KAAM,CAChB,MAAO,cACP,KAAM,SACN,SAAU,yBAEX,MAAM,MACN,WAAW,KAAM,CAChB,MAAO,WACP,KAAM,SACN,SAAU,sBAEX,MAAM,MACN,WAAW,KAAM,CAChB,MAAO,UACP,KAAM,UACN,SAAU,yCAEX,WAAW,YAAa,CACvB,KAAM,SACN,SAAU,2CAEX,MAAM,aACN,WAAW,WAAY,CACtB,KAAM,SACN,SAAU,0CAEX,MAAM,YACN,WAAW,KAAM,CAChB,MAAO,eACP,KAAM,SACN,SAAU,8CAEX,MAAM,MACN,WAAW,WAAY,CACtB,KAAM,UACN,SAAU,0BAEX,OAAO,KAAM,CACZ,MAAO,aACP,SAAU,yCAEX,OAAO,IAAK,CACX,MAAO,SACP,KAAM,SACN,QAAS,GACT,SAAU,uCAEX,OAAO,IAAK,CACX,MAAO,WACP,KAAM,SACN,QAAS,GACT,SAAU,6CAEX,OAAO,IAAK,CACX,MAAO,YACP,KAAM,UACN,SAAS,EACT,SAAU,oCAEX,OAAO,OAAQ,CACd,KAAM,UACN,SAAS,EACT,SAAU,mCAEX,OAAO,WAAY,CAClB,KAAM,UACN,SAAS,EACT,SAAU,uCAEX,OAAO,WAA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KAAM,UACN,SAAU,6BAEX,OACA,SACA,oBAAoB","file":"/npm/react-native-help-create@2.7.0/bin/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-native-help-create@2.7.0/bin/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n\nconst yargs = require(\"yargs\");\nconst {\n  createComponent,\n  createNavigation,\n  createReduxStore,\n  createScreen,\n  createConfig,\n  createReducer,\n  createAction,\n} = require(\"./create\");\nconst {\n  deleteComponents,\n  deleteScreens,\n  deleteReduxStore,\n  deleteReducers,\n  deleteActions,\n  deleteNavigation,\n  deleteConfig,\n} = require(\"./delete\");\nconst { combineComponents, combineScreens } = require(\"./combine\");\nconst { loadConfig, rootChecker, languageChecker } = require(\"./utils\");\n\nyargs\n  .scriptName(\"rnhc\")\n  .usage(\"$0 <command> [option]\")\n  .command(\n    \"create [name]\",\n    \"Create components, screens, navigations and redux implementation\",\n    (yargs) => {\n      yargs\n        .positional(\"-c\", {\n          alias: \"--component\",\n          type: \"string\",\n          describe: \"To create components\",\n        })\n        .array(\"-c\")\n        .positional(\"-s\", {\n          alias: \"--screen\",\n          type: \"string\",\n          describe: \"To create screens\",\n        })\n        .array(\"-s\")\n        .positional(\"-r\", {\n          alias: \"--redux\",\n          type: \"boolean\",\n          describe: \"To create redux store implementation\",\n        })\n        .positional(\"--reducer\", {\n          type: \"string\",\n          describe: \"To create redux reducer implementation\",\n        })\n        .array(\"--reducer\")\n        .positional(\"--action\", {\n          type: \"string\",\n          describe: \"To create redux action implementation\",\n        })\n        .array(\"--action\")\n        .positional(\"-n\", {\n          alias: \"--navigation\",\n          type: \"string\",\n          describe: \"To create navigation for selected screens\",\n        })\n        .array(\"-n\")\n        .positional(\"--config\", {\n          type: \"boolean\",\n          describe: \"to create config file\",\n        })\n        .option(\"ts\", {\n          alias: \"typescript\",\n          describe: \"To force writing files in typescript\",\n        })\n        .option(\"f\", {\n          alias: \"folder\",\n          type: \"string\",\n          default: \"\",\n          describe: \"Folder path to create files within\",\n        })\n        .option(\"t\", {\n          alias: \"template\",\n          type: \"string\",\n          default: \"\",\n          describe: \"Template to be used to create files with\",\n        })\n        .option(\"o\", {\n          alias: \"overwrite\",\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to overwrite created files\",\n        })\n        .option(\"atom\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to create atom components\",\n        })\n        .option(\"molecule\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to create molecule components\",\n        })\n        .option(\"organism\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to create organism components\",\n        });\n    },\n    (argv) => {\n      let {\n        component,\n        screen,\n        redux,\n        reducer,\n        action,\n        navigation,\n        config,\n        ts,\n        folder,\n        template,\n        overwrite,\n        silent,\n        atom,\n        molecule,\n        organism,\n      } = argv;\n      // check if project is written in typescript\n      ts = languageChecker() === \"ts\" ? true : ts;\n      if (component) {\n        component.forEach((c) =>\n          createComponent(\n            c,\n            ts,\n            folder,\n            template,\n            overwrite,\n            silent,\n            atom,\n            molecule,\n            organism\n          )\n        );\n      } else if (screen) {\n        screen.forEach((s) =>\n          createScreen(s, ts, folder, template, overwrite, silent)\n        );\n      } else if (redux) {\n        createReduxStore(ts, overwrite, silent);\n      } else if (reducer) {\n        reducer.forEach((r) => {\n          createReducer(r, ts, overwrite, silent);\n        });\n      } else if (action) {\n        createAction(action, ts, overwrite, silent);\n      } else if (navigation) {\n        createNavigation(navigation, ts, folder, overwrite, silent);\n      } else if (config) {\n        createConfig(overwrite, silent);\n      } else {\n        !silent && console.log(\"Check usage: rnhc create --help\");\n      }\n    }\n  )\n  .command(\n    \"delete [name]\",\n    \"Delete components, screens, navigations and redux implementation\",\n    (yargs) => {\n      yargs\n        .positional(\"-c\", {\n          alias: \"--component\",\n          type: \"string\",\n          describe: \"To delete components\",\n        })\n        .array(\"-c\")\n        .positional(\"-s\", {\n          alias: \"--screen\",\n          type: \"string\",\n          describe: \"To delete screens\",\n        })\n        .array(\"-s\")\n        .positional(\"-r\", {\n          alias: \"--redux\",\n          type: \"boolean\",\n          describe: \"To delete redux implementation\",\n        })\n        .positional(\"--reducer\", {\n          type: \"string\",\n          describe: \"To delete redux reducer implementation\",\n        })\n        .array(\"--reducer\")\n        .positional(\"--action\", {\n          type: \"string\",\n          describe: \"To delete redux action implementation\",\n        })\n        .array(\"--action\")\n        .positional(\"-n\", {\n          alias: \"--navigation\",\n          type: \"boolean\",\n          describe: \"To delete navigations\",\n        })\n        .positional(\"--config\", {\n          type: \"boolean\",\n          describe: \"to delete config file\",\n        })\n        .option(\"f\", {\n          alias: \"folder\",\n          type: \"string\",\n          default: \"\",\n          describe: \"Folder path to delete files or folders within\",\n        })\n        .option(\"atom\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to delete atom components\",\n        })\n        .option(\"molecule\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to delete molecule components\",\n        })\n        .option(\"organism\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to delete organism components\",\n        });\n    },\n    (argv) => {\n      const {\n        component,\n        screen,\n        redux,\n        reducer,\n        action,\n        navigation,\n        config,\n        folder,\n        silent,\n        atom,\n        molecule,\n        organism,\n      } = argv;\n      if (component) {\n        deleteComponents(component, folder, silent, atom, molecule, organism);\n      } else if (screen) {\n        deleteScreens(screen, folder, silent);\n      } else if (redux) {\n        deleteReduxStore(silent);\n      } else if (reducer) {\n        deleteReducers(reducer, languageChecker() === \"ts\", silent);\n      } else if (action) {\n        deleteActions(action, languageChecker() === \"ts\", silent);\n      } else if (navigation) {\n        deleteNavigation(folder, silent);\n      } else if (config) {\n        deleteConfig(silent);\n      } else {\n        !silent && console.log(\"Check usage: rnhc delete --help\");\n      }\n    }\n  )\n  .command(\n    \"combine [name]\",\n    \"Combine components or screens in a folder\",\n    (yargs) => {\n      yargs\n        .positional(\"-c\", {\n          alias: \"--component\",\n          type: \"string\",\n          array: true,\n          describe: \"To combine components in a folder\",\n        })\n        .array(\"-c\")\n        .positional(\"-s\", {\n          alias: \"--screen\",\n          type: \"string\",\n          array: true,\n          describe: \"To combine pages in a folder\",\n        })\n        .array(\"-s\")\n        .option(\"f\", {\n          alias: \"folder\",\n          type: \"string\",\n          describe: \"Folder path to combine components or screens\",\n          demandOption: \"This option is mandatory\" | true,\n        })\n        .option(\"atom\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to combine atom components\",\n        })\n        .option(\"molecule\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to combine molecule components\",\n        })\n        .option(\"organism\", {\n          type: \"boolean\",\n          default: false,\n          describe: \"Used to combine organism components\",\n        });\n    },\n    (argv) => {\n      const { component, screen, folder, silent, atom, molecule, organism } =\n        argv;\n      if (component) {\n        if (component.length > 1) {\n          combineComponents(\n            component,\n            folder,\n            silent,\n            atom,\n            molecule,\n            organism\n          );\n        } else {\n          !silent && console.log(\"At least give 2 components\");\n        }\n      } else if (screen) {\n        combineScreens(screen, folder, silent);\n      } else {\n        !silent && console.log(\"Check usage: rnhc combine --help\");\n      }\n    }\n  )\n  .middleware((argv) => {\n    const { silent } = argv;\n    if (rootChecker()) {\n      try {\n        loadConfig();\n      } catch {}\n    } else {\n      !silent &&\n        console.log(\n          \"You don't seem to be at the root of a react native project\"\n        );\n      process.exit(1);\n    }\n  })\n  .option(\"silent\", {\n    type: \"boolean\",\n    describe: \"Do not show log messages\",\n  })\n  .help()\n  .strict()\n  .recommendCommands().argv;\n"]}