@shopify/ui-extensions-server-kit 0.0.0-snapshot-20240814205424

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 (367) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +74 -0
  3. package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -0
  4. package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +28 -0
  5. package/dist/ExtensionServerClient/ExtensionServerClient.es.js +133 -0
  6. package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +1 -0
  7. package/dist/ExtensionServerClient/index.d.ts +2 -0
  8. package/dist/ExtensionServerClient/types.cjs.js +1 -0
  9. package/dist/ExtensionServerClient/types.d.ts +124 -0
  10. package/dist/ExtensionServerClient/types.es.js +4 -0
  11. package/dist/context/ExtensionServerProvider.cjs.js +1 -0
  12. package/dist/context/ExtensionServerProvider.d.ts +2 -0
  13. package/dist/context/ExtensionServerProvider.es.js +29 -0
  14. package/dist/context/ExtensionServerProvider.test.d.ts +1 -0
  15. package/dist/context/constants.cjs.js +1 -0
  16. package/dist/context/constants.d.ts +3 -0
  17. package/dist/context/constants.es.js +14 -0
  18. package/dist/context/index.d.ts +3 -0
  19. package/dist/context/types.d.ts +11 -0
  20. package/dist/hooks/index.d.ts +5 -0
  21. package/dist/hooks/useExtensionClient.cjs.js +1 -0
  22. package/dist/hooks/useExtensionClient.d.ts +1 -0
  23. package/dist/hooks/useExtensionClient.es.js +8 -0
  24. package/dist/hooks/useExtensionServerContext.cjs.js +1 -0
  25. package/dist/hooks/useExtensionServerContext.d.ts +1 -0
  26. package/dist/hooks/useExtensionServerContext.es.js +6 -0
  27. package/dist/hooks/useExtensionServerEvent.cjs.js +1 -0
  28. package/dist/hooks/useExtensionServerEvent.d.ts +1 -0
  29. package/dist/hooks/useExtensionServerEvent.es.js +9 -0
  30. package/dist/hooks/useExtensionServerState.cjs.js +1 -0
  31. package/dist/hooks/useExtensionServerState.d.ts +1 -0
  32. package/dist/hooks/useExtensionServerState.es.js +9 -0
  33. package/dist/hooks/useIsomorphicLayoutEffect.cjs.js +1 -0
  34. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  35. package/dist/hooks/useIsomorphicLayoutEffect.es.js +5 -0
  36. package/dist/i18n.cjs.js +1 -0
  37. package/dist/i18n.d.ts +93 -0
  38. package/dist/i18n.es.js +61 -0
  39. package/dist/i18n.test.d.ts +1 -0
  40. package/dist/index.cjs.js +1 -0
  41. package/dist/index.cjs2.js +1 -0
  42. package/dist/index.d.ts +7 -0
  43. package/dist/index.es.js +54 -0
  44. package/dist/index.es2.js +8 -0
  45. package/dist/state/actions/actions.cjs.js +1 -0
  46. package/dist/state/actions/actions.d.ts +6 -0
  47. package/dist/state/actions/actions.es.js +37 -0
  48. package/dist/state/actions/index.d.ts +2 -0
  49. package/dist/state/actions/types.d.ts +21 -0
  50. package/dist/state/index.d.ts +2 -0
  51. package/dist/state/reducers/constants.cjs.js +1 -0
  52. package/dist/state/reducers/constants.d.ts +2 -0
  53. package/dist/state/reducers/constants.es.js +7 -0
  54. package/dist/state/reducers/extensionServerReducer.cjs.js +1 -0
  55. package/dist/state/reducers/extensionServerReducer.d.ts +3 -0
  56. package/dist/state/reducers/extensionServerReducer.es.js +57 -0
  57. package/dist/state/reducers/extensionServerReducer.test.d.ts +1 -0
  58. package/dist/state/reducers/index.d.ts +3 -0
  59. package/dist/state/reducers/types.d.ts +6 -0
  60. package/dist/testing/MockExtensionServerProvider.cjs.js +1 -0
  61. package/dist/testing/MockExtensionServerProvider.d.ts +7 -0
  62. package/dist/testing/MockExtensionServerProvider.es.js +24 -0
  63. package/dist/testing/app.cjs.js +1 -0
  64. package/dist/testing/app.d.ts +2 -0
  65. package/dist/testing/app.es.js +16 -0
  66. package/dist/testing/extensions.cjs.js +1 -0
  67. package/dist/testing/extensions.d.ts +6 -0
  68. package/dist/testing/extensions.es.js +65 -0
  69. package/dist/testing/index.d.ts +3 -0
  70. package/dist/types.cjs.js +1 -0
  71. package/dist/types.d.ts +173 -0
  72. package/dist/types.es.js +4 -0
  73. package/dist/utilities/assetToString.cjs.js +1 -0
  74. package/dist/utilities/assetToString.d.ts +2 -0
  75. package/dist/utilities/assetToString.es.js +7 -0
  76. package/dist/utilities/assetToString.test.d.ts +1 -0
  77. package/dist/utilities/groupByKey.cjs.js +1 -0
  78. package/dist/utilities/groupByKey.d.ts +3 -0
  79. package/dist/utilities/groupByKey.es.js +6 -0
  80. package/dist/utilities/index.d.ts +7 -0
  81. package/dist/utilities/isUIExtension.cjs.js +1 -0
  82. package/dist/utilities/isUIExtension.d.ts +1 -0
  83. package/dist/utilities/isUIExtension.es.js +6 -0
  84. package/dist/utilities/isValidSurface.cjs.js +1 -0
  85. package/dist/utilities/isValidSurface.d.ts +2 -0
  86. package/dist/utilities/isValidSurface.es.js +7 -0
  87. package/dist/utilities/noop.cjs.js +1 -0
  88. package/dist/utilities/noop.d.ts +1 -0
  89. package/dist/utilities/noop.es.js +5 -0
  90. package/dist/utilities/replaceUpdated.cjs.js +1 -0
  91. package/dist/utilities/replaceUpdated.d.ts +1 -0
  92. package/dist/utilities/replaceUpdated.es.js +14 -0
  93. package/dist/utilities/replaceUpdated.test.d.ts +1 -0
  94. package/dist/utilities/set.cjs.js +1 -0
  95. package/dist/utilities/set.d.ts +4 -0
  96. package/dist/utilities/set.es.js +18 -0
  97. package/dist/utilities/set.test.d.ts +1 -0
  98. package/index.d.ts +1 -0
  99. package/index.js +1 -0
  100. package/index.mjs +1 -0
  101. package/node_modules/@shopify/react-testing/LICENSE.md +21 -0
  102. package/node_modules/@shopify/react-testing/README.md +711 -0
  103. package/node_modules/@shopify/react-testing/build/cjs/TestWrapper.js +52 -0
  104. package/node_modules/@shopify/react-testing/build/cjs/_virtual/_rollupPluginBabelHelpers.js +47 -0
  105. package/node_modules/@shopify/react-testing/build/cjs/compat.js +14 -0
  106. package/node_modules/@shopify/react-testing/build/cjs/destroy.js +13 -0
  107. package/node_modules/@shopify/react-testing/build/cjs/element.js +225 -0
  108. package/node_modules/@shopify/react-testing/build/cjs/index.js +21 -0
  109. package/node_modules/@shopify/react-testing/build/cjs/matchers/components.js +46 -0
  110. package/node_modules/@shopify/react-testing/build/cjs/matchers/context.js +25 -0
  111. package/node_modules/@shopify/react-testing/build/cjs/matchers/index.js +16 -0
  112. package/node_modules/@shopify/react-testing/build/cjs/matchers/props.js +38 -0
  113. package/node_modules/@shopify/react-testing/build/cjs/matchers/strings.js +42 -0
  114. package/node_modules/@shopify/react-testing/build/cjs/matchers/utilities.js +110 -0
  115. package/node_modules/@shopify/react-testing/build/cjs/mount.js +76 -0
  116. package/node_modules/@shopify/react-testing/build/cjs/root.js +284 -0
  117. package/node_modules/@shopify/react-testing/build/cjs/toReactString.js +86 -0
  118. package/node_modules/@shopify/react-testing/build/cjs/types.js +28 -0
  119. package/node_modules/@shopify/react-testing/build/esm/TestWrapper.mjs +44 -0
  120. package/node_modules/@shopify/react-testing/build/esm/_virtual/_rollupPluginBabelHelpers.mjs +42 -0
  121. package/node_modules/@shopify/react-testing/build/esm/compat.mjs +10 -0
  122. package/node_modules/@shopify/react-testing/build/esm/destroy.mjs +9 -0
  123. package/node_modules/@shopify/react-testing/build/esm/element.mjs +221 -0
  124. package/node_modules/@shopify/react-testing/build/esm/index.mjs +5 -0
  125. package/node_modules/@shopify/react-testing/build/esm/matchers/components.mjs +41 -0
  126. package/node_modules/@shopify/react-testing/build/esm/matchers/context.mjs +21 -0
  127. package/node_modules/@shopify/react-testing/build/esm/matchers/index.mjs +14 -0
  128. package/node_modules/@shopify/react-testing/build/esm/matchers/props.mjs +33 -0
  129. package/node_modules/@shopify/react-testing/build/esm/matchers/strings.mjs +37 -0
  130. package/node_modules/@shopify/react-testing/build/esm/matchers/utilities.mjs +101 -0
  131. package/node_modules/@shopify/react-testing/build/esm/mount.mjs +70 -0
  132. package/node_modules/@shopify/react-testing/build/esm/root.mjs +275 -0
  133. package/node_modules/@shopify/react-testing/build/esm/toReactString.mjs +80 -0
  134. package/node_modules/@shopify/react-testing/build/esm/types.mjs +26 -0
  135. package/node_modules/@shopify/react-testing/build/esnext/TestWrapper.esnext +44 -0
  136. package/node_modules/@shopify/react-testing/build/esnext/compat.esnext +10 -0
  137. package/node_modules/@shopify/react-testing/build/esnext/destroy.esnext +9 -0
  138. package/node_modules/@shopify/react-testing/build/esnext/element.esnext +221 -0
  139. package/node_modules/@shopify/react-testing/build/esnext/index.esnext +5 -0
  140. package/node_modules/@shopify/react-testing/build/esnext/matchers/components.esnext +41 -0
  141. package/node_modules/@shopify/react-testing/build/esnext/matchers/context.esnext +21 -0
  142. package/node_modules/@shopify/react-testing/build/esnext/matchers/index.esnext +14 -0
  143. package/node_modules/@shopify/react-testing/build/esnext/matchers/props.esnext +33 -0
  144. package/node_modules/@shopify/react-testing/build/esnext/matchers/strings.esnext +37 -0
  145. package/node_modules/@shopify/react-testing/build/esnext/matchers/utilities.esnext +99 -0
  146. package/node_modules/@shopify/react-testing/build/esnext/mount.esnext +71 -0
  147. package/node_modules/@shopify/react-testing/build/esnext/root.esnext +275 -0
  148. package/node_modules/@shopify/react-testing/build/esnext/toReactString.esnext +80 -0
  149. package/node_modules/@shopify/react-testing/build/esnext/types.esnext +26 -0
  150. package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts +17 -0
  151. package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts.map +1 -0
  152. package/node_modules/@shopify/react-testing/build/ts/compat.d.ts +3 -0
  153. package/node_modules/@shopify/react-testing/build/ts/compat.d.ts.map +1 -0
  154. package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts +2 -0
  155. package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts.map +1 -0
  156. package/node_modules/@shopify/react-testing/build/ts/element.d.ts +42 -0
  157. package/node_modules/@shopify/react-testing/build/ts/element.d.ts.map +1 -0
  158. package/node_modules/@shopify/react-testing/build/ts/index.d.ts +7 -0
  159. package/node_modules/@shopify/react-testing/build/ts/index.d.ts.map +1 -0
  160. package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts +12 -0
  161. package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts.map +1 -0
  162. package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts +8 -0
  163. package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts.map +1 -0
  164. package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts +20 -0
  165. package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts.map +1 -0
  166. package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts +10 -0
  167. package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts.map +1 -0
  168. package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts +11 -0
  169. package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts.map +1 -0
  170. package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts +17 -0
  171. package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts.map +1 -0
  172. package/node_modules/@shopify/react-testing/build/ts/mount.d.ts +39 -0
  173. package/node_modules/@shopify/react-testing/build/ts/mount.d.ts.map +1 -0
  174. package/node_modules/@shopify/react-testing/build/ts/root.d.ts +55 -0
  175. package/node_modules/@shopify/react-testing/build/ts/root.d.ts.map +1 -0
  176. package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts +5 -0
  177. package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts.map +1 -0
  178. package/node_modules/@shopify/react-testing/build/ts/types.d.ts +89 -0
  179. package/node_modules/@shopify/react-testing/build/ts/types.d.ts.map +1 -0
  180. package/node_modules/@shopify/react-testing/index.esnext +1 -0
  181. package/node_modules/@shopify/react-testing/index.js +1 -0
  182. package/node_modules/@shopify/react-testing/index.mjs +1 -0
  183. package/node_modules/@shopify/react-testing/matchers.esnext +1 -0
  184. package/node_modules/@shopify/react-testing/matchers.js +1 -0
  185. package/node_modules/@shopify/react-testing/matchers.mjs +1 -0
  186. package/node_modules/@shopify/react-testing/package.json +69 -0
  187. package/node_modules/@shopify/ui-extensions-test-utils/CHANGELOG.md +66 -0
  188. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.js +3 -0
  189. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.js +5 -0
  190. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.js +20 -0
  191. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +6 -0
  192. package/node_modules/@shopify/ui-extensions-test-utils/package.json +41 -0
  193. package/node_modules/@shopify/ui-extensions-test-utils/project.json +39 -0
  194. package/node_modules/@types/node/LICENSE +21 -0
  195. package/node_modules/@types/node/README.md +15 -0
  196. package/node_modules/@types/node/assert/strict.d.ts +8 -0
  197. package/node_modules/@types/node/assert.d.ts +985 -0
  198. package/node_modules/@types/node/async_hooks.d.ts +522 -0
  199. package/node_modules/@types/node/buffer.d.ts +2321 -0
  200. package/node_modules/@types/node/child_process.d.ts +1544 -0
  201. package/node_modules/@types/node/cluster.d.ts +432 -0
  202. package/node_modules/@types/node/console.d.ts +412 -0
  203. package/node_modules/@types/node/constants.d.ts +19 -0
  204. package/node_modules/@types/node/crypto.d.ts +4451 -0
  205. package/node_modules/@types/node/dgram.d.ts +586 -0
  206. package/node_modules/@types/node/diagnostics_channel.d.ts +192 -0
  207. package/node_modules/@types/node/dns/promises.d.ts +381 -0
  208. package/node_modules/@types/node/dns.d.ts +809 -0
  209. package/node_modules/@types/node/dom-events.d.ts +122 -0
  210. package/node_modules/@types/node/domain.d.ts +170 -0
  211. package/node_modules/@types/node/events.d.ts +803 -0
  212. package/node_modules/@types/node/fs/promises.d.ts +1205 -0
  213. package/node_modules/@types/node/fs.d.ts +4211 -0
  214. package/node_modules/@types/node/globals.d.ts +377 -0
  215. package/node_modules/@types/node/globals.global.d.ts +1 -0
  216. package/node_modules/@types/node/http.d.ts +1801 -0
  217. package/node_modules/@types/node/http2.d.ts +2386 -0
  218. package/node_modules/@types/node/https.d.ts +544 -0
  219. package/node_modules/@types/node/index.d.ts +88 -0
  220. package/node_modules/@types/node/inspector.d.ts +2739 -0
  221. package/node_modules/@types/node/module.d.ts +298 -0
  222. package/node_modules/@types/node/net.d.ts +913 -0
  223. package/node_modules/@types/node/os.d.ts +473 -0
  224. package/node_modules/@types/node/package.json +235 -0
  225. package/node_modules/@types/node/path.d.ts +191 -0
  226. package/node_modules/@types/node/perf_hooks.d.ts +626 -0
  227. package/node_modules/@types/node/process.d.ts +1531 -0
  228. package/node_modules/@types/node/punycode.d.ts +117 -0
  229. package/node_modules/@types/node/querystring.d.ts +141 -0
  230. package/node_modules/@types/node/readline/promises.d.ts +143 -0
  231. package/node_modules/@types/node/readline.d.ts +666 -0
  232. package/node_modules/@types/node/repl.d.ts +430 -0
  233. package/node_modules/@types/node/stream/consumers.d.ts +12 -0
  234. package/node_modules/@types/node/stream/promises.d.ts +83 -0
  235. package/node_modules/@types/node/stream/web.d.ts +336 -0
  236. package/node_modules/@types/node/stream.d.ts +1731 -0
  237. package/node_modules/@types/node/string_decoder.d.ts +67 -0
  238. package/node_modules/@types/node/test.d.ts +1113 -0
  239. package/node_modules/@types/node/timers/promises.d.ts +93 -0
  240. package/node_modules/@types/node/timers.d.ts +126 -0
  241. package/node_modules/@types/node/tls.d.ts +1203 -0
  242. package/node_modules/@types/node/trace_events.d.ts +171 -0
  243. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  244. package/node_modules/@types/node/ts4.8/assert.d.ts +985 -0
  245. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +522 -0
  246. package/node_modules/@types/node/ts4.8/buffer.d.ts +2321 -0
  247. package/node_modules/@types/node/ts4.8/child_process.d.ts +1544 -0
  248. package/node_modules/@types/node/ts4.8/cluster.d.ts +432 -0
  249. package/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  250. package/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
  251. package/node_modules/@types/node/ts4.8/crypto.d.ts +4450 -0
  252. package/node_modules/@types/node/ts4.8/dgram.d.ts +586 -0
  253. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +192 -0
  254. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +381 -0
  255. package/node_modules/@types/node/ts4.8/dns.d.ts +809 -0
  256. package/node_modules/@types/node/ts4.8/dom-events.d.ts +122 -0
  257. package/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  258. package/node_modules/@types/node/ts4.8/events.d.ts +754 -0
  259. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +1205 -0
  260. package/node_modules/@types/node/ts4.8/fs.d.ts +4211 -0
  261. package/node_modules/@types/node/ts4.8/globals.d.ts +377 -0
  262. package/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  263. package/node_modules/@types/node/ts4.8/http.d.ts +1801 -0
  264. package/node_modules/@types/node/ts4.8/http2.d.ts +2386 -0
  265. package/node_modules/@types/node/ts4.8/https.d.ts +544 -0
  266. package/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  267. package/node_modules/@types/node/ts4.8/inspector.d.ts +2739 -0
  268. package/node_modules/@types/node/ts4.8/module.d.ts +298 -0
  269. package/node_modules/@types/node/ts4.8/net.d.ts +913 -0
  270. package/node_modules/@types/node/ts4.8/os.d.ts +473 -0
  271. package/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  272. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +626 -0
  273. package/node_modules/@types/node/ts4.8/process.d.ts +1531 -0
  274. package/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  275. package/node_modules/@types/node/ts4.8/querystring.d.ts +141 -0
  276. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
  277. package/node_modules/@types/node/ts4.8/readline.d.ts +666 -0
  278. package/node_modules/@types/node/ts4.8/repl.d.ts +430 -0
  279. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  280. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +83 -0
  281. package/node_modules/@types/node/ts4.8/stream/web.d.ts +336 -0
  282. package/node_modules/@types/node/ts4.8/stream.d.ts +1731 -0
  283. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  284. package/node_modules/@types/node/ts4.8/test.d.ts +1113 -0
  285. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  286. package/node_modules/@types/node/ts4.8/timers.d.ts +126 -0
  287. package/node_modules/@types/node/ts4.8/tls.d.ts +1203 -0
  288. package/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
  289. package/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
  290. package/node_modules/@types/node/ts4.8/url.d.ts +937 -0
  291. package/node_modules/@types/node/ts4.8/util.d.ts +2075 -0
  292. package/node_modules/@types/node/ts4.8/v8.d.ts +541 -0
  293. package/node_modules/@types/node/ts4.8/vm.d.ts +667 -0
  294. package/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  295. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +692 -0
  296. package/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  297. package/node_modules/@types/node/tty.d.ts +206 -0
  298. package/node_modules/@types/node/url.d.ts +937 -0
  299. package/node_modules/@types/node/util.d.ts +2075 -0
  300. package/node_modules/@types/node/v8.d.ts +541 -0
  301. package/node_modules/@types/node/vm.d.ts +667 -0
  302. package/node_modules/@types/node/wasi.d.ts +158 -0
  303. package/node_modules/@types/node/worker_threads.d.ts +692 -0
  304. package/node_modules/@types/node/zlib.d.ts +517 -0
  305. package/node_modules/@types/react/LICENSE +21 -0
  306. package/node_modules/@types/react/README.md +16 -0
  307. package/node_modules/@types/react/experimental.d.ts +192 -0
  308. package/node_modules/@types/react/global.d.ts +151 -0
  309. package/node_modules/@types/react/index.d.ts +3175 -0
  310. package/node_modules/@types/react/jsx-dev-runtime.d.ts +2 -0
  311. package/node_modules/@types/react/jsx-runtime.d.ts +2 -0
  312. package/node_modules/@types/react/package.json +149 -0
  313. package/node_modules/@vitejs/plugin-react-refresh/LICENSE +21 -0
  314. package/node_modules/@vitejs/plugin-react-refresh/README.md +73 -0
  315. package/node_modules/@vitejs/plugin-react-refresh/index.d.ts +14 -0
  316. package/node_modules/@vitejs/plugin-react-refresh/index.js +239 -0
  317. package/node_modules/@vitejs/plugin-react-refresh/package.json +35 -0
  318. package/package.json +64 -0
  319. package/project.json +74 -0
  320. package/scripts/create-entry-files.ts +44 -0
  321. package/src/ExtensionServerClient/ExtensionServerClient.test.ts +730 -0
  322. package/src/ExtensionServerClient/ExtensionServerClient.ts +310 -0
  323. package/src/ExtensionServerClient/index.ts +2 -0
  324. package/src/ExtensionServerClient/types.ts +159 -0
  325. package/src/context/ExtensionServerProvider.test.tsx +173 -0
  326. package/src/context/ExtensionServerProvider.tsx +46 -0
  327. package/src/context/constants.ts +15 -0
  328. package/src/context/index.ts +3 -0
  329. package/src/context/types.ts +13 -0
  330. package/src/hooks/index.ts +5 -0
  331. package/src/hooks/useExtensionClient.ts +6 -0
  332. package/src/hooks/useExtensionServerContext.ts +4 -0
  333. package/src/hooks/useExtensionServerEvent.ts +11 -0
  334. package/src/hooks/useExtensionServerState.ts +6 -0
  335. package/src/hooks/useIsomorphicLayoutEffect.ts +6 -0
  336. package/src/i18n.test.ts +417 -0
  337. package/src/i18n.ts +208 -0
  338. package/src/index.ts +7 -0
  339. package/src/state/actions/actions.ts +36 -0
  340. package/src/state/actions/index.ts +2 -0
  341. package/src/state/actions/types.ts +26 -0
  342. package/src/state/index.ts +2 -0
  343. package/src/state/reducers/constants.ts +6 -0
  344. package/src/state/reducers/extensionServerReducer.test.ts +160 -0
  345. package/src/state/reducers/extensionServerReducer.ts +87 -0
  346. package/src/state/reducers/index.ts +3 -0
  347. package/src/state/reducers/types.ts +7 -0
  348. package/src/testing/MockExtensionServerProvider.tsx +36 -0
  349. package/src/testing/app.ts +15 -0
  350. package/src/testing/extensions.ts +70 -0
  351. package/src/testing/index.ts +3 -0
  352. package/src/types.ts +177 -0
  353. package/src/utilities/assetToString.test.ts +16 -0
  354. package/src/utilities/assetToString.ts +8 -0
  355. package/src/utilities/groupByKey.ts +3 -0
  356. package/src/utilities/index.ts +7 -0
  357. package/src/utilities/isUIExtension.ts +7 -0
  358. package/src/utilities/isValidSurface.ts +7 -0
  359. package/src/utilities/noop.ts +1 -0
  360. package/src/utilities/replaceUpdated.test.ts +26 -0
  361. package/src/utilities/replaceUpdated.ts +16 -0
  362. package/src/utilities/set.test.ts +19 -0
  363. package/src/utilities/set.ts +29 -0
  364. package/testing.d.ts +1 -0
  365. package/testing.js +1 -0
  366. package/testing.mjs +1 -0
  367. package/tests/setup.ts +6 -0
