@speedkit/cli 4.36.1 → 4.37.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 +14 -0
- package/README.md +12 -5
- package/dist/base/sk-command.d.ts +41 -0
- package/dist/base/sk-command.js +56 -0
- package/dist/commands/auto-prewarm.d.ts +6 -4
- package/dist/commands/auto-prewarm.js +13 -66
- package/dist/commands/autocomplete/fish.d.ts +2 -2
- package/dist/commands/autocomplete/fish.js +3 -2
- package/dist/commands/browser/clean.d.ts +2 -2
- package/dist/commands/browser/clean.js +6 -6
- package/dist/commands/browser/list.d.ts +2 -2
- package/dist/commands/browser/list.js +6 -7
- package/dist/commands/browser/update.d.ts +2 -2
- package/dist/commands/browser/update.js +9 -11
- package/dist/commands/bulk-deploy.d.ts +4 -2
- package/dist/commands/bulk-deploy.js +7 -37
- package/dist/commands/config/edit.d.ts +2 -2
- package/dist/commands/config/edit.js +2 -2
- package/dist/commands/config/setup.d.ts +5 -2
- package/dist/commands/config/setup.js +9 -19
- package/dist/commands/deploy.d.ts +12 -3
- package/dist/commands/deploy.js +14 -20
- package/dist/commands/diff-url-parameters.d.ts +3 -2
- package/dist/commands/diff-url-parameters.js +19 -16
- package/dist/commands/extension/add.d.ts +2 -2
- package/dist/commands/extension/add.js +6 -6
- package/dist/commands/extension/devtools.d.ts +2 -2
- package/dist/commands/extension/devtools.js +6 -7
- package/dist/commands/extension/list.d.ts +2 -2
- package/dist/commands/extension/list.js +5 -6
- package/dist/commands/extension/remove.d.ts +2 -2
- package/dist/commands/extension/remove.js +6 -6
- package/dist/commands/extension/update.d.ts +2 -2
- package/dist/commands/extension/update.js +5 -6
- package/dist/commands/find-pops.d.ts +2 -2
- package/dist/commands/find-pops.js +10 -11
- package/dist/commands/generate-customer-config.d.ts +5 -2
- package/dist/commands/generate-customer-config.js +9 -27
- package/dist/commands/generate-pop-config.d.ts +2 -2
- package/dist/commands/generate-pop-config.js +19 -15
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +6 -9
- package/dist/commands/onboarding.d.ts +19 -3
- package/dist/commands/onboarding.js +15 -11
- package/dist/commands/origin-request.d.ts +4 -2
- package/dist/commands/origin-request.js +10 -42
- package/dist/commands/prewarm.d.ts +4 -2
- package/dist/commands/prewarm.js +12 -56
- package/dist/commands/pull.d.ts +4 -2
- package/dist/commands/pull.js +9 -14
- package/dist/commands/query/parameter.d.ts +4 -2
- package/dist/commands/query/parameter.js +12 -19
- package/dist/commands/query/prewarm.d.ts +4 -2
- package/dist/commands/query/prewarm.js +16 -23
- package/dist/commands/revalidate.d.ts +4 -2
- package/dist/commands/revalidate.js +13 -56
- package/dist/commands/wpt-launcher.d.ts +2 -2
- package/dist/commands/wpt-launcher.js +16 -17
- package/dist/hooks/init/first-run.js +9 -10
- package/dist/models/context.d.ts +24 -0
- package/dist/models/context.js +31 -0
- package/dist/services/athena/athena-flags.d.ts +18 -0
- package/dist/services/athena/athena-flags.js +29 -0
- package/dist/services/athena/athena-service-build-context.d.ts +25 -0
- package/dist/services/athena/athena-service-build-context.js +4 -0
- package/dist/services/athena/athena-service-factory.d.ts +3 -16
- package/dist/services/athena/athena-service-factory.js +11 -27
- package/dist/services/athena/baqend-athena-service.d.ts +3 -14
- package/dist/services/athena/baqend-athena-service.js +8 -16
- package/dist/services/athena/index.d.ts +1 -0
- package/dist/services/athena/index.js +1 -0
- package/dist/services/athena/spec/baqend-athena-service.spec.js +2 -2
- package/dist/services/browser-fetch/browser-origin-fetch.d.ts +2 -2
- package/dist/services/browser-fetch/browser-origin-fetch.js +1 -1
- package/dist/services/browser-fetch/browser-origin-fetcher.d.ts +3 -3
- package/dist/services/browser-fetch/browser-origin-fetcher.js +5 -5
- package/dist/services/browser-fetch/spec/browser-origin-fetch.spec.js +10 -10
- package/dist/services/cli/cli-environment-factory.d.ts +25 -0
- package/dist/services/cli/cli-environment-factory.js +30 -0
- package/dist/services/cli/cli-environment.d.ts +73 -0
- package/dist/services/cli/cli-environment.js +216 -0
- package/dist/services/cli/cli-service-build-context.d.ts +10 -0
- package/dist/services/cli/cli-service-build-context.js +4 -0
- package/dist/services/cli/cli-service-factory.d.ts +7 -7
- package/dist/services/cli/cli-service-factory.js +7 -7
- package/dist/services/cli/cli-service-model.d.ts +0 -4
- package/dist/services/cli/cli-service-model.js +0 -6
- package/dist/services/cli/cli-service.d.ts +16 -2
- package/dist/services/cli/cli-service.js +17 -18
- package/dist/services/cli/cli-settings.d.ts +37 -0
- package/dist/services/cli/cli-settings.js +23 -0
- package/dist/services/cli/command-build-context.d.ts +23 -0
- package/dist/services/cli/index.d.ts +5 -1
- package/dist/services/cli/index.js +5 -1
- package/dist/services/cli/spec/cli-environment-detection.spec.js +52 -0
- package/dist/services/cli/spec/cli-environment.spec.js +125 -0
- package/dist/services/cli/spec/cli-service.spec.js +9 -19
- package/dist/services/config-api/client.d.ts +3 -3
- package/dist/services/config-api/client.js +4 -4
- package/dist/services/config-api/config-api-factory.js +3 -3
- package/dist/services/config-api/entity-manager-provider.d.ts +11 -0
- package/dist/services/config-api/{entity-manager-factory.js → entity-manager-provider.js} +7 -1
- package/dist/services/customer-config/customer-config-service-build-context.d.ts +33 -0
- package/dist/services/customer-config/customer-config-service-build-context.js +36 -0
- package/dist/services/customer-config/customer-config-service-factory.d.ts +3 -4
- package/dist/services/customer-config/customer-config-service-factory.js +5 -8
- package/dist/services/customer-config/customer-config-service.d.ts +2 -2
- package/dist/services/customer-config/index.d.ts +1 -1
- package/dist/services/customer-config/index.js +1 -1
- package/dist/services/customer-config/site-analyzer/index.d.ts +1 -0
- package/dist/services/customer-config/site-analyzer/index.js +1 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.d.ts +6 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-build-context.js +4 -0
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.d.ts +3 -3
- package/dist/services/customer-config/site-analyzer/site-analyzer-service-factory.js +4 -5
- package/dist/services/deploy/bulk/bulk-deploy-model.d.ts +0 -25
- package/dist/services/deploy/bulk/bulk-deploy-model.js +1 -27
- package/dist/services/deploy/bulk/bulk-deploy-service-build-context.d.ts +51 -0
- package/dist/services/deploy/bulk/bulk-deploy-service-build-context.js +50 -0
- package/dist/services/deploy/bulk/bulk-deploy-service-factory.d.ts +2 -4
- package/dist/services/deploy/bulk/bulk-deploy-service-factory.js +2 -5
- package/dist/services/deploy/bulk/bulk-deploy-service.d.ts +3 -2
- package/dist/services/deploy/bulk/config-deploy-factory.d.ts +3 -3
- package/dist/services/deploy/bulk/config-deploy-factory.js +16 -8
- package/dist/services/deploy/bulk/index.d.ts +1 -0
- package/dist/services/deploy/bulk/index.js +1 -0
- package/dist/services/deploy/checks/activation/customer-approval-check.d.ts +3 -1
- package/dist/services/deploy/checks/activation/customer-approval-check.js +4 -2
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.d.ts +3 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +4 -2
- package/dist/services/deploy/checks/pre-deploy/split-change-check.d.ts +3 -1
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +4 -2
- package/dist/services/deploy/deploy-service-build-context.d.ts +63 -0
- package/dist/services/deploy/deploy-service-build-context.js +64 -0
- package/dist/services/deploy/deploy-service-factory.d.ts +5 -8
- package/dist/services/deploy/deploy-service-factory.js +28 -19
- package/dist/services/deploy/mr/base-config-reader.d.ts +6 -4
- package/dist/services/deploy/mr/base-config-reader.js +6 -8
- package/dist/services/deploy/mr/index.d.ts +1 -0
- package/dist/services/deploy/mr/index.js +1 -0
- package/dist/services/deploy/mr/merge-request-deploy-model.d.ts +0 -35
- package/dist/services/deploy/mr/merge-request-deploy-model.js +0 -34
- package/dist/services/deploy/mr/merge-request-deploy-service-build-context.d.ts +32 -0
- package/dist/services/deploy/mr/merge-request-deploy-service-build-context.js +20 -0
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.d.ts +2 -4
- package/dist/services/deploy/mr/merge-request-deploy-service-factory.js +31 -10
- package/dist/services/deploy/mr/merge-request-deploy-service.d.ts +3 -2
- package/dist/services/deploy/spec/bulk/bulk-deploy-service.spec.js +14 -3
- package/dist/services/deploy/spec/checks/activation/customer-approval-check.spec.js +7 -5
- package/dist/services/deploy/spec/checks/pre-deploy/split-change-check.spec.js +2 -1
- package/dist/services/diff/diff-service-build-context.d.ts +14 -0
- package/dist/services/diff/diff-service-build-context.js +4 -0
- package/dist/services/diff/diff-service-factory.d.ts +4 -5
- package/dist/services/diff/diff-service-factory.js +4 -7
- package/dist/services/diff/index.d.ts +1 -1
- package/dist/services/diff/index.js +1 -1
- package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.d.ts → document-handler-runtime-model.d.ts} +0 -5
- package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.d.ts +11 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service-build-context.js +4 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +2 -2
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +3 -6
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +14 -14
- package/dist/services/document-handler-runtime/server/request.js +1 -1
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +1 -1
- package/dist/services/document-handler-runtime/templates/database-mock.js +1 -1
- package/dist/services/integration-api/customer-config-flags.d.ts +16 -0
- package/dist/services/integration-api/customer-config-flags.js +30 -0
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +8 -0
- package/dist/services/integration-api/handler/install-resource-handler.js +10 -1
- package/dist/services/integration-api/index.d.ts +1 -0
- package/dist/services/integration-api/index.js +1 -0
- package/dist/services/integration-api/integration-api-factory.d.ts +4 -6
- package/dist/services/integration-api/integration-api-factory.js +11 -11
- package/dist/services/integration-api/integration-api-model.d.ts +0 -9
- package/dist/services/integration-api/integration-api-model.js +0 -16
- package/dist/services/integration-api/integration-api-service-build-context.d.ts +19 -0
- package/dist/services/integration-api/integration-api-service-build-context.js +4 -0
- package/dist/services/integration-api/spec/config-plugin.spec.js +1 -1
- package/dist/services/integration-api/spec/integration-api-service.spec.js +7 -3
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +9 -2
- package/dist/services/integration-api/struct/config-plugin.d.ts +1 -1
- package/dist/services/integration-api/struct/config-plugin.js +12 -7
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +18 -2
- package/dist/services/integration-api/struct/speed-kit-config-file.js +22 -12
- package/dist/services/integration-api/struct/speed-kit-config.d.ts +1 -1
- package/dist/services/onboarding/browse/browse-service.d.ts +18 -0
- package/dist/services/onboarding/browse/browse-service.js +61 -0
- package/dist/services/onboarding/browse/browse-url.d.ts +10 -0
- package/dist/services/onboarding/browse/browse-url.js +19 -0
- package/dist/services/onboarding/browser/config/browser-config.d.ts +3 -3
- package/dist/services/onboarding/browser/config/browser-config.js +5 -5
- package/dist/services/onboarding/browser/executable/executable-validator.d.ts +3 -3
- package/dist/services/onboarding/browser/executable/executable-validator.js +20 -16
- package/dist/services/onboarding/browser/extension/extension-downloader.d.ts +3 -3
- package/dist/services/onboarding/browser/extension/extension-downloader.js +8 -6
- package/dist/services/onboarding/browser/extension/extension-validator.d.ts +3 -3
- package/dist/services/onboarding/browser/extension/extension-validator.js +4 -4
- package/dist/services/onboarding/browser/launch-browser.d.ts +9 -0
- package/dist/services/onboarding/browser/launch-browser.js +20 -0
- package/dist/services/onboarding/error/browse-domain-error.d.ts +6 -0
- package/dist/services/onboarding/error/browse-domain-error.js +11 -0
- package/dist/services/onboarding/error/missing-customer-path-error.d.ts +6 -0
- package/dist/services/onboarding/error/missing-customer-path-error.js +11 -0
- package/dist/services/onboarding/file-events/file-watcher.js +1 -0
- package/dist/services/onboarding/index.d.ts +1 -1
- package/dist/services/onboarding/index.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +8 -24
- package/dist/services/onboarding/onboarding-model.js +19 -87
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +61 -0
- package/dist/services/onboarding/onboarding-service-build-context.js +79 -0
- package/dist/services/onboarding/onboarding-service-factory.d.ts +31 -6
- package/dist/services/onboarding/onboarding-service-factory.js +120 -48
- package/dist/services/onboarding/onboarding-service.d.ts +2 -0
- package/dist/services/onboarding/onboarding-service.js +5 -16
- package/dist/services/onboarding/spec/browse/browse-url.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/browse/browse-url.spec.js +28 -0
- package/dist/services/onboarding/spec/onboarding-model.spec.js +11 -6
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.d.ts +1 -0
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +155 -0
- package/dist/services/origin-request/index.d.ts +1 -1
- package/dist/services/origin-request/index.js +1 -1
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +52 -0
- package/dist/services/origin-request/origin-request-service-build-context.js +54 -0
- package/dist/services/origin-request/origin-request-service-factory.d.ts +2 -5
- package/dist/services/origin-request/origin-request-service-factory.js +12 -12
- package/dist/services/origin-request/origin-request-service.d.ts +2 -2
- package/dist/services/pop-config/index.d.ts +1 -0
- package/dist/services/pop-config/index.js +1 -0
- package/dist/services/pop-config/pop-config-factory.d.ts +4 -1
- package/dist/services/pop-config/pop-config-factory.js +10 -3
- package/dist/services/pop-config/pop-config-service-build-context.d.ts +10 -0
- package/dist/services/pop-config/pop-config-service-build-context.js +4 -0
- package/dist/services/prewarm/auto-pre-warm-factory.d.ts +3 -31
- package/dist/services/prewarm/auto-pre-warm-factory.js +6 -11
- package/dist/services/prewarm/auto-pre-warm-service-build-context.d.ts +84 -0
- package/dist/services/prewarm/auto-pre-warm-service-build-context.js +68 -0
- package/dist/services/prewarm/index.d.ts +2 -0
- package/dist/services/prewarm/index.js +2 -0
- package/dist/services/prewarm/pre-warm-factory.d.ts +4 -5
- package/dist/services/prewarm/pre-warm-factory.js +6 -8
- package/dist/services/prewarm/pre-warm-model.d.ts +0 -10
- package/dist/services/prewarm/pre-warm-model.js +0 -18
- package/dist/services/prewarm/pre-warm-service-build-context.d.ts +47 -0
- package/dist/services/prewarm/pre-warm-service-build-context.js +64 -0
- package/dist/services/pull/index.d.ts +1 -0
- package/dist/services/pull/index.js +1 -0
- package/dist/services/pull/pull-service-build-context.d.ts +28 -0
- package/dist/services/pull/pull-service-build-context.js +17 -0
- package/dist/services/pull/pull-service-factory.d.ts +3 -5
- package/dist/services/pull/pull-service-factory.js +13 -14
- package/dist/services/pull/pull-service-model.d.ts +0 -5
- package/dist/services/pull/pull-service-model.js +0 -9
- package/dist/services/query-builder/query-builder-factory.d.ts +9 -7
- package/dist/services/query-builder/query-builder-factory.js +26 -15
- package/dist/{models/cli-parameters.d.ts → services/query-builder/query-builder-flags.d.ts} +1 -120
- package/dist/services/query-builder/query-builder-flags.js +150 -0
- package/dist/services/query-builder/query-builder-model.d.ts +1 -14
- package/dist/services/query-builder/query-builder-service-build-context.d.ts +113 -0
- package/dist/services/query-builder/query-builder-service-build-context.js +68 -0
- package/dist/services/query-builder/query-builder-service.d.ts +3 -3
- package/dist/services/query-builder/spec/query-builder-flags.spec.d.ts +1 -0
- package/dist/{models/spec/cli-parameters.spec.js → services/query-builder/spec/query-builder-flags.spec.js} +1 -1
- package/dist/services/revalidate/index.d.ts +1 -0
- package/dist/services/revalidate/index.js +1 -0
- package/dist/services/revalidate/revalidate-factory.d.ts +3 -5
- package/dist/services/revalidate/revalidate-factory.js +2 -6
- package/dist/services/revalidate/revalidate-model.d.ts +0 -9
- package/dist/services/revalidate/revalidate-model.js +0 -8
- package/dist/services/revalidate/revalidate-service-build-context.d.ts +38 -0
- package/dist/services/revalidate/revalidate-service-build-context.js +59 -0
- package/dist/services/setup/browser/browser-setup-service.d.ts +3 -4
- package/dist/services/setup/browser/browser-setup-service.js +16 -18
- package/dist/services/setup/difftool/difftool-setup-service.d.ts +3 -4
- package/dist/services/setup/difftool/difftool-setup-service.js +5 -7
- package/dist/services/setup/extension/extension-setup-service.d.ts +3 -4
- package/dist/services/setup/extension/extension-setup-service.js +8 -10
- package/dist/services/setup/index.d.ts +1 -1
- package/dist/services/setup/index.js +1 -1
- package/dist/services/setup/setup-service-build-context.d.ts +27 -0
- package/dist/services/setup/setup-service-build-context.js +26 -0
- package/dist/services/setup/setup-service-factory.d.ts +2 -6
- package/dist/services/setup/setup-service-factory.js +10 -18
- package/dist/services/setup/setup-service.d.ts +4 -5
- package/dist/services/setup/setup-service.js +6 -7
- package/oclif.manifest.json +155 -147
- package/package.json +4 -2
- package/dist/models/cli-parameters.js +0 -297
- package/dist/services/cli/cli-config.d.ts +0 -59
- package/dist/services/cli/cli-config.js +0 -180
- package/dist/services/cli/environment.d.ts +0 -15
- package/dist/services/cli/environment.js +0 -40
- package/dist/services/cli/spec/cli-config.spec.js +0 -117
- package/dist/services/cli/spec/environment.spec.js +0 -28
- package/dist/services/config-api/entity-manager-factory.d.ts +0 -5
- package/dist/services/customer-config/customer-config-service-context.d.ts +0 -13
- package/dist/services/customer-config/customer-config-service-context.js +0 -21
- package/dist/services/deploy/context/deploy-context.d.ts +0 -32
- package/dist/services/deploy/context/deploy-context.js +0 -72
- package/dist/services/diff/diff-model.d.ts +0 -9
- package/dist/services/diff/diff-model.js +0 -12
- package/dist/services/origin-request/origin-request-context.d.ts +0 -13
- package/dist/services/origin-request/origin-request-context.js +0 -23
- package/dist/services/query-builder/query-command.d.ts +0 -28
- package/dist/services/query-builder/query-command.js +0 -37
- package/dist/services/setup/setup-context.d.ts +0 -14
- package/dist/services/setup/setup-context.js +0 -15
- /package/dist/{models/spec/cli-parameters.spec.d.ts → services/cli/command-build-context.js} +0 -0
- /package/dist/services/cli/spec/{cli-config.spec.d.ts → cli-environment-detection.spec.d.ts} +0 -0
- /package/dist/services/cli/spec/{environment.spec.d.ts → cli-environment.spec.d.ts} +0 -0
- /package/dist/services/document-handler-runtime/{context/document-handler-runtime-context.js → document-handler-runtime-model.js} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { OriginRequestServiceBuildContext } from "../services/origin-request/index.js";
|
|
3
|
+
export default class OriginRequest extends SkCommand<OriginRequestServiceBuildContext> {
|
|
3
4
|
static description: string;
|
|
5
|
+
static buildContext: typeof OriginRequestServiceBuildContext;
|
|
4
6
|
static args: {
|
|
5
7
|
pageUrl: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
8
|
customerPath: import("@oclif/core/interfaces").Arg<string, {
|
|
@@ -1,49 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { CliConfig } from "../services/cli/index.js";
|
|
5
|
-
export default class OriginRequest extends Command {
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { OriginRequestServiceBuildContext, OriginRequestServiceFactory, } from "../services/origin-request/index.js";
|
|
3
|
+
export default class OriginRequest extends SkCommand {
|
|
6
4
|
static description = "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";
|
|
7
|
-
static
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
name: CLIParameters.PageUrl,
|
|
11
|
-
required: true,
|
|
12
|
-
description: "Page to request from origin",
|
|
13
|
-
example: CLIParametersExample.PageUrl,
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
16
|
-
static flags = {
|
|
17
|
-
...CLI_CONFIG_NAME,
|
|
18
|
-
[CLIParameters.Variation]: Flags.string({
|
|
19
|
-
char: CLIParametersChar.Variation,
|
|
20
|
-
description: "Cache variation to simulate, e.g. desktop-fmarkt-variant-e_1907090. Omitted means the default variation",
|
|
21
|
-
}),
|
|
22
|
-
host: Flags.string({
|
|
23
|
-
description: "Send this Host header, emulating an origin-map host override",
|
|
24
|
-
}),
|
|
25
|
-
body: Flags.string({
|
|
26
|
-
description: "Write the response body to this file",
|
|
27
|
-
}),
|
|
28
|
-
grep: Flags.string({
|
|
29
|
-
description: "Print body lines matching this regex, case-insensitive",
|
|
30
|
-
}),
|
|
31
|
-
json: Flags.boolean({
|
|
32
|
-
description: "Machine-readable output",
|
|
33
|
-
}),
|
|
34
|
-
variations: Flags.string({
|
|
35
|
-
description: "Simulate against a runtime config in a local file instead of the app's deployed one",
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
5
|
+
static buildContext = OriginRequestServiceBuildContext;
|
|
6
|
+
static args = OriginRequestServiceBuildContext.args;
|
|
7
|
+
static flags = OriginRequestServiceBuildContext.flags;
|
|
38
8
|
static examples = [
|
|
39
|
-
`$ sk origin-request
|
|
40
|
-
`$ sk origin-request
|
|
41
|
-
`$ sk origin-request
|
|
9
|
+
`$ sk origin-request <customerPath> <pageUrl>`,
|
|
10
|
+
`$ sk origin-request customers/decathlon.de https://www.decathlon.de/ -v mobile`,
|
|
11
|
+
`$ sk origin-request customers/decathlon.de https://www.decathlon.de/ --grep "storeId" --body /tmp/origin.html`,
|
|
42
12
|
];
|
|
43
13
|
async run() {
|
|
44
|
-
const
|
|
45
|
-
const context = new OriginRequestContext(customerPath, configName, pageUrl, variation, host, body, grep, json, variations);
|
|
46
|
-
const service = await new OriginRequestServiceFactory(context, new CliConfig(this.config).load()).buildService();
|
|
14
|
+
const service = await new OriginRequestServiceFactory(this.context).buildService();
|
|
47
15
|
await service.run();
|
|
48
16
|
}
|
|
49
17
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { PreWarmServiceBuildContext } from "../services/prewarm/index.js";
|
|
3
|
+
export default class Prewarm extends SkCommand<PreWarmServiceBuildContext> {
|
|
3
4
|
static description: string;
|
|
5
|
+
static buildContext: typeof PreWarmServiceBuildContext;
|
|
4
6
|
static args: {
|
|
5
7
|
app: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
8
|
path: import("@oclif/core/interfaces").Arg<string, {
|
package/dist/commands/prewarm.js
CHANGED
|
@@ -1,66 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export default class Prewarm extends Command {
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { PreWarmFactory, PreWarmServiceBuildContext, } from "../services/prewarm/index.js";
|
|
3
|
+
export default class Prewarm extends SkCommand {
|
|
5
4
|
static description = "Pre-warm Fastly";
|
|
6
|
-
static
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
required: true, // make the arg required with `required: true`
|
|
10
|
-
description: "The customer app name", // help description
|
|
11
|
-
}),
|
|
12
|
-
[CLIParameters.Path]: Args.file({
|
|
13
|
-
name: CLIParameters.Path, // name of arg to show in help and reference with args[name]
|
|
14
|
-
required: true, // make the arg required with `required: true`
|
|
15
|
-
description: "path to prewarmFile.csv", // help description
|
|
16
|
-
}),
|
|
17
|
-
};
|
|
18
|
-
static flags = {
|
|
19
|
-
// No default: the list may already name a variation per url, and only a
|
|
20
|
-
// flag the caller really gave should be reported as ignored then.
|
|
21
|
-
[CLIParameters.Variation]: Flags.string({
|
|
22
|
-
char: CLIParametersChar.Variation,
|
|
23
|
-
description: "Warm every url of the list in each of these variations, e.g. 'desktop,mobile'. Ignored for a list that names a variation itself",
|
|
24
|
-
}),
|
|
25
|
-
[CLIParameters.VariationPath]: Flags.file({
|
|
26
|
-
char: CLIParametersChar.VariationPath,
|
|
27
|
-
exclusive: [CLIParameters.Variation],
|
|
28
|
-
description: "path to variations.csv",
|
|
29
|
-
}),
|
|
30
|
-
[CLIParameters.KeepParameterSorting]: Flags.boolean({
|
|
31
|
-
char: CLIParametersChar.KeepParameterSorting,
|
|
32
|
-
default: false,
|
|
33
|
-
description: "Prevents alphabetical sorting of the URL parameters",
|
|
34
|
-
}),
|
|
35
|
-
[CLIParameters.Quiet]: Flags.boolean({
|
|
36
|
-
char: CLIParametersChar.Quiet,
|
|
37
|
-
default: false,
|
|
38
|
-
description: "less output non interactive",
|
|
39
|
-
}),
|
|
40
|
-
[CLIParameters.Verbose]: Flags.boolean({
|
|
41
|
-
default: false,
|
|
42
|
-
description: "Log information about failed requests",
|
|
43
|
-
}),
|
|
44
|
-
["delay"]: Flags.integer({
|
|
45
|
-
char: "d",
|
|
46
|
-
description: "Request delay in ms (deprecated)",
|
|
47
|
-
deprecated: true,
|
|
48
|
-
}),
|
|
49
|
-
};
|
|
5
|
+
static buildContext = PreWarmServiceBuildContext;
|
|
6
|
+
static args = PreWarmServiceBuildContext.args;
|
|
7
|
+
static flags = PreWarmServiceBuildContext.flags;
|
|
50
8
|
static examples = [
|
|
51
9
|
"for a single variation:",
|
|
52
|
-
`$ sk prewarm
|
|
53
|
-
`$ sk prewarm
|
|
10
|
+
`$ sk prewarm <app> <path> -v <variation> -k`,
|
|
11
|
+
`$ sk prewarm decathlon C:\\Users\\testUser\\file.csv -v MOBILE -k`,
|
|
54
12
|
"",
|
|
55
13
|
"for a list of variations:",
|
|
56
|
-
`$ sk prewarm
|
|
57
|
-
`$ sk prewarm
|
|
58
|
-
`$ sk prewarm
|
|
14
|
+
`$ sk prewarm <app> <path> -p <variationPath> -k`,
|
|
15
|
+
`$ sk prewarm decathlon C:\\Users\\testUser\\file.csv -v MOBILE,DESKTOP -k`,
|
|
16
|
+
`$ sk prewarm decathlon C:\\Users\\testUser\\file.csv -p C:\\Users\\testUser\\variations.csv -k`,
|
|
59
17
|
];
|
|
60
18
|
async run() {
|
|
61
|
-
const
|
|
62
|
-
const sortParameters = !keepParameterSorting;
|
|
63
|
-
const service = await new PreWarmFactory(new PreWarmContext(app, path, variation, variationPath, sortParameters, quiet, verbose)).getService();
|
|
19
|
+
const service = await new PreWarmFactory(this.context).getService();
|
|
64
20
|
await service.run();
|
|
65
21
|
}
|
|
66
22
|
}
|
package/dist/commands/pull.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { PullServiceBuildContext } from "../services/pull/index.js";
|
|
3
|
+
export default class Pull extends SkCommand<PullServiceBuildContext> {
|
|
3
4
|
static description: string;
|
|
5
|
+
static buildContext: typeof PullServiceBuildContext;
|
|
4
6
|
static args: {
|
|
5
7
|
customerPath: import("@oclif/core/interfaces").Arg<string, {
|
|
6
8
|
exists?: boolean;
|
package/dist/commands/pull.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { CliConfig } from "../services/cli/index.js";
|
|
5
|
-
export default class Pull extends Command {
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { PullServiceBuildContext, PullServiceFactory, } from "../services/pull/index.js";
|
|
3
|
+
export default class Pull extends SkCommand {
|
|
6
4
|
static description = "Pull the specified customer config from orestes";
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
|
|
10
|
-
};
|
|
5
|
+
static buildContext = PullServiceBuildContext;
|
|
6
|
+
static args = PullServiceBuildContext.args;
|
|
7
|
+
static flags = PullServiceBuildContext.flags;
|
|
11
8
|
static examples = [
|
|
12
|
-
`$ sk pull
|
|
13
|
-
`$ sk pull
|
|
9
|
+
`$ sk pull <customerPath>`,
|
|
10
|
+
`$ sk pull customers/decathlon.de -c production`,
|
|
14
11
|
];
|
|
15
12
|
async run() {
|
|
16
|
-
const
|
|
17
|
-
const pullContext = new PullContext(customerPath, configName);
|
|
18
|
-
const pullService = await new PullServiceFactory(pullContext, new CliConfig(this.config).load()).buildService();
|
|
13
|
+
const pullService = await new PullServiceFactory(this.context).buildService();
|
|
19
14
|
await pullService.run();
|
|
20
15
|
}
|
|
21
16
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkCommand } from "../../base/sk-command.js";
|
|
2
|
+
import { ParameterQueryServiceBuildContext } from "../../services/query-builder/query-builder-service-build-context.js";
|
|
3
|
+
export default class QueryParameter extends SkCommand<ParameterQueryServiceBuildContext> {
|
|
4
|
+
static buildContext: typeof ParameterQueryServiceBuildContext;
|
|
3
5
|
static args: {
|
|
4
6
|
customerPath: import("@oclif/core/interfaces").Arg<string, {
|
|
5
7
|
exists?: boolean;
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
static args =
|
|
1
|
+
import { SkCommand } from "../../base/sk-command.js";
|
|
2
|
+
import { QueryBuilderFactory } from "../../services/query-builder/query-builder-factory.js";
|
|
3
|
+
import { ParameterQueryServiceBuildContext } from "../../services/query-builder/query-builder-service-build-context.js";
|
|
4
|
+
export default class QueryParameter extends SkCommand {
|
|
5
|
+
static buildContext = ParameterQueryServiceBuildContext;
|
|
6
|
+
static args = ParameterQueryServiceBuildContext.args;
|
|
7
7
|
/** The command was `sk build-parameter-query` before it moved under `query`. */
|
|
8
8
|
static aliases = ["build-parameter-query"];
|
|
9
9
|
static deprecateAliases = true;
|
|
10
10
|
static description = "Build a parameter query that can be executed in Athena";
|
|
11
11
|
static examples = [
|
|
12
|
-
`$ sk query parameter
|
|
13
|
-
`$ sk query parameter
|
|
14
|
-
`$ sk query parameter
|
|
12
|
+
`$ sk query parameter <customerPath> -c <configName>`,
|
|
13
|
+
`$ sk query parameter customers/decathlon.de -c production`,
|
|
14
|
+
`$ sk query parameter customers/decathlon.de --explain`,
|
|
15
15
|
];
|
|
16
|
-
static flags =
|
|
17
|
-
...CLI_ATHENA,
|
|
18
|
-
...CLI_CONFIG_NAME,
|
|
19
|
-
...CLI_QUERY_DAYS,
|
|
20
|
-
...CLI_QUERY_FILTERS,
|
|
21
|
-
...CLI_QUERY_OUTPUT,
|
|
22
|
-
...CLI_QUERY_PARAMETER,
|
|
23
|
-
};
|
|
16
|
+
static flags = ParameterQueryServiceBuildContext.flags;
|
|
24
17
|
async run() {
|
|
25
|
-
const
|
|
26
|
-
await
|
|
18
|
+
const service = await new QueryBuilderFactory(this.context).buildService();
|
|
19
|
+
await service.run();
|
|
27
20
|
}
|
|
28
21
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkCommand } from "../../base/sk-command.js";
|
|
2
|
+
import { PrewarmQueryServiceBuildContext } from "../../services/query-builder/query-builder-service-build-context.js";
|
|
3
|
+
export default class QueryPrewarm extends SkCommand<PrewarmQueryServiceBuildContext> {
|
|
4
|
+
static buildContext: typeof PrewarmQueryServiceBuildContext;
|
|
3
5
|
static args: {
|
|
4
6
|
customerPath: import("@oclif/core/interfaces").Arg<string, {
|
|
5
7
|
exists?: boolean;
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
static args =
|
|
1
|
+
import { SkCommand } from "../../base/sk-command.js";
|
|
2
|
+
import { QueryBuilderFactory } from "../../services/query-builder/query-builder-factory.js";
|
|
3
|
+
import { PrewarmQueryServiceBuildContext } from "../../services/query-builder/query-builder-service-build-context.js";
|
|
4
|
+
export default class QueryPrewarm extends SkCommand {
|
|
5
|
+
static buildContext = PrewarmQueryServiceBuildContext;
|
|
6
|
+
static args = PrewarmQueryServiceBuildContext.args;
|
|
7
7
|
/** The command was `sk build-prewarm-query` before it moved under `query`. */
|
|
8
8
|
static aliases = ["build-prewarm-query"];
|
|
9
9
|
static deprecateAliases = true;
|
|
10
10
|
static description = "Build a prewarm query that can be executed in Athena";
|
|
11
11
|
static examples = [
|
|
12
|
-
`$ sk query prewarm
|
|
13
|
-
`$ sk query prewarm
|
|
14
|
-
`$ sk query prewarm
|
|
15
|
-
`$ sk query prewarm
|
|
16
|
-
`$ sk query prewarm
|
|
17
|
-
`$ sk query prewarm
|
|
18
|
-
`$ sk query prewarm
|
|
12
|
+
`$ sk query prewarm <customerPath> -c <configName>`,
|
|
13
|
+
`$ sk query prewarm customers/decathlon.de -c production`,
|
|
14
|
+
`$ sk query prewarm customers/decathlon.de --explain`,
|
|
15
|
+
`$ sk query prewarm customers/decathlon.de --match '^/p/'`,
|
|
16
|
+
`$ sk query prewarm customers/decathlon.de --device desktop,mobile`,
|
|
17
|
+
`$ sk query prewarm customers/decathlon.de -v MOBILE,DESKTOP`,
|
|
18
|
+
`$ sk query prewarm customers/decathlon.de --count`,
|
|
19
19
|
];
|
|
20
|
-
static flags =
|
|
21
|
-
...CLI_ATHENA,
|
|
22
|
-
...CLI_CONFIG_NAME,
|
|
23
|
-
...CLI_QUERY_DAYS,
|
|
24
|
-
...CLI_QUERY_FILTERS,
|
|
25
|
-
...CLI_QUERY_OUTPUT,
|
|
26
|
-
...CLI_QUERY_PREWARM,
|
|
27
|
-
};
|
|
20
|
+
static flags = PrewarmQueryServiceBuildContext.flags;
|
|
28
21
|
async run() {
|
|
29
|
-
const
|
|
30
|
-
await
|
|
22
|
+
const service = await new QueryBuilderFactory(this.context).buildService();
|
|
23
|
+
await service.run();
|
|
31
24
|
}
|
|
32
25
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { RevalidateServiceBuildContext } from "../services/revalidate/index.js";
|
|
3
|
+
export default class Revalidate extends SkCommand<RevalidateServiceBuildContext> {
|
|
3
4
|
static description: string;
|
|
5
|
+
static buildContext: typeof RevalidateServiceBuildContext;
|
|
4
6
|
static args: {
|
|
5
7
|
app: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
8
|
};
|
|
@@ -1,64 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CliContext, CliServiceFactory } from "../services/cli/index.js";
|
|
4
|
-
import { CONFIRMATION_THRESHOLD, DROPPING_TYPES, REVALIDATE_TYPES, RevalidateContext, RevalidateFactory, } from "../services/revalidate/index.js";
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
import { CONFIRMATION_THRESHOLD, DROPPING_TYPES, RevalidateServiceBuildContext, RevalidateFactory, } from "../services/revalidate/index.js";
|
|
5
3
|
const SAMPLE_SIZE = 10;
|
|
6
|
-
export default class Revalidate extends
|
|
4
|
+
export default class Revalidate extends SkCommand {
|
|
7
5
|
static description = "Purge or refresh cached assets by prefix and query. Run it after a config that narrows scope goes live, so returning visitors stop receiving the cached HTML.";
|
|
8
|
-
static
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
required: true,
|
|
12
|
-
description: "The customer app name",
|
|
13
|
-
}),
|
|
14
|
-
};
|
|
15
|
-
static flags = {
|
|
16
|
-
["pattern"]: Flags.string({
|
|
17
|
-
multiple: true,
|
|
18
|
-
description: 'URL pattern to purge, as a regex anchored at the scheme — mirror what the config excludes, e.g. "^https://www.example.com/en/.*-c1234$". Repeatable. The command derives the prefix the API requires from the pattern\'s literal head, and MongoDB reads that same literal as index bounds.',
|
|
19
|
-
}),
|
|
20
|
-
["prefix"]: Flags.string({
|
|
21
|
-
multiple: true,
|
|
22
|
-
description: "URL prefix, matched against the start of the cached URL. Derived from --pattern by default; state it only to override that, or to purge a whole path without a pattern.",
|
|
23
|
-
}),
|
|
24
|
-
["query"]: Flags.string({
|
|
25
|
-
description: "Raw MongoDB query on the asset fields, as JSON. An escape hatch for a rule --pattern cannot express, such as a condition on another field. It replaces the query --pattern would build.",
|
|
26
|
-
}),
|
|
27
|
-
["type"]: Flags.string({
|
|
28
|
-
options: [...REVALIDATE_TYPES],
|
|
29
|
-
default: "REFRESH",
|
|
30
|
-
description: "REFRESH revalidates against origin and keeps serving the cached copy meanwhile. A URL that went out of scope needs PURGE instead: it drops the entries and does not rebuild them, which is the only type that stops serving for good.",
|
|
31
|
-
}),
|
|
32
|
-
[CLIParameters.DryRun]: Flags.boolean({
|
|
33
|
-
char: CLIParametersChar.DryRun,
|
|
34
|
-
default: false,
|
|
35
|
-
description: "Report the assets the filter selects and exit. Changes nothing.",
|
|
36
|
-
}),
|
|
37
|
-
["wait"]: Flags.boolean({
|
|
38
|
-
default: false,
|
|
39
|
-
description: "Poll the job until it finishes.",
|
|
40
|
-
}),
|
|
41
|
-
["yes"]: Flags.boolean({
|
|
42
|
-
default: false,
|
|
43
|
-
description: `Skip the confirmation a dropping job above ${CONFIRMATION_THRESHOLD} assets asks for. Required in a non-interactive shell.`,
|
|
44
|
-
}),
|
|
45
|
-
[CLIParameters.Quiet]: Flags.boolean({
|
|
46
|
-
char: CLIParametersChar.Quiet,
|
|
47
|
-
default: false,
|
|
48
|
-
description: "less output non interactive",
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
6
|
+
static buildContext = RevalidateServiceBuildContext;
|
|
7
|
+
static args = RevalidateServiceBuildContext.args;
|
|
8
|
+
static flags = RevalidateServiceBuildContext.flags;
|
|
51
9
|
static examples = [
|
|
52
|
-
`$ sk revalidate
|
|
53
|
-
`$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c(?:1234|5678)(?:/|\\?|$)'
|
|
10
|
+
`$ sk revalidate <app> --pattern <regex> [--pattern <regex>] [--dryRun] [--wait]`,
|
|
11
|
+
`$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c(?:1234|5678)(?:/|\\?|$)' --dryRun`,
|
|
54
12
|
`$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c1234(?:/|\\?|$)' --type PURGE --wait`,
|
|
55
|
-
`$ sk revalidate example-shop --prefix https://www.example.com/en/
|
|
13
|
+
`$ sk revalidate example-shop --prefix https://www.example.com/en/ --dryRun`,
|
|
56
14
|
];
|
|
57
15
|
async run() {
|
|
58
|
-
const {
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const service = new RevalidateFactory(new RevalidateContext(app, flags[CLIParameters.Quiet]), cli).getService();
|
|
16
|
+
const { flags } = await this.parse(Revalidate);
|
|
17
|
+
const cli = this.environment.cli;
|
|
18
|
+
const service = new RevalidateFactory(this.context).getService();
|
|
62
19
|
const patterns = flags["pattern"] ?? [];
|
|
63
20
|
const prefixes = flags["prefix"] ?? [];
|
|
64
21
|
if (!patterns.length && !prefixes.length) {
|
|
@@ -80,7 +37,7 @@ export default class Revalidate extends Command {
|
|
|
80
37
|
if (preview.count > preview.sample.length) {
|
|
81
38
|
this.log(` … ${preview.count - preview.sample.length} more`);
|
|
82
39
|
}
|
|
83
|
-
if (flags[
|
|
40
|
+
if (flags["dryRun"]) {
|
|
84
41
|
this.log("dry run — nothing was purged");
|
|
85
42
|
return;
|
|
86
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class WptLauncher extends
|
|
1
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
|
+
export default class WptLauncher extends SkCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static args: {
|
|
5
5
|
urls: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import { Args,
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
|
+
import { SkCommand } from "../base/sk-command.js";
|
|
2
3
|
import fetch from "node-fetch";
|
|
3
|
-
|
|
4
|
-
import { CliServiceFactory } from "../services/cli/index.js";
|
|
5
|
-
export default class WptLauncher extends Command {
|
|
4
|
+
export default class WptLauncher extends SkCommand {
|
|
6
5
|
static description = "Analyze the performance impact that Speed Kit has compared to the original version.";
|
|
7
6
|
static args = {
|
|
8
|
-
|
|
9
|
-
name:
|
|
7
|
+
urls: Args.string({
|
|
8
|
+
name: "urls", // name of arg to show in help and reference with args[name]
|
|
10
9
|
required: true, // make the arg required with `required: true`
|
|
11
10
|
}),
|
|
12
|
-
|
|
13
|
-
name:
|
|
11
|
+
testId: Args.string({
|
|
12
|
+
name: "testId", // name of arg to show in help and reference with args[name]
|
|
14
13
|
required: true, // make the arg required with `required: true`
|
|
15
14
|
}),
|
|
16
15
|
};
|
|
17
16
|
static flags = {
|
|
18
|
-
|
|
17
|
+
cookies: Flags.string({
|
|
19
18
|
default: "",
|
|
20
|
-
char:
|
|
19
|
+
char: "c",
|
|
21
20
|
}),
|
|
22
|
-
|
|
21
|
+
mobile: Flags.string({
|
|
23
22
|
default: "no",
|
|
24
|
-
char:
|
|
23
|
+
char: "m",
|
|
25
24
|
}),
|
|
26
|
-
|
|
25
|
+
group: Flags.string({
|
|
27
26
|
default: "A",
|
|
28
|
-
char:
|
|
27
|
+
char: "g",
|
|
29
28
|
}),
|
|
30
29
|
};
|
|
31
30
|
static examples = [
|
|
32
|
-
`$ sk wpt-launcher
|
|
33
|
-
`$ sk wpt-launcher
|
|
31
|
+
`$ sk wpt-launcher <urls> <testId> -g <group> -m <mobile> -c <cookies>`,
|
|
32
|
+
`$ sk wpt-launcher url1,url2,url3 listing-50vs50 -g B -m Y -c consentCookies`,
|
|
34
33
|
];
|
|
35
34
|
static localhostUrl = "http://localhost:8888/orange.html";
|
|
36
35
|
async run() {
|
|
37
36
|
const { args: { urls, testId }, flags: { group, mobile, cookies }, } = await this.parse(WptLauncher);
|
|
38
|
-
const cli =
|
|
37
|
+
const cli = this.environment.cli;
|
|
39
38
|
const resourceOrigin = this.getResourceOrigin(this.allResourceUrls(urls));
|
|
40
39
|
let script = `setViewportSize ${this.getViewPortSize(this.isMobile(mobile))}
|
|
41
40
|
navigate ${resourceOrigin}/wrapper-sw.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SetupServiceFactory } from "../../services/setup/index.js";
|
|
2
|
-
import {
|
|
1
|
+
import { SetupServiceBuildContext, SetupServiceFactory, } from "../../services/setup/index.js";
|
|
2
|
+
import { CliEnvironmentFactory } from "../../services/cli/index.js";
|
|
3
3
|
// commands the hook must never interfere with (setup itself, help, plugins)
|
|
4
4
|
const IGNORED_PREFIXES = ["config:setup", "help", "autocomplete", "plugins"];
|
|
5
5
|
/**
|
|
@@ -9,24 +9,23 @@ const IGNORED_PREFIXES = ["config:setup", "help", "autocomplete", "plugins"];
|
|
|
9
9
|
*/
|
|
10
10
|
const hook = async function (opts) {
|
|
11
11
|
try {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// opts.config is the runtime Config instance, typed here as the interface
|
|
13
|
+
const config = opts.config;
|
|
14
|
+
// The hook runs before the command and has an environment of its own.
|
|
15
|
+
const environment = new CliEnvironmentFactory(config).buildEnvironment();
|
|
16
|
+
if (environment.nonInteractive) {
|
|
14
17
|
return;
|
|
15
18
|
}
|
|
16
19
|
const id = opts.id ?? "";
|
|
17
20
|
if (id === "" || IGNORED_PREFIXES.some((prefix) => id.startsWith(prefix))) {
|
|
18
21
|
return;
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
const config = opts.config;
|
|
22
|
-
const cliConfig = new CliConfig(config);
|
|
23
|
-
const userConfig = cliConfig.load();
|
|
24
|
-
if (!userConfig.firstRunCompleted) {
|
|
23
|
+
if (!environment.settings.firstRunCompleted) {
|
|
25
24
|
this.log(`${opts.config.bin}: first-time setup has not run yet. ` +
|
|
26
25
|
`Run \`${opts.config.bin} config setup\` to choose a browser and diff tool.`);
|
|
27
26
|
return;
|
|
28
27
|
}
|
|
29
|
-
const service = new SetupServiceFactory(
|
|
28
|
+
const service = new SetupServiceFactory(new SetupServiceBuildContext({ environment: environment })).getService();
|
|
30
29
|
await service.remindBrowserUpdate();
|
|
31
30
|
await service.remindExtensionUpdates();
|
|
32
31
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base of every build context: a class whose fields are exactly the values
|
|
3
|
+
* it is built from, taken as one object.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* export interface PullServiceBuildContextValues extends CommandContextValues {
|
|
7
|
+
* readonly customerPath: string;
|
|
8
|
+
* }
|
|
9
|
+
*
|
|
10
|
+
* export class PullServiceBuildContext extends Context<PullServiceBuildContextValues>() {
|
|
11
|
+
* static create(args, flags, environment: CliEnvironment): PullServiceBuildContext {
|
|
12
|
+
* return new PullServiceBuildContext({ environment, customerPath: args.customerPath, … });
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* The fields are declared once, in the values interface, and a caller names
|
|
18
|
+
* each value it passes, so two neighbouring booleans cannot swap places. A
|
|
19
|
+
* build context adds nothing but `static` members: its `flags`, and `create`,
|
|
20
|
+
* which maps a command's input onto the values. It carries the invocation's
|
|
21
|
+
* environment (`CommandContextValues`, in services/cli) and is named after the
|
|
22
|
+
* service it builds: `<Service>BuildContext`. See docs/architecture.md.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Context<Values extends object>(): new (values: Values) => Readonly<Values>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base of every build context: a class whose fields are exactly the values
|
|
3
|
+
* it is built from, taken as one object.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* export interface PullServiceBuildContextValues extends CommandContextValues {
|
|
7
|
+
* readonly customerPath: string;
|
|
8
|
+
* }
|
|
9
|
+
*
|
|
10
|
+
* export class PullServiceBuildContext extends Context<PullServiceBuildContextValues>() {
|
|
11
|
+
* static create(args, flags, environment: CliEnvironment): PullServiceBuildContext {
|
|
12
|
+
* return new PullServiceBuildContext({ environment, customerPath: args.customerPath, … });
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* The fields are declared once, in the values interface, and a caller names
|
|
18
|
+
* each value it passes, so two neighbouring booleans cannot swap places. A
|
|
19
|
+
* build context adds nothing but `static` members: its `flags`, and `create`,
|
|
20
|
+
* which maps a command's input onto the values. It carries the invocation's
|
|
21
|
+
* environment (`CommandContextValues`, in services/cli) and is named after the
|
|
22
|
+
* service it builds: `<Service>BuildContext`. See docs/architecture.md.
|
|
23
|
+
*/
|
|
24
|
+
export function Context() {
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class -- the base of every context: it only copies the values in
|
|
26
|
+
return class {
|
|
27
|
+
constructor(values) {
|
|
28
|
+
Object.assign(this, values);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The flags that say where an Athena query runs. */
|
|
2
|
+
/**
|
|
3
|
+
* Where a query that is executed actually runs.
|
|
4
|
+
*
|
|
5
|
+
* The catalog is the account's, not the query's: our own logins reach the rum
|
|
6
|
+
* tables under `live`, while a role scoped to one account reaches the same
|
|
7
|
+
* tables under `AwsDataCatalog`. `SK_ATHENA_CATALOG` lets a CI job say so once.
|
|
8
|
+
*
|
|
9
|
+
* Athena resolves the account's default workgroup when none is named, which is
|
|
10
|
+
* only right where the credentials are allowed to use it — a role scoped to one
|
|
11
|
+
* workgroup is refused on any other, and the result location is a workgroup
|
|
12
|
+
* setting too. `SK_ATHENA_WORKGROUP` lets a CI job set it once for every
|
|
13
|
+
* command in the job.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CLI_ATHENA: {
|
|
16
|
+
catalog: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
workgroup: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|