mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
Bugfix not-needed script argument parsing (#49718)
* fix not-needed script regression, introduced by removing of the sourceRepoURL parameter in #49620 (3868b76e67)
* doc fix example of npm run not-needed
This commit is contained in:
@@ -218,7 +218,7 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D
|
||||
|
||||
When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from Definitely Typed to avoid confusion.
|
||||
|
||||
You can remove it by running `npm run not-needed — typingsPackageName asOfVersion [libraryName]`.
|
||||
You can remove it by running `npm run not-needed -- typingsPackageName asOfVersion [libraryName]`.
|
||||
* `typingsPackageName`: This is the name of the directory to delete.
|
||||
* `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version, and should be a version of `foo` on npm.
|
||||
* `libraryName`: Name of npm package that replaces the Definitely Typed types. Usually this is identical to "typingsPackageName", in which case you can omit it.
|
||||
|
||||
@@ -5,9 +5,9 @@ const path = require("path");
|
||||
|
||||
const typingsPackageName = process.argv[2];
|
||||
const asOfVersion = process.argv[3];
|
||||
const libraryName = process.argv[5] || typingsPackageName;
|
||||
const libraryName = process.argv[4] || typingsPackageName;
|
||||
|
||||
if (process.argv.length !== 5 && process.argv.length !== 6) {
|
||||
if (process.argv.length !== 4 && process.argv.length !== 5) {
|
||||
console.log("Usage: npm run not-needed -- typingsPackageName asOfVersion [libraryName]");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user