UNPKG

@smushytaco/custompatch

Version:

Tool for patching buggy NPM packages instead of forking them

50 lines (46 loc) 2.82 kB
import { program } from 'commander'; import path from 'pathe'; import os from 'node:os'; const name = "@smushytaco/custompatch"; const version = "1.0.17"; const description = "Tool for patching buggy NPM packages instead of forking them"; const keywords = ["patching","buggy","packages"]; const bugs = {"url":"https://github.com/SmushyTaco/custompatch/issues"}; const repository = {"type":"git","url":"git+https://github.com/SmushyTaco/custompatch.git"}; const license = "MIT"; const author = {"name":"SmushyTaco","email":"personal@nikanradan.com"}; const type = "module"; const bin = {"custompatch":"dist/cli.mjs"}; const files = ["dist","LICENSE","README.md"]; const scripts = {"build":"npm run clean && npx vite build","clean":"npx del-cli dist","prepare":"npm run build","start":"node ./dist/cli.mjs"}; const dependencies = {"commander":"^14.0.0","diff":"^8.0.2","pacote":"^21.0.0","pathe":"^2.0.3","picocolors":"^1.1.1"}; const devDependencies = {"@eslint/js":"^9.32.0","@smushytaco/versionchecker":"^1.0.11","@types/node":"^24.1.0","@types/pacote":"^11.1.8","@typescript-eslint/eslint-plugin":"^8.38.0","@typescript-eslint/parser":"^8.38.0","del-cli":"^6.0.0","eslint-plugin-prettier":"^5.5.3","eslint-plugin-unicorn":"^60.0.0","globals":"^16.3.0","prettier":"^3.6.2","sort-package-json":"^3.4.0","typescript":"^5.8.3","typescript-eslint":"^8.38.0","vite":"^7.0.6","vite-plugin-tsc-transpile":"^1.0.7"}; const engines = {"node":">=22.13.0","npm":">=11.0.0"}; const publishConfig = {"access":"public"}; const ownPackage = { name, version, "private": false, description, keywords, bugs, repository, license, author, type, bin, files, scripts, dependencies, devDependencies, engines, publishConfig, }; const currentDirectory = process.cwd(); const temporaryDirectory = os.tmpdir(); const patchDirectory = path.join(currentDirectory, "patches"); program.name("custompatch").usage("[options] [packageName ...]").version(ownPackage.version).description('Tool for patching buggy NPM packages instead of forking them.\nWhen invoked without arguments - apply all patches from the "patches" folder.\nIf one or more package names are specified - create a patch for the given NPM package (already patched by you in your "node_modules" folder) and save it inside "patches" folder.').option("-a, --all", 'Include "package.json" files in the patch, by default these are ignored').option("-r, --reverse", "Reverse the patch(es) instead of applying them").option("-p, --patch", "Apply the patch(es) to the specified package(s) instead of all patches").allowExcessArguments(true); program.parse(); const programOptions = program.opts(); export { patchDirectory as a, currentDirectory as c, ownPackage as o, programOptions as p, temporaryDirectory as t }; //# sourceMappingURL=variables.mjs.map