@quenty/nevermore-cli 4.42.0 → 4.42.1-canary.783.30683606415.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 (172) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/args/global-args.d.ts +13 -0
  3. package/dist/args/global-args.d.ts.map +1 -1
  4. package/dist/commands/batch-command/batch-deploy-command.d.ts +3 -0
  5. package/dist/commands/batch-command/batch-deploy-command.d.ts.map +1 -1
  6. package/dist/commands/batch-command/batch-deploy-command.js +90 -1
  7. package/dist/commands/batch-command/batch-deploy-command.js.map +1 -1
  8. package/dist/commands/batch-command/batch-test-command.d.ts.map +1 -1
  9. package/dist/commands/batch-command/batch-test-command.js +7 -2
  10. package/dist/commands/batch-command/batch-test-command.js.map +1 -1
  11. package/dist/commands/deploy-command/deploy-init.js +1 -1
  12. package/dist/commands/deploy-command/deploy-init.js.map +1 -1
  13. package/dist/commands/deploy-command/index.d.ts +3 -0
  14. package/dist/commands/deploy-command/index.d.ts.map +1 -1
  15. package/dist/commands/deploy-command/index.js +301 -60
  16. package/dist/commands/deploy-command/index.js.map +1 -1
  17. package/dist/commands/deploy-command/select-target.js +1 -1
  18. package/dist/commands/deploy-command/select-target.js.map +1 -1
  19. package/dist/commands/deploy-command/version-command.d.ts.map +1 -1
  20. package/dist/commands/deploy-command/version-command.js +138 -12
  21. package/dist/commands/deploy-command/version-command.js.map +1 -1
  22. package/dist/commands/test-command/test-command.d.ts.map +1 -1
  23. package/dist/commands/test-command/test-command.js +17 -7
  24. package/dist/commands/test-command/test-command.js.map +1 -1
  25. package/dist/nevermore.js +17 -0
  26. package/dist/nevermore.js.map +1 -1
  27. package/dist/utils/batch/changed-packages-utils.d.ts +1 -1
  28. package/dist/utils/batch/changed-packages-utils.d.ts.map +1 -1
  29. package/dist/utils/batch/changed-packages-utils.js +1 -1
  30. package/dist/utils/batch/changed-packages-utils.js.map +1 -1
  31. package/dist/utils/build/base-place-resolver-factory.d.ts +25 -0
  32. package/dist/utils/build/base-place-resolver-factory.d.ts.map +1 -0
  33. package/dist/utils/build/base-place-resolver-factory.js +40 -0
  34. package/dist/utils/build/base-place-resolver-factory.js.map +1 -0
  35. package/dist/utils/build/build.d.ts +13 -2
  36. package/dist/utils/build/build.d.ts.map +1 -1
  37. package/dist/utils/build/build.js.map +1 -1
  38. package/dist/utils/build/upload.d.ts +1 -1
  39. package/dist/utils/build/upload.d.ts.map +1 -1
  40. package/dist/utils/deploy/deploy-metadata.d.ts +1 -1
  41. package/dist/utils/deploy/deploy-metadata.d.ts.map +1 -1
  42. package/dist/utils/job-context/base-job-context.d.ts +3 -1
  43. package/dist/utils/job-context/base-job-context.d.ts.map +1 -1
  44. package/dist/utils/job-context/base-job-context.js +45 -6
  45. package/dist/utils/job-context/base-job-context.js.map +1 -1
  46. package/dist/utils/job-context/batch-script-job-context.d.ts +6 -0
  47. package/dist/utils/job-context/batch-script-job-context.d.ts.map +1 -1
  48. package/dist/utils/job-context/batch-script-job-context.js +13 -0
  49. package/dist/utils/job-context/batch-script-job-context.js.map +1 -1
  50. package/dist/utils/job-context/cloud-job-context.d.ts +2 -1
  51. package/dist/utils/job-context/cloud-job-context.d.ts.map +1 -1
  52. package/dist/utils/job-context/cloud-job-context.js +2 -2
  53. package/dist/utils/job-context/cloud-job-context.js.map +1 -1
  54. package/dist/utils/job-context/local-job-context.d.ts +2 -1
  55. package/dist/utils/job-context/local-job-context.d.ts.map +1 -1
  56. package/dist/utils/job-context/local-job-context.js +2 -2
  57. package/dist/utils/job-context/local-job-context.js.map +1 -1
  58. package/dist/utils/open-cloud/open-cloud-client.d.ts +20 -2
  59. package/dist/utils/open-cloud/open-cloud-client.d.ts.map +1 -1
  60. package/dist/utils/open-cloud/open-cloud-client.js +74 -20
  61. package/dist/utils/open-cloud/open-cloud-client.js.map +1 -1
  62. package/dist/utils/open-cloud/open-cloud-client.test.js +89 -12
  63. package/dist/utils/open-cloud/open-cloud-client.test.js.map +1 -1
  64. package/dist/utils/testing/runner/combined-project-generator.d.ts +1 -1
  65. package/dist/utils/testing/runner/combined-project-generator.d.ts.map +1 -1
  66. package/dist/utils/testing/runner/test-runner.d.ts +1 -1
  67. package/dist/utils/testing/runner/test-runner.d.ts.map +1 -1
  68. package/dist/utils/watch/github-context.d.ts +50 -0
  69. package/dist/utils/watch/github-context.d.ts.map +1 -0
  70. package/dist/utils/watch/github-context.js +125 -0
  71. package/dist/utils/watch/github-context.js.map +1 -0
  72. package/dist/utils/watch/github-context.test.d.ts +2 -0
  73. package/dist/utils/watch/github-context.test.d.ts.map +1 -0
  74. package/dist/utils/watch/github-context.test.js +112 -0
  75. package/dist/utils/watch/github-context.test.js.map +1 -0
  76. package/dist/utils/watch/http-watch-registry.d.ts +40 -0
  77. package/dist/utils/watch/http-watch-registry.d.ts.map +1 -0
  78. package/dist/utils/watch/http-watch-registry.js +262 -0
  79. package/dist/utils/watch/http-watch-registry.js.map +1 -0
  80. package/dist/utils/watch/http-watch-registry.test.d.ts +2 -0
  81. package/dist/utils/watch/http-watch-registry.test.d.ts.map +1 -0
  82. package/dist/utils/watch/http-watch-registry.test.js +211 -0
  83. package/dist/utils/watch/http-watch-registry.test.js.map +1 -0
  84. package/dist/utils/watch/local-watch-loop.d.ts +50 -0
  85. package/dist/utils/watch/local-watch-loop.d.ts.map +1 -0
  86. package/dist/utils/watch/local-watch-loop.js +103 -0
  87. package/dist/utils/watch/local-watch-loop.js.map +1 -0
  88. package/dist/utils/watch/local-watch-loop.test.d.ts +2 -0
  89. package/dist/utils/watch/local-watch-loop.test.d.ts.map +1 -0
  90. package/dist/utils/watch/local-watch-loop.test.js +170 -0
  91. package/dist/utils/watch/local-watch-loop.test.js.map +1 -0
  92. package/dist/utils/watch/register-notify-watches.d.ts +41 -0
  93. package/dist/utils/watch/register-notify-watches.d.ts.map +1 -0
  94. package/dist/utils/watch/register-notify-watches.js +159 -0
  95. package/dist/utils/watch/register-notify-watches.js.map +1 -0
  96. package/dist/utils/watch/register-notify-watches.test.d.ts +2 -0
  97. package/dist/utils/watch/register-notify-watches.test.d.ts.map +1 -0
  98. package/dist/utils/watch/register-notify-watches.test.js +225 -0
  99. package/dist/utils/watch/register-notify-watches.test.js.map +1 -0
  100. package/dist/utils/watch/register-watches.d.ts +68 -0
  101. package/dist/utils/watch/register-watches.d.ts.map +1 -0
  102. package/dist/utils/watch/register-watches.js +221 -0
  103. package/dist/utils/watch/register-watches.js.map +1 -0
  104. package/dist/utils/watch/register-watches.test.d.ts +2 -0
  105. package/dist/utils/watch/register-watches.test.d.ts.map +1 -0
  106. package/dist/utils/watch/register-watches.test.js +576 -0
  107. package/dist/utils/watch/register-watches.test.js.map +1 -0
  108. package/dist/utils/watch/stream-watch-loop.d.ts +54 -0
  109. package/dist/utils/watch/stream-watch-loop.d.ts.map +1 -0
  110. package/dist/utils/watch/stream-watch-loop.js +282 -0
  111. package/dist/utils/watch/stream-watch-loop.js.map +1 -0
  112. package/dist/utils/watch/stream-watch-loop.test.d.ts +2 -0
  113. package/dist/utils/watch/stream-watch-loop.test.d.ts.map +1 -0
  114. package/dist/utils/watch/stream-watch-loop.test.js +392 -0
  115. package/dist/utils/watch/stream-watch-loop.test.js.map +1 -0
  116. package/dist/utils/watch/websocket-watch-stream.d.ts +25 -0
  117. package/dist/utils/watch/websocket-watch-stream.d.ts.map +1 -0
  118. package/dist/utils/watch/websocket-watch-stream.js +306 -0
  119. package/dist/utils/watch/websocket-watch-stream.js.map +1 -0
  120. package/dist/utils/watch/websocket-watch-stream.test.d.ts +2 -0
  121. package/dist/utils/watch/websocket-watch-stream.test.d.ts.map +1 -0
  122. package/dist/utils/watch/websocket-watch-stream.test.js +475 -0
  123. package/dist/utils/watch/websocket-watch-stream.test.js.map +1 -0
  124. package/package.json +7 -4
  125. package/src/args/global-args.ts +13 -0
  126. package/src/commands/batch-command/batch-deploy-command.ts +105 -1
  127. package/src/commands/batch-command/batch-test-command.ts +8 -2
  128. package/src/commands/deploy-command/deploy-init.ts +1 -1
  129. package/src/commands/deploy-command/index.ts +331 -32
  130. package/src/commands/deploy-command/select-target.ts +1 -1
  131. package/src/commands/deploy-command/version-command.ts +215 -21
  132. package/src/commands/test-command/test-command.ts +24 -18
  133. package/src/nevermore.ts +19 -0
  134. package/src/utils/batch/changed-packages-utils.ts +1 -1
  135. package/src/utils/build/base-place-resolver-factory.ts +49 -0
  136. package/src/utils/build/build.ts +13 -2
  137. package/src/utils/build/upload.ts +1 -1
  138. package/src/utils/deploy/deploy-metadata.ts +1 -1
  139. package/src/utils/job-context/base-job-context.ts +68 -6
  140. package/src/utils/job-context/batch-script-job-context.ts +18 -0
  141. package/src/utils/job-context/cloud-job-context.ts +7 -2
  142. package/src/utils/job-context/local-job-context.ts +7 -2
  143. package/src/utils/open-cloud/open-cloud-client.test.ts +133 -14
  144. package/src/utils/open-cloud/open-cloud-client.ts +127 -34
  145. package/src/utils/testing/runner/combined-project-generator.ts +1 -1
  146. package/src/utils/testing/runner/test-runner.ts +1 -1
  147. package/src/utils/watch/github-context.test.ts +154 -0
  148. package/src/utils/watch/github-context.ts +184 -0
  149. package/src/utils/watch/http-watch-registry.test.ts +330 -0
  150. package/src/utils/watch/http-watch-registry.ts +341 -0
  151. package/src/utils/watch/local-watch-loop.test.ts +197 -0
  152. package/src/utils/watch/local-watch-loop.ts +190 -0
  153. package/src/utils/watch/register-notify-watches.test.ts +282 -0
  154. package/src/utils/watch/register-notify-watches.ts +226 -0
  155. package/src/utils/watch/register-watches.test.ts +696 -0
  156. package/src/utils/watch/register-watches.ts +369 -0
  157. package/src/utils/watch/stream-watch-loop.test.ts +625 -0
  158. package/src/utils/watch/stream-watch-loop.ts +411 -0
  159. package/src/utils/watch/websocket-watch-stream.test.ts +581 -0
  160. package/src/utils/watch/websocket-watch-stream.ts +403 -0
  161. package/tsconfig.json +19 -6
  162. package/tsconfig.tsbuildinfo +1 -1
  163. package/dist/utils/build/deploy-config.d.ts +0 -71
  164. package/dist/utils/build/deploy-config.d.ts.map +0 -1
  165. package/dist/utils/build/deploy-config.js +0 -164
  166. package/dist/utils/build/deploy-config.js.map +0 -1
  167. package/dist/utils/build/deploy-config.test.d.ts +0 -2
  168. package/dist/utils/build/deploy-config.test.d.ts.map +0 -1
  169. package/dist/utils/build/deploy-config.test.js +0 -126
  170. package/dist/utils/build/deploy-config.test.js.map +0 -1
  171. package/src/utils/build/deploy-config.test.ts +0 -149
  172. package/src/utils/build/deploy-config.ts +0 -259
