@shopify/cli-kit 3.84.1 → 3.85.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 (118) hide show
  1. package/README.md +1 -1
  2. package/dist/private/node/analytics/bounded-collections.js.map +1 -0
  3. package/dist/{public/node/themes → private/node}/analytics/error-categorizer.d.ts +7 -1
  4. package/dist/private/node/analytics/error-categorizer.js +106 -0
  5. package/dist/private/node/analytics/error-categorizer.js.map +1 -0
  6. package/dist/{public/node/themes → private/node}/analytics/storage.js +8 -3
  7. package/dist/private/node/analytics/storage.js.map +1 -0
  8. package/dist/private/node/api/graphql/business-platform-destinations/user-email.d.ts +6 -0
  9. package/dist/private/node/api/graphql/business-platform-destinations/user-email.js +8 -0
  10. package/dist/private/node/api/graphql/business-platform-destinations/user-email.js.map +1 -0
  11. package/dist/private/node/api/headers.d.ts +3 -6
  12. package/dist/private/node/api/headers.js +8 -24
  13. package/dist/private/node/api/headers.js.map +1 -1
  14. package/dist/private/node/conf-store.d.ts +20 -3
  15. package/dist/private/node/conf-store.js +32 -7
  16. package/dist/private/node/conf-store.js.map +1 -1
  17. package/dist/private/node/constants.d.ts +0 -1
  18. package/dist/private/node/constants.js +0 -1
  19. package/dist/private/node/constants.js.map +1 -1
  20. package/dist/private/node/context/service.d.ts +8 -2
  21. package/dist/private/node/context/service.js +9 -5
  22. package/dist/private/node/context/service.js.map +1 -1
  23. package/dist/private/node/otel-metrics.js +2 -3
  24. package/dist/private/node/otel-metrics.js.map +1 -1
  25. package/dist/private/node/session/schema.d.ts +796 -41
  26. package/dist/private/node/session/schema.js +24 -25
  27. package/dist/private/node/session/schema.js.map +1 -1
  28. package/dist/private/node/session/store.d.ts +21 -11
  29. package/dist/private/node/session/store.js +52 -18
  30. package/dist/private/node/session/store.js.map +1 -1
  31. package/dist/private/node/session/validate.d.ts +2 -7
  32. package/dist/private/node/session/validate.js.map +1 -1
  33. package/dist/private/node/session.d.ts +8 -6
  34. package/dist/private/node/session.js +99 -71
  35. package/dist/private/node/session.js.map +1 -1
  36. package/dist/private/node/ui/components/LoadingBar.d.ts +8 -0
  37. package/dist/private/node/ui/components/LoadingBar.js +21 -0
  38. package/dist/private/node/ui/components/LoadingBar.js.map +1 -0
  39. package/dist/private/node/ui/components/LoadingBar.test.d.ts +1 -0
  40. package/dist/private/node/ui/components/LoadingBar.test.js +182 -0
  41. package/dist/private/node/ui/components/LoadingBar.test.js.map +1 -0
  42. package/dist/private/node/ui/components/SingleTask.d.ts +8 -0
  43. package/dist/private/node/ui/components/SingleTask.js +27 -0
  44. package/dist/private/node/ui/components/SingleTask.js.map +1 -0
  45. package/dist/private/node/ui/components/SingleTask.test.d.ts +1 -0
  46. package/dist/private/node/ui/components/SingleTask.test.js +145 -0
  47. package/dist/private/node/ui/components/SingleTask.test.js.map +1 -0
  48. package/dist/private/node/ui/components/Tasks.d.ts +2 -1
  49. package/dist/private/node/ui/components/Tasks.js +5 -25
  50. package/dist/private/node/ui/components/Tasks.js.map +1 -1
  51. package/dist/private/node/ui/components/Tasks.test.js +19 -103
  52. package/dist/private/node/ui/components/Tasks.test.js.map +1 -1
  53. package/dist/private/node/ui/hooks/use-exit-on-ctrl-c.d.ts +4 -0
  54. package/dist/private/node/ui/hooks/use-exit-on-ctrl-c.js +15 -0
  55. package/dist/private/node/ui/hooks/use-exit-on-ctrl-c.js.map +1 -0
  56. package/dist/public/common/version.d.ts +1 -1
  57. package/dist/public/common/version.js +1 -1
  58. package/dist/public/common/version.js.map +1 -1
  59. package/dist/public/node/analytics.d.ts +77 -0
  60. package/dist/public/node/analytics.js +88 -0
  61. package/dist/public/node/analytics.js.map +1 -1
  62. package/dist/public/node/api/admin.js +2 -3
  63. package/dist/public/node/api/admin.js.map +1 -1
  64. package/dist/public/node/api/app-dev.d.ts +2 -0
  65. package/dist/public/node/api/app-dev.js +1 -0
  66. package/dist/public/node/api/app-dev.js.map +1 -1
  67. package/dist/public/node/base-command.d.ts +22 -0
  68. package/dist/public/node/base-command.js +1 -1
  69. package/dist/public/node/base-command.js.map +1 -1
  70. package/dist/public/node/context/fqdn.d.ts +0 -4
  71. package/dist/public/node/context/fqdn.js +1 -23
  72. package/dist/public/node/context/fqdn.js.map +1 -1
  73. package/dist/public/node/context/local.d.ts +2 -2
  74. package/dist/public/node/context/local.js +2 -6
  75. package/dist/public/node/context/local.js.map +1 -1
  76. package/dist/public/node/error-handler.js +2 -1
  77. package/dist/public/node/error-handler.js.map +1 -1
  78. package/dist/public/node/http.d.ts +1 -1
  79. package/dist/public/node/http.js +1 -1
  80. package/dist/public/node/http.js.map +1 -1
  81. package/dist/public/node/metadata.d.ts +31 -4
  82. package/dist/public/node/metadata.js.map +1 -1
  83. package/dist/public/node/session-prompt.d.ts +10 -0
  84. package/dist/public/node/session-prompt.js +86 -0
  85. package/dist/public/node/session-prompt.js.map +1 -0
  86. package/dist/public/node/session.d.ts +11 -6
  87. package/dist/public/node/session.js +15 -4
  88. package/dist/public/node/session.js.map +1 -1
  89. package/dist/public/node/themes/api.js +28 -8
  90. package/dist/public/node/themes/api.js.map +1 -1
  91. package/dist/public/node/ui.d.ts +17 -1
  92. package/dist/public/node/ui.js +26 -2
  93. package/dist/public/node/ui.js.map +1 -1
  94. package/dist/public/node/vendor/dev_server/dev-server.js +1 -5
  95. package/dist/public/node/vendor/dev_server/dev-server.js.map +1 -1
  96. package/dist/public/node/vendor/dev_server/env.js +2 -2
  97. package/dist/public/node/vendor/dev_server/env.js.map +1 -1
  98. package/dist/tsconfig.tsbuildinfo +1 -1
  99. package/package.json +2 -2
  100. package/dist/private/node/context/spin-cache.d.ts +0 -2
  101. package/dist/private/node/context/spin-cache.js +0 -8
  102. package/dist/private/node/context/spin-cache.js.map +0 -1
  103. package/dist/public/node/context/spin.d.ts +0 -69
  104. package/dist/public/node/context/spin.js +0 -152
  105. package/dist/public/node/context/spin.js.map +0 -1
  106. package/dist/public/node/themes/analytics/bounded-collections.js.map +0 -1
  107. package/dist/public/node/themes/analytics/error-categorizer.js +0 -49
  108. package/dist/public/node/themes/analytics/error-categorizer.js.map +0 -1
  109. package/dist/public/node/themes/analytics/storage.js.map +0 -1
  110. package/dist/public/node/themes/analytics.d.ts +0 -60
  111. package/dist/public/node/themes/analytics.js +0 -71
  112. package/dist/public/node/themes/analytics.js.map +0 -1
  113. package/dist/public/node/vendor/dev_server/dev-server-spin.d.ts +0 -5
  114. package/dist/public/node/vendor/dev_server/dev-server-spin.js +0 -28
  115. package/dist/public/node/vendor/dev_server/dev-server-spin.js.map +0 -1
  116. /package/dist/{public/node/themes → private/node}/analytics/bounded-collections.d.ts +0 -0
  117. /package/dist/{public/node/themes → private/node}/analytics/bounded-collections.js +0 -0
  118. /package/dist/{public/node/themes → private/node}/analytics/storage.d.ts +0 -0
