-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin): improve plugin loader (#3370)
* feat(plugin): implement scope package support plugins * feat(plugin): improve plugin loader * chore: fix build * chore: cover config path case * chore: async ui thene plugin * chore: store async plugin * chore: refactor plugin loader auth * feat: filter refactoring * chore: remove old plugin loader * chore: add changeset * chore: add docs * chore: refactor relative plugin loader * Update user.jwt.spec.ts * Update user.jwt.spec.ts
- Loading branch information
1 parent
98afd48
commit 9fc2e79
Showing
67 changed files
with
807 additions
and
525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
'@verdaccio/api': major | ||
'@verdaccio/auth': major | ||
'@verdaccio/config': major | ||
'@verdaccio/types': major | ||
'@verdaccio/loaders': major | ||
'@verdaccio/node-api': major | ||
'verdaccio-audit': major | ||
'verdaccio-auth-memory': major | ||
'verdaccio-htpasswd': major | ||
'@verdaccio/local-storage': major | ||
'verdaccio-memory': major | ||
'@verdaccio/server': major | ||
'@verdaccio/server-fastify': major | ||
'@verdaccio/store': major | ||
'@verdaccio/test-helper': major | ||
'customprefix-auth': major | ||
'verdaccio': major | ||
'@verdaccio/web': major | ||
--- | ||
|
||
feat(plugins): improve plugin loader | ||
|
||
### Changes | ||
|
||
- Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227 | ||
- Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928 | ||
- https://github.com/verdaccio/verdaccio/issues/1394 | ||
- `config.plugins` plugin path validations | ||
- Updated algorithm for plugin loader. | ||
- improved documentation (included dev) | ||
|
||
## Features | ||
|
||
- Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227 | ||
- Custom prefix: | ||
|
||
``` | ||
// config.yaml | ||
server: | ||
pluginPrefix: mycompany | ||
middleware: | ||
audit: | ||
foo: 1 | ||
``` | ||
|
||
This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`. | ||
|
||
## Breaking Changes | ||
|
||
### sinopia plugins | ||
|
||
- `sinopia` fallback support is removed, but can be restored using `pluginPrefix` | ||
|
||
### plugin filter | ||
|
||
- method rename `filter_metadata`->`filterMetadata` | ||
|
||
### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928 | ||
|
||
The plugin receives as first argument `config`, which represents the config of the plugin. Example: | ||
|
||
``` | ||
// config.yaml | ||
auth: | ||
plugin: | ||
foo: 1 | ||
bar: 2 | ||
export class Plugin<T> { | ||
public constructor(config: T, options: PluginOptions) { | ||
console.log(config); | ||
// {foo:1, bar: 2} | ||
} | ||
} | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.