@shopify/cli-hydrogen 4.0.0-alpha.10 → 4.0.0-alpha.11

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 (337) hide show
  1. package/dist/commands/hydrogen/build.d.ts +23 -0
  2. package/dist/commands/hydrogen/check.d.ts +17 -0
  3. package/dist/commands/hydrogen/dev.d.ts +21 -0
  4. package/dist/commands/hydrogen/generate/route.d.ts +30 -0
  5. package/dist/commands/hydrogen/generate/route.js +21 -42
  6. package/dist/commands/hydrogen/generate/route.test.d.ts +1 -0
  7. package/dist/commands/hydrogen/init.d.ts +23 -0
  8. package/dist/commands/hydrogen/init.js +174 -21
  9. package/dist/commands/hydrogen/preview.d.ts +17 -0
  10. package/dist/create-app.d.ts +1 -0
  11. package/dist/create-app.js +4 -0
  12. package/dist/{templates → generator-templates/routes}/[robots.txt].tsx +0 -0
  13. package/dist/{templates → generator-templates/routes}/[sitemap.xml].tsx +0 -0
  14. package/dist/{templates → generator-templates/routes}/account/login.tsx +0 -0
  15. package/dist/{templates → generator-templates/routes}/account/register.tsx +0 -0
  16. package/dist/{templates → generator-templates/routes}/cart.tsx +0 -0
  17. package/dist/{templates → generator-templates/routes}/collections/$collectionHandle.tsx +0 -0
  18. package/dist/{templates → generator-templates/routes}/graphiql.tsx +0 -0
  19. package/dist/{templates → generator-templates/routes}/index.tsx +0 -0
  20. package/dist/{templates → generator-templates/routes}/pages/$pageHandle.tsx +0 -0
  21. package/dist/{templates → generator-templates/routes}/policies/$policyHandle.tsx +0 -0
  22. package/dist/{templates → generator-templates/routes}/policies/index.tsx +0 -0
  23. package/dist/{templates → generator-templates/routes}/products/$productHandle.tsx +0 -0
  24. package/dist/hooks/init.d.ts +5 -0
  25. package/dist/utils/check-lockfile.d.ts +3 -0
  26. package/dist/utils/check-version.d.ts +3 -0
  27. package/dist/utils/config.d.ts +14 -0
  28. package/dist/utils/flags.d.ts +8 -0
  29. package/dist/utils/log.d.ts +5 -0
  30. package/dist/utils/mini-oxygen.d.ts +11 -0
  31. package/dist/utils/mini-oxygen.js +4 -1
  32. package/dist/utils/missing-routes.d.ts +6 -0
  33. package/dist/utils/template-downloader.d.ts +11 -0
  34. package/dist/utils/template-downloader.js +63 -0
  35. package/dist/utils/transpile-ts.d.ts +16 -0
  36. package/dist/utils/transpile-ts.js +155 -0
  37. package/dist/utils/virtual-routes.d.ts +7 -0
  38. package/dist/utils/virtual-routes.test.d.ts +1 -0
  39. package/dist/virtual-routes/assets/dummy.d.ts +1 -0
  40. package/oclif.manifest.json +1 -1
  41. package/package.json +14 -2
  42. package/dist/templates/demo-store/.cache/content-v2/sha512/02/76/13bbea15bb42b81a204b0dc5f14726e0bfa8d012a7b284f887cc2e3c92195d6b07a78f199f990b311ca5fafa9079563503cdd81808cd9b7e496d86c72732 +0 -1
  43. package/dist/templates/demo-store/.cache/content-v2/sha512/04/98/0e81e9c8b9ebe79605df3bf2476728954d7ad01229239c4acbaaefe8e2aa6558b7a08b14cd245365258a7ef2191a7b1d656ae081cc1d129662476f547e96 +0 -1
  44. package/dist/templates/demo-store/.cache/content-v2/sha512/0d/2c/9c0b3f348e40c09b984fbb9d08a1e983e86b4ee155baf87d0fd2428689357600b1f0d71d1edcc0b7381c27eaa024e58b2b76f5a3ed14f836f0f17b0a9b0c +0 -1
  45. package/dist/templates/demo-store/.cache/content-v2/sha512/18/ed/a944ad29223f60420de387c0325270e1a26f7826a52c813bf5dd319660be2c1cf779dbd9be17aae3c9cd24baa75ddd411fd0674a0e4664b69e6115bf73ed +0 -1
  46. package/dist/templates/demo-store/.cache/content-v2/sha512/19/32/725ad9da4e9155ebe89c04ce462b0ced1a34e836fa4d0b8829baaf369979e173477fc3468eb1fc91562fbc7abef2a51dda6398a65dd490111a668d460647 +0 -1
  47. package/dist/templates/demo-store/.cache/content-v2/sha512/1e/24/595da822fb6e0d70b7a478b35192c23348911f81396b562a4c5d5ed52cf28ec3e9253496dc0e307da724bf0572b1e4c490b3c922af5b5c3ee13642b050ce +0 -1
  48. package/dist/templates/demo-store/.cache/content-v2/sha512/42/8e/b848de3b458a3ae29197f58d73db1dcd110d272982471001e4c049af15058851abe97b8671671c36918d87c97adde4c188df8648dc2f71128213dfc72dc2 +0 -1
  49. package/dist/templates/demo-store/.cache/content-v2/sha512/44/52/5bdf014389259b65ea3cf4ef77cbecdc3fe3f95487a53633fccd9dcf29e0eefcccc3a985ba720febd74aeb96e51259a3ccefc51c1c6d91f23fe362ad2bc9 +0 -1
  50. package/dist/templates/demo-store/.cache/content-v2/sha512/5c/12/8d5330d3dea4de70c4b434403ffd5c5083d7f2c2c68a2fc149bd066bc6cde6a75fcb5ab2b59772c72c108f42af3338ba95b69ab4248e1d1a7046e51607b7 +0 -1
  51. package/dist/templates/demo-store/.cache/content-v2/sha512/63/3a/fb02a5e332b2f3a90f634a25f88555704bfeaf5e371631306fcb0d0d548e3d2efd6b525bf62d54f8f0548b73cccabaa34ebb0d51e624bf67de37afb78c8c +0 -1
  52. package/dist/templates/demo-store/.cache/content-v2/sha512/73/40/c822831f11f08a9ceea944d0145b072ba6164a3e2e75f98fda5437cda6dfddf9ca9450445c1f3236228d6259ac95e4cde9bb6e5996490ed00b7b13b06121 +0 -1
  53. package/dist/templates/demo-store/.cache/content-v2/sha512/76/07/e5a2affb0d722624b151277bfa2c3cd26f1e5c0d3a11d5bb3ba745631b2e8fd1ade94990b19a6acb2805de34048a34c035406d4829bcf3f41a061b270d60 +0 -1
  54. package/dist/templates/demo-store/.cache/content-v2/sha512/86/ba/0dd1289bc16f8dda9cb229b7ffa7aa59c4bdba95e1352a0b61de02fccd726c0269d8cabeae04ffddf408f42491354e24866fe5801ee4bb1ea4b98cce482c +0 -1
  55. package/dist/templates/demo-store/.cache/content-v2/sha512/8e/7e/005894d7690ac4cc4f3301702083a6d900a8971af9f9f1b38dc4821809c3b6ed302521bfce7460c8673d38875c4187e3b9f59b5d4f4a399cc3869f5b0f55 +0 -1
  56. package/dist/templates/demo-store/.cache/content-v2/sha512/93/6b/e60098157f6bff8ba570cab2ffd97a14983109006f7fa87e4432728366f96dfb19e957d28754daa45f1b6cb2421d26ab59bbd5ce5a448d6102e8e662403d +0 -1
  57. package/dist/templates/demo-store/.cache/content-v2/sha512/95/3c/ad893b35be316318d41d6141e282cddf5d214b4c335d86498cea48f1ecf32c108a2d58f7aa4a51bdb309da5762afda4204a0551d1a203cf4e642f9669317 +0 -1
  58. package/dist/templates/demo-store/.cache/content-v2/sha512/9b/2b/829beb6526ccc7e54cfa51951fce87e756d17a2096b57011a441b2f9eb4f546e2a6cc650a872f033c5d38bb7b704b862e033212258ee5496c2c0c1cef0c8 +0 -1
  59. package/dist/templates/demo-store/.cache/content-v2/sha512/ae/9a/84c86ca2189f308cb995b8289870f41e4692da806538c67dbe3f4849718a6a7e712fa105aff5ceb5135d0eececf75ab7281e171975bf8ae1ace932046621 +0 -1
  60. package/dist/templates/demo-store/.cache/content-v2/sha512/ae/d9/a6fed1d3e4f1cd165a5a4dc633dbf277ea6cb6089b239cde32fef7d5d041590c05216207b5d6ad6b81d02865ce06b41670751940fd49c43b6bc80efc0076 +0 -1
  61. package/dist/templates/demo-store/.cache/content-v2/sha512/b1/56/584dd264cd440a690eaaaef18f8837dd5a32415fad319adbb289121c1812bcd34dfed87f66cd6ba3b4bf26bc988de0b19c32a593609e5656c9d8cfbc1b2c +0 -1
  62. package/dist/templates/demo-store/.cache/content-v2/sha512/b5/32/0a7d091d5e19d604dfc1702a81918fb1e21a5263eec2c443e1b0cc3b51d95dc894883dd5bf6851e27dfaf8566a9752d9fc24698cf77fbd692897eb0fb189 +0 -1
  63. package/dist/templates/demo-store/.cache/content-v2/sha512/bc/33/6e26ece5ac53d9eac9ac8a192ef39faf2a587a5808253c659fb1d371c477fc8074d428c8d1929b0d85dd1fec66fc79ea6b9fcb01507e2efec75fb7fbc2cc +0 -1
  64. package/dist/templates/demo-store/.cache/content-v2/sha512/d8/b5/26061c660a6fb2a2cabd1f7dcf701c984788ed6329891d8d540fa01b9b8ad4cda43fc436b61c0d76b687f1600ad46b59ea52da003b1e7edb4472f74399cb +0 -1
  65. package/dist/templates/demo-store/.cache/content-v2/sha512/e2/ab/e085c7b7942344631033fca463b3da5f58bb80e3a7f9e52140bb4ef3a46e1f10bb8aa1dbc401bec8718939075060c8acaf7a6e0b6e082f9b83f5a4590296 +0 -1
  66. package/dist/templates/demo-store/.cache/content-v2/sha512/e5/41/1521ee52031bdb29b551344ea7b79161701bfd506f12776bd0aca74255c38adae35405e44958ce8c6807f0a290e48aac6e28eb540dad3e62ae59dc487a8b +0 -1
  67. package/dist/templates/demo-store/.cache/content-v2/sha512/e8/ae/9b467e1d23913d4584d9417875b3cdc25f6dfed8b228f3a0c818129010b778aae1af1eb200b015ab428e79afe0ef1061262392fbdb96ed7da95efbe7f758 +0 -1
  68. package/dist/templates/demo-store/.cache/content-v2/sha512/ea/40/1c04ae276d1792713cf3118f13f0d73df08b3604b039412073447f7410c95a2a6567aca59d31b263cb9119085fba85d208f25b71b3c96ef151f418b7cd48 +0 -1
  69. package/dist/templates/demo-store/.cache/content-v2/sha512/ec/9a/4e2483d9a13faadd1cbcfe0ab70cdf87a838fe1cf04d11c56c478472e08f5b9e785654654d9b338c051fd762d20e23f14f2c1e110664815f1012c3ab8a08 +0 -1
  70. package/dist/templates/demo-store/.cache/content-v2/sha512/f0/62/eca4034f805cff0ae6d9c9f08128afa5e9bc40f2177b2ff2e8625187e02b6219e9b049300d2a90c7fe947873483161a8b2b040c1cd376d908a7e3e4cb8bf +0 -1
  71. package/dist/templates/demo-store/.cache/content-v2/sha512/f2/5f/9ccdef519bdb0a99e4f88d4c2c5a2acd4bf79507c81e4403263a875f093ad8d04dd863c4d610426a2974a4f95713c0cd9f29d06b294a6960c2cabffa6c42 +0 -1
  72. package/dist/templates/demo-store/.cache/content-v2/sha512/f4/ca/0f5ba83b2d5596d6f5917cab8ecedc1a457d62bf4988914f35161e4a4bd39a85030d1f69e2da82d9c2652985f7ca7c8ec2e79fe0235d534911543090b3c5 +0 -1
  73. package/dist/templates/demo-store/.cache/index-v5/05/44/bebd201ef5e9e9a7c41bd789ff110691a32c7f7fbbbdd630f33d96667cd1 +0 -2
  74. package/dist/templates/demo-store/.cache/index-v5/26/b5/113aeb17f9f4ef406a1f8b143895199ca545fd0cc1e7972435a092910963 +0 -2
  75. package/dist/templates/demo-store/.cache/index-v5/2c/09/e60b5cd818510e0cbec908aae3b74175e35e446f4383e87c21489433a11e +0 -2
  76. package/dist/templates/demo-store/.cache/index-v5/38/21/c3fb7841590b85142018ba88a01045ef1249ac34211342579f0129eae294 +0 -2
  77. package/dist/templates/demo-store/.cache/index-v5/3a/98/8858fe7de4bf85d37c71adc322cc95335b498bef9a4ae41db324bf5696cc +0 -2
  78. package/dist/templates/demo-store/.cache/index-v5/3e/40/7021422a7cae2c05484b491fb5b85edd82b325e598ac9e5c6afb858049da +0 -2
  79. package/dist/templates/demo-store/.cache/index-v5/47/2f/8e9ec62247eca3464d07de774855bb30a56145adc6525b907490e0c1bda0 +0 -2
  80. package/dist/templates/demo-store/.cache/index-v5/5e/83/14bed234cd143eaf4043de721fcf4250a5adc7008e76d663365e8a322c88 +0 -2
  81. package/dist/templates/demo-store/.cache/index-v5/5f/87/f79366b4aab5423acdda7930c6c989c49dd1c6607885df3afaa5e6873c9f +0 -2
  82. package/dist/templates/demo-store/.cache/index-v5/6e/9e/dc622ea9b5c66089a08f3e8b7a0e62a29e85bab337da0a3b28d6126185ec +0 -2
  83. package/dist/templates/demo-store/.cache/index-v5/71/4c/401eb7f3b2db5e56857a3ddd90e61181e636a5d01cc569ff8671ddf7f14b +0 -2
  84. package/dist/templates/demo-store/.cache/index-v5/79/2e/b0dd8fcd37a11ecb71cfd33184651560cabda672e55e0b244fc6f825190c +0 -2
  85. package/dist/templates/demo-store/.cache/index-v5/7b/e1/807e64f6a84e568bf9163283e9d49b77b24ff24bd8eed751d9fd94ea404a +0 -2
  86. package/dist/templates/demo-store/.cache/index-v5/85/07/e0c4be5b8442583f11be2d0b6f09171d22721437456b745eb2c977294995 +0 -2
  87. package/dist/templates/demo-store/.cache/index-v5/87/4d/89bc172664efe0dc7f86d8e67559073b2900ae079bd42ae9e3c015d38ab0 +0 -2
  88. package/dist/templates/demo-store/.cache/index-v5/8c/0d/a633a8771437b330d83eef0fdd99a81c41356b2bdc81f80ec9277f92b060 +0 -2
  89. package/dist/templates/demo-store/.cache/index-v5/a3/fc/e2e503290d165b9b0e20c6880bc23ff8ec39a440482418b5103c36be66b9 +0 -2
  90. package/dist/templates/demo-store/.cache/index-v5/a5/bc/d87ab9468457cb872d6c360f8acecd05e0f88b7239b50754f120706fabd4 +0 -2
  91. package/dist/templates/demo-store/.cache/index-v5/a5/c0/8e6e4f498a17b6198e54f204247ba544e6404b282d4ce3065d85fa69a8a4 +0 -2
  92. package/dist/templates/demo-store/.cache/index-v5/af/65/89b0c9eb41779c1658ace443604fea125c524bc95cfc71c9b6300da2dc81 +0 -2
  93. package/dist/templates/demo-store/.cache/index-v5/b2/75/51549baf010c977c70017db497fd9bd20e1efa9b658a6d52761c559f9c0b +0 -2
  94. package/dist/templates/demo-store/.cache/index-v5/bb/db/9dc2cbdcdc6ff352f9a34463a02e198aa2123a4c2e4ef37fea8b8ccae413 +0 -2
  95. package/dist/templates/demo-store/.cache/index-v5/c8/52/09bfbca72b45aec745fc339c27986edefa85e40bd69113275a6ecd6495e9 +0 -2
  96. package/dist/templates/demo-store/.cache/index-v5/d0/c4/d960260ece228d28f70e317741b3f3f3df05c53956d870235837ae2b73b4 +0 -2
  97. package/dist/templates/demo-store/.cache/index-v5/d3/ca/ff5860148f0bedafb91dab72b54462de81a32a21210324c45a051b197b48 +0 -2
  98. package/dist/templates/demo-store/.cache/index-v5/d4/55/296e80e87e2652f4cf1aebd5419fe73ef16c94ab20cd0400166d44ea1746 +0 -2
  99. package/dist/templates/demo-store/.cache/index-v5/da/7a/4b6977be684885e550a0d8fd21c955d0195371ffc3a9535a5a7b950a5ac9 +0 -2
  100. package/dist/templates/demo-store/.cache/index-v5/dd/aa/599a1cd855476ba058c63ae75a9c006ca11f7fbc2efc00b361d7f1b95cb4 +0 -2
  101. package/dist/templates/demo-store/.cache/index-v5/df/d2/bcfa3853e61309abab85dbd561dbc632ad0ea79b24f1b77c95f861eead5f +0 -2
  102. package/dist/templates/demo-store/.cache/index-v5/df/f5/cc3a1197c607eac768ab1b1cdb7b53a7f87b67c23c92da957d45a5bd0bda +0 -2
  103. package/dist/templates/demo-store/.cache/index-v5/e4/bd/743967c269ef70a14ba6b5dd223d26759eae9295d79f165c66f514b7d8d3 +0 -2
  104. package/dist/templates/demo-store/.editorconfig +0 -8
  105. package/dist/templates/demo-store/.eslintignore +0 -4
  106. package/dist/templates/demo-store/.eslintrc.js +0 -16
  107. package/dist/templates/demo-store/.graphqlrc.yml +0 -1
  108. package/dist/templates/demo-store/.prettierignore +0 -2
  109. package/dist/templates/demo-store/_env +0 -6
  110. package/dist/templates/demo-store/_gitignore +0 -9
  111. package/dist/templates/demo-store/app/components/AccountAddressBook.tsx +0 -97
  112. package/dist/templates/demo-store/app/components/AccountDetails.tsx +0 -41
  113. package/dist/templates/demo-store/app/components/AddToCartButton.tsx +0 -42
  114. package/dist/templates/demo-store/app/components/Breadcrumbs.tsx +0 -36
  115. package/dist/templates/demo-store/app/components/Button.tsx +0 -56
  116. package/dist/templates/demo-store/app/components/Cart.tsx +0 -431
  117. package/dist/templates/demo-store/app/components/CartLoading.tsx +0 -50
  118. package/dist/templates/demo-store/app/components/CountrySelector.tsx +0 -180
  119. package/dist/templates/demo-store/app/components/Drawer.tsx +0 -115
  120. package/dist/templates/demo-store/app/components/FeaturedCollections.tsx +0 -54
  121. package/dist/templates/demo-store/app/components/FeaturedProducts.tsx +0 -116
  122. package/dist/templates/demo-store/app/components/FeaturedSection.tsx +0 -36
  123. package/dist/templates/demo-store/app/components/GenericError.tsx +0 -58
  124. package/dist/templates/demo-store/app/components/Grid.tsx +0 -44
  125. package/dist/templates/demo-store/app/components/Hero.tsx +0 -129
  126. package/dist/templates/demo-store/app/components/Icon.tsx +0 -253
  127. package/dist/templates/demo-store/app/components/Input.tsx +0 -24
  128. package/dist/templates/demo-store/app/components/Layout.tsx +0 -499
  129. package/dist/templates/demo-store/app/components/Link.tsx +0 -46
  130. package/dist/templates/demo-store/app/components/Modal.tsx +0 -46
  131. package/dist/templates/demo-store/app/components/NotFound.tsx +0 -22
  132. package/dist/templates/demo-store/app/components/OrderCard.tsx +0 -82
  133. package/dist/templates/demo-store/app/components/Pagination.tsx +0 -277
  134. package/dist/templates/demo-store/app/components/ProductCard.tsx +0 -132
  135. package/dist/templates/demo-store/app/components/ProductGallery.tsx +0 -114
  136. package/dist/templates/demo-store/app/components/ProductGrid.tsx +0 -90
  137. package/dist/templates/demo-store/app/components/ProductSwimlane.tsx +0 -30
  138. package/dist/templates/demo-store/app/components/Skeleton.tsx +0 -24
  139. package/dist/templates/demo-store/app/components/SortFilter.tsx +0 -414
  140. package/dist/templates/demo-store/app/components/Text.tsx +0 -192
  141. package/dist/templates/demo-store/app/components/index.ts +0 -28
  142. package/dist/templates/demo-store/app/data/countries.ts +0 -194
  143. package/dist/templates/demo-store/app/data/fragments.ts +0 -73
  144. package/dist/templates/demo-store/app/entry.client.tsx +0 -4
  145. package/dist/templates/demo-store/app/entry.server.tsx +0 -26
  146. package/dist/templates/demo-store/app/hooks/useCartFetchers.tsx +0 -14
  147. package/dist/templates/demo-store/app/hooks/useIsHydrated.tsx +0 -12
  148. package/dist/templates/demo-store/app/lib/const.ts +0 -10
  149. package/dist/templates/demo-store/app/lib/placeholders.ts +0 -244
  150. package/dist/templates/demo-store/app/lib/session.server.ts +0 -57
  151. package/dist/templates/demo-store/app/lib/type.ts +0 -21
  152. package/dist/templates/demo-store/app/lib/utils.ts +0 -310
  153. package/dist/templates/demo-store/app/root.tsx +0 -360
  154. package/dist/templates/demo-store/app/routes/($lang)/$.tsx +0 -7
  155. package/dist/templates/demo-store/app/routes/($lang)/[sitemap.xml].tsx +0 -198
  156. package/dist/templates/demo-store/app/routes/($lang)/account/__private/address/$id.tsx +0 -417
  157. package/dist/templates/demo-store/app/routes/($lang)/account/__private/edit.tsx +0 -295
  158. package/dist/templates/demo-store/app/routes/($lang)/account/__private/logout.ts +0 -25
  159. package/dist/templates/demo-store/app/routes/($lang)/account/__private/orders.$id.tsx +0 -442
  160. package/dist/templates/demo-store/app/routes/($lang)/account/__public/activate.$id.$activationToken.tsx +0 -249
  161. package/dist/templates/demo-store/app/routes/($lang)/account/__public/login.tsx +0 -247
  162. package/dist/templates/demo-store/app/routes/($lang)/account/__public/recover.tsx +0 -160
  163. package/dist/templates/demo-store/app/routes/($lang)/account/__public/register.tsx +0 -214
  164. package/dist/templates/demo-store/app/routes/($lang)/account/__public/reset.$id.$resetToken.tsx +0 -246
  165. package/dist/templates/demo-store/app/routes/($lang)/account.tsx +0 -300
  166. package/dist/templates/demo-store/app/routes/($lang)/api/countries.tsx +0 -22
  167. package/dist/templates/demo-store/app/routes/($lang)/api/products.tsx +0 -85
  168. package/dist/templates/demo-store/app/routes/($lang)/cart.tsx +0 -510
  169. package/dist/templates/demo-store/app/routes/($lang)/collections/$collectionHandle.tsx +0 -303
  170. package/dist/templates/demo-store/app/routes/($lang)/collections/all.tsx +0 -5
  171. package/dist/templates/demo-store/app/routes/($lang)/collections/index.tsx +0 -194
  172. package/dist/templates/demo-store/app/routes/($lang)/discounts.$code.tsx +0 -60
  173. package/dist/templates/demo-store/app/routes/($lang)/featured-products.tsx +0 -58
  174. package/dist/templates/demo-store/app/routes/($lang)/index.tsx +0 -270
  175. package/dist/templates/demo-store/app/routes/($lang)/journal/$journalHandle.tsx +0 -145
  176. package/dist/templates/demo-store/app/routes/($lang)/journal/index.tsx +0 -149
  177. package/dist/templates/demo-store/app/routes/($lang)/pages/$pageHandle.tsx +0 -74
  178. package/dist/templates/demo-store/app/routes/($lang)/policies/$policyHandle.tsx +0 -116
  179. package/dist/templates/demo-store/app/routes/($lang)/policies/index.tsx +0 -92
  180. package/dist/templates/demo-store/app/routes/($lang)/products/$productHandle.tsx +0 -594
  181. package/dist/templates/demo-store/app/routes/($lang)/products/index.tsx +0 -146
  182. package/dist/templates/demo-store/app/routes/($lang)/search.tsx +0 -198
  183. package/dist/templates/demo-store/app/routes/[robots.txt].tsx +0 -40
  184. package/dist/templates/demo-store/app/styles/app.css +0 -4117
  185. package/dist/templates/demo-store/app/styles/custom-font.css +0 -13
  186. package/dist/templates/demo-store/app/styles/fonts/IBMPlexSerif-Text.woff2 +0 -0
  187. package/dist/templates/demo-store/app/styles/fonts/IBMPlexSerif-TextItalic.woff2 +0 -0
  188. package/dist/templates/demo-store/dist/client/build/_assets/IBMPlexSerif-Text-YFMZNZW6.woff2 +0 -0
  189. package/dist/templates/demo-store/dist/client/build/_assets/IBMPlexSerif-TextItalic-CS6L5H7S.woff2 +0 -0
  190. package/dist/templates/demo-store/dist/client/build/_assets/app-5V46SKC6.css +0 -1
  191. package/dist/templates/demo-store/dist/client/build/_assets/custom-font-WVPOFKHF.css +0 -1
  192. package/dist/templates/demo-store/dist/client/build/_assets/favicon-5FIZBM2K.svg +0 -28
  193. package/dist/templates/demo-store/dist/client/build/_shared/chunk-2JM6VWTP.js +0 -2
  194. package/dist/templates/demo-store/dist/client/build/_shared/chunk-2JM6VWTP.js.map +0 -7
  195. package/dist/templates/demo-store/dist/client/build/_shared/chunk-3RDIRS72.js +0 -9
  196. package/dist/templates/demo-store/dist/client/build/_shared/chunk-3RDIRS72.js.map +0 -7
  197. package/dist/templates/demo-store/dist/client/build/_shared/chunk-AYHDHSL7.js +0 -2
  198. package/dist/templates/demo-store/dist/client/build/_shared/chunk-AYHDHSL7.js.map +0 -7
  199. package/dist/templates/demo-store/dist/client/build/_shared/chunk-E5DM2WN5.js +0 -2
  200. package/dist/templates/demo-store/dist/client/build/_shared/chunk-E5DM2WN5.js.map +0 -7
  201. package/dist/templates/demo-store/dist/client/build/_shared/chunk-EGF7BKAH.js +0 -31
  202. package/dist/templates/demo-store/dist/client/build/_shared/chunk-EGF7BKAH.js.map +0 -7
  203. package/dist/templates/demo-store/dist/client/build/_shared/chunk-MEPKJ2VW.js +0 -2
  204. package/dist/templates/demo-store/dist/client/build/_shared/chunk-MEPKJ2VW.js.map +0 -7
  205. package/dist/templates/demo-store/dist/client/build/_shared/chunk-N73MA4O3.js +0 -72
  206. package/dist/templates/demo-store/dist/client/build/_shared/chunk-N73MA4O3.js.map +0 -7
  207. package/dist/templates/demo-store/dist/client/build/_shared/chunk-S5VPOIXA.js +0 -2
  208. package/dist/templates/demo-store/dist/client/build/_shared/chunk-S5VPOIXA.js.map +0 -7
  209. package/dist/templates/demo-store/dist/client/build/_shared/chunk-SJXYTHYC.js +0 -7
  210. package/dist/templates/demo-store/dist/client/build/_shared/chunk-SJXYTHYC.js.map +0 -7
  211. package/dist/templates/demo-store/dist/client/build/_shared/chunk-W7NVY25S.js +0 -25
  212. package/dist/templates/demo-store/dist/client/build/_shared/chunk-W7NVY25S.js.map +0 -7
  213. package/dist/templates/demo-store/dist/client/build/_shared/chunk-YU4DAQHP.js +0 -2
  214. package/dist/templates/demo-store/dist/client/build/_shared/chunk-YU4DAQHP.js.map +0 -7
  215. package/dist/templates/demo-store/dist/client/build/_shared/log-seo-tags-3MQL2PTY-EVG3H53P.js +0 -2
  216. package/dist/templates/demo-store/dist/client/build/_shared/log-seo-tags-3MQL2PTY-EVG3H53P.js.map +0 -7
  217. package/dist/templates/demo-store/dist/client/build/entry.client-OO4LDNWK.js +0 -2
  218. package/dist/templates/demo-store/dist/client/build/entry.client-OO4LDNWK.js.map +0 -7
  219. package/dist/templates/demo-store/dist/client/build/manifest-1AF0BBA5.js +0 -1
  220. package/dist/templates/demo-store/dist/client/build/root-FV6LPUDT.js +0 -3
  221. package/dist/templates/demo-store/dist/client/build/root-FV6LPUDT.js.map +0 -7
  222. package/dist/templates/demo-store/dist/client/build/routes/($lang)/$-HDBACFGJ.js +0 -2
  223. package/dist/templates/demo-store/dist/client/build/routes/($lang)/$-HDBACFGJ.js.map +0 -7
  224. package/dist/templates/demo-store/dist/client/build/routes/($lang)/[sitemap.xml]-AAQRJL2R.js +0 -2
  225. package/dist/templates/demo-store/dist/client/build/routes/($lang)/[sitemap.xml]-AAQRJL2R.js.map +0 -7
  226. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/address/$id-EQYOPKPY.js +0 -2
  227. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/address/$id-EQYOPKPY.js.map +0 -7
  228. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/edit-YM3NVGDL.js +0 -2
  229. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/edit-YM3NVGDL.js.map +0 -7
  230. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/logout-7KXWFBCX.js +0 -2
  231. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/logout-7KXWFBCX.js.map +0 -7
  232. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/orders.$id-QODJFNZS.js +0 -2
  233. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/orders.$id-QODJFNZS.js.map +0 -7
  234. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/activate.$id.$activationToken-VQ76BWT7.js +0 -2
  235. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/activate.$id.$activationToken-VQ76BWT7.js.map +0 -7
  236. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/login-IRZTYHQF.js +0 -2
  237. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/login-IRZTYHQF.js.map +0 -7
  238. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/recover-4VLNDEUK.js +0 -2
  239. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/recover-4VLNDEUK.js.map +0 -7
  240. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/register-6GG4XAMH.js +0 -2
  241. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/register-6GG4XAMH.js.map +0 -7
  242. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/reset.$id.$resetToken-SIXY5J2S.js +0 -2
  243. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/reset.$id.$resetToken-SIXY5J2S.js.map +0 -7
  244. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account-G7FQFZFP.js +0 -2
  245. package/dist/templates/demo-store/dist/client/build/routes/($lang)/account-G7FQFZFP.js.map +0 -7
  246. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/countries-UD6BGYL2.js +0 -2
  247. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/countries-UD6BGYL2.js.map +0 -7
  248. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/products-Y2SK2JNE.js +0 -18
  249. package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/products-Y2SK2JNE.js.map +0 -7
  250. package/dist/templates/demo-store/dist/client/build/routes/($lang)/cart-TFONAIOG.js +0 -55
  251. package/dist/templates/demo-store/dist/client/build/routes/($lang)/cart-TFONAIOG.js.map +0 -7
  252. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/$collectionHandle-HSKYTXMD.js +0 -83
  253. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/$collectionHandle-HSKYTXMD.js.map +0 -7
  254. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/all-IXDFOKCK.js +0 -2
  255. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/all-IXDFOKCK.js.map +0 -7
  256. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/index-RXXMMLNQ.js +0 -2
  257. package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/index-RXXMMLNQ.js.map +0 -7
  258. package/dist/templates/demo-store/dist/client/build/routes/($lang)/discounts.$code-GYKQBNLQ.js +0 -2
  259. package/dist/templates/demo-store/dist/client/build/routes/($lang)/discounts.$code-GYKQBNLQ.js.map +0 -7
  260. package/dist/templates/demo-store/dist/client/build/routes/($lang)/featured-products-KNUST6DD.js +0 -2
  261. package/dist/templates/demo-store/dist/client/build/routes/($lang)/featured-products-KNUST6DD.js.map +0 -7
  262. package/dist/templates/demo-store/dist/client/build/routes/($lang)/index-DZYZ23DT.js +0 -59
  263. package/dist/templates/demo-store/dist/client/build/routes/($lang)/index-DZYZ23DT.js.map +0 -7
  264. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/$journalHandle-BFPXMHRY.js +0 -2
  265. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/$journalHandle-BFPXMHRY.js.map +0 -7
  266. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/index-TVV6RNDT.js +0 -2
  267. package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/index-TVV6RNDT.js.map +0 -7
  268. package/dist/templates/demo-store/dist/client/build/routes/($lang)/pages/$pageHandle-2JU4FDNU.js +0 -2
  269. package/dist/templates/demo-store/dist/client/build/routes/($lang)/pages/$pageHandle-2JU4FDNU.js.map +0 -7
  270. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/$policyHandle-B2JUECEA.js +0 -2
  271. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/$policyHandle-B2JUECEA.js.map +0 -7
  272. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/index-DKYSL4RX.js +0 -2
  273. package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/index-DKYSL4RX.js.map +0 -7
  274. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/$productHandle-CSUUFYMX.js +0 -102
  275. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/$productHandle-CSUUFYMX.js.map +0 -7
  276. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/index-VAQVPD22.js +0 -24
  277. package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/index-VAQVPD22.js.map +0 -7
  278. package/dist/templates/demo-store/dist/client/build/routes/($lang)/search-UVGUQAJG.js +0 -54
  279. package/dist/templates/demo-store/dist/client/build/routes/($lang)/search-UVGUQAJG.js.map +0 -7
  280. package/dist/templates/demo-store/dist/client/build/routes/[robots.txt]-YG62MDLB.js +0 -2
  281. package/dist/templates/demo-store/dist/client/build/routes/[robots.txt]-YG62MDLB.js.map +0 -7
  282. package/dist/templates/demo-store/dist/client/favicon.svg +0 -28
  283. package/dist/templates/demo-store/dist/worker/_assets/IBMPlexSerif-Text-YFMZNZW6.woff2 +0 -0
  284. package/dist/templates/demo-store/dist/worker/_assets/IBMPlexSerif-TextItalic-CS6L5H7S.woff2 +0 -0
  285. package/dist/templates/demo-store/dist/worker/index.js +0 -1352
  286. package/dist/templates/demo-store/dist/worker/index.js.map +0 -7
  287. package/dist/templates/demo-store/package.json +0 -64
  288. package/dist/templates/demo-store/postcss.config.js +0 -10
  289. package/dist/templates/demo-store/public/favicon.svg +0 -28
  290. package/dist/templates/demo-store/remix.env.d.ts +0 -40
  291. package/dist/templates/demo-store/remix.init/index.js +0 -25
  292. package/dist/templates/demo-store/remix.init/package.json +0 -7
  293. package/dist/templates/demo-store/server.ts +0 -73
  294. package/dist/templates/demo-store/styles/app.css +0 -182
  295. package/dist/templates/demo-store/tailwind.config.js +0 -70
  296. package/dist/templates/demo-store/tsconfig.json +0 -25
  297. package/dist/templates/hello-world/.cache/content-v2/sha512/13/4d/016017e6bcf9be61273229516bd898b7df8dad06121807f9b80f1e2acca7e9790dcc476d08b81a899d8d29d38331b4a459d66f3c7f9dc4303ca2fcc167b7 +0 -1
  298. package/dist/templates/hello-world/.cache/content-v2/sha512/99/79/957d59c381e42c01e473b69a7befabebff88d7ae53269b038a7aca4993e3e773e6a1144223532f089df44c4d866af69317389a969681566e3e71ef5e023c +0 -1
  299. package/dist/templates/hello-world/.cache/index-v5/09/f6/fe4b05c4157320b8b59b3f84116195be0437d87357d743d21acd638a4606 +0 -2
  300. package/dist/templates/hello-world/.cache/index-v5/d0/c4/d960260ece228d28f70e317741b3f3f3df05c53956d870235837ae2b73b4 +0 -2
  301. package/dist/templates/hello-world/.eslintignore +0 -4
  302. package/dist/templates/hello-world/.eslintrc.js +0 -6
  303. package/dist/templates/hello-world/.graphqlrc.yml +0 -1
  304. package/dist/templates/hello-world/README.md +0 -20
  305. package/dist/templates/hello-world/_env +0 -6
  306. package/dist/templates/hello-world/_gitignore +0 -8
  307. package/dist/templates/hello-world/app/components/Layout.tsx +0 -43
  308. package/dist/templates/hello-world/app/components/index.ts +0 -1
  309. package/dist/templates/hello-world/app/entry.client.tsx +0 -4
  310. package/dist/templates/hello-world/app/entry.server.tsx +0 -21
  311. package/dist/templates/hello-world/app/root.tsx +0 -104
  312. package/dist/templates/hello-world/app/routes/index.tsx +0 -16
  313. package/dist/templates/hello-world/app/styles/app.css +0 -38
  314. package/dist/templates/hello-world/dist/client/build/_assets/app-NBPUE4H5.css +0 -1
  315. package/dist/templates/hello-world/dist/client/build/_assets/favicon-5FIZBM2K.svg +0 -28
  316. package/dist/templates/hello-world/dist/client/build/_shared/chunk-AEML26BQ.js +0 -31
  317. package/dist/templates/hello-world/dist/client/build/_shared/chunk-AEML26BQ.js.map +0 -7
  318. package/dist/templates/hello-world/dist/client/build/_shared/chunk-RKJPHUBS.js +0 -2
  319. package/dist/templates/hello-world/dist/client/build/_shared/chunk-RKJPHUBS.js.map +0 -7
  320. package/dist/templates/hello-world/dist/client/build/entry.client-ZGMV2YX5.js +0 -9
  321. package/dist/templates/hello-world/dist/client/build/entry.client-ZGMV2YX5.js.map +0 -7
  322. package/dist/templates/hello-world/dist/client/build/manifest-8ABA8B0B.js +0 -1
  323. package/dist/templates/hello-world/dist/client/build/root-HK7BXYY5.js +0 -2
  324. package/dist/templates/hello-world/dist/client/build/root-HK7BXYY5.js.map +0 -7
  325. package/dist/templates/hello-world/dist/client/build/routes/index-YNIEU6B3.js +0 -2
  326. package/dist/templates/hello-world/dist/client/build/routes/index-YNIEU6B3.js.map +0 -7
  327. package/dist/templates/hello-world/dist/client/favicon.svg +0 -28
  328. package/dist/templates/hello-world/dist/worker/index.js +0 -68
  329. package/dist/templates/hello-world/dist/worker/index.js.map +0 -7
  330. package/dist/templates/hello-world/package.json +0 -42
  331. package/dist/templates/hello-world/public/favicon.svg +0 -28
  332. package/dist/templates/hello-world/remix.env.d.ts +0 -35
  333. package/dist/templates/hello-world/remix.init/index.js +0 -25
  334. package/dist/templates/hello-world/remix.init/package.json +0 -7
  335. package/dist/templates/hello-world/server.ts +0 -129
  336. package/dist/templates/hello-world/tsconfig.json +0 -25
  337. package/dist/tmp-create-app.js +0 -33
