@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.
- package/dist/commands/hydrogen/build.d.ts +23 -0
- package/dist/commands/hydrogen/check.d.ts +17 -0
- package/dist/commands/hydrogen/dev.d.ts +21 -0
- package/dist/commands/hydrogen/generate/route.d.ts +30 -0
- package/dist/commands/hydrogen/generate/route.js +21 -42
- package/dist/commands/hydrogen/generate/route.test.d.ts +1 -0
- package/dist/commands/hydrogen/init.d.ts +23 -0
- package/dist/commands/hydrogen/init.js +174 -21
- package/dist/commands/hydrogen/preview.d.ts +17 -0
- package/dist/create-app.d.ts +1 -0
- package/dist/create-app.js +4 -0
- package/dist/{templates → generator-templates/routes}/[robots.txt].tsx +0 -0
- package/dist/{templates → generator-templates/routes}/[sitemap.xml].tsx +0 -0
- package/dist/{templates → generator-templates/routes}/account/login.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/account/register.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/cart.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/collections/$collectionHandle.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/graphiql.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/index.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/pages/$pageHandle.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/policies/$policyHandle.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/policies/index.tsx +0 -0
- package/dist/{templates → generator-templates/routes}/products/$productHandle.tsx +0 -0
- package/dist/hooks/init.d.ts +5 -0
- package/dist/utils/check-lockfile.d.ts +3 -0
- package/dist/utils/check-version.d.ts +3 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/flags.d.ts +8 -0
- package/dist/utils/log.d.ts +5 -0
- package/dist/utils/mini-oxygen.d.ts +11 -0
- package/dist/utils/mini-oxygen.js +4 -1
- package/dist/utils/missing-routes.d.ts +6 -0
- package/dist/utils/template-downloader.d.ts +11 -0
- package/dist/utils/template-downloader.js +63 -0
- package/dist/utils/transpile-ts.d.ts +16 -0
- package/dist/utils/transpile-ts.js +155 -0
- package/dist/utils/virtual-routes.d.ts +7 -0
- package/dist/utils/virtual-routes.test.d.ts +1 -0
- package/dist/virtual-routes/assets/dummy.d.ts +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +14 -2
- package/dist/templates/demo-store/.cache/content-v2/sha512/02/76/13bbea15bb42b81a204b0dc5f14726e0bfa8d012a7b284f887cc2e3c92195d6b07a78f199f990b311ca5fafa9079563503cdd81808cd9b7e496d86c72732 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/04/98/0e81e9c8b9ebe79605df3bf2476728954d7ad01229239c4acbaaefe8e2aa6558b7a08b14cd245365258a7ef2191a7b1d656ae081cc1d129662476f547e96 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/0d/2c/9c0b3f348e40c09b984fbb9d08a1e983e86b4ee155baf87d0fd2428689357600b1f0d71d1edcc0b7381c27eaa024e58b2b76f5a3ed14f836f0f17b0a9b0c +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/18/ed/a944ad29223f60420de387c0325270e1a26f7826a52c813bf5dd319660be2c1cf779dbd9be17aae3c9cd24baa75ddd411fd0674a0e4664b69e6115bf73ed +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/19/32/725ad9da4e9155ebe89c04ce462b0ced1a34e836fa4d0b8829baaf369979e173477fc3468eb1fc91562fbc7abef2a51dda6398a65dd490111a668d460647 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/1e/24/595da822fb6e0d70b7a478b35192c23348911f81396b562a4c5d5ed52cf28ec3e9253496dc0e307da724bf0572b1e4c490b3c922af5b5c3ee13642b050ce +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/42/8e/b848de3b458a3ae29197f58d73db1dcd110d272982471001e4c049af15058851abe97b8671671c36918d87c97adde4c188df8648dc2f71128213dfc72dc2 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/44/52/5bdf014389259b65ea3cf4ef77cbecdc3fe3f95487a53633fccd9dcf29e0eefcccc3a985ba720febd74aeb96e51259a3ccefc51c1c6d91f23fe362ad2bc9 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/5c/12/8d5330d3dea4de70c4b434403ffd5c5083d7f2c2c68a2fc149bd066bc6cde6a75fcb5ab2b59772c72c108f42af3338ba95b69ab4248e1d1a7046e51607b7 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/63/3a/fb02a5e332b2f3a90f634a25f88555704bfeaf5e371631306fcb0d0d548e3d2efd6b525bf62d54f8f0548b73cccabaa34ebb0d51e624bf67de37afb78c8c +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/73/40/c822831f11f08a9ceea944d0145b072ba6164a3e2e75f98fda5437cda6dfddf9ca9450445c1f3236228d6259ac95e4cde9bb6e5996490ed00b7b13b06121 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/76/07/e5a2affb0d722624b151277bfa2c3cd26f1e5c0d3a11d5bb3ba745631b2e8fd1ade94990b19a6acb2805de34048a34c035406d4829bcf3f41a061b270d60 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/86/ba/0dd1289bc16f8dda9cb229b7ffa7aa59c4bdba95e1352a0b61de02fccd726c0269d8cabeae04ffddf408f42491354e24866fe5801ee4bb1ea4b98cce482c +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/8e/7e/005894d7690ac4cc4f3301702083a6d900a8971af9f9f1b38dc4821809c3b6ed302521bfce7460c8673d38875c4187e3b9f59b5d4f4a399cc3869f5b0f55 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/93/6b/e60098157f6bff8ba570cab2ffd97a14983109006f7fa87e4432728366f96dfb19e957d28754daa45f1b6cb2421d26ab59bbd5ce5a448d6102e8e662403d +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/95/3c/ad893b35be316318d41d6141e282cddf5d214b4c335d86498cea48f1ecf32c108a2d58f7aa4a51bdb309da5762afda4204a0551d1a203cf4e642f9669317 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/9b/2b/829beb6526ccc7e54cfa51951fce87e756d17a2096b57011a441b2f9eb4f546e2a6cc650a872f033c5d38bb7b704b862e033212258ee5496c2c0c1cef0c8 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/ae/9a/84c86ca2189f308cb995b8289870f41e4692da806538c67dbe3f4849718a6a7e712fa105aff5ceb5135d0eececf75ab7281e171975bf8ae1ace932046621 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/ae/d9/a6fed1d3e4f1cd165a5a4dc633dbf277ea6cb6089b239cde32fef7d5d041590c05216207b5d6ad6b81d02865ce06b41670751940fd49c43b6bc80efc0076 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/b1/56/584dd264cd440a690eaaaef18f8837dd5a32415fad319adbb289121c1812bcd34dfed87f66cd6ba3b4bf26bc988de0b19c32a593609e5656c9d8cfbc1b2c +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/b5/32/0a7d091d5e19d604dfc1702a81918fb1e21a5263eec2c443e1b0cc3b51d95dc894883dd5bf6851e27dfaf8566a9752d9fc24698cf77fbd692897eb0fb189 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/bc/33/6e26ece5ac53d9eac9ac8a192ef39faf2a587a5808253c659fb1d371c477fc8074d428c8d1929b0d85dd1fec66fc79ea6b9fcb01507e2efec75fb7fbc2cc +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/d8/b5/26061c660a6fb2a2cabd1f7dcf701c984788ed6329891d8d540fa01b9b8ad4cda43fc436b61c0d76b687f1600ad46b59ea52da003b1e7edb4472f74399cb +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/e2/ab/e085c7b7942344631033fca463b3da5f58bb80e3a7f9e52140bb4ef3a46e1f10bb8aa1dbc401bec8718939075060c8acaf7a6e0b6e082f9b83f5a4590296 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/e5/41/1521ee52031bdb29b551344ea7b79161701bfd506f12776bd0aca74255c38adae35405e44958ce8c6807f0a290e48aac6e28eb540dad3e62ae59dc487a8b +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/e8/ae/9b467e1d23913d4584d9417875b3cdc25f6dfed8b228f3a0c818129010b778aae1af1eb200b015ab428e79afe0ef1061262392fbdb96ed7da95efbe7f758 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/ea/40/1c04ae276d1792713cf3118f13f0d73df08b3604b039412073447f7410c95a2a6567aca59d31b263cb9119085fba85d208f25b71b3c96ef151f418b7cd48 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/ec/9a/4e2483d9a13faadd1cbcfe0ab70cdf87a838fe1cf04d11c56c478472e08f5b9e785654654d9b338c051fd762d20e23f14f2c1e110664815f1012c3ab8a08 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/f0/62/eca4034f805cff0ae6d9c9f08128afa5e9bc40f2177b2ff2e8625187e02b6219e9b049300d2a90c7fe947873483161a8b2b040c1cd376d908a7e3e4cb8bf +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/f2/5f/9ccdef519bdb0a99e4f88d4c2c5a2acd4bf79507c81e4403263a875f093ad8d04dd863c4d610426a2974a4f95713c0cd9f29d06b294a6960c2cabffa6c42 +0 -1
- package/dist/templates/demo-store/.cache/content-v2/sha512/f4/ca/0f5ba83b2d5596d6f5917cab8ecedc1a457d62bf4988914f35161e4a4bd39a85030d1f69e2da82d9c2652985f7ca7c8ec2e79fe0235d534911543090b3c5 +0 -1
- package/dist/templates/demo-store/.cache/index-v5/05/44/bebd201ef5e9e9a7c41bd789ff110691a32c7f7fbbbdd630f33d96667cd1 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/26/b5/113aeb17f9f4ef406a1f8b143895199ca545fd0cc1e7972435a092910963 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/2c/09/e60b5cd818510e0cbec908aae3b74175e35e446f4383e87c21489433a11e +0 -2
- package/dist/templates/demo-store/.cache/index-v5/38/21/c3fb7841590b85142018ba88a01045ef1249ac34211342579f0129eae294 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/3a/98/8858fe7de4bf85d37c71adc322cc95335b498bef9a4ae41db324bf5696cc +0 -2
- package/dist/templates/demo-store/.cache/index-v5/3e/40/7021422a7cae2c05484b491fb5b85edd82b325e598ac9e5c6afb858049da +0 -2
- package/dist/templates/demo-store/.cache/index-v5/47/2f/8e9ec62247eca3464d07de774855bb30a56145adc6525b907490e0c1bda0 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/5e/83/14bed234cd143eaf4043de721fcf4250a5adc7008e76d663365e8a322c88 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/5f/87/f79366b4aab5423acdda7930c6c989c49dd1c6607885df3afaa5e6873c9f +0 -2
- package/dist/templates/demo-store/.cache/index-v5/6e/9e/dc622ea9b5c66089a08f3e8b7a0e62a29e85bab337da0a3b28d6126185ec +0 -2
- package/dist/templates/demo-store/.cache/index-v5/71/4c/401eb7f3b2db5e56857a3ddd90e61181e636a5d01cc569ff8671ddf7f14b +0 -2
- package/dist/templates/demo-store/.cache/index-v5/79/2e/b0dd8fcd37a11ecb71cfd33184651560cabda672e55e0b244fc6f825190c +0 -2
- package/dist/templates/demo-store/.cache/index-v5/7b/e1/807e64f6a84e568bf9163283e9d49b77b24ff24bd8eed751d9fd94ea404a +0 -2
- package/dist/templates/demo-store/.cache/index-v5/85/07/e0c4be5b8442583f11be2d0b6f09171d22721437456b745eb2c977294995 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/87/4d/89bc172664efe0dc7f86d8e67559073b2900ae079bd42ae9e3c015d38ab0 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/8c/0d/a633a8771437b330d83eef0fdd99a81c41356b2bdc81f80ec9277f92b060 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/a3/fc/e2e503290d165b9b0e20c6880bc23ff8ec39a440482418b5103c36be66b9 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/a5/bc/d87ab9468457cb872d6c360f8acecd05e0f88b7239b50754f120706fabd4 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/a5/c0/8e6e4f498a17b6198e54f204247ba544e6404b282d4ce3065d85fa69a8a4 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/af/65/89b0c9eb41779c1658ace443604fea125c524bc95cfc71c9b6300da2dc81 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/b2/75/51549baf010c977c70017db497fd9bd20e1efa9b658a6d52761c559f9c0b +0 -2
- package/dist/templates/demo-store/.cache/index-v5/bb/db/9dc2cbdcdc6ff352f9a34463a02e198aa2123a4c2e4ef37fea8b8ccae413 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/c8/52/09bfbca72b45aec745fc339c27986edefa85e40bd69113275a6ecd6495e9 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/d0/c4/d960260ece228d28f70e317741b3f3f3df05c53956d870235837ae2b73b4 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/d3/ca/ff5860148f0bedafb91dab72b54462de81a32a21210324c45a051b197b48 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/d4/55/296e80e87e2652f4cf1aebd5419fe73ef16c94ab20cd0400166d44ea1746 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/da/7a/4b6977be684885e550a0d8fd21c955d0195371ffc3a9535a5a7b950a5ac9 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/dd/aa/599a1cd855476ba058c63ae75a9c006ca11f7fbc2efc00b361d7f1b95cb4 +0 -2
- package/dist/templates/demo-store/.cache/index-v5/df/d2/bcfa3853e61309abab85dbd561dbc632ad0ea79b24f1b77c95f861eead5f +0 -2
- package/dist/templates/demo-store/.cache/index-v5/df/f5/cc3a1197c607eac768ab1b1cdb7b53a7f87b67c23c92da957d45a5bd0bda +0 -2
- package/dist/templates/demo-store/.cache/index-v5/e4/bd/743967c269ef70a14ba6b5dd223d26759eae9295d79f165c66f514b7d8d3 +0 -2
- package/dist/templates/demo-store/.editorconfig +0 -8
- package/dist/templates/demo-store/.eslintignore +0 -4
- package/dist/templates/demo-store/.eslintrc.js +0 -16
- package/dist/templates/demo-store/.graphqlrc.yml +0 -1
- package/dist/templates/demo-store/.prettierignore +0 -2
- package/dist/templates/demo-store/_env +0 -6
- package/dist/templates/demo-store/_gitignore +0 -9
- package/dist/templates/demo-store/app/components/AccountAddressBook.tsx +0 -97
- package/dist/templates/demo-store/app/components/AccountDetails.tsx +0 -41
- package/dist/templates/demo-store/app/components/AddToCartButton.tsx +0 -42
- package/dist/templates/demo-store/app/components/Breadcrumbs.tsx +0 -36
- package/dist/templates/demo-store/app/components/Button.tsx +0 -56
- package/dist/templates/demo-store/app/components/Cart.tsx +0 -431
- package/dist/templates/demo-store/app/components/CartLoading.tsx +0 -50
- package/dist/templates/demo-store/app/components/CountrySelector.tsx +0 -180
- package/dist/templates/demo-store/app/components/Drawer.tsx +0 -115
- package/dist/templates/demo-store/app/components/FeaturedCollections.tsx +0 -54
- package/dist/templates/demo-store/app/components/FeaturedProducts.tsx +0 -116
- package/dist/templates/demo-store/app/components/FeaturedSection.tsx +0 -36
- package/dist/templates/demo-store/app/components/GenericError.tsx +0 -58
- package/dist/templates/demo-store/app/components/Grid.tsx +0 -44
- package/dist/templates/demo-store/app/components/Hero.tsx +0 -129
- package/dist/templates/demo-store/app/components/Icon.tsx +0 -253
- package/dist/templates/demo-store/app/components/Input.tsx +0 -24
- package/dist/templates/demo-store/app/components/Layout.tsx +0 -499
- package/dist/templates/demo-store/app/components/Link.tsx +0 -46
- package/dist/templates/demo-store/app/components/Modal.tsx +0 -46
- package/dist/templates/demo-store/app/components/NotFound.tsx +0 -22
- package/dist/templates/demo-store/app/components/OrderCard.tsx +0 -82
- package/dist/templates/demo-store/app/components/Pagination.tsx +0 -277
- package/dist/templates/demo-store/app/components/ProductCard.tsx +0 -132
- package/dist/templates/demo-store/app/components/ProductGallery.tsx +0 -114
- package/dist/templates/demo-store/app/components/ProductGrid.tsx +0 -90
- package/dist/templates/demo-store/app/components/ProductSwimlane.tsx +0 -30
- package/dist/templates/demo-store/app/components/Skeleton.tsx +0 -24
- package/dist/templates/demo-store/app/components/SortFilter.tsx +0 -414
- package/dist/templates/demo-store/app/components/Text.tsx +0 -192
- package/dist/templates/demo-store/app/components/index.ts +0 -28
- package/dist/templates/demo-store/app/data/countries.ts +0 -194
- package/dist/templates/demo-store/app/data/fragments.ts +0 -73
- package/dist/templates/demo-store/app/entry.client.tsx +0 -4
- package/dist/templates/demo-store/app/entry.server.tsx +0 -26
- package/dist/templates/demo-store/app/hooks/useCartFetchers.tsx +0 -14
- package/dist/templates/demo-store/app/hooks/useIsHydrated.tsx +0 -12
- package/dist/templates/demo-store/app/lib/const.ts +0 -10
- package/dist/templates/demo-store/app/lib/placeholders.ts +0 -244
- package/dist/templates/demo-store/app/lib/session.server.ts +0 -57
- package/dist/templates/demo-store/app/lib/type.ts +0 -21
- package/dist/templates/demo-store/app/lib/utils.ts +0 -310
- package/dist/templates/demo-store/app/root.tsx +0 -360
- package/dist/templates/demo-store/app/routes/($lang)/$.tsx +0 -7
- package/dist/templates/demo-store/app/routes/($lang)/[sitemap.xml].tsx +0 -198
- package/dist/templates/demo-store/app/routes/($lang)/account/__private/address/$id.tsx +0 -417
- package/dist/templates/demo-store/app/routes/($lang)/account/__private/edit.tsx +0 -295
- package/dist/templates/demo-store/app/routes/($lang)/account/__private/logout.ts +0 -25
- package/dist/templates/demo-store/app/routes/($lang)/account/__private/orders.$id.tsx +0 -442
- package/dist/templates/demo-store/app/routes/($lang)/account/__public/activate.$id.$activationToken.tsx +0 -249
- package/dist/templates/demo-store/app/routes/($lang)/account/__public/login.tsx +0 -247
- package/dist/templates/demo-store/app/routes/($lang)/account/__public/recover.tsx +0 -160
- package/dist/templates/demo-store/app/routes/($lang)/account/__public/register.tsx +0 -214
- package/dist/templates/demo-store/app/routes/($lang)/account/__public/reset.$id.$resetToken.tsx +0 -246
- package/dist/templates/demo-store/app/routes/($lang)/account.tsx +0 -300
- package/dist/templates/demo-store/app/routes/($lang)/api/countries.tsx +0 -22
- package/dist/templates/demo-store/app/routes/($lang)/api/products.tsx +0 -85
- package/dist/templates/demo-store/app/routes/($lang)/cart.tsx +0 -510
- package/dist/templates/demo-store/app/routes/($lang)/collections/$collectionHandle.tsx +0 -303
- package/dist/templates/demo-store/app/routes/($lang)/collections/all.tsx +0 -5
- package/dist/templates/demo-store/app/routes/($lang)/collections/index.tsx +0 -194
- package/dist/templates/demo-store/app/routes/($lang)/discounts.$code.tsx +0 -60
- package/dist/templates/demo-store/app/routes/($lang)/featured-products.tsx +0 -58
- package/dist/templates/demo-store/app/routes/($lang)/index.tsx +0 -270
- package/dist/templates/demo-store/app/routes/($lang)/journal/$journalHandle.tsx +0 -145
- package/dist/templates/demo-store/app/routes/($lang)/journal/index.tsx +0 -149
- package/dist/templates/demo-store/app/routes/($lang)/pages/$pageHandle.tsx +0 -74
- package/dist/templates/demo-store/app/routes/($lang)/policies/$policyHandle.tsx +0 -116
- package/dist/templates/demo-store/app/routes/($lang)/policies/index.tsx +0 -92
- package/dist/templates/demo-store/app/routes/($lang)/products/$productHandle.tsx +0 -594
- package/dist/templates/demo-store/app/routes/($lang)/products/index.tsx +0 -146
- package/dist/templates/demo-store/app/routes/($lang)/search.tsx +0 -198
- package/dist/templates/demo-store/app/routes/[robots.txt].tsx +0 -40
- package/dist/templates/demo-store/app/styles/app.css +0 -4117
- package/dist/templates/demo-store/app/styles/custom-font.css +0 -13
- package/dist/templates/demo-store/app/styles/fonts/IBMPlexSerif-Text.woff2 +0 -0
- package/dist/templates/demo-store/app/styles/fonts/IBMPlexSerif-TextItalic.woff2 +0 -0
- package/dist/templates/demo-store/dist/client/build/_assets/IBMPlexSerif-Text-YFMZNZW6.woff2 +0 -0
- package/dist/templates/demo-store/dist/client/build/_assets/IBMPlexSerif-TextItalic-CS6L5H7S.woff2 +0 -0
- package/dist/templates/demo-store/dist/client/build/_assets/app-5V46SKC6.css +0 -1
- package/dist/templates/demo-store/dist/client/build/_assets/custom-font-WVPOFKHF.css +0 -1
- package/dist/templates/demo-store/dist/client/build/_assets/favicon-5FIZBM2K.svg +0 -28
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-2JM6VWTP.js +0 -2
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-2JM6VWTP.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-3RDIRS72.js +0 -9
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-3RDIRS72.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-AYHDHSL7.js +0 -2
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-AYHDHSL7.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-E5DM2WN5.js +0 -2
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-E5DM2WN5.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-EGF7BKAH.js +0 -31
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-EGF7BKAH.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-MEPKJ2VW.js +0 -2
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-MEPKJ2VW.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-N73MA4O3.js +0 -72
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-N73MA4O3.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-S5VPOIXA.js +0 -2
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-S5VPOIXA.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-SJXYTHYC.js +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-SJXYTHYC.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-W7NVY25S.js +0 -25
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-W7NVY25S.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-YU4DAQHP.js +0 -2
- package/dist/templates/demo-store/dist/client/build/_shared/chunk-YU4DAQHP.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/_shared/log-seo-tags-3MQL2PTY-EVG3H53P.js +0 -2
- package/dist/templates/demo-store/dist/client/build/_shared/log-seo-tags-3MQL2PTY-EVG3H53P.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/entry.client-OO4LDNWK.js +0 -2
- package/dist/templates/demo-store/dist/client/build/entry.client-OO4LDNWK.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/manifest-1AF0BBA5.js +0 -1
- package/dist/templates/demo-store/dist/client/build/root-FV6LPUDT.js +0 -3
- package/dist/templates/demo-store/dist/client/build/root-FV6LPUDT.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/$-HDBACFGJ.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/$-HDBACFGJ.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/[sitemap.xml]-AAQRJL2R.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/[sitemap.xml]-AAQRJL2R.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/address/$id-EQYOPKPY.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/address/$id-EQYOPKPY.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/edit-YM3NVGDL.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/edit-YM3NVGDL.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/logout-7KXWFBCX.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/logout-7KXWFBCX.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/orders.$id-QODJFNZS.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__private/orders.$id-QODJFNZS.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/activate.$id.$activationToken-VQ76BWT7.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/activate.$id.$activationToken-VQ76BWT7.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/login-IRZTYHQF.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/login-IRZTYHQF.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/recover-4VLNDEUK.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/recover-4VLNDEUK.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/register-6GG4XAMH.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/register-6GG4XAMH.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/reset.$id.$resetToken-SIXY5J2S.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account/__public/reset.$id.$resetToken-SIXY5J2S.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account-G7FQFZFP.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/account-G7FQFZFP.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/countries-UD6BGYL2.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/countries-UD6BGYL2.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/products-Y2SK2JNE.js +0 -18
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/api/products-Y2SK2JNE.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/cart-TFONAIOG.js +0 -55
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/cart-TFONAIOG.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/$collectionHandle-HSKYTXMD.js +0 -83
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/$collectionHandle-HSKYTXMD.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/all-IXDFOKCK.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/all-IXDFOKCK.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/index-RXXMMLNQ.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/collections/index-RXXMMLNQ.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/discounts.$code-GYKQBNLQ.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/discounts.$code-GYKQBNLQ.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/featured-products-KNUST6DD.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/featured-products-KNUST6DD.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/index-DZYZ23DT.js +0 -59
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/index-DZYZ23DT.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/$journalHandle-BFPXMHRY.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/$journalHandle-BFPXMHRY.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/index-TVV6RNDT.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/journal/index-TVV6RNDT.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/pages/$pageHandle-2JU4FDNU.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/pages/$pageHandle-2JU4FDNU.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/$policyHandle-B2JUECEA.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/$policyHandle-B2JUECEA.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/index-DKYSL4RX.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/policies/index-DKYSL4RX.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/$productHandle-CSUUFYMX.js +0 -102
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/$productHandle-CSUUFYMX.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/index-VAQVPD22.js +0 -24
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/products/index-VAQVPD22.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/search-UVGUQAJG.js +0 -54
- package/dist/templates/demo-store/dist/client/build/routes/($lang)/search-UVGUQAJG.js.map +0 -7
- package/dist/templates/demo-store/dist/client/build/routes/[robots.txt]-YG62MDLB.js +0 -2
- package/dist/templates/demo-store/dist/client/build/routes/[robots.txt]-YG62MDLB.js.map +0 -7
- package/dist/templates/demo-store/dist/client/favicon.svg +0 -28
- package/dist/templates/demo-store/dist/worker/_assets/IBMPlexSerif-Text-YFMZNZW6.woff2 +0 -0
- package/dist/templates/demo-store/dist/worker/_assets/IBMPlexSerif-TextItalic-CS6L5H7S.woff2 +0 -0
- package/dist/templates/demo-store/dist/worker/index.js +0 -1352
- package/dist/templates/demo-store/dist/worker/index.js.map +0 -7
- package/dist/templates/demo-store/package.json +0 -64
- package/dist/templates/demo-store/postcss.config.js +0 -10
- package/dist/templates/demo-store/public/favicon.svg +0 -28
- package/dist/templates/demo-store/remix.env.d.ts +0 -40
- package/dist/templates/demo-store/remix.init/index.js +0 -25
- package/dist/templates/demo-store/remix.init/package.json +0 -7
- package/dist/templates/demo-store/server.ts +0 -73
- package/dist/templates/demo-store/styles/app.css +0 -182
- package/dist/templates/demo-store/tailwind.config.js +0 -70
- package/dist/templates/demo-store/tsconfig.json +0 -25
- package/dist/templates/hello-world/.cache/content-v2/sha512/13/4d/016017e6bcf9be61273229516bd898b7df8dad06121807f9b80f1e2acca7e9790dcc476d08b81a899d8d29d38331b4a459d66f3c7f9dc4303ca2fcc167b7 +0 -1
- package/dist/templates/hello-world/.cache/content-v2/sha512/99/79/957d59c381e42c01e473b69a7befabebff88d7ae53269b038a7aca4993e3e773e6a1144223532f089df44c4d866af69317389a969681566e3e71ef5e023c +0 -1
- package/dist/templates/hello-world/.cache/index-v5/09/f6/fe4b05c4157320b8b59b3f84116195be0437d87357d743d21acd638a4606 +0 -2
- package/dist/templates/hello-world/.cache/index-v5/d0/c4/d960260ece228d28f70e317741b3f3f3df05c53956d870235837ae2b73b4 +0 -2
- package/dist/templates/hello-world/.eslintignore +0 -4
- package/dist/templates/hello-world/.eslintrc.js +0 -6
- package/dist/templates/hello-world/.graphqlrc.yml +0 -1
- package/dist/templates/hello-world/README.md +0 -20
- package/dist/templates/hello-world/_env +0 -6
- package/dist/templates/hello-world/_gitignore +0 -8
- package/dist/templates/hello-world/app/components/Layout.tsx +0 -43
- package/dist/templates/hello-world/app/components/index.ts +0 -1
- package/dist/templates/hello-world/app/entry.client.tsx +0 -4
- package/dist/templates/hello-world/app/entry.server.tsx +0 -21
- package/dist/templates/hello-world/app/root.tsx +0 -104
- package/dist/templates/hello-world/app/routes/index.tsx +0 -16
- package/dist/templates/hello-world/app/styles/app.css +0 -38
- package/dist/templates/hello-world/dist/client/build/_assets/app-NBPUE4H5.css +0 -1
- package/dist/templates/hello-world/dist/client/build/_assets/favicon-5FIZBM2K.svg +0 -28
- package/dist/templates/hello-world/dist/client/build/_shared/chunk-AEML26BQ.js +0 -31
- package/dist/templates/hello-world/dist/client/build/_shared/chunk-AEML26BQ.js.map +0 -7
- package/dist/templates/hello-world/dist/client/build/_shared/chunk-RKJPHUBS.js +0 -2
- package/dist/templates/hello-world/dist/client/build/_shared/chunk-RKJPHUBS.js.map +0 -7
- package/dist/templates/hello-world/dist/client/build/entry.client-ZGMV2YX5.js +0 -9
- package/dist/templates/hello-world/dist/client/build/entry.client-ZGMV2YX5.js.map +0 -7
- package/dist/templates/hello-world/dist/client/build/manifest-8ABA8B0B.js +0 -1
- package/dist/templates/hello-world/dist/client/build/root-HK7BXYY5.js +0 -2
- package/dist/templates/hello-world/dist/client/build/root-HK7BXYY5.js.map +0 -7
- package/dist/templates/hello-world/dist/client/build/routes/index-YNIEU6B3.js +0 -2
- package/dist/templates/hello-world/dist/client/build/routes/index-YNIEU6B3.js.map +0 -7
- package/dist/templates/hello-world/dist/client/favicon.svg +0 -28
- package/dist/templates/hello-world/dist/worker/index.js +0 -68
- package/dist/templates/hello-world/dist/worker/index.js.map +0 -7
- package/dist/templates/hello-world/package.json +0 -42
- package/dist/templates/hello-world/public/favicon.svg +0 -28
- package/dist/templates/hello-world/remix.env.d.ts +0 -35
- package/dist/templates/hello-world/remix.init/index.js +0 -25
- package/dist/templates/hello-world/remix.init/package.json +0 -7
- package/dist/templates/hello-world/server.ts +0 -129
- package/dist/templates/hello-world/tsconfig.json +0 -25
- 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,
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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 =
|
|
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 @@
|
|
|
1
|
+
|
|
@@ -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
|
-
|
|
8
|
-
description: "
|
|
9
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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,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(
|
|
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,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 };
|