Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add @verdaccio/plugin-id support #1868

Closed
wants to merge 2 commits into from
Closed

feat: add @verdaccio/plugin-id support #1868

wants to merge 2 commits into from

Conversation

IhToN
Copy link

@IhToN IhToN commented Jul 8, 2020

Feature inclusion discussed on:
#1867

@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #1868 into master will decrease coverage by 0.01%.
The diff coverage is 78.26%.

@@            Coverage Diff             @@
##           master    #1868      +/-   ##
==========================================
- Coverage   83.46%   83.44%   -0.02%     
==========================================
  Files          48       48              
  Lines        2558     2574      +16     
  Branches      600      594       -6     
==========================================
+ Hits         2135     2148      +13     
- Misses        417      421       +4     
+ Partials        6        5       -1     
Impacted Files Coverage Δ
src/lib/plugin-loader.ts 88.33% <78.26%> (-2.58%) ⬇️
src/api/web/endpoint/package.ts 75.00% <0.00%> (ø)

@juanpicado juanpicado self-requested a review July 8, 2020 19:31
@juanpicado juanpicado linked an issue Jul 8, 2020 that may be closed by this pull request
loadedId = `sinopia-${pluginId}`;
}

if (!plugin) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm running some test, but I could not make this work with the example you shared in the ticket. In theory here you would get @verdaccio/@verdaccio/active-directory.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @verdaccio/active-directory is installed you could set it up either as active-directory or @verdaccio/active-directory.

First case: it would be loaded in line 108.
Second case: it would be loaded in line 113.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still looking into this. Just playing around. Most likely we would need add test. I hope can back with feedback soon.

@sonarcloud
Copy link

sonarcloud bot commented Jul 20, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stale
Copy link

stale bot commented Jun 11, 2021

Hi pal 👋🏼!
This issue has gone quiet 😶.

We get a lot of issues, so we currently close issues after 25 days of inactivity. It’s been at least 15 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add/suggest the label "discuss" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out https://github.com/verdaccio/contributing for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Verdaccio community! 💘

@stale stale bot added the issue: wontfix label Jun 11, 2021
@bdovaz
Copy link

bdovaz commented Jul 1, 2021

@juanpicado ping!

@stale stale bot removed the issue: wontfix label Jul 1, 2021
@juanpicado
Copy link
Member

pong

@juanpicado
Copy link
Member

There is a lot of work regarding plugins on the roadmap #1690

In other words, this deserves a new architecture, so it would not be ideal to merge patches, rather think big and improve the approach for plugins, the list of requests is long, most are valid, but we cannot solve all in small PR without breaking changes.

I have some ideas, but not enough time, maybe late this year. So unless someone is willing to take this topic we can talk and make it happen.

Just FYI, anything regarding plugins new should be based on master branch which would be a future 6.x or major depends.

@juanpicado
Copy link
Member

juanpicado commented Jun 13, 2022

I want to close this so here is my proposal for next release for loading scoped plugins: For instance
https://github.com/xlts-dev/verdaccio-prometheus-middleware

Middleware

middlewares:
  audit:
    enabled: true
  '@xlts.dev/verdaccio-prometheus-middleware':
      metricsPath: /custom/path/metrics    

Auth

auth:
  '@scope/test':
    foo: 1
  htpasswd:
    file: ./htpasswd

etc etc ...

The error message would be like

 warn --- config file  - /home/xxx/.config/verdaccio/config.yaml
 error--- plugin not found. try npm install @scope/test
 fatal--- uncaught exception, please report this
Error: 
      @scope/test plugin not found. try "npm install @scope/test"

@edclement @Splaktar

@juanpicado
Copy link
Member

#3227

@juanpicado juanpicado closed this Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: allow scopes in loading plugins
3 participants