@@ -0,0 +1,282 @@
1
+ import { OutputHelper } from '@quenty/cli-output-helpers';
2
+ /**
3
+ * Whether the service has actually failed to read this source, as opposed to
4
+ * simply not having polled it yet.
5
+ *
6
+ * One failure is a blip — an asset-delivery hiccup, a rate limit — and the next
7
+ * poll usually clears it. Requiring the service's own consecutive counter to
8
+ * have moved keeps a transient error from abandoning a working stream.
9
+ */
10
+ function _isUnreadable(status) {
11
+ return (status.sourceError != null && (status.sourceConsecutiveFailures ?? 0) > 1);
12
+ }
13
+ /**
14
+ * Watch by being told, and rebuild here.
15
+ *
16
+ * The service polls the base place and pushes a `notify` when it moves, so this
17
+ * side holds a socket instead of a poll timer — no Open Cloud quota spent per
18
+ * developer, and the rebuild starts when the change happens rather than up to
19
+ * an interval later.
20
+ *
21
+ * There is no session length. A held connection renews the monitor's lease, so
22
+ * the lease passed to `--watch` is a floor for how long the monitor outlives a
23
+ * dropped link, not a clock on the terminal: this runs until Ctrl-C.
24
+ */
25
+ export async function runStreamWatchLoopAsync(options) {
26
+ const { entries, stream, source, redeployAsync } = options;
27
+ // Always our own controller, chained to the caller's when there is one: this
28
+ // loop has to be able to stop the stream itself (an unobservable monitor),
29
+ // which it could not do if the only signal belonged to someone else.
30
+ const controller = new AbortController();
31
+ const signal = controller.signal;
32
+ const onSigint = () => controller.abort();
33
+ if (options.signal) {
34
+ if (options.signal.aborted) {
35
+ controller.abort();
36
+ }
37
+ else {
38
+ options.signal.addEventListener('abort', onSigint, { once: true });
39
+ }
40
+ }
41
+ else {
42
+ process.on('SIGINT', onSigint);
43
+ }
44
+ const byWatchName = new Map(entries.map((e) => [e.watchName, e]));
45
+ /**
46
+ * What each place has actually been built from here, as an Open Cloud place
47
+ * version. Seeded from the lock and advanced only by a rebuild that
48
+ * succeeded: the service moves its own baseline whether or not anyone was
49
+ * listening, so this map is the only durable record of what exists.
50
+ */
51
+ const built = new Map(entries.map((e) => [e.watchName, e.baseline]));
52
+ /**
53
+ * The last service-side token each watch was settled at. Purely an
54
+ * optimization — a reconnect that reports the same token needs no Open Cloud
55
+ * call — and deliberately not advanced when a rebuild fails, so the next
56
+ * `ready` retries it.
57
+ */
58
+ const settledAt = new Map();
59
+ let redeploys = 0;
60
+ let failures = 0;
61
+ let lastDropReason;
62
+ let unobservable = false;
63
+ /**
64
+ * Watches the service has told us it cannot read, from either direction:
65
+ * the `ready` snapshot on connect, or a `poll-failed` event as it happens.
66
+ *
67
+ * Both are needed. A connection opened before the service's first failed
68
+ * poll gets a clean snapshot, and the next one is an hour away — so without
69
+ * the live tail a private base place would look fine for an hour before the
70
+ * watch admitted it was doing nothing.
71
+ */
72
+ const unreadable = new Set();
73
+ /**
74
+ * Give up the stream once nothing on it can ever fire, so the caller can
75
+ * poll instead — this machine's credentials reach places the service's
76
+ * credential-free driver cannot.
77
+ */
78
+ const abandonIfNothingLeftToWatch = () => {
79
+ // Counted against every entry this run owns, not against what the last
80
+ // frame happened to mention: a watch the service has stopped reporting
81
+ // altogether can no more produce a notification than one it cannot read.
82
+ if (unreadable.size < byWatchName.size) {
83
+ return false;
84
+ }
85
+ unobservable = true;
86
+ controller.abort();
87
+ return true;
88
+ };
89
+ OutputHelper.info(`Watching ${entries.length} base place${entries.length === 1 ? '' : 's'} over the watch service. Ctrl-C to stop.`);
90
+ for (const entry of entries) {
91
+ OutputHelper.info(` ${entry.label} — base place ${entry.placeId} (${entry.versionType}${entry.baseline == null ? '' : ` v${entry.baseline}`})`);
92
+ }
93
+ /**
94
+ * Bring one watch up to date, given the service's opaque change token.
95
+ *
96
+ * The token is all the service can offer: for a Roblox place it is the
97
+ * asset-delivery content hash, which answers "has this moved" and nothing
98
+ * else. The lock file speaks Open Cloud place versions instead, and the two
99
+ * are not comparable — so a change is confirmed here by asking Open Cloud
100
+ * what the place is actually at, which is the same number the build records.
101
+ */
102
+ const settleAsync = async (entry, token) => {
103
+ if (token != null && settledAt.get(entry.watchName) === token) {
104
+ return;
105
+ }
106
+ let latest;
107
+ try {
108
+ latest = await source.resolveLatestPlaceVersionAsync(entry.universeId, entry.placeId, entry.versionType);
109
+ }
110
+ catch (err) {
111
+ // Never fatal. A watch is meant to be left running for hours, and the
112
+ // next frame will ask again.
113
+ OutputHelper.warn(`Could not check ${entry.label}: ` +
114
+ (err instanceof Error ? err.message : String(err)));
115
+ return;
116
+ }
117
+ const previous = built.get(entry.watchName);
118
+ const settle = () => {
119
+ if (token != null) {
120
+ settledAt.set(entry.watchName, token);
121
+ }
122
+ };
123
+ if (previous === undefined) {
124
+ // Never built here and nothing locked: adopt what is there rather than
125
+ // reading "unknown -> something" as a change.
126
+ built.set(entry.watchName, latest);
127
+ settle();
128
+ return;
129
+ }
130
+ if (latest === previous) {
131
+ settle();
132
+ return;
133
+ }
134
+ OutputHelper.info(`${entry.label}: base place moved v${previous} → v${latest}, rebuilding...`);
135
+ try {
136
+ await redeployAsync(entry, latest);
137
+ redeploys++;
138
+ built.set(entry.watchName, latest);
139
+ settle();
140
+ OutputHelper.info(`${entry.label}: rebuilt from v${latest}.`);
141
+ }
142
+ catch (err) {
143
+ // Left unsettled on purpose: the next `ready` sees it as still stale and
144
+ // tries again, which is what a rebuild that failed halfway deserves.
145
+ failures++;
146
+ OutputHelper.error(`${entry.label}: rebuild failed — ` +
147
+ (err instanceof Error ? err.message : String(err)));
148
+ }
149
+ };
150
+ try {
151
+ const result = await stream.runAsync({
152
+ monitorId: options.monitorId,
153
+ credential: options.credential,
154
+ signal,
155
+ handlers: {
156
+ // Every connection starts here, including reconnects. Nothing is
157
+ // replayed while a client is away, so this is the whole catch-up.
158
+ onReadyAsync: async (ready) => {
159
+ const ours = ready.watches.filter((s) => byWatchName.has(s.name));
160
+ // A source the service cannot read never fires, and the socket says
161
+ // nothing about it — the failure is visible only here. Waiting
162
+ // silently forever is the worst of the options, so a monitor that can
163
+ // see none of these places gives up the stream and lets the caller
164
+ // poll instead, using this machine's credentials, which can reach
165
+ // places the service cannot.
166
+ //
167
+ // Keyed on `sourceError`, not on `state`. `state` tracks dispatching,
168
+ // and a notify that reaches nobody is a success — so a watch whose
169
+ // place is private sits at "pending" forever and never reaches
170
+ // "failed". `sourceError` is the service's answer to exactly this.
171
+ const failedToRead = ours.filter((s) => _isUnreadable(s));
172
+ // An empty intersection is the same silent wait by another route: the
173
+ // monitor exists but holds none of our watches, so nothing can ever
174
+ // arrive for us. Reachable when another checkout re-registered this
175
+ // monitor name with different place names.
176
+ // A watch the monitor does not hold at all is as dead as one it
177
+ // cannot read — no frame can ever name it. Folding the missing into
178
+ // the same set means a partial snapshot falls back too, instead of
179
+ // holding the socket for the ones that remain and silently never
180
+ // rebuilding the rest.
181
+ const missing = [...byWatchName.keys()].filter((name) => !ready.watches.some((s) => s.name === name));
182
+ for (const name of missing) {
183
+ if (unreadable.has(name)) {
184
+ continue;
185
+ }
186
+ unreadable.add(name);
187
+ OutputHelper.warn(`The watch monitor no longer holds ${byWatchName.get(name).label} — another checkout has probably re-registered it.`);
188
+ }
189
+ if (abandonIfNothingLeftToWatch()) {
190
+ return;
191
+ }
192
+ for (const status of failedToRead) {
193
+ if (unreadable.has(status.name)) {
194
+ continue;
195
+ }
196
+ unreadable.add(status.name);
197
+ OutputHelper.warn(`The watch service cannot read ${byWatchName.get(status.name).label}` + (status.sourceError ? `: ${status.sourceError}` : '.'));
198
+ }
199
+ if (abandonIfNothingLeftToWatch()) {
200
+ return;
201
+ }
202
+ for (const status of ours) {
203
+ if (!unreadable.has(status.name)) {
204
+ await settleAsync(byWatchName.get(status.name), status.currentVersion);
205
+ }
206
+ }
207
+ },
208
+ onNotifyAsync: async (notify) => {
209
+ const entry = byWatchName.get(notify.watchName);
210
+ if (!entry) {
211
+ OutputHelper.verbose(`Ignoring a notification for "${notify.watchName}", which this ` +
212
+ 'run does not watch.');
213
+ return;
214
+ }
215
+ await settleAsync(entry, notify.version);
216
+ },
217
+ onEvent: (message) => {
218
+ OutputHelper.verbose(` [${message.event.type}] ${message.event.message}`);
219
+ // The service only logs this once it has failed several polls in a
220
+ // row, so it already means "not a blip". There is no matching
221
+ // recovered event, so this is one-way — but the cost of being wrong
222
+ // is polling something that could have been streamed, which still
223
+ // works.
224
+ const name = message.event.watchName;
225
+ if (message.event.type !== 'poll-failed' ||
226
+ name == null ||
227
+ !byWatchName.has(name) ||
228
+ unreadable.has(name)) {
229
+ return;
230
+ }
231
+ unreadable.add(name);
232
+ OutputHelper.warn(`The watch service cannot read ${byWatchName.get(name).label}: ${message.event.message}`);
233
+ abandonIfNothingLeftToWatch();
234
+ },
235
+ // The stream swallows a handler's throw so it cannot strand the watch
236
+ // or kill the process; unreported it would be invisible. Everything
237
+ // above already catches its own failures, so reaching here is a bug.
238
+ onHandlerError: (err) => {
239
+ OutputHelper.error(`Watch handler failed: ${err.message}`);
240
+ },
241
+ // A misconfiguration retries on a fixed reason forever, so the same
242
+ // sentence would be printed until someone gave up reading it. Said once
243
+ // per distinct cause, counted after that.
244
+ onReconnect: (attempt, reason) => {
245
+ if (reason === lastDropReason) {
246
+ OutputHelper.verbose(`Watch stream still unavailable (attempt ${attempt}).`);
247
+ return;
248
+ }
249
+ lastDropReason = reason;
250
+ OutputHelper.warn(`Watch stream dropped: ${reason}`);
251
+ },
252
+ },
253
+ });
254
+ if (result.ending === 'monitor-gone') {
255
+ OutputHelper.warn('The watch monitor was released or its lease lapsed, so nothing is ' +
256
+ 'being watched any more. Re-run with --watch to register again.');
257
+ }
258
+ if (result.ending === 'rejected') {
259
+ OutputHelper.error(`Could not hold the watch stream: ${result.reason ?? 'the service refused the handshake'}`);
260
+ }
261
+ if (!unobservable) {
262
+ OutputHelper.info(`Stopped watching. ${redeploys} rebuild${redeploys === 1 ? '' : 's'}.`);
263
+ }
264
+ return {
265
+ redeploys,
266
+ failures,
267
+ reconnects: result.reconnects,
268
+ monitorGone: result.ending === 'monitor-gone',
269
+ rejected: result.ending === 'rejected',
270
+ unobservable,
271
+ };
272
+ }
273
+ finally {
274
+ if (options.signal) {
275
+ options.signal.removeEventListener('abort', onSigint);
276
+ }
277
+ else {
278
+ process.off('SIGINT', onSigint);
279
+ }
280
+ }
281
+ }
282
+ //# sourceMappingURL=stream-watch-loop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-watch-loop.js","sourceRoot":"","sources":["../../../src/utils/watch/stream-watch-loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAU1D;;;;;;;GAOG;AACH,SAAS,aAAa,CAAC,MAAyB;IAC9C,OAAO,CACL,MAAM,CAAC,WAAW,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,yBAAyB,IAAI,CAAC,CAAC,GAAG,CAAC,CAC1E,CAAC;AACJ,CAAC;AA2CD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAA+B;IAE/B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAE3D,6EAA6E;IAC7E,2EAA2E;IAC3E,qEAAqE;IACrE,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACjC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1C,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAC3B,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;a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AAM,KAAK,cAAc,EAAE,CAAC;YACrC,YAAY,CAAC,IAAI,CACf,oEAAoE;gBAClE,gEAAgE,CACnE,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACjC,YAAY,CAAC,KAAK,CAChB,oCACE,MAAM,CAAC,MAAM,IAAI,mCACnB,EAAE,CACH,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,YAAY,CAAC,IAAI,CACf,qBAAqB,SAAS,WAAW,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CACvE,CAAC;QACJ,CAAC;QAED,OAAO;YACL,SAAS;YACT,QAAQ;YACR,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,KAAK,cAAc;YAC7C,QAAQ,EAAE,MAAM,CAAC,MAAM,KAAK,UAAU;YACtC,YAAY;SACb,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stream-watch-loop.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-watch-loop.test.d.ts","sourceRoot":"","sources":["../../../src/utils/watch/stream-watch-loop.test.ts"],"names":[],"mappings":""}