@verdaccio/server 7.0.0-next.5 → 8.0.0-next-8.0
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 +361 -0
- package/LICENSE +1 -1
- package/build/debug/index.js.map +1 -1
- package/build/env.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/server.js +4 -4
- package/build/server.js.map +1 -1
- package/package.json +16 -16
- package/src/server.ts +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,366 @@
|
|
|
1
1
|
# @verdaccio/server
|
|
2
2
|
|
|
3
|
+
## 8.0.0-next-8.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- chore: move v7 next to v8 next
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @verdaccio/logger@8.0.0-next-8.0
|
|
13
|
+
- verdaccio-audit@13.0.0-next-8.0
|
|
14
|
+
- @verdaccio/middleware@8.0.0-next-8.0
|
|
15
|
+
- @verdaccio/core@8.0.0-next-8.0
|
|
16
|
+
- @verdaccio/loaders@8.0.0-next-8.0
|
|
17
|
+
- @verdaccio/config@8.0.0-next-8.0
|
|
18
|
+
- @verdaccio/store@8.0.0-next-8.0
|
|
19
|
+
- @verdaccio/web@7.0.1-next-8.0
|
|
20
|
+
- @verdaccio/auth@7.0.1-next-8.0
|
|
21
|
+
- @verdaccio/api@7.0.1-next-8.0
|
|
22
|
+
- @verdaccio/utils@7.0.1-next-8.0
|
|
23
|
+
|
|
24
|
+
## 7.0.0
|
|
25
|
+
|
|
26
|
+
### Major Changes
|
|
27
|
+
|
|
28
|
+
- 47f61c6: feat!: bump to v7
|
|
29
|
+
- e7ebccb: update major dependencies, remove old nodejs support
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- f047cc8: refactor: auth with legacy sign support
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 7c9f3cf: chore: improve startup logging
|
|
38
|
+
- 3ca4056: fix: Avoid 404 error when getting favicon from root
|
|
39
|
+
- Updated dependencies [e5624e1]
|
|
40
|
+
- Updated dependencies [47f61c6]
|
|
41
|
+
- Updated dependencies [2a6ee33]
|
|
42
|
+
- Updated dependencies [10dd81f]
|
|
43
|
+
- Updated dependencies [5bfab62]
|
|
44
|
+
- Updated dependencies [6c5f7a4]
|
|
45
|
+
- Updated dependencies [6e764e3]
|
|
46
|
+
- Updated dependencies [b0946b2]
|
|
47
|
+
- Updated dependencies [136e992]
|
|
48
|
+
- Updated dependencies [ccc7bd1]
|
|
49
|
+
- Updated dependencies [8c10a3e]
|
|
50
|
+
- Updated dependencies [daceb6d]
|
|
51
|
+
- Updated dependencies [e14b064]
|
|
52
|
+
- Updated dependencies [e7ebccb]
|
|
53
|
+
- Updated dependencies [c9962fe]
|
|
54
|
+
- Updated dependencies [7400830]
|
|
55
|
+
- Updated dependencies [f967a69]
|
|
56
|
+
- Updated dependencies [de6ff5c]
|
|
57
|
+
- Updated dependencies [f047cc8]
|
|
58
|
+
- Updated dependencies [a99a4bb]
|
|
59
|
+
- Updated dependencies [c807f0c]
|
|
60
|
+
- Updated dependencies [a05a7d8]
|
|
61
|
+
- Updated dependencies [7c9f3cf]
|
|
62
|
+
- Updated dependencies [c31aec8]
|
|
63
|
+
- Updated dependencies [bd8703e]
|
|
64
|
+
- Updated dependencies [4dc62a8]
|
|
65
|
+
- Updated dependencies [253cc13]
|
|
66
|
+
- Updated dependencies [74cd588]
|
|
67
|
+
- Updated dependencies [19df355]
|
|
68
|
+
- Updated dependencies [4d96324]
|
|
69
|
+
- @verdaccio/store@7.0.0
|
|
70
|
+
- @verdaccio/api@7.0.0
|
|
71
|
+
- @verdaccio/auth@7.0.0
|
|
72
|
+
- @verdaccio/config@7.0.0
|
|
73
|
+
- @verdaccio/core@7.0.0
|
|
74
|
+
- @verdaccio/loaders@7.0.0
|
|
75
|
+
- @verdaccio/logger@7.0.0
|
|
76
|
+
- @verdaccio/middleware@7.0.0
|
|
77
|
+
- verdaccio-audit@12.0.0
|
|
78
|
+
- @verdaccio/utils@7.0.0
|
|
79
|
+
- @verdaccio/web@7.0.0
|
|
80
|
+
|
|
81
|
+
## 7.0.0-next-8.21
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- 7c9f3cf: chore: improve startup logging
|
|
86
|
+
- Updated dependencies [8c10a3e]
|
|
87
|
+
- Updated dependencies [a05a7d8]
|
|
88
|
+
- Updated dependencies [7c9f3cf]
|
|
89
|
+
- @verdaccio/config@7.0.0-next-8.21
|
|
90
|
+
- @verdaccio/core@7.0.0-next-8.21
|
|
91
|
+
- @verdaccio/loaders@7.0.0-next-8.21
|
|
92
|
+
- @verdaccio/store@7.0.0-next-8.21
|
|
93
|
+
- @verdaccio/auth@7.0.0-next-8.21
|
|
94
|
+
- @verdaccio/web@7.0.0-next-8.21
|
|
95
|
+
- @verdaccio/api@7.0.0-next-8.21
|
|
96
|
+
- @verdaccio/middleware@7.0.0-next-8.21
|
|
97
|
+
- verdaccio-audit@12.0.0-next-8.21
|
|
98
|
+
- @verdaccio/utils@7.0.0-next-8.21
|
|
99
|
+
- @verdaccio/logger@7.0.0-next-8.21
|
|
100
|
+
|
|
101
|
+
## 7.0.0-next-7.20
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- Updated dependencies [ccc7bd1]
|
|
106
|
+
- @verdaccio/middleware@7.0.0-next-7.20
|
|
107
|
+
- @verdaccio/api@7.0.0-next-7.20
|
|
108
|
+
- @verdaccio/auth@7.0.0-next-7.20
|
|
109
|
+
- @verdaccio/web@7.0.0-next-7.20
|
|
110
|
+
- @verdaccio/store@7.0.0-next-7.20
|
|
111
|
+
- @verdaccio/core@7.0.0-next-7.20
|
|
112
|
+
- @verdaccio/config@7.0.0-next-7.20
|
|
113
|
+
- @verdaccio/loaders@7.0.0-next-7.20
|
|
114
|
+
- verdaccio-audit@12.0.0-next-7.20
|
|
115
|
+
- @verdaccio/utils@7.0.0-next-7.20
|
|
116
|
+
- @verdaccio/logger@7.0.0-next-7.20
|
|
117
|
+
|
|
118
|
+
## 7.0.0-next-7.19
|
|
119
|
+
|
|
120
|
+
### Patch Changes
|
|
121
|
+
|
|
122
|
+
- Updated dependencies [2a6ee33]
|
|
123
|
+
- Updated dependencies [6c5f7a4]
|
|
124
|
+
- Updated dependencies [136e992]
|
|
125
|
+
- Updated dependencies [c31aec8]
|
|
126
|
+
- Updated dependencies [19df355]
|
|
127
|
+
- @verdaccio/middleware@7.0.0-next-7.19
|
|
128
|
+
- verdaccio-audit@12.0.0-next-7.19
|
|
129
|
+
- @verdaccio/config@7.0.0-next-7.19
|
|
130
|
+
- @verdaccio/api@7.0.0-next-7.19
|
|
131
|
+
- @verdaccio/auth@7.0.0-next-7.19
|
|
132
|
+
- @verdaccio/web@7.0.0-next-7.19
|
|
133
|
+
- @verdaccio/loaders@7.0.0-next-7.19
|
|
134
|
+
- @verdaccio/store@7.0.0-next-7.19
|
|
135
|
+
- @verdaccio/core@7.0.0-next-7.19
|
|
136
|
+
- @verdaccio/utils@7.0.0-next-7.19
|
|
137
|
+
- @verdaccio/logger@7.0.0-next-7.19
|
|
138
|
+
|
|
139
|
+
## 7.0.0-next-7.18
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [10dd81f]
|
|
144
|
+
- @verdaccio/middleware@7.0.0-next-7.18
|
|
145
|
+
- @verdaccio/config@7.0.0-next-7.18
|
|
146
|
+
- @verdaccio/api@7.0.0-next-7.18
|
|
147
|
+
- @verdaccio/auth@7.0.0-next-7.18
|
|
148
|
+
- @verdaccio/core@7.0.0-next-7.18
|
|
149
|
+
- @verdaccio/loaders@7.0.0-next-7.18
|
|
150
|
+
- @verdaccio/logger@7.0.0-next-7.18
|
|
151
|
+
- verdaccio-audit@12.0.0-next-7.18
|
|
152
|
+
- @verdaccio/store@7.0.0-next-7.18
|
|
153
|
+
- @verdaccio/web@7.0.0-next-7.18
|
|
154
|
+
- @verdaccio/utils@7.0.0-next-7.18
|
|
155
|
+
|
|
156
|
+
## 7.0.0-next-7.17
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- Updated dependencies [6e764e3]
|
|
161
|
+
- Updated dependencies [de6ff5c]
|
|
162
|
+
- @verdaccio/config@7.0.0-next-7.17
|
|
163
|
+
- @verdaccio/core@7.0.0-next-7.17
|
|
164
|
+
- @verdaccio/store@7.0.0-next-7.17
|
|
165
|
+
- @verdaccio/api@7.0.0-next-7.17
|
|
166
|
+
- @verdaccio/auth@7.0.0-next-7.17
|
|
167
|
+
- @verdaccio/loaders@7.0.0-next-7.17
|
|
168
|
+
- @verdaccio/logger@7.0.0-next-7.17
|
|
169
|
+
- verdaccio-audit@12.0.0-next-7.17
|
|
170
|
+
- @verdaccio/web@7.0.0-next-7.17
|
|
171
|
+
- @verdaccio/middleware@7.0.0-next-7.17
|
|
172
|
+
- @verdaccio/utils@7.0.0-next-7.17
|
|
173
|
+
|
|
174
|
+
## 7.0.0-next-7.16
|
|
175
|
+
|
|
176
|
+
### Patch Changes
|
|
177
|
+
|
|
178
|
+
- Updated dependencies [e5624e1]
|
|
179
|
+
- Updated dependencies [5bfab62]
|
|
180
|
+
- @verdaccio/store@7.0.0-next-7.16
|
|
181
|
+
- @verdaccio/api@7.0.0-next-7.16
|
|
182
|
+
- @verdaccio/web@7.0.0-next-7.16
|
|
183
|
+
- @verdaccio/logger@7.0.0-next-7.16
|
|
184
|
+
- @verdaccio/middleware@7.0.0-next-7.16
|
|
185
|
+
- @verdaccio/auth@7.0.0-next-7.16
|
|
186
|
+
- @verdaccio/loaders@7.0.0-next-7.16
|
|
187
|
+
- verdaccio-audit@12.0.0-next-7.16
|
|
188
|
+
- @verdaccio/core@7.0.0-next-7.16
|
|
189
|
+
- @verdaccio/config@7.0.0-next-7.16
|
|
190
|
+
- @verdaccio/utils@7.0.0-next-7.16
|
|
191
|
+
|
|
192
|
+
## 7.0.0-next-7.15
|
|
193
|
+
|
|
194
|
+
### Patch Changes
|
|
195
|
+
|
|
196
|
+
- Updated dependencies [7400830]
|
|
197
|
+
- Updated dependencies [bd8703e]
|
|
198
|
+
- @verdaccio/store@7.0.0-next-7.15
|
|
199
|
+
- @verdaccio/core@7.0.0-next-7.15
|
|
200
|
+
- @verdaccio/config@7.0.0-next-7.15
|
|
201
|
+
- @verdaccio/auth@7.0.0-next-7.15
|
|
202
|
+
- @verdaccio/web@7.0.0-next-7.15
|
|
203
|
+
- @verdaccio/api@7.0.0-next-7.15
|
|
204
|
+
- @verdaccio/loaders@7.0.0-next-7.15
|
|
205
|
+
- @verdaccio/logger@7.0.0-next-7.15
|
|
206
|
+
- verdaccio-audit@12.0.0-next-7.15
|
|
207
|
+
- @verdaccio/middleware@7.0.0-next-7.15
|
|
208
|
+
- @verdaccio/utils@7.0.0-next-7.15
|
|
209
|
+
|
|
210
|
+
## 7.0.0-next-7.14
|
|
211
|
+
|
|
212
|
+
### Patch Changes
|
|
213
|
+
|
|
214
|
+
- Updated dependencies [b0946b2]
|
|
215
|
+
- Updated dependencies [f967a69]
|
|
216
|
+
- Updated dependencies [4dc62a8]
|
|
217
|
+
- Updated dependencies [253cc13]
|
|
218
|
+
- @verdaccio/middleware@7.0.0-next-7.14
|
|
219
|
+
- @verdaccio/store@7.0.0-next-7.14
|
|
220
|
+
- @verdaccio/auth@7.0.0-next-7.14
|
|
221
|
+
- @verdaccio/api@7.0.0-next-7.14
|
|
222
|
+
- @verdaccio/web@7.0.0-next-7.14
|
|
223
|
+
- verdaccio-audit@12.0.0-next-7.14
|
|
224
|
+
- @verdaccio/core@7.0.0-next-7.14
|
|
225
|
+
- @verdaccio/config@7.0.0-next-7.14
|
|
226
|
+
- @verdaccio/loaders@7.0.0-next-7.14
|
|
227
|
+
- @verdaccio/utils@7.0.0-next-7.14
|
|
228
|
+
- @verdaccio/logger@7.0.0-next-7.14
|
|
229
|
+
|
|
230
|
+
## 7.0.0-next-7.13
|
|
231
|
+
|
|
232
|
+
### Patch Changes
|
|
233
|
+
|
|
234
|
+
- Updated dependencies [a99a4bb]
|
|
235
|
+
- @verdaccio/config@7.0.0-next-7.13
|
|
236
|
+
- @verdaccio/api@7.0.0-next-7.13
|
|
237
|
+
- @verdaccio/auth@7.0.0-next-7.13
|
|
238
|
+
- @verdaccio/loaders@7.0.0-next-7.13
|
|
239
|
+
- @verdaccio/middleware@7.0.0-next-7.13
|
|
240
|
+
- verdaccio-audit@12.0.0-next-7.13
|
|
241
|
+
- @verdaccio/store@7.0.0-next-7.13
|
|
242
|
+
- @verdaccio/web@7.0.0-next-7.13
|
|
243
|
+
- @verdaccio/logger@7.0.0-next-7.13
|
|
244
|
+
- @verdaccio/core@7.0.0-next-7.13
|
|
245
|
+
- @verdaccio/utils@7.0.0-next-7.13
|
|
246
|
+
|
|
247
|
+
## 7.0.0-next-7.12
|
|
248
|
+
|
|
249
|
+
### Patch Changes
|
|
250
|
+
|
|
251
|
+
- @verdaccio/store@7.0.0-next-7.12
|
|
252
|
+
- @verdaccio/api@7.0.0-next-7.12
|
|
253
|
+
- @verdaccio/web@7.0.0-next-7.12
|
|
254
|
+
- @verdaccio/core@7.0.0-next-7.12
|
|
255
|
+
- @verdaccio/config@7.0.0-next-7.12
|
|
256
|
+
- @verdaccio/auth@7.0.0-next-7.12
|
|
257
|
+
- @verdaccio/loaders@7.0.0-next-7.12
|
|
258
|
+
- @verdaccio/middleware@7.0.0-next-7.12
|
|
259
|
+
- verdaccio-audit@12.0.0-next-7.12
|
|
260
|
+
- @verdaccio/utils@7.0.0-next-7.12
|
|
261
|
+
- @verdaccio/logger@7.0.0-next-7.12
|
|
262
|
+
|
|
263
|
+
## 7.0.0-next-7.11
|
|
264
|
+
|
|
265
|
+
### Patch Changes
|
|
266
|
+
|
|
267
|
+
- Updated dependencies [c9962fe]
|
|
268
|
+
- @verdaccio/config@7.0.0-next-7.11
|
|
269
|
+
- @verdaccio/api@7.0.0-next-7.11
|
|
270
|
+
- @verdaccio/auth@7.0.0-next-7.11
|
|
271
|
+
- @verdaccio/loaders@7.0.0-next-7.11
|
|
272
|
+
- @verdaccio/middleware@7.0.0-next-7.11
|
|
273
|
+
- verdaccio-audit@12.0.0-next-7.11
|
|
274
|
+
- @verdaccio/store@7.0.0-next-7.11
|
|
275
|
+
- @verdaccio/web@7.0.0-next-7.11
|
|
276
|
+
- @verdaccio/core@7.0.0-next-7.11
|
|
277
|
+
- @verdaccio/utils@7.0.0-next-7.11
|
|
278
|
+
- @verdaccio/logger@7.0.0-next-7.11
|
|
279
|
+
|
|
280
|
+
## 7.0.0-next-7.10
|
|
281
|
+
|
|
282
|
+
### Patch Changes
|
|
283
|
+
|
|
284
|
+
- @verdaccio/core@7.0.0-next-7.10
|
|
285
|
+
- @verdaccio/config@7.0.0-next-7.10
|
|
286
|
+
- @verdaccio/api@7.0.0-next-7.10
|
|
287
|
+
- @verdaccio/auth@7.0.0-next-7.10
|
|
288
|
+
- @verdaccio/loaders@7.0.0-next-7.10
|
|
289
|
+
- @verdaccio/middleware@7.0.0-next-7.10
|
|
290
|
+
- verdaccio-audit@12.0.0-next-7.10
|
|
291
|
+
- @verdaccio/store@7.0.0-next-7.10
|
|
292
|
+
- @verdaccio/utils@7.0.0-next-7.10
|
|
293
|
+
- @verdaccio/web@7.0.0-next-7.10
|
|
294
|
+
- @verdaccio/logger@7.0.0-next-7.10
|
|
295
|
+
|
|
296
|
+
## 7.0.0-next-7.9
|
|
297
|
+
|
|
298
|
+
### Patch Changes
|
|
299
|
+
|
|
300
|
+
- Updated dependencies [c807f0c]
|
|
301
|
+
- @verdaccio/store@7.0.0-next-7.9
|
|
302
|
+
- @verdaccio/api@7.0.0-next-7.9
|
|
303
|
+
- @verdaccio/web@7.0.0-next-7.9
|
|
304
|
+
- @verdaccio/core@7.0.0-next-7.9
|
|
305
|
+
- @verdaccio/config@7.0.0-next-7.9
|
|
306
|
+
- @verdaccio/auth@7.0.0-next-7.9
|
|
307
|
+
- @verdaccio/loaders@7.0.0-next-7.9
|
|
308
|
+
- @verdaccio/middleware@7.0.0-next-7.9
|
|
309
|
+
- verdaccio-audit@12.0.0-next-7.9
|
|
310
|
+
- @verdaccio/utils@7.0.0-next-7.9
|
|
311
|
+
- @verdaccio/logger@7.0.0-next-7.9
|
|
312
|
+
|
|
313
|
+
## 7.0.0-next-7.8
|
|
314
|
+
|
|
315
|
+
### Patch Changes
|
|
316
|
+
|
|
317
|
+
- Updated dependencies [74cd588]
|
|
318
|
+
- @verdaccio/api@7.0.0-next-7.8
|
|
319
|
+
- @verdaccio/web@7.0.0-next-7.8
|
|
320
|
+
- @verdaccio/core@7.0.0-next-7.8
|
|
321
|
+
- @verdaccio/config@7.0.0-next-7.8
|
|
322
|
+
- @verdaccio/auth@7.0.0-next-7.8
|
|
323
|
+
- @verdaccio/loaders@7.0.0-next-7.8
|
|
324
|
+
- @verdaccio/middleware@7.0.0-next-7.8
|
|
325
|
+
- verdaccio-audit@12.0.0-next-7.8
|
|
326
|
+
- @verdaccio/store@7.0.0-next-7.8
|
|
327
|
+
- @verdaccio/utils@7.0.0-next-7.8
|
|
328
|
+
- @verdaccio/logger@7.0.0-next-7.8
|
|
329
|
+
|
|
330
|
+
## 7.0.0-next-7.7
|
|
331
|
+
|
|
332
|
+
### Patch Changes
|
|
333
|
+
|
|
334
|
+
- @verdaccio/core@7.0.0-next-7.7
|
|
335
|
+
- @verdaccio/config@7.0.0-next-7.7
|
|
336
|
+
- @verdaccio/api@7.0.0-next-7.7
|
|
337
|
+
- @verdaccio/auth@7.0.0-next-7.7
|
|
338
|
+
- @verdaccio/loaders@7.0.0-next-7.7
|
|
339
|
+
- @verdaccio/middleware@7.0.0-next-7.7
|
|
340
|
+
- verdaccio-audit@12.0.0-next-7.7
|
|
341
|
+
- @verdaccio/store@7.0.0-next-7.7
|
|
342
|
+
- @verdaccio/utils@7.0.0-next-7.7
|
|
343
|
+
- @verdaccio/web@7.0.0-next-7.7
|
|
344
|
+
- @verdaccio/logger@7.0.0-next-7.7
|
|
345
|
+
|
|
346
|
+
## 7.0.0-next.6
|
|
347
|
+
|
|
348
|
+
### Patch Changes
|
|
349
|
+
|
|
350
|
+
- Updated dependencies [e14b064]
|
|
351
|
+
- Updated dependencies [4d96324]
|
|
352
|
+
- @verdaccio/store@7.0.0-next.6
|
|
353
|
+
- @verdaccio/config@7.0.0-next.6
|
|
354
|
+
- @verdaccio/api@7.0.0-next.6
|
|
355
|
+
- @verdaccio/web@7.0.0-next.6
|
|
356
|
+
- @verdaccio/auth@7.0.0-next.6
|
|
357
|
+
- @verdaccio/loaders@7.0.0-next.6
|
|
358
|
+
- @verdaccio/middleware@7.0.0-next.6
|
|
359
|
+
- verdaccio-audit@12.0.0-next.6
|
|
360
|
+
- @verdaccio/core@7.0.0-next.6
|
|
361
|
+
- @verdaccio/utils@7.0.0-next.6
|
|
362
|
+
- @verdaccio/logger@7.0.0-next.6
|
|
363
|
+
|
|
3
364
|
## 7.0.0-next.5
|
|
4
365
|
|
|
5
366
|
### Minor Changes
|
package/LICENSE
CHANGED
package/build/debug/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_default","app","configPath","get","req","res","next","global","gc","pid","process","main","conf","mem","memoryUsage","exports","default"],"sources":["../../src/debug/index.ts"],"sourcesContent":["import { Application } from 'express';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../types/custom';\n\nexport default (app: Application, configPath?: string): void => {\n // Hook for tests only\n app.get(\n '/-/_debug',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n if (global.gc) {\n global.gc();\n }\n\n next({\n pid: process.pid,\n // @ts-ignore\n main: process.main,\n conf: configPath,\n mem: process.memoryUsage(),\n gc: global.gc,\n });\n }\n );\n};\n"],"mappings":";;;;;;eAIeA,CAACC,GAAgB,EAAEC,UAAmB,KAAW;EAC9D;EACAD,GAAG,CAACE,GAAG,CACL,WAAW,EACX,UAAUC,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACjF,IAAIC,MAAM,CAACC,EAAE,EAAE;MACbD,MAAM,CAACC,EAAE,CAAC,CAAC;IACb;IAEAF,IAAI,CAAC;MACHG,GAAG,EAAEC,OAAO,CAACD,GAAG;MAChB;MACAE,IAAI,EAAED,OAAO,CAACC,IAAI;MAClBC,IAAI,EAAEV,UAAU;MAChBW,GAAG,EAAEH,OAAO,CAACI,WAAW,CAAC,CAAC;MAC1BN,EAAE,EAAED,MAAM,CAACC;IACb,CAAC,CAAC;EACJ,CACF,CAAC;AACH,CAAC;AAAAO,OAAA,CAAAC,OAAA,GAAAhB,QAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_default","app","configPath","get","req","res","next","global","gc","pid","process","main","conf","mem","memoryUsage","exports","default"],"sources":["../../src/debug/index.ts"],"sourcesContent":["import { Application } from 'express';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../types/custom';\n\nexport default (app: Application, configPath?: string): void => {\n // Hook for tests only\n app.get(\n '/-/_debug',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n if (global.gc) {\n global.gc();\n }\n\n next({\n pid: process.pid,\n // @ts-ignore\n main: process.main,\n conf: configPath,\n mem: process.memoryUsage(),\n gc: global.gc,\n });\n }\n );\n};\n"],"mappings":";;;;;;eAIeA,CAACC,GAAgB,EAAEC,UAAmB,KAAW;EAC9D;EACAD,GAAG,CAACE,GAAG,CACL,WAAW,EACX,UAAUC,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACjF,IAAIC,MAAM,CAACC,EAAE,EAAE;MACbD,MAAM,CAACC,EAAE,CAAC,CAAC;IACb;IAEAF,IAAI,CAAC;MACHG,GAAG,EAAEC,OAAO,CAACD,GAAG;MAChB;MACAE,IAAI,EAAED,OAAO,CAACC,IAAI;MAClBC,IAAI,EAAEV,UAAU;MAChBW,GAAG,EAAEH,OAAO,CAACI,WAAW,CAAC,CAAC;MAC1BN,EAAE,EAAED,MAAM,CAACC;IACb,CAAC,CAAC;EACJ,CACF,CAAC;AACH,CAAC;AAAAO,OAAA,CAAAC,OAAA,GAAAhB,QAAA","ignoreList":[]}
|
package/build/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","names":[],"sources":["../src/env.ts"],"sourcesContent":["// const path = require('path');\n//\n// const APP_ROOT = path.resolve(__dirname, '../../');\n//\n// module.exports = {\n// APP_ROOT,\n// SRC_ROOT: path.resolve(APP_ROOT, 'src/')\n// };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA"}
|
|
1
|
+
{"version":3,"file":"env.js","names":[],"sources":["../src/env.ts"],"sourcesContent":["// const path = require('path');\n//\n// const APP_ROOT = path.resolve(__dirname, '../../');\n//\n// module.exports = {\n// APP_ROOT,\n// SRC_ROOT: path.resolve(APP_ROOT, 'src/')\n// };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
|
package/build/index.js
CHANGED
|
@@ -10,5 +10,5 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _server = _interopRequireDefault(require("./server"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_server","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_server","_interopRequireDefault","require","e","__esModule","default"],"sources":["../src/index.ts"],"sourcesContent":["export { default } from './server';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
package/build/server.js
CHANGED
|
@@ -20,13 +20,13 @@ var _middleware = require("@verdaccio/middleware");
|
|
|
20
20
|
var _store = require("@verdaccio/store");
|
|
21
21
|
var _web = _interopRequireDefault(require("@verdaccio/web"));
|
|
22
22
|
var _debug2 = _interopRequireDefault(require("./debug"));
|
|
23
|
-
function _interopRequireDefault(
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
24
|
const debug = (0, _debug.default)('verdaccio:server');
|
|
25
25
|
const {
|
|
26
26
|
version
|
|
27
27
|
} = require('../package.json');
|
|
28
28
|
const defineAPI = async function (config, storage) {
|
|
29
|
-
var _config$server;
|
|
29
|
+
var _config$server, _config$serverSetting, _config$serverSetting2;
|
|
30
30
|
const auth = new _auth.Auth(config);
|
|
31
31
|
await auth.init();
|
|
32
32
|
const app = (0, _express.default)();
|
|
@@ -59,7 +59,7 @@ const defineAPI = async function (config, storage) {
|
|
|
59
59
|
logger: _logger.logger
|
|
60
60
|
}, function (plugin) {
|
|
61
61
|
return typeof plugin.register_middlewares !== 'undefined';
|
|
62
|
-
});
|
|
62
|
+
}, (_config$serverSetting = config === null || config === void 0 || (_config$serverSetting2 = config.serverSettings) === null || _config$serverSetting2 === void 0 ? void 0 : _config$serverSetting2.pluginPrefix) !== null && _config$serverSetting !== void 0 ? _config$serverSetting : 'verdaccio', _core.PLUGIN_CATEGORY.MIDDLEWARE);
|
|
63
63
|
if (plugins.length === 0) {
|
|
64
64
|
_logger.logger.info('none middleware plugins has been defined, adding audit middleware by default');
|
|
65
65
|
// @ts-ignore
|
|
@@ -134,7 +134,7 @@ var startServer = exports.default = async function startServer(configHash) {
|
|
|
134
134
|
// register middleware plugins
|
|
135
135
|
debug('loaded filter plugin');
|
|
136
136
|
// @ts-ignore
|
|
137
|
-
const storage = new _store.Storage(config);
|
|
137
|
+
const storage = new _store.Storage(config, _logger.logger);
|
|
138
138
|
try {
|
|
139
139
|
// waits until init calls have been initialized
|
|
140
140
|
debug('storage init start');
|
package/build/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":["_compression","_interopRequireDefault","require","_cors","_debug","_express","_lodash","_verdaccioAudit","_api","_auth","_config","_core","_loaders","_logger","_middleware","_store","_web","_debug2","obj","__esModule","default","debug","buildDebug","version","defineAPI","config","storage","_config$server","auth","Auth","init","app","express","set","process","env","NODE_ENV","server","trustProxy","use","cors","rateLimit","serverSettings","errorReportingMiddlewareWrap","errorReportingMiddleware","logger","log","userAgent","compression","get","req","res","next","url","hookDebug","configPath","plugins","asyncLoadPlugin","middlewares","plugin","register_middlewares","length","info","push","AuditMiddleware","enabled","strict_ssl","forEach","apiEndpoint","_","_req","locals","app_version","middleware","webMiddleware","errorUtils","getNotFound","API_ERROR","WEB_DISABLED","handleError","final","startServer","exports","configHash","AppConfig","Storage","err","error","msg","Error"],"sources":["../src/server.ts"],"sourcesContent":["import compression from 'compression';\nimport cors from 'cors';\nimport buildDebug from 'debug';\nimport express from 'express';\nimport _ from 'lodash';\nimport AuditMiddleware from 'verdaccio-audit';\n\nimport apiEndpoint from '@verdaccio/api';\nimport { Auth } from '@verdaccio/auth';\nimport { Config as AppConfig } from '@verdaccio/config';\nimport { API_ERROR, errorUtils, pluginUtils } from '@verdaccio/core';\nimport { asyncLoadPlugin } from '@verdaccio/loaders';\nimport { logger } from '@verdaccio/logger';\nimport {\n errorReportingMiddleware,\n final,\n handleError,\n log,\n rateLimit,\n userAgent,\n} from '@verdaccio/middleware';\nimport { Storage } from '@verdaccio/store';\nimport { ConfigYaml } from '@verdaccio/types';\nimport { Config as IConfig } from '@verdaccio/types';\nimport webMiddleware from '@verdaccio/web';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';\nimport hookDebug from './debug';\n\nconst debug = buildDebug('verdaccio:server');\nconst { version } = require('../package.json');\n\nconst defineAPI = async function (config: IConfig, storage: Storage): Promise<any> {\n const auth: Auth = new Auth(config);\n await auth.init();\n const app = express();\n // run in production mode by default, just in case\n // it shouldn't make any difference anyway\n app.set('env', process.env.NODE_ENV || 'production');\n if (config.server?.trustProxy) {\n app.set('trust proxy', config.server.trustProxy);\n }\n app.use(cors());\n app.use(rateLimit(config.serverSettings.rateLimit));\n\n const errorReportingMiddlewareWrap = errorReportingMiddleware(logger);\n\n // Router setup\n app.use(log(logger));\n app.use(errorReportingMiddlewareWrap);\n app.use(userAgent(config));\n app.use(compression());\n\n app.get(\n '/favicon.ico',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n req.url = '/-/static/favicon.ico';\n next();\n }\n );\n\n // Hook for tests only\n if (config._debug) {\n hookDebug(app, config.configPath);\n }\n\n const plugins: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>[] = await asyncLoadPlugin(\n config.middlewares,\n {\n config,\n logger,\n },\n function (plugin) {\n return typeof plugin.register_middlewares !== 'undefined';\n }\n );\n\n if (plugins.length === 0) {\n logger.info('none middleware plugins has been defined, adding audit middleware by default');\n // @ts-ignore\n plugins.push(new AuditMiddleware({ enabled: true, strict_ssl: true }, { config, logger }));\n }\n\n plugins.forEach((plugin: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>) => {\n plugin.register_middlewares(app, auth, storage);\n });\n\n // For npm request\n // @ts-ignore\n app.use(apiEndpoint(config, auth, storage));\n\n // For WebUI & WebUI API\n if (_.get(config, 'web.enable', true)) {\n app.use((_req, res, next) => {\n res.locals.app_version = version ?? '';\n next();\n });\n const middleware = await webMiddleware(config, auth, storage);\n app.use(middleware);\n } else {\n app.get('/', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound(API_ERROR.WEB_DISABLED));\n });\n }\n\n // Catch 404\n app.get('/*', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound('resource not found'));\n });\n\n // @ts-ignore\n app.use(handleError(logger));\n\n // app.use(function (\n // err: HttpError,\n // req: $RequestExtend,\n // res: $ResponseExtend,\n // next: $NextFunctionVer\n // ) {\n // if (_.isError(err)) {\n // if (err.code === 'ECONNABORT' && res.statusCode === HTTP_STATUS.NOT_MODIFIED) {\n // return next();\n // }\n // if (_.isFunction(res.locals.report_error) === false) {\n // // in case of very early error this middleware may not be loaded before error is generated\n // // fixing that\n // errorReportingMiddlewareWrap(req, res, _.noop);\n // }\n // res.locals.report_error(err);\n // } else {\n // // Fall to Middleware.final\n // return next(err);\n // }\n // });\n\n app.use(final);\n\n return app;\n};\n\nexport default (async function startServer(configHash: ConfigYaml): Promise<any> {\n debug('start server');\n const config: IConfig = new AppConfig({ ...configHash } as any);\n // register middleware plugins\n debug('loaded filter plugin');\n // @ts-ignore\n const storage: Storage = new Storage(config);\n try {\n // waits until init calls have been initialized\n debug('storage init start');\n await storage.init(config);\n debug('storage init end');\n } catch (err: any) {\n logger.error({ error: err.msg }, 'storage has failed: @{error}');\n throw new Error(err);\n }\n return await defineAPI(config, storage);\n});\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,IAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GA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E9D,KAAK,CAAC,cAAc,CAAC;EACrB,MAAMI,MAAe,GAAG,IAAI2D,cAAS,CAAC;IAAE,GAAGD;EAAW,CAAQ,CAAC;EAC/D;EACA9D,KAAK,CAAC,sBAAsB,CAAC;EAC7B;EACA,MAAMK,OAAgB,GAAG,IAAI2D,cAAO,CAAC5D,MAAM,CAAC;EAC5C,IAAI;IACF;IACAJ,KAAK,CAAC,oBAAoB,CAAC;IAC3B,MAAMK,OAAO,CAACI,IAAI,CAACL,MAAM,CAAC;IAC1BJ,KAAK,CAAC,kBAAkB,CAAC;EAC3B,CAAC,CAAC,OAAOiE,GAAQ,EAAE;IACjBzC,cAAM,CAAC0C,KAAK,CAAC;MAAEA,KAAK,EAAED,GAAG,CAACE;IAAI,CAAC,EAAE,8BAA8B,CAAC;IAChE,MAAM,IAAIC,KAAK,CAACH,GAAG,CAAC;EACtB;EACA,OAAO,MAAM9D,SAAS,CAACC,MAAM,EAAEC,OAAO,CAAC;AACzC,CAAC"}
|
|
1
|
+
{"version":3,"file":"server.js","names":["_compression","_interopRequireDefault","require","_cors","_debug","_express","_lodash","_verdaccioAudit","_api","_auth","_config","_core","_loaders","_logger","_middleware","_store","_web","_debug2","e","__esModule","default","debug","buildDebug","version","defineAPI","config","storage","_config$server","_config$serverSetting","_config$serverSetting2","auth","Auth","init","app","express","set","process","env","NODE_ENV","server","trustProxy","use","cors","rateLimit","serverSettings","errorReportingMiddlewareWrap","errorReportingMiddleware","logger","log","userAgent","compression","get","req","res","next","url","hookDebug","configPath","plugins","asyncLoadPlugin","middlewares","plugin","register_middlewares","pluginPrefix","PLUGIN_CATEGORY","MIDDLEWARE","length","info","push","AuditMiddleware","enabled","strict_ssl","forEach","apiEndpoint","_","_req","locals","app_version","middleware","webMiddleware","errorUtils","getNotFound","API_ERROR","WEB_DISABLED","handleError","final","startServer","exports","configHash","AppConfig","Storage","err","error","msg","Error"],"sources":["../src/server.ts"],"sourcesContent":["import compression from 'compression';\nimport cors from 'cors';\nimport buildDebug from 'debug';\nimport express from 'express';\nimport _ from 'lodash';\nimport AuditMiddleware from 'verdaccio-audit';\n\nimport apiEndpoint from '@verdaccio/api';\nimport { Auth } from '@verdaccio/auth';\nimport { Config as AppConfig } from '@verdaccio/config';\nimport { API_ERROR, PLUGIN_CATEGORY, errorUtils, pluginUtils } from '@verdaccio/core';\nimport { asyncLoadPlugin } from '@verdaccio/loaders';\nimport { logger } from '@verdaccio/logger';\nimport {\n errorReportingMiddleware,\n final,\n handleError,\n log,\n rateLimit,\n userAgent,\n} from '@verdaccio/middleware';\nimport { Storage } from '@verdaccio/store';\nimport { ConfigYaml } from '@verdaccio/types';\nimport { Config as IConfig } from '@verdaccio/types';\nimport webMiddleware from '@verdaccio/web';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';\nimport hookDebug from './debug';\n\nconst debug = buildDebug('verdaccio:server');\nconst { version } = require('../package.json');\n\nconst defineAPI = async function (config: IConfig, storage: Storage): Promise<any> {\n const auth: Auth = new Auth(config);\n await auth.init();\n const app = express();\n // run in production mode by default, just in case\n // it shouldn't make any difference anyway\n app.set('env', process.env.NODE_ENV || 'production');\n if (config.server?.trustProxy) {\n app.set('trust proxy', config.server.trustProxy);\n }\n app.use(cors());\n app.use(rateLimit(config.serverSettings.rateLimit));\n\n const errorReportingMiddlewareWrap = errorReportingMiddleware(logger);\n\n // Router setup\n app.use(log(logger));\n app.use(errorReportingMiddlewareWrap);\n app.use(userAgent(config));\n app.use(compression());\n\n app.get(\n '/favicon.ico',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n req.url = '/-/static/favicon.ico';\n next();\n }\n );\n\n // Hook for tests only\n if (config._debug) {\n hookDebug(app, config.configPath);\n }\n\n const plugins: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>[] = await asyncLoadPlugin(\n config.middlewares,\n {\n config,\n logger,\n },\n function (plugin) {\n return typeof plugin.register_middlewares !== 'undefined';\n },\n config?.serverSettings?.pluginPrefix ?? 'verdaccio',\n PLUGIN_CATEGORY.MIDDLEWARE\n );\n\n if (plugins.length === 0) {\n logger.info('none middleware plugins has been defined, adding audit middleware by default');\n // @ts-ignore\n plugins.push(new AuditMiddleware({ enabled: true, strict_ssl: true }, { config, logger }));\n }\n\n plugins.forEach((plugin: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>) => {\n plugin.register_middlewares(app, auth, storage);\n });\n\n // For npm request\n // @ts-ignore\n app.use(apiEndpoint(config, auth, storage));\n\n // For WebUI & WebUI API\n if (_.get(config, 'web.enable', true)) {\n app.use((_req, res, next) => {\n res.locals.app_version = version ?? '';\n next();\n });\n const middleware = await webMiddleware(config, auth, storage);\n app.use(middleware);\n } else {\n app.get('/', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound(API_ERROR.WEB_DISABLED));\n });\n }\n\n // Catch 404\n app.get('/*', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound('resource not found'));\n });\n\n // @ts-ignore\n app.use(handleError(logger));\n\n // app.use(function (\n // err: HttpError,\n // req: $RequestExtend,\n // res: $ResponseExtend,\n // next: $NextFunctionVer\n // ) {\n // if (_.isError(err)) {\n // if (err.code === 'ECONNABORT' && res.statusCode === HTTP_STATUS.NOT_MODIFIED) {\n // return next();\n // }\n // if (_.isFunction(res.locals.report_error) === false) {\n // // in case of very early error this middleware may not be loaded before error is generated\n // // fixing that\n // errorReportingMiddlewareWrap(req, res, _.noop);\n // }\n // res.locals.report_error(err);\n // } else {\n // // Fall to Middleware.final\n // return next(err);\n // }\n // });\n\n app.use(final);\n\n return app;\n};\n\nexport default (async function startServer(configHash: ConfigYaml): Promise<any> {\n debug('start server');\n const config: IConfig = new AppConfig({ ...configHash } as any);\n // register middleware plugins\n debug('loaded filter plugin');\n // @ts-ignore\n const storage: Storage = new Storage(config, logger);\n try {\n // waits until init calls have been initialized\n debug('storage init start');\n await storage.init(config);\n debug('storage init end');\n } catch (err: any) {\n logger.error({ error: err.msg }, 'storage has failed: @{error}');\n throw new Error(err);\n }\n return await defineAPI(config, storage);\n});\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,IAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAQA,IAAAa,MAAA,GAAAb,OAAA;AAGA,IAAAc,IAAA,GAAAf,sBAAA,CAAAC,OAAA;AAGA,IAAAe,OAAA,GAAAhB,sBAAA,CAAAC,OAAA;AAAgC,SAAAD,uBAAAiB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,kBAAkB,CAAC;AAC5C,MAAM;EAAEC;AAAQ,CAAC,GAAGrB,OAAO,CAAC,iBAAiB,CAAC;AAE9C,MAAMsB,SAAS,GAAG,eAAAA,CAAgBC,MAAe,EAAEC,OAAgB,EAAgB;EAAA,IAAAC,cAAA,EAAAC,qBAAA,EAAAC,sBAAA;EACjF,MAAMC,IAAU,GAAG,IAAIC,UAAI,CAACN,MAAM,CAAC;EACnC,MAAMK,IAAI,CAACE,IAAI,CAAC,CAAC;EACjB,MAAMC,GAAG,GAAG,IA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AK,EAAED,GAAG,CAACE;IAAI,CAAC,EAAE,8BAA8B,CAAC;IAChE,MAAM,IAAIC,KAAK,CAACH,GAAG,CAAC;EACtB;EACA,OAAO,MAAMnE,SAAS,CAACC,MAAM,EAAEC,OAAO,CAAC;AACzC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-next-8.0",
|
|
4
4
|
"description": "server logic",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -29,26 +29,26 @@
|
|
|
29
29
|
"node": ">=18"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@verdaccio/api": "7.0.
|
|
33
|
-
"@verdaccio/auth": "7.0.
|
|
34
|
-
"@verdaccio/core": "
|
|
35
|
-
"@verdaccio/config": "
|
|
36
|
-
"@verdaccio/loaders": "
|
|
37
|
-
"@verdaccio/logger": "
|
|
38
|
-
"@verdaccio/middleware": "
|
|
39
|
-
"@verdaccio/store": "
|
|
40
|
-
"@verdaccio/utils": "7.0.
|
|
41
|
-
"@verdaccio/web": "7.0.
|
|
42
|
-
"verdaccio-audit": "
|
|
32
|
+
"@verdaccio/api": "7.0.1-next-8.0",
|
|
33
|
+
"@verdaccio/auth": "7.0.1-next-8.0",
|
|
34
|
+
"@verdaccio/core": "8.0.0-next-8.0",
|
|
35
|
+
"@verdaccio/config": "8.0.0-next-8.0",
|
|
36
|
+
"@verdaccio/loaders": "8.0.0-next-8.0",
|
|
37
|
+
"@verdaccio/logger": "8.0.0-next-8.0",
|
|
38
|
+
"@verdaccio/middleware": "8.0.0-next-8.0",
|
|
39
|
+
"@verdaccio/store": "8.0.0-next-8.0",
|
|
40
|
+
"@verdaccio/utils": "7.0.1-next-8.0",
|
|
41
|
+
"@verdaccio/web": "7.0.1-next-8.0",
|
|
42
|
+
"verdaccio-audit": "13.0.0-next-8.0",
|
|
43
43
|
"compression": "1.7.4",
|
|
44
44
|
"cors": "2.8.5",
|
|
45
|
-
"debug": "4.3.
|
|
46
|
-
"express": "4.
|
|
45
|
+
"debug": "4.3.7",
|
|
46
|
+
"express": "4.21.0",
|
|
47
47
|
"lodash": "4.17.21"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@verdaccio/proxy": "
|
|
51
|
-
"@verdaccio/test-helper": "
|
|
50
|
+
"@verdaccio/proxy": "8.0.0-next-8.0",
|
|
51
|
+
"@verdaccio/test-helper": "4.0.0-next-8.0",
|
|
52
52
|
"http-errors": "2.0.0"
|
|
53
53
|
},
|
|
54
54
|
"funding": {
|
package/src/server.ts
CHANGED
|
@@ -8,7 +8,7 @@ import AuditMiddleware from 'verdaccio-audit';
|
|
|
8
8
|
import apiEndpoint from '@verdaccio/api';
|
|
9
9
|
import { Auth } from '@verdaccio/auth';
|
|
10
10
|
import { Config as AppConfig } from '@verdaccio/config';
|
|
11
|
-
import { API_ERROR, errorUtils, pluginUtils } from '@verdaccio/core';
|
|
11
|
+
import { API_ERROR, PLUGIN_CATEGORY, errorUtils, pluginUtils } from '@verdaccio/core';
|
|
12
12
|
import { asyncLoadPlugin } from '@verdaccio/loaders';
|
|
13
13
|
import { logger } from '@verdaccio/logger';
|
|
14
14
|
import {
|
|
@@ -72,7 +72,9 @@ const defineAPI = async function (config: IConfig, storage: Storage): Promise<an
|
|
|
72
72
|
},
|
|
73
73
|
function (plugin) {
|
|
74
74
|
return typeof plugin.register_middlewares !== 'undefined';
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
|
+
config?.serverSettings?.pluginPrefix ?? 'verdaccio',
|
|
77
|
+
PLUGIN_CATEGORY.MIDDLEWARE
|
|
76
78
|
);
|
|
77
79
|
|
|
78
80
|
if (plugins.length === 0) {
|
|
@@ -144,7 +146,7 @@ export default (async function startServer(configHash: ConfigYaml): Promise<any>
|
|
|
144
146
|
// register middleware plugins
|
|
145
147
|
debug('loaded filter plugin');
|
|
146
148
|
// @ts-ignore
|
|
147
|
-
const storage: Storage = new Storage(config);
|
|
149
|
+
const storage: Storage = new Storage(config, logger);
|
|
148
150
|
try {
|
|
149
151
|
// waits until init calls have been initialized
|
|
150
152
|
debug('storage init start');
|