@@ -23,68 +23,6 @@ beforeEach(() => {
23
23
  });
24
24
  });
25
25
  describe('Tasks', () => {
26
- test('shows a loading state at the start', async () => {
27
- // Given
28
- const firstTaskFunction = vi.fn(async () => {
29
- await new Promise((resolve) => setTimeout(resolve, 2000));
30
- });
31
- const firstTask = {
32
- title: 'task 1',
33
- task: firstTaskFunction,
34
- };
35
- // When
36
- const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask], silent: false }));
37
- await taskHasRendered();
38
- // Then
39
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
40
- "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
41
- task 1 ..."
42
- `);
43
- expect(firstTaskFunction).toHaveBeenCalled();
44
- });
45
- test('shows a loading state that is useful in no-color mode', async () => {
46
- // Given
47
- const firstTaskFunction = vi.fn(async () => {
48
- await new Promise((resolve) => setTimeout(resolve, 2000));
49
- });
50
- const firstTask = {
51
- title: 'task 1',
52
- task: firstTaskFunction,
53
- };
54
- // When
55
- const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask], silent: false, noColor: true }));
56
- // Then
57
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
58
- "▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆
59
- task 1 ..."
60
- `);
61
- expect(firstTaskFunction).toHaveBeenCalled();
62
- });
63
- test('truncates the no-color display correctly for narrow screens', async () => {
64
- // Given
65
- vi.mocked(useStdout).mockReturnValue({
66
- stdout: new Stdout({
67
- columns: 10,
68
- rows: 80,
69
- }),
70
- write: () => { },
71
- });
72
- const firstTaskFunction = vi.fn(async () => {
73
- await new Promise((resolve) => setTimeout(resolve, 2000));
74
- });
75
- const firstTask = {
76
- title: 'task 1',
77
- task: firstTaskFunction,
78
- };
79
- // When
80
- const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask], silent: false, noColor: true }));
81
- // Then
82
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
83
- "▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆
84
- task 1 ..."
85
- `);
86
- expect(firstTaskFunction).toHaveBeenCalled();
87
- });
88
26
  test('shows nothing at the end in case of success', async () => {
89
27
  // Given
90
28
  const firstTaskFunction = vi.fn(async () => { });
@@ -126,8 +64,9 @@ describe('Tasks', () => {
126
64
  test('it supports subtasks', async () => {
127
65
  // Given
128
66
  const firstSubtaskFunction = vi.fn(async () => {
129
- await new Promise((resolve) => setTimeout(resolve, 2000));
67
+ await new Promise((resolve) => setTimeout(resolve, 100));
130
68
  });
69
+ const secondSubtaskFunction = vi.fn(async () => { });
131
70
  const firstTask = {
132
71
  title: 'task 1',
133
72
  task: async () => {
@@ -138,7 +77,7 @@ describe('Tasks', () => {
138
77
  },
139
78
  {
140
79
  title: 'subtask 2',
141
- task: async () => { },
80
+ task: secondSubtaskFunction,
142
81
  },
143
82
  ];
144
83
  },
@@ -149,18 +88,18 @@ describe('Tasks', () => {
149
88
  };
150
89
  // When
151
90
  const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask, secondTask], silent: false }));
152
- await taskHasRendered();
91
+ await renderInstance.waitUntilExit();
153
92
  // Then
154
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
155
- "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
156
- subtask 1 ..."
157
- `);
158
93
  expect(firstSubtaskFunction).toHaveBeenCalled();
