@shopify/cli 3.74.1 → 3.75.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 (102) hide show
  1. package/dist/assets/hydrogen/starter/CHANGELOG.md +99 -0
  2. package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +2 -1
  3. package/dist/assets/hydrogen/starter/app/root.tsx +12 -2
  4. package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +1 -0
  5. package/dist/assets/hydrogen/starter/package.json +10 -10
  6. package/dist/assets/hydrogen/starter/tsconfig.json +1 -1
  7. package/dist/assets/hydrogen/starter/vite.config.ts +1 -0
  8. package/dist/assets/hydrogen/tailwind/package.json +1 -1
  9. package/dist/assets/hydrogen/tailwind/tailwind.css +1 -1
  10. package/dist/assets/hydrogen/vite/package.json +1 -1
  11. package/dist/assets/hydrogen/vite/vite.config.js +1 -0
  12. package/dist/{chunk-RAAPXB5S.js → chunk-2B5C3QFS.js} +3 -3
  13. package/dist/{chunk-X2GSBUQM.js → chunk-2FZJER24.js} +4 -4
  14. package/dist/{chunk-MCL7WC6G.js → chunk-57EEPGQZ.js} +3 -3
  15. package/dist/{chunk-QVSOZYZT.js → chunk-5KSWCELC.js} +3 -3
  16. package/dist/{chunk-LOKVDI3S.js → chunk-6HBKMQLD.js} +15 -14
  17. package/dist/{chunk-WYNFQEFV.js → chunk-6W5TMCT3.js} +3 -3
  18. package/dist/{chunk-VKUWRIWE.js → chunk-6XBYMBOQ.js} +4 -4
  19. package/dist/{chunk-S7L4E7JJ.js → chunk-B7ABTOI4.js} +6 -6
  20. package/dist/{chunk-TKPN642B.js → chunk-BDLU7EEZ.js} +14 -10
  21. package/dist/{chunk-FKB56THZ.js → chunk-BTMRJLQ7.js} +5 -5
  22. package/dist/{chunk-POBZPEHK.js → chunk-DV2H7WDY.js} +430 -207
  23. package/dist/{chunk-6J2OGZ3N.js → chunk-ESYWXFSK.js} +2 -2
  24. package/dist/{chunk-GSDR4V4C.js → chunk-GMHA2S7O.js} +3 -3
  25. package/dist/{chunk-DDHWVLT7.js → chunk-GQIMWIIF.js} +9970 -9968
  26. package/dist/{chunk-CKTTNTVQ.js → chunk-I3WJF5NM.js} +7 -7
  27. package/dist/{chunk-PLIMIFMY.js → chunk-IAM7IYO3.js} +3 -3
  28. package/dist/{chunk-AQFGEPN5.js → chunk-ILXYHK4Q.js} +8 -8
  29. package/dist/{chunk-C2KCEZK7.js → chunk-IML7XVTM.js} +2 -2
  30. package/dist/{chunk-Z4WWAZEY.js → chunk-KMPW66LQ.js} +4 -4
  31. package/dist/{chunk-BGCAU2LM.js → chunk-L656JYPI.js} +2 -2
  32. package/dist/{chunk-XCOZPDGL.js → chunk-MN33EVV7.js} +2 -2
  33. package/dist/{chunk-POKIPHUC.js → chunk-MOZOZ3LN.js} +3 -3
  34. package/dist/{chunk-5CLGH5PH.js → chunk-MP5RLDFN.js} +15 -8
  35. package/dist/{chunk-7HJY7CZB.js → chunk-OK2LJ3F3.js} +6 -6
  36. package/dist/{chunk-J673ZU5S.js → chunk-ORGKANED.js} +3 -3
  37. package/dist/{chunk-DH65BORI.js → chunk-QJQSCN3A.js} +5 -5
  38. package/dist/{chunk-5L3V3XN7.js → chunk-S4YW77H4.js} +4 -4
  39. package/dist/{chunk-IVI5VH2V.js → chunk-S576QAPY.js} +2 -2
  40. package/dist/{chunk-L5L7GDSR.js → chunk-S6L5743K.js} +2 -2
  41. package/dist/{chunk-H6V3ZAMP.js → chunk-SWQM7ICR.js} +2 -2
  42. package/dist/{chunk-6N46HJWX.js → chunk-T35HYPVZ.js} +3 -3
  43. package/dist/{chunk-DNKTPUYV.js → chunk-T4WJXSDW.js} +4 -4
  44. package/dist/{chunk-P6UIGUUZ.js → chunk-TJDZDZWG.js} +2 -2
  45. package/dist/{chunk-7DCZ4PEB.js → chunk-VM4XPRZK.js} +3 -3
  46. package/dist/{chunk-CDQA3SST.js → chunk-VSKRQ3JT.js} +33 -29
  47. package/dist/{chunk-4VWVAF7H.js → chunk-W6IJP4MY.js} +3 -3
  48. package/dist/{chunk-TLXMY7OM.js → chunk-X3CFSDHA.js} +94 -17
  49. package/dist/{chunk-AKL7T64Q.js → chunk-Y53XECL6.js} +34 -34
  50. package/dist/{chunk-CGXWFHRF.js → chunk-YVTRJWYT.js} +3 -3
  51. package/dist/cli/commands/auth/logout.js +14 -15
  52. package/dist/cli/commands/auth/logout.test.js +16 -17
  53. package/dist/cli/commands/cache/clear.js +13 -14
  54. package/dist/cli/commands/debug/command-flags.js +13 -14
  55. package/dist/cli/commands/docs/generate.js +13 -14
  56. package/dist/cli/commands/docs/generate.test.js +14 -15
  57. package/dist/cli/commands/help.js +13 -14
  58. package/dist/cli/commands/kitchen-sink/async.js +14 -15
  59. package/dist/cli/commands/kitchen-sink/async.test.js +15 -16
  60. package/dist/cli/commands/kitchen-sink/index.js +16 -17
  61. package/dist/cli/commands/kitchen-sink/index.test.js +17 -18
  62. package/dist/cli/commands/kitchen-sink/prompts.js +14 -15
  63. package/dist/cli/commands/kitchen-sink/prompts.test.js +15 -16
  64. package/dist/cli/commands/kitchen-sink/static.js +14 -15
  65. package/dist/cli/commands/kitchen-sink/static.test.js +15 -16
  66. package/dist/cli/commands/notifications/generate.js +14 -15
  67. package/dist/cli/commands/notifications/list.js +14 -15
  68. package/dist/cli/commands/search.js +14 -15
  69. package/dist/cli/commands/upgrade.js +14 -15
  70. package/dist/cli/commands/upgrade.test.js +1 -2
  71. package/dist/cli/commands/version.js +14 -15
  72. package/dist/cli/commands/version.test.js +15 -16
  73. package/dist/cli/services/commands/notifications.js +8 -9
  74. package/dist/cli/services/commands/search.js +4 -5
  75. package/dist/cli/services/commands/search.test.js +5 -6
  76. package/dist/cli/services/commands/version.js +5 -6
  77. package/dist/cli/services/commands/version.test.js +7 -8
  78. package/dist/cli/services/kitchen-sink/async.js +4 -5
  79. package/dist/cli/services/kitchen-sink/prompts.js +4 -5
  80. package/dist/cli/services/kitchen-sink/static.js +4 -5
  81. package/dist/cli/services/upgrade.js +5 -6
  82. package/dist/cli/services/upgrade.test.js +8 -9
  83. package/dist/{custom-oclif-loader-YCFOTKOV.js → custom-oclif-loader-MPQ33GKJ.js} +4 -5
  84. package/dist/{del-FBU5JYXS.js → del-2SYBVRHB.js} +2 -2
  85. package/dist/devtools-BA4WST2D.js +72 -0
  86. package/dist/{error-handler-S6ZLT6DF.js → error-handler-ABXDEJNM.js} +11 -12
  87. package/dist/hooks/postrun.js +9 -10
  88. package/dist/hooks/prerun.js +9 -10
  89. package/dist/index.js +28936 -12542
  90. package/dist/{lib-E2DSNKUX.js → lib-SGEWXU7Z.js} +3 -3
  91. package/dist/{local-62JTGJVG.js → local-DGW3VZG7.js} +6 -5
  92. package/dist/{magic-string.es-PJMYOE6F.js → magic-string.es-BSVDQOZI.js} +32 -20
  93. package/dist/{morph-ACVSDUS7.js → morph-BTANDGVW.js} +9 -9
  94. package/dist/{node-M7KO76D7.js → node-GVOKD67H.js} +17 -18
  95. package/dist/{node-package-manager-RXCBZVWU.js → node-package-manager-WEN6FJ7Z.js} +5 -6
  96. package/dist/{npa-JAX2F6CO.js → npa-E675GQOI.js} +123 -33
  97. package/dist/tsconfig.tsbuildinfo +1 -1
  98. package/dist/{ui-CEJ6R3AV.js → ui-TWIKWYG2.js} +4 -5
  99. package/dist/{workerd-WLX2SY5E.js → workerd-SK47YSGA.js} +16 -17
  100. package/oclif.manifest.json +33 -62
  101. package/package.json +11 -10
  102. package/dist/chunk-CFIKVUNW.js +0 -45
