@featurevisor/core 2.26.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/coverage/clover.xml +4991 -3130
  3. package/coverage/coverage-final.json +63 -39
  4. package/coverage/lcov-report/block-navigation.js +1 -1
  5. package/coverage/lcov-report/index.html +248 -98
  6. package/coverage/lcov-report/sorter.js +21 -7
  7. package/coverage/lcov-report/src/assess-distribution/index.html +116 -0
  8. package/coverage/lcov-report/src/assess-distribution/index.ts.html +754 -0
  9. package/coverage/lcov-report/{list → src/benchmark}/index.html +30 -30
  10. package/coverage/lcov-report/src/benchmark/index.ts.html +793 -0
  11. package/coverage/lcov-report/{builder → src/builder}/allocator.ts.html +38 -38
  12. package/coverage/lcov-report/{builder/buildScopedConditions.ts.html → src/builder/applyContextToConditions.ts.html} +80 -65
  13. package/coverage/lcov-report/{builder/buildScopedDatafile.ts.html → src/builder/applyContextToDatafile.ts.html} +92 -92
  14. package/coverage/lcov-report/{builder/buildScopedSegments.ts.html → src/builder/applyContextToSegments.ts.html} +103 -67
  15. package/coverage/lcov-report/{builder → src/builder}/buildDatafile.ts.html +336 -306
  16. package/coverage/lcov-report/src/builder/buildProject.ts.html +1117 -0
  17. package/coverage/lcov-report/src/builder/buildRuntimeDatafiles.ts.html +256 -0
  18. package/coverage/lcov-report/{builder → src/builder}/getFeatureRanges.ts.html +22 -22
  19. package/coverage/lcov-report/{builder → src/builder}/hashes.ts.html +50 -50
  20. package/coverage/lcov-report/{builder → src/builder}/index.html +114 -84
  21. package/coverage/lcov-report/{tester/cliFormat.ts.html → src/builder/index.ts.html} +17 -29
  22. package/coverage/lcov-report/{builder → src/builder}/mutateVariables.ts.html +55 -55
  23. package/coverage/lcov-report/{builder → src/builder}/mutator.ts.html +118 -118
  24. package/coverage/lcov-report/{builder → src/builder}/revision.ts.html +15 -15
  25. package/coverage/lcov-report/{builder → src/builder}/traffic.ts.html +86 -86
  26. package/coverage/lcov-report/src/cli/cli.ts.html +400 -0
  27. package/coverage/lcov-report/{tester → src/cli}/index.html +41 -41
  28. package/coverage/lcov-report/src/cli/plugins.ts.html +214 -0
  29. package/coverage/lcov-report/{config → src/config}/index.html +31 -31
  30. package/coverage/lcov-report/{config → src/config}/index.ts.html +12 -12
  31. package/coverage/lcov-report/{config → src/config}/projectConfig.ts.html +312 -96
  32. package/coverage/lcov-report/{datasource → src/datasource}/adapter.ts.html +28 -73
  33. package/coverage/lcov-report/{datasource → src/datasource}/datasource.ts.html +191 -104
  34. package/coverage/lcov-report/{datasource → src/datasource}/filesystemAdapter.ts.html +233 -635
  35. package/coverage/lcov-report/{datasource → src/datasource}/index.html +48 -48
  36. package/coverage/lcov-report/{datasource → src/datasource}/index.ts.html +14 -14
  37. package/coverage/lcov-report/src/evaluate/index.html +116 -0
  38. package/coverage/lcov-report/src/evaluate/index.ts.html +814 -0
  39. package/coverage/lcov-report/src/find-duplicate-segments/findDuplicateSegments.ts.html +313 -0
  40. package/coverage/lcov-report/src/find-duplicate-segments/index.html +131 -0
  41. package/coverage/lcov-report/src/find-duplicate-segments/index.ts.html +307 -0
  42. package/coverage/lcov-report/src/find-usage/index.html +116 -0
  43. package/coverage/lcov-report/src/find-usage/index.ts.html +1780 -0
  44. package/coverage/lcov-report/src/generate-code/index.html +131 -0
  45. package/coverage/lcov-report/src/generate-code/index.ts.html +403 -0
  46. package/coverage/lcov-report/{generate-code → src/generate-code}/typescript.ts.html +266 -1361
  47. package/coverage/lcov-report/{generate-code → src}/index.html +38 -23
  48. package/coverage/lcov-report/src/info/index.html +116 -0
  49. package/coverage/lcov-report/src/info/index.ts.html +472 -0
  50. package/coverage/lcov-report/src/init/index.html +116 -0
  51. package/coverage/lcov-report/src/init/index.ts.html +280 -0
  52. package/coverage/lcov-report/{linter → src/linter}/attributeSchema.ts.html +160 -157
  53. package/coverage/lcov-report/{linter → src/linter}/checkCircularDependency.ts.html +25 -25
  54. package/coverage/lcov-report/{linter → src/linter}/checkPercentageExceedingSlot.ts.html +42 -42
  55. package/coverage/lcov-report/{linter → src/linter}/conditionSchema.ts.html +207 -207
  56. package/coverage/lcov-report/{linter → src/linter}/featureSchema.ts.html +462 -471
  57. package/coverage/lcov-report/{linter → src/linter}/groupSchema.ts.html +25 -22
  58. package/coverage/lcov-report/{linter → src/linter}/index.html +129 -99
  59. package/coverage/lcov-report/src/linter/index.ts.html +88 -0
  60. package/coverage/lcov-report/{linter → src/linter}/lintProject.ts.html +740 -332
  61. package/coverage/lcov-report/{linter → src/linter}/mutationNotation.ts.html +130 -130
  62. package/coverage/lcov-report/{linter → src/linter}/printError.ts.html +27 -27
  63. package/coverage/lcov-report/{linter → src/linter}/schema.ts.html +153 -150
  64. package/coverage/lcov-report/{linter → src/linter}/segmentSchema.ts.html +18 -15
  65. package/coverage/lcov-report/src/linter/targetSchema.ts.html +223 -0
  66. package/coverage/lcov-report/{linter → src/linter}/testSchema.ts.html +54 -48
  67. package/coverage/lcov-report/{linter → src/linter}/zodHelpers.ts.html +17 -17
  68. package/coverage/lcov-report/src/list/index.html +131 -0
  69. package/coverage/lcov-report/src/list/index.ts.html +2065 -0
  70. package/coverage/lcov-report/{list → src/list}/matrix.ts.html +43 -58
  71. package/coverage/lcov-report/src/promoter/index.html +116 -0
  72. package/coverage/lcov-report/src/promoter/index.ts.html +3883 -0
  73. package/coverage/lcov-report/src/sets.ts.html +313 -0
  74. package/coverage/lcov-report/src/targeting.ts.html +403 -0
  75. package/coverage/lcov-report/src/tester/cliFormat.ts.html +133 -0
  76. package/coverage/lcov-report/{tester → src/tester}/helpers.ts.html +15 -15
  77. package/coverage/lcov-report/src/tester/index.html +206 -0
  78. package/coverage/lcov-report/src/tester/prettyDuration.ts.html +187 -0
  79. package/coverage/lcov-report/src/tester/printTestResult.ts.html +337 -0
  80. package/coverage/lcov-report/src/tester/testFeature.ts.html +1186 -0
  81. package/coverage/lcov-report/src/tester/testProject.ts.html +1018 -0
  82. package/coverage/lcov-report/src/tester/testSegment.ts.html +316 -0
  83. package/coverage/lcov-report/{utils → src/utils}/extractKeys.ts.html +68 -68
  84. package/coverage/lcov-report/{utils → src/utils}/git.ts.html +44 -68
  85. package/coverage/lcov-report/{utils → src/utils}/index.html +44 -44
  86. package/coverage/lcov-report/{utils → src/utils}/index.ts.html +14 -14
  87. package/coverage/lcov-report/{utils → src/utils}/pretty.ts.html +20 -20
  88. package/coverage/lcov.info +10121 -5723
  89. package/jest.config.js +13 -4
  90. package/lib/assess-distribution/index.d.ts +1 -1
  91. package/lib/assess-distribution/index.js +59 -40
  92. package/lib/assess-distribution/index.js.map +1 -1
  93. package/lib/benchmark/index.d.ts +8 -5
  94. package/lib/benchmark/index.js +82 -65
  95. package/lib/benchmark/index.js.map +1 -1
  96. package/lib/builder/applyContextToConditions.d.ts +5 -0
  97. package/lib/builder/{buildScopedConditions.js → applyContextToConditions.js} +19 -14
  98. package/lib/builder/applyContextToConditions.js.map +1 -0
  99. package/lib/builder/applyContextToDatafile.d.ts +2 -0
  100. package/lib/builder/{buildScopedDatafile.js → applyContextToDatafile.js} +26 -26
  101. package/lib/builder/applyContextToDatafile.js.map +1 -0
  102. package/lib/builder/applyContextToSegments.d.ts +5 -0
  103. package/lib/builder/{buildScopedSegments.js → applyContextToSegments.js} +19 -14
  104. package/lib/builder/applyContextToSegments.js.map +1 -0
  105. package/lib/builder/buildDatafile.d.ts +9 -6
  106. package/lib/builder/buildDatafile.js +86 -51
  107. package/lib/builder/buildDatafile.js.map +1 -1
  108. package/lib/builder/buildProject.d.ts +17 -3
  109. package/lib/builder/buildProject.js +151 -59
  110. package/lib/builder/buildProject.js.map +1 -1
  111. package/lib/builder/buildRuntimeDatafiles.d.ts +12 -0
  112. package/lib/builder/buildRuntimeDatafiles.js +35 -0
  113. package/lib/builder/buildRuntimeDatafiles.js.map +1 -0
  114. package/lib/builder/getFeatureRanges.js +34 -1
  115. package/lib/builder/getFeatureRanges.js.map +1 -1
  116. package/lib/builder/hashes.js +34 -1
  117. package/lib/builder/hashes.js.map +1 -1
  118. package/lib/builder/index.d.ts +0 -1
  119. package/lib/builder/index.js +0 -1
  120. package/lib/builder/index.js.map +1 -1
  121. package/lib/cli/cli.js +0 -4
  122. package/lib/cli/cli.js.map +1 -1
  123. package/lib/cli/plugins.js +7 -2
  124. package/lib/cli/plugins.js.map +1 -1
  125. package/lib/config/projectConfig.d.ts +17 -17
  126. package/lib/config/projectConfig.js +101 -15
  127. package/lib/config/projectConfig.js.map +1 -1
  128. package/lib/datasource/adapter.d.ts +7 -9
  129. package/lib/datasource/adapter.js +0 -7
  130. package/lib/datasource/adapter.js.map +1 -1
  131. package/lib/datasource/datasource.d.ts +15 -5
  132. package/lib/datasource/datasource.js +37 -9
  133. package/lib/datasource/datasource.js.map +1 -1
  134. package/lib/datasource/filesystemAdapter.d.ts +4 -10
  135. package/lib/datasource/filesystemAdapter.js +111 -149
  136. package/lib/datasource/filesystemAdapter.js.map +1 -1
  137. package/lib/evaluate/index.d.ts +1 -7
  138. package/lib/evaluate/index.js +81 -67
  139. package/lib/evaluate/index.js.map +1 -1
  140. package/lib/find-duplicate-segments/findDuplicateSegments.js +34 -1
  141. package/lib/find-duplicate-segments/findDuplicateSegments.js.map +1 -1
  142. package/lib/find-duplicate-segments/index.js +21 -13
  143. package/lib/find-duplicate-segments/index.js.map +1 -1
  144. package/lib/find-usage/index.js +57 -41
  145. package/lib/find-usage/index.js.map +1 -1
  146. package/lib/generate-code/index.d.ts +1 -1
  147. package/lib/generate-code/index.js +64 -21
  148. package/lib/generate-code/index.js.map +1 -1
  149. package/lib/generate-code/typescript.d.ts +1 -1
  150. package/lib/generate-code/typescript.js +59 -333
  151. package/lib/generate-code/typescript.js.map +1 -1
  152. package/lib/index.d.ts +2 -1
  153. package/lib/index.js +2 -1
  154. package/lib/index.js.map +1 -1
  155. package/lib/info/index.js +57 -16
  156. package/lib/info/index.js.map +1 -1
  157. package/lib/init/index.d.ts +2 -2
  158. package/lib/init/index.js +39 -3
  159. package/lib/init/index.js.map +1 -1
  160. package/lib/linter/attributeSchema.d.ts +1 -0
  161. package/lib/linter/attributeSchema.js +1 -0
  162. package/lib/linter/attributeSchema.js.map +1 -1
  163. package/lib/linter/conditionSchema.js +5 -5
  164. package/lib/linter/conditionSchema.js.map +1 -1
  165. package/lib/linter/featureSchema.d.ts +4 -1
  166. package/lib/linter/featureSchema.js +15 -13
  167. package/lib/linter/featureSchema.js.map +1 -1
  168. package/lib/linter/groupSchema.d.ts +1 -0
  169. package/lib/linter/groupSchema.js +1 -0
  170. package/lib/linter/groupSchema.js.map +1 -1
  171. package/lib/linter/lintProject.d.ts +1 -3
  172. package/lib/linter/lintProject.js +198 -68
  173. package/lib/linter/lintProject.js.map +1 -1
  174. package/lib/linter/schema.js +1 -0
  175. package/lib/linter/schema.js.map +1 -1
  176. package/lib/linter/segmentSchema.d.ts +1 -0
  177. package/lib/linter/segmentSchema.js +1 -0
  178. package/lib/linter/segmentSchema.js.map +1 -1
  179. package/lib/linter/targetSchema.d.ts +16 -0
  180. package/lib/linter/targetSchema.js +40 -0
  181. package/lib/linter/targetSchema.js.map +1 -0
  182. package/lib/linter/testSchema.d.ts +4 -3
  183. package/lib/linter/testSchema.js +9 -4
  184. package/lib/linter/testSchema.js.map +1 -1
  185. package/lib/list/index.d.ts +1 -0
  186. package/lib/list/index.js +131 -12
  187. package/lib/list/index.js.map +1 -1
  188. package/lib/list/matrix.js +3 -7
  189. package/lib/list/matrix.js.map +1 -1
  190. package/lib/promoter/index.d.ts +50 -0
  191. package/lib/promoter/index.js +880 -0
  192. package/lib/promoter/index.js.map +1 -0
  193. package/lib/sets.d.ts +11 -0
  194. package/lib/sets.js +81 -0
  195. package/lib/sets.js.map +1 -0
  196. package/lib/targeting.d.ts +14 -0
  197. package/lib/targeting.js +82 -0
  198. package/lib/targeting.js.map +1 -0
  199. package/lib/tester/cliFormat.d.ts +7 -1
  200. package/lib/tester/cliFormat.js +11 -2
  201. package/lib/tester/cliFormat.js.map +1 -1
  202. package/lib/tester/printTestResult.js +2 -2
  203. package/lib/tester/printTestResult.js.map +1 -1
  204. package/lib/tester/testFeature.d.ts +0 -1
  205. package/lib/tester/testFeature.js +8 -25
  206. package/lib/tester/testFeature.js.map +1 -1
  207. package/lib/tester/testProject.d.ts +2 -3
  208. package/lib/tester/testProject.js +93 -86
  209. package/lib/tester/testProject.js.map +1 -1
  210. package/lib/tester/testSegment.d.ts +1 -1
  211. package/lib/tester/testSegment.js +3 -21
  212. package/lib/tester/testSegment.js.map +1 -1
  213. package/lib/utils/git.js +45 -19
  214. package/lib/utils/git.js.map +1 -1
  215. package/package.json +12 -12
  216. package/src/assess-distribution/index.ts +72 -52
  217. package/src/benchmark/index.ts +124 -91
  218. package/src/builder/{buildScopedConditions.spec.ts → applyContextToConditions.spec.ts} +160 -142
  219. package/src/builder/{buildScopedConditions.ts → applyContextToConditions.ts} +19 -14
  220. package/src/builder/{buildScopedDatafile.spec.ts → applyContextToDatafile.spec.ts} +141 -81
  221. package/src/builder/{buildScopedDatafile.ts → applyContextToDatafile.ts} +33 -33
  222. package/src/builder/{buildScopedSegments.spec.ts → applyContextToSegments.spec.ts} +171 -151
  223. package/src/builder/{buildScopedSegments.ts → applyContextToSegments.ts} +26 -14
  224. package/src/builder/buildDatafile.spec.ts +192 -14
  225. package/src/builder/buildDatafile.ts +74 -64
  226. package/src/builder/buildProject.ts +171 -86
  227. package/src/builder/buildRuntimeDatafiles.ts +57 -0
  228. package/src/builder/index.ts +0 -1
  229. package/src/cli/cli.ts +0 -5
  230. package/src/cli/plugins.ts +7 -2
  231. package/src/config/projectConfig.spec.ts +171 -8
  232. package/src/config/projectConfig.ts +100 -28
  233. package/src/datasource/adapter.ts +8 -23
  234. package/src/datasource/datasource.ts +50 -21
  235. package/src/datasource/filesystemAdapter.spec.ts +133 -74
  236. package/src/datasource/filesystemAdapter.ts +93 -227
  237. package/src/evaluate/index.ts +109 -97
  238. package/src/find-duplicate-segments/index.ts +34 -16
  239. package/src/find-usage/index.ts +89 -44
  240. package/src/generate-code/index.ts +36 -24
  241. package/src/generate-code/typescript.spec.ts +106 -0
  242. package/src/generate-code/typescript.ts +33 -398
  243. package/src/index.ts +2 -1
  244. package/src/info/index.ts +72 -16
  245. package/src/init/index.ts +1 -1
  246. package/src/linter/attributeSchema.ts +1 -0
  247. package/src/linter/conditionSchema.spec.ts +23 -3
  248. package/src/linter/conditionSchema.ts +5 -5
  249. package/src/linter/featureSchema.spec.ts +107 -18
  250. package/src/linter/featureSchema.ts +25 -28
  251. package/src/linter/groupSchema.ts +1 -0
  252. package/src/linter/lintProject.spec.ts +131 -92
  253. package/src/linter/lintProject.ts +233 -97
  254. package/src/linter/schema.ts +1 -0
  255. package/src/linter/segmentSchema.spec.ts +5 -3
  256. package/src/linter/segmentSchema.ts +1 -0
  257. package/src/linter/targetSchema.spec.ts +159 -0
  258. package/src/linter/targetSchema.ts +46 -0
  259. package/src/linter/testSchema.spec.ts +70 -5
  260. package/src/linter/testSchema.ts +12 -10
  261. package/src/list/index.spec.ts +135 -0
  262. package/src/list/index.ts +188 -12
  263. package/src/list/matrix.ts +3 -8
  264. package/src/promoter/index.spec.ts +617 -0
  265. package/src/promoter/index.ts +1266 -0
  266. package/src/sets.ts +76 -0
  267. package/src/targeting.spec.ts +74 -0
  268. package/src/targeting.ts +106 -0
  269. package/src/tester/cliFormat.ts +11 -1
  270. package/src/tester/printTestResult.ts +12 -3
  271. package/src/tester/testFeature.ts +10 -36
  272. package/src/tester/testProject.spec.ts +50 -0
  273. package/src/tester/testProject.ts +89 -140
  274. package/src/tester/testSegment.ts +5 -22
  275. package/src/utils/git.ts +13 -21
  276. package/tsconfig.cjs.json +5 -1
  277. package/tsconfig.typecheck.json +9 -0
  278. package/coverage/lcov-report/builder/convertToV1.ts.html +0 -583
  279. package/lib/builder/allocator.spec.d.ts +0 -1
  280. package/lib/builder/allocator.spec.js +0 -85
  281. package/lib/builder/allocator.spec.js.map +0 -1
  282. package/lib/builder/buildDatafile.spec.d.ts +0 -1
  283. package/lib/builder/buildDatafile.spec.js +0 -233
  284. package/lib/builder/buildDatafile.spec.js.map +0 -1
  285. package/lib/builder/buildScopedConditions.d.ts +0 -5
  286. package/lib/builder/buildScopedConditions.js.map +0 -1
  287. package/lib/builder/buildScopedConditions.spec.d.ts +0 -1
  288. package/lib/builder/buildScopedConditions.spec.js +0 -2167
  289. package/lib/builder/buildScopedConditions.spec.js.map +0 -1
  290. package/lib/builder/buildScopedDatafile.d.ts +0 -2
  291. package/lib/builder/buildScopedDatafile.js.map +0 -1
  292. package/lib/builder/buildScopedDatafile.spec.d.ts +0 -1
  293. package/lib/builder/buildScopedDatafile.spec.js +0 -2277
  294. package/lib/builder/buildScopedDatafile.spec.js.map +0 -1
  295. package/lib/builder/buildScopedSegments.d.ts +0 -5
  296. package/lib/builder/buildScopedSegments.js.map +0 -1
  297. package/lib/builder/buildScopedSegments.spec.d.ts +0 -1
  298. package/lib/builder/buildScopedSegments.spec.js +0 -1062
  299. package/lib/builder/buildScopedSegments.spec.js.map +0 -1
  300. package/lib/builder/convertToV1.d.ts +0 -10
  301. package/lib/builder/convertToV1.js +0 -119
  302. package/lib/builder/convertToV1.js.map +0 -1
  303. package/lib/builder/mutateVariables.spec.d.ts +0 -1
  304. package/lib/builder/mutateVariables.spec.js +0 -1074
  305. package/lib/builder/mutateVariables.spec.js.map +0 -1
  306. package/lib/builder/mutator.spec.d.ts +0 -1
  307. package/lib/builder/mutator.spec.js +0 -368
  308. package/lib/builder/mutator.spec.js.map +0 -1
  309. package/lib/builder/revision.spec.d.ts +0 -1
  310. package/lib/builder/revision.spec.js +0 -21
  311. package/lib/builder/revision.spec.js.map +0 -1
  312. package/lib/builder/traffic.spec.d.ts +0 -1
  313. package/lib/builder/traffic.spec.js +0 -872
  314. package/lib/builder/traffic.spec.js.map +0 -1
  315. package/lib/config/projectConfig.spec.d.ts +0 -1
  316. package/lib/config/projectConfig.spec.js +0 -24
  317. package/lib/config/projectConfig.spec.js.map +0 -1
  318. package/lib/datasource/filesystemAdapter.spec.d.ts +0 -1
  319. package/lib/datasource/filesystemAdapter.spec.js +0 -88
  320. package/lib/datasource/filesystemAdapter.spec.js.map +0 -1
  321. package/lib/generate-code/typescript.spec.d.ts +0 -1
  322. package/lib/generate-code/typescript.spec.js +0 -78
  323. package/lib/generate-code/typescript.spec.js.map +0 -1
  324. package/lib/linter/attributeSchema.spec.d.ts +0 -1
  325. package/lib/linter/attributeSchema.spec.js +0 -266
  326. package/lib/linter/attributeSchema.spec.js.map +0 -1
  327. package/lib/linter/conditionSchema.spec.d.ts +0 -1
  328. package/lib/linter/conditionSchema.spec.js +0 -380
  329. package/lib/linter/conditionSchema.spec.js.map +0 -1
  330. package/lib/linter/featureSchema.spec.d.ts +0 -1
  331. package/lib/linter/featureSchema.spec.js +0 -1552
  332. package/lib/linter/featureSchema.spec.js.map +0 -1
  333. package/lib/linter/lintProject.spec.d.ts +0 -1
  334. package/lib/linter/lintProject.spec.js +0 -211
  335. package/lib/linter/lintProject.spec.js.map +0 -1
  336. package/lib/linter/mutationNotation.spec.d.ts +0 -1
  337. package/lib/linter/mutationNotation.spec.js +0 -598
  338. package/lib/linter/mutationNotation.spec.js.map +0 -1
  339. package/lib/linter/schema.spec.d.ts +0 -1
  340. package/lib/linter/schema.spec.js +0 -535
  341. package/lib/linter/schema.spec.js.map +0 -1
  342. package/lib/linter/segmentSchema.spec.d.ts +0 -1
  343. package/lib/linter/segmentSchema.spec.js +0 -303
  344. package/lib/linter/segmentSchema.spec.js.map +0 -1
  345. package/lib/linter/testSchema.spec.d.ts +0 -1
  346. package/lib/linter/testSchema.spec.js +0 -162
  347. package/lib/linter/testSchema.spec.js.map +0 -1
  348. package/lib/list/matrix.spec.d.ts +0 -1
  349. package/lib/list/matrix.spec.js +0 -42
  350. package/lib/list/matrix.spec.js.map +0 -1
  351. package/lib/site/exportSite.d.ts +0 -2
  352. package/lib/site/exportSite.js +0 -30
  353. package/lib/site/exportSite.js.map +0 -1
  354. package/lib/site/generateHistory.d.ts +0 -3
  355. package/lib/site/generateHistory.js +0 -31
  356. package/lib/site/generateHistory.js.map +0 -1
  357. package/lib/site/generateSiteSearchIndex.d.ts +0 -4
  358. package/lib/site/generateSiteSearchIndex.js +0 -195
  359. package/lib/site/generateSiteSearchIndex.js.map +0 -1
  360. package/lib/site/getLastModifiedFromHistory.d.ts +0 -2
  361. package/lib/site/getLastModifiedFromHistory.js +0 -18
  362. package/lib/site/getLastModifiedFromHistory.js.map +0 -1
  363. package/lib/site/getOwnerAndRepoFromUrl.d.ts +0 -4
  364. package/lib/site/getOwnerAndRepoFromUrl.js +0 -20
  365. package/lib/site/getOwnerAndRepoFromUrl.js.map +0 -1
  366. package/lib/site/getRelativePaths.d.ts +0 -6
  367. package/lib/site/getRelativePaths.js +0 -15
  368. package/lib/site/getRelativePaths.js.map +0 -1
  369. package/lib/site/getRepoDetails.d.ts +0 -8
  370. package/lib/site/getRepoDetails.js +0 -48
  371. package/lib/site/getRepoDetails.js.map +0 -1
  372. package/lib/site/index.d.ts +0 -2
  373. package/lib/site/index.js +0 -43
  374. package/lib/site/index.js.map +0 -1
  375. package/lib/site/serveSite.d.ts +0 -2
  376. package/lib/site/serveSite.js +0 -54
  377. package/lib/site/serveSite.js.map +0 -1
  378. package/lib/tester/helpers.spec.d.ts +0 -1
  379. package/lib/tester/helpers.spec.js +0 -115
  380. package/lib/tester/helpers.spec.js.map +0 -1
  381. package/src/builder/convertToV1.ts +0 -166
  382. package/src/site/exportSite.ts +0 -42
  383. package/src/site/generateHistory.ts +0 -40
  384. package/src/site/generateSiteSearchIndex.ts +0 -258
  385. package/src/site/getLastModifiedFromHistory.ts +0 -21
  386. package/src/site/getOwnerAndRepoFromUrl.ts +0 -17
  387. package/src/site/getRelativePaths.ts +0 -24
  388. package/src/site/getRepoDetails.ts +0 -62
  389. package/src/site/index.ts +0 -46
  390. package/src/site/serveSite.ts +0 -58
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.evaluatePlugin = void 0;
4
4
  exports.evaluateFeature = evaluateFeature;