94
+ expect(secondSubtaskFunction).toHaveBeenCalled();
159
95
  });
160
96
  test('supports skipping', async () => {
161
97
  // Given
162
98
  const firstTaskFunction = vi.fn(async () => {
163
- await new Promise((resolve) => setTimeout(resolve, 2000));
99
+ await new Promise((resolve) => setTimeout(resolve, 100));
100
+ });
101
+ const secondTaskFunction = vi.fn(async () => {
102
+ await new Promise((resolve) => setTimeout(resolve, 100));
164
103
  });
165
104
  const firstTask = {
166
105
  title: 'task 1',
@@ -169,27 +108,22 @@ describe('Tasks', () => {
169
108
  };
170
109
  const secondTask = {
171
110
  title: 'task 2',
172
- task: async () => {
173
- await new Promise((resolve) => setTimeout(resolve, 2000));
174
- },
111
+ task: secondTaskFunction,
175
112
  };
176
113
  // When
177
114
  const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask, secondTask], silent: false }));
178
- await taskHasRendered();
115
+ await renderInstance.waitUntilExit();
179
116
  // Then
180
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
181
- "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
182
- task 2 ..."
183
- `);
184
117
  expect(firstTaskFunction).toHaveBeenCalledTimes(0);
118
+ expect(secondTaskFunction).toHaveBeenCalled();
185
119
  });
186
120
  test('supports skipping a subtask', async () => {
187
121
  // Given
188
122
  const firstSubTaskFunction = vi.fn(async () => {
189
- await new Promise((resolve) => setTimeout(resolve, 2000));
123
+ await new Promise((resolve) => setTimeout(resolve, 100));
190
124
  });
191
125
  const secondSubTaskFunction = vi.fn(async () => {
192
- await new Promise((resolve) => setTimeout(resolve, 2000));
126
+ await new Promise((resolve) => setTimeout(resolve, 100));
193
127
  });
194
128
  const firstTask = {
195
129
  title: 'task 1',
@@ -209,12 +143,8 @@ describe('Tasks', () => {
209
143
  };
210
144
  // When
211
145
  const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask], silent: false }));
212
- await taskHasRendered();
146
+ await renderInstance.waitUntilExit();
213
147
  // Then
214
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
215
- "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
216
- subtask 2 ..."
217
- `);
218
148
  expect(firstSubTaskFunction).toHaveBeenCalledTimes(0);
219
149
  expect(secondSubTaskFunction).toHaveBeenCalled();
220
150
  });
@@ -224,7 +154,6 @@ describe('Tasks', () => {
224
154
  if (task.retryCount < task.retry) {
225
155
  throw new Error(`something went wrong${task.retryCount}`);
226
156
  }
227
- await new Promise((resolve) => setTimeout(resolve, 2000));
228
157
  });
229
158
  const firstTask = {
230
159
  title: 'task 1',
@@ -233,12 +162,8 @@ describe('Tasks', () => {
233
162
  };
234
163
  // When
235
164
  const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask], silent: false }));
