Closed mgmanzella closed 1 year ago
Closes #651
Refreshes docs async on theme-check startup, after discussing with @karreiro we decided it's out of scope to periodically refresh while theme-check is running
Since this is a medium size PR, I broke this down into 4 commits:
SourceManager#refresh
SourceIndex
SourceManager#download_or_refresh
on_initialized
SourceIndex::FilterState
SourceIndex::ObjectState
SourceIndex::TagState
SourceManager
test/shopify_liquid/scope_index
test/shopify_liquid/source_index/
rake download_theme_liquid_docs
sleep(30)
data/shopify_liquid/documentation/latest.json
collections
Summary
Closes #651
Refreshes docs async on theme-check startup, after discussing with @karreiro we decided it's out of scope to periodically refresh while theme-check is running
Since this is a medium size PR, I broke this down into 4 commits:
SourceManager#refresh
and mechanism to notifySourceIndex
liquid schema is out of dateSourceManager#download_or_refresh
is called inon_initialized
to download docs async while theme-check loads the existing outdated docsSourceManager#refresh
downloads updated docs to a temp directory in case the download failsSourceIndex::FilterState
,SourceIndex::ObjectState
, andSourceIndex::TagState
are used to notifySourceIndex
if a schema is out of date after refreshSourceManager
marks each liquid schema variable's respective state to "out of date" when updated docs are successfully downloadedSourceIndex
marks each liquid schema variable's respective state "up to date" when it finishes loading ittest/shopify_liquid/scope_index
totest/shopify_liquid/source_index/
Tophatting Steps
rake download_theme_liquid_docs
if you dont have the version of theme-liquid-docs with a revision filesleep(30)
in the threaddata/shopify_liquid/documentation/latest.json
to change the revision key to "out_of_date_sha"collections
documentation)