@speedkit/cli 2.4.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/README.md +775 -0
- package/bin/dev +18 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +4 -0
- package/bin/run.cmd +3 -0
- package/dist/commands/airports_iata.json +1 -0
- package/dist/commands/build-parameter-query.d.ts +15 -0
- package/dist/commands/build-parameter-query.js +95 -0
- package/dist/commands/build-prewarm-query.d.ts +15 -0
- package/dist/commands/build-prewarm-query.js +69 -0
- package/dist/commands/deploy.d.ts +17 -0
- package/dist/commands/deploy.js +39 -0
- package/dist/commands/document-handler.d.ts +16 -0
- package/dist/commands/document-handler.js +36 -0
- package/dist/commands/find-pops.d.ts +17 -0
- package/dist/commands/find-pops.js +84 -0
- package/dist/commands/generate-customer-config.d.ts +10 -0
- package/dist/commands/generate-customer-config.js +29 -0
- package/dist/commands/generate-pop-config.d.ts +27 -0
- package/dist/commands/generate-pop-config.js +231 -0
- package/dist/commands/login.d.ts +10 -0
- package/dist/commands/login.js +35 -0
- package/dist/commands/onboarding.d.ts +16 -0
- package/dist/commands/onboarding.js +25 -0
- package/dist/commands/param-diff.d.ts +16 -0
- package/dist/commands/param-diff.js +111 -0
- package/dist/commands/pop-prewarm.d.ts +17 -0
- package/dist/commands/pop-prewarm.js +80 -0
- package/dist/commands/prewarm.d.ts +40 -0
- package/dist/commands/prewarm.js +127 -0
- package/dist/commands/pull.d.ts +14 -0
- package/dist/commands/pull.js +24 -0
- package/dist/commands/wpt-launcher.d.ts +21 -0
- package/dist/commands/wpt-launcher.js +79 -0
- package/dist/helpers/CustomerConfig.d.ts +51 -0
- package/dist/helpers/CustomerConfig.js +150 -0
- package/dist/helpers/build-query-helper.d.ts +32 -0
- package/dist/helpers/build-query-helper.js +216 -0
- package/dist/helpers/cli-config.d.ts +22 -0
- package/dist/helpers/cli-config.js +85 -0
- package/dist/helpers/file-helper.d.ts +8 -0
- package/dist/helpers/file-helper.js +63 -0
- package/dist/helpers/get-parsed-config.d.ts +11 -0
- package/dist/helpers/get-parsed-config.js +63 -0
- package/dist/helpers/getChromePath.d.ts +7 -0
- package/dist/helpers/getChromePath.js +27 -0
- package/dist/helpers/isDirectory.d.ts +1 -0
- package/dist/helpers/isDirectory.js +17 -0
- package/dist/helpers/isExecutable.d.ts +1 -0
- package/dist/helpers/isExecutable.js +15 -0
- package/dist/helpers/isFile.d.ts +1 -0
- package/dist/helpers/isFile.js +17 -0
- package/dist/helpers/logging-helper.d.ts +12 -0
- package/dist/helpers/logging-helper.js +27 -0
- package/dist/helpers/normalize.d.ts +40 -0
- package/dist/helpers/normalize.js +112 -0
- package/dist/helpers/race.d.ts +1 -0
- package/dist/helpers/race.js +16 -0
- package/dist/helpers/safe.d.ts +10 -0
- package/dist/helpers/safe.js +34 -0
- package/dist/helpers/scrape.d.ts +1 -0
- package/dist/helpers/scrape.js +11 -0
- package/dist/helpers/speedKitRuleToRegExp.d.ts +1 -0
- package/dist/helpers/speedKitRuleToRegExp.js +10 -0
- package/dist/helpers/watchFiles.d.ts +1 -0
- package/dist/helpers/watchFiles.js +20 -0
- package/dist/models/cli-parameters.d.ts +73 -0
- package/dist/models/cli-parameters.js +82 -0
- package/dist/models/files.d.ts +20 -0
- package/dist/models/files.js +23 -0
- package/dist/models/install.d.ts +24 -0
- package/dist/models/install.js +2 -0
- package/dist/services/athena-service.d.ts +30 -0
- package/dist/services/athena-service.js +139 -0
- package/dist/services/bundler/bundle-service-factory.d.ts +4 -0
- package/dist/services/bundler/bundle-service-factory.js +10 -0
- package/dist/services/bundler/bundle-service.d.ts +25 -0
- package/dist/services/bundler/bundle-service.js +84 -0
- package/dist/services/bundler/index.d.ts +2 -0
- package/dist/services/bundler/index.js +5 -0
- package/dist/services/cli/cli-service-factory.d.ts +5 -0
- package/dist/services/cli/cli-service-factory.js +14 -0
- package/dist/services/cli/cli-service-model.d.ts +27 -0
- package/dist/services/cli/cli-service-model.js +9 -0
- package/dist/services/cli/cli-service.d.ts +37 -0
- package/dist/services/cli/cli-service.js +123 -0
- package/dist/services/cli/error/cli-type-error.d.ts +3 -0
- package/dist/services/cli/error/cli-type-error.js +7 -0
- package/dist/services/cli/hooks.d.ts +11 -0
- package/dist/services/cli/hooks.js +33 -0
- package/dist/services/cli/index.d.ts +3 -0
- package/dist/services/cli/index.js +6 -0
- package/dist/services/config-api/client.d.ts +16 -0
- package/dist/services/config-api/client.js +54 -0
- package/dist/services/config-api/config-api-service.d.ts +16 -0
- package/dist/services/config-api/config-api-service.js +56 -0
- package/dist/services/config-api/context/config-api-context.d.ts +5 -0
- package/dist/services/config-api/context/config-api-context.js +9 -0
- package/dist/services/config-api/error/json-response-error.d.ts +2 -0
- package/dist/services/config-api/error/json-response-error.js +5 -0
- package/dist/services/config-api/error/login-error.d.ts +5 -0
- package/dist/services/config-api/error/login-error.js +12 -0
- package/dist/services/config-api/factory/config-api-service-factory.d.ts +10 -0
- package/dist/services/config-api/factory/config-api-service-factory.js +38 -0
- package/dist/services/config-api/factory/entity-manager-factory.d.ts +5 -0
- package/dist/services/config-api/factory/entity-manager-factory.js +21 -0
- package/dist/services/config-api/interface/config-api-context-interface.d.ts +4 -0
- package/dist/services/config-api/interface/config-api-context-interface.js +2 -0
- package/dist/services/config-api/interface/request-extension-interface.d.ts +5 -0
- package/dist/services/config-api/interface/request-extension-interface.js +2 -0
- package/dist/services/config-api-service.d.ts +18 -0
- package/dist/services/config-api-service.js +96 -0
- package/dist/services/context/app-context.d.ts +1 -0
- package/dist/services/context/app-context.js +2 -0
- package/dist/services/context/error/context-runtime-error.d.ts +3 -0
- package/dist/services/context/error/context-runtime-error.js +7 -0
- package/dist/services/context/interface/context-interface.d.ts +2 -0
- package/dist/services/context/interface/context-interface.js +2 -0
- package/dist/services/customer-config/customer-config-service-context.d.ts +5 -0
- package/dist/services/customer-config/customer-config-service-context.js +15 -0
- package/dist/services/customer-config/customer-config-service-factory.d.ts +8 -0
- package/dist/services/customer-config/customer-config-service-factory.js +24 -0
- package/dist/services/customer-config/customer-config-service-model.d.ts +39 -0
- package/dist/services/customer-config/customer-config-service-model.js +23 -0
- package/dist/services/customer-config/customer-config-service.d.ts +27 -0
- package/dist/services/customer-config/customer-config-service.js +263 -0
- package/dist/services/customer-config/index.d.ts +4 -0
- package/dist/services/customer-config/index.js +7 -0
- package/dist/services/customer-config/templates/config_SpeedKit.js.hbs +351 -0
- package/dist/services/customer-config/templates/config_customer.js.hbs +75 -0
- package/dist/services/customer-config/templates/config_documentHandler.js.hbs +162 -0
- package/dist/services/customer-config/templates/config_dynamicBlocks.es6.hbs +263 -0
- package/dist/services/customer-config/templates/config_dynamicStyles.css.hbs +116 -0
- package/dist/services/customer-config/templates/config_loadHandler.js.hbs +394 -0
- package/dist/services/customer-config/templates/deploymentDetection.es6.hbs +262 -0
- package/dist/services/customer-config/templates/downtimeDetection.js.hbs +110 -0
- package/dist/services/deploy/builder/install-resource-builder.d.ts +14 -0
- package/dist/services/deploy/builder/install-resource-builder.js +48 -0
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.d.ts +11 -0
- package/dist/services/deploy/checks/post-deploy/revalidated-module-check.js +30 -0
- package/dist/services/deploy/checks/post-deploy/save-files-check.d.ts +9 -0
- package/dist/services/deploy/checks/post-deploy/save-files-check.js +25 -0
- package/dist/services/deploy/context/deploy-context.d.ts +12 -0
- package/dist/services/deploy/context/deploy-context.js +26 -0
- package/dist/services/deploy/deploy-service-factory.d.ts +15 -0
- package/dist/services/deploy/deploy-service-factory.js +68 -0
- package/dist/services/deploy/deploy-service.d.ts +17 -0
- package/dist/services/deploy/deploy-service.js +63 -0
- package/dist/services/deploy/error/create-find-temp-directory-error.d.ts +4 -0
- package/dist/services/deploy/error/create-find-temp-directory-error.js +10 -0
- package/dist/services/deploy/error/deploy-app-error.d.ts +2 -0
- package/dist/services/deploy/error/deploy-app-error.js +5 -0
- package/dist/services/deploy/error/no-active-installation-error.d.ts +4 -0
- package/dist/services/deploy/error/no-active-installation-error.js +10 -0
- package/dist/services/deploy/handler/customer-config-handler.d.ts +21 -0
- package/dist/services/deploy/handler/customer-config-handler.js +85 -0
- package/dist/services/deploy/handler/install-resource-handler.d.ts +25 -0
- package/dist/services/deploy/handler/install-resource-handler.js +104 -0
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.d.ts +13 -0
- package/dist/services/deploy/handler/install-resource-modifier/deleted-file-check.js +51 -0
- package/dist/services/deploy/handler/module-handler.d.ts +14 -0
- package/dist/services/deploy/handler/module-handler.js +81 -0
- package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.d.ts +9 -0
- package/dist/services/deploy/handler/module-modifier/deployment-detection-modifier.js +24 -0
- package/dist/services/deploy/handler/server-config-handler.d.ts +12 -0
- package/dist/services/deploy/handler/server-config-handler.js +63 -0
- package/dist/services/deploy/interface/deploy-handler-interface.d.ts +6 -0
- package/dist/services/deploy/interface/deploy-handler-interface.js +2 -0
- package/dist/services/deploy/interface/install-configs.d.ts +11 -0
- package/dist/services/deploy/interface/install-configs.js +2 -0
- package/dist/services/deploy/interface/install-resource-processor-interface.d.ts +5 -0
- package/dist/services/deploy/interface/install-resource-processor-interface.js +2 -0
- package/dist/services/deploy/interface/install.d.ts +14 -0
- package/dist/services/deploy/interface/install.js +2 -0
- package/dist/services/deploy/interface/post-deploy-check-interface.d.ts +3 -0
- package/dist/services/deploy/interface/post-deploy-check-interface.js +2 -0
- package/dist/services/deploy/interface/runtime-modifier.d.ts +6 -0
- package/dist/services/deploy/interface/runtime-modifier.js +2 -0
- package/dist/services/deploy/interface/validate-origins-response.d.ts +4 -0
- package/dist/services/deploy/interface/validate-origins-response.js +2 -0
- package/dist/services/diff/diff-model.d.ts +5 -0
- package/dist/services/diff/diff-model.js +12 -0
- package/dist/services/diff/diff-service-factory.d.ts +7 -0
- package/dist/services/diff/diff-service-factory.js +20 -0
- package/dist/services/diff/diff-service.d.ts +34 -0
- package/dist/services/diff/diff-service.js +134 -0
- package/dist/services/diff/index.d.ts +3 -0
- package/dist/services/diff/index.js +6 -0
- package/dist/services/diff-service.d.ts +24 -0
- package/dist/services/diff-service.js +112 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.d.ts +23 -0
- package/dist/services/document-handler-runtime/context/document-handler-runtime-context.js +41 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service.d.ts +32 -0
- package/dist/services/document-handler-runtime/document-handler-runtime-service.js +220 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +42 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +225 -0
- package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.d.ts +6 -0
- package/dist/services/document-handler-runtime/error/handler/required-file-not-found-handler.js +14 -0
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.d.ts +3 -0
- package/dist/services/document-handler-runtime/error/required-file-not-found-error.js +7 -0
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.d.ts +24 -0
- package/dist/services/document-handler-runtime/factory/document-handler-runtime-service-factory.js +106 -0
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.d.ts +3 -0
- package/dist/services/document-handler-runtime/interface/document-handler-runtime-config-interface.js +6 -0
- package/dist/services/document-handler-runtime/interface/template-context-interface.d.ts +3 -0
- package/dist/services/document-handler-runtime/interface/template-context-interface.js +2 -0
- package/dist/services/document-handler-runtime/interface/template-interface.d.ts +6 -0
- package/dist/services/document-handler-runtime/interface/template-interface.js +2 -0
- package/dist/services/document-handler-runtime/interface/template-param-interface.d.ts +4 -0
- package/dist/services/document-handler-runtime/interface/template-param-interface.js +2 -0
- package/dist/services/document-handler-runtime/templates/abstract-template.d.ts +9 -0
- package/dist/services/document-handler-runtime/templates/abstract-template.js +18 -0
- package/dist/services/document-handler-runtime/templates/database-mock.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/database-mock.js +111 -0
- package/dist/services/document-handler-runtime/templates/execute-document-handler.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/execute-document-handler.js +76 -0
- package/dist/services/document-handler-runtime/templates/orestes-mock.d.ts +9 -0
- package/dist/services/document-handler-runtime/templates/orestes-mock.js +168 -0
- package/dist/services/document-handler-runtime/templates/package-json.d.ts +8 -0
- package/dist/services/document-handler-runtime/templates/package-json.js +21 -0
- package/dist/services/document-handler-runtime/templates/test.d.ts +6 -0
- package/dist/services/document-handler-runtime/templates/test.js +63 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-factory.js +19 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-service.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-async-error-handling-service.js +18 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-factory.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-factory.js +19 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-service.d.ts +6 -0
- package/dist/services/error-handling/abstract/abstract-error-handling-service.js +19 -0
- package/dist/services/error-handling/error/application-error.d.ts +5 -0
- package/dist/services/error-handling/error/application-error.js +11 -0
- package/dist/services/error-handling/error/handler/default-error-handler.d.ts +5 -0
- package/dist/services/error-handling/error/handler/default-error-handler.js +13 -0
- package/dist/services/error-handling/error-handling-service.d.ts +7 -0
- package/dist/services/error-handling/error-handling-service.js +27 -0
- package/dist/services/error-handling/factory/error-handling-factory.d.ts +8 -0
- package/dist/services/error-handling/factory/error-handling-factory.js +21 -0
- package/dist/services/error-handling/interface/error-context-interface.d.ts +6 -0
- package/dist/services/error-handling/interface/error-context-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handler-interface.d.ts +5 -0
- package/dist/services/error-handling/interface/error-handler-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handling-factory-interface.d.ts +8 -0
- package/dist/services/error-handling/interface/error-handling-factory-interface.js +2 -0
- package/dist/services/error-handling/interface/error-handling-service-interface.d.ts +8 -0
- package/dist/services/error-handling/interface/error-handling-service-interface.js +2 -0
- package/dist/services/integration-api/context/integration-api-context.d.ts +9 -0
- package/dist/services/integration-api/context/integration-api-context.js +20 -0
- package/dist/services/integration-api/error/customer-config-error.d.ts +2 -0
- package/dist/services/integration-api/error/customer-config-error.js +5 -0
- package/dist/services/integration-api/error/customer-config-legacy-error.d.ts +3 -0
- package/dist/services/integration-api/error/customer-config-legacy-error.js +7 -0
- package/dist/services/integration-api/error/handler/customer-config-handler.d.ts +5 -0
- package/dist/services/integration-api/error/handler/customer-config-handler.js +19 -0
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.d.ts +6 -0
- package/dist/services/integration-api/error/handler/customer-config-legacy-handler.js +24 -0
- package/dist/services/integration-api/error/handler/origin-handler.d.ts +6 -0
- package/dist/services/integration-api/error/handler/origin-handler.js +22 -0
- package/dist/services/integration-api/error/load-customer-error.d.ts +4 -0
- package/dist/services/integration-api/error/load-customer-error.js +10 -0
- package/dist/services/integration-api/error/mandatory-file-missing-error.d.ts +3 -0
- package/dist/services/integration-api/error/mandatory-file-missing-error.js +8 -0
- package/dist/services/integration-api/error/origin-error.d.ts +3 -0
- package/dist/services/integration-api/error/origin-error.js +7 -0
- package/dist/services/integration-api/external/external-file-reader.d.ts +4 -0
- package/dist/services/integration-api/external/external-file-reader.js +17 -0
- package/dist/services/integration-api/factory/integration-api-service-factory.d.ts +13 -0
- package/dist/services/integration-api/factory/integration-api-service-factory.js +55 -0
- package/dist/services/integration-api/file-list.d.ts +18 -0
- package/dist/services/integration-api/file-list.js +79 -0
- package/dist/services/integration-api/file-reader.d.ts +15 -0
- package/dist/services/integration-api/file-reader.js +97 -0
- package/dist/services/integration-api/file-writer.d.ts +9 -0
- package/dist/services/integration-api/file-writer.js +27 -0
- package/dist/services/integration-api/handler/customer-config-handler.d.ts +16 -0
- package/dist/services/integration-api/handler/customer-config-handler.js +55 -0
- package/dist/services/integration-api/handler/file-handler.d.ts +9 -0
- package/dist/services/integration-api/handler/file-handler.js +20 -0
- package/dist/services/integration-api/handler/install-resource-handler.d.ts +33 -0
- package/dist/services/integration-api/handler/install-resource-handler.js +67 -0
- package/dist/services/integration-api/handler/module-handler.d.ts +12 -0
- package/dist/services/integration-api/handler/module-handler.js +20 -0
- package/dist/services/integration-api/handler/server-config-handler.d.ts +8 -0
- package/dist/services/integration-api/handler/server-config-handler.js +21 -0
- package/dist/services/integration-api/integration-api-model.d.ts +89 -0
- package/dist/services/integration-api/integration-api-model.js +2 -0
- package/dist/services/integration-api/integration-api-service.d.ts +21 -0
- package/dist/services/integration-api/integration-api-service.js +76 -0
- package/dist/services/integration-api/struct/customer-config-file.d.ts +10 -0
- package/dist/services/integration-api/struct/customer-config-file.js +32 -0
- package/dist/services/integration-api/struct/customer-config.d.ts +22 -0
- package/dist/services/integration-api/struct/customer-config.js +67 -0
- package/dist/services/integration-api/struct/file.d.ts +19 -0
- package/dist/services/integration-api/struct/file.js +61 -0
- package/dist/services/integration-api/struct/install-resource-file.d.ts +6 -0
- package/dist/services/integration-api/struct/install-resource-file.js +12 -0
- package/dist/services/integration-api/struct/module-file.d.ts +5 -0
- package/dist/services/integration-api/struct/module-file.js +10 -0
- package/dist/services/integration-api/struct/ro-file.d.ts +13 -0
- package/dist/services/integration-api/struct/ro-file.js +26 -0
- package/dist/services/integration-api/struct/server-config-file.d.ts +9 -0
- package/dist/services/integration-api/struct/server-config-file.js +22 -0
- package/dist/services/integration-api/struct/virtual-file.d.ts +14 -0
- package/dist/services/integration-api/struct/virtual-file.js +28 -0
- package/dist/services/integration-api/validator/customer-config-validator.d.ts +5 -0
- package/dist/services/integration-api/validator/customer-config-validator.js +23 -0
- package/dist/services/integration-api/validator/mandatory-files-validator.d.ts +7 -0
- package/dist/services/integration-api/validator/mandatory-files-validator.js +39 -0
- package/dist/services/integration-api/virtual/external-recipe.d.ts +9 -0
- package/dist/services/integration-api/virtual/external-recipe.js +19 -0
- package/dist/services/integration-api/virtual/virtual-file-handler.d.ts +7 -0
- package/dist/services/integration-api/virtual/virtual-file-handler.js +38 -0
- package/dist/services/onboarding/browser/abort-response.d.ts +5 -0
- package/dist/services/onboarding/browser/abort-response.js +10 -0
- package/dist/services/onboarding/browser/baqend-response.d.ts +12 -0
- package/dist/services/onboarding/browser/baqend-response.js +52 -0
- package/dist/services/onboarding/browser/origin-response.d.ts +8 -0
- package/dist/services/onboarding/browser/origin-response.js +20 -0
- package/dist/services/onboarding/config-renderer/install-file-recipe.d.ts +7 -0
- package/dist/services/onboarding/config-renderer/install-file-recipe.js +13 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +22 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +78 -0
- package/dist/services/onboarding/dashboard/athena-service.d.ts +11 -0
- package/dist/services/onboarding/dashboard/athena-service.js +70 -0
- package/dist/services/onboarding/dashboard/frontend-dist/assets/index-87b53ed4.css +1 -0
- package/dist/services/onboarding/dashboard/frontend-dist/assets/main-274b5625.js +9 -0
- package/dist/services/onboarding/dashboard/frontend-dist/index.html +18 -0
- package/dist/services/onboarding/dashboard/index.d.ts +16 -0
- package/dist/services/onboarding/dashboard/index.js +78 -0
- package/dist/services/onboarding/dashboard/param-query-builder.d.ts +9 -0
- package/dist/services/onboarding/dashboard/param-query-builder.js +67 -0
- package/dist/services/onboarding/dashboard/request-diff-service.d.ts +11 -0
- package/dist/services/onboarding/dashboard/request-diff-service.js +59 -0
- package/dist/services/onboarding/error/vm-error.d.ts +2 -0
- package/dist/services/onboarding/error/vm-error.js +6 -0
- package/dist/services/onboarding/fetch-event-handler.d.ts +19 -0
- package/dist/services/onboarding/fetch-event-handler.js +155 -0
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.d.ts +24 -0
- package/dist/services/onboarding/fetch-events/customer-domain-document-response.js +118 -0
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.d.ts +14 -0
- package/dist/services/onboarding/fetch-events/customer-service-worker-js.js +30 -0
- package/dist/services/onboarding/fetch-events/dashboard-request.d.ts +15 -0
- package/dist/services/onboarding/fetch-events/dashboard-request.js +29 -0
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.d.ts +26 -0
- package/dist/services/onboarding/fetch-events/speed-kit-asset-request.js +138 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.d.ts +15 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-html.js +49 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.d.ts +22 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +62 -0
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +21 -0
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +43 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +17 -0
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +27 -0
- package/dist/services/onboarding/file-events/fileWatcher.d.ts +28 -0
- package/dist/services/onboarding/file-events/fileWatcher.js +133 -0
- package/dist/services/onboarding/index.d.ts +3 -0
- package/dist/services/onboarding/index.js +8 -0
- package/dist/services/onboarding/onboarding-model.d.ts +30 -0
- package/dist/services/onboarding/onboarding-model.js +53 -0
- package/dist/services/onboarding/onboarding-service-factory.d.ts +16 -0
- package/dist/services/onboarding/onboarding-service-factory.js +163 -0
- package/dist/services/onboarding/onboarding-service.d.ts +31 -0
- package/dist/services/onboarding/onboarding-service.js +130 -0
- package/dist/services/onboarding/request-cache/cache.d.ts +15 -0
- package/dist/services/onboarding/request-cache/cache.js +32 -0
- package/dist/services/onboarding/templates/install-speed-kit-html-template.d.ts +4 -0
- package/dist/services/onboarding/templates/install-speed-kit-html-template.js +264 -0
- package/dist/services/onboarding/templates/install-speed-kit-js-template.d.ts +4 -0
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +41 -0
- package/dist/services/onboarding/todo-collector.d.ts +18 -0
- package/dist/services/onboarding/todo-collector.js +48 -0
- package/dist/services/prewarm-service.d.ts +5 -0
- package/dist/services/prewarm-service.js +57 -0
- package/dist/services/pull/index.d.ts +3 -0
- package/dist/services/pull/index.js +6 -0
- package/dist/services/pull/pull-service-factory.d.ts +12 -0
- package/dist/services/pull/pull-service-factory.js +44 -0
- package/dist/services/pull/pull-service-model.d.ts +43 -0
- package/dist/services/pull/pull-service-model.js +27 -0
- package/dist/services/pull/pull-service.d.ts +18 -0
- package/dist/services/pull/pull-service.js +106 -0
- package/dist/templates/pops.js +97 -0
- package/dist/templates/speedKit.Revalidated.js +86 -0
- package/oclif.manifest.json +700 -0
- package/package.json +128 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./customer-config-service"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./customer-config-service-context"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./customer-config-service-model"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./customer-config-service-factory"), exports);
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
var ENABLED_HOSTS_CONFIGS = [
|
|
3
|
+
// Production:
|
|
4
|
+
{
|
|
5
|
+
hosts: ["{{production.host}}"],
|
|
6
|
+
split: 0,
|
|
7
|
+
splitTestId: "0vs100_20xx-xx-xx",
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
{{#if staging.host}}
|
|
11
|
+
// Staging:
|
|
12
|
+
{
|
|
13
|
+
hosts: ["{{staging.host}}"],
|
|
14
|
+
},
|
|
15
|
+
{{else}}
|
|
16
|
+
// No Staging configured
|
|
17
|
+
{{/if}}
|
|
18
|
+
];
|
|
19
|
+
var ENABLED_HOSTS = getEnabledHosts(ENABLED_HOSTS_CONFIGS);
|
|
20
|
+
var CURRENT_HOST_CONFIG = getCurrentHostConfig(ENABLED_HOSTS_CONFIGS);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @type {SpeedKitConfig}
|
|
24
|
+
*/
|
|
25
|
+
window.speedKit = {
|
|
26
|
+
ruleSetConfig: {
|
|
27
|
+
version: 2,
|
|
28
|
+
},
|
|
29
|
+
appName: APP,
|
|
30
|
+
{{#if isShopify}}
|
|
31
|
+
sw: "/apps/speed-kit/sw.js", // Shopify specific
|
|
32
|
+
{{else}}
|
|
33
|
+
sw: "/wrapper-sw.js",
|
|
34
|
+
{{/if}}
|
|
35
|
+
{{#if includeServiceWorker}}
|
|
36
|
+
includeServiceWorker: "{{includeServiceWorker}}",
|
|
37
|
+
{{/if}}
|
|
38
|
+
preloadDynamicBlocks: true,
|
|
39
|
+
rumTracking: {{activateRumTracking}},
|
|
40
|
+
split: CURRENT_HOST_CONFIG.split,
|
|
41
|
+
splitTestId: CURRENT_HOST_CONFIG.splitTestId,
|
|
42
|
+
disabled: !CURRENT_HOST_CONFIG.enabled,
|
|
43
|
+
enabledSites: [
|
|
44
|
+
{
|
|
45
|
+
pathname: [
|
|
46
|
+
// TODO: adjust/replace this exemplary list
|
|
47
|
+
{{#if isShopify}}
|
|
48
|
+
|
|
49
|
+
"/collections/",
|
|
50
|
+
"/products/",
|
|
51
|
+
{{/if}}
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
whitelist: [
|
|
56
|
+
{
|
|
57
|
+
{{#if isPlentymarkets}}
|
|
58
|
+
host: ENABLED_HOSTS.concat([
|
|
59
|
+
// Plentymarkets specific:
|
|
60
|
+
/cdn\d\d\.plentymarkets\.com/,
|
|
61
|
+
"www.gstatic.com",
|
|
62
|
+
"static.doubleclick.net",
|
|
63
|
+
"static.newsletter2go.com",
|
|
64
|
+
"cdn-static.optimonk.com",
|
|
65
|
+
]),
|
|
66
|
+
{{else}}
|
|
67
|
+
host: ENABLED_HOSTS,
|
|
68
|
+
{{/if}}
|
|
69
|
+
contentType: [
|
|
70
|
+
'navigate',
|
|
71
|
+
'style',
|
|
72
|
+
'font',
|
|
73
|
+
{{#if activateImageOptimisation}}
|
|
74
|
+
'image',
|
|
75
|
+
{{/if}}
|
|
76
|
+
{{#if isShopify}}
|
|
77
|
+
|
|
78
|
+
// Shopify specific:
|
|
79
|
+
// don't enable 'script' because XHR Requests on PDPs, that do not match the navigate content type, are served as scripts
|
|
80
|
+
{{else}}
|
|
81
|
+
'script',
|
|
82
|
+
{{/if}}
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
host: [
|
|
87
|
+
"fonts.googleapis.com",
|
|
88
|
+
"fonts.gstatic.com",
|
|
89
|
+
],
|
|
90
|
+
contentType: ["script", "style", "font"],
|
|
91
|
+
},
|
|
92
|
+
{{#if isShopify}}
|
|
93
|
+
|
|
94
|
+
// Shopify specific:
|
|
95
|
+
{
|
|
96
|
+
host: [
|
|
97
|
+
"cdn.shopify.com",
|
|
98
|
+
],
|
|
99
|
+
// Image optimization is normally not activated for the Shopify CDN host
|
|
100
|
+
// – unless this has been explicitly requested!
|
|
101
|
+
contentType: ["script", "style", "font"],
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
// Shopify specific:
|
|
105
|
+
{
|
|
106
|
+
url: [
|
|
107
|
+
"bat.bing.com/bat.js",
|
|
108
|
+
"connect.facebook.net/en_US/fbevents.js",
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{{/if}}
|
|
112
|
+
],
|
|
113
|
+
blacklist: [
|
|
114
|
+
{
|
|
115
|
+
pathname: [
|
|
116
|
+
// TODO: adjust/replace this exemplary list
|
|
117
|
+
|
|
118
|
+
// Login & Account:
|
|
119
|
+
/\/account/i,
|
|
120
|
+
/password/i,
|
|
121
|
+
/registration/i,
|
|
122
|
+
/register/i,
|
|
123
|
+
/login/i,
|
|
124
|
+
/authenticate/i,
|
|
125
|
+
|
|
126
|
+
// Checkout & Payment:
|
|
127
|
+
/\/cart/i,
|
|
128
|
+
/\/basket/i,
|
|
129
|
+
/checkout/i,
|
|
130
|
+
/payment/i,
|
|
131
|
+
/paypal/i,
|
|
132
|
+
/klarna/i,
|
|
133
|
+
/amazon/i,
|
|
134
|
+
/ratepay/i,
|
|
135
|
+
/payone/i,
|
|
136
|
+
|
|
137
|
+
// Admin:
|
|
138
|
+
/\/admin/i,
|
|
139
|
+
/\/backend/i,
|
|
140
|
+
|
|
141
|
+
// Misc:
|
|
142
|
+
/\/akam\//i, // Akamai telemetry data
|
|
143
|
+
/\.pdf/,
|
|
144
|
+
/\/adyen/i,
|
|
145
|
+
/\/cdn-cgi\//i, // dynamic scripts
|
|
146
|
+
{{#if isPlentymarkets}}
|
|
147
|
+
|
|
148
|
+
// Plentymarkets specific:
|
|
149
|
+
/\/mein-warenkorb/i,
|
|
150
|
+
/\/mein-checkout/i,
|
|
151
|
+
/\/my-account/i,
|
|
152
|
+
/\/myaccount/i,
|
|
153
|
+
/\/mein-kundenkonto/i,
|
|
154
|
+
/\/wish-list/i,
|
|
155
|
+
/\/rest/i, // REST API
|
|
156
|
+
/place-order/i,
|
|
157
|
+
{{/if}}
|
|
158
|
+
{{#if isSalesforce}}
|
|
159
|
+
|
|
160
|
+
// SFCC specific:
|
|
161
|
+
/\/demandware\.store/i, // high-level api blacklist
|
|
162
|
+
{{/if}}
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
url: [
|
|
167
|
+
/[?&](_=1\d{12})/, // jQuery code execution callbacks
|
|
168
|
+
/[?&]nocache/i,
|
|
169
|
+
|
|
170
|
+
// GTM:
|
|
171
|
+
"www.googletagmanager.com/gtm.js",
|
|
172
|
+
"www.googletagmanager.com/gtag/js",
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
host: ["www.paypal.com", "www.paypalobjects.com"],
|
|
177
|
+
},
|
|
178
|
+
{{#if isShopify}}
|
|
179
|
+
|
|
180
|
+
// Shopify specific:
|
|
181
|
+
{
|
|
182
|
+
pathname: [
|
|
183
|
+
"/api/",
|
|
184
|
+
"/apps/",
|
|
185
|
+
"/a/",
|
|
186
|
+
"/community/",
|
|
187
|
+
"/tools/",
|
|
188
|
+
"/recommendations/",
|
|
189
|
+
/discount/,
|
|
190
|
+
/orders/,
|
|
191
|
+
/digital_wallets/, // HTML Fragment in Checkout that does not match XHR Rule
|
|
192
|
+
"/app/services/", // many checkout resources
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
{{/if}}
|
|
196
|
+
{{#if isShopware}}
|
|
197
|
+
|
|
198
|
+
// Shopware specific:
|
|
199
|
+
{
|
|
200
|
+
pathname: [
|
|
201
|
+
/\/refreshStatistic/i, // stats request
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
{{/if}}
|
|
205
|
+
{{#if isPlentymarkets}}
|
|
206
|
+
|
|
207
|
+
// Plentymarkets specific:
|
|
208
|
+
{
|
|
209
|
+
url: [
|
|
210
|
+
/\/plentymarkets/i, // API, updates of certain pages can be triggered under this path
|
|
211
|
+
|
|
212
|
+
// params:
|
|
213
|
+
/[?&]time=/i,
|
|
214
|
+
/[?&]subscription=/i,
|
|
215
|
+
/[?&]hash=/i,
|
|
216
|
+
/[?&]AccountShow=/i,
|
|
217
|
+
/[?&]OrderID=/i,
|
|
218
|
+
/[?&]PaymentMethod=/i,
|
|
219
|
+
/[?&]paymentId=/i,
|
|
220
|
+
/[?&]token=/i,
|
|
221
|
+
/[?&]PayerID=/i,
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
{{/if}}
|
|
225
|
+
{{#if isShopify}}
|
|
226
|
+
|
|
227
|
+
// Shopify specific:
|
|
228
|
+
// exclude preview function from caching
|
|
229
|
+
{
|
|
230
|
+
url: [
|
|
231
|
+
/[?&]view=/i,
|
|
232
|
+
/[?&]_ab=/i,
|
|
233
|
+
/[?&]_fd=/i,
|
|
234
|
+
/[?&]preview_theme/i,
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
{ cookie: ["preview_theme"] },
|
|
238
|
+
{{/if}}
|
|
239
|
+
{{#if isPlentymarkets}}
|
|
240
|
+
|
|
241
|
+
// Plentymarkets specific:
|
|
242
|
+
// blacklist on experimental features cookie
|
|
243
|
+
{
|
|
244
|
+
cookie: ['PluginSetPreview'],
|
|
245
|
+
contentType: ['document'],
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
// Plentymarkets specific:
|
|
249
|
+
// blacklist based on custom cookie (e.g. on user logging in => see loadHandler)
|
|
250
|
+
{ cookie: ['baqend-speedkit-blacklist'] },
|
|
251
|
+
{{/if}}
|
|
252
|
+
],
|
|
253
|
+
stripQueryParams: [{
|
|
254
|
+
params: [
|
|
255
|
+
// TODO: extend during query param analysis
|
|
256
|
+
{{#if isShopify}}
|
|
257
|
+
|
|
258
|
+
// Shopify specific:
|
|
259
|
+
"_fid",
|
|
260
|
+
"_pos",
|
|
261
|
+
"_psq",
|
|
262
|
+
"_sid",
|
|
263
|
+
"_ss",
|
|
264
|
+
"_v",
|
|
265
|
+
/^pr_/i, // Product Recommendation
|
|
266
|
+
{{/if}}
|
|
267
|
+
|
|
268
|
+
// Default:
|
|
269
|
+
"_ga", // Google Analytics User ID (Universal Analytics)
|
|
270
|
+
"_gl", // Google Analytics User ID (GA 4+)
|
|
271
|
+
"_kx", // klaviyo
|
|
272
|
+
"awc", // AWIN (former Zanox Affiliate Network)
|
|
273
|
+
"campaign",
|
|
274
|
+
"cjid",
|
|
275
|
+
"cto_pld",
|
|
276
|
+
"dclid", // another Click ID
|
|
277
|
+
"ds_rl",
|
|
278
|
+
"epik",
|
|
279
|
+
"fbclid", // Facebook Click ID
|
|
280
|
+
"gtm_debug", // Google Tag Manager
|
|
281
|
+
"msclkid", // Microsoft Click ID
|
|
282
|
+
"srsltid", // google search engine
|
|
283
|
+
"yclid", // Yandex Click ID
|
|
284
|
+
"zanpid", // AWIN (former Zanox Affiliate Network)
|
|
285
|
+
/^[gw]braid$/, // Google's iOS web-to-app campaign measurement
|
|
286
|
+
/^cq_/,
|
|
287
|
+
/^et_/,
|
|
288
|
+
/^gad(w|_source)?$/, // Google Ads
|
|
289
|
+
/^gcl(id|src)$/, // Google Click ID + Source
|
|
290
|
+
/^klar_/, // getklar.com
|
|
291
|
+
/^neocom_/, // Neocom.ai
|
|
292
|
+
/^sc_/, // e.g. Adobe
|
|
293
|
+
/^trc_/, // Tracify
|
|
294
|
+
/^uslk_/, // Userlike Chatbot
|
|
295
|
+
/^utm[_-]/, // Urchin Tracking Module
|
|
296
|
+
/^vm(st|track)_id$/,
|
|
297
|
+
/^wg(u|expiry)$/, // Webgains Affiliate Network
|
|
298
|
+
],
|
|
299
|
+
}],
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
//================================================================================
|
|
303
|
+
// Utility Functions
|
|
304
|
+
//================================================================================
|
|
305
|
+
|
|
306
|
+
function getEnabledHosts(enabledHostsConfigs) {
|
|
307
|
+
var allHosts = [];
|
|
308
|
+
enabledHostsConfigs.forEach(function (enabledHostsConfig) {
|
|
309
|
+
allHosts = allHosts.concat(enabledHostsConfig.hosts);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// Return unique array ("set") of all enabled hosts
|
|
313
|
+
return allHosts.filter(function (value, index, self) {
|
|
314
|
+
return self.indexOf(value) === index;
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function getCurrentHostConfig(enabledHostsConfigs) {
|
|
319
|
+
var currentHost = location.hostname;
|
|
320
|
+
var defaultSplit = 0;
|
|
321
|
+
var defaultSplitTestId = "0vs100";
|
|
322
|
+
var foundHostConfig;
|
|
323
|
+
|
|
324
|
+
// Lookup for matching enabled hosts config
|
|
325
|
+
for (var i = 0; i < enabledHostsConfigs.length; i++) {
|
|
326
|
+
if (enabledHostsConfigs[i].hosts.indexOf(currentHost) !== -1) {
|
|
327
|
+
foundHostConfig = enabledHostsConfigs[i];
|
|
328
|
+
break; // Break out of the loop once the config related to the host is found
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (foundHostConfig) {
|
|
333
|
+
// Provide fallback split values if incomplete or incorrect
|
|
334
|
+
if (
|
|
335
|
+
!(foundHostConfig.split >= 0 && foundHostConfig.split <= 1) ||
|
|
336
|
+
!foundHostConfig.splitTestId
|
|
337
|
+
) {
|
|
338
|
+
foundHostConfig.split = defaultSplit;
|
|
339
|
+
foundHostConfig.splitTestId = defaultSplitTestId;
|
|
340
|
+
}
|
|
341
|
+
foundHostConfig.enabled = true;
|
|
342
|
+
return foundHostConfig;
|
|
343
|
+
} else {
|
|
344
|
+
return {
|
|
345
|
+
enabled: false,
|
|
346
|
+
split: defaultSplit,
|
|
347
|
+
splitTestId: defaultSplitTestId,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
})();
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shop System in use:
|
|
3
|
+
{{#if isShopify}}
|
|
4
|
+
* - Shopify
|
|
5
|
+
{{else if isShopware}}
|
|
6
|
+
* - Shopware
|
|
7
|
+
{{else if isSalesforce}}
|
|
8
|
+
* - Salesforce Commerce Cloud
|
|
9
|
+
{{else if isPlentymarkets}}
|
|
10
|
+
* - Plentymarkets
|
|
11
|
+
{{else}}
|
|
12
|
+
* - TODO: enter name of shop system here... please
|
|
13
|
+
{{/if}}
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const shared = {
|
|
17
|
+
app: "{{appName}}",
|
|
18
|
+
domain: "{{production.host}}",
|
|
19
|
+
origins: [
|
|
20
|
+
"https://{{production.host}}",
|
|
21
|
+
],
|
|
22
|
+
{{#if isShopify}}
|
|
23
|
+
shopifyId: "{{shopifyId}}", // Shopify specific
|
|
24
|
+
swPath: "/apps/speed-kit/sw.js", // Shopify specific
|
|
25
|
+
{{else}}
|
|
26
|
+
swPath: "/wrapper-sw.js",
|
|
27
|
+
{{/if}}
|
|
28
|
+
scope: "/",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const configs = {
|
|
32
|
+
test: {
|
|
33
|
+
...shared,
|
|
34
|
+
app: process.env.TEST_APP,
|
|
35
|
+
name: shared.app,
|
|
36
|
+
forceInstall: true,
|
|
37
|
+
},
|
|
38
|
+
{{#if staging.host}}
|
|
39
|
+
staging: {
|
|
40
|
+
...shared,
|
|
41
|
+
name: "staging",
|
|
42
|
+
domain: "{{staging.host}}",
|
|
43
|
+
origins: [
|
|
44
|
+
"https://{{staging.host}}",
|
|
45
|
+
],
|
|
46
|
+
forceInstall: {{staging.forceInstall}}, // use when our setup is not present yet
|
|
47
|
+
// bypassDeactivation: false, // comment out when SK deactivation should not be bypassed
|
|
48
|
+
},
|
|
49
|
+
{{/if}}
|
|
50
|
+
production: {
|
|
51
|
+
...shared,
|
|
52
|
+
name: "production",
|
|
53
|
+
forceInstall: {{production.forceInstall}}, // use when our setup is not present yet
|
|
54
|
+
// bypassDeactivation: false, // comment out when SK deactivation should not be bypassed
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const objectMap = (obj, fn) =>
|
|
59
|
+
Object.fromEntries(
|
|
60
|
+
Object.entries(obj).map(
|
|
61
|
+
([k, v], i) => [k, fn(v, k, i)],
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const completeConfig = config => ({
|
|
66
|
+
// create installPath automatically if not set:
|
|
67
|
+
{{#if shopifyId}}
|
|
68
|
+
installPath: `https://${config.app}.app.baqend.com/v1/speedkit/install.js?d=${config.name}&shop=${config.shopifyId}.myshopify.com`,
|
|
69
|
+
{{else}}
|
|
70
|
+
installPath: `https://${config.app}.app.baqend.com/v1/speedkit/install.js?d=${config.name}`,
|
|
71
|
+
{{/if}}
|
|
72
|
+
...config,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
module.exports = objectMap(configs, config => completeConfig(config));
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{{#unless addPreRendering}}
|
|
2
|
+
{{#if removeLazyLoading}}
|
|
3
|
+
const lazyLoadDefaultConfig = {
|
|
4
|
+
attributes: [
|
|
5
|
+
{ find: 'data-src', rename: 'src' },
|
|
6
|
+
{ find: 'data-srcset', rename: 'srcset' },
|
|
7
|
+
],
|
|
8
|
+
lazyClass: 'lazyload',
|
|
9
|
+
preload: true, // preload lazy-removed images in head
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const lazyLoadList = [
|
|
13
|
+
// TODO: adjust/replace this exemplary list
|
|
14
|
+
|
|
15
|
+
// Content page's stage image:
|
|
16
|
+
{
|
|
17
|
+
...lazyLoadDefaultConfig,
|
|
18
|
+
parentClasses: [
|
|
19
|
+
'image-with-text-overlay__banner',
|
|
20
|
+
],
|
|
21
|
+
limit: 1
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
// PLP product images:
|
|
25
|
+
{
|
|
26
|
+
...lazyLoadDefaultConfig,
|
|
27
|
+
parentClasses: [
|
|
28
|
+
'product-image__wrapper',
|
|
29
|
+
],
|
|
30
|
+
limit: 4
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
// PDP hero image:
|
|
34
|
+
{
|
|
35
|
+
...lazyLoadDefaultConfig,
|
|
36
|
+
parentClasses: [
|
|
37
|
+
'product-gallery__image',
|
|
38
|
+
],
|
|
39
|
+
limit: 1
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
{{/if}}
|
|
44
|
+
{{/unless}}
|
|
45
|
+
const config = {
|
|
46
|
+
shouldTransform({ db, {{#if addPreRendering}}document{{else}}html{{/if}}, variation, url, headers }) {
|
|
47
|
+
return true;
|
|
48
|
+
},
|
|
49
|
+
shouldDelayDom({ db, {{#if addPreRendering}}document{{else}}html{{/if}}, variation, url, headers }) {
|
|
50
|
+
{{#if isPlentymarkets}}
|
|
51
|
+
return false; // Plentymarkets specific
|
|
52
|
+
{{else}}
|
|
53
|
+
return true;
|
|
54
|
+
{{/if}}
|
|
55
|
+
},
|
|
56
|
+
async preTransform({db, {{#if addPreRendering}}document{{else}}html{{/if}}, variation, url, headers}) {
|
|
57
|
+
{{#unless addPreRendering}}
|
|
58
|
+
return html;
|
|
59
|
+
{{else}}
|
|
60
|
+
// do nothing
|
|
61
|
+
{{/unless}}
|
|
62
|
+
},
|
|
63
|
+
postTransform({db, {{#if addPreRendering}}document{{else}}html{{/if}}, variation, url, headers}) {
|
|
64
|
+
{{#unless addPreRendering}}
|
|
65
|
+
{{#if includeServiceWorker}}
|
|
66
|
+
html = injectServiceWorkerScript(html, '{{includeServiceWorker}}');
|
|
67
|
+
{{/if}}
|
|
68
|
+
return html;
|
|
69
|
+
{{else}}
|
|
70
|
+
// do nothing
|
|
71
|
+
{{/unless}}
|
|
72
|
+
},
|
|
73
|
+
{{#if isPlentymarkets}}
|
|
74
|
+
stripComments: false, // Plentymarkets specific
|
|
75
|
+
{{/if}}
|
|
76
|
+
{{#if isShopify}}
|
|
77
|
+
delayScriptPath: "/apps/speed-kit/speed-kit-dom-ready.js", // Shopify specific
|
|
78
|
+
{{else}}
|
|
79
|
+
delayScriptPath: "/speed-kit-dom-ready.js",
|
|
80
|
+
{{/if}}
|
|
81
|
+
{{#if isSalesforce}}
|
|
82
|
+
executeDeploymentDetection: false, // Salesforce specific => deploymentDetection.es6 is being used instead
|
|
83
|
+
{{else}}
|
|
84
|
+
executeDeploymentDetection: true,
|
|
85
|
+
{{/if}}
|
|
86
|
+
{{#unless addPreRendering}}
|
|
87
|
+
{{#if removeLazyLoading}}
|
|
88
|
+
lazyLoadList,
|
|
89
|
+
{{/if}}
|
|
90
|
+
{{else}}
|
|
91
|
+
preRender: {
|
|
92
|
+
lambdaUrl: 'https://pw5wfiqnr2kqdzzc45tu3rdjue0zildl.lambda-url.eu-central-1.on.aws',
|
|
93
|
+
elements: [
|
|
94
|
+
// app shell e.g. vue often uses #app
|
|
95
|
+
// this will be the main element to extract from the rendered DOM
|
|
96
|
+
{ selector: '#app' }
|
|
97
|
+
],
|
|
98
|
+
guards: [
|
|
99
|
+
{ // plp
|
|
100
|
+
whenPresent: '.products-list-page', // check wait for selectors, when this is present on current Page
|
|
101
|
+
waitFor: [
|
|
102
|
+
// e.g. wait for first 4 images to be loaded
|
|
103
|
+
'.products-list-page__products-list .products-list__tiles__element:nth-child(-n+4) img[src=""]',
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
rules: {
|
|
108
|
+
url: [
|
|
109
|
+
// additional domains for the page to work need to be added here (main domain is already added)
|
|
110
|
+
'<scripts-domain.com>',
|
|
111
|
+
],
|
|
112
|
+
resourceType: [
|
|
113
|
+
// only resource types listed here will be fetched
|
|
114
|
+
'xhr',
|
|
115
|
+
'font',
|
|
116
|
+
'script',
|
|
117
|
+
'document',
|
|
118
|
+
'stylesheet',
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{{/unless}}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const documentHandler = new DocumentHandler({
|
|
126
|
+
...config,
|
|
127
|
+
app: APP,
|
|
128
|
+
dynamicFetcher: DYNAMIC_FETCHER,
|
|
129
|
+
dynamicFetcherConfig: DYNAMIC_FETCHER_CONFIG,
|
|
130
|
+
customStyles: CUSTOM_STYLES
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
export const post = async (db, req, res) => {
|
|
134
|
+
await documentHandler.transformAndSend(db, req, res);
|
|
135
|
+
}
|
|
136
|
+
{{#unless addPreRendering}}
|
|
137
|
+
{{#if includeServiceWorker}}
|
|
138
|
+
|
|
139
|
+
//================================================================================
|
|
140
|
+
// Utility Functions
|
|
141
|
+
//================================================================================
|
|
142
|
+
|
|
143
|
+
function prepend(string, searchString, prependString) {
|
|
144
|
+
const index = string.lastIndexOf(searchString);
|
|
145
|
+
return string.slice(0, index) + prependString + string.slice(index);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function injectServiceWorkerScript(html, searchedSwPath) {
|
|
149
|
+
return prepend(html, '</head>', `
|
|
150
|
+
<script class="speed-kit-service-worker">
|
|
151
|
+
var serviceWorkerRegister = ServiceWorkerContainer.prototype.register;
|
|
152
|
+
ServiceWorkerContainer.prototype.register = function (swPath, options) {
|
|
153
|
+
if (swPath.indexOf('${searchedSwPath}') === 0 && SpeedKit.group === 'A') {
|
|
154
|
+
return navigator.serviceWorker.getRegistration();
|
|
155
|
+
}
|
|
156
|
+
return serviceWorkerRegister.call(this, swPath, options);
|
|
157
|
+
};
|
|
158
|
+
</script>
|
|
159
|
+
`);
|
|
160
|
+
}
|
|
161
|
+
{{/if}}
|
|
162
|
+
{{/unless}}
|