236
- await taskHasRendered();
165
+ await renderInstance.waitUntilExit();
237
166
  // Then
238
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
239
- "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
240
- task 1 ..."
241
- `);
242
167
  expect(firstTask.retryCount).toBe(3);
243
168
  expect(firstTask.errors).toEqual([
244
169
  Error('something went wrong0'),
@@ -252,7 +177,6 @@ describe('Tasks', () => {
252
177
  if (task.retryCount <= task.retry) {
253
178
  throw new Error(`something went wrong${task.retryCount}`);
254
179
  }
255
- await new Promise((resolve) => setTimeout(resolve, 2000));
256
180
  });
257
181
  const secondTaskFunction = vi.fn(async () => { });
258
182
  const firstTask = {
@@ -266,9 +190,8 @@ describe('Tasks', () => {
266
190
  };
267
191
  // When
268
192
  const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask, secondTask], silent: false }));
269
- await taskHasRendered();
270
193
  // Then
271
- expect(unstyled(getLastFrameAfterUnmount(renderInstance))).toMatchInlineSnapshot('""');
194
+ await expect(renderInstance.waitUntilExit()).rejects.toThrow('something went wrong3');
272
195
  expect(firstTask.retryCount).toBe(3);
273
196
  expect(firstTask.errors).toEqual([
274
197
  Error('something went wrong0'),
@@ -283,7 +206,6 @@ describe('Tasks', () => {
283
206
  if (task.retryCount < task.retry) {
284
207
  throw new Error(`something went wrong${task.retryCount}`);
285
208
  }
286
- await new Promise((resolve) => setTimeout(resolve, 2000));
287
209
  });
288
210
  const firstSubTask = {
289
211
  title: 'subtask 1',
@@ -298,12 +220,8 @@ describe('Tasks', () => {
298
220
  };
299
221
  // When
300
222
  const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask], silent: false }));
301
- await taskHasRendered();
223
+ await renderInstance.waitUntilExit();
302
224
  // Then
303
- expect(unstyled(renderInstance.lastFrame())).toMatchInlineSnapshot(`
304
- "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
305
- subtask 1 ..."
306
- `);
307
225
  expect(firstSubTask.retryCount).toBe(3);
308
226
  expect(firstSubTask.errors).toEqual([
309
227
  Error('something went wrong0'),
@@ -317,7 +235,6 @@ describe('Tasks', () => {
317
235
  if (task.retryCount <= task.retry) {
318
236
  throw new Error(`something went wrong${task.retryCount}`);
319
237
  }
320
- await new Promise((resolve) => setTimeout(resolve, 2000));
321
238
  });
322
239
  const secondSubTaskFunction = vi.fn(async () => { });
323
240
  const firstSubTask = {
@@ -337,9 +254,8 @@ describe('Tasks', () => {
337
254
  };
338
255
  // When
339
256
  const renderInstance = render(React.createElement(Tasks, { tasks: [firstTask], silent: false }));
340
- await taskHasRendered();
341
257
  // Then
342
- expect(unstyled(getLastFrameAfterUnmount(renderInstance))).toMatchInlineSnapshot('""');
258
+ await expect(renderInstance.waitUntilExit()).rejects.toThrow('something went wrong3');
343
259
  expect(firstSubTask.retryCount).toBe(3);
344
260
  expect(firstSubTask.errors).toEqual([
345
261
  Error('something went wrong0'),
@@ -1 +1 @@
1
- {"version":3,"file":"Tasks.test.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Tasks.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,EAAC,MAAM,YAAY,CAAA;AACtC,OAAO,EAAC,wBAAwB,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAC,QAAQ,EAAC,MA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C,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAC1D,CAAC","sourcesContent":["import {Task, Tasks} from './Tasks.js'\nimport {getLastFrameAfterUnmount, render} from '../../testing/ui.js'\nimport {unstyled} from '../../../../public/node/output.js'\nimport {AbortController} from '../../../../public/node/abort.js'\nimport {Stdout} from '../../ui.js'\nimport React from 'react'\nimport {beforeEach, describe, expect, test, vi} from 'vitest'\nimport {useStdout} from 'ink'\n\nvi.mock('ink', async () => {\n const original: any = await vi.importActual('ink')\n return {\n ...original,\n useStdout: vi.fn(),\n }\n})\n\nbeforeEach(() => {\n vi.mocked(useStdout).mockReturnValue({\n stdout: new Stdout({\n columns: 80,\n rows: 80,\n }) as any,\n write: () => {},\n })\n})\n\ndescribe('Tasks', () => {\n test('shows a loading state at the start', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 1 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalled()\n })\n\n test('shows a loading state that is useful in no-color mode', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} noColor />)\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆▆▅▅▄▄▃▃▂▂▁▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆\n task 1 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalled()\n })\n\n test('truncates the no-color display correctly for narrow screens', async () => {\n // Given\n vi.mocked(useStdout).mockReturnValue({\n stdout: new Stdout({\n columns: 10,\n rows: 80,\n }) as any,\n write: () => {},\n })\n\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} noColor />)\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▁▁▁▂▂▃▃▄▄▅▅▆▆▇▇██▇▇▆\n task 1 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalled()\n })\n\n test('shows nothing at the end in case of success', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {})\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n // When\n\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n await renderInstance.waitUntilExit()\n\n // Then\n expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot('\"\"')\n })\n\n test('stops at the task that throws error', async () => {\n // Given\n const abortController = new AbortController()\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n throw new Error('something went wrong')\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(\n <Tasks tasks={[firstTask, secondTask]} silent={false} abortSignal={abortController.signal} />,\n )\n\n // Then\n await expect(renderInstance.waitUntilExit()).rejects.toThrowError('something went wrong')\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('it supports subtasks', async () => {\n // Given\n const firstSubtaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubtaskFunction,\n },\n {\n title: 'subtask 2',\n task: async () => {},\n },\n ]\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: async () => {},\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 1 ...\"\n `)\n\n expect(firstSubtaskFunction).toHaveBeenCalled()\n })\n\n test('supports skipping', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n skip: () => true,\n }\n\n const secondTask = {\n title: 'task 2',\n task: async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 2 ...\"\n `)\n expect(firstTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('supports skipping a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n skip: () => true,\n },\n {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n },\n ]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 2 ...\"\n `)\n\n expect(firstSubTaskFunction).toHaveBeenCalledTimes(0)\n expect(secondSubTaskFunction).toHaveBeenCalled()\n })\n\n test('supports retrying', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n task 1 ...\"\n `)\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying up to a limit', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n const secondTask: Task = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toMatchInlineSnapshot('\"\"')\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('supports retrying a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(renderInstance.lastFrame()!)).toMatchInlineSnapshot(`\n \"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n subtask 1 ...\"\n `)\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying a subtask up to a limit', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n\n await new Promise((resolve) => setTimeout(resolve, 2000))\n })\n\n const secondSubTaskFunction = vi.fn(async () => {})\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const secondSubTask: Task = {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask, secondSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n await taskHasRendered()\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toMatchInlineSnapshot('\"\"')\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondSubTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('has a context', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const firstTask: Task<{foo: string}> = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask: Task<{foo: string}> = {\n title: 'task 2',\n task: async (ctx) => {\n if (ctx.foo === 'bar') {\n throw new Error('context is shared')\n }\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // Then\n await expect(renderInstance.waitUntilExit()).rejects.toThrow('context is shared')\n })\n\n test('has an onComplete function that is called with the context', async () => {\n // Given\n const taskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const task: Task<{foo: string}> = {\n title: 'task 1',\n task: taskFunction,\n }\n\n // When\n const context = await new Promise((resolve, _reject) => {\n render(<Tasks tasks={[task]} silent={false} onComplete={resolve} />)\n })\n\n // Then\n expect(context).toEqual({foo: 'bar'})\n })\n\n test('abortController can be used to exit from outside', async () => {\n // Given\n const abortController = new AbortController()\n\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 10000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} abortSignal={abortController.signal} />)\n await taskHasRendered()\n const promise = renderInstance.waitUntilExit()\n\n abortController.abort()\n\n // wait for the onAbort promise to resolve\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toEqual('')\n await expect(promise).resolves.toEqual(undefined)\n })\n})\n\nasync function taskHasRendered() {\n await new Promise((resolve) => setTimeout(resolve, 100))\n}\n"]}
1
+ {"version":3,"file":"Tasks.test.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Tasks.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,EAAC,MAAM,YAAY,CAAA;AACtC,OAAO,EAAC,wBAAwB,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,UAAU,EAAE,Q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,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;QAEtD,OAAO;QACP,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,cAAc,CAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACvE,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAC1D,CAAC","sourcesContent":["import {Task, Tasks} from './Tasks.js'\nimport {getLastFrameAfterUnmount, render} from '../../testing/ui.js'\nimport {unstyled} from '../../../../public/node/output.js'\nimport {AbortController} from '../../../../public/node/abort.js'\nimport {Stdout} from '../../ui.js'\nimport React from 'react'\nimport {beforeEach, describe, expect, test, vi} from 'vitest'\nimport {useStdout} from 'ink'\n\nvi.mock('ink', async () => {\n const original: any = await vi.importActual('ink')\n return {\n ...original,\n useStdout: vi.fn(),\n }\n})\n\nbeforeEach(() => {\n vi.mocked(useStdout).mockReturnValue({\n stdout: new Stdout({\n columns: 80,\n rows: 80,\n }) as any,\n write: () => {},\n })\n})\n\ndescribe('Tasks', () => {\n test('shows nothing at the end in case of success', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {})\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n // When\n\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n await renderInstance.waitUntilExit()\n\n // Then\n expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot('\"\"')\n })\n\n test('stops at the task that throws error', async () => {\n // Given\n const abortController = new AbortController()\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n throw new Error('something went wrong')\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(\n <Tasks tasks={[firstTask, secondTask]} silent={false} abortSignal={abortController.signal} />,\n )\n\n // Then\n await expect(renderInstance.waitUntilExit()).rejects.toThrowError('something went wrong')\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('it supports subtasks', async () => {\n // Given\n const firstSubtaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 100))\n })\n\n const secondSubtaskFunction = vi.fn(async () => {})\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubtaskFunction,\n },\n {\n title: 'subtask 2',\n task: secondSubtaskFunction,\n },\n ]\n },\n }\n\n const secondTask = {\n title: 'task 2',\n task: async () => {},\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n await renderInstance.waitUntilExit()\n\n // Then\n expect(firstSubtaskFunction).toHaveBeenCalled()\n expect(secondSubtaskFunction).toHaveBeenCalled()\n })\n\n test('supports skipping', async () => {\n // Given\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 100))\n })\n\n const secondTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 100))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n skip: () => true,\n }\n\n const secondTask = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n await renderInstance.waitUntilExit()\n\n // Then\n expect(firstTaskFunction).toHaveBeenCalledTimes(0)\n expect(secondTaskFunction).toHaveBeenCalled()\n })\n\n test('supports skipping a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 100))\n })\n\n const secondSubTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 100))\n })\n\n const firstTask = {\n title: 'task 1',\n task: async () => {\n return [\n {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n skip: () => true,\n },\n {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n },\n ]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n await renderInstance.waitUntilExit()\n\n // Then\n expect(firstSubTaskFunction).toHaveBeenCalledTimes(0)\n expect(secondSubTaskFunction).toHaveBeenCalled()\n })\n\n test('supports retrying', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n })\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n await renderInstance.waitUntilExit()\n\n // Then\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying up to a limit', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n })\n\n const secondTaskFunction = vi.fn(async () => {})\n\n const firstTask: Task = {\n title: 'task 1',\n task: firstTaskFunction,\n retry: 3,\n }\n\n const secondTask: Task = {\n title: 'task 2',\n task: secondTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // Then\n await expect(renderInstance.waitUntilExit()).rejects.toThrow('something went wrong3')\n expect(firstTask.retryCount).toBe(3)\n expect(firstTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('supports retrying a subtask', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount < task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n })\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n await renderInstance.waitUntilExit()\n\n // Then\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n })\n\n test('supports retrying a subtask up to a limit', async () => {\n // Given\n const firstSubTaskFunction = vi.fn(async (_ctx, task) => {\n if (task.retryCount <= task.retry) {\n throw new Error(`something went wrong${task.retryCount}`)\n }\n })\n\n const secondSubTaskFunction = vi.fn(async () => {})\n\n const firstSubTask: Task = {\n title: 'subtask 1',\n task: firstSubTaskFunction,\n retry: 3,\n }\n\n const secondSubTask: Task = {\n title: 'subtask 2',\n task: secondSubTaskFunction,\n }\n\n const firstTask: Task = {\n title: 'task 1',\n task: async () => {\n return [firstSubTask, secondSubTask]\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} />)\n\n // Then\n await expect(renderInstance.waitUntilExit()).rejects.toThrow('something went wrong3')\n expect(firstSubTask.retryCount).toBe(3)\n expect(firstSubTask.errors).toEqual([\n Error('something went wrong0'),\n Error('something went wrong1'),\n Error('something went wrong2'),\n ])\n expect(secondSubTaskFunction).toHaveBeenCalledTimes(0)\n })\n\n test('has a context', async () => {\n // Given\n const firstTaskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const firstTask: Task<{foo: string}> = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n const secondTask: Task<{foo: string}> = {\n title: 'task 2',\n task: async (ctx) => {\n if (ctx.foo === 'bar') {\n throw new Error('context is shared')\n }\n },\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask, secondTask]} silent={false} />)\n\n // Then\n await expect(renderInstance.waitUntilExit()).rejects.toThrow('context is shared')\n })\n\n test('has an onComplete function that is called with the context', async () => {\n // Given\n const taskFunction = vi.fn(async (ctx) => {\n ctx.foo = 'bar'\n })\n\n const task: Task<{foo: string}> = {\n title: 'task 1',\n task: taskFunction,\n }\n\n // When\n const context = await new Promise((resolve, _reject) => {\n render(<Tasks tasks={[task]} silent={false} onComplete={resolve} />)\n })\n\n // Then\n expect(context).toEqual({foo: 'bar'})\n })\n\n test('abortController can be used to exit from outside', async () => {\n // Given\n const abortController = new AbortController()\n\n const firstTaskFunction = vi.fn(async () => {\n await new Promise((resolve) => setTimeout(resolve, 10000))\n })\n\n const firstTask = {\n title: 'task 1',\n task: firstTaskFunction,\n }\n\n // When\n const renderInstance = render(<Tasks tasks={[firstTask]} silent={false} abortSignal={abortController.signal} />)\n await taskHasRendered()\n const promise = renderInstance.waitUntilExit()\n\n abortController.abort()\n\n // wait for the onAbort promise to resolve\n await new Promise((resolve) => setTimeout(resolve, 0))\n\n // Then\n expect(unstyled(getLastFrameAfterUnmount(renderInstance)!)).toEqual('')\n await expect(promise).resolves.toEqual(undefined)\n })\n})\n\nasync function taskHasRendered() {\n await new Promise((resolve) => setTimeout(resolve, 100))\n}\n"]}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This hook will cause the process to exit when the user presses Ctrl+C.
3
+ */
4
+ export declare function useExitOnCtrlC(): void;
@@ -0,0 +1,15 @@
1
+ import { handleCtrlC } from '../../ui.js';
2
+ import { useInput, useStdin } from 'ink';
3
+ /**
4
+ * This hook will cause the process to exit when the user presses Ctrl+C.
5
+ */
6
+ export function useExitOnCtrlC() {
7
+ const { isRawModeSupported } = useStdin();
8
+ useInput((input, key) => {
9
+ handleCtrlC(input, key);
10
+ if (key.return) {
11
+ return null;
12
+ }
13
+ }, { isActive: Boolean(isRawModeSupported) });
14
+ }
15
+ //# sourceMappingURL=use-exit-on-ctrl-c.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-exit-on-ctrl-c.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/hooks/use-exit-on-ctrl-c.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAA;AACvC,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAC,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,EAAC,kBAAkB,EAAC,GAAG,QAAQ,EAAE,CAAA;IACvC,QAAQ,CACN,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACb,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACvB,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC,EACD,EAAC,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,EAAC,CACxC,CAAA;AACH,CAAC","sourcesContent":["import {handleCtrlC} from '../../ui.js'\nimport {useInput, useStdin} from 'ink'\n\n/**\n * This hook will cause the process to exit when the user presses Ctrl+C.\n */\nexport function useExitOnCtrlC() {\n const {isRawModeSupported} = useStdin()\n useInput(\n (input, key) => {\n handleCtrlC(input, key)\n if (key.return) {\n return null\n }\n },\n {isActive: Boolean(isRawModeSupported)},\n )\n}\n"]}
@@ -1 +1 @@
1
- export declare const CLI_KIT_VERSION = "3.84.1";
1
+ export declare const CLI_KIT_VERSION = "3.85.0";
@@ -1,2 +1,2 @@
1
- export const CLI_KIT_VERSION = '3.84.1';
1
+ export const CLI_KIT_VERSION = '3.85.0';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.84.1'\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.85.0'\n"]}
@@ -1,3 +1,4 @@
1
+ import { RuntimeData } from '../../private/node/analytics/storage.js';
1
2
  import { Interfaces } from '@oclif/core';
