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

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