@@ -1,5 +1,104 @@
1
1
  # skeleton
2
2
 
3
+ ## 2025.1.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Bump vite, Remix versions and tailwind v4 alpha to beta ([#2696](https://github.com/Shopify/hydrogen/pull/2696)) by [@wizardlyhel](https://github.com/wizardlyhel)
8
+
9
+ - Workaround for "Error: failed to execute 'insertBefore' on 'Node'" that sometimes happen during development. ([#2701](https://github.com/Shopify/hydrogen/pull/2701)) by [@wizardlyhel](https://github.com/wizardlyhel)
10
+
11
+ ```diff
12
+ // root.tsx
13
+
14
+ /**
15
+ * The main and reset stylesheets are added in the Layout component
16
+ * to prevent a bug in development HMR updates.
17
+ *
18
+ * This avoids the "failed to execute 'insertBefore' on 'Node'" error
19
+ * that occurs after editing and navigating to another page.
20
+ *
21
+ * It's a temporary fix until the issue is resolved.
22
+ * https://github.com/remix-run/remix/issues/9242
23
+ */
24
+ export function links() {
25
+ return [
26
+ - {rel: 'stylesheet', href: resetStyles},
27
+ - {rel: 'stylesheet', href: appStyles},
28
+ {
29
+ rel: 'preconnect',
30
+ href: 'https://cdn.shopify.com',
31
+ },
32
+ {
33
+ rel: 'preconnect',
34
+ href: 'https://shop.app',
35
+ },
36
+ {rel: 'icon', type: 'image/svg+xml', href: favicon},
37
+ ];
38
+ }
39
+
40
+ ...
41
+
42
+ export function Layout({children}: {children?: React.ReactNode}) {
43
+ const nonce = useNonce();
44
+ const data = useRouteLoaderData<RootLoader>('root');
45
+
46
+ return (
47
+ <html lang="en">
48
+ <head>
49
+ <meta charSet="utf-8" />
50
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
51
+ + <link rel="stylesheet" href={resetStyles}></link>
52
+ + <link rel="stylesheet" href={appStyles}></link>
53
+
54
+ ```
55
+
56
+ - Turn on future flag `v3_lazyRouteDiscovery` ([#2702](https://github.com/Shopify/hydrogen/pull/2702)) by [@wizardlyhel](https://github.com/wizardlyhel)
57
+
58
+ In your vite.config.ts, add the following line:
59
+
60
+ ```diff
61
+ export default defineConfig({
62
+ plugins: [
63
+ hydrogen(),
64
+ oxygen(),
65
+ remix({
66
+ presets: [hydrogen.preset()],
67
+ future: {
68
+ v3_fetcherPersist: true,
69
+ v3_relativeSplatPath: true,
70
+ v3_throwAbortReason: true,
71
+ + v3_lazyRouteDiscovery: true,
72
+ },
73
+ }),
74
+ tsconfigPaths(),
75
+ ],
76
+ ```
77
+
78
+ Test your app by running `npm run dev` and nothing should break
79
+
80
+ - Fix image size warnings on collections page ([#2703](https://github.com/Shopify/hydrogen/pull/2703)) by [@wizardlyhel](https://github.com/wizardlyhel)
81
+
82
+ - Bump cli version ([#2732](https://github.com/Shopify/hydrogen/pull/2732)) by [@wizardlyhel](https://github.com/wizardlyhel)
83
+
84
+ - Bump SFAPI to 2025-01 ([#2715](https://github.com/Shopify/hydrogen/pull/2715)) by [@rbshop](https://github.com/rbshop)
85
+
86
+ - Updated dependencies [[`fdab06f5`](https://github.com/Shopify/hydrogen/commit/fdab06f5d34076b526d406698bdf6fca6787660b), [`ae6d71f0`](https://github.com/Shopify/hydrogen/commit/ae6d71f0976f520ca177c69ff677f852af63859e), [`650d57b3`](https://github.com/Shopify/hydrogen/commit/650d57b3e07125661e23900e73c0bb3027ddbcde), [`064de138`](https://github.com/Shopify/hydrogen/commit/064de13890c68cabb1c3fdbe7f77409a0cf1c384)]:
87
+ - @shopify/remix-oxygen@2.0.10
88
+ - @shopify/hydrogen@2025.1.0
89
+
90
+ ## 2024.10.4
91
+
92
+ ### Patch Changes
93
+
94
+ - Bump cli version ([#2694](https://github.com/Shopify/hydrogen/pull/2694)) by [@wizardlyhel](https://github.com/wizardlyhel)
95
+
96
+ ## 2024.10.3
97
+
98
+ ### Patch Changes
99
+
100
+ - Prevent scroll reset on variant change ([#2672](https://github.com/Shopify/hydrogen/pull/2672)) by [@scottdixon](https://github.com/scottdixon)
101
+
3
102
  ## 2024.10.2
4
103
 
5
104
  ### Patch Changes
@@ -86,6 +86,7 @@ export function ProductForm({
86
86
  if (!selected) {
87
87
  navigate(`?${variantUriQuery}`, {
88
88
  replace: true,
89
+ preventScrollReset: true,
89
90
  });
90
91
  }
91
92
  }}
@@ -98,7 +99,7 @@ export function ProductForm({
98
99
  </div>
99
100
  <br />
100
101
  </div>
101
- )
102
+ );
102
103
  })}
103
104
  <AddToCartButton
104
105
  disabled={!selectedVariant || !selectedVariant.availableForSale}
@@ -37,10 +37,18 @@ export const shouldRevalidate: ShouldRevalidateFunction = ({
37
37
  return defaultShouldRevalidate;
38
38
  };
39
39
 
40
+ /**
41
+ * The main and reset stylesheets are added in the Layout component
42
+ * to prevent a bug in development HMR updates.
43
+ *
44
+ * This avoids the "failed to execute 'insertBefore' on 'Node'" error
45
+ * that occurs after editing and navigating to another page.
46
+ *
47
+ * It's a temporary fix until the issue is resolved.
48
+ * https://github.com/remix-run/remix/issues/9242
49
+ */
40
50
  export function links() {
41
51
  return [
42
- {rel: 'stylesheet', href: resetStyles},
43
- {rel: 'stylesheet', href: appStyles},
44
52
  {
45
53
  rel: 'preconnect',
46
54
  href: 'https://cdn.shopify.com',
@@ -138,6 +146,8 @@ export function Layout({children}: {children?: React.ReactNode}) {
138
146
  <head>
139
147
  <meta charSet="utf-8" />
140
148
  <meta name="viewport" content="width=device-width,initial-scale=1" />
149
+ <link rel="stylesheet" href={resetStyles}></link>
150
+ <link rel="stylesheet" href={appStyles}></link>
141
151
  <Meta />
142
152
  <Links />
143
153
  </head>
@@ -84,6 +84,7 @@ function CollectionItem({
84
84
  aspectRatio="1/1"
85
85
  data={collection.image}
86
86
  loading={index < 3 ? 'eager' : undefined}
87
+ sizes="(min-width: 45em) 400px, 100vw"
87
88
  />
88
89
  )}
89
90
  <h5>{collection.title}</h5>
@@ -2,7 +2,7 @@
2
2
  "name": "skeleton",
3
3
  "private": true,
4
4
  "sideEffects": false,
5
- "version": "2024.10.2",
5
+ "version": "2025.1.0",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "shopify hydrogen build --codegen",
@@ -14,10 +14,10 @@
14
14
  },
15
15
  "prettier": "@shopify/prettier-config",
16
16
  "dependencies": {
17
- "@remix-run/react": "^2.13.1",
18
- "@remix-run/server-runtime": "^2.13.1",
19
- "@shopify/hydrogen": "2024.10.1",
20
- "@shopify/remix-oxygen": "^2.0.9",
17
+ "@remix-run/react": "^2.15.2",
18
+ "@remix-run/server-runtime": "^2.15.2",
19
+ "@shopify/hydrogen": "2025.1.0",
20
+ "@shopify/remix-oxygen": "^2.0.10",
21
21
  "graphql": "^16.6.0",
22
22
  "graphql-tag": "^2.12.6",
23
23
  "isbot": "^3.8.0",
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@graphql-codegen/cli": "5.0.2",
29
- "@remix-run/dev": "^2.13.1",
30
- "@remix-run/eslint-config": "^2.13.1",
31
- "@shopify/cli": "~3.72.0",
29
+ "@remix-run/dev": "^2.15.2",
30
+ "@remix-run/eslint-config": "^2.15.2",
31
+ "@shopify/cli": "~3.74.1",
32
32
  "@shopify/hydrogen-codegen": "^0.3.2",
33
- "@shopify/mini-oxygen": "^3.1.0",
33
+ "@shopify/mini-oxygen": "^3.1.1",
34
34
  "@shopify/oxygen-workers-types": "^4.1.2",
35
35
  "@shopify/prettier-config": "^1.1.2",
36
36
  "@total-typescript/ts-reset": "^0.4.2",
@@ -41,7 +41,7 @@
41
41
  "eslint-plugin-hydrogen": "0.12.2",
42
42
  "prettier": "^2.8.4",
43
43
  "typescript": "^5.2.2",
44
- "vite": "^5.1.0",
44
+ "vite": "^5.1.8",
45
45
  "vite-tsconfig-paths": "^4.3.1"
46
46
  },
47
47
  "engines": {
@@ -14,7 +14,7 @@
14
14
  "forceConsistentCasingInFileNames": true,
15
15
  "skipLibCheck": true,
16
16
  "baseUrl": ".",
17
- "types": ["@shopify/oxygen-workers-types"],
17
+ "types": ["@shopify/oxygen-workers-types", "@remix-run/node", "vite/client"],
18
18
  "paths": {
19
19
  "~/*": ["app/*"]
20
20
  },
@@ -14,6 +14,7 @@ export default defineConfig({
14
14
  v3_fetcherPersist: true,
15
15
  v3_relativeSplatPath: true,
16
16
  v3_throwAbortReason: true,
17
+ v3_lazyRouteDiscovery: true,
17
18
  },
18
19
  }),
19
20
  tsconfigPaths(),
@@ -3,6 +3,6 @@
3
3
  "defaults"
4
4
  ],
5
5
  "devDependencies": {
6
- "@tailwindcss/vite": "4.0.0-alpha.17"
6
+ "@tailwindcss/vite": "4.0.0-beta.8"
7
7
  }
8
8
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Configure Tailwind v4 in this file using CSS variables and directives:
3
- * https://tailwindcss.com/blog/tailwindcss-v4-alpha#css-first-configuration
3
+ * https://tailwindcss.com/docs/v4-beta#css-first-configuration
4
4
  */
5
5
 
6
6
  @import 'tailwindcss';
@@ -8,7 +8,7 @@
8
8
  "isbot": "^3.8.0"
9
9
  },
10
10
  "devDependencies": {
11
- "vite": "^5.1.0",
11
+ "vite": "^5.1.8",
12
12
  "vite-tsconfig-paths": "^4.3.1"
13
13
  }
14
14
  }
@@ -14,6 +14,7 @@ export default defineConfig({
14
14
  v3_fetcherPersist: true,
15
15
  v3_relativeSplatPath: true,
16
16
  v3_throwAbortReason: true,
17
+ v3_lazyRouteDiscovery: true,
17
18
  },
18
19
  }),
19
20
  tsconfigPaths(),
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  packageManagerFromUserAgent
3
- } from "./chunk-IVI5VH2V.js";
3
+ } from "./chunk-S576QAPY.js";
4
4
  import {
5
5
  currentProcessIsGlobal,
6
6
  inferPackageManagerForGlobalCLI,
7
7
  outputContent,
8
8
  outputToken
9
- } from "./chunk-TLXMY7OM.js";
9
+ } from "./chunk-X3CFSDHA.js";
10
10
  import {
11
11
  init_cjs_shims
12
12
  } from "./chunk-PKR7KJ6P.js";
@@ -25,4 +25,4 @@ export {
25
25
  cliInstallCommand,
26
26
  getOutputUpdateCLIReminder
27
27
  };
28
- //# sourceMappingURL=chunk-RAAPXB5S.js.map
28
+ //# sourceMappingURL=chunk-2B5C3QFS.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-DH65BORI.js";
3
+ } from "./chunk-QJQSCN3A.js";
4
4
  import {
5
5
  renderTable,
6
6
  renderText
7
- } from "./chunk-TLXMY7OM.js";
7
+ } from "./chunk-X3CFSDHA.js";
8
8
  import {
9
9
  require_lib
10
- } from "./chunk-CDQA3SST.js";
10
+ } from "./chunk-VSKRQ3JT.js";
11
11
  import {
12
12
  __toESM,
13
13
  init_cjs_shims
@@ -83,4 +83,4 @@ var import_core = __toESM(require_lib(), 1), CommandFlags = class _CommandFlags
83
83
  export {
84
84
  CommandFlags
85
85
  };
86
- //# sourceMappingURL=chunk-X2GSBUQM.js.map
86
+ //# sourceMappingURL=chunk-2FZJER24.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-DH65BORI.js";
3
+ } from "./chunk-QJQSCN3A.js";
4
4
  import {
5
5
  mkdir,
6
6
  outputInfo,
7
7
  rmdir,
8
8
  writeFile
9
- } from "./chunk-TLXMY7OM.js";
9
+ } from "./chunk-X3CFSDHA.js";
10
10
  import {
11
11
  cwd,
12
12
  joinPath
@@ -115,4 +115,4 @@ export {
115
115
  writeCommandFlagInterface,
116
116
  writeCommandUsageExampleFile
117
117
  };
118
- //# sourceMappingURL=chunk-MCL7WC6G.js.map
118
+ //# sourceMappingURL=chunk-57EEPGQZ.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  versionService
3
- } from "./chunk-PLIMIFMY.js";
3
+ } from "./chunk-IAM7IYO3.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-DH65BORI.js";
6
+ } from "./chunk-QJQSCN3A.js";
7
7
  import {
8
8
  init_cjs_shims
9
9
  } from "./chunk-PKR7KJ6P.js";
@@ -22,4 +22,4 @@ var Version = class extends base_command_default {
22
22
  export {
23
23
  Version
24
24
  };
25
- //# sourceMappingURL=chunk-QVSOZYZT.js.map
25
+ //# sourceMappingURL=chunk-5KSWCELC.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  platformAndArch
3
- } from "./chunk-P6UIGUUZ.js";
3
+ } from "./chunk-TJDZDZWG.js";
4
4
  import {
5
5
  allAPIs,
6
6
  buildHeaders,
7
7
  shopifyFetch,
8
8
  z
9
- } from "./chunk-DDHWVLT7.js";
9
+ } from "./chunk-GQIMWIIF.js";
10
10
  import {
11
11
  cacheRetrieveOrRepopulate,
12
12
  getPackageManager,
@@ -14,7 +14,7 @@ import {
14
14
  packageManagerFromUserAgent,
15
15
  removeSession,
16
16
  setSession
17
- } from "./chunk-IVI5VH2V.js";
17
+ } from "./chunk-S576QAPY.js";
18
18
  import {
19
19
  AbortError,
20
20
  BugError,
@@ -22,6 +22,7 @@ import {
22
22
  FatalError,
23
23
  addPublicMetadata,
24
24
  addSensitiveMetadata,
25
+ blockPartnersAccess,
25
26
  ciPlatform,
26
27
  cloudEnvironment,
27
28
  currentProcessIsGlobal,
@@ -48,7 +49,7 @@ import {
48
49
  spinFqdn,
49
50
  themeKitAccessDomain,
50
51
  themeToken
51
- } from "./chunk-TLXMY7OM.js";
52
+ } from "./chunk-X3CFSDHA.js";
52
53
  import {
53
54
  cwd
54
55
  } from "./chunk-57Q6OQG4.js";
@@ -320,6 +321,8 @@ var DevServer = class {
320
321
  // ../cli-kit/dist/public/node/context/fqdn.js
321
322
  var CouldntObtainPartnersSpinFQDNError = new AbortError("Couldn't obtain the Spin FQDN for Partners when the CLI is not running from a Spin environment."), CouldntObtainIdentitySpinFQDNError = new AbortError("Couldn't obtain the Spin FQDN for Identity when the CLI is not running from a Spin environment."), CouldntObtainShopifySpinFQDNError = new AbortError("Couldn't obtain the Spin FQDN for Shopify when the CLI is not running from a Spin environment."), NotProvidedStoreFQDNError = new AbortError("Couldn't obtain the Shopify FQDN because the store FQDN was not provided.");
322
323
  async function partnersFqdn() {
324
+ if (blockPartnersAccess())
325
+ throw new BugError("Partners API is blocked by the SHOPIFY_CLI_NEVER_USE_PARTNERS_API environment variable.");
323
326
  let environment = serviceEnvironment(), productionFqdn = "partners.shopify.com";
324
327
  switch (environment) {
325
328
  case "local":
@@ -550,10 +553,7 @@ function validateScopes(requestedScopes, identity) {
550
553
  return firstPartyDev() !== currentScopes.includes("employee") ? !1 : requestedScopes.every((scope) => currentScopes.includes(scope));
551
554
  }
552
555
  async function validateSession(scopes, applications, session) {
553
- if (!session)
554
- return "needs_full_auth";
555
- let scopesAreValid = validateScopes(scopes, session.identity), identityIsValid = await validateIdentityToken(session.identity.accessToken);
556
- if (!scopesAreValid)
556
+ if (!session || !validateScopes(scopes, session.identity))
557
557
  return "needs_full_auth";
558
558
  let tokensAreExpired = isTokenExpired(session.identity);
559
559
  if (applications.partnersApi) {
@@ -572,11 +572,12 @@ async function validateSession(scopes, applications, session) {
572
572
  let appId = applicationId("admin"), realAppId = `${applications.adminApi.storeFqdn}-${appId}`, token = session.applications[realAppId];
573
573
  tokensAreExpired = tokensAreExpired || isTokenExpired(token);
574
574
  }
575
- return outputDebug(`
576
- The validation of the token for application/identity completed with the following results:
577
- - It's expired: ${tokensAreExpired}
578
- - It's invalid in identity: ${!identityIsValid}
579
- `), validateCachedIdentityTokenStructure(session.identity) ? tokensAreExpired ? "needs_refresh" : identityIsValid ? "ok" : "needs_full_auth" : "needs_full_auth";
575
+ if (outputDebug(`- Token validation -> It's expired: ${tokensAreExpired}`), !validateCachedIdentityTokenStructure(session.identity))
576
+ return "needs_full_auth";
577
+ if (tokensAreExpired)
578
+ return "needs_refresh";
579
+ let identityIsValid = await validateIdentityToken(session.identity.accessToken);
580
+ return outputDebug(`- Token validation -> It's invalid in identity: ${!identityIsValid}`), identityIsValid ? "ok" : "needs_full_auth";
580
581
  }
581
582
  function isTokenExpired(token) {
582
583
  return token ? token.expiresAt < expireThreshold() : !0;
@@ -1134,4 +1135,4 @@ export {
1134
1135
  getEnvironmentData,
1135
1136
  getSensitiveEnvironmentData
1136
1137
  };
1137
- //# sourceMappingURL=chunk-LOKVDI3S.js.map
1138
+ //# sourceMappingURL=chunk-6HBKMQLD.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-DH65BORI.js";
3
+ } from "./chunk-QJQSCN3A.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-CDQA3SST.js";
6
+ } from "./chunk-VSKRQ3JT.js";
7
7
  import {
8
8
  __toESM,
9
9
  init_cjs_shims
@@ -43,4 +43,4 @@ var HelpCommand = class _HelpCommand extends base_command_default {
43
43
  export {
44
44
  HelpCommand
45
45
  };
46
- //# sourceMappingURL=chunk-WYNFQEFV.js.map
46
+ //# sourceMappingURL=chunk-6W5TMCT3.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  logout
3
- } from "./chunk-TKPN642B.js";
3
+ } from "./chunk-BDLU7EEZ.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-DH65BORI.js";
6
+ } from "./chunk-QJQSCN3A.js";
7
7
  import {
8
8
  outputSuccess
9
- } from "./chunk-TLXMY7OM.js";
9
+ } from "./chunk-X3CFSDHA.js";
10
10
  import {
11
11
  init_cjs_shims
12
12
  } from "./chunk-PKR7KJ6P.js";
@@ -25,4 +25,4 @@ var Logout = class extends base_command_default {
25
25
  export {
26
26
  Logout
27
27
  };
28
- //# sourceMappingURL=chunk-VKUWRIWE.js.map
28
+ //# sourceMappingURL=chunk-6XBYMBOQ.js.map
@@ -2,16 +2,16 @@ import {
2
2
  getEnvironmentData,
3
3
  getLastSeenUserIdAfterAuth,
4
4
  getSensitiveEnvironmentData
5
- } from "./chunk-LOKVDI3S.js";
5
+ } from "./chunk-6HBKMQLD.js";
6
6
  import {
7
7
  fetch
8
- } from "./chunk-DDHWVLT7.js";
8
+ } from "./chunk-GQIMWIIF.js";
9
9
  import {
10
10
  CLI_KIT_VERSION
11
- } from "./chunk-L5L7GDSR.js";
11
+ } from "./chunk-S6L5743K.js";
12
12
  import {
13
13
  runWithRateLimit
14
- } from "./chunk-IVI5VH2V.js";
14
+ } from "./chunk-S576QAPY.js";
15
15
  import {
16
16
  alwaysLogAnalytics,
17
17
  alwaysLogMetrics,
@@ -28,7 +28,7 @@ import {
28
28
  outputDebug,
29
29
  outputToken,
30
30
  reportingRateLimit
31
- } from "./chunk-TLXMY7OM.js";
31
+ } from "./chunk-X3CFSDHA.js";
32
32
  import {
33
33
  __commonJS,
34
34
  __esm,
@@ -15930,4 +15930,4 @@ export {
15930
15930
  requestIdsCollection,
15931
15931
  reportAnalyticsEvent
15932
15932
  };
15933
- //# sourceMappingURL=chunk-S7L4E7JJ.js.map
15933
+ //# sourceMappingURL=chunk-B7ABTOI4.js.map
@@ -6,7 +6,7 @@ import {
6
6
  remove,
7
7
  setLastSeenAuthMethod,
8
8
  setLastSeenUserIdAfterAuth
9
- } from "./chunk-LOKVDI3S.js";
9
+ } from "./chunk-6HBKMQLD.js";
10
10
  import {
11
11
  BugError,
12
12
  getPartnersToken,
@@ -14,7 +14,7 @@ import {
14
14
  outputContent,
15
15
  outputDebug,
16
16
  outputToken
17
- } from "./chunk-TLXMY7OM.js";
17
+ } from "./chunk-X3CFSDHA.js";
18
18
  import {
19
19
  init_cjs_shims
20
20
  } from "./chunk-PKR7KJ6P.js";
@@ -35,14 +35,18 @@ ${outputToken.json(scopes)}
35
35
  throw new BugError("No partners token found after ensuring authenticated");
36
36
  return { token: tokens.partners, userId: tokens.userId };
37
37
  }
