@shopify/shop-minis-cli 0.0.172 → 0.0.173

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.
Files changed (517) hide show
  1. package/README_INTERNAL.md +153 -0
  2. package/build/commands/app/index.js +1 -2
  3. package/build/commands/app/index.js.map +1 -1
  4. package/build/commands/cancel-submission/cancel-submission.js +2 -2
  5. package/build/commands/cancel-submission/cancel-submission.js.map +1 -1
  6. package/build/commands/cancel-submission/index.js +1 -1
  7. package/build/commands/cancel-submission/index.js.map +1 -1
  8. package/build/commands/check-submission/index.js +13 -6
  9. package/build/commands/check-submission/index.js.map +1 -1
  10. package/build/commands/codemod/index.js +0 -9
  11. package/build/commands/codemod/index.js.map +1 -1
  12. package/build/commands/codemod/releases/index.js +2 -72
  13. package/build/commands/codemod/releases/index.js.map +1 -1
  14. package/build/commands/config.d.ts +2 -2
  15. package/build/commands/config.js +3 -2
  16. package/build/commands/config.js.map +1 -1
  17. package/build/commands/create/examples/default/.cursorrules +25 -0
  18. package/{templates/__template_common/gitignore → build/commands/create/examples/default/_gitignore} +0 -1
  19. package/build/commands/create/examples/default/index.html +15 -0
  20. package/build/commands/create/examples/default/package.json +18 -0
  21. package/build/commands/create/examples/default/src/App.tsx +25 -0
  22. package/build/commands/create/examples/default/src/icon.png +0 -0
  23. package/build/commands/create/examples/default/src/index.css +1 -0
  24. package/build/commands/create/examples/default/src/main.tsx +14 -0
  25. package/build/commands/create/examples/default/src/manifest.json +6 -0
  26. package/build/commands/{create-mini/standalone/examples/with-getting-started → create/examples/default}/tsconfig.json +6 -14
  27. package/build/commands/create/examples/default/vite.config.mjs +11 -0
  28. package/build/commands/{create-mini/standalone → create}/index.js +6 -26
  29. package/build/commands/create/index.js.map +1 -0
  30. package/build/commands/{create-mini → create}/utils/examples.d.ts +1 -1
  31. package/build/commands/{create-mini → create}/utils/examples.js +13 -9
  32. package/build/commands/create/utils/examples.js.map +1 -0
  33. package/build/commands/create/utils/index.js.map +1 -0
  34. package/build/commands/dev/index.d.ts +0 -11
  35. package/build/commands/dev/index.js +32 -58
  36. package/build/commands/dev/index.js.map +1 -1
  37. package/build/commands/dev/types.d.ts +46 -0
  38. package/build/commands/dev/{utils/types.js → types.js} +5 -0
  39. package/build/commands/dev/types.js.map +1 -0
  40. package/build/commands/dev/utils/binaries.d.ts +1 -1
  41. package/build/commands/dev/utils/build-type.d.ts +1 -1
  42. package/build/commands/dev/utils/build-type.js +1 -1
  43. package/build/commands/dev/utils/build-type.js.map +1 -1
  44. package/build/commands/dev/utils/deeplink.d.ts +3 -15
  45. package/build/commands/dev/utils/deeplink.js +12 -59
  46. package/build/commands/dev/utils/deeplink.js.map +1 -1
  47. package/build/commands/dev/utils/interactive-terminal.d.ts +6 -5
  48. package/build/commands/dev/utils/interactive-terminal.js +25 -65
  49. package/build/commands/dev/utils/interactive-terminal.js.map +1 -1
  50. package/build/commands/dev/utils/network.d.ts +1 -2
  51. package/build/commands/dev/utils/network.js.map +1 -1
  52. package/build/commands/dev/utils/platform.d.ts +1 -4
  53. package/build/commands/dev/utils/platform.js +1 -5
  54. package/build/commands/dev/utils/platform.js.map +1 -1
  55. package/build/commands/dev/utils/start-app/config.d.ts +1 -2
  56. package/build/commands/dev/utils/start-app/config.js +1 -1
  57. package/build/commands/dev/utils/start-app/config.js.map +1 -1
  58. package/build/commands/dev/utils/start-app/start-app-with-options.d.ts +1 -1
  59. package/build/commands/dev/utils/start-app/start-app-with-options.js +5 -3
  60. package/build/commands/dev/utils/start-app/start-app-with-options.js.map +1 -1
  61. package/build/commands/dev/utils/start-app/start-app.d.ts +1 -1
  62. package/build/commands/dev/utils/start-app/start-app.js.map +1 -1
  63. package/build/commands/dev/utils/version.d.ts +1 -2
  64. package/build/commands/dev/utils/version.js +3 -2
  65. package/build/commands/dev/utils/version.js.map +1 -1
  66. package/build/commands/dev/utils/web-server.d.ts +1 -0
  67. package/build/commands/dev/utils/web-server.js +16 -0
  68. package/build/commands/dev/utils/web-server.js.map +1 -0
  69. package/build/commands/doctor/index.js +10 -3
  70. package/build/commands/doctor/index.js.map +1 -1
  71. package/build/commands/features/index.js +2 -2
  72. package/build/commands/features/index.js.map +1 -1
  73. package/build/commands/info/index.js +3 -11
  74. package/build/commands/info/index.js.map +1 -1
  75. package/build/commands/install/index.d.ts +2 -0
  76. package/build/commands/install/index.js +65 -0
  77. package/build/commands/install/index.js.map +1 -0
  78. package/build/commands/setup/index.js +9 -1
  79. package/build/commands/setup/index.js.map +1 -1
  80. package/build/commands/submit/config.js +1 -1
  81. package/build/commands/submit/errors.js +24 -2
  82. package/build/commands/submit/errors.js.map +1 -1
  83. package/build/commands/submit/index.js +18 -2
  84. package/build/commands/submit/index.js.map +1 -1
  85. package/build/commands/submit/submit.d.ts +2 -2
  86. package/build/commands/submit/submit.js +63 -53
  87. package/build/commands/submit/submit.js.map +1 -1
  88. package/build/commands/submit/tasks.d.ts +2 -1
  89. package/build/commands/submit/tasks.js +5 -4
  90. package/build/commands/submit/tasks.js.map +1 -1
  91. package/build/commands/submit/types.d.ts +5 -0
  92. package/build/commands/submit/utils/assert-core-dependencies-version.d.ts +1 -3
  93. package/build/commands/submit/utils/assert-core-dependencies-version.js +6 -85
  94. package/build/commands/submit/utils/assert-core-dependencies-version.js.map +1 -1
  95. package/build/commands/sync-user-metafield-definitions/index.js +7 -5
  96. package/build/commands/sync-user-metafield-definitions/index.js.map +1 -1
  97. package/build/commands/upgrade/index.d.ts +0 -1
  98. package/build/commands/upgrade/index.js +20 -56
  99. package/build/commands/upgrade/index.js.map +1 -1
  100. package/build/constants/dev-panel.d.ts +3 -0
  101. package/build/constants/dev-panel.js +4 -0
  102. package/build/constants/dev-panel.js.map +1 -0
  103. package/build/data/create-submission.d.ts +2 -1
  104. package/build/data/create-submission.js +13 -4
  105. package/build/data/create-submission.js.map +1 -1
  106. package/build/data/get-submissions.d.ts +3 -2
  107. package/build/data/get-submissions.js +3 -1
  108. package/build/data/get-submissions.js.map +1 -1
  109. package/build/data/types/autogenerated/shop-minis-admin-api/gql.d.ts +3 -2
  110. package/build/data/types/autogenerated/shop-minis-admin-api/gql.js +1 -1
  111. package/build/data/types/autogenerated/shop-minis-admin-api/gql.js.map +1 -1
  112. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.d.ts +11 -3
  113. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js +21 -1
  114. package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js.map +1 -1
  115. package/build/index.d.ts +1 -1
  116. package/build/index.js +1 -0
  117. package/build/index.js.map +1 -1
  118. package/build/program.js +5 -7
  119. package/build/program.js.map +1 -1
  120. package/build/schemas/manifest.schema.json +0 -211
  121. package/build/utils/allowed-dependencies.d.ts +5 -0
  122. package/build/utils/allowed-dependencies.js +21 -0
  123. package/build/utils/allowed-dependencies.js.map +1 -0
  124. package/build/utils/dependencies.d.ts +7 -0
  125. package/build/utils/dependencies.js +275 -0
  126. package/build/utils/dependencies.js.map +1 -0
  127. package/build/utils/minis-manifest.js +0 -7
  128. package/build/utils/minis-manifest.js.map +1 -1
  129. package/build/utils/package-manager.d.ts +25 -13
  130. package/build/utils/package-manager.js +56 -36
  131. package/build/utils/package-manager.js.map +1 -1
  132. package/package.json +7 -15
  133. package/build/commands/codemod/releases/v0-0-100.d.ts +0 -3
  134. package/build/commands/codemod/releases/v0-0-100.js +0 -50
  135. package/build/commands/codemod/releases/v0-0-100.js.map +0 -1
  136. package/build/commands/codemod/releases/v0-0-103.d.ts +0 -3
  137. package/build/commands/codemod/releases/v0-0-103.js +0 -43
  138. package/build/commands/codemod/releases/v0-0-103.js.map +0 -1
  139. package/build/commands/codemod/releases/v0-0-105.d.ts +0 -3
  140. package/build/commands/codemod/releases/v0-0-105.js +0 -59
  141. package/build/commands/codemod/releases/v0-0-105.js.map +0 -1
  142. package/build/commands/codemod/releases/v0-0-106.d.ts +0 -3
  143. package/build/commands/codemod/releases/v0-0-106.js +0 -32
  144. package/build/commands/codemod/releases/v0-0-106.js.map +0 -1
  145. package/build/commands/codemod/releases/v0-0-114.d.ts +0 -3
  146. package/build/commands/codemod/releases/v0-0-114.js +0 -48
  147. package/build/commands/codemod/releases/v0-0-114.js.map +0 -1
  148. package/build/commands/codemod/releases/v0-0-115.d.ts +0 -3
  149. package/build/commands/codemod/releases/v0-0-115.js +0 -50
  150. package/build/commands/codemod/releases/v0-0-115.js.map +0 -1
  151. package/build/commands/codemod/releases/v0-0-121.d.ts +0 -3
  152. package/build/commands/codemod/releases/v0-0-121.js +0 -74
  153. package/build/commands/codemod/releases/v0-0-121.js.map +0 -1
  154. package/build/commands/codemod/releases/v0-0-123.d.ts +0 -3
  155. package/build/commands/codemod/releases/v0-0-123.js +0 -33
  156. package/build/commands/codemod/releases/v0-0-123.js.map +0 -1
  157. package/build/commands/codemod/releases/v0-0-125.d.ts +0 -3
  158. package/build/commands/codemod/releases/v0-0-125.js +0 -37
  159. package/build/commands/codemod/releases/v0-0-125.js.map +0 -1
  160. package/build/commands/codemod/releases/v0-0-130.d.ts +0 -3
  161. package/build/commands/codemod/releases/v0-0-130.js +0 -26
  162. package/build/commands/codemod/releases/v0-0-130.js.map +0 -1
  163. package/build/commands/codemod/releases/v0-0-139.d.ts +0 -3
  164. package/build/commands/codemod/releases/v0-0-139.js +0 -26
  165. package/build/commands/codemod/releases/v0-0-139.js.map +0 -1
  166. package/build/commands/codemod/releases/v0-0-163.d.ts +0 -3
  167. package/build/commands/codemod/releases/v0-0-163.js +0 -26
  168. package/build/commands/codemod/releases/v0-0-163.js.map +0 -1
  169. package/build/commands/codemod/releases/v0-0-42/index.d.ts +0 -3
  170. package/build/commands/codemod/releases/v0-0-42/index.js +0 -46
  171. package/build/commands/codemod/releases/v0-0-42/index.js.map +0 -1
  172. package/build/commands/codemod/releases/v0-0-42/reset-files.d.ts +0 -7
  173. package/build/commands/codemod/releases/v0-0-42/reset-files.js +0 -83
  174. package/build/commands/codemod/releases/v0-0-42/reset-files.js.map +0 -1
  175. package/build/commands/codemod/releases/v0-0-43.d.ts +0 -3
  176. package/build/commands/codemod/releases/v0-0-43.js +0 -32
  177. package/build/commands/codemod/releases/v0-0-43.js.map +0 -1
  178. package/build/commands/codemod/releases/v0-0-44.d.ts +0 -3
  179. package/build/commands/codemod/releases/v0-0-44.js +0 -214
  180. package/build/commands/codemod/releases/v0-0-44.js.map +0 -1
  181. package/build/commands/codemod/releases/v0-0-45.d.ts +0 -3
  182. package/build/commands/codemod/releases/v0-0-45.js +0 -23
  183. package/build/commands/codemod/releases/v0-0-45.js.map +0 -1
  184. package/build/commands/codemod/releases/v0-0-50.d.ts +0 -3
  185. package/build/commands/codemod/releases/v0-0-50.js +0 -34
  186. package/build/commands/codemod/releases/v0-0-50.js.map +0 -1
  187. package/build/commands/codemod/releases/v0-0-54.d.ts +0 -3
  188. package/build/commands/codemod/releases/v0-0-54.js +0 -70
  189. package/build/commands/codemod/releases/v0-0-54.js.map +0 -1
  190. package/build/commands/codemod/releases/v0-0-56.d.ts +0 -3
  191. package/build/commands/codemod/releases/v0-0-56.js +0 -48
  192. package/build/commands/codemod/releases/v0-0-56.js.map +0 -1
  193. package/build/commands/codemod/releases/v0-0-57.d.ts +0 -3
  194. package/build/commands/codemod/releases/v0-0-57.js +0 -41
  195. package/build/commands/codemod/releases/v0-0-57.js.map +0 -1
  196. package/build/commands/codemod/releases/v0-0-58.d.ts +0 -3
  197. package/build/commands/codemod/releases/v0-0-58.js +0 -68
  198. package/build/commands/codemod/releases/v0-0-58.js.map +0 -1
  199. package/build/commands/codemod/releases/v0-0-61.d.ts +0 -3
  200. package/build/commands/codemod/releases/v0-0-61.js +0 -30
  201. package/build/commands/codemod/releases/v0-0-61.js.map +0 -1
  202. package/build/commands/codemod/releases/v0-0-63.d.ts +0 -3
  203. package/build/commands/codemod/releases/v0-0-63.js +0 -42
  204. package/build/commands/codemod/releases/v0-0-63.js.map +0 -1
  205. package/build/commands/codemod/releases/v0-0-64.d.ts +0 -3
  206. package/build/commands/codemod/releases/v0-0-64.js +0 -47
  207. package/build/commands/codemod/releases/v0-0-64.js.map +0 -1
  208. package/build/commands/codemod/releases/v0-0-75.d.ts +0 -3
  209. package/build/commands/codemod/releases/v0-0-75.js +0 -30
  210. package/build/commands/codemod/releases/v0-0-75.js.map +0 -1
  211. package/build/commands/codemod/releases/v0-0-76.d.ts +0 -3
  212. package/build/commands/codemod/releases/v0-0-76.js +0 -32
  213. package/build/commands/codemod/releases/v0-0-76.js.map +0 -1
  214. package/build/commands/codemod/releases/v0-0-77.d.ts +0 -3
  215. package/build/commands/codemod/releases/v0-0-77.js +0 -39
  216. package/build/commands/codemod/releases/v0-0-77.js.map +0 -1
  217. package/build/commands/codemod/releases/v0-0-79.d.ts +0 -3
  218. package/build/commands/codemod/releases/v0-0-79.js +0 -35
  219. package/build/commands/codemod/releases/v0-0-79.js.map +0 -1
  220. package/build/commands/codemod/releases/v0-0-84.d.ts +0 -3
  221. package/build/commands/codemod/releases/v0-0-84.js +0 -41
  222. package/build/commands/codemod/releases/v0-0-84.js.map +0 -1
  223. package/build/commands/codemod/releases/v0-0-85.d.ts +0 -3
  224. package/build/commands/codemod/releases/v0-0-85.js +0 -60
  225. package/build/commands/codemod/releases/v0-0-85.js.map +0 -1
  226. package/build/commands/codemod/releases/v0-0-89.d.ts +0 -3
  227. package/build/commands/codemod/releases/v0-0-89.js +0 -60
  228. package/build/commands/codemod/releases/v0-0-89.js.map +0 -1
  229. package/build/commands/codemod/releases/v0-0-91/index.d.ts +0 -3
  230. package/build/commands/codemod/releases/v0-0-91/index.js +0 -38
  231. package/build/commands/codemod/releases/v0-0-91/index.js.map +0 -1
  232. package/build/commands/codemod/releases/v0-0-91/replace-dev-wrapper.d.ts +0 -5
  233. package/build/commands/codemod/releases/v0-0-91/replace-dev-wrapper.js +0 -45
  234. package/build/commands/codemod/releases/v0-0-91/replace-dev-wrapper.js.map +0 -1
  235. package/build/commands/codemod/releases/v0-0-91/replace-safe-area-imports.d.ts +0 -1
  236. package/build/commands/codemod/releases/v0-0-91/replace-safe-area-imports.js +0 -97
  237. package/build/commands/codemod/releases/v0-0-91/replace-safe-area-imports.js.map +0 -1
  238. package/build/commands/codemod/releases/v0-0-92.d.ts +0 -3
  239. package/build/commands/codemod/releases/v0-0-92.js +0 -38
  240. package/build/commands/codemod/releases/v0-0-92.js.map +0 -1
  241. package/build/commands/codemod/releases/v0-0-93/blank/App-after.d.ts +0 -1
  242. package/build/commands/codemod/releases/v0-0-93/blank/App-after.js +0 -15
  243. package/build/commands/codemod/releases/v0-0-93/blank/App-after.js.map +0 -1
  244. package/build/commands/codemod/releases/v0-0-93/blank/App-before.d.ts +0 -1
  245. package/build/commands/codemod/releases/v0-0-93/blank/App-before.js +0 -13
  246. package/build/commands/codemod/releases/v0-0-93/blank/App-before.js.map +0 -1
  247. package/build/commands/codemod/releases/v0-0-93/index.d.ts +0 -6
  248. package/build/commands/codemod/releases/v0-0-93/index.js +0 -7
  249. package/build/commands/codemod/releases/v0-0-93/index.js.map +0 -1
  250. package/build/commands/codemod/releases/v0-0-93/shoppable-posts/App-after.d.ts +0 -1
  251. package/build/commands/codemod/releases/v0-0-93/shoppable-posts/App-after.js +0 -53
  252. package/build/commands/codemod/releases/v0-0-93/shoppable-posts/App-after.js.map +0 -1
  253. package/build/commands/codemod/releases/v0-0-93/shoppable-posts/App-before.d.ts +0 -1
  254. package/build/commands/codemod/releases/v0-0-93/shoppable-posts/App-before.js +0 -43
  255. package/build/commands/codemod/releases/v0-0-93/shoppable-posts/App-before.js.map +0 -1
  256. package/build/commands/codemod/releases/v0-0-93/shoppable-videos/App-after.d.ts +0 -1
  257. package/build/commands/codemod/releases/v0-0-93/shoppable-videos/App-after.js +0 -49
  258. package/build/commands/codemod/releases/v0-0-93/shoppable-videos/App-after.js.map +0 -1
  259. package/build/commands/codemod/releases/v0-0-93/shoppable-videos/App-before.d.ts +0 -1
  260. package/build/commands/codemod/releases/v0-0-93/shoppable-videos/App-before.js +0 -42
  261. package/build/commands/codemod/releases/v0-0-93/shoppable-videos/App-before.js.map +0 -1
  262. package/build/commands/codemod/releases/v0-0-93.d.ts +0 -3
  263. package/build/commands/codemod/releases/v0-0-93.js +0 -48
  264. package/build/commands/codemod/releases/v0-0-93.js.map +0 -1
  265. package/build/commands/codemod/releases/v0-0-97/index.d.ts +0 -3
  266. package/build/commands/codemod/releases/v0-0-97/index.js +0 -20
  267. package/build/commands/codemod/releases/v0-0-97/index.js.map +0 -1
  268. package/build/commands/codemod/releases/v0-0-97/migrate-to-new-theme.d.ts +0 -1
  269. package/build/commands/codemod/releases/v0-0-97/migrate-to-new-theme.js +0 -47
  270. package/build/commands/codemod/releases/v0-0-97/migrate-to-new-theme.js.map +0 -1
  271. package/build/commands/codemod/releases/v0-0-97/remove-theme-from-config.d.ts +0 -1
  272. package/build/commands/codemod/releases/v0-0-97/remove-theme-from-config.js +0 -105
  273. package/build/commands/codemod/releases/v0-0-97/remove-theme-from-config.js.map +0 -1
  274. package/build/commands/create-extension/constants.d.ts +0 -44
  275. package/build/commands/create-extension/constants.js +0 -111
  276. package/build/commands/create-extension/constants.js.map +0 -1
  277. package/build/commands/create-extension/index.js +0 -71
  278. package/build/commands/create-extension/index.js.map +0 -1
  279. package/build/commands/create-extension/types.d.ts +0 -13
  280. package/build/commands/create-extension/types.js +0 -8
  281. package/build/commands/create-extension/types.js.map +0 -1
  282. package/build/commands/create-extension/utils/add-target-to-config.d.ts +0 -2
  283. package/build/commands/create-extension/utils/add-target-to-config.js +0 -48
  284. package/build/commands/create-extension/utils/add-target-to-config.js.map +0 -1
  285. package/build/commands/create-extension/utils/create-extension-files.d.ts +0 -11
  286. package/build/commands/create-extension/utils/create-extension-files.js +0 -96
  287. package/build/commands/create-extension/utils/create-extension-files.js.map +0 -1
  288. package/build/commands/create-extension/utils/create-from-template.d.ts +0 -3
  289. package/build/commands/create-extension/utils/create-from-template.js +0 -47
  290. package/build/commands/create-extension/utils/create-from-template.js.map +0 -1
  291. package/build/commands/create-extension/utils/format-extension-files.d.ts +0 -1
  292. package/build/commands/create-extension/utils/format-extension-files.js +0 -22
  293. package/build/commands/create-extension/utils/format-extension-files.js.map +0 -1
  294. package/build/commands/create-mini/index.d.ts +0 -2
  295. package/build/commands/create-mini/index.js +0 -11
  296. package/build/commands/create-mini/index.js.map +0 -1
  297. package/build/commands/create-mini/legacy/index.d.ts +0 -2
  298. package/build/commands/create-mini/legacy/index.js +0 -176
  299. package/build/commands/create-mini/legacy/index.js.map +0 -1
  300. package/build/commands/create-mini/legacy/utils/template-app.d.ts +0 -2
  301. package/build/commands/create-mini/legacy/utils/template-app.js +0 -84
  302. package/build/commands/create-mini/legacy/utils/template-app.js.map +0 -1
  303. package/build/commands/create-mini/standalone/examples/with-camera-access/.eslintignore +0 -1
  304. package/build/commands/create-mini/standalone/examples/with-camera-access/.eslintrc.js +0 -3
  305. package/build/commands/create-mini/standalone/examples/with-camera-access/.graphqlrc.js +0 -1
  306. package/build/commands/create-mini/standalone/examples/with-camera-access/.prettierrc.json +0 -8
  307. package/build/commands/create-mini/standalone/examples/with-camera-access/README.md +0 -30
  308. package/build/commands/create-mini/standalone/examples/with-camera-access/assets.d.ts +0 -14
  309. package/build/commands/create-mini/standalone/examples/with-camera-access/babel.config.js +0 -5
  310. package/build/commands/create-mini/standalone/examples/with-camera-access/index.tsx +0 -5
  311. package/build/commands/create-mini/standalone/examples/with-camera-access/metro.config.js +0 -3
  312. package/build/commands/create-mini/standalone/examples/with-camera-access/package.json +0 -33
  313. package/build/commands/create-mini/standalone/examples/with-camera-access/src/App.tsx +0 -152
  314. package/build/commands/create-mini/standalone/examples/with-camera-access/src/index.tsx +0 -9
  315. package/build/commands/create-mini/standalone/examples/with-camera-access/src/manifest.json +0 -5
  316. package/build/commands/create-mini/standalone/examples/with-camera-access/tsconfig.json +0 -41
  317. package/build/commands/create-mini/standalone/examples/with-fal-ai/.eslintignore +0 -1
  318. package/build/commands/create-mini/standalone/examples/with-fal-ai/.eslintrc.js +0 -3
  319. package/build/commands/create-mini/standalone/examples/with-fal-ai/.graphqlrc.js +0 -1
  320. package/build/commands/create-mini/standalone/examples/with-fal-ai/.prettierrc.json +0 -8
  321. package/build/commands/create-mini/standalone/examples/with-fal-ai/README.md +0 -46
  322. package/build/commands/create-mini/standalone/examples/with-fal-ai/assets.d.ts +0 -14
  323. package/build/commands/create-mini/standalone/examples/with-fal-ai/babel.config.js +0 -5
  324. package/build/commands/create-mini/standalone/examples/with-fal-ai/index.tsx +0 -5
  325. package/build/commands/create-mini/standalone/examples/with-fal-ai/metro.config.js +0 -3
  326. package/build/commands/create-mini/standalone/examples/with-fal-ai/package.json +0 -33
  327. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/App.tsx +0 -5
  328. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/index.tsx +0 -9
  329. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/manifest.json +0 -21
  330. package/build/commands/create-mini/standalone/examples/with-fal-ai/src/screens/HomeScreen.tsx +0 -142
  331. package/build/commands/create-mini/standalone/examples/with-fal-ai/tsconfig.json +0 -41
  332. package/build/commands/create-mini/standalone/examples/with-getting-started/.eslintignore +0 -1
  333. package/build/commands/create-mini/standalone/examples/with-getting-started/.eslintrc.js +0 -3
  334. package/build/commands/create-mini/standalone/examples/with-getting-started/.graphqlrc.js +0 -1
  335. package/build/commands/create-mini/standalone/examples/with-getting-started/.prettierrc.json +0 -8
  336. package/build/commands/create-mini/standalone/examples/with-getting-started/README.md +0 -18
  337. package/build/commands/create-mini/standalone/examples/with-getting-started/assets.d.ts +0 -14
  338. package/build/commands/create-mini/standalone/examples/with-getting-started/babel.config.js +0 -5
  339. package/build/commands/create-mini/standalone/examples/with-getting-started/index.tsx +0 -5
  340. package/build/commands/create-mini/standalone/examples/with-getting-started/metro.config.js +0 -3
  341. package/build/commands/create-mini/standalone/examples/with-getting-started/package.json +0 -33
  342. package/build/commands/create-mini/standalone/examples/with-getting-started/src/App.tsx +0 -23
  343. package/build/commands/create-mini/standalone/examples/with-getting-started/src/index.tsx +0 -9
  344. package/build/commands/create-mini/standalone/examples/with-getting-started/src/manifest.json +0 -5
  345. package/build/commands/create-mini/standalone/examples/with-getting-started/src/screens/HomeScreen.tsx +0 -133
  346. package/build/commands/create-mini/standalone/examples/with-getting-started/src/screens/NativeFeaturesScreen.tsx +0 -138
  347. package/build/commands/create-mini/standalone/examples/with-getting-started/src/types/screens.ts +0 -5
  348. package/build/commands/create-mini/standalone/examples/with-search/.eslintignore +0 -1
  349. package/build/commands/create-mini/standalone/examples/with-search/.eslintrc.js +0 -3
  350. package/build/commands/create-mini/standalone/examples/with-search/.graphqlrc.js +0 -1
  351. package/build/commands/create-mini/standalone/examples/with-search/.prettierrc.json +0 -8
  352. package/build/commands/create-mini/standalone/examples/with-search/README.md +0 -25
  353. package/build/commands/create-mini/standalone/examples/with-search/assets.d.ts +0 -14
  354. package/build/commands/create-mini/standalone/examples/with-search/babel.config.js +0 -5
  355. package/build/commands/create-mini/standalone/examples/with-search/index.tsx +0 -5
  356. package/build/commands/create-mini/standalone/examples/with-search/metro.config.js +0 -3
  357. package/build/commands/create-mini/standalone/examples/with-search/package.json +0 -33
  358. package/build/commands/create-mini/standalone/examples/with-search/src/App.tsx +0 -23
  359. package/build/commands/create-mini/standalone/examples/with-search/src/components/HeaderAction.tsx +0 -32
  360. package/build/commands/create-mini/standalone/examples/with-search/src/components/ShopCard.tsx +0 -92
  361. package/build/commands/create-mini/standalone/examples/with-search/src/index.tsx +0 -9
  362. package/build/commands/create-mini/standalone/examples/with-search/src/manifest.json +0 -7
  363. package/build/commands/create-mini/standalone/examples/with-search/src/screens/MerchantSearchScreen.tsx +0 -126
  364. package/build/commands/create-mini/standalone/examples/with-search/src/screens/ProductSearchScreen.tsx +0 -115
  365. package/build/commands/create-mini/standalone/examples/with-search/src/types/screens.ts +0 -6
  366. package/build/commands/create-mini/standalone/examples/with-search/tsconfig.json +0 -41
  367. package/build/commands/create-mini/standalone/examples/with-user-data/.eslintignore +0 -1
  368. package/build/commands/create-mini/standalone/examples/with-user-data/.eslintrc.js +0 -3
  369. package/build/commands/create-mini/standalone/examples/with-user-data/.graphqlrc.js +0 -1
  370. package/build/commands/create-mini/standalone/examples/with-user-data/.prettierrc.json +0 -8
  371. package/build/commands/create-mini/standalone/examples/with-user-data/README.md +0 -26
  372. package/build/commands/create-mini/standalone/examples/with-user-data/assets.d.ts +0 -14
  373. package/build/commands/create-mini/standalone/examples/with-user-data/babel.config.js +0 -5
  374. package/build/commands/create-mini/standalone/examples/with-user-data/index.tsx +0 -5
  375. package/build/commands/create-mini/standalone/examples/with-user-data/metro.config.js +0 -3
  376. package/build/commands/create-mini/standalone/examples/with-user-data/package.json +0 -33
  377. package/build/commands/create-mini/standalone/examples/with-user-data/src/App.tsx +0 -5
  378. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/ProductSection.tsx +0 -39
  379. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/SectionStyles.ts +0 -9
  380. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/ShopCard.tsx +0 -42
  381. package/build/commands/create-mini/standalone/examples/with-user-data/src/components/ShopSection.tsx +0 -40
  382. package/build/commands/create-mini/standalone/examples/with-user-data/src/index.tsx +0 -9
  383. package/build/commands/create-mini/standalone/examples/with-user-data/src/manifest.json +0 -10
  384. package/build/commands/create-mini/standalone/examples/with-user-data/src/screens/HomeScreen.tsx +0 -67
  385. package/build/commands/create-mini/standalone/examples/with-user-data/tsconfig.json +0 -41
  386. package/build/commands/create-mini/standalone/index.d.ts +0 -2
  387. package/build/commands/create-mini/standalone/index.js.map +0 -1
  388. package/build/commands/create-mini/utils/examples.js.map +0 -1
  389. package/build/commands/create-mini/utils/index.js.map +0 -1
  390. package/build/commands/dev/utils/app-screens.d.ts +0 -9
  391. package/build/commands/dev/utils/app-screens.js +0 -170
  392. package/build/commands/dev/utils/app-screens.js.map +0 -1
  393. package/build/commands/dev/utils/metro/metro-config.d.ts +0 -2
  394. package/build/commands/dev/utils/metro/metro-config.js +0 -29
  395. package/build/commands/dev/utils/metro/metro-config.js.map +0 -1
  396. package/build/commands/dev/utils/metro/metro-minis-module-resolver.d.ts +0 -6
  397. package/build/commands/dev/utils/metro/metro-minis-module-resolver.js +0 -11
  398. package/build/commands/dev/utils/metro/metro-minis-module-resolver.js.map +0 -1
  399. package/build/commands/dev/utils/metro/metro-reporter.d.ts +0 -21
  400. package/build/commands/dev/utils/metro/metro-reporter.js +0 -46
  401. package/build/commands/dev/utils/metro/metro-reporter.js.map +0 -1
  402. package/build/commands/dev/utils/metro/metro-server-middleware.d.ts +0 -10
  403. package/build/commands/dev/utils/metro/metro-server-middleware.js +0 -74
  404. package/build/commands/dev/utils/metro/metro-server-middleware.js.map +0 -1
  405. package/build/commands/dev/utils/metro/metro-server.d.ts +0 -6
  406. package/build/commands/dev/utils/metro/metro-server.js +0 -26
  407. package/build/commands/dev/utils/metro/metro-server.js.map +0 -1
  408. package/build/commands/dev/utils/start-app/types.d.ts +0 -14
  409. package/build/commands/dev/utils/start-app/types.js +0 -2
  410. package/build/commands/dev/utils/start-app/types.js.map +0 -1
  411. package/build/commands/dev/utils/types.d.ts +0 -24
  412. package/build/commands/dev/utils/types.js.map +0 -1
  413. package/build/commands/doctor/utils/diagnose-dependencies.d.ts +0 -8
  414. package/build/commands/doctor/utils/diagnose-dependencies.js +0 -190
  415. package/build/commands/doctor/utils/diagnose-dependencies.js.map +0 -1
  416. package/build/commands/generate-graphql-types/index.d.ts +0 -6
  417. package/build/commands/generate-graphql-types/index.js +0 -36
  418. package/build/commands/generate-graphql-types/index.js.map +0 -1
  419. package/build/commands/generate-graphql-types/utils/generate-graphql-types.d.ts +0 -2
  420. package/build/commands/generate-graphql-types/utils/generate-graphql-types.js +0 -67
  421. package/build/commands/generate-graphql-types/utils/generate-graphql-types.js.map +0 -1
  422. package/build/commands/generate-graphql-types/utils/get-graphql-config.d.ts +0 -1
  423. package/build/commands/generate-graphql-types/utils/get-graphql-config.js +0 -39
  424. package/build/commands/generate-graphql-types/utils/get-graphql-config.js.map +0 -1
  425. package/build/commands/generate-graphql-types/utils/get-graphql-config.spec.d.ts +0 -1
  426. package/build/commands/generate-graphql-types/utils/get-graphql-config.spec.js +0 -62
  427. package/build/commands/generate-graphql-types/utils/get-graphql-config.spec.js.map +0 -1
  428. package/build/commands/generate-graphql-types/utils/require.d.ts +0 -2
  429. package/build/commands/generate-graphql-types/utils/require.js +0 -3
  430. package/build/commands/generate-graphql-types/utils/require.js.map +0 -1
  431. package/build/commands/submit/utils/request-entry-point-params.d.ts +0 -1
  432. package/build/commands/submit/utils/request-entry-point-params.js +0 -43
  433. package/build/commands/submit/utils/request-entry-point-params.js.map +0 -1
  434. package/build/commands/upgrade/utils/clear-metro-cache.d.ts +0 -1
  435. package/build/commands/upgrade/utils/clear-metro-cache.js +0 -12
  436. package/build/commands/upgrade/utils/clear-metro-cache.js.map +0 -1
  437. package/build/commands/upgrade/utils/cli.d.ts +0 -1
  438. package/build/commands/upgrade/utils/cli.js +0 -15
  439. package/build/commands/upgrade/utils/cli.js.map +0 -1
  440. package/build/constants/extensions.d.ts +0 -21
  441. package/build/constants/extensions.js +0 -25
  442. package/build/constants/extensions.js.map +0 -1
  443. package/build/constants/templates.d.ts +0 -7
  444. package/build/constants/templates.js +0 -8
  445. package/build/constants/templates.js.map +0 -1
  446. package/build/templates-index.d.ts +0 -6
  447. package/build/templates-index.js +0 -24
  448. package/build/templates-index.js.map +0 -1
  449. package/build/utils/development-params.d.ts +0 -13
  450. package/build/utils/development-params.js +0 -44
  451. package/build/utils/development-params.js.map +0 -1
  452. package/build/utils/extensions.d.ts +0 -13
  453. package/build/utils/extensions.js +0 -87
  454. package/build/utils/extensions.js.map +0 -1
  455. package/build/utils/patch-package.d.ts +0 -5
  456. package/build/utils/patch-package.js +0 -79
  457. package/build/utils/patch-package.js.map +0 -1
  458. package/build/utils/semver.d.ts +0 -1
  459. package/build/utils/semver.js +0 -19
  460. package/build/utils/semver.js.map +0 -1
  461. package/build/utils/standalone.d.ts +0 -2
  462. package/build/utils/standalone.js +0 -15
  463. package/build/utils/standalone.js.map +0 -1
  464. package/scripts/test-create-mini-legacy.ts +0 -63
  465. package/scripts/test-create-mini-standalone.ts +0 -80
  466. package/shipit.snapshot.yml +0 -9
  467. package/templates/__template_blank/src/App.tsx +0 -24
  468. package/templates/__template_blank/src/index.tsx +0 -9
  469. package/templates/__template_common/.eslintignore +0 -1
  470. package/templates/__template_common/.eslintrc.js +0 -3
  471. package/templates/__template_common/.graphqlrc.js +0 -1
  472. package/templates/__template_common/.prettierrc.json +0 -8
  473. package/templates/__template_common/assets.d.ts +0 -14
  474. package/templates/__template_common/babel.config.js +0 -5
  475. package/templates/__template_common/index.tsx +0 -5
  476. package/templates/__template_common/metro.config.js +0 -5
  477. package/templates/__template_common/package.json +0 -35
  478. package/templates/__template_common/src/manifest.json +0 -6
  479. package/templates/__template_common/tsconfig.json +0 -41
  480. package/templates/__template_getting_started/src/App.tsx +0 -23
  481. package/templates/__template_getting_started/src/index.tsx +0 -9
  482. package/templates/__template_getting_started/src/manifest.json +0 -7
  483. package/templates/__template_getting_started/src/screens/HomeScreen.tsx +0 -131
  484. package/templates/__template_getting_started/src/screens/NativeFeaturesScreen.tsx +0 -137
  485. package/templates/__template_getting_started/src/types/screens.ts +0 -5
  486. package/templates/__template_shoppable_posts/src/App.tsx +0 -42
  487. package/templates/__template_shoppable_posts/src/index.tsx +0 -9
  488. package/templates/__template_shoppable_videos/src/App.tsx +0 -39
  489. package/templates/__template_shoppable_videos/src/index.tsx +0 -9
  490. package/templates/extensions/components/__template_blank/render.tsx +0 -18
  491. package/templates/extensions/components/__template_bundle-collection/render.tsx +0 -31
  492. package/templates/extensions/components/__template_bundle-collection/seed.ts +0 -26
  493. package/templates/extensions/components/__template_bundle-selector/render.tsx +0 -51
  494. package/templates/extensions/components/__template_bundle-selector/seed.ts +0 -72
  495. package/templates/extensions/components/__template_default-card/render.tsx +0 -24
  496. package/templates/extensions/components/__template_default-card/seed.ts +0 -10
  497. package/templates/extensions/components/__template_image-collection/render.tsx +0 -17
  498. package/templates/extensions/components/__template_image-collection/seed.ts +0 -70
  499. package/templates/extensions/components/__template_link/render.tsx +0 -17
  500. package/templates/extensions/components/__template_link/seed.ts +0 -5
  501. package/templates/extensions/components/__template_product-offer-card/render.tsx +0 -17
  502. package/templates/extensions/components/__template_product-offer-card/seed.ts +0 -44
  503. package/templates/extensions/components/__template_survey-single-response/render.tsx +0 -26
  504. package/templates/extensions/components/__template_survey-single-response/seed.ts +0 -22
  505. package/templates/extensions/components/__template_video-collection/render.tsx +0 -17
  506. package/templates/extensions/components/__template_video-collection/seed.ts +0 -37
  507. package/templates/extensions/queries/__template_order-confirmation-page/input.graphql +0 -5
  508. package/templates/extensions/queries/__template_order-confirmation-page/input.graphql.d.ts +0 -24
  509. package/templates/extensions/queries/__template_order-management-page/input.graphql +0 -5
  510. package/templates/extensions/queries/__template_order-management-page/input.graphql.d.ts +0 -24
  511. package/templates/extensions/queries/__template_product-page/input.graphql +0 -9
  512. package/templates/extensions/queries/__template_product-page/input.graphql.d.ts +0 -36
  513. package/templates/extensions/queries/__template_store-page/input.graphql +0 -5
  514. package/templates/extensions/queries/__template_store-page/input.graphql.d.ts +0 -24
  515. /package/build/commands/{create-extension → create}/index.d.ts +0 -0
  516. /package/build/commands/{create-mini → create}/utils/index.d.ts +0 -0
  517. /package/build/commands/{create-mini → create}/utils/index.js +0 -0
