@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,127 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { afterEach, beforeEach, describe, it } from "mocha";
|
|
3
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import { join } from "node:path";
|
|
6
|
-
import { confirmConflicts } from "../onboarding.js";
|
|
7
|
-
import { RunRegistry } from "../../services/run-registry/index.js";
|
|
8
|
-
import { META_FILE, } from "../../services/run-registry/run-registry-model.js";
|
|
9
|
-
import { processStartToken } from "../../services/run-registry/process-identity.js";
|
|
10
|
-
/**
|
|
11
|
-
* A CLI that records what it said and answers the prompt however the test
|
|
12
|
-
* wants. The real one derives `nonInteractive` from the environment, which
|
|
13
|
-
* under mocha is always true — so the interactive branch, the one that decides
|
|
14
|
-
* whether a run starts, could not be reached with it.
|
|
15
|
-
*/
|
|
16
|
-
class FakeCli {
|
|
17
|
-
nonInteractive;
|
|
18
|
-
answer;
|
|
19
|
-
warnings = [];
|
|
20
|
-
comments = [];
|
|
21
|
-
questions = [];
|
|
22
|
-
constructor(nonInteractive, answer) {
|
|
23
|
-
this.nonInteractive = nonInteractive;
|
|
24
|
-
this.answer = answer;
|
|
25
|
-
}
|
|
26
|
-
writeWarning(message) {
|
|
27
|
-
this.warnings.push(message);
|
|
28
|
-
}
|
|
29
|
-
comment(message) {
|
|
30
|
-
this.comments.push(message);
|
|
31
|
-
}
|
|
32
|
-
spacer() {
|
|
33
|
-
this.comments.push("");
|
|
34
|
-
}
|
|
35
|
-
async confirm(message) {
|
|
36
|
-
this.questions.push(message);
|
|
37
|
-
return this.answer;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const asCli = (fake) => fake;
|
|
41
|
-
describe("sk onboarding conflict check", () => {
|
|
42
|
-
let cacheDirectory;
|
|
43
|
-
let registry;
|
|
44
|
-
const liveRun = (id, extra = {}) => {
|
|
45
|
-
const meta = {
|
|
46
|
-
id,
|
|
47
|
-
customer: "example.com",
|
|
48
|
-
customerPath: "customers/example.com",
|
|
49
|
-
configName: "production",
|
|
50
|
-
pid: process.pid,
|
|
51
|
-
startToken: processStartToken(process.pid) ?? undefined,
|
|
52
|
-
startedAt: new Date().toISOString(),
|
|
53
|
-
status: "running",
|
|
54
|
-
flags: {
|
|
55
|
-
local: false,
|
|
56
|
-
headless: false,
|
|
57
|
-
useTestConfig: false,
|
|
58
|
-
ignoreContentSecurityPolicy: false,
|
|
59
|
-
},
|
|
60
|
-
cliVersion: "0.0.0",
|
|
61
|
-
...extra,
|
|
62
|
-
};
|
|
63
|
-
const dir = join(registry.directory, id);
|
|
64
|
-
mkdirSync(dir, { recursive: true });
|
|
65
|
-
writeFileSync(join(dir, META_FILE), JSON.stringify(meta));
|
|
66
|
-
};
|
|
67
|
-
beforeEach(() => {
|
|
68
|
-
cacheDirectory = mkdtempSync(join(tmpdir(), "sk-conflicts-"));
|
|
69
|
-
registry = new RunRegistry(cacheDirectory);
|
|
70
|
-
});
|
|
71
|
-
afterEach(() => {
|
|
72
|
-
rmSync(cacheDirectory, { recursive: true, force: true });
|
|
73
|
-
});
|
|
74
|
-
it("should not ask anything when nothing collides", async () => {
|
|
75
|
-
const cli = new FakeCli(false, false);
|
|
76
|
-
const go = await confirmConflicts(asCli(cli), registry, {
|
|
77
|
-
customerPath: "customers/example.com",
|
|
78
|
-
});
|
|
79
|
-
expect(go).to.equal(true);
|
|
80
|
-
expect(cli.questions).to.deep.equal([]);
|
|
81
|
-
expect(cli.warnings).to.deep.equal([]);
|
|
82
|
-
});
|
|
83
|
-
it("should stop the start when the answer is no", async () => {
|
|
84
|
-
liveRun("example.com-production-1");
|
|
85
|
-
const cli = new FakeCli(false, false);
|
|
86
|
-
const go = await confirmConflicts(asCli(cli), registry, {
|
|
87
|
-
customerPath: "./customers/example.com/",
|
|
88
|
-
});
|
|
89
|
-
expect(go).to.equal(false);
|
|
90
|
-
expect(cli.questions).to.have.lengthOf(1);
|
|
91
|
-
});
|
|
92
|
-
it("should let the start through when the answer is yes", async () => {
|
|
93
|
-
liveRun("example.com-production-1");
|
|
94
|
-
const cli = new FakeCli(false, true);
|
|
95
|
-
expect(await confirmConflicts(asCli(cli), registry, {
|
|
96
|
-
customerPath: "customers/example.com",
|
|
97
|
-
})).to.equal(true);
|
|
98
|
-
});
|
|
99
|
-
it("should name the run in the way of the port, and how to move", async () => {
|
|
100
|
-
liveRun("other-production-1", {
|
|
101
|
-
customerPath: "customers/other.com",
|
|
102
|
-
debugPort: 9222,
|
|
103
|
-
});
|
|
104
|
-
const cli = new FakeCli(false, true);
|
|
105
|
-
await confirmConflicts(asCli(cli), registry, {
|
|
106
|
-
customerPath: "customers/example.com",
|
|
107
|
-
debugPort: 9222,
|
|
108
|
-
});
|
|
109
|
-
expect(cli.warnings.join("\n")).to.contain("9222");
|
|
110
|
-
expect(cli.warnings.join("\n")).to.contain("other-production-1");
|
|
111
|
-
// The warning is only useful if it says what to do about it.
|
|
112
|
-
expect(cli.comments.join("\n")).to.contain("--debugPort");
|
|
113
|
-
});
|
|
114
|
-
it("should warn but not wedge a shell it cannot ask", async () => {
|
|
115
|
-
liveRun("example.com-production-1");
|
|
116
|
-
// `confirm` would answer `false` here if it were reached — so a pass proves
|
|
117
|
-
// the non-interactive branch returned true on its own rather than by
|
|
118
|
-
// taking the default. A scripted run is warned, never blocked.
|
|
119
|
-
const cli = new FakeCli(true, false);
|
|
120
|
-
const go = await confirmConflicts(asCli(cli), registry, {
|
|
121
|
-
customerPath: "customers/example.com",
|
|
122
|
-
});
|
|
123
|
-
expect(go).to.equal(true);
|
|
124
|
-
expect(cli.questions).to.deep.equal([]);
|
|
125
|
-
expect(cli.warnings.join("\n")).to.contain("cannot be asked");
|
|
126
|
-
});
|
|
127
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface BuildInfo {
|
|
2
|
-
/** Short commit the build came from. Absent where git was not available. */
|
|
3
|
-
commit?: string;
|
|
4
|
-
/** Whether anything was uncommitted when it was built. */
|
|
5
|
-
dirty?: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* A digest of `dist/` as it was built — the build's own identity.
|
|
8
|
-
*
|
|
9
|
-
* `commit` describes where the build came from, which on a dirty tree is the
|
|
10
|
-
* commit *before* the change under test. This describes the build itself, so
|
|
11
|
-
* two dirty builds can be told apart and a rebuild can be confirmed to have
|
|
12
|
-
* happened. Compare this when `dirty` is true.
|
|
13
|
-
*/
|
|
14
|
-
buildId?: string;
|
|
15
|
-
/** ISO 8601. */
|
|
16
|
-
builtAt?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Which build **this process** is running, written by `npm run build`.
|
|
20
|
-
*
|
|
21
|
-
* `version` does not answer this. semantic-release bumps it only on a release,
|
|
22
|
-
* so every development build of a version reports the same string and a run
|
|
23
|
-
* from a fixed build is indistinguishable from one from the build it fixed. Two
|
|
24
|
-
* test sweeps in a row had to date-match a build time against the commit log by
|
|
25
|
-
* hand — across timezones — to establish what they had been testing.
|
|
26
|
-
*
|
|
27
|
-
* Everything is optional on purpose: a tarball install has no git, and a build
|
|
28
|
-
* that predates this file has no stamp. Reporting nothing is better than
|
|
29
|
-
* reporting a guess.
|
|
30
|
-
*/
|
|
31
|
-
export declare function buildInfo(): BuildInfo;
|
|
32
|
-
/** One line naming the build, for anything that reports what it is running. */
|
|
33
|
-
export declare function buildLabel(version: string): string;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { dirname, resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
/**
|
|
5
|
-
* Where the stamp lives, relative to this module once compiled.
|
|
6
|
-
* dist/services/cli/build-info.js → dist/build-info.json
|
|
7
|
-
*/
|
|
8
|
-
const STAMP_PATH = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "build-info.json");
|
|
9
|
-
function readStamp() {
|
|
10
|
-
try {
|
|
11
|
-
return JSON.parse(readFileSync(STAMP_PATH, "utf8"));
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
// A tarball install has no git, a build predating this file has no stamp,
|
|
15
|
-
// and running from source under tsx has no dist at all. Reporting nothing
|
|
16
|
-
// beats reporting a guess.
|
|
17
|
-
return {};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Read once, at import — **not** on first call.
|
|
22
|
-
*
|
|
23
|
-
* This is the whole correctness of the field. The stamp is a file in `dist/`,
|
|
24
|
-
* and `dist/` is replaced by every build, so a long-lived process that reads it
|
|
25
|
-
* lazily reports whatever happens to be on disk the moment something first
|
|
26
|
-
* asks. `sk onboarding` is exactly that process: it runs for hours, so a
|
|
27
|
-
* rebuild mid-run left it executing the old code while naming the new commit —
|
|
28
|
-
* with `dirty: false`, which made it look trustworthy. A process started at
|
|
29
|
-
* 08:02 reported a commit made at 12:40.
|
|
30
|
-
*
|
|
31
|
-
* ESM evaluates a statically imported module at process start, so reading here
|
|
32
|
-
* pins the stamp to the build this process actually loaded. It cannot drift
|
|
33
|
-
* afterwards, because nothing re-reads it.
|
|
34
|
-
*/
|
|
35
|
-
const LOADED = readStamp();
|
|
36
|
-
/**
|
|
37
|
-
* Which build **this process** is running, written by `npm run build`.
|
|
38
|
-
*
|
|
39
|
-
* `version` does not answer this. semantic-release bumps it only on a release,
|
|
40
|
-
* so every development build of a version reports the same string and a run
|
|
41
|
-
* from a fixed build is indistinguishable from one from the build it fixed. Two
|
|
42
|
-
* test sweeps in a row had to date-match a build time against the commit log by
|
|
43
|
-
* hand — across timezones — to establish what they had been testing.
|
|
44
|
-
*
|
|
45
|
-
* Everything is optional on purpose: a tarball install has no git, and a build
|
|
46
|
-
* that predates this file has no stamp. Reporting nothing is better than
|
|
47
|
-
* reporting a guess.
|
|
48
|
-
*/
|
|
49
|
-
export function buildInfo() {
|
|
50
|
-
return LOADED;
|
|
51
|
-
}
|
|
52
|
-
/** One line naming the build, for anything that reports what it is running. */
|
|
53
|
-
export function buildLabel(version) {
|
|
54
|
-
const { commit, dirty, buildId } = buildInfo();
|
|
55
|
-
if (!commit) {
|
|
56
|
-
return buildId ? `${version} (build ${buildId})` : version;
|
|
57
|
-
}
|
|
58
|
-
// On a dirty tree the commit is not the code, so the build id is what the
|
|
59
|
-
// reader needs; on a clean one the commit says it better than a digest can.
|
|
60
|
-
return dirty
|
|
61
|
-
? `${version} (${commit}+dirty, build ${buildId ?? "unknown"})`
|
|
62
|
-
: `${version} (${commit})`;
|
|
63
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where `CliService` output actually goes.
|
|
3
|
-
*
|
|
4
|
-
* Every write the CLI makes passes through one of these three methods, so
|
|
5
|
-
* redirecting the CLI is a matter of handing it a different sink rather than
|
|
6
|
-
* intercepting `process.stdout`. That is the whole point: a process whose
|
|
7
|
-
* stdout belongs to something else — a protocol, a payload — cannot afford a
|
|
8
|
-
* stray byte, and nothing can be intercepted reliably enough to
|
|
9
|
-
* guarantee that.
|
|
10
|
-
*
|
|
11
|
-
* The three channels exist because they have different rules, not because the
|
|
12
|
-
* streams differ:
|
|
13
|
-
*
|
|
14
|
-
* - `line` is for a human reading along.
|
|
15
|
-
* - `payload` is the machine-readable result under `--quiet`, written verbatim.
|
|
16
|
-
* Callers own their separators, because whether a format ends in a newline is
|
|
17
|
-
* part of the format.
|
|
18
|
-
* - `aside` is a human line that must never share a channel with a payload, so
|
|
19
|
-
* it survives `sk … --quiet > file`.
|
|
20
|
-
*/
|
|
21
|
-
export interface CliSink {
|
|
22
|
-
/** A human-facing line. The sink adds the newline. */
|
|
23
|
-
line(message: string): void;
|
|
24
|
-
/** Machine-readable output, verbatim — no styling, no added newline. */
|
|
25
|
-
payload(data: string): void;
|
|
26
|
-
/** A human-facing line that must stay off the payload channel. */
|
|
27
|
-
aside(message: string): void;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The default: a terminal. `line` and `payload` share stdout, which is what
|
|
31
|
-
* makes `aside` necessary — under `--quiet` a caller is redirecting stdout, and
|
|
32
|
-
* an aside written there would end up inside the data.
|
|
33
|
-
*/
|
|
34
|
-
export declare class ConsoleSink implements CliSink {
|
|
35
|
-
line(message: string): void;
|
|
36
|
-
payload(data: string): void;
|
|
37
|
-
aside(message: string): void;
|
|
38
|
-
}
|
|
39
|
-
/** Keeps every write in memory. For tests, and for asserting on output. */
|
|
40
|
-
export declare class MemorySink implements CliSink {
|
|
41
|
-
readonly lines: string[];
|
|
42
|
-
readonly payloads: string[];
|
|
43
|
-
readonly asides: string[];
|
|
44
|
-
line(message: string): void;
|
|
45
|
-
payload(data: string): void;
|
|
46
|
-
aside(message: string): void;
|
|
47
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The default: a terminal. `line` and `payload` share stdout, which is what
|
|
3
|
-
* makes `aside` necessary — under `--quiet` a caller is redirecting stdout, and
|
|
4
|
-
* an aside written there would end up inside the data.
|
|
5
|
-
*/
|
|
6
|
-
export class ConsoleSink {
|
|
7
|
-
line(message) {
|
|
8
|
-
process.stdout.write(`${message}\n`);
|
|
9
|
-
}
|
|
10
|
-
payload(data) {
|
|
11
|
-
process.stdout.write(data);
|
|
12
|
-
}
|
|
13
|
-
aside(message) {
|
|
14
|
-
process.stderr.write(`${message}\n`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/** Keeps every write in memory. For tests, and for asserting on output. */
|
|
18
|
-
export class MemorySink {
|
|
19
|
-
lines = [];
|
|
20
|
-
payloads = [];
|
|
21
|
-
asides = [];
|
|
22
|
-
line(message) {
|
|
23
|
-
this.lines.push(message);
|
|
24
|
-
}
|
|
25
|
-
payload(data) {
|
|
26
|
-
this.payloads.push(data);
|
|
27
|
-
}
|
|
28
|
-
aside(message) {
|
|
29
|
-
this.asides.push(message);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { describe, it } from "mocha";
|
|
3
|
-
import { execFileSync } from "node:child_process";
|
|
4
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
-
import { resolve } from "node:path";
|
|
6
|
-
/**
|
|
7
|
-
* The guard for "this process knows which build it is".
|
|
8
|
-
*
|
|
9
|
-
* `sk onboarding` runs for hours, and `dist/` is replaced underneath it by
|
|
10
|
-
* every rebuild. The stamp used to be read lazily on first call, which meant a
|
|
11
|
-
* long-lived process reported whatever was on disk the moment something first
|
|
12
|
-
* asked — a process started at 08:02 named a commit made at 12:40, with
|
|
13
|
-
* `dirty: false` to make it look trustworthy. A run's `meta.json` records that
|
|
14
|
-
* commit, so the opposite of what the field is for.
|
|
15
|
-
*
|
|
16
|
-
* Run in a child process against the built module, because the bug only exists
|
|
17
|
-
* across a rebuild: it cannot be reproduced by calling a function twice in one
|
|
18
|
-
* process unless that process loaded the module before the file changed.
|
|
19
|
-
* `npm test` skips it without a build, the way the stdio guard does.
|
|
20
|
-
*/
|
|
21
|
-
describe("build identity across a rebuild", () => {
|
|
22
|
-
const stamp = resolve("dist/build-info.json");
|
|
23
|
-
const module = resolve("dist/services/cli/build-info.js");
|
|
24
|
-
/**
|
|
25
|
-
* Import the built module, rewrite the stamp, and only *then* ask.
|
|
26
|
-
*
|
|
27
|
-
* The order is the test. Calling `buildInfo()` before the rewrite caches the
|
|
28
|
-
* right answer and the bug disappears — which is exactly what the first
|
|
29
|
-
* version of this spec did, and it passed against the broken implementation.
|
|
30
|
-
* A lazily-read stamp is only wrong when the first call lands after the
|
|
31
|
-
* rebuild, which is the real case: a process started at 08:02 that is first
|
|
32
|
-
* asked something at 13:00.
|
|
33
|
-
*/
|
|
34
|
-
function askAfterRebuild(rewrite) {
|
|
35
|
-
const script = `
|
|
36
|
-
import { writeFileSync } from "node:fs";
|
|
37
|
-
// Imported here, asked below. Nothing may call buildInfo() in between.
|
|
38
|
-
import { buildInfo } from ${JSON.stringify(module)};
|
|
39
|
-
|
|
40
|
-
if (${rewrite}) {
|
|
41
|
-
writeFileSync(${JSON.stringify(stamp)}, JSON.stringify({
|
|
42
|
-
commit: "deadbeef",
|
|
43
|
-
dirty: false,
|
|
44
|
-
buildId: "ffffffffffff",
|
|
45
|
-
builtAt: new Date().toISOString(),
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
process.stdout.write(JSON.stringify({
|
|
50
|
-
reported: { ...buildInfo() },
|
|
51
|
-
}));
|
|
52
|
-
`;
|
|
53
|
-
return JSON.parse(execFileSync(process.execPath, ["--input-type=module", "-e", script], {
|
|
54
|
-
encoding: "utf8",
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
it("should keep naming the build it loaded, not the one on disk", function () {
|
|
58
|
-
if (!existsSync(module) || !existsSync(stamp)) {
|
|
59
|
-
this.skip();
|
|
60
|
-
}
|
|
61
|
-
const original = readFileSync(stamp, "utf8");
|
|
62
|
-
const loaded = JSON.parse(original).buildId;
|
|
63
|
-
try {
|
|
64
|
-
const result = askAfterRebuild(true);
|
|
65
|
-
// The assertion the lazy implementation fails: asked for the first time
|
|
66
|
-
// after the rebuild, it reported the build it had never loaded.
|
|
67
|
-
expect(result.reported.buildId).to.equal(loaded);
|
|
68
|
-
expect(result.reported.buildId).to.not.equal("ffffffffffff");
|
|
69
|
-
expect(result.reported.commit).to.not.equal("deadbeef");
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
writeFileSync(stamp, original);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
it("should restore the stamp it borrowed", function () {
|
|
76
|
-
if (!existsSync(stamp)) {
|
|
77
|
-
this.skip();
|
|
78
|
-
}
|
|
79
|
-
// The case above rewrites a real file in `dist/`. If it leaves it
|
|
80
|
-
// wrong, every later answer about this build is wrong too — so it is worth
|
|
81
|
-
// one assertion rather than trust.
|
|
82
|
-
const current = JSON.parse(readFileSync(stamp, "utf8"));
|
|
83
|
-
expect(current.buildId).to.not.equal("ffffffffffff");
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { describe, it } from "mocha";
|
|
3
|
-
import { buildLabel } from "../build-info.js";
|
|
4
|
-
describe("buildLabel", () => {
|
|
5
|
-
it("should name a build even where the stamp is missing", () => {
|
|
6
|
-
// A tarball install has no git and a build predating the stamp has no
|
|
7
|
-
// file. Reporting the bare version is honest; inventing a commit is not.
|
|
8
|
-
expect(buildLabel("4.28.0")).to.be.a("string").and.contain("4.28.0");
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { afterEach, beforeEach, describe, it } from "mocha";
|
|
3
|
-
import { MemorySink } from "../sink.js";
|
|
4
|
-
import { MemoryRunLog } from "../../run-log/index.js";
|
|
5
|
-
import { memoryCli } from "./memory-cli.js";
|
|
6
|
-
describe("CliService writing to a run log", () => {
|
|
7
|
-
let ci;
|
|
8
|
-
let sink;
|
|
9
|
-
let log;
|
|
10
|
-
let cli;
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
ci = process.env.CI;
|
|
13
|
-
process.env.CI = "true";
|
|
14
|
-
sink = new MemorySink();
|
|
15
|
-
log = new MemoryRunLog();
|
|
16
|
-
cli = memoryCli(sink);
|
|
17
|
-
cli.attachLog(log);
|
|
18
|
-
});
|
|
19
|
-
afterEach(() => {
|
|
20
|
-
if (ci === undefined) {
|
|
21
|
-
delete process.env.CI;
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
process.env.CI = ci;
|
|
25
|
-
});
|
|
26
|
-
it("records nothing before a log is attached", () => {
|
|
27
|
-
const detached = memoryCli();
|
|
28
|
-
expect(() => detached.write("no log here")).to.not.throw();
|
|
29
|
-
});
|
|
30
|
-
it("gives each write the level its method implies", () => {
|
|
31
|
-
cli.write("plain");
|
|
32
|
-
cli.writeSuccess("done");
|
|
33
|
-
cli.writeWarning("careful");
|
|
34
|
-
cli.writeError("broken");
|
|
35
|
-
expect(log.events.map((event) => [event.level, event.msg])).to.eql([
|
|
36
|
-
["info", "plain"],
|
|
37
|
-
["success", "done"],
|
|
38
|
-
["warn", "careful"],
|
|
39
|
-
["error", "broken"],
|
|
40
|
-
]);
|
|
41
|
-
});
|
|
42
|
-
it("records a warning once, not once as a warning and once as a write", () => {
|
|
43
|
-
// `writeWarning` used to delegate to `write`, which would log the same line
|
|
44
|
-
// twice — the second time at the wrong level.
|
|
45
|
-
cli.writeWarning("careful");
|
|
46
|
-
expect(log.events).to.have.length(1);
|
|
47
|
-
expect(sink.lines).to.have.length(1);
|
|
48
|
-
});
|
|
49
|
-
it("carries the scope and data the caller annotated", () => {
|
|
50
|
-
cli.write("served from origin", false, {
|
|
51
|
-
scope: "fetch",
|
|
52
|
-
data: { url: "/checkout", responseCause: "SwBooting" },
|
|
53
|
-
});
|
|
54
|
-
expect(log.events[0].scope).to.equal("fetch");
|
|
55
|
-
expect(log.events[0].data).to.eql({
|
|
56
|
-
url: "/checkout",
|
|
57
|
-
responseCause: "SwBooting",
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
it("lets a caller overrule the level its method implies", () => {
|
|
61
|
-
cli.writeWarning("this one is routine", false, { level: "debug" });
|
|
62
|
-
expect(log.events[0].level).to.equal("debug");
|
|
63
|
-
});
|
|
64
|
-
it("records a buffered line when it is buffered, with its own level", () => {
|
|
65
|
-
// Buffered lines are flushed as one block. Logging at flush time would
|
|
66
|
-
// report a page of mixed warnings and successes as a single info line.
|
|
67
|
-
cli.writeWarning("careful", true);
|
|
68
|
-
cli.writeSuccess("done", true);
|
|
69
|
-
cli.writeBuffer();
|
|
70
|
-
expect(log.events.map((event) => event.level)).to.eql(["warn", "success"]);
|
|
71
|
-
});
|
|
72
|
-
it("records an action's whole lifecycle", () => {
|
|
73
|
-
cli.startAction("INSTALL", "install Speed Kit");
|
|
74
|
-
cli.failAction("INSTALL", "could not reach the origin");
|
|
75
|
-
expect(log.events.map((event) => [event.action?.state, event.level])).to.eql([
|
|
76
|
-
["start", "info"],
|
|
77
|
-
["fail", "error"],
|
|
78
|
-
]);
|
|
79
|
-
});
|
|
80
|
-
it("names the action it ended, even when the caller did not", () => {
|
|
81
|
-
cli.startAction("WARM", "warm the list");
|
|
82
|
-
cli.successAction("WARM");
|
|
83
|
-
expect(log.events[1].msg).to.equal("warm the list");
|
|
84
|
-
});
|
|
85
|
-
it("records what a quiet run would have printed", () => {
|
|
86
|
-
// The log is not the terminal. A `--quiet` session prints nothing and still
|
|
87
|
-
// happened, and an empty log would be the most misleading file in the run
|
|
88
|
-
// directory.
|
|
89
|
-
const quiet = memoryCli(sink, true);
|
|
90
|
-
quiet.attachLog(log);
|
|
91
|
-
quiet.startAction("BUILD", "build the bundle");
|
|
92
|
-
expect(log.events).to.have.length(1);
|
|
93
|
-
});
|
|
94
|
-
it("records a question before the answer exists, and again after", async () => {
|
|
95
|
-
const quiet = memoryCli(sink, true);
|
|
96
|
-
quiet.attachLog(log);
|
|
97
|
-
// Under `--quiet` the default is taken without asking, so the pair here is
|
|
98
|
-
// one event: there was never a question on screen to record as pending.
|
|
99
|
-
await quiet.confirm("Start anyway?", false);
|
|
100
|
-
expect(log.events).to.have.length(1);
|
|
101
|
-
expect(log.events[0].interaction).to.include({
|
|
102
|
-
kind: "confirm",
|
|
103
|
-
question: "Start anyway?",
|
|
104
|
-
answer: false,
|
|
105
|
-
defaulted: true,
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
it("withholds the answer to a prompt the caller marked sensitive", async () => {
|
|
109
|
-
const quiet = memoryCli(sink, true);
|
|
110
|
-
quiet.attachLog(log);
|
|
111
|
-
await quiet.prompt("Basic auth password", {
|
|
112
|
-
defaultAnswer: "hunter2",
|
|
113
|
-
sensitive: true,
|
|
114
|
-
});
|
|
115
|
-
expect(log.events[0].interaction?.sensitive).to.equal(true);
|
|
116
|
-
expect(log.events[0].interaction?.answer).to.equal(undefined);
|
|
117
|
-
// The question itself is the useful part, and it is not the secret.
|
|
118
|
-
expect(log.events[0].interaction?.question).to.equal("Basic auth password");
|
|
119
|
-
});
|
|
120
|
-
it("records a table as rows, not as the rendered grid", () => {
|
|
121
|
-
cli.table([{ url: "/a", hits: 2 }], { url: {}, hits: {} });
|
|
122
|
-
expect(log.events[0].data).to.eql({
|
|
123
|
-
columns: ["url", "hits"],
|
|
124
|
-
rows: [{ url: "/a", hits: 2 }],
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
it("records that a payload was written, without its bytes", () => {
|
|
128
|
-
cli.pipe("SELECT * FROM rum.pi\n");
|
|
129
|
-
expect(log.events[0].level).to.equal("debug");
|
|
130
|
-
expect(log.events[0].msg).to.contain("bytes");
|
|
131
|
-
expect(log.events[0].msg).to.not.contain("SELECT");
|
|
132
|
-
});
|
|
133
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CliService } from "../cli-service.js";
|
|
2
|
-
import { MemorySink } from "../sink.js";
|
|
3
|
-
/** What a CI runner looks like to the CLI: no spinner can spin, nobody to ask. */
|
|
4
|
-
export declare const CI_TERMINAL: {
|
|
5
|
-
isCI: boolean;
|
|
6
|
-
nonInteractive: boolean;
|
|
7
|
-
};
|
|
8
|
-
/** A CLI on a CI runner that writes into `sink` rather than the terminal. */
|
|
9
|
-
export declare function memoryCli(sink?: MemorySink, quiet?: boolean): CliService;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CliService } from "../cli-service.js";
|
|
2
|
-
import { ClipboardService } from "../clipboard/index.js";
|
|
3
|
-
import { MemorySink } from "../sink.js";
|
|
4
|
-
/** What a CI runner looks like to the CLI: no spinner can spin, nobody to ask. */
|
|
5
|
-
export const CI_TERMINAL = { isCI: true, nonInteractive: true };
|
|
6
|
-
/** A CLI on a CI runner that writes into `sink` rather than the terminal. */
|
|
7
|
-
export function memoryCli(sink = new MemorySink(), quiet = false) {
|
|
8
|
-
return new CliService(new ClipboardService(), CI_TERMINAL, quiet, sink);
|
|
9
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { GitRepository } from "../git/index.js";
|
|
2
|
-
/** A customer directory as a git ref holds it, written to a temp directory. */
|
|
3
|
-
export interface ConfigAtRef {
|
|
4
|
-
/** The customer directory in the temp directory. */
|
|
5
|
-
readonly customerPath: string;
|
|
6
|
-
/** The commit the files come from: where HEAD left the ref. */
|
|
7
|
-
readonly commit: string;
|
|
8
|
-
/** Deletes the temp directory. */
|
|
9
|
-
remove(): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Writes the customer directory as `ref` holds it to a temp directory, so
|
|
13
|
-
* the documentHandler can be built from it beside the working tree's.
|
|
14
|
-
* The files come from the merge base of HEAD and `ref`, so changes that
|
|
15
|
-
* landed on `ref` after the branch left it do not show up reversed.
|
|
16
|
-
*
|
|
17
|
-
* shortcut: files are read as utf8, so a binary file in the customer
|
|
18
|
-
* directory is mangled; read buffers when a config ships one.
|
|
19
|
-
*/
|
|
20
|
-
export declare function configAtRef(customerPath: string, ref: string, repository?: GitRepository): Promise<ConfigAtRef>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import ApplicationError from "../error-handling/error/application-error.js";
|
|
5
|
-
import { GitRepository } from "../git/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* Writes the customer directory as `ref` holds it to a temp directory, so
|
|
8
|
-
* the documentHandler can be built from it beside the working tree's.
|
|
9
|
-
* The files come from the merge base of HEAD and `ref`, so changes that
|
|
10
|
-
* landed on `ref` after the branch left it do not show up reversed.
|
|
11
|
-
*
|
|
12
|
-
* shortcut: files are read as utf8, so a binary file in the customer
|
|
13
|
-
* directory is mangled; read buffers when a config ships one.
|
|
14
|
-
*/
|
|
15
|
-
export async function configAtRef(customerPath, ref, repository = GitRepository.at(customerPath)) {
|
|
16
|
-
const directory = repository.relative(customerPath);
|
|
17
|
-
const commit = repository.mergeBase(ref);
|
|
18
|
-
const files = repository.pathsAt(commit, directory);
|
|
19
|
-
if (files.length === 0) {
|
|
20
|
-
throw new ApplicationError(`no config at ${ref} (${commit.slice(0, 8)}) for ${directory}; use a ref that has one, or drop --base for a new customer.`);
|
|
21
|
-
}
|
|
22
|
-
const root = await mkdtemp(path.join(tmpdir(), "sk-diff-base-"));
|
|
23
|
-
for (const file of files) {
|
|
24
|
-
const target = path.join(root, file);
|
|
25
|
-
await mkdir(path.dirname(target), { recursive: true });
|
|
26
|
-
await writeFile(target, repository.contentAt(commit, file));
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
customerPath: path.join(root, directory),
|
|
30
|
-
commit,
|
|
31
|
-
remove: () => rm(root, { recursive: true, force: true }),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { OriginRequestConfig } from "../origin-request/index.js";
|
|
2
|
-
import { LiveRun } from "../run-control/live-run.js";
|
|
3
|
-
import { RunRegistry } from "../run-registry/index.js";
|
|
4
|
-
import { DiffLog } from "./diff-log.js";
|
|
5
|
-
/** What a request carries without a runtime config: the device defaults only. */
|
|
6
|
-
export declare const DEFAULTS_ONLY: OriginRequestConfig;
|
|
7
|
-
/**
|
|
8
|
-
* The live run whose runtime config `sk diff` follows: the one `--run` names,
|
|
9
|
-
* else the one live run of the customer. Several live runs pick none.
|
|
10
|
-
*/
|
|
11
|
-
export declare function liveRunFor(input: {
|
|
12
|
-
registry: RunRegistry;
|
|
13
|
-
selector?: string;
|
|
14
|
-
customerPath?: string;
|
|
15
|
-
}): LiveRun | undefined;
|
|
16
|
-
export interface DiffRuntimeConfigDeps {
|
|
17
|
-
readonly log: DiffLog;
|
|
18
|
-
/** The live run to follow; absent without one. */
|
|
19
|
-
readonly run?: Pick<LiveRun, "id" | "request">;
|
|
20
|
-
/** Whether `--run` named the run, so a failure to ask it is not hidden. */
|
|
21
|
-
readonly runNamed?: boolean;
|
|
22
|
-
/** `--variationsFile`: the file `load` reads instead of the app's config. */
|
|
23
|
-
readonly file?: string;
|
|
24
|
-
/** The app's or the file's runtime config, as `RuntimeConfigSource` loads it. */
|
|
25
|
-
readonly load: () => Promise<OriginRequestConfig | 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 declare function diffRuntimeConfig(deps: DiffRuntimeConfigDeps): Promise<OriginRequestConfig>;
|