Skip to content

Commit 3f28ecd

Browse files
authored
Generate RunOptions from cli-options (#1138)
1 parent c886c6e commit 3f28ecd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+539
-391
lines changed

.github/CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## Filing an issue
2+
13
Make sure you read the list of [known issues](https://github.com/raineorshine/npm-check-updates#known-issues) and search for [similar issues](https://github.com/raineorshine/npm-check-updates/issues) before filing an issue.
24

35
When filing an issue, please include:
@@ -7,3 +9,13 @@ When filing an issue, please include:
79
- npm-check-updates version
810
- the relevant package names and their specified versions from your package file
911
- ...or the output from `npm -g ls --depth=0` if using global mode
12+
13+
## Design
14+
15+
The _raison d'être_ of npm-check-updates is to upgrade package.json dependencies to the latest versions, ignoring specified versions. Suggested features that do not fit within this objective will be considered out of scope.
16+
17+
npm-check-updates maintains a balance between minimalism and customizability. The default execution with no options will always produce simple, clean output. If you would like to add additional information to ncu's output, you may propose a new value for the `--format` option.
18+
19+
## Adding a new CLI or module option
20+
21+
All of ncu's options are generated from [/src/cli-options.ts](https://github.com/raineorshine/npm-check-updates/blob/main/src/cli-options.ts). You can add a new option to this file and then run `npm run build` to automatically generate README, CLI help text, and Typescript definitions.

.github/ISSUE_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@
66

77
## Steps to Reproduce
88

9+
.ncurc:
10+
11+
<!-- If you use a .ncurc config file, specify it here. ncu options have a dramatic effect on its behavior. -->
12+
13+
```js
14+
15+
```
16+
17+
Dependencies:
18+
19+
<!-- If the suggested upgrades are not what you expect, make sure to List your package.json dependencies here so the issue can be reproduced. -->
20+
21+
```json
22+
23+
```
24+
25+
Steps:
26+
27+
<!-- The exact steps taken to arrive at the unexpected behavior. -->
28+
929
## Current Behavior
1030

1131
## Expected Behavior

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ ncu "/^(?!react-).*$/" # windows
155155
continuous integration). (default: 1)
156156
-f, --filter <matches> Include only package names matching the given
157157
string, wildcard, glob, comma-or-space-delimited
158-
list, or /regex/.
158+
list, /regex/, or predicate function.
159159
--filterVersion <matches> Filter on package version using
160-
comma-or-space-delimited list, or /regex/.
160+
comma-or-space-delimited list, /regex/, or
161+
predicate function.
161162
--format <value> Enable additional output data, string or
162163
comma-delimited list: ownerChanged, repo.
163164
ownerChanged: shows if the package owner changed
@@ -195,9 +196,10 @@ ncu "/^(?!react-).*$/" # windows
195196
-r, --registry <url> Third-party npm registry.
196197
-x, --reject <matches> Exclude packages matching the given string,
197198
wildcard, glob, comma-or-space-delimited list,
198-
or /regex/. (default: [])
199+
/regex/, or predicate function. (default: [])
199200
--rejectVersion <matches> Exclude package.json versions using
200-
comma-or-space-delimited list, or /regex/.
201+
comma-or-space-delimited list, /regex/, or
202+
predicate function.
201203
--removeRange Remove version ranges from the final package
202204
version.
203205
--retry <n> Number of times to retry failed requests for
@@ -292,6 +294,10 @@ const upgraded = await ncu.run({
292294
console.log(upgraded) // { "mypackage": "^2.0.0", ... }
293295
```
294296
297+
## Contributing
298+
299+
Contributions are happily accepted. I respond to all PR's and can offer guidance on where to make changes. For contributing tips see [CONTRIBUTING.md](https://github.com/raineorshine/npm-check-updates/blob/main/.github/CONTRIBUTING.md).
300+
295301
## Known Issues
296302

297303
- If `ncu` prints output that does not seem related to this package, it may be conflicting with another executable such as `ncu-weather-cli` or Nvidia CUDA. Try using the long name instead: `npm-check-updates`.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
},
2727
"main": "build/src/index.js",
2828
"scripts": {
29-
"build": "npm run build:ts && npm run build:readme",
29+
"build": "npm run build:ts && npm run build:options",
3030
"build:ts": "tsc",
31-
"build:readme": "node scripts/buildReadme.js",
31+
"build:options": "node build/src/scripts/build-options.js && tsc",
3232
"lint": "cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*",
3333
"lint:lockfile": "lockfile-lint",
3434
"lint:markdown": "markdownlint \"**/*.md\" --ignore node_modules --ignore build --config .markdownlint.js",

scripts/buildReadme.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)