@verdaccio/config 6.0.0-6-next.47 → 6.0.0-6-next.49

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,83 @@
1
1
  # @verdaccio/config
2
2
 
3
+ ## 6.0.0-6-next.49
4
+
5
+ ### Patch Changes
6
+
7
+ - @verdaccio/core@6.0.0-6-next.49
8
+ - @verdaccio/utils@6.0.0-6-next.17
9
+
10
+ ## 6.0.0-6-next.48
11
+
12
+ ### Major Changes
13
+
14
+ - 9fc2e796: feat(plugins): improve plugin loader
15
+
16
+ ### Changes
17
+
18
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
19
+ - Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
20
+ - https://github.com/verdaccio/verdaccio/issues/1394
21
+ - `config.plugins` plugin path validations
22
+ - Updated algorithm for plugin loader.
23
+ - improved documentation (included dev)
24
+
25
+ ## Features
26
+
27
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
28
+ - Custom prefix:
29
+
30
+ ```
31
+ // config.yaml
32
+ server:
33
+ pluginPrefix: mycompany
34
+ middleware:
35
+ audit:
36
+ foo: 1
37
+ ```
38
+
39
+ This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
40
+
41
+ ## Breaking Changes
42
+
43
+ ### sinopia plugins
44
+
45
+ - `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
46
+
47
+ ### plugin filter
48
+
49
+ - method rename `filter_metadata`->`filterMetadata`
50
+
51
+ ### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
52
+
53
+ The plugin receives as first argument `config`, which represents the config of the plugin. Example:
54
+
55
+ ```
56
+ // config.yaml
57
+ auth:
58
+ plugin:
59
+ foo: 1
60
+ bar: 2
61
+
62
+ export class Plugin<T> {
63
+ public constructor(config: T, options: PluginOptions) {
64
+ console.log(config);
65
+ // {foo:1, bar: 2}
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### Minor Changes
71
+
72
+ - 62c24b63: feat: add passwordValidationRegex property
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [43f32687]
77
+ - Updated dependencies [62c24b63]
78
+ - @verdaccio/core@6.0.0-6-next.48
79
+ - @verdaccio/utils@6.0.0-6-next.16
80
+
3
81
  ## 6.0.0-6-next.47
4
82
 
5
83
  ### Patch Changes
package/README.md CHANGED
@@ -1,72 +1,5 @@
1
1
  # @verdaccio/config
2
2
 
3
- [![backers](https://opencollective.com/verdaccio/tiers/backer/badge.svg?label=Backer&color=brightgreen)](https://opencollective.com/verdaccio)
4
- [![stackshare](https://img.shields.io/badge/Follow%20on-StackShare-blue.svg?logo=stackshare&style=flat)](https://stackshare.io/verdaccio)
5
- [![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
6
- [![Crowdin](https://d322cqt584bo4o.cloudfront.net/verdaccio/localized.svg)](https://crowdin.com/project/verdaccio)
7
- [![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/verdaccio/verdaccio)](https://www.tickgit.com/browse?repo=github.com/verdaccio/verdaccio)
8
-
9
- [![Twitter followers](https://img.shields.io/twitter/follow/verdaccio_npm.svg?style=social&label=Follow)](https://twitter.com/verdaccio_npm)
10
- [![Github](https://img.shields.io/github/stars/verdaccio/verdaccio.svg?style=social&label=Stars)](https://github.com/verdaccio/verdaccio/stargazers)
11
-
12
- ## Donations
13
-
14
- Verdaccio is run by **volunteers**; nobody is working full-time on it. If you find this project to be useful and would like to support its development, consider making a donation - **your logo might end up in this readme.** 😉
15
-
16
- **[Donate](https://opencollective.com/verdaccio)** 💵👍🏻 starting from _\$1/month_ or just one single contribution.
17
-
18
- ## Report a vulnerability
19
-
20
- If you want to report a security vulnerability, please follow the steps which we have defined for you in our [security policy](https://github.com/verdaccio/verdaccio/security/policy).
21
-
22
- ## Open Collective Sponsors
23
-
24
- Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/verdaccio#sponsor)]
25
-
26
- [![sponsor](https://opencollective.com/verdaccio/sponsor/0/avatar.svg)](https://opencollective.com/verdaccio/sponsor/0/website)
27
- [![sponsor](https://opencollective.com/verdaccio/sponsor/1/avatar.svg)](https://opencollective.com/verdaccio/sponsor/1/website)
28
- [![sponsor](https://opencollective.com/verdaccio/sponsor/2/avatar.svg)](https://opencollective.com/verdaccio/sponsor/2/website)
29
- [![sponsor](https://opencollective.com/verdaccio/sponsor/3/avatar.svg)](https://opencollective.com/verdaccio/sponsor/3/website)
30
- [![sponsor](https://opencollective.com/verdaccio/sponsor/4/avatar.svg)](https://opencollective.com/verdaccio/sponsor/4/website)
31
- [![sponsor](https://opencollective.com/verdaccio/sponsor/5/avatar.svg)](https://opencollective.com/verdaccio/sponsor/5/website)
32
- [![sponsor](https://opencollective.com/verdaccio/sponsor/6/avatar.svg)](https://opencollective.com/verdaccio/sponsor/6/website)
33
- [![sponsor](https://opencollective.com/verdaccio/sponsor/7/avatar.svg)](https://opencollective.com/verdaccio/sponsor/7/website)
34
- [![sponsor](https://opencollective.com/verdaccio/sponsor/8/avatar.svg)](https://opencollective.com/verdaccio/sponsor/8/website)
35
- [![sponsor](https://opencollective.com/verdaccio/sponsor/9/avatar.svg)](https://opencollective.com/verdaccio/sponsor/9/website)
36
-
37
- ## Open Collective Backers
38
-
39
- Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/verdaccio#backer)]
40
-
41
- [![backers](https://opencollective.com/verdaccio/backers.svg?width=890)](https://opencollective.com/verdaccio#backers)
42
-
43
- ## Special Thanks
44
-
45
- Thanks to the following companies to help us to achieve our goals providing free open source licenses.
46
-
47
- [![jetbrain](assets/thanks/jetbrains/logo.png)](https://www.jetbrains.com/)
48
- [![crowdin](assets/thanks/crowdin/logo.png)](https://crowdin.com/)
49
- [![balsamiq](assets/thanks/balsamiq/logo.jpg)](https://balsamiq.com/)
50
-
51
- ## Contributors
52
-
53
- This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
54
-
55
- [![contributors](https://opencollective.com/verdaccio/contributors.svg?width=890&button=true)](../../graphs/contributors)
56
-
57
- ### FAQ / Contact / Troubleshoot
58
-
59
- If you have any issue you can try the following options, do no desist to ask or check our issues database, perhaps someone has asked already what you are looking for.
60
-
61
- - [Blog](https://verdaccio.org/blog/)
62
- - [Donations](https://opencollective.com/verdaccio)
63
- - [Reporting an issue](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md#reporting-a-bug)
64
- - [Running discussions](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Adiscuss)
65
- - [Chat](http://chat.verdaccio.org/)
66
- - [Logos](https://verdaccio.org/docs/en/logo)
67
- - [Docker Examples](https://github.com/verdaccio/docker-examples)
68
- - [FAQ](https://github.com/verdaccio/verdaccio/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)
69
-
70
3
  ### License
71
4
 
72
5
  Verdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
@@ -11,8 +11,9 @@
11
11
 
12
12
  # path to a directory with all packages
13
13
  storage: ./storage
14
- # path to a directory with plugins to include
15
- plugins: ./plugins
14
+ # path to a directory with plugins to include, the plugins folder has the higher priority for loading plugins
15
+ # disable this folder to avoid warnings if is not used
16
+ # plugins: ./plugins
16
17
 
17
18
  # https://verdaccio.org/docs/webui
18
19
  web:
@@ -99,6 +100,12 @@ packages:
99
100
  # WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
100
101
  server:
101
102
  keepAliveTimeout: 60
103
+ # The pluginPrefix replaces the default plugins prefix which is `verdaccio`, please don't include `-`. If `something` is provided
104
+ # the resolve package will be `something-xxxx`.
105
+ # pluginPrefix: something
106
+ # A regex for the password validation /.{3}$/ (3 characters min)
107
+ # An example to limit to 10 characters minimum
108
+ # passwordValidationRegex: /.{10}$/
102
109
 
103
110
  # https://verdaccio.org/docs/configuration#offline-publish
104
111
  # publish:
@@ -14,7 +14,8 @@
14
14
 
15
15
  # path to a directory with all packages
16
16
  storage: /verdaccio/storage/data
17
- # path to a directory with plugins to include
17
+ # path to a directory with plugins to include, the plugins folder has the higher priority for loading plugins
18
+ # disable this folder to avoid warnings if is not used
18
19
  plugins: /verdaccio/plugins
19
20
 
20
21
  # https://verdaccio.org/docs/webui
@@ -105,6 +106,12 @@ packages:
105
106
  # https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
106
107
  server:
107
108
  keepAliveTimeout: 60
109
+ # The pluginPrefix replaces the default plugins prefix which is `verdaccio`, please don't include `-`. If `something` is provided
110
+ # the resolve package will be `something-xxxx`.
111
+ # pluginPrefix: something
112
+ # A regex for the password validation /.{3}$/ (3 characters min)
113
+ # An example to limit to 10 characters minimum
114
+ # passwordValidationRegex: /.{10}$/
108
115
 
109
116
  # https://verdaccio.org/docs/configuration#offline-publish
110
117
  # publish:
package/build/config.d.ts CHANGED
@@ -13,7 +13,7 @@ declare class Config implements AppConfig {
13
13
  config_path: string;
14
14
  configPath: string;
15
15
  storage: string | void;
16
- plugins: string | void;
16
+ plugins: string | void | null;
17
17
  security: Security;
18
18
  serverSettings: ServerSettingsConf;
19
19
  secret: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["strategicConfigProps","allowedEnvConfig","debug","buildDebug","WEB_TITLE","Config","constructor","config","self","storage","process","env","VERDACCIO_STORAGE_PATH","configPath","Error","config_path","plugins","security","_","merge","defaultSecurity","serverSettings","flags","searchRemote","configProp","isNil","user_agent","getUserAgent","assert","isObject","APP_ERROR","CONFIG_NOT_VALID","forEach","x","uplinks","sanityCheckUplinksProps","uplinkSanityCheck","packages","normalisePackageAccess","envConf","toUpperCase","server_id","generateRandomHexString","getMatchedPackagesSpec","pkgName","checkSecretKey","secret","isString","isEmpty","generateRandomSecretKey"],"sources":["../src/config.ts"],"sourcesContent":["import assert from 'assert';\nimport buildDebug from 'debug';\nimport _ from 'lodash';\n\nimport { APP_ERROR } from '@verdaccio/core';\nimport {\n Config as AppConfig,\n AuthConf,\n ConfigYaml,\n FlagsConfig,\n PackageAccess,\n PackageList,\n Security,\n ServerSettingsConf,\n} from '@verdaccio/types';\nimport { generateRandomHexString, getMatchedPackagesSpec, isObject } from '@verdaccio/utils';\n\nimport { getUserAgent } from './agent';\nimport { normalisePackageAccess } from './package-access';\nimport { defaultSecurity } from './security';\nimport serverSettings from './serverSettings';\nimport { generateRandomSecretKey } from './token';\nimport { sanityCheckUplinksProps, uplinkSanityCheck } from './uplinks';\n\nconst strategicConfigProps = ['uplinks', 'packages'];\nconst allowedEnvConfig = ['http_proxy', 'https_proxy', 'no_proxy'];\nconst debug = buildDebug('verdaccio:config');\n\nexport const WEB_TITLE = 'Verdaccio';\n\n/**\n * Coordinates the application configuration\n */\nclass Config implements AppConfig {\n public user_agent: string;\n public uplinks: any;\n public packages: PackageList;\n public users: any;\n public auth: AuthConf;\n public server_id: string;\n // @deprecated use configPath instead\n public config_path: string;\n public configPath: string;\n public storage: string | void;\n\n public plugins: string | void;\n public security: Security;\n public serverSettings: ServerSettingsConf;\n // @ts-ignore\n public secret: string;\n public flags: FlagsConfig;\n\n public constructor(config: ConfigYaml & { config_path: string }) {\n const self = this;\n this.storage = process.env.VERDACCIO_STORAGE_PATH || config.storage;\n if (!config.configPath) {\n throw new Error('config_path is required');\n }\n this.config_path = config.config_path ?? (config.configPath as string);\n this.configPath = config.configPath;\n debug('config path: %s', this.configPath);\n this.plugins = config.plugins;\n this.security = _.merge(defaultSecurity, config.security);\n this.serverSettings = serverSettings;\n this.flags = {\n searchRemote: config.flags?.searchRemote ?? true,\n };\n\n for (const configProp in config) {\n if (self[configProp] == null) {\n self[configProp] = config[configProp];\n }\n }\n\n // @ts-ignore\n if (_.isNil(this.user_agent)) {\n this.user_agent = getUserAgent();\n }\n\n // some weird shell scripts are valid yaml files parsed as string\n assert(_.isObject(config), APP_ERROR.CONFIG_NOT_VALID);\n\n // sanity check for strategic config properties\n strategicConfigProps.forEach(function (x): void {\n if (self[x] == null) {\n self[x] = {};\n }\n\n assert(isObject(self[x]), `CONFIG: bad \"${x}\" value (object expected)`);\n });\n\n this.uplinks = sanityCheckUplinksProps(uplinkSanityCheck(this.uplinks));\n this.packages = normalisePackageAccess(self.packages);\n\n // loading these from ENV if aren't in config\n allowedEnvConfig.forEach((envConf): void => {\n if (!(envConf in self)) {\n self[envConf] = process.env[envConf] || process.env[envConf.toUpperCase()];\n }\n });\n\n // unique identifier of self server (or a cluster), used to avoid loops\n // @ts-ignore\n if (!this.server_id) {\n this.server_id = generateRandomHexString(6);\n }\n }\n\n /**\n * Check for package spec\n */\n public getMatchedPackagesSpec(pkgName: string): PackageAccess | void {\n // TODO: remove this method and replace by library utils\n return getMatchedPackagesSpec(pkgName, this.packages);\n }\n\n /**\n * Store or create whether receive a secret key\n */\n public checkSecretKey(secret?: string): string {\n debug('check secret key');\n if (_.isString(secret) && _.isEmpty(secret) === false) {\n this.secret = secret;\n debug('reusing previous key');\n return secret;\n }\n // it generates a secret key\n // FUTURE: this might be an external secret key, perhaps within config file?\n debug('generate a new key');\n this.secret = generateRandomSecretKey();\n return this.secret;\n }\n}\n\nexport { Config };\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAWA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,oBAAoB,GAAG,CAAC,SAAD,EAAY,UAAZ,CAA7B;AACA,MAAMC,gBAAgB,GAAG,CAAC,YAAD,EAAe,aAAf,EAA8B,UAA9B,CAAzB;AACA,MAAMC,KAAK,GAAG,IAAAC,cAAA,EAAW,kBAAX,CAAd;AAEO,MAAMC,SAAS,GAAG,WAAlB;AAEP;AACA;AACA;;;;AACA,MAAMC,MAAN,CAAkC;EAOhC;EAQA;EAIOC,WAAW,CAACC,MAAD,EAA+C;IAAA;;IA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,oBAAD,CAAL;IACA,KAAK4C,MAAL,GAAc,IAAAG,8BAAA,GAAd;IACA,OAAO,KAAKH,MAAZ;EACD;;AAlG+B"}
1
+ {"version":3,"file":"config.js","names":["strategicConfigProps","allowedEnvConfig","debug","buildDebug","WEB_TITLE","Config","constructor","config","self","storage","process","env","VERDACCIO_STORAGE_PATH","configPath","Error","config_path","plugins","security","_","merge","defaultSecurity","serverSettings","flags","searchRemote","configProp","isNil","user_agent","getUserAgent","assert","isObject","APP_ERROR","CONFIG_NOT_VALID","forEach","x","uplinks","sanityCheckUplinksProps","uplinkSanityCheck","packages","normalisePackageAccess","envConf","toUpperCase","server_id","generateRandomHexString","getMatchedPackagesSpec","pkgName","checkSecretKey","secret","isString","isEmpty","generateRandomSecretKey"],"sources":["../src/config.ts"],"sourcesContent":["import assert from 'assert';\nimport buildDebug from 'debug';\nimport _ from 'lodash';\n\nimport { APP_ERROR } from '@verdaccio/core';\nimport {\n Config as AppConfig,\n AuthConf,\n ConfigYaml,\n FlagsConfig,\n PackageAccess,\n PackageList,\n Security,\n ServerSettingsConf,\n} from '@verdaccio/types';\nimport { generateRandomHexString, getMatchedPackagesSpec, isObject } from '@verdaccio/utils';\n\nimport { getUserAgent } from './agent';\nimport { normalisePackageAccess } from './package-access';\nimport { defaultSecurity } from './security';\nimport serverSettings from './serverSettings';\nimport { generateRandomSecretKey } from './token';\nimport { sanityCheckUplinksProps, uplinkSanityCheck } from './uplinks';\n\nconst strategicConfigProps = ['uplinks', 'packages'];\nconst allowedEnvConfig = ['http_proxy', 'https_proxy', 'no_proxy'];\nconst debug = buildDebug('verdaccio:config');\n\nexport const WEB_TITLE = 'Verdaccio';\n\n/**\n * Coordinates the application configuration\n */\nclass Config implements AppConfig {\n public user_agent: string;\n public uplinks: any;\n public packages: PackageList;\n public users: any;\n public auth: AuthConf;\n public server_id: string;\n // @deprecated use configPath instead\n public config_path: string;\n public configPath: string;\n public storage: string | void;\n\n public plugins: string | void | null;\n public security: Security;\n public serverSettings: ServerSettingsConf;\n // @ts-ignore\n public secret: string;\n public flags: FlagsConfig;\n\n public constructor(config: ConfigYaml & { config_path: string }) {\n const self = this;\n this.storage = process.env.VERDACCIO_STORAGE_PATH || config.storage;\n if (!config.configPath) {\n throw new Error('config_path is required');\n }\n this.config_path = config.config_path ?? (config.configPath as string);\n this.configPath = config.configPath;\n debug('config path: %s', this.configPath);\n this.plugins = config.plugins;\n this.security = _.merge(defaultSecurity, config.security);\n this.serverSettings = serverSettings;\n this.flags = {\n searchRemote: config.flags?.searchRemote ?? true,\n };\n\n for (const configProp in config) {\n if (self[configProp] == null) {\n self[configProp] = config[configProp];\n }\n }\n\n // @ts-ignore\n if (_.isNil(this.user_agent)) {\n this.user_agent = getUserAgent();\n }\n\n // some weird shell scripts are valid yaml files parsed as string\n assert(_.isObject(config), APP_ERROR.CONFIG_NOT_VALID);\n\n // sanity check for strategic config properties\n strategicConfigProps.forEach(function (x): void {\n if (self[x] == null) {\n self[x] = {};\n }\n\n assert(isObject(self[x]), `CONFIG: bad \"${x}\" value (object expected)`);\n });\n\n this.uplinks = sanityCheckUplinksProps(uplinkSanityCheck(this.uplinks));\n this.packages = normalisePackageAccess(self.packages);\n\n // loading these from ENV if aren't in config\n allowedEnvConfig.forEach((envConf): void => {\n if (!(envConf in self)) {\n self[envConf] = process.env[envConf] || process.env[envConf.toUpperCase()];\n }\n });\n\n // unique identifier of self server (or a cluster), used to avoid loops\n // @ts-ignore\n if (!this.server_id) {\n this.server_id = generateRandomHexString(6);\n }\n }\n\n /**\n * Check for package spec\n */\n public getMatchedPackagesSpec(pkgName: string): PackageAccess | void {\n // TODO: remove this method and replace by library utils\n return getMatchedPackagesSpec(pkgName, this.packages);\n }\n\n /**\n * Store or create whether receive a secret key\n */\n public checkSecretKey(secret?: string): string {\n debug('check secret key');\n if (_.isString(secret) && _.isEmpty(secret) === false) {\n this.secret = secret;\n debug('reusing previous key');\n return secret;\n }\n // it generates a secret key\n // FUTURE: this might be an external secret key, perhaps within config file?\n debug('generate a new key');\n this.secret = generateRandomSecretKey();\n return this.secret;\n }\n}\n\nexport { Config };\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAWA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,oBAAoB,GAAG,CAAC,SAAD,EAAY,UAAZ,CAA7B;AACA,MAAMC,gBAAgB,GAAG,CAAC,YAAD,EAAe,aAAf,EAA8B,UAA9B,CAAzB;AACA,MAAMC,KAAK,GAAG,IAAAC,cAAA,EAAW,kBAAX,CAAd;AAEO,MAAMC,SAAS,GAAG,WAAlB;AAEP;AACA;AACA;;;;AACA,MAAMC,MAAN,CAAkC;EAOhC;EAQA;EAIOC,WAAW,CAACC,MAAD,EAA+C;IAAA;;IAC/D,MAAMC,IAAI,GAAG,IAAb;IACA,KAAKC,OAAL,GAAeC,OAAO,CAACC,GAAR,CAAYC,sBAAZ,IAAsCL,MAAM,CAACE,OAA5D;;IACA,IAAI,CAACF,MAAM,CAACM,UAAZ,EAAwB;MACtB,MAAM,IAAIC,KAAJ,CAAU,yBAAV,CAAN;IACD;;IACD,KAAKC,WAAL,GAAmBR,MAAM,CAACQ,WAAP,IAAuBR,MAAM,CAACM,UAAjD;IACA,KAAKA,UAAL,GAAkBN,MAAM,CAACM,UAAzB;IACAX,KAAK,CAAC,iBAAD,EAAoB,KAAKW,UAAzB,CAAL;IACA,KAAKG,OAAL,GAAeT,MAAM,CAACS,OAAtB;IACA,KAAKC,QAAL,GAAgBC,eAAA,CAAEC,KAAF,CAAQC,yBAAR,EAAyBb,MAAM,CAACU,QAAhC,CAAhB;IACA,KAAKI,cAAL,GAAsBA,uBAAtB;IACA,KAAKC,KAAL,GAAa;MACXC,YAAY,EAAE,kBAAAhB,MAAM,CAACe,KAAP,gEAAcC,YAAd,KAA8B;IADjC,CAAb;;IAIA,KAAK,MAAMC,UAAX,IAAyBjB,MAAzB,EAAiC;MAC/B,IAAIC,IAAI,CAACgB,UAAD,CA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wB,CAAxB,CAAjB;IACD;EACF;EAED;AACF;AACA;;;EACSC,sBAAsB,CAACC,OAAD,EAAwC;IACnE;IACA,OAAO,IAAAD,6BAAA,EAAuBC,OAAvB,EAAgC,KAAKP,QAArC,CAAP;EACD;EAED;AACF;AACA;;;EACSQ,cAAc,CAACC,MAAD,EAA0B;IAC7C5C,KAAK,CAAC,kBAAD,CAAL;;IACA,IAAIgB,eAAA,CAAE6B,QAAF,CAAWD,MAAX,KAAsB5B,eAAA,CAAE8B,OAAF,CAAUF,MAAV,MAAsB,KAAhD,EAAuD;MACrD,KAAKA,MAAL,GAAcA,MAAd;MACA5C,KAAK,CAAC,sBAAD,CAAL;MACA,OAAO4C,MAAP;IACD,CAN4C,CAO7C;IACA;;;IACA5C,KAAK,CAAC,oBAAD,CAAL;IACA,KAAK4C,MAAL,GAAc,IAAAG,8BAAA,GAAd;IACA,OAAO,KAAKH,MAAZ;EACD;;AAlG+B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/config",
3
- "version": "6.0.0-6-next.47",
3
+ "version": "6.0.0-6-next.49",
4
4
  "description": "logger",
5
5
  "main": "./build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -30,8 +30,8 @@
30
30
  "npm": ">=6"
31
31
  },
32
32
  "dependencies": {
33
- "@verdaccio/core": "6.0.0-6-next.47",
34
- "@verdaccio/utils": "6.0.0-6-next.15",
33
+ "@verdaccio/core": "6.0.0-6-next.49",
34
+ "@verdaccio/utils": "6.0.0-6-next.17",
35
35
  "debug": "4.3.4",
36
36
  "yaml": "2.1.1",
37
37
  "lodash": "4.17.21",
@@ -55,5 +55,5 @@
55
55
  "watch": "pnpm build:js -- --watch",
56
56
  "build": "pnpm run build:js && pnpm run build:types"
57
57
  },
58
- "readme": "# @verdaccio/config\n\n[![backers](https://opencollective.com/verdaccio/tiers/backer/badge.svg?label=Backer&color=brightgreen)](https://opencollective.com/verdaccio)\n[![stackshare](https://img.shields.io/badge/Follow%20on-StackShare-blue.svg?logo=stackshare&style=flat)](https://stackshare.io/verdaccio)\n[![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)\n[![Crowdin](https://d322cqt584bo4o.cloudfront.net/verdaccio/localized.svg)](https://crowdin.com/project/verdaccio)\n[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/verdaccio/verdaccio)](https://www.tickgit.com/browse?repo=github.com/verdaccio/verdaccio)\n\n[![Twitter followers](https://img.shields.io/twitter/follow/verdaccio_npm.svg?style=social&label=Follow)](https://twitter.com/verdaccio_npm)\n[![Github](https://img.shields.io/github/stars/verdaccio/verdaccio.svg?style=social&label=Stars)](https://github.com/verdaccio/verdaccio/stargazers)\n\n## Donations\n\nVerdaccio is run by **volunteers**; nobody is working full-time on it. If you find this project to be useful and would like to support its development, consider making a donation - **your logo might end up in this readme.** 😉\n\n**[Donate](https://opencollective.com/verdaccio)** 💵👍🏻 starting from _\\$1/month_ or just one single contribution.\n\n## Report a vulnerability\n\nIf you want to report a security vulnerability, please follow the steps which we have defined for you in our [security policy](https://github.com/verdaccio/verdaccio/security/policy).\n\n## Open Collective Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/verdaccio#sponsor)]\n\n[![sponsor](https://opencollective.com/verdaccio/sponsor/0/avatar.svg)](https://opencollective.com/verdaccio/sponsor/0/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/1/avatar.svg)](https://opencollective.com/verdaccio/sponsor/1/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/2/avatar.svg)](https://opencollective.com/verdaccio/sponsor/2/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/3/avatar.svg)](https://opencollective.com/verdaccio/sponsor/3/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/4/avatar.svg)](https://opencollective.com/verdaccio/sponsor/4/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/5/avatar.svg)](https://opencollective.com/verdaccio/sponsor/5/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/6/avatar.svg)](https://opencollective.com/verdaccio/sponsor/6/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/7/avatar.svg)](https://opencollective.com/verdaccio/sponsor/7/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/8/avatar.svg)](https://opencollective.com/verdaccio/sponsor/8/website)\n[![sponsor](https://opencollective.com/verdaccio/sponsor/9/avatar.svg)](https://opencollective.com/verdaccio/sponsor/9/website)\n\n## Open Collective Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/verdaccio#backer)]\n\n[![backers](https://opencollective.com/verdaccio/backers.svg?width=890)](https://opencollective.com/verdaccio#backers)\n\n## Special Thanks\n\nThanks to the following companies to help us to achieve our goals providing free open source licenses.\n\n[![jetbrain](assets/thanks/jetbrains/logo.png)](https://www.jetbrains.com/)\n[![crowdin](assets/thanks/crowdin/logo.png)](https://crowdin.com/)\n[![balsamiq](assets/thanks/balsamiq/logo.jpg)](https://balsamiq.com/)\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n[![contributors](https://opencollective.com/verdaccio/contributors.svg?width=890&button=true)](../../graphs/contributors)\n\n### FAQ / Contact / Troubleshoot\n\nIf you have any issue you can try the following options, do no desist to ask or check our issues database, perhaps someone has asked already what you are looking for.\n\n- [Blog](https://verdaccio.org/blog/)\n- [Donations](https://opencollective.com/verdaccio)\n- [Reporting an issue](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md#reporting-a-bug)\n- [Running discussions](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Adiscuss)\n- [Chat](http://chat.verdaccio.org/)\n- [Logos](https://verdaccio.org/docs/en/logo)\n- [Docker Examples](https://github.com/verdaccio/docker-examples)\n- [FAQ](https://github.com/verdaccio/verdaccio/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)\n\n### License\n\nVerdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)\n\nThe Verdaccio documentation and logos (excluding /thanks, e.g., .md, .png, .sketch) files within the /assets folder) is\n[Creative Commons licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE-docs).\n"
58
+ "readme": "# @verdaccio/config\n\n### License\n\nVerdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)\n\nThe Verdaccio documentation and logos (excluding /thanks, e.g., .md, .png, .sketch) files within the /assets folder) is\n[Creative Commons licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE-docs).\n"
59
59
  }
@@ -11,8 +11,9 @@
11
11
 
12
12
  # path to a directory with all packages
13
13
  storage: ./storage
14
- # path to a directory with plugins to include
15
- plugins: ./plugins
14
+ # path to a directory with plugins to include, the plugins folder has the higher priority for loading plugins
15
+ # disable this folder to avoid warnings if is not used
16
+ # plugins: ./plugins
16
17
 
17
18
  # https://verdaccio.org/docs/webui
18
19
  web:
@@ -99,6 +100,12 @@ packages:
99
100
  # WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
100
101
  server:
101
102
  keepAliveTimeout: 60
103
+ # The pluginPrefix replaces the default plugins prefix which is `verdaccio`, please don't include `-`. If `something` is provided
104
+ # the resolve package will be `something-xxxx`.
105
+ # pluginPrefix: something
106
+ # A regex for the password validation /.{3}$/ (3 characters min)
107
+ # An example to limit to 10 characters minimum
108
+ # passwordValidationRegex: /.{10}$/
102
109
 
103
110
  # https://verdaccio.org/docs/configuration#offline-publish
104
111
  # publish:
@@ -14,7 +14,8 @@
14
14
 
15
15
  # path to a directory with all packages
16
16
  storage: /verdaccio/storage/data
17
- # path to a directory with plugins to include
17
+ # path to a directory with plugins to include, the plugins folder has the higher priority for loading plugins
18
+ # disable this folder to avoid warnings if is not used
18
19
  plugins: /verdaccio/plugins
19
20
 
20
21
  # https://verdaccio.org/docs/webui
@@ -105,6 +106,12 @@ packages:
105
106
  # https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
106
107
  server:
107
108
  keepAliveTimeout: 60
109
+ # The pluginPrefix replaces the default plugins prefix which is `verdaccio`, please don't include `-`. If `something` is provided
110
+ # the resolve package will be `something-xxxx`.
111
+ # pluginPrefix: something
112
+ # A regex for the password validation /.{3}$/ (3 characters min)
113
+ # An example to limit to 10 characters minimum
114
+ # passwordValidationRegex: /.{10}$/
108
115
 
109
116
  # https://verdaccio.org/docs/configuration#offline-publish
110
117
  # publish:
package/src/config.ts CHANGED
@@ -43,7 +43,7 @@ class Config implements AppConfig {
43
43
  public configPath: string;
44
44
  public storage: string | void;
45
45
 
46
- public plugins: string | void;
46
+ public plugins: string | void | null;
47
47
  public security: Security;
48
48
  public serverSettings: ServerSettingsConf;
49
49
  // @ts-ignore