5
5
  const sdk_1 = require("@featurevisor/sdk");
6
- const config_1 = require("../config");
7
- const builder_1 = require("../builder");
6
+ const buildRuntimeDatafiles_1 = require("../builder/buildRuntimeDatafiles");
7
+ const sets_1 = require("../sets");
8
+ const cliFormat_1 = require("../tester/cliFormat");
8
9
  function printEvaluationDetails(evaluation) {
9
10
  const ignoreKeys = ["featureKey", "variableKey", "traffic", "force"];
10
11
  for (const [key, value] of Object.entries(evaluation)) {
@@ -12,59 +13,44 @@ function printEvaluationDetails(evaluation) {
12
13
  continue;
13
14
  }
14
15
  if (key === "variation") {
15
- console.log(`-`, `${key}:`, value?.value);
16
+ console.log(` ${(0, cliFormat_1.colorize)(key, cliFormat_1.CLI_COLOR_CYAN)}:`, value?.value);
16
17
  continue;
17
18
  }
18
19
  if (key === "variableSchema") {
19
- console.log(`-`, `variableType:`, value.type);
20
- console.log(`-`, `defaultValue:`, value.defaultValue);
20
+ console.log(` ${(0, cliFormat_1.colorize)("variableType", cliFormat_1.CLI_COLOR_CYAN)}:`, value.type);
21
+ console.log(` ${(0, cliFormat_1.colorize)("defaultValue", cliFormat_1.CLI_COLOR_CYAN)}:`, value.defaultValue);
21
22
  continue;
22
23
  }
23
- console.log(`-`, `${key}:`, value);
24
+ console.log(` ${(0, cliFormat_1.colorize)(key, cliFormat_1.CLI_COLOR_CYAN)}:`, value);
24
25
  }
25
26
  }