@@ -0,0 +1,23 @@
1
+ import * as _oclif_core_lib_interfaces_parser_js from '@oclif/core/lib/interfaces/parser.js';
2
+ import Command from '@shopify/cli-kit/node/base-command';
3
+
4
+ declare class Build extends Command {
5
+ static description: string;
6
+ static flags: {
7
+ sourcemap: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
8
+ entry: _oclif_core_lib_interfaces_parser_js.OptionFlag<string>;
9
+ disableRouteWarning: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
10
+ path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
11
+ port: _oclif_core_lib_interfaces_parser_js.OptionFlag<number>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
15
+ declare function runBuild({ entry, path: appPath, sourcemap, disableRouteWarning, }: {
16
+ entry: string;
17
+ path?: string;
18
+ sourcemap?: boolean;
19
+ disableRouteWarning?: boolean;
20
+ }): Promise<void>;
21
+ declare function copyPublicFiles(publicPath: string, buildPathClient: string): Promise<void>;
22
+
23
+ export { copyPublicFiles, Build as default, runBuild };
@@ -0,0 +1,17 @@
1
+ import * as _oclif_core_lib_interfaces_parser_js from '@oclif/core/lib/interfaces/parser.js';
2
+ import Command from '@shopify/cli-kit/node/base-command';
3
+
4
+ declare class GenerateRoute extends Command {
5
+ static flags: {
6
+ path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
7
+ };
8
+ static args: {
9
+ name: string;
10
+ description: string;
11
+ required: boolean;
12
+ options: string[];
13
+ }[];
14
+ run(): Promise<void>;
15
+ }
16
+
17
+ export { GenerateRoute as default };
@@ -0,0 +1,21 @@
1
+ import * as _oclif_core_lib_interfaces_parser_js from '@oclif/core/lib/interfaces/parser.js';
2
+ import Command from '@shopify/cli-kit/node/base-command';
3
+
4
+ declare class Dev extends Command {
5
+ static description: string;
6
+ static flags: {
7
+ port: _oclif_core_lib_interfaces_parser_js.OptionFlag<number>;
8
+ entry: _oclif_core_lib_interfaces_parser_js.OptionFlag<string>;
9
+ disableVirtualRoutes: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
10
+ path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
14
+ declare function runDev({ entry, port, path: appPath, disableVirtualRoutes, }: {
15
+ entry: string;
16
+ port?: number;
17
+ path?: string;
18
+ disableVirtualRoutes?: boolean;
19
+ }): Promise<void>;
20
+
21
+ export { Dev as default, runDev };
@@ -0,0 +1,30 @@
1
+ import * as _oclif_core_lib_interfaces_parser_js from '@oclif/core/lib/interfaces/parser.js';
2
+ import Command from '@shopify/cli-kit/node/base-command';
3
+
4
+ interface Result {
5
+ operation: 'generated' | 'skipped' | 'overwritten';
6
+ }
7
+ declare class GenerateRoute extends Command {
8
+ static flags: {
9
+ path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
10
+ adapter: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
11
+ force: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
12
+ };
13
+ static args: {
14
+ name: string;
15
+ description: string;
16
+ required: boolean;
17
+ options: string[];
18
+ env: string;
19
+ }[];
20
+ run(): Promise<void>;
21
+ }
22
+ declare function runGenerate(route: string, { directory, typescript, force, adapter, templatesRoot, }: {
23
+ directory: string;
24
+ typescript?: boolean;
25
+ force?: boolean;
26
+ adapter?: string;
27
+ templatesRoot?: string;
28
+ }): Promise<Result>;
29
+
30
+ export { GenerateRoute as default, runGenerate };
@@ -1,10 +1,10 @@
1
1
  import Command from '@shopify/cli-kit/node/base-command';
2
- import { path, error, file, ui } from '@shopify/cli-kit';
2
+ import { path, file, ui } from '@shopify/cli-kit';
3
+ import { AbortError } from '@shopify/cli-kit/node/error';
3
4
  import { renderSuccess } from '@shopify/cli-kit/node/ui';
4
5
  import { commonFlags } from '../../../utils/flags.js';
5
6
  import Flags from '@oclif/core/lib/flags.js';
6
- import ts from 'typescript';
7
- import prettier from 'prettier';
7
+ import { transpileFile, format, resolvePrettierConfig } from '../../../utils/transpile-ts.js';
8
8
 
9
9
  const ROUTE_MAP = {
10
10
  page: "/pages/$pageHandle",
@@ -46,7 +46,7 @@ class GenerateRoute extends Command {
46
46
  const { route } = args;
47
47
  const routePath = route === "all" ? Object.values(ROUTE_MAP).flat() : ROUTE_MAP[route];
48
48
  if (!routePath) {
49
- throw new error.Abort(
49
+ throw new AbortError(
50
50
  `No template generator found for ${route}. Try one of ${ROUTES.join()}`
51
51
  );
52
52
  }
@@ -67,7 +67,7 @@ class GenerateRoute extends Command {
67
67
  );
68
68
  }
69
69
  } catch (err) {
70
- throw new error.Abort(err.message);
70
+ throw new AbortError(err.message);
71
71
  }
72
72
  const extension = isTypescript ? ".tsx" : ".jsx";
73
73
  const success = Array.from(result.values()).filter(
@@ -90,7 +90,12 @@ async function runGenerate(route, {
90
90
  templatesRoot = new URL("../../../", import.meta.url).pathname
91
91
  }) {
92
92
  const extension = typescript ? ".tsx" : ".jsx";
93
- const templatePath = path.join(templatesRoot, "templates", `${route}.tsx`);
93
+ const templatePath = path.join(
94
+ templatesRoot,
95
+ "generator-templates",
96
+ "routes",
97
+ `${route}.tsx`
98
+ );
94
99
  const destinationPath = path.join(
95
100
  directory,
96
101
  "app",
@@ -119,20 +124,11 @@ async function runGenerate(route, {
119
124
  }
120
125
  let templateContent = await file.read(templatePath);
121
126
  if (!typescript) {
122
- const config = await file.exists(path.join(directory, "jsconfig.json")) ? await import(path.join(directory, "jsconfig.json")) : {
123
- lib: ["DOM", "DOM.Iterable", "ES2022"],
124
- isolatedModules: true,
125
- esModuleInterop: true,
126
- resolveJsonModule: true,
127
- target: "ES2022",
128
- strict: true,
129
- allowJs: true,
130
- forceConsistentCasingInFileNames: true,
131
- skipLibCheck: true
132
- };
133
- const withArtificialNewLines = escapeNewLines(templateContent);
134
- const compiled = compile(withArtificialNewLines, config);
135
- templateContent = restoreNewLines(compiled.outputText);
127
+ const jsConfigPath = path.join(directory, "jsconfig.json");
128
+ const config = await file.exists(jsConfigPath) ? JSON.parse(
129
+ await (await file.read(jsConfigPath, { encoding: "utf8" })).replace(/^\s*\/\/.*$/gm, "")
130
+ ) : void 0;
131
+ templateContent = transpileFile(templateContent, config?.compilerOptions);
136
132
  }
137
133
  if (adapter) {
138
134
  templateContent = templateContent.replace(
@@ -140,7 +136,11 @@ async function runGenerate(route, {
140
136
  adapter
141
137
  );
142
138
  }
143
- templateContent = await format(templateContent, destinationPath);
139
+ templateContent = format(
140
+ templateContent,
141
+ await resolvePrettierConfig(destinationPath),
142
+ destinationPath
143
+ );
144
144
  if (!await file.exists(path.dirname(destinationPath))) {
145
145
  await file.mkdir(path.dirname(destinationPath));
146
146
  }
@@ -149,26 +149,5 @@ async function runGenerate(route, {
149
149
  operation: "generated"
150
150
  };
151
151
  }
152
- const escapeNewLines = (code) => code.replace(/\n\n/g, "\n/* :newline: */");
153
- const restoreNewLines = (code) => code.replace(/\/\* :newline: \*\//g, "\n");
154
- function compile(code, options = {}) {
155
- return ts.transpileModule(code, {
156
- reportDiagnostics: false,
157
- compilerOptions: {
158
- ...options,
159
- jsx: 1,
160
- removeComments: false
161
- }
162
- });
163
- }
164
- async function format(content, filePath) {
165
- const config = await prettier.resolveConfig(filePath) || {};
166
- const ext = path.extname(filePath);
167
- const formattedContent = await prettier.format(content, {
168
- parser: ext === ".tsx" || ext === ".ts" ? "typescript" : "babel",
169
- ...config
170
- });
171
- return formattedContent;
172
- }
173
152
 
174
153
  export { GenerateRoute as default, runGenerate };
@@ -0,0 +1,23 @@
1
+ import * as _oclif_core_lib_interfaces_parser_js from '@oclif/core/lib/interfaces/parser.js';
2
+ import Command from '@shopify/cli-kit/node/base-command';
3
+
4
+ declare class Init extends Command {
5
+ static description: string;
6
+ static flags: {
7
+ language: _oclif_core_lib_interfaces_parser_js.OptionFlag<string>;
8
+ path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
9
+ template: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
10
+ token: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
11
+ force: _oclif_core_lib_interfaces_parser_js.BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
15
+ declare function runInit(options?: {
16
+ path?: string;
17
+ template?: string;
18
+ language?: string;
19
+ token?: string;
20
+ force?: boolean;
21
+ }): Promise<void>;
22
+
23
+ export { Init as default, runInit };
@@ -1,21 +1,37 @@
1
1
  import Command from '@shopify/cli-kit/node/base-command';
2
+ import { packageManagerUsedForCreating, installNodeModules } from '@shopify/cli-kit/node/node-package-manager';
3
+ import { renderFatalError } from '@shopify/cli-kit/node/ui';
2
4
  import Flags from '@oclif/core/lib/flags.js';
5
+ import { output, path } from '@shopify/cli-kit';
6
+ import fs from 'fs-extra';
7
+ import { transpileProject } from '../../utils/transpile-ts.js';
8
+ import { getLatestTemplates } from '../../utils/template-downloader.js';
3
9
 
4
10
  class Init extends Command {
5
11
  static description = "Creates a new Hydrogen storefront project";
6
12
  static flags = {
7
- typescript: Flags.boolean({
8
- description: "Use TypeScript",
9
- env: "SHOPIFY_HYDROGEN_FLAG_TYPESCRIPT"
13
+ language: Flags.string({
14
+ description: "Language to use for the project",
15
+ choices: ["js", "ts"],
16
+ default: "js",
17
+ env: "SHOPIFY_HYDROGEN_FLAG_LANGUAGE"
18
+ }),
19
+ path: Flags.string({
20
+ description: "The path to create the project in",
21
+ env: "SHOPIFY_HYDROGEN_FLAG_PATH"
10
22
  }),
11
23
  template: Flags.string({
12
24
  description: "The template to use",
13
- env: "SHOPIFY_HYDROGEN_FLAG_TEMPLATE",
14
- default: "../../templates/demo-store",
15
- required: true
25
+ env: "SHOPIFY_HYDROGEN_FLAG_TEMPLATE"
16
26
  }),
17
27
  token: Flags.string({
18
- description: "A GitHub token used to access access private repository templates"
28
+ description: "A GitHub token used to access access private repository templates",
29
+ env: "SHOPIFY_HYDROGEN_FLAG_TOKEN"
30
+ }),
31
+ force: Flags.boolean({
32
+ description: "Overwrite the destination directory if it already exists",
33
+ env: "SHOPIFY_HYDROGEN_FLAG_FORCE",
34
+ char: "f"
19
35
  })
20
36
  };
21
37
  async run() {
@@ -23,20 +39,157 @@ class Init extends Command {
23
39
  await runInit({ ...flags });
24
40
  }
25
41
  }
26
- async function runInit({
27
- template,
28
- typescript,
29
- token
30
- }) {
31
- const defaults = [
32
- "--template",
33
- template,
34
- "--install",
35
- typescript ? "--typescript" : "--no-typescript",
36
- token ? `--token ${token}` : ""
37
- ];
38
- const { cli } = await import('@remix-run/dev');
39
- cli.run(["create", ...defaults]);
42
+ async function runInit(options = getProcessFlags()) {
43
+ supressNodeExperimentalWarnings();
44
+ const templatesPromise = getLatestTemplates().catch((error) => {
45
+ output.info("\n\n\n");
46
+ renderFatalError(error);
47
+ process.exit(1);
48
+ });
49
+ const { ui } = await import('@shopify/cli-kit');
50
+ const { renderSuccess, renderInfo } = await import('@shopify/cli-kit/node/ui');
51
+ const prompts = [];
52
+ if (!options.template) {
53
+ prompts.push({
54
+ type: "select",
55
+ name: "template",
56
+ message: "Choose a template",
57
+ choices: ["hello-world", "demo-store"].map((value) => ({
58
+ name: value.replace(/-/g, " ").replace(/\b\w/g, (l) => l.toUpperCase()),
59
+ value
60
+ }))
61
+ });
62
+ }
63
+ if (!options.language) {
64
+ prompts.push({
65
+ type: "select",
66
+ name: "language",
67
+ message: "Choose a language",
68
+ choices: [
69
+ { name: "JavaScript", value: "js" },
70
+ { name: "TypeScript", value: "ts" }
71
+ ],
72
+ default: "js"
73
+ });
74
+ }
75
+ if (!options.path) {
76
+ prompts.push({
77
+ type: "input",
78
+ name: "path",
79
+ message: "Where would you like to create your app?",
80
+ default: "hydrogen-storefront"
81
+ });
82
+ }
83
+ const {
84
+ path: location = options.path,
85
+ template: appTemplate = options.template,
86
+ language = options.language ?? "js"
87
+ } = prompts.length > 0 ? await ui.prompt(prompts) : options;
88
+ const projectName = path.basename(location);
89
+ const projectDir = path.resolve(process.cwd(), location);
90
+ if (await projectExists(projectDir)) {
91
+ if (!options.force) {
92
+ const { deleteFiles } = await ui.prompt([
93
+ {
94
+ type: "select",
95
+ name: "deleteFiles",
96
+ message: `${location} is not an empty directory. Do you want to delete the existing files and continue?`,
97
+ choices: [
98
+ { name: "Yes, delete the files", value: "true" },
99
+ { name: "No, do not delete the files", value: "false" }
100
+ ],
101
+ default: "false"
102
+ }
103
+ ]);
104
+ if (deleteFiles === "false") {
105
+ renderInfo({
106
+ headline: `Destination path ${location} already exists and is not an empty directory. You may use \`--force\` or \`-f\` to override it.`
107
+ });
108
+ return;
109
+ }
110
+ }
111
+ await fs.remove(projectDir);
112
+ }
113
+ let downloaded = false;
114
+ setTimeout(
115
+ () => !downloaded && output.info("\n\u{1F4E5} Downloading templates..."),
116
+ 150
117
+ );
118
+ const { templatesDir } = await templatesPromise;
119
+ downloaded = true;
120
+ await fs.copy(path.join(templatesDir, appTemplate), projectDir);
121
+ if (language === "js") {
122
+ try {
123
+ await transpileProject(projectDir);
124
+ } catch (error) {
125
+ await fs.rmdir(projectDir);
126
+ throw error;
127
+ }
128
+ }
129
+ let depsInstalled = false;
130
+ let packageManager = await packageManagerUsedForCreating();
131
+ if (packageManager !== "unknown") {
132
+ const { installDeps } = await ui.prompt([
133
+ {
134
+ type: "select",
135
+ name: "installDeps",
136
+ message: `Do you want to install dependencies with ${packageManager} for ${projectName}?`,
137
+ choices: [
138
+ { name: "Yes, install the dependencies", value: "true" },
139
+ { name: "No, I'll do it myself", value: "false" }
140
+ ],
141
+ default: "true"
142
+ }
143
+ ]);
144
+ if (installDeps === "true") {
145
+ await installNodeModules({
146
+ directory: projectDir,
147
+ packageManager,
148
+ args: [],
149
+ stdout: process.stdout,
150
+ stderr: process.stderr
151
+ });
152
+ depsInstalled = true;
153
+ }
154
+ } else {
155
+ packageManager = "npm";
156
+ }
157
+ renderSuccess({
158
+ headline: `${projectName} is ready to build.`,
159
+ nextSteps: [
160
+ `Run \`cd ${location}\`${depsInstalled ? "" : `, \`${packageManager} install\`,`} and \`${packageManager + (packageManager === "npm" ? " run" : "")} dev\` to start your local development server and start building.`
161
+ ],
162
+ reference: [
163
+ "Building with Hydrogen: https://shopify.dev/custom-storefronts/hydrogen"
164
+ ]
165
+ });
166
+ renderInfo({
167
+ headline: `Your project will display inventory from the Hydrogen Demo Store.`,
168
+ body: `To connect this project to your Shopify store\u2019s inventory, update \`${projectName}/.env\` with your store ID and Storefront API key.`
169
+ });
170
+ }
171
+ async function projectExists(projectDir) {
172
+ return await fs.pathExists(projectDir) && (await fs.stat(projectDir)).isDirectory() && (await fs.readdir(projectDir)).length > 0;
173
+ }
174
+ function getProcessFlags() {
175
+ const flagMap = { f: "force" };
176
+ const [, , ...flags] = process.argv;
177
+ return flags.reduce((acc, flag) => {
178
+ const [key, value = true] = flag.replace(/^\-+/, "").split("=");
179
+ const mappedKey = flagMap[key] || key;
180
+ return { ...acc, [mappedKey]: value };
181
+ }, {});
182
+ }
183
+ function supressNodeExperimentalWarnings() {
184
+ const warningListener = process.listeners("warning")[0];
185
+ if (warningListener) {
186
+ process.removeAllListeners("warning");
187
+ process.prependListener("warning", (warning) => {
188
+ if (warning.name != "ExperimentalWarning") {
189
+ warningListener(warning);
190
+ }
191
+ });
192
+ }
40
193
  }
41
194
 
42
195
  export { Init as default, runInit };
@@ -0,0 +1,17 @@
1
+ import * as _oclif_core_lib_interfaces_parser_js from '@oclif/core/lib/interfaces/parser.js';
2
+ import Command from '@shopify/cli-kit/node/base-command';
3
+
4
+ declare class Preview extends Command {
5
+ static description: string;
6
+ static flags: {
7
+ paths: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
8
+ port: _oclif_core_lib_interfaces_parser_js.OptionFlag<number>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
12
+ declare function runPreview({ port, path: appPath, }: {
13
+ port?: number;
14
+ path?: string;
15
+ }): Promise<void>;
16
+
17
+ export { Preview as default, runPreview };
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runInit } from './commands/hydrogen/init.js';
3
+
4
+ runInit();
@@ -0,0 +1,5 @@
1
+ import { Hook } from '@oclif/core';
2
+
3
+ declare const hook: Hook<'init'>;
4
+
5
+ export { hook as default };
@@ -0,0 +1,3 @@
1
+ declare function checkLockfileStatus(directory: string): Promise<void>;
2
+
3
+ export { checkLockfileStatus };
@@ -0,0 +1,3 @@
1
+ declare function checkHydrogenVersion(directory: string): Promise<(() => void) | undefined>;
2
+
3
+ export { checkHydrogenVersion };
@@ -0,0 +1,14 @@
1
+ import * as _remix_run_dev_dist_config_js from '@remix-run/dev/dist/config.js';
2
+ import { ServerMode } from '@remix-run/dev/dist/config/serverModes.js';
3
+
4
+ declare function getProjectPaths(appPath?: string, entry?: string): {
5
+ root: string;
6
+ entryFile: string;
7
+ buildPath: string;
8
+ buildPathClient: string;
9
+ buildPathWorkerFile: string;
10
+ publicPath: string;
11
+ };
12
+ declare function getRemixConfig(root: string, entryFile: string, publicPath: string, mode?: ServerMode): Promise<_remix_run_dev_dist_config_js.RemixConfig>;
13
+
14
+ export { getProjectPaths, getRemixConfig };
@@ -0,0 +1,8 @@
1
+ import * as _oclif_core_lib_interfaces_parser_js from '@oclif/core/lib/interfaces/parser.js';
2
+
3
+ declare const commonFlags: {
4
+ path: _oclif_core_lib_interfaces_parser_js.OptionFlag<string | undefined>;
5
+ port: _oclif_core_lib_interfaces_parser_js.OptionFlag<number>;
6
+ };
7
+
8
+ export { commonFlags };
@@ -0,0 +1,5 @@
1
+ declare function muteDevLogs({ workerReload }?: {
2
+ workerReload?: boolean;
3
+ }): void;
4
+
5
+ export { muteDevLogs };
@@ -0,0 +1,11 @@
1
+ type MiniOxygenOptions = {
2
+ root: string;
3
+ port?: number;
4
+ watch?: boolean;
5
+ buildPathClient: string;
6
+ buildPathWorkerFile: string;
7
+ };
8
+ declare function startMiniOxygen({ root, port, watch, buildPathWorkerFile, buildPathClient, }: MiniOxygenOptions): Promise<void>;
9
+ declare function logResponse(request: Request, response: Response): void;
10
+
11
+ export { logResponse, startMiniOxygen };
@@ -24,7 +24,10 @@ async function startMiniOxygen({
24
24
  log: () => {
25
25
  },
26
26
  buildWatchPaths: watch ? [path.resolve(root, buildPathWorkerFile)] : void 0,
27
- onResponse: (request, response) => logResponse(request, response)
27
+ onResponse: (request, response) => logResponse(
28
+ request,
29
+ response
30
+ )
28
31
  });
29
32
  const listeningAt = `http://localhost:${actualPort}`;
30
33
  output.info(
@@ -0,0 +1,6 @@
1
+ import { RemixConfig } from '@remix-run/dev/dist/config.js';
2
+
3
+ declare function findMissingRoutes(config: RemixConfig): string[];
4
+ declare function logMissingRoutes(routes: string[]): void;
5
+
6
+ export { findMissingRoutes, logMissingRoutes };
@@ -0,0 +1,11 @@
1
+ declare function getLatestReleaseDownloadUrl(): Promise<{
2
+ version: string;
3
+ url: string;
4
+ }>;
5
+ declare function downloadTarball(url: string, storageDir: string): Promise<void>;
6
+ declare function getLatestTemplates(): Promise<{
7
+ version: string;
8
+ templatesDir: string;
9
+ }>;
10
+
11
+ export { downloadTarball, getLatestReleaseDownloadUrl, getLatestTemplates };
@@ -0,0 +1,63 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { Readable } from 'stream';
4
+ import { pipeline } from 'stream/promises';
5
+ import gunzipMaybe from 'gunzip-maybe';
6
+ import { extract } from 'tar-fs';
7
+
8
+ const REPO_RELEASES_URL = `https://api.github.com/repos/shopify/h2/releases/latest`;
9
+ async function getLatestReleaseDownloadUrl() {
10
+ const response = await fetch(REPO_RELEASES_URL);
11
+ if (!response.ok || response.status >= 400) {
12
+ throw new Error(
13
+ `Failed to fetch the latest release information. Status ${response.status} ${response.statusText}}`
14
+ );
15
+ }
16
+ const release = await response.json();
17
+ return {
18
+ version: release.name.split("/").pop() ?? release.name,
19
+ url: release.tarball_url
20
+ };
21
+ }
22
+ async function downloadTarball(url, storageDir) {
23
+ const response = await fetch(url);
24
+ if (!response.ok || response.status >= 400) {
25
+ throw new Error(
26
+ `Failed to download the latest release files. Status ${response.status} ${response.statusText}}`
27
+ );
28
+ }
29
+ await pipeline(
30
+ Readable.fromWeb(response.body),
31
+ gunzipMaybe(),
32
+ extract(storageDir, {
33
+ strip: 1,
34
+ filter: (name, header) => !name.replace(storageDir, "").startsWith("/templates/")
35
+ })
36
+ );
37
+ }
38
+ async function getLatestTemplates() {
39
+ try {
40
+ const { version, url } = await getLatestReleaseDownloadUrl();
41
+ const templateStoragePath = new URL("../starter-templates", import.meta.url).pathname;
42
+ if (!fs.existsSync(templateStoragePath)) {
43
+ fs.mkdirSync(templateStoragePath);
44
+ }
45
+ const templateStorageVersionPath = path.join(templateStoragePath, version);
46
+ if (!fs.existsSync(templateStorageVersionPath)) {
47
+ await downloadTarball(url, templateStorageVersionPath);
48
+ }
49
+ return {
50
+ version,
51
+ templatesDir: path.join(templateStorageVersionPath, "templates")
52
+ };
53
+ } catch (e) {
54
+ const error = e;
55
+ error.message = `Could not download Hydrogen templates from GitHub.
56
+ Please check your internet connection and the following error:
57
+
58
+ ` + error.message;
59
+ throw error;
60
+ }
61
+ }
62
+
63
+ export { downloadTarball, getLatestReleaseDownloadUrl, getLatestTemplates };