modules icon indicating copy to clipboard operation
modules copied to clipboard

Sort by last updated

Open larzon83 opened this issue 3 years ago • 19 comments

Can we have a sort by last updated? Thx

larzon83 avatar Jan 09 '21 21:01 larzon83

It could be a great idea but currently we don't have the information about last update for each module. They are only extract from npm but not update. A solution could be create a script to iterate on each of them to get lastUpdated value for current module then purpose a sort in this direction. What do you think about it @pi0 ?

Geminii avatar Jan 09 '21 21:01 Geminii

Having last updated would be nice since we can also use it for rss feed output

pi0 avatar Jan 11 '21 09:01 pi0

Last updated as last released at?

Atinux avatar Jan 11 '21 12:01 Atinux

Last updated as last released at?

Yes. For me at least

larzon83 avatar Jan 11 '21 12:01 larzon83

I guess we can use the pushed_at attribute from GH API: https://api.github.com/repos/nuxt/image

Would be nice to have the last release date from NPM, but I struggled to find the API endpoint.

Atinux avatar Jan 11 '21 13:01 Atinux

I guess we can use the pushed_at attribute from GH API: https://api.github.com/repos/nuxt/image

Would be nice to have the last release date from NPM, but I struggled to find the API endpoint.

GET on http://registry.npmjs.org/nuxt-image and we get extract the time.modified which seems to be the last published version

Geminii avatar Jan 11 '21 16:01 Geminii

GET on http://registry.npmjs.org/nuxt-image and we get extract the time.modified which seems to be the last published version

Perfect then!

Atinux avatar Jan 11 '21 19:01 Atinux

So i will update script for new upload 😀 And of course update all current modules 👍

Geminii avatar Jan 11 '21 20:01 Geminii

What do you think about to add the released date into module card ? Your opinion is welcome @pi0 about to add this improvement 😀

Geminii avatar Jan 12 '21 19:01 Geminii

@Geminii That would be cool!

Only a small note that we may need to migrate this project at a point of time to serverless in order to have updated stats. Temporary solution could be GH actions with crontab to trigger deploy everyday...

pi0 avatar Jan 13 '21 08:01 pi0

@Geminii That would be cool!

Only a small note that we may need to migrate this project at a point of time to serverless in order to have updated stats. Temporary solution could be GH actions with crontab to trigger deploy everyday...

Yes i think it's a good point. However, we probably need to improve the yarn sync all modules. During the development, i saw that some modules had a different description for example. We could maybe add a parameter to synchronize only released date ?

Geminii avatar Jan 13 '21 08:01 Geminii

Historically, this project and sync command was designed to publish modules database which then can be served by website. Fetching on development, slows down build and i think having latest tags isn't important for dev. With serverless, we can do some more refactors for caching API :)

pi0 avatar Jan 13 '21 09:01 pi0

Agree with @pi0

I see two things:

  • Using @nuxt/modules as a package, it should not include stars, download and last release
  • Using it as API for the website (can include stars, download and last release + caching)

Atinux avatar Jan 13 '21 10:01 Atinux

Initial idea for package was to allow offline support and implement meta fetching directly in website. We might snapshot from prod API and filter-out frequently changing fields like stars...

pi0 avatar Jan 13 '21 10:01 pi0

  • Using @nuxt/modules as a package, it should not include stars, download and last release

Currently, these informations are extracted during the build into dist/modules.json. However, we can always remove them. But this assumes that if an external service retrieves all the modules and wishes to offer a similar service regarding the release date for example, it is up to it to call npm to retrieve recent information no ?

Geminii avatar Jan 13 '21 10:01 Geminii

However, we can always remove them. But this assumes that if an external service retrieves all the modules and wishes to offer a similar service regarding the release date for example, it is up to it to call npm to retrieve recent information no ?

Actually anyone can do it but purpose of published npm package will be mainly for nuxt-cli for nuxt module <add> command for having installation meta-data which is currently not in db...

pi0 avatar Jan 13 '21 11:01 pi0

Actually anyone can do it but purpose of published npm package will be mainly for nuxt-cli for nuxt module <add> command for having installation meta-data which is currently not in db...

Ok i understand. I will open an issue to remove these extra fields (stars, download and last release) into build step and purpose a PR in this direction 👍

Geminii avatar Jan 13 '21 11:01 Geminii

@Geminii It would be nice if can wait for serverless migration. I'm working on it now :)

pi0 avatar Jan 13 '21 11:01 pi0

No problem, don't hesitate to remind me once it's in place 😀

Geminii avatar Jan 13 '21 11:01 Geminii