shopify 3.76.1 → 3.76.2

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 (128) hide show
  1. package/dist/{chunk-WOG2LQ3X.js → chunk-2WTNMSEA.js} +3 -3
  2. package/dist/{chunk-ACGZSEHA.js → chunk-3DV6EZ24.js} +7 -7
  3. package/dist/chunk-3IUNQ4LM.js +52 -0
  4. package/dist/chunk-3IUNQ4LM.js.map +7 -0
  5. package/dist/{chunk-LXQWZFLX.js → chunk-3UYXKXR6.js} +5 -6
  6. package/dist/{chunk-LXQWZFLX.js.map → chunk-3UYXKXR6.js.map} +2 -2
  7. package/dist/{chunk-EHL6XSBG.js → chunk-6RHYOJ63.js} +5 -5
  8. package/dist/{chunk-3Q5TSFEN.js → chunk-7ZRFR7FA.js} +8 -8
  9. package/dist/{chunk-3Q5TSFEN.js.map → chunk-7ZRFR7FA.js.map} +1 -1
  10. package/dist/{chunk-ZQU7DVLN.js → chunk-AHNHLXEN.js} +4 -4
  11. package/dist/{chunk-BJG7ZRQ2.js → chunk-AZ3SNZKH.js} +3 -3
  12. package/dist/{chunk-W6WCETMJ.js → chunk-BJXULBKX.js} +4 -4
  13. package/dist/{chunk-PDQLM7DM.js → chunk-CBRJA5VT.js} +4 -4
  14. package/dist/{chunk-RDHYYXFE.js → chunk-DTR7ATW4.js} +3 -3
  15. package/dist/{chunk-ULBY4CUT.js → chunk-DZC6PFFO.js} +2 -2
  16. package/dist/{chunk-LTIYNGCV.js → chunk-EPUCFUDR.js} +3 -3
  17. package/dist/{chunk-T2LQCR7X.js → chunk-IKXB6S5W.js} +2 -2
  18. package/dist/{chunk-EJU7LVJW.js → chunk-J4VMFBCX.js} +3 -3
  19. package/dist/{chunk-6KV6OKFB.js → chunk-J64C3R6H.js} +3 -3
  20. package/dist/{chunk-DFFXOFLT.js → chunk-JMXX7A4N.js} +2 -2
  21. package/dist/{chunk-DFFXOFLT.js.map → chunk-JMXX7A4N.js.map} +1 -1
  22. package/dist/{chunk-WWI2QVFK.js → chunk-KI626P2Z.js} +4 -4
  23. package/dist/{chunk-WWI2QVFK.js.map → chunk-KI626P2Z.js.map} +1 -1
  24. package/dist/{chunk-FZT5AGA5.js → chunk-KTICPCDH.js} +4 -4
  25. package/dist/{chunk-MVZ4LGIM.js → chunk-MIAZDAJI.js} +2 -2
  26. package/dist/{chunk-4SFWD6RY.js → chunk-OSETU22I.js} +3 -3
  27. package/dist/{chunk-JBS4NEJX.js → chunk-PNWJ2GZC.js} +5 -5
  28. package/dist/{chunk-5TZDSORY.js → chunk-QP45KHVL.js} +5 -5
  29. package/dist/{chunk-6TPMZTXG.js → chunk-SO2JXJNK.js} +6 -6
  30. package/dist/{chunk-4OD4TP6T.js → chunk-SROPQDQ2.js} +4 -4
  31. package/dist/{chunk-VX5SZCUI.js → chunk-TKC27SYH.js} +11 -11
  32. package/dist/{chunk-VX5SZCUI.js.map → chunk-TKC27SYH.js.map} +1 -1
  33. package/dist/{chunk-LUCMIGZJ.js → chunk-TYXJ553W.js} +2 -2
  34. package/dist/{chunk-742MYXOA.js → chunk-VXUNILLD.js} +3 -3
  35. package/dist/{chunk-A44GEDKW.js → chunk-WFJKWPG7.js} +4 -4
  36. package/dist/{chunk-IROPFRNN.js → chunk-WOA7JN7E.js} +28 -16
  37. package/dist/chunk-WOA7JN7E.js.map +7 -0
  38. package/dist/{chunk-FUA76K3T.js → chunk-WXONIGO7.js} +2 -2
  39. package/dist/{chunk-3THHNKSL.js → chunk-WYLW7KVV.js} +3 -3
  40. package/dist/{chunk-RB5K7TGA.js → chunk-XAK5UQFR.js} +2 -2
  41. package/dist/{chunk-7UIQNXWE.js → chunk-XOWOZYS5.js} +3 -3
  42. package/dist/{chunk-57Q6OQG4.js → chunk-ZUCWDIGE.js} +2 -2
  43. package/dist/cli/commands/auth/logout.js +12 -12
  44. package/dist/cli/commands/auth/logout.test.js +13 -13
  45. package/dist/cli/commands/cache/clear.js +11 -11
  46. package/dist/cli/commands/debug/command-flags.js +11 -11
  47. package/dist/cli/commands/docs/generate.js +11 -11
  48. package/dist/cli/commands/docs/generate.test.js +11 -11
  49. package/dist/cli/commands/help.js +11 -11
  50. package/dist/cli/commands/kitchen-sink/async.js +12 -12
  51. package/dist/cli/commands/kitchen-sink/async.test.js +12 -12
  52. package/dist/cli/commands/kitchen-sink/index.js +14 -14
  53. package/dist/cli/commands/kitchen-sink/index.test.js +14 -14
  54. package/dist/cli/commands/kitchen-sink/prompts.js +12 -12
  55. package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -12
  56. package/dist/cli/commands/kitchen-sink/static.js +12 -12
  57. package/dist/cli/commands/kitchen-sink/static.test.js +12 -12
  58. package/dist/cli/commands/notifications/generate.js +12 -12
  59. package/dist/cli/commands/notifications/list.d.ts +3 -0
  60. package/dist/cli/commands/notifications/list.js +12 -12
  61. package/dist/cli/commands/search.js +12 -12
  62. package/dist/cli/commands/upgrade.js +12 -12
  63. package/dist/cli/commands/version.js +12 -12
  64. package/dist/cli/commands/version.test.js +12 -12
  65. package/dist/cli/services/commands/notifications.js +7 -7
  66. package/dist/cli/services/commands/search.js +3 -3
  67. package/dist/cli/services/commands/search.test.js +3 -3
  68. package/dist/cli/services/commands/version.js +4 -4
  69. package/dist/cli/services/commands/version.test.js +5 -5
  70. package/dist/cli/services/kitchen-sink/async.js +3 -3
  71. package/dist/cli/services/kitchen-sink/prompts.js +3 -3
  72. package/dist/cli/services/kitchen-sink/static.js +3 -3
  73. package/dist/cli/services/upgrade.js +4 -4
  74. package/dist/cli/services/upgrade.test.js +5 -5
  75. package/dist/{custom-oclif-loader-BXHJERI2.js → custom-oclif-loader-FMEBF4P4.js} +3 -3
  76. package/dist/{error-handler-FV3FJ3VW.js → error-handler-AMKMVQCR.js} +9 -9
  77. package/dist/hooks/postrun.js +7 -7
  78. package/dist/hooks/prerun.js +9 -9
  79. package/dist/hooks/prerun.js.map +2 -2
  80. package/dist/index.js +35 -35
  81. package/dist/{local-PMOJBQT6.js → local-2RXSPQ2I.js} +3 -3
  82. package/dist/{node-5MJ6ATKS.js → node-X35R6UYP.js} +13 -13
  83. package/dist/{node-package-manager-FZRL3EQB.js → node-package-manager-3GAIXEER.js} +4 -4
  84. package/dist/{path-2K5HIMHZ.js → path-GWAZZN2N.js} +2 -2
  85. package/dist/tsconfig.tsbuildinfo +1 -1
  86. package/dist/{ui-5VMS7DNB.js → ui-MTRH5XFP.js} +3 -3
  87. package/dist/{workerd-JHDITYBC.js → workerd-EHYW43DG.js} +13 -13
  88. package/oclif.manifest.json +9 -1
  89. package/package.json +6 -6
  90. package/dist/chunk-IROPFRNN.js.map +0 -7
  91. package/dist/chunk-UAZUB5EV.js +0 -28
  92. package/dist/chunk-UAZUB5EV.js.map +0 -7
  93. /package/dist/{chunk-WOG2LQ3X.js.map → chunk-2WTNMSEA.js.map} +0 -0
  94. /package/dist/{chunk-ACGZSEHA.js.map → chunk-3DV6EZ24.js.map} +0 -0
  95. /package/dist/{chunk-EHL6XSBG.js.map → chunk-6RHYOJ63.js.map} +0 -0
  96. /package/dist/{chunk-ZQU7DVLN.js.map → chunk-AHNHLXEN.js.map} +0 -0
  97. /package/dist/{chunk-BJG7ZRQ2.js.map → chunk-AZ3SNZKH.js.map} +0 -0
  98. /package/dist/{chunk-W6WCETMJ.js.map → chunk-BJXULBKX.js.map} +0 -0
  99. /package/dist/{chunk-PDQLM7DM.js.map → chunk-CBRJA5VT.js.map} +0 -0
  100. /package/dist/{chunk-RDHYYXFE.js.map → chunk-DTR7ATW4.js.map} +0 -0
  101. /package/dist/{chunk-ULBY4CUT.js.map → chunk-DZC6PFFO.js.map} +0 -0
  102. /package/dist/{chunk-LTIYNGCV.js.map → chunk-EPUCFUDR.js.map} +0 -0
  103. /package/dist/{chunk-T2LQCR7X.js.map → chunk-IKXB6S5W.js.map} +0 -0
  104. /package/dist/{chunk-EJU7LVJW.js.map → chunk-J4VMFBCX.js.map} +0 -0
  105. /package/dist/{chunk-6KV6OKFB.js.map → chunk-J64C3R6H.js.map} +0 -0
  106. /package/dist/{chunk-FZT5AGA5.js.map → chunk-KTICPCDH.js.map} +0 -0
  107. /package/dist/{chunk-MVZ4LGIM.js.map → chunk-MIAZDAJI.js.map} +0 -0
  108. /package/dist/{chunk-4SFWD6RY.js.map → chunk-OSETU22I.js.map} +0 -0
  109. /package/dist/{chunk-JBS4NEJX.js.map → chunk-PNWJ2GZC.js.map} +0 -0
  110. /package/dist/{chunk-5TZDSORY.js.map → chunk-QP45KHVL.js.map} +0 -0
  111. /package/dist/{chunk-6TPMZTXG.js.map → chunk-SO2JXJNK.js.map} +0 -0
  112. /package/dist/{chunk-4OD4TP6T.js.map → chunk-SROPQDQ2.js.map} +0 -0
  113. /package/dist/{chunk-LUCMIGZJ.js.map → chunk-TYXJ553W.js.map} +0 -0
  114. /package/dist/{chunk-742MYXOA.js.map → chunk-VXUNILLD.js.map} +0 -0
  115. /package/dist/{chunk-A44GEDKW.js.map → chunk-WFJKWPG7.js.map} +0 -0
  116. /package/dist/{chunk-FUA76K3T.js.map → chunk-WXONIGO7.js.map} +0 -0
  117. /package/dist/{chunk-3THHNKSL.js.map → chunk-WYLW7KVV.js.map} +0 -0
  118. /package/dist/{chunk-RB5K7TGA.js.map → chunk-XAK5UQFR.js.map} +0 -0
  119. /package/dist/{chunk-7UIQNXWE.js.map → chunk-XOWOZYS5.js.map} +0 -0
  120. /package/dist/{chunk-57Q6OQG4.js.map → chunk-ZUCWDIGE.js.map} +0 -0
  121. /package/dist/{custom-oclif-loader-BXHJERI2.js.map → custom-oclif-loader-FMEBF4P4.js.map} +0 -0
  122. /package/dist/{error-handler-FV3FJ3VW.js.map → error-handler-AMKMVQCR.js.map} +0 -0
  123. /package/dist/{local-PMOJBQT6.js.map → local-2RXSPQ2I.js.map} +0 -0
  124. /package/dist/{node-5MJ6ATKS.js.map → node-X35R6UYP.js.map} +0 -0
  125. /package/dist/{node-package-manager-FZRL3EQB.js.map → node-package-manager-3GAIXEER.js.map} +0 -0
  126. /package/dist/{path-2K5HIMHZ.js.map → path-GWAZZN2N.js.map} +0 -0
  127. /package/dist/{ui-5VMS7DNB.js.map → ui-MTRH5XFP.js.map} +0 -0
  128. /package/dist/{workerd-JHDITYBC.js.map → workerd-EHYW43DG.js.map} +0 -0
