@speedkit/cli 4.51.0-run-control.4 → 4.51.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 (485) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +14 -1426
  3. package/dist/commands/diff.d.ts +1 -7
  4. package/dist/commands/diff.js +3 -9
  5. package/dist/commands/login.d.ts +0 -3
  6. package/dist/commands/login.js +3 -14
  7. package/dist/commands/onboarding.d.ts +0 -26
  8. package/dist/commands/onboarding.js +4 -221
  9. package/dist/commands/origin-request.d.ts +0 -4
  10. package/dist/commands/origin-request.js +0 -4
  11. package/dist/services/browser-fetch/device-emulation.d.ts +0 -11
  12. package/dist/services/browser-fetch/device-emulation.js +0 -14
  13. package/dist/services/bundler/bundle-service-factory.d.ts +3 -0
  14. package/dist/services/bundler/bundle-service-factory.js +5 -1
  15. package/dist/services/bundler/bundle-service.d.ts +10 -1
  16. package/dist/services/bundler/bundle-service.js +16 -1
  17. package/dist/services/bundler/error/packjockel-error.d.ts +3 -0
  18. package/dist/services/bundler/error/packjockel-error.js +3 -0
  19. package/dist/services/bundler/index.d.ts +1 -0
  20. package/dist/services/bundler/index.js +1 -0
  21. package/dist/services/bundler/packjockel-service.d.ts +112 -0
  22. package/dist/services/bundler/packjockel-service.js +202 -0
  23. package/dist/services/bundler/spec/packjockel-service.spec.js +186 -0
  24. package/dist/services/cli/cli-environment-factory.d.ts +0 -3
  25. package/dist/services/cli/cli-environment-factory.js +0 -1
  26. package/dist/services/cli/cli-service-build-context.d.ts +0 -3
  27. package/dist/services/cli/cli-service-factory.js +1 -1
  28. package/dist/services/cli/cli-service-model.d.ts +10 -29
  29. package/dist/services/cli/cli-service.d.ts +11 -60
  30. package/dist/services/cli/cli-service.js +32 -196
  31. package/dist/services/cli/index.d.ts +0 -2
  32. package/dist/services/cli/index.js +0 -2
  33. package/dist/services/cli/spec/cli-service.spec.js +50 -113
  34. package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
  35. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +2 -3
  36. package/dist/services/deploy/checks/pre-deploy/split-change-check.js +2 -3
  37. package/dist/services/deploy/handler/customer-config-handler.d.ts +9 -0
  38. package/dist/services/deploy/handler/customer-config-handler.js +41 -6
  39. package/dist/services/deploy/interface/install.d.ts +7 -1
  40. package/dist/services/deploy/mr/live-state-check.js +21 -2
  41. package/dist/services/deploy/policy/auto-deploy-policy.js +2 -0
  42. package/dist/services/deploy/policy/deploy-policy-model.d.ts +4 -0
  43. package/dist/services/deploy/policy/deploy-policy-model.js +4 -0
  44. package/dist/services/deploy/policy/testing-deploy-policy.js +2 -0
  45. package/dist/services/deploy/spec/handler/customer-config-handler.spec.js +98 -0
  46. package/dist/services/deploy/spec/mr/live-state-check.spec.js +45 -4
  47. package/dist/services/deploy/spec/policy/auto-deploy-policy.spec.js +2 -0
  48. package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.js +3 -1
  49. package/dist/services/diff/diff-service-build-context.d.ts +0 -12
  50. package/dist/services/diff/diff-service-build-context.js +1 -45
  51. package/dist/services/diff/diff-service-factory.d.ts +0 -2
  52. package/dist/services/diff/diff-service-factory.js +25 -65
  53. package/dist/services/diff/diff-service.d.ts +0 -11
  54. package/dist/services/diff/diff-service.js +11 -37
  55. package/dist/services/diff/page-source.d.ts +0 -12
  56. package/dist/services/diff/page-source.js +11 -16
  57. package/dist/services/diff/sinks/tool-diff-sink.d.ts +2 -3
  58. package/dist/services/diff/sinks/tool-diff-sink.js +2 -3
  59. package/dist/services/diff/spec/diff-service-build-context.spec.js +0 -19
  60. package/dist/services/diff/spec/diff-service.spec.js +0 -95
  61. package/dist/services/document-handler-runtime/document-handler-browser-mock.d.ts +13 -0
  62. package/dist/services/document-handler-runtime/document-handler-browser-mock.js +69 -0
  63. package/dist/services/document-handler-runtime/document-handler-server.d.ts +27 -0
  64. package/dist/services/document-handler-runtime/document-handler-server.js +112 -19
  65. package/dist/services/document-handler-runtime/spec/document-handler-browser-mock.spec.js +34 -0
  66. package/dist/services/git/git-repository.d.ts +0 -2
  67. package/dist/services/git/git-repository.js +0 -6
  68. package/dist/services/integration-api/customer-config-flags.js +0 -1
  69. package/dist/services/integration-api/integration-api-model.d.ts +4 -1
  70. package/dist/services/integration-api/spec/customer-config-file.spec.js +56 -0
  71. package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +68 -8
  72. package/dist/services/integration-api/struct/customer-config-file.d.ts +15 -0
  73. package/dist/services/integration-api/struct/customer-config-file.js +42 -0
  74. package/dist/services/integration-api/struct/customer-config.d.ts +55 -1
  75. package/dist/services/integration-api/struct/customer-config.js +70 -3
  76. package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +11 -4
  77. package/dist/services/integration-api/struct/speed-kit-config-file.js +31 -10
  78. package/dist/services/onboarding/browse/browse-service.d.ts +1 -13
  79. package/dist/services/onboarding/browse/browse-service.js +7 -43
  80. package/dist/services/onboarding/browser/baqend-response.d.ts +1 -17
  81. package/dist/services/onboarding/browser/baqend-response.js +0 -23
  82. package/dist/services/onboarding/browser/emulate-device.d.ts +1 -12
  83. package/dist/services/onboarding/browser/emulate-device.js +13 -68
  84. package/dist/services/onboarding/browser/executable/executable-validator.js +2 -4
  85. package/dist/services/onboarding/browser/extension/extension-bridge.js +3 -5
  86. package/dist/services/onboarding/browser/extension/extension-downloader.js +8 -17
  87. package/dist/services/onboarding/browser/extension/extension-validator.js +4 -9
  88. package/dist/services/onboarding/browser/launch-browser.d.ts +1 -2
  89. package/dist/services/onboarding/browser/launch-browser.js +1 -6
  90. package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +2 -0
  91. package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +29 -8
  92. package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -3
  93. package/dist/services/onboarding/dashboard/index.js +2 -7
  94. package/dist/services/onboarding/fetch-event-handler.d.ts +5 -24
  95. package/dist/services/onboarding/fetch-event-handler.js +32 -103
  96. package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +2 -11
  97. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +0 -14
  98. package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +0 -30
  99. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -14
  100. package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +10 -29
  101. package/dist/services/onboarding/file-events/file-watcher.d.ts +4 -43
  102. package/dist/services/onboarding/file-events/file-watcher.js +21 -119
  103. package/dist/services/onboarding/inject/inject-service.js +1 -1
  104. package/dist/services/onboarding/onboarding-model.d.ts +7 -40
  105. package/dist/services/onboarding/onboarding-model.js +9 -20
  106. package/dist/services/onboarding/onboarding-service-build-context.d.ts +0 -4
  107. package/dist/services/onboarding/onboarding-service-build-context.js +1 -7
  108. package/dist/services/onboarding/onboarding-service-factory.d.ts +1 -17
  109. package/dist/services/onboarding/onboarding-service-factory.js +35 -152
  110. package/dist/services/onboarding/onboarding-service.d.ts +1 -40
  111. package/dist/services/onboarding/onboarding-service.js +23 -139
  112. package/dist/services/onboarding/request-cache/cache.d.ts +5 -62
  113. package/dist/services/onboarding/request-cache/cache.js +17 -128
  114. package/dist/services/onboarding/spec/file-events/file-watcher.spec.js +67 -0
  115. package/dist/services/onboarding/spec/onboarding-model.spec.js +3 -39
  116. package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +1 -25
  117. package/dist/services/onboarding/templates/install-speed-kit-js-template.js +5 -0
  118. package/dist/services/onboarding/todo-collector.d.ts +2 -7
  119. package/dist/services/onboarding/todo-collector.js +12 -49
  120. package/dist/services/onboarding/virtual-orestes-app/index.d.ts +0 -38
  121. package/dist/services/onboarding/virtual-orestes-app/index.js +27 -113
  122. package/dist/services/origin-request/asset-variations.d.ts +0 -14
  123. package/dist/services/origin-request/asset-variations.js +4 -11
  124. package/dist/services/origin-request/origin-fetcher.d.ts +0 -7
  125. package/dist/services/origin-request/origin-fetcher.js +5 -43
  126. package/dist/services/origin-request/origin-request-service-build-context.d.ts +0 -17
  127. package/dist/services/origin-request/origin-request-service-build-context.js +0 -8
  128. package/dist/services/origin-request/origin-request-service-factory.d.ts +5 -0
  129. package/dist/services/origin-request/origin-request-service-factory.js +30 -2
  130. package/dist/services/origin-request/origin-request-service.d.ts +6 -121
  131. package/dist/services/origin-request/origin-request-service.js +49 -273
  132. package/dist/services/origin-request/runtime-config-source.d.ts +0 -6
  133. package/dist/services/origin-request/runtime-config-source.js +4 -15
  134. package/dist/services/origin-request/spec/asset-variations.spec.js +0 -20
  135. package/dist/services/origin-request/spec/origin-request-service.spec.js +6 -329
  136. package/dist/services/pull/pull-service.js +23 -5
  137. package/dist/services/query-builder/query-builder-factory.js +3 -3
  138. package/dist/services/setup/os/tool-registry.js +2 -2
  139. package/oclif.manifest.json +288 -3409
  140. package/package.json +3 -20
  141. package/dist/base/run-control-command.d.ts +0 -15
  142. package/dist/base/run-control-command.js +0 -20
  143. package/dist/build-info.json +0 -6
  144. package/dist/commands/onboarding/browser/click.d.ts +0 -75
  145. package/dist/commands/onboarding/browser/click.js +0 -19
  146. package/dist/commands/onboarding/browser/emulate.d.ts +0 -105
  147. package/dist/commands/onboarding/browser/emulate.js +0 -26
  148. package/dist/commands/onboarding/browser/navigate.d.ts +0 -75
  149. package/dist/commands/onboarding/browser/navigate.js +0 -19
  150. package/dist/commands/onboarding/browser/panel.d.ts +0 -63
  151. package/dist/commands/onboarding/browser/panel.js +0 -12
  152. package/dist/commands/onboarding/browser/reinstall-sw.d.ts +0 -63
  153. package/dist/commands/onboarding/browser/reinstall-sw.js +0 -14
  154. package/dist/commands/onboarding/browser/reset.d.ts +0 -71
  155. package/dist/commands/onboarding/browser/reset.js +0 -18
  156. package/dist/commands/onboarding/browser/screenshot.d.ts +0 -77
  157. package/dist/commands/onboarding/browser/screenshot.js +0 -19
  158. package/dist/commands/onboarding/browser/state.d.ts +0 -63
  159. package/dist/commands/onboarding/browser/state.js +0 -12
  160. package/dist/commands/onboarding/browser/tabs.d.ts +0 -58
  161. package/dist/commands/onboarding/browser/tabs.js +0 -16
  162. package/dist/commands/onboarding/cache/clear.d.ts +0 -58
  163. package/dist/commands/onboarding/cache/clear.js +0 -12
  164. package/dist/commands/onboarding/cache/errors.d.ts +0 -58
  165. package/dist/commands/onboarding/cache/errors.js +0 -12
  166. package/dist/commands/onboarding/cache/evict.d.ts +0 -62
  167. package/dist/commands/onboarding/cache/evict.js +0 -15
  168. package/dist/commands/onboarding/cache/get.d.ts +0 -85
  169. package/dist/commands/onboarding/cache/get.js +0 -17
  170. package/dist/commands/onboarding/cache/list.d.ts +0 -58
  171. package/dist/commands/onboarding/cache/list.js +0 -15
  172. package/dist/commands/onboarding/cache/prewarm.d.ts +0 -73
  173. package/dist/commands/onboarding/cache/prewarm.js +0 -20
  174. package/dist/commands/onboarding/cache/refresh.d.ts +0 -62
  175. package/dist/commands/onboarding/cache/refresh.js +0 -18
  176. package/dist/commands/onboarding/cdp.d.ts +0 -81
  177. package/dist/commands/onboarding/cdp.js +0 -18
  178. package/dist/commands/onboarding/debug/arm.d.ts +0 -83
  179. package/dist/commands/onboarding/debug/arm.js +0 -19
  180. package/dist/commands/onboarding/debug/await.d.ts +0 -71
  181. package/dist/commands/onboarding/debug/await.js +0 -18
  182. package/dist/commands/onboarding/debug/disarm.d.ts +0 -63
  183. package/dist/commands/onboarding/debug/disarm.js +0 -12
  184. package/dist/commands/onboarding/debug/eval.d.ts +0 -75
  185. package/dist/commands/onboarding/debug/eval.js +0 -16
  186. package/dist/commands/onboarding/debug/release.d.ts +0 -63
  187. package/dist/commands/onboarding/debug/release.js +0 -12
  188. package/dist/commands/onboarding/debug/resume.d.ts +0 -63
  189. package/dist/commands/onboarding/debug/resume.js +0 -12
  190. package/dist/commands/onboarding/debug/status.d.ts +0 -63
  191. package/dist/commands/onboarding/debug/status.js +0 -12
  192. package/dist/commands/onboarding/debug/step.d.ts +0 -67
  193. package/dist/commands/onboarding/debug/step.js +0 -15
  194. package/dist/commands/onboarding/files/list.d.ts +0 -58
  195. package/dist/commands/onboarding/files/list.js +0 -12
  196. package/dist/commands/onboarding/files/read.d.ts +0 -73
  197. package/dist/commands/onboarding/files/read.js +0 -16
  198. package/dist/commands/onboarding/files/rebuild.d.ts +0 -63
  199. package/dist/commands/onboarding/files/rebuild.js +0 -18
  200. package/dist/commands/onboarding/files/validate.d.ts +0 -58
  201. package/dist/commands/onboarding/files/validate.js +0 -12
  202. package/dist/commands/onboarding/fouc.d.ts +0 -77
  203. package/dist/commands/onboarding/fouc.js +0 -16
  204. package/dist/commands/onboarding/inject/add.d.ts +0 -89
  205. package/dist/commands/onboarding/inject/add.js +0 -17
  206. package/dist/commands/onboarding/inject/clear.d.ts +0 -63
  207. package/dist/commands/onboarding/inject/clear.js +0 -12
  208. package/dist/commands/onboarding/inject/list.d.ts +0 -63
  209. package/dist/commands/onboarding/inject/list.js +0 -12
  210. package/dist/commands/onboarding/inject/read.d.ts +0 -75
  211. package/dist/commands/onboarding/inject/read.js +0 -18
  212. package/dist/commands/onboarding/inject/recipes.d.ts +0 -63
  213. package/dist/commands/onboarding/inject/recipes.js +0 -12
  214. package/dist/commands/onboarding/inject/remove.d.ts +0 -67
  215. package/dist/commands/onboarding/inject/remove.js +0 -15
  216. package/dist/commands/onboarding/list.d.ts +0 -13
  217. package/dist/commands/onboarding/list.js +0 -12
  218. package/dist/commands/onboarding/logs.d.ts +0 -41
  219. package/dist/commands/onboarding/logs.js +0 -257
  220. package/dist/commands/onboarding/navwalk.d.ts +0 -95
  221. package/dist/commands/onboarding/navwalk.js +0 -19
  222. package/dist/commands/onboarding/response.d.ts +0 -67
  223. package/dist/commands/onboarding/response.js +0 -18
  224. package/dist/commands/onboarding/rum/beacons.d.ts +0 -75
  225. package/dist/commands/onboarding/rum/beacons.js +0 -16
  226. package/dist/commands/onboarding/rum/get.d.ts +0 -77
  227. package/dist/commands/onboarding/rum/get.js +0 -18
  228. package/dist/commands/onboarding/rum/key.d.ts +0 -67
  229. package/dist/commands/onboarding/rum/key.js +0 -13
  230. package/dist/commands/onboarding/rum/previous.d.ts +0 -63
  231. package/dist/commands/onboarding/rum/previous.js +0 -12
  232. package/dist/commands/onboarding/status.d.ts +0 -13
  233. package/dist/commands/onboarding/status.js +0 -17
  234. package/dist/commands/onboarding/stop.d.ts +0 -13
  235. package/dist/commands/onboarding/stop.js +0 -17
  236. package/dist/commands/onboarding/todo.d.ts +0 -58
  237. package/dist/commands/onboarding/todo.js +0 -12
  238. package/dist/commands/onboarding/viewport.d.ts +0 -101
  239. package/dist/commands/onboarding/viewport.js +0 -18
  240. package/dist/commands/onboarding/watch.d.ts +0 -93
  241. package/dist/commands/onboarding/watch.js +0 -16
  242. package/dist/commands/spec/onboarding.spec.js +0 -127
  243. package/dist/services/cli/build-info.d.ts +0 -33
  244. package/dist/services/cli/build-info.js +0 -63
  245. package/dist/services/cli/sink.d.ts +0 -47
  246. package/dist/services/cli/sink.js +0 -31
  247. package/dist/services/cli/spec/build-identity.spec.js +0 -85
  248. package/dist/services/cli/spec/build-info.spec.js +0 -10
  249. package/dist/services/cli/spec/cli-service-log.spec.js +0 -133
  250. package/dist/services/cli/spec/memory-cli.d.ts +0 -9
  251. package/dist/services/cli/spec/memory-cli.js +0 -9
  252. package/dist/services/diff/config-at-ref.d.ts +0 -20
  253. package/dist/services/diff/config-at-ref.js +0 -33
  254. package/dist/services/diff/run-runtime-config.d.ts +0 -33
  255. package/dist/services/diff/run-runtime-config.js +0 -74
  256. package/dist/services/diff/spec/config-at-ref.spec.js +0 -46
  257. package/dist/services/diff/spec/run-runtime-config.spec.d.ts +0 -1
  258. package/dist/services/diff/spec/run-runtime-config.spec.js +0 -87
  259. package/dist/services/onboarding/browser/answer-dialogs.d.ts +0 -12
  260. package/dist/services/onboarding/browser/answer-dialogs.js +0 -25
  261. package/dist/services/onboarding/browser/console-log.d.ts +0 -9
  262. package/dist/services/onboarding/browser/console-log.js +0 -27
  263. package/dist/services/onboarding/browser/resume-restarted-workers.d.ts +0 -14
  264. package/dist/services/onboarding/browser/resume-restarted-workers.js +0 -26
  265. package/dist/services/onboarding/control/body-inspect.d.ts +0 -24
  266. package/dist/services/onboarding/control/body-inspect.js +0 -106
  267. package/dist/services/onboarding/control/browser-session.d.ts +0 -547
  268. package/dist/services/onboarding/control/browser-session.js +0 -1337
  269. package/dist/services/onboarding/control/config-validation.d.ts +0 -17
  270. package/dist/services/onboarding/control/config-validation.js +0 -46
  271. package/dist/services/onboarding/control/control-protocol.d.ts +0 -1430
  272. package/dist/services/onboarding/control/control-protocol.js +0 -58
  273. package/dist/services/onboarding/control/control-server.d.ts +0 -292
  274. package/dist/services/onboarding/control/control-server.js +0 -1629
  275. package/dist/services/onboarding/control/debug-session.d.ts +0 -219
  276. package/dist/services/onboarding/control/debug-session.js +0 -897
  277. package/dist/services/onboarding/control/fouc.d.ts +0 -23
  278. package/dist/services/onboarding/control/fouc.js +0 -151
  279. package/dist/services/onboarding/control/index.d.ts +0 -4
  280. package/dist/services/onboarding/control/index.js +0 -4
  281. package/dist/services/onboarding/control/navigate-wait.d.ts +0 -33
  282. package/dist/services/onboarding/control/navigate-wait.js +0 -56
  283. package/dist/services/onboarding/control/navwalk.d.ts +0 -65
  284. package/dist/services/onboarding/control/navwalk.js +0 -248
  285. package/dist/services/onboarding/control/preload-registry.d.ts +0 -150
  286. package/dist/services/onboarding/control/preload-registry.js +0 -829
  287. package/dist/services/onboarding/control/response-explainer.d.ts +0 -24
  288. package/dist/services/onboarding/control/response-explainer.js +0 -257
  289. package/dist/services/onboarding/control/rum.d.ts +0 -8
  290. package/dist/services/onboarding/control/rum.js +0 -220
  291. package/dist/services/onboarding/control/service-worker-tracker.d.ts +0 -68
  292. package/dist/services/onboarding/control/service-worker-tracker.js +0 -120
  293. package/dist/services/onboarding/control/viewport.d.ts +0 -45
  294. package/dist/services/onboarding/control/viewport.js +0 -344
  295. package/dist/services/onboarding/control/watch.d.ts +0 -26
  296. package/dist/services/onboarding/control/watch.js +0 -157
  297. package/dist/services/onboarding/request-cache/asset-key.d.ts +0 -61
  298. package/dist/services/onboarding/request-cache/asset-key.js +0 -115
  299. package/dist/services/onboarding/spec/browser/answer-dialogs.spec.d.ts +0 -1
  300. package/dist/services/onboarding/spec/browser/answer-dialogs.spec.js +0 -66
  301. package/dist/services/onboarding/spec/browser/console-log.spec.d.ts +0 -1
  302. package/dist/services/onboarding/spec/browser/console-log.spec.js +0 -42
  303. package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.d.ts +0 -1
  304. package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.js +0 -45
  305. package/dist/services/onboarding/spec/control/browser-session.spec.d.ts +0 -1
  306. package/dist/services/onboarding/spec/control/browser-session.spec.js +0 -753
  307. package/dist/services/onboarding/spec/control/control-server.spec.d.ts +0 -1
  308. package/dist/services/onboarding/spec/control/control-server.spec.js +0 -371
  309. package/dist/services/onboarding/spec/control/debug-session.spec.d.ts +0 -1
  310. package/dist/services/onboarding/spec/control/debug-session.spec.js +0 -751
  311. package/dist/services/onboarding/spec/control/fakes.d.ts +0 -31
  312. package/dist/services/onboarding/spec/control/fakes.js +0 -67
  313. package/dist/services/onboarding/spec/control/fouc.spec.d.ts +0 -1
  314. package/dist/services/onboarding/spec/control/fouc.spec.js +0 -167
  315. package/dist/services/onboarding/spec/control/navigate-wait.spec.d.ts +0 -1
  316. package/dist/services/onboarding/spec/control/navigate-wait.spec.js +0 -47
  317. package/dist/services/onboarding/spec/control/navwalk.spec.d.ts +0 -1
  318. package/dist/services/onboarding/spec/control/navwalk.spec.js +0 -222
  319. package/dist/services/onboarding/spec/control/preload-registry.spec.d.ts +0 -1
  320. package/dist/services/onboarding/spec/control/preload-registry.spec.js +0 -432
  321. package/dist/services/onboarding/spec/control/response-explainer.spec.d.ts +0 -1
  322. package/dist/services/onboarding/spec/control/response-explainer.spec.js +0 -324
  323. package/dist/services/onboarding/spec/control/rum.spec.d.ts +0 -1
  324. package/dist/services/onboarding/spec/control/rum.spec.js +0 -222
  325. package/dist/services/onboarding/spec/control/service-worker-tracker.spec.d.ts +0 -1
  326. package/dist/services/onboarding/spec/control/service-worker-tracker.spec.js +0 -193
  327. package/dist/services/onboarding/spec/control/viewport.spec.d.ts +0 -1
  328. package/dist/services/onboarding/spec/control/viewport.spec.js +0 -200
  329. package/dist/services/onboarding/spec/control/watch.spec.d.ts +0 -1
  330. package/dist/services/onboarding/spec/control/watch.spec.js +0 -187
  331. package/dist/services/onboarding/spec/fetch-event-handler.spec.d.ts +0 -1
  332. package/dist/services/onboarding/spec/fetch-event-handler.spec.js +0 -219
  333. package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.d.ts +0 -1
  334. package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.js +0 -41
  335. package/dist/services/onboarding/spec/request-cache/cache.spec.d.ts +0 -1
  336. package/dist/services/onboarding/spec/request-cache/cache.spec.js +0 -107
  337. package/dist/services/onboarding/spec/todo-collector.spec.d.ts +0 -1
  338. package/dist/services/onboarding/spec/todo-collector.spec.js +0 -136
  339. package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.d.ts +0 -1
  340. package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.js +0 -65
  341. package/dist/services/query-builder/rules/rule-match.d.ts +0 -35
  342. package/dist/services/query-builder/rules/rule-match.js +0 -70
  343. package/dist/services/query-builder/spec/rules/rule-match.spec.d.ts +0 -1
  344. package/dist/services/query-builder/spec/rules/rule-match.spec.js +0 -121
  345. package/dist/services/run-control/browser/run-browser-contexts.d.ts +0 -557
  346. package/dist/services/run-control/browser/run-browser-contexts.js +0 -91
  347. package/dist/services/run-control/browser/run-browser-service-factory.d.ts +0 -5
  348. package/dist/services/run-control/browser/run-browser-service-factory.js +0 -7
  349. package/dist/services/run-control/browser/run-browser-service.d.ts +0 -68
  350. package/dist/services/run-control/browser/run-browser-service.js +0 -206
  351. package/dist/services/run-control/cache/run-cache-contexts.d.ts +0 -349
  352. package/dist/services/run-control/cache/run-cache-contexts.js +0 -51
  353. package/dist/services/run-control/cache/run-cache-service-factory.d.ts +0 -6
  354. package/dist/services/run-control/cache/run-cache-service-factory.js +0 -12
  355. package/dist/services/run-control/cache/run-cache-service.d.ts +0 -35
  356. package/dist/services/run-control/cache/run-cache-service.js +0 -151
  357. package/dist/services/run-control/control-client.d.ts +0 -36
  358. package/dist/services/run-control/control-client.js +0 -147
  359. package/dist/services/run-control/debug/run-debug-contexts.d.ts +0 -416
  360. package/dist/services/run-control/debug/run-debug-contexts.js +0 -47
  361. package/dist/services/run-control/debug/run-debug-service-factory.d.ts +0 -5
  362. package/dist/services/run-control/debug/run-debug-service-factory.js +0 -7
  363. package/dist/services/run-control/debug/run-debug-service.d.ts +0 -39
  364. package/dist/services/run-control/debug/run-debug-service.js +0 -164
  365. package/dist/services/run-control/files/run-files-contexts.d.ts +0 -238
  366. package/dist/services/run-control/files/run-files-contexts.js +0 -26
  367. package/dist/services/run-control/files/run-files-service-factory.d.ts +0 -5
  368. package/dist/services/run-control/files/run-files-service-factory.js +0 -7
  369. package/dist/services/run-control/files/run-files-service.d.ts +0 -29
  370. package/dist/services/run-control/files/run-files-service.js +0 -120
  371. package/dist/services/run-control/index.d.ts +0 -32
  372. package/dist/services/run-control/index.js +0 -31
  373. package/dist/services/run-control/inject/run-inject-contexts.d.ts +0 -319
  374. package/dist/services/run-control/inject/run-inject-contexts.js +0 -38
  375. package/dist/services/run-control/inject/run-inject-service-factory.d.ts +0 -5
  376. package/dist/services/run-control/inject/run-inject-service-factory.js +0 -7
  377. package/dist/services/run-control/inject/run-inject-service.d.ts +0 -31
  378. package/dist/services/run-control/inject/run-inject-service.js +0 -227
  379. package/dist/services/run-control/live-run.d.ts +0 -37
  380. package/dist/services/run-control/live-run.js +0 -56
  381. package/dist/services/run-control/probe/run-probe-contexts.d.ts +0 -333
  382. package/dist/services/run-control/probe/run-probe-contexts.js +0 -73
  383. package/dist/services/run-control/probe/run-probe-service-factory.d.ts +0 -5
  384. package/dist/services/run-control/probe/run-probe-service-factory.js +0 -7
  385. package/dist/services/run-control/probe/run-probe-service.d.ts +0 -54
  386. package/dist/services/run-control/probe/run-probe-service.js +0 -194
  387. package/dist/services/run-control/rum/run-rum-contexts.d.ts +0 -216
  388. package/dist/services/run-control/rum/run-rum-contexts.js +0 -34
  389. package/dist/services/run-control/rum/run-rum-service-factory.d.ts +0 -5
  390. package/dist/services/run-control/rum/run-rum-service-factory.js +0 -7
  391. package/dist/services/run-control/rum/run-rum-service.d.ts +0 -36
  392. package/dist/services/run-control/rum/run-rum-service.js +0 -122
  393. package/dist/services/run-control/run-answer.d.ts +0 -28
  394. package/dist/services/run-control/run-answer.js +0 -58
  395. package/dist/services/run-control/run-control-context.d.ts +0 -102
  396. package/dist/services/run-control/run-control-context.js +0 -36
  397. package/dist/services/run-control/run-control-flags.d.ts +0 -12
  398. package/dist/services/run-control/run-control-flags.js +0 -22
  399. package/dist/services/run-control/run-control-model.d.ts +0 -9
  400. package/dist/services/run-control/run-control-model.js +0 -1
  401. package/dist/services/run-control/run-control-service-factory.d.ts +0 -14
  402. package/dist/services/run-control/run-control-service-factory.js +0 -26
  403. package/dist/services/run-control/session/run-session-contexts.d.ts +0 -25
  404. package/dist/services/run-control/session/run-session-contexts.js +0 -20
  405. package/dist/services/run-control/session/run-session-service-factory.d.ts +0 -8
  406. package/dist/services/run-control/session/run-session-service-factory.js +0 -18
  407. package/dist/services/run-control/session/run-session-service.d.ts +0 -32
  408. package/dist/services/run-control/session/run-session-service.js +0 -151
  409. package/dist/services/run-control/spec/browser/run-browser-service.spec.d.ts +0 -1
  410. package/dist/services/run-control/spec/browser/run-browser-service.spec.js +0 -328
  411. package/dist/services/run-control/spec/cache/run-cache-service.spec.d.ts +0 -1
  412. package/dist/services/run-control/spec/cache/run-cache-service.spec.js +0 -454
  413. package/dist/services/run-control/spec/debug/run-debug-service.spec.d.ts +0 -1
  414. package/dist/services/run-control/spec/debug/run-debug-service.spec.js +0 -113
  415. package/dist/services/run-control/spec/files/run-files-service.spec.d.ts +0 -1
  416. package/dist/services/run-control/spec/files/run-files-service.spec.js +0 -234
  417. package/dist/services/run-control/spec/inject/run-inject-service.spec.d.ts +0 -1
  418. package/dist/services/run-control/spec/inject/run-inject-service.spec.js +0 -251
  419. package/dist/services/run-control/spec/live-run-fixture.d.ts +0 -32
  420. package/dist/services/run-control/spec/live-run-fixture.js +0 -109
  421. package/dist/services/run-control/spec/probe/run-probe-service.spec.d.ts +0 -1
  422. package/dist/services/run-control/spec/probe/run-probe-service.spec.js +0 -108
  423. package/dist/services/run-control/spec/rum/run-rum-service.spec.d.ts +0 -1
  424. package/dist/services/run-control/spec/rum/run-rum-service.spec.js +0 -47
  425. package/dist/services/run-control/spec/run-answer.spec.d.ts +0 -1
  426. package/dist/services/run-control/spec/run-answer.spec.js +0 -57
  427. package/dist/services/run-control/spec/session/run-session-service.spec.d.ts +0 -1
  428. package/dist/services/run-control/spec/session/run-session-service.spec.js +0 -150
  429. package/dist/services/run-log/crash-mirror.d.ts +0 -31
  430. package/dist/services/run-log/crash-mirror.js +0 -69
  431. package/dist/services/run-log/index.d.ts +0 -11
  432. package/dist/services/run-log/index.js +0 -11
  433. package/dist/services/run-log/jsonl-appender.d.ts +0 -46
  434. package/dist/services/run-log/jsonl-appender.js +0 -91
  435. package/dist/services/run-log/log-event-model.d.ts +0 -104
  436. package/dist/services/run-log/log-event-model.js +0 -56
  437. package/dist/services/run-log/log-query-service-factory.d.ts +0 -11
  438. package/dist/services/run-log/log-query-service-factory.js +0 -14
  439. package/dist/services/run-log/log-query-service.d.ts +0 -59
  440. package/dist/services/run-log/log-query-service.js +0 -111
  441. package/dist/services/run-log/log-reader.d.ts +0 -84
  442. package/dist/services/run-log/log-reader.js +0 -180
  443. package/dist/services/run-log/log-summary.d.ts +0 -72
  444. package/dist/services/run-log/log-summary.js +0 -208
  445. package/dist/services/run-log/redaction.d.ts +0 -34
  446. package/dist/services/run-log/redaction.js +0 -124
  447. package/dist/services/run-log/request-log.d.ts +0 -82
  448. package/dist/services/run-log/request-log.js +0 -69
  449. package/dist/services/run-log/request-summary.d.ts +0 -76
  450. package/dist/services/run-log/request-summary.js +0 -0
  451. package/dist/services/run-log/run-log.d.ts +0 -61
  452. package/dist/services/run-log/run-log.js +0 -102
  453. package/dist/services/run-log/spec/log-query-service.spec.d.ts +0 -1
  454. package/dist/services/run-log/spec/log-query-service.spec.js +0 -197
  455. package/dist/services/run-log/spec/log-reader.spec.d.ts +0 -1
  456. package/dist/services/run-log/spec/log-reader.spec.js +0 -109
  457. package/dist/services/run-log/spec/log-summary.spec.d.ts +0 -1
  458. package/dist/services/run-log/spec/log-summary.spec.js +0 -153
  459. package/dist/services/run-log/spec/redaction.spec.d.ts +0 -1
  460. package/dist/services/run-log/spec/redaction.spec.js +0 -61
  461. package/dist/services/run-log/spec/request-log.spec.d.ts +0 -1
  462. package/dist/services/run-log/spec/request-log.spec.js +0 -101
  463. package/dist/services/run-log/spec/request-summary.spec.d.ts +0 -1
  464. package/dist/services/run-log/spec/request-summary.spec.js +0 -171
  465. package/dist/services/run-log/spec/run-log.spec.d.ts +0 -1
  466. package/dist/services/run-log/spec/run-log.spec.js +0 -122
  467. package/dist/services/run-registry/exit-classification.d.ts +0 -39
  468. package/dist/services/run-registry/exit-classification.js +0 -42
  469. package/dist/services/run-registry/index.d.ts +0 -3
  470. package/dist/services/run-registry/index.js +0 -3
  471. package/dist/services/run-registry/process-identity.d.ts +0 -28
  472. package/dist/services/run-registry/process-identity.js +0 -80
  473. package/dist/services/run-registry/run-registry-model.d.ts +0 -128
  474. package/dist/services/run-registry/run-registry-model.js +0 -16
  475. package/dist/services/run-registry/run-registry.d.ts +0 -155
  476. package/dist/services/run-registry/run-registry.js +0 -430
  477. package/dist/services/run-registry/spec/exit-classification.spec.d.ts +0 -1
  478. package/dist/services/run-registry/spec/exit-classification.spec.js +0 -82
  479. package/dist/services/run-registry/spec/run-registry.spec.d.ts +0 -1
  480. package/dist/services/run-registry/spec/run-registry.spec.js +0 -526
  481. /package/dist/{commands/spec/onboarding.spec.d.ts → services/bundler/spec/packjockel-service.spec.d.ts} +0 -0
  482. /package/dist/services/{cli/spec/build-identity.spec.d.ts → deploy/spec/handler/customer-config-handler.spec.d.ts} +0 -0
  483. /package/dist/services/{cli/spec/build-info.spec.d.ts → document-handler-runtime/spec/document-handler-browser-mock.spec.d.ts} +0 -0
  484. /package/dist/services/{cli/spec/cli-service-log.spec.d.ts → integration-api/spec/customer-config-file.spec.d.ts} +0 -0
  485. /package/dist/services/{diff/spec/config-at-ref.spec.d.ts → onboarding/spec/file-events/file-watcher.spec.d.ts} +0 -0
