@speedkit/cli 4.44.0-beta.4 → 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.
- package/CHANGELOG.md +35 -13
- package/README.md +68 -42
- 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/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-factory.js +19 -1
- 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/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 +151 -19
- 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/oclif.manifest.json
CHANGED
|
@@ -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
|
-
"
|
|
327
|
-
"
|
|
328
|
-
|
|
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
|
-
"
|
|
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
|
|
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": "
|
|
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":
|
|
395
|
+
"required": false
|
|
376
396
|
}
|
|
377
397
|
},
|
|
378
|
-
"
|
|
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
|
|
382
|
-
"$ sk
|
|
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
|
-
"
|
|
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
|
|
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
|
|
537
|
+
"diff.js"
|
|
406
538
|
]
|
|
407
539
|
},
|
|
408
540
|
"find-pops": {
|
|
@@ -1788,5 +1920,5 @@
|
|
|
1788
1920
|
]
|
|
1789
1921
|
}
|
|
1790
1922
|
},
|
|
1791
|
-
"version": "4.44.
|
|
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.
|
|
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.1.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,72 +0,0 @@
|
|
|
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
|
-
rumPluginVersion?: 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 PackjockelDocumentHandlerRequest {
|
|
25
|
-
/** The document handler library; without it packjockel bundles the published one of `documentHandlerVersion`. */
|
|
26
|
-
documentHandler?: string;
|
|
27
|
-
documentHandlerConfig: string;
|
|
28
|
-
speedKitConfig: string;
|
|
29
|
-
appName: string;
|
|
30
|
-
dynamicFetcher?: string;
|
|
31
|
-
dynamicFetcherConfig?: string;
|
|
32
|
-
customStyle?: string;
|
|
33
|
-
versions?: AssetVersions;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Bundles with the packjockel binary in embedded mode, so no packjockel server is needed.
|
|
37
|
-
*
|
|
38
|
-
* Every input goes to the binary as a file, because a document handler is too large for one
|
|
39
|
-
* command line argument.
|
|
40
|
-
*/
|
|
41
|
-
export declare class PackjockelService {
|
|
42
|
-
private readonly resolveBinary;
|
|
43
|
-
/**
|
|
44
|
-
* @param resolveBinary returns the packjockel binary; it runs only when a bundle is needed, so
|
|
45
|
-
* a platform without a packjockel package fails only for the `enableSpeedKitConfigPlugins` feature
|
|
46
|
-
*/
|
|
47
|
-
constructor(resolveBinary?: () => string);
|
|
48
|
-
/**
|
|
49
|
-
* Bundles the entry points in their order into one script. packjockel puts a script before them
|
|
50
|
-
* which exposes the `SpeedKit` global.
|
|
51
|
-
*
|
|
52
|
-
* @returns the bundled code
|
|
53
|
-
*/
|
|
54
|
-
bundle(request: PackjockelBundleRequest): Promise<string>;
|
|
55
|
-
/**
|
|
56
|
-
* Bundles a document handler with its config, the embedded Speed Kit config and the default `post`.
|
|
57
|
-
*
|
|
58
|
-
* @returns the code of one CommonJS module, which exports `post`
|
|
59
|
-
*/
|
|
60
|
-
bundleDocumentHandler(request: PackjockelDocumentHandlerRequest): Promise<string>;
|
|
61
|
-
/**
|
|
62
|
-
* Runs packjockel in a scratch directory, which is removed afterwards.
|
|
63
|
-
*
|
|
64
|
-
* @param buildArgs writes the inputs into the directory and returns the arguments that read them
|
|
65
|
-
*/
|
|
66
|
-
private run;
|
|
67
|
-
/**
|
|
68
|
-
* Runs the binary without stdin: packjockel reads a piped stdin as the document handler, and only
|
|
69
|
-
* without input it bundles the published one.
|
|
70
|
-
*/
|
|
71
|
-
private execute;
|
|
72
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
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
|
-
rumPluginVersion: "--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 a document handler with its config, the embedded Speed Kit config and the default `post`.
|
|
55
|
-
*
|
|
56
|
-
* @returns the code of one CommonJS module, which exports `post`
|
|
57
|
-
*/
|
|
58
|
-
async bundleDocumentHandler(request) {
|
|
59
|
-
return this.run(async (directory) => {
|
|
60
|
-
const args = ["bundle", "document-handler"];
|
|
61
|
-
if (request.documentHandler !== undefined) {
|
|
62
|
-
args.push(await writeInput(directory, "DocumentHandler.js", request.documentHandler));
|
|
63
|
-
}
|
|
64
|
-
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}`);
|
|
65
|
-
const optional = {
|
|
66
|
-
"dynamic-fetcher": ["dynamicFetcher.js", request.dynamicFetcher],
|
|
67
|
-
"dynamic-fetcher-config": [
|
|
68
|
-
"dynamicFetcherConfig.js",
|
|
69
|
-
request.dynamicFetcherConfig,
|
|
70
|
-
],
|
|
71
|
-
"custom-style": ["customStyle.css", request.customStyle],
|
|
72
|
-
};
|
|
73
|
-
for (const [flag, [name, value]] of Object.entries(optional)) {
|
|
74
|
-
if (value) {
|
|
75
|
-
args.push(`--${flag}=${await writeInput(directory, name, value)}`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return args;
|
|
79
|
-
}, request.versions);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Runs packjockel in a scratch directory, which is removed afterwards.
|
|
83
|
-
*
|
|
84
|
-
* @param buildArgs writes the inputs into the directory and returns the arguments that read them
|
|
85
|
-
*/
|
|
86
|
-
async run(buildArgs, versions = {}) {
|
|
87
|
-
const directory = await mkdtemp(join(tmpdir(), "sk-packjockel-"));
|
|
88
|
-
try {
|
|
89
|
-
const output = join(directory, "out.js");
|
|
90
|
-
const args = [
|
|
91
|
-
...(await buildArgs(directory)),
|
|
92
|
-
...versionFlags(versions),
|
|
93
|
-
"--embedded",
|
|
94
|
-
`--output=${output}`,
|
|
95
|
-
];
|
|
96
|
-
await this.execute(args);
|
|
97
|
-
return await readFile(output, "utf8");
|
|
98
|
-
}
|
|
99
|
-
finally {
|
|
100
|
-
await rm(directory, { recursive: true, force: true });
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Runs the binary without stdin: packjockel reads a piped stdin as the document handler, and only
|
|
105
|
-
* without input it bundles the published one.
|
|
106
|
-
*/
|
|
107
|
-
execute(args) {
|
|
108
|
-
let binary;
|
|
109
|
-
try {
|
|
110
|
-
binary = this.resolveBinary();
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
return Promise.reject(new PackjockelError(error.message));
|
|
114
|
-
}
|
|
115
|
-
return new Promise((resolve, reject) => {
|
|
116
|
-
const child = spawn(binary, args, {
|
|
117
|
-
stdio: ["ignore", "ignore", "pipe"],
|
|
118
|
-
});
|
|
119
|
-
let stderr = "";
|
|
120
|
-
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
121
|
-
child.on("error", (error) => reject(new PackjockelError(`packjockel failed: ${error.message}`)));
|
|
122
|
-
child.on("close", (code) => {
|
|
123
|
-
if (code === 0) {
|
|
124
|
-
resolve();
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
reject(new PackjockelError(`packjockel failed: ${withoutLogLines(stderr) || `exit code ${code}`}`));
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
/** Writes one input into the scratch directory and returns the `file://` value that reads it. */
|
|
134
|
-
async function writeInput(directory, name, content) {
|
|
135
|
-
const path = join(directory, name);
|
|
136
|
-
await writeFile(path, content);
|
|
137
|
-
return `file://${path}`;
|
|
138
|
-
}
|
|
139
|
-
/** The flags of the tags that are set. */
|
|
140
|
-
function versionFlags(versions) {
|
|
141
|
-
return Object.entries(VERSION_FLAGS)
|
|
142
|
-
.filter(([key]) => versions[key])
|
|
143
|
-
.map(([key, flag]) => `${flag}=${versions[key]}`);
|
|
144
|
-
}
|
|
145
|
-
function keyValueFlags(flag, values = {}) {
|
|
146
|
-
return Object.entries(values).map(([key, value]) => `${flag}=${key}=${value}`);
|
|
147
|
-
}
|
|
148
|
-
/** packjockel and its cache log to stderr as well; the error is in the remaining lines. */
|
|
149
|
-
function withoutLogLines(stderr = "") {
|
|
150
|
-
return stderr
|
|
151
|
-
.split("\n")
|
|
152
|
-
.filter((line) => line.trim() &&
|
|
153
|
-
!line.startsWith("time=") &&
|
|
154
|
-
!/^\d{4}\/\d{2}\/\d{2} /.test(line))
|
|
155
|
-
.join("\n");
|
|
156
|
-
}
|