@@ -0,0 +1,2 @@
1
+ // Expose `JSX` namespace in `global` namespace
2
+ import './';
@@ -0,0 +1,2 @@
1
+ // Expose `JSX` namespace in `global` namespace
2
+ import './';
@@ -0,0 +1,149 @@
1
+ {
2
+ "name": "@types/react",
3
+ "version": "17.0.2",
4
+ "description": "TypeScript definitions for React",
5
+ "license": "MIT",
6
+ "contributors": [
7
+ {
8
+ "name": "Asana",
9
+ "url": "https://asana.com"
10
+ },
11
+ {
12
+ "name": "AssureSign",
13
+ "url": "http://www.assuresign.com"
14
+ },
15
+ {
16
+ "name": "Microsoft",
17
+ "url": "https://microsoft.com"
18
+ },
19
+ {
20
+ "name": "John Reilly",
21
+ "url": "https://github.com/johnnyreilly",
22
+ "githubUsername": "johnnyreilly"
23
+ },
24
+ {
25
+ "name": "Benoit Benezech",
26
+ "url": "https://github.com/bbenezech",
27
+ "githubUsername": "bbenezech"
28
+ },
29
+ {
30
+ "name": "Patricio Zavolinsky",
31
+ "url": "https://github.com/pzavolinsky",
32
+ "githubUsername": "pzavolinsky"
33
+ },
34
+ {
35
+ "name": "Digiguru",
36
+ "url": "https://github.com/digiguru",
37
+ "githubUsername": "digiguru"
38
+ },
39
+ {
40
+ "name": "Eric Anderson",
41
+ "url": "https://github.com/ericanderson",
42
+ "githubUsername": "ericanderson"
43
+ },
44
+ {
45
+ "name": "Dovydas Navickas",
46
+ "url": "https://github.com/DovydasNavickas",
47
+ "githubUsername": "DovydasNavickas"
48
+ },
49
+ {
50
+ "name": "Josh Rutherford",
51
+ "url": "https://github.com/theruther4d",
52
+ "githubUsername": "theruther4d"
53
+ },
54
+ {
55
+ "name": "Guilherme Hübner",
56
+ "url": "https://github.com/guilhermehubner",
57
+ "githubUsername": "guilhermehubner"
58
+ },
59
+ {
60
+ "name": "Ferdy Budhidharma",
61
+ "url": "https://github.com/ferdaber",
62
+ "githubUsername": "ferdaber"
63
+ },
64
+ {
65
+ "name": "Johann Rakotoharisoa",
66
+ "url": "https://github.com/jrakotoharisoa",
67
+ "githubUsername": "jrakotoharisoa"
68
+ },
69
+ {
70
+ "name": "Olivier Pascal",
71
+ "url": "https://github.com/pascaloliv",
72
+ "githubUsername": "pascaloliv"
73
+ },
74
+ {
75
+ "name": "Martin Hochel",
76
+ "url": "https://github.com/hotell",
77
+ "githubUsername": "hotell"
78
+ },
79
+ {
80
+ "name": "Frank Li",
81
+ "url": "https://github.com/franklixuefei",
82
+ "githubUsername": "franklixuefei"
83
+ },
84
+ {
85
+ "name": "Jessica Franco",
86
+ "url": "https://github.com/Jessidhia",
87
+ "githubUsername": "Jessidhia"
88
+ },
89
+ {
90
+ "name": "Saransh Kataria",
91
+ "url": "https://github.com/saranshkataria",
92
+ "githubUsername": "saranshkataria"
93
+ },
94
+ {
95
+ "name": "Kanitkorn Sujautra",
96
+ "url": "https://github.com/lukyth",
97
+ "githubUsername": "lukyth"
98
+ },
99
+ {
100
+ "name": "Sebastian Silbermann",
101
+ "url": "https://github.com/eps1lon",
102
+ "githubUsername": "eps1lon"
103
+ },
104
+ {
105
+ "name": "Kyle Scully",
106
+ "url": "https://github.com/zieka",
107
+ "githubUsername": "zieka"
108
+ },
109
+ {
110
+ "name": "Cong Zhang",
111
+ "url": "https://github.com/dancerphil",
112
+ "githubUsername": "dancerphil"
113
+ },
114
+ {
115
+ "name": "Dimitri Mitropoulos",
116
+ "url": "https://github.com/dimitropoulos",
117
+ "githubUsername": "dimitropoulos"
118
+ },
119
+ {
120
+ "name": "JongChan Choi",
121
+ "url": "https://github.com/disjukr",
122
+ "githubUsername": "disjukr"
123
+ },
124
+ {
125
+ "name": "Victor Magalhães",
126
+ "url": "https://github.com/vhfmag",
127
+ "githubUsername": "vhfmag"
128
+ },
129
+ {
130
+ "name": "Dale Tan",
131
+ "url": "https://github.com/hellatan",
132
+ "githubUsername": "hellatan"
133
+ }
134
+ ],
135
+ "main": "",
136
+ "types": "index.d.ts",
137
+ "repository": {
138
+ "type": "git",
139
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
140
+ "directory": "types/react"
141
+ },
142
+ "scripts": {},
143
+ "dependencies": {
144
+ "@types/prop-types": "*",
145
+ "csstype": "^3.0.2"
146
+ },
147
+ "typesPublisherContentHash": "b4bc71e5ae8e6467bc315f57f8e7b98e248d5994ecaaf51bd4e674de77bfb6fc",
148
+ "typeScriptVersion": "3.4"
149
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,73 @@
1
+ # @vitejs/plugin-react-refresh [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react-refresh.svg)](https://npmjs.com/package/@vitejs/plugin-react-refresh)
2
+
3
+ Provides [React Refresh](https://www.npmjs.com/package/react-refresh) support for Vite.
4
+
5
+ ```js
6
+ // vite.config.js
7
+ import reactRefresh from '@vitejs/plugin-react-refresh'
8
+
9
+ export default {
10
+ plugins: [reactRefresh()]
11
+ }
12
+ ```
13
+
14
+ ## Specifying Additional Parser Plugins
15
+
16
+ If you are using ES syntax that are still in proposal status (e.g. class properties), you can selectively enable them via the `parserPlugins` option:
17
+
18
+ ```js
19
+ export default {
20
+ plugins: [
21
+ reactRefresh({
22
+ parserPlugins: ['classProperties', 'classPrivateProperties']
23
+ })
24
+ ]
25
+ }
26
+ ```
27
+
28
+ [Full list of Babel parser plugins](https://babeljs.io/docs/en/babel-parser#ecmascript-proposalshttpsgithubcombabelproposals).
29
+
30
+ ## Specifying files to include or exclude from refreshing
31
+
32
+ By default, @vite/plugin-react-refresh will process files ending with `.js`, `.jsx`, `.ts`, and `.tsx`, and excludes all files in `node_modules`.
33
+
34
+ In some situations you may not want a file to act as an HMR boundary, instead preferring that the changes propagate higher in the stack before being handled. In these cases, you can provide an `include` and/or `exclude` option, which can be regex or a [picomatch](https://github.com/micromatch/picomatch#globbing-features) pattern, or array of either. Files must match include and not exclude to be processed. Note, when using either `include`, or `exclude`, the defaults will not be merged in, so re-apply them if necessary.
35
+
36
+ ```js
37
+ export default {
38
+ plugins: [
39
+ reactRefresh({
40
+ // Exclude storybook stories and node_modules
41
+ exclude: [/\.stories\.(t|j)sx?$/, /node_modules/],
42
+ // Only .tsx files
43
+ include: '**/*.tsx'
44
+ })
45
+ ]
46
+ }
47
+ ```
48
+
49
+ ### Notes
50
+
51
+ - If using TSX, any TS-supported syntax will already be transpiled away so you won't need to specify them here.
52
+
53
+ - This option only enables the plugin to parse these syntax - it does not perform any transpilation since this plugin is dev-only.
54
+
55
+ - If you wish to transpile the syntax for production, you will need to configure the transform separately using [@rollup/plugin-babel](https://github.com/rollup/plugins/tree/master/packages/babel) as a build-only plugin.
56
+
57
+ ## Middleware Mode Notes
58
+
59
+ When Vite is launched in **Middleware Mode**, you need to make sure your entry `index.html` file is transformed with `ViteDevServer.transformIndexHtml`. Otherwise, you may get an error prompting `Uncaught Error: @vitejs/plugin-react-refresh can't detect preamble. Something is wrong.`
60
+
61
+ To mitigate this issue, you can explicitly transform your `index.html` like this when configuring your express server:
62
+
63
+ ```js
64
+ app.get('/', async (req, res, next) => {
65
+ try {
66
+ let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')
67
+ html = await viteServer.transformIndexHtml(req.url, html)
68
+ res.send(html)
69
+ } catch (e) {
70
+ return next(e)
71
+ }
72
+ })
73
+ ```
@@ -0,0 +1,14 @@
1
+ import { Plugin } from 'vite'
2
+ import { ParserOptions } from '@babel/core'
3
+
4
+ type PluginFactory = (options?: Options) => Plugin
5
+
6
+ declare const createPlugin: PluginFactory & { preambleCode: string }
7
+
8
+ export interface Options {
9
+ parserPlugins?: ParserOptions['plugins']
10
+ include?: string | RegExp | Array<string | RegExp>
11
+ exclude?: string | RegExp | Array<string | RegExp>
12
+ }
13
+
14
+ export default createPlugin
@@ -0,0 +1,239 @@
1
+ // @ts-check
2
+ const fs = require('fs')
3
+ const { transformSync, ParserOptions } = require('@babel/core')
4
+ const { createFilter } = require('@rollup/pluginutils')
5
+ const runtimePublicPath = '/@react-refresh'
6
+ const runtimeFilePath = require.resolve(
7
+ 'react-refresh/cjs/react-refresh-runtime.development.js'
8
+ )
9
+
10
+ const runtimeCode = `
11
+ const exports = {}
12
+ ${fs.readFileSync(runtimeFilePath, 'utf-8')}
13
+ function debounce(fn, delay) {
14
+ let handle
15
+ return () => {
16
+ clearTimeout(handle)
17
+ handle = setTimeout(fn, delay)
18
+ }
19
+ }
20
+ exports.performReactRefresh = debounce(exports.performReactRefresh, 16)
21
+ export default exports
22
+ `
23
+
24
+ const preambleCode = `
25
+ import RefreshRuntime from "__BASE__${runtimePublicPath.slice(1)}"
26
+ RefreshRuntime.injectIntoGlobalHook(window)
27
+ window.$RefreshReg$ = () => {}
28
+ window.$RefreshSig$ = () => (type) => type
29
+ window.__vite_plugin_react_preamble_installed__ = true
30
+ `
31
+
32
+ /**
33
+ * Transform plugin for transforming and injecting per-file refresh code.
34
+ *
35
+ * @type {import('.').default}
36
+ */
37
+ function reactRefreshPlugin(opts) {
38
+ let shouldSkip = false
39
+ let base = '/'
40
+ const filter = createFilter(
41
+ (opts && opts.include) || /\.(t|j)sx?$/,
42
+ (opts && opts.exclude) || /node_modules/
43
+ )
44
+
45
+ return {
46
+ name: 'react-refresh',
47
+
48
+ enforce: 'pre',
49
+
50
+ configResolved(config) {
51
+ shouldSkip = config.command === 'build' || config.isProduction
52
+ base = config.base
53
+ },
54
+
55
+ resolveId(id) {
56
+ if (id === runtimePublicPath) {
57
+ return id
58
+ }
59
+ },
60
+
61
+ load(id) {
62
+ if (id === runtimePublicPath) {
63
+ return runtimeCode
64
+ }
65
+ },
66
+
67
+ transform(code, id, ssr) {
68
+ if (shouldSkip || ssr) {
69
+ return
70
+ }
71
+
72
+ if (!filter(id)) {
73
+ return
74
+ }
75
+
76
+ // plain js/ts files can't use React without importing it, so skip
77
+ // them whenever possible
78
+ if (!id.endsWith('x') && !code.includes('react')) {
79
+ return
80
+ }
81
+
82
+ /**
83
+ * @type ParserOptions["plugins"]
84
+ */
85
+ const parserPlugins = [
86
+ 'jsx',
87
+ 'importMeta',
88
+ // since the plugin now applies before esbuild transforms the code,
89
+ // we need to enable some stage 3 syntax since they are supported in
90
+ // TS and some environments already.
91
+ 'topLevelAwait',
92
+ 'classProperties',
93
+ 'classPrivateProperties',
94
+ 'classPrivateMethods'
95
+ ]
96
+ if (/\.tsx?$/.test(id)) {
97
+ // it's a typescript file
98
+ // TODO: maybe we need to read tsconfig to determine parser plugins to
99
+ // enable here, but allowing decorators by default since it's very
100
+ // commonly used with TS.
101
+ parserPlugins.push('typescript', 'decorators-legacy')
102
+ }
103
+ if (opts && opts.parserPlugins) {
104
+ parserPlugins.push(...opts.parserPlugins)
105
+ }
106
+
107
+ const isReasonReact = id.endsWith('.bs.js')
108
+ const result = transformSync(code, {
109
+ babelrc: false,
110
+ configFile: false,
111
+ filename: id,
112
+ parserOpts: {
113
+ sourceType: 'module',
114
+ allowAwaitOutsideFunction: true,
115
+ plugins: parserPlugins
116
+ },
117
+ generatorOpts: {
118
+ decoratorsBeforeExport: true
119
+ },
120
+ plugins: [
121
+ require('@babel/plugin-transform-react-jsx-self'),
122
+ require('@babel/plugin-transform-react-jsx-source'),
123
+ [require('react-refresh/babel'), { skipEnvCheck: true }]
124
+ ],
125
+ ast: !isReasonReact,
126
+ sourceMaps: true,
127
+ sourceFileName: id
128
+ })
129
+
130
+ if (!/\$RefreshReg\$\(/.test(result.code)) {
131
+ // no component detected in the file
132
+ return code
133
+ }
134
+
135
+ const header = `
136
+ import RefreshRuntime from "${runtimePublicPath}";
137
+
138
+ let prevRefreshReg;
139
+ let prevRefreshSig;
140
+
141
+ if (!window.__vite_plugin_react_preamble_installed__) {
142
+ throw new Error(
143
+ "@vitejs/plugin-react-refresh can't detect preamble. Something is wrong. " +
144
+ "See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
145
+ );
146
+ }
147
+
148
+ if (import.meta.hot) {
149
+ prevRefreshReg = window.$RefreshReg$;
150
+ prevRefreshSig = window.$RefreshSig$;
151
+ window.$RefreshReg$ = (type, id) => {
152
+ RefreshRuntime.register(type, ${JSON.stringify(id)} + " " + id)
153
+ };
154
+ window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;
155
+ }`.replace(/[\n]+/gm, '')
156
+
157
+ const footer = `
158
+ if (import.meta.hot) {
159
+ window.$RefreshReg$ = prevRefreshReg;
160
+ window.$RefreshSig$ = prevRefreshSig;
161
+
162
+ ${
163
+ isReasonReact || isRefreshBoundary(result.ast)
164
+ ? `import.meta.hot.accept();`
165
+ : ``
166
+ }
167
+ if (!window.__vite_plugin_react_timeout) {
168
+ window.__vite_plugin_react_timeout = setTimeout(() => {
169
+ window.__vite_plugin_react_timeout = 0;
170
+ RefreshRuntime.performReactRefresh();
171
+ }, 30);
172
+ }
173
+ }`
174
+
175
+ return {
176
+ code: `${header}${result.code}${footer}`,
177
+ map: result.map
178
+ }
179
+ },
180
+
181
+ transformIndexHtml() {
182
+ if (shouldSkip) {
183
+ return
184
+ }
185
+
186
+ return [
187
+ {
188
+ tag: 'script',
189
+ attrs: { type: 'module' },
190
+ children: preambleCode.replace(`__BASE__`, base)
191
+ }
192
+ ]
193
+ }
194
+ }
195
+ }
196
+
197
+ /**
198
+ * @param {import('@babel/core').BabelFileResult['ast']} ast
199
+ */
200
+ function isRefreshBoundary(ast) {
201
+ // Every export must be a React component.
202
+ return ast.program.body.every((node) => {
203
+ if (node.type !== 'ExportNamedDeclaration') {
204
+ return true
205
+ }
206
+ const { declaration, specifiers } = node
207
+ if (declaration) {
208
+ if (declaration.type === 'VariableDeclaration') {
209
+ return declaration.declarations.every((variable) =>
210
+ isComponentLikeIdentifier(variable.id)
211
+ )
212
+ }
213
+ if (declaration.type === 'FunctionDeclaration') {
214
+ return isComponentLikeIdentifier(declaration.id)
215
+ }
216
+ }
217
+ return specifiers.every((spec) => {
218
+ return isComponentLikeIdentifier(spec.exported)
219
+ })
220
+ })
221
+ }
222
+
223
+ /**
224
+ * @param {import('@babel/types').Node} node
225
+ */
226
+ function isComponentLikeIdentifier(node) {
227
+ return node.type === 'Identifier' && isComponentLikeName(node.name)
228
+ }
229
+
230
+ /**
231
+ * @param {string} name
232
+ */
233
+ function isComponentLikeName(name) {
234
+ return typeof name === 'string' && name[0] >= 'A' && name[0] <= 'Z'
235
+ }
236
+
237
+ module.exports = reactRefreshPlugin
238
+ reactRefreshPlugin['default'] = reactRefreshPlugin
239
+ reactRefreshPlugin.preambleCode = preambleCode
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@vitejs/plugin-react-refresh",
3
+ "version": "1.3.6",
4
+ "license": "MIT",
5
+ "author": "Evan You",
6
+ "files": [
7
+ "index.js",
8
+ "index.d.ts"
9
+ ],
10
+ "main": "index.js",
11
+ "types": "index.d.ts",
12
+ "scripts": {
13
+ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . --lerna-package plugin-react-refresh",
14
+ "release": "node ../../scripts/release.js --skipBuild"
15
+ },
16
+ "engines": {
17
+ "node": ">=12.0.0"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/vitejs/vite.git",
22
+ "directory": "packages/plugin-react-refresh"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/vitejs/vite/issues"
26
+ },
27
+ "homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-react-refresh#readme",
28
+ "dependencies": {
29
+ "@babel/core": "^7.14.8",
30
+ "@babel/plugin-transform-react-jsx-self": "^7.14.5",
31
+ "@babel/plugin-transform-react-jsx-source": "^7.14.5",
32
+ "@rollup/pluginutils": "^4.1.1",
33
+ "react-refresh": "^0.10.0"
34
+ }
35
+ }
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@shopify/ui-extensions-server-kit",
3
+ "version": "0.0.0-snapshot-20240814205424",
4
+ "private": false,
5
+ "license": "MIT",
6
+ "exports": {
7
+ "./package.json": "./package.json",
8
+ ".": {
9
+ "require": "./index.js",
10
+ "import": "./index.mjs",
11
+ "types": "./index.d.ts"
12
+ },
13
+ "./testing": {
14
+ "require": "./testing.js",
15
+ "import": "./testing.mjs",
16
+ "types": "./testing.d.ts"
17
+ }
18
+ },
19
+ "main": "index.js",
20
+ "module": "index.mjs",
21
+ "types": "index.d.ts",
22
+ "files": [
23
+ "**"
24
+ ],
25
+ "eslintConfig": {
26
+ "extends": [
27
+ "../../.eslintrc.cjs"
28
+ ],
29
+ "rules": {
30
+ "@typescript-eslint/no-explicit-any": "off",
31
+ "import/extensions": [
32
+ "error",
33
+ "never",
34
+ {
35
+ "ignorePackages": true
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ "devDependencies": {
41
+ "@shopify/react-testing": "^3.0.0",
42
+ "@shopify/ui-extensions-test-utils": "3.26.0",
43
+ "@types/node": "18.19.3",
44
+ "@types/react": "17.0.2",
45
+ "@vitejs/plugin-react-refresh": "^1.3.6",
46
+ "jest-websocket-mock": "^2.4.0",
47
+ "jsdom": "^20.0.3",
48
+ "react": "^17.0.2",
49
+ "typescript": "5.2.2",
50
+ "vi-fetch": "^0.8.0",
51
+ "vite": "^5.3.1"
52
+ },
53
+ "peerDependencies": {
54
+ "react": "^17.0.2"
55
+ },
56
+ "scripts": {
57
+ "build": "nx build",
58
+ "clean": "nx clean",
59
+ "lint": "nx lint",
60
+ "lint:fix": "nx lint:fix",
61
+ "test": "nx run ui-extensions-server-kit:test",
62
+ "test:watch": "nx test:watch"
63
+ }
64
+ }
package/project.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "ui-extensions-server-kit",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "packages/ui-extensions-server-kit/src",
5
+ "projectType": "library",
6
+ "implicitDependencies": ["ui-extensions-test-utils"],
7
+ "tags": ["scope:feature", "scope:ui-extensions"],
8
+ "targets": {
9
+ "clean": {
10
+ "executor": "nx:run-commands",
11
+ "options": {
12
+ "command": "pnpm rimraf dist/",
13
+ "cwd": "packages/ui-extensions-server-kit"
14
+ }
15
+ },
16
+ "build:code": {
17
+ "executor": "nx:run-commands",
18
+ "outputs": ["{workspaceRoot}/dist"],
19
+ "options": {
20
+ "command": "pnpm vite build --config vite.config.ts",
21
+ "cwd": "packages/ui-extensions-server-kit"
22
+ }
23
+ },
24
+ "build:types": {
25
+ "executor": "nx:run-commands",
26
+ "dependsOn": ["^build"],
27
+ "outputs": ["{workspaceRoot}/dist"],
28
+ "options": {
29
+ "command": "pnpm tsc --emitDeclarationOnly",
30
+ "cwd": "packages/ui-extensions-server-kit"
31
+ }
32
+ },
33
+ "build": {
34
+ "executor": "nx:run-commands",
35
+ "dependsOn": ["build:code", "build:types"],
36
+ "outputs": ["{workspaceRoot}/dist"],
37
+ "inputs": ["{projectRoot}/src/**/*", "{projectRoot}/testing.*", "{projectRoot}/index.*"],
38
+ "options": {
39
+ "command": "cd .",
40
+ "cwd": "packages/ui-extensions-server-kit"
41
+ }
42
+ },
43
+ "lint": {
44
+ "executor": "nx:run-commands",
45
+ "options": {
46
+ "command": "pnpm eslint src",
47
+ "cwd": "packages/ui-extensions-server-kit"
48
+ }
49
+ },
50
+ "lint:fix": {
51
+ "executor": "nx:run-commands",
52
+ "options": {
53
+ "command": "pnpm eslint src --fix",
54
+ "cwd": "packages/ui-extensions-server-kit"
55
+ }
56
+ },
57
+ "test": {
58
+ "executor": "nx:run-commands",
59
+ "dependsOn": ["^build"],
60
+ "options": {
61
+ "command": "pnpm vitest run",
62
+ "cwd": "packages/ui-extensions-server-kit"
63
+ }
64
+ },
65
+ "test:watch": {
66
+ "executor": "nx:run-commands",
67
+ "dependsOn": ["^build"],
68
+ "options": {
69
+ "command": "pnpm vitest watch",
70
+ "cwd": "packages/ui-extensions-server-kit"
71
+ }
72
+ }
73
+ }
74
+ }