@@ -17,10 +17,10 @@ import {
17
17
  renderText,
18
18
  renderTextPrompt,
19
19
  renderWarning
20
- } from "./chunk-LXQWZFLX.js";
20
+ } from "./chunk-3UYXKXR6.js";
21
21
  import "./chunk-B5EXYCV3.js";
22
22
  import "./chunk-75LV6AQS.js";
23
- import "./chunk-57Q6OQG4.js";
23
+ import "./chunk-ZUCWDIGE.js";
24
24
  import "./chunk-VSKRQ3JT.js";
25
25
  import "./chunk-G5R6YD27.js";
26
26
  import "./chunk-3I3GQNEW.js";
@@ -51,4 +51,4 @@ export {
51
51
  renderTextPrompt,
52
52
  renderWarning
53
53
  };
54
- //# sourceMappingURL=ui-5VMS7DNB.js.map
54
+ //# sourceMappingURL=ui-MTRH5XFP.js.map
@@ -10,20 +10,20 @@ import {
10
10
  importLocal,
11
11
  logRequestLine,
12
12
  setConstructors
13
- } from "./chunk-VX5SZCUI.js";
13
+ } from "./chunk-TKC27SYH.js";
14
14
  import "./chunk-LQ2ZKVR6.js";
15
15
  import "./chunk-CP3BRHWK.js";