2
3
  export type CommandExitMode = 'ok' | 'unexpected_error' | 'expected_error';
3
4
  interface ReportAnalyticsEventOptions {
@@ -12,4 +13,80 @@ interface ReportAnalyticsEventOptions {
12
13
  *
13
14
  */
14
15
  export declare function reportAnalyticsEvent(options: ReportAnalyticsEventOptions): Promise<void>;
16
+ /**
17
+ * Records timing data for performance monitoring. Call twice with the same
18
+ * event name to start and stop timing. First call starts the timer, second
19
+ * call stops it and records the duration.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * recordTiming('theme-upload') // Start timing
24
+ * // ... do work ...
25
+ * recordTiming('theme-upload') // Stop timing and record duration
26
+ * ```
27
+ *
28
+ * @param eventName - Unique identifier for the timing event
29
+ */
30
+ export declare function recordTiming(eventName: string): void;
31
+ /**
32
+ * Records error information for debugging and monitoring. Use this to track
33
+ * any exceptions or error conditions that occur during theme operations.
34
+ * Errors are automatically categorized for easier analysis.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * try {
39
+ * // ... risky operation ...
40
+ * } catch (error) {
41
+ * recordError(error)
42
+ * }
43
+ * ```
44
+ *
45
+ * @param error - Error object or message to record
46
+ */
47
+ export declare function recordError<T>(error: T): T;
48
+ /**
49
+ * Records retry attempts for network operations. Use this to track when
50
+ * operations are retried due to transient failures. Helps identify
51
+ * problematic endpoints or operations that frequently fail.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * recordRetry('https://api.shopify.com/themes', 'upload')
56
+ * ```
57
+ *
58
+ * @param url - The URL or endpoint being retried
59
+ * @param operation - Description of the operation being retried
60
+ */
61
+ export declare function recordRetry(url: string, operation: string): void;
62
+ /**
63
+ * Records custom events for tracking specific user actions or system events.
64
+ * Use this for important milestones, user interactions, or significant
65
+ * state changes in the application.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * recordEvent('theme-dev-started')
70
+ * recordEvent('file-watcher-connected')
71
+ * ```
72
+ *
73
+ * @param eventName - Descriptive name for the event
74
+ */
75
+ export declare function recordEvent(eventName: string): void;
76
+ /**
77
+ * Compiles and returns all runtime analytics data collected during the session.
78
+ * This includes timing measurements, error records, retry attempts, and custom
79
+ * events. Use this to retrieve a complete snapshot of analytics data for
80
+ * reporting or debugging purposes.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const analyticsData = compileData()
85
+ * console.log(`Recorded ${analyticsData.timings.length} timing events`)
86
+ * console.log(`Recorded ${analyticsData.errors.length} errors`)
87
+ * ```
88
+ *
89
+ * @returns Object containing all collected analytics data including timings, errors, retries, and events
90
+ */
91
+ export declare function compileData(): RuntimeData;
15
92
  export {};
@@ -2,6 +2,7 @@ import { alwaysLogAnalytics, alwaysLogMetrics, analyticsDisabled, isShopify } fr
2
2
  import * as metadata from './metadata.js';
3
3
  import { publishMonorailEvent, MONORAIL_COMMAND_TOPIC } from './monorail.js';
4
4
  import { fanoutHooks } from './plugins.js';
5
+ import { recordTiming as storageRecordTiming, recordError as storageRecordError, recordRetry as storageRecordRetry, recordEvent as storageRecordEvent, compileData as storageCompileData, } from '../../private/node/analytics/storage.js';
5
6
  import { outputContent, outputDebug, outputToken } from '../../public/node/output.js';
6
7
  import { getEnvironmentData, getSensitiveEnvironmentData } from '../../private/node/analytics.js';
7
8
  import { CLI_KIT_VERSION } from '../common/version.js';
@@ -153,4 +154,91 @@ function sanitizePayload(payload) {
153
154
  const sanitizedPayloadString = payloadString.replace(/shptka_\w*/g, '*****');
154
155
  return JSON.parse(sanitizedPayloadString);
155
156
  }
157
+ /**
158
+ * Records timing data for performance monitoring. Call twice with the same
159
+ * event name to start and stop timing. First call starts the timer, second
160
+ * call stops it and records the duration.
161
+ *
162
+ * @example
163
+ * ```ts
164
+ * recordTiming('theme-upload') // Start timing
165
+ * // ... do work ...
166
+ * recordTiming('theme-upload') // Stop timing and record duration
167
+ * ```
168
+ *
169
+ * @param eventName - Unique identifier for the timing event
170
+ */
171
+ export function recordTiming(eventName) {
172
+ storageRecordTiming(eventName);
173
+ }
174
+ /**
175
+ * Records error information for debugging and monitoring. Use this to track
176
+ * any exceptions or error conditions that occur during theme operations.
177
+ * Errors are automatically categorized for easier analysis.
178
+ *
179
+ * @example
180
+ * ```ts
181
+ * try {
182
+ * // ... risky operation ...
183
+ * } catch (error) {
184
+ * recordError(error)
185
+ * }
186
+ * ```
187
+ *
188
+ * @param error - Error object or message to record
189
+ */
190
+ export function recordError(error) {
191
+ storageRecordError(error);
192
+ return error;
193
+ }
194
+ /**
195
+ * Records retry attempts for network operations. Use this to track when
196
+ * operations are retried due to transient failures. Helps identify
197
+ * problematic endpoints or operations that frequently fail.
198
+ *
199
+ * @example
200
+ * ```ts
201
+ * recordRetry('https://api.shopify.com/themes', 'upload')
202
+ * ```
203
+ *
204
+ * @param url - The URL or endpoint being retried
205
+ * @param operation - Description of the operation being retried
206
+ */
207
+ export function recordRetry(url, operation) {
208
+ storageRecordRetry(url, operation);
209
+ }
210
+ /**
211
+ * Records custom events for tracking specific user actions or system events.
212
+ * Use this for important milestones, user interactions, or significant
213
+ * state changes in the application.
214
+ *
215
+ * @example
216
+ * ```ts
217
+ * recordEvent('theme-dev-started')
218
+ * recordEvent('file-watcher-connected')
219
+ * ```
220
+ *
221
+ * @param eventName - Descriptive name for the event
222
+ */
223
+ export function recordEvent(eventName) {
224
+ storageRecordEvent(eventName);
225
+ }
226
+ /**
227
+ * Compiles and returns all runtime analytics data collected during the session.
228
+ * This includes timing measurements, error records, retry attempts, and custom
229
+ * events. Use this to retrieve a complete snapshot of analytics data for
230
+ * reporting or debugging purposes.
231
+ *
232
+ * @example
233
+ * ```ts
234
+ * const analyticsData = compileData()
235
+ * console.log(`Recorded ${analyticsData.timings.length} timing events`)
236
+ * console.log(`Recorded ${analyticsData.errors.length} errors`)
237
+ * ```
238
+ *
239
+ * @returns Object containing all collected analytics data including timings, errors, retries, and events
240
+ */
241
+ export function compileData() {
242
+ return storageCompileData();
243
+ }
156
244
  //# sourceMappingURL=analytics.js.map