1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/.changeset/dry-planes-tap.md
Juan Picado 459b6fa72b
refactor: search v1 endpoint and local-database (#2340)
* Refactor local-storage async

refactor local storage search stream

Remove async from local-storage, refactor search with streams

refactor search with undici fetch

finish search refactor

stream multiple request to single stream

refactor storage types

remove async dependency #1225

add score and refactor metadata

remove old search async

fix missing stream local data

clean up

clean up

refactor folder search

format

fix some test

fix issue on publish

filter preview

update ci

delete package folder refactor

refactor get packages methods

fix tests

fix lock file

add changeset

fix test windows

disable some test

update package json versions

* fix merge

* fix e2e cli

* restore e2e

* Update process.ts

* Update process.ts

* add improvement

* format

* Update utils.ts

* test

* test

* Update search.spec.ts

* Update search.spec.ts

* Update search.spec.ts

* test

* Update ci.yml

* clean up

* fix tests

* Update tags.ts

* Update index.spec.ts

* document changeset

* format
2021-09-08 19:06:37 +02:00

1.9 KiB

@verdaccio/api @verdaccio/auth @verdaccio/cli @verdaccio/config @verdaccio/commons-api @verdaccio/core @verdaccio/local-storage @verdaccio/fastify-migration @verdaccio/streams @verdaccio/types @verdaccio/hooks verdaccio-audit verdaccio-aws-s3-storage verdaccio-google-cloud verdaccio-memory @verdaccio/ui-theme @verdaccio/proxy @verdaccio/server @verdaccio/store @verdaccio/eslint-config @verdaccio/dev-types @verdaccio/utils verdaccio @verdaccio/web
major major major major major major major major major major major major major major major major major major major major major major major major

refactor: search v1 endpoint and local-database

  • refactor search api v1 endpoint, improve performance
  • remove usage of async dependency https://github.com/verdaccio/verdaccio/issues/1225
  • refactor method storage class
  • create new module core to reduce the ammount of modules with utilities
  • use undici instead node-fetch
  • use fastify instead express for functional test

Breaking changes

  • plugin storage API changes
  • remove old search endpoint (return 404)
  • filter local private packages at plugin level

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.

export interface IPluginStorage<T> extends IPlugin {
  add(name: string): Promise<void>;
  remove(name: string): Promise<void>;
  get(): Promise<any>;
  init(): Promise<void>;
  getSecret(): Promise<string>;
  setSecret(secret: string): Promise<any>;
  getPackageStorage(packageInfo: string): IPackageStorage;
  search(query: searchUtils.SearchQuery): Promise<searchUtils.SearchItem[]>;
  saveToken(token: Token): Promise<any>;
  deleteToken(user: string, tokenKey: string): Promise<any>;
  readTokens(filter: TokenFilter): Promise<Token[]>;
}