wordpress-playground icon indicating copy to clipboard operation
wordpress-playground copied to clipboard

CLI: Source WordPress zip from a local cache file before looking for it online

Open adamziel opened this issue 8 months ago • 1 comments

Motivation for the change, related issues

I couldn't use Playground CLI on the plane because resolveWPRelease() is always called and it requires an active network connection to fetch()-request the WordPress.org API. This PR adds an offline-first WordPress zip resolution that tries to find a WordPress zip file in the local cache without any network lookups. It will only do a network lookup if it doesn't find anything locally.

Implementation details

Ships a resolveWordPressZip() function that tries finding the right WordPress versions among the zip files cached in a local directory. It looks for files matching the pattern prebuilt-wp-*.zip and return one when it's found.

Remaining work

  • [ ] A way of downloading a fresh WordPress release. Currently, when this PR is applied, a nightly or beta or 6.4.1 WordPress release, once cached, will continue to be used afterwards.

Testing Instructions (or ideally a Blueprint)

🚧 TBD 🚧

adamziel avatar Jun 18 '24 08:06 adamziel