@verdaccio/types 11.0.0-6-next.25 → 12.0.0-next.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 CHANGED
@@ -1,5 +1,400 @@
1
1
  # Change Log
2
2
 
3
+ ## 12.0.0-next.0
4
+
5
+ ### Major Changes
6
+
7
+ - feat!: bump to v7
8
+
9
+ ## 11.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - 292c0a37f: feat!: replace deprecated request dependency by got
14
+
15
+ 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.
16
+
17
+ ## Notes
18
+
19
+ - Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
20
+ - Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
21
+ - Refactor with promises instead callback wherever is possible
22
+ - ~Document the API~
23
+ - Improve testing, integration tests
24
+ - Bugfix
25
+ - Clean up old validations
26
+ - Improve performance
27
+
28
+ ## 💥 Breaking changes
29
+
30
+ - Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
31
+ - 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));`
32
+ - `@verdaccio/streams` stream abort support is legacy is being deprecated removed
33
+ - Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
34
+
35
+ - a3a209b5e: feat: migrate to pino.js 8
36
+ - 459b6fa72: refactor: search v1 endpoint and local-database
37
+
38
+ - refactor search `api v1` endpoint, improve performance
39
+ - remove usage of `async` dependency https://github.com/verdaccio/verdaccio/issues/1225
40
+ - refactor method storage class
41
+ - create new module `core` to reduce the ammount of modules with utilities
42
+ - use `undici` instead `node-fetch`
43
+ - use `fastify` instead `express` for functional test
44
+
45
+ ### Breaking changes
46
+
47
+ - plugin storage API changes
48
+ - remove old search endpoint (return 404)
49
+ - filter local private packages at plugin level
50
+
51
+ The storage api changes for methods `get`, `add`, `remove` as promise base. The `search` methods also changes and recieves a `query` object that contains all query params from the client.
52
+
53
+ ```ts
54
+ export interface IPluginStorage<T> extends IPlugin {
55
+ add(name: string): Promise<void>;
56
+ remove(name: string): Promise<void>;
57
+ get(): Promise<any>;
58
+ init(): Promise<void>;
59
+ getSecret(): Promise<string>;
60
+ setSecret(secret: string): Promise<any>;
61
+ getPackageStorage(packageInfo: string): IPackageStorage;
62
+ search(query: searchUtils.SearchQuery): Promise<searchUtils.SearchItem[]>;
63
+ saveToken(token: Token): Promise<any>;
64
+ deleteToken(user: string, tokenKey: string): Promise<any>;
65
+ readTokens(filter: TokenFilter): Promise<Token[]>;
66
+ }
67
+ ```
68
+
69
+ - 9fc2e7961: feat(plugins): improve plugin loader
70
+
71
+ ### Changes
72
+
73
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
74
+ - Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
75
+ - https://github.com/verdaccio/verdaccio/issues/1394
76
+ - `config.plugins` plugin path validations
77
+ - Updated algorithm for plugin loader.
78
+ - improved documentation (included dev)
79
+
80
+ ## Features
81
+
82
+ - Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
83
+ - Custom prefix:
84
+
85
+ ```
86
+ // config.yaml
87
+ server:
88
+ pluginPrefix: mycompany
89
+ middleware:
90
+ audit:
91
+ foo: 1
92
+ ```
93
+
94
+ This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
95
+
96
+ ## Breaking Changes
97
+
98
+ ### sinopia plugins
99
+
100
+ - `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
101
+
102
+ ### plugin filter
103
+
104
+ - method rename `filter_metadata`->`filterMetadata`
105
+
106
+ ### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
107
+
108
+ The plugin receives as first argument `config`, which represents the config of the plugin. Example:
109
+
110
+ ```
111
+ // config.yaml
112
+ auth:
113
+ plugin:
114
+ foo: 1
115
+ bar: 2
116
+
117
+ export class Plugin<T> {
118
+ public constructor(config: T, options: PluginOptions) {
119
+ console.log(config);
120
+ // {foo:1, bar: 2}
121
+ }
122
+ }
123
+ ```
124
+
125
+ - 794af76c5: Remove Node 12 support
126
+
127
+ - We need move to the new `undici` and does not support Node.js 12
128
+
129
+ - 10aeb4f13: feat!: experiments config renamed to flags
130
+
131
+ - The `experiments` configuration is renamed to `flags`. The functionality is exactly the same.
132
+
133
+ ```js
134
+ flags: token: false;
135
+ search: false;
136
+ ```
137
+
138
+ - The `self_path` property from the config file is being removed in favor of `config_file` full path.
139
+ - Refactor `config` module, better types and utilities
140
+
141
+ - e367c3f1e: - Replace signature handler for legacy tokens by removing deprecated crypto.createDecipher by createCipheriv
142
+
143
+ - Introduce environment variables for legacy tokens
144
+
145
+ ### Code Improvements
146
+
147
+ - Add debug library for improve developer experience
148
+
149
+ ### Breaking change
150
+
151
+ - The new signature invalidates all previous tokens generated by Verdaccio 4 or previous versions.
152
+ - The secret key must have 32 characters long.
153
+
154
+ ### New environment variables
155
+
156
+ - `VERDACCIO_LEGACY_ALGORITHM`: Allows to define the specific algorithm for the token signature which by default is `aes-256-ctr`
157
+ - `VERDACCIO_LEGACY_ENCRYPTION_KEY`: By default, the token stores in the database, but using this variable allows to get it from memory
158
+
159
+ - 999787974: feat(web): components for custom user interfaces
160
+
161
+ Provides a package that includes all components from the user interface, instead being embedded at the `@verdaccio/ui-theme` package.
162
+
163
+ ```
164
+ npm i -D @verdaccio/ui-components
165
+ ```
166
+
167
+ The package contains
168
+
169
+ - Components
170
+ - Providers
171
+ - Redux Storage
172
+ - Layouts (precomposed layouts ready to use)
173
+ - Custom Material Theme
174
+
175
+ The `@verdaccio/ui-theme` will consume this package and will use only those are need it.
176
+
177
+ > Prerequisites are using Redux, Material-UI and Translations with `i18next`.
178
+
179
+ Users could have their own Material UI theme and build custom layouts, adding new features without the need to modify the default project.
180
+
181
+ - 82cb0f2bf: feat!: config.logs throw an error, logging config not longer accept array or logs property
182
+
183
+ ### 💥 Breaking change
184
+
185
+ This is valid
186
+
187
+ ```yaml
188
+ log: { type: stdout, format: pretty, level: http }
189
+ ```
190
+
191
+ This is invalid
192
+
193
+ ```yaml
194
+ logs: { type: stdout, format: pretty, level: http }
195
+ ```
196
+
197
+ or
198
+
199
+ ```yaml
200
+ logs:
201
+ - [{ type: stdout, format: pretty, level: http }]
202
+ ```
203
+
204
+ - 000d43746: feat: upgrade to material ui 5
205
+ - 8f43bf17d: feat: node api new structure based on promise
206
+
207
+ ```js
208
+ import { runServer } from '@verdaccio/node-api';
209
+ // or
210
+ import { runServer } from 'verdaccio';
211
+
212
+ const app = await runServer(); // default configuration
213
+ const app = await runServer('./config/config.yaml');
214
+ const app = await runServer({ configuration });
215
+ app.listen(4000, (event) => {
216
+ // do something
217
+ });
218
+ ```
219
+
220
+ ### Breaking Change
221
+
222
+ If you are using the node-api, the new structure is Promise based and less arguments.
223
+
224
+ ### Minor Changes
225
+
226
+ - 0da7031e7: allow disable login on ui and endpoints
227
+
228
+ To be able disable the login, set `login: false`, anything else would enable login. This flag will disable access via UI and web endpoints.
229
+
230
+ ```yml
231
+ web:
232
+ title: verdaccio
233
+ login: false
234
+ ```
235
+
236
+ - 974cd8c19: fix: startup messages improved and logs support on types
237
+ - ef88da3b4: feat: improve support for fs promises older nodejs
238
+ - 631abe1ac: feat: refactor logger
239
+ - b61f762d6: feat: add server rate limit protection to all request
240
+
241
+ To modify custom values, use the server settings property.
242
+
243
+ ```markdown
244
+ server:
245
+
246
+ ## https://www.npmjs.com/package/express-rate-limit#configuration-options
247
+
248
+ rateLimit:
249
+ windowMs: 1000
250
+ max: 10000
251
+ ```
252
+
253
+ The values are intended to be high, if you want to improve security of your server consider
254
+ using different values.
255
+
256
+ - d43894e8f: feat: rework web header for mobile, add new settings and raw manifest button
257
+
258
+ ### New set of variables to hide features
259
+
260
+ Add set of new variables that allow hide different parts of the UI, buttons, footer or download tarballs. _All are
261
+ enabled by default_.
262
+
263
+ ```yaml
264
+ # login: true <-- already exist but worth the reminder
265
+ # showInfo: true
266
+ # showSettings: true
267
+ # In combination with darkMode you can force specific theme
268
+ # showThemeSwitch: true
269
+ # showFooter: true
270
+ # showSearch: true
271
+ # showDownloadTarball: true
272
+ ```
273
+
274
+ > If you disable `showThemeSwitch` and force `darkMode: true` the local storage settings would be
275
+ > ignored and force all themes to the one in the configuration file.
276
+
277
+ Future could be extended to
278
+
279
+ ### Raw button to display manifest package
280
+
281
+ A new experimental feature (enabled by default), button named RAW to be able navigate on the package manifest directly on the ui, kudos to [react-json-view](https://www.npmjs.com/package/react-json-view) that allows an easy integration, not configurable yet until get more feedback.
282
+
283
+ ```yaml
284
+ showRaw: true
285
+ ```
286
+
287
+ #### Rework header buttons
288
+
289
+ - The header has been rework, the mobile was not looking broken.
290
+ - Removed info button in the header and moved to a dialog
291
+ - Info dialog now contains more information about the project, license and the aid content for Ukrania now is inside of the info modal.
292
+ - Separate settings and info to avoid collapse too much info (for mobile still need some work)
293
+
294
+ - 154b2ecd3: refactor: remove @verdaccio/commons-api in favor @verdaccio/core and remove duplications
295
+ - aa763baec: feat: add typescript project references settings
296
+
297
+ Reading https://ebaytech.berlin/optimizing-multi-package-apps-with-typescript-project-references-d5c57a3b4440 I realized I can use project references to solve the issue to pre-compile modules on develop mode.
298
+
299
+ It allows to navigate (IDE) trough the packages without need compile the packages.
300
+
301
+ Add two `tsconfig`, one using the previous existing configuration that is able to produce declaration files (`tsconfig.build`) and a new one `tsconfig` which is enables [_projects references_](https://www.typescriptlang.org/docs/handbook/project-references.html).
302
+
303
+ - 16e38df8a: feat: trustProxy property
304
+ - dc571aabd: feat: add forceEnhancedLegacySignature
305
+ - 62c24b632: feat: add passwordValidationRegex property
306
+ - 5167bb528: feat: ui search support for remote, local and private packages
307
+
308
+ The command `npm search` search globally and return all matches, with this improvement the user interface
309
+ is powered with the same capabilities.
310
+
311
+ The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
312
+
313
+ - 5cf041a1a: feat: add dist.signatures to core/types
314
+
315
+ According to [`npm`](https://docs.npmjs.com/about-registry-signatures): _"Signatures are provided in the package's `packument` in each published version within the `dist` object"_
316
+
317
+ Here's an [example of a package version from the public npm registry with `dist.signatures`](https://registry.npmjs.org/light-cycle/1.4.3).
318
+
319
+ - 37274e4c8: feat: implement abbreviated manifest
320
+
321
+ Enable abbreviated manifest data by adding the header:
322
+
323
+ ```
324
+ curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
325
+ ```
326
+
327
+ It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
328
+
329
+ Current support for packages managers:
330
+
331
+ - npm: yes
332
+ - pnpm: yes
333
+ - yarn classic: yes
334
+ - yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
335
+
336
+ https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
337
+
338
+ - 45c03819e: refactor: render html middleware
339
+ - aecbd226d: web: allow ui hide package managers on sidebar
340
+
341
+ If there is a package manager of preference over others, you can define the package managers to be displayed on the detail page and sidebar, just define in the `config.yaml` and web section the list of package managers to be displayed.
342
+
343
+ ```
344
+ web:
345
+ title: Verdaccio
346
+ sort_packages: asc
347
+ primary_color: #cccccc
348
+ pkgManagers:
349
+ - pnpm
350
+ - yarn
351
+ # - npm
352
+ ```
353
+
354
+ To disable all package managers, just define empty:
355
+
356
+ ```
357
+ web:
358
+ title: Verdaccio
359
+ sort_packages: asc
360
+ primary_color: #cccccc
361
+ pkgManagers:
362
+ ```
363
+
364
+ and the section would be hidden.
365
+
366
+ ### Patch Changes
367
+
368
+ - 351aeeaa8: fix(deps): @verdaccio/utils should be a prod dep of local-storage
369
+ - 7ef599cc4: fix: missing version on footer
370
+ - 19d272d10: fix: restore logger on init
371
+
372
+ Enable logger after parse configuration and log the very first step on startup phase.
373
+
374
+ ```bash
375
+ warn --- experiments are enabled, it is recommended do not use experiments in production comment out this section to disable it
376
+ info --- support for experiment [token] is disabled
377
+ info --- support for experiment [search] is disabled
378
+ (node:50831) Warning: config.logs is deprecated, rename configuration to "config.log"
379
+ (Use `node --trace-warnings ...` to show where the warning was created)
380
+ info --- http address http://localhost:4873/
381
+ info --- version: 6.0.0-6-next.11
382
+ info --- server started
383
+ ```
384
+
385
+ - a610ef26b: chore: add release step to private regisry on merge changeset pr
386
+ - 4fc21146a: fix: missing logo on header
387
+ - 34f0f1101: Enable prerelease mode with **changesets**
388
+ - 68ea21214: ESLint Warnings Fixed
389
+
390
+ Related to issue #1461
391
+
392
+ - max-len: most of the sensible max-len errors are fixed
393
+ - no-unused-vars: most of these types of errors are fixed by deleting not needed declarations
394
+ - @typescript-eslint/no-unused-vars: same as above
395
+
396
+ - b849128de: fix: handle upload scoped tarball
397
+
3
398
  ## 11.0.0-6-next.25
4
399
 
5
400
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/types",
3
- "version": "11.0.0-6-next.25",
3
+ "version": "12.0.0-next.0",
4
4
  "description": "verdaccio types definitions",
5
5
  "keywords": [
6
6
  "private",
@@ -33,7 +33,6 @@
33
33
  "main": "src/types.ts",
34
34
  "types": "src/types.ts",
35
35
  "devDependencies": {
36
- "@types/node": "16.18.10",
37
36
  "typedoc": "0.23.25"
38
37
  },
39
38
  "typedoc": {
@@ -51,6 +50,5 @@
51
50
  "build:docs": "typedoc --options ./typedoc.json --tsconfig tsconfig.build.json",
52
51
  "type-check": "tsc --noEmit -p tsconfig.build.json",
53
52
  "build": "echo 0"
54
- },
55
- "readme": "# @verdaccio/types\n\nTypeScript definitions for Verdaccio plugins and internal code.\n"
53
+ }
56
54
  }
@@ -18,9 +18,6 @@ export type LoggerLevel = 'http' | 'fatal' | 'warn' | 'info' | 'debug' | 'trace'
18
18
 
19
19
  export type LoggerConfigItem = {
20
20
  type?: LoggerType;
21
- /**
22
- * The format
23
- */
24
21
  format?: LoggerFormat;
25
22
  path?: string;
26
23
  level?: string;