@shopify/cli-kit 3.56.1 → 3.56.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,10 +35,11 @@ module ShopifyCLI
35
35
  wpm
36
36
  ]
37
37
 
38
- def initialize(ctx, theme, param_builder)
38
+ def initialize(ctx, theme, param_builder, cache_cleaned = false)
39
39
  @ctx = ctx
40
40
  @theme = theme
41
41
  @param_builder = param_builder
42
+ @cache_cleaned = cache_cleaned
42
43
 
43
44
  @core_endpoints = Set.new
44
45
  @secure_session_id = nil
@@ -56,6 +57,9 @@ module ShopifyCLI
56
57
  headers["User-Agent"] = "Shopify CLI"
57
58
  query = URI.decode_www_form(env["QUERY_STRING"])
58
59
  replace_templates = build_replacement_param(env)
60
+
61
+ clean_sfr_cache(env, query, headers)
62
+
59
63
  response = if replace_templates.any?
60
64
  # Pass to SFR the recently modified templates in `replace_templates` or
61
65
  # `replace_extension_templates` body param
@@ -101,6 +105,22 @@ module ShopifyCLI
101
105
 
102
106
  private
103
107
 
108
+ def clean_sfr_cache(env, query, headers)
109
+ return if @cache_cleaned
110
+
111
+ @cache_cleaned = true
112
+
113
+ query = query.dup
114
+ query << ["preview_theme_id", theme_id]
115
+
116
+ request(
117
+ env["REQUEST_METHOD"], env["PATH_INFO"],
118
+ headers: headers,
119
+ query: query,
120
+ body_stream: (env["rack.input"] if has_body?(headers))
121
+ )
122
+ end
123
+
104
124
  def patch_body(env, body)
105
125
  return [""] unless body
106
126
 
@@ -1 +1 @@
1
- export declare const CLI_KIT_VERSION = "3.56.1";
1
+ export declare const CLI_KIT_VERSION = "3.56.3";
@@ -1,2 +1,2 @@
1
- export const CLI_KIT_VERSION = '3.56.1';
1
+ export const CLI_KIT_VERSION = '3.56.3';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.56.1'\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.56.3'\n"]}