@@ -11,8 +11,6 @@ declare const flags: {
11
11
  variations: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
12
12
  against: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
13
13
  variation: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
14
- base: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
15
- html: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
16
14
  baseline: Interfaces.BooleanFlag<boolean>;
17
15
  params: Interfaces.BooleanFlag<boolean>;
18
16
  param: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
@@ -22,7 +20,6 @@ declare const flags: {
22
20
  browserFetch: Interfaces.BooleanFlag<boolean>;
23
21
  host: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
24
22
  variationsFile: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
25
- run: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
26
23
  hideDiff: Interfaces.BooleanFlag<boolean>;
27
24
  configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
28
25
  };
@@ -49,10 +46,6 @@ export interface DiffOptions {
49
46
  readonly pageUrl: string;
50
47
  /** The page {@link pageUrl} is compared with, in place of the parameter check. */
51
48
  readonly against?: string;
52
- /** The git ref whose customer config renders the page, against the working tree's. */
53
- readonly base?: string;
54
- /** With {@link base}: a saved origin page, rendered instead of a request. */
55
- readonly html?: string;
56
49
  /** The variation `against` and a parameter check without `variations` request. */
57
50
  readonly variation: string;
58
51
  /** Ask which variation to request the pages in, in place of {@link variation}. */
@@ -76,8 +69,6 @@ export interface DiffOptions {
76
69
  readonly ignore: readonly string[];
77
70
  readonly host?: string;
78
71
  readonly variationsFile?: string;
79
- /** `--run`: the live run whose runtime config the requests follow. */
80
- readonly run?: string;
81
72
  /** Fetch through a headless Chrome instead of a direct request. */
82
73
  readonly browserFetch: boolean;
83
74
  }
@@ -96,8 +87,6 @@ export declare class DiffServiceBuildContext extends DiffServiceBuildContext_bas
96
87
  variations: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
97
88
  against: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
98
89
  variation: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
99
- base: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
100
- html: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
101
90
  baseline: Interfaces.BooleanFlag<boolean>;
102
91
  params: Interfaces.BooleanFlag<boolean>;
103
92
  param: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
@@ -107,7 +96,6 @@ export declare class DiffServiceBuildContext extends DiffServiceBuildContext_bas
107
96
  browserFetch: Interfaces.BooleanFlag<boolean>;
108
97
  host: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
109
98
  variationsFile: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
110
- run: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
111
99
  hideDiff: Interfaces.BooleanFlag<boolean>;
112
100
  configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
113
101
  };
@@ -38,13 +38,7 @@ const flags = {
38
38
  description: "Compare the page against this other page, both requested and rendered the same way: ?color=red against ?color=blue. Replaces the parameter check",
39
39
  }),