38
- async function ensureAuthenticatedAppManagement(scopes = [], env = process.env, options = {}) {
38
+ async function ensureAuthenticatedAppManagementAndBusinessPlatform(options = {}, appManagementScopes = [], businessPlatformScopes = [], env = process.env) {
39
39
  outputDebug(outputContent`Ensuring that the user is authenticated with the App Management API with the following scopes:
40
- ${outputToken.json(scopes)}
40
+ ${outputToken.json(appManagementScopes)}
41
41
  `);
42
- let tokens = await ensureAuthenticated({ appManagementApi: { scopes } }, env, options);
43
- if (!tokens)
44
- throw new BugError("No App Management token found after ensuring authenticated");
45
- return { token: tokens.appManagement, userId: tokens.userId };
42
+ let tokens = await ensureAuthenticated({ appManagementApi: { scopes: appManagementScopes }, businessPlatformApi: { scopes: businessPlatformScopes } }, env, options);
43
+ if (!tokens.appManagement || !tokens.businessPlatform)
44
+ throw new BugError("No App Management or Business Platform token found after ensuring authenticated");
45
+ return {
46
+ appManagementToken: tokens.appManagement,
47
+ userId: tokens.userId,
48
+ businessPlatformToken: tokens.businessPlatform
49
+ };
46
50
  }
47
51
  async function ensureAuthenticatedStorefront(scopes = [], password = void 0, forceRefresh = !1) {
48
52
  if (password) {
@@ -93,11 +97,11 @@ function logout() {
93
97
 
94
98
  export {
95
99
  ensureAuthenticatedPartners,
96
- ensureAuthenticatedAppManagement,
100
+ ensureAuthenticatedAppManagementAndBusinessPlatform,
97
101
  ensureAuthenticatedStorefront,
98
102
  ensureAuthenticatedAdmin,
99
103
  ensureAuthenticatedThemes,
100
104
  ensureAuthenticatedBusinessPlatform,
101
105
  logout
102
106
  };
103
- //# sourceMappingURL=chunk-TKPN642B.js.map
107
+ //# sourceMappingURL=chunk-BDLU7EEZ.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  prompts
3
- } from "./chunk-C2KCEZK7.js";
3
+ } from "./chunk-IML7XVTM.js";
4
4
  import {
5
5
  staticService
6
- } from "./chunk-XCOZPDGL.js";
6
+ } from "./chunk-MN33EVV7.js";
7
7
  import {
8
8
  asyncTasks
9
- } from "./chunk-H6V3ZAMP.js";
9
+ } from "./chunk-SWQM7ICR.js";
10
10
  import {
11
11
  base_command_default
12
- } from "./chunk-DH65BORI.js";
12
+ } from "./chunk-QJQSCN3A.js";
13
13
  import {
14
14
  init_cjs_shims
15
15
  } from "./chunk-PKR7KJ6P.js";
@@ -34,4 +34,4 @@ var KitchenSinkAll = class extends base_command_default {
34
34
  export {
35
35
  KitchenSinkAll
36
36
  };
37
- //# sourceMappingURL=chunk-FKB56THZ.js.map
37
+ //# sourceMappingURL=chunk-BTMRJLQ7.js.map