@verdaccio/types 11.0.0-6-next.25 → 12.0.0-next.1

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