26
- function printLogs(logs) {
27
- logs.forEach((log) => {
28
- console.log(`[${log.level}] ${log.message}`, log.details);
27
+ function printDiagnostics(diagnostics) {
28
+ diagnostics.forEach((diagnostic) => {
29
+ const levelColor = diagnostic.level === "error" ? 31 : diagnostic.level === "warn" ? 33 : 2;
30
+ console.log(`${(0, cliFormat_1.colorize)(`[${diagnostic.level}]`, levelColor)} ${diagnostic.message}`, diagnostic);
29
31
  console.log("");
30
32
  });
31
33
  }
32
34
  function printHeader(message) {
33
- console.log("\n\n###############");
34
- console.log(`# ${message}`);
35
- console.log("###############\n");
35
+ console.log("");
36
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, message);
37
+ console.log("");
36
38
  }
37
- async function evaluateFeature(deps, options) {
38
- const { datasource, projectConfig } = deps;
39
- const existingState = await datasource.readState(options.environment || false);
40
- const datafileContent = await (0, builder_1.buildDatafile)(projectConfig, datasource, {
41
- schemaVersion: options.schemaVersion || config_1.SCHEMA_VERSION,
42
- revision: "include-all-features",
43
- environment: options.environment || false,
44
- inflate: options.inflate,
45
- }, existingState);
46
- let logs = [];
47
- const f = (0, sdk_1.createInstance)({
39
+ async function evaluateFeatureWithDatafile(datafileContent, options, target) {
40
+ let diagnostics = [];
41
+ const f = (0, sdk_1.createFeaturevisor)({
48
42
  datafile: datafileContent,
49
- logger: (0, sdk_1.createLogger)({
50
- level: "debug",
51
- handler: (level, message, details) => {
52
- logs.push({
53
- level,
54
- message,
55
- details,
56
- });
57
- },
58
- }),
43
+ logLevel: "debug",
44
+ onDiagnostic: (diagnostic) => diagnostics.push(diagnostic),
59
45
  });
60
46
  const flagEvaluation = f.evaluateFlag(options.feature, options.context);
61
- const flagEvaluationLogs = [...logs];
62
- logs = [];
47
+ const flagEvaluationDiagnostics = [...diagnostics];
48
+ diagnostics = [];
63
49
  const variationEvaluation = f.evaluateVariation(options.feature, options.context);
64
- const variationEvaluationLogs = [...logs];
65
- logs = [];
50
+ const variationEvaluationDiagnostics = [...diagnostics];
51
+ diagnostics = [];
66
52
  const variableEvaluations = {};
67
- const variableEvaluationLogs = {};
53
+ const variableEvaluationDiagnostics = {};
68
54
  const feature = f.getFeature(options.feature);
69
55
  if (feature?.variablesSchema) {
70
56
  const variableKeys = Array.isArray(feature.variablesSchema)
@@ -72,8 +58,8 @@ async function evaluateFeature(deps, options) {
72
58
  : Object.keys(feature.variablesSchema);
73
59
  variableKeys.forEach((variableKey) => {
74
60
  const variableEvaluation = f.evaluateVariable(options.feature, variableKey, options.context);
75
- variableEvaluationLogs[variableKey] = [...logs];
76
- logs = [];
61
+ variableEvaluationDiagnostics[variableKey] = [...diagnostics];
62
+ diagnostics = [];
77
63
  variableEvaluations[variableKey] = variableEvaluation;
78
64
  });
79
65
  }
@@ -83,69 +69,97 @@ async function evaluateFeature(deps, options) {
83
69
  variables: variableEvaluations,
84
70
  };
85
71
  if (options.json) {
86
- console.log(options.pretty ? JSON.stringify(allEvaluations, null, 2) : JSON.stringify(allEvaluations));
87
- return;
72
+ return allEvaluations;
88
73
  }
89
74
  console.log("");
90
- console.log(`Evaluating feature "${options.feature}" in environment "${options.environment}"...`);
91
- console.log(`Against context: ${JSON.stringify(options.context)}`);
75
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, "Evaluating Featurevisor feature");
76
+ console.log(` ${(0, cliFormat_1.colorize)("Feature", cliFormat_1.CLI_COLOR_CYAN)}: ${options.feature}`);
77
+ console.log(` ${(0, cliFormat_1.colorize)("Environment", cliFormat_1.CLI_COLOR_CYAN)}: ${options.environment || false}`);
78
+ if (target)
79
+ console.log(` ${(0, cliFormat_1.colorize)("Target", cliFormat_1.CLI_COLOR_CYAN)}: ${target}`);
80
+ console.log(` ${(0, cliFormat_1.colorize)("Context", cliFormat_1.CLI_COLOR_CYAN)}: ${JSON.stringify(options.context)}`);
92
81
  // flag
93
82
  printHeader("Is enabled?");
94
83
  if (options.verbose) {
95
- printLogs(flagEvaluationLogs);
84
+ printDiagnostics(flagEvaluationDiagnostics);
96
85
  }
97
- console.log("Value:", flagEvaluation.enabled);
86
+ console.log(flagEvaluation.enabled ? cliFormat_1.CLI_FORMAT_GREEN : cliFormat_1.CLI_FORMAT_YELLOW, `Value: ${flagEvaluation.enabled}`);
98
87
  console.log("\nDetails:\n");
99
88
  printEvaluationDetails(flagEvaluation);
100
89
  // variation
101
90
  printHeader("Variation");
102
91
  if (feature?.variations) {
103
92
  if (options.verbose) {
104
- printLogs(variationEvaluationLogs);
93
+ printDiagnostics(variationEvaluationDiagnostics);
105
94
  }
106
- console.log("Value:", JSON.stringify(variationEvaluation.variation?.value));
95
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, `Value: ${JSON.stringify(variationEvaluation.variation?.value)}`);
107
96
  console.log("\nDetails:\n");
108
97
  printEvaluationDetails(variationEvaluation);
109
98
  }
110
99
  else {
111
- console.log("No variations defined.");
100
+ console.log(cliFormat_1.CLI_FORMAT_YELLOW, "No variations defined.");
112
101
  }
113
102
  // variables
114
103
  if (feature?.variablesSchema) {
115
104
  for (const [key, value] of Object.entries(variableEvaluations)) {
116
105
  printHeader(`Variable: ${key}`);
117
106
  if (options.verbose) {
118
- printLogs(variableEvaluationLogs[key]);
107
+ printDiagnostics(variableEvaluationDiagnostics[key]);
119
108
  }
120
- console.log("Value:", typeof value.variableValue !== "undefined"
109
+ const variableValue = typeof value.variableValue !== "undefined"
121
110
  ? JSON.stringify(value.variableValue)
122
- : value.variableValue);
111
+ : value.variableValue;
112
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, `Value: ${variableValue}`);
123
113
  console.log("\nDetails:\n");
124
114
  printEvaluationDetails(value);
125
115
  }
126
116
  }
127
117
  else {
128
118
  printHeader("Variables");
129
- console.log("No variables defined.");
119
+ console.log(cliFormat_1.CLI_FORMAT_YELLOW, "No variables defined.");
120
+ }
121
+ return allEvaluations;
122
+ }
123
+ async function evaluateFeature(deps, options) {
124
+ const datafiles = await (0, buildRuntimeDatafiles_1.buildRuntimeDatafiles)(deps, {
125
+ environment: options.environment || false,
126
+ target: options.target,
127
+ revision: "include-all-features",
128
+ inflate: options.inflate,
129
+ });
130
+ const results = [];
131
+ for (const entry of datafiles) {
132
+ const evaluations = await evaluateFeatureWithDatafile(entry.datafile, options, entry.target);
133
+ results.push({ target: entry.target, evaluations });
134
+ }
135
+ if (options.json) {
136
+ const output = results.length === 1 ? results[0].evaluations : results;
137
+ console.log(options.pretty ? JSON.stringify(output, null, 2) : JSON.stringify(output));
130
138
  }
131
139
  }
132
140
  exports.evaluatePlugin = {
133
141
  command: "evaluate",
134
142
  handler: async ({ rootDirectoryPath, projectConfig, datasource, parsed }) => {
135
- await evaluateFeature({
136
- rootDirectoryPath,
137
- projectConfig,
138
- datasource,
139
- options: parsed,
140
- }, {
141
- environment: parsed.environment,
142
- feature: parsed.feature,
143
- context: parsed.context ? JSON.parse(parsed.context) : {},
144
- // @NOTE: introduce optional --at?
145
- json: parsed.json,
146
- pretty: parsed.pretty,
147
- verbose: parsed.verbose,
148
- });
143
+ (0, sets_1.assertProjectSetJsonSelection)(projectConfig, parsed.set, parsed.json);
144
+ const executions = await (0, sets_1.getProjectSetExecutions)(projectConfig, datasource, parsed.set);
145
+ for (const execution of executions) {
146
+ (0, sets_1.printSetHeader)(projectConfig, execution.set, parsed.json);
147
+ await evaluateFeature({
148
+ rootDirectoryPath,
149
+ projectConfig: execution.projectConfig,
150
+ datasource: execution.datasource,
151
+ options: parsed,
152
+ }, {
153
+ environment: parsed.environment,
154
+ feature: parsed.feature,
155
+ context: parsed.context ? JSON.parse(parsed.context) : {},
156
+ // @NOTE: introduce optional --at?
157
+ json: parsed.json,
158
+ pretty: parsed.pretty,
159
+ verbose: parsed.verbose,
160
+ target: parsed.target,
161
+ });
162
+ }
149
163
  },
150
164
  examples: [
151
165
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/evaluate/index.ts"],"names":[],"mappings":";;;AAoEA,0CAoIC;AAvMD,2CAO2B;AAG3B,sCAA2C;AAC3C,wCAA2C;AAG3C,SAAS,sBAAsB,CAAC,UAAsB;IACpD,MAAM,UAAU,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAErE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAA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M,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IACD,QAAQ,EAAE;QACR;YACE,OAAO,EACL,wFAAwF;YAC1F,WAAW,EAAE,6CAA6C;SAC3D;KACF;CACF,CAAC"}
@@ -1,7 +1,40 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.findDuplicateSegments = findDuplicateSegments;
4
- const crypto = require("crypto");
37
+ const crypto = __importStar(require("crypto"));
5
38
  async function findDuplicateSegments(deps, options = {}) {
6
39
  const { datasource } = deps;
7
40
  const segments = await datasource.listSegments();
@@ -1 +1 @@
1
- {"version":3,"file":"findDuplicateSegments.js","sourceRoot":"","sources":["../../src/find-duplicate-segments/findDuplicateSegments.ts"],"names":[],"mappings":";;AAeA,sDA4DC;AA3ED,iCAAiC;AAe1B,KAAK,UAAU,qBAAqB,CACzC,IAAkB,EAClB,UAAoC,EAAE;IAEtC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAE5B,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,YAAY,EAAE,CAAC;IAEjD,MAAM,gBAAgB,GAA+C,EAAE,CAAC;IACxE,KAAK,MAAM,UAAU,IAAI,QAAQ,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACzD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACtD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1E,gBAAgB,CAAC,IAAI,CAAC;YACpB,UAAU;YACV,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,MAAM,eAAe,GAAqC,gBAAgB,CAAC,MAAM,CAC/E,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE;QAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACjB,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3B,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,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IAAI,WAAW,EAAE,CAAC;gBACrC,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,kBAAkB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAE3E,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;oBACxB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC7B,CAAC,CAAC,CAAC;YACL,CAAC;YAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACjF,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QAC1B,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -3,36 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findDuplicateSegmentsPlugin = void 0;
4
4
  exports.findDuplicateSegmentsInProject = findDuplicateSegmentsInProject;
5
5
  const findDuplicateSegments_1 = require("./findDuplicateSegments");
6
+ const sets_1 = require("../sets");
7
+ const cliFormat_1 = require("../tester/cliFormat");
6
8
  async function findDuplicateSegmentsInProject(deps, options = {}) {
7
9
  const duplicates = await (0, findDuplicateSegments_1.findDuplicateSegments)(deps, options);
8
10
  console.log("");
11
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, "Finding duplicate Featurevisor segments");
9
12
  if (duplicates.length === 0) {
10
- console.log("No duplicate segments found");
13
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, "No duplicate segments found");
11
14
  return;
12
15
  }
13
- console.log(`Found ${duplicates.length} duplicate(s):\n`);
16
+ console.log(cliFormat_1.CLI_FORMAT_YELLOW, `Found ${duplicates.length} duplicate(s):`);
17
+ console.log("");
14
18
  duplicates.forEach((entry) => {
15
19
  if (options.authors) {
16
- console.log(` - Segments: ${entry.segments.join(", ")}`);
17
- console.log(` Authors: ${entry.authors && entry.authors.join(", ")}`);
20
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} Segments: ${entry.segments.join(", ")}`);
21
+ console.log(` ${(0, cliFormat_1.colorize)("Authors", cliFormat_1.CLI_COLOR_CYAN)}: ${entry.authors && entry.authors.join(", ")}`);
18
22
  console.log("");
19
23
  }
20
24
  else {
21
- console.log(` - ${entry.segments.join(", ")}`);
25
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${entry.segments.join(", ")}`);
22
26
  }
23
27
  });
24
28
  }
25
29
  exports.findDuplicateSegmentsPlugin = {
26
30
  command: "find-duplicate-segments",
27
31
  handler: async ({ rootDirectoryPath, projectConfig, datasource, parsed }) => {
28
- await findDuplicateSegmentsInProject({
29
- rootDirectoryPath,
30
- projectConfig,
31
- datasource,
32
- options: parsed,
33
- }, {
34
- authors: parsed.authors,
35
- });
32
+ const executions = await (0, sets_1.getProjectSetExecutions)(projectConfig, datasource, parsed.set);
33
+ for (const execution of executions) {
34
+ (0, sets_1.printSetHeader)(projectConfig, execution.set);
35
+ await findDuplicateSegmentsInProject({
36
+ rootDirectoryPath,
37
+ projectConfig: execution.projectConfig,
38
+ datasource: execution.datasource,
39
+ options: parsed,
40
+ }, {
41
+ authors: parsed.authors,
42
+ });
43
+ }
36
44
  },
37
45
  examples: [
38
46
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/find-duplicate-segments/index.ts"],"names":[],"mappings":";;;AAIA,wEAwBC;AA5BD,mEAA0F;AAInF,KAAK,UAAU,8BAA8B,CAClD,IAAkB,EAClB,UAAoC,EAAE;IAEtC,MAAM,UAAU,GAAG,MAAM,IAAA,6CAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE9D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,IA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EAAE,0BAAc,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,2BAA2B,GAAW;IACjD,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,KAAK,EAAE,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QAC1E,MAAM,UAAU,GAAG,MAAM,IAAA,8BAAuB,EAAC,aAAa,EAAE,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;QAExF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAA,qBAAc,EAAC,aAAa,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;YAE7C,MAAM,8BAA8B,CAClC;gBACE,iBAAiB;gBACjB,aAAa,EAAE,SAAS,CAAC,aAAa;gBACtC,UAAU,EAAE,SAAS,CAAC,UAAU;gBAChC,OAAO,EAAE,MAAM;aAChB,EACD;gBACE,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IACD,QAAQ,EAAE;QACR;YACE,OAAO,EAAE,yBAAyB;YAClC,WAAW,EAAE,wCAAwC;SACtD;QACD;YACE,OAAO,EAAE,mCAAmC;YAC5C,WAAW,EAAE,yDAAyD;SACvE;KACF;CACF,CAAC"}
@@ -10,6 +10,8 @@ exports.findUnusedSegments = findUnusedSegments;
10
10
  exports.findUnusedAttributes = findUnusedAttributes;
11
11
  exports.findUsageInProject = findUsageInProject;
12
12
  const extractKeys_1 = require("../utils/extractKeys");
13
+ const sets_1 = require("../sets");
14
+ const cliFormat_1 = require("../tester/cliFormat");
13
15
  async function findAllUsageInFeatures(deps) {
14
16
  const { datasource, projectConfig } = deps;
15
17
  const usageInFeatures = {};
@@ -87,7 +89,7 @@ async function findAllUsageInFeatures(deps) {
87
89
  });
88
90
  }
89
91
  // no environments
90
- if (projectConfig.environments === false) {
92
+ if (!Array.isArray(projectConfig.environments)) {
91
93
  // force
92
94
  if (Array.isArray(feature.force)) {
93
95
  feature.force.forEach((force) => {
@@ -201,24 +203,27 @@ async function findUnusedAttributes(deps, usageInFeatures, usageInSegments) {
201
203
  async function findUsageInProject(deps, options) {
202
204
  const { datasource } = deps;
203
205
  console.log("");
206
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, "Finding Featurevisor usage");
207
+ console.log("");
204
208
  const usageInFeatures = await findAllUsageInFeatures(deps);
205
209
  const usageInSegments = await findAllUsageInSegments(deps);
206
210
  // feature
207
211
  if (options.feature) {
208
212
  const usedInFeatures = await findFeatureUsage(usageInFeatures, options.feature);
209
213
  if (usedInFeatures.size === 0) {
210
- console.log(`Feature "${options.feature}" is not used in any features.`);
214
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, `Feature "${options.feature}" is not used in any features.`);
211
215
  }
212
216
  else {
213
- console.log(`Feature "${options.feature}" is used in the following features:\n`);
217
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, `Feature "${options.feature}" is used in these features`);
218
+ console.log("");
214
219
  for (const featureKey of Array.from(usedInFeatures)) {
215
220
  if (options.authors) {
216
221
  const entries = await datasource.listHistoryEntries("feature", featureKey);
217
222
  const authors = Array.from(new Set(entries.map((entry) => entry.author)));
218
- console.log(` - ${featureKey} (Authors: ${authors.join(", ")})`);
223
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey} ${(0, cliFormat_1.colorize)(`(Authors: ${authors.join(", ")})`, cliFormat_1.CLI_COLOR_DIM)}`);
219
224
  }
220
225
  else {
221
- console.log(` - ${featureKey}`);
226
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey}`);
222
227
  }
223
228
  }
224
229
  }
@@ -228,18 +233,19 @@ async function findUsageInProject(deps, options) {
228
233
  if (options.segment) {
229
234
  const usedInFeatures = await findSegmentUsage(usageInFeatures, options.segment);
230
235
  if (usedInFeatures.size === 0) {
231
- console.log(`Segment "${options.segment}" is not used in any features.`);
236
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, `Segment "${options.segment}" is not used in any features.`);
232
237
  }
233
238
  else {
234
- console.log(`Segment "${options.segment}" is used in the following features:\n`);
239
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, `Segment "${options.segment}" is used in these features`);
240
+ console.log("");
235
241
  for (const featureKey of Array.from(usedInFeatures)) {
236
242
  if (options.authors) {
237
243
  const entries = await datasource.listHistoryEntries("feature", featureKey);
238
244
  const authors = Array.from(new Set(entries.map((entry) => entry.author)));
239
- console.log(` - ${featureKey} (Authors: ${authors.join(", ")})`);
245
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey} ${(0, cliFormat_1.colorize)(`(Authors: ${authors.join(", ")})`, cliFormat_1.CLI_COLOR_DIM)}`);
240
246
  }
241
247
  else {
242
- console.log(` - ${featureKey}`);
248
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey}`);
243
249
  }
244
250
  }
245
251
  }
@@ -249,19 +255,20 @@ async function findUsageInProject(deps, options) {
249
255
  if (options.attribute) {
250
256
  const usedIn = await findAttributeUsage(usageInFeatures, usageInSegments, options.attribute);
251
257
  if (usedIn.features.size === 0 && usedIn.segments.size === 0) {
252
- console.log(`Attribute "${options.attribute}" is not used in any features or segments.`);
258
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, `Attribute "${options.attribute}" is not used in any features or segments.`);
253
259
  return;
254
260
  }
255
261
  if (usedIn.segments.size > 0) {
256
- console.log(`Attribute "${options.attribute}" is used in the following segments:\n`);
262
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, `Attribute "${options.attribute}" is used in these segments`);
263
+ console.log("");
257
264
  for (const segmentKey of Array.from(usedIn.segments)) {
258
265
  if (options.authors) {
259
266
  const entries = await datasource.listHistoryEntries("segment", segmentKey);
260
267
  const authors = Array.from(new Set(entries.map((entry) => entry.author)));
261
- console.log(` - ${segmentKey} (Authors: ${authors.join(", ")})`);
268
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${segmentKey} ${(0, cliFormat_1.colorize)(`(Authors: ${authors.join(", ")})`, cliFormat_1.CLI_COLOR_DIM)}`);
262
269
  }
263
270
  else {
264
- console.log(` - ${segmentKey}`);
271
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${segmentKey}`);
265
272
  }
266
273
  }
267
274
  // features affected by above segments
@@ -271,30 +278,33 @@ async function findUsageInProject(deps, options) {
271
278
  featureKeys.forEach((featureKey) => affectedFeatures.add(featureKey));
272
279
  }
273
280
  if (affectedFeatures.size > 0) {
274
- console.log(`\nSegments above are used in the following features:\n`);
281
+ console.log("");
282
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, "Segments above are used in these features");
283
+ console.log("");
275
284
  for (const featureKey of Array.from(affectedFeatures)) {
276
285
  if (options.authors) {
277
286
  const entries = await datasource.listHistoryEntries("feature", featureKey);
278
287
  const authors = Array.from(new Set(entries.map((entry) => entry.author)));
279
- console.log(` - ${featureKey} (Authors: ${authors.join(", ")})`);
288
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey} ${(0, cliFormat_1.colorize)(`(Authors: ${authors.join(", ")})`, cliFormat_1.CLI_COLOR_DIM)}`);
280
289
  }
281
290
  else {
282
- console.log(` - ${featureKey}`);
291
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey}`);
283
292
  }
284
293
  }
285
294
  console.log("");
286
295
  }
287
296
  }
288
297
  if (usedIn.features.size > 0) {
289
- console.log(`Attribute "${options.attribute}" is used directly in the following features:\n`);
298
+ console.log(cliFormat_1.CLI_FORMAT_BOLD, `Attribute "${options.attribute}" is used directly in these features`);
299
+ console.log("");
290
300
  for (const featureKey of Array.from(usedIn.features)) {
291
301
  if (options.authors) {
292
302
  const entries = await datasource.listHistoryEntries("feature", featureKey);
293
303
  const authors = Array.from(new Set(entries.map((entry) => entry.author)));
294
- console.log(` - ${featureKey} (Authors: ${authors.join(", ")})`);
304
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey} ${(0, cliFormat_1.colorize)(`(Authors: ${authors.join(", ")})`, cliFormat_1.CLI_COLOR_DIM)}`);
295
305
  }
296
306
  else {
297
- console.log(` - ${featureKey}`);
307
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${featureKey}`);
298
308
  }
299
309
  }
