nextui-org / nextui-cli

⌨️ A CLI tool that unlocks seamless NextUI integration.
MIT License
37 stars 14 forks source link

feat: all up to data do not show select and add fetch cache #61

Closed winchesHe closed 2 months ago

winchesHe commented 3 months ago

📝 Description

  1. Fix https://linear.app/nextui-inc/issue/ENG-709/all-components-up-to-date-message
  2. Fetch cache and loading

When first run when fetch latest version, next time run will check whether cache data expired(30min) and using cache data

CleanShot 2024-05-09 at 22 37 33

Upgrade

CleanShot 2024-05-10 at 14 05 17

Remove

CleanShot 2024-05-10 at 14 07 04

  1. Add display about disabled pkg when select omponents

Every up to date pkg show in bottom

image

✅ Type of change

linear[bot] commented 3 months ago

ENG-709 All components up to date message

winchesHe commented 3 months ago

It still uses cached data unless 30 minutes have passed

wingkwong commented 3 months ago

but what if i need to upgrade? users may not know they need to wait for 30 mins. is there any way to invalidate by themselves? ideally if there is a new release, it shouldn't use the cache.

winchesHe commented 3 months ago

I think we could add a option to run without cache, and add notes in docs, usually, this scenario should occur relatively infrequently

wingkwong commented 3 months ago

second thought - i think we just need to handle it on our side. it doesn't make sense to invalidate cache from user side.

winchesHe commented 3 months ago

But if that's the case, we need to send requests every time run, or only keep fetching component's data every time

wingkwong commented 3 months ago

That's a good point. If so we may add a option like you said to run without cache so that users don't need to wait for the cache expiry time in order to perform some actions like upgrade.

jrgarciadev commented 3 months ago

@winchesHe why don't we validate the cached version vs the latest version and rewrite the cache only when the latest version changes? (only for globally installed cli)

winchesHe commented 3 months ago

@jrgarciadev It's because we need to send a request every time we run a command to validate whether it is latest version, that's why I added a default cache of 30 minutes, so that within 30 minutes, if we run the command again, we won't send the same request, therefore, it can improve the running speed