@verdaccio/node-api 6.0.0-6-next.48 → 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,15 @@
1
1
  # @verdaccio/node-api
2
2
 
3
+ ## 6.0.0-6-next.49
4
+
5
+ ### Patch Changes
6
+
7
+ - @verdaccio/server@6.0.0-6-next.38
8
+ - @verdaccio/server-fastify@6.0.0-6-next.30
9
+ - @verdaccio/core@6.0.0-6-next.49
10
+ - @verdaccio/config@6.0.0-6-next.49
11
+ - @verdaccio/logger@6.0.0-6-next.17
12
+
3
13
  ## 6.0.0-6-next.48
4
14
 
5
15
  ### Major Changes
package/README.md CHANGED
@@ -1,72 +1,5 @@
1
1
  # @verdaccio/node-api
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)
package/build/server.d.ts CHANGED
@@ -17,12 +17,14 @@ export declare function initServer(config: ConfigYaml, port: string | void, vers
17
17
  /**
18
18
  * Exposes a server factory to be instantiated programmatically.
19
19
  *
20
+ ```ts
20
21
  const app = await runServer(); // default configuration
21
22
  const app = await runServer('./config/config.yaml');
22
23
  const app = await runServer({ configuration });
23
24
  app.listen(4000, (event) => {
24
25
  // do something
25
26
  });
27
+ ```
26
28
  * @param config
27
29
  */
28
30
  export declare function runServer(config?: string | ConfigYaml): Promise<any>;
package/build/server.js CHANGED
@@ -197,12 +197,14 @@ async function initServer(config, port, version, pkgName) {
197
197
  /**
198
198
  * Exposes a server factory to be instantiated programmatically.
199
199
  *
200
+ ```ts
200
201
  const app = await runServer(); // default configuration
201
202
  const app = await runServer('./config/config.yaml');
202
203
  const app = await runServer({ configuration });
203
204
  app.listen(4000, (event) => {
204
205
  // do something
205
206
  });
207
+ ```
206
208
  * @param config
207
209
  */
208
210
 
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","names":["debug","buildDebug","unlinkAddressPath","addr","path","fs","existsSync","unlinkSync","createServerFactory","config","app","serverFactory","proto","httpsOptions","secureOptions","constants","SSL_OP_NO_SSLv2","SSL_OP_NO_SSLv3","keyCertConfig","https","pfxConfig","key","cert","pfx","Error","passphrase","assign","readFileSync","ca","createServer","err","message","http","server","keepAliveTimeout","initServer","port","version","pkgName","Promise","resolve","reject","getListListenAddresses","listen","logger","setup","log","displayExperimentsInfoBox","flags","process","env","VERDACCIO_SERVER","fastifyServer","host","expressServer","isFunction","send","verdaccio_started","addressServer","url","format","protocol","pathname","hostname","info","on","exitCode","handleShutdownGracefully","close","exit","signal","once","runServer","configurationParsed","undefined","configPathLocation","findConfigFile","parseConfigFile","_","isObject","API_ERROR","CONFIG_BAD_FORMAT"],"sources":["../src/server.ts"],"sourcesContent":["/* eslint-disable */\nimport constants from 'constants';\nimport buildDebug from 'debug';\nimport fs from 'fs';\nimport http from 'http';\nimport https from 'https';\nimport _, { assign, isFunction } from 'lodash';\nimport url from 'url';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { API_ERROR } from '@verdaccio/core';\nimport { setup } from '@verdaccio/logger';\nimport expressServer from '@verdaccio/server';\nimport fastifyServer from '@verdaccio/server-fastify';\nimport { ConfigYaml, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';\n\nimport { getListListenAddresses } from './cli-utils';\nimport { displayExperimentsInfoBox } from './experiments';\n\nconst debug = buildDebug('verdaccio:node-api');\n\nfunction unlinkAddressPath(addr) {\n if (addr.path && fs.existsSync(addr.path)) {\n fs.unlinkSync(addr.path);\n }\n}\n\n/**\n * Return a native HTTP/HTTPS server instance\n * @param config\n * @param addr\n * @param app\n */\nexport function createServerFactory(config: ConfigYaml, addr, app) {\n let serverFactory;\n if (addr.proto === 'https') {\n debug('https enabled');\n try {\n let httpsOptions = {\n // disable insecure SSLv2 and SSLv3\n secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3,\n };\n\n const keyCertConfig = config.https as HttpsConfKeyCert;\n const pfxConfig = config.https as HttpsConfPfx;\n\n // https must either have key and cert or a pfx and (optionally) a passphrase\n if (!((keyCertConfig.key && keyCertConfig.cert) || pfxConfig.pfx)) {\n // logHTTPSError(configPath);\n throw Error('bad format https configuration');\n }\n\n if (pfxConfig.pfx) {\n const { pfx, passphrase } = pfxConfig;\n httpsOptions = assign(httpsOptions, {\n pfx: fs.readFileSync(pfx),\n passphrase: passphrase || '',\n });\n } else {\n const { key, cert, ca } = keyCertConfig;\n httpsOptions = assign(httpsOptions, {\n key: fs.readFileSync(key),\n cert: fs.readFileSync(cert),\n ...(ca && {\n ca: fs.readFileSync(ca),\n }),\n });\n }\n // TODO: enable http2 as feature\n // if (config.server.http2) <-- check if force http2\n serverFactory = https.createServer(httpsOptions, app);\n } catch (err: any) {\n throw new Error(`cannot create https server: ${err.message}`);\n }\n } else {\n // http\n debug('http enabled');\n serverFactory = http.createServer(app);\n }\n\n if (\n config.server &&\n typeof config.server.keepAliveTimeout !== 'undefined' &&\n // @ts-ignore\n config.server.keepAliveTimeout !== 'null'\n ) {\n // library definition for node is not up to date (doesn't contain recent 8.0 changes)\n serverFactory.keepAliveTimeout = config.server.keepAliveTimeout * 1000;\n }\n // FIXE: I could not find the reason of this code.\n unlinkAddressPath(addr);\n\n return serverFactory;\n}\n\n/**\n * Start the server on the port defined\n * @param config\n * @param port\n * @param version\n * @param pkgName\n */\nexport async function initServer(\n config: ConfigYaml,\n port: string | void,\n version: string,\n pkgName: string\n): Promise<void> {\n return new Promise(async (resolve, reject) => {\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(port, config.listen);\n const logger = setup(config?.log as any);\n displayExperimentsInfoBox(config.flags);\n\n let app;\n if (process.env.VERDACCIO_SERVER === 'fastify') {\n app = await fastifyServer(config);\n app.listen({ port: addr.port, host: addr.host }, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n } else {\n app = await expressServer(config);\n const serverFactory = createServerFactory(config, addr, app);\n serverFactory\n .listen(addr.port || addr.path, addr.host, (): void => {\n // send a message for test\n if (isFunction(process.send)) {\n process.send({\n verdaccio_started: true,\n });\n }\n const addressServer = `${\n addr.path\n ? url.format({\n protocol: 'unix',\n pathname: addr.path,\n })\n : url.format({\n protocol: addr.proto,\n hostname: addr.host,\n port: addr.port,\n pathname: '/',\n })\n }`;\n logger.info(`http address ${addressServer}`);\n logger.info(`version: ${version}`);\n resolve();\n })\n .on('error', function (err): void {\n reject(err);\n process.exitCode = 1;\n });\n function handleShutdownGracefully() {\n logger.info('received shutdown signal - closing server gracefully...');\n serverFactory.close(() => {\n logger.info('server closed.');\n process.exit(0);\n });\n }\n\n for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {\n // Use once() so that receiving double signals exit the app.\n process.once(signal, handleShutdownGracefully);\n }\n }\n });\n}\n\n/**\n * Exposes a server factory to be instantiated programmatically.\n *\n const app = await runServer(); // default configuration\n const app = await runServer('./config/config.yaml');\n const app = await runServer({ configuration });\n app.listen(4000, (event) => {\n // do something\n });\n * @param config\n */\nexport async function runServer(config?: string | ConfigYaml): Promise<any> {\n let configurationParsed: ConfigYaml;\n if (config === undefined || typeof config === 'string') {\n const configPathLocation = findConfigFile(config);\n configurationParsed = parseConfigFile(configPathLocation);\n } else if (_.isObject(config)) {\n configurationParsed = config;\n } else {\n throw new Error(API_ERROR.CONFIG_BAD_FORMAT);\n }\n\n setup(configurationParsed.log as any);\n displayExperimentsInfoBox(configurationParsed.flags);\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(undefined, configurationParsed.listen);\n const app = await expressServer(configurationParsed);\n return createServerFactory(configurationParsed, addr, app);\n}\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;;;;;;;AAjBA;AAmBA,MAAMA,KAAK,GAAG,IAAAC,cAAA,EAAW,oBAAX,CAAd;;AAEA,SAASC,iBAAT,CAA2BC,IAA3B,EAAiC;EAC/B,IAAIA,IAAI,CAACC,IAAL,IAAaC,WAAA,CAAGC,UAAH,CAAcH,IAAI,CAACC,IAAnB,CAAjB,EAA2C;IACzCC,WAAA,CAAGE,UAAH,CAAcJ,IAAI,CAACC,IAAnB;EACD;AACF;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,mBAAT,CAA6BC,MAA7B,EAAiDN,IAAjD,EAAuDO,GAAvD,EAA4D;EACjE,IAAIC,aAAJ;;EACA,IAAIR,IAAI,CAACS,KAAL,KAAe,OAAnB,EAA4B;IAC1BZ,KAAK,CAAC,eAAD,CAAL;;IACA,IAAI;MACF,IAAIa,YAAY,GAAG;QACjB;QACAC,aAAa,EAAEC,kBAAA,CAAUC,eAAV,GAA4BD,kBAAA,CAAUE;MAFpC,CAAnB;MAKA,MAAMC,aAAa,GAAGT,MAAM,CAACU,KAA7B;MACA,MAAMC,SAAS,GAAGX,MAAM,CAACU,KAAzB,CAPE,CASF;;MACA,IAAI,EAAGD,aAAa,CAACG,GAAd,IAAqBH,aAAa,CAACI,IAApC,IAA6CF,SAAS,CAACG,GAAzD,CAAJ,EAAmE;QACjE;QACA,MAAMC,KAAK,CAAC,gCAAD,CAAX;MACD;;MAED,IAAIJ,SAAS,CAACG,GAAd,EAAmB;QACjB,MAAM;UAAEA,GAAF;UAAOE;QAAP,IAAsBL,SAA5B;QACAP,YAAY,GAAG,IAAAa,cAAA,EAAOb,YAAP,EAAqB;UA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MAAf,CAA3B;IACAgE,mBAAmB,GAAG,IAAAI,uBAAA,EAAgBF,kBAAhB,CAAtB;EACD,CAHD,MAGO,IAAIG,eAAA,CAAEC,QAAF,CAAWtE,MAAX,CAAJ,EAAwB;IAC7BgE,mBAAmB,GAAGhE,MAAtB;EACD,CAFM,MAEA;IACL,MAAM,IAAIe,KAAJ,CAAUwD,eAAA,CAAUC,iBAApB,CAAN;EACD;;EAED,IAAApC,aAAA,EAAM4B,mBAAmB,CAAC3B,GAA1B;EACA,IAAAC,sCAAA,EAA0B0B,mBAAmB,CAACzB,KAA9C,EAZ0E,CAa1E;;EACA,MAAM,CAAC7C,IAAD,IAAS,IAAAuC,gCAAA,EAAuBgC,SAAvB,EAAkCD,mBAAmB,CAAC9B,MAAtD,CAAf;EACA,MAAMjC,GAAG,GAAG,MAAM,IAAA4C,eAAA,EAAcmB,mBAAd,CAAlB;EACA,OAAOjE,mBAAmB,CAACiE,mBAAD,EAAsBtE,IAAtB,EAA4BO,GAA5B,CAA1B;AACD"}
1
+ {"version":3,"file":"server.js","names":["debug","buildDebug","unlinkAddressPath","addr","path","fs","existsSync","unlinkSync","createServerFactory","config","app","serverFactory","proto","httpsOptions","secureOptions","constants","SSL_OP_NO_SSLv2","SSL_OP_NO_SSLv3","keyCertConfig","https","pfxConfig","key","cert","pfx","Error","passphrase","assign","readFileSync","ca","createServer","err","message","http","server","keepAliveTimeout","initServer","port","version","pkgName","Promise","resolve","reject","getListListenAddresses","listen","logger","setup","log","displayExperimentsInfoBox","flags","process","env","VERDACCIO_SERVER","fastifyServer","host","expressServer","isFunction","send","verdaccio_started","addressServer","url","format","protocol","pathname","hostname","info","on","exitCode","handleShutdownGracefully","close","exit","signal","once","runServer","configurationParsed","undefined","configPathLocation","findConfigFile","parseConfigFile","_","isObject","API_ERROR","CONFIG_BAD_FORMAT"],"sources":["../src/server.ts"],"sourcesContent":["/* eslint-disable */\nimport constants from 'constants';\nimport buildDebug from 'debug';\nimport fs from 'fs';\nimport http from 'http';\nimport https from 'https';\nimport _, { assign, isFunction } from 'lodash';\nimport url from 'url';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { API_ERROR } from '@verdaccio/core';\nimport { setup } from '@verdaccio/logger';\nimport expressServer from '@verdaccio/server';\nimport fastifyServer from '@verdaccio/server-fastify';\nimport { ConfigYaml, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';\n\nimport { getListListenAddresses } from './cli-utils';\nimport { displayExperimentsInfoBox } from './experiments';\n\nconst debug = buildDebug('verdaccio:node-api');\n\nfunction unlinkAddressPath(addr) {\n if (addr.path && fs.existsSync(addr.path)) {\n fs.unlinkSync(addr.path);\n }\n}\n\n/**\n * Return a native HTTP/HTTPS server instance\n * @param config\n * @param addr\n * @param app\n */\nexport function createServerFactory(config: ConfigYaml, addr, app) {\n let serverFactory;\n if (addr.proto === 'https') {\n debug('https enabled');\n try {\n let httpsOptions = {\n // disable insecure SSLv2 and SSLv3\n secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3,\n };\n\n const keyCertConfig = config.https as HttpsConfKeyCert;\n const pfxConfig = config.https as HttpsConfPfx;\n\n // https must either have key and cert or a pfx and (optionally) a passphrase\n if (!((keyCertConfig.key && keyCertConfig.cert) || pfxConfig.pfx)) {\n // logHTTPSError(configPath);\n throw Error('bad format https configuration');\n }\n\n if (pfxConfig.pfx) {\n const { pfx, passphrase } = pfxConfig;\n httpsOptions = assign(httpsOptions, {\n pfx: fs.readFileSync(pfx),\n passphrase: passphrase || '',\n });\n } else {\n const { key, cert, ca } = keyCertConfig;\n httpsOptions = assign(httpsOptions, {\n key: fs.readFileSync(key),\n cert: fs.readFileSync(cert),\n ...(ca && {\n ca: fs.readFileSync(ca),\n }),\n });\n }\n // TODO: enable http2 as feature\n // if (config.server.http2) <-- check if force http2\n serverFactory = https.createServer(httpsOptions, app);\n } catch (err: any) {\n throw new Error(`cannot create https server: ${err.message}`);\n }\n } else {\n // http\n debug('http enabled');\n serverFactory = http.createServer(app);\n }\n\n if (\n config.server &&\n typeof config.server.keepAliveTimeout !== 'undefined' &&\n // @ts-ignore\n config.server.keepAliveTimeout !== 'null'\n ) {\n // library definition for node is not up to date (doesn't contain recent 8.0 changes)\n serverFactory.keepAliveTimeout = config.server.keepAliveTimeout * 1000;\n }\n // FIXE: I could not find the reason of this code.\n unlinkAddressPath(addr);\n\n return serverFactory;\n}\n\n/**\n * Start the server on the port defined\n * @param config\n * @param port\n * @param version\n * @param pkgName\n */\nexport async function initServer(\n config: ConfigYaml,\n port: string | void,\n version: string,\n pkgName: string\n): Promise<void> {\n return new Promise(async (resolve, reject) => {\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(port, config.listen);\n const logger = setup(config?.log as any);\n displayExperimentsInfoBox(config.flags);\n\n let app;\n if (process.env.VERDACCIO_SERVER === 'fastify') {\n app = await fastifyServer(config);\n app.listen({ port: addr.port, host: addr.host }, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n } else {\n app = await expressServer(config);\n const serverFactory = createServerFactory(config, addr, app);\n serverFactory\n .listen(addr.port || addr.path, addr.host, (): void => {\n // send a message for test\n if (isFunction(process.send)) {\n process.send({\n verdaccio_started: true,\n });\n }\n const addressServer = `${\n addr.path\n ? url.format({\n protocol: 'unix',\n pathname: addr.path,\n })\n : url.format({\n protocol: addr.proto,\n hostname: addr.host,\n port: addr.port,\n pathname: '/',\n })\n }`;\n logger.info(`http address ${addressServer}`);\n logger.info(`version: ${version}`);\n resolve();\n })\n .on('error', function (err): void {\n reject(err);\n process.exitCode = 1;\n });\n function handleShutdownGracefully() {\n logger.info('received shutdown signal - closing server gracefully...');\n serverFactory.close(() => {\n logger.info('server closed.');\n process.exit(0);\n });\n }\n\n for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {\n // Use once() so that receiving double signals exit the app.\n process.once(signal, handleShutdownGracefully);\n }\n }\n });\n}\n\n/**\n * Exposes a server factory to be instantiated programmatically.\n *\n ```ts\n const app = await runServer(); // default configuration\n const app = await runServer('./config/config.yaml');\n const app = await runServer({ configuration });\n app.listen(4000, (event) => {\n // do something\n });\n ```\n * @param config\n */\nexport async function runServer(config?: string | ConfigYaml): Promise<any> {\n let configurationParsed: ConfigYaml;\n if (config === undefined || typeof config === 'string') {\n const configPathLocation = findConfigFile(config);\n configurationParsed = parseConfigFile(configPathLocation);\n } else if (_.isObject(config)) {\n configurationParsed = config;\n } else {\n throw new Error(API_ERROR.CONFIG_BAD_FORMAT);\n }\n\n setup(configurationParsed.log as any);\n displayExperimentsInfoBox(configurationParsed.flags);\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(undefined, configurationParsed.listen);\n const app = await expressServer(configurationParsed);\n return createServerFactory(configurationParsed, addr, app);\n}\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;;;;;;;AAjBA;AAmBA,MAAMA,KAAK,GAAG,IAAAC,cAAA,EAAW,oBAAX,CAAd;;AAEA,SAASC,iBAAT,CAA2BC,IAA3B,EAAiC;EAC/B,IAAIA,IAAI,CAACC,IAAL,IAAaC,WAAA,CAAGC,UAAH,CAAcH,IAAI,CAACC,IAAnB,CAAjB,EAA2C;IACzCC,WAAA,CAAGE,UAAH,CAAcJ,IAAI,CAACC,IAAnB;EACD;AACF;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,mBAAT,CAA6BC,MAA7B,EAAiDN,IAAjD,EAAuDO,GAAvD,EAA4D;EACjE,IAAIC,aAAJ;;EACA,IAAIR,IAAI,CAACS,KAAL,KAAe,OAAnB,EAA4B;IAC1BZ,KAAK,CAAC,eAAD,CAAL;;IACA,IAAI;MACF,IAAIa,YAAY,GAAG;QACjB;QACAC,aAAa,EAAEC,kBAAA,CAAUC,eAAV,GAA4BD,kBAAA,CAAUE;MAFpC,CAAnB;MAKA,MAAM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,QAAD,EAAW,SAAX,EAAsB,QAAtB,CAArB,EAAsD;QACpD;QACArB,OAAO,CAACsB,IAAR,CAAaD,MAAb,EAAqBH,wBAArB;MACD;IACF;EACF,CA7DM,CAAP;AA8DD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,eAAeK,SAAf,CAAyB/D,MAAzB,EAAqE;EAC1E,IAAIgE,mBAAJ;;EACA,IAAIhE,MAAM,KAAKiE,SAAX,IAAwB,OAAOjE,MAAP,KAAkB,QAA9C,EAAwD;IACtD,MAAMkE,kBAAkB,GAAG,IAAAC,sBAAA,EAAenE,MAAf,CAA3B;IACAgE,mBAAmB,GAAG,IAAAI,uBAAA,EAAgBF,kBAAhB,CAAtB;EACD,CAHD,MAGO,IAAIG,eAAA,CAAEC,QAAF,CAAWtE,MAAX,CAAJ,EAAwB;IAC7BgE,mBAAmB,GAAGhE,MAAtB;EACD,CAFM,MAEA;IACL,MAAM,IAAIe,KAAJ,CAAUwD,eAAA,CAAUC,iBAApB,CAAN;EACD;;EAED,IAAApC,aAAA,EAAM4B,mBAAmB,CAAC3B,GAA1B;EACA,IAAAC,sCAAA,EAA0B0B,mBAAmB,CAACzB,KAA9C,EAZ0E,CAa1E;;EACA,MAAM,CAAC7C,IAAD,IAAS,IAAAuC,gCAAA,EAAuBgC,SAAvB,EAAkCD,mBAAmB,CAAC9B,MAAtD,CAAf;EACA,MAAMjC,GAAG,GAAG,MAAM,IAAA4C,eAAA,EAAcmB,mBAAd,CAAlB;EACA,OAAOjE,mBAAmB,CAACiE,mBAAD,EAAsBtE,IAAtB,EAA4BO,GAA5B,CAA1B;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/node-api",
3
- "version": "6.0.0-6-next.48",
3
+ "version": "6.0.0-6-next.49",
4
4
  "description": "node API",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -30,17 +30,17 @@
30
30
  },
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@verdaccio/core": "6.0.0-6-next.48",
34
- "@verdaccio/config": "6.0.0-6-next.48",
35
- "@verdaccio/logger": "6.0.0-6-next.16",
36
- "@verdaccio/server": "6.0.0-6-next.37",
37
- "@verdaccio/server-fastify": "6.0.0-6-next.29",
38
- "core-js": "3.25.2",
33
+ "@verdaccio/core": "6.0.0-6-next.49",
34
+ "@verdaccio/config": "6.0.0-6-next.49",
35
+ "@verdaccio/logger": "6.0.0-6-next.17",
36
+ "@verdaccio/server": "6.0.0-6-next.38",
37
+ "@verdaccio/server-fastify": "6.0.0-6-next.30",
38
+ "core-js": "3.25.3",
39
39
  "debug": "4.3.4",
40
40
  "lodash": "4.17.21"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "16.11.60",
43
+ "@types/node": "16.11.62",
44
44
  "@verdaccio/types": "11.0.0-6-next.17",
45
45
  "jest-mock-process": "1.5.1",
46
46
  "selfsigned": "1.10.14",
@@ -62,5 +62,5 @@
62
62
  "build": "pnpm run build:js && pnpm run build:types",
63
63
  "test": "jest"
64
64
  },
65
- "readme": "# @verdaccio/node-api\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"
65
+ "readme": "# @verdaccio/node-api\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"
66
66
  }
