npm-check-updates 18.2.0 → 18.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -219,7 +219,7 @@ Options that take no arguments can be negated by prefixing them with `--no-`, e.
219
219
  </tr>
220
220
  <tr>
221
221
  <td>--deprecated</td>
222
- <td>Include deprecated packages. Use <code>--no-deprecated</code> to exclude deprecated packages (uses more bandwidth). (default: true)</td>
222
+ <td>Include deprecated packages. Use <code>--no-deprecated</code> to exclude deprecated packages (20–25% slower). (default: true)</td>
223
223
  </tr>
224
224
  <tr>
225
225
  <td><a href="#doctor">-d, --doctor</a></td>
@@ -888,12 +888,24 @@ Some options offer more advanced configuration using a function definition. Thes
888
888
  For example, `.ncurc.js`:
889
889
 
890
890
  ```js
891
+ /** @type {import('npm-check-updates').RcOptions } */
891
892
  module.exports = {
892
893
  upgrade: true,
893
894
  filter: name => name.startsWith('@myorg/'),
894
895
  }
895
896
  ```
896
897
 
898
+ Alternatively, you can use the defineConfig helper which should provide intellisense without the need for jsdoc annotations:
899
+
900
+ ```js
901
+ const { defineConfig } = require('npm-check-updates')
902
+
903
+ module.exports = defineConfig({
904
+ upgrade: true,
905
+ filter: name => name.startsWith('@myorg/'),
906
+ })
907
+ ```
908
+
897
909
  ### JSON Schema
898
910
 
899
911
  If you write `.ncurc` config files using json or yaml, you can add the JSON Schema to your IDE settings for completions.
package/build/index.d.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  import { SemVer } from 'semver-utils';
2
2
 
3
+ /**
4
+ * TypeScript helper for .npmrc config file. Similar to vite and eslint's
5
+ * defineConfig helper
6
+ */
7
+ export declare function defineConfig(config: RcOptions): RcOptions;
8
+
3
9
  /** Supported function for the --filter and --reject options. */
4
10
  declare type FilterFunction = (packageName: string, versionRange: SemVer[]) => boolean;
5
11
 
@@ -20,6 +26,9 @@ declare type NestedVersionSpecs = {
20
26
  [name: string]: VersionSpec | NestedVersionSpecs;
21
27
  };
22
28
 
29
+ /** Options that would make no sense in a .ncurc file */
30
+ declare type Nonsensical = 'configFileName' | 'configFilePath' | 'cwd' | 'packageData' | 'stdin';
31
+
23
32
  /** The relevant bits of a parsed package.json file. */
24
33
  declare interface PackageFile {
25
34
  dependencies?: Index<VersionSpec>;
@@ -45,6 +54,12 @@ declare interface PackageFileRepository {
45
54
  directory?: string;
46
55
  }
47
56
 
57
+ /** Expected options that might be found in an .ncurc file. Since the config is external, this cannot be guaranteed */
58
+ export declare type RcOptions = Omit<RunOptions, Nonsensical> & {
59
+ $schema?: string;
60
+ format?: string | string[];
61
+ };
62
+
48
63
  /** Main entry point.
49
64
  *
50
65
  * @returns Promise<
@@ -97,7 +112,7 @@ export declare interface RunOptions {
97
112
  * @default ["prod","dev","optional","packageManager"]
98
113
  */
99
114
  dep?: string | readonly string[];
100
- /** Include deprecated packages. Use `--no-deprecated` to exclude deprecated packages (uses more bandwidth).
115
+ /** Include deprecated packages. Use `--no-deprecated` to exclude deprecated packages (20–25% slower).
101
116
  *
102
117
  * @default true
103
118
  */