16
- import "./chunk-4SFWD6RY.js";
17
- import "./chunk-EHL6XSBG.js";
18
- import "./chunk-3Q5TSFEN.js";
16
+ import "./chunk-OSETU22I.js";
17
+ import "./chunk-6RHYOJ63.js";
18
+ import "./chunk-7ZRFR7FA.js";
19
19
  import "./chunk-SHWOPMLQ.js";
20
- import "./chunk-6TPMZTXG.js";
21
- import "./chunk-5TZDSORY.js";
22
- import "./chunk-IROPFRNN.js";
23
- import "./chunk-W6WCETMJ.js";
20
+ import "./chunk-SO2JXJNK.js";
21
+ import "./chunk-QP45KHVL.js";
22
+ import "./chunk-WOA7JN7E.js";
23
+ import "./chunk-BJXULBKX.js";
24
24
  import "./chunk-25IMI7TH.js";
25
- import "./chunk-DFFXOFLT.js";
26
- import "./chunk-WWI2QVFK.js";
25
+ import "./chunk-JMXX7A4N.js";
26
+ import "./chunk-KI626P2Z.js";
27
27
  import "./chunk-HMDWNGIV.js";
28
28
  import {
29
29
  AbortError,
@@ -32,13 +32,13 @@ import {
32
32
  readFile,
33
33
  renderSuccess,
34
34
  source_default
35
- } from "./chunk-LXQWZFLX.js";
35
+ } from "./chunk-3UYXKXR6.js";
36
36
  import "./chunk-B5EXYCV3.js";
