slnodejs 6.1.1087 → 6.1.1090

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/README.md +10 -9
  2. package/lib/cli.js +1 -1
  3. package/lib/preload.js +171 -171
  4. package/package.json +13 -3
  5. package/tsOutputs/api.js +8 -8
  6. package/tsOutputs/build-scanner/ast-utils.js +3 -3
  7. package/tsOutputs/build-scanner/ast-utils.js.map +1 -1
  8. package/tsOutputs/build-scanner/build-diff-process.js +99 -47
  9. package/tsOutputs/build-scanner/build-diff-process.js.map +1 -1
  10. package/tsOutputs/build-scanner/cia.js +17 -9
  11. package/tsOutputs/build-scanner/cia.js.map +1 -1
  12. package/tsOutputs/build-scanner/current-agent-instance.js +3 -3
  13. package/tsOutputs/build-scanner/current-agent-instance.js.map +1 -1
  14. package/tsOutputs/build-scanner/default-values-resolver.js +6 -7
  15. package/tsOutputs/build-scanner/default-values-resolver.js.map +1 -1
  16. package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js +9 -7
  17. package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js.map +1 -1
  18. package/tsOutputs/build-scanner/diagnostic/contracts.js.map +1 -1
  19. package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js.map +1 -1
  20. package/tsOutputs/build-scanner/entities-mapper.js +5 -4
  21. package/tsOutputs/build-scanner/entities-mapper.js.map +1 -1
  22. package/tsOutputs/build-scanner/file-and-folder-utils.js +23 -11
  23. package/tsOutputs/build-scanner/file-and-folder-utils.js.map +1 -1
  24. package/tsOutputs/build-scanner/file-system/actual-file.js +9 -9
  25. package/tsOutputs/build-scanner/file-system/actual-file.js.map +1 -1
  26. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +135 -91
  27. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
  28. package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js +5 -4
  29. package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js.map +1 -1
  30. package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js +13 -6
  31. package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js.map +1 -1
  32. package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js +6 -4
  33. package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js.map +1 -1
  34. package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js +68 -43
  35. package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js.map +1 -1
  36. package/tsOutputs/build-scanner/instrumentation/process-pool/contracts.js.map +1 -1
  37. package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js +4 -1
  38. package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js.map +1 -1
  39. package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js +10 -5
  40. package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js.map +1 -1
  41. package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js +1 -1
  42. package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js.map +1 -1
  43. package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js.map +1 -1
  44. package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js.map +1 -1
  45. package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js +8 -3
  46. package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js.map +1 -1
  47. package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js +5 -3
  48. package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js.map +1 -1
  49. package/tsOutputs/build-scanner/instrumentation/strategies/strategy-utils.js.map +1 -1
  50. package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-js-instrumentation-strategy.d.ts +1 -1
  51. package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-js-instrumentation-strategy.js +3 -3
  52. package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-markup-instrumentation-strategy.d.ts +1 -1
  53. package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-markup-instrumentation-strategy.js +6 -6
  54. package/tsOutputs/build-scanner/instrumentation/strategies/toggle-based-markup-instrumentation-strategy.js.map +1 -1
  55. package/tsOutputs/build-scanner/js_diff/ast-node-types.js +11 -11
  56. package/tsOutputs/build-scanner/js_diff/ast-node-types.js.map +1 -1
  57. package/tsOutputs/build-scanner/js_diff/branch-key.js.map +1 -1
  58. package/tsOutputs/build-scanner/js_diff/branch-signature.js +22 -15
  59. package/tsOutputs/build-scanner/js_diff/branch-signature.js.map +1 -1
  60. package/tsOutputs/build-scanner/js_diff/create-node-key.js +1 -1
  61. package/tsOutputs/build-scanner/js_diff/create-node-key.js.map +1 -1
  62. package/tsOutputs/build-scanner/js_diff/dry-run-files-mapping.js +1 -1
  63. package/tsOutputs/build-scanner/js_diff/dry-run-files-mapping.js.map +1 -1
  64. package/tsOutputs/build-scanner/js_diff/file-signature.js +31 -26
  65. package/tsOutputs/build-scanner/js_diff/file-signature.js.map +1 -1
  66. package/tsOutputs/build-scanner/js_diff/files-mapping.js +83 -62
  67. package/tsOutputs/build-scanner/js_diff/files-mapping.js.map +1 -1
  68. package/tsOutputs/build-scanner/js_diff/generated-file-signature.js +24 -16
  69. package/tsOutputs/build-scanner/js_diff/generated-file-signature.js.map +1 -1
  70. package/tsOutputs/build-scanner/js_diff/globalMethodIndexer.js.map +1 -1
  71. package/tsOutputs/build-scanner/js_diff/guess-method-location.js +39 -25
  72. package/tsOutputs/build-scanner/js_diff/guess-method-location.js.map +1 -1
  73. package/tsOutputs/build-scanner/js_diff/guess-method-name.js +23 -20
  74. package/tsOutputs/build-scanner/js_diff/guess-method-name.js.map +1 -1
  75. package/tsOutputs/build-scanner/js_diff/method-id-by-position-resolver.js.map +1 -1
  76. package/tsOutputs/build-scanner/js_diff/method-signature.js +19 -9
  77. package/tsOutputs/build-scanner/js_diff/method-signature.js.map +1 -1
  78. package/tsOutputs/build-scanner/js_diff/sl-mapper.js +13 -8
  79. package/tsOutputs/build-scanner/js_diff/sl-mapper.js.map +1 -1
  80. package/tsOutputs/build-scanner/js_diff/source-data-enricher.js +13 -9
  81. package/tsOutputs/build-scanner/js_diff/source-data-enricher.js.map +1 -1
  82. package/tsOutputs/build-scanner/js_diff/source-files-notifier.js +13 -8
  83. package/tsOutputs/build-scanner/js_diff/source-files-notifier.js.map +1 -1
  84. package/tsOutputs/build-scanner/js_diff/source-position-mapper.js +6 -2
  85. package/tsOutputs/build-scanner/js_diff/source-position-mapper.js.map +1 -1
  86. package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js +26 -19
  87. package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js.map +1 -1
  88. package/tsOutputs/build-scanner/mappings/file-element-utils.js +8 -3
  89. package/tsOutputs/build-scanner/mappings/file-element-utils.js.map +1 -1
  90. package/tsOutputs/build-scanner/mappings/file-enricher.js +47 -17
  91. package/tsOutputs/build-scanner/mappings/file-enricher.js.map +1 -1
  92. package/tsOutputs/build-scanner/mappings/file-path-fixer.js +15 -7
  93. package/tsOutputs/build-scanner/mappings/file-path-fixer.js.map +1 -1
  94. package/tsOutputs/build-scanner/mappings/files-container.js +5 -5
  95. package/tsOutputs/build-scanner/mappings/files-data-container.js +6 -4
  96. package/tsOutputs/build-scanner/mappings/files-data-container.js.map +1 -1
  97. package/tsOutputs/build-scanner/mappings/source-path-mapper.js.map +1 -1
  98. package/tsOutputs/build-scanner/markup-files-parser.js +10 -10
  99. package/tsOutputs/build-scanner/markup-files-parser.js.map +1 -1
  100. package/tsOutputs/build-scanner/scm/parse-log.js +3 -1
  101. package/tsOutputs/build-scanner/scm/parse-log.js.map +1 -1
  102. package/tsOutputs/build-scanner/scm/scm-file-fixer.js.map +1 -1
  103. package/tsOutputs/build-scanner/scm/scm-files-container.js.map +1 -1
  104. package/tsOutputs/build-scanner/source-map-eraser/factory.js.map +1 -1
  105. package/tsOutputs/build-scanner/source-map-eraser/interface.js.map +1 -1
  106. package/tsOutputs/build-scanner/source-map-eraser/none-source-maps-eraser.js.map +1 -1
  107. package/tsOutputs/build-scanner/source-map-eraser/skip-copy-source-maps.js.map +1 -1
  108. package/tsOutputs/build-scanner/source-map-eraser/source-maps-eraser.d.ts +2 -2
  109. package/tsOutputs/build-scanner/source-map-eraser/source-maps-eraser.js +1 -1
  110. package/tsOutputs/build-scanner/utils.js +21 -15
  111. package/tsOutputs/build-scanner/utils.js.map +1 -1
  112. package/tsOutputs/cli-parse/agent-instance-data.js.map +1 -1
  113. package/tsOutputs/cli-parse/agent-time-synchronizer.js.map +1 -1
  114. package/tsOutputs/cli-parse/child-process-wrapper.js +4 -2
  115. package/tsOutputs/cli-parse/child-process-wrapper.js.map +1 -1
  116. package/tsOutputs/cli-parse/cli.js +130 -129
  117. package/tsOutputs/cli-parse/cli.js.map +1 -1
  118. package/tsOutputs/cli-parse/constants/constants.js +1 -1
  119. package/tsOutputs/cli-parse/constants/constants.js.map +1 -1
  120. package/tsOutputs/cli-parse/constants/third-parties.js +1 -1
  121. package/tsOutputs/cli-parse/constants/third-parties.js.map +1 -1
  122. package/tsOutputs/cli-parse/contracts.js.map +1 -1
  123. package/tsOutputs/cli-parse/custom-commander.js +7 -3
  124. package/tsOutputs/cli-parse/custom-commander.js.map +1 -1
  125. package/tsOutputs/cli-parse/executors/base-executor.js +18 -11
  126. package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
  127. package/tsOutputs/cli-parse/executors/build-args-dto.js +1 -1
  128. package/tsOutputs/cli-parse/executors/build-args-dto.js.map +1 -1
  129. package/tsOutputs/cli-parse/executors/build-end-executor.js +4 -4
  130. package/tsOutputs/cli-parse/executors/build-end-executor.js.map +1 -1
  131. package/tsOutputs/cli-parse/executors/build-executor.js +117 -51
  132. package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
  133. package/tsOutputs/cli-parse/executors/config-executor.js +1 -1
  134. package/tsOutputs/cli-parse/executors/config-executor.js.map +1 -1
  135. package/tsOutputs/cli-parse/executors/dry-run/base-data.js +2 -2
  136. package/tsOutputs/cli-parse/executors/dry-run/base-data.js.map +1 -1
  137. package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js +9 -8
  138. package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js.map +1 -1
  139. package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js +31 -15
  140. package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js.map +1 -1
  141. package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js.map +1 -1
  142. package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js +3 -3
  143. package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js.map +1 -1
  144. package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js +8 -6
  145. package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js.map +1 -1
  146. package/tsOutputs/cli-parse/executors/end-execution-executor.js +2 -2
  147. package/tsOutputs/cli-parse/executors/end-execution-executor.js.map +1 -1
  148. package/tsOutputs/cli-parse/executors/instrument-args-dto.js +1 -1
  149. package/tsOutputs/cli-parse/executors/instrument-args-dto.js.map +1 -1
  150. package/tsOutputs/cli-parse/executors/instrument-executor.js +43 -19
  151. package/tsOutputs/cli-parse/executors/instrument-executor.js.map +1 -1
  152. package/tsOutputs/cli-parse/executors/integration-build-components-executor.js +3 -3
  153. package/tsOutputs/cli-parse/executors/integration-build-components-executor.js.map +1 -1
  154. package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js.map +1 -1
  155. package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js.map +1 -1
  156. package/tsOutputs/cli-parse/executors/mocha-executor.js +1 -1
  157. package/tsOutputs/cli-parse/executors/mocha-executor.js.map +1 -1
  158. package/tsOutputs/cli-parse/executors/nyc-report-executor.js.map +1 -1
  159. package/tsOutputs/cli-parse/executors/pr-config-executor.js +1 -1
  160. package/tsOutputs/cli-parse/executors/pr-config-executor.js.map +1 -1
  161. package/tsOutputs/cli-parse/executors/run-executor.js.map +1 -1
  162. package/tsOutputs/cli-parse/executors/start-execution-executor.js +2 -2
  163. package/tsOutputs/cli-parse/executors/start-execution-executor.js.map +1 -1
  164. package/tsOutputs/cli-parse/executors/test-executions-executor.js.map +1 -1
  165. package/tsOutputs/cli-parse/executors/test-listener-executor.js +3 -1
  166. package/tsOutputs/cli-parse/executors/test-listener-executor.js.map +1 -1
  167. package/tsOutputs/cli-parse/executors/upload-report-executor.js +4 -4
  168. package/tsOutputs/cli-parse/executors/upload-report-executor.js.map +1 -1
  169. package/tsOutputs/cli-parse/preloader.js +10 -5
  170. package/tsOutputs/cli-parse/preloader.js.map +1 -1
  171. package/tsOutputs/cli-parse/utils.js +3 -3
  172. package/tsOutputs/cli-parse/utils.js.map +1 -1
  173. package/tsOutputs/common/agent-events/agent-events-contracts.js.map +1 -1
  174. package/tsOutputs/common/agent-events/agent-events-controller.js +28 -10
  175. package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
  176. package/tsOutputs/common/agent-events/agent-events-guard.js +2 -1
  177. package/tsOutputs/common/agent-events/agent-events-guard.js.map +1 -1
  178. package/tsOutputs/common/agent-events/agent-instance-info-builder.js +13 -7
  179. package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
  180. package/tsOutputs/common/agent-events/agent-start-info-builder.js +2 -3
  181. package/tsOutputs/common/agent-events/agent-start-info-builder.js.map +1 -1
  182. package/tsOutputs/common/agent-events/browser-info-builder.js.map +1 -1
  183. package/tsOutputs/common/agent-events/ci-info-builder.js +2 -2
  184. package/tsOutputs/common/agent-events/ci-info-builder.js.map +1 -1
  185. package/tsOutputs/common/agent-events/cockpit-notifier.js +1 -1
  186. package/tsOutputs/common/agent-events/cockpit-notifier.js.map +1 -1
  187. package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js.map +1 -1
  188. package/tsOutputs/common/agent-events/machine-info-builder.js +5 -3
  189. package/tsOutputs/common/agent-events/machine-info-builder.js.map +1 -1
  190. package/tsOutputs/common/agent-events/no-op-agent-events-controller.js +9 -18
  191. package/tsOutputs/common/agent-events/no-op-agent-events-controller.js.map +1 -1
  192. package/tsOutputs/common/agent-events/nodejs-env-info-builder.js +2 -1
  193. package/tsOutputs/common/agent-events/nodejs-env-info-builder.js.map +1 -1
  194. package/tsOutputs/common/agent-events/sensitive-data-filter.js +2 -2
  195. package/tsOutputs/common/agent-events/sensitive-data-filter.js.map +1 -1
  196. package/tsOutputs/common/agent-instance-data.js +5 -1
  197. package/tsOutputs/common/agent-instance-data.js.map +1 -1
  198. package/tsOutputs/common/cli-progress.js.map +1 -1
  199. package/tsOutputs/common/config-process/config-loader.js +13 -6
  200. package/tsOutputs/common/config-process/config-loader.js.map +1 -1
  201. package/tsOutputs/common/config-process/config-system.js +19 -6
  202. package/tsOutputs/common/config-process/config-system.js.map +1 -1
  203. package/tsOutputs/common/config-process/config.d.ts +2 -2
  204. package/tsOutputs/common/config-process/config.js +2 -2
  205. package/tsOutputs/common/config-process/config.js.map +1 -1
  206. package/tsOutputs/common/config-process/index.js +6 -4
  207. package/tsOutputs/common/config-process/index.js.map +1 -1
  208. package/tsOutputs/common/config-process/no-op-config-process.js.map +1 -1
  209. package/tsOutputs/common/constants/constants.js.map +1 -1
  210. package/tsOutputs/common/constants/sl-env-vars.js +93 -31
  211. package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
  212. package/tsOutputs/common/contracts.d.ts +1 -1
  213. package/tsOutputs/common/contracts.js.map +1 -1
  214. package/tsOutputs/common/coverage-elements/contracts.js.map +1 -1
  215. package/tsOutputs/common/coverage-elements/file-element.js +24 -12
  216. package/tsOutputs/common/coverage-elements/file-element.js.map +1 -1
  217. package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js +19 -17
  218. package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js.map +1 -1
  219. package/tsOutputs/common/coverage-elements/new-id-resolver.js.map +1 -1
  220. package/tsOutputs/common/coverage-elements/original-module-loader.js +24 -13
  221. package/tsOutputs/common/coverage-elements/original-module-loader.js.map +1 -1
  222. package/tsOutputs/common/coverage-elements/unique-id-converter.js +19 -15
  223. package/tsOutputs/common/coverage-elements/unique-id-converter.js.map +1 -1
  224. package/tsOutputs/common/environment-data-service.js.map +1 -1
  225. package/tsOutputs/common/events-process/events-contracts.js.map +1 -1
  226. package/tsOutputs/common/events-process/events-creator.js +1 -1
  227. package/tsOutputs/common/events-process/events-creator.js.map +1 -1
  228. package/tsOutputs/common/events-process/index.js +10 -4
  229. package/tsOutputs/common/events-process/index.js.map +1 -1
  230. package/tsOutputs/common/footprints-process/collection-interval.js +1 -1
  231. package/tsOutputs/common/footprints-process/collection-interval.js.map +1 -1
  232. package/tsOutputs/common/footprints-process/footprints-service-proxy.js +4 -1
  233. package/tsOutputs/common/footprints-process/footprints-service-proxy.js.map +1 -1
  234. package/tsOutputs/common/footprints-process/index.js +35 -20
  235. package/tsOutputs/common/footprints-process/index.js.map +1 -1
  236. package/tsOutputs/common/footprints-process/istanbul-to-footprints.js +26 -20
  237. package/tsOutputs/common/footprints-process/istanbul-to-footprints.js.map +1 -1
  238. package/tsOutputs/common/footprints-process/production-footprints-handler.js +30 -17
  239. package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +1 -1
  240. package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js +5 -1
  241. package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js.map +1 -1
  242. package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js +12 -10
  243. package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js.map +1 -1
  244. package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js +1 -1
  245. package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js.map +1 -1
  246. package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js +1 -1
  247. package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js.map +1 -1
  248. package/tsOutputs/common/footprints-process-v6/collector-remote-footprints-process.js +1 -2
  249. package/tsOutputs/common/footprints-process-v6/collector-remote-footprints-process.js.map +1 -1
  250. package/tsOutputs/common/footprints-process-v6/footprints-buffer.js +12 -7
  251. package/tsOutputs/common/footprints-process-v6/footprints-buffer.js.map +1 -1
  252. package/tsOutputs/common/footprints-process-v6/footprints-data-utils.d.ts +1 -1
  253. package/tsOutputs/common/footprints-process-v6/footprints-data-utils.spec.js +38 -38
  254. package/tsOutputs/common/footprints-process-v6/hits-collector.d.ts +1 -0
  255. package/tsOutputs/common/footprints-process-v6/hits-collector.js +42 -19
  256. package/tsOutputs/common/footprints-process-v6/hits-collector.js.map +1 -1
  257. package/tsOutputs/common/footprints-process-v6/hits-converter.js +47 -22
  258. package/tsOutputs/common/footprints-process-v6/hits-converter.js.map +1 -1
  259. package/tsOutputs/common/footprints-process-v6/index.js +12 -7
  260. package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
  261. package/tsOutputs/common/footprints-process-v6/location-formatter.js +4 -2
  262. package/tsOutputs/common/footprints-process-v6/location-formatter.js.map +1 -1
  263. package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js.map +1 -1
  264. package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js.map +1 -1
  265. package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js +1 -2
  266. package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js.map +1 -1
  267. package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js.map +1 -1
  268. package/tsOutputs/common/footprints-process-v6/source-map-data.js +1 -1
  269. package/tsOutputs/common/footprints-process-v6/source-map-data.js.map +1 -1
  270. package/tsOutputs/common/http/backend-proxy-with-default-client.js.map +1 -1
  271. package/tsOutputs/common/http/backend-proxy.js +26 -10
  272. package/tsOutputs/common/http/backend-proxy.js.map +1 -1
  273. package/tsOutputs/common/http/contracts.js.map +1 -1
  274. package/tsOutputs/common/http/dry-run-proxy.js +8 -16
  275. package/tsOutputs/common/http/dry-run-proxy.js.map +1 -1
  276. package/tsOutputs/common/http/entities-mapper.js.map +1 -1
  277. package/tsOutputs/common/http/http-client.js +25 -12
  278. package/tsOutputs/common/http/http-client.js.map +1 -1
  279. package/tsOutputs/common/http/http-verb.js.map +1 -1
  280. package/tsOutputs/common/http/sl-routes.js +111 -33
  281. package/tsOutputs/common/http/sl-routes.js.map +1 -1
  282. package/tsOutputs/common/ignored-files-handler.js +13 -5
  283. package/tsOutputs/common/ignored-files-handler.js.map +1 -1
  284. package/tsOutputs/common/index.d.ts +1 -1
  285. package/tsOutputs/common/logger.js +21 -14
  286. package/tsOutputs/common/logger.js.map +1 -1
  287. package/tsOutputs/common/messages-formatter.js.map +1 -1
  288. package/tsOutputs/common/metrics-process/index.js.map +1 -1
  289. package/tsOutputs/common/metrics-process/metrics-store-factory.js.map +1 -1
  290. package/tsOutputs/common/metrics-process/metrics-store.js +3 -3
  291. package/tsOutputs/common/metrics-process/metrics-store.js.map +1 -1
  292. package/tsOutputs/common/no-op-state-tracker.js.map +1 -1
  293. package/tsOutputs/common/queue.js.map +1 -1
  294. package/tsOutputs/common/scm/git-cloner.js +1 -1
  295. package/tsOutputs/common/scm/git-cloner.js.map +1 -1
  296. package/tsOutputs/common/scm/git-format-builder.js +2 -2
  297. package/tsOutputs/common/scm/git-format-builder.js.map +1 -1
  298. package/tsOutputs/common/scm/git-log-parser.js +2 -2
  299. package/tsOutputs/common/scm/git-log-parser.js.map +1 -1
  300. package/tsOutputs/common/scm/git.js +43 -15
  301. package/tsOutputs/common/scm/git.js.map +1 -1
  302. package/tsOutputs/common/scm/none.js +3 -4
  303. package/tsOutputs/common/scm/none.js.map +1 -1
  304. package/tsOutputs/common/scm/scm-factory.js.map +1 -1
  305. package/tsOutputs/common/short-name-to-file-mapper.js.map +1 -1
  306. package/tsOutputs/common/sl-mapper-tokenizer.js +12 -8
  307. package/tsOutputs/common/sl-mapper-tokenizer.js.map +1 -1
  308. package/tsOutputs/common/source-map-config-dto.js +1 -1
  309. package/tsOutputs/common/source-map-config-dto.js.map +1 -1
  310. package/tsOutputs/common/source-map-handler.js +7 -4
  311. package/tsOutputs/common/source-map-handler.js.map +1 -1
  312. package/tsOutputs/common/source-map-reader.js +14 -14
  313. package/tsOutputs/common/source-map-reader.js.map +1 -1
  314. package/tsOutputs/common/source-maps-utils.js +2 -1
  315. package/tsOutputs/common/source-maps-utils.js.map +1 -1
  316. package/tsOutputs/common/state-tracker-fpv6.js +5 -4
  317. package/tsOutputs/common/state-tracker-fpv6.js.map +1 -1
  318. package/tsOutputs/common/state-tracker.js +18 -7
  319. package/tsOutputs/common/state-tracker.js.map +1 -1
  320. package/tsOutputs/common/system-date.js.map +1 -1
  321. package/tsOutputs/common/utils/abstract-data-builder.js.map +1 -1
  322. package/tsOutputs/common/utils/build-session-data-builder.js +5 -5
  323. package/tsOutputs/common/utils/build-session-data-builder.js.map +1 -1
  324. package/tsOutputs/common/utils/cookie.js +7 -4
  325. package/tsOutputs/common/utils/cookie.js.map +1 -1
  326. package/tsOutputs/common/utils/data-cleansing-utils.js +4 -3
  327. package/tsOutputs/common/utils/data-cleansing-utils.js.map +1 -1
  328. package/tsOutputs/common/utils/dependency-utils.js +1 -1
  329. package/tsOutputs/common/utils/dependency-utils.js.map +1 -1
  330. package/tsOutputs/common/utils/env-var-parsing.js.map +1 -1
  331. package/tsOutputs/common/utils/files-utils.js.map +1 -1
  332. package/tsOutputs/common/utils/process-utils.js +3 -2
  333. package/tsOutputs/common/utils/process-utils.js.map +1 -1
  334. package/tsOutputs/common/utils/tail-file-reader.js +5 -2
  335. package/tsOutputs/common/utils/tail-file-reader.js.map +1 -1
  336. package/tsOutputs/common/utils/test-runner-build-session-data-builder.js.map +1 -1
  337. package/tsOutputs/common/utils/test-utils/mock-server-utils/contracts.js.map +1 -1
  338. package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js +3 -3
  339. package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js.map +1 -1
  340. package/tsOutputs/common/utils/timer-utils.js +3 -1
  341. package/tsOutputs/common/utils/timer-utils.js.map +1 -1
  342. package/tsOutputs/common/utils/token-data-builder.js +4 -4
  343. package/tsOutputs/common/utils/token-data-builder.js.map +1 -1
  344. package/tsOutputs/common/utils/token-utils.js +2 -2
  345. package/tsOutputs/common/utils/validation-utils.js +1 -1
  346. package/tsOutputs/common/utils/validation-utils.js.map +1 -1
  347. package/tsOutputs/common/v8-utils.js +2 -1
  348. package/tsOutputs/common/v8-utils.js.map +1 -1
  349. package/tsOutputs/common/watchdog.js.map +1 -1
  350. package/tsOutputs/mocha-reporter/constants.js +7 -7
  351. package/tsOutputs/mocha-reporter/constants.js.map +1 -1
  352. package/tsOutputs/mocha-reporter/end-execution.js +3 -3
  353. package/tsOutputs/mocha-reporter/end-execution.js.map +1 -1
  354. package/tsOutputs/mocha-reporter/index.js +39 -22
  355. package/tsOutputs/mocha-reporter/index.js.map +1 -1
  356. package/tsOutputs/mocha-reporter/otel-agent.js.map +1 -1
  357. package/tsOutputs/test-listener/SlNodeJsProxy.js +14 -9
  358. package/tsOutputs/test-listener/SlNodeJsProxy.js.map +1 -1
  359. package/tsOutputs/test-listener/UserMessageHelper.js.map +1 -1
  360. package/tsOutputs/test-listener/agent-loader.js +15 -8
  361. package/tsOutputs/test-listener/agent-loader.js.map +1 -1
  362. package/tsOutputs/test-listener/agent.js +15 -10
  363. package/tsOutputs/test-listener/agent.js.map +1 -1
  364. package/tsOutputs/test-listener/api.js +1 -2
  365. package/tsOutputs/test-listener/api.js.map +1 -1
  366. package/tsOutputs/test-listener/base-proxy.js +14 -10
  367. package/tsOutputs/test-listener/base-proxy.js.map +1 -1
  368. package/tsOutputs/test-listener/bootstrap.js.map +1 -1
  369. package/tsOutputs/test-listener/child-process-patcher.js +6 -6
  370. package/tsOutputs/test-listener/child-process-patcher.js.map +1 -1
  371. package/tsOutputs/test-listener/coloring/http-coloring.js +38 -27
  372. package/tsOutputs/test-listener/coloring/http-coloring.js.map +1 -1
  373. package/tsOutputs/test-listener/coloring/listening-port.js +4 -3
  374. package/tsOutputs/test-listener/coloring/listening-port.js.map +1 -1
  375. package/tsOutputs/test-listener/config-process/config-loader.js +5 -3
  376. package/tsOutputs/test-listener/config-process/config-loader.js.map +1 -1
  377. package/tsOutputs/test-listener/entities/BasicConfigurationData.js.map +1 -1
  378. package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js.map +1 -1
  379. package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js.map +1 -1
  380. package/tsOutputs/test-listener/execution-process/entities-mapper.js +7 -5
  381. package/tsOutputs/test-listener/execution-process/entities-mapper.js.map +1 -1
  382. package/tsOutputs/test-listener/execution-process/execution-service-proxy.js +30 -17
  383. package/tsOutputs/test-listener/execution-process/execution-service-proxy.js.map +1 -1
  384. package/tsOutputs/test-listener/execution-process/index.js +2 -2
  385. package/tsOutputs/test-listener/execution-process/index.js.map +1 -1
  386. package/tsOutputs/test-listener/factory.js +180 -50
  387. package/tsOutputs/test-listener/factory.js.map +1 -1
  388. package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js +18 -15
  389. package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js.map +1 -1
  390. package/tsOutputs/test-listener/integrations/SlGulp.js +7 -6
  391. package/tsOutputs/test-listener/integrations/SlGulp.js.map +1 -1
  392. package/tsOutputs/test-listener/logs-process/index.js +5 -3
  393. package/tsOutputs/test-listener/logs-process/index.js.map +1 -1
  394. package/tsOutputs/test-listener/logs-process/log-service-proxy.js.map +1 -1
  395. package/tsOutputs/test-listener/nyc-report-executor-fpv6.js +1 -1
  396. package/tsOutputs/test-listener/nyc-report-executor-fpv6.js.map +1 -1
  397. package/tsOutputs/test-listener/nyc-report-executor.js +3 -3
  398. package/tsOutputs/test-listener/nyc-report-executor.js.map +1 -1
  399. package/tsOutputs/test-listener/otel-agent-loader.js +13 -10
  400. package/tsOutputs/test-listener/otel-agent-loader.js.map +1 -1
  401. package/tsOutputs/test-listener/remote-agent.js +37 -9
  402. package/tsOutputs/test-listener/remote-agent.js.map +1 -1
  403. package/tsOutputs/test-listener/resolvers/AppNameResolver.js.map +1 -1
  404. package/tsOutputs/test-listener/resolvers/ArgumentResolver.js +23 -6
  405. package/tsOutputs/test-listener/resolvers/ArgumentResolver.js.map +1 -1
  406. package/tsOutputs/test-listener/resolvers/BuildResolver.js.map +1 -1
  407. package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js.map +1 -1
  408. package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js.map +1 -1
  409. package/tsOutputs/test-listener/resolvers/ProxyResolver.js.map +1 -1
  410. package/tsOutputs/test-listener/resolvers/TokenResolver.js.map +1 -1
  411. package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js +12 -4
  412. package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js.map +1 -1
  413. package/tsOutputs/test-listener/test-recommendation-handler.js +20 -11
  414. package/tsOutputs/test-listener/test-recommendation-handler.js.map +1 -1
  415. package/tsOutputs/test-listener/upload-report-handler.js +14 -5
  416. package/tsOutputs/test-listener/upload-report-handler.js.map +1 -1
  417. package/tsOutputs/test-listener/uuid.js +2 -2
  418. package/tsOutputs/test-listener/uuid.js.map +1 -1
  419. 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 | Description | Default |
