@speedkit/cli 4.44.0-beta.3 → 4.44.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.
Files changed (189) hide show
  1. package/CHANGELOG.md +38 -8
  2. package/README.md +68 -42
  3. package/dist/base/sk-command.d.ts +7 -0
  4. package/dist/base/sk-command.js +19 -0
  5. package/dist/commands/deploy.d.ts +1 -0
  6. package/dist/commands/deploy.js +5 -1
  7. package/dist/commands/diff.d.ts +47 -0
  8. package/dist/commands/diff.js +67 -0
  9. package/dist/commands/generate-pop-config.js +3 -7
  10. package/dist/helpers/race.js +4 -2
  11. package/dist/helpers/spec/race.spec.js +31 -0
  12. package/dist/models/files.d.ts +0 -1
  13. package/dist/models/files.js +0 -1
  14. package/dist/services/browser-fetch/browser-origin-fetch.js +1 -1
  15. package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +1 -7
  16. package/dist/services/browser-fetch/browser-origin-fetcher.js +3 -26
  17. package/dist/services/bundler/bundle-service-factory.d.ts +0 -3
  18. package/dist/services/bundler/bundle-service-factory.js +1 -5
  19. package/dist/services/bundler/bundle-service.d.ts +1 -10
  20. package/dist/services/bundler/bundle-service.js +1 -16
  21. package/dist/services/bundler/index.d.ts +0 -1
  22. package/dist/services/bundler/index.js +0 -1
  23. package/dist/services/cli/cli-environment.d.ts +11 -0
  24. package/dist/services/cli/cli-environment.js +37 -0
  25. package/dist/services/cli/cli-service-model.d.ts +3 -1
  26. package/dist/services/cli/cli-service.d.ts +1 -1
  27. package/dist/services/cli/cli-service.js +4 -1
  28. package/dist/services/cli/spec/cli-environment.spec.js +30 -1
  29. package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
  30. package/dist/services/deploy/checks/post-deploy/refresh-deployment-job-check.d.ts +2 -2
  31. package/dist/services/deploy/checks/post-deploy/refresh-deployment-job-check.js +8 -7
  32. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +2 -2
  33. package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +11 -7
  34. package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +2 -2
  35. package/dist/services/deploy/checks/post-deploy/save-files-check.js +3 -2
  36. package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +3 -2
  37. package/dist/services/deploy/checks/pre-deploy/split-change-check.js +3 -2
  38. package/dist/services/deploy/deploy-service-build-context.d.ts +2 -0
  39. package/dist/services/deploy/deploy-service-build-context.js +13 -2
  40. package/dist/services/deploy/deploy-service-factory.js +2 -9
  41. package/dist/services/deploy/deploy-service-model.d.ts +11 -1
  42. package/dist/services/deploy/deploy-service.d.ts +2 -0
  43. package/dist/services/deploy/deploy-service.js +26 -1
  44. package/dist/services/deploy/handler/customer-config-handler.d.ts +2 -2
  45. package/dist/services/deploy/handler/install-resource-handler.d.ts +2 -2
  46. package/dist/services/deploy/handler/install-resource-handler.js +6 -3
  47. package/dist/services/deploy/handler/module-handler.d.ts +2 -2
  48. package/dist/services/deploy/handler/module-handler.js +2 -2
  49. package/dist/services/deploy/handler/server-config-handler.d.ts +2 -2
  50. package/dist/services/deploy/handler/server-config-handler.js +2 -2
  51. package/dist/services/deploy/mr/live-state-check.d.ts +2 -2
  52. package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +2 -7
  53. package/dist/services/deploy/policy/deploy-policy-model.d.ts +1 -5
  54. package/dist/services/deploy/policy/deploy-policy-model.js +0 -4
  55. package/dist/services/deploy/policy/index.d.ts +1 -0
  56. package/dist/services/deploy/policy/index.js +1 -0
  57. package/dist/services/deploy/policy/testing-deploy-policy.d.ts +16 -0
  58. package/dist/services/deploy/policy/testing-deploy-policy.js +42 -0
  59. package/dist/services/deploy/spec/checks/post-deploy/refresh-deployment-job-check.spec.js +5 -12
  60. package/dist/services/deploy/spec/deploy-service.spec.js +64 -0
  61. package/dist/services/deploy/spec/handler/install-resource-handler.spec.js +58 -0
  62. package/dist/services/deploy/spec/mr/live-state-check.spec.js +2 -2
  63. package/dist/services/deploy/spec/policy/auto-deploy-policy.spec.js +0 -2
  64. package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.d.ts +1 -0
  65. package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.js +46 -0
  66. package/dist/services/diff/create-diff-engine.d.ts +14 -0
  67. package/dist/services/diff/create-diff-engine.js +42 -0
  68. package/dist/services/diff/customer-origin.d.ts +9 -0
  69. package/dist/services/diff/customer-origin.js +19 -0
  70. package/dist/services/diff/diff-engine.d.ts +30 -0
  71. package/dist/services/diff/diff-engine.js +49 -0
  72. package/dist/services/diff/diff-log.d.ts +9 -0
  73. package/dist/services/diff/diff-log.js +18 -0
  74. package/dist/services/diff/diff-model.d.ts +68 -0
  75. package/dist/services/diff/diff-model.js +1 -0
  76. package/dist/services/diff/diff-service-build-context.d.ts +99 -9
  77. package/dist/services/diff/diff-service-build-context.js +299 -1
  78. package/dist/services/diff/diff-service-factory.d.ts +24 -2
  79. package/dist/services/diff/diff-service-factory.js +165 -3
  80. package/dist/services/diff/diff-service.d.ts +93 -33
  81. package/dist/services/diff/diff-service.js +274 -140
  82. package/dist/services/diff/index.d.ts +12 -1
  83. package/dist/services/diff/index.js +12 -1
  84. package/dist/services/diff/noise-baseline.d.ts +28 -0
  85. package/dist/services/diff/noise-baseline.js +105 -0
  86. package/dist/services/diff/page-source.d.ts +42 -0
  87. package/dist/services/diff/page-source.js +93 -0
  88. package/dist/services/diff/side-failure.d.ts +28 -0
  89. package/dist/services/diff/side-failure.js +100 -0
  90. package/dist/services/diff/sinks/json-diff-sink.d.ts +32 -0
  91. package/dist/services/diff/sinks/json-diff-sink.js +44 -0
  92. package/dist/services/diff/sinks/no-diff-sink.d.ts +5 -0
  93. package/dist/services/diff/sinks/no-diff-sink.js +6 -0
  94. package/dist/services/diff/sinks/patch-diff-sink.d.ts +19 -0
  95. package/dist/services/diff/sinks/patch-diff-sink.js +29 -0
  96. package/dist/services/diff/sinks/tool-diff-sink.d.ts +26 -0
  97. package/dist/services/diff/sinks/tool-diff-sink.js +88 -0
  98. package/dist/services/diff/sinks/unified-patch.d.ts +7 -0
  99. package/dist/services/diff/sinks/unified-patch.js +12 -0
  100. package/dist/services/diff/spec/customer-origin.spec.d.ts +1 -0
  101. package/dist/services/diff/spec/customer-origin.spec.js +27 -0
  102. package/dist/services/diff/spec/diff-engine.spec.d.ts +1 -0
  103. package/dist/services/diff/spec/diff-engine.spec.js +47 -0
  104. package/dist/services/diff/spec/diff-service-build-context.spec.d.ts +1 -0
  105. package/dist/services/diff/spec/diff-service-build-context.spec.js +185 -0
  106. package/dist/services/diff/spec/diff-service.spec.d.ts +1 -0
  107. package/dist/services/diff/spec/diff-service.spec.js +393 -0
  108. package/dist/services/diff/spec/noise-baseline.spec.d.ts +1 -0
  109. package/dist/services/diff/spec/noise-baseline.spec.js +95 -0
  110. package/dist/services/diff/spec/page-source.spec.d.ts +1 -0
  111. package/dist/services/diff/spec/page-source.spec.js +140 -0
  112. package/dist/services/diff/spec/sinks/json-diff-sink.spec.d.ts +1 -0
  113. package/dist/services/diff/spec/sinks/json-diff-sink.spec.js +72 -0
  114. package/dist/services/diff/spec/sinks/patch-diff-sink.spec.d.ts +1 -0
  115. package/dist/services/diff/spec/sinks/patch-diff-sink.spec.js +47 -0
  116. package/dist/services/diff/spec/sinks/tool-diff-sink.spec.d.ts +1 -0
  117. package/dist/services/diff/spec/sinks/tool-diff-sink.spec.js +61 -0
  118. package/dist/services/document-handler-runtime/document-handler-abort.d.ts +2 -0
  119. package/dist/services/document-handler-runtime/document-handler-abort.js +2 -0
  120. package/dist/services/document-handler-runtime/document-handler-server.d.ts +0 -17
  121. package/dist/services/document-handler-runtime/document-handler-server.js +19 -81
  122. package/dist/services/document-handler-runtime/runtime-files.d.ts +9 -0
  123. package/dist/services/document-handler-runtime/runtime-files.js +17 -0
  124. package/dist/services/integration-api/integration-api-model.d.ts +1 -2
  125. package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +8 -68
  126. package/dist/services/integration-api/struct/customer-config.d.ts +1 -32
  127. package/dist/services/integration-api/struct/customer-config.js +3 -33
  128. package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +4 -9
  129. package/dist/services/integration-api/struct/speed-kit-config-file.js +10 -27
  130. package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +8 -20
  131. package/dist/services/onboarding/dashboard/diff-against-current-page.d.ts +29 -7
  132. package/dist/services/onboarding/dashboard/diff-against-current-page.js +24 -37
  133. package/dist/services/onboarding/dashboard/index.js +13 -6
  134. package/dist/services/onboarding/dashboard/request-diff-service.d.ts +21 -8
  135. package/dist/services/onboarding/dashboard/request-diff-service.js +21 -49
  136. package/dist/services/onboarding/onboarding-model.d.ts +0 -1
  137. package/dist/services/onboarding/onboarding-model.js +0 -1
  138. package/dist/services/onboarding/onboarding-service-factory.d.ts +0 -1
  139. package/dist/services/onboarding/onboarding-service-factory.js +24 -30
  140. package/dist/services/onboarding/spec/dashboard/request-diff-service.spec.d.ts +1 -0
  141. package/dist/services/onboarding/spec/dashboard/request-diff-service.spec.js +57 -0
  142. package/dist/services/onboarding/templates/install-speed-kit-js-template.js +0 -5
  143. package/dist/services/onboarding/virtual-orestes-app/index.d.ts +3 -3
  144. package/dist/services/onboarding/virtual-orestes-app/index.js +5 -5
  145. package/dist/services/origin-request/index.d.ts +3 -0
  146. package/dist/services/origin-request/index.js +3 -0
  147. package/dist/services/origin-request/origin-fetcher.d.ts +52 -0
  148. package/dist/services/origin-request/origin-fetcher.js +93 -0
  149. package/dist/services/origin-request/origin-request-service-factory.js +19 -1
  150. package/dist/services/origin-request/origin-request-service.d.ts +6 -10
  151. package/dist/services/origin-request/origin-request-service.js +28 -70
  152. package/dist/services/origin-request/runtime-config-source.d.ts +36 -0
  153. package/dist/services/origin-request/runtime-config-source.js +59 -0
  154. package/dist/services/origin-request/spec/origin-error-cause.spec.d.ts +1 -0
  155. package/dist/services/{onboarding/spec/virtual-orestes-app → origin-request/spec}/origin-error-cause.spec.js +1 -1
  156. package/dist/services/origin-request/spec/origin-fetcher.spec.d.ts +1 -0
  157. package/dist/services/{onboarding/spec/virtual-orestes-app/crawler.spec.js → origin-request/spec/origin-fetcher.spec.js} +46 -15
  158. package/dist/services/prewarm/assets/asset-api-client.d.ts +6 -0
  159. package/dist/services/prewarm/assets/asset-api-client.js +6 -1
  160. package/dist/services/prewarm/pre-warm-service.d.ts +10 -0
  161. package/dist/services/prewarm/pre-warm-service.js +17 -0
  162. package/dist/services/prewarm/spec/pre-warm-service.spec.d.ts +1 -0
  163. package/dist/services/prewarm/spec/pre-warm-service.spec.js +72 -0
  164. package/dist/services/query-builder/query-builder-factory.js +3 -3
  165. package/dist/services/setup/os/tool-registry.d.ts +1 -1
  166. package/oclif.manifest.json +294 -162
  167. package/package.json +1 -2
  168. package/dist/commands/diff-url-parameters.d.ts +0 -19
  169. package/dist/commands/diff-url-parameters.js +0 -121
  170. package/dist/services/bundler/error/packjockel-error.d.ts +0 -3
  171. package/dist/services/bundler/error/packjockel-error.js +0 -3
  172. package/dist/services/bundler/packjockel-service.d.ts +0 -72
  173. package/dist/services/bundler/packjockel-service.js +0 -156
  174. package/dist/services/bundler/spec/packjockel-service.spec.js +0 -143
  175. package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.d.ts +0 -15
  176. package/dist/services/deploy/checks/post-deploy/deprecated-deployment-detection-check.js +0 -70
  177. package/dist/services/deploy/error/check-module-file-error.d.ts +0 -4
  178. package/dist/services/deploy/error/check-module-file-error.js +0 -4
  179. package/dist/services/deploy/error/post-deploy-deployment-detection-error.d.ts +0 -4
  180. package/dist/services/deploy/error/post-deploy-deployment-detection-error.js +0 -4
  181. package/dist/services/onboarding/server-config/index.d.ts +0 -10
  182. package/dist/services/onboarding/server-config/index.js +0 -27
  183. package/dist/services/onboarding/virtual-orestes-app/crawler.d.ts +0 -31
  184. package/dist/services/onboarding/virtual-orestes-app/crawler.js +0 -98
  185. /package/dist/{services/bundler/spec/packjockel-service.spec.d.ts → helpers/spec/race.spec.d.ts} +0 -0
  186. /package/dist/services/{onboarding/spec/virtual-orestes-app/crawler.spec.d.ts → deploy/spec/deploy-service.spec.d.ts} +0 -0
  187. /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
  188. /package/dist/services/{onboarding/virtual-orestes-app → origin-request}/origin-error-cause.d.ts +0 -0
  189. /package/dist/services/{onboarding/virtual-orestes-app → origin-request}/origin-error-cause.js +0 -0
