@verdaccio/types 11.0.0-6-next.16 → 11.0.0-6-next.17

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/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # Change Log
2
2
 
3
+ ## 11.0.0-6-next.17
4
+
5
+ ### Major Changes
6
+
7
+ - 9fc2e796: feat(plugins): improve plugin loader
8
+
9
+ ### Changes
10
+
11
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
12
+ - Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
13
+ - https://github.com/verdaccio/verdaccio/issues/1394
14
+ - `config.plugins` plugin path validations
15
+ - Updated algorithm for plugin loader.
16
+ - improved documentation (included dev)
17
+
18
+ ## Features
19
+
20
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
21
+ - Custom prefix:
22
+
23
+ ```
24
+ // config.yaml
25
+ server:
26
+ pluginPrefix: mycompany
27
+ middleware:
28
+ audit:
29
+ foo: 1
30
+ ```
31
+
32
+ This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
33
+
34
+ ## Breaking Changes
35
+
36
+ ### sinopia plugins
37
+
38
+ - `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
39
+
40
+ ### plugin filter
41
+
42
+ - method rename `filter_metadata`->`filterMetadata`
43
+
44
+ ### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
45
+
46
+ The plugin receives as first argument `config`, which represents the config of the plugin. Example:
47
+
48
+ ```
49
+ // config.yaml
50
+ auth:
51
+ plugin:
52
+ foo: 1
53
+ bar: 2
54
+
55
+ export class Plugin<T> {
56
+ public constructor(config: T, options: PluginOptions) {
57
+ console.log(config);
58
+ // {foo:1, bar: 2}
59
+ }
60
+ }
61
+ ```
62
+
63
+ ### Minor Changes
64
+
65
+ - 62c24b63: feat: add passwordValidationRegex property
66
+
3
67
  ## 11.0.0-6-next.16
4
68
 
5
69
  ### Patch Changes
@@ -180,6 +180,14 @@ export declare type Notification = Notifications;
180
180
  export declare type ServerSettingsConf = {
181
181
  rateLimit: RateLimit;
182
182
  keepAliveTimeout?: number;
183
+ /**
184
+ * Plugins should be prefixed verdaccio-XXXXXX by default.
185
+ * To override the default prefix, use this property without `-`
186
+ * If you set pluginPrefix: acme, the packages to resolve will be
187
+ * acme-XXXXXX
188
+ */
189
+ pluginPrefix?: string;
190
+ passwordValidationRegex?: RegExp;
183
191
  };
184
192
  /**
185
193
  * YAML configuration file available options.
@@ -198,7 +206,7 @@ export interface ConfigYaml {
198
206
  listen?: ListenAddress;
199
207
  https?: HttpsConf;
200
208
  http_proxy?: string;
201
- plugins?: string | void;
209
+ plugins?: string | void | null;
202
210
  https_proxy?: string;
203
211
  no_proxy?: string;
204
212
  max_body_size?: string;
@@ -213,7 +221,7 @@ export interface ConfigYaml {
213
221
  configPath?: string;
214
222
  }
215
223
  /**
216
- * Configuration object with additonal methods for configuration, includes yaml and internal medatada.
224
+ * Configuration object with additional methods for configuration, includes yaml and internal medatada.
217
225
  * @interface Config
218
226
  * @extends {ConfigYaml}
219
227
  */
@@ -1,11 +1,11 @@
1
1
  import { Config, Logger } from '../configuration';
2
2
  export declare class Plugin<T> {
3
- constructor(config: T, options: PluginOptions<T>);
3
+ constructor(config: T, options: PluginOptions);
4
4
  }
5
5
  export interface IPlugin<T> {
6
6
  version?: string;
7
7
  }
8
- export interface PluginOptions<T> {
9
- config: T & Config;
8
+ export interface PluginOptions {
9
+ config: Config;
10
10
  logger: Logger;
11
11
  }
@@ -1,5 +1,5 @@
1
1
  import { Manifest } from '../manifest';
2
2
  import { IPlugin } from './commons';
3
3
  export interface IPluginStorageFilter<T> extends IPlugin<T> {
4
- filter_metadata(packageInfo: Manifest): Promise<Manifest>;
4
+ filterMetadata(packageInfo: Manifest): Promise<Manifest>;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Readable, Writable } from 'stream';
3
3
  import { Callback, CallbackAction } from '../commons';
4
- import { Config, Logger } from '../configuration';
4
+ import { Logger } from '../configuration';
5
5
  import { Manifest, Token } from '../manifest';
6
6
  import { IPlugin } from './commons';
7
7
  export declare type StorageList = string[];
@@ -68,7 +68,7 @@ export declare type IPackageStorageManager = ILocalPackageManager;
68
68
  */
69
69
  interface ILocalData<T> extends IPlugin<T>, ITokenActions {
70
70
  logger: Logger;
71
- config: T & Config;
71
+ config: T;
72
72
  add(name: string): Promise<void>;
73
73
  remove(name: string): Promise<void>;
74
74
  get(): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/types",
3
- "version": "11.0.0-6-next.16",
3
+ "version": "11.0.0-6-next.17",
4
4
  "description": "verdaccio types definitions",
5
5
  "keywords": [
6
6
  "private",
@@ -34,7 +34,7 @@
34
34
  "main": "build/types.d.ts",
35
35
  "types": "build/types.d.ts",
36
36
  "devDependencies": {
37
- "@types/node": "16.11.56",
37
+ "@types/node": "16.11.60",
38
38
  "typedoc": "beta",
39
39
  "typedoc-plugin-missing-exports": "1.0.0"
40
40
  },
@@ -226,6 +226,14 @@ export type ServerSettingsConf = {
226
226
  // express-rate-limit settings
227
227
  rateLimit: RateLimit;
228
228
  keepAliveTimeout?: number;
229
+ /**
230
+ * Plugins should be prefixed verdaccio-XXXXXX by default.
231
+ * To override the default prefix, use this property without `-`
232
+ * If you set pluginPrefix: acme, the packages to resolve will be
233
+ * acme-XXXXXX
234
+ */
235
+ pluginPrefix?: string;
236
+ passwordValidationRegex?: RegExp;
229
237
  };
230
238
 
231
239
  /**
@@ -245,7 +253,7 @@ export interface ConfigYaml {
245
253
  listen?: ListenAddress;
246
254
  https?: HttpsConf;
247
255
  http_proxy?: string;
248
- plugins?: string | void;
256
+ plugins?: string | void | null;
249
257
  https_proxy?: string;
250
258
  no_proxy?: string;
251
259
  max_body_size?: string;
@@ -264,7 +272,7 @@ export interface ConfigYaml {
264
272
  }
265
273
 
266
274
  /**
267
- * Configuration object with additonal methods for configuration, includes yaml and internal medatada.
275
+ * Configuration object with additional methods for configuration, includes yaml and internal medatada.
268
276
  * @interface Config
269
277
  * @extends {ConfigYaml}
270
278
  */
@@ -1,7 +1,7 @@
1
1
  import { Config, Logger } from '../configuration';
2
2
 
3
3
  export class Plugin<T> {
4
- public constructor(config: T, options: PluginOptions<T>) {}
4
+ public constructor(config: T, options: PluginOptions) {}
5
5
  }
6
6
 
7
7
  export interface IPlugin<T> {
@@ -9,7 +9,7 @@ export interface IPlugin<T> {
9
9
  version?: string;
10
10
  }
11
11
 
12
- export interface PluginOptions<T> {
13
- config: T & Config;
12
+ export interface PluginOptions {
13
+ config: Config;
14
14
  logger: Logger;
15
15
  }
@@ -2,5 +2,5 @@ import { Manifest } from '../manifest';
2
2
  import { IPlugin } from './commons';
3
3
 
4
4
  export interface IPluginStorageFilter<T> extends IPlugin<T> {
5
- filter_metadata(packageInfo: Manifest): Promise<Manifest>;
5
+ filterMetadata(packageInfo: Manifest): Promise<Manifest>;
6
6
  }
@@ -84,7 +84,7 @@ export type IPackageStorageManager = ILocalPackageManager;
84
84
  */
85
85
  interface ILocalData<T> extends IPlugin<T>, ITokenActions {
86
86
  logger: Logger;
87
- config: T & Config;
87
+ config: T;
88
88
  add(name: string): Promise<void>;
89
89
  remove(name: string): Promise<void>;
90
90
  get(): Promise<any>;