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

Support Scoped Packages (i.e. @google) #56

Closed
grant opened this issue Apr 23, 2018 · 11 comments · Fixed by #64
Closed

Support Scoped Packages (i.e. @google) #56

grant opened this issue Apr 23, 2018 · 11 comments · Fixed by #64

Comments

@grant
Copy link
Contributor

grant commented Apr 23, 2018

Packages that are scoped (Use @) break the image URL:
http://npm.packagequality.com/#?package=@google%2Fclasp

@alexfernandez
Copy link
Owner

Hi, sorry for the delay! It sounds good, care to venture a patch?

@grant
Copy link
Contributor Author

grant commented May 6, 2018

I think we just need to URL escape the "Share this package" samples:

The solution is probably just encodeURIComponent this line:

var packageName = request.params['package'].replace(/.png$/, '');

Example

encodeURIComponent('@google/clasp')
"%40google%2Fclasp"

http://npm.packagequality.com/shield/%40google%2Fclasp.svg

Workaround

You can escape yourself (rather than copying the sample) to get the correct URL.

grant added a commit to google/clasp that referenced this issue May 6, 2018
@alexfernandez
Copy link
Owner

That is cool! If you propose a PR I will just accept it.

@grant
Copy link
Contributor Author

grant commented Dec 12, 2018

It looks like this repo ignores local-config.js.

I also get the error:

/Users/granttimmerman/Documents/github/grant/package-quality/test.js:21
	log.debug('Running tests');
	    ^
TypeError: log.debug is not a function

@alexfernandez
Copy link
Owner

Again, I would appreciate it if you can submit a PR 😄

@grant
Copy link
Contributor Author

grant commented Dec 16, 2018

Well, I'd submit a PR for the feature if the project build wasn't broken.

I can't say I'm going to (1) fix the project build, then (2) add a PR, since there's a fine workaround.

@alexfernandez
Copy link
Owner

Fair enough, I will try to repair the build and get back to you, OK?

@sasadjolic
Copy link

Any updates on adding support for scoped packages?

@sasadjolic
Copy link

I should mention that the workaround as described above in the history of this issue does not work anymore

@grant
Copy link
Contributor Author

grant commented Feb 13, 2021

I added a PR that I believe fixes the URL rendered on the web page. Although I don't know if it fixes the related/new searching issue.

@alexfernandez
Copy link
Owner

Merged and restarted! But now https://packagequality.com/shield/%40google%2Fclasp.svg is yielding an error 🤔

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 a pull request may close this issue.

3 participants