300
310
  console.log("");
@@ -305,18 +315,19 @@ async function findUsageInProject(deps, options) {
305
315
  if (options.unusedSegments) {
306
316
  const unusedSegments = await findUnusedSegments(deps, usageInFeatures);
307
317
  if (unusedSegments.size === 0) {
308
- console.log("No unused segments found.");
318
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, "No unused segments found.");
309
319
  }
310
320
  else {
311
- console.log("Unused segments:\n");
321
+ console.log(cliFormat_1.CLI_FORMAT_YELLOW, "Unused segments");
322
+ console.log("");
312
323
  for (const segmentKey of Array.from(unusedSegments)) {
313
324
  if (options.authors) {
314
325
  const entries = await datasource.listHistoryEntries("segment", segmentKey);
315
326
  const authors = Array.from(new Set(entries.map((entry) => entry.author)));
316
- console.log(` - ${segmentKey} (Authors: ${authors.join(", ")})`);
327
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${segmentKey} ${(0, cliFormat_1.colorize)(`(Authors: ${authors.join(", ")})`, cliFormat_1.CLI_COLOR_DIM)}`);
317
328
  }
318
329
  else {
319
- console.log(` - ${segmentKey}`);
330
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${segmentKey}`);
320
331
  }
321
332
  }
322
333
  }
