slnodejs 6.1.1087 → 6.1.1091
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 +10 -9
- package/lib/cli.js +1 -1
- package/lib/preload.js +171 -171
- package/package.json +13 -3
- package/tsOutputs/api.js +8 -8
- package/tsOutputs/build-scanner/ast-utils.js +3 -3
- package/tsOutputs/build-scanner/ast-utils.js.map +1 -1
- package/tsOutputs/build-scanner/build-diff-process.js +99 -47
- package/tsOutputs/build-scanner/build-diff-process.js.map +1 -1
- package/tsOutputs/build-scanner/cia.js +17 -9
- package/tsOutputs/build-scanner/cia.js.map +1 -1
- package/tsOutputs/build-scanner/current-agent-instance.js +3 -3
- package/tsOutputs/build-scanner/current-agent-instance.js.map +1 -1
- package/tsOutputs/build-scanner/default-values-resolver.js +6 -7
- package/tsOutputs/build-scanner/default-values-resolver.js.map +1 -1
- package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js +9 -7
- package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js.map +1 -1
- package/tsOutputs/build-scanner/diagnostic/contracts.js.map +1 -1
- package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js.map +1 -1
- package/tsOutputs/build-scanner/entities-mapper.js +5 -4
- package/tsOutputs/build-scanner/entities-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/file-and-folder-utils.js +23 -11
- package/tsOutputs/build-scanner/file-and-folder-utils.js.map +1 -1
- package/tsOutputs/build-scanner/file-system/actual-file.js +9 -9
- package/tsOutputs/build-scanner/file-system/actual-file.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +135 -91
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js +5 -4
- package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js +13 -6
- package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js +6 -4
- package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js +68 -43
- package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/contracts.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js +4 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js +10 -5
- package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js +8 -3
- package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js +5 -3
- package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/strategy-utils.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-js-instrumentation-strategy.d.ts +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-js-instrumentation-strategy.js +3 -3
- package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-markup-instrumentation-strategy.d.ts +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-markup-instrumentation-strategy.js +6 -6
- package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-markup-instrumentation-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/ast-node-types.js +11 -11
- package/tsOutputs/build-scanner/js_diff/ast-node-types.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/branch-key.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/branch-signature.js +22 -15
- package/tsOutputs/build-scanner/js_diff/branch-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/create-node-key.js +1 -1
- package/tsOutputs/build-scanner/js_diff/create-node-key.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/dry-run-files-mapping.js +1 -1
- package/tsOutputs/build-scanner/js_diff/dry-run-files-mapping.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/file-signature.js +31 -26
- package/tsOutputs/build-scanner/js_diff/file-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/files-mapping.js +83 -62
- package/tsOutputs/build-scanner/js_diff/files-mapping.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/generated-file-signature.js +24 -16
- package/tsOutputs/build-scanner/js_diff/generated-file-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/globalMethodIndexer.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/guess-method-location.js +39 -25
- package/tsOutputs/build-scanner/js_diff/guess-method-location.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/guess-method-name.js +23 -20
- package/tsOutputs/build-scanner/js_diff/guess-method-name.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/method-id-by-position-resolver.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/method-signature.js +19 -9
- package/tsOutputs/build-scanner/js_diff/method-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/sl-mapper.js +13 -8
- package/tsOutputs/build-scanner/js_diff/sl-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/source-data-enricher.js +13 -9
- package/tsOutputs/build-scanner/js_diff/source-data-enricher.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/source-files-notifier.js +13 -8
- package/tsOutputs/build-scanner/js_diff/source-files-notifier.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/source-position-mapper.js +6 -2
- package/tsOutputs/build-scanner/js_diff/source-position-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js +26 -19
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-element-utils.js +8 -3
- package/tsOutputs/build-scanner/mappings/file-element-utils.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-enricher.js +47 -17
- package/tsOutputs/build-scanner/mappings/file-enricher.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-path-fixer.js +15 -7
- package/tsOutputs/build-scanner/mappings/file-path-fixer.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/files-container.js +5 -5
- package/tsOutputs/build-scanner/mappings/files-data-container.js +6 -4
- package/tsOutputs/build-scanner/mappings/files-data-container.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/source-path-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/markup-files-parser.js +10 -10
- package/tsOutputs/build-scanner/markup-files-parser.js.map +1 -1
- package/tsOutputs/build-scanner/scm/parse-log.js +3 -1
- package/tsOutputs/build-scanner/scm/parse-log.js.map +1 -1
- package/tsOutputs/build-scanner/scm/scm-file-fixer.js.map +1 -1
- package/tsOutputs/build-scanner/scm/scm-files-container.js.map +1 -1
- package/tsOutputs/build-scanner/source-map-eraser/factory.js.map +1 -1
- package/tsOutputs/build-scanner/source-map-eraser/interface.js.map +1 -1
- package/tsOutputs/build-scanner/source-map-eraser/none-source-maps-eraser.js.map +1 -1
- package/tsOutputs/build-scanner/source-map-eraser/skip-copy-source-maps.js.map +1 -1
- package/tsOutputs/build-scanner/source-map-eraser/source-maps-eraser.d.ts +2 -2
- package/tsOutputs/build-scanner/source-map-eraser/source-maps-eraser.js +1 -1
- package/tsOutputs/build-scanner/utils.js +21 -15
- package/tsOutputs/build-scanner/utils.js.map +1 -1
- package/tsOutputs/cli-parse/agent-instance-data.js.map +1 -1
- package/tsOutputs/cli-parse/agent-time-synchronizer.js.map +1 -1
- package/tsOutputs/cli-parse/child-process-wrapper.js +4 -2
- package/tsOutputs/cli-parse/child-process-wrapper.js.map +1 -1
- package/tsOutputs/cli-parse/cli.js +130 -129
- package/tsOutputs/cli-parse/cli.js.map +1 -1
- package/tsOutputs/cli-parse/constants/constants.js +1 -1
- package/tsOutputs/cli-parse/constants/constants.js.map +1 -1
- package/tsOutputs/cli-parse/constants/third-parties.js +1 -1
- package/tsOutputs/cli-parse/constants/third-parties.js.map +1 -1
- package/tsOutputs/cli-parse/contracts.js.map +1 -1
- package/tsOutputs/cli-parse/custom-commander.js +7 -3
- package/tsOutputs/cli-parse/custom-commander.js.map +1 -1
- package/tsOutputs/cli-parse/executors/base-executor.js +18 -11
- package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-args-dto.js +1 -1
- package/tsOutputs/cli-parse/executors/build-args-dto.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-end-executor.js +4 -4
- package/tsOutputs/cli-parse/executors/build-end-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-executor.js +117 -51
- package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/config-executor.js +1 -1
- package/tsOutputs/cli-parse/executors/config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js +2 -2
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js +9 -8
- package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js +31 -15
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js +3 -3
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js +8 -6
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js.map +1 -1
- package/tsOutputs/cli-parse/executors/end-execution-executor.js +2 -2
- package/tsOutputs/cli-parse/executors/end-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/instrument-args-dto.js +1 -1
- package/tsOutputs/cli-parse/executors/instrument-args-dto.js.map +1 -1
- package/tsOutputs/cli-parse/executors/instrument-executor.js +43 -19
- package/tsOutputs/cli-parse/executors/instrument-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js +3 -3
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/mocha-executor.js +1 -1
- package/tsOutputs/cli-parse/executors/mocha-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/nyc-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/pr-config-executor.js +1 -1
- package/tsOutputs/cli-parse/executors/pr-config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/run-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/start-execution-executor.js +2 -2
- package/tsOutputs/cli-parse/executors/start-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-executions-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-listener-executor.js +3 -1
- package/tsOutputs/cli-parse/executors/test-listener-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/upload-report-executor.js +4 -4
- package/tsOutputs/cli-parse/executors/upload-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/preloader.js +10 -5
- package/tsOutputs/cli-parse/preloader.js.map +1 -1
- package/tsOutputs/cli-parse/utils.js +3 -3
- package/tsOutputs/cli-parse/utils.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-contracts.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-controller.js +28 -10
- package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-guard.js +2 -1
- package/tsOutputs/common/agent-events/agent-events-guard.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js +13 -7
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-start-info-builder.js +2 -3
- package/tsOutputs/common/agent-events/agent-start-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/browser-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/ci-info-builder.js +2 -2
- package/tsOutputs/common/agent-events/ci-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/cockpit-notifier.js +1 -1
- package/tsOutputs/common/agent-events/cockpit-notifier.js.map +1 -1
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/machine-info-builder.js +5 -3
- package/tsOutputs/common/agent-events/machine-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/no-op-agent-events-controller.js +9 -18
- package/tsOutputs/common/agent-events/no-op-agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.js +2 -1
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/sensitive-data-filter.js +2 -2
- package/tsOutputs/common/agent-events/sensitive-data-filter.js.map +1 -1
- package/tsOutputs/common/agent-instance-data.js +5 -1
- package/tsOutputs/common/agent-instance-data.js.map +1 -1
- package/tsOutputs/common/cli-progress.js.map +1 -1
- package/tsOutputs/common/config-process/config-loader.js +13 -6
- package/tsOutputs/common/config-process/config-loader.js.map +1 -1
- package/tsOutputs/common/config-process/config-system.js +19 -6
- package/tsOutputs/common/config-process/config-system.js.map +1 -1
- package/tsOutputs/common/config-process/config.d.ts +2 -2
- package/tsOutputs/common/config-process/config.js +2 -2
- package/tsOutputs/common/config-process/config.js.map +1 -1
- package/tsOutputs/common/config-process/index.js +6 -4
- package/tsOutputs/common/config-process/index.js.map +1 -1
- package/tsOutputs/common/config-process/no-op-config-process.js.map +1 -1
- package/tsOutputs/common/constants/constants.js.map +1 -1
- package/tsOutputs/common/constants/sl-env-vars.js +93 -31
- package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
- package/tsOutputs/common/contracts.d.ts +1 -1
- package/tsOutputs/common/contracts.js.map +1 -1
- package/tsOutputs/common/coverage-elements/contracts.js.map +1 -1
- package/tsOutputs/common/coverage-elements/file-element.js +24 -12
- package/tsOutputs/common/coverage-elements/file-element.js.map +1 -1
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js +19 -17
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js.map +1 -1
- package/tsOutputs/common/coverage-elements/new-id-resolver.js.map +1 -1
- package/tsOutputs/common/coverage-elements/original-module-loader.js +24 -13
- package/tsOutputs/common/coverage-elements/original-module-loader.js.map +1 -1
- package/tsOutputs/common/coverage-elements/unique-id-converter.js +19 -15
- package/tsOutputs/common/coverage-elements/unique-id-converter.js.map +1 -1
- package/tsOutputs/common/environment-data-service.js.map +1 -1
- package/tsOutputs/common/events-process/events-contracts.js.map +1 -1
- package/tsOutputs/common/events-process/events-creator.js +1 -1
- package/tsOutputs/common/events-process/events-creator.js.map +1 -1
- package/tsOutputs/common/events-process/index.js +10 -4
- package/tsOutputs/common/events-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/collection-interval.js +1 -1
- package/tsOutputs/common/footprints-process/collection-interval.js.map +1 -1
- package/tsOutputs/common/footprints-process/footprints-service-proxy.js +4 -1
- package/tsOutputs/common/footprints-process/footprints-service-proxy.js.map +1 -1
- package/tsOutputs/common/footprints-process/index.js +35 -20
- package/tsOutputs/common/footprints-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js +26 -20
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js.map +1 -1
- package/tsOutputs/common/footprints-process/production-footprints-handler.js +30 -17
- package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js +5 -1
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js +12 -10
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-remote-footprints-process.js +1 -2
- package/tsOutputs/common/footprints-process-v6/collector-remote-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js +12 -7
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/footprints-data-utils.d.ts +1 -1
- package/tsOutputs/common/footprints-process-v6/footprints-data-utils.spec.js +38 -38
- package/tsOutputs/common/footprints-process-v6/hits-collector.d.ts +1 -0
- package/tsOutputs/common/footprints-process-v6/hits-collector.js +42 -19
- package/tsOutputs/common/footprints-process-v6/hits-collector.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/hits-converter.js +47 -22
- package/tsOutputs/common/footprints-process-v6/hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/index.js +12 -7
- package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/location-formatter.js +4 -2
- package/tsOutputs/common/footprints-process-v6/location-formatter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js +1 -2
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/source-map-data.js +1 -1
- package/tsOutputs/common/footprints-process-v6/source-map-data.js.map +1 -1
- package/tsOutputs/common/http/backend-proxy-with-default-client.js.map +1 -1
- package/tsOutputs/common/http/backend-proxy.js +26 -10
- package/tsOutputs/common/http/backend-proxy.js.map +1 -1
- package/tsOutputs/common/http/contracts.js.map +1 -1
- package/tsOutputs/common/http/dry-run-proxy.js +8 -16
- package/tsOutputs/common/http/dry-run-proxy.js.map +1 -1
- package/tsOutputs/common/http/entities-mapper.js.map +1 -1
- package/tsOutputs/common/http/http-client.js +25 -12
- package/tsOutputs/common/http/http-client.js.map +1 -1
- package/tsOutputs/common/http/http-verb.js.map +1 -1
- package/tsOutputs/common/http/sl-routes.js +111 -33
- package/tsOutputs/common/http/sl-routes.js.map +1 -1
- package/tsOutputs/common/ignored-files-handler.js +13 -5
- package/tsOutputs/common/ignored-files-handler.js.map +1 -1
- package/tsOutputs/common/index.d.ts +1 -1
- package/tsOutputs/common/logger.js +21 -14
- package/tsOutputs/common/logger.js.map +1 -1
- package/tsOutputs/common/messages-formatter.js.map +1 -1
- package/tsOutputs/common/metrics-process/index.js.map +1 -1
- package/tsOutputs/common/metrics-process/metrics-store-factory.js.map +1 -1
- package/tsOutputs/common/metrics-process/metrics-store.js +3 -3
- package/tsOutputs/common/metrics-process/metrics-store.js.map +1 -1
- package/tsOutputs/common/no-op-state-tracker.js.map +1 -1
- package/tsOutputs/common/queue.js.map +1 -1
- package/tsOutputs/common/scm/git-cloner.js +1 -1
- package/tsOutputs/common/scm/git-cloner.js.map +1 -1
- package/tsOutputs/common/scm/git-format-builder.js +2 -2
- package/tsOutputs/common/scm/git-format-builder.js.map +1 -1
- package/tsOutputs/common/scm/git-log-parser.js +2 -2
- package/tsOutputs/common/scm/git-log-parser.js.map +1 -1
- package/tsOutputs/common/scm/git.js +43 -15
- package/tsOutputs/common/scm/git.js.map +1 -1
- package/tsOutputs/common/scm/none.js +3 -4
- package/tsOutputs/common/scm/none.js.map +1 -1
- package/tsOutputs/common/scm/scm-factory.js.map +1 -1
- package/tsOutputs/common/short-name-to-file-mapper.js.map +1 -1
- package/tsOutputs/common/sl-mapper-tokenizer.js +12 -8
- package/tsOutputs/common/sl-mapper-tokenizer.js.map +1 -1
- package/tsOutputs/common/source-map-config-dto.js +1 -1
- package/tsOutputs/common/source-map-config-dto.js.map +1 -1
- package/tsOutputs/common/source-map-handler.js +7 -4
- package/tsOutputs/common/source-map-handler.js.map +1 -1
- package/tsOutputs/common/source-map-reader.js +14 -14
- package/tsOutputs/common/source-map-reader.js.map +1 -1
- package/tsOutputs/common/source-maps-utils.js +2 -1
- package/tsOutputs/common/source-maps-utils.js.map +1 -1
- package/tsOutputs/common/state-tracker-fpv6.js +5 -4
- package/tsOutputs/common/state-tracker-fpv6.js.map +1 -1
- package/tsOutputs/common/state-tracker.js +18 -7
- package/tsOutputs/common/state-tracker.js.map +1 -1
- package/tsOutputs/common/system-date.js.map +1 -1
- package/tsOutputs/common/utils/abstract-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/build-session-data-builder.js +5 -5
- package/tsOutputs/common/utils/build-session-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/cookie.js +7 -4
- package/tsOutputs/common/utils/cookie.js.map +1 -1
- package/tsOutputs/common/utils/data-cleansing-utils.js +4 -3
- package/tsOutputs/common/utils/data-cleansing-utils.js.map +1 -1
- package/tsOutputs/common/utils/dependency-utils.js +1 -1
- package/tsOutputs/common/utils/dependency-utils.js.map +1 -1
- package/tsOutputs/common/utils/env-var-parsing.js.map +1 -1
- package/tsOutputs/common/utils/files-utils.js.map +1 -1
- package/tsOutputs/common/utils/process-utils.js +3 -2
- package/tsOutputs/common/utils/process-utils.js.map +1 -1
- package/tsOutputs/common/utils/tail-file-reader.js +5 -2
- package/tsOutputs/common/utils/tail-file-reader.js.map +1 -1
- package/tsOutputs/common/utils/test-runner-build-session-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/test-utils/mock-server-utils/contracts.js.map +1 -1
- package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js +3 -3
- package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js.map +1 -1
- package/tsOutputs/common/utils/timer-utils.js +3 -1
- package/tsOutputs/common/utils/timer-utils.js.map +1 -1
- package/tsOutputs/common/utils/token-data-builder.js +4 -4
- package/tsOutputs/common/utils/token-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/token-utils.js +2 -2
- package/tsOutputs/common/utils/validation-utils.js +1 -1
- package/tsOutputs/common/utils/validation-utils.js.map +1 -1
- package/tsOutputs/common/v8-utils.js +2 -1
- package/tsOutputs/common/v8-utils.js.map +1 -1
- package/tsOutputs/common/watchdog.js.map +1 -1
- package/tsOutputs/mocha-reporter/constants.js +7 -7
- package/tsOutputs/mocha-reporter/constants.js.map +1 -1
- package/tsOutputs/mocha-reporter/end-execution.js +3 -3
- package/tsOutputs/mocha-reporter/end-execution.js.map +1 -1
- package/tsOutputs/mocha-reporter/index.js +39 -22
- package/tsOutputs/mocha-reporter/index.js.map +1 -1
- package/tsOutputs/mocha-reporter/otel-agent.js.map +1 -1
- package/tsOutputs/test-listener/SlNodeJsProxy.js +14 -9
- package/tsOutputs/test-listener/SlNodeJsProxy.js.map +1 -1
- package/tsOutputs/test-listener/UserMessageHelper.js.map +1 -1
- package/tsOutputs/test-listener/agent-loader.js +15 -8
- package/tsOutputs/test-listener/agent-loader.js.map +1 -1
- package/tsOutputs/test-listener/agent.js +16 -11
- package/tsOutputs/test-listener/agent.js.map +1 -1
- package/tsOutputs/test-listener/api.js +1 -2
- package/tsOutputs/test-listener/api.js.map +1 -1
- package/tsOutputs/test-listener/base-proxy.js +14 -10
- package/tsOutputs/test-listener/base-proxy.js.map +1 -1
- package/tsOutputs/test-listener/bootstrap.js.map +1 -1
- package/tsOutputs/test-listener/child-process-patcher.js +6 -6
- package/tsOutputs/test-listener/child-process-patcher.js.map +1 -1
- package/tsOutputs/test-listener/coloring/http-coloring.js +38 -27
- package/tsOutputs/test-listener/coloring/http-coloring.js.map +1 -1
- package/tsOutputs/test-listener/coloring/listening-port.js +4 -3
- package/tsOutputs/test-listener/coloring/listening-port.js.map +1 -1
- package/tsOutputs/test-listener/config-process/config-loader.js +5 -3
- package/tsOutputs/test-listener/config-process/config-loader.js.map +1 -1
- package/tsOutputs/test-listener/entities/BasicConfigurationData.js.map +1 -1
- package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js.map +1 -1
- package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/entities-mapper.js +7 -5
- package/tsOutputs/test-listener/execution-process/entities-mapper.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js +30 -17
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/index.js +2 -2
- package/tsOutputs/test-listener/execution-process/index.js.map +1 -1
- package/tsOutputs/test-listener/factory.js +180 -50
- package/tsOutputs/test-listener/factory.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js +18 -15
- package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js.map +1 -1
- package/tsOutputs/test-listener/integrations/SlGulp.js +7 -6
- package/tsOutputs/test-listener/integrations/SlGulp.js.map +1 -1
- package/tsOutputs/test-listener/logs-process/index.js +5 -3
- package/tsOutputs/test-listener/logs-process/index.js.map +1 -1
- package/tsOutputs/test-listener/logs-process/log-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js +1 -1
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor.js +3 -3
- package/tsOutputs/test-listener/nyc-report-executor.js.map +1 -1
- package/tsOutputs/test-listener/otel-agent-loader.js +13 -10
- package/tsOutputs/test-listener/otel-agent-loader.js.map +1 -1
- package/tsOutputs/test-listener/remote-agent.js +37 -9
- package/tsOutputs/test-listener/remote-agent.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/AppNameResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js +23 -6
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ProxyResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/TokenResolver.js.map +1 -1
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js +12 -4
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js.map +1 -1
- package/tsOutputs/test-listener/test-recommendation-handler.js +20 -11
- package/tsOutputs/test-listener/test-recommendation-handler.js.map +1 -1
- package/tsOutputs/test-listener/upload-report-handler.js +14 -5
- package/tsOutputs/test-listener/upload-report-handler.js.map +1 -1
- package/tsOutputs/test-listener/uuid.js +2 -2
- package/tsOutputs/test-listener/uuid.js.map +1 -1
- package/tsOutputs/test-listener/wait-for-multiple-callbacks.js.map +1 -1
package/README.md
CHANGED
|
@@ -46,19 +46,20 @@ NODE_OPTIONS="-r ./node_modules/slnodejs/lib/preload.js" node your-script.js
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
> Using `NODE_OPTIONS` allows you to persist the preloader configuration across multiple Node.js executions without explicitly specifying the `-r` flag each time.
|
|
49
|
+
|
|
49
50
|
---
|
|
50
51
|
|
|
51
52
|
## Environment Variables Configuration
|
|
52
53
|
|
|
53
|
-
| Variable
|
|
54
|
-
|
|
55
|
-
| `SL_TOKEN`
|
|
56
|
-
| `SL_TOKEN_FILE`
|
|
57
|
-
| `SL_BUILD_SESSION_ID`
|
|
58
|
-
| `SL_BUILD_SESSION_ID_FILE
|
|
59
|
-
| `SL_PROJECT_ROOT` | Root directory of your project
|
|
60
|
-
| `SL_COLLECTOR_URL`
|
|
61
|
-
| `SL_LAB_ID`
|
|
54
|
+
| Variable | Description | Default |
|
|
55
|
+
| -------------------------- | ------------------------------------------- | ------------------------- |
|
|
56
|
+
| `SL_TOKEN` | Direct Sealights agent authentication token | |
|
|
57
|
+
| `SL_TOKEN_FILE` | Path to file containing the Sealights token | `./sltoken.txt` |
|
|
58
|
+
| `SL_BUILD_SESSION_ID` | Direct build session ID | |
|
|
59
|
+
| `SL_BUILD_SESSION_ID_FILE` | Path to file containing build session ID | `./buildSessionId` |
|
|
60
|
+
| `SL_PROJECT_ROOT` | Root directory of your project | Current working directory |
|
|
61
|
+
| `SL_COLLECTOR_URL` | URL to Sealights collector | |
|
|
62
|
+
| `SL_LAB_ID` | Lab ID for test execution | |
|
|
62
63
|
|
|
63
64
|
---
|
|
64
65
|
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
require(
|
|
2
|
+
require('../tsOutputs/cli-parse/cli.js');
|
package/lib/preload.js
CHANGED
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
const { resolve } = require('node:path');
|
|
2
|
-
const { spawnSync } = require('node:child_process');
|
|
3
|
-
const { LoggerFactory} = require('../tsOutputs/common/logger')
|
|
4
|
-
|
|
5
|
-
const logger = LoggerFactory.getCreateApplicationLogger();
|
|
6
|
-
|
|
7
|
-
// Split the node options string into tokens, handling quoted strings
|
|
8
|
-
function tokenizeNodeOptions(str) {
|
|
9
|
-
return (str.match(/(?:[^\s"]+|"[^"]*")+/g) || []).map((s) =>
|
|
10
|
-
s.replace(/^\"(.*)\"$/,
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function isThisPreload(targetPath) {
|
|
15
|
-
try {
|
|
16
|
-
const resolvedTarget = resolve(process.cwd(), targetPath);
|
|
17
|
-
const thisFile = __filename;
|
|
18
|
-
// if the target path is the same as the current file, means we matched the preload target with the full path
|
|
19
|
-
if (resolvedTarget === thisFile) {
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
// check if the target path contains the slnodejs preloader path (covering relative path configuration)
|
|
23
|
-
if (targetPath.endsWith(
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
} catch (_) {}
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Sanitize the node options by removing the preload target but keep the rest of the options, prevents endless recursion
|
|
31
|
-
function sanitizeNodeOptions(nodeOptions) {
|
|
32
|
-
const tokens = tokenizeNodeOptions(nodeOptions);
|
|
33
|
-
const sanitized = [];
|
|
34
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
35
|
-
const token = tokens[i];
|
|
36
|
-
if (token ===
|
|
37
|
-
const nextToken = tokens[i + 1];
|
|
38
|
-
if (nextToken) {
|
|
39
|
-
if (isThisPreload(nextToken)) {
|
|
40
|
-
i++; // skip the preload target token
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
sanitized.push(token, nextToken);
|
|
44
|
-
i++; // consumed the next token as well
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
sanitized.push(token);
|
|
49
|
-
}
|
|
50
|
-
return sanitized.join(
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function main() {
|
|
54
|
-
if (process.env.PRELOAD_EXECUTED) {
|
|
55
|
-
logger.info(
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
process.env.PRELOAD_EXECUTED = 1;
|
|
60
|
-
|
|
61
|
-
if (require.main === module) {
|
|
62
|
-
logger.info(
|
|
63
|
-
process.exit(0);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const pathToSlAgentCli = resolve(__dirname,
|
|
67
|
-
|
|
68
|
-
const originalNodeOptions = process.env.NODE_OPTIONS ||
|
|
69
|
-
const sanitizedNodeOptions = sanitizeNodeOptions(originalNodeOptions);
|
|
70
|
-
|
|
71
|
-
let token =
|
|
72
|
-
if (process.env.SL_token || process.env.SL_TOKEN) {
|
|
73
|
-
token = `--token ${process.env.SL_token || process.env.SL_TOKEN}`;
|
|
74
|
-
} else if (process.env.SL_tokenFile || process.env.SL_TOKEN_FILE) {
|
|
75
|
-
token = `--tokenFile ${
|
|
76
|
-
process.env.SL_tokenFile || process.env.SL_TOKEN_FILE
|
|
77
|
-
}`;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
let bsid =
|
|
81
|
-
if (process.env.SL_buildSessionId || process.env.SL_BUILD_SESSION_ID) {
|
|
82
|
-
bsid = `--buildSessionId ${
|
|
83
|
-
process.env.SL_buildSessionId || process.env.SL_BUILD_SESSION_ID
|
|
84
|
-
}`;
|
|
85
|
-
} else if (
|
|
86
|
-
process.env.SL_buildSessionIdFile ||
|
|
87
|
-
process.env.SL_BUILD_SESSION_ID_FILE
|
|
88
|
-
) {
|
|
89
|
-
bsid = `--buildSessionIdFile ${
|
|
90
|
-
process.env.SL_buildSessionIdFile || process.env.SL_BUILD_SESSION_ID_FILE
|
|
91
|
-
}`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
let projectRoot =
|
|
95
|
-
if (process.env.SL_projectRoot || process.env.SL_PROJECT_ROOT) {
|
|
96
|
-
projectRoot = `--projectRoot ${
|
|
97
|
-
process.env.SL_projectRoot || process.env.SL_PROJECT_ROOT
|
|
98
|
-
}`;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
let labId =
|
|
102
|
-
if (process.env.SL_labId || process.env.SL_LAB_ID) {
|
|
103
|
-
labId = `--labId ${process.env.SL_labId || process.env.SL_LAB_ID}`;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
let collectorUrl =
|
|
107
|
-
if (process.env.SL_collectorUrl || process.env.SL_COLLECTOR_URL) {
|
|
108
|
-
collectorUrl = `--collectorUrl ${
|
|
109
|
-
process.env.SL_collectorUrl || process.env.SL_COLLECTOR_URL
|
|
110
|
-
}`;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const [argv0, ...restArgv] = process.argv.map((x) =>
|
|
114
|
-
x.includes(
|
|
115
|
-
);
|
|
116
|
-
const originalArgv = process.argv.join(
|
|
117
|
-
const args = [
|
|
118
|
-
|
|
119
|
-
...token.split(
|
|
120
|
-
...bsid.split(
|
|
121
|
-
...projectRoot.split(
|
|
122
|
-
...labId.split(
|
|
123
|
-
...collectorUrl.split(
|
|
124
|
-
|
|
125
|
-
...restArgv,
|
|
126
|
-
].filter((x) => x); // remove unset arguments
|
|
127
|
-
const processArgs = [pathToSlAgentCli, ...args];
|
|
128
|
-
process.env.NODE_OPTIONS =
|
|
129
|
-
|
|
130
|
-
const childEnv = {
|
|
131
|
-
...process.env,
|
|
132
|
-
NODE_OPTIONS: sanitizedNodeOptions,
|
|
133
|
-
PRELOAD_EXECUTED:
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
try {
|
|
137
|
-
logger.info(`Rerun main module with args - ${JSON.stringify(processArgs)}`);
|
|
138
|
-
const result = spawnSync(process.argv[0], processArgs, {
|
|
139
|
-
stdio:
|
|
140
|
-
shell: false,
|
|
141
|
-
env: childEnv,
|
|
142
|
-
});
|
|
143
|
-
if (result.error) {
|
|
144
|
-
throw result.error;
|
|
145
|
-
}
|
|
146
|
-
process.exit(result.status);
|
|
147
|
-
} catch (error) {
|
|
148
|
-
logger.error(
|
|
149
|
-
logger.info(
|
|
150
|
-
const result = spawnSync(argv0, originalArgv.split(
|
|
151
|
-
stdio:
|
|
152
|
-
shell: false,
|
|
153
|
-
env: childEnv,
|
|
154
|
-
});
|
|
155
|
-
if (result.error) {
|
|
156
|
-
logger.error(
|
|
157
|
-
|
|
158
|
-
result.error
|
|
159
|
-
);
|
|
160
|
-
process.exit(1);
|
|
161
|
-
}
|
|
162
|
-
process.exit(result.status);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
process.on('uncaughtException', (error) => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
main();
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
const { spawnSync } = require('node:child_process');
|
|
3
|
+
const { LoggerFactory } = require('../tsOutputs/common/logger');
|
|
4
|
+
|
|
5
|
+
const logger = LoggerFactory.getCreateApplicationLogger();
|
|
6
|
+
|
|
7
|
+
// Split the node options string into tokens, handling quoted strings
|
|
8
|
+
function tokenizeNodeOptions(str) {
|
|
9
|
+
return (str.match(/(?:[^\s"]+|"[^"]*")+/g) || []).map((s) =>
|
|
10
|
+
s.replace(/^\"(.*)\"$/, '$1'),
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isThisPreload(targetPath) {
|
|
15
|
+
try {
|
|
16
|
+
const resolvedTarget = resolve(process.cwd(), targetPath);
|
|
17
|
+
const thisFile = __filename;
|
|
18
|
+
// if the target path is the same as the current file, means we matched the preload target with the full path
|
|
19
|
+
if (resolvedTarget === thisFile) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
// check if the target path contains the slnodejs preloader path (covering relative path configuration)
|
|
23
|
+
if (targetPath.endsWith('slnodejs/lib/preload.js')) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
} catch (_) {}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Sanitize the node options by removing the preload target but keep the rest of the options, prevents endless recursion
|
|
31
|
+
function sanitizeNodeOptions(nodeOptions) {
|
|
32
|
+
const tokens = tokenizeNodeOptions(nodeOptions);
|
|
33
|
+
const sanitized = [];
|
|
34
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
35
|
+
const token = tokens[i];
|
|
36
|
+
if (token === '-r' || token === '--require') {
|
|
37
|
+
const nextToken = tokens[i + 1];
|
|
38
|
+
if (nextToken) {
|
|
39
|
+
if (isThisPreload(nextToken)) {
|
|
40
|
+
i++; // skip the preload target token
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
sanitized.push(token, nextToken);
|
|
44
|
+
i++; // consumed the next token as well
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
sanitized.push(token);
|
|
49
|
+
}
|
|
50
|
+
return sanitized.join(' ').trim();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function main() {
|
|
54
|
+
if (process.env.PRELOAD_EXECUTED) {
|
|
55
|
+
logger.info('Skipping preload logic on subsequent entry');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
process.env.PRELOAD_EXECUTED = 1;
|
|
60
|
+
|
|
61
|
+
if (require.main === module) {
|
|
62
|
+
logger.info('preload.js is the main module, exiting.');
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const pathToSlAgentCli = resolve(__dirname, './cli.js');
|
|
67
|
+
|
|
68
|
+
const originalNodeOptions = process.env.NODE_OPTIONS || '';
|
|
69
|
+
const sanitizedNodeOptions = sanitizeNodeOptions(originalNodeOptions);
|
|
70
|
+
|
|
71
|
+
let token = '--tokenFile ./sltoken.txt';
|
|
72
|
+
if (process.env.SL_token || process.env.SL_TOKEN) {
|
|
73
|
+
token = `--token ${process.env.SL_token || process.env.SL_TOKEN}`;
|
|
74
|
+
} else if (process.env.SL_tokenFile || process.env.SL_TOKEN_FILE) {
|
|
75
|
+
token = `--tokenFile ${
|
|
76
|
+
process.env.SL_tokenFile || process.env.SL_TOKEN_FILE
|
|
77
|
+
}`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let bsid = '--buildSessionIdFile ./buildSessionId';
|
|
81
|
+
if (process.env.SL_buildSessionId || process.env.SL_BUILD_SESSION_ID) {
|
|
82
|
+
bsid = `--buildSessionId ${
|
|
83
|
+
process.env.SL_buildSessionId || process.env.SL_BUILD_SESSION_ID
|
|
84
|
+
}`;
|
|
85
|
+
} else if (
|
|
86
|
+
process.env.SL_buildSessionIdFile ||
|
|
87
|
+
process.env.SL_BUILD_SESSION_ID_FILE
|
|
88
|
+
) {
|
|
89
|
+
bsid = `--buildSessionIdFile ${
|
|
90
|
+
process.env.SL_buildSessionIdFile || process.env.SL_BUILD_SESSION_ID_FILE
|
|
91
|
+
}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let projectRoot = '';
|
|
95
|
+
if (process.env.SL_projectRoot || process.env.SL_PROJECT_ROOT) {
|
|
96
|
+
projectRoot = `--projectRoot ${
|
|
97
|
+
process.env.SL_projectRoot || process.env.SL_PROJECT_ROOT
|
|
98
|
+
}`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
let labId = '';
|
|
102
|
+
if (process.env.SL_labId || process.env.SL_LAB_ID) {
|
|
103
|
+
labId = `--labId ${process.env.SL_labId || process.env.SL_LAB_ID}`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let collectorUrl = '';
|
|
107
|
+
if (process.env.SL_collectorUrl || process.env.SL_COLLECTOR_URL) {
|
|
108
|
+
collectorUrl = `--collectorUrl ${
|
|
109
|
+
process.env.SL_collectorUrl || process.env.SL_COLLECTOR_URL
|
|
110
|
+
}`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const [argv0, ...restArgv] = process.argv.map((x) =>
|
|
114
|
+
x.includes(' ') ? `"${x}"` : x,
|
|
115
|
+
);
|
|
116
|
+
const originalArgv = process.argv.join(' ');
|
|
117
|
+
const args = [
|
|
118
|
+
'run',
|
|
119
|
+
...token.split(' '),
|
|
120
|
+
...bsid.split(' '),
|
|
121
|
+
...projectRoot.split(' '),
|
|
122
|
+
...labId.split(' '),
|
|
123
|
+
...collectorUrl.split(' '),
|
|
124
|
+
'--',
|
|
125
|
+
...restArgv,
|
|
126
|
+
].filter((x) => x); // remove unset arguments
|
|
127
|
+
const processArgs = [pathToSlAgentCli, ...args];
|
|
128
|
+
process.env.NODE_OPTIONS = '';
|
|
129
|
+
|
|
130
|
+
const childEnv = {
|
|
131
|
+
...process.env,
|
|
132
|
+
NODE_OPTIONS: sanitizedNodeOptions,
|
|
133
|
+
PRELOAD_EXECUTED: '1',
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
try {
|
|
137
|
+
logger.info(`Rerun main module with args - ${JSON.stringify(processArgs)}`);
|
|
138
|
+
const result = spawnSync(process.argv[0], processArgs, {
|
|
139
|
+
stdio: 'inherit',
|
|
140
|
+
shell: false,
|
|
141
|
+
env: childEnv,
|
|
142
|
+
});
|
|
143
|
+
if (result.error) {
|
|
144
|
+
throw result.error;
|
|
145
|
+
}
|
|
146
|
+
process.exit(result.status);
|
|
147
|
+
} catch (error) {
|
|
148
|
+
logger.error('Error occurred while executing the target script:', error);
|
|
149
|
+
logger.info('Run main module with original args - ', originalArgv);
|
|
150
|
+
const result = spawnSync(argv0, originalArgv.split(' '), {
|
|
151
|
+
stdio: 'inherit',
|
|
152
|
+
shell: false,
|
|
153
|
+
env: childEnv,
|
|
154
|
+
});
|
|
155
|
+
if (result.error) {
|
|
156
|
+
logger.error(
|
|
157
|
+
'Error occurred while executing the original script:',
|
|
158
|
+
result.error,
|
|
159
|
+
);
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
process.exit(result.status);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
process.on('uncaughtException', (error) => {
|
|
167
|
+
logger.error('Uncaught Exception:', error);
|
|
168
|
+
process.exit(1);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slnodejs",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.1091",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "tsOutputs/api.js",
|
|
6
6
|
"workspaces": [
|
|
@@ -29,8 +29,10 @@
|
|
|
29
29
|
"build:lightweight-agent": "cd lightweight-agent && npm run build",
|
|
30
30
|
"build": "npm run lint && npm run build:node-agent && npm run build:browser-agent && npm run build:lightweight-agent",
|
|
31
31
|
"lint": "npx eslint .",
|
|
32
|
+
"prettier": "npx prettier -w .",
|
|
32
33
|
"lint:fix": "npx eslint --fix .",
|
|
33
|
-
"install-all": "npm run install-node-agent && npm run install-browser-agent && npm run install-lightweight-agent"
|
|
34
|
+
"install-all": "npm run install-node-agent && npm run install-browser-agent && npm run install-lightweight-agent",
|
|
35
|
+
"prepare": "husky install"
|
|
34
36
|
},
|
|
35
37
|
"keywords": [],
|
|
36
38
|
"author": "",
|
|
@@ -113,14 +115,18 @@
|
|
|
113
115
|
"cpy": "8.1.2",
|
|
114
116
|
"deep-diff": "1.0.2",
|
|
115
117
|
"eslint": "^8.27.0",
|
|
118
|
+
"eslint-config-prettier": "^10.1.8",
|
|
116
119
|
"eslint-plugin-mocha": "^10.1.0",
|
|
117
120
|
"express": "4.17.1",
|
|
118
121
|
"find-free-port": "^2.0.0",
|
|
119
122
|
"fs-extra": "7.0.1",
|
|
123
|
+
"husky": "^9.1.7",
|
|
124
|
+
"lint-staged": "^16.1.5",
|
|
120
125
|
"mocha": "6.2.3",
|
|
121
126
|
"mockdate": "2.0.2",
|
|
122
127
|
"mute": "2.0.6",
|
|
123
128
|
"plugin-error": "1.0.1",
|
|
129
|
+
"prettier": "^3.6.2",
|
|
124
130
|
"proxyquire": "^2.1.3",
|
|
125
131
|
"recursive-readdir": "2.2.3",
|
|
126
132
|
"shelljs": "^0.8.5",
|
|
@@ -144,5 +150,9 @@
|
|
|
144
150
|
"tsOutputs/mocha-reporter/*",
|
|
145
151
|
"tsOutputs/test-listener/*",
|
|
146
152
|
"browser-agent/dist"
|
|
147
|
-
]
|
|
153
|
+
],
|
|
154
|
+
"lint-staged": {
|
|
155
|
+
"*.{js,ts}": "eslint --cache --fix",
|
|
156
|
+
"*.{js,ts,css,md}": "prettier --write"
|
|
157
|
+
}
|
|
148
158
|
}
|
package/tsOutputs/api.js
CHANGED
|
@@ -33,11 +33,11 @@ function createRemoteAgent(cliArgs, useRelativeCoverage = false, disableStateTra
|
|
|
33
33
|
const agentConfig = yield cliArgsToAgentConfig(cliArgs);
|
|
34
34
|
const agent = new factory_1.NodeAgentFactory(agentConfig).createRemoteAgent(useRelativeCoverage, disableStateTracker);
|
|
35
35
|
/* This was added in order to prevent the remote-agent from opening new execution in case of bsid resolved from labid
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
The customers that required this feature in that point in time were opening executions manually using the 'start' command
|
|
37
|
+
So it was assumed that it will always be the case, but in recent releases of our plugins we have added the ability to start the execution from the remote-agent
|
|
38
|
+
itself and this is breaking that functionality when labId is provided (the remote-agent tries to load a non-existing )
|
|
39
|
+
https://sealights.atlassian.net/browse/SLDEV-14814
|
|
40
|
+
*/
|
|
41
41
|
if (checkBsidResolvedFromLabId) {
|
|
42
42
|
agent.isStartingExecution = !bsidResolvedFromLabid(cliArgs);
|
|
43
43
|
}
|
|
@@ -58,7 +58,7 @@ function cliArgsToAgentConfig(cliArgs) {
|
|
|
58
58
|
throw new Error('could not resolve build session data');
|
|
59
59
|
}
|
|
60
60
|
backendProxy.updateMetadata({
|
|
61
|
-
buildSessionId: buildSessionData.buildSessionId
|
|
61
|
+
buildSessionId: buildSessionData.buildSessionId,
|
|
62
62
|
});
|
|
63
63
|
logger.debug(`Resolved build session data ${buildSessionData}`);
|
|
64
64
|
return createAgentConfig(Object.assign(Object.assign(Object.assign(Object.assign({}, cliArgs), tokenData), buildSessionData), { build: buildSessionData.buildName, branch: buildSessionData.branchName }));
|
|
@@ -66,13 +66,13 @@ function cliArgsToAgentConfig(cliArgs) {
|
|
|
66
66
|
}
|
|
67
67
|
exports.cliArgsToAgentConfig = cliArgsToAgentConfig;
|
|
68
68
|
function bsidResolvedFromLabid(cliArgs) {
|
|
69
|
-
return cliArgs.labid && !cliArgs.buildsessionid && !cliArgs.buildsessionidfile;
|
|
69
|
+
return (cliArgs.labid && !cliArgs.buildsessionid && !cliArgs.buildsessionidfile);
|
|
70
70
|
}
|
|
71
71
|
exports.bsidResolvedFromLabid = bsidResolvedFromLabid;
|
|
72
72
|
function createAgentConfig(configJson) {
|
|
73
73
|
const agentConfig = new config_loader_1.ConfigLoader().loadAgentConfiguration({});
|
|
74
74
|
const agentConfigKeys = agentConfig.getLowerCaseToKeyMap();
|
|
75
|
-
Object.keys(configJson).forEach(key => {
|
|
75
|
+
Object.keys(configJson).forEach((key) => {
|
|
76
76
|
const property = agentConfigKeys[key.toLowerCase()];
|
|
77
77
|
if (property) {
|
|
78
78
|
agentConfig[property].value = configJson[key];
|
|
@@ -23,16 +23,16 @@ function getParserPlugins(babylonPlugins, filename) {
|
|
|
23
23
|
}
|
|
24
24
|
function parseContentToAST(content, opts, filename, diagnostic) {
|
|
25
25
|
var _a;
|
|
26
|
-
const sourceType =
|
|
26
|
+
const sourceType = opts && opts.es6Modules ? 'module' : 'script';
|
|
27
27
|
const plugins = getParserPlugins(opts && opts.babylonPlugins, filename);
|
|
28
28
|
diagnostic.usedPlugins(filename, plugins);
|
|
29
29
|
const file = (0, parser_1.parse)(content, {
|
|
30
30
|
sourceType: sourceType,
|
|
31
31
|
plugins: plugins,
|
|
32
|
-
errorRecovery: true
|
|
32
|
+
errorRecovery: true,
|
|
33
33
|
});
|
|
34
34
|
if ((_a = file === null || file === void 0 ? void 0 : file.errors) === null || _a === void 0 ? void 0 : _a.length) {
|
|
35
|
-
cockpit_notifier_1.CockpitNotifier.sendWarning(`File '${filename}' parsed to AST with the following error(s): ${file.errors.map(e => e.message)}`);
|
|
35
|
+
cockpit_notifier_1.CockpitNotifier.sendWarning(`File '${filename}' parsed to AST with the following error(s): ${file.errors.map((e) => e.message)}`);
|
|
36
36
|
}
|
|
37
37
|
return file;
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-utils.js","sourceRoot":"","sources":["../../build-scanner/ast-utils.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"ast-utils.js","sourceRoot":"","sources":["../../build-scanner/ast-utils.ts"],"names":[],"mappings":";;;AAAA,0CAAoD;AAEpD,8EAA0E;AAC1E,6CAAiD;AAGjD,MAAM,MAAM,GAAG,sBAAa,CAAC,0BAA0B,EAAE,CAAC;AAE1D,SAAS,mBAAmB,CAC1B,cAA8B,EAC9B,QAAgB;IAEhB,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;IAC7C,IAAI,cAAc,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE;QACjD,MAAM,CAAC,IAAI,CACT,UAAU,gBAAgB,8BAA8B,QAAQ,GAAG,CACpE,CAAC;QACF,OAAO;KACR;IACD,OAAO,CAAC,YAAY,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,gBAAgB,CAAC,cAA8B,EAAE,QAAgB;IACxE,cAAc,GAAG,cAAc,IAAI,EAAE,CAAC;IACtC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAEvE,IAAI,gBAAgB,EAAE;QACpB,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;KACvC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAgB,iBAAiB,CAC/B,OAAe,EACf,IAAS,EACT,QAAgB,EAChB,UAA+B;;IAE/B,MAAM,UAAU,GAAG,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IACjE,MAAM,OAAO,GAAmB,gBAAgB,CAC9C,IAAI,IAAI,IAAI,CAAC,cAAc,EAC3B,QAAQ,CACT,CAAC;IACF,UAAU,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAA,cAAK,EAAC,OAAO,EAAE;QAC1B,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE,OAAO;QAChB,aAAa,EAAE,IAAI;KACpB,CAA8B,CAAC;IAEhC,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAE,MAAM,EAAE;QACxB,kCAAe,CAAC,WAAW,CACzB,SAAS,QAAQ,gDAAgD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CACrG,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAxBD,8CAwBC"}
|