@smushytaco/custompatch
Version:
Tool for patching buggy NPM packages instead of forking them
1 lines • 1.93 kB
Source Map (JSON)
{"version":3,"file":"variables.mjs","sources":["../src/variables.ts"],"sourcesContent":["import { program } from 'commander';\nimport path from 'pathe';\nimport os from 'node:os';\nimport ownPackage from '../package.json' with { type: 'json' };\n\nexport const currentDirectory: string = process.cwd();\nexport const temporaryDirectory: string = os.tmpdir();\nexport const patchDirectory: string = path.join(currentDirectory, 'patches');\n\nprogram\n .name('custompatch')\n .usage('[options] [packageName ...]')\n .version(ownPackage.version)\n .description(\n 'Tool for patching buggy NPM packages instead of forking them.\\n' +\n 'When invoked without arguments - apply all patches from the \"patches\" folder.\\n' +\n 'If one or more package names are specified - create a patch for the given NPM package ' +\n '(already patched by you in your \"node_modules\" folder) and save it inside \"patches\" folder.'\n )\n .option(\n '-a, --all',\n 'Include \"package.json\" files in the patch, by default these are ignored'\n )\n .option('-r, --reverse', 'Reverse the patch(es) instead of applying them')\n .option(\n '-p, --patch',\n 'Apply the patch(es) to the specified package(s) instead of all patches'\n )\n .allowExcessArguments(true);\n\nprogram.parse();\n\nexport const programOptions = program.opts();\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,gBAAA,GAA2B,QAAQ,GAAA;AACzC,MAAM,kBAAA,GAA6B,GAAG,MAAA;AACtC,MAAM,cAAA,GAAyB,IAAA,CAAK,IAAA,CAAK,gBAAA,EAAkB,SAAS;AAE3E,OAAA,CACK,IAAA,CAAK,aAAa,CAAA,CAClB,KAAA,CAAM,6BAA6B,CAAA,CACnC,OAAA,CAAQ,UAAA,CAAW,OAAO,CAAA,CAC1B,WAAA,CACG,iUAGiG,CAAA,CAEpG,OACG,WAAA,EACA,yEAAyE,CAAA,CAE5E,MAAA,CAAO,eAAA,EAAiB,gDAAgD,CAAA,CACxE,MAAA,CACG,aAAA,EACA,wEAAwE,CAAA,CAE3E,oBAAA,CAAqB,IAAI,CAAA;AAE9B,OAAA,CAAQ,KAAA,EAAK;AAEN,MAAM,cAAA,GAAiB,QAAQ,IAAA;;;;"}