@@ -326,41 +337,46 @@ async function findUsageInProject(deps, options) {
326
337
  if (options.unusedAttributes) {
327
338
  const unusedAttributes = await findUnusedAttributes(deps, usageInFeatures, usageInSegments);
328
339
  if (unusedAttributes.size === 0) {
329
- console.log("No unused attributes found.");
340
+ console.log(cliFormat_1.CLI_FORMAT_GREEN, "No unused attributes found.");
330
341
  }
331
342
  else {
332
- console.log("Unused attributes:\n");
343
+ console.log(cliFormat_1.CLI_FORMAT_YELLOW, "Unused attributes");
344
+ console.log("");
333
345
  for (const attributeKey of Array.from(unusedAttributes)) {
334
346
  if (options.authors) {
335
347
  const entries = await datasource.listHistoryEntries("attribute", attributeKey);
336
348
  const authors = Array.from(new Set(entries.map((entry) => entry.author)));
337
- console.log(` - ${attributeKey} (Authors: ${authors.join(", ")})`);
349
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${attributeKey} ${(0, cliFormat_1.colorize)(`(Authors: ${authors.join(", ")})`, cliFormat_1.CLI_COLOR_DIM)}`);
338
350
  }
339
351
  else {
340
- console.log(` - ${attributeKey}`);
352
+ console.log(` ${(0, cliFormat_1.colorize)("•", cliFormat_1.CLI_COLOR_CYAN)} ${attributeKey}`);
341
353
  }
342
354
  }
343
355
  }
344
356
  return;
345
357
  }
346
- console.log("Please specify a segment or attribute.");
358
+ console.log(cliFormat_1.CLI_FORMAT_YELLOW, "Please specify a feature, segment, attribute, or unused query.");
347
359
  }
348
360
  exports.findUsagePlugin = {
349
361
  command: "find-usage",
350
362
  handler: async ({ rootDirectoryPath, projectConfig, datasource, parsed }) => {
351
- await findUsageInProject({
352
- rootDirectoryPath,
353
- projectConfig,
354
- datasource,
355
- options: parsed,
356
- }, {
357
- feature: parsed.feature,
358
- segment: parsed.segment,
359
- attribute: parsed.attribute,
360
- unusedSegments: parsed.unusedSegments,
361
- unusedAttributes: parsed.unusedAttributes,
362
- authors: parsed.authors,
363
- });
363
+ const executions = await (0, sets_1.getProjectSetExecutions)(projectConfig, datasource, parsed.set);
364
+ for (const execution of executions) {
365
+ (0, sets_1.printSetHeader)(projectConfig, execution.set);
366
+ await findUsageInProject({
367
+ rootDirectoryPath,
368
+ projectConfig: execution.projectConfig,
369
+ datasource: execution.datasource,
370
+ options: parsed,
371
+ }, {
372
+ feature: parsed.feature,
373
+ segment: parsed.segment,
374
+ attribute: parsed.attribute,
375
+ unusedSegments: parsed.unusedSegments,
376
+ unusedAttributes: parsed.unusedAttributes,
377
+ authors: parsed.authors,
378
+ });
379
+ }
364
380
  },
365
381
  examples: [
366
382
  {