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

Display packages published on openupm in the package window #10

Open
mob-sakai opened this issue Dec 27, 2019 · 7 comments
Open

Display packages published on openupm in the package window #10

mob-sakai opened this issue Dec 27, 2019 · 7 comments
Labels

Comments

@mob-sakai
Copy link

@mob-sakai mob-sakai commented Dec 27, 2019

Hi @favoyang

First of all, thank you for starting this GREAT service.
Many Unity users will welcome your service!

I will work on developing an editor extension that displays packages published on openupm in the package window.

Thanks!

@favoyang

This comment has been minimized.

Copy link
Member

@favoyang favoyang commented Dec 27, 2019

Hi @mob-sakai, thanks for creating many useful upm packages. I was being asked a few times for the editor integration. Certainly that’s on my todo list, but not my current focus. As I blogged on the pateron post that I will focus on the infrastructure of the service and contents instead. Another reason is that I’m not sure what is the most affordable way to implement it. There seems many options on the table. I will definitely learn a lot from you when I reach the point.

I trend to keep this issue open for further conversation.

@mob-sakai

This comment has been minimized.

Copy link
Author

@mob-sakai mob-sakai commented Jan 31, 2020

Hi @favoyang, it's been a long time.

I succeeded in displaying any package info on the Package Manager UI!
Is it possible to get package.json for all packages and all versions that exist in OpenUPM?

For example, the unity field is required to display the supported Unity version, and the dependencies field is required to display dependent packages.

I know that we can get it with the following command:

  • npm info <package>@<version> --registry https://package.openupm.com.

But I am worried about server load...

Thanks

@favoyang

This comment has been minimized.

Copy link
Member

@favoyang favoyang commented Jan 31, 2020

@mob-sakai,

Sounds great! Please checkout information below:

To get package info

The official way to get a package info (include unity and dependencies fields) is using the /package endpoint, the one served the npm info and the detail page of Unity Package Manager.

curl -s https://package.openupm.com/com.littlebigfun.addressable-importer

To get package list info

Unity Package Manager using the old /-/all endpoint to fetch meta of all packages to construct the list page. The information is limited to name, displayName, description, latest version, license, author and modified time.

 curl -s https://package.openupm.com/-/all

{"_updated":99999,
 ...,
 "jp.setchi.fancyscrollview": {                                                               
   "name": "jp.setchi.fancyscrollview",                                                       
   "displayName": "FancyScrollView",                                                          
   "description": "A scrollview component that can implement highly flexible animation.",     
   "dist-tags": {                                                                             
     "latest": "1.8.6"                                                                        
   },                                                                                         
   "maintainers": [                                                                           
     {                                                                                        
       "name": "openupm",                                                                     
       "email": "openupm"                                                                     
     }                                                                                        
   ],                                                                                         
   "author": {                                                                                
     "name": "setchi"                                                                         
   },                                                                                         
   "readmeFilename": "README.md",                                                             
   "license": "MIT",                                                                          
   "time": {                                                                                  
     "modified": "2020-01-21T12:41:04.000Z"                                                   
   },                                                                                         
   "versions": {                                                                              
     "1.8.6": "latest"                                                                        
   }                                                                                          
 }                                                                                            

The endpoint can also return packages added since a timestamp. But you can ignore it for now. Refs

If you reply on the standard endpoint API of the npm protocol, then it can be used for any UPM registry. And you don't need worry about the server load for now.

@mob-sakai

This comment has been minimized.

Copy link
Author

@mob-sakai mob-sakai commented Jan 31, 2020

Thank you!

@mob-sakai

This comment has been minimized.

Copy link
Author

@mob-sakai mob-sakai commented Feb 9, 2020

WIP

All packages in openupm can be displayed in UI.

@favoyang

This comment has been minimized.

Copy link
Member

@favoyang favoyang commented Feb 9, 2020

@mob-sakai,

Awesome!

One question, can this solve custom dependencies automatically?

For example pkg-a => pkg-b => pkg-c, and all these packages are available on the custom registry. openupm add pkg-a will resolve the dependency tree and put all packages to the scope field.

 "dependencies": {
    "pkg-a": "1.0.0"
 },
 "scopedRegistries": [                                                                                 
   {                                                       
     "name": "package.openupm.com",                        
     "url": "https://package.openupm.com",                 
     "scopes": [                                           
       "com.openupm", "pkg-a", "pkg-b", "pkg-c"                                       
     ]                                                     
   }                                                       
 ],                                                        
@mob-sakai

This comment has been minimized.

Copy link
Author

@mob-sakai mob-sakai commented Feb 9, 2020

@favoyang

Oh shoot, it totally slipped my mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.