@favware/npm-deprecate
Advanced tools
Comparing version 1.0.8-next.fe65a4f.0 to 2.0.0-next.52fd648
@@ -16,3 +16,3 @@ #!/usr/bin/env node | ||
.version(packageJson.version) | ||
.option('-n, --name <nameGlob>', 'A glob pattern that will determine which packages are deprecated. Anything that passes [Micromatch](https://www.npmjs.com/package/micromatch) will work here. For example set `*dev*` to match `13.2.0-dev.123a`.') | ||
.option('-n, --name <nameGlob>', 'A glob pattern that will determine which packages are deprecated. Anything that passes [picomatch](https://www.npmjs.com/package/picomatch) or [micromatch](https://www.npmjs.com/package/micromatch) will work here. For example set `*dev*` to match `13.2.0-dev.123a`.') | ||
.option('-d, --deprecate-dist-tag [deprecateDistTag]', 'Whether the version that is in the current dist tags should be preserved or not. By default dist tags are preserved. When set to `true`, dist tags are pruned.') | ||
@@ -19,0 +19,0 @@ .option('-m, --message [message]', 'A custom message to show for all the deprecated versions.') |
@@ -5,3 +5,3 @@ import { NodeAuthToken, NpmBaseUrl } from '#lib/constants'; | ||
import { isNullish } from '@sapphire/utilities'; | ||
import micromatch from 'micromatch'; | ||
import picomatch from 'picomatch'; | ||
import npa from 'npm-package-arg'; | ||
@@ -46,2 +46,3 @@ import npmFetch from 'npm-registry-fetch'; | ||
let amountVersionsChanged = 0; | ||
const isVersionMatch = picomatch(options.name, { nocase: true }); | ||
for (const pkg of registryJsonFiles) { | ||
@@ -57,3 +58,3 @@ const distTags = Object.values(pkg['dist-tags']); | ||
continue; | ||
if (!micromatch.isMatch(version.version, options.name, { nocase: true })) | ||
if (!isVersionMatch(version.version)) | ||
continue; | ||
@@ -60,0 +61,0 @@ logVerboseInfo([`Deprecating version ${version.name}@${version.version}`], options.verbose); |
@@ -7,7 +7,7 @@ /** | ||
export function hydrateDefaultOptions(parsedOptions) { | ||
parsedOptions.deprecateDistTag ??= false; | ||
parsedOptions.message ??= 'This version has been automatically deprecated by @favware/npm-deprecate. Please use a newer version.'; | ||
parsedOptions.package ??= []; | ||
parsedOptions.deprecateDistTag ?? (parsedOptions.deprecateDistTag = false); | ||
parsedOptions.message ?? (parsedOptions.message = 'This version has been automatically deprecated by @favware/npm-deprecate. Please use a newer version.'); | ||
parsedOptions.package ?? (parsedOptions.package = []); | ||
return parsedOptions; | ||
} | ||
//# sourceMappingURL=hydrateDefaultOptions.js.map |
{ | ||
"name": "@favware/npm-deprecate", | ||
"version": "1.0.8-next.fe65a4f.0", | ||
"version": "2.0.0-next.52fd648", | ||
"description": "Programmatically deprecate your NPM published packages", | ||
@@ -20,7 +20,3 @@ "author": "@favware", | ||
"files": [ | ||
"dist", | ||
"!dist/*.tsbuildinfo", | ||
"!dist/**/*.js.map", | ||
"!dist/**/*.d.ts", | ||
"!dist/**/*.d.ts.map" | ||
"dist/**/*.js" | ||
], | ||
@@ -37,43 +33,39 @@ "scripts": { | ||
"check-update": "cliff-jumper --dry-run", | ||
"_postinstall": "husky install .github/husky", | ||
"prepack": "yarn build && pinst --disable", | ||
"postpack": "pinst --enable" | ||
"prepack": "yarn build" | ||
}, | ||
"dependencies": { | ||
"@sapphire/fetch": "^2.4.1", | ||
"@sapphire/utilities": "^3.13.0", | ||
"@sapphire/fetch": "^3.0.3", | ||
"@sapphire/utilities": "^3.17.0", | ||
"colorette": "^2.0.20", | ||
"commander": "^11.0.0", | ||
"commander": "^12.1.0", | ||
"js-yaml": "^4.1.0", | ||
"micromatch": "^4.0.5", | ||
"npm-package-arg": "^10.1.0", | ||
"npm-registry-fetch": "^15.0.0" | ||
"npm-package-arg": "^12.0.0", | ||
"npm-registry-fetch": "^18.0.2", | ||
"picomatch": "^4.0.2" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^17.7.1", | ||
"@commitlint/config-conventional": "^17.7.0", | ||
"@favware/cliff-jumper": "^2.1.1", | ||
"@sapphire/eslint-config": "^5.0.1", | ||
"@commitlint/cli": "^19.5.0", | ||
"@commitlint/config-conventional": "^19.5.0", | ||
"@favware/cliff-jumper": "^4.1.0", | ||
"@sapphire/eslint-config": "^5.0.5", | ||
"@sapphire/prettier-config": "^2.0.0", | ||
"@sapphire/ts-config": "^4.0.1", | ||
"@types/js-yaml": "^4.0.5", | ||
"@types/micromatch": "^4.0.2", | ||
"@types/node": "^18.17.6", | ||
"@types/node-fetch": "^2.6.4", | ||
"@types/npm-package-arg": "^6.1.1", | ||
"@types/npm-registry-fetch": "^8.0.4", | ||
"@typescript-eslint/eslint-plugin": "^6.4.0", | ||
"@typescript-eslint/parser": "^6.4.0", | ||
"@sapphire/ts-config": "^5.0.1", | ||
"@types/js-yaml": "^4.0.9", | ||
"@types/node": "^20.16.13", | ||
"@types/node-fetch": "^2.6.11", | ||
"@types/npm-package-arg": "^6.1.4", | ||
"@types/npm-registry-fetch": "^8.0.7", | ||
"@types/picomatch": "^3.0.1", | ||
"@typescript-eslint/eslint-plugin": "^7.18.0", | ||
"@typescript-eslint/parser": "^7.18.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.47.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^13.3.0", | ||
"pinst": "^3.0.0", | ||
"prettier": "^3.0.2", | ||
"typescript": "^5.1.6" | ||
"eslint": "^8.57.1", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"lint-staged": "^15.2.10", | ||
"prettier": "^3.3.3", | ||
"typescript": "^5.6.3" | ||
}, | ||
"resolutions": { | ||
"acorn": "^8.10.0", | ||
"acorn": "^8.12.1", | ||
"ansi-regex": "^5.0.1", | ||
@@ -83,3 +75,3 @@ "minimist": "^1.2.8" | ||
"engines": { | ||
"node": ">=16" | ||
"node": ">=18" | ||
}, | ||
@@ -114,3 +106,3 @@ "repository": { | ||
}, | ||
"packageManager": "yarn@3.6.2" | ||
"packageManager": "yarn@4.5.0" | ||
} |
@@ -152,6 +152,6 @@ <div align="center"> | ||
uses: actions/checkout@v2 | ||
- name: Use Node.js v16 | ||
- name: Use Node.js v18 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
node-version: 18 | ||
cache: yarn | ||
@@ -158,0 +158,0 @@ registry-url: https://registry.npmjs.org/ |
21
14
337
30760
+ Addedpicomatch@^4.0.2
+ Added@isaacs/fs-minipass@4.0.1(transitive)
+ Added@npmcli/agent@3.0.0(transitive)
+ Added@npmcli/fs@4.0.0(transitive)
+ Added@npmcli/redact@3.0.0(transitive)
+ Added@sapphire/fetch@3.0.5(transitive)
+ Addedagent-base@7.1.3(transitive)
+ Addedcacache@19.0.1(transitive)
+ Addedchownr@3.0.0(transitive)
+ Addedcommander@12.1.0(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedhosted-git-info@8.0.2(transitive)
+ Addedhttp-proxy-agent@7.0.2(transitive)
+ Addedhttps-proxy-agent@7.0.6(transitive)
+ Addedmake-fetch-happen@14.0.3(transitive)
+ Addedminipass-collect@2.0.1(transitive)
+ Addedminipass-fetch@4.0.0(transitive)
+ Addedminizlib@3.0.1(transitive)
+ Addedmkdirp@3.0.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednegotiator@1.0.0(transitive)
+ Addednpm-package-arg@12.0.1(transitive)
+ Addednpm-registry-fetch@18.0.2(transitive)
+ Addedp-map@7.0.3(transitive)
+ Addedpicomatch@4.0.2(transitive)
+ Addedproc-log@5.0.0(transitive)
+ Addedrimraf@5.0.10(transitive)
+ Addedsocks-proxy-agent@8.0.5(transitive)
+ Addedssri@12.0.0(transitive)
+ Addedtar@7.4.3(transitive)
+ Addedunique-filename@4.0.0(transitive)
+ Addedunique-slug@5.0.0(transitive)
+ Addedvalidate-npm-package-name@6.0.0(transitive)
+ Addedyallist@5.0.0(transitive)
- Removedmicromatch@^4.0.5
- Removed@npmcli/agent@1.1.0(transitive)
- Removed@npmcli/fs@3.1.1(transitive)
- Removed@sapphire/fetch@2.4.2(transitive)
- Removedaggregate-error@3.1.0(transitive)
- Removedbraces@3.0.3(transitive)
- Removedcacache@17.1.4(transitive)
- Removedchownr@2.0.0(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedcommander@11.1.0(transitive)
- Removedcross-fetch@4.1.0(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfs-minipass@2.1.0(transitive)
- Removedhosted-git-info@6.1.3(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedis-lambda@1.0.1(transitive)
- Removedis-number@7.0.0(transitive)
- Removedlru-cache@7.18.3(transitive)
- Removedmake-fetch-happen@12.0.0(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedminipass@5.0.0(transitive)
- Removedminipass-collect@1.0.2(transitive)
- Removedminipass-fetch@3.0.5(transitive)
- Removedminipass-json-stream@1.0.2(transitive)
- Removedminizlib@2.1.2(transitive)
- Removedmkdirp@1.0.4(transitive)
- Removednegotiator@0.6.4(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removednpm-package-arg@10.1.0(transitive)
- Removednpm-registry-fetch@15.0.0(transitive)
- Removedp-map@4.0.0(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedproc-log@3.0.0(transitive)
- Removedssri@10.0.6(transitive)
- Removedtar@6.2.1(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedtr46@0.0.3(transitive)
- Removedunique-filename@3.0.0(transitive)
- Removedunique-slug@4.0.0(transitive)
- Removedvalidate-npm-package-name@5.0.1(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updated@sapphire/fetch@^3.0.3
Updated@sapphire/utilities@^3.17.0
Updatedcommander@^12.1.0
Updatednpm-package-arg@^12.0.0
Updatednpm-registry-fetch@^18.0.2