@speedkit/cli 4.44.0-beta.4 → 4.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -11
- package/README.md +77 -47
- package/dist/base/sk-command.d.ts +7 -0
- package/dist/base/sk-command.js +19 -0
- package/dist/commands/deploy.d.ts +1 -0
- package/dist/commands/deploy.js +5 -1
- package/dist/commands/diff.d.ts +47 -0
- package/dist/commands/diff.js +67 -0
- package/dist/commands/generate-pop-config.js +3 -7
- package/dist/commands/origin-request.d.ts +2 -1
- package/dist/commands/origin-request.js +1 -0
- package/dist/helpers/race.js +4 -2
- package/dist/helpers/spec/race.spec.js +31 -0
- package/dist/models/files.d.ts +0 -1
- package/dist/models/files.js +0 -1
- package/dist/services/browser-fetch/browser-origin-fetch.js +1 -1
- package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +1 -7
- package/dist/services/browser-fetch/browser-origin-fetcher.js +3 -26
- package/dist/services/bundler/bundle-service-factory.d.ts +0 -3
- package/dist/services/bundler/bundle-service-factory.js +1 -5
- package/dist/services/bundler/bundle-service.d.ts +1 -10
- package/dist/services/bundler/bundle-service.js +1 -16
- package/dist/services/bundler/index.d.ts +0 -1
- package/dist/services/bundler/index.js +0 -1
- package/dist/services/cli/cli-environment.d.ts +11 -0
- package/dist/services/cli/cli-environment.js +37 -0
- package/dist/services/cli/cli-service-model.d.ts +3 -1
- package/dist/services/cli/cli-service.d.ts +1 -1
- package/dist/services/cli/cli-service.js +4 -1
- package/dist/services/cli/spec/cli-environment.spec.js +30 -1
- package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
- package/dist/services/deploy/checks/post-deploy/refresh-deployment-job-check.d.ts +2 -2
- package/dist/services/deploy/checks/post-deploy/refresh-deployment-job-check.js +8 -7
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +2 -2
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +11 -7
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +2 -2
- package/dist/services/deploy/checks/post-deploy/save-files-check.js +3 -2
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +3 -2
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +3 -2
- package/dist/services/deploy/deploy-service-build-context.d.ts +2 -0
- package/dist/services/deploy/deploy-service-build-context.js +13 -2
- package/dist/services/deploy/deploy-service-factory.js +2 -9
- package/dist/services/deploy/deploy-service-model.d.ts +11 -1
- package/dist/services/deploy/deploy-service.d.ts +2 -0
- package/dist/services/deploy/deploy-service.js +26 -1
- package/dist/services/deploy/handler/customer-config-handler.d.ts +2 -2
- package/dist/services/deploy/handler/install-resource-handler.d.ts +2 -2
- package/dist/services/deploy/handler/install-resource-handler.js +6 -3
- package/dist/services/deploy/handler/module-handler.d.ts +2 -2
- package/dist/services/deploy/handler/module-handler.js +2 -2
- package/dist/services/deploy/handler/server-config-handler.d.ts +2 -2
- package/dist/services/deploy/handler/server-config-handler.js +2 -2
- package/dist/services/deploy/mr/live-state-check.d.ts +2 -2
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +2 -7
- package/dist/services/deploy/policy/deploy-policy-model.d.ts +1 -5
- package/dist/services/deploy/policy/deploy-policy-model.js +0 -4
- package/dist/services/deploy/policy/index.d.ts +1 -0
- package/dist/services/deploy/policy/index.js +1 -0
- package/dist/services/deploy/policy/testing-deploy-policy.d.ts +16 -0
- package/dist/services/deploy/policy/testing-deploy-policy.js +42 -0
- package/dist/services/deploy/spec/checks/post-deploy/refresh-deployment-job-check.spec.js +5 -12
- package/dist/services/deploy/spec/deploy-service.spec.js +64 -0
- package/dist/services/deploy/spec/handler/install-resource-handler.spec.js +58 -0
- package/dist/services/deploy/spec/mr/live-state-check.spec.js +2 -2
- package/dist/services/deploy/spec/policy/auto-deploy-policy.spec.js +0 -2
- package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.d.ts +1 -0
- package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.js +46 -0
- package/dist/services/diff/create-diff-engine.d.ts +14 -0
- package/dist/services/diff/create-diff-engine.js +42 -0
- package/dist/services/diff/customer-origin.d.ts +9 -0
- package/dist/services/diff/customer-origin.js +19 -0
- package/dist/services/diff/diff-engine.d.ts +30 -0
- package/dist/services/diff/diff-engine.js +49 -0
- package/dist/services/diff/diff-log.d.ts +9 -0
- package/dist/services/diff/diff-log.js +18 -0
- package/dist/services/diff/diff-model.d.ts +68 -0
- package/dist/services/diff/diff-model.js +1 -0
- package/dist/services/diff/diff-service-build-context.d.ts +99 -9
- package/dist/services/diff/diff-service-build-context.js +299 -1
- package/dist/services/diff/diff-service-factory.d.ts +24 -2
- package/dist/services/diff/diff-service-factory.js +165 -3
- package/dist/services/diff/diff-service.d.ts +93 -33
- package/dist/services/diff/diff-service.js +274 -140
- package/dist/services/diff/index.d.ts +12 -1
- package/dist/services/diff/index.js +12 -1
- package/dist/services/diff/noise-baseline.d.ts +28 -0
- package/dist/services/diff/noise-baseline.js +105 -0
- package/dist/services/diff/page-source.d.ts +42 -0
- package/dist/services/diff/page-source.js +93 -0
- package/dist/services/diff/side-failure.d.ts +28 -0
- package/dist/services/diff/side-failure.js +100 -0
- package/dist/services/diff/sinks/json-diff-sink.d.ts +32 -0
- package/dist/services/diff/sinks/json-diff-sink.js +44 -0
- package/dist/services/diff/sinks/no-diff-sink.d.ts +5 -0
- package/dist/services/diff/sinks/no-diff-sink.js +6 -0
- package/dist/services/diff/sinks/patch-diff-sink.d.ts +19 -0
- package/dist/services/diff/sinks/patch-diff-sink.js +29 -0
- package/dist/services/diff/sinks/tool-diff-sink.d.ts +26 -0
- package/dist/services/diff/sinks/tool-diff-sink.js +88 -0
- package/dist/services/diff/sinks/unified-patch.d.ts +7 -0
- package/dist/services/diff/sinks/unified-patch.js +12 -0
- package/dist/services/diff/spec/customer-origin.spec.d.ts +1 -0
- package/dist/services/diff/spec/customer-origin.spec.js +27 -0
- package/dist/services/diff/spec/diff-engine.spec.d.ts +1 -0
- package/dist/services/diff/spec/diff-engine.spec.js +47 -0
- package/dist/services/diff/spec/diff-service-build-context.spec.d.ts +1 -0
- package/dist/services/diff/spec/diff-service-build-context.spec.js +185 -0
- package/dist/services/diff/spec/diff-service.spec.d.ts +1 -0
- package/dist/services/diff/spec/diff-service.spec.js +393 -0
- package/dist/services/diff/spec/noise-baseline.spec.d.ts +1 -0
- package/dist/services/diff/spec/noise-baseline.spec.js +95 -0
- package/dist/services/diff/spec/page-source.spec.d.ts +1 -0
- package/dist/services/diff/spec/page-source.spec.js +140 -0
- package/dist/services/diff/spec/sinks/json-diff-sink.spec.d.ts +1 -0
- package/dist/services/diff/spec/sinks/json-diff-sink.spec.js +72 -0
- package/dist/services/diff/spec/sinks/patch-diff-sink.spec.d.ts +1 -0
- package/dist/services/diff/spec/sinks/patch-diff-sink.spec.js +47 -0
- package/dist/services/diff/spec/sinks/tool-diff-sink.spec.d.ts +1 -0
- package/dist/services/diff/spec/sinks/tool-diff-sink.spec.js +61 -0
- package/dist/services/document-handler-runtime/document-handler-abort.d.ts +2 -0
- package/dist/services/document-handler-runtime/document-handler-abort.js +2 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +0 -17
- package/dist/services/document-handler-runtime/document-handler-server.js +19 -81
- package/dist/services/document-handler-runtime/runtime-files.d.ts +9 -0
- package/dist/services/document-handler-runtime/runtime-files.js +17 -0
- package/dist/services/integration-api/integration-api-model.d.ts +1 -2
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +8 -68
- package/dist/services/integration-api/struct/customer-config.d.ts +1 -32
- package/dist/services/integration-api/struct/customer-config.js +3 -33
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +4 -9
- package/dist/services/integration-api/struct/speed-kit-config-file.js +10 -27
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +8 -25
- package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +29 -7
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +24 -37
- package/dist/services/onboarding/dashboard/index.js +13 -6
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +21 -8
- package/dist/services/onboarding/dashboard/request-diff-service.js +21 -49
- package/dist/services/onboarding/onboarding-model.d.ts +0 -1
- package/dist/services/onboarding/onboarding-model.js +0 -1
- package/dist/services/onboarding/onboarding-service-factory.d.ts +0 -1
- package/dist/services/onboarding/onboarding-service-factory.js +24 -30
- package/dist/services/onboarding/spec/dashboard/request-diff-service.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/dashboard/request-diff-service.spec.js +57 -0
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +0 -5
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +3 -3
- package/dist/services/onboarding/virtual-orestes-app/index.js +5 -5
- package/dist/services/origin-request/index.d.ts +3 -0
- package/dist/services/origin-request/index.js +3 -0
- package/dist/services/origin-request/origin-fetcher.d.ts +52 -0
- package/dist/services/origin-request/origin-fetcher.js +93 -0
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +6 -3
- package/dist/services/origin-request/origin-request-service-build-context.js +30 -4
- package/dist/services/origin-request/origin-request-service-factory.d.ts +5 -0
- package/dist/services/origin-request/origin-request-service-factory.js +40 -6
- package/dist/services/origin-request/origin-request-service.d.ts +6 -10
- package/dist/services/origin-request/origin-request-service.js +28 -70
- package/dist/services/origin-request/runtime-config-source.d.ts +36 -0
- package/dist/services/origin-request/runtime-config-source.js +59 -0
- package/dist/services/origin-request/spec/origin-error-cause.spec.d.ts +1 -0
- package/dist/services/{onboarding/spec/virtual-orestes-app → origin-request/spec}/origin-error-cause.spec.js +1 -1
- package/dist/services/origin-request/spec/origin-fetcher.spec.d.ts +1 -0
- package/dist/services/{onboarding/spec/virtual-orestes-app/crawler.spec.js → origin-request/spec/origin-fetcher.spec.js} +46 -15
- package/dist/services/origin-request/spec/origin-request-service-build-context.spec.d.ts +1 -0
- package/dist/services/origin-request/spec/origin-request-service-build-context.spec.js +32 -0
- package/dist/services/prewarm/assets/asset-api-client.d.ts +6 -0
- package/dist/services/prewarm/assets/asset-api-client.js +6 -1
- package/dist/services/prewarm/pre-warm-service.d.ts +10 -0
- package/dist/services/prewarm/pre-warm-service.js +17 -0
- package/dist/services/prewarm/spec/pre-warm-service.spec.d.ts +1 -0
- package/dist/services/prewarm/spec/pre-warm-service.spec.js +72 -0
- package/dist/services/query-builder/query-builder-factory.js +3 -3
- package/dist/services/setup/os/tool-registry.d.ts +1 -1
- package/oclif.manifest.json +162 -23
- package/package.json +1 -2
- package/dist/commands/diff-url-parameters.d.ts +0 -19
- package/dist/commands/diff-url-parameters.js +0 -121
- package/dist/services/bundler/error/packjockel-error.d.ts +0 -3
- package/dist/services/bundler/error/packjockel-error.js +0 -3
- package/dist/services/bundler/packjockel-service.d.ts +0 -72
- package/dist/services/bundler/packjockel-service.js +0 -156
- package/dist/services/bundler/spec/packjockel-service.spec.js +0 -143
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +0 -15
- package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.js +0 -70
- package/dist/services/deploy/error/check-module-file-error.d.ts +0 -4
- package/dist/services/deploy/error/check-module-file-error.js +0 -4
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.d.ts +0 -4
- package/dist/services/deploy/error/post-deploy-deployment-detection-error.js +0 -4
- package/dist/services/onboarding/server-config/index.d.ts +0 -10
- package/dist/services/onboarding/server-config/index.js +0 -27
- package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +0 -31
- package/dist/services/onboarding/virtual-orestes-app/crawler.js +0 -98
- /package/dist/{services/bundler/spec/packjockel-service.spec.d.ts → helpers/spec/race.spec.d.ts} +0 -0
- /package/dist/services/{onboarding/spec/virtual-orestes-app/crawler.spec.d.ts → deploy/spec/deploy-service.spec.d.ts} +0 -0
- /package/dist/services/{onboarding/spec/virtual-orestes-app/origin-error-cause.spec.d.ts → deploy/spec/handler/install-resource-handler.spec.d.ts} +0 -0
- /package/dist/services/{onboarding/virtual-orestes-app → origin-request}/origin-error-cause.d.ts +0 -0
- /package/dist/services/{onboarding/virtual-orestes-app → origin-request}/origin-error-cause.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,31 +1,60 @@
|
|
|
1
|
-
# [4.
|
|
1
|
+
# [4.45.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.44.1...v4.45.0) (2026-10-15)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
* **
|
|
7
|
-
* **onboarding:** set the app on SpeedKit.config like the install script of the server ([89e6073](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/89e6073933a1ff081a8918eec75d8c7f8c512e26))
|
|
6
|
+
* **origin-request:** a raw mode without a customer ([9acce74](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/9acce74f54622caff99a422d89b362f574ec440b))
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
## [4.44.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.44.0...v4.44.1) (2026-10-15)
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
###
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* close open http2-connections after the job is done ([3ddd8ca](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/3ddd8ca94fad0a59e172b97beb699dbf829478e2))
|
|
14
|
+
* **deploy:** compile the testing specs against the merged main ([2434cb4](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/2434cb4ae972ef90cb1466bb63436259763013ae))
|
|
15
|
+
* **deploy:** count the 14 deploy questions main has now ([02c4d10](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/02c4d10f539729deb952edce038f63bcd8a053e9))
|
|
16
|
+
* race keeps node open ([2fbd950](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/2fbd950f2dbb77551f31455b7a313ffa2b378567))
|
|
17
|
+
|
|
18
|
+
# [4.44.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.43.1...v4.44.0) (2026-10-14)
|
|
13
19
|
|
|
14
|
-
* **integration-api:** name the feature flag enableSpeedKitConfigPlugins like the server ([23f5ffb](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/23f5ffb307aa1743f8434c7ad136a2bf251363e0))
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **cli:** flush stdout before oclif exits with a code ([8637ab0](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/8637ab0f9c8d9845b624488018b34b3d96807327))
|
|
24
|
+
* **diff:** a bare --param or --variations asks instead of failing ([19109b7](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/19109b770a35e71369fad448490b3b2419d71c3b))
|
|
25
|
+
* **diff:** an empty --param takes a url's only parameter without asking ([a17ccfc](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/a17ccfc88ef5a55b6f0e9ada2d460e2a75855176))
|
|
26
|
+
* **diff:** recognise a random hex id as noise ([9b45891](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/9b458917a69d20763a8f08c5a5c08304665eeb7e))
|
|
27
|
+
* **diff:** remove a --param's comma-separated parameters together ([639ec74](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/639ec740625769c1c59f536ea9815d7bd4c3893b))
|
|
28
|
+
* **diff:** remove every parameter --param names together ([1695ac3](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/1695ac3f851b008a1c73670a2ddaa2d5195cbfd3))
|
|
29
|
+
* **diff:** state whether a parameter's difference is the one removing all of them makes ([ddd839b](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/ddd839b77fce5a9d9c6e38596a2b3eeaff0cbea2))
|
|
30
|
+
* request and diff a page the same way in every tool ([28f944b](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/28f944bf18f51fbdffb8b91a6802f4d44a5477e5))
|
|
17
31
|
|
|
18
32
|
|
|
19
33
|
### Features
|
|
20
34
|
|
|
21
|
-
* **
|
|
35
|
+
* **deploy:** add --testing, a testing installation from a branch ([998d985](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/998d985d2f105e86a537a423c1a8378cb50b85b2))
|
|
36
|
+
* **diff:** --variations names one variation against desktop, or two against each other ([d5e4c46](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/d5e4c461113aa95b6517bb501322e4a81667de3b))
|
|
37
|
+
* **diff:** an empty --param asks which parameters to check ([e3b2d81](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/e3b2d81011292f44927720342eea2d98254cd394))
|
|
38
|
+
* **diff:** an empty --variation asks, and the variations prompt takes one ([fa53647](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/fa5364765538013d98911b8a5bb0f35d2389a743))
|
|
39
|
+
* **diff:** an empty --variations asks which two variations to compare ([90271a0](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/90271a023d46c5419b8394ec586b2a6382fae333))
|
|
40
|
+
* **diff:** check only the parameters --param names ([14bfcd6](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/14bfcd6b2a4e1c866332767f9f51ce9fb8334e76))
|
|
41
|
+
* **diff:** classify a failed side the way onboarding does ([4e1ce76](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/4e1ce76cad09d0dc61ed1efd0368979e810d9dd8))
|
|
42
|
+
* **diff:** compare a page against another page with --against ([4441930](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/4441930a0aaa68cc5a9a26811b03cc1b286d02dd))
|
|
43
|
+
* **diff:** diff a page across variations with --variations and --baseline ([38aa8ea](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/38aa8ea8a6fb8116efe0dc3e097e755f994574bc))
|
|
44
|
+
* **diff:** diff a page without a customer with sk diff --raw <pageUrl> ([f8e7c6c](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/f8e7c6c64cb9e0a1b02b563430575a43233fdd15))
|
|
45
|
+
* **diff:** exit with 2 when the pages could not be compared ([9757465](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/97574652e0ddce28815cc2ff827ccb9195edb43e))
|
|
46
|
+
* **diff:** fetch through a headless Chrome with --browserFetch, for a page of the customer ([6583255](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/658325584e495620cbbd20b008849658fe943a97))
|
|
47
|
+
* **diff:** ignore a page's own noise with --baseline ([6075e4d](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/6075e4d3786549bf0fc90b68d3a34d5b394f1866))
|
|
48
|
+
* **diff:** print a diff as a unified patch or JSON ([bd275a3](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/bd275a37ffc13d0f9dbe4e7eccbd038b84267f6d))
|
|
49
|
+
* **diff:** sk diff renders a page as Speed Kit serves it and diffs it without its parameters ([cbcebd7](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/cbcebd754ec69ad5f8a4e49be6bdf7024fc337c4))
|
|
50
|
+
* **onboarding:** let a dashboard diff request ask for the noise baseline ([0bdac45](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/0bdac45890f5535339bdc19d0a9c71d3edde2e88))
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
## [4.43.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.43.0...v4.43.1) (2026-10-14)
|
|
24
53
|
|
|
25
54
|
|
|
26
|
-
###
|
|
55
|
+
### Bug Fixes
|
|
27
56
|
|
|
28
|
-
*
|
|
57
|
+
* **deploy:** post deploy checks don't throw errors ([887747b](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/887747be797ec13afa691a80cd312782bbcabdd1))
|
|
29
58
|
|
|
30
59
|
# [4.43.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.42.0...v4.43.0) (2026-10-09)
|
|
31
60
|
|
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ By either...
|
|
|
77
77
|
* [`sk config edit`](#sk-config-edit)
|
|
78
78
|
* [`sk config setup`](#sk-config-setup)
|
|
79
79
|
* [`sk deploy CUSTOMERPATH`](#sk-deploy-customerpath)
|
|
80
|
-
* [`sk diff
|
|
80
|
+
* [`sk diff [CUSTOMERPATH] [PAGEURL]`](#sk-diff-customerpath-pageurl)
|
|
81
81
|
* [`sk extension add [REF]`](#sk-extension-add-ref)
|
|
82
82
|
* [`sk extension devtools`](#sk-extension-devtools)
|
|
83
83
|
* [`sk extension list`](#sk-extension-list)
|
|
@@ -89,8 +89,7 @@ By either...
|
|
|
89
89
|
* [`sk help [COMMAND]`](#sk-help-command)
|
|
90
90
|
* [`sk login [APP]`](#sk-login-app)
|
|
91
91
|
* [`sk onboarding [CUSTOMERPATH]`](#sk-onboarding-customerpath)
|
|
92
|
-
* [`sk origin-request CUSTOMERPATH PAGEURL`](#sk-origin-request-customerpath-pageurl)
|
|
93
|
-
* [`sk param-diff PAGEURL`](#sk-param-diff-pageurl)
|
|
92
|
+
* [`sk origin-request [CUSTOMERPATH] [PAGEURL]`](#sk-origin-request-customerpath-pageurl)
|
|
94
93
|
* [`sk prewarm APP PATH`](#sk-prewarm-app-path)
|
|
95
94
|
* [`sk pull CUSTOMERPATH`](#sk-pull-customerpath)
|
|
96
95
|
* [`sk query parameter CUSTOMERPATH`](#sk-query-parameter-customerpath)
|
|
@@ -438,8 +437,8 @@ Deploys the specified customer config while comparing to the live version before
|
|
|
438
437
|
|
|
439
438
|
```
|
|
440
439
|
USAGE
|
|
441
|
-
$ sk deploy CUSTOMERPATH [-c <value>] [-t] [-
|
|
442
|
-
[--approval approved|testing|skip ]
|
|
440
|
+
$ sk deploy CUSTOMERPATH [-c <value>] [-t] [-v] [-a <value>] [--testing | --mr <value> | -d]
|
|
441
|
+
[--description <value>] [--approval approved|testing|skip ]
|
|
443
442
|
|
|
444
443
|
ARGUMENTS
|
|
445
444
|
CUSTOMERPATH The customer config path
|
|
@@ -452,8 +451,11 @@ FLAGS
|
|
|
452
451
|
-v, --verboseLevel Show all messages
|
|
453
452
|
--approval=<option> what to do with a customer that approves every rollout themselves
|
|
454
453
|
<options: approved|testing|skip>
|
|
455
|
-
--description=<value> the description every installation of the run gets
|
|
454
|
+
--description=<value> the description every installation of the run gets. With --mr it is asked while it is left
|
|
455
|
+
out
|
|
456
456
|
--mr=<value> deploy the reviewed change of this merged merge request, without questions
|
|
457
|
+
--testing deploy the local config as a testing installation only, without questions. It never
|
|
458
|
+
activates for real users, and it leaves the modules and the server config alone
|
|
457
459
|
|
|
458
460
|
DESCRIPTION
|
|
459
461
|
Deploys the specified customer config while comparing to the live version before
|
|
@@ -462,32 +464,82 @@ EXAMPLES
|
|
|
462
464
|
$ sk deploy <customerPath> -c <configName> -t <slackToken> -a <artifacts> -d <dryRun>
|
|
463
465
|
|
|
464
466
|
$ sk deploy customers/decathlon.de -c production -t someSlackToken -a dynamic,SpeedKit -d
|
|
467
|
+
|
|
468
|
+
$ sk deploy customers/decathlon.de --testing --description "branch feature/x"
|
|
465
469
|
```
|
|
466
470
|
|
|
467
|
-
## `sk diff
|
|
471
|
+
## `sk diff [CUSTOMERPATH] [PAGEURL]`
|
|
468
472
|
|
|
469
|
-
|
|
473
|
+
Diff a page with and without its query parameters, across variations, or against another page, as Speed Kit requests it from origin and the customer's documentHandler renders it. Exits with 1 when a diff is found, with 2 when the pages could not be compared, and with 3 when the documentHandler aborts a page, so Speed Kit never caches it
|
|
470
474
|
|
|
471
475
|
```
|
|
472
476
|
USAGE
|
|
473
|
-
$ sk diff
|
|
477
|
+
$ sk diff [CUSTOMERPATH] [PAGEURL] [-c <value>] [--variations <value>...] [--against <value>]
|
|
478
|
+
[--variation <value>] [--baseline] [--params] [--param <value>...] [-o tool|patch|json|none] [--raw] [--ignore
|
|
479
|
+
<value>...] [--browserFetch] [--host <value>] [--variationsFile <value>]
|
|
474
480
|
|
|
475
481
|
ARGUMENTS
|
|
476
|
-
|
|
482
|
+
[CUSTOMERPATH] The customer config path; optional with --raw, which then compares the origin's HTML with Speed Kit's
|
|
483
|
+
device defaults
|
|
484
|
+
[PAGEURL] The page to diff, with the query parameters to check, or the first page of an --against comparison
|
|
477
485
|
|
|
478
486
|
FLAGS
|
|
479
|
-
-
|
|
487
|
+
-c, --configName=<value> [default: production] The costumer config name
|
|
488
|
+
-o, --output=<option> How a diff is shown: the diff tool, a unified patch, JSON, or only the verdict. Defaults
|
|
489
|
+
to the tool at a terminal and to a patch otherwise
|
|
490
|
+
<options: tool|patch|json|none>
|
|
491
|
+
--against=<value> Compare the page against this other page, both requested and rendered the same way:
|
|
492
|
+
?color=red against ?color=blue. Replaces the parameter check
|
|
493
|
+
--baseline Fetch every side twice and ignore what differs between the two, such as nonces,
|
|
494
|
+
timestamps or reordered preloads. Doubles the requests: 4 per comparison
|
|
495
|
+
--browserFetch Fetch every page through a headless Chrome, for an origin whose bot protection refuses a
|
|
496
|
+
direct request. Needs the customer path
|
|
497
|
+
--host=<value> Send this Host header, emulating an origin-map host override
|
|
498
|
+
--ignore=<value>... Remove what this regex matches from both sides before comparing, e.g. a nonce or a
|
|
499
|
+
timestamp
|
|
500
|
+
--param=<value>... Check only this query parameter of the url: sort. Several, as sort,page or repeated, are
|
|
501
|
+
removed together; an empty one asks which. Implies --params with --variations
|
|
502
|
+
--params With --variations, also check the query parameters, once for each of the two variations.
|
|
503
|
+
Without --variations it is what sk diff does
|
|
504
|
+
--raw Compare the origin's HTML as it is, without running the customer's documentHandler
|
|
505
|
+
--variation=<value> The one variation the pages are requested in, for --against or the parameter check:
|
|
506
|
+
mobile, tablet or a custom one; an empty one asks which. Defaults to desktop
|
|
507
|
+
--variations=<value>... One variation to compare against desktop, or two to compare with each other: mobile, or
|
|
508
|
+
tablet,mobile. A custom variation works too; an empty one asks which
|
|
509
|
+
--variationsFile=<value> Resolve the requests against a runtime config in a local file instead of the app's
|
|
510
|
+
deployed one
|
|
480
511
|
|
|
481
512
|
DESCRIPTION
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
$ sk param-diff
|
|
513
|
+
Diff a page with and without its query parameters, across variations, or against another page, as Speed Kit requests
|
|
514
|
+
it from origin and the customer's documentHandler renders it. Exits with 1 when a diff is found, with 2 when the pages
|
|
515
|
+
could not be compared, and with 3 when the documentHandler aborts a page, so Speed Kit never caches it
|
|
486
516
|
|
|
487
517
|
EXAMPLES
|
|
488
|
-
$ sk
|
|
518
|
+
$ sk diff <customerPath> <pageUrl>
|
|
519
|
+
|
|
520
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2"
|
|
521
|
+
|
|
522
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2" --param sort
|
|
523
|
+
|
|
524
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2" --param
|
|
525
|
+
|
|
526
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2&size=48" --param sort,size
|
|
489
527
|
|
|
490
|
-
$ sk
|
|
528
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price" --output patch --ignore 'nonce="[^"]*"'
|
|
529
|
+
|
|
530
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/c/shoes?color=red" --against "https://www.decathlon.de/c/shoes?color=blue"
|
|
531
|
+
|
|
532
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/c/shoes?color=red" --against "https://www.decathlon.de/c/shoes?color=blue" --variation mobile
|
|
533
|
+
|
|
534
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price" --variation tablet
|
|
535
|
+
|
|
536
|
+
$ sk diff customers/decathlon.de https://www.decathlon.de/ --variations mobile
|
|
537
|
+
|
|
538
|
+
$ sk diff customers/decathlon.de https://www.decathlon.de/ --variations tablet,mobile
|
|
539
|
+
|
|
540
|
+
$ sk diff --raw "https://www.decathlon.de/?sort=price" --variations mobile
|
|
541
|
+
|
|
542
|
+
$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price" --variations mobile --params
|
|
491
543
|
```
|
|
492
544
|
|
|
493
545
|
## `sk extension add [REF]`
|
|
@@ -774,18 +826,18 @@ EXAMPLES
|
|
|
774
826
|
$ sk onboarding customers/decathlon.de --inject <installationId>
|
|
775
827
|
```
|
|
776
828
|
|
|
777
|
-
## `sk origin-request CUSTOMERPATH PAGEURL`
|
|
829
|
+
## `sk origin-request [CUSTOMERPATH] [PAGEURL]`
|
|
778
830
|
|
|
779
831
|
Request a page from origin with the exact headers Speed Kit's server sends for a cache variation, using the app's deployed runtime config
|
|
780
832
|
|
|
781
833
|
```
|
|
782
834
|
USAGE
|
|
783
|
-
$ sk origin-request CUSTOMERPATH PAGEURL [-c <value>] [-v <value>] [--host <value>] [--body <value>] [--grep
|
|
784
|
-
<value>] [--json] [--variations <value>]
|
|
835
|
+
$ sk origin-request [CUSTOMERPATH] [PAGEURL] [-c <value>] [-v <value>] [--host <value>] [--body <value>] [--grep
|
|
836
|
+
<value>] [--json] [--variations <value>] [--raw]
|
|
785
837
|
|
|
786
838
|
ARGUMENTS
|
|
787
|
-
CUSTOMERPATH The customer config path
|
|
788
|
-
PAGEURL Page to request from origin
|
|
839
|
+
[CUSTOMERPATH] The customer config path; optional with --raw, which then sends Speed Kit's device defaults
|
|
840
|
+
[PAGEURL] Page to request from origin
|
|
789
841
|
|
|
790
842
|
FLAGS
|
|
791
843
|
-c, --configName=<value> [default: production] The costumer config name
|
|
@@ -795,6 +847,8 @@ FLAGS
|
|
|
795
847
|
--grep=<value> Print body lines matching this regex, case-insensitive
|
|
796
848
|
--host=<value> Send this Host header, emulating an origin-map host override
|
|
797
849
|
--json Machine-readable output
|
|
850
|
+
--raw Request without a customer: the customer path becomes optional, and the request carries
|
|
851
|
+
Speed Kit's device defaults (default, mobile, tablet) and no variation of an app
|
|
798
852
|
--variations=<value> Simulate against a runtime config in a local file instead of the app's deployed one
|
|
799
853
|
|
|
800
854
|
DESCRIPTION
|
|
@@ -807,32 +861,8 @@ EXAMPLES
|
|
|
807
861
|
$ sk origin-request customers/decathlon.de https://www.decathlon.de/ -v mobile
|
|
808
862
|
|
|
809
863
|
$ sk origin-request customers/decathlon.de https://www.decathlon.de/ --grep "storeId" --body /tmp/origin.html
|
|
810
|
-
```
|
|
811
|
-
|
|
812
|
-
## `sk param-diff PAGEURL`
|
|
813
|
-
|
|
814
|
-
Shows difference in documents with query parameters on/off
|
|
815
|
-
|
|
816
|
-
```
|
|
817
|
-
USAGE
|
|
818
|
-
$ sk param-diff PAGEURL [-h]
|
|
819
|
-
|
|
820
|
-
ARGUMENTS
|
|
821
|
-
PAGEURL Link of the page
|
|
822
|
-
|
|
823
|
-
FLAGS
|
|
824
|
-
-h, --hideDiff Hide the code diff in IDE code diff window
|
|
825
|
-
|
|
826
|
-
DESCRIPTION
|
|
827
|
-
Shows difference in documents with query parameters on/off
|
|
828
|
-
|
|
829
|
-
ALIASES
|
|
830
|
-
$ sk param-diff
|
|
831
|
-
|
|
832
|
-
EXAMPLES
|
|
833
|
-
$ sk prewarm <pageUrl> -h
|
|
834
864
|
|
|
835
|
-
$ sk
|
|
865
|
+
$ sk origin-request --raw https://www.decathlon.de/ -v mobile --body /tmp/mobile.html
|
|
836
866
|
```
|
|
837
867
|
|
|
838
868
|
## `sk prewarm APP PATH`
|
|
@@ -30,6 +30,13 @@ export declare abstract class SkCommand<Built = never> extends Command {
|
|
|
30
30
|
/** The build context, when the command names one in `buildContext`. */
|
|
31
31
|
protected context: Built;
|
|
32
32
|
init(): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Waits until stdout and stderr have handed everything to the OS. A command
|
|
35
|
+
* that exits with a code throws, and oclif ends that run with
|
|
36
|
+
* `process.exit()`, which drops whatever a pipe has not taken yet: `sk diff
|
|
37
|
+
* -o json | jq` got the first 64 KiB, one pipe buffer, of a differing run.
|
|
38
|
+
*/
|
|
39
|
+
finally(error: Error | undefined): Promise<unknown>;
|
|
33
40
|
/**
|
|
34
41
|
* The customer whose documentHandler node modules the environment points
|
|
35
42
|
* at. None by default; onboarding, which runs the documentHandler locally,
|
package/dist/base/sk-command.js
CHANGED
|
@@ -41,6 +41,16 @@ export class SkCommand extends Command {
|
|
|
41
41
|
this.context = buildContext.create(args, flags, this.environment);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Waits until stdout and stderr have handed everything to the OS. A command
|
|
46
|
+
* that exits with a code throws, and oclif ends that run with
|
|
47
|
+
* `process.exit()`, which drops whatever a pipe has not taken yet: `sk diff
|
|
48
|
+
* -o json | jq` got the first 64 KiB, one pipe buffer, of a differing run.
|
|
49
|
+
*/
|
|
50
|
+
async finally(error) {
|
|
51
|
+
await Promise.all([drained(process.stdout), drained(process.stderr)]);
|
|
52
|
+
return super.finally(error);
|
|
53
|
+
}
|
|
44
54
|
/**
|
|
45
55
|
* The customer whose documentHandler node modules the environment points
|
|
46
56
|
* at. None by default; onboarding, which runs the documentHandler locally,
|
|
@@ -54,3 +64,12 @@ export class SkCommand extends Command {
|
|
|
54
64
|
return flags["quiet"] === true;
|
|
55
65
|
}
|
|
56
66
|
}
|
|
67
|
+
/** Resolves once every write queued on the stream so far has been flushed. */
|
|
68
|
+
function drained(stream) {
|
|
69
|
+
if (stream.writableLength === 0) {
|
|
70
|
+
return Promise.resolve();
|
|
71
|
+
}
|
|
72
|
+
// Writes complete in order, so the callback of an empty one comes last; it
|
|
73
|
+
// fires with an error too, as on a closed pipe, which ends the wait as well.
|
|
74
|
+
return new Promise((resolve) => stream.write("", () => resolve()));
|
|
75
|
+
}
|
|
@@ -10,6 +10,7 @@ export default class Deploy extends SkCommand {
|
|
|
10
10
|
verboseLevel: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
artifacts: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
mr: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
testing: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
description: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
approval: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
useTestConfig: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
package/dist/commands/deploy.js
CHANGED
|
@@ -2,6 +2,7 @@ import { SkCommand } from "../base/sk-command.js";
|
|
|
2
2
|
import { DeployServiceBuildContext } from "../services/deploy/deploy-service-build-context.js";
|
|
3
3
|
import DeployServiceFactory from "../services/deploy/deploy-service-factory.js";
|
|
4
4
|
import { DeployAbortedError } from "../services/deploy/error/deploy-aborted-error.js";
|
|
5
|
+
import { TestingDeployPolicy } from "../services/deploy/policy/index.js";
|
|
5
6
|
import { MergeRequestDeployServiceBuildContext, MergeRequestDeployServiceFactory, } from "../services/deploy/mr/index.js";
|
|
6
7
|
export default class Deploy extends SkCommand {
|
|
7
8
|
static args = DeployServiceBuildContext.args;
|
|
@@ -10,6 +11,7 @@ export default class Deploy extends SkCommand {
|
|
|
10
11
|
static examples = [
|
|
11
12
|
`$ sk deploy <customerPath> -c <configName> -t <slackToken> -a <artifacts> -d <dryRun>`,
|
|
12
13
|
`$ sk deploy customers/decathlon.de -c production -t someSlackToken -a dynamic,SpeedKit -d`,
|
|
14
|
+
`$ sk deploy customers/decathlon.de --testing --description "branch feature/x"`,
|
|
13
15
|
];
|
|
14
16
|
async run() {
|
|
15
17
|
const { args, flags } = await this.parse(Deploy);
|
|
@@ -17,7 +19,9 @@ export default class Deploy extends SkCommand {
|
|
|
17
19
|
await this.deployMergeRequest(MergeRequestDeployServiceBuildContext.create(args, flags, this.environment));
|
|
18
20
|
return;
|
|
19
21
|
}
|
|
20
|
-
const deployService = await new DeployServiceFactory(DeployServiceBuildContext.create(args, flags, this.environment)
|
|
22
|
+
const deployService = await new DeployServiceFactory(DeployServiceBuildContext.create(args, flags, this.environment), flags.testing
|
|
23
|
+
? new TestingDeployPolicy(flags.description ?? "testing installation")
|
|
24
|
+
: undefined).buildService();
|
|
21
25
|
try {
|
|
22
26
|
await deployService.run();
|
|
23
27
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Interfaces } from "@oclif/core";
|
|
2
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
3
|
+
import { DiffServiceBuildContext } from "../services/diff/index.js";
|
|
4
|
+
export default class Diff extends SkCommand<DiffServiceBuildContext> {
|
|
5
|
+
static description: string;
|
|
6
|
+
static buildContext: typeof DiffServiceBuildContext;
|
|
7
|
+
static args: {
|
|
8
|
+
customerPath: Interfaces.Arg<string, {
|
|
9
|
+
exists?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
pageUrl: Interfaces.Arg<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
static flags: {
|
|
14
|
+
variations: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
15
|
+
against: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
16
|
+
variation: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
17
|
+
baseline: Interfaces.BooleanFlag<boolean>;
|
|
18
|
+
params: Interfaces.BooleanFlag<boolean>;
|
|
19
|
+
param: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
20
|
+
output: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
21
|
+
raw: Interfaces.BooleanFlag<boolean>;
|
|
22
|
+
ignore: Interfaces.OptionFlag<string[], Interfaces.CustomOptions>;
|
|
23
|
+
browserFetch: Interfaces.BooleanFlag<boolean>;
|
|
24
|
+
host: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
25
|
+
variationsFile: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
26
|
+
hideDiff: Interfaces.BooleanFlag<boolean>;
|
|
27
|
+
configName: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
28
|
+
};
|
|
29
|
+
static examples: string[];
|
|
30
|
+
/** A bare --param or --variations asks, rather than oclif refusing it. */
|
|
31
|
+
init(): Promise<void>;
|
|
32
|
+
/** The documentHandler runs locally, with the customer's extra node modules. */
|
|
33
|
+
protected customerPathForModules(args: Record<string, unknown>): string | undefined;
|
|
34
|
+
/** JSON owns stdout, so the CLI keeps its action lines out of it. */
|
|
35
|
+
protected quietCli(flags: Record<string, unknown>): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* A run that could not compare exits with 2, as diff(1) does, so a script
|
|
38
|
+
* tells "the pages differ" (1) from "something went wrong". The exit for a
|
|
39
|
+
* diff found carries its own code and passes through.
|
|
40
|
+
*/
|
|
41
|
+
catch(error: Interfaces.CommandError & {
|
|
42
|
+
oclif?: {
|
|
43
|
+
exit?: number;
|
|
44
|
+
};
|
|
45
|
+
}): Promise<unknown>;
|
|
46
|
+
run(): Promise<void>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Errors } from "@oclif/core";
|
|
2
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
3
|
+
import { DiffServiceBuildContext, DiffServiceFactory, withAskingFlags, } from "../services/diff/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* The exit code for a run's outcome, as diff(1) has them, and 3 for a page
|
|
6
|
+
* the documentHandler aborts: a verdict, not a failure to compare.
|
|
7
|
+
*/
|
|
8
|
+
const EXIT_CODES = {
|
|
9
|
+
equal: 0,
|
|
10
|
+
differs: 1,
|
|
11
|
+
failed: 2,
|
|
12
|
+
uncacheable: 3,
|
|
13
|
+
};
|
|
14
|
+
export default class Diff extends SkCommand {
|
|
15
|
+
static description = "Diff a page with and without its query parameters, across variations, or against another page, as Speed Kit requests it from origin and the customer's documentHandler renders it. Exits with 1 when a diff is found, with 2 when the pages could not be compared, and with 3 when the documentHandler aborts a page, so Speed Kit never caches it";
|
|
16
|
+
static buildContext = DiffServiceBuildContext;
|
|
17
|
+
static args = DiffServiceBuildContext.args;
|
|
18
|
+
static flags = DiffServiceBuildContext.flags;
|
|
19
|
+
static examples = [
|
|
20
|
+
`$ sk diff <customerPath> <pageUrl>`,
|
|
21
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2"`,
|
|
22
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2" --param sort`,
|
|
23
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2" --param`,
|
|
24
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price&page=2&size=48" --param sort,size`,
|
|
25
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price" --output patch --ignore 'nonce="[^"]*"'`,
|
|
26
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/c/shoes?color=red" --against "https://www.decathlon.de/c/shoes?color=blue"`,
|
|
27
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/c/shoes?color=red" --against "https://www.decathlon.de/c/shoes?color=blue" --variation mobile`,
|
|
28
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price" --variation tablet`,
|
|
29
|
+
`$ sk diff customers/decathlon.de https://www.decathlon.de/ --variations mobile`,
|
|
30
|
+
`$ sk diff customers/decathlon.de https://www.decathlon.de/ --variations tablet,mobile`,
|
|
31
|
+
`$ sk diff --raw "https://www.decathlon.de/?sort=price" --variations mobile`,
|
|
32
|
+
`$ sk diff customers/decathlon.de "https://www.decathlon.de/?sort=price" --variations mobile --params`,
|
|
33
|
+
];
|
|
34
|
+
/** A bare --param or --variations asks, rather than oclif refusing it. */
|
|
35
|
+
async init() {
|
|
36
|
+
this.argv = withAskingFlags(this.argv);
|
|
37
|
+
await super.init();
|
|
38
|
+
}
|
|
39
|
+
/** The documentHandler runs locally, with the customer's extra node modules. */
|
|
40
|
+
customerPathForModules(args) {
|
|
41
|
+
const customerPath = args["customerPath"];
|
|
42
|
+
return /^https?:\/\//i.test(customerPath ?? "") ? undefined : customerPath;
|
|
43
|
+
}
|
|
44
|
+
/** JSON owns stdout, so the CLI keeps its action lines out of it. */
|
|
45
|
+
quietCli(flags) {
|
|
46
|
+
return flags["output"] === "json";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A run that could not compare exits with 2, as diff(1) does, so a script
|
|
50
|
+
* tells "the pages differ" (1) from "something went wrong". The exit for a
|
|
51
|
+
* diff found carries its own code and passes through.
|
|
52
|
+
*/
|
|
53
|
+
async catch(error) {
|
|
54
|
+
if (!(error instanceof Errors.ExitError)) {
|
|
55
|
+
error.exitCode = 2;
|
|
56
|
+
error.oclif = { ...error.oclif, exit: 2 };
|
|
57
|
+
}
|
|
58
|
+
return super.catch(error);
|
|
59
|
+
}
|
|
60
|
+
async run() {
|
|
61
|
+
const service = await new DiffServiceFactory(this.context).buildService();
|
|
62
|
+
const code = EXIT_CODES[await service.run()];
|
|
63
|
+
if (code !== 0) {
|
|
64
|
+
this.exit(code);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -4,7 +4,7 @@ import { CLI_QUERY_DAYS_DESCRIPTION } from "../services/query-builder/query-buil
|
|
|
4
4
|
import { ensureBaqendLogin } from "../services/config-api/ensure-login.js";
|
|
5
5
|
import { ConfigApiContext, ConfigApiServiceFactory, } from "../services/config-api/index.js";
|
|
6
6
|
import { PopConfigFactory, PopConfigServiceBuildContext, } from "../services/pop-config/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { createDiffEngine } from "../services/diff/index.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
@@ -145,17 +145,13 @@ export default class GeneratePopConfig extends SkCommand {
|
|
|
145
145
|
// is the one the deploy of the generated config uses.
|
|
146
146
|
const configService = new ConfigApiServiceFactory(new ConfigApiContext(app), environment.entityManagerProvider).getService();
|
|
147
147
|
const cliService = environment.cli;
|
|
148
|
-
const diffService =
|
|
149
|
-
environment,
|
|
150
|
-
executablePath: environment.settings.diffExec,
|
|
151
|
-
executableTemplate: environment.settings.diffExecTemplate,
|
|
152
|
-
})).getService();
|
|
148
|
+
const diffService = createDiffEngine(environment, "tool");
|
|
153
149
|
const popPrewarmingCode = await this.createPopPrewarmingCode(config);
|
|
154
150
|
const remoteConfig = await configService.getModule(moduleName);
|
|
155
151
|
const result = await diffService.diffContent(moduleName, remoteConfig, // remoteContent
|
|
156
152
|
popPrewarmingCode);
|
|
157
153
|
const content = result.updatedFile;
|
|
158
|
-
const isEqual = result.
|
|
154
|
+
const isEqual = result.equal;
|
|
159
155
|
if (isEqual) {
|
|
160
156
|
cliService.write(`created config is the same as the deployed one`);
|
|
161
157
|
}
|
|
@@ -4,10 +4,10 @@ export default class OriginRequest extends SkCommand<OriginRequestServiceBuildCo
|
|
|
4
4
|
static description: string;
|
|
5
5
|
static buildContext: typeof OriginRequestServiceBuildContext;
|
|
6
6
|
static args: {
|
|
7
|
-
pageUrl: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
7
|
customerPath: import("@oclif/core/interfaces").Arg<string, {
|
|
9
8
|
exists?: boolean;
|
|
10
9
|
}>;
|
|
10
|
+
pageUrl: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
11
|
};
|
|
12
12
|
static flags: {
|
|
13
13
|
variation: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -16,6 +16,7 @@ export default class OriginRequest extends SkCommand<OriginRequestServiceBuildCo
|
|
|
16
16
|
grep: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
18
|
variations: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
raw: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
20
|
configName: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
21
|
};
|
|
21
22
|
static examples: string[];
|
|
@@ -9,6 +9,7 @@ export default class OriginRequest extends SkCommand {
|
|
|
9
9
|
`$ sk origin-request <customerPath> <pageUrl>`,
|
|
10
10
|
`$ sk origin-request customers/decathlon.de https://www.decathlon.de/ -v mobile`,
|
|
11
11
|
`$ sk origin-request customers/decathlon.de https://www.decathlon.de/ --grep "storeId" --body /tmp/origin.html`,
|
|
12
|
+
`$ sk origin-request --raw https://www.decathlon.de/ -v mobile --body /tmp/mobile.html`,
|
|
12
13
|
];
|
|
13
14
|
async run() {
|
|
14
15
|
const service = await new OriginRequestServiceFactory(this.context).buildService();
|
package/dist/helpers/race.js
CHANGED
|
@@ -3,10 +3,12 @@ const DEFAULT_TIMEOUT = 5000;
|
|
|
3
3
|
export class RaceTimeOutError extends ApplicationError {
|
|
4
4
|
}
|
|
5
5
|
export async function race(promise, timeout = DEFAULT_TIMEOUT) {
|
|
6
|
+
let timer;
|
|
6
7
|
const timeOut = new Promise((resolve, reject) => {
|
|
7
|
-
setTimeout(() => {
|
|
8
|
+
timer = setTimeout(() => {
|
|
8
9
|
reject(new RaceTimeOutError(`timeout of ${timeout}ms reached`));
|
|
9
10
|
}, timeout);
|
|
10
11
|
});
|
|
11
|
-
|
|
12
|
+
// A pending timer keeps Node alive, so it must not outlive the race.
|
|
13
|
+
return Promise.race([promise, timeOut]).finally(() => clearTimeout(timer));
|
|
12
14
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import { describe, it } from "mocha";
|
|
3
|
+
import { race, RaceTimeOutError } from "../race.js";
|
|
4
|
+
/**
|
|
5
|
+
* The timers that keep the process alive. A cleared timer is only dropped from
|
|
6
|
+
* the count on the next turn of the event loop, so this waits for it.
|
|
7
|
+
*/
|
|
8
|
+
async function pendingTimers() {
|
|
9
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
10
|
+
return process
|
|
11
|
+
.getActiveResourcesInfo()
|
|
12
|
+
.filter((resource) => resource === "Timeout").length;
|
|
13
|
+
}
|
|
14
|
+
describe("race", () => {
|
|
15
|
+
it("resolves with the promise and leaves no timer behind", async () => {
|
|
16
|
+
const before = await pendingTimers();
|
|
17
|
+
expect(await race(Promise.resolve("done"), 10_000)).to.equal("done");
|
|
18
|
+
expect(await pendingTimers()).to.equal(before);
|
|
19
|
+
});
|
|
20
|
+
it("rejects with the promise's error and leaves no timer behind", async () => {
|
|
21
|
+
const before = await pendingTimers();
|
|
22
|
+
const error = new Error("failed");
|
|
23
|
+
const result = await race(Promise.reject(error), 10_000).catch((e) => e);
|
|
24
|
+
expect(result).to.equal(error);
|
|
25
|
+
expect(await pendingTimers()).to.equal(before);
|
|
26
|
+
});
|
|
27
|
+
it("rejects with a RaceTimeOutError once the timeout is reached", async () => {
|
|
28
|
+
const result = await race(new Promise(() => undefined), 10).catch((e) => e);
|
|
29
|
+
expect(result).to.be.instanceOf(RaceTimeOutError);
|
|
30
|
+
});
|
|
31
|
+
});
|
package/dist/models/files.d.ts
CHANGED
package/dist/models/files.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { directOriginFetch, setOriginFetchTransport, } from "../../helpers/origin-proxy.js";
|
|
2
2
|
import { safe } from "../../helpers/safe.js";
|
|
3
|
-
import { isBlockedOriginStatus } from "../
|
|
3
|
+
import { isBlockedOriginStatus } from "../origin-request/origin-error-cause.js";
|
|
4
4
|
import { BrowserOriginFetcher, } from "./browser-origin-fetcher.js";
|
|
5
5
|
/**
|
|
6
6
|
* Routes `originFetch` through a real browser, for origins that refuse a server-side fetcher.
|
|
@@ -204,13 +204,7 @@ export declare class BrowserOriginFetcher {
|
|
|
204
204
|
private emulate;
|
|
205
205
|
private browserInstance;
|
|
206
206
|
private launchBrowser;
|
|
207
|
-
/**
|
|
208
|
-
* Creates this browser's own profile directory, pruning anything a crashed run left behind.
|
|
209
|
-
*
|
|
210
|
-
* Pruning is by age rather than by wiping the parent: two `sk onboarding` sessions can run at
|
|
211
|
-
* once, and one must not delete the profile the other is holding open.
|
|
212
|
-
*/
|
|
207
|
+
/** Creates this browser's own profile directory, pruning anything a crashed run left behind. */
|
|
213
208
|
private createProfile;
|
|
214
|
-
private pruneProfiles;
|
|
215
209
|
private warnOnce;
|
|
216
210
|
}
|