@shopify/cli 3.68.0 → 3.69.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.
Files changed (124) hide show
  1. package/dist/assets/graphiql/style.css +58 -0
  2. package/dist/assets/hydrogen/starter/CHANGELOG.md +19 -0
  3. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +24 -1
  4. package/dist/assets/hydrogen/starter/app/components/Header.tsx +13 -6
  5. package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +5 -3
  6. package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +10 -25
  7. package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +3 -1
  8. package/dist/assets/hydrogen/starter/package.json +4 -4
  9. package/dist/{chokidar-4TKDAB27.js → chokidar-OESTCX4H.js} +571 -8
  10. package/dist/{chunk-BFQFJ7IZ.js → chunk-27ILOE3X.js} +93 -5
  11. package/dist/{chunk-G47SEBU3.js → chunk-2KS65IIG.js} +4 -4
  12. package/dist/{chunk-IL455HI5.js → chunk-2MYCKNTK.js} +3 -3
  13. package/dist/{chunk-GDKBDEZV.js → chunk-3ABJXNVW.js} +4 -4
  14. package/dist/{chunk-INEJACZ7.js → chunk-4N3RFONW.js} +3 -3
  15. package/dist/{chunk-RUR45G5U.js → chunk-5CWXBRLN.js} +3 -3
  16. package/dist/{chunk-QIBFYG6F.js → chunk-6LAVKC2D.js} +3 -3
  17. package/dist/{chunk-4H7GRGC6.js → chunk-6X6RXSOY.js} +3 -3
  18. package/dist/{chunk-MXZ6B3TP.js → chunk-6Y4AUHLY.js} +2 -2
  19. package/dist/{chunk-WJBW5QHV.js → chunk-7FIKIM5M.js} +2 -2
  20. package/dist/{chunk-HTDUPJH5.js → chunk-7HUDUSI4.js} +3 -3
  21. package/dist/{chunk-NCUKAORS.js → chunk-7ZKC5ILI.js} +9 -9
  22. package/dist/{chunk-LAPJDMM4.js → chunk-A3JXD7N7.js} +2 -2
  23. package/dist/{chunk-FKQTUQ3O.js → chunk-BSDFEZQG.js} +5 -5
  24. package/dist/{chunk-JAQZDU4S.js → chunk-C5PPIQTU.js} +2 -2
  25. package/dist/{chunk-XCGES3AJ.js → chunk-CKBSX6XG.js} +3 -3
  26. package/dist/{chunk-A3DV6VXO.js → chunk-E4UK3DDW.js} +2 -2
  27. package/dist/{chunk-CLB5CEKJ.js → chunk-ERVB6ERU.js} +3 -3
  28. package/dist/{chunk-DD5ULVKP.js → chunk-FCPMBTDR.js} +3 -3
  29. package/dist/{chunk-JJOZP7G6.js → chunk-FGJNGEQU.js} +3 -3
  30. package/dist/{chunk-WUA6LTEH.js → chunk-GZPZCHO4.js} +8 -8
  31. package/dist/{chunk-6IS7OFWG.js → chunk-M7RSCDR3.js} +5 -5
  32. package/dist/{chunk-ZJZ3SGOJ.js → chunk-MW2MPXIP.js} +2 -2
  33. package/dist/{chunk-F27QYMO7.js → chunk-MX4RJDBM.js} +591 -20
  34. package/dist/{chunk-ZFVK6EQX.js → chunk-NB4NLOEJ.js} +142 -703
  35. package/dist/{chunk-EUBA2XGP.js → chunk-NDBAW6KJ.js} +7 -7
  36. package/dist/{chunk-7PUJMPXN.js → chunk-OBGMH362.js} +142 -860
  37. package/dist/{chunk-OBX5DIH4.js → chunk-OFXRW54F.js} +4 -4
  38. package/dist/{chunk-NZDBLGNM.js → chunk-P7JUHQKL.js} +1 -2
  39. package/dist/{chunk-VVY6VJR6.js → chunk-QNT2C5AG.js} +3 -3
  40. package/dist/{chunk-C4FBYE7F.js → chunk-STUT2ORI.js} +4 -4
  41. package/dist/{chunk-YKH4ILAB.js → chunk-T5NVZ7CN.js} +76 -77
  42. package/dist/{chunk-JR6ZN4TY.js → chunk-TCFVEGET.js} +5 -5
  43. package/dist/{chunk-UCYJX4VB.js → chunk-TW5OG5SK.js} +2 -2
  44. package/dist/{chunk-E2OAY724.js → chunk-UBD3BPIF.js} +2 -2
  45. package/dist/{chunk-DMM6NVLV.js → chunk-VOAOZJT3.js} +4 -4
  46. package/dist/{chunk-5VZ6BLBM.js → chunk-VU6JM57U.js} +3 -3
  47. package/dist/{chunk-D72SCNZ2.js → chunk-XQBHX6FC.js} +139 -37
  48. package/dist/{chunk-FIAUTHMT.js → chunk-YC5ZCSKV.js} +2 -2
  49. package/dist/{chunk-JAH3NBCG.js → chunk-YYE7F3MT.js} +4 -4
  50. package/dist/cli/commands/auth/logout.js +15 -17
  51. package/dist/cli/commands/auth/logout.test.js +16 -18
  52. package/dist/cli/commands/debug/command-flags.js +14 -16
  53. package/dist/cli/commands/demo/catalog.js +15 -17
  54. package/dist/cli/commands/demo/generate-file.js +15 -17
  55. package/dist/cli/commands/demo/index.js +15 -17
  56. package/dist/cli/commands/demo/print-ai-prompt.js +15 -17
  57. package/dist/cli/commands/docs/generate.js +14 -16
  58. package/dist/cli/commands/docs/generate.test.js +14 -16
  59. package/dist/cli/commands/help.js +14 -16
  60. package/dist/cli/commands/kitchen-sink/async.js +15 -17
  61. package/dist/cli/commands/kitchen-sink/async.test.js +15 -17
  62. package/dist/cli/commands/kitchen-sink/index.js +17 -19
  63. package/dist/cli/commands/kitchen-sink/index.test.js +17 -19
  64. package/dist/cli/commands/kitchen-sink/prompts.js +15 -17
  65. package/dist/cli/commands/kitchen-sink/prompts.test.js +15 -17
  66. package/dist/cli/commands/kitchen-sink/static.js +15 -17
  67. package/dist/cli/commands/kitchen-sink/static.test.js +15 -17
  68. package/dist/cli/commands/search.js +15 -17
  69. package/dist/cli/commands/upgrade.js +15 -17
  70. package/dist/cli/commands/version.js +15 -17
  71. package/dist/cli/commands/version.test.js +15 -17
  72. package/dist/cli/services/commands/search.js +7 -9
  73. package/dist/cli/services/commands/search.test.js +7 -9
  74. package/dist/cli/services/commands/version.js +8 -10
  75. package/dist/cli/services/commands/version.test.js +9 -11
  76. package/dist/cli/services/demo.js +7 -9
  77. package/dist/cli/services/demo.test.js +7 -9
  78. package/dist/cli/services/kitchen-sink/async.js +7 -9
  79. package/dist/cli/services/kitchen-sink/prompts.js +7 -9
  80. package/dist/cli/services/kitchen-sink/static.js +7 -9
  81. package/dist/cli/services/upgrade.js +8 -10
  82. package/dist/cli/services/upgrade.test.js +10 -12
  83. package/dist/{constants-TR6ABVLJ.js → constants-T7JXE5K7.js} +2 -2
  84. package/dist/{custom-oclif-loader-Y5TLP3GI.js → custom-oclif-loader-5V334D6O.js} +9 -11
  85. package/dist/{del-EL3PLWCY.js → del-7ZS2Z64N.js} +4 -4
  86. package/dist/{error-handler-EORUUIBK.js → error-handler-HMFDDM23.js} +13 -15
  87. package/dist/hooks/postrun.js +14 -15
  88. package/dist/hooks/prerun.js +12 -14
  89. package/dist/index.js +4573 -3762
  90. package/dist/{lib-4WCTNKJK.js → lib-JHUCJTHS.js} +5 -6
  91. package/dist/{local-4NQ3UGM2.js → local-AL4CN3PY.js} +7 -11
  92. package/dist/{morph-WDFBUXWF.js → morph-QZYXTRWT.js} +11 -11
  93. package/dist/{node-NWOSUD3V.js → node-V4CKO2VA.js} +18 -20
  94. package/dist/{node-package-manager-D7JIOBLM.js → node-package-manager-OQVXGQ6S.js} +8 -10
  95. package/dist/out-ZDSLKX4N.js +7 -0
  96. package/dist/{system-WDT2XUAD.js → system-L7GYVRHB.js} +7 -9
  97. package/dist/tsconfig.tsbuildinfo +1 -1
  98. package/dist/{ui-JUVEDXYN.js → ui-TYMS2HPU.js} +7 -9
  99. package/dist/{workerd-VWTWLJIV.js → workerd-3T7EKFXS.js} +17 -19
  100. package/oclif.manifest.json +30 -49
  101. package/package.json +19 -8
  102. package/dist/assets/auth-error.html +0 -23
  103. package/dist/assets/empty-url.html +0 -23
  104. package/dist/assets/favicon.svg +0 -26
  105. package/dist/assets/missing-code.html +0 -23
  106. package/dist/assets/missing-state.html +0 -23
  107. package/dist/assets/style.css +0 -58
  108. package/dist/assets/success.html +0 -20
  109. package/dist/chunk-2AW6NZQ5.js +0 -101
  110. package/dist/chunk-QETDXAFX.js +0 -106
  111. package/dist/lib-H3ZZGS7I.js +0 -1322
  112. package/dist/out-66YUO4CT.js +0 -7
  113. package/dist/templates/theme-extension/assets/thumbs-up.png +0 -0
  114. package/dist/templates/theme-extension/blocks/star_rating.liquid.raw +0 -21
  115. package/dist/templates/theme-extension/locales/en.default.json +0 -10
  116. package/dist/templates/theme-extension/shopify.extension.toml.liquid +0 -3
  117. package/dist/templates/theme-extension/snippets/stars.liquid.raw +0 -10
  118. package/dist/templates/ui-extensions/projects/product_subscription/package.json.liquid +0 -25
  119. package/dist/templates/ui-extensions/projects/product_subscription/shopify.extension.toml.liquid +0 -3
  120. package/dist/templates/ui-extensions/projects/product_subscription/src/index.liquid +0 -46
  121. package/dist/templates/ui-extensions/projects/web_pixel_extension/README.md +0 -23
  122. package/dist/templates/ui-extensions/projects/web_pixel_extension/package.json.liquid +0 -9
  123. package/dist/templates/ui-extensions/projects/web_pixel_extension/shopify.extension.toml.liquid +0 -16
  124. package/dist/templates/ui-extensions/projects/web_pixel_extension/src/index.liquid +0 -10
