@shopify/ui-extensions-server-kit 5.2.0 → 5.3.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 (169) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -1
  3. package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +1 -0
  4. package/dist/ExtensionServerClient/ExtensionServerClient.es.js +1 -1
  5. package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +8 -0
  6. package/dist/ExtensionServerClient/server-types.d.ts +42 -0
  7. package/dist/context/constants.cjs.js +1 -1
  8. package/dist/context/constants.d.ts +0 -1
  9. package/dist/context/constants.es.js +0 -1
  10. package/dist/context/types.d.ts +1 -0
  11. package/dist/hooks/index.d.ts +0 -2
  12. package/dist/i18n.cjs.js +1 -1
  13. package/dist/i18n.d.ts +1 -20
  14. package/dist/i18n.es.js +0 -1
  15. package/dist/index.cjs.js +1 -1
  16. package/dist/index.es.js +40 -48
  17. package/dist/testing/extensions.cjs.js +1 -1
  18. package/dist/testing/extensions.es.js +2 -2
  19. package/dist/types.cjs.js +1 -1
  20. package/dist/types.d.ts +10 -4
  21. package/dist/types.es.js +2 -2
  22. package/dist/utilities/index.d.ts +0 -1
  23. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.d.ts +3 -0
  24. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.d.ts +2 -0
  25. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.d.ts +17 -0
  26. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.d.ts +9 -0
  27. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +1 -0
  28. package/node_modules/@shopify/ui-extensions-test-utils/package.json +2 -3
  29. package/package.json +7 -6
  30. package/project.json +0 -2
  31. package/src/ExtensionServerClient/ExtensionServerClient.test.ts +837 -330
  32. package/src/ExtensionServerClient/ExtensionServerClient.ts +10 -8
  33. package/src/ExtensionServerClient/server-types.ts +55 -0
  34. package/src/ExtensionServerClient/types.ts +2 -0
  35. package/src/context/ExtensionServerProvider.test.tsx +202 -39
  36. package/src/context/ExtensionServerProvider.tsx +1 -0
  37. package/src/context/constants.ts +3 -2
  38. package/src/context/types.ts +1 -0
  39. package/src/hooks/index.ts +0 -2
  40. package/src/i18n.ts +3 -3
  41. package/src/state/reducers/extensionServerReducer.test.ts +2 -2
  42. package/src/testing/extensions.ts +2 -2
  43. package/src/types.ts +10 -4
  44. package/src/utilities/index.ts +0 -1
  45. package/src/utilities/replaceUpdated.ts +1 -0
  46. package/src/utilities/set.ts +1 -0
  47. package/dist/hooks/useExtensionClient.cjs.js +0 -1
  48. package/dist/hooks/useExtensionClient.d.ts +0 -1
  49. package/dist/hooks/useExtensionClient.es.js +0 -8
  50. package/dist/hooks/useExtensionServerEvent.cjs.js +0 -1
  51. package/dist/hooks/useExtensionServerEvent.d.ts +0 -1
  52. package/dist/hooks/useExtensionServerEvent.es.js +0 -9
  53. package/dist/utilities/groupByKey.cjs.js +0 -1
  54. package/dist/utilities/groupByKey.d.ts +0 -3
  55. package/dist/utilities/groupByKey.es.js +0 -6
  56. package/node_modules/@types/node/LICENSE +0 -21
  57. package/node_modules/@types/node/README.md +0 -15
  58. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  59. package/node_modules/@types/node/assert.d.ts +0 -985
  60. package/node_modules/@types/node/async_hooks.d.ts +0 -522
  61. package/node_modules/@types/node/buffer.d.ts +0 -2321
  62. package/node_modules/@types/node/child_process.d.ts +0 -1544
  63. package/node_modules/@types/node/cluster.d.ts +0 -432
  64. package/node_modules/@types/node/console.d.ts +0 -412
  65. package/node_modules/@types/node/constants.d.ts +0 -19
  66. package/node_modules/@types/node/crypto.d.ts +0 -4451
  67. package/node_modules/@types/node/dgram.d.ts +0 -586
  68. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -192
  69. package/node_modules/@types/node/dns/promises.d.ts +0 -381
  70. package/node_modules/@types/node/dns.d.ts +0 -809
  71. package/node_modules/@types/node/dom-events.d.ts +0 -122
  72. package/node_modules/@types/node/domain.d.ts +0 -170
  73. package/node_modules/@types/node/events.d.ts +0 -803
  74. package/node_modules/@types/node/fs/promises.d.ts +0 -1205
  75. package/node_modules/@types/node/fs.d.ts +0 -4211
  76. package/node_modules/@types/node/globals.d.ts +0 -377
  77. package/node_modules/@types/node/globals.global.d.ts +0 -1
  78. package/node_modules/@types/node/http.d.ts +0 -1801
  79. package/node_modules/@types/node/http2.d.ts +0 -2386
  80. package/node_modules/@types/node/https.d.ts +0 -544
  81. package/node_modules/@types/node/index.d.ts +0 -88
  82. package/node_modules/@types/node/inspector.d.ts +0 -2739
  83. package/node_modules/@types/node/module.d.ts +0 -298
  84. package/node_modules/@types/node/net.d.ts +0 -913
  85. package/node_modules/@types/node/os.d.ts +0 -473
  86. package/node_modules/@types/node/package.json +0 -235
  87. package/node_modules/@types/node/path.d.ts +0 -191
  88. package/node_modules/@types/node/perf_hooks.d.ts +0 -626
  89. package/node_modules/@types/node/process.d.ts +0 -1531
  90. package/node_modules/@types/node/punycode.d.ts +0 -117
  91. package/node_modules/@types/node/querystring.d.ts +0 -141
  92. package/node_modules/@types/node/readline/promises.d.ts +0 -143
  93. package/node_modules/@types/node/readline.d.ts +0 -666
  94. package/node_modules/@types/node/repl.d.ts +0 -430
  95. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  96. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  97. package/node_modules/@types/node/stream/web.d.ts +0 -336
  98. package/node_modules/@types/node/stream.d.ts +0 -1731
  99. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  100. package/node_modules/@types/node/test.d.ts +0 -1113
  101. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  102. package/node_modules/@types/node/timers.d.ts +0 -126
  103. package/node_modules/@types/node/tls.d.ts +0 -1203
  104. package/node_modules/@types/node/trace_events.d.ts +0 -171
  105. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  106. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -985
  107. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -522
  108. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2321
  109. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1544
  110. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  111. package/node_modules/@types/node/ts4.8/console.d.ts +0 -412
  112. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  113. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4450
  114. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
  115. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -192
  116. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -381
  117. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  118. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  119. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  120. package/node_modules/@types/node/ts4.8/events.d.ts +0 -754
  121. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1205
  122. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4211
  123. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -377
  124. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  125. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1801
  126. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2386
  127. package/node_modules/@types/node/ts4.8/https.d.ts +0 -544
  128. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  129. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2739
  130. package/node_modules/@types/node/ts4.8/module.d.ts +0 -298
  131. package/node_modules/@types/node/ts4.8/net.d.ts +0 -913
  132. package/node_modules/@types/node/ts4.8/os.d.ts +0 -473
  133. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  134. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -626
  135. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1531
  136. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  137. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  138. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -143
  139. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -666
  140. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  141. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  142. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  143. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -336
  144. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1731
  145. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  146. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1113
  147. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  148. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -126
  149. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1203
  150. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -171
  151. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -206
  152. package/node_modules/@types/node/ts4.8/url.d.ts +0 -937
  153. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2075
  154. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -541
  155. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -667
  156. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
  157. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -692
  158. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  159. package/node_modules/@types/node/tty.d.ts +0 -206
  160. package/node_modules/@types/node/url.d.ts +0 -937
  161. package/node_modules/@types/node/util.d.ts +0 -2075
  162. package/node_modules/@types/node/v8.d.ts +0 -541
  163. package/node_modules/@types/node/vm.d.ts +0 -667
  164. package/node_modules/@types/node/wasi.d.ts +0 -158
  165. package/node_modules/@types/node/worker_threads.d.ts +0 -692
  166. package/node_modules/@types/node/zlib.d.ts +0 -517
  167. package/src/hooks/useExtensionClient.ts +0 -6
  168. package/src/hooks/useExtensionServerEvent.ts +0 -11
  169. package/src/utilities/groupByKey.ts +0 -3