package/src/server.ts CHANGED
@@ -173,12 +173,14 @@ export async function initServer(
173
173
  /**
174
174
  * Exposes a server factory to be instantiated programmatically.
175
175
  *
176
+ ```ts
176
177
  const app = await runServer(); // default configuration
177
178
  const app = await runServer('./config/config.yaml');
178
179
  const app = await runServer({ configuration });
179
180
  app.listen(4000, (event) => {
180
181
  // do something
181
182
  });
183
+ ```
182
184
  * @param config
183
185
  */
184
186
  export async function runServer(config?: string | ConfigYaml): Promise<any> {
@@ -15,7 +15,7 @@ describe('startServer via API', () => {
15
15
  });
16
16
 
17
17
  test('should fail on start with null as entry', async () => {
18
- // @ts-expected-error
18
+ // @ts-expect-error
19
19
  await expect(runServer(null)).rejects.toThrow();
20
20
  });
21
21
  });
@@ -4,6 +4,5 @@
4
4
  "rootDir": "./src",
5
5
  "outDir": "./build"
6
6
  },
7
- "include": ["src/**/*.ts"],
8
- "exclude": ["src/**/*.test.ts"]
7
+ "include": ["src/**/*.ts", "types/*.d.ts"]
9
8
  }
package/tsconfig.json CHANGED
@@ -4,21 +4,15 @@
4
4
  "rootDir": "./src",
5
5
  "outDir": "./build"
6
6
  },
7
- "include": ["src/**/*"],
7
+ "include": ["src/**/*.ts", "types/*.d.ts"],
8
8
  "exclude": ["src/**/*.test.ts"],
9
9
  "references": [
10
10
  {
11
11
  "path": "../config"
12
12
  },
13
- {
14
- "path": "../core/cli-ui"
15
- },
16
13
  {
17
14
  "path": "../logger"
18
15
  },
19
- {
20
- "path": "../mock"
21
- },
22
16
  {
23
17
  "path": "../server/express"
24
18
  },