@@ -0,0 +1,58 @@
1
+ html {
2
+ font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;
3
+ text-size-adjust: 100%;
4
+ text-rendering: optimizeLegibility;
5
+ -webkit-font-smoothing: antialiased;
6
+ -moz-osx-font-smoothing: grayscale;
7
+ }
8
+
9
+ body {
10
+ font-size: 26px;
11
+ line-height: normal;
12
+ margin: 0;
13
+ padding: 0;
14
+ }
15
+
16
+ button, input, optgroup, select, textarea {
17
+ font-family: inherit;
18
+ }
19
+
20
+ h1 {
21
+ font-weight: 600;
22
+ font-size: 1em;
23
+ }
24
+
25
+ p {
26
+ font-weight: 400;
27
+ }
28
+
29
+ .body-success {
30
+ color: #F6F6F7;
31
+ }
32
+
33
+ .body-error {
34
+ color: #202223;
35
+ }
36
+
37
+ .app-success {
38
+ width: 100vw;
39
+ height: 100vh;
40
+ background-color: #054A49;
41
+ display: flex;
42
+ }
43
+
44
+ .app-error {
45
+ width: 100vw;
46
+ height: 100vh;
47
+ background-color: #F6F6F7;
48
+ display: flex;
49
+ }
50
+
51
+ .container {
52
+ display: flex;
53
+ flex-direction: column;
54
+ justify-content: center;
55
+ width: 100%;
56
+ height: 100%;
57
+ padding-left: 7.5em;
58
+ }
@@ -1,5 +1,24 @@
1
1
  # skeleton
