@ohos-ports/shopify 4.8.0-beta.0
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/README.md +75 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +11 -0
- package/dist/acorn-7M27BPGP.js +16 -0
- package/dist/analytics-3IIUBZ3B.js +1 -0
- package/dist/analytics-OOT5AB52.js +1 -0
- package/dist/angular-DW5TQVCM.js +4 -0
- package/dist/assets/graphiql/favicon.ico +0 -0
- package/dist/assets/graphiql/style.css +58 -0
- package/dist/assets/hydrogen/bundle/analyzer.html +2056 -0
- package/dist/assets/hydrogen/i18n/domains.ts +21 -0
- package/dist/assets/hydrogen/i18n/mock-i18n-types.ts +5 -0
- package/dist/assets/hydrogen/i18n/subdomains.ts +20 -0
- package/dist/assets/hydrogen/i18n/subfolders.ts +22 -0
- package/dist/assets/hydrogen/routes/locale-check.ts +16 -0
- package/dist/assets/hydrogen/starter/.cursor/rules/hydrogen-react-router.mdc +52 -0
- package/dist/assets/hydrogen/starter/.graphqlrc.ts +29 -0
- package/dist/assets/hydrogen/starter/AGENTS.md +5 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +2839 -0
- package/dist/assets/hydrogen/starter/CLAUDE.md +1 -0
- package/dist/assets/hydrogen/starter/README.md +45 -0
- package/dist/assets/hydrogen/starter/app/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +37 -0
- package/dist/assets/hydrogen/starter/app/components/Aside.tsx +101 -0
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +197 -0
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +109 -0
- package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +300 -0
- package/dist/assets/hydrogen/starter/app/components/Footer.tsx +129 -0
- package/dist/assets/hydrogen/starter/app/components/Header.tsx +231 -0
- package/dist/assets/hydrogen/starter/app/components/MockShopNotice.tsx +20 -0
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +174 -0
- package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +61 -0
- package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +150 -0
- package/dist/assets/hydrogen/starter/app/components/ProductImage.tsx +23 -0
- package/dist/assets/hydrogen/starter/app/components/ProductItem.tsx +44 -0
- package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +27 -0
- package/dist/assets/hydrogen/starter/app/components/SearchForm.tsx +68 -0
- package/dist/assets/hydrogen/starter/app/components/SearchFormPredictive.tsx +76 -0
- package/dist/assets/hydrogen/starter/app/components/SearchResults.tsx +161 -0
- package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +304 -0
- package/dist/assets/hydrogen/starter/app/entry.client.tsx +21 -0
- package/dist/assets/hydrogen/starter/app/entry.server.tsx +53 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerAddressMutations.ts +64 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerDetailsQuery.ts +40 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrderQuery.ts +90 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerOrdersQuery.ts +63 -0
- package/dist/assets/hydrogen/starter/app/graphql/customer-account/CustomerUpdateMutation.ts +25 -0
- package/dist/assets/hydrogen/starter/app/lib/context.ts +65 -0
- package/dist/assets/hydrogen/starter/app/lib/fragments.ts +242 -0
- package/dist/assets/hydrogen/starter/app/lib/orderFilters.ts +90 -0
- package/dist/assets/hydrogen/starter/app/lib/redirect.ts +23 -0
- package/dist/assets/hydrogen/starter/app/lib/search.ts +79 -0
- package/dist/assets/hydrogen/starter/app/lib/session.ts +72 -0
- package/dist/assets/hydrogen/starter/app/lib/variants.ts +46 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +209 -0
- package/dist/assets/hydrogen/starter/app/routes/$.tsx +11 -0
- package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +78 -0
- package/dist/assets/hydrogen/starter/app/routes/[sitemap.xml].tsx +16 -0
- package/dist/assets/hydrogen/starter/app/routes/_index.tsx +177 -0
- package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +9 -0
- package/dist/assets/hydrogen/starter/app/routes/account._index.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +516 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +222 -0
- package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +222 -0
- package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +133 -0
- package/dist/assets/hydrogen/starter/app/routes/account.tsx +97 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.authorize.tsx +5 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.login.tsx +17 -0
- package/dist/assets/hydrogen/starter/app/routes/account_.logout.tsx +11 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +129 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +175 -0
- package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +109 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.$lines.tsx +70 -0
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +113 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +161 -0
- package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +133 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +122 -0
- package/dist/assets/hydrogen/starter/app/routes/discount.$code.tsx +48 -0
- package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +88 -0
- package/dist/assets/hydrogen/starter/app/routes/policies.$handle.tsx +93 -0
- package/dist/assets/hydrogen/starter/app/routes/policies._index.tsx +69 -0
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +232 -0
- package/dist/assets/hydrogen/starter/app/routes/search.tsx +426 -0
- package/dist/assets/hydrogen/starter/app/routes/sitemap.$type.$page[.xml].tsx +23 -0
- package/dist/assets/hydrogen/starter/app/routes.ts +9 -0
- package/dist/assets/hydrogen/starter/app/styles/app.css +645 -0
- package/dist/assets/hydrogen/starter/app/styles/reset.css +139 -0
- package/dist/assets/hydrogen/starter/customer-accountapi.generated.d.ts +543 -0
- package/dist/assets/hydrogen/starter/env.d.ts +7 -0
- package/dist/assets/hydrogen/starter/eslint.config.js +247 -0
- package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.jpg +0 -0
- package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.md +394 -0
- package/dist/assets/hydrogen/starter/guides/search/search.jpg +0 -0
- package/dist/assets/hydrogen/starter/guides/search/search.md +335 -0
- package/dist/assets/hydrogen/starter/package.json +62 -0
- package/dist/assets/hydrogen/starter/public/.gitkeep +0 -0
- package/dist/assets/hydrogen/starter/react-router.config.ts +13 -0
- package/dist/assets/hydrogen/starter/server.ts +59 -0
- package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +1342 -0
- package/dist/assets/hydrogen/starter/tsconfig.json +43 -0
- package/dist/assets/hydrogen/starter/vite.config.ts +44 -0
- package/dist/assets/hydrogen/tailwind/package.json +11 -0
- package/dist/assets/hydrogen/tailwind/tailwind.css +6 -0
- package/dist/assets/hydrogen/vanilla-extract/package.json +8 -0
- package/dist/assets/hydrogen/virtual-routes/assets/debug-network.css +609 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon-dark.svg +20 -0
- package/dist/assets/hydrogen/virtual-routes/assets/favicon.svg +28 -0
- package/dist/assets/hydrogen/virtual-routes/assets/inter-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/jetbrainsmono-variable-font.woff2 +0 -0
- package/dist/assets/hydrogen/virtual-routes/assets/styles.css +249 -0
- package/dist/assets/hydrogen/virtual-routes/components/FlameChartWrapper.jsx +123 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseBW.jsx +32 -0
- package/dist/assets/hydrogen/virtual-routes/components/HydrogenLogoBaseColor.jsx +47 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconBanner.jsx +292 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconClose.jsx +38 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconDiscard.jsx +44 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconError.jsx +61 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconGithub.jsx +23 -0
- package/dist/assets/hydrogen/virtual-routes/components/IconTwitter.jsx +21 -0
- package/dist/assets/hydrogen/virtual-routes/components/Layout.jsx +7 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestDetails.jsx +171 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestTable.jsx +91 -0
- package/dist/assets/hydrogen/virtual-routes/components/RequestWaterfall.jsx +151 -0
- package/dist/assets/hydrogen/virtual-routes/layout.jsx +33 -0
- package/dist/assets/hydrogen/virtual-routes/lib/useDebugNetworkServer.jsx +178 -0
- package/dist/assets/hydrogen/virtual-routes/routes/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx +37 -0
- package/dist/assets/hydrogen/virtual-routes/routes/graphiql.jsx +5 -0
- package/dist/assets/hydrogen/virtual-routes/routes/index.jsx +265 -0
- package/dist/assets/hydrogen/virtual-routes/routes/subrequest-profiler.jsx +243 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root-with-layout.jsx +63 -0
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +67 -0
- package/dist/assets/hydrogen/vite/package.json +13 -0
- package/dist/assets/hydrogen/vite/vite.config.js +43 -0
- package/dist/assets/speedscope/SourceCodePro-Regular.ttf.f546cbe0.woff2 +0 -0
- package/dist/assets/speedscope/demangle-cpp.1768f4cc.js +4 -0
- package/dist/assets/speedscope/favicon-16x16.f74b3187.png +0 -0
- package/dist/assets/speedscope/favicon-32x32.bc503437.png +0 -0
- package/dist/assets/speedscope/file-format-schema.json +324 -0
- package/dist/assets/speedscope/import.bcbb2033.js +123 -0
- package/dist/assets/speedscope/index.html +2 -0
- package/dist/assets/speedscope/perf-vertx-stacks-01-collapsed-all.2681da68.txt +199 -0
- package/dist/assets/speedscope/release.txt +3 -0
- package/dist/assets/speedscope/reset.8c46b7a1.css +2 -0
- package/dist/assets/speedscope/source-code-pro.52b1676f.css +2 -0
- package/dist/assets/speedscope/source-code-pro.LICENSE.md +93 -0
- package/dist/assets/speedscope/source-map.438fa06b.js +24 -0
- package/dist/assets/speedscope/speedscope.6f107512.js +193 -0
- package/dist/babel-I2RLWM7N.js +15 -0
- package/dist/bootstrap.d.ts +5 -0
- package/dist/bootstrap.js +3 -0
- package/dist/chokidar-5RWEYTNQ.js +1 -0
- package/dist/chunk-2AK44UYM.js +1 -0
- package/dist/chunk-2CIZE537.js +3 -0
- package/dist/chunk-2EAFYCCS.js +16 -0
- package/dist/chunk-2KD4LHRT.js +5 -0
- package/dist/chunk-2KGPH7YG.js +2 -0
- package/dist/chunk-2O224ZPO.js +3 -0
- package/dist/chunk-2XDUJQQN.js +12 -0
- package/dist/chunk-36ROOKQB.js +1 -0
- package/dist/chunk-3DCN3N23.js +4 -0
- package/dist/chunk-3JXPOOFV.js +836 -0
- package/dist/chunk-4QBJ5JBX.js +18 -0
- package/dist/chunk-4ZNV5YSL.js +1 -0
- package/dist/chunk-5HBIIYSK.js +1 -0
- package/dist/chunk-5L63PRJL.js +2 -0
- package/dist/chunk-5N6HNQQ5.js +8 -0
- package/dist/chunk-5SEEDOQ5.js +1 -0
- package/dist/chunk-636CTEW7.js +1 -0
- package/dist/chunk-67Z34HN5.js +5 -0
- package/dist/chunk-6BDAJ6UD.js +5 -0
- package/dist/chunk-6CXG3XLP.js +1 -0
- package/dist/chunk-6MWWJZFN.js +19 -0
- package/dist/chunk-6QDOCBD4.js +6 -0
- package/dist/chunk-6RQOEPEC.js +1 -0
- package/dist/chunk-72ZY3KTF.js +1 -0
- package/dist/chunk-742XXXGL.js +6 -0
- package/dist/chunk-773TIA5M.js +2 -0
- package/dist/chunk-7HFHL5SO.js +2 -0
- package/dist/chunk-7ISJRIPT.js +1 -0
- package/dist/chunk-7LWUHQIF.js +1 -0
- package/dist/chunk-7T6M7FAC.js +103 -0
- package/dist/chunk-7UNQOKZW.js +1 -0
- package/dist/chunk-7Y7AZRL3.js +10 -0
- package/dist/chunk-A6BMJISP.js +8 -0
- package/dist/chunk-AAK376RT.js +2 -0
- package/dist/chunk-AEUCDGTB.js +294 -0
- package/dist/chunk-AWUX36VG.js +1 -0
- package/dist/chunk-B4OMIONW.js +5 -0
- package/dist/chunk-BOAGJ6P5.js +1 -0
- package/dist/chunk-BWJIZYAG.js +1 -0
- package/dist/chunk-BZ73NV3L.js +2 -0
- package/dist/chunk-C3RUVXG2.js +6 -0
- package/dist/chunk-C4YLE3NS.js +64 -0
- package/dist/chunk-CEYIZC3M.js +2 -0
- package/dist/chunk-CIWKN4HF.js +7 -0
- package/dist/chunk-CRALWNNO.js +1 -0
- package/dist/chunk-CTNBSUVU.js +83 -0
- package/dist/chunk-CULTZLC4.js +1 -0
- package/dist/chunk-CX5CC6P5.js +1 -0
- package/dist/chunk-CX75OKZK.js +1 -0
- package/dist/chunk-DASVZTAX.js +359 -0
- package/dist/chunk-DPNZWBT5.js +1 -0
- package/dist/chunk-DX3JLOUA.js +4 -0
- package/dist/chunk-E55KS3GZ.js +1 -0
- package/dist/chunk-E5FXOLQO.js +17 -0
- package/dist/chunk-E6N4PZZR.js +7 -0
- package/dist/chunk-EB574SY6.js +6 -0
- package/dist/chunk-ET2CGROE.js +451 -0
- package/dist/chunk-EX5GVHGE.js +1 -0
- package/dist/chunk-F3NYCSXT.js +273 -0
- package/dist/chunk-F3TMLDLC.js +1 -0
- package/dist/chunk-F6X6OXXB.js +3 -0
- package/dist/chunk-FDBHQLFK.js +1 -0
- package/dist/chunk-FDYW3UQC.js +1 -0
- package/dist/chunk-FEDVVYK2.js +1 -0
- package/dist/chunk-FFSDGRAN.js +1 -0
- package/dist/chunk-FJ6F4XRV.js +28 -0
- package/dist/chunk-FKIVKNOV.js +2 -0
- package/dist/chunk-FOREMLFZ.js +1 -0
- package/dist/chunk-FUYDGK33.js +2 -0
- package/dist/chunk-FX3L344E.js +1 -0
- package/dist/chunk-G5XIGN5D.js +593 -0
- package/dist/chunk-GAYKYEIM.js +1 -0
- package/dist/chunk-GB3YC4TI.js +1 -0
- package/dist/chunk-GCN4O7HM.js +1 -0
- package/dist/chunk-GCY7LPEF.js +6 -0
- package/dist/chunk-GNBRCK7L.js +3 -0
- package/dist/chunk-GRPKF5ZB.js +1 -0
- package/dist/chunk-GRSF7456.js +1 -0
- package/dist/chunk-H2TQ4ODI.js +1 -0
- package/dist/chunk-H6XEESUN.js +4 -0
- package/dist/chunk-HB347DXT.js +2 -0
- package/dist/chunk-HFSCXTJQ.js +97 -0
- package/dist/chunk-HHN6KZXX.js +1 -0
- package/dist/chunk-HP64ZTEJ.js +6 -0
- package/dist/chunk-I5A6BPCP.js +1 -0
- package/dist/chunk-IARCMH7G.js +5 -0
- package/dist/chunk-IBI5UCJO.js +1 -0
- package/dist/chunk-IKUSLRGD.js +1 -0
- package/dist/chunk-IT4HYLTY.js +1 -0
- package/dist/chunk-IWOTLFOY.js +32 -0
- package/dist/chunk-J3JPJCWP.js +1 -0
- package/dist/chunk-J4T73EAS.js +8 -0
- package/dist/chunk-JD5P5RAJ.js +1 -0
- package/dist/chunk-JG4HH54Q.js +1 -0
- package/dist/chunk-JIYSCWCG.js +1 -0
- package/dist/chunk-JJZNUFPD.js +44 -0
- package/dist/chunk-JLGA3B7P.js +1 -0
- package/dist/chunk-JWRK5KLD.js +560 -0
- package/dist/chunk-JX7FYWPO.js +1 -0
- package/dist/chunk-K42WBNJQ.js +18 -0
- package/dist/chunk-KDU7VW3L.js +11 -0
- package/dist/chunk-KWVOJWO7.js +1 -0
- package/dist/chunk-LANUJ7LX.js +16 -0
- package/dist/chunk-LD6ZCTZ3.js +9 -0
- package/dist/chunk-LFOBYEWG.js +1 -0
- package/dist/chunk-LQ7ENG4V.js +1 -0
- package/dist/chunk-LUKQ5HLC.js +1 -0
- package/dist/chunk-M2XHIN57.js +4 -0
- package/dist/chunk-MNOQAXJW.js +3 -0
- package/dist/chunk-MPW2YJWU.js +31 -0
- package/dist/chunk-MYQUYU4U.js +2 -0
- package/dist/chunk-N65F7ET2.js +1 -0
- package/dist/chunk-N6RBRPGW.js +7 -0
- package/dist/chunk-N75VOJHO.js +15 -0
- package/dist/chunk-NBFMP5XQ.js +1 -0
- package/dist/chunk-NE3ZFSMS.js +1 -0
- package/dist/chunk-NGLMZYS7.js +278 -0
- package/dist/chunk-NHAUJWEG.js +1 -0
- package/dist/chunk-NILETICC.js +11 -0
- package/dist/chunk-NNZXKFOS.js +7 -0
- package/dist/chunk-NQK2VCDA.js +1 -0
- package/dist/chunk-NROVZETL.js +1 -0
- package/dist/chunk-NW6NUGN7.js +1 -0
- package/dist/chunk-O7DZXO3O.js +15 -0
- package/dist/chunk-OBYQSIYU.js +25 -0
- package/dist/chunk-OEG3N5PG.js +15 -0
- package/dist/chunk-OGBZTY2G.js +5 -0
- package/dist/chunk-OMHR423H.js +1 -0
- package/dist/chunk-OV6SRRXR.js +5 -0
- package/dist/chunk-OVV5YGKN.js +1 -0
- package/dist/chunk-OZL5FTT7.js +1 -0
- package/dist/chunk-OZMQ2EJB.js +1 -0
- package/dist/chunk-P2OI2P2M.js +1 -0
- package/dist/chunk-P57P7UAN.js +3 -0
- package/dist/chunk-PATTG7YZ.js +1 -0
- package/dist/chunk-PG5YNPJB.js +26 -0
- package/dist/chunk-PP4L2JJ6.js +3 -0
- package/dist/chunk-Q5JX23QU.js +1 -0
- package/dist/chunk-Q5KVMLBK.js +4 -0
- package/dist/chunk-Q5LIJGT7.js +12 -0
- package/dist/chunk-Q6ADIMJM.js +6 -0
- package/dist/chunk-Q7BOSHWX.js +7 -0
- package/dist/chunk-QERQARMC.js +1 -0
- package/dist/chunk-QOV43E26.js +1 -0
- package/dist/chunk-QTFUYKMF.js +1 -0
- package/dist/chunk-QTJCCOAG.js +20 -0
- package/dist/chunk-R6ICQT2D.js +1 -0
- package/dist/chunk-R7T3LYJL.js +3 -0
- package/dist/chunk-RJ5VF3QY.js +2 -0
- package/dist/chunk-RXQJCJDV.js +1 -0
- package/dist/chunk-S2TLBBSS.js +5 -0
- package/dist/chunk-S5FOQY35.js +1 -0
- package/dist/chunk-SYLHT42O.js +1 -0
- package/dist/chunk-T4AA6TSF.js +15 -0
- package/dist/chunk-T4QWK5GG.js +10 -0
- package/dist/chunk-T7KHS6RF.js +1 -0
- package/dist/chunk-T7PJDT5O.js +6 -0
- package/dist/chunk-TEY4LRY7.js +1 -0
- package/dist/chunk-TFBRVLDN.js +1 -0
- package/dist/chunk-TOLPNBZK.js +4 -0
- package/dist/chunk-TR4OWSEX.js +77 -0
- package/dist/chunk-TU47HMTL.js +1 -0
- package/dist/chunk-TUVDJ3PG.js +2 -0
- package/dist/chunk-TYMYIUIQ.js +1 -0
- package/dist/chunk-U2DWBZK2.js +1 -0
- package/dist/chunk-U53OLUOE.js +3 -0
- package/dist/chunk-UAETNFN4.js +1 -0
- package/dist/chunk-UAFEFKAQ.js +5 -0
- package/dist/chunk-ULRJDKWQ.js +1 -0
- package/dist/chunk-UOHNRH6E.js +7 -0
- package/dist/chunk-UZARYOLN.js +1 -0
- package/dist/chunk-VASGXHYA.js +1 -0
- package/dist/chunk-VD4XJ6BX.js +1 -0
- package/dist/chunk-VE35YELD.js +1 -0
- package/dist/chunk-VFM2KQRM.js +19 -0
- package/dist/chunk-VJEKDBGZ.js +1 -0
- package/dist/chunk-VKWPEFWQ.js +1 -0
- package/dist/chunk-VSDRNYA5.js +1 -0
- package/dist/chunk-VUMUCNI7.js +1 -0
- package/dist/chunk-VVZSYHDG.js +4 -0
- package/dist/chunk-VXEYO3ZP.js +1 -0
- package/dist/chunk-VYDSOAV4.js +9 -0
- package/dist/chunk-W6ST525S.js +99 -0
- package/dist/chunk-WBYAGS6B.js +6 -0
- package/dist/chunk-WGAFCKGD.js +1 -0
- package/dist/chunk-WYBTC356.js +1 -0
- package/dist/chunk-XF2KTEID.js +1 -0
- package/dist/chunk-XH5YGJQR.js +1 -0
- package/dist/chunk-XHKWITLA.js +1705 -0
- package/dist/chunk-XOCB4KNX.js +2 -0
- package/dist/chunk-XUUAKGEX.js +1 -0
- package/dist/chunk-XUYVJEZG.js +3 -0
- package/dist/chunk-Y47C3LSX.js +3 -0
- package/dist/chunk-Y5PRPHLQ.js +6 -0
- package/dist/chunk-YD2VQEN5.js +1 -0
- package/dist/chunk-YESGYUEL.js +1 -0
- package/dist/chunk-YEVGLC5X.js +1 -0
- package/dist/chunk-YFINLODF.js +375 -0
- package/dist/chunk-YKL3BLWC.js +46 -0
- package/dist/chunk-YLQ3LNNY.js +99 -0
- package/dist/chunk-YLXPYXQP.js +1 -0
- package/dist/chunk-YNDIZCD2.js +7 -0
- package/dist/chunk-YPWHD3NL.js +1 -0
- package/dist/chunk-YSAFHVV6.js +8 -0
- package/dist/chunk-YY6TFARF.js +1 -0
- package/dist/chunk-YZMY2CTU.js +10 -0
- package/dist/chunk-Z4AFEO36.js +1 -0
- package/dist/chunk-Z5WPP6ME.js +1 -0
- package/dist/chunk-Z65E4UAP.js +1 -0
- package/dist/chunk-ZDF5N422.js +1 -0
- package/dist/chunk-ZDRIQC7O.js +1 -0
- package/dist/chunk-ZH44BDUR.js +5 -0
- package/dist/chunk-ZI7LK3LW.js +11 -0
- package/dist/chunk-ZL5LU4U2.js +32 -0
- package/dist/chunk-ZYX7UHCQ.js +1 -0
- package/dist/chunk-ZZRFG6ME.js +317 -0
- package/dist/cli/commands/app/app-logs/sources.js +1 -0
- package/dist/cli/commands/app/build.js +1 -0
- package/dist/cli/commands/app/bulk/cancel.js +1 -0
- package/dist/cli/commands/app/bulk/execute.js +1 -0
- package/dist/cli/commands/app/bulk/status.js +1 -0
- package/dist/cli/commands/app/config/link.js +1 -0
- package/dist/cli/commands/app/config/pull.js +1 -0
- package/dist/cli/commands/app/config/use.js +1 -0
- package/dist/cli/commands/app/config/validate.js +1 -0
- package/dist/cli/commands/app/demo/watcher.js +1 -0
- package/dist/cli/commands/app/deploy.js +1 -0
- package/dist/cli/commands/app/dev/clean.js +1 -0
- package/dist/cli/commands/app/dev.js +1 -0
- package/dist/cli/commands/app/doctor/instructions.js +1 -0
- package/dist/cli/commands/app/doctor.js +1 -0
- package/dist/cli/commands/app/env/pull.js +1 -0
- package/dist/cli/commands/app/env/show.js +1 -0
- package/dist/cli/commands/app/execute.js +1 -0
- package/dist/cli/commands/app/function/build.js +1 -0
- package/dist/cli/commands/app/function/info.js +1 -0
- package/dist/cli/commands/app/function/replay.js +1 -0
- package/dist/cli/commands/app/function/run.js +1 -0
- package/dist/cli/commands/app/function/schema.js +1 -0
- package/dist/cli/commands/app/function/typegen.js +1 -0
- package/dist/cli/commands/app/generate/extension.js +1 -0
- package/dist/cli/commands/app/graphiql.js +1 -0
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -0
- package/dist/cli/commands/app/import-extensions.js +1 -0
- package/dist/cli/commands/app/info.js +1 -0
- package/dist/cli/commands/app/init.js +1 -0
- package/dist/cli/commands/app/logs.js +1 -0
- package/dist/cli/commands/app/release.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/list.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/status.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -0
- package/dist/cli/commands/app/versions/list.js +1 -0
- package/dist/cli/commands/app/webhook/trigger.js +1 -0
- package/dist/cli/commands/auth/login.d.ts +8 -0
- package/dist/cli/commands/auth/login.js +1 -0
- package/dist/cli/commands/auth/logout.d.ts +5 -0
- package/dist/cli/commands/auth/logout.js +1 -0
- package/dist/cli/commands/cache/clear.d.ts +6 -0
- package/dist/cli/commands/cache/clear.js +1 -0
- package/dist/cli/commands/config/autoupgrade/constants.d.ts +4 -0
- package/dist/cli/commands/config/autoupgrade/constants.js +1 -0
- package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -0
- package/dist/cli/commands/config/autoupgrade/off.js +1 -0
- package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -0
- package/dist/cli/commands/config/autoupgrade/on.js +1 -0
- package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -0
- package/dist/cli/commands/config/autoupgrade/status.js +1 -0
- package/dist/cli/commands/debug/command-flags.d.ts +9 -0
- package/dist/cli/commands/debug/command-flags.js +1 -0
- package/dist/cli/commands/doc/fetch.d.ts +12 -0
- package/dist/cli/commands/doc/fetch.js +1 -0
- package/dist/cli/commands/doc/search.d.ts +13 -0
- package/dist/cli/commands/doc/search.js +1 -0
- package/dist/cli/commands/docs/generate.d.ts +21 -0
- package/dist/cli/commands/docs/generate.js +1 -0
- package/dist/cli/commands/doctor-release/doctor-release.d.ts +6 -0
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -0
- package/dist/cli/commands/doctor-release/theme/index.d.ts +14 -0
- package/dist/cli/commands/doctor-release/theme/index.js +1 -0
- package/dist/cli/commands/help.d.ts +13 -0
- package/dist/cli/commands/help.js +1 -0
- package/dist/cli/commands/kitchen-sink/async.d.ts +11 -0
- package/dist/cli/commands/kitchen-sink/async.js +1 -0
- package/dist/cli/commands/kitchen-sink/index.d.ts +12 -0
- package/dist/cli/commands/kitchen-sink/index.js +1 -0
- package/dist/cli/commands/kitchen-sink/prompts.d.ts +11 -0
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -0
- package/dist/cli/commands/kitchen-sink/static.d.ts +11 -0
- package/dist/cli/commands/kitchen-sink/static.js +1 -0
- package/dist/cli/commands/notifications/generate.d.ts +6 -0
- package/dist/cli/commands/notifications/generate.js +1 -0
- package/dist/cli/commands/notifications/list.d.ts +9 -0
- package/dist/cli/commands/notifications/list.js +1 -0
- package/dist/cli/commands/organization/list.js +1 -0
- package/dist/cli/commands/search.d.ts +14 -0
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/send-analytics.d.ts +5 -0
- package/dist/cli/commands/send-analytics.js +1 -0
- package/dist/cli/commands/theme/check.js +1 -0
- package/dist/cli/commands/theme/console.js +1 -0
- package/dist/cli/commands/theme/delete.js +1 -0
- package/dist/cli/commands/theme/dev.js +1 -0
- package/dist/cli/commands/theme/duplicate.js +1 -0
- package/dist/cli/commands/theme/info.js +1 -0
- package/dist/cli/commands/theme/init.js +1 -0
- package/dist/cli/commands/theme/language-server.js +1 -0
- package/dist/cli/commands/theme/list.js +1 -0
- package/dist/cli/commands/theme/metafields/pull.js +1 -0
- package/dist/cli/commands/theme/open.js +1 -0
- package/dist/cli/commands/theme/package.js +1 -0
- package/dist/cli/commands/theme/preview.js +1 -0
- package/dist/cli/commands/theme/profile.js +1 -0
- package/dist/cli/commands/theme/publish.js +1 -0
- package/dist/cli/commands/theme/pull.js +1 -0
- package/dist/cli/commands/theme/push.js +1 -0
- package/dist/cli/commands/theme/rename.js +1 -0
- package/dist/cli/commands/theme/share.js +1 -0
- package/dist/cli/commands/upgrade.d.ts +7 -0
- package/dist/cli/commands/upgrade.js +1 -0
- package/dist/cli/commands/version.d.ts +5 -0
- package/dist/cli/commands/version.js +1 -0
- package/dist/cli/help.d.ts +38 -0
- package/dist/cli/help.js +2 -0
- package/dist/cli/services/commands/doc/fetch.d.ts +1 -0
- package/dist/cli/services/commands/doc/fetch.js +45 -0
- package/dist/cli/services/commands/doc/search.d.ts +1 -0
- package/dist/cli/services/commands/doc/search.js +47 -0
- package/dist/cli/services/commands/notifications.d.ts +2 -0
- package/dist/cli/services/commands/notifications.js +106 -0
- package/dist/cli/services/commands/search.d.ts +1 -0
- package/dist/cli/services/commands/search.js +7 -0
- package/dist/cli/services/commands/version.d.ts +1 -0
- package/dist/cli/services/commands/version.js +6 -0
- package/dist/cli/services/doctor-release/context.d.ts +16 -0
- package/dist/cli/services/doctor-release/context.js +11 -0
- package/dist/cli/services/doctor-release/theme/runner.d.ts +7 -0
- package/dist/cli/services/doctor-release/theme/runner.js +37 -0
- package/dist/cli/services/doctor-release/theme/tests/init.d.ts +11 -0
- package/dist/cli/services/doctor-release/theme/tests/init.js +34 -0
- package/dist/cli/services/doctor-release/theme/tests/push.d.ts +10 -0
- package/dist/cli/services/doctor-release/theme/tests/push.js +44 -0
- package/dist/cli/services/kitchen-sink/async.d.ts +1 -0
- package/dist/cli/services/kitchen-sink/async.js +65 -0
- package/dist/cli/services/kitchen-sink/prompts.d.ts +1 -0
- package/dist/cli/services/kitchen-sink/prompts.js +168 -0
- package/dist/cli/services/kitchen-sink/static.d.ts +1 -0
- package/dist/cli/services/kitchen-sink/static.js +201 -0
- package/dist/command-registry.d.ts +8 -0
- package/dist/command-registry.js +1 -0
- package/dist/conf-store-ASDCTDQ4.js +1 -0
- package/dist/configs/all.yml +280 -0
- package/dist/configs/nothing.yml +3 -0
- package/dist/configs/recommended.yml +258 -0
- package/dist/configs/theme-app-extension.yml +24 -0
- package/dist/custom-oclif-loader-BWAMUFQ4.js +1 -0
- package/dist/data/app_block_entry.json +13 -0
- package/dist/data/default_setting_values.json +24 -0
- package/dist/data/filters.json +6177 -0
- package/dist/data/latest.json +2 -0
- package/dist/data/local_block_entry.json +25 -0
- package/dist/data/manifest_theme.json +19 -0
- package/dist/data/manifest_theme_app_extension.json +10 -0
- package/dist/data/objects.json +20621 -0
- package/dist/data/preset.json +72 -0
- package/dist/data/preset_blocks.json +91 -0
- package/dist/data/section.json +208 -0
- package/dist/data/setting.json +1538 -0
- package/dist/data/settings.json +10 -0
- package/dist/data/shopify_system_translations.json +2766 -0
- package/dist/data/tags.json +1276 -0
- package/dist/data/targetted_block_entry.json +15 -0
- package/dist/data/theme_block.json +91 -0
- package/dist/data/theme_block_entry.json +14 -0
- package/dist/data/theme_settings.json +83 -0
- package/dist/data/translations.json +63 -0
- package/dist/deprecations-VBQV7Q4O.js +1 -0
- package/dist/devtools-37DE4MUR.js +1 -0
- package/dist/devtools-WAWU5KQL.js +1 -0
- package/dist/dist-FZLOAKU7.js +1 -0
- package/dist/dist-HTY6UHG5.js +1 -0
- package/dist/environments-HSTNEQRG.js +1 -0
- package/dist/error-2LZYKRMA.js +1 -0
- package/dist/error-handler-PIGEJ7BT.js +1 -0
- package/dist/estree-JV5M77BA.js +44 -0
- package/dist/flow-N4JYPYMQ.js +20 -0
- package/dist/fs-BJHNJDDK.js +1 -0
- package/dist/glimmer-JEV3BXHR.js +37 -0
- package/dist/graphql-DTF6MHYF.js +28 -0
- package/dist/hooks/did-you-mean.d.ts +1 -0
- package/dist/hooks/did-you-mean.js +1 -0
- package/dist/hooks/hydrogen-init.d.ts +7 -0
- package/dist/hooks/hydrogen-init.js +1 -0
- package/dist/hooks/plugin-plugins.d.ts +1 -0
- package/dist/hooks/plugin-plugins.js +1 -0
- package/dist/hooks/postrun.d.ts +1 -0
- package/dist/hooks/postrun.js +1 -0
- package/dist/hooks/prerun.d.ts +1 -0
- package/dist/hooks/prerun.js +2 -0
- package/dist/hooks/public-metadata.d.ts +1 -0
- package/dist/hooks/public-metadata.js +1 -0
- package/dist/hooks/sensitive-metadata.d.ts +1 -0
- package/dist/hooks/sensitive-metadata.js +1 -0
- package/dist/hooks/tunnel-provider.d.ts +1 -0
- package/dist/hooks/tunnel-provider.js +1 -0
- package/dist/hooks/tunnel-start.d.ts +1 -0
- package/dist/hooks/tunnel-start.js +1 -0
- package/dist/html-LVOJ3RQS.js +25 -0
- package/dist/http-proxy-node16-A6AKKRQH.js +38 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +120 -0
- package/dist/is-global-6SCOAJVG.js +1 -0
- package/dist/latest-version-LDWU5F7A.js +49 -0
- package/dist/lib-2BR2WN7L.js +1 -0
- package/dist/lib-M72BVWQ3.js +1 -0
- package/dist/lib-O5EZ4NVT.js +1 -0
- package/dist/lib-P3APEIHY.js +1 -0
- package/dist/local-PZWPRFU7.js +1 -0
- package/dist/markdown-J6CE6POI.js +62 -0
- package/dist/meriyah-PNQQZQYI.js +5 -0
- package/dist/metadata-VVBHB3HL.js +1 -0
- package/dist/morph-BMYYMQNX.js +30489 -0
- package/dist/multipart-parser-5NSSTW27.js +2 -0
- package/dist/node-package-manager-ETYQN7OM.js +1 -0
- package/dist/notifications-system-652OG5KL.js +1 -0
- package/dist/npa-A4YSCQ5Q.js +1 -0
- package/dist/open-KLSGXBIW.js +1 -0
- package/dist/os-7D6NT4O3.js +1 -0
- package/dist/out-53ABAVL7.js +1 -0
- package/dist/output-74VDGYJD.js +1 -0
- package/dist/path-MBXP7ZIC.js +1 -0
- package/dist/postcss-Q36SHOML.js +61 -0
- package/dist/prettier-EGVCP5CY.js +1 -0
- package/dist/source-map-E7FCCJL7.js +1 -0
- package/dist/system-P5QIJALL.js +1 -0
- package/dist/templates/ui-extensions/html/error.html.liquid +41 -0
- package/dist/templates/ui-extensions/html/post_purchase/index.html.liquid +44 -0
- package/dist/templates/ui-extensions/html/post_purchase/tunnel-error.html.liquid +41 -0
- package/dist/templates/ui-extensions/html/tunnel-error.html.liquid +55 -0
- package/dist/toml_patch_bg.wasm +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/typescript-5R4Y7PXE.js +1 -0
- package/dist/typescript-WYPDGPSV.js +21 -0
- package/dist/ui-H5I5YVKV.js +1 -0
- package/dist/upgrade-34HSYBXI.js +1 -0
- package/dist/vendor/esbuild-ohos/lib/main.js +2538 -0
- package/dist/vendor/esbuild-ohos/package.json +7 -0
- package/dist/version-EKXEAF6Q.js +1 -0
- package/dist/version-J2PYO6M5.js +1 -0
- package/dist/workerd-X4TGHEG3.js +18 -0
- package/dist/yaml-6KWCJ64X.js +159 -0
- package/dist/yoga.wasm +0 -0
- package/oclif.manifest.json +10100 -0
- package/package.json +153 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type {HydrogenSession} from '@shopify/hydrogen';
|
|
2
|
+
import {
|
|
3
|
+
createCookieSessionStorage,
|
|
4
|
+
type SessionStorage,
|
|
5
|
+
type Session,
|
|
6
|
+
} from 'react-router';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This is a custom session implementation for your Hydrogen shop.
|
|
10
|
+
* Feel free to customize it to your needs, add helper methods, or
|
|
11
|
+
* swap out the cookie-based implementation with something else!
|
|
12
|
+
*/
|
|
13
|
+
export class AppSession implements HydrogenSession {
|
|
14
|
+
public isPending = false;
|
|
15
|
+
|
|
16
|
+
#sessionStorage;
|
|
17
|
+
#session;
|
|
18
|
+
|
|
19
|
+
constructor(sessionStorage: SessionStorage, session: Session) {
|
|
20
|
+
this.#sessionStorage = sessionStorage;
|
|
21
|
+
this.#session = session;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static async init(request: Request, secrets: string[]) {
|
|
25
|
+
const storage = createCookieSessionStorage({
|
|
26
|
+
cookie: {
|
|
27
|
+
name: 'session',
|
|
28
|
+
httpOnly: true,
|
|
29
|
+
path: '/',
|
|
30
|
+
sameSite: 'lax',
|
|
31
|
+
secrets,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const session = await storage
|
|
36
|
+
.getSession(request.headers.get('Cookie'))
|
|
37
|
+
.catch(() => storage.getSession());
|
|
38
|
+
|
|
39
|
+
return new this(storage, session);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get has() {
|
|
43
|
+
return this.#session.has;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get get() {
|
|
47
|
+
return this.#session.get;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get flash() {
|
|
51
|
+
return this.#session.flash;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get unset() {
|
|
55
|
+
this.isPending = true;
|
|
56
|
+
return this.#session.unset;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get set() {
|
|
60
|
+
this.isPending = true;
|
|
61
|
+
return this.#session.set;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
destroy() {
|
|
65
|
+
return this.#sessionStorage.destroySession(this.#session);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
commit() {
|
|
69
|
+
this.isPending = false;
|
|
70
|
+
return this.#sessionStorage.commitSession(this.#session);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {useLocation} from 'react-router';
|
|
2
|
+
import type {SelectedOption} from '@shopify/hydrogen/storefront-api-types';
|
|
3
|
+
import {useMemo} from 'react';
|
|
4
|
+
|
|
5
|
+
export function useVariantUrl(
|
|
6
|
+
handle: string,
|
|
7
|
+
selectedOptions?: SelectedOption[],
|
|
8
|
+
) {
|
|
9
|
+
const {pathname} = useLocation();
|
|
10
|
+
|
|
11
|
+
return useMemo(() => {
|
|
12
|
+
return getVariantUrl({
|
|
13
|
+
handle,
|
|
14
|
+
pathname,
|
|
15
|
+
searchParams: new URLSearchParams(),
|
|
16
|
+
selectedOptions,
|
|
17
|
+
});
|
|
18
|
+
}, [handle, selectedOptions, pathname]);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getVariantUrl({
|
|
22
|
+
handle,
|
|
23
|
+
pathname,
|
|
24
|
+
searchParams,
|
|
25
|
+
selectedOptions,
|
|
26
|
+
}: {
|
|
27
|
+
handle: string;
|
|
28
|
+
pathname: string;
|
|
29
|
+
searchParams: URLSearchParams;
|
|
30
|
+
selectedOptions?: SelectedOption[];
|
|
31
|
+
}) {
|
|
32
|
+
const match = /(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(pathname);
|
|
33
|
+
const isLocalePathname = match && match.length > 0;
|
|
34
|
+
|
|
35
|
+
const path = isLocalePathname
|
|
36
|
+
? `${match![0]}products/${handle}`
|
|
37
|
+
: `/products/${handle}`;
|
|
38
|
+
|
|
39
|
+
selectedOptions?.forEach((option) => {
|
|
40
|
+
searchParams.set(option.name, option.value);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const searchString = searchParams.toString();
|
|
44
|
+
|
|
45
|
+
return path + (searchString ? '?' + searchParams.toString() : '');
|
|
46
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import {Analytics, getShopAnalytics, useNonce} from '@shopify/hydrogen';
|
|
2
|
+
import {
|
|
3
|
+
Outlet,
|
|
4
|
+
useRouteError,
|
|
5
|
+
isRouteErrorResponse,
|
|
6
|
+
type ShouldRevalidateFunction,
|
|
7
|
+
Links,
|
|
8
|
+
Meta,
|
|
9
|
+
Scripts,
|
|
10
|
+
ScrollRestoration,
|
|
11
|
+
useRouteLoaderData,
|
|
12
|
+
} from 'react-router';
|
|
13
|
+
import type {Route} from './+types/root';
|
|
14
|
+
import favicon from '~/assets/favicon.svg';
|
|
15
|
+
import {FOOTER_QUERY, HEADER_QUERY} from '~/lib/fragments';
|
|
16
|
+
import resetStyles from '~/styles/reset.css?url';
|
|
17
|
+
import appStyles from '~/styles/app.css?url';
|
|
18
|
+
import {PageLayout} from './components/PageLayout';
|
|
19
|
+
|
|
20
|
+
export type RootLoader = typeof loader;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This is important to avoid re-fetching root queries on sub-navigations
|
|
24
|
+
*/
|
|
25
|
+
export const shouldRevalidate: ShouldRevalidateFunction = ({
|
|
26
|
+
formMethod,
|
|
27
|
+
currentUrl,
|
|
28
|
+
nextUrl,
|
|
29
|
+
}) => {
|
|
30
|
+
// revalidate when a mutation is performed e.g add to cart, login...
|
|
31
|
+
if (formMethod && formMethod !== 'GET') return true;
|
|
32
|
+
|
|
33
|
+
// revalidate when manually revalidating via useRevalidator
|
|
34
|
+
if (currentUrl.toString() === nextUrl.toString()) return true;
|
|
35
|
+
|
|
36
|
+
// Defaulting to no revalidation for root loader data to improve performance.
|
|
37
|
+
// When using this feature, you risk your UI getting out of sync with your server.
|
|
38
|
+
// Use with caution. If you are uncomfortable with this optimization, update the
|
|
39
|
+
// line below to `return defaultShouldRevalidate` instead.
|
|
40
|
+
// For more details see: https://remix.run/docs/en/main/route/should-revalidate
|
|
41
|
+
return false;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The main and reset stylesheets are added in the Layout component
|
|
46
|
+
* to prevent a bug in development HMR updates.
|
|
47
|
+
*
|
|
48
|
+
* This avoids the "failed to execute 'insertBefore' on 'Node'" error
|
|
49
|
+
* that occurs after editing and navigating to another page.
|
|
50
|
+
*
|
|
51
|
+
* It's a temporary fix until the issue is resolved.
|
|
52
|
+
* https://github.com/remix-run/remix/issues/9242
|
|
53
|
+
*/
|
|
54
|
+
export function links() {
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
rel: 'preconnect',
|
|
58
|
+
href: 'https://cdn.shopify.com',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
rel: 'preconnect',
|
|
62
|
+
href: 'https://shop.app',
|
|
63
|
+
},
|
|
64
|
+
{rel: 'icon', type: 'image/svg+xml', href: favicon},
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export async function loader(args: Route.LoaderArgs) {
|
|
69
|
+
// Start fetching non-critical data without blocking time to first byte
|
|
70
|
+
const deferredData = loadDeferredData(args);
|
|
71
|
+
|
|
72
|
+
// Await the critical data required to render initial state of the page
|
|
73
|
+
const criticalData = await loadCriticalData(args);
|
|
74
|
+
|
|
75
|
+
const {storefront, env} = args.context;
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
...deferredData,
|
|
79
|
+
...criticalData,
|
|
80
|
+
publicStoreDomain: env.PUBLIC_STORE_DOMAIN,
|
|
81
|
+
shop: getShopAnalytics({
|
|
82
|
+
storefront,
|
|
83
|
+
publicStorefrontId: env.PUBLIC_STOREFRONT_ID,
|
|
84
|
+
}),
|
|
85
|
+
consent: {
|
|
86
|
+
checkoutDomain: env.PUBLIC_CHECKOUT_DOMAIN,
|
|
87
|
+
storefrontAccessToken: env.PUBLIC_STOREFRONT_API_TOKEN,
|
|
88
|
+
withPrivacyBanner: false,
|
|
89
|
+
// localize the privacy banner
|
|
90
|
+
country: args.context.storefront.i18n.country,
|
|
91
|
+
language: args.context.storefront.i18n.language,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Load data necessary for rendering content above the fold. This is the critical data
|
|
98
|
+
* needed to render the page. If it's unavailable, the whole page should 400 or 500 error.
|
|
99
|
+
*/
|
|
100
|
+
async function loadCriticalData({context}: Route.LoaderArgs) {
|
|
101
|
+
const {storefront} = context;
|
|
102
|
+
|
|
103
|
+
const [header] = await Promise.all([
|
|
104
|
+
storefront.query(HEADER_QUERY, {
|
|
105
|
+
cache: storefront.CacheLong(),
|
|
106
|
+
variables: {
|
|
107
|
+
headerMenuHandle: 'main-menu', // Adjust to your header menu handle
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
// Add other queries here, so that they are loaded in parallel
|
|
111
|
+
]);
|
|
112
|
+
|
|
113
|
+
return {header};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Load data for rendering content below the fold. This data is deferred and will be
|
|
118
|
+
* fetched after the initial page load. If it's unavailable, the page should still 200.
|
|
119
|
+
* Make sure to not throw any errors here, as it will cause the page to 500.
|
|
120
|
+
*/
|
|
121
|
+
function loadDeferredData({context}: Route.LoaderArgs) {
|
|
122
|
+
const {storefront, customerAccount, cart} = context;
|
|
123
|
+
|
|
124
|
+
// defer the footer query (below the fold)
|
|
125
|
+
const footer = storefront
|
|
126
|
+
.query(FOOTER_QUERY, {
|
|
127
|
+
cache: storefront.CacheLong(),
|
|
128
|
+
variables: {
|
|
129
|
+
footerMenuHandle: 'footer', // Adjust to your footer menu handle
|
|
130
|
+
},
|
|
131
|
+
})
|
|
132
|
+
.catch((error: Error) => {
|
|
133
|
+
// Log query errors, but don't throw them so the page can still render
|
|
134
|
+
console.error(error);
|
|
135
|
+
return null;
|
|
136
|
+
});
|
|
137
|
+
return {
|
|
138
|
+
cart: cart.get(),
|
|
139
|
+
isLoggedIn: customerAccount.isLoggedIn(),
|
|
140
|
+
footer,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function Layout({children}: {children?: React.ReactNode}) {
|
|
145
|
+
const nonce = useNonce();
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<html lang="en">
|
|
149
|
+
<head>
|
|
150
|
+
<meta charSet="utf-8" />
|
|
151
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
152
|
+
<link rel="stylesheet" href={resetStyles}></link>
|
|
153
|
+
<link rel="stylesheet" href={appStyles}></link>
|
|
154
|
+
<Meta />
|
|
155
|
+
<Links />
|
|
156
|
+
</head>
|
|
157
|
+
<body>
|
|
158
|
+
{children}
|
|
159
|
+
<ScrollRestoration nonce={nonce} />
|
|
160
|
+
<Scripts nonce={nonce} />
|
|
161
|
+
</body>
|
|
162
|
+
</html>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export default function App() {
|
|
167
|
+
const data = useRouteLoaderData<RootLoader>('root');
|
|
168
|
+
|
|
169
|
+
if (!data) {
|
|
170
|
+
return <Outlet />;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<Analytics.Provider
|
|
175
|
+
cart={data.cart}
|
|
176
|
+
shop={data.shop}
|
|
177
|
+
consent={data.consent}
|
|
178
|
+
>
|
|
179
|
+
<PageLayout {...data}>
|
|
180
|
+
<Outlet />
|
|
181
|
+
</PageLayout>
|
|
182
|
+
</Analytics.Provider>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function ErrorBoundary() {
|
|
187
|
+
const error = useRouteError();
|
|
188
|
+
let errorMessage = 'Unknown error';
|
|
189
|
+
let errorStatus = 500;
|
|
190
|
+
|
|
191
|
+
if (isRouteErrorResponse(error)) {
|
|
192
|
+
errorMessage = error?.data?.message ?? error.data;
|
|
193
|
+
errorStatus = error.status;
|
|
194
|
+
} else if (error instanceof Error) {
|
|
195
|
+
errorMessage = error.message;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<div className="route-error">
|
|
200
|
+
<h1>Oops</h1>
|
|
201
|
+
<h2>{errorStatus}</h2>
|
|
202
|
+
{errorMessage && (
|
|
203
|
+
<fieldset>
|
|
204
|
+
<pre>{errorMessage}</pre>
|
|
205
|
+
</fieldset>
|
|
206
|
+
)}
|
|
207
|
+
</div>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type {Route} from './+types/$';
|
|
2
|
+
|
|
3
|
+
export async function loader({request}: Route.LoaderArgs) {
|
|
4
|
+
throw new Response(`${new URL(request.url).pathname} not found`, {
|
|
5
|
+
status: 404,
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function CatchAllPage() {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type {Route} from './+types/[robots.txt]';
|
|
2
|
+
|
|
3
|
+
export function loader({request}: Route.LoaderArgs) {
|
|
4
|
+
const url = new URL(request.url);
|
|
5
|
+
const body = robotsTxtData({url: url.origin});
|
|
6
|
+
|
|
7
|
+
return new Response(body, {
|
|
8
|
+
status: 200,
|
|
9
|
+
headers: {
|
|
10
|
+
'Content-Type': 'text/plain',
|
|
11
|
+
|
|
12
|
+
'Cache-Control': `max-age=${60 * 60 * 24}`,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function robotsTxtData({url}: {url?: string}) {
|
|
18
|
+
const sitemapUrl = url ? `${url}/sitemap.xml` : undefined;
|
|
19
|
+
|
|
20
|
+
return `
|
|
21
|
+
User-agent: *
|
|
22
|
+
${generalDisallowRules({sitemapUrl})}
|
|
23
|
+
|
|
24
|
+
# Google adsbot ignores robots.txt unless specifically named!
|
|
25
|
+
User-agent: adsbot-google
|
|
26
|
+
Disallow: /cart
|
|
27
|
+
Disallow: /account
|
|
28
|
+
Disallow: /search
|
|
29
|
+
Allow: /search/
|
|
30
|
+
Disallow: /search/?*
|
|
31
|
+
|
|
32
|
+
User-agent: Nutch
|
|
33
|
+
Disallow: /
|
|
34
|
+
|
|
35
|
+
User-agent: AhrefsBot
|
|
36
|
+
Crawl-delay: 10
|
|
37
|
+
${generalDisallowRules({sitemapUrl})}
|
|
38
|
+
|
|
39
|
+
User-agent: AhrefsSiteAudit
|
|
40
|
+
Crawl-delay: 10
|
|
41
|
+
${generalDisallowRules({sitemapUrl})}
|
|
42
|
+
|
|
43
|
+
User-agent: MJ12bot
|
|
44
|
+
Crawl-Delay: 10
|
|
45
|
+
|
|
46
|
+
User-agent: Pinterest
|
|
47
|
+
Crawl-delay: 1
|
|
48
|
+
`.trim();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* This function generates disallow rules that generally follow what Shopify's
|
|
53
|
+
* Online Store has as defaults for their robots.txt
|
|
54
|
+
*/
|
|
55
|
+
function generalDisallowRules({sitemapUrl}: {sitemapUrl?: string}) {
|
|
56
|
+
return `Disallow: /cart
|
|
57
|
+
Disallow: /account
|
|
58
|
+
Disallow: /collections/*sort_by*
|
|
59
|
+
Disallow: /*/collections/*sort_by*
|
|
60
|
+
Disallow: /collections/*+*
|
|
61
|
+
Disallow: /collections/*%2B*
|
|
62
|
+
Disallow: /collections/*%2b*
|
|
63
|
+
Disallow: /*/collections/*+*
|
|
64
|
+
Disallow: /*/collections/*%2B*
|
|
65
|
+
Disallow: /*/collections/*%2b*
|
|
66
|
+
Disallow: /*/collections/*filter*&*filter*
|
|
67
|
+
Disallow: /blogs/*+*
|
|
68
|
+
Disallow: /blogs/*%2B*
|
|
69
|
+
Disallow: /blogs/*%2b*
|
|
70
|
+
Disallow: /*/blogs/*+*
|
|
71
|
+
Disallow: /*/blogs/*%2B*
|
|
72
|
+
Disallow: /*/blogs/*%2b*
|
|
73
|
+
Disallow: /policies/
|
|
74
|
+
Disallow: /search
|
|
75
|
+
Allow: /search/
|
|
76
|
+
Disallow: /search/?*
|
|
77
|
+
${sitemapUrl ? `Sitemap: ${sitemapUrl}` : ''}`;
|
|
78
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type {Route} from './+types/[sitemap.xml]';
|
|
2
|
+
import {getSitemapIndex} from '@shopify/hydrogen';
|
|
3
|
+
|
|
4
|
+
export async function loader({
|
|
5
|
+
request,
|
|
6
|
+
context: {storefront},
|
|
7
|
+
}: Route.LoaderArgs) {
|
|
8
|
+
const response = await getSitemapIndex({
|
|
9
|
+
storefront,
|
|
10
|
+
request,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
response.headers.set('Cache-Control', `max-age=${60 * 60 * 24}`);
|
|
14
|
+
|
|
15
|
+
return response;
|
|
16
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import {Await, useLoaderData, Link} from 'react-router';
|
|
2
|
+
import type {Route} from './+types/_index';
|
|
3
|
+
import {Suspense} from 'react';
|
|
4
|
+
import {Image} from '@shopify/hydrogen';
|
|
5
|
+
import type {
|
|
6
|
+
FeaturedCollectionFragment,
|
|
7
|
+
RecommendedProductsQuery,
|
|
8
|
+
} from 'storefrontapi.generated';
|
|
9
|
+
import {ProductItem} from '~/components/ProductItem';
|
|
10
|
+
import {MockShopNotice} from '~/components/MockShopNotice';
|
|
11
|
+
|
|
12
|
+
export const meta: Route.MetaFunction = () => {
|
|
13
|
+
return [{title: 'Hydrogen | Home'}];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export async function loader(args: Route.LoaderArgs) {
|
|
17
|
+
// Start fetching non-critical data without blocking time to first byte
|
|
18
|
+
const deferredData = loadDeferredData(args);
|
|
19
|
+
|
|
20
|
+
// Await the critical data required to render initial state of the page
|
|
21
|
+
const criticalData = await loadCriticalData(args);
|
|
22
|
+
|
|
23
|
+
return {...deferredData, ...criticalData};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Load data necessary for rendering content above the fold. This is the critical data
|
|
28
|
+
* needed to render the page. If it's unavailable, the whole page should 400 or 500 error.
|
|
29
|
+
*/
|
|
30
|
+
async function loadCriticalData({context}: Route.LoaderArgs) {
|
|
31
|
+
const [{collections}] = await Promise.all([
|
|
32
|
+
context.storefront.query(FEATURED_COLLECTION_QUERY),
|
|
33
|
+
// Add other queries here, so that they are loaded in parallel
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
isShopLinked: Boolean(context.env.PUBLIC_STORE_DOMAIN),
|
|
38
|
+
featuredCollection: collections.nodes[0],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Load data for rendering content below the fold. This data is deferred and will be
|
|
44
|
+
* fetched after the initial page load. If it's unavailable, the page should still 200.
|
|
45
|
+
* Make sure to not throw any errors here, as it will cause the page to 500.
|
|
46
|
+
*/
|
|
47
|
+
function loadDeferredData({context}: Route.LoaderArgs) {
|
|
48
|
+
const recommendedProducts = context.storefront
|
|
49
|
+
.query(RECOMMENDED_PRODUCTS_QUERY)
|
|
50
|
+
.catch((error: Error) => {
|
|
51
|
+
// Log query errors, but don't throw them so the page can still render
|
|
52
|
+
console.error(error);
|
|
53
|
+
return null;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
recommendedProducts,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default function Homepage() {
|
|
62
|
+
const data = useLoaderData<typeof loader>();
|
|
63
|
+
return (
|
|
64
|
+
<div className="home">
|
|
65
|
+
{data.isShopLinked ? null : <MockShopNotice />}
|
|
66
|
+
<FeaturedCollection collection={data.featuredCollection} />
|
|
67
|
+
<RecommendedProducts products={data.recommendedProducts} />
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function FeaturedCollection({
|
|
73
|
+
collection,
|
|
74
|
+
}: {
|
|
75
|
+
collection: FeaturedCollectionFragment;
|
|
76
|
+
}) {
|
|
77
|
+
if (!collection) return null;
|
|
78
|
+
const image = collection?.image;
|
|
79
|
+
return (
|
|
80
|
+
<Link
|
|
81
|
+
className="featured-collection"
|
|
82
|
+
to={`/collections/${collection.handle}`}
|
|
83
|
+
>
|
|
84
|
+
{image && (
|
|
85
|
+
<div className="featured-collection-image">
|
|
86
|
+
<Image
|
|
87
|
+
data={image}
|
|
88
|
+
sizes="100vw"
|
|
89
|
+
alt={image.altText || collection.title}
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
93
|
+
<h1>{collection.title}</h1>
|
|
94
|
+
</Link>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function RecommendedProducts({
|
|
99
|
+
products,
|
|
100
|
+
}: {
|
|
101
|
+
products: Promise<RecommendedProductsQuery | null>;
|
|
102
|
+
}) {
|
|
103
|
+
return (
|
|
104
|
+
<section
|
|
105
|
+
className="recommended-products"
|
|
106
|
+
aria-labelledby="recommended-products"
|
|
107
|
+
>
|
|
108
|
+
<h2 id="recommended-products">Recommended Products</h2>
|
|
109
|
+
<Suspense fallback={<div>Loading...</div>}>
|
|
110
|
+
<Await resolve={products}>
|
|
111
|
+
{(response) => (
|
|
112
|
+
<div className="recommended-products-grid">
|
|
113
|
+
{response
|
|
114
|
+
? response.products.nodes.map((product) => (
|
|
115
|
+
<ProductItem key={product.id} product={product} />
|
|
116
|
+
))
|
|
117
|
+
: null}
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
</Await>
|
|
121
|
+
</Suspense>
|
|
122
|
+
<br />
|
|
123
|
+
</section>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const FEATURED_COLLECTION_QUERY = `#graphql
|
|
128
|
+
fragment FeaturedCollection on Collection {
|
|
129
|
+
id
|
|
130
|
+
title
|
|
131
|
+
image {
|
|
132
|
+
id
|
|
133
|
+
url
|
|
134
|
+
altText
|
|
135
|
+
width
|
|
136
|
+
height
|
|
137
|
+
}
|
|
138
|
+
handle
|
|
139
|
+
}
|
|
140
|
+
query FeaturedCollection($country: CountryCode, $language: LanguageCode)
|
|
141
|
+
@inContext(country: $country, language: $language) {
|
|
142
|
+
collections(first: 1, sortKey: UPDATED_AT, reverse: true) {
|
|
143
|
+
nodes {
|
|
144
|
+
...FeaturedCollection
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
` as const;
|
|
149
|
+
|
|
150
|
+
const RECOMMENDED_PRODUCTS_QUERY = `#graphql
|
|
151
|
+
fragment RecommendedProduct on Product {
|
|
152
|
+
id
|
|
153
|
+
title
|
|
154
|
+
handle
|
|
155
|
+
priceRange {
|
|
156
|
+
minVariantPrice {
|
|
157
|
+
amount
|
|
158
|
+
currencyCode
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
featuredImage {
|
|
162
|
+
id
|
|
163
|
+
url
|
|
164
|
+
altText
|
|
165
|
+
width
|
|
166
|
+
height
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
query RecommendedProducts ($country: CountryCode, $language: LanguageCode)
|
|
170
|
+
@inContext(country: $country, language: $language) {
|
|
171
|
+
products(first: 4, sortKey: UPDATED_AT, reverse: true) {
|
|
172
|
+
nodes {
|
|
173
|
+
...RecommendedProduct
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
` as const;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {redirect} from 'react-router';
|
|
2
|
+
import type {Route} from './+types/account.$';
|
|
3
|
+
|
|
4
|
+
// fallback wild card for all unauthenticated routes in account section
|
|
5
|
+
export async function loader({context}: Route.LoaderArgs) {
|
|
6
|
+
await context.customerAccount.handleAuthStatus();
|
|
7
|
+
|
|
8
|
+
return redirect('/account');
|
|
9
|
+
}
|