@@ -1,138 +0,0 @@
1
- import {useState} from 'react'
2
- import {ScrollView, TouchableOpacity} from 'react-native'
3
- import {useNavigation} from '@react-navigation/native'
4
- import {NativeStackNavigationProp} from '@react-navigation/native-stack'
5
- import {
6
- Box,
7
- SafeAreaView,
8
- Text,
9
- useTheme,
10
- Button,
11
- Icon,
12
- useMinisDimensions,
13
- Image,
14
- Divider,
15
- useImagePicker,
16
- useShare,
17
- } from '@shopify/shop-minis-sdk'
18
-
19
- import {RootStackParamList} from '../types/screens'
20
-
21
- export function NativeFeaturesScreen() {
22
- const theme = useTheme()
23
- const navigation =
24
- useNavigation<NativeStackNavigationProp<RootStackParamList>>()
25
- const {height, width} = useMinisDimensions()
26
- const {share} = useShare()
27
- const {openCamera, openPicker} = useImagePicker()
28
- const [imageUrl, setImageUrl] = useState<string>()
29
-
30
- return (
31
- <SafeAreaView
32
- style={{flex: 1, backgroundColor: theme.colors['backgrounds-regular']}}
33
- >
34
- <ScrollView>
35
- <Box
36
- flex={1}
37
- paddingHorizontal="gutter"
38
- backgroundColor="backgrounds-regular"
39
- >
40
- <Box>
41
- <TouchableOpacity
42
- onPress={() => navigation.goBack()}
43
- accessibilityLabel="Navigate back"
44
- >
45
- <Box marginTop="xs">
46
- <Icon name="arrow-left" />
47
- </Box>
48
- </TouchableOpacity>
49
- </Box>
50
- <Text variant="heroBold" marginBottom="s" marginTop="xs">
51
- Unlock Native Capabilities
52
- </Text>
53
- <Text variant="subtitle" marginBottom="s">
54
- Let&apos;s explore the native capabilities your Shop Mini can
55
- access.
56
- </Text>
57
- <Box>
58
- <Button
59
- text="Camera access"
60
- onPress={async () => {
61
- await openCamera({})
62
- .then(image => {
63
- setImageUrl(image.path)
64
- })
65
- .catch(error => {
66
- console.log(error)
67
- })
68
- }}
69
- />
70
- <Text variant="bodySmall" marginTop="xs">
71
- Run this Mini on a real device to access the camera.
72
- </Text>
73
- </Box>
74
- <Box marginVertical="s">
75
- <Button
76
- text="Gallery access"
77
- variant="secondary"
78
- onPress={async () => {
79
- await openPicker({})
80
- .then(image => {
81
- setImageUrl(image.path)
82
- })
83
- .catch(error => {
84
- console.log(error)
85
- })
86
- }}
87
- />
88
- </Box>
89
- {imageUrl ? (
90
- <Box marginBottom="s">
91
- <Box
92
- style={{
93
- width: 100,
94
- height: 100,
95
- borderRadius: 10,
96
- overflow: 'hidden',
97
- }}
98
- >
99
- <Image
100
- source={{uri: imageUrl}}
101
- style={{width: 100, height: 100}}
102
- />
103
- </Box>
104
- </Box>
105
- ) : null}
106
- <Box>
107
- <Button
108
- text="Share sheet"
109
- variant="tertiary"
110
- onPress={async () => {
111
- await share({
112
- url: 'https://shop.app/minis',
113
- title: 'title',
114
- }).catch(error => {
115
- console.log(error)
116
- })
117
- }}
118
- />
119
- </Box>
120
- <Divider marginVertical="s" />
121
- <Box>
122
- <Text variant="subtitle" marginBottom="s">
123
- Use some of our built-in APIs
124
- </Text>
125
- <Text>Screen height: {height}</Text>
126
- <Text>Screen width: {width}</Text>
127
- </Box>
128
- <Divider marginVertical="s" />
129
- <Text marginBottom="s">
130
- We look forward to seeing what you build! Check out the
131
- documentation at
132
- </Text>
133
- <Text>https://shop.app/minis</Text>
134
- </Box>
135
- </ScrollView>
136
- </SafeAreaView>
137
- )
138
- }
@@ -1,5 +0,0 @@
1
- import {ParamListBase} from '@react-navigation/native'
2
-
3
- export interface RootStackParamList extends ParamListBase {
4
- 'GettingStarted.Home': undefined
5
- }
@@ -1,3 +0,0 @@
1
- const {minisEslintConfig} = require('@shopify/shop-minis-sdk/eslint-config')
2
-
3
- module.exports = minisEslintConfig
@@ -1 +0,0 @@
1
- module.exports = require('@shopify/shop-minis-sdk/graphqlrc')
@@ -1,8 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "trailingComma": "es5",
5
- "arrowParens": "avoid",
6
- "bracketSpacing": false,
7
- "printWidth": 80
8
- }
@@ -1,25 +0,0 @@
1
- # Show Buyers's data
2
-
3
- A Shop Mini that searches forShop products and merchants
4
-
5
- ## Features
6
-
7
- - Fetches products and merchants using the Shop Minis Platform SDK
8
- - Displays vertical scrollable lists of items
9
- - Shows product cards with images and details
10
- - Shows shop cards with logos and names, and navigation to the shop
11
-
12
- ## Setup
13
-
14
- 1. Run the development server:
15
- ```bash
16
- npm start
17
- ```
18
-
19
- ## Development
20
-
21
- This mini is built using:
22
-
23
- - React Native
24
- - TypeScript
25
- - Shop Minis SDK
@@ -1,14 +0,0 @@
1
- declare module '*.svg' {
2
- const content: import('react').FC<import('react-native-svg').SvgProps>
3
- export default content
4
- }
5
-
6
- declare module '*.png' {
7
- const content: import('react-native').ImageRequireSource
8
- export default content
9
- }
10
-
11
- declare module '*.jpg' {
12
- const content: import('react-native').ImageRequireSource
13
- export default content
14
- }
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- // Changes to babel config are not supported by the mini platform.
3
- // Custom configuration can introduce unexpected behaviour in your mini and could be a cause of rejection during the submission process.
4
- presets: ['@shopify/shop-minis-sdk/babel-preset'],
5
- }
@@ -1,5 +0,0 @@
1
- import {renderDevelopmentMini} from '@shopify/shop-minis-sdk/src/renderDevelopmentMini'
2
-
3
- import MiniApp from './src'
4
-
5
- renderDevelopmentMini(MiniApp)
@@ -1,3 +0,0 @@
1
- const {getMinisMetroConfig} = require('@shopify/shop-minis-sdk/metro-config')
2
-
3
- module.exports = getMinisMetroConfig(__dirname)
@@ -1,33 +0,0 @@
1
- {
2
- "name": "with-search",
3
- "version": "0.0.1",
4
- "private": true,
5
- "scripts": {
6
- "start": "shop-minis dev",
7
- "test": "jest",
8
- "lint": "eslint ."
9
- },
10
- "dependencies": {
11
- "@shopify/shop-minis-sdk": "0.0.16"
12
- },
13
- "devDependencies": {
14
- "@shopify/shop-minis-cli": "0.0.161",
15
- "@types/jest": "^29.2.6",
16
- "babel-jest": "^26.6.3",
17
- "eslint": "^8.32.0",
18
- "jest": "^29.3.1",
19
- "prettier": "^2.8.2"
20
- },
21
- "jest": {
22
- "preset": "react-native"
23
- },
24
- "overrides": {
25
- "graphql": "15.8.0",
26
- "react": "18.2.0",
27
- "react-native": "0.73.2"
28
- },
29
- "resolutions": {
30
- "@apollo/federation": "0.38.1",
31
- "graphql": "15.8.0"
32
- }
33
- }
@@ -1,23 +0,0 @@
1
- import {createNativeStackNavigator} from '@react-navigation/native-stack'
2
-
3
- import {ProductSearchScreen} from './screens/ProductSearchScreen'
4
- import {MerchantSearchScreen} from './screens/MerchantSearchScreen'
5
-
6
- const Stack = createNativeStackNavigator()
7
-
8
- export function App() {
9
- return (
10
- <Stack.Navigator>
11
- <Stack.Screen
12
- name="ProductSearch"
13
- component={ProductSearchScreen}
14
- options={{headerShown: false}}
15
- />
16
- <Stack.Screen
17
- name="MerchantSearch"
18
- component={MerchantSearchScreen}
19
- options={{headerShown: false}}
20
- />
21
- </Stack.Navigator>
22
- )
23
- }
@@ -1,32 +0,0 @@
1
- import {useNavigation, useRoute} from '@react-navigation/native'
2
- import {NativeStackNavigationProp} from '@react-navigation/native-stack'
3
- import {TouchableOpacity, Text} from 'react-native'
4
-
5
- import {RootStackParamList} from '../types/screens'
6
-
7
- export function HeaderAction() {
8
- const navigation =
9
- useNavigation<NativeStackNavigationProp<RootStackParamList>>()
10
- const route = useRoute()
11
-
12
- const isProductSearch = route.name === 'ProductSearch'
13
-
14
- const navigationTarget = isProductSearch ? 'MerchantSearch' : 'ProductSearch'
15
-
16
- return (
17
- <TouchableOpacity
18
- onPress={() => navigation.navigate(navigationTarget)}
19
- style={{
20
- backgroundColor: 'black',
21
- paddingVertical: 6,
22
- paddingHorizontal: 12,
23
- borderRadius: 8,
24
- alignItems: 'center',
25
- }}
26
- >
27
- <Text style={{color: 'white', fontWeight: '600'}}>
28
- {isProductSearch ? 'Search Merchants' : 'Search Products'}
29
- </Text>
30
- </TouchableOpacity>
31
- )
32
- }
@@ -1,92 +0,0 @@
1
- import {View, Text} from 'react-native'
2
- import {Icon, IconButton, ImageBox, Shop} from '@shopify/shop-minis-sdk'
3
-
4
- interface ShopCardProps {
5
- shop: Shop
6
- onFavoriteToggled?: () => void
7
- }
8
-
9
- const IMAGE_ASPECT_RATIO = 1
10
-
11
- export const ShopCard: React.FC<ShopCardProps> = ({
12
- shop,
13
- onFavoriteToggled,
14
- }) => {
15
- const {logoImage, name, isFollowing, reviewAnalytics} = shop
16
-
17
- const averageRating = reviewAnalytics?.averageRating
18
-
19
- const heartButton = isFollowing ? (
20
- <IconButton
21
- accessibilityLabel="Favorite"
22
- onPress={() => onFavoriteToggled?.()}
23
- name="heart"
24
- variant="filled"
25
- backgroundColor="primary-button-background"
26
- size="xs"
27
- />
28
- ) : (
29
- <IconButton
30
- accessibilityLabel="Favorite"
31
- onPress={() => onFavoriteToggled?.()}
32
- name="favorites-heart"
33
- variant="overlay"
34
- size="xs"
35
- />
36
- )
37
-
38
- return (
39
- <View>
40
- <View
41
- style={{
42
- borderRadius: 16,
43
- borderColor: '#E4E5E7',
44
- borderWidth: 0.5,
45
- borderRightWidth: 1,
46
- }}
47
- >
48
- <View
49
- style={{
50
- minWidth: 134,
51
- width: '100%',
52
- aspectRatio: IMAGE_ASPECT_RATIO,
53
- }}
54
- >
55
- <ImageBox
56
- borderRadius="m"
57
- style={{
58
- width: '100%',
59
- height: '100%',
60
- minHeight: 134,
61
- }}
62
- resizeMode="cover"
63
- source={{
64
- uri: logoImage?.url,
65
- }}
66
- />
67
- </View>
68
-
69
- {onFavoriteToggled ? (
70
- <View style={{position: 'absolute', right: 12, bottom: 12}}>
71
- {heartButton}
72
- </View>
73
- ) : null}
74
- </View>
75
-
76
- <View
77
- style={{flexDirection: 'column', alignItems: 'center', marginTop: 4}}
78
- >
79
- <Text style={{fontSize: 16, fontWeight: '400'}}>{name}</Text>
80
-
81
- {averageRating ? (
82
- <View
83
- style={{flexDirection: 'row', alignItems: 'center', marginLeft: 8}}
84
- >
85
- <Text>{averageRating?.toFixed(1)}</Text>
86
- <Icon name="star-filled" size="xs" />
87
- </View>
88
- ) : null}
89
- </View>
90
- </View>
91
- )
92
- }
@@ -1,9 +0,0 @@
1
- import {MiniAppConfig} from '@shopify/shop-minis-sdk'
2
-
3
- import {App} from './App'
4
-
5
- const config: MiniAppConfig = {
6
- ViewerRoot: App,
7
- }
8
-
9
- export default config
@@ -1,7 +0,0 @@
1
- {
2
- "name": "with-search-merchants",
3
- "features": [
4
- "FULL_BLEED_VIEWER",
5
- "STANDALONE"
6
- ]
7
- }
@@ -1,126 +0,0 @@
1
- import {useMemo, useState, useCallback} from 'react'
2
- import {TouchableOpacity, TextInput, Text, View} from 'react-native'
3
- import {
4
- useShopSearch,
5
- useUpdateFollowedShops,
6
- useTheme,
7
- useShopNavigation,
8
- SafeAreaView,
9
- Grid,
10
- Shop,
11
- } from '@shopify/shop-minis-sdk'
12
- import debounce from 'lodash/debounce'
13
-
14
- import {ShopCard} from '../components/ShopCard'
15
- import {HeaderAction} from '../components/HeaderAction'
16
-
17
- export function MerchantSearchScreen() {
18
- const theme = useTheme()
19
-
20
- const [inputValue, setInputValue] = useState('')
21
- const [query, setQuery] = useState('')
22
-
23
- const {followShop, unfollowShop} = useUpdateFollowedShops()
24
- const {navigateToShop} = useShopNavigation()
25
- const debouncedSetQuery = useMemo(
26
- () =>
27
- debounce((text: string) => {
28
- setQuery(text)
29
- }, 300),
30
- []
31
- )
32
-
33
- const {shops, refetch} = useShopSearch({
34
- query,
35
- first: 10,
36
- skip: !query,
37
- })
38
-
39
- const onShopCardPressedHandler = useCallback(
40
- (shop: Shop) => {
41
- navigateToShop({
42
- shopId: shop.id,
43
- shopName: shop.name,
44
- })
45
- },
46
- [navigateToShop]
47
- )
48
-
49
- const onFavoriteToggledHandler = useCallback(
50
- async (shop: Shop) => {
51
- if (shop.isFollowing) {
52
- unfollowShop({shopId: shop.id})
53
- } else {
54
- followShop({shopId: shop.id})
55
- }
56
-
57
- await refetch()
58
- },
59
- [followShop, unfollowShop, refetch]
60
- )
61
-
62
- return (
63
- <SafeAreaView style={{flex: 1}}>
64
- <View
65
- style={{
66
- flex: 1,
67
- paddingHorizontal: 16,
68
- marginBottom: 8,
69
- backgroundColor: 'white',
70
- }}
71
- >
72
- <View
73
- style={{
74
- flexDirection: 'row',
75
- justifyContent: 'space-between',
76
- alignItems: 'center',
77
- marginBottom: 8,
78
- marginTop: 4,
79
- }}
80
- >
81
- <Text style={{fontSize: 20, fontWeight: 'bold'}}>
82
- Search Merchants
83
- </Text>
84
-
85
- <HeaderAction />
86
- </View>
87
-
88
- <View>
89
- <TextInput
90
- placeholder="Search for..."
91
- value={inputValue}
92
- onChangeText={text => {
93
- setInputValue(text)
94
- debouncedSetQuery(text)
95
- }}
96
- style={{
97
- borderWidth: 1,
98
- borderColor: 'gray',
99
- borderRadius: 5,
100
- padding: 10,
101
- }}
102
- />
103
- </View>
104
-
105
- {shops && shops.length > 0 ? (
106
- <View style={{flex: 1, marginTop: theme.spacing.m}}>
107
- <Grid
108
- data={shops}
109
- renderItem={({item}) => (
110
- <TouchableOpacity
111
- onPress={() => onShopCardPressedHandler(item)}
112
- >
113
- <ShopCard
114
- shop={item}
115
- onFavoriteToggled={() => onFavoriteToggledHandler(item)}
116
- />
117
- </TouchableOpacity>
118
- )}
119
- initialNumToRender={10}
120
- />
121
- </View>
122
- ) : null}
123
- </View>
124
- </SafeAreaView>
125
- )
126
- }
@@ -1,115 +0,0 @@
1
- import {useMemo, useState} from 'react'
2
- import {View, Text, TextInput, TouchableOpacity} from 'react-native'
3
- import {
4
- useProductSearch,
5
- SafeAreaView,
6
- ProductCardGrid,
7
- TouchableProduct,
8
- ProductCard,
9
- } from '@shopify/shop-minis-sdk'
10
- import debounce from 'lodash/debounce'
11
-
12
- import {HeaderAction} from '../components/HeaderAction'
13
-
14
- const LoadMoreButton = ({onPress}: {onPress: () => void}) => (
15
- <View style={{marginTop: 16}}>
16
- <TouchableOpacity
17
- onPress={onPress}
18
- style={{
19
- backgroundColor: 'black',
20
- padding: 12,
21
- borderRadius: 12,
22
- alignItems: 'center',
23
- }}
24
- >
25
- <Text style={{color: 'white', fontWeight: '600'}}>Load more</Text>
26
- </TouchableOpacity>
27
- </View>
28
- )
29
-
30
- export function ProductSearchScreen() {
31
- const [inputValue, setInputValue] = useState('')
32
- const [query, setQuery] = useState('')
33
-
34
- const debouncedSetQuery = useMemo(
35
- () =>
36
- debounce((text: string) => {
37
- setQuery(text)
38
- }, 300),
39
- []
40
- )
41
-
42
- const {products, loadMore} = useProductSearch({
43
- query,
44
- first: 10,
45
- filters: {
46
- minimumRating: 4,
47
- price: {
48
- min: 150,
49
- max: 250,
50
- },
51
- },
52
- skip: !query,
53
- })
54
-
55
- return (
56
- <SafeAreaView style={{flex: 1}}>
57
- <View
58
- style={{
59
- flex: 1,
60
- paddingHorizontal: 16,
61
- marginBottom: 8,
62
- backgroundColor: 'white',
63
- }}
64
- >
65
- <View
66
- style={{
67
- flexDirection: 'row',
68
- justifyContent: 'space-between',
69
- alignItems: 'center',
70
- marginBottom: 8,
71
- marginTop: 4,
72
- }}
73
- >
74
- <Text style={{fontSize: 20, fontWeight: 'bold'}}>
75
- Search Products
76
- </Text>
77
-
78
- <HeaderAction />
79
- </View>
80
-
81
- <View>
82
- <TextInput
83
- placeholder="Search for..."
84
- value={inputValue}
85
- onChangeText={text => {
86
- setInputValue(text)
87
- debouncedSetQuery(text)
88
- }}
89
- style={{
90
- borderWidth: 1,
91
- borderColor: 'gray',
92
- borderRadius: 5,
93
- padding: 10,
94
- }}
95
- />
96
- </View>
97
-
98
- {products && products.length > 0 ? (
99
- <View style={{flex: 1, marginTop: 16}}>
100
- <ProductCardGrid
101
- products={products}
102
- renderItem={({product}) => (
103
- <TouchableProduct product={product}>
104
- <ProductCard key={product.id} product={product} />
105
- </TouchableProduct>
106
- )}
107
- initialNumToRender={10}
108
- ListFooterComponent={<LoadMoreButton onPress={loadMore} />}
109
- />
110
- </View>
111
- ) : null}
112
- </View>
113
- </SafeAreaView>
114
- )
115
- }
@@ -1,6 +0,0 @@
1
- import {ParamListBase} from '@react-navigation/native'
2
-
3
- export interface RootStackParamList extends ParamListBase {
4
- ProductSearch: undefined
5
- MerchantSearch: undefined
6
- }