2
2
 
3
+ ## 2024.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Use HTML datalist element for query suggestions for autocomplete experience ([#2506](https://github.com/Shopify/hydrogen/pull/2506)) by [@frontsideair](https://github.com/frontsideair)
8
+
9
+ - Bump cli packages version ([#2592](https://github.com/Shopify/hydrogen/pull/2592)) by [@wizardlyhel](https://github.com/wizardlyhel)
10
+
11
+ - Updated dependencies [[`e963389d`](https://github.com/Shopify/hydrogen/commit/e963389d011b1cb44e2874fa332dc355c0d38eb9), [`d08d8c37`](https://github.com/Shopify/hydrogen/commit/d08d8c3779564cc55749f24bed1f6a2958a0a865)]:
12
+ - @shopify/hydrogen@2024.7.9
13
+
14
+ ## 2024.7.9
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [[`f3363030`](https://github.com/Shopify/hydrogen/commit/f3363030a50bd24d946427e01b88ba77253a6cc9), [`bb5b0979`](https://github.com/Shopify/hydrogen/commit/bb5b0979ddffb007111885b3a9b7aa490a3c6882)]:
19
+ - @shopify/hydrogen@2024.7.8
20
+ - @shopify/remix-oxygen@2.0.8
21
+
3
22
  ## 2024.7.8
4
23
 
5
24
  ### Patch Changes
@@ -1,4 +1,10 @@
1
- import {createContext, type ReactNode, useContext, useState} from 'react';
1
+ import {
2
+ createContext,
3
+ type ReactNode,
4
+ useContext,
5
+ useEffect,
6
+ useState,
7
+ } from 'react';
2
8
 
3
9
  type AsideType = 'search' | 'cart' | 'mobile' | 'closed';
4
10
  type AsideContextValue = {
@@ -29,6 +35,23 @@ export function Aside({
29
35
  const {type: activeType, close} = useAside();
30
36
  const expanded = type === activeType;
31
37
 
38
+ useEffect(() => {
39
+ const abortController = new AbortController();
40
+
41
+ if (expanded) {
42
+ document.addEventListener(
43
+ 'keydown',
44
+ function handler(event: KeyboardEvent) {
45
+ if (event.key === 'Escape') {
46
+ close();
47
+ }
48
+ },
49
+ {signal: abortController.signal},
50
+ );
51
+ }
52
+ return () => abortController.abort();
53
+ }, [close, expanded]);
54
+
32
55
  return (
33
56
  <div
34
57
  aria-modal
@@ -1,6 +1,10 @@
1
1
  import {Suspense} from 'react';
2
- import {Await, NavLink} from '@remix-run/react';
3
- import {type CartViewPayload, useAnalytics} from '@shopify/hydrogen';
2
+ import {Await, NavLink, useAsyncValue} from '@remix-run/react';
3
+ import {
4
+ type CartViewPayload,
5
+ useAnalytics,
6
+ useOptimisticCart,
7
+ } from '@shopify/hydrogen';
4
8
  import type {HeaderQuery, CartApiQueryFragment} from 'storefrontapi.generated';
5
9
  import {useAside} from '~/components/Aside';
6
10
 
@@ -159,15 +163,18 @@ function CartToggle({cart}: Pick<HeaderProps, 'cart'>) {
159
163
  return (
160
164
  <Suspense fallback={<CartBadge count={null} />}>
161
165
  <Await resolve={cart}>
162
- {(cart) => {
163
- if (!cart) return <CartBadge count={0} />;
164
- return <CartBadge count={cart.totalQuantity || 0} />;
165
- }}
166
+ <CartBanner />
166
167
  </Await>
167
168
  </Suspense>
168
169
  );
169
170
  }
170
171
 
172
+ function CartBanner() {
173
+ const originalCart = useAsyncValue() as CartApiQueryFragment | null;
174
+ const cart = useOptimisticCart(originalCart);
175
+ return <CartBadge count={cart?.totalQuantity ?? 0} />;
176
+ }
177
+
171
178
  const FALLBACK_HEADER_MENU = {
172
179
  id: 'gid://shopify/Menu/199655587896',
173
180
  items: [
@@ -1,5 +1,5 @@
1
1
  import {Await, Link} from '@remix-run/react';
2
- import {Suspense} from 'react';
2
+ import {Suspense, useId} from 'react';
3
3
  import type {
4
4
  CartApiQueryFragment,
5
5
  FooterQuery,
@@ -70,6 +70,7 @@ function CartAside({cart}: {cart: PageLayoutProps['cart']}) {
70
70
  }
71
71
 
72
72
  function SearchAside() {
73
+ const queriesDatalistId = useId();
73
74
  return (
74
75
  <Aside type="search" heading="SEARCH">
75
76
  <div className="predictive-search">
@@ -84,6 +85,7 @@ function SearchAside() {
84
85
  placeholder="Search"
85
86
  ref={inputRef}
86
87
  type="search"
88
+ list={queriesDatalistId}
87
89
  />
88
90
  &nbsp;
89
91
  <button onClick={goToSearch}>Search</button>
@@ -92,7 +94,7 @@ function SearchAside() {
92
94
  </SearchFormPredictive>
93
95
 
94
96
  <SearchResultsPredictive>
95
- {({items, total, term, state, inputRef, closeSearch}) => {
97
+ {({items, total, term, state, closeSearch}) => {
96
98
  const {articles, collections, pages, products, queries} = items;
97
99
 
98
100
  if (state === 'loading' && term.current) {
@@ -107,7 +109,7 @@ function SearchAside() {
107
109
  <>
108
110
  <SearchResultsPredictive.Queries
109
111
  queries={queries}
110
- inputRef={inputRef}
112
+ queriesDatalistId={queriesDatalistId}
111
113
  />
112
114
  <SearchResultsPredictive.Products
113
115
  products={products}
@@ -244,35 +244,20 @@ function SearchResultsPredictiveProducts({
244
244
 
245
245
  function SearchResultsPredictiveQueries({
246
246
  queries,
247
- inputRef,
248
- }: PartialPredictiveSearchResult<'queries', 'inputRef'>) {
247
+ queriesDatalistId,
248
+ }: PartialPredictiveSearchResult<'queries', never> & {
249
+ queriesDatalistId: string;
250
+ }) {
249
251
  if (!queries.length) return null;
250
252
 
251
253
  return (
252
- <div className="predictive-search-result" key="queries">
253
- <h5>Queries</h5>
254
- <ul>
255
- {queries.map((suggestion) => {
256
- if (!suggestion) return null;
254
+ <datalist id={queriesDatalistId}>
255
+ {queries.map((suggestion) => {
256
+ if (!suggestion) return null;
257
257
 
258
- return (
259
- <li className="predictive-search-result-item" key={suggestion.text}>
260
- <div
261
- role="presentation"
262
- onClick={() => {
263
- if (!inputRef.current) return;
264
- inputRef.current.value = suggestion.text;
265
- inputRef.current.focus();
266
- }}
267
- dangerouslySetInnerHTML={{
268
- __html: suggestion?.styledText,
269
- }}
270
- />
271
- </li>
272
- );
273
- })}
274
- </ul>
275
- </div>
258
+ return <option key={suggestion.text} value={suggestion.text} />;
259
+ })}
260
+ </datalist>
276
261
  );
277
262
  }
278
263
 
@@ -29,7 +29,9 @@ export async function loader({params, context}: LoaderFunctionArgs) {
29
29
 
30
30
  const lineItems = flattenConnection(order.lineItems);
31
31
  const discountApplications = flattenConnection(order.discountApplications);
32
- const fulfillmentStatus = flattenConnection(order.fulfillments)[0].status;
32
+
33
+ const fulfillmentStatus =
34
+ flattenConnection(order.fulfillments)[0]?.status ?? 'N/A';
33
35
 
34
36
  const firstDiscount = discountApplications[0]?.value;
35
37
 
@@ -2,7 +2,7 @@
2
2
  "name": "skeleton",
3
3
  "private": true,
4
4
  "sideEffects": false,
5
- "version": "2024.7.8",
5
+ "version": "2024.7.10",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "shopify hydrogen build --codegen",
@@ -16,8 +16,8 @@
16
16
  "dependencies": {
17
17
  "@remix-run/react": "^2.10.1",
18
18
  "@remix-run/server-runtime": "^2.10.1",
19
- "@shopify/hydrogen": "2024.7.7",
20
- "@shopify/remix-oxygen": "^2.0.7",
19
+ "@shopify/hydrogen": "2024.7.9",
20
+ "@shopify/remix-oxygen": "^2.0.8",
21
21
  "graphql": "^16.6.0",
22
22
  "graphql-tag": "^2.12.6",
23
23
  "isbot": "^3.8.0",
@@ -28,7 +28,7 @@
28
28
  "@graphql-codegen/cli": "5.0.2",
29
29
  "@remix-run/dev": "^2.10.1",
30
30
  "@remix-run/eslint-config": "^2.10.1",
31
- "@shopify/cli": "~3.66.1",
31
+ "@shopify/cli": "~3.68.0",
32
32
  "@shopify/hydrogen-codegen": "^0.3.1",
33
33
  "@shopify/mini-oxygen": "^3.0.5",
34
34
  "@shopify/oxygen-workers-types": "^4.1.2",