37
37
  import "./chunk-75LV6AQS.js";
38
38
  import {
39
39
  dirname,
40
40
  resolvePath
41
- } from "./chunk-57Q6OQG4.js";
41
+ } from "./chunk-ZUCWDIGE.js";
42
42
  import "./chunk-VSKRQ3JT.js";
43
43
  import "./chunk-G5R6YD27.js";
44
44
  import "./chunk-3I3GQNEW.js";
@@ -171,4 +171,4 @@ async function startWorkerdServer({
171
171
  export {
172
172
  startWorkerdServer
173
173
  };
174
- //# sourceMappingURL=workerd-JHDITYBC.js.map
174
+ //# sourceMappingURL=workerd-EHYW43DG.js.map
@@ -4423,6 +4423,14 @@
4423
4423
  "description": "List current notifications configured for the CLI.",
4424
4424
  "enableJsonFlag": false,
4425
4425
  "flags": {
4426
+ "ignore-errors": {
4427
+ "allowNo": false,
4428
+ "description": "Don't fail if an error occurs.",
4429
+ "env": "SHOPIFY_FLAG_IGNORE_ERRORS",
4430
+ "hidden": false,
4431
+ "name": "ignore-errors",
4432
+ "type": "boolean"
4433
+ }
4426
4434
  },
4427
4435
  "hasDynamicHelp": false,
4428
4436
  "hidden": true,
@@ -6845,5 +6853,5 @@
6845
6853
  "summary": "Trigger delivery of a sample webhook topic payload to a designated address."
6846
6854
  }
6847
6855
  },
6848
- "version": "3.76.1"
6856
+ "version": "3.76.2"
6849
6857
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify",
3
- "version": "3.76.1",
3
+ "version": "3.76.2",
4
4
  "packageManager": "pnpm@8.15.7",
5
5
  "private": false,
6
6
  "description": "A CLI tool to build for the Shopify platform",
@@ -98,11 +98,11 @@
98
98
  "@oclif/core": "3.26.5",
99
99
  "@oclif/plugin-commands": "4.1.18",
100
100
  "@oclif/plugin-plugins": "5.4.28",
