@verdaccio/node-api 6.0.0-6-next.76 → 7.0.0-next-7.8

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,419 @@
1
1
  # @verdaccio/node-api
2
2
 
3
+ ## 7.0.0-next-7.8
4
+
5
+ ### Patch Changes
6
+
7
+ - @verdaccio/server@7.0.0-next-7.8
8
+ - @verdaccio/core@7.0.0-next-7.8
9
+ - @verdaccio/config@7.0.0-next-7.8
10
+ - @verdaccio/server-fastify@7.0.0-next-7.8
11
+ - @verdaccio/logger@7.0.0-next-7.8
12
+
13
+ ## 7.0.0-next-7.7
14
+
15
+ ### Patch Changes
16
+
17
+ - @verdaccio/core@7.0.0-next-7.7
18
+ - @verdaccio/config@7.0.0-next-7.7
19
+ - @verdaccio/server@7.0.0-next-7.7
20
+ - @verdaccio/server-fastify@7.0.0-next-7.7
21
+ - @verdaccio/logger@7.0.0-next-7.7
22
+
23
+ ## 7.0.0-next.6
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [4d96324]
28
+ - @verdaccio/config@7.0.0-next.6
29
+ - @verdaccio/server@7.0.0-next.6
30
+ - @verdaccio/server-fastify@7.0.0-next.6
31
+ - @verdaccio/core@7.0.0-next.6
32
+ - @verdaccio/logger@7.0.0-next.6
33
+
34
+ ## 7.0.0-next.5
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [f047cc8]
39
+ - @verdaccio/server@7.0.0-next.5
40
+ - @verdaccio/core@7.0.0-next.5
41
+ - @verdaccio/config@7.0.0-next.5
42
+ - @verdaccio/logger@7.0.0-next.5
43
+ - @verdaccio/server-fastify@7.0.0-next.5
44
+
45
+ ## 7.0.0-next.4
46
+
47
+ ### Patch Changes
48
+
49
+ - @verdaccio/server@7.0.0-next.4
50
+ - @verdaccio/server-fastify@7.0.0-next.4
51
+ - @verdaccio/core@7.0.0-next.4
52
+ - @verdaccio/config@7.0.0-next.4
53
+ - @verdaccio/logger@7.0.0-next.4
54
+
55
+ ## 7.0.0-next.3
56
+
57
+ ### Major Changes
58
+
59
+ - e7ebccb61: update major dependencies, remove old nodejs support
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [daceb6d87]
64
+ - Updated dependencies [e7ebccb61]
65
+ - Updated dependencies [3ca405618]
66
+ - @verdaccio/config@7.0.0-next.3
67
+ - @verdaccio/core@7.0.0-next.3
68
+ - @verdaccio/logger@7.0.0-next.3
69
+ - @verdaccio/server@7.0.0-next.3
70
+ - @verdaccio/server-fastify@7.0.0-next.3
71
+
72
+ ## 7.0.0-next.2
73
+
74
+ ### Patch Changes
75
+
76
+ - @verdaccio/core@7.0.0-next.2
77
+ - @verdaccio/config@7.0.0-next.2
78
+ - @verdaccio/server@7.0.0-next.2
79
+ - @verdaccio/server-fastify@7.0.0-next.2
80
+ - @verdaccio/logger@7.0.0-next.2
81
+
82
+ ## 7.0.0-next.1
83
+
84
+ ### Patch Changes
85
+
86
+ - @verdaccio/core@7.0.0-next.1
87
+ - @verdaccio/config@7.0.0-next.1
88
+ - @verdaccio/server@7.0.0-next.1
89
+ - @verdaccio/server-fastify@7.0.0-next.1
90
+ - @verdaccio/logger@7.0.0-next.1
91
+
92
+ ## 7.0.0-next.0
93
+
94
+ ### Major Changes
95
+
96
+ - feat!: bump to v7
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies
101
+ - @verdaccio/config@7.0.0-next.0
102
+ - @verdaccio/core@7.0.0-next.0
103
+ - @verdaccio/logger@7.0.0-next.0
104
+ - @verdaccio/server@7.0.0-next.0
105
+ - @verdaccio/server-fastify@7.0.0-next.0
106
+
107
+ ## 6.0.0
108
+
109
+ ### Major Changes
110
+
111
+ - 292c0a37f: feat!: replace deprecated request dependency by got
112
+
113
+ This is a big refactoring of the core, fetching dependencies, improve code, more tests and better stability. This is essential for the next release, will take some time but would allow modularize more the core.
114
+
115
+ ## Notes
116
+
117
+ - Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
118
+ - Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
119
+ - Refactor with promises instead callback wherever is possible
120
+ - ~Document the API~
121
+ - Improve testing, integration tests
122
+ - Bugfix
123
+ - Clean up old validations
124
+ - Improve performance
125
+
126
+ ## 💥 Breaking changes
127
+
128
+ - Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
129
+ - Write Tarball, Read Tarball methods parameters change, a new set of options like `AbortController` signals are being provided to the `addAbortSignal` can be internally used with Streams when a request is aborted. eg: `addAbortSignal(signal, fs.createReadStream(pathName));`
130
+ - `@verdaccio/streams` stream abort support is legacy is being deprecated removed
131
+ - Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
132
+
133
+ - 9fc2e7961: feat(plugins): improve plugin loader
134
+
135
+ ### Changes
136
+
137
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
138
+ - Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
139
+ - https://github.com/verdaccio/verdaccio/issues/1394
140
+ - `config.plugins` plugin path validations
141
+ - Updated algorithm for plugin loader.
142
+ - improved documentation (included dev)
143
+
144
+ ## Features
145
+
146
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
147
+ - Custom prefix:
148
+
149
+ ```
150
+ // config.yaml
151
+ server:
152
+ pluginPrefix: mycompany
153
+ middleware:
154
+ audit:
155
+ foo: 1
156
+ ```
157
+
158
+ This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
159
+
160
+ ## Breaking Changes
161
+
162
+ ### sinopia plugins
163
+
164
+ - `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
165
+
166
+ ### plugin filter
167
+
168
+ - method rename `filter_metadata`->`filterMetadata`
169
+
170
+ ### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
171
+
172
+ The plugin receives as first argument `config`, which represents the config of the plugin. Example:
173
+
174
+ ```
175
+ // config.yaml
176
+ auth:
177
+ plugin:
178
+ foo: 1
179
+ bar: 2
180
+
181
+ export class Plugin<T> {
182
+ public constructor(config: T, options: PluginOptions) {
183
+ console.log(config);
184
+ // {foo:1, bar: 2}
185
+ }
186
+ }
187
+ ```
188
+
189
+ - 794af76c5: Remove Node 12 support
190
+
191
+ - We need move to the new `undici` and does not support Node.js 12
192
+
193
+ - 10aeb4f13: feat!: experiments config renamed to flags
194
+
195
+ - The `experiments` configuration is renamed to `flags`. The functionality is exactly the same.
196
+
197
+ ```js
198
+ flags: token: false;
199
+ search: false;
200
+ ```
201
+
202
+ - The `self_path` property from the config file is being removed in favor of `config_file` full path.
203
+ - Refactor `config` module, better types and utilities
204
+
205
+ - e367c3f1e: - Replace signature handler for legacy tokens by removing deprecated crypto.createDecipher by createCipheriv
206
+
207
+ - Introduce environment variables for legacy tokens
208
+
209
+ ### Code Improvements
210
+
211
+ - Add debug library for improve developer experience
212
+
213
+ ### Breaking change
214
+
215
+ - The new signature invalidates all previous tokens generated by Verdaccio 4 or previous versions.
216
+ - The secret key must have 32 characters long.
217
+
218
+ ### New environment variables
219
+
220
+ - `VERDACCIO_LEGACY_ALGORITHM`: Allows to define the specific algorithm for the token signature which by default is `aes-256-ctr`
221
+ - `VERDACCIO_LEGACY_ENCRYPTION_KEY`: By default, the token stores in the database, but using this variable allows to get it from memory
222
+
223
+ - 82cb0f2bf: feat!: config.logs throw an error, logging config not longer accept array or logs property
224
+
225
+ ### 💥 Breaking change
226
+
227
+ This is valid
228
+
229
+ ```yaml
230
+ log: { type: stdout, format: pretty, level: http }
231
+ ```
232
+
233
+ This is invalid
234
+
235
+ ```yaml
236
+ logs: { type: stdout, format: pretty, level: http }
237
+ ```
238
+
239
+ or
240
+
241
+ ```yaml
242
+ logs:
243
+ - [{ type: stdout, format: pretty, level: http }]
244
+ ```
245
+
246
+ - 8f43bf17d: feat: node api new structure based on promise
247
+
248
+ ```js
249
+ import { runServer } from "@verdaccio/node-api";
250
+ // or
251
+ import { runServer } from "verdaccio";
252
+
253
+ const app = await runServer(); // default configuration
254
+ const app = await runServer("./config/config.yaml");
255
+ const app = await runServer({ configuration });
256
+ app.listen(4000, (event) => {
257
+ // do something
258
+ });
259
+ ```
260
+
261
+ ### Breaking Change
262
+
263
+ If you are using the node-api, the new structure is Promise based and less arguments.
264
+
265
+ ### Minor Changes
266
+
267
+ - 631abe1ac: feat: refactor logger
268
+ - 00d1d2a17: chore: env variable for launch fastify
269
+
270
+ - Update fastify to major release `v4.3.0`
271
+ - Update CLI launcher
272
+
273
+ via CLI
274
+
275
+ ```
276
+ VERDACCIO_SERVER=fastify verdaccio
277
+ ```
278
+
279
+ with docker
280
+
281
+ ```
282
+ docker run -it --rm --name verdaccio \
283
+ -e "VERDACCIO_SERVER=8080" -p 8080:8080 \
284
+ -e "VERDACCIO_SERVER=fastify" \
285
+ verdaccio/verdaccio
286
+ ```
287
+
288
+ - b61f762d6: feat: add server rate limit protection to all request
289
+
290
+ To modify custom values, use the server settings property.
291
+
292
+ ```markdown
293
+ server:
294
+
295
+ ## https://www.npmjs.com/package/express-rate-limit#configuration-options
296
+
297
+ rateLimit:
298
+ windowMs: 1000
299
+ max: 10000
300
+ ```
301
+
302
+ The values are intended to be high, if you want to improve security of your server consider
303
+ using different values.
304
+
305
+ - 154b2ecd3: refactor: remove @verdaccio/commons-api in favor @verdaccio/core and remove duplications
306
+ - aa763baec: feat: add typescript project references settings
307
+
308
+ Reading https://ebaytech.berlin/optimizing-multi-package-apps-with-typescript-project-references-d5c57a3b4440 I realized I can use project references to solve the issue to pre-compile modules on develop mode.
309
+
310
+ It allows to navigate (IDE) trough the packages without need compile the packages.
311
+
312
+ Add two `tsconfig`, one using the previous existing configuration that is able to produce declaration files (`tsconfig.build`) and a new one `tsconfig` which is enables [_projects references_](https://www.typescriptlang.org/docs/handbook/project-references.html).
313
+
314
+ - d5eacc218: feat: improve cli loggin on start up
315
+ - 6c1eb021b: feat: use warning codes for deprecation warnings
316
+
317
+ ### Patch Changes
318
+
319
+ - 351aeeaa8: fix(deps): @verdaccio/utils should be a prod dep of local-storage
320
+ - 19d272d10: fix: restore logger on init
321
+
322
+ Enable logger after parse configuration and log the very first step on startup phase.
323
+
324
+ ```bash
325
+ warn --- experiments are enabled, it is recommended do not use experiments in production comment out this section to disable it
326
+ info --- support for experiment [token] is disabled
327
+ info --- support for experiment [search] is disabled
328
+ (node:50831) Warning: config.logs is deprecated, rename configuration to "config.log"
329
+ (Use `node --trace-warnings ...` to show where the warning was created)
330
+ info --- http address http://localhost:4873/
331
+ info --- version: 6.0.0-6-next.11
332
+ info --- server started
333
+ ```
334
+
335
+ - a610ef26b: chore: add release step to private regisry on merge changeset pr
336
+ - 34f0f1101: Enable prerelease mode with **changesets**
337
+ - df0da3d69: Added core-js missing from dependencies though referenced in .js sources
338
+ - 68ea21214: ESLint Warnings Fixed
339
+
340
+ Related to issue #1461
341
+
342
+ - max-len: most of the sensible max-len errors are fixed
343
+ - no-unused-vars: most of these types of errors are fixed by deleting not needed declarations
344
+ - @typescript-eslint/no-unused-vars: same as above
345
+
346
+ - Updated dependencies [292c0a37f]
347
+ - Updated dependencies [974cd8c19]
348
+ - Updated dependencies [a828271d6]
349
+ - Updated dependencies [ef88da3b4]
350
+ - Updated dependencies [43f32687c]
351
+ - Updated dependencies [679c19c1b]
352
+ - Updated dependencies [a3a209b5e]
353
+ - Updated dependencies [459b6fa72]
354
+ - Updated dependencies [9fc2e7961]
355
+ - Updated dependencies [9943e2b18]
356
+ - Updated dependencies [ae93e039d]
357
+ - Updated dependencies [702d5c497]
358
+ - Updated dependencies [24b9be020]
359
+ - Updated dependencies [794af76c5]
360
+ - Updated dependencies [e75c0a3b9]
361
+ - Updated dependencies [351aeeaa8]
362
+ - Updated dependencies [10aeb4f13]
363
+ - Updated dependencies [631abe1ac]
364
+ - Updated dependencies [9718e0330]
365
+ - Updated dependencies [7ef599cc4]
366
+ - Updated dependencies [b702ea363]
367
+ - Updated dependencies [1b217fd34]
368
+ - Updated dependencies [e367c3f1e]
369
+ - Updated dependencies [a1da11308]
370
+ - Updated dependencies [d167f92e1]
371
+ - Updated dependencies [00d1d2a17]
372
+ - Updated dependencies [19d272d10]
373
+ - Updated dependencies [1810ed0d8]
374
+ - Updated dependencies [55ee3fdd9]
375
+ - Updated dependencies [a610ef26b]
376
+ - Updated dependencies [ddb6a2239]
377
+ - Updated dependencies [a23628be9]
378
+ - Updated dependencies [048ac95e8]
379
+ - Updated dependencies [648575aa4]
380
+ - Updated dependencies [b61f762d6]
381
+ - Updated dependencies [d43894e8f]
382
+ - Updated dependencies [154b2ecd3]
383
+ - Updated dependencies [061bfcc8d]
384
+ - Updated dependencies [aa763baec]
385
+ - Updated dependencies [378e907d5]
386
+ - Updated dependencies [16e38df8a]
387
+ - Updated dependencies [34f0f1101]
388
+ - Updated dependencies [df0da3d69]
389
+ - Updated dependencies [82cb0f2bf]
390
+ - Updated dependencies [dc571aabd]
391
+ - Updated dependencies [b78f35257]
392
+ - Updated dependencies [f859d2b1a]
393
+ - Updated dependencies [2c594910d]
394
+ - Updated dependencies [6c1eb021b]
395
+ - Updated dependencies [62c24b632]
396
+ - Updated dependencies [0a6412ca9]
397
+ - Updated dependencies [d08fe29d9]
398
+ - Updated dependencies [5167bb528]
399
+ - Updated dependencies [f86c31ed0]
400
+ - Updated dependencies [65f88b826]
401
+ - Updated dependencies [20c9e43ed]
402
+ - Updated dependencies [b3e8438f6]
403
+ - Updated dependencies [c9d1af0e5]
404
+ - Updated dependencies [730b5d8cc]
405
+ - Updated dependencies [4b29d715b]
406
+ - Updated dependencies [68ea21214]
407
+ - Updated dependencies [37274e4c8]
408
+ - Updated dependencies [8f43bf17d]
409
+ - Updated dependencies [45c03819e]
410
+ - Updated dependencies [b849128de]
411
+ - @verdaccio/config@6.0.0
412
+ - @verdaccio/core@6.0.0
413
+ - @verdaccio/logger@6.0.0
414
+ - @verdaccio/server@6.0.0
415
+ - @verdaccio/server-fastify@6.0.0
416
+
3
417
  ## 6.0.0-6-next.76
4
418
 
5
419
  ### Patch Changes
@@ -715,14 +1129,14 @@
715
1129
  - 5c5057fc: feat: node api new structure based on promise
716
1130
 
717
1131
  ```js