@@ -1,171 +0,0 @@
1
- /**
2
- * The `trace_events` module provides a mechanism to centralize tracing information
3
- * generated by V8, Node.js core, and userspace code.
4
- *
5
- * Tracing can be enabled with the `--trace-event-categories` command-line flag
6
- * or by using the `trace_events` module. The `--trace-event-categories` flag
7
- * accepts a list of comma-separated category names.
8
- *
9
- * The available categories are:
10
- *
11
- * * `node`: An empty placeholder.
12
- * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data.
13
- * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
14
- * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
15
- * * `node.console`: Enables capture of `console.time()` and `console.count()`output.
16
- * * `node.dns.native`: Enables capture of trace data for DNS queries.
17
- * * `node.environment`: Enables capture of Node.js Environment milestones.
18
- * * `node.fs.sync`: Enables capture of trace data for file system sync methods.
19
- * * `node.perf`: Enables capture of `Performance API` measurements.
20
- * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
21
- * measures and marks.
22
- * * `node.perf.timerify`: Enables capture of only Performance API timerify
23
- * measurements.
24
- * * `node.promises.rejections`: Enables capture of trace data tracking the number
25
- * of unhandled Promise rejections and handled-after-rejections.
26
- * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
27
- * * `v8`: The `V8` events are GC, compiling, and execution related.
28
- *
29
- * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
30
- *
31
- * ```bash
32
- * node --trace-event-categories v8,node,node.async_hooks server.js
33
- * ```
34
- *
35
- * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be
36
- * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default.
37
- *
38
- * ```bash
39
- * node --trace-events-enabled
40
- *
41
- * # is equivalent to
42
- *
43
- * node --trace-event-categories v8,node,node.async_hooks
44
- * ```
45
- *
46
- * Alternatively, trace events may be enabled using the `trace_events` module:
47
- *
48
- * ```js
49
- * const trace_events = require('trace_events');
50
- * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
51
- * tracing.enable(); // Enable trace event capture for the 'node.perf' category
52
- *
53
- * // do work
54
- *
55
- * tracing.disable(); // Disable trace event capture for the 'node.perf' category
56
- * ```
57
- *
58
- * Running Node.js with tracing enabled will produce log files that can be opened
59
- * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
60
- *
61
- * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can
62
- * be specified with `--trace-event-file-pattern` that accepts a template
63
- * string that supports `${rotation}` and `${pid}`:
64
- *
65
- * ```bash
66
- * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
67
- * ```
68
- *
69
- * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
70
- * in your code, such as:
71
- *
72
- * ```js
73
- * process.on('SIGINT', function onSigint() {
74
- * console.info('Received SIGINT.');
75
- * process.exit(130); // Or applicable exit code depending on OS and signal
76
- * });
77
- * ```
78
- *
79
- * The tracing system uses the same time source
80
- * as the one used by `process.hrtime()`.
81
- * However the trace-event timestamps are expressed in microseconds,
82
- * unlike `process.hrtime()` which returns nanoseconds.
83
- *
84
- * The features from this module are not available in `Worker` threads.
85
- * @experimental
86
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js)
87
- */
88
- declare module "trace_events" {
89
- /**
90
- * The `Tracing` object is used to enable or disable tracing for sets of
91
- * categories. Instances are created using the
92
- * `trace_events.createTracing()` method.
93
- *
94
- * When created, the `Tracing` object is disabled. Calling the
95
- * `tracing.enable()` method adds the categories to the set of enabled trace
96
- * event categories. Calling `tracing.disable()` will remove the categories
97
- * from the set of enabled trace event categories.
98
- */
99
- interface Tracing {
100
- /**
101
- * A comma-separated list of the trace event categories covered by this
102
- * `Tracing` object.
103
- */
104
- readonly categories: string;
105
- /**
106
- * Disables this `Tracing` object.
107
- *
108
- * Only trace event categories _not_ covered by other enabled `Tracing`
109
- * objects and _not_ specified by the `--trace-event-categories` flag
110
- * will be disabled.
111
- */
112
- disable(): void;
113
- /**
114
- * Enables this `Tracing` object for the set of categories covered by
115
- * the `Tracing` object.
116
- */
117
- enable(): void;
118
- /**
119
- * `true` only if the `Tracing` object has been enabled.
120
- */
121
- readonly enabled: boolean;
122
- }
123
- interface CreateTracingOptions {
124
- /**
125
- * An array of trace category names. Values included in the array are
126
- * coerced to a string when possible. An error will be thrown if the
127
- * value cannot be coerced.
128
- */
129
- categories: string[];
130
- }
131
- /**
132
- * Creates and returns a `Tracing` object for the given set of `categories`.
133
- *
134
- * ```js
135
- * const trace_events = require('trace_events');
136
- * const categories = ['node.perf', 'node.async_hooks'];
137
- * const tracing = trace_events.createTracing({ categories });
138
- * tracing.enable();
139
- * // do stuff
140
- * tracing.disable();
141
- * ```
142
- * @since v10.0.0
143
- * @return .
144
- */
145
- function createTracing(options: CreateTracingOptions): Tracing;
146
- /**
147
- * Returns a comma-separated list of all currently-enabled trace event
148
- * categories. The current set of enabled trace event categories is determined
149
- * by the _union_ of all currently-enabled `Tracing` objects and any categories
150
- * enabled using the `--trace-event-categories` flag.
151
- *
152
- * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console.
153
- *
154
- * ```js
155
- * const trace_events = require('trace_events');
156
- * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
157
- * const t2 = trace_events.createTracing({ categories: ['node.perf'] });
158
- * const t3 = trace_events.createTracing({ categories: ['v8'] });
159
- *
160
- * t1.enable();
161
- * t2.enable();
162
- *
163
- * console.log(trace_events.getEnabledCategories());
164
- * ```
165
- * @since v10.0.0
166
- */
167
- function getEnabledCategories(): string | undefined;
168
- }
169
- declare module "node:trace_events" {
170
- export * from "trace_events";
171
- }
@@ -1,8 +0,0 @@
1
- declare module "assert/strict" {
2
- import { strict } from "node:assert";
3
- export = strict;
4
- }
5
- declare module "node:assert/strict" {
6
- import { strict } from "node:assert";
7
- export = strict;
8
- }