101
- "@shopify/app": "3.76.1",
102
- "@shopify/cli-kit": "3.76.1",
103
- "@shopify/plugin-cloudflare": "3.76.1",
104
- "@shopify/plugin-did-you-mean": "3.76.1",
105
- "@shopify/theme": "3.76.1",
101
+ "@shopify/app": "3.76.2",
102
+ "@shopify/cli-kit": "3.76.2",
103
+ "@shopify/plugin-cloudflare": "3.76.2",
104
+ "@shopify/plugin-did-you-mean": "3.76.2",
105
+ "@shopify/theme": "3.76.2",
106
106
  "@shopify/cli-hydrogen": "9.0.8",
107
107
  "@typescript-eslint/eslint-plugin": "7.13.1",
108
108
  "@vitest/coverage-istanbul": "^1.6.0",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../cli-kit/src/public/node/notifications-system.ts", "../../cli-kit/src/public/node/global-context.ts"],
4
- "sourcesContent": ["import {versionSatisfies} from './node-package-manager.js'\nimport {renderError, renderInfo, renderWarning} from './ui.js'\nimport {getCurrentCommandId} from './global-context.js'\nimport {outputDebug} from './output.js'\nimport {zod} from './schema.js'\nimport {AbortSilentError} from './error.js'\nimport {isTruthy} from './context/utilities.js'\nimport {exec} from './system.js'\nimport {jsonOutputEnabled} from './environment.js'\nimport {CLI_KIT_VERSION} from '../common/version.js'\nimport {NotificationKey, NotificationsKey, cacheRetrieve, cacheStore} from '../../private/node/conf-store.js'\nimport {fetch} from '@shopify/cli-kit/node/http'\n\nconst URL = 'https://cdn.shopify.com/static/cli/notifications.json'\nconst EMPTY_CACHE_MESSAGE = 'Cache is empty'\n\nfunction url(): string {\n return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL ?? URL\n}\n\nconst NotificationSchema = zod.object({\n id: zod.string(),\n message: zod.string(),\n type: zod.enum(['info', 'warning', 'error']),\n frequency: zod.enum(['always', 'once', 'once_a_day', 'once_a_week']),\n ownerChannel: zod.string(),\n cta: zod\n .object({\n label: zod.string(),\n url: zod.string().url(),\n })\n .optional(),\n title: zod.string().optional(),\n minVersion: zod.string().optional(),\n maxVersion: zod.string().optional(),\n minDate: zod.string().optional(),\n maxDate: zod.string().optional(),\n commands: zod.array(zod.string()).optional(),\n surface: zod.string().optional(),\n})\nexport type Notification = zod.infer<typeof NotificationSchema>\n\nconst NotificationsSchema = zod.object({notifications: zod.array(NotificationSchema)})\nexport type Notifications = zod.infer<typeof NotificationsSchema>\n\n/**\n * Shows notifications to the user if they meet the criteria specified in the notifications.json file.\n *\n * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).\n * @param environment - Process environment variables.\n * @returns - A promise that resolves when the notifications have been shown.\n */\nexport async function showNotificationsIfNeeded(\n currentSurfaces?: string[],\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<void> {\n try {\n if (skipNotifications(environment) || jsonOutputEnabled(environment)) return\n\n const notifications = await getNotifications()\n const commandId = getCurrentCommandId()\n const notificationsToShow = filterNotifications(notifications.notifications, commandId, currentSurfaces)\n outputDebug(`Notifications to show: ${notificationsToShow.length}`)\n await renderNotifications(notificationsToShow)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n if (error.message === 'abort') throw new AbortSilentError()\n const errorMessage = `Error retrieving notifications: ${error.message}`\n outputDebug(errorMessage)\n if (error.message === EMPTY_CACHE_MESSAGE) return\n // This is very prone to becoming a circular dependency, so we import it dynamically\n const {sendErrorToBugsnag} = await import('./error-handler.js')\n await sendErrorToBugsnag(errorMessage, 'unexpected_error')\n }\n}\n\nfunction skipNotifications(environment: NodeJS.ProcessEnv = process.env): boolean {\n return isTruthy(environment.CI) || isTruthy(environment.SHOPIFY_UNIT_TEST)\n}\n\n/**\n * Renders the first 2 notifications to the user.\n *\n * @param notifications - The notifications to render.\n */\nasync function renderNotifications(notifications: Notification[]) {\n notifications.slice(0, 2).forEach((notification) => {\n const content = {\n headline: notification.title,\n body: notification.message.replaceAll('\\\\n', '\\n'),\n link: notification.cta,\n }\n switch (notification.type) {\n case 'info': {\n renderInfo(content)\n break\n }\n case 'warning': {\n renderWarning(content)\n break\n }\n case 'error': {\n renderError(content)\n throw new Error('abort')\n }\n }\n cacheStore(`notification-${notification.id}`, new Date().getTime().toString())\n })\n}\n\n/**\n * Get notifications list from cache, that is updated in the background from bin/fetch-notifications.json.\n *\n * @returns A Notifications object.\n */\nexport async function getNotifications(): Promise<Notifications> {\n const cacheKey: NotificationsKey = `notifications-${url()}`\n const rawNotifications = cacheRetrieve(cacheKey)?.value as unknown as string\n if (!rawNotifications) throw new Error(EMPTY_CACHE_MESSAGE)\n const notifications: object = JSON.parse(rawNotifications)\n return NotificationsSchema.parse(notifications)\n}\n\n/**\n * Fetch notifications from the CDN and chache them.\n *\n * @returns A string with the notifications.\n */\nexport async function fetchNotifications(): Promise<Notifications> {\n outputDebug(`Fetching notifications...`)\n const response = await fetch(url(), {signal: AbortSignal.timeout(3 * 1000)})\n if (response.status !== 200) throw new Error(`Failed to fetch notifications: ${response.statusText}`)\n const rawNotifications = await response.text()\n const notifications: object = JSON.parse(rawNotifications)\n const result = NotificationsSchema.parse(notifications)\n await cacheNotifications(rawNotifications)\n return result\n}\n\n/**\n * Store the notifications in the cache.\n *\n * @param notifications - String with the notifications to cache.\n * @returns A Notifications object.\n */\nasync function cacheNotifications(notifications: string): Promise<void> {\n cacheStore(`notifications-${url()}`, notifications)\n outputDebug(`Notifications from ${url()} stored in the cache`)\n}\n\n/**\n * Fetch notifications in background as a detached process.\n *\n * @param currentCommand - The current Shopify command being run.\n * @param argv - The arguments passed to the current process.\n * @param environment - Process environment variables.\n */\nexport function fetchNotificationsInBackground(\n currentCommand: string,\n argv = process.argv,\n environment: NodeJS.ProcessEnv = process.env,\n): void {\n if (skipNotifications(environment)) return\n\n let command = 'shopify'\n const args = ['notifications', 'list']\n // Run the Shopify command the same way as the current execution when it's not the global installation\n if (argv[0] && argv[0] !== 'shopify') {\n command = argv[0]\n const indexValue = currentCommand.split(':')[0] ?? ''\n const index = argv.indexOf(indexValue)\n if (index > 0) args.unshift(...argv.slice(1, index))\n }\n // eslint-disable-next-line no-void\n void exec(command, args, {background: true, env: {...process.env, SHOPIFY_CLI_NO_ANALYTICS: '1'}})\n}\n\n/**\n * Filters notifications based on the version of the CLI.\n *\n * @param notifications - The notifications to filter.\n * @param commandId - The command ID to filter by.\n * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).\n * @param today - The current date.\n * @param currentVersion - The current version of the CLI.\n * @returns - The filtered notifications.\n */\nexport function filterNotifications(\n notifications: Notification[],\n commandId: string,\n currentSurfaces?: string[],\n today: Date = new Date(new Date().setUTCHours(0, 0, 0, 0)),\n currentVersion: string = CLI_KIT_VERSION,\n): Notification[] {\n return notifications\n .filter((notification) => filterByVersion(notification, currentVersion))\n .filter((notifications) => filterByDate(notifications, today))\n .filter((notification) => filterByCommand(notification, commandId))\n .filter((notification) => filterBySurface(notification, commandId, currentSurfaces))\n .filter((notification) => filterByFrequency(notification))\n}\n\n/**\n * Filters notifications based on the version of the CLI.\n *\n * @param notification - The notification to filter.\n * @param currentVersion - The current version of the CLI.\n */\nfunction filterByVersion(notification: Notification, currentVersion: string) {\n const minVersion = !notification.minVersion || versionSatisfies(currentVersion, `>=${notification.minVersion}`)\n const maxVersion = !notification.maxVersion || versionSatisfies(currentVersion, `<=${notification.maxVersion}`)\n return minVersion && maxVersion\n}\n\n/**\n * Filters notifications based on the date.\n *\n * @param notification - The notification to filter.\n * @param today - The current date.\n */\nfunction filterByDate(notification: Notification, today: Date) {\n const minDate = !notification.minDate || new Date(notification.minDate) <= today\n const maxDate = !notification.maxDate || new Date(notification.maxDate) >= today\n return minDate && maxDate\n}\n\n/**\n * Filters notifications based on the command ID.\n *\n * @param notification - The notification to filter.\n * @param commandId - The command ID to filter by.\n * @returns - A boolean indicating whether the notification should be shown.\n */\nfunction filterByCommand(notification: Notification, commandId: string) {\n if (commandId === '') return true\n return !notification.commands || notification.commands.includes(commandId)\n}\n\n/**\n * Filters notifications based on the surface.\n *\n * @param notification - The notification to filter.\n * @param commandId - The command id.\n * @param surfacesFromContext - The surfaces present in the current project (usually for app extensions).\n * @returns - A boolean indicating whether the notification should be shown.\n */\nfunction filterBySurface(notification: Notification, commandId: string, surfacesFromContext?: string[]) {\n const surfaceFromCommand = commandId.split(':')[0] ?? 'all'\n const notificationSurface = notification.surface ?? 'all'\n\n if (surfacesFromContext) return surfacesFromContext.includes(notificationSurface)\n\n return notificationSurface === surfaceFromCommand || notificationSurface === 'all'\n}\n\n/**\n * Filters notifications based on the frequency.\n *\n * @param notification - The notification to filter.\n * @returns - A boolean indicating whether the notification should be shown.\n */\nfunction filterByFrequency(notification: Notification): boolean {\n if (!notification.frequency) return true\n const cacheKey: NotificationKey = `notification-${notification.id}`\n const lastShown = cacheRetrieve(cacheKey)?.value as unknown as string\n if (!lastShown) return true\n\n switch (notification.frequency) {\n case 'always': {\n return true\n }\n case 'once': {\n return false\n }\n case 'once_a_day': {\n return new Date().getTime() - Number(lastShown) > 24 * 3600 * 1000\n }\n case 'once_a_week': {\n return new Date().getTime() - Number(lastShown) > 7 * 24 * 3600 * 1000\n }\n }\n}\n\n/**\n * Returns a string with the filters from a notification, one by line.\n *\n * @param notification - The notification to get the filters from.\n * @returns A string with human-readable filters from the notification.\n */\nexport function stringifyFilters(notification: Notification): string {\n const filters = []\n if (notification.minDate) filters.push(`from ${notification.minDate}`)\n if (notification.maxDate) filters.push(`to ${notification.maxDate}`)\n if (notification.minVersion) filters.push(`from v${notification.minVersion}`)\n if (notification.maxVersion) filters.push(`to v${notification.maxVersion}`)\n if (notification.frequency === 'once') filters.push('show only once')\n if (notification.frequency === 'once_a_day') filters.push('show once a day')\n if (notification.frequency === 'once_a_week') filters.push('show once a week')\n if (notification.surface) filters.push(`surface = ${notification.surface}`)\n if (notification.commands) filters.push(`commands = ${notification.commands.join(', ')}`)\n return filters.join('\\n')\n}\n", "export interface GlobalContext {\n currentCommandId: string\n}\n\nlet _globalContext: GlobalContext | undefined\n\n/**\n * Get the global context.\n *\n * @returns Global context.\n */\nfunction getGlobalContext(): GlobalContext {\n if (!_globalContext) {\n _globalContext = {currentCommandId: ''}\n }\n return _globalContext\n}\n\n/**\n * Get the current command ID.\n *\n * @returns Current command ID.\n */\nexport function getCurrentCommandId(): string {\n return getGlobalContext().currentCommandId\n}\n\n/**\n * Set the current command ID.\n *\n * @param commandId - Command ID.\n */\nexport function setCurrentCommandId(commandId: string): void {\n getGlobalContext().currentCommandId = commandId\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACIA;IAAI;AAOJ,SAAS,mBAAgB;AACvB,SAAK,mBACH,iBAAiB,EAAC,kBAAkB,GAAE,IAEjC;AACT;AAOM,SAAU,sBAAmB;AACjC,SAAO,iBAAgB,EAAG;AAC5B;AAOM,SAAU,oBAAoB,WAAiB;AACnD,mBAAgB,EAAG,mBAAmB;AACxC;;;ADrBA,IAAM,MAAM,yDACN,sBAAsB;AAE5B,SAAS,MAAG;AACV,SAAO,QAAQ,IAAI,iCAAiC;AACtD;AAEA,IAAM,qBAAqB,EAAI,OAAO;EACpC,IAAI,EAAI,OAAM;EACd,SAAS,EAAI,OAAM;EACnB,MAAM,EAAI,KAAK,CAAC,QAAQ,WAAW,OAAO,CAAC;EAC3C,WAAW,EAAI,KAAK,CAAC,UAAU,QAAQ,cAAc,aAAa,CAAC;EACnE,cAAc,EAAI,OAAM;EACxB,KAAK,EACF,OAAO;IACN,OAAO,EAAI,OAAM;IACjB,KAAK,EAAI,OAAM,EAAG,IAAG;GACtB,EACA,SAAQ;EACX,OAAO,EAAI,OAAM,EAAG,SAAQ;EAC5B,YAAY,EAAI,OAAM,EAAG,SAAQ;EACjC,YAAY,EAAI,OAAM,EAAG,SAAQ;EACjC,SAAS,EAAI,OAAM,EAAG,SAAQ;EAC9B,SAAS,EAAI,OAA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AAW,WAAO;AACpC,MAAM,WAA4B,gBAAgB,aAAa,EAAE,IAC3D,YAAY,cAAc,QAAQ,GAAG;AAC3C,MAAI,CAAC;AAAW,WAAO;AAEvB,UAAQ,aAAa,WAAW;IAC9B,KAAK;AACH,aAAO;IAET,KAAK;AACH,aAAO;IAET,KAAK;AACH,cAAO,oBAAI,KAAI,GAAG,QAAO,IAAK,OAAO,SAAS,IAAI,KAAK,OAAO;IAEhE,KAAK;AACH,cAAO,oBAAI,KAAI,GAAG,QAAO,IAAK,OAAO,SAAS,IAAI,IAAI,KAAK,OAAO;EAEtE;AACF;AAQM,SAAU,iBAAiB,cAA0B;AACzD,MAAM,UAAU,CAAA;AAChB,SAAI,aAAa,WAAS,QAAQ,KAAK,QAAQ,aAAa,OAAO,EAAE,GACjE,aAAa,WAAS,QAAQ,KAAK,MAAM,aAAa,OAAO,EAAE,GAC/D,aAAa,cAAY,QAAQ,KAAK,SAAS,aAAa,UAAU,EAAE,GACxE,aAAa,cAAY,QAAQ,KAAK,OAAO,aAAa,UAAU,EAAE,GACtE,aAAa,cAAc,UAAQ,QAAQ,KAAK,gBAAgB,GAChE,aAAa,cAAc,gBAAc,QAAQ,KAAK,iBAAiB,GACvE,aAAa,cAAc,iBAAe,QAAQ,KAAK,kBAAkB,GACzE,aAAa,WAAS,QAAQ,KAAK,aAAa,aAAa,OAAO,EAAE,GACtE,aAAa,YAAU,QAAQ,KAAK,cAAc,aAAa,SAAS,KAAK,IAAI,CAAC,EAAE,GACjF,QAAQ,KAAK;CAAI;AAC1B;",
6
- "names": ["notifications"]
7
- }
@@ -1,28 +0,0 @@
1
- import {
2
- list
3
- } from "./chunk-A44GEDKW.js";
4
- import {
5
- base_command_default
6
- } from "./chunk-EHL6XSBG.js";
7
- import {
8
- init_cjs_shims
9
- } from "./chunk-PKR7KJ6P.js";
10
-
11
- // src/cli/commands/notifications/list.ts
12
- init_cjs_shims();
13
- var List = class extends base_command_default {
14
- static {
15
- this.description = "List current notifications configured for the CLI.";
16
- }
17
- static {
18
- this.hidden = !0;
19
- }
20
- async run() {
21
- await list();
22
- }
23
- };
24
-
25
- export {
26
- List
27
- };
28
- //# sourceMappingURL=chunk-UAZUB5EV.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/cli/commands/notifications/list.ts"],
4
- "sourcesContent": ["import {list} from '../../services/commands/notifications.js'\nimport Command from '@shopify/cli-kit/node/base-command'\n\nexport default class List extends Command {\n static description = 'List current notifications configured for the CLI.'\n static hidden = true\n\n async run(): Promise<void> {\n await list()\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAAA;AAGA,IAAqB,OAArB,cAAkC,qBAAQ;AAAA,EACxC;AAAA,SAAO,cAAc;AAAA;AAAA,EACrB;AAAA,SAAO,SAAS;AAAA;AAAA,EAEhB,MAAM,MAAqB;AACzB,UAAM,KAAK;AAAA,EACb;AACF;",
6
- "names": []
7
- }
File without changes