feat: refresh types on Deno CLI cache #66
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of https://github.com/netlify/pillar-runtime/issues/322, we'd like customers to start importing the types from
https://edge.netlify.com
rather thannetlify:edge
. To ensure that they always have the latest version of that specifier, and not an outdated version cached by Deno CLI, this PR adds a newensureLatestTypes
function that will:/version.txt
endpoint exposed by https://github.com/netlify/edge-functions-bootstrap/pull/57 to see what is the latest version of the typestypes-version.txt
file locally to see whether the cache was already refreshed for that versiondeno cache -r https://edge.netlify.com
to update the specifier in the Deno CLI cacheensureLatestTypes
runs on bothbundle
andserve
, and any errors resulting from the operation will be handled, so that the application will continue to operate normally if something goes wrong with the HTTP call or the cache refresh.