718
- import { runServer } from '@verdaccio/node-api';
1132
+ import { runServer } from "@verdaccio/node-api";
719
1133
  // or
720
- import { runServer } from 'verdaccio';
1134
+ import { runServer } from "verdaccio";
721
1135
 
722
1136
  const app = await runServer(); // default configuration
723
- const app = await runServer('./config/config.yaml');
1137
+ const app = await runServer("./config/config.yaml");
724
1138
  const app = await runServer({ configuration });
725
- app.listen(4000, event => {
1139
+ app.listen(4000, (event) => {
726
1140
  // do something
727
1141
  });
728
1142
  ```
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Verdaccio contributors
3
+ Copyright (c) 2024 Verdaccio contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -7,11 +7,9 @@ exports.DEFAULT_PROTOCOL = exports.DEFAULT_PORT = exports.DEFAULT_DOMAIN = void
7
7
  exports.getListListenAddresses = getListListenAddresses;
8
8
  exports.parseAddress = parseAddress;
9
9
  var _core = require("@verdaccio/core");
10
- const DEFAULT_PORT = '4873';
11
- exports.DEFAULT_PORT = DEFAULT_PORT;
12
- const DEFAULT_PROTOCOL = 'http';
13
- exports.DEFAULT_PROTOCOL = DEFAULT_PROTOCOL;
14
- const DEFAULT_DOMAIN = 'localhost';
10
+ const DEFAULT_PORT = exports.DEFAULT_PORT = '4873';
11
+ const DEFAULT_PROTOCOL = exports.DEFAULT_PROTOCOL = 'http';
12
+ const DEFAULT_DOMAIN = exports.DEFAULT_DOMAIN = 'localhost';
15
13
  /**
16
14
  * Parse an internet address
17
15
  * Allow:
@@ -26,7 +24,6 @@ const DEFAULT_DOMAIN = 'localhost';
26
24
  * @param {*} urlAddress the internet address definition
27
25
  * @return {Object|Null} literal object that represent the address parsed
28
26
  */
29
- exports.DEFAULT_DOMAIN = DEFAULT_DOMAIN;
30
27
  function parseAddress(urlAddress) {
31
28
  //
32
29
  // TODO: refactor it to something more reasonable?
@@ -1 +1 @@
1
- {"version":3,"file":"cli-utils.js","names":["_core","require","DEFAULT_PORT","exports","DEFAULT_PROTOCOL","DEFAULT_DOMAIN","parseAddress","urlAddress","urlPattern","exec","proto","host","port","path","getListListenAddresses","argListen","configListen","addresses","Array","isArray","process","emitWarning","map","addr","parsedAddr","warningUtils","emit","Codes","VERWAR004","filter","Boolean"],"sources":["../src/cli-utils.ts"],"sourcesContent":["import { warningUtils } from '@verdaccio/core';\n\nexport const DEFAULT_PORT = '4873';\nexport const DEFAULT_PROTOCOL = 'http';\nexport const DEFAULT_DOMAIN = 'localhost';\n/**\n * Parse an internet address\n * Allow:\n - https:localhost:1234 - protocol + host + port\n - localhost:1234 - host + port\n - 1234 - port\n - http::1234 - protocol + port\n - https://localhost:443/ - full url + https\n - http://[::1]:443/ - ipv6\n - unix:/tmp/http.sock - unix sockets\n - https://unix:/tmp/http.sock - unix sockets (https)\n * @param {*} urlAddress the internet address definition\n * @return {Object|Null} literal object that represent the address parsed\n */\nexport function parseAddress(urlAddress: any): any {\n //\n // TODO: refactor it to something more reasonable?\n //\n // protocol : // ( host )|( ipv6 ): port /\n let urlPattern = /^((https?):(\\/\\/)?)?((([^\\/:]*)|\\[([^\\[\\]]+)\\]):)?(\\d+)\\/?$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n host: urlPattern[6] || urlPattern[7] || DEFAULT_DOMAIN,\n port: urlPattern[8] || DEFAULT_PORT,\n };\n }\n\n urlPattern = /^((https?):(\\/\\/)?)?unix:(.*)$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n path: urlPattern[4],\n };\n }\n\n return null;\n}\n\n/**\n * Retrieve all addresses defined in the config file.\n * Verdaccio is able to listen multiple ports\n * @param {String} argListen\n * @param {String} configListen\n * eg:\n * listen:\n - localhost:5555\n - localhost:5557\n @return {Array}\n */\nexport function getListListenAddresses(argListen: string | void, configListen: any): any {\n // command line || config file || default\n let addresses;\n if (argListen) {\n addresses = [argListen];\n } else if (Array.isArray(configListen)) {\n addresses = configListen;\n process.emitWarning('multiple addresses will be deprecated in the next major, only use one');\n } else if (configListen) {\n addresses = [configListen];\n } else {\n addresses = [DEFAULT_PORT];\n }\n addresses = addresses\n .map(function (addr): string {\n const parsedAddr = parseAddress(addr);\n\n if (!parsedAddr) {\n warningUtils.emit(warningUtils.Codes.VERWAR004, addr);\n }\n\n return parsedAddr;\n })\n .filter(Boolean);\n\n return addresses;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,GAAG,MAAM;AAACC,OAAA,CAAAD,YAAA,GAAAA,YAAA;AAC5B,MAAME,gBAAgB,GAAG,MAAM;AAACD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAChC,MAAMC,cAAc,GAAG,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAbAF,OAAA,CAAAE,cAAA,GAAAA,cAAA;AAcO,SAASC,YAAYA,CAACC,UAAe,EAAO;EACjD;EACA;EACA;EACA;EACA,IAAIC,UAAU,GAAG,6DAA6D,CAACC,IAAI,CAACF,UAAU,CAAC;EAE/F,IAAIC,UAAU,EAAE;IACd,OAAO;MACLE,KAAK,EAAEF,UAAU,CAAC,CAAC,CAAC,IAAIJ,gBAAgB;MACxCO,IAAI,EAAEH,UAAU,CAAC,CAAC,CAAC,IAAIA,UAAU,CAAC,CAAC,CAAC,IAAIH,cAAc;MACtDO,IAAI,EAAEJ,UAAU,CAAC,CAAC,CAAC,IAAIN;IACzB,CAAC;EACH;EAEAM,UAAU,GAAG,gCAAgC,CAACC,IAAI,CAACF,UAAU,CAAC;EAE9D,IAAIC,UAAU,EAAE;IACd,OAAO;MACLE,KAAK,EAAEF,UAAU,CAAC,CAAC,CAAC,IAAIJ,gBAAgB;MACxCS,IAAI,EAAEL,UAAU,CAAC,CAAC;IACpB,CAAC;EACH;EAEA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,sBAAsBA,CAACC,SAAwB,EAAEC,YAAiB,EAAO;EACvF;EACA,IAAIC,SAAS;EACb,IAAIF,SAAS,EAAE;IACbE,SAAS,GAAG,CAACF,SAAS,CAAC;EACzB,CAAC,MAAM,IAAIG,KAAK,CAACC,OAAO,CAACH,YAAY,CAAC,EAAE;IACtCC,SAAS,GAAGD,YAAY;IACxBI,OAAO,CAACC,WAAW,CAAC,uEAAuE,CAAC;EAC9F,CAAC,MAAM,IAAIL,YAAY,EAAE;IACvBC,SAAS,GAAG,CAACD,YAAY,CAAC;EAC5B,CAAC,MAAM;IACLC,SAAS,GAAG,CAACf,YAAY,CAAC;EAC5B;EACAe,SAAS,GAAGA,SAAS,CAClBK,GAAG,CAAC,UAAUC,IAAI,EAAU;IAC3B,MAAMC,UAAU,GAAGlB,YAAY,CAACiB,IAAI,CAAC;IAErC,IAAI,CAACC,UAAU,EAAE;MACfC,kBAAY,CAACC,IAAI,CAACD,kBAAY,CAACE,KAAK,CAACC,SAAS,EAAEL,IAAI,CAAC;IACvD;IAEA,OAAOC,UAAU;EACnB,CAAC,CAAC,CACDK,MAAM,CAACC,OAAO,CAAC;EAElB,OAAOb,SAAS;AAClB"}
1
+ {"version":3,"file":"cli-utils.js","names":["_core","require","DEFAULT_PORT","exports","DEFAULT_PROTOCOL","DEFAULT_DOMAIN","parseAddress","urlAddress","urlPattern","exec","proto","host","port","path","getListListenAddresses","argListen","configListen","addresses","Array","isArray","process","emitWarning","map","addr","parsedAddr","warningUtils","emit","Codes","VERWAR004","filter","Boolean"],"sources":["../src/cli-utils.ts"],"sourcesContent":["import { warningUtils } from '@verdaccio/core';\n\nexport const DEFAULT_PORT = '4873';\nexport const DEFAULT_PROTOCOL = 'http';\nexport const DEFAULT_DOMAIN = 'localhost';\n/**\n * Parse an internet address\n * Allow:\n - https:localhost:1234 - protocol + host + port\n - localhost:1234 - host + port\n - 1234 - port\n - http::1234 - protocol + port\n - https://localhost:443/ - full url + https\n - http://[::1]:443/ - ipv6\n - unix:/tmp/http.sock - unix sockets\n - https://unix:/tmp/http.sock - unix sockets (https)\n * @param {*} urlAddress the internet address definition\n * @return {Object|Null} literal object that represent the address parsed\n */\nexport function parseAddress(urlAddress: any): any {\n //\n // TODO: refactor it to something more reasonable?\n //\n // protocol : // ( host )|( ipv6 ): port /\n let urlPattern = /^((https?):(\\/\\/)?)?((([^\\/:]*)|\\[([^\\[\\]]+)\\]):)?(\\d+)\\/?$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n host: urlPattern[6] || urlPattern[7] || DEFAULT_DOMAIN,\n port: urlPattern[8] || DEFAULT_PORT,\n };\n }\n\n urlPattern = /^((https?):(\\/\\/)?)?unix:(.*)$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n path: urlPattern[4],\n };\n }\n\n return null;\n}\n\n/**\n * Retrieve all addresses defined in the config file.\n * Verdaccio is able to listen multiple ports\n * @param {String} argListen\n * @param {String} configListen\n * eg:\n * listen:\n - localhost:5555\n - localhost:5557\n @return {Array}\n */\nexport function getListListenAddresses(argListen: string | void, configListen: any): any {\n // command line || config file || default\n let addresses;\n if (argListen) {\n addresses = [argListen];\n } else if (Array.isArray(configListen)) {\n addresses = configListen;\n process.emitWarning('multiple addresses will be deprecated in the next major, only use one');\n } else if (configListen) {\n addresses = [configListen];\n } else {\n addresses = [DEFAULT_PORT];\n }\n addresses = addresses\n .map(function (addr): string {\n const parsedAddr = parseAddress(addr);\n\n if (!parsedAddr) {\n warningUtils.emit(warningUtils.Codes.VERWAR004, addr);\n }\n\n return parsedAddr;\n })\n .filter(Boolean);\n\n return addresses;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,MAAM;AAC3B,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,MAAM;AAC/B,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAACC,UAAe,EAAO;EACjD;EACA;EACA;EACA;EACA,IAAIC,UAAU,GAAG,6DAA6D,CAACC,IAAI,CAACF,UAAU,CAAC;EAE/F,IAAIC,UAAU,EAAE;IACd,OAAO;MACLE,KAAK,EAAEF,UAAU,CAAC,CAAC,CAAC,IAAIJ,gBAAgB;MACxCO,IAAI,EAAEH,UAAU,CAAC,CAAC,CAAC,IAAIA,UAAU,CAAC,CAAC,CAAC,IAAIH,cAAc;MACtDO,IAAI,EAAEJ,UAAU,CAAC,CAAC,CAAC,IAAIN;IACzB,CAAC;EACH;EAEAM,UAAU,GAAG,gCAAgC,CAACC,IAAI,CAACF,UAAU,CAAC;EAE9D,IAAIC,UAAU,EAAE;IACd,OAAO;MACLE,KAAK,EAAEF,UAAU,CAAC,CAAC,CAAC,IAAIJ,gBAAgB;MACxCS,IAAI,EAAEL,UAAU,CAAC,CAAC;IACpB,CAAC;EACH;EAEA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,sBAAsBA,CAACC,SAAwB,EAAEC,YAAiB,EAAO;EACvF;EACA,IAAIC,SAAS;EACb,IAAIF,SAAS,EAAE;IACbE,SAAS,GAAG,CAACF,SAAS,CAAC;EACzB,CAAC,MAAM,IAAIG,KAAK,CAACC,OAAO,CAACH,YAAY,CAAC,EAAE;IACtCC,SAAS,GAAGD,YAAY;IACxBI,OAAO,CAACC,WAAW,CAAC,uEAAuE,CAAC;EAC9F,CAAC,MAAM,IAAIL,YAAY,EAAE;IACvBC,SAAS,GAAG,CAACD,YAAY,CAAC;EAC5B,CAAC,MAAM;IACLC,SAAS,GAAG,CAACf,YAAY,CAAC;EAC5B;EACAe,SAAS,GAAGA,SAAS,CAClBK,GAAG,CAAC,UAAUC,IAAI,EAAU;IAC3B,MAAMC,UAAU,GAAGlB,YAAY,CAACiB,IAAI,CAAC;IAErC,IAAI,CAACC,UAAU,EAAE;MACfC,kBAAY,CAACC,IAAI,CAACD,kBAAY,CAACE,KAAK,CAACC,SAAS,EAAEL,IAAI,CAAC;IACvD;IAEA,OAAOC,UAAU;EACnB,CAAC,CAAC,CACDK,MAAM,CAACC,OAAO,CAAC;EAElB,OAAOb,SAAS;AAClB"}
package/build/server.js CHANGED
@@ -20,8 +20,8 @@ var _server = _interopRequireDefault(require("@verdaccio/server"));
20
20
  var _serverFastify = _interopRequireDefault(require("@verdaccio/server-fastify"));
21
21
  var _cliUtils = require("./cli-utils");
22
22
  var _experiments = require("./experiments");
23
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
26
  /* eslint-disable */
27
27
 
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","names":["_constants","_interopRequireDefault","require","_debug","_fs","_http","_https","_lodash","_interopRequireWildcard","_url","_config","_core","_logger","_server","_serverFastify","_cliUtils","_experiments","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","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","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,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAC,uBAAA,CAAAN,OAAA;AACA,IAAAO,IAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,cAAA,GA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AmB,GAAG/D,MAAM;EAC9B,CAAC,MAAM;IACL,MAAM,IAAIc,KAAK,CAACwD,eAAS,CAACC,iBAAiB,CAAC;EAC9C;EAEA,IAAApC,aAAK,EAAC4B,mBAAmB,CAAC3B,GAAU,CAAC;EACrC,IAAAC,sCAAyB,EAAC0B,mBAAmB,CAACzB,KAAK,CAAC;EACpD;EACA,MAAM,CAAC5C,IAAI,CAAC,GAAG,IAAAsC,gCAAsB,EAACgC,SAAS,EAAED,mBAAmB,CAAC9B,MAAM,CAAC;EAC5E,MAAMhC,GAAG,GAAG,MAAM,IAAA2C,eAAa,EAACmB,mBAAmB,CAAC;EACpD,OAAOhE,mBAAmB,CAACgE,mBAAmB,EAAErE,IAAI,EAAEO,GAAG,CAAC;AAC5D"}
1
+ {"version":3,"file":"server.js","names":["_constants","_interopRequireDefault","require","_debug","_fs","_http","_https","_lodash","_interopRequireWildcard","_url","_config","_core","_logger","_server","_serverFastify","_cliUtils","_experiments","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","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,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAC,uBAAA,CAAAN,OAAA;AACA,IAAAO,IAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,cAAA,GAAAb,sBAAA,CAAAC,OAAA;AAGA,IAAAa,SAAA,GAAAb,OAAA;AACA,IAAAc,YAAA,GAAAd,OAAA;AAA0D,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,O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CAAyB,EAAC0B,mBAAmB,CAACzB,KAAK,CAAC;EACpD;EACA,MAAM,CAAC7C,IAAI,CAAC,GAAG,IAAAuC,gCAAsB,EAACgC,SAAS,EAAED,mBAAmB,CAAC9B,MAAM,CAAC;EAC5E,MAAMjC,GAAG,GAAG,MAAM,IAAA4C,eAAa,EAACmB,mBAAmB,CAAC;EACpD,OAAOjE,mBAAmB,CAACiE,mBAAmB,EAAEtE,IAAI,EAAEO,GAAG,CAAC;AAC5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/node-api",
3
- "version": "6.0.0-6-next.76",
3
+ "version": "7.0.0-next-7.8",
4
4
  "description": "node API",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -25,24 +25,24 @@
25
25
  "verdaccio"
26
26
  ],
27
27
  "engines": {
28
- "node": ">=14",
29
- "npm": ">=6"
28
+ "node": ">=18"
30
29
  },
31
30
  "license": "MIT",
32
31
  "dependencies": {
33
- "@verdaccio/core": "6.0.0-6-next.76",
34
- "@verdaccio/config": "6.0.0-6-next.76",
35
- "@verdaccio/logger": "6.0.0-6-next.44",
36
- "@verdaccio/server": "6.0.0-6-next.65",
37
- "@verdaccio/server-fastify": "6.0.0-6-next.57",
38
- "core-js": "3.30.2",
32
+ "@verdaccio/config": "7.0.0-next-7.8",
33
+ "@verdaccio/core": "7.0.0-next-7.8",
34
+ "@verdaccio/logger": "7.0.0-next-7.8",
35
+ "@verdaccio/server": "7.0.0-next-7.8",
36
+ "@verdaccio/server-fastify": "7.0.0-next-7.8",
37
+ "core-js": "3.35.0",
39
38
  "debug": "4.3.4",
40
39
  "lodash": "4.17.21"
41
40
  },
42
41
  "devDependencies": {
43
- "@verdaccio/types": "11.0.0-6-next.25",
44
- "selfsigned": "1.10.14",
45
- "supertest": "6.3.3"
42
+ "@verdaccio/types": "12.0.0-next.2",
43
+ "jest": "29.7.0",
44
+ "selfsigned": "2.4.1",
45
+ "supertest": "6.3.4"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"