40
40
  variation: Flags.string({
41
- description: "The one variation the pages are requested in, for --against, --base or the parameter check: mobile, tablet or a custom one; an empty one asks which. Defaults to desktop",
42
- }),
43
- base: Flags.string({
44
- description: "Render the page with the customer config where HEAD left this git ref (their merge base) and with the working tree, and diff the two: what a config change does to the page. Replaces the parameter check; takes --variation and --html",
45
- }),
46
- html: Flags.string({
47
- description: "With --base, render this saved origin HTML instead of requesting the page",
41
+ description: "The one variation the pages are requested in, for --against or the parameter check: mobile, tablet or a custom one; an empty one asks which. Defaults to desktop",
48
42
  }),
49
43
  baseline: Flags.boolean({
50
44
  description: "Fetch every side twice and ignore what differs between the two, such as nonces, timestamps or reordered preloads. Doubles the requests: 4 per comparison",
@@ -77,10 +71,6 @@ const flags = {
77
71
  variationsFile: Flags.string({
78
72
  description: "Resolve the requests against a runtime config in a local file instead of the app's deployed one",
79
73
  }),
80
- run: Flags.string({
81
- exclusive: ["variationsFile"],
82
- description: "Take the runtime config from this live sk onboarding run: its id, its customer name, or its path. Without it, the one live run of the customer is used",
83
- }),
84
74
  hideDiff: Flags.boolean({
85
75
  char: "h",
86
76
  hidden: true,
@@ -139,36 +129,6 @@ function againstUrl(pageUrl, parsedFlags) {
139
129
  }
140
130
  return against;
141
131
  }
142
- /**
143
- * The git ref `--base` names. It compares two configs on one page, so it
144
- * needs the customer and the documentHandler, and refuses the flags of the
145
- * checks it replaces. `--html` only feeds it.
146
- */
147
- function baseRef(customerPath, parsedFlags) {
148
- const { base, html } = parsedFlags;
149
- if (base === undefined) {
150
- if (html !== undefined) {
151
- throw new ApplicationError("--html renders a saved page for --base.", [
152
- "sk diff <customerPath> <pageUrl> --base origin/main --html page.html",
153
- ]);
154
- }
155
- return undefined;
156
- }
157
- if (!customerPath || parsedFlags.raw) {
158
- throw new ApplicationError("--base compares two configs of a customer, so it needs the customer path and the documentHandler.", ["sk diff <customerPath> <pageUrl> --base origin/main"]);
159
- }
160
- const conflicting = [
161
- parsedFlags.against !== undefined && "--against",
162
- parsedFlags.param !== undefined && "--param",
163
- parsedFlags.params && "--params",
164
- parsedFlags.variations !== undefined && "--variations",
165
- parsedFlags.baseline && "--baseline",
166
- ].filter(Boolean);
167
- if (conflicting.length > 0) {
168
- throw new ApplicationError(`--base renders one page with two configs, so it does not take ${conflicting.join(", ")}.`, ["For another variation than desktop, name one: --variation mobile"]);
169
- }
170
- return base;
171
- }
172
132
  /**
173
133
  * The one variation `--variation` names, desktop by default, or before an
174
134
  * empty one is answered. `--variations` compares a pair, so the two are
@@ -308,7 +268,6 @@ export class DiffServiceBuildContext extends Context() {
308
268
  if (!customerPath && !parsedFlags.raw) {
309
269
  throw new ApplicationError("Without a customer path there is no documentHandler to render with.", ["Name the customer, or pass --raw to compare the origin's HTML."]);
310
270
  }
311
- const base = baseRef(customerPath, parsedFlags);
312
271
  const against = againstUrl(pageUrl, parsedFlags);
313
272
  const variation = singleVariation(parsedFlags);
314
273
  const chooseVariation = choosesVariation(parsedFlags.variation, environment);
@@ -321,8 +280,6 @@ export class DiffServiceBuildContext extends Context() {
321
280
  configName: parsedFlags.configName,
322
281
  pageUrl,
323
282
  against,
324
- base,
325
- html: parsedFlags.html,
326
283
  variation,
327
284
  chooseVariation,
328
285
  variations: chooseVariations
@@ -338,7 +295,6 @@ export class DiffServiceBuildContext extends Context() {
338
295
  ignore: parsedFlags.ignore ?? [],
339
296
  host: parsedFlags.host,
340
297
  variationsFile: parsedFlags.variationsFile,
341
- run: parsedFlags.run,
342
298
  browserFetch: parsedFlags.browserFetch,
343
299
  });
344
300
  }
@@ -6,8 +6,6 @@ export declare class DiffServiceFactory {
6
6
  constructor(context: DiffServiceBuildContext);
7
7
  buildService(): Promise<DiffService>;
8
8
  private build;
9
- /** The pages rendered with the customer config at `--base`, from a checkout of it. */
10
- private buildBase;
11
9
  /**
12
10
  * The options, with the parameters an empty `--param` asked for added to
13
11
  * the ones removed. Asked first, before anything is loaded or fetched.
@@ -12,9 +12,6 @@ import { assertCustomerOrigin } from "./customer-origin.js";
12
12
  import { stderrLog } from "./diff-log.js";
13
13
  import { variationPair, } from "./diff-service-build-context.js";
14
14
  import { DiffService } from "./diff-service.js";
15
- import { configAtRef } from "./config-at-ref.js";
16
- import { RunRegistry } from "../run-registry/index.js";
17
- import { DEFAULTS_ONLY, diffRuntimeConfig, liveRunFor, } from "./run-runtime-config.js";
18
15
  import { PageSource } from "./page-source.js";
19
16
  /**
20
17
  * The variations a person can choose from: the device variations and the
@@ -50,11 +47,8 @@ export class DiffServiceFactory {
50
47
  async build() {
51
48
  const { environment } = this.context;
52
49
  const chosenParameters = await this.withChosenParameters();
53
- // JSON and a patch own stdout; the progress goes to stderr.
54
- const ownsStdout = ["json", "patch"].includes(this.context.output);
55
- const log = ownsStdout
56
- ? stderrLog(environment.cli)
57
- : environment.cli;
50
+ const json = this.context.output === "json";
51
+ const log = json ? stderrLog(environment.cli) : environment.cli;
58
52
  const files = this.context.customerPath
59
53
  ? await this.getIntegrationFiles()
60
54
  : undefined;
@@ -65,40 +59,13 @@ export class DiffServiceFactory {
65
59
  for (const url of [pageUrl, against].filter(Boolean)) {
66
60
  assertCustomerOrigin(url, customer.origins, this.context.customerPath);
67
61
  }
68
- applyOriginProxy(customer.chromeFlags, ownsStdout ? undefined : environment.cli);
62
+ applyOriginProxy(customer.chromeFlags, json ? undefined : environment.cli);
63
+ }
64
+ const config = await this.loadRuntimeConfig(log, customer?.app);
65
+ if (!config) {
66
+ throw new ApplicationError("no runtime config to build the requests from");
69
67
  }
70
- const config = await diffRuntimeConfig({
71
- log,
72
- // A named file wins; else the live run the customer has, so the diff sees what it sees.
73
- run: this.context.variationsFile
74
- ? undefined
75
- : liveRunFor({
76
- registry: new RunRegistry(environment.cacheDir),
77
- selector: this.context.run,
78
- customerPath: this.context.customerPath,
79
- }),
80
- runNamed: Boolean(this.context.run),
81
- file: this.context.variationsFile,
82
- load: () => this.loadRuntimeConfig(log, customer?.app),
83
- });
84
68
  const options = await this.withChosenVariations(chosenParameters, config.variations);
85
- const fetcher = new OriginFetcher({
86
- cli: log,
87
- config,
88
- host: this.context.host,
89
- strict: true,
90
- });
91
- const ignore = this.context.ignore.map((pattern) => new RegExp(pattern, "g"));
92
- const pages = new PageSource({
93
- fetcher,
94
- documentHandler: this.context.raw || !files
95
- ? undefined
96
- : await this.buildDocumentHandler(files, this.context.customerPath),
97
- ignore,
98
- });
99
- const base = this.context.base
100
- ? await this.buildBase(log, fetcher, ignore)
101
- : undefined;
102
69
  // Installed last, after everything that can fail: the service closes it.
103
70
  const browserFetch = this.context.browserFetch
104
71
  ? installBrowserOriginFetch({ environment, logger: log, mode: "always" })
@@ -110,28 +77,21 @@ export class DiffServiceFactory {
110
77
  options,
111
78
  log,
112
79
  browserFetch,
113
- base,
114
80
  engine: createDiffEngine(environment, this.context.output),
115
- pages,
81
+ pages: new PageSource({
82
+ fetcher: new OriginFetcher({
83
+ cli: log,
84
+ config,
85
+ host: this.context.host,
86
+ strict: true,
87
+ }),
88
+ documentHandler: this.context.raw || !files
89
+ ? undefined
90
+ : await this.buildDocumentHandler(files),
91
+ ignore: this.context.ignore.map((pattern) => new RegExp(pattern, "g")),
92
+ }),
116
93
  });
117
94
  }
118
- /** The pages rendered with the customer config at `--base`, from a checkout of it. */
119
- async buildBase(log, fetcher, ignore) {
120
- const checkout = await configAtRef(this.context.customerPath, this.context.base);
121
- log.comment(`--base ${this.context.base}: the config at ${checkout.commit.slice(0, 8)}, where HEAD left it`);
122
- try {
123
- const files = await this.getIntegrationFiles(checkout.customerPath);
124
- const documentHandler = await this.buildDocumentHandler(files, checkout.customerPath);
125
- return {
126
- pages: new PageSource({ fetcher, documentHandler, ignore }),
127
- remove: checkout.remove,
128
- };
129
- }
130
- catch (error) {
131
- await checkout.remove();
132
- throw error;
133
- }
134
- }
135
95
  /**
136
96
  * The options, with the parameters an empty `--param` asked for added to
137
97
  * the ones removed. Asked first, before anything is loaded or fetched.
@@ -163,7 +123,7 @@ export class DiffServiceFactory {
163
123
  const chosen = await this.context.environment.cli.multiSelect("Which variations should be compared? One is compared against desktop", variationChoices(variations), (picked) => (picked.length === 1 && picked[0] !== DEFAULT_TYPE) ||
164
124
  picked.length === 2 ||
165
125
  "Choose one variation to compare against desktop, or two to compare with each other.");
166
- // A quiet CLI (--output json or patch) does not ask, and answers with no choice.
126
+ // A quiet CLI (--output json) does not ask, and answers with no choice.
167
127
  if (chosen.length === 0) {
168
128
  throw new ApplicationError("No variation chosen, so nothing to compare.", ["Name them: --variations mobile, or --variations tablet,mobile"]);
169
129
  }
@@ -185,7 +145,7 @@ export class DiffServiceFactory {
185
145
  async loadRuntimeConfig(log, app) {
186
146
  if (!app && !this.context.variationsFile) {
187
147
  log.writeWarning("no customer: the requests carry Speed Kit's device defaults only, no variations of an app");
188
- return DEFAULTS_ONLY;
148
+ return { variations: {}, authentications: [], originMap: {} };
189
149
  }
190
150
  return new RuntimeConfigSource({
191
151
  cli: log,
@@ -196,20 +156,20 @@ export class DiffServiceFactory {
196
156
  }).load(this.context.variationsFile);
197
157
  }
198
158
  /** The customer's files, with the released document handler unless it brings its own. */
199
- async getIntegrationFiles(customerPath = this.context.customerPath) {
159
+ async getIntegrationFiles() {
200
160
  return new IntegrationApiFactory(new IntegrationApiServiceBuildContext({
201
161
  environment: this.context.environment,
202
- basePath: customerPath,
162
+ basePath: this.context.customerPath,
203
163
  configName: this.context.configName,
204
164
  whitelist: [],
205
165
  }))
206
166
  .buildService()
207
167
  .run(this.context.raw ? [] : documentHandlerRuntimeFiles());
208
168
  }
209
- async buildDocumentHandler(files, customerPath) {
169
+ async buildDocumentHandler(files) {
210
170
  return new DocumentHandlerRuntimeServiceFactory(new DocumentHandlerRuntimeServiceBuildContext({
211
171
  environment: this.context.environment,
212
- customerPath,
172
+ customerPath: this.context.customerPath,
213
173
  configName: this.context.configName,
214
174
  verboseLevel: false,
215
175
  }), files).buildDocumentHandlerServer();
@@ -11,11 +11,6 @@ export interface DiffServiceDeps {
11
11
  readonly pages: PageSource;
12
12
  /** The headless Chrome pages are fetched through; closed when the run ends. */
13
13
  readonly browserFetch?: BrowserOriginFetchHandle;
14
- /** With `--base`: the pages rendered with the config at that ref, and how to remove its checkout. */
15
- readonly base?: {
16
- readonly pages: PageSource;
17
- remove(): Promise<void>;
18
- };
19
14
  }
20
15
  /**
21
16
  * `sk diff`: compares one page, as Speed Kit's server would request and the
@@ -65,12 +60,6 @@ export declare class DiffService {
65
60
  */
66
61
  run(): Promise<ComparisonOutcome>;
67
62
  private check;
68
- /**
69
- * One origin page, rendered with the config at `--base` and with the
70
- * working tree: only what the config change does. The page is requested
71
- * once, or read from `--html`; an origin failure ends the run.
72
- */
73
- private checkBase;
74
63
  /** The page against another page, both in one variation. */
75
64
  private checkAgainst;
76
65
  private checkVariations;
@@ -1,16 +1,9 @@
1
- import { readFile } from "node:fs/promises";
2
1
  import { withoutNoise } from "./noise-baseline.js";
3
2
  import ApplicationError from "../error-handling/error/application-error.js";
4
3
  import { PageSideFailure } from "./side-failure.js";
5
4
  function isFailed(side) {
6
5
  return side !== undefined && "failure" in side;
7
6
  }
8
- /** The side a failure Speed Kit's server would also have leaves; any other error ends the run. */
9
- function failedPage(error, label, url, variation) {
10
- if (!(error instanceof PageSideFailure))
11
- throw error;
12
- return { label, failure: error.failure, details: { url, variation }, error };
13
- }
14
7
  /** The failed side as a sink reports it, without the error object. */
15
8
  function withoutError({ error: _error, ...side }) {
16
9
  return side;
@@ -88,16 +81,11 @@ export class DiffService {
88
81
  finally {
89
82
  this.deps.engine.finish();
90
83
  await this.deps.browserFetch?.close();
91
- await this.deps.base?.remove();
92
84
  }
93
85
  return (OUTCOME_RANK.find((outcome) => this.outcomes.has(outcome)) ?? "equal");
94
86
  }
95
87
  async check() {
96
88
  const { against, variation, variations, params } = this.deps.options;
97
- if (this.deps.base) {
98
- await this.checkBase(this.deps.base.pages, variation);
99
- return;
100
- }
101
89
  if (against) {
102
90
  await this.checkAgainst(against, variation);
103
91
  return;
@@ -114,27 +102,6 @@ export class DiffService {
114
102
  await this.checkParameters(each);
115
103
  }
116
104
  }
117
- /**
118
- * One origin page, rendered with the config at `--base` and with the
119
- * working tree: only what the config change does. The page is requested
120
- * once, or read from `--html`; an origin failure ends the run.
121
- */
122
- async checkBase(basePages, variation) {
123
- const { pageUrl, base, html } = this.deps.options;
124
- const page = html === undefined
125
- ? await this.deps.pages.origin(pageUrl, variation)
126
- : { html: await readFile(html, "utf8") };
127
- const render = (pages, label) => pages
128
- .fromHtml(page.html, pageUrl, variation, {
129
- label,
130
- contentType: page.contentType,
131
- })
132
- .catch((error) => failedPage(error, label, pageUrl, variation));
133
- const before = await render(basePages, `config at ${base}`);
134
- const after = await render(this.deps.pages, "working tree");
135
- this.announce(`Checking the working tree against ${base} (${variation})...`, [`- url: ${pageUrl}`, ...(html === undefined ? [] : [`- html: ${html}`])]);
136
- await this.compare(before, after);
137
- }
138
105
  /** The page against another page, both in one variation. */
139
106
  async checkAgainst(against, variation) {
140
107
  const { pageUrl } = this.deps.options;
@@ -270,9 +237,7 @@ export class DiffService {
270
237
  reportFailure(left, right) {
271
238
  const { log, engine } = this.deps;
272
239
  const failed = [left, right].filter(isFailed);
273
- // With --base, any rendering failure is the config change's verdict.
274
- const verdict = (error) => this.deps.base ? error.failure.kind !== "origin" : error.isAbort;
275
- const outcome = failed.every((side) => verdict(side.error))
240
+ const outcome = failed.every((side) => side.error.isAbort)
276
241
  ? "uncacheable"
277
242
  : "failed";
278
243
  for (const { error } of failed) {
@@ -316,7 +281,16 @@ export class DiffService {
316
281
  if (!side) {
317
282
  side = this.deps.pages
318
283
  .fetch(url, variation, label, { baseline: this.deps.options.baseline })
319
- .catch((error) => failedPage(error, label, url, variation));
284
+ .catch((error) => {
285
+ if (!(error instanceof PageSideFailure))
286
+ throw error;
287
+ return {
288
+ label,
289
+ failure: error.failure,
290
+ details: { url, variation },
291
+ error,
292
+ };
293
+ });
320
294
  this.sides.set(key, side);
321
295
  }
322
296
  return side;
@@ -19,13 +19,6 @@ export interface PageSourceOptions {
19
19
  */
20
20
  readonly baseline?: boolean;
21
21
  }
22
- /** A page as the origin answered it. */
23
- export interface OriginPage {
24
- readonly html: string;
25
- readonly contentType?: string;
26
- /** Where the request went and what it answered, for a sink that reports it. */
27
- readonly details?: Readonly<Record<string, unknown>>;
28
- }
29
22
  /**
30
23
  * One side of a page diff: the page fetched from origin as Speed Kit's server
31
24
  * requests it for a variation, rendered by the customer's local
@@ -36,11 +29,6 @@ export declare class PageSource {
36
29
  constructor(deps: PageSourceDeps);
37
30
  fetch(url: string, variation: string, label: string, options?: PageSourceOptions): Promise<BaselinedSide>;
38
31
  private fetchOnce;
39
- /**
40
- * The page as the origin answers Speed Kit's server, before the
41
- * documentHandler renders it.
42
- */
43
- origin(url: string, variation: string): Promise<OriginPage>;
44
32
  /**
45
33
  * A side from HTML the caller already has, such as the page a browser
46
34
  * shows: rendered and reduced the same way a fetched page is.
@@ -23,19 +23,6 @@ export class PageSource {
23
23
  return { ...side, baseline: baselineOf(side.content, again.content) };
24
24
  }
25
25
  async fetchOnce(url, variation, label, options) {
26
- const page = await this.origin(url, variation);
27
- const side = await this.fromHtml(page.html, url, variation, {
28
- ...options,
29
- label,
30
- contentType: page.contentType,
31
- });
32
- return { ...side, details: { ...side.details, ...page.details } };
33
- }
34
- /**
35
- * The page as the origin answers Speed Kit's server, before the
36
- * documentHandler renders it.
37
- */
38
- async origin(url, variation) {
39
26
  const fetched = await this.deps.fetcher.fetch(url, variation);
40
27
  if (!fetched) {
41
28
  throw new ApplicationError(`${url} (${variation}) could not be fetched.`);
@@ -51,10 +38,18 @@ export class PageSource {
51
38
  failure: originFailure(response.status, response.statusText),
52
39
  });
53
40
  }
54
- return {
55
- html: await response.text(),
41
+ const side = await this.fromHtml(await response.text(), url, variation, {
42
+ ...options,
43
+ label,
56
44
  contentType: response.headers.get("content-type") ?? undefined,
57
- details: { requestUrl: fetched.url, status: response.status },
45
+ });
46
+ return {
47
+ ...side,
48
+ details: {
49
+ ...side.details,
50
+ requestUrl: fetched.url,
51
+ status: response.status,
52
+ },
58
53
  };
59
54
  }
60
55
  /**
@@ -11,9 +11,8 @@ export interface ToolDiffSinkDeps {
11
11
  * IntelliJ IDEA when none is configured.
12
12
  *
13
13
  * Both sides are written to files under the CLI's cache directory, which
14
- * outlive the command. The right side is read back once the command returns,
15
- * so an edit made in the tool reaches the caller only when the command blocks
16
- * until the diff is closed: `idea diff` does, VS Code needs `--wait`.
14
+ * outlive the command: the tool opens them after `idea diff` has returned.
15
+ * The right side is read back, so an edit made in the tool reaches the caller.
17
16
  */
18
17
  export declare class ToolDiffSink implements DiffSink {
19
18
  private readonly deps;
@@ -18,9 +18,8 @@ function fileName(label) {
18
18
  * IntelliJ IDEA when none is configured.
19
19
  *
20
20
  * Both sides are written to files under the CLI's cache directory, which
21
- * outlive the command. The right side is read back once the command returns,
22
- * so an edit made in the tool reaches the caller only when the command blocks
23
- * until the diff is closed: `idea diff` does, VS Code needs `--wait`.
21
+ * outlive the command: the tool opens them after `idea diff` has returned.
22
+ * The right side is read back, so an edit made in the tool reaches the caller.
24
23
  */
25
24
  export class ToolDiffSink {
26
25
  deps;
@@ -37,25 +37,6 @@ describe("DiffServiceBuildContext", () => {
37
37
  it("refuses --against the page itself", () => {
38
38
  expect(() => create({ against: "https://shop.test/" })).to.throw("with itself");
39
39
  });
40
- it("renders the page with the config at --base, from --html in one variation", () => {
41
- const context = create({
42
- base: "origin/main",
43
- html: "page.html",
44
- variation: "mobile",
45
- });
46
- expect(context.base).to.equal("origin/main");
47
- expect(context.html).to.equal("page.html");
48
- expect(context.variation).to.equal("mobile");
49
- });
50
- it("refuses --base with the flags of the checks it replaces", () => {
51
- expect(() => create({ base: "origin/main", params: true, baseline: true })).to.throw("does not take --params, --baseline");
52
- });
53
- it("refuses --base with --raw, which has no documentHandler", () => {
54
- expect(() => create({ base: "origin/main", raw: true })).to.throw("needs the customer path and the documentHandler");
55
- });
56
- it("refuses --html without --base", () => {
57
- expect(() => create({ html: "page.html" })).to.throw("for --base");
58
- });
59
40
  it("refuses --variation next to --variations", () => {
60
41
  expect(() => create({ variation: "mobile", variations: ["tablet"] })).to.throw("pass one of them");
61
42
  });
@@ -1,6 +1,3 @@
1
- import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
2
- import { tmpdir } from "node:os";
3
- import path from "node:path";
4
1
  import { expect } from "chai";
5
2
  import { describe, it } from "mocha";
6
3
  import { DiffEngine } from "../diff-engine.js";
@@ -410,95 +407,3 @@ describe("DiffService variation", () => {
410
407
  ]);
411
408
  });
412
409
  });
413
- /** A page source that renders whatever origin HTML it is given with `render`. */
414
- function renderingSource(render) {
415
- const origins = [];
416
- const source = {
417
- origins,
418
- async origin(url, variation) {
419
- origins.push(`${variation} ${url}`);
420
- return { html: "<p>origin</p>" };
421
- },
422
- async fromHtml(html, _url, _variation, options) {
423
- const content = render(html);
424
- if (content instanceof PageSideFailure)
425
- throw content;
426
- return { label: options.label, content };
427
- },
428
- };
429
- return source;
430
- }
431
- function baseService(before, after, options = {}) {
432
- const shown = [];
433
- const failed = [];
434
- const removed = [];
435
- const log = recordingLog();
436
- const pages = renderingSource(after);
437
- const diff = new DiffService({
438
- options: {
439
- pageUrl: "https://shop.test/c/shoes",
440
- variation: "default",
441
- base: "origin/main",
442
- ...options,
443
- },
444
- log,
445
- engine: new DiffEngine({
446
- sink: {
447
- async show(result) {
448
- shown.push(result);
449
- return undefined;
450
- },
451
- fail(comparison) {
452
- failed.push(comparison);
453
- },
454
- },
455
- }),
456
- pages,
457
- base: {
458
- pages: renderingSource(before),
459
- remove: async () => {
460
- removed.push("base");
461
- },
462
- },
463
- });
464
- return { diff, shown, failed, removed, log, pages };
465
- }
466
- describe("DiffService base", () => {
467
- it("renders one origin page with both configs and shows the change", async () => {
468
- const { diff, shown, removed, pages } = baseService((html) => `${html}<p>old</p>`, (html) => `${html}<p>new</p>`, { variation: "mobile" });
469
- expect(await diff.run()).to.equal("differs");
470
- expect(pages.origins).to.deep.equal(["mobile https://shop.test/c/shoes"]);
471
- expect(shown[0].left.label).to.equal("config at origin/main");
472
- expect(shown[0].right.label).to.equal("working tree");
473
- expect(removed).to.deep.equal(["base"]);
474
- });
475
- it("finds no diff when the change leaves the page alone", async () => {
476
- const { diff } = baseService((html) => html, (html) => html);
477
- expect(await diff.run()).to.equal("equal");
478
- });
479
- it("is uncacheable with the handler's message when the working tree throws", async () => {
480
- const thrown = new PageSideFailure({
481
- url: "https://shop.test/c/shoes",
482
- variation: "default",
483
- failure: documentHandlerFailure(new DocumentHandlerTransformError(new TypeError("grid is undefined"))),
484
- });
485
- const { diff, failed, log } = baseService((html) => html, () => thrown);
486
- expect(await diff.run()).to.equal("uncacheable");
487
- expect(failed).to.have.length(1);
488
- expect(log.lines.join("\n")).to.contain("grid is undefined");
489
- });
490
- it("renders a saved page instead of requesting it", async () => {
491
- const dir = mkdtempSync(path.join(tmpdir(), "sk-diff-spec-"));
492
- const file = path.join(dir, "page.html");
493
- writeFileSync(file, "<p>saved</p>");
494
- const { diff, shown, pages } = baseService((html) => html, (html) => html, { html: file });
495
- try {
496
- expect(await diff.run()).to.equal("equal");
497
- expect(pages.origins).to.have.length(0);
498
- expect(shown[0].left.content).to.equal("<p>saved</p>");
499
- }
500
- finally {
501
- rmSync(dir, { recursive: true });
502
- }
503
- });
504
- });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The browser mock that the server passes to a document handler, as in
3
+ * `orestes-node/helper/browserMock.js`. The embedded Speed Kit config runs in
4
+ * it, so a read such as `location.hostname` in `getCurrentHostConfig()` works.
5
+ * `location` points at the app domain, and `window` and `top` are the mock
6
+ * itself. It has no timers and no event listeners, like the server's mock.
7
+ *
8
+ * @param app the app whose domain `location` points to
9
+ * @returns the browser globals by name
10
+ */
11
+ export declare function createBrowserGlobals(app: string): Record<string, unknown>;
12
+ /** The browser global that `error` reports as not defined, or undefined for any other error. */
13
+ export declare function missingBrowserGlobal(error: unknown): string | undefined;