54
- |---------------------------|-------------------------------------------------|--------------------------|
55
- | `SL_TOKEN` | Direct Sealights agent authentication token | |
56
- | `SL_TOKEN_FILE` | Path to file containing the Sealights token | `./sltoken.txt` |
57
- | `SL_BUILD_SESSION_ID` | Direct build session ID | |
58
- | `SL_BUILD_SESSION_ID_FILE`| Path to file containing build session ID | `./buildSessionId` |
59
- | `SL_PROJECT_ROOT` | Root directory of your project | Current working directory|
60
- | `SL_COLLECTOR_URL` | URL to Sealights collector | |
61
- | `SL_LAB_ID` | Lab ID for test execution | |
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("../tsOutputs/cli-parse/cli.js");
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(/^\"(.*)\"$/, "$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();
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.1087",
3
+ "version": "6.1.1090",
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
- 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
- */
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 = (opts && opts.es6Modules) ? 'module' : 'script';
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,0CAAkD;AAElD,8EAAwE;AACxE,6CAA+C;AAG/C,MAAM,MAAM,GAAG,sBAAa,CAAC,0BAA0B,EAAE,CAAC;AAE1D,SAAS,mBAAmB,CAAC,cAA8B,EAAE,QAAgB;IACzE,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;IAC7C,IAAI,cAAc,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE;QAC/C,MAAM,CAAC,IAAI,CAAC,UAAU,gBAAgB,8BAA8B,QAAQ,GAAG,CAAC,CAAA;QAChF,OAAO;KACV;IACD,OAAO,CAAC,YAAY,EAAE,EAAC,sBAAsB,EAAE,IAAI,EAAC,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,gBAAgB,CAAC,cAA8B,EAAE,QAAgB;IACtE,cAAc,GAAG,cAAc,IAAI,EAAE,CAAC;IACtC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAEvE,IAAI,gBAAgB,EAAE;QAClB,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;KACxC;IACD,OAAO,cAAc,CAAC;AAC1B,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAAe,EAAE,IAAS,EAAE,QAAgB,EAAE,UAA+B;;IAC3G,MAAM,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnE,MAAM,OAAO,GAAmB,gBAAgB,CAAC,IAAI,IAAI,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACxF,UAAU,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzC,MAAM,IAAI,GAAG,IAAA,cAAK,EAAC,OAAO,EAAE;QACxB,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE,OAAO;QAChB,aAAa,EAAE,IAAI;KACtB,CAA8B,CAAC;IAEhC,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAE,MAAM,EAAE;QACtB,kCAAe,CAAC,WAAW,CAAC,SAAS,QAAQ,gDAAgD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;KAClI;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAdD,8CAcC"}
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"}