/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/typescript-assistant@0.74.0/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
#!/usr/bin/env node
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const semver_1=require("semver"),yargsModule=require("yargs"),assist_1=require("./commands/assist"),ci_1=require("./commands/ci"),clean_1=require("./commands/clean"),fix_1=require("./commands/fix"),fix_all_1=require("./commands/fix-all"),init_1=require("./commands/init"),lint_1=require("./commands/lint"),post_checkout_1=require("./commands/post-checkout"),post_merge_1=require("./commands/post-merge"),pre_commit_1=require("./commands/pre-commit"),pre_push_1=require("./commands/pre-push"),dependency_injector_1=require("./dependency-injector");(0,semver_1.gte)("v12.0.0",process.version)&&(console.error("Please update your version of Node."),process.exit(1));let inject=(0,dependency_injector_1.createDependencyInjector)(),onSuccess=()=>{process.exit(0)},onFailure=e=>{console.error(e),process.exit(1)},failIfUnsuccessful=e=>{e||process.exit(1)};yargsModule.command(["assist","*"],"Watches for file changes and outputs current errors and violations",{port:{describe:"the port to have the status server listen on"},format:{describe:"check formatting during assist",default:!0,boolean:!0},coverage:{describe:"run tests with coverage",boolean:!0,default:!0},project:{describe:"provide tsconfigs to watch",string:!0,type:"array"},testConfig:{describe:"path to nyc config file",string:!0},testsGlob:{describe:"glob for test files",string:!0}},(e=>{0===e._.length||1===e._.length&&"assist"===e._[0]?inject(assist_1.createAssistCommand).execute({statusServerPort:parseInt(e.port,10)||0,format:e.format,coverage:e.coverage,projects:e.project,testConfig:e.testConfig,testsGlob:e.testsGlob}):(console.error("Unknown command"),process.exit(1))})),yargsModule.command(["lint"],"Lints",{},(e=>{inject(lint_1.createLintCommand).execute().then(onSuccess,onFailure)})),yargsModule.command(["fix","f"],"Formats changed files and applies tslint fixes",{},(e=>{inject(fix_1.createFixCommand).execute().then(onSuccess,onFailure)})),yargsModule.command(["fixall"],"Formats all files and applies tslint fixes",{},(e=>{inject(fix_all_1.createFixAllCommand).execute().then(onSuccess,onFailure)})),yargsModule.command(["clean","c"],"Deletes all output files and intermediate files",{},(e=>{inject(clean_1.createCleanCommand).execute()})),yargsModule.command(["ci"],"Runs all tools in parallel to find errors",{tests:{describe:"Run the test and coverage command",boolean:!0,default:!0},format:{describe:"check formatting during command",boolean:!0,default:!0},coverage:{describe:"run tests with coverage",boolean:!0,default:!0},disable:{string:!0,type:"array"},compileLimit:{describe:"Limit the number of concurrent compilations",number:!0,default:2}},(e=>{inject(ci_1.createCICommand).execute({tests:e.tests,format:e.format,coverage:e.coverage,disabledProjects:e.disable,compileLimit:e.compileLimit}).then(failIfUnsuccessful,onFailure)})),yargsModule.command("init","Initialize or repair all features of typescript-assistant in your project",{},(e=>{inject(init_1.createInitCommand).execute(!0)})),yargsModule.command("pre-commit","Pre-commit git hook for husky",(e=>e.boolean("format").default("format",!0)),(e=>{inject(pre_commit_1.createPreCommitCommand).execute({format:e.format}).then(onSuccess,onFailure)})),yargsModule.command("post-checkout","Post-checkout git hook for husky",{previous:{describe:"The previous checkout head",string:!0,demandOption:!0},new:{describe:"The new checkout head",string:!0,demandOption:!0},branch:{coerce:e=>1===e}},(e=>{inject(post_checkout_1.createPostCheckoutCommand).execute({previousHead:e.previous,newHead:e.new,isBranch:e.branch})})),yargsModule.command("post-merge","Post-merge git hook for husky",{},(e=>{inject(post_merge_1.createPostMergeCommand).execute()})),yargsModule.command("pre-push","Pre-push git hook for husky",{disable:{string:!0,type:"array"},testConfig:{describe:"path to nyc config file",string:!0},testsGlob:{describe:"glob for test files",string:!0}},(e=>{inject(pre_push_1.createPrePushCommand).execute({disabledProjects:e.disable,testConfig:e.testConfig,testsGlob:e.testsGlob}).then(failIfUnsuccessful,onFailure)})),yargsModule.strict().argv;
//# sourceMappingURL=/sm/5a4e7cea45de17a2d98c25dbb6a220ed929054f2f197b5454e6c2afd633907c3.map