@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
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tags of the Speed Kit assets that packjockel bundles, each a version such as `1.8.0` or a channel
|
|
3
|
+
* such as `@release`. packjockel takes `latest` for a tag that is not set. The names are the client
|
|
4
|
+
* config keys of packjockel.
|
|
5
|
+
*/
|
|
6
|
+
export interface AssetVersions {
|
|
7
|
+
/** Speed Kit: snippet, service worker and dynamic fetcher */
|
|
8
|
+
speedKitVersion?: string;
|
|
9
|
+
rumPluginsVersion?: string;
|
|
10
|
+
/** predictive preloading */
|
|
11
|
+
ppVersion?: string;
|
|
12
|
+
configPluginsVersion?: string;
|
|
13
|
+
documentHandlerVersion?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PackjockelBundleRequest {
|
|
16
|
+
/** The entry points by file name, in output order. */
|
|
17
|
+
entryPoints: Record<string, string>;
|
|
18
|
+
versions?: AssetVersions;
|
|
19
|
+
define?: Record<string, string>;
|
|
20
|
+
platform?: "browser" | "node";
|
|
21
|
+
target?: "es5" | "es6";
|
|
22
|
+
minify?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PackjockelInstallScriptRequest {
|
|
25
|
+
/** The config plugins, such as the `rum.js` load handler. */
|
|
26
|
+
plugins: string;
|
|
27
|
+
/** The Speed Kit config, which writes `SpeedKit.config`. */
|
|
28
|
+
config: string;
|
|
29
|
+
loader: string;
|
|
30
|
+
/** Set as `SpeedKit.config.installationId`. */
|
|
31
|
+
installationId: string;
|
|
32
|
+
/**
|
|
33
|
+
* The feature flags of the app. packjockel reads the flags it knows, such as `executeInIframe`, and
|
|
34
|
+
* ignores the others.
|
|
35
|
+
*/
|
|
36
|
+
features?: Record<string, boolean>;
|
|
37
|
+
versions?: AssetVersions;
|
|
38
|
+
define?: Record<string, string>;
|
|
39
|
+
minify?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PackjockelDocumentHandlerRequest {
|
|
42
|
+
/** The document handler library; without it packjockel bundles the published one of `documentHandlerVersion`. */
|
|
43
|
+
documentHandler?: string;
|
|
44
|
+
documentHandlerConfig: string;
|
|
45
|
+
speedKitConfig: string;
|
|
46
|
+
appName: string;
|
|
47
|
+
dynamicFetcher?: string;
|
|
48
|
+
dynamicFetcherConfig?: string;
|
|
49
|
+
customStyle?: string;
|
|
50
|
+
versions?: AssetVersions;
|
|
51
|
+
}
|
|
52
|
+
export interface PackjockelServiceWorkerRequest {
|
|
53
|
+
/** The Speed Kit service worker, with the `INSERT_CONFIG_HERE` placeholder of its config. */
|
|
54
|
+
serviceWorker: string;
|
|
55
|
+
/** The Speed Kit config, which writes `SpeedKit.config`. */
|
|
56
|
+
speedKitConfig: string;
|
|
57
|
+
appName: string;
|
|
58
|
+
versions?: AssetVersions;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Bundles with the packjockel binary in embedded mode, so no packjockel server is needed.
|
|
62
|
+
*
|
|
63
|
+
* Every input goes to the binary as a file, because a document handler is too large for one
|
|
64
|
+
* command line argument.
|
|
65
|
+
*/
|
|
66
|
+
export declare class PackjockelService {
|
|
67
|
+
private readonly resolveBinary;
|
|
68
|
+
/**
|
|
69
|
+
* @param resolveBinary returns the packjockel binary; it runs only when a bundle is needed, so
|
|
70
|
+
* a platform without a packjockel package fails only for the `enableSpeedKitConfigPlugins` feature
|
|
71
|
+
*/
|
|
72
|
+
constructor(resolveBinary?: () => string);
|
|
73
|
+
/**
|
|
74
|
+
* Bundles the entry points in their order into one script. packjockel puts a script before them
|
|
75
|
+
* which exposes the `SpeedKit` global.
|
|
76
|
+
*
|
|
77
|
+
* @returns the bundled code
|
|
78
|
+
*/
|
|
79
|
+
bundle(request: PackjockelBundleRequest): Promise<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Bundles the Speed Kit install script: the `SpeedKit` global, the plugins, the config, the
|
|
82
|
+
* installation (app, installation id) and the loader, in this order.
|
|
83
|
+
*
|
|
84
|
+
* @returns the install script
|
|
85
|
+
*/
|
|
86
|
+
bundleInstallScript(request: PackjockelInstallScriptRequest): Promise<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Bundles a document handler with its config, the embedded Speed Kit config and the default `post`.
|
|
89
|
+
*
|
|
90
|
+
* @returns the code of one CommonJS module, which exports `post`
|
|
91
|
+
*/
|
|
92
|
+
bundleDocumentHandler(request: PackjockelDocumentHandlerRequest): Promise<string>;
|
|
93
|
+
/**
|
|
94
|
+
* Bundles the service worker with the embedded Speed Kit config. The config module runs before
|
|
95
|
+
* the service worker, so its plugin imports resolve to their service worker builds, and the
|
|
96
|
+
* placeholder reads the `SpeedKit.config` it wrote.
|
|
97
|
+
*
|
|
98
|
+
* @returns the bundled service worker
|
|
99
|
+
*/
|
|
100
|
+
bundleServiceWorker(request: PackjockelServiceWorkerRequest): Promise<string>;
|
|
101
|
+
/**
|
|
102
|
+
* Runs packjockel in a scratch directory, which is removed afterwards.
|
|
103
|
+
*
|
|
104
|
+
* @param buildArgs writes the inputs into the directory and returns the arguments that read them
|
|
105
|
+
*/
|
|
106
|
+
private run;
|
|
107
|
+
/**
|
|
108
|
+
* Runs the binary without stdin: packjockel reads a piped stdin as the document handler, and only
|
|
109
|
+
* without input it bundles the published one.
|
|
110
|
+
*/
|
|
111
|
+
private execute;
|
|
112
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { binaryPath } from "@speedkit/packjockel";
|
|
6
|
+
import { PackjockelError } from "./error/packjockel-error.js";
|
|
7
|
+
const VERSION_FLAGS = {
|
|
8
|
+
speedKitVersion: "--speed-kit-version",
|
|
9
|
+
rumPluginsVersion: "--rum-plugin-version",
|
|
10
|
+
ppVersion: "--pp-version",
|
|
11
|
+
configPluginsVersion: "--config-plugins-version",
|
|
12
|
+
documentHandlerVersion: "--document-handler-version",
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Bundles with the packjockel binary in embedded mode, so no packjockel server is needed.
|
|
16
|
+
*
|
|
17
|
+
* Every input goes to the binary as a file, because a document handler is too large for one
|
|
18
|
+
* command line argument.
|
|
19
|
+
*/
|
|
20
|
+
export class PackjockelService {
|
|
21
|
+
resolveBinary;
|
|
22
|
+
/**
|
|
23
|
+
* @param resolveBinary returns the packjockel binary; it runs only when a bundle is needed, so
|
|
24
|
+
* a platform without a packjockel package fails only for the `enableSpeedKitConfigPlugins` feature
|
|
25
|
+
*/
|
|
26
|
+
constructor(resolveBinary = binaryPath) {
|
|
27
|
+
this.resolveBinary = resolveBinary;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Bundles the entry points in their order into one script. packjockel puts a script before them
|
|
31
|
+
* which exposes the `SpeedKit` global.
|
|
32
|
+
*
|
|
33
|
+
* @returns the bundled code
|
|
34
|
+
*/
|
|
35
|
+
async bundle(request) {
|
|
36
|
+
return this.run(async (directory) => {
|
|
37
|
+
const args = [
|
|
38
|
+
"bundle",
|
|
39
|
+
"--bundle",
|
|
40
|
+
`--platform=${request.platform ?? "browser"}`,
|
|
41
|
+
`--target=${request.target ?? "es5"}`,
|
|
42
|
+
];
|
|
43
|
+
if (request.minify) {
|
|
44
|
+
args.push("--minify");
|
|
45
|
+
}
|
|
46
|
+
args.push(...keyValueFlags("--define", request.define));
|
|
47
|
+
for (const [name, code] of Object.entries(request.entryPoints)) {
|
|
48
|
+
args.push(await writeInput(directory, name, code));
|
|
49
|
+
}
|
|
50
|
+
return args;
|
|
51
|
+
}, request.versions);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Bundles the Speed Kit install script: the `SpeedKit` global, the plugins, the config, the
|
|
55
|
+
* installation (app, installation id) and the loader, in this order.
|
|
56
|
+
*
|
|
57
|
+
* @returns the install script
|
|
58
|
+
*/
|
|
59
|
+
async bundleInstallScript(request) {
|
|
60
|
+
return this.run(async (directory) => {
|
|
61
|
+
const args = [
|
|
62
|
+
"bundle",
|
|
63
|
+
"install-script",
|
|
64
|
+
await writeInput(directory, "loader.js", request.loader),
|
|
65
|
+
`--plugins=${await writeInput(directory, "plugins.js", request.plugins)}`,
|
|
66
|
+
`--config=${await writeInput(directory, "config.js", request.config)}`,
|
|
67
|
+
`--installation-id=${request.installationId}`,
|
|
68
|
+
];
|
|
69
|
+
if (request.features) {
|
|
70
|
+
args.push(`--features=${await writeInput(directory, "features.json", JSON.stringify(request.features))}`);
|
|
71
|
+
}
|
|
72
|
+
if (request.minify) {
|
|
73
|
+
args.push("--minify");
|
|
74
|
+
}
|
|
75
|
+
args.push(...keyValueFlags("--define", request.define));
|
|
76
|
+
return args;
|
|
77
|
+
}, request.versions);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Bundles a document handler with its config, the embedded Speed Kit config and the default `post`.
|
|
81
|
+
*
|
|
82
|
+
* @returns the code of one CommonJS module, which exports `post`
|
|
83
|
+
*/
|
|
84
|
+
async bundleDocumentHandler(request) {
|
|
85
|
+
return this.run(async (directory) => {
|
|
86
|
+
const args = ["bundle", "document-handler"];
|
|
87
|
+
if (request.documentHandler !== undefined) {
|
|
88
|
+
args.push(await writeInput(directory, "DocumentHandler.js", request.documentHandler));
|
|
89
|
+
}
|
|
90
|
+
args.push(`--document-handler-config=${await writeInput(directory, "documentHandlerConfig.js", request.documentHandlerConfig)}`, `--speed-kit-config=${await writeInput(directory, "speedKitConfig.js", request.speedKitConfig)}`, `--app-name=${request.appName}`);
|
|
91
|
+
const optional = {
|
|
92
|
+
"dynamic-fetcher": ["dynamicFetcher.js", request.dynamicFetcher],
|
|
93
|
+
"dynamic-fetcher-config": [
|
|
94
|
+
"dynamicFetcherConfig.js",
|
|
95
|
+
request.dynamicFetcherConfig,
|
|
96
|
+
],
|
|
97
|
+
"custom-style": ["customStyle.css", request.customStyle],
|
|
98
|
+
};
|
|
99
|
+
for (const [flag, [name, value]] of Object.entries(optional)) {
|
|
100
|
+
if (value) {
|
|
101
|
+
args.push(`--${flag}=${await writeInput(directory, name, value)}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return args;
|
|
105
|
+
}, request.versions);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Bundles the service worker with the embedded Speed Kit config. The config module runs before
|
|
109
|
+
* the service worker, so its plugin imports resolve to their service worker builds, and the
|
|
110
|
+
* placeholder reads the `SpeedKit.config` it wrote.
|
|
111
|
+
*
|
|
112
|
+
* @returns the bundled service worker
|
|
113
|
+
*/
|
|
114
|
+
async bundleServiceWorker(request) {
|
|
115
|
+
return this.run(async (directory) => [
|
|
116
|
+
"bundle",
|
|
117
|
+
"service-worker",
|
|
118
|
+
await writeInput(directory, "sw.js", `${request.speedKitConfig}\n${request.serviceWorker}`),
|
|
119
|
+
"--sk-config=SpeedKit.config",
|
|
120
|
+
// The Speed Kit service worker is ES6 and cannot be lowered to the es5 default.
|
|
121
|
+
"--target=es6",
|
|
122
|
+
...keyValueFlags("--define", {
|
|
123
|
+
APP: JSON.stringify(request.appName),
|
|
124
|
+
}),
|
|
125
|
+
], request.versions);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Runs packjockel in a scratch directory, which is removed afterwards.
|
|
129
|
+
*
|
|
130
|
+
* @param buildArgs writes the inputs into the directory and returns the arguments that read them
|
|
131
|
+
*/
|
|
132
|
+
async run(buildArgs, versions = {}) {
|
|
133
|
+
const directory = await mkdtemp(join(tmpdir(), "sk-packjockel-"));
|
|
134
|
+
try {
|
|
135
|
+
const output = join(directory, "out.js");
|
|
136
|
+
const args = [
|
|
137
|
+
...(await buildArgs(directory)),
|
|
138
|
+
...versionFlags(versions),
|
|
139
|
+
"--embedded",
|
|
140
|
+
`--output=${output}`,
|
|
141
|
+
];
|
|
142
|
+
await this.execute(args);
|
|
143
|
+
return await readFile(output, "utf8");
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
await rm(directory, { recursive: true, force: true });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Runs the binary without stdin: packjockel reads a piped stdin as the document handler, and only
|
|
151
|
+
* without input it bundles the published one.
|
|
152
|
+
*/
|
|
153
|
+
execute(args) {
|
|
154
|
+
let binary;
|
|
155
|
+
try {
|
|
156
|
+
binary = this.resolveBinary();
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
return Promise.reject(new PackjockelError(error.message));
|
|
160
|
+
}
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
const child = spawn(binary, args, {
|
|
163
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
164
|
+
});
|
|
165
|
+
let stderr = "";
|
|
166
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
167
|
+
child.on("error", (error) => reject(new PackjockelError(`packjockel failed: ${error.message}`)));
|
|
168
|
+
child.on("close", (code) => {
|
|
169
|
+
if (code === 0) {
|
|
170
|
+
resolve();
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
reject(new PackjockelError(`packjockel failed: ${withoutLogLines(stderr) || `exit code ${code}`}`));
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** Writes one input into the scratch directory and returns the `file://` value that reads it. */
|
|
180
|
+
async function writeInput(directory, name, content) {
|
|
181
|
+
const path = join(directory, name);
|
|
182
|
+
await writeFile(path, content);
|
|
183
|
+
return `file://${path}`;
|
|
184
|
+
}
|
|
185
|
+
/** The flags of the tags that are set. */
|
|
186
|
+
function versionFlags(versions) {
|
|
187
|
+
return Object.entries(VERSION_FLAGS)
|
|
188
|
+
.filter(([key]) => versions[key])
|
|
189
|
+
.map(([key, flag]) => `${flag}=${versions[key]}`);
|
|
190
|
+
}
|
|
191
|
+
function keyValueFlags(flag, values = {}) {
|
|
192
|
+
return Object.entries(values).map(([key, value]) => `${flag}=${key}=${value}`);
|
|
193
|
+
}
|
|
194
|
+
/** packjockel and its cache log to stderr as well; the error is in the remaining lines. */
|
|
195
|
+
function withoutLogLines(stderr = "") {
|
|
196
|
+
return stderr
|
|
197
|
+
.split("\n")
|
|
198
|
+
.filter((line) => line.trim() &&
|
|
199
|
+
!line.startsWith("time=") &&
|
|
200
|
+
!/^\d{4}\/\d{2}\/\d{2} /.test(line))
|
|
201
|
+
.join("\n");
|
|
202
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { afterEach, beforeEach, describe, it } from "mocha";
|
|
3
|
+
import { chmod, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { PackjockelService } from "../packjockel-service.js";
|
|
8
|
+
import { PackjockelError } from "../error/packjockel-error.js";
|
|
9
|
+
/**
|
|
10
|
+
* A packjockel stand-in: it records its arguments, the content of every `file://` input and a
|
|
11
|
+
* piped stdin, and writes a fixed bundle to `--output`.
|
|
12
|
+
*/
|
|
13
|
+
const FAKE_PACKJOCKEL = `#!/bin/sh
|
|
14
|
+
if [ -p /dev/stdin ] || [ -f /dev/stdin ]; then
|
|
15
|
+
echo "piped" > "$RECORD_DIR/stdin"
|
|
16
|
+
fi
|
|
17
|
+
out=""
|
|
18
|
+
for arg in "$@"; do
|
|
19
|
+
echo "$arg" >> "$RECORD_DIR/args"
|
|
20
|
+
case "$arg" in
|
|
21
|
+
--output=*) out="\${arg#--output=}" ;;
|
|
22
|
+
esac
|
|
23
|
+
path=$(echo "$arg" | sed -n 's|.*file://||p')
|
|
24
|
+
if [ -n "$path" ]; then
|
|
25
|
+
echo "$(basename "$path"): $(cat "$path")" >> "$RECORD_DIR/inputs"
|
|
26
|
+
fi
|
|
27
|
+
done
|
|
28
|
+
if [ -n "$FAIL" ]; then
|
|
29
|
+
echo "time=\\"2026\\" level=info msg=starting" >&2
|
|
30
|
+
echo "invalid bundle: could not resolve x" >&2
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
echo "bundled" > "$out"
|
|
34
|
+
`;
|
|
35
|
+
describe("PackjockelService", () => {
|
|
36
|
+
let directory;
|
|
37
|
+
let service;
|
|
38
|
+
beforeEach(async () => {
|
|
39
|
+
directory = await mkdtemp(join(tmpdir(), "packjockel-spec-"));
|
|
40
|
+
const binary = join(directory, "packjockel");
|
|
41
|
+
await writeFile(binary, FAKE_PACKJOCKEL);
|
|
42
|
+
await chmod(binary, 0o755);
|
|
43
|
+
process.env.RECORD_DIR = directory;
|
|
44
|
+
service = new PackjockelService(() => binary);
|
|
45
|
+
});
|
|
46
|
+
afterEach(async () => {
|
|
47
|
+
delete process.env.RECORD_DIR;
|
|
48
|
+
delete process.env.FAIL;
|
|
49
|
+
await rm(directory, { recursive: true, force: true });
|
|
50
|
+
});
|
|
51
|
+
async function recorded() {
|
|
52
|
+
const args = (await readFile(join(directory, "args"), "utf8"))
|
|
53
|
+
.trim()
|
|
54
|
+
.split("\n");
|
|
55
|
+
const inputs = (await readFile(join(directory, "inputs"), "utf8"))
|
|
56
|
+
.trim()
|
|
57
|
+
.split("\n");
|
|
58
|
+
return { args, inputs };
|
|
59
|
+
}
|
|
60
|
+
it("should bundle the entry points in their order", async () => {
|
|
61
|
+
const bundle = await service.bundle({
|
|
62
|
+
entryPoints: { "rum.js": "rum()", "config.js": "SpeedKit.config = {}" },
|
|
63
|
+
versions: { configPluginsVersion: "@release", rumPluginsVersion: "" },
|
|
64
|
+
define: { APP: '"shop"' },
|
|
65
|
+
platform: "browser",
|
|
66
|
+
});
|
|
67
|
+
const { args, inputs } = await recorded();
|
|
68
|
+
expect(bundle.trim()).to.equal("bundled");
|
|
69
|
+
expect(args.slice(0, 5)).to.deep.equal([
|
|
70
|
+
"bundle",
|
|
71
|
+
"--bundle",
|
|
72
|
+
"--platform=browser",
|
|
73
|
+
"--target=es5",
|
|
74
|
+
'--define=APP="shop"',
|
|
75
|
+
]);
|
|
76
|
+
expect(args).to.include("--config-plugins-version=@release");
|
|
77
|
+
expect(args.filter((arg) => arg.endsWith("-version=")), "a tag that is not set is left to packjockel").to.deep.equal([]);
|
|
78
|
+
expect(args).to.include("--embedded");
|
|
79
|
+
expect(inputs).to.deep.equal([
|
|
80
|
+
"rum.js: rum()",
|
|
81
|
+
"config.js: SpeedKit.config = {}",
|
|
82
|
+
]);
|
|
83
|
+
});
|
|
84
|
+
it("should bundle the install script with its loader, plugins and config", async () => {
|
|
85
|
+
const bundle = await service.bundleInstallScript({
|
|
86
|
+
plugins: "rum()",
|
|
87
|
+
config: "SpeedKit.config = {}",
|
|
88
|
+
loader: "load()",
|
|
89
|
+
installationId: "onboarding",
|
|
90
|
+
features: { executeInIframe: true },
|
|
91
|
+
versions: { speedKitVersion: "2.22.4" },
|
|
92
|
+
define: { APP: '"shop"' },
|
|
93
|
+
});
|
|
94
|
+
const { args, inputs } = await recorded();
|
|
95
|
+
expect(bundle.trim()).to.equal("bundled");
|
|
96
|
+
expect(args.slice(0, 2)).to.deep.equal(["bundle", "install-script"]);
|
|
97
|
+
expect(args).to.include("--installation-id=onboarding");
|
|
98
|
+
expect(args.some((arg) => arg.startsWith("--target")), "packjockel builds the install script for one browser gate").to.equal(false);
|
|
99
|
+
expect(args).to.include('--define=APP="shop"');
|
|
100
|
+
expect(args).to.include("--speed-kit-version=2.22.4");
|
|
101
|
+
expect(args).to.include("--embedded");
|
|
102
|
+
expect(inputs).to.deep.equal([
|
|
103
|
+
"loader.js: load()",
|
|
104
|
+
"plugins.js: rum()",
|
|
105
|
+
"config.js: SpeedKit.config = {}",
|
|
106
|
+
'features.json: {"executeInIframe":true}',
|
|
107
|
+
]);
|
|
108
|
+
});
|
|
109
|
+
it("should bundle a document handler with every input it got", async () => {
|
|
110
|
+
await service.bundleDocumentHandler({
|
|
111
|
+
documentHandler: "var DocumentHandler = 1",
|
|
112
|
+
documentHandlerConfig: "export default new DocumentHandler()",
|
|
113
|
+
speedKitConfig: "SpeedKit.config = {}",
|
|
114
|
+
appName: "shop",
|
|
115
|
+
dynamicFetcherConfig: "window.dynamicBlockConfig = {}",
|
|
116
|
+
});
|
|
117
|
+
const { args, inputs } = await recorded();
|
|
118
|
+
expect(args.slice(0, 2)).to.deep.equal(["bundle", "document-handler"]);
|
|
119
|
+
expect(args).to.include("--app-name=shop");
|
|
120
|
+
expect(args.some((arg) => arg.startsWith("--dynamic-fetcher="))).to.equal(false);
|
|
121
|
+
expect(inputs).to.deep.equal([
|
|
122
|
+
"DocumentHandler.js: var DocumentHandler = 1",
|
|
123
|
+
"documentHandlerConfig.js: export default new DocumentHandler()",
|
|
124
|
+
"speedKitConfig.js: SpeedKit.config = {}",
|
|
125
|
+
"dynamicFetcherConfig.js: window.dynamicBlockConfig = {}",
|
|
126
|
+
]);
|
|
127
|
+
});
|
|
128
|
+
it("should bundle the service worker after the Speed Kit config", async () => {
|
|
129
|
+
await service.bundleServiceWorker({
|
|
130
|
+
serviceWorker: "const config = INSERT_CONFIG_HERE;",
|
|
131
|
+
speedKitConfig: "SpeedKit.config = {}",
|
|
132
|
+
appName: "shop",
|
|
133
|
+
versions: { configPluginsVersion: "@release" },
|
|
134
|
+
});
|
|
135
|
+
const { args, inputs } = await recorded();
|
|
136
|
+
expect(args.slice(0, 2)).to.deep.equal(["bundle", "service-worker"]);
|
|
137
|
+
expect(args).to.include("--sk-config=SpeedKit.config");
|
|
138
|
+
expect(args).to.include("--target=es6");
|
|
139
|
+
expect(args).to.include('--define=APP="shop"');
|
|
140
|
+
expect(args).to.include("--config-plugins-version=@release");
|
|
141
|
+
expect(inputs).to.deep.equal([
|
|
142
|
+
"sw.js: SpeedKit.config = {}",
|
|
143
|
+
"const config = INSERT_CONFIG_HERE;",
|
|
144
|
+
]);
|
|
145
|
+
});
|
|
146
|
+
it("should leave the document handler to packjockel without one", async () => {
|
|
147
|
+
await service.bundleDocumentHandler({
|
|
148
|
+
documentHandlerConfig: "export default new DomDocumentHandler()",
|
|
149
|
+
speedKitConfig: "SpeedKit.config = {}",
|
|
150
|
+
appName: "shop",
|
|
151
|
+
versions: {
|
|
152
|
+
documentHandlerVersion: "1.8.0",
|
|
153
|
+
speedKitVersion: "2.22.4",
|
|
154
|
+
rumPluginsVersion: "@release",
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
const { args, inputs } = await recorded();
|
|
158
|
+
expect(args.slice(0, 2)).to.deep.equal(["bundle", "document-handler"]);
|
|
159
|
+
expect(args[2], "no handler argument").to.match(/^--document-handler-config=/);
|
|
160
|
+
expect(args).to.include("--document-handler-version=1.8.0");
|
|
161
|
+
expect(args).to.include("--speed-kit-version=2.22.4");
|
|
162
|
+
expect(args).to.include("--rum-plugin-version=@release");
|
|
163
|
+
expect(existsSync(join(directory, "stdin")), "packjockel reads a piped stdin as the handler").to.equal(false);
|
|
164
|
+
expect(inputs).to.deep.equal([
|
|
165
|
+
"documentHandlerConfig.js: export default new DomDocumentHandler()",
|
|
166
|
+
"speedKitConfig.js: SpeedKit.config = {}",
|
|
167
|
+
]);
|
|
168
|
+
});
|
|
169
|
+
it("should report the error of packjockel without its log lines", async () => {
|
|
170
|
+
process.env.FAIL = "1";
|
|
171
|
+
const failure = await service
|
|
172
|
+
.bundle({ entryPoints: { "config.js": "x" } })
|
|
173
|
+
.catch((error) => error);
|
|
174
|
+
expect(failure).to.be.instanceOf(PackjockelError);
|
|
175
|
+
expect(failure.message).to.equal("packjockel failed: invalid bundle: could not resolve x");
|
|
176
|
+
});
|
|
177
|
+
it("should report a platform without a packjockel package", async () => {
|
|
178
|
+
const failure = await new PackjockelService(() => {
|
|
179
|
+
throw new Error("packjockel: @speedkit/packjockel-aix-ppc64 is not installed.");
|
|
180
|
+
})
|
|
181
|
+
.bundle({ entryPoints: { "config.js": "x" } })
|
|
182
|
+
.catch((error) => error);
|
|
183
|
+
expect(failure).to.be.instanceOf(PackjockelError);
|
|
184
|
+
expect(failure.message).to.contain("is not installed");
|
|
185
|
+
});
|
|
186
|
+
});
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { Config } from "@oclif/core";
|
|
2
2
|
import { CliEnvironment } from "./cli-environment.js";
|
|
3
|
-
import type { CliSink } from "./sink.js";
|
|
4
3
|
export interface CliEnvironmentOptions {
|
|
5
4
|
/** The customer the command works on, for its documentHandler's node modules. */
|
|
6
5
|
readonly customerPath?: string;
|
|
7
6
|
/** Keep the CLI to what `--quiet` allows: no spinners, default answers. */
|
|
8
7
|
readonly quiet?: boolean;
|
|
9
|
-
/** Where the CLI's output goes. Defaults to the terminal. */
|
|
10
|
-
readonly sink?: CliSink;
|
|
11
8
|
}
|
|
12
9
|
/**
|
|
13
10
|
* Builds the environment of one invocation, with its one CLI.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { CommandContextValues } from "./command-build-context.js";
|
|
2
|
-
import type { CliSink } from "./sink.js";
|
|
3
2
|
export interface CliServiceBuildContextValues extends CommandContextValues {
|
|
4
3
|
/** Keep to what `--quiet` allows: no spinners, default answers. */
|
|
5
4
|
readonly quiet: boolean;
|
|
6
|
-
/** Where output goes. Defaults to the terminal. */
|
|
7
|
-
readonly sink?: CliSink;
|
|
8
5
|
}
|
|
9
6
|
declare const CliServiceBuildContext_base: new (values: CliServiceBuildContextValues) => Readonly<CliServiceBuildContextValues>;
|
|
10
7
|
/** What the invocation's one CLI is built from. */
|
|
@@ -15,6 +15,6 @@ export class CliServiceFactory {
|
|
|
15
15
|
this.context = context;
|
|
16
16
|
}
|
|
17
17
|
getService() {
|
|
18
|
-
return new CliService(new ClipboardService(), this.context.environment, this.context.quiet
|
|
18
|
+
return new CliService(new ClipboardService(), this.context.environment, this.context.quiet);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Options } from "cli-progress";
|
|
2
2
|
import { ExecSyncOptions } from "node:child_process";
|
|
3
3
|
import { ChalkInstance } from "chalk";
|
|
4
|
-
import { LogLevel, LogMeta, RunLogInterface } from "../run-log/index.js";
|
|
5
4
|
export declare enum CliActionStatus {
|
|
6
5
|
COMPLETED = "completed",
|
|
7
6
|
FAILED = "failed",
|
|
@@ -26,30 +25,14 @@ export interface CliServiceInterface {
|
|
|
26
25
|
readonly quiet: boolean;
|
|
27
26
|
/** True when this shell cannot be prompted (CI, no TTY, SK_NON_INTERACTIVE). */
|
|
28
27
|
readonly nonInteractive: boolean;
|
|
29
|
-
|
|
30
|
-
* Also record everything from here on into a run's log.
|
|
31
|
-
*
|
|
32
|
-
* Attached rather than constructed with, because the two have different
|
|
33
|
-
* lifetimes: the service exists from the first line of the command, and the
|
|
34
|
-
* run directory does not exist until the command has decided there is going
|
|
35
|
-
* to be a run — `sk onboarding` asks about colliding runs first, and a
|
|
36
|
-
* declined start must leave nothing behind on disk.
|
|
37
|
-
*/
|
|
38
|
-
attachLog(log: RunLogInterface): void;
|
|
39
|
-
/**
|
|
40
|
-
* Record a line into the run's log only, never on the terminal: what is
|
|
41
|
-
* too much to print, such as the page's console.
|
|
42
|
-
*/
|
|
43
|
-
logOnly(level: LogLevel, message: string, meta?: LogMeta): void;
|
|
44
|
-
code(code: string, buffered?: boolean, meta?: LogMeta): void;
|
|
28
|
+
code(code: string, buffered?: boolean): void;
|
|
45
29
|
codeStyle(code: string): string;
|
|
46
|
-
comment(message: string, buffered?: boolean
|
|
30
|
+
comment(message: string, buffered?: boolean): void;
|
|
47
31
|
confirm(message: string, defaultAnswer?: boolean): Promise<boolean>;
|
|
48
32
|
exit(code?: number): void;
|
|
49
33
|
prompt(message: string, options?: {
|
|
50
34
|
defaultAnswer?: any;
|
|
51
35
|
validator?: any;
|
|
52
|
-
sensitive?: boolean;
|
|
53
36
|
}): Promise<string>;
|
|
54
37
|
select(message: string, choices: any, defaultValue?: string): Promise<string>;
|
|
55
38
|
multiSelect<T>(message: string, choices: {
|
|
@@ -66,21 +49,19 @@ export interface CliServiceInterface {
|
|
|
66
49
|
pipe(data: string): void;
|
|
67
50
|
/** A human-facing line that must stay out of the data channel. */
|
|
68
51
|
note(message: string): void;
|
|
69
|
-
/** Put the terminal back — shows the cursor a spinner hid. */
|
|
70
|
-
restoreTerminal(): void;
|
|
71
52
|
spacer(): void;
|
|
72
|
-
startAction(name: string, message: string
|
|
73
|
-
endAction(name: string, message?: string
|
|
74
|
-
successAction(name: string, message?: string
|
|
75
|
-
failAction(name: string, message?: string
|
|
53
|
+
startAction(name: string, message: string): void;
|
|
54
|
+
endAction(name: string, message?: string): void;
|
|
55
|
+
successAction(name: string, message?: string): void;
|
|
56
|
+
failAction(name: string, message?: string): void;
|
|
76
57
|
startProgress(total: number, start?: number, payload?: object, config?: Options): void;
|
|
77
58
|
stopProgress(): void;
|
|
78
59
|
table<T extends Record<string, unknown>>(data: T[], columns: CliTableColumns<T>, options?: CliTableOptions): void;
|
|
79
60
|
updateProgress(current: number, payload?: object): void;
|
|
80
|
-
write(message: string, buffered?: boolean
|
|
61
|
+
write(message: string, buffered?: boolean): void;
|
|
81
62
|
writeBuffer(): void;
|
|
82
|
-
writeError(message: string, buffered?: boolean
|
|
83
|
-
writeSuccess(message: string, buffered?: boolean
|
|
84
|
-
writeWarning(message: string, buffered?: boolean
|
|
63
|
+
writeError(message: string, buffered?: boolean): void;
|
|
64
|
+
writeSuccess(message: string, buffered?: boolean): void;
|
|
65
|
+
writeWarning(message: string, buffered?: boolean): void;
|
|
85
66
|
execSync(command: string, options?: ExecSyncOptions): string;
|
|
86
67
|
}
|