@verdaccio/cli 6.0.0-6-next.32 → 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 +94 -16
- 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 +63 -63
- 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,83 @@
|
|
|
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
|
+
|
|
63
|
+
## 6.0.0-6-next.34
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- @verdaccio/node-api@6.0.0-6-next.32
|
|
68
|
+
|
|
69
|
+
## 6.0.0-6-next.33
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies [d43894e8]
|
|
74
|
+
- Updated dependencies [d08fe29d]
|
|
75
|
+
- @verdaccio/config@6.0.0-6-next.14
|
|
76
|
+
- @verdaccio/server-fastify@6.0.0-6-next.23
|
|
77
|
+
- @verdaccio/node-api@6.0.0-6-next.31
|
|
78
|
+
- @verdaccio/core@6.0.0-6-next.5
|
|
79
|
+
- @verdaccio/logger@6.0.0-6-next.11
|
|
80
|
+
|
|
3
81
|
## 6.0.0-6-next.32
|
|
4
82
|
|
|
5
83
|
### Patch Changes
|
|
@@ -41,20 +119,20 @@
|
|
|
41
119
|
- @verdaccio/core@6.0.0-6-next.5
|
|
42
120
|
- @verdaccio/logger@6.0.0-6-next.11
|
|
43
121
|
- @verdaccio/node-api@6.0.0-6-next.30
|
|
44
|
-
- @verdaccio/fastify
|
|
122
|
+
- @verdaccio/server-fastify@6.0.0-6-next.22
|
|
45
123
|
|
|
46
124
|
## 6.0.0-6-next.30
|
|
47
125
|
|
|
48
126
|
### Patch Changes
|
|
49
127
|
|
|
50
|
-
- @verdaccio/fastify
|
|
128
|
+
- @verdaccio/server-fastify@6.0.0-6-next.21
|
|
51
129
|
- @verdaccio/node-api@6.0.0-6-next.29
|
|
52
130
|
|
|
53
131
|
## 6.0.0-6-next.29
|
|
54
132
|
|
|
55
133
|
### Patch Changes
|
|
56
134
|
|
|
57
|
-
- @verdaccio/fastify
|
|
135
|
+
- @verdaccio/server-fastify@6.0.0-6-next.20
|
|
58
136
|
- @verdaccio/node-api@6.0.0-6-next.28
|
|
59
137
|
|
|
60
138
|
## 6.0.0-6-next.28
|
|
@@ -63,7 +141,7 @@
|
|
|
63
141
|
|
|
64
142
|
- Updated dependencies [b78f3525]
|
|
65
143
|
- @verdaccio/logger@6.0.0-6-next.10
|
|
66
|
-
- @verdaccio/fastify
|
|
144
|
+
- @verdaccio/server-fastify@6.0.0-6-next.19
|
|
67
145
|
- @verdaccio/node-api@6.0.0-6-next.27
|
|
68
146
|
|
|
69
147
|
## 6.0.0-6-next.27
|
|
@@ -73,7 +151,7 @@
|
|
|
73
151
|
- Updated dependencies [730b5d8c]
|
|
74
152
|
- @verdaccio/logger@6.0.0-6-next.9
|
|
75
153
|
- @verdaccio/node-api@6.0.0-6-next.26
|
|
76
|
-
- @verdaccio/fastify
|
|
154
|
+
- @verdaccio/server-fastify@6.0.0-6-next.18
|
|
77
155
|
|
|
78
156
|
## 6.0.0-6-next.26
|
|
79
157
|
|
|
@@ -82,7 +160,7 @@
|
|
|
82
160
|
- Updated dependencies [a828271d]
|
|
83
161
|
- Updated dependencies [24b9be02]
|
|
84
162
|
- Updated dependencies [e75c0a3b]
|
|
85
|
-
- @verdaccio/fastify
|
|
163
|
+
- @verdaccio/server-fastify@6.0.0-6-next.17
|
|
86
164
|
- @verdaccio/core@6.0.0-6-next.4
|
|
87
165
|
- @verdaccio/logger@6.0.0-6-next.8
|
|
88
166
|
- @verdaccio/node-api@6.0.0-6-next.25
|
|
@@ -94,7 +172,7 @@
|
|
|
94
172
|
|
|
95
173
|
- Updated dependencies [f86c31ed]
|
|
96
174
|
- Updated dependencies [20c9e43e]
|
|
97
|
-
- @verdaccio/fastify
|
|
175
|
+
- @verdaccio/server-fastify@6.0.0-6-next.16
|
|
98
176
|
- @verdaccio/config@6.0.0-6-next.11
|
|
99
177
|
- @verdaccio/node-api@6.0.0-6-next.24
|
|
100
178
|
|
|
@@ -111,7 +189,7 @@
|
|
|
111
189
|
- @verdaccio/logger@6.0.0-6-next.7
|
|
112
190
|
- @verdaccio/node-api@6.0.0-6-next.23
|
|
113
191
|
- @verdaccio/config@6.0.0-6-next.10
|
|
114
|
-
- @verdaccio/fastify
|
|
192
|
+
- @verdaccio/server-fastify@6.0.0-6-next.15
|
|
115
193
|
|
|
116
194
|
## 6.0.0-6-next.23
|
|
117
195
|
|
|
@@ -131,7 +209,7 @@
|
|
|
131
209
|
- Updated dependencies [b702ea36]
|
|
132
210
|
- Updated dependencies [154b2ecd]
|
|
133
211
|
- @verdaccio/config@6.0.0-6-next.9
|
|
134
|
-
- @verdaccio/fastify
|
|
212
|
+
- @verdaccio/server-fastify@6.0.0-6-next.14
|
|
135
213
|
- @verdaccio/logger@6.0.0-6-next.6
|
|
136
214
|
- @verdaccio/node-api@6.0.0-6-next.22
|
|
137
215
|
|
|
@@ -141,7 +219,7 @@
|
|
|
141
219
|
|
|
142
220
|
- Updated dependencies [2c594910]
|
|
143
221
|
- @verdaccio/logger@6.0.0-6-next.5
|
|
144
|
-
- @verdaccio/fastify
|
|
222
|
+
- @verdaccio/server-fastify@6.0.0-6-next.13
|
|
145
223
|
- @verdaccio/node-api@6.0.0-6-next.21
|
|
146
224
|
|
|
147
225
|
## 6.0.0-6-next.21
|
|
@@ -185,7 +263,7 @@
|
|
|
185
263
|
|
|
186
264
|
- Updated dependencies [459b6fa7]
|
|
187
265
|
- @verdaccio/config@6.0.0-6-next.8
|
|
188
|
-
- @verdaccio/fastify
|
|
266
|
+
- @verdaccio/server-fastify@6.0.0-6-next.12
|
|
189
267
|
- @verdaccio/node-api@6.0.0-6-next.20
|
|
190
268
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
191
269
|
|
|
@@ -194,7 +272,7 @@
|
|
|
194
272
|
### Patch Changes
|
|
195
273
|
|
|
196
274
|
- Updated dependencies [df0da3d6]
|
|
197
|
-
- @verdaccio/fastify
|
|
275
|
+
- @verdaccio/server-fastify@6.0.0-6-next.11
|
|
198
276
|
- @verdaccio/node-api@6.0.0-6-next.19
|
|
199
277
|
|
|
200
278
|
## 6.0.0-6-next.19
|
|
@@ -218,7 +296,7 @@
|
|
|
218
296
|
### Patch Changes
|
|
219
297
|
|
|
220
298
|
- Updated dependencies [55ee3fdd]
|
|
221
|
-
- @verdaccio/fastify
|
|
299
|
+
- @verdaccio/server-fastify@6.0.0-6-next.10
|
|
222
300
|
- @verdaccio/config@6.0.0-6-next.7
|
|
223
301
|
- @verdaccio/node-api@6.0.0-6-next.17
|
|
224
302
|
|
|
@@ -232,7 +310,7 @@
|
|
|
232
310
|
|
|
233
311
|
### Patch Changes
|
|
234
312
|
|
|
235
|
-
- @verdaccio/fastify
|
|
313
|
+
- @verdaccio/server-fastify@6.0.0-6-next.9
|
|
236
314
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
237
315
|
- @verdaccio/node-api@6.0.0-6-next.15
|
|
238
316
|
|
|
@@ -240,7 +318,7 @@
|
|
|
240
318
|
|
|
241
319
|
### Patch Changes
|
|
242
320
|
|
|
243
|
-
- @verdaccio/fastify
|
|
321
|
+
- @verdaccio/server-fastify@6.0.0-6-next.9
|
|
244
322
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
245
323
|
- @verdaccio/node-api@6.0.0-6-next.14
|
|
246
324
|
|
|
@@ -273,7 +351,7 @@
|
|
|
273
351
|
|
|
274
352
|
- Updated dependencies [19d272d1]
|
|
275
353
|
- @verdaccio/node-api@6.0.0-6-next.12
|
|
276
|
-
- @verdaccio/fastify
|
|
354
|
+
- @verdaccio/server-fastify@6.0.0-6-next.9
|
|
277
355
|
- @verdaccio/logger@6.0.0-6-next.4
|
|
278
356
|
|
|
279
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,64 +1,64 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
2
|
+
"name": "@verdaccio/cli",
|
|
3
|
+
"version": "6.0.0-6-next.35",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Juan Picado",
|
|
6
|
+
"email": "juanpicado19@gmail.com"
|
|
7
|
+
},
|
|
8
|
+
"bin": {
|
|
9
|
+
"verdaccio": "./bin/verdaccio",
|
|
10
|
+
"verdaccio-cli": "./bin/verdaccio"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "https",
|
|
14
|
+
"url": "https://github.com/verdaccio/verdaccio"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://verdaccio.org",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"private",
|
|
19
|
+
"package",
|
|
20
|
+
"repository",
|
|
21
|
+
"registry",
|
|
22
|
+
"enterprise",
|
|
23
|
+
"modules",
|
|
24
|
+
"proxy",
|
|
25
|
+
"server",
|
|
26
|
+
"verdaccio"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=14",
|
|
30
|
+
"npm": ">=6"
|
|
31
|
+
},
|
|
32
|
+
"description": "verdaccio CLI",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"main": "./build/index.js",
|
|
35
|
+
"types": "build/index.d.ts",
|
|
36
|
+
"dependencies": {
|
|
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",
|
|
41
|
+
"clipanion": "3.1.0",
|
|
42
|
+
"envinfo": "7.8.1",
|
|
43
|
+
"kleur": "3.0.3",
|
|
44
|
+
"semver": "7.3.7"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"ts-node": "10.9.1"
|
|
48
|
+
},
|
|
49
|
+
"funding": {
|
|
50
|
+
"type": "opencollective",
|
|
51
|
+
"url": "https://opencollective.com/verdaccio"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"clean": "rimraf ./build",
|
|
55
|
+
"test": "jest",
|
|
56
|
+
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
57
|
+
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
58
|
+
"build:js": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
|
59
|
+
"watch": "pnpm build:js --F --watch",
|
|
60
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
61
|
+
"start": "ts-node src/index.ts"
|
|
62
|
+
},
|
|
63
|
+
"readme": "# @verdaccio/cli\n\n[](https://opencollective.com/verdaccio)\n[](https://stackshare.io/verdaccio)\n[](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)\n[](https://crowdin.com/project/verdaccio)\n[](https://www.tickgit.com/browse?repo=github.com/verdaccio/verdaccio)\n\n[](https://twitter.com/verdaccio_npm)\n[](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[](https://opencollective.com/verdaccio/sponsor/0/website)\n[](https://opencollective.com/verdaccio/sponsor/1/website)\n[](https://opencollective.com/verdaccio/sponsor/2/website)\n[](https://opencollective.com/verdaccio/sponsor/3/website)\n[](https://opencollective.com/verdaccio/sponsor/4/website)\n[](https://opencollective.com/verdaccio/sponsor/5/website)\n[](https://opencollective.com/verdaccio/sponsor/6/website)\n[](https://opencollective.com/verdaccio/sponsor/7/website)\n[](https://opencollective.com/verdaccio/sponsor/8/website)\n[](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[](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[](https://www.jetbrains.com/)\n[](https://crowdin.com/)\n[](https://balsamiq.com/)\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n[](../../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"
|
|
64
|
+
}
|
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
|
-
}
|