@speedkit/cli 4.51.0-run-control.5 → 4.51.1
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.
- package/CHANGELOG.md +37 -0
- package/README.md +14 -1426
- package/dist/commands/diff.d.ts +1 -7
- package/dist/commands/diff.js +3 -9
- package/dist/commands/login.d.ts +0 -3
- package/dist/commands/login.js +3 -14
- package/dist/commands/onboarding.d.ts +0 -26
- package/dist/commands/onboarding.js +4 -221
- package/dist/commands/origin-request.d.ts +0 -4
- package/dist/commands/origin-request.js +0 -4
- package/dist/services/browser-fetch/device-emulation.d.ts +0 -11
- package/dist/services/browser-fetch/device-emulation.js +0 -14
- package/dist/services/bundler/bundle-service-factory.d.ts +3 -0
- package/dist/services/bundler/bundle-service-factory.js +5 -1
- package/dist/services/bundler/bundle-service.d.ts +10 -1
- package/dist/services/bundler/bundle-service.js +16 -1
- package/dist/services/bundler/error/packjockel-error.d.ts +3 -0
- package/dist/services/bundler/error/packjockel-error.js +3 -0
- package/dist/services/bundler/index.d.ts +1 -0
- package/dist/services/bundler/index.js +1 -0
- package/dist/services/bundler/packjockel-service.d.ts +112 -0
- package/dist/services/bundler/packjockel-service.js +202 -0
- package/dist/services/bundler/spec/packjockel-service.spec.js +186 -0
- package/dist/services/cli/cli-environment-factory.d.ts +0 -3
- package/dist/services/cli/cli-environment-factory.js +0 -1
- package/dist/services/cli/cli-service-build-context.d.ts +0 -3
- package/dist/services/cli/cli-service-factory.js +1 -1
- package/dist/services/cli/cli-service-model.d.ts +10 -29
- package/dist/services/cli/cli-service.d.ts +11 -60
- package/dist/services/cli/cli-service.js +32 -196
- package/dist/services/cli/index.d.ts +0 -2
- package/dist/services/cli/index.js +0 -2
- package/dist/services/cli/spec/cli-service.spec.js +50 -113
- package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +2 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +2 -3
- package/dist/services/deploy/handler/customer-config-handler.d.ts +9 -0
- package/dist/services/deploy/handler/customer-config-handler.js +41 -6
- package/dist/services/deploy/interface/install.d.ts +7 -1
- package/dist/services/deploy/mr/live-state-check.js +21 -2
- package/dist/services/deploy/policy/auto-deploy-policy.js +2 -0
- package/dist/services/deploy/policy/deploy-policy-model.d.ts +4 -0
- package/dist/services/deploy/policy/deploy-policy-model.js +4 -0
- package/dist/services/deploy/policy/testing-deploy-policy.js +2 -0
- package/dist/services/deploy/spec/handler/customer-config-handler.spec.js +98 -0
- package/dist/services/deploy/spec/mr/live-state-check.spec.js +45 -4
- package/dist/services/deploy/spec/policy/auto-deploy-policy.spec.js +2 -0
- package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.js +3 -1
- package/dist/services/diff/diff-service-build-context.d.ts +0 -12
- package/dist/services/diff/diff-service-build-context.js +1 -45
- package/dist/services/diff/diff-service-factory.d.ts +0 -2
- package/dist/services/diff/diff-service-factory.js +25 -65
- package/dist/services/diff/diff-service.d.ts +0 -11
- package/dist/services/diff/diff-service.js +11 -37
- package/dist/services/diff/page-source.d.ts +0 -12
- package/dist/services/diff/page-source.js +11 -16
- package/dist/services/diff/sinks/tool-diff-sink.d.ts +2 -3
- package/dist/services/diff/sinks/tool-diff-sink.js +2 -3
- package/dist/services/diff/spec/diff-service-build-context.spec.js +0 -19
- package/dist/services/diff/spec/diff-service.spec.js +0 -95
- package/dist/services/document-handler-runtime/document-handler-browser-mock.d.ts +13 -0
- package/dist/services/document-handler-runtime/document-handler-browser-mock.js +69 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +27 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +112 -19
- package/dist/services/document-handler-runtime/spec/document-handler-browser-mock.spec.js +34 -0
- package/dist/services/git/git-repository.d.ts +0 -2
- package/dist/services/git/git-repository.js +0 -6
- package/dist/services/integration-api/customer-config-flags.js +0 -1
- package/dist/services/integration-api/integration-api-model.d.ts +4 -1
- package/dist/services/integration-api/spec/customer-config-file.spec.js +56 -0
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +68 -8
- package/dist/services/integration-api/struct/customer-config-file.d.ts +15 -0
- package/dist/services/integration-api/struct/customer-config-file.js +42 -0
- package/dist/services/integration-api/struct/customer-config.d.ts +55 -1
- package/dist/services/integration-api/struct/customer-config.js +70 -3
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +11 -4
- package/dist/services/integration-api/struct/speed-kit-config-file.js +31 -10
- package/dist/services/onboarding/browse/browse-service.d.ts +1 -13
- package/dist/services/onboarding/browse/browse-service.js +7 -43
- package/dist/services/onboarding/browser/baqend-response.d.ts +1 -17
- package/dist/services/onboarding/browser/baqend-response.js +0 -23
- package/dist/services/onboarding/browser/emulate-device.d.ts +1 -12
- package/dist/services/onboarding/browser/emulate-device.js +13 -68
- package/dist/services/onboarding/browser/executable/executable-validator.js +2 -4
- package/dist/services/onboarding/browser/extension/extension-bridge.js +3 -5
- package/dist/services/onboarding/browser/extension/extension-downloader.js +8 -17
- package/dist/services/onboarding/browser/extension/extension-validator.js +4 -9
- package/dist/services/onboarding/browser/launch-browser.d.ts +1 -2
- package/dist/services/onboarding/browser/launch-browser.js +1 -6
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +2 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +29 -8
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -3
- package/dist/services/onboarding/dashboard/index.js +2 -7
- package/dist/services/onboarding/fetch-event-handler.d.ts +5 -24
- package/dist/services/onboarding/fetch-event-handler.js +32 -103
- package/dist/services/onboarding/fetch-events/spec/speed-kit-install-js.spec.js +59 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +7 -14
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +0 -14
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +0 -30
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -14
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +10 -29
- package/dist/services/onboarding/file-events/file-watcher.d.ts +4 -43
- package/dist/services/onboarding/file-events/file-watcher.js +21 -119
- package/dist/services/onboarding/inject/inject-service.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +7 -40
- package/dist/services/onboarding/onboarding-model.js +9 -20
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +0 -4
- package/dist/services/onboarding/onboarding-service-build-context.js +1 -7
- package/dist/services/onboarding/onboarding-service-factory.d.ts +1 -17
- package/dist/services/onboarding/onboarding-service-factory.js +35 -152
- package/dist/services/onboarding/onboarding-service.d.ts +1 -40
- package/dist/services/onboarding/onboarding-service.js +23 -139
- package/dist/services/onboarding/request-cache/cache.d.ts +5 -62
- package/dist/services/onboarding/request-cache/cache.js +17 -128
- package/dist/services/onboarding/spec/file-events/file-watcher.spec.js +67 -0
- package/dist/services/onboarding/spec/onboarding-model.spec.js +3 -39
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +1 -25
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +5 -0
- package/dist/services/onboarding/todo-collector.d.ts +2 -7
- package/dist/services/onboarding/todo-collector.js +12 -49
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +0 -38
- package/dist/services/onboarding/virtual-orestes-app/index.js +27 -113
- package/dist/services/origin-request/asset-variations.d.ts +0 -14
- package/dist/services/origin-request/asset-variations.js +4 -11
- package/dist/services/origin-request/origin-fetcher.d.ts +0 -7
- package/dist/services/origin-request/origin-fetcher.js +5 -43
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +0 -17
- package/dist/services/origin-request/origin-request-service-build-context.js +0 -8
- package/dist/services/origin-request/origin-request-service-factory.d.ts +5 -0
- package/dist/services/origin-request/origin-request-service-factory.js +30 -2
- package/dist/services/origin-request/origin-request-service.d.ts +6 -121
- package/dist/services/origin-request/origin-request-service.js +49 -273
- package/dist/services/origin-request/runtime-config-source.d.ts +0 -6
- package/dist/services/origin-request/runtime-config-source.js +4 -15
- package/dist/services/origin-request/spec/asset-variations.spec.js +0 -20
- package/dist/services/origin-request/spec/origin-request-service.spec.js +6 -329
- package/dist/services/pull/pull-service.js +23 -5
- package/dist/services/query-builder/query-builder-factory.js +3 -3
- package/dist/services/setup/os/tool-registry.js +2 -2
- package/oclif.manifest.json +269 -3390
- package/package.json +3 -20
- package/dist/base/run-control-command.d.ts +0 -15
- package/dist/base/run-control-command.js +0 -20
- package/dist/build-info.json +0 -6
- package/dist/commands/onboarding/browser/click.d.ts +0 -75
- package/dist/commands/onboarding/browser/click.js +0 -19
- package/dist/commands/onboarding/browser/emulate.d.ts +0 -105
- package/dist/commands/onboarding/browser/emulate.js +0 -26
- package/dist/commands/onboarding/browser/navigate.d.ts +0 -75
- package/dist/commands/onboarding/browser/navigate.js +0 -19
- package/dist/commands/onboarding/browser/panel.d.ts +0 -63
- package/dist/commands/onboarding/browser/panel.js +0 -12
- package/dist/commands/onboarding/browser/reinstall-sw.d.ts +0 -63
- package/dist/commands/onboarding/browser/reinstall-sw.js +0 -14
- package/dist/commands/onboarding/browser/reset.d.ts +0 -71
- package/dist/commands/onboarding/browser/reset.js +0 -18
- package/dist/commands/onboarding/browser/screenshot.d.ts +0 -77
- package/dist/commands/onboarding/browser/screenshot.js +0 -19
- package/dist/commands/onboarding/browser/state.d.ts +0 -63
- package/dist/commands/onboarding/browser/state.js +0 -12
- package/dist/commands/onboarding/browser/tabs.d.ts +0 -58
- package/dist/commands/onboarding/browser/tabs.js +0 -16
- package/dist/commands/onboarding/cache/clear.d.ts +0 -58
- package/dist/commands/onboarding/cache/clear.js +0 -12
- package/dist/commands/onboarding/cache/errors.d.ts +0 -58
- package/dist/commands/onboarding/cache/errors.js +0 -12
- package/dist/commands/onboarding/cache/evict.d.ts +0 -62
- package/dist/commands/onboarding/cache/evict.js +0 -15
- package/dist/commands/onboarding/cache/get.d.ts +0 -85
- package/dist/commands/onboarding/cache/get.js +0 -17
- package/dist/commands/onboarding/cache/list.d.ts +0 -58
- package/dist/commands/onboarding/cache/list.js +0 -15
- package/dist/commands/onboarding/cache/prewarm.d.ts +0 -73
- package/dist/commands/onboarding/cache/prewarm.js +0 -20
- package/dist/commands/onboarding/cache/refresh.d.ts +0 -62
- package/dist/commands/onboarding/cache/refresh.js +0 -18
- package/dist/commands/onboarding/cdp.d.ts +0 -81
- package/dist/commands/onboarding/cdp.js +0 -18
- package/dist/commands/onboarding/debug/arm.d.ts +0 -83
- package/dist/commands/onboarding/debug/arm.js +0 -19
- package/dist/commands/onboarding/debug/await.d.ts +0 -71
- package/dist/commands/onboarding/debug/await.js +0 -18
- package/dist/commands/onboarding/debug/disarm.d.ts +0 -63
- package/dist/commands/onboarding/debug/disarm.js +0 -12
- package/dist/commands/onboarding/debug/eval.d.ts +0 -75
- package/dist/commands/onboarding/debug/eval.js +0 -16
- package/dist/commands/onboarding/debug/release.d.ts +0 -63
- package/dist/commands/onboarding/debug/release.js +0 -12
- package/dist/commands/onboarding/debug/resume.d.ts +0 -63
- package/dist/commands/onboarding/debug/resume.js +0 -12
- package/dist/commands/onboarding/debug/status.d.ts +0 -63
- package/dist/commands/onboarding/debug/status.js +0 -12
- package/dist/commands/onboarding/debug/step.d.ts +0 -67
- package/dist/commands/onboarding/debug/step.js +0 -15
- package/dist/commands/onboarding/files/list.d.ts +0 -58
- package/dist/commands/onboarding/files/list.js +0 -12
- package/dist/commands/onboarding/files/read.d.ts +0 -73
- package/dist/commands/onboarding/files/read.js +0 -16
- package/dist/commands/onboarding/files/rebuild.d.ts +0 -63
- package/dist/commands/onboarding/files/rebuild.js +0 -18
- package/dist/commands/onboarding/files/validate.d.ts +0 -58
- package/dist/commands/onboarding/files/validate.js +0 -12
- package/dist/commands/onboarding/fouc.d.ts +0 -77
- package/dist/commands/onboarding/fouc.js +0 -16
- package/dist/commands/onboarding/inject/add.d.ts +0 -89
- package/dist/commands/onboarding/inject/add.js +0 -17
- package/dist/commands/onboarding/inject/clear.d.ts +0 -63
- package/dist/commands/onboarding/inject/clear.js +0 -12
- package/dist/commands/onboarding/inject/list.d.ts +0 -63
- package/dist/commands/onboarding/inject/list.js +0 -12
- package/dist/commands/onboarding/inject/read.d.ts +0 -75
- package/dist/commands/onboarding/inject/read.js +0 -18
- package/dist/commands/onboarding/inject/recipes.d.ts +0 -63
- package/dist/commands/onboarding/inject/recipes.js +0 -12
- package/dist/commands/onboarding/inject/remove.d.ts +0 -67
- package/dist/commands/onboarding/inject/remove.js +0 -15
- package/dist/commands/onboarding/list.d.ts +0 -13
- package/dist/commands/onboarding/list.js +0 -12
- package/dist/commands/onboarding/logs.d.ts +0 -41
- package/dist/commands/onboarding/logs.js +0 -257
- package/dist/commands/onboarding/navwalk.d.ts +0 -95
- package/dist/commands/onboarding/navwalk.js +0 -19
- package/dist/commands/onboarding/response.d.ts +0 -67
- package/dist/commands/onboarding/response.js +0 -18
- package/dist/commands/onboarding/rum/beacons.d.ts +0 -75
- package/dist/commands/onboarding/rum/beacons.js +0 -16
- package/dist/commands/onboarding/rum/get.d.ts +0 -77
- package/dist/commands/onboarding/rum/get.js +0 -18
- package/dist/commands/onboarding/rum/key.d.ts +0 -67
- package/dist/commands/onboarding/rum/key.js +0 -13
- package/dist/commands/onboarding/rum/previous.d.ts +0 -63
- package/dist/commands/onboarding/rum/previous.js +0 -12
- package/dist/commands/onboarding/status.d.ts +0 -13
- package/dist/commands/onboarding/status.js +0 -17
- package/dist/commands/onboarding/stop.d.ts +0 -13
- package/dist/commands/onboarding/stop.js +0 -17
- package/dist/commands/onboarding/todo.d.ts +0 -58
- package/dist/commands/onboarding/todo.js +0 -12
- package/dist/commands/onboarding/viewport.d.ts +0 -101
- package/dist/commands/onboarding/viewport.js +0 -18
- package/dist/commands/onboarding/watch.d.ts +0 -93
- package/dist/commands/onboarding/watch.js +0 -16
- package/dist/commands/spec/onboarding.spec.js +0 -127
- package/dist/services/cli/build-info.d.ts +0 -33
- package/dist/services/cli/build-info.js +0 -63
- package/dist/services/cli/sink.d.ts +0 -47
- package/dist/services/cli/sink.js +0 -31
- package/dist/services/cli/spec/build-identity.spec.js +0 -85
- package/dist/services/cli/spec/build-info.spec.js +0 -10
- package/dist/services/cli/spec/cli-service-log.spec.js +0 -133
- package/dist/services/cli/spec/memory-cli.d.ts +0 -9
- package/dist/services/cli/spec/memory-cli.js +0 -9
- package/dist/services/diff/config-at-ref.d.ts +0 -20
- package/dist/services/diff/config-at-ref.js +0 -33
- package/dist/services/diff/run-runtime-config.d.ts +0 -33
- package/dist/services/diff/run-runtime-config.js +0 -74
- package/dist/services/diff/spec/config-at-ref.spec.js +0 -46
- package/dist/services/diff/spec/run-runtime-config.spec.js +0 -87
- package/dist/services/onboarding/browser/answer-dialogs.d.ts +0 -12
- package/dist/services/onboarding/browser/answer-dialogs.js +0 -25
- package/dist/services/onboarding/browser/console-log.d.ts +0 -9
- package/dist/services/onboarding/browser/console-log.js +0 -27
- package/dist/services/onboarding/browser/resume-restarted-workers.d.ts +0 -14
- package/dist/services/onboarding/browser/resume-restarted-workers.js +0 -26
- package/dist/services/onboarding/control/body-inspect.d.ts +0 -24
- package/dist/services/onboarding/control/body-inspect.js +0 -106
- package/dist/services/onboarding/control/browser-session.d.ts +0 -547
- package/dist/services/onboarding/control/browser-session.js +0 -1337
- package/dist/services/onboarding/control/config-validation.d.ts +0 -17
- package/dist/services/onboarding/control/config-validation.js +0 -46
- package/dist/services/onboarding/control/control-protocol.d.ts +0 -1430
- package/dist/services/onboarding/control/control-protocol.js +0 -58
- package/dist/services/onboarding/control/control-server.d.ts +0 -292
- package/dist/services/onboarding/control/control-server.js +0 -1629
- package/dist/services/onboarding/control/debug-session.d.ts +0 -219
- package/dist/services/onboarding/control/debug-session.js +0 -897
- package/dist/services/onboarding/control/fouc.d.ts +0 -23
- package/dist/services/onboarding/control/fouc.js +0 -151
- package/dist/services/onboarding/control/index.d.ts +0 -4
- package/dist/services/onboarding/control/index.js +0 -4
- package/dist/services/onboarding/control/navigate-wait.d.ts +0 -33
- package/dist/services/onboarding/control/navigate-wait.js +0 -56
- package/dist/services/onboarding/control/navwalk.d.ts +0 -65
- package/dist/services/onboarding/control/navwalk.js +0 -248
- package/dist/services/onboarding/control/preload-registry.d.ts +0 -150
- package/dist/services/onboarding/control/preload-registry.js +0 -829
- package/dist/services/onboarding/control/response-explainer.d.ts +0 -24
- package/dist/services/onboarding/control/response-explainer.js +0 -257
- package/dist/services/onboarding/control/rum.d.ts +0 -8
- package/dist/services/onboarding/control/rum.js +0 -220
- package/dist/services/onboarding/control/service-worker-tracker.d.ts +0 -68
- package/dist/services/onboarding/control/service-worker-tracker.js +0 -120
- package/dist/services/onboarding/control/viewport.d.ts +0 -45
- package/dist/services/onboarding/control/viewport.js +0 -344
- package/dist/services/onboarding/control/watch.d.ts +0 -26
- package/dist/services/onboarding/control/watch.js +0 -157
- package/dist/services/onboarding/request-cache/asset-key.d.ts +0 -61
- package/dist/services/onboarding/request-cache/asset-key.js +0 -115
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.js +0 -66
- package/dist/services/onboarding/spec/browser/console-log.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/console-log.spec.js +0 -42
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.js +0 -45
- package/dist/services/onboarding/spec/control/browser-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/browser-session.spec.js +0 -753
- package/dist/services/onboarding/spec/control/control-server.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/control-server.spec.js +0 -371
- package/dist/services/onboarding/spec/control/debug-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/debug-session.spec.js +0 -751
- package/dist/services/onboarding/spec/control/fakes.d.ts +0 -31
- package/dist/services/onboarding/spec/control/fakes.js +0 -67
- package/dist/services/onboarding/spec/control/fouc.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/fouc.spec.js +0 -167
- package/dist/services/onboarding/spec/control/navigate-wait.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navigate-wait.spec.js +0 -47
- package/dist/services/onboarding/spec/control/navwalk.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navwalk.spec.js +0 -222
- package/dist/services/onboarding/spec/control/preload-registry.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/preload-registry.spec.js +0 -432
- package/dist/services/onboarding/spec/control/response-explainer.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/response-explainer.spec.js +0 -324
- package/dist/services/onboarding/spec/control/rum.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/rum.spec.js +0 -222
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.js +0 -193
- package/dist/services/onboarding/spec/control/viewport.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/viewport.spec.js +0 -200
- package/dist/services/onboarding/spec/control/watch.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/watch.spec.js +0 -187
- package/dist/services/onboarding/spec/fetch-event-handler.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-event-handler.spec.js +0 -219
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.js +0 -41
- package/dist/services/onboarding/spec/request-cache/cache.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/request-cache/cache.spec.js +0 -107
- package/dist/services/onboarding/spec/todo-collector.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/todo-collector.spec.js +0 -136
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.js +0 -65
- package/dist/services/query-builder/rules/rule-match.d.ts +0 -35
- package/dist/services/query-builder/rules/rule-match.js +0 -70
- package/dist/services/query-builder/spec/rules/rule-match.spec.d.ts +0 -1
- package/dist/services/query-builder/spec/rules/rule-match.spec.js +0 -121
- package/dist/services/run-control/browser/run-browser-contexts.d.ts +0 -557
- package/dist/services/run-control/browser/run-browser-contexts.js +0 -91
- package/dist/services/run-control/browser/run-browser-service-factory.d.ts +0 -5
- package/dist/services/run-control/browser/run-browser-service-factory.js +0 -7
- package/dist/services/run-control/browser/run-browser-service.d.ts +0 -68
- package/dist/services/run-control/browser/run-browser-service.js +0 -206
- package/dist/services/run-control/cache/run-cache-contexts.d.ts +0 -349
- package/dist/services/run-control/cache/run-cache-contexts.js +0 -51
- package/dist/services/run-control/cache/run-cache-service-factory.d.ts +0 -6
- package/dist/services/run-control/cache/run-cache-service-factory.js +0 -12
- package/dist/services/run-control/cache/run-cache-service.d.ts +0 -35
- package/dist/services/run-control/cache/run-cache-service.js +0 -151
- package/dist/services/run-control/control-client.d.ts +0 -36
- package/dist/services/run-control/control-client.js +0 -147
- package/dist/services/run-control/debug/run-debug-contexts.d.ts +0 -416
- package/dist/services/run-control/debug/run-debug-contexts.js +0 -47
- package/dist/services/run-control/debug/run-debug-service-factory.d.ts +0 -5
- package/dist/services/run-control/debug/run-debug-service-factory.js +0 -7
- package/dist/services/run-control/debug/run-debug-service.d.ts +0 -39
- package/dist/services/run-control/debug/run-debug-service.js +0 -164
- package/dist/services/run-control/files/run-files-contexts.d.ts +0 -238
- package/dist/services/run-control/files/run-files-contexts.js +0 -26
- package/dist/services/run-control/files/run-files-service-factory.d.ts +0 -5
- package/dist/services/run-control/files/run-files-service-factory.js +0 -7
- package/dist/services/run-control/files/run-files-service.d.ts +0 -29
- package/dist/services/run-control/files/run-files-service.js +0 -120
- package/dist/services/run-control/index.d.ts +0 -32
- package/dist/services/run-control/index.js +0 -31
- package/dist/services/run-control/inject/run-inject-contexts.d.ts +0 -319
- package/dist/services/run-control/inject/run-inject-contexts.js +0 -38
- package/dist/services/run-control/inject/run-inject-service-factory.d.ts +0 -5
- package/dist/services/run-control/inject/run-inject-service-factory.js +0 -7
- package/dist/services/run-control/inject/run-inject-service.d.ts +0 -31
- package/dist/services/run-control/inject/run-inject-service.js +0 -227
- package/dist/services/run-control/live-run.d.ts +0 -37
- package/dist/services/run-control/live-run.js +0 -56
- package/dist/services/run-control/probe/run-probe-contexts.d.ts +0 -333
- package/dist/services/run-control/probe/run-probe-contexts.js +0 -73
- package/dist/services/run-control/probe/run-probe-service-factory.d.ts +0 -5
- package/dist/services/run-control/probe/run-probe-service-factory.js +0 -7
- package/dist/services/run-control/probe/run-probe-service.d.ts +0 -54
- package/dist/services/run-control/probe/run-probe-service.js +0 -194
- package/dist/services/run-control/rum/run-rum-contexts.d.ts +0 -216
- package/dist/services/run-control/rum/run-rum-contexts.js +0 -34
- package/dist/services/run-control/rum/run-rum-service-factory.d.ts +0 -5
- package/dist/services/run-control/rum/run-rum-service-factory.js +0 -7
- package/dist/services/run-control/rum/run-rum-service.d.ts +0 -36
- package/dist/services/run-control/rum/run-rum-service.js +0 -122
- package/dist/services/run-control/run-answer.d.ts +0 -28
- package/dist/services/run-control/run-answer.js +0 -58
- package/dist/services/run-control/run-control-context.d.ts +0 -102
- package/dist/services/run-control/run-control-context.js +0 -36
- package/dist/services/run-control/run-control-flags.d.ts +0 -12
- package/dist/services/run-control/run-control-flags.js +0 -22
- package/dist/services/run-control/run-control-model.d.ts +0 -9
- package/dist/services/run-control/run-control-model.js +0 -1
- package/dist/services/run-control/run-control-service-factory.d.ts +0 -14
- package/dist/services/run-control/run-control-service-factory.js +0 -26
- package/dist/services/run-control/session/run-session-contexts.d.ts +0 -25
- package/dist/services/run-control/session/run-session-contexts.js +0 -20
- package/dist/services/run-control/session/run-session-service-factory.d.ts +0 -8
- package/dist/services/run-control/session/run-session-service-factory.js +0 -18
- package/dist/services/run-control/session/run-session-service.d.ts +0 -32
- package/dist/services/run-control/session/run-session-service.js +0 -151
- package/dist/services/run-control/spec/browser/run-browser-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/browser/run-browser-service.spec.js +0 -328
- package/dist/services/run-control/spec/cache/run-cache-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/cache/run-cache-service.spec.js +0 -454
- package/dist/services/run-control/spec/debug/run-debug-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/debug/run-debug-service.spec.js +0 -113
- package/dist/services/run-control/spec/files/run-files-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/files/run-files-service.spec.js +0 -234
- package/dist/services/run-control/spec/inject/run-inject-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/inject/run-inject-service.spec.js +0 -251
- package/dist/services/run-control/spec/live-run-fixture.d.ts +0 -32
- package/dist/services/run-control/spec/live-run-fixture.js +0 -109
- package/dist/services/run-control/spec/probe/run-probe-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/probe/run-probe-service.spec.js +0 -108
- package/dist/services/run-control/spec/rum/run-rum-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/rum/run-rum-service.spec.js +0 -47
- package/dist/services/run-control/spec/run-answer.spec.d.ts +0 -1
- package/dist/services/run-control/spec/run-answer.spec.js +0 -57
- package/dist/services/run-control/spec/session/run-session-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/session/run-session-service.spec.js +0 -150
- package/dist/services/run-log/crash-mirror.d.ts +0 -31
- package/dist/services/run-log/crash-mirror.js +0 -69
- package/dist/services/run-log/index.d.ts +0 -11
- package/dist/services/run-log/index.js +0 -11
- package/dist/services/run-log/jsonl-appender.d.ts +0 -46
- package/dist/services/run-log/jsonl-appender.js +0 -91
- package/dist/services/run-log/log-event-model.d.ts +0 -104
- package/dist/services/run-log/log-event-model.js +0 -56
- package/dist/services/run-log/log-query-service-factory.d.ts +0 -11
- package/dist/services/run-log/log-query-service-factory.js +0 -14
- package/dist/services/run-log/log-query-service.d.ts +0 -59
- package/dist/services/run-log/log-query-service.js +0 -111
- package/dist/services/run-log/log-reader.d.ts +0 -84
- package/dist/services/run-log/log-reader.js +0 -180
- package/dist/services/run-log/log-summary.d.ts +0 -72
- package/dist/services/run-log/log-summary.js +0 -208
- package/dist/services/run-log/redaction.d.ts +0 -34
- package/dist/services/run-log/redaction.js +0 -124
- package/dist/services/run-log/request-log.d.ts +0 -82
- package/dist/services/run-log/request-log.js +0 -69
- package/dist/services/run-log/request-summary.d.ts +0 -76
- package/dist/services/run-log/request-summary.js +0 -0
- package/dist/services/run-log/run-log.d.ts +0 -61
- package/dist/services/run-log/run-log.js +0 -102
- package/dist/services/run-log/spec/log-query-service.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-query-service.spec.js +0 -197
- package/dist/services/run-log/spec/log-reader.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-reader.spec.js +0 -109
- package/dist/services/run-log/spec/log-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-summary.spec.js +0 -153
- package/dist/services/run-log/spec/redaction.spec.d.ts +0 -1
- package/dist/services/run-log/spec/redaction.spec.js +0 -61
- package/dist/services/run-log/spec/request-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-log.spec.js +0 -101
- package/dist/services/run-log/spec/request-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-summary.spec.js +0 -171
- package/dist/services/run-log/spec/run-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/run-log.spec.js +0 -122
- package/dist/services/run-registry/exit-classification.d.ts +0 -39
- package/dist/services/run-registry/exit-classification.js +0 -42
- package/dist/services/run-registry/index.d.ts +0 -3
- package/dist/services/run-registry/index.js +0 -3
- package/dist/services/run-registry/process-identity.d.ts +0 -28
- package/dist/services/run-registry/process-identity.js +0 -80
- package/dist/services/run-registry/run-registry-model.d.ts +0 -128
- package/dist/services/run-registry/run-registry-model.js +0 -16
- package/dist/services/run-registry/run-registry.d.ts +0 -155
- package/dist/services/run-registry/run-registry.js +0 -430
- package/dist/services/run-registry/spec/exit-classification.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/exit-classification.spec.js +0 -82
- package/dist/services/run-registry/spec/run-registry.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/run-registry.spec.js +0 -526
- /package/dist/{commands/spec/onboarding.spec.d.ts → services/bundler/spec/packjockel-service.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-identity.spec.d.ts → deploy/spec/handler/customer-config-handler.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-info.spec.d.ts → document-handler-runtime/spec/document-handler-browser-mock.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/cli-service-log.spec.d.ts → integration-api/spec/customer-config-file.spec.d.ts} +0 -0
- /package/dist/services/{diff/spec/config-at-ref.spec.d.ts → onboarding/fetch-events/spec/speed-kit-install-js.spec.d.ts} +0 -0
- /package/dist/services/{diff/spec/run-runtime-config.spec.d.ts → onboarding/spec/file-events/file-watcher.spec.d.ts} +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
|
-
import ApplicationError from "../error-handling/error/application-error.js";
|
|
3
|
-
import { ControlError } from "../run-control/control-client.js";
|
|
4
|
-
import { LiveRun } from "../run-control/live-run.js";
|
|
5
|
-
/** What a request carries without a runtime config: the device defaults only. */
|
|
6
|
-
export const DEFAULTS_ONLY = {
|
|
7
|
-
variations: {},
|
|
8
|
-
authentications: [],
|
|
9
|
-
originMap: {},
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* The live run whose runtime config `sk diff` follows: the one `--run` names,
|
|
13
|
-
* else the one live run of the customer. Several live runs pick none.
|
|
14
|
-
*/
|
|
15
|
-
export function liveRunFor(input) {
|
|
16
|
-
const { registry, selector, customerPath } = input;
|
|
17
|
-
if (selector)
|
|
18
|
-
return LiveRun.resolve(registry, selector);
|
|
19
|
-
if (!customerPath)
|
|
20
|
-
return undefined;
|
|
21
|
-
const wanted = resolve(customerPath);
|
|
22
|
-
const runs = registry
|
|
23
|
-
.liveRuns()
|
|
24
|
-
.filter((run) => (run.meta.customerDir ?? resolve(run.meta.customerPath)) === wanted);
|
|
25
|
-
return runs.length === 1 ? new LiveRun(runs[0]) : undefined;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The runtime config `sk diff` builds its requests from: the live run's, so
|
|
29
|
-
* the diff sees what the run sees, else the one `load` reads.
|
|
30
|
-
*
|
|
31
|
-
* @throws {ApplicationError} Without a config: the run loaded none, or `load` read none.
|
|
32
|
-
*/
|
|
33
|
-
export async function diffRuntimeConfig(deps) {
|
|
34
|
-
const { log, run, runNamed, file, load } = deps;
|
|
35
|
-
if (run) {
|
|
36
|
-
try {
|
|
37
|
-
const { config } = await run.request({
|
|
38
|
-
op: "config.runtime",
|
|
39
|
-
});
|
|
40
|
-
if (config) {
|
|
41
|
-
log.comment(`runtime config from the live run ${run.id}`);
|
|
42
|
-
return config;
|
|
43
|
-
}
|
|
44
|
-
// The device defaults would hide that the run lacks the variations and the basic auth.
|
|
45
|
-
throw noRuntimeConfig(`the live run ${run.id} loaded no runtime config`, [
|
|
46
|
-
'Run "sk login", then restart the run so it loads the runtime config.',
|
|
47
|
-
]);
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
// A run of an older build does not know the op; the login still works.
|
|
51
|
-
if (runNamed || !(error instanceof ControlError))
|
|
52
|
-
throw error;
|
|
53
|
-
log.comment(`the live run ${run.id} did not share its runtime config (${error.message}); loading the app's`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const config = await load();
|
|
57
|
-
if (!config && file) {
|
|
58
|
-
throw new ApplicationError(`no runtime config to build the requests from: ${file} could not be read`);
|
|
59
|
-
}
|
|
60
|
-
if (!config) {
|
|
61
|
-
throw noRuntimeConfig("no login", [
|
|
62
|
-
'Run "sk login".',
|
|
63
|
-
"Or pass --run <run> to take it from a live sk onboarding run.",
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
return config;
|
|
67
|
-
}
|
|
68
|
-
/** The refusal without a runtime config; `--variationsFile` always fixes it. */
|
|
69
|
-
function noRuntimeConfig(cause, fixes) {
|
|
70
|
-
return new ApplicationError(`no runtime config to build the requests from: ${cause}`, [
|
|
71
|
-
...fixes,
|
|
72
|
-
"Or pass --variationsFile <file> to use a config you already have.",
|
|
73
|
-
]);
|
|
74
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { expect } from "chai";
|
|
4
|
-
import { describe, it } from "mocha";
|
|
5
|
-
import { GitRepository } from "../../git/index.js";
|
|
6
|
-
import { configAtRef } from "../config-at-ref.js";
|
|
7
|
-
/** A repository whose merge base with any ref is `fork`, and holds the files in `files`. */
|
|
8
|
-
function repositoryWith(files, seen = []) {
|
|
9
|
-
return new GitRepository("/repo", (args) => {
|
|
10
|
-
seen.push(args);
|
|
11
|
-
if (args[0] === "merge-base")
|
|
12
|
-
return "f0f0f0f0f0\n";
|
|
13
|
-
if (args[0] === "ls-tree")
|
|
14
|
-
return Object.keys(files).join("\n");
|
|
15
|
-
if (args[0] === "show")
|
|
16
|
-
return files[args[1].split(":")[1]];
|
|
17
|
-
throw new Error(`unexpected git ${args.join(" ")}`);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
describe("configAtRef", () => {
|
|
21
|
-
it("writes the customer directory as the ref holds it, and removes it", async () => {
|
|
22
|
-
const checkout = await configAtRef("/repo/customers/shop", "origin/main", repositoryWith({
|
|
23
|
-
"customers/shop/config_customer.json": '{"app":"shop"}',
|
|
24
|
-
"customers/shop/plugins/grid.js": "export {}",
|
|
25
|
-
}));
|
|
26
|
-
expect(checkout.customerPath).to.match(/customers[/\\]shop$/);
|
|
27
|
-
expect(readFileSync(path.join(checkout.customerPath, "plugins/grid.js"), "utf8")).to.equal("export {}");
|
|
28
|
-
await checkout.remove();
|
|
29
|
-
expect(existsSync(checkout.customerPath)).to.equal(false);
|
|
30
|
-
});
|
|
31
|
-
it("refuses a ref without the customer", async () => {
|
|
32
|
-
const error = await configAtRef("/repo/customers/new", "origin/main", repositoryWith({})).catch((error_) => error_);
|
|
33
|
-
expect(error.message).to.contain("no config at origin/main (f0f0f0f0) for customers/new");
|
|
34
|
-
});
|
|
35
|
-
it("reads the files where HEAD left the ref, so later changes on it do not show reversed", async () => {
|
|
36
|
-
const seen = [];
|
|
37
|
-
const checkout = await configAtRef("/repo/customers/shop", "origin/main", repositoryWith({ "customers/shop/config_customer.json": "{}" }, seen));
|
|
38
|
-
await checkout.remove();
|
|
39
|
-
expect(seen[0]).to.deep.equal(["merge-base", "HEAD", "origin/main"]);
|
|
40
|
-
expect(checkout.commit).to.equal("f0f0f0f0f0");
|
|
41
|
-
expect(seen.slice(1).map((args) => args.at(-1))).to.deep.equal([
|
|
42
|
-
"customers/shop",
|
|
43
|
-
"f0f0f0f0f0:customers/shop/config_customer.json",
|
|
44
|
-
]);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { describe, it } from "mocha";
|
|
3
|
-
import ApplicationError from "../../error-handling/error/application-error.js";
|
|
4
|
-
import { memoryCli } from "../../cli/spec/memory-cli.js";
|
|
5
|
-
import { ControlError } from "../../run-control/control-client.js";
|
|
6
|
-
import { diffRuntimeConfig } from "../run-runtime-config.js";
|
|
7
|
-
const LOGIN_CONFIG = {
|
|
8
|
-
variations: { app: { headers: { "x-app": "1" } } },
|
|
9
|
-
authentications: [],
|
|
10
|
-
originMap: {},
|
|
11
|
-
};
|
|
12
|
-
/** A live run that answers `config.runtime` with `config`, or fails with `error`. */
|
|
13
|
-
function liveRun(config, error) {
|
|
14
|
-
return {
|
|
15
|
-
id: "shop-production-1",
|
|
16
|
-
request: async () => {
|
|
17
|
-
if (error)
|
|
18
|
-
throw error;
|
|
19
|
-
return { config };
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
describe("diffRuntimeConfig", () => {
|
|
24
|
-
it("should take the config the live run loaded, without the login", async () => {
|
|
25
|
-
const runConfig = { ...LOGIN_CONFIG, originMap: { a: {} } };
|
|
26
|
-
let loaded = false;
|
|
27
|
-
const config = await diffRuntimeConfig({
|
|
28
|
-
log: memoryCli(),
|
|
29
|
-
run: liveRun(runConfig),
|
|
30
|
-
load: async () => {
|
|
31
|
-
loaded = true;
|
|
32
|
-
return LOGIN_CONFIG;
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
expect(config).to.deep.equal(runConfig);
|
|
36
|
-
expect(loaded).to.equal(false);
|
|
37
|
-
});
|
|
38
|
-
it("should refuse when the run loaded no config, even with a login, and name the cause and fixes", async () => {
|
|
39
|
-
const error = await diffRuntimeConfig({
|
|
40
|
-
log: memoryCli(),
|
|
41
|
-
run: liveRun(null),
|
|
42
|
-
load: async () => LOGIN_CONFIG,
|
|
43
|
-
}).catch((caught) => caught);
|
|
44
|
-
expect(error).to.be.instanceOf(ApplicationError);
|
|
45
|
-
expect(error.message).to.contain("the live run shop-production-1 loaded no runtime config");
|
|
46
|
-
const suggestions = error.suggestions.join(" ");
|
|
47
|
-
expect(suggestions).to.contain("sk login");
|
|
48
|
-
expect(suggestions).to.contain("--variationsFile");
|
|
49
|
-
});
|
|
50
|
-
it("should refuse without a run and without a login, and name the alternatives", async () => {
|
|
51
|
-
const error = await diffRuntimeConfig({
|
|
52
|
-
log: memoryCli(),
|
|
53
|
-
load: async () => undefined,
|
|
54
|
-
}).catch((caught) => caught);
|
|
55
|
-
expect(error).to.be.instanceOf(ApplicationError);
|
|
56
|
-
expect(error.message).to.contain("no login");
|
|
57
|
-
const suggestions = error.suggestions.join(" ");
|
|
58
|
-
expect(suggestions).to.contain("sk login");
|
|
59
|
-
expect(suggestions).to.contain("--run");
|
|
60
|
-
expect(suggestions).to.contain("--variationsFile");
|
|
61
|
-
});
|
|
62
|
-
it("should refuse when --variationsFile cannot be read, and name the file", async () => {
|
|
63
|
-
const error = await diffRuntimeConfig({
|
|
64
|
-
log: memoryCli(),
|
|
65
|
-
file: "runtime.json",
|
|
66
|
-
load: async () => undefined,
|
|
67
|
-
}).catch((caught) => caught);
|
|
68
|
-
expect(error.message).to.contain("runtime.json could not be read");
|
|
69
|
-
});
|
|
70
|
-
it("should load the app's config when a found run of an older build cannot answer", async () => {
|
|
71
|
-
const config = await diffRuntimeConfig({
|
|
72
|
-
log: memoryCli(),
|
|
73
|
-
run: liveRun(null, new ControlError("UNKNOWN_OP", "no such op")),
|
|
74
|
-
load: async () => LOGIN_CONFIG,
|
|
75
|
-
});
|
|
76
|
-
expect(config).to.equal(LOGIN_CONFIG);
|
|
77
|
-
});
|
|
78
|
-
it("should not hide the failure of a run --run named", async () => {
|
|
79
|
-
const error = await diffRuntimeConfig({
|
|
80
|
-
log: memoryCli(),
|
|
81
|
-
run: liveRun(null, new ControlError("UNKNOWN_OP", "no such op")),
|
|
82
|
-
runNamed: true,
|
|
83
|
-
load: async () => LOGIN_CONFIG,
|
|
84
|
-
}).catch((caught) => caught);
|
|
85
|
-
expect(error).to.be.instanceOf(ControlError);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Browser } from "puppeteer";
|
|
2
|
-
import { CliServiceInterface } from "../../cli/index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Answers every JavaScript dialog of every page of `browser`, and logs it.
|
|
5
|
-
*
|
|
6
|
-
* An open alert, confirm, prompt or beforeunload dialog blocks the page's main thread. Every CDP
|
|
7
|
-
* call then times out, a navigation never commits, and a headless run has nobody to close it: the
|
|
8
|
-
* run looked alive and every tool answered CDP_TIMEOUT until a restart. A confirm and a prompt are
|
|
9
|
-
* cancelled, which changes nothing on the site; an alert and a beforeunload are accepted, so the
|
|
10
|
-
* page goes on and a navigation leaves it.
|
|
11
|
-
*/
|
|
12
|
-
export declare function answerDialogs(browser: Pick<Browser, "on" | "targets">, cli: Pick<CliServiceInterface, "writeWarning">): void;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Answers every JavaScript dialog of every page of `browser`, and logs it.
|
|
3
|
-
*
|
|
4
|
-
* An open alert, confirm, prompt or beforeunload dialog blocks the page's main thread. Every CDP
|
|
5
|
-
* call then times out, a navigation never commits, and a headless run has nobody to close it: the
|
|
6
|
-
* run looked alive and every tool answered CDP_TIMEOUT until a restart. A confirm and a prompt are
|
|
7
|
-
* cancelled, which changes nothing on the site; an alert and a beforeunload are accepted, so the
|
|
8
|
-
* page goes on and a navigation leaves it.
|
|
9
|
-
*/
|
|
10
|
-
export function answerDialogs(browser, cli) {
|
|
11
|
-
const watch = async (target) => {
|
|
12
|
-
const page = await target.page().catch(() => null);
|
|
13
|
-
page?.on("dialog", (dialog) => void answer(dialog, page, cli));
|
|
14
|
-
};
|
|
15
|
-
browser.on("targetcreated", watch);
|
|
16
|
-
for (const target of browser.targets())
|
|
17
|
-
void watch(target);
|
|
18
|
-
}
|
|
19
|
-
async function answer(dialog, page, cli) {
|
|
20
|
-
const type = dialog.type();
|
|
21
|
-
const accept = type === "alert" || type === "beforeunload";
|
|
22
|
-
cli.writeWarning(`the page opened a dialog (${type}: "${dialog.message().slice(0, 200)}"); ${accept ? "accepted" : "cancelled"} it, as a blocked page answers no tool`, false, { scope: "browser", data: { page: page.url(), dialog: type } });
|
|
23
|
-
// A dialog that a navigation already closed cannot be answered any more.
|
|
24
|
-
await (accept ? dialog.accept() : dialog.dismiss()).catch(() => undefined);
|
|
25
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Page } from "puppeteer";
|
|
2
|
-
import { CliServiceInterface } from "../../cli/index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Records the page's console warnings and errors, and the errors it did not
|
|
5
|
-
* catch, into the run's log under the `console` scope, never on the
|
|
6
|
-
* terminal. `sk onboarding logs --scope console` reads them back, so "no
|
|
7
|
-
* console errors" can be checked after a test without a probe.
|
|
8
|
-
*/
|
|
9
|
-
export declare function recordConsole(page: Pick<Page, "on" | "url">, cli: Pick<CliServiceInterface, "logOnly">): void;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/** The console types worth a line: a log of every `console.log` would bury the run. */
|
|
2
|
-
const LEVELS = {
|
|
3
|
-
warn: "warn",
|
|
4
|
-
warning: "warn",
|
|
5
|
-
error: "error",
|
|
6
|
-
assert: "error",
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Records the page's console warnings and errors, and the errors it did not
|
|
10
|
-
* catch, into the run's log under the `console` scope, never on the
|
|
11
|
-
* terminal. `sk onboarding logs --scope console` reads them back, so "no
|
|
12
|
-
* console errors" can be checked after a test without a probe.
|
|
13
|
-
*/
|
|
14
|
-
export function recordConsole(page, cli) {
|
|
15
|
-
page.on("console", (message) => {
|
|
16
|
-
const level = LEVELS[message.type()];
|
|
17
|
-
if (!level)
|
|
18
|
-
return;
|
|
19
|
-
cli.logOnly(level, message.text(), {
|
|
20
|
-
scope: "console",
|
|
21
|
-
data: { page: page.url(), source: message.location()?.url },
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
page.on("pageerror", (error) => {
|
|
25
|
-
cli.logOnly("error", error instanceof Error ? error.message : String(error), { scope: "console", data: { page: page.url(), uncaught: true } });
|
|
26
|
-
});
|
|
27
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Browser } from "puppeteer";
|
|
2
|
-
/**
|
|
3
|
-
* Lets a target run again when Chrome restarts it, on every CDP session the run opens on `browser`.
|
|
4
|
-
*
|
|
5
|
-
* Chrome stops a service worker and starts it again under the same target. While a session is
|
|
6
|
-
* attached, Chrome holds the restarted worker at its first line and tells only the attached
|
|
7
|
-
* sessions, with `Inspector.targetReloadedAfterCrash`. The run keeps sessions on its workers for
|
|
8
|
-
* the device emulation, so nobody resumed it. An activating worker then stayed `starting`, every
|
|
9
|
-
* navigation in its scope waited for it, and every tool answered CDP_TIMEOUT until an outside
|
|
10
|
-
* client attached and resumed the worker.
|
|
11
|
-
*
|
|
12
|
-
* `Runtime.runIfWaitingForDebugger` does nothing on a target that does not wait.
|
|
13
|
-
*/
|
|
14
|
-
export declare function resumeRestartedWorkers(browser: Pick<Browser, "target">): Promise<void>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CDPSessionEvent } from "puppeteer";
|
|
2
|
-
/**
|
|
3
|
-
* Lets a target run again when Chrome restarts it, on every CDP session the run opens on `browser`.
|
|
4
|
-
*
|
|
5
|
-
* Chrome stops a service worker and starts it again under the same target. While a session is
|
|
6
|
-
* attached, Chrome holds the restarted worker at its first line and tells only the attached
|
|
7
|
-
* sessions, with `Inspector.targetReloadedAfterCrash`. The run keeps sessions on its workers for
|
|
8
|
-
* the device emulation, so nobody resumed it. An activating worker then stayed `starting`, every
|
|
9
|
-
* navigation in its scope waited for it, and every tool answered CDP_TIMEOUT until an outside
|
|
10
|
-
* client attached and resumed the worker.
|
|
11
|
-
*
|
|
12
|
-
* `Runtime.runIfWaitingForDebugger` does nothing on a target that does not wait.
|
|
13
|
-
*/
|
|
14
|
-
export async function resumeRestartedWorkers(browser) {
|
|
15
|
-
const root = await browser.target().createCDPSession();
|
|
16
|
-
root
|
|
17
|
-
.connection()
|
|
18
|
-
?.on(CDPSessionEvent.SessionAttached, (session) => {
|
|
19
|
-
session.on("Inspector.targetReloadedAfterCrash", () => {
|
|
20
|
-
void session
|
|
21
|
-
.send("Runtime.runIfWaitingForDebugger")
|
|
22
|
-
.catch(() => undefined);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
await root.detach();
|
|
26
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { GrepResult, SelectResult } from "./control-protocol.js";
|
|
2
|
-
/**
|
|
3
|
-
* Count and sample the elements a selector matches.
|
|
4
|
-
*
|
|
5
|
-
* The count is the point. "Did my postTransform remove what I think it did" is
|
|
6
|
-
* a question about how many of something is left, and a byte delta only answers
|
|
7
|
-
* it by inference — you have to already know what the removal should have
|
|
8
|
-
* weighed. `script[src*="analytics"]` → 0 answers it outright.
|
|
9
|
-
*
|
|
10
|
-
* Parsed properly rather than matched with a regex: the documents this runs on
|
|
11
|
-
* are transformed, minified and frequently malformed, which is exactly where a
|
|
12
|
-
* regex stops meaning what it appears to mean.
|
|
13
|
-
*/
|
|
14
|
-
export declare function selectInHtml(html: string, selector: string, maxMatches?: number): SelectResult;
|
|
15
|
-
/**
|
|
16
|
-
* Lines matching a pattern, with their line numbers.
|
|
17
|
-
*
|
|
18
|
-
* For everything a selector cannot reach, and for everything that is not html
|
|
19
|
-
* at all — an inline script's contents, a `setAssetList(` call in a minified
|
|
20
|
-
* bundle, a comment the handler leaves behind.
|
|
21
|
-
*/
|
|
22
|
-
export declare function grepText(html: string, pattern: string, maxMatches?: number,
|
|
23
|
-
/** RegExp flags; `i` where a caller promised case-insensitive. */
|
|
24
|
-
flags?: string): GrepResult;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { selectAll } from "css-select";
|
|
2
|
-
import render from "dom-serializer";
|
|
3
|
-
import { parse } from "parse5";
|
|
4
|
-
import { adapter } from "parse5-htmlparser2-tree-adapter";
|
|
5
|
-
/** Enough to see what survived, few enough to stay readable. */
|
|
6
|
-
const DEFAULT_MAX_MATCHES = 10;
|
|
7
|
-
/** One match, capped — a single minified element can be the whole document. */
|
|
8
|
-
const MAX_MATCH_LENGTH = 400;
|
|
9
|
-
/** Characters kept either side of a grep hit. */
|
|
10
|
-
const GREP_CONTEXT = 80;
|
|
11
|
-
/**
|
|
12
|
-
* Count and sample the elements a selector matches.
|
|
13
|
-
*
|
|
14
|
-
* The count is the point. "Did my postTransform remove what I think it did" is
|
|
15
|
-
* a question about how many of something is left, and a byte delta only answers
|
|
16
|
-
* it by inference — you have to already know what the removal should have
|
|
17
|
-
* weighed. `script[src*="analytics"]` → 0 answers it outright.
|
|
18
|
-
*
|
|
19
|
-
* Parsed properly rather than matched with a regex: the documents this runs on
|
|
20
|
-
* are transformed, minified and frequently malformed, which is exactly where a
|
|
21
|
-
* regex stops meaning what it appears to mean.
|
|
22
|
-
*/
|
|
23
|
-
export function selectInHtml(html, selector, maxMatches = DEFAULT_MAX_MATCHES) {
|
|
24
|
-
let nodes;
|
|
25
|
-
try {
|
|
26
|
-
const document = parse(html, { treeAdapter: adapter });
|
|
27
|
-
nodes = selectAll(selector, document);
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
return {
|
|
31
|
-
selector,
|
|
32
|
-
count: 0,
|
|
33
|
-
matches: [],
|
|
34
|
-
truncated: false,
|
|
35
|
-
error: error instanceof Error ? error.message : String(error),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
selector,
|
|
40
|
-
count: nodes.length,
|
|
41
|
-
matches: nodes.slice(0, maxMatches).map((node) => clamp(render(node))),
|
|
42
|
-
truncated: nodes.length > maxMatches,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Lines matching a pattern, with their line numbers.
|
|
47
|
-
*
|
|
48
|
-
* For everything a selector cannot reach, and for everything that is not html
|
|
49
|
-
* at all — an inline script's contents, a `setAssetList(` call in a minified
|
|
50
|
-
* bundle, a comment the handler leaves behind.
|
|
51
|
-
*/
|
|
52
|
-
export function grepText(html, pattern, maxMatches = DEFAULT_MAX_MATCHES,
|
|
53
|
-
/** RegExp flags; `i` where a caller promised case-insensitive. */
|
|
54
|
-
flags = "") {
|
|
55
|
-
let expression;
|
|
56
|
-
try {
|
|
57
|
-
expression = new RegExp(pattern, flags);
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
return {
|
|
61
|
-
pattern,
|
|
62
|
-
count: 0,
|
|
63
|
-
matches: [],
|
|
64
|
-
truncated: false,
|
|
65
|
-
error: error instanceof Error ? error.message : String(error),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
const matches = [];
|
|
69
|
-
let count = 0;
|
|
70
|
-
for (const [index, text] of html.split("\n").entries()) {
|
|
71
|
-
if (!expression.test(text)) {
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
count += 1;
|
|
75
|
-
if (matches.length < maxMatches) {
|
|
76
|
-
matches.push({ line: index + 1, text: windowAround(text, expression) });
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return { pattern, count, matches, truncated: count > matches.length };
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* The match with a little either side, rather than the line it sits on.
|
|
83
|
-
*
|
|
84
|
-
* A minified bundle is one line, so "the matching line" is the whole document —
|
|
85
|
-
* returning it would put the artifact straight back into the conversation that
|
|
86
|
-
* the file path exists to keep it out of. A window answers the question the
|
|
87
|
-
* grep was asking without doing that.
|
|
88
|
-
*/
|
|
89
|
-
function windowAround(text, expression) {
|
|
90
|
-
const found = expression.exec(text);
|
|
91
|
-
if (!found) {
|
|
92
|
-
return clamp(text.trim());
|
|
93
|
-
}
|
|
94
|
-
const start = Math.max(0, found.index - GREP_CONTEXT);
|
|
95
|
-
const end = Math.min(text.length, found.index + found[0].length + GREP_CONTEXT);
|
|
96
|
-
return [
|
|
97
|
-
start > 0 ? "…" : "",
|
|
98
|
-
text.slice(start, end).trim(),
|
|
99
|
-
end < text.length ? "…" : "",
|
|
100
|
-
].join("");
|
|
101
|
-
}
|
|
102
|
-
function clamp(text) {
|
|
103
|
-
return text.length > MAX_MATCH_LENGTH
|
|
104
|
-
? `${text.slice(0, MAX_MATCH_LENGTH)}…`
|
|
105
|
-
: text;
|
|
106
|
-
}
|