@@ -274,7 +274,8 @@
274
274
  "description": "Deploys the specified customer config while comparing to the live version before",
275
275
  "examples": [
276
276
  "$ sk deploy <customerPath> -c <configName> -t <slackToken> -a <artifacts> -d <dryRun>",
277
- "$ sk deploy customers/decathlon.de -c production -t someSlackToken -a dynamic,SpeedKit -d"
277
+ "$ sk deploy customers/decathlon.de -c production -t someSlackToken -a dynamic,SpeedKit -d",
278
+ "$ sk deploy customers/decathlon.de --testing --description \"branch feature/x\""
278
279
  ],
279
280
  "flags": {
280
281
  "configName": {
@@ -323,12 +324,28 @@
323
324
  "multiple": false,
324
325
  "type": "option"
325
326
  },
326
- "description": {
327
- "dependsOn": [
328
- "mr"
327
+ "testing": {
328
+ "description": "deploy the local config as a testing installation only, without questions. It never activates for real users, and it leaves the modules and the server config alone",
329
+ "exclusive": [
330
+ "mr",
331
+ "dryRun"
329
332
  ],
330
- "description": "the description every installation of the run gets, asked while it is left out",
333
+ "name": "testing",
334
+ "allowNo": false,
335
+ "type": "boolean"
336
+ },
337
+ "description": {
338
+ "description": "the description every installation of the run gets. With --mr it is asked while it is left out",
331
339
  "name": "description",
340
+ "relationships": [
341
+ {
342
+ "type": "some",
343
+ "flags": [
344
+ "mr",
345
+ "testing"
346
+ ]
347
+ }
348
+ ],
332
349
  "hasDynamicHelp": false,
333
350
  "multiple": false,
334
351
  "type": "option"
@@ -364,27 +381,142 @@
364
381
  "deploy.js"
365
382
  ]
366
383
  },
367
- "diff-url-parameters": {
368
- "aliases": [
369
- "param-diff"
370
- ],
384
+ "diff": {
385
+ "aliases": [],
371
386
  "args": {
387
+ "customerPath": {
388
+ "description": "The customer config path; optional with --raw, which then compares the origin's HTML with Speed Kit's device defaults",
389
+ "name": "customerPath",
390
+ "required": false
391
+ },
372
392
  "pageUrl": {
373
- "description": "Link of the page",
393
+ "description": "The page to diff, with the query parameters to check, or the first page of an --against comparison",
374
394
  "name": "pageUrl",
375
- "required": true
395
+ "required": false
376
396
  }
377
397
  },
378
- "deprecateAliases": true,
379
- "description": "Shows difference in documents with query parameters on/off",
398
+ "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",
380
399
  "examples": [
381
- "$ sk prewarm <pageUrl> -h",
382
- "$ sk prewarm https://www.decathlon.de/ -h"
400
+ "$ sk diff <customerPath> <pageUrl>",
401
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/?sort=price&page=2\"",
402
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/?sort=price&page=2\" --param sort",
403
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/?sort=price&page=2\" --param",
404
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/?sort=price&page=2&size=48\" --param sort,size",
405
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/?sort=price\" --output patch --ignore 'nonce=\"[^\"]*\"'",
406
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/c/shoes?color=red\" --against \"https://www.decathlon.de/c/shoes?color=blue\"",
407
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/c/shoes?color=red\" --against \"https://www.decathlon.de/c/shoes?color=blue\" --variation mobile",
408
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/?sort=price\" --variation tablet",
409
+ "$ sk diff customers/decathlon.de https://www.decathlon.de/ --variations mobile",
410
+ "$ sk diff customers/decathlon.de https://www.decathlon.de/ --variations tablet,mobile",
411
+ "$ sk diff --raw \"https://www.decathlon.de/?sort=price\" --variations mobile",
412
+ "$ sk diff customers/decathlon.de \"https://www.decathlon.de/?sort=price\" --variations mobile --params"
383
413
  ],
384
414
  "flags": {
415
+ "configName": {
416
+ "char": "c",
417
+ "description": "The costumer config name",
418
+ "name": "configName",
419
+ "required": false,
420
+ "default": "production",
421
+ "hasDynamicHelp": false,
422
+ "multiple": false,
423
+ "type": "option"
424
+ },
425
+ "variations": {
426
+ "description": "One variation to compare against desktop, or two to compare with each other: mobile, or tablet,mobile. A custom variation works too; an empty one asks which",
427
+ "name": "variations",
428
+ "delimiter": ",",
429
+ "hasDynamicHelp": false,
430
+ "multiple": true,
431
+ "type": "option"
432
+ },
433
+ "against": {
434
+ "description": "Compare the page against this other page, both requested and rendered the same way: ?color=red against ?color=blue. Replaces the parameter check",
435
+ "name": "against",
436
+ "hasDynamicHelp": false,
437
+ "multiple": false,
438
+ "type": "option"
439
+ },
440
+ "variation": {
441
+ "description": "The one variation the pages are requested in, for --against or the parameter check: mobile, tablet or a custom one; an empty one asks which. Defaults to desktop",
442
+ "name": "variation",
443
+ "hasDynamicHelp": false,
444
+ "multiple": false,
445
+ "type": "option"
446
+ },
447
+ "baseline": {
448
+ "description": "Fetch every side twice and ignore what differs between the two, such as nonces, timestamps or reordered preloads. Doubles the requests: 4 per comparison",
449
+ "name": "baseline",
450
+ "allowNo": false,
451
+ "type": "boolean"
452
+ },
453
+ "params": {
454
+ "description": "With --variations, also check the query parameters, once for each of the two variations. Without --variations it is what sk diff does",
455
+ "name": "params",
456
+ "allowNo": false,
457
+ "type": "boolean"
458
+ },
459
+ "param": {
460
+ "description": "Check only this query parameter of the url: sort. Several, as sort,page or repeated, are removed together; an empty one asks which. Implies --params with --variations",
461
+ "name": "param",
462
+ "hasDynamicHelp": false,
463
+ "multiple": true,
464
+ "type": "option"
465
+ },
466
+ "output": {
467
+ "char": "o",
468
+ "description": "How a diff is shown: the diff tool, a unified patch, JSON, or only the verdict. Defaults to the tool at a terminal and to a patch otherwise",
469
+ "name": "output",
470
+ "hasDynamicHelp": false,
471
+ "multiple": false,
472
+ "options": [
473
+ "tool",
474
+ "patch",
475
+ "json",
476
+ "none"
477
+ ],
478
+ "type": "option"
479
+ },
480
+ "raw": {
481
+ "description": "Compare the origin's HTML as it is, without running the customer's documentHandler",
482
+ "name": "raw",
483
+ "allowNo": false,
484
+ "type": "boolean"
485
+ },
486
+ "ignore": {
487
+ "description": "Remove what this regex matches from both sides before comparing, e.g. a nonce or a timestamp",
488
+ "name": "ignore",
489
+ "hasDynamicHelp": false,
490
+ "multiple": true,
491
+ "type": "option"
492
+ },
493
+ "browserFetch": {
494
+ "description": "Fetch every page through a headless Chrome, for an origin whose bot protection refuses a direct request. Needs the customer path",
495
+ "name": "browserFetch",
496
+ "allowNo": false,
497
+ "type": "boolean"
498
+ },
499
+ "host": {
500
+ "description": "Send this Host header, emulating an origin-map host override",
501
+ "name": "host",
502
+ "hasDynamicHelp": false,
503
+ "multiple": false,
504
+ "type": "option"
505
+ },
506
+ "variationsFile": {
507
+ "description": "Resolve the requests against a runtime config in a local file instead of the app's deployed one",
508
+ "name": "variationsFile",
509
+ "hasDynamicHelp": false,
510
+ "multiple": false,
511
+ "type": "option"
512
+ },
385
513
  "hideDiff": {
386
514
  "char": "h",
387
- "description": "Hide the code diff in IDE code diff window",
515
+ "deprecated": {
516
+ "to": "output"
517
+ },
518
+ "description": "Show no diff; the same as --output none",
519
+ "hidden": true,
388
520
  "name": "hideDiff",
389
521
  "allowNo": false,
390
522
  "type": "boolean"
@@ -392,7 +524,7 @@
392
524
  },
393
525
  "hasDynamicHelp": false,
394
526
  "hiddenAliases": [],
395
- "id": "diff-url-parameters",
527
+ "id": "diff",
396
528
  "pluginAlias": "@speedkit/cli",
397
529
  "pluginName": "@speedkit/cli",
398
530
  "pluginType": "core",
@@ -402,7 +534,7 @@
402
534
  "relativePath": [
403
535
  "dist",
404
536
  "commands",
405
- "diff-url-parameters.js"
537
+ "diff.js"
406
538
  ]
407
539
  },
408
540
  "find-pops": {
@@ -1333,6 +1465,149 @@
1333
1465
  "setup.js"
1334
1466
  ]
1335
1467
  },
1468
+ "extension:add": {
1469
+ "aliases": [],
1470
+ "args": {
1471
+ "ref": {
1472
+ "description": "Chrome Web Store link or extension id",
1473
+ "name": "ref",
1474
+ "required": false
1475
+ }
1476
+ },
1477
+ "description": "Install a Chrome extension into the onboarding browser by Web Store link or id",
1478
+ "examples": [
1479
+ "$ sk extension add fmkadmapgofadopljbjfkapdkoienihi",
1480
+ "$ sk extension add https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi",
1481
+ "$ sk extension add"
1482
+ ],
1483
+ "flags": {},
1484
+ "hasDynamicHelp": false,
1485
+ "hiddenAliases": [],
1486
+ "id": "extension:add",
1487
+ "pluginAlias": "@speedkit/cli",
1488
+ "pluginName": "@speedkit/cli",
1489
+ "pluginType": "core",
1490
+ "strict": true,
1491
+ "enableJsonFlag": false,
1492
+ "isESM": true,
1493
+ "relativePath": [
1494
+ "dist",
1495
+ "commands",
1496
+ "extension",
1497
+ "add.js"
1498
+ ]
1499
+ },
1500
+ "extension:devtools": {
1501
+ "aliases": [],
1502
+ "args": {},
1503
+ "description": "Install the integration-devtools extension for the onboarding browser, or update it to the latest release",
1504
+ "examples": [
1505
+ "$ sk extension devtools",
1506
+ "$ sk extension devtools --force"
1507
+ ],
1508
+ "flags": {
1509
+ "force": {
1510
+ "description": "reinstall the latest release even when it is up to date",
1511
+ "name": "force",
1512
+ "allowNo": false,
1513
+ "type": "boolean"
1514
+ }
1515
+ },
1516
+ "hasDynamicHelp": false,
1517
+ "hiddenAliases": [],
1518
+ "id": "extension:devtools",
1519
+ "pluginAlias": "@speedkit/cli",
1520
+ "pluginName": "@speedkit/cli",
1521
+ "pluginType": "core",
1522
+ "strict": true,
1523
+ "enableJsonFlag": false,
1524
+ "isESM": true,
1525
+ "relativePath": [
1526
+ "dist",
1527
+ "commands",
1528
+ "extension",
1529
+ "devtools.js"
1530
+ ]
1531
+ },
1532
+ "extension:list": {
1533
+ "aliases": [],
1534
+ "args": {},
1535
+ "description": "List Chrome extensions managed by the setup wizard",
1536
+ "examples": [
1537
+ "$ sk extension list"
1538
+ ],
1539
+ "flags": {},
1540
+ "hasDynamicHelp": false,
1541
+ "hiddenAliases": [],
1542
+ "id": "extension:list",
1543
+ "pluginAlias": "@speedkit/cli",
1544
+ "pluginName": "@speedkit/cli",
1545
+ "pluginType": "core",
1546
+ "strict": true,
1547
+ "enableJsonFlag": false,
1548
+ "isESM": true,
1549
+ "relativePath": [
1550
+ "dist",
1551
+ "commands",
1552
+ "extension",
1553
+ "list.js"
1554
+ ]
1555
+ },
1556
+ "extension:remove": {
1557
+ "aliases": [],
1558
+ "args": {
1559
+ "ref": {
1560
+ "description": "Chrome Web Store link or extension id",
1561
+ "name": "ref",
1562
+ "required": false
1563
+ }
1564
+ },
1565
+ "description": "Remove a managed Chrome extension",
1566
+ "examples": [
1567
+ "$ sk extension remove",
1568
+ "$ sk extension remove <id>"
1569
+ ],
1570
+ "flags": {},
1571
+ "hasDynamicHelp": false,
1572
+ "hiddenAliases": [],
1573
+ "id": "extension:remove",
1574
+ "pluginAlias": "@speedkit/cli",
1575
+ "pluginName": "@speedkit/cli",
1576
+ "pluginType": "core",
1577
+ "strict": true,
1578
+ "enableJsonFlag": false,
1579
+ "isESM": true,
1580
+ "relativePath": [
1581
+ "dist",
1582
+ "commands",
1583
+ "extension",
1584
+ "remove.js"
1585
+ ]
1586
+ },
1587
+ "extension:update": {
1588
+ "aliases": [],
1589
+ "args": {},
1590
+ "description": "Check managed Chrome extensions for updates and install them",
1591
+ "examples": [
1592
+ "$ sk extension update"
1593
+ ],
1594
+ "flags": {},
1595
+ "hasDynamicHelp": false,
1596
+ "hiddenAliases": [],
1597
+ "id": "extension:update",
1598
+ "pluginAlias": "@speedkit/cli",
1599
+ "pluginName": "@speedkit/cli",
1600
+ "pluginType": "core",
1601
+ "strict": true,
1602
+ "enableJsonFlag": false,
1603
+ "isESM": true,
1604
+ "relativePath": [
1605
+ "dist",
1606
+ "commands",
1607
+ "extension",
1608
+ "update.js"
1609
+ ]
1610
+ },
1336
1611
  "query:parameter": {
1337
1612
  "aliases": [
1338
1613
  "build-parameter-query"
@@ -1643,150 +1918,7 @@
1643
1918
  "query",
1644
1919
  "prewarm.js"
1645
1920
  ]
1646
- },
1647
- "extension:add": {
1648
- "aliases": [],
1649
- "args": {
1650
- "ref": {
1651
- "description": "Chrome Web Store link or extension id",
1652
- "name": "ref",
1653
- "required": false
1654
- }
1655
- },
1656
- "description": "Install a Chrome extension into the onboarding browser by Web Store link or id",
1657
- "examples": [
1658
- "$ sk extension add fmkadmapgofadopljbjfkapdkoienihi",
1659
- "$ sk extension add https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi",
1660
- "$ sk extension add"
1661
- ],
1662
- "flags": {},
1663
- "hasDynamicHelp": false,
1664
- "hiddenAliases": [],
1665
- "id": "extension:add",
1666
- "pluginAlias": "@speedkit/cli",
1667
- "pluginName": "@speedkit/cli",
1668
- "pluginType": "core",
1669
- "strict": true,
1670
- "enableJsonFlag": false,
1671
- "isESM": true,
1672
- "relativePath": [
1673
- "dist",
1674
- "commands",
1675
- "extension",
1676
- "add.js"
1677
- ]
1678
- },
1679
- "extension:devtools": {
1680
- "aliases": [],
1681
- "args": {},
1682
- "description": "Install the integration-devtools extension for the onboarding browser, or update it to the latest release",
1683
- "examples": [
1684
- "$ sk extension devtools",
1685
- "$ sk extension devtools --force"
1686
- ],
1687
- "flags": {
1688
- "force": {
1689
- "description": "reinstall the latest release even when it is up to date",
1690
- "name": "force",
1691
- "allowNo": false,
1692
- "type": "boolean"
1693
- }
1694
- },
1695
- "hasDynamicHelp": false,
1696
- "hiddenAliases": [],
1697
- "id": "extension:devtools",
1698
- "pluginAlias": "@speedkit/cli",
1699
- "pluginName": "@speedkit/cli",
1700
- "pluginType": "core",
1701
- "strict": true,
1702
- "enableJsonFlag": false,
1703
- "isESM": true,
1704
- "relativePath": [
1705
- "dist",
1706
- "commands",
1707
- "extension",
1708
- "devtools.js"
1709
- ]
1710
- },
1711
- "extension:list": {
1712
- "aliases": [],
1713
- "args": {},
1714
- "description": "List Chrome extensions managed by the setup wizard",
1715
- "examples": [
1716
- "$ sk extension list"
1717
- ],
1718
- "flags": {},
1719
- "hasDynamicHelp": false,
1720
- "hiddenAliases": [],
1721
- "id": "extension:list",
1722
- "pluginAlias": "@speedkit/cli",
1723
- "pluginName": "@speedkit/cli",
1724
- "pluginType": "core",
1725
- "strict": true,
1726
- "enableJsonFlag": false,
1727
- "isESM": true,
1728
- "relativePath": [
1729
- "dist",
1730
- "commands",
1731
- "extension",
1732
- "list.js"
1733
- ]
1734
- },
1735
- "extension:remove": {
1736
- "aliases": [],
1737
- "args": {
1738
- "ref": {
1739
- "description": "Chrome Web Store link or extension id",
1740
- "name": "ref",
1741
- "required": false
1742
- }
1743
- },
1744
- "description": "Remove a managed Chrome extension",
1745
- "examples": [
1746
- "$ sk extension remove",
1747
- "$ sk extension remove <id>"
1748
- ],
1749
- "flags": {},
1750
- "hasDynamicHelp": false,
1751
- "hiddenAliases": [],
1752
- "id": "extension:remove",
1753
- "pluginAlias": "@speedkit/cli",
1754
- "pluginName": "@speedkit/cli",
1755
- "pluginType": "core",
1756
- "strict": true,
1757
- "enableJsonFlag": false,
1758
- "isESM": true,
1759
- "relativePath": [
1760
- "dist",
1761
- "commands",
1762
- "extension",
1763
- "remove.js"
1764
- ]
1765
- },
1766
- "extension:update": {
1767
- "aliases": [],
1768
- "args": {},
1769
- "description": "Check managed Chrome extensions for updates and install them",
1770
- "examples": [
1771
- "$ sk extension update"
1772
- ],
1773
- "flags": {},
1774
- "hasDynamicHelp": false,
1775
- "hiddenAliases": [],
1776
- "id": "extension:update",
1777
- "pluginAlias": "@speedkit/cli",
1778
- "pluginName": "@speedkit/cli",
1779
- "pluginType": "core",
1780
- "strict": true,
1781
- "enableJsonFlag": false,
1782
- "isESM": true,
1783
- "relativePath": [
1784
- "dist",
1785
- "commands",
1786
- "extension",
1787
- "update.js"
1788
- ]
1789
1921
  }
1790
1922
  },
1791
- "version": "4.44.0-beta.3"
1923
+ "version": "4.44.1"
1792
1924
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@speedkit/cli",
3
3
  "description": "Speed Kit CLI",
4
- "version": "4.44.0-beta.3",
4
+ "version": "4.44.1",
5
5
  "author": {
6
6
  "name": "Baqend.com",
7
7
  "email": "info@baqend.com"
@@ -110,7 +110,6 @@
110
110
  "@oclif/plugin-help": "^6.2.45",
111
111
  "@oclif/plugin-not-found": "^3.2.81",
112
112
  "@oclif/plugin-warn-if-update-available": "^3.1.61",
113
- "@speedkit/packjockel": "3.0.0",
114
113
  "@speedkit/rules": "^1.3.0-0",
115
114
  "baqend": "^4.2.5",
116
115
  "chalk": "^5.6.2",
@@ -1,19 +0,0 @@
1
- import { Config } from "@oclif/core";
2
- import { SkCommand } from "../base/sk-command.js";
3
- import { CliServiceInterface } from "../services/cli/index.js";
4
- export default class DiffUrlParameters extends SkCommand {
5
- cli: CliServiceInterface;
6
- static description: string;
7
- static aliases: string[];
8
- static deprecateAliases: boolean;
9
- static args: {
10
- pageUrl: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
11
- };
12
- static flags: {
13
- hideDiff: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- };
15
- static examples: string[];
16
- constructor(argv: string[], config: Config);
17
- logError(message: any): void;
18
- run(): Promise<void>;
19
- }
@@ -1,121 +0,0 @@
1
- import { Args, Flags } from "@oclif/core";
2
- import { SkCommand } from "../base/sk-command.js";
3
- import { originFetch } from "../helpers/origin-proxy.js";
4
- import * as url from "node:url";
5
- import { DiffServiceBuildContext, DiffServiceFactory, } from "../services/diff/index.js";
6
- import { formatHtml } from "../services/diff/index.js";
7
- /**
8
- * Fetch a page for diffing, or null when the origin does not answer with 200 —
9
- * the command reports the miss itself and carries on with what it did get.
10
- */
11
- async function scrape(url) {
12
- const response = await originFetch(url);
13
- return response.status === 200 ? response.text() : null;
14
- }
15
- export default class DiffUrlParameters extends SkCommand {
16
- cli;
17
- static description = "Shows difference in documents with query parameters on/off";
18
- static aliases = ["param-diff"];
19
- static deprecateAliases = true;
20
- static args = {
21
- pageUrl: Args.string({
22
- name: "pageUrl",
23
- required: true,
24
- description: "Link of the page",
25
- example: "https://www.decathlon.de/",
26
- }),
27
- };
28
- static flags = {
29
- hideDiff: Flags.boolean({
30
- char: "h",
31
- description: "Hide the code diff in IDE code diff window",
32
- }),
33
- };
34
- static examples = [
35
- `$ sk prewarm <pageUrl> -h`,
36
- `$ sk prewarm https://www.decathlon.de/ -h`,
37
- ];
38
- constructor(argv, config) {
39
- super(argv, config);
40
- this.cli = this.environment.cli;
41
- }
42
- logError(message) {
43
- this.cli.spacer();
44
- this.cli.writeError(message);
45
- this.cli.exit(1);
46
- }
47
- async run() {
48
- const { args, flags } = await this.parse(DiffUrlParameters);
49
- const { pageUrl: originalUrl } = args;
50
- const originalData = await scrape(originalUrl);
51
- if (!originalData) {
52
- this.logError("Failed to fetch original document");
53
- }
54
- const parsedUrl = url.parse(originalUrl, true);
55
- const withoutAnyParametersUrl = url.format({
56
- protocol: parsedUrl.protocol,
57
- host: parsedUrl.host,
58
- pathname: parsedUrl.pathname,
59
- });
60
- const withoutAnyParametersData = await scrape(withoutAnyParametersUrl);
61
- if (!withoutAnyParametersData) {
62
- this.logError("Failed to fetch document without any params");
63
- }
64
- const environment = this.environment;
65
- const context = new DiffServiceBuildContext({
66
- environment,
67
- executablePath: environment.settings.diffExec,
68
- executableTemplate: environment.settings.diffExecTemplate,
69
- });
70
- const diffService = new DiffServiceFactory(context).getService();
71
- const originalFilePath = await diffService.writeContentToTemporalFile("original.html", formatHtml(originalData));
72
- const withoutAnyParametersFilePath = await diffService.writeContentToTemporalFile("without-any-params.html", formatHtml(withoutAnyParametersData));
73
- this.cli.spacer();
74
- this.cli.write(`Checking any parameter...`);
75
- this.cli.write(`- with: ${originalUrl}`);
76
- this.cli.write(`- without: ${withoutAnyParametersUrl}`);
77
- const isEqual = await diffService.executeDiff(originalFilePath, withoutAnyParametersFilePath, flags.hideDiff);
78
- if (isEqual) {
79
- this.cli.writeSuccess(`✅ No diff found`);
80
- return;
81
- }
82
- this.cli.writeWarning("⚠️ Found diff");
83
- // If there is more than one query params given &
84
- // there's a difference in the general check, do a detailed check:
85
- if (Object.keys(parsedUrl.query).length === 1)
86
- return;
87
- for (const parameter in parsedUrl.query) {
88
- const withoutCurrentParameterQuery = { ...parsedUrl.query };
89
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
90
- delete withoutCurrentParameterQuery[parameter]; // Remove the current parameter
91
- const withoutCurrentParameterUrl = url.format({
92
- protocol: parsedUrl.protocol,
93
- host: parsedUrl.host,
94
- pathname: parsedUrl.pathname,
95
- query: withoutCurrentParameterQuery,
96
- });
97
- const withoutCurrentParameterData = await scrape(withoutCurrentParameterUrl);
98
- if (!withoutCurrentParameterData) {
99
- this.logError(`Failed to fetch document without "${parameter}" parameter`);
100
- }
101
- const withoutCurrentParameterFilePath = await diffService.writeContentToTemporalFile(`without-${parameter}-param.html`, formatHtml(withoutCurrentParameterData));
102
- this.cli.spacer();
103
- this.cli.write(`Checking "${parameter}" parameter...`);
104
- this.cli.write(`- with: ${originalUrl}`);
105
- this.cli.write(`- without: ${withoutCurrentParameterUrl}`);
106
- const hasSpecificDiff = !(await diffService.executeDiff(originalFilePath, withoutCurrentParameterFilePath, flags.hideDiff));
107
- if (hasSpecificDiff) {
108
- const hasDiffWithoutAnyParameters = !(await diffService.executeDiff(withoutAnyParametersFilePath, withoutCurrentParameterFilePath, true));
109
- if (hasDiffWithoutAnyParameters) {
110
- this.cli.writeWarning("⚠️ Found diff");
111
- }
112
- else {
113
- this.cli.writeWarning("⚠️ Found diff (identical with having all params removed)");
114
- }
115
- }
116
- else {
117
- this.cli.writeSuccess(`✅ No diff found`);
118
- }
119
- }
120
- }
121
- }
@@ -1,3 +0,0 @@
1
- import ApplicationError from "../../error-handling/error/application-error.js";
2
- export declare class PackjockelError extends ApplicationError {
3
- }
@@ -1,3 +0,0 @@
1
- import ApplicationError from "../../error-handling/error/application-error.js";
2
- export class PackjockelError extends ApplicationError {
3
- }