Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@favware/npm-deprecate

Package Overview
Dependencies
Maintainers
1
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@favware/npm-deprecate - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6-next.2ba98ea.0

CHANGELOG.md

10

dist/cli.js

@@ -5,2 +5,3 @@ #!/usr/bin/env node

import { cliRootDir, indent } from '#lib/constants';
import { hydrateDefaultOptions } from '#lib/hydrateDefaultOptions';
import { logVerboseInfo } from '#lib/logVerbose';

@@ -17,8 +18,9 @@ import { parseOptionsFile } from '#lib/optionsParser';

.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('-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.', false)
.option('-m, --message [message]', 'A custom message to show for all the deprecated versions.', 'This version has been automatically deprecated by @favware/npm-deprecate. Please use a newer version.')
.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.')
.option('-m, --message [message]', 'A custom message to show for all the deprecated versions.')
.option('-v, --verbose', 'Print verbose information', false)
.option('-p, --package <packages...>', `Repeatable, each will be treated as another package. The packages that should be deprecated`, (value, previous) => previous.concat([value]), []);
.option('-p, --package <packages...>', `Repeatable, each will be treated as another package. The packages that should be deprecated`, (value, previous) => previous.concat([value]));
const program = command.parse(process.argv);
const options = await parseOptionsFile(program.opts());
let options = await parseOptionsFile(program.opts());
options = hydrateDefaultOptions(options);
logVerboseInfo([

@@ -25,0 +27,0 @@ 'Resolved options: ',

2

dist/commands/deprecate.js

@@ -35,3 +35,3 @@ import { NodeAuthToken, NpmBaseUrl } from '#lib/constants';

text: [
'Looks like the action failed to get the data for any of the provided packages. Are you sure your package names are correct? You can check by manually adding the package name to the URL "https://registry.npmjs.com/". For example "https://registry.npmjs.com/@favware/rollup-type-bundler"'
'Looks like the action failed to get the data for any of the provided packages. Are you sure your package names are correct? You can check by manually adding the package name to the URL "https://registry.npmjs.com/". For example "https://registry.npmjs.com/@favware/npm-deprecate"'
],

@@ -38,0 +38,0 @@ verbose: options.verbose,

@@ -8,3 +8,3 @@ import { npmDeprecateRcJsonPath, npmDeprecateRcPath, npmDeprecateRcYamlPath, npmDeprecateRcYmlPath } from '#lib/constants';

* @param cliOptions The base CLI options to merge with the options found in a YAML or JSON file, if any
* @returns The YAML or JSON file provided options with anything passed through the CLI overriding it. Also calls {@link transformOptionsDistPathToFileUrl}
* @returns The YAML or JSON file provided options with anything passed through the CLI overriding it.
*/

@@ -11,0 +11,0 @@ export async function parseOptionsFile(cliOptions) {

@@ -5,21 +5,17 @@ # The MIT License (MIT)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
"name": "@favware/npm-deprecate",
"version": "1.0.5",
"description": "Programmatically deprecate your NPM published packages",
"author": "@favware",
"license": "MIT",
"type": "module",
"main": "dist/cli.js",
"bin": {
"nd": "./dist/cli.js",
"npm-deprecate": "./dist/cli.js"
},
"imports": {
"#commands/*": "./dist/commands/*.js",
"#lib/*": "./dist/lib/*.js",
"#root/*": "./dist/*.js"
},
"sideEffects": "false",
"files": [
"dist",
"!dist/*.tsbuildinfo",
"!dist/**/*.js.map",
"!dist/**/*.d.ts",
"!dist/**/*.d.ts.map"
],
"scripts": {
"lint": "eslint src --ext ts --fix",
"debug": "node . -v --dist .\\build\\",
"format": "prettier --write src/**/*.ts",
"update": "yarn upgrade-interactive --latest",
"clean": "node scripts/clean.mjs",
"build": "tsc -b src",
"watch": "tsc -b src -w",
"sversion": "standard-version",
"prepare": "husky install .github/husky",
"prepublishOnly": "yarn build"
},
"dependencies": {
"@sapphire/fetch": "^2.4.1",
"@sapphire/utilities": "^3.8.0",
"colorette": "^2.0.19",
"commander": "^9.4.0",
"js-yaml": "^4.1.0",
"micromatch": "^4.0.5",
"npm-package-arg": "^9.1.0",
"npm-registry-fetch": "^13.3.0"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@sapphire/eslint-config": "^4.3.7",
"@sapphire/prettier-config": "^1.4.3",
"@sapphire/ts-config": "^3.3.4",
"@types/js-yaml": "^4.0.5",
"@types/micromatch": "^4.0.2",
"@types/node": "^18.6.2",
"@types/node-fetch": "^2.6.2",
"@types/npm-package-arg": "^6.1.1",
"@types/npm-registry-fetch": "^8.0.4",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"standard-version": "^9.5.0",
"typescript": "^4.7.4"
},
"resolutions": {
"ansi-regex": "^5.0.1",
"minimist": "^1.2.6"
},
"engines": {
"node": ">=16",
"npm": ">=7.24.2"
},
"repository": {
"type": "git",
"url": "git+https://github.com/favware/npm-deprecate.git"
},
"bugs": {
"url": "https://github.com/favware/npm-deprecate/issues"
},
"homepage": "https://github.com/favware/npm-deprecate",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"lint-staged": {
"*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"publishConfig": {
"access": "public"
},
"eslintConfig": {
"extends": "@sapphire"
},
"prettier": "@sapphire/prettier-config",
"packageManager": "yarn@3.2.2"
}
"name": "@favware/npm-deprecate",
"version": "1.0.6-next.2ba98ea.0",
"description": "Programmatically deprecate your NPM published packages",
"author": "@favware",
"license": "MIT",
"type": "module",
"main": "dist/cli.js",
"bin": {
"nd": "./dist/cli.js",
"npm-deprecate": "./dist/cli.js"
},
"imports": {
"#commands/*": "./dist/commands/*.js",
"#lib/*": "./dist/lib/*.js",
"#root/*": "./dist/*.js"
},
"sideEffects": "false",
"files": [
"dist",
"!dist/*.tsbuildinfo",
"!dist/**/*.js.map",
"!dist/**/*.d.ts",
"!dist/**/*.d.ts.map"
],
"scripts": {
"lint": "eslint src --ext ts --fix",
"format": "prettier --write \"src/**/*.ts\"",
"update": "yarn upgrade-interactive --latest",
"clean": "node scripts/clean.mjs",
"build": "tsc -b src",
"watch": "tsc -b src -w",
"bump": "cliff-jumper",
"check-update": "cliff-jumper --dry-run",
"_postinstall": "husky install .github/husky",
"prepack": "yarn build && pinst --disable",
"postpack": "pinst --enable"
},
"dependencies": {
"@sapphire/fetch": "^2.4.1",
"@sapphire/utilities": "^3.11.0",
"colorette": "^2.0.19",
"commander": "^9.4.1",
"js-yaml": "^4.1.0",
"micromatch": "^4.0.5",
"npm-package-arg": "^10.0.0",
"npm-registry-fetch": "^14.0.2"
},
"devDependencies": {
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@favware/cliff-jumper": "^1.9.0",
"@sapphire/eslint-config": "^4.3.8",
"@sapphire/prettier-config": "^1.4.4",
"@sapphire/ts-config": "^3.3.4",
"@types/js-yaml": "^4.0.5",
"@types/micromatch": "^4.0.2",
"@types/node": "^18.11.9",
"@types/node-fetch": "^2.6.2",
"@types/npm-package-arg": "^6.1.1",
"@types/npm-registry-fetch": "^8.0.4",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"lint-staged": "^13.0.3",
"pinst": "^3.0.0",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"typescript": "^4.9.3"
},
"resolutions": {
"acorn": "^8.8.1",
"ansi-regex": "^5.0.1",
"minimist": "^1.2.7"
},
"engines": {
"node": ">=16"
},
"repository": {
"type": "git",
"url": "git+https://github.com/favware/npm-deprecate.git"
},
"bugs": {
"url": "https://github.com/favware/npm-deprecate/issues"
},
"homepage": "https://github.com/favware/npm-deprecate",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"lint-staged": {
"*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"publishConfig": {
"access": "public"
},
"eslintConfig": {
"extends": "@sapphire"
},
"packageManager": "yarn@3.3.0"
}

@@ -16,6 +16,8 @@ <div align="center">

When working on larger libraries it may be desirable to release every commit to NPM automatically using a GitHub workflow.
However when doing this you'll end up with a LOT of versions on npm, which gets extremely cluttered.
When working on larger libraries it may be desirable to release every commit to
NPM automatically using a GitHub workflow. However when doing this you'll end up
with a LOT of versions on npm, which gets extremely cluttered.
To solve this, one can use this package to programmatically deprecate many versions at once, matching a glob that is checked against the version name.
To solve this, one can use this package to programmatically deprecate many
versions at once, matching a glob that is checked against the version name.

@@ -80,22 +82,22 @@ ## Installation

Or, you can set most of these options through a configuration file. This
file should be located at your current working directory (where you're
calling this package). It should be named `.npm-deprecaterc`, optionally
suffixed with `.json`, `.yaml`, or `.yml`.
Or, you can set most of these options through a configuration file. This file
should be located at your current working directory (where you're calling this
package). It should be named `.npm-deprecaterc`, optionally suffixed with
`.json`, `.yaml`, or `.yml`.
### Config file fields
- `--name` maps to `name`
- `--deprecate-dist-tag` maps to `deprecateDistTag`
- `--verbose` maps to `verbose`
- `--message` maps to `message`
- `--package` maps to `package`
- `--name` maps to `name`
- `--deprecate-dist-tag` maps to `deprecateDistTag`
- `--verbose` maps to `verbose`
- `--message` maps to `message`
- `--package` maps to `package`
When using `.npm-deprecaterc` or `.npm-deprecaterc.json` as
your config file you can also use the JSON schema to get schema
validation. To do so, add the following to your config file:
When using `.npm-deprecaterc` or `.npm-deprecaterc.json` as your config file you
can also use the JSON schema to get schema validation. To do so, add the
following to your config file:
```json
{
"$schema": "https://raw.githubusercontent.com/favware/npm-deprecate/main/assets/npm-deprecate.schema.json"
"$schema": "https://raw.githubusercontent.com/favware/npm-deprecate/main/assets/npm-deprecate.schema.json"
}

@@ -108,7 +110,7 @@ ```

{
"$schema": "https://raw.githubusercontent.com/favware/npm-deprecate/main/assets/npm-deprecate.schema.json",
"name": "*next*",
"deprecateDistTag": false,
"verbose": true,
"package": ["@favware/rollup-type-bundler", "@favware/npm-deprecate"]
"$schema": "https://raw.githubusercontent.com/favware/npm-deprecate/main/assets/npm-deprecate.schema.json",
"name": "*next*",
"deprecateDistTag": false,
"verbose": true,
"package": ["@favware/cliff-jumper", "@favware/npm-deprecate"]
}

@@ -124,4 +126,4 @@ ```

package:
- '@favware/rollup-type-bundler'
- '@favware/npm-deprecate'
- '@favware/cliff-jumper'
- '@favware/npm-deprecate'
```

@@ -133,5 +135,6 @@

- `--deprecate-dist-tag` will default to `false`.
- `--message` will default to `This version has been automatically deprecated by @favware/npm-deprecate. Please use a newer version.`.
- `--verbose` will default to `false`.
- `--deprecate-dist-tag` will default to `false`.
- `--message` will default to
`This version has been automatically deprecated by @favware/npm-deprecate. Please use a newer version.`.
- `--verbose` will default to `false`.

@@ -144,24 +147,24 @@ ### Using this in a GitHub Workflow

on:
schedule:
- cron: '0 0 * * *'
schedule:
- cron: '0 0 * * *'
jobs:
auto-deprecate:
name: NPM Auto Deprecate
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Use Node.js v16
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies if Cache Miss
run: yarn --immutable
- name: Deprecate versions
run: yarn npm-deprecate
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
auto-deprecate:
name: NPM Auto Deprecate
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Use Node.js v16
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies if Cache Miss
run: yarn --immutable
- name: Deprecate versions
run: yarn npm-deprecate
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
```

@@ -172,9 +175,8 @@

Favware projects are and always will be open source, even if we don't get
donations. That being said, we know there are amazing people who may still
want to donate just to show their appreciation. Thank you very much in
advance!
donations. That being said, we know there are amazing people who may still want
to donate just to show their appreciation. Thank you very much in advance!
We accept donations through Ko-fi, Paypal, Patreon, GitHub Sponsorships,
and various cryptocurrencies. You can use the buttons below to donate
through your method of choice.
We accept donations through Ko-fi, Paypal, Patreon, GitHub Sponsorships, and
various cryptocurrencies. You can use the buttons below to donate through your
method of choice.

@@ -193,3 +195,4 @@ | Donate With | Address |

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Thanks goes to these wonderful people
([emoji key](https://allcontributors.org/docs/en/emoji-key)):

@@ -210,2 +213,4 @@ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome!
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc