@speedkit/cli 4.51.0-run-control.5 → 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.
- package/CHANGELOG.md +30 -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/speed-kit-install-js.js +2 -11
- 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 +288 -3409
- 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.d.ts +0 -1
- 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/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
|
|
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
|
-
|
|
54
|
-
const
|
|
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,
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
-
|
|
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) =>
|
|
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
|
-
|
|
55
|
-
|
|
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
|
-
|
|
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
|
|
15
|
-
* so an edit made in the tool reaches the caller
|
|
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
|
|
22
|
-
* so an edit made in the tool reaches the caller
|
|
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;
|