@verdaccio/cli 6.0.0-6-next.34 → 6.0.0-6-next.35
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 +77 -17
- package/build/cli.js +0 -3
- package/build/cli.js.map +1 -1
- package/build/commands/info.js.map +1 -1
- package/build/commands/init.js.map +1 -1
- package/build/commands/version.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/utils.js.map +1 -1
- package/jest.config.js +10 -1
- package/package.json +8 -9
- package/src/cli.ts +0 -2
- package/src/commands/init.ts +2 -3
- package/build/commands/FastifyServer.d.ts +0 -16
- package/build/commands/FastifyServer.js +0 -77
- package/build/commands/FastifyServer.js.map +0 -1
- package/src/commands/FastifyServer.ts +0 -58
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @verdaccio/cli
|
|
2
2
|
|
|
3
|
+
## 6.0.0-6-next.35
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 292c0a37: feat!: replace deprecated request dependency by got
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
## Notes
|
|
12
|
+
|
|
13
|
+
- Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
|
|
14
|
+
- Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
|
|
15
|
+
- Refactor with promises instead callback wherever is possible
|
|
16
|
+
- ~Document the API~
|
|
17
|
+
- Improve testing, integration tests
|
|
18
|
+
- Bugfix
|
|
19
|
+
- Clean up old validations
|
|
20
|
+
- Improve performance
|
|
21
|
+
|
|
22
|
+
## 💥 Breaking changes
|
|
23
|
+
|
|
24
|
+
- Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
|
|
25
|
+
- 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));`
|
|
26
|
+
- `@verdaccio/streams` stream abort support is legacy is being deprecated removed
|
|
27
|
+
- Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
|
|
28
|
+
|
|
29
|
+
- a3a209b5: feat: migrate to pino.js 8
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- 00d1d2a1: chore: env variable for launch fastify
|
|
34
|
+
|
|
35
|
+
- Update fastify to major release `v4.3.0`
|
|
36
|
+
- Update CLI launcher
|
|
37
|
+
|
|
38
|
+
via CLI
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
VERDACCIO_SERVER=fastify verdaccio
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
with docker
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
docker run -it --rm --name verdaccio \
|
|
48
|
+
-e "VERDACCIO_SERVER=8080" -p 8080:8080 \
|
|
49
|
+
-e "VERDACCIO_SERVER=fastify" \
|
|
50
|
+
verdaccio/verdaccio
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [292c0a37]
|
|
56
|
+
- Updated dependencies [a3a209b5]
|
|
57
|
+
- Updated dependencies [00d1d2a1]
|
|
58
|
+
- @verdaccio/config@6.0.0-6-next.15
|
|
59
|
+
- @verdaccio/core@6.0.0-6-next.6
|
|
60
|
+
- @verdaccio/logger@6.0.0-6-next.12
|
|
61
|
+
- @verdaccio/node-api@6.0.0-6-next.33
|
|
62
|
+
|
|
3
63
|
## 6.0.0-6-next.34
|
|
4
64
|
|
|
5
65
|
### Patch Changes
|
|
@@ -13,7 +73,7 @@
|
|
|
13
73
|
- Updated dependencies [d43894e8]
|
|
14
74
|
- Updated dependencies [d08fe29d]
|
|
15
75
|
- @verdaccio/config@6.0.0-6-next.14
|
|
16
|
-
- @verdaccio/fastify
|
|
76
|
+
- @verdaccio/server-fastify@6.0.0-6-next.23
|
|
17
77
|
- @verdaccio/node-api@6.0.0-6-next.31
|
|
18
78
|
- @verdaccio/core@6.0.0-6-next.5
|
|
19
79
|
- @verdaccio/logger@6.0.0-6-next.11
|
|
@@ -59,20 +119,20 @@
|
|
|
59
119
|
- @verdaccio/core@6.0.0-6-next.5
|
|
60
120
|
- @verdaccio/logger@6.0.0-6-next.11
|
|
61
121
|
- @verdaccio/node-api@6.0.0-6-next.30
|
|
62
|
-
- @verdaccio/fastify
|
|
122
|
+
- @verdaccio/server-fastify@6.0.0-6-next.22
|
|
63
123
|
|
|
64
124
|
## 6.0.0-6-next.30
|
|
65
125
|
|
|
66
126
|
### Patch Changes
|
|
67
127
|
|
|
68
|
-
- @verdaccio/fastify
|
|
128
|
+
- @verdaccio/server-fastify@6.0.0-6-next.21
|
|
69
129
|
- @verdaccio/node-api@6.0.0-6-next.29
|
|
70
130
|
|
|
71
131
|
## 6.0.0-6-next.29
|
|
72
132
|
|
|
73
133
|
### Patch Changes
|
|
74
134
|
|
|
75
|
-
- @verdaccio/fastify
|
|
135
|
+
- @verdaccio/server-fastify@6.0.0-6-next.20
|
|
76
136
|
- @verdaccio/node-api@6.0.0-6-next.28
|
|
77
137
|
|
|
78
138
|
## 6.0.0-6-next.28
|
|
@@ -81,7 +141,7 @@
|
|
|
81
141
|
|
|
82
142
|
- Updated dependencies [b78f3525]
|
|
83
143
|
- @verdaccio/logger@6.0.0-6-next.10
|
|
84
|
-
- @verdaccio/fastify
|
|
144
|
+
- @verdaccio/server-fastify@6.0.0-6-next.19
|
|
85
145
|
- @verdaccio/node-api@6.0.0-6-next.27
|
|
86
146
|
|
|
87
147
|
## 6.0.0-6-next.27
|
|
@@ -91,7 +151,7 @@
|
|
|
91
151
|
- Updated dependencies [730b5d8c]
|
|
92
152
|
- @verdaccio/logger@6.0.0-6-next.9
|
|
93
153
|
- @verdaccio/node-api@6.0.0-6-next.26
|
|
94
|
-
- @verdaccio/fastify
|
|
154
|
+
- @verdaccio/server-fastify@6.0.0-6-next.18
|
|
95
155
|
|
|
96
156
|
## 6.0.0-6-next.26
|
|
97
157
|
|
|
@@ -100,7 +160,7 @@
|
|
|
100
160
|
- Updated dependencies [a828271d]
|
|
101
161
|
- Updated dependencies [24b9be02]
|
|
102
162
|
- Updated dependencies [e75c0a3b]
|
|
103
|
-
- @verdaccio/fastify
|
|
163
|
+
- @verdaccio/server-fastify@6.0.0-6-next.17
|
|
104
164
|
- @verdaccio/core@6.0.0-6-next.4
|
|
105
165
|
- @verdaccio/logger@6.0.0-6-next.8
|
|
106
166
|
- @verdaccio/node-api@6.0.0-6-next.25
|
|
@@ -112,7 +172,7 @@
|
|
|
112
172
|
|
|
113
173
|
- Updated dependencies [f86c31ed]
|
|
114
174
|
- Updated dependencies [20c9e43e]
|
|
115
|
-
- @verdaccio/fastify
|
|
175
|
+
- @verdaccio/server-fastify@6.0.0-6-next.16
|
|
116
176
|
- @verdaccio/config@6.0.0-6-next.11
|
|
117
177
|
- @verdaccio/node-api@6.0.0-6-next.24
|
|
118
178
|
|
|
@@ -129,7 +189,7 @@
|
|
|
129
189
|
- @verdaccio/logger@6.0.0-6-next.7
|
|
130
190
|
- @verdaccio/node-api@6.0.0-6-next.23
|
|
131
191
|
- @verdaccio/config@6.0.0-6-next.10
|
|
132
|
-
- @verdaccio/fastify
|
|
192
|
+
- @verdaccio/server-fastify@6.0.0-6-next.15
|
|
133
193
|
|
|
134
194
|
## 6.0.0-6-next.23
|
|
135
195
|
|
|
@@ -149,7 +209,7 @@
|
|
|
149
209
|
- Updated dependencies [b702ea36]
|
|
150
210
|
- Updated dependencies [154b2ecd]
|
|
151
211
|
- @verdaccio/config@6.0.0-6-next.9
|
|
152
|
-
- @verdaccio/fastify
|
|
212
|
+
- @verdaccio/server-fastify@6.0.0-6-next.14
|
|
153
213
|
- @verdaccio/logger@6.0.0-6-next.6
|
|
154
214
|
- @verdaccio/node-api@6.0.0-6-next.22
|
|
155
215
|
|
|
@@ -159,7 +219,7 @@
|
|
|
159
219
|
|
|
160
220
|
- Updated dependencies [2c594910]
|
|
161
221
|
- @verdaccio/logger@6.0.0-6-next.5
|
|
162
|
-
- @verdaccio/fastify
|
|
222
|
+
- @verdaccio/server-fastify@6.0.0-6-next.13
|
|
163
223
|
- @verdaccio/node-api@6.0.0-6-next.21
|
|
164
224
|
|
|
165
225
|
## 6.0.0-6-next.21
|
|
@@ -203,7 +263,7 @@
|
|
|
203
263
|
|
|
204
264
|
- Updated dependencies [459b6fa7]
|
|
205
265
|
- @verdaccio/config@6.0.0-6-next.8
|
|
206
|
-
- @verdaccio/fastify
|
|
266
|
+
- @verdaccio/server-fastify@6.0.0-6-next.12
|
|
207
267
|
- @verdaccio/node-api@6.0.0-6-next.20
|
|
208
268
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
209
269
|
|
|
@@ -212,7 +272,7 @@
|
|
|
212
272
|
### Patch Changes
|
|
213
273
|
|
|
214
274
|
- Updated dependencies [df0da3d6]
|
|
215
|
-
- @verdaccio/fastify
|
|
275
|
+
- @verdaccio/server-fastify@6.0.0-6-next.11
|
|
216
276
|
- @verdaccio/node-api@6.0.0-6-next.19
|
|
217
277
|
|
|
218
278
|
## 6.0.0-6-next.19
|
|
@@ -236,7 +296,7 @@
|
|
|
236
296
|
### Patch Changes
|
|
237
297
|
|
|
238
298
|
- Updated dependencies [55ee3fdd]
|
|
239
|
-
- @verdaccio/fastify
|
|
299
|
+
- @verdaccio/server-fastify@6.0.0-6-next.10
|
|
240
300
|
- @verdaccio/config@6.0.0-6-next.7
|
|
241
301
|
- @verdaccio/node-api@6.0.0-6-next.17
|
|
242
302
|
|
|
@@ -250,7 +310,7 @@
|
|
|
250
310
|
|
|
251
311
|
### Patch Changes
|
|
252
312
|
|
|
253
|
-
- @verdaccio/fastify
|
|
313
|
+
- @verdaccio/server-fastify@6.0.0-6-next.9
|
|
254
314
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
255
315
|
- @verdaccio/node-api@6.0.0-6-next.15
|
|
256
316
|
|
|
@@ -258,7 +318,7 @@
|
|
|
258
318
|
|
|
259
319
|
### Patch Changes
|
|
260
320
|
|
|
261
|
-
- @verdaccio/fastify
|
|
321
|
+
- @verdaccio/server-fastify@6.0.0-6-next.9
|
|
262
322
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
263
323
|
- @verdaccio/node-api@6.0.0-6-next.14
|
|
264
324
|
|
|
@@ -291,7 +351,7 @@
|
|
|
291
351
|
|
|
292
352
|
- Updated dependencies [19d272d1]
|
|
293
353
|
- @verdaccio/node-api@6.0.0-6-next.12
|
|
294
|
-
- @verdaccio/fastify
|
|
354
|
+
- @verdaccio/server-fastify@6.0.0-6-next.9
|
|
295
355
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
296
356
|
|
|
297
357
|
## 6.0.0-6-next.11
|
package/build/cli.js
CHANGED
|
@@ -4,8 +4,6 @@ var _clipanion = require("clipanion");
|
|
|
4
4
|
|
|
5
5
|
var _core = require("@verdaccio/core");
|
|
6
6
|
|
|
7
|
-
var _FastifyServer = require("./commands/FastifyServer");
|
|
8
|
-
|
|
9
7
|
var _info = require("./commands/info");
|
|
10
8
|
|
|
11
9
|
var _init = require("./commands/init");
|
|
@@ -32,7 +30,6 @@ const cli = new _clipanion.Cli({
|
|
|
32
30
|
cli.register(_info.InfoCommand);
|
|
33
31
|
cli.register(_init.InitCommand);
|
|
34
32
|
cli.register(_version.VersionCommand);
|
|
35
|
-
cli.register(_FastifyServer.FastifyServer);
|
|
36
33
|
cli.runExit(args, _clipanion.Cli.defaultContext);
|
|
37
34
|
process.on('uncaughtException', function (err) {
|
|
38
35
|
console.error( // eslint-disable-next-line max-len
|
package/build/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"cli.js","names":["process","getuid","warningUtils","emit","Codes","VERWAR001","isVersionValid","version","Error","MIN_NODE_VERSION","node","app","args","argv","cli","Cli","binaryLabel","binaryName","binaryVersion","require","register","InfoCommand","InitCommand","VersionCommand","runExit","defaultContext","on","err","console","error","stack","exit"],"sources":["../src/cli.ts"],"sourcesContent":["import { Cli } from 'clipanion';\n\nimport { warningUtils } from '@verdaccio/core';\n\nimport { InfoCommand } from './commands/info';\nimport { InitCommand } from './commands/init';\nimport { VersionCommand } from './commands/version';\nimport { MIN_NODE_VERSION, isVersionValid } from './utils';\n\nif (process.getuid && process.getuid() === 0) {\n warningUtils.emit(warningUtils.Codes.VERWAR001);\n}\n\nif (!isVersionValid(process.version)) {\n throw new Error(\n `Verdaccio requires at least Node.js v${MIN_NODE_VERSION} or higher and you have installed ${process.version}, \n please upgrade your Node.js distribution`\n );\n}\n\nconst [node, app, ...args] = process.argv;\n\nconst cli = new Cli({\n binaryLabel: `verdaccio`,\n binaryName: `${node} ${app}`,\n binaryVersion: require('../package.json').version,\n});\n\ncli.register(InfoCommand);\ncli.register(InitCommand);\ncli.register(VersionCommand);\ncli.runExit(args, Cli.defaultContext);\n\nprocess.on('uncaughtException', function (err) {\n console.error(\n // eslint-disable-next-line max-len\n `uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this: \\n${err.stack}`\n );\n process.exit(1);\n});\n"],"mappings":";;AAAA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AAEA,IAAIA,OAAO,CAACC,MAAR,IAAkBD,OAAO,CAACC,MAAR,OAAqB,CAA3C,EAA8C;EAC5CC,kBAAA,CAAaC,IAAb,CAAkBD,kBAAA,CAAaE,KAAb,CAAmBC,SAArC;AACD;;AAED,IAAI,CAAC,IAAAC,qBAAA,EAAeN,OAAO,CAACO,OAAvB,CAAL,EAAsC;EACpC,MAAM,IAAIC,KAAJ,CACH,wCAAuCC,uBAAiB,qCAAoCT,OAAO,CAACO,OAAQ;AACjH,6CAFQ,CAAN;AAID;;AAED,MAAM,CAACG,IAAD,EAAOC,GAAP,EAAY,GAAGC,IAAf,IAAuBZ,OAAO,CAACa,IAArC;AAEA,MAAMC,GAAG,GAAG,IAAIC,cAAJ,CAAQ;EAClBC,WAAW,EAAG,WADI;EAElBC,UAAU,EAAG,GAAEP,IAAK,IAAGC,GAAI,EAFT;EAGlBO,aAAa,EAAEC,OAAO,CAAC,iBAAD,CAAP,CAA2BZ;AAHxB,CAAR,CAAZ;AAMAO,GAAG,CAACM,QAAJ,CAAaC,iBAAb;AACAP,GAAG,CAACM,QAAJ,CAAaE,iBAAb;AACAR,GAAG,CAACM,QAAJ,CAAaG,uBAAb;AACAT,GAAG,CAACU,OAAJ,CAAYZ,IAAZ,EAAkBG,cAAA,CAAIU,cAAtB;AAEAzB,OAAO,CAAC0B,EAAR,CAAW,mBAAX,EAAgC,UAAUC,GAAV,EAAe;EAC7CC,OAAO,CAACC,KAAR,EACE;EACC,6FAA4FF,GAAG,CAACG,KAAM,EAFzG;EAIA9B,OAAO,CAAC+B,IAAR,CAAa,CAAb;AACD,CAND"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"info.js","names":["InfoCommand","Command","paths","execute","context","stdout","write","data","envinfo","run","System","Binaries","Virtualization","Browsers","npmGlobalPackages","process","exit"],"sources":["../../src/commands/info.ts"],"sourcesContent":["import { Command } from 'clipanion';\nimport envinfo from 'envinfo';\n\nexport class InfoCommand extends Command {\n public static paths = [[`--info`], [`-i`]];\n\n public async execute(): Promise<void> {\n this.context.stdout.write('\\nEnvironment Info:');\n const data = await envinfo.run({\n System: ['OS', 'CPU'],\n Binaries: ['node', 'yarn', 'npm', 'pnpm'],\n Virtualization: ['Docker'],\n Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],\n npmGlobalPackages: ['verdaccio'],\n });\n\n this.context.stdout.write(data);\n process.exit(0);\n }\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEO,MAAMA,WAAN,SAA0BC,kBAA1B,CAAkC;EACpB,OAALC,KAAK,GAAG,CAAC,CAAE,QAAF,CAAD,EAAa,CAAE,IAAF,CAAb,CAAH;;EAEC,MAAPC,OAAO,GAAkB;IACpC,KAAKC,OAAL,CAAaC,MAAb,CAAoBC,KAApB,CAA0B,qBAA1B;IACA,MAAMC,IAAI,GAAG,MAAMC,gBAAA,CAAQC,GAAR,CAAY;MAC7BC,MAAM,EAAE,CAAC,IAAD,EAAO,KAAP,CADqB;MAE7BC,QAAQ,EAAE,CAAC,MAAD,EAAS,MAAT,EAAiB,KAAjB,EAAwB,MAAxB,CAFmB;MAG7BC,cAAc,EAAE,CAAC,QAAD,CAHa;MAI7BC,QAAQ,EAAE,CAAC,QAAD,EAAW,MAAX,EAAmB,SAAnB,EAA8B,QAA9B,CAJmB;MAK7BC,iBAAiB,EAAE,CAAC,WAAD;IALU,CAAZ,CAAnB;IAQA,KAAKV,OAAL,CAAaC,MAAb,CAAoBC,KAApB,CAA0BC,IAA1B;IACAQ,OAAO,CAACC,IAAR,CAAa,CAAb;EACD;;AAfsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"init.js","names":["DEFAULT_PROCESS_NAME","InitCommand","Command","paths","Default","port","Option","String","description","usage","Usage","details","examples","config","initLogger","logConfig","logs","Error","setup","log","err","execute","configPathLocation","findConfigFile","configParsed","parseConfigFile","web","process","title","version","name","require","initServer","logger","info","console","error","exit"],"sources":["../../src/commands/init.ts"],"sourcesContent":["import { Command, Option } from 'clipanion';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { logger, setup } from '@verdaccio/logger';\nimport { initServer } from '@verdaccio/node-api';\nimport { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';\n\nexport const DEFAULT_PROCESS_NAME: string = 'verdaccio';\n\nexport class InitCommand extends Command {\n public static paths = [Command.Default];\n\n private port = Option.String('-l,-p,--listen,--port', {\n description: 'host:port number to listen on (default: localhost:4873)',\n });\n\n // eslint-disable-next-line\n static usage = Command.Usage({\n description: `launch the server`,\n details: `\n This start the registry in the default port.\n\n When used without arguments, it:\n\n - bootstrap the server at the port \\`4873\\`\n\n The optional arguments are:\n\n - \\`-l | --listen | -p | --port\\` to switch the default server port,\n - \\`-c | --config\\` to define a different configuration path location,\n\n `,\n examples: [\n [`Runs the server with the default configuration`, `verdaccio`],\n [`Runs the server in the port 5000`, `verdaccio --listen 5000`],\n [\n `Runs the server by using a different absolute location of the configuration file`,\n `verdaccio --config /home/user/verdaccio/config.yaml`,\n ],\n ],\n });\n\n private config = Option.String('-c,--config', {\n description: 'use this configuration file (default: ./config.yaml)',\n });\n\n private initLogger(logConfig: ConfigYaml) {\n try {\n // @ts-expect-error\n if (logConfig.logs) {\n throw Error(\n 'the property config \"logs\" property is longer supported, rename to \"log\" and use object instead'\n );\n }\n setup(logConfig.log as LoggerConfigItem);\n } catch (err: any) {\n throw new Error(err);\n }\n }\n\n public async execute() {\n try {\n const configPathLocation = findConfigFile(this.config as string);\n const configParsed = parseConfigFile(configPathLocation);\n this.initLogger(configParsed);\n const { web } = configParsed;\n\n process.title = web?.title || DEFAULT_PROCESS_NAME;\n\n const { version, name } = require('../../package.json');\n\n await initServer(configParsed, this.port as string, version, name);\n logger.info('server started');\n } catch (err: any) {\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AAGO,MAAMA,oBAA4B,GAAG,WAArC;;;AAEA,MAAMC,WAAN,SAA0BC,kBAA1B,CAAkC;EACpB,OAALC,KAAK,GAAG,CAACD,kBAAA,CAAQE,OAAT,CAAH;EAEXC,IAAI,GAAGC,iBAAA,CAAOC,MAAP,CAAc,uBAAd,EAAuC;IACpDC,WAAW,EAAE;EADuC,CAAvC,CAAH,CAH2B,CAOvC;;EACY,OAALC,KAAK,GAAGP,kBAAA,CAAQQ,KAAR,CAAc;IAC3BF,WAAW,EAAG,mBADa;IAE3BG,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAd+B;IAe3BC,QAAQ,EAAE,CACR,CAAE,gDAAF,EAAoD,WAApD,CADQ,EAER,CAAE,kCAAF,EAAsC,yBAAtC,CAFQ,EAGR,CACG,kFADH,EAEG,qDAFH,CAHQ;EAfiB,CAAd,CAAH;EAyBJC,MAAM,GAAGP,iBAAA,CAAOC,MAAP,CAAc,aAAd,EAA6B;IAC5CC,WAAW,EAAE;EAD+B,CAA7B,CAAH;;EAINM,UAAU,CAACC,SAAD,EAAwB;IACxC,IAAI;MACF;MACA,IAAIA,SAAS,CAACC,IAAd,EAAoB;QAClB,MAAMC,KAAK,CACT,iGADS,CAAX;MAGD;;MACD,IAAAC,aAAA,EAAMH,SAAS,CAACI,GAAhB;IACD,CARD,CAQE,OAAOC,GAAP,EAAiB;MACjB,MAAM,IAAIH,KAAJ,CAAUG,GAAV,CAAN;IACD;EACF;;EAEmB,MAAPC,OAAO,GAAG;IACrB,IAAI;MACF,MAAMC,kBAAkB,GAAG,IAAAC,sBAAA,EAAe,KAAKV,MAApB,CAA3B;MACA,MAAMW,YAAY,GAAG,IAAAC,uBAAA,EAAgBH,kBAAhB,CAArB;MACA,KAAKR,UAAL,CAAgBU,YAAhB;MACA,MAAM;QAAEE;MAAF,IAAUF,YAAhB;MAEAG,OAAO,CAACC,KAAR,GAAgB,CAAAF,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEE,KAAL,KAAc5B,oBAA9B;;MAEA,MAAM;QAAE6B,OAAF;QAAWC;MAAX,IAAoBC,OAAO,CAAC,oBAAD,CAAjC;;MAEA,MAAM,IAAAC,mBAAA,EAAWR,YAAX,EAAyB,KAAKnB,IAA9B,EAA8CwB,OAA9C,EAAuDC,IAAvD,CAAN;;MACAG,cAAA,CAAOC,IAAP,CAAY,gBAAZ;IACD,CAZD,CAYE,OAAOd,GAAP,EAAiB;MACjBe,OAAO,CAACC,KAAR,CAAchB,GAAd;MACAO,OAAO,CAACU,IAAR,CAAa,CAAb;IACD;EACF;;AApEsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"version.js","names":["VersionCommand","Command","paths","execute","version","require","context","stdout","write","process","exit"],"sources":["../../src/commands/version.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-member-accessibility */\nimport { Command } from 'clipanion';\n\nexport class VersionCommand extends Command {\n static paths = [[`--version`], [`-v`]];\n\n async execute() {\n const version = require('../../package.json').version;\n this.context.stdout.write(`v${version}`);\n process.exit(0);\n }\n}\n"],"mappings":";;;;;;;AACA;;AADA;AAGO,MAAMA,cAAN,SAA6BC,kBAA7B,CAAqC;EAC9B,OAALC,KAAK,GAAG,CAAC,CAAE,WAAF,CAAD,EAAgB,CAAE,IAAF,CAAhB,CAAH;;EAEC,MAAPC,OAAO,GAAG;IACd,MAAMC,OAAO,GAAGC,OAAO,CAAC,oBAAD,CAAP,CAA8BD,OAA9C;;IACA,KAAKE,OAAL,CAAaC,MAAb,CAAoBC,KAApB,CAA2B,IAAGJ,OAAQ,EAAtC;IACAK,OAAO,CAACC,IAAR,CAAa,CAAb;EACD;;AAPyC"}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["require"],"sources":["../src/index.ts"],"sourcesContent":["require('./cli');\n"],"mappings":";;AAAAA,OAAO,CAAC,OAAD,CAAP"}
|
package/build/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils.js","names":["MIN_NODE_VERSION","isVersionValid","processVersion","version","slice","semver","satisfies"],"sources":["../src/utils.ts"],"sourcesContent":["import semver from 'semver';\n\nexport const MIN_NODE_VERSION = '14.0.0';\n\nexport function isVersionValid(processVersion) {\n const version = processVersion.slice(1);\n return semver.satisfies(version, `>=${MIN_NODE_VERSION}`);\n}\n"],"mappings":";;;;;;;;AAAA;;;;AAEO,MAAMA,gBAAgB,GAAG,QAAzB;;;AAEA,SAASC,cAAT,CAAwBC,cAAxB,EAAwC;EAC7C,MAAMC,OAAO,GAAGD,cAAc,CAACE,KAAf,CAAqB,CAArB,CAAhB;EACA,OAAOC,eAAA,CAAOC,SAAP,CAAiBH,OAAjB,EAA2B,KAAIH,gBAAiB,EAAhD,CAAP;AACD"}
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/cli",
|
|
3
|
-
"version": "6.0.0-6-next.
|
|
3
|
+
"version": "6.0.0-6-next.35",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Juan Picado",
|
|
6
6
|
"email": "juanpicado19@gmail.com"
|
|
@@ -34,18 +34,17 @@
|
|
|
34
34
|
"main": "./build/index.js",
|
|
35
35
|
"types": "build/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@verdaccio/core": "6.0.0-6-next.
|
|
38
|
-
"@verdaccio/config": "6.0.0-6-next.
|
|
39
|
-
"@verdaccio/logger": "6.0.0-6-next.
|
|
40
|
-
"@verdaccio/node-api": "6.0.0-6-next.
|
|
41
|
-
"@verdaccio/fastify-migration": "6.0.0-6-next.23",
|
|
37
|
+
"@verdaccio/core": "6.0.0-6-next.6",
|
|
38
|
+
"@verdaccio/config": "6.0.0-6-next.15",
|
|
39
|
+
"@verdaccio/logger": "6.0.0-6-next.12",
|
|
40
|
+
"@verdaccio/node-api": "6.0.0-6-next.33",
|
|
42
41
|
"clipanion": "3.1.0",
|
|
43
42
|
"envinfo": "7.8.1",
|
|
44
43
|
"kleur": "3.0.3",
|
|
45
|
-
"semver": "7.3.
|
|
44
|
+
"semver": "7.3.7"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"ts-node": "10.
|
|
47
|
+
"ts-node": "10.9.1"
|
|
49
48
|
},
|
|
50
49
|
"funding": {
|
|
51
50
|
"type": "opencollective",
|
|
@@ -53,7 +52,7 @@
|
|
|
53
52
|
},
|
|
54
53
|
"scripts": {
|
|
55
54
|
"clean": "rimraf ./build",
|
|
56
|
-
"test": "
|
|
55
|
+
"test": "jest",
|
|
57
56
|
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
58
57
|
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
59
58
|
"build:js": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
package/src/cli.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Cli } from 'clipanion';
|
|
|
2
2
|
|
|
3
3
|
import { warningUtils } from '@verdaccio/core';
|
|
4
4
|
|
|
5
|
-
import { FastifyServer } from './commands/FastifyServer';
|
|
6
5
|
import { InfoCommand } from './commands/info';
|
|
7
6
|
import { InitCommand } from './commands/init';
|
|
8
7
|
import { VersionCommand } from './commands/version';
|
|
@@ -30,7 +29,6 @@ const cli = new Cli({
|
|
|
30
29
|
cli.register(InfoCommand);
|
|
31
30
|
cli.register(InitCommand);
|
|
32
31
|
cli.register(VersionCommand);
|
|
33
|
-
cli.register(FastifyServer);
|
|
34
32
|
cli.runExit(args, Cli.defaultContext);
|
|
35
33
|
|
|
36
34
|
process.on('uncaughtException', function (err) {
|
package/src/commands/init.ts
CHANGED
|
@@ -2,9 +2,8 @@ import { Command, Option } from 'clipanion';
|
|
|
2
2
|
|
|
3
3
|
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
|
4
4
|
import { logger, setup } from '@verdaccio/logger';
|
|
5
|
-
import { LoggerConfigItem } from '@verdaccio/logger/src/logger';
|
|
6
5
|
import { initServer } from '@verdaccio/node-api';
|
|
7
|
-
import {
|
|
6
|
+
import { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';
|
|
8
7
|
|
|
9
8
|
export const DEFAULT_PROCESS_NAME: string = 'verdaccio';
|
|
10
9
|
|
|
@@ -45,7 +44,7 @@ export class InitCommand extends Command {
|
|
|
45
44
|
description: 'use this configuration file (default: ./config.yaml)',
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
private initLogger(logConfig:
|
|
47
|
+
private initLogger(logConfig: ConfigYaml) {
|
|
49
48
|
try {
|
|
50
49
|
// @ts-expect-error
|
|
51
50
|
if (logConfig.logs) {
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare const DEFAULT_PROCESS_NAME: string;
|
|
3
|
-
/**
|
|
4
|
-
* This command is intended to run the server with Fastify
|
|
5
|
-
* as a migration step.
|
|
6
|
-
* More info: https://github.com/verdaccio/verdaccio/discussions/2155
|
|
7
|
-
* To try out.
|
|
8
|
-
* pnpm debug:fastify
|
|
9
|
-
*/
|
|
10
|
-
export declare class FastifyServer extends Command {
|
|
11
|
-
static paths: string[][];
|
|
12
|
-
private port;
|
|
13
|
-
private config;
|
|
14
|
-
private initLogger;
|
|
15
|
-
execute(): Promise<void>;
|
|
16
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FastifyServer = exports.DEFAULT_PROCESS_NAME = void 0;
|
|
7
|
-
|
|
8
|
-
var _clipanion = require("clipanion");
|
|
9
|
-
|
|
10
|
-
var _config = require("@verdaccio/config");
|
|
11
|
-
|
|
12
|
-
var _fastifyMigration = _interopRequireDefault(require("@verdaccio/fastify-migration"));
|
|
13
|
-
|
|
14
|
-
var _logger = require("@verdaccio/logger");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
const DEFAULT_PROCESS_NAME = 'verdaccio';
|
|
19
|
-
/**
|
|
20
|
-
* This command is intended to run the server with Fastify
|
|
21
|
-
* as a migration step.
|
|
22
|
-
* More info: https://github.com/verdaccio/verdaccio/discussions/2155
|
|
23
|
-
* To try out.
|
|
24
|
-
* pnpm debug:fastify
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
exports.DEFAULT_PROCESS_NAME = DEFAULT_PROCESS_NAME;
|
|
28
|
-
|
|
29
|
-
class FastifyServer extends _clipanion.Command {
|
|
30
|
-
static paths = [['fastify-server']];
|
|
31
|
-
port = _clipanion.Option.String('-l,-p,--listen,--port', {
|
|
32
|
-
description: 'host:port number to listen on (default: localhost:4873)'
|
|
33
|
-
});
|
|
34
|
-
config = _clipanion.Option.String('-c,--config', {
|
|
35
|
-
description: 'use this configuration file (default: ./config.yaml)'
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
initLogger(logConfig) {
|
|
39
|
-
try {
|
|
40
|
-
if (logConfig.log) {
|
|
41
|
-
throw Error('logger as array not longer supported');
|
|
42
|
-
} // FUTURE: remove fallback when is ready
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(0, _logger.setup)(logConfig.log);
|
|
46
|
-
} catch (err) {
|
|
47
|
-
throw new Error(err);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async execute() {
|
|
52
|
-
try {
|
|
53
|
-
const configPathLocation = (0, _config.findConfigFile)(this.config);
|
|
54
|
-
const configParsed = (0, _config.parseConfigFile)(configPathLocation);
|
|
55
|
-
const {
|
|
56
|
-
web
|
|
57
|
-
} = configParsed;
|
|
58
|
-
this.initLogger(configParsed);
|
|
59
|
-
process.title = (web === null || web === void 0 ? void 0 : web.title) || DEFAULT_PROCESS_NAME; // FIXME: need a way to get version of the package.
|
|
60
|
-
// const { version, name } = require('../../package.json');
|
|
61
|
-
|
|
62
|
-
const ser = await (0, _fastifyMigration.default)({
|
|
63
|
-
logger: _logger.logger,
|
|
64
|
-
config: configParsed
|
|
65
|
-
}); // FIXME: harcoded, this would need to come from the configuration and the --listen flag.
|
|
66
|
-
|
|
67
|
-
await ser.listen(process.env.PORT || 4873);
|
|
68
|
-
} catch (err) {
|
|
69
|
-
console.error(err);
|
|
70
|
-
process.exit(1);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
exports.FastifyServer = FastifyServer;
|
|
77
|
-
//# sourceMappingURL=FastifyServer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/FastifyServer.ts"],"names":["DEFAULT_PROCESS_NAME","FastifyServer","Command","paths","port","Option","String","description","config","initLogger","logConfig","log","Error","err","execute","configPathLocation","configParsed","web","process","title","ser","logger","listen","env","PORT","console","error","exit"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;AAGO,MAAMA,oBAA4B,GAAG,WAArC;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACO,MAAMC,aAAN,SAA4BC,kBAA5B,CAAoC;AACtB,SAALC,KAAK,GAAG,CAAC,CAAC,gBAAD,CAAD,CAAH;AAEXC,EAAAA,IAAI,GAAGC,kBAAOC,MAAP,CAAc,uBAAd,EAAuC;AACpDC,IAAAA,WAAW,EAAE;AADuC,GAAvC,CAAH;AAIJC,EAAAA,MAAM,GAAGH,kBAAOC,MAAP,CAAc,aAAd,EAA6B;AAC5CC,IAAAA,WAAW,EAAE;AAD+B,GAA7B,CAAH;;AAINE,EAAAA,UAAU,CAACC,SAAD,EAA2B;AAC3C,QAAI;AACF,UAAIA,SAAS,CAACC,GAAd,EAAmB;AACjB,cAAMC,KAAK,CAAC,sCAAD,CAAX;AACD,OAHC,CAIF;;;AACA,yBAAMF,SAAS,CAACC,GAAhB;AACD,KAND,CAME,OAAOE,GAAP,EAAiB;AACjB,YAAM,IAAID,KAAJ,CAAUC,GAAV,CAAN;AACD;AACF;;AAEmB,QAAPC,OAAO,GAAG;AACrB,QAAI;AACF,YAAMC,kBAAkB,GAAG,4BAAe,KAAKP,MAApB,CAA3B;AACA,YAAMQ,YAAY,GAAG,6BAAgBD,kBAAhB,CAArB;AACA,YAAM;AAAEE,QAAAA;AAAF,UAAUD,YAAhB;AACA,WAAKP,UAAL,CAAgBO,YAAhB;AAEAE,MAAAA,OAAO,CAACC,KAAR,GAAgB,CAAAF,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEE,KAAL,KAAcnB,oBAA9B,CANE,CAOF;AACA;;AACA,YAAMoB,GAAG,GAAG,MAAM,+BAAO;AAAEC,QAAAA,MAAM,EAANA,cAAF;AAAUb,QAAAA,MAAM,EAAEQ;AAAlB,OAAP,CAAlB,CATE,CAUF;;AACA,YAAMI,GAAG,CAACE,MAAJ,CAAWJ,OAAO,CAACK,GAAR,CAAYC,IAAZ,IAAoB,IAA/B,CAAN;AACD,KAZD,CAYE,OAAOX,GAAP,EAAiB;AACjBY,MAAAA,OAAO,CAACC,KAAR,CAAcb,GAAd;AACAK,MAAAA,OAAO,CAACS,IAAR,CAAa,CAAb;AACD;AACF;;AAxCwC","sourcesContent":["import { Command, Option } from 'clipanion';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport server from '@verdaccio/fastify-migration';\nimport { logger, setup } from '@verdaccio/logger';\nimport { ConfigRuntime } from '@verdaccio/types';\n\nexport const DEFAULT_PROCESS_NAME: string = 'verdaccio';\n\n/**\n * This command is intended to run the server with Fastify\n * as a migration step.\n * More info: https://github.com/verdaccio/verdaccio/discussions/2155\n * To try out.\n * pnpm debug:fastify\n */\nexport class FastifyServer extends Command {\n public static paths = [['fastify-server']];\n\n private port = Option.String('-l,-p,--listen,--port', {\n description: 'host:port number to listen on (default: localhost:4873)',\n });\n\n private config = Option.String('-c,--config', {\n description: 'use this configuration file (default: ./config.yaml)',\n });\n\n private initLogger(logConfig: ConfigRuntime) {\n try {\n if (logConfig.log) {\n throw Error('logger as array not longer supported');\n }\n // FUTURE: remove fallback when is ready\n setup(logConfig.log);\n } catch (err: any) {\n throw new Error(err);\n }\n }\n\n public async execute() {\n try {\n const configPathLocation = findConfigFile(this.config as string);\n const configParsed = parseConfigFile(configPathLocation);\n const { web } = configParsed;\n this.initLogger(configParsed);\n\n process.title = web?.title || DEFAULT_PROCESS_NAME;\n // FIXME: need a way to get version of the package.\n // const { version, name } = require('../../package.json');\n const ser = await server({ logger, config: configParsed });\n // FIXME: harcoded, this would need to come from the configuration and the --listen flag.\n await ser.listen(process.env.PORT || 4873);\n } catch (err: any) {\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"file":"FastifyServer.js"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Command, Option } from 'clipanion';
|
|
2
|
-
|
|
3
|
-
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
|
4
|
-
import server from '@verdaccio/fastify-migration';
|
|
5
|
-
import { logger, setup } from '@verdaccio/logger';
|
|
6
|
-
import { ConfigRuntime } from '@verdaccio/types';
|
|
7
|
-
|
|
8
|
-
export const DEFAULT_PROCESS_NAME: string = 'verdaccio';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This command is intended to run the server with Fastify
|
|
12
|
-
* as a migration step.
|
|
13
|
-
* More info: https://github.com/verdaccio/verdaccio/discussions/2155
|
|
14
|
-
* To try out.
|
|
15
|
-
* pnpm debug:fastify
|
|
16
|
-
*/
|
|
17
|
-
export class FastifyServer extends Command {
|
|
18
|
-
public static paths = [['fastify-server']];
|
|
19
|
-
|
|
20
|
-
private port = Option.String('-l,-p,--listen,--port', {
|
|
21
|
-
description: 'host:port number to listen on (default: localhost:4873)',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
private config = Option.String('-c,--config', {
|
|
25
|
-
description: 'use this configuration file (default: ./config.yaml)',
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
private initLogger(logConfig: ConfigRuntime) {
|
|
29
|
-
try {
|
|
30
|
-
if (logConfig.log) {
|
|
31
|
-
throw Error('logger as array not longer supported');
|
|
32
|
-
}
|
|
33
|
-
// FUTURE: remove fallback when is ready
|
|
34
|
-
setup(logConfig.log);
|
|
35
|
-
} catch (err: any) {
|
|
36
|
-
throw new Error(err);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public async execute() {
|
|
41
|
-
try {
|
|
42
|
-
const configPathLocation = findConfigFile(this.config as string);
|
|
43
|
-
const configParsed = parseConfigFile(configPathLocation);
|
|
44
|
-
const { web } = configParsed;
|
|
45
|
-
this.initLogger(configParsed);
|
|
46
|
-
|
|
47
|
-
process.title = web?.title || DEFAULT_PROCESS_NAME;
|
|
48
|
-
// FIXME: need a way to get version of the package.
|
|
49
|
-
// const { version, name } = require('../../package.json');
|
|
50
|
-
const ser = await server({ logger, config: configParsed });
|
|
51
|
-
// FIXME: harcoded, this would need to come from the configuration and the --listen flag.
|
|
52
|
-
await ser.listen(process.env.PORT || 4873);
|
|
53
|
-
} catch (err: any) {
|
|
54
|
-
console.error(err);
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|