@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
@@ -1,872 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const traffic_1 = require("./traffic");
4
- describe("core: Traffic", function () {
5
- it("should be a function", function () {
6
- expect(typeof traffic_1.getTraffic).toEqual("function");
7
- });
8
- it("should allocate traffic for 100-0 weight on two variations", function () {
9
- const result = (0, traffic_1.getTraffic)(
10
- // parsed variations from YAML
11
- [
12
- {
13
- value: "on",
14
- weight: 100,
15
- },
16
- {
17
- value: "off",
18
- weight: 0,
19
- },
20
- ],
21
- // parsed rollouts from YAML
22
- [
23
- {
24
- key: "1",
25
- segments: "*",
26
- percentage: 80,
27
- },
28
- ],
29
- // existing feature from previous release
30
- undefined);
31
- expect(result).toEqual([
32
- {
33
- key: "1",
34
- segments: "*",
35
- percentage: 80000,
36
- allocation: [
37
- {
38
- variation: "on",
39
- range: [0, 80000],
40
- },
41
- ],
42
- },
43
- ]);
44
- });
45
- it("should allocate traffic for 0-100 weight on two variations", function () {
46
- const result = (0, traffic_1.getTraffic)(
47
- // parsed variations from YAML
48
- [
49
- {
50
- value: "control",
51
- weight: 0,
52
- },
53
- {
54
- value: "treatment",
55
- weight: 100,
56
- },
57
- ],
58
- // parsed rollouts from YAML
59
- [
60
- {
61
- key: "1",
62
- segments: "*",
63
- percentage: 80,
64
- },
65
- ],
66
- // existing feature from previous release
67
- undefined);
68
- expect(result).toEqual([
69
- {
70
- key: "1",
71
- segments: "*",
72
- percentage: 80000,
73
- allocation: [
74
- // should be filtered out automatically
75
- // {
76
- // variation: "control",
77
- // range: [0, 0],
78
- // },
79
- {
80
- variation: "treatment",
81
- range: [0, 80000],
82
- },
83
- ],
84
- },
85
- ]);
86
- });
87
- it("should allocate traffic for 0-100 weight on two variations, with rule percentage going from 80% to 100%", function () {
88
- const result = (0, traffic_1.getTraffic)(
89
- // parsed variations from YAML
90
- [
91
- {
92
- value: "control",
93
- weight: 0,
94
- },
95
- {
96
- value: "treatment",
97
- weight: 100,
98
- },
99
- ],
100
- // parsed rollouts from YAML
101
- [
102
- {
103
- key: "1",
104
- segments: "*",
105
- percentage: 100,
106
- },
107
- ],
108
- // existing feature from previous release
109
- {
110
- variations: [
111
- {
112
- value: "control",
113
- weight: 0,
114
- },
115
- {
116
- value: "treatment",
117
- weight: 80,
118
- },
119
- ],
120
- traffic: [
121
- {
122
- key: "1",
123
- percentage: 80000,
124
- allocation: [
125
- {
126
- variation: "treatment",
127
- range: [0, 80000],
128
- },
129
- ],
130
- },
131
- ],
132
- });
133
- expect(result).toEqual([
134
- {
135
- key: "1",
136
- segments: "*",
137
- percentage: 100000,
138
- allocation: [
139
- // should be filtered out automatically
140
- // {
141
- // variation: "control",
142
- // range: [0, 0],
143
- // },
144
- {
145
- variation: "treatment",
146
- range: [0, 100000],
147
- },
148
- ],
149
- },
150
- ]);
151
- });
152
- it("should allocate traffic for 0-100 weight on two variations, with rule percentage going from 100% to 80%", function () {
153
- const result = (0, traffic_1.getTraffic)(
154
- // parsed variations from YAML
155
- [
156
- {
157
- value: "control",
158
- weight: 0,
159
- },
160
- {
161
- value: "treatment",
162
- weight: 100,
163
- },
164
- ],
165
- // parsed rollouts from YAML
166
- [
167
- {
168
- key: "1",
169
- segments: "*",
170
- percentage: 80,
171
- },
172
- ],
173
- // existing feature from previous release
174
- {
175
- variations: [
176
- {
177
- value: "control",
178
- weight: 0,
179
- },
180
- {
181
- value: "treatment",
182
- weight: 80,
183
- },
184
- ],
185
- traffic: [
186
- {
187
- key: "1",
188
- percentage: 100000,
189
- allocation: [
190
- {
191
- variation: "treatment",
192
- range: [0, 100000],
193
- },
194
- ],
195
- },
196
- ],
197
- });
198
- expect(result).toEqual([
199
- {
200
- key: "1",
201
- segments: "*",
202
- percentage: 80000,
203
- allocation: [
204
- // should be filtered out automatically
205
- // {
206
- // variation: "control",
207
- // range: [0, 0],
208
- // },
209
- {
210
- variation: "treatment",
211
- range: [0, 80000],
212
- },
213
- ],
214
- },
215
- ]);
216
- });
217
- it("should allocate traffic for existing variations state of 0-100 weights", function () {
218
- const result = (0, traffic_1.getTraffic)(
219
- // parsed variations from YAML
220
- [
221
- {
222
- value: "control",
223
- weight: 50,
224
- },
225
- {
226
- value: "treatment",
227
- weight: 50,
228
- },
229
- ],
230
- // parsed rollouts from YAML
231
- [
232
- {
233
- key: "1",
234
- segments: "*",
235
- percentage: 80,
236
- },
237
- ],
238
- // existing feature from previous release
239
- {
240
- variations: [
241
- {
242
- value: "control",
243
- weight: 0,
244
- },
245
- {
246
- value: "treatment",
247
- weight: 80,
248
- },
249
- ],
250
- traffic: [
251
- {
252
- key: "1",
253
- percentage: 80000,
254
- allocation: [
255
- {
256
- variation: "treatment",
257
- range: [0, 80000],
258
- },
259
- ],
260
- },
261
- ],
262
- });
263
- expect(result).toEqual([
264
- {
265
- key: "1",
266
- segments: "*",
267
- percentage: 80000,
268
- allocation: [
269
- {
270
- variation: "control",
271
- range: [0, 40000],
272
- },
273
- {
274
- variation: "treatment",
275
- range: [40000, 80000],
276
- },
277
- ],
278
- },
279
- ]);
280
- });
281
- it("should allocate traffic for 50-50 weight on two variations", function () {
282
- const result = (0, traffic_1.getTraffic)(
283
- // parsed variations from YAML
284
- [
285
- {
286
- value: "on",
287
- weight: 50,
288
- },
289
- {
290
- value: "off",
291
- weight: 50,
292
- },
293
- ],
294
- // parsed rollouts from YAML
295
- [
296
- {
297
- key: "1",
298
- segments: "*",
299
- percentage: 80,
300
- },
301
- ],
302
- // existing feature from previous release
303
- undefined);
304
- expect(result).toEqual([
305
- {
306
- key: "1",
307
- segments: "*",
308
- percentage: 80000,
309
- allocation: [
310
- {
311
- variation: "on",
312
- range: [0, 40000],
313
- },
314
- {
315
- variation: "off",
316
- range: [40000, 80000],
317
- },
318
- ],
319
- },
320
- ]);
321
- });
322
- it("should allocate traffic for weight with two decimal places among three variations", function () {
323
- const result = (0, traffic_1.getTraffic)(
324
- // parsed variations from YAML
325
- [
326
- {
327
- value: "yes",
328
- weight: 33.33,
329
- },
330
- {
331
- value: "no",
332
- weight: 33.33,
333
- },
334
- {
335
- value: "maybe",
336
- weight: 33.34,
337
- },
338
- ],
339
- // parsed rollouts from YAML
340
- [
341
- {
342
- key: "1",
343
- segments: "*",
344
- percentage: 100,
345
- },
346
- ],
347
- // existing feature from previous release
348
- undefined);
349
- expect(result).toEqual([
350
- {
351
- key: "1",
352
- segments: "*",
353
- percentage: 100000,
354
- allocation: [
355
- {
356
- variation: "yes",
357
- range: [0, 33330],
358
- },
359
- {
360
- variation: "no",
361
- range: [33330, 66660],
362
- },
363
- {
364
- variation: "maybe",
365
- range: [66660, 100000],
366
- },
367
- ],
368
- },
369
- ]);
370
- });
371
- it("should allocate against previous known allocation, increasing from 80% to 90%, with same variations and weight", function () {
372
- const result = (0, traffic_1.getTraffic)(
373
- // parsed variations from YAML
374
- [
375
- {
376
- value: "on",
377
- weight: 50,
378
- },
379
- {
380
- value: "off",
381
- weight: 50,
382
- },
383
- ],
384
- // parsed rollouts from YAML
385
- [
386
- {
387
- key: "1",
388
- segments: "*",
389
- percentage: 90,
390
- },
391
- ],
392
- // existing feature from previous release
393
- {
394
- variations: [
395
- {
396
- value: "on",
397
- weight: 50,
398
- },
399
- {
400
- value: "off",
401
- weight: 50,
402
- },
403
- ],
404
- traffic: [
405
- {
406
- key: "1",
407
- percentage: 80000,
408
- allocation: [
409
- {
410
- variation: "on",
411
- range: [0, 40000],
412
- },
413
- {
414
- variation: "off",
415
- range: [40000, 80000],
416
- },
417
- ],
418
- },
419
- ],
420
- });
421
- expect(result).toEqual([
422
- {
423
- key: "1",
424
- segments: "*",
425
- percentage: 90000,
426
- allocation: [
427
- // existing
428
- {
429
- variation: "on",
430
- range: [0, 40000],
431
- },
432
- {
433
- variation: "off",
434
- range: [40000, 80000],
435
- },
436
- // new
437
- {
438
- variation: "on",
439
- range: [80000, 85000],
440
- },
441
- {
442
- variation: "off",
443
- range: [85000, 90000],
444
- },
445
- ],
446
- },
447
- ]);
448
- });
449
- it("should allocate against previous known allocation, decreasing from 80% to 70%, with same variations and weight", function () {
450
- const result = (0, traffic_1.getTraffic)(
451
- // parsed variations from YAML
452
- [
453
- {
454
- value: "on",
455
- weight: 50,
456
- },
457
- {
458
- value: "off",
459
- weight: 50,
460
- },
461
- ],
462
- // parsed rollouts from YAML
463
- [
464
- {
465
- key: "1",
466
- segments: "*",
467
- percentage: 70,
468
- },
469
- ],
470
- // existing feature from previous release
471
- {
472
- variations: [
473
- {
474
- value: "on",
475
- weight: 50,
476
- },
477
- {
478
- value: "off",
479
- weight: 50,
480
- },
481
- ],
482
- traffic: [
483
- {
484
- key: "1",
485
- percentage: 80000,
486
- allocation: [
487
- {
488
- variation: "on",
489
- range: [0, 40000],
490
- },
491
- {
492
- variation: "off",
493
- range: [40000, 80000],
494
- },
495
- ],
496
- },
497
- ],
498
- });
499
- expect(result).toEqual([
500
- {
501
- key: "1",
502
- segments: "*",
503
- percentage: 70000,
504
- allocation: [
505
- {
506
- variation: "on",
507
- range: [0, 35000],
508
- },
509
- {
510
- variation: "off",
511
- range: [35000, 70000],
512
- },
513
- ],
514
- },
515
- ]);
516
- });
517
- it("should allocate against previous known allocation, increasing from 80% to 90%, with new added variation", function () {
518
- const result = (0, traffic_1.getTraffic)(
519
- // parsed variations from YAML
520
- [
521
- {
522
- value: "a",
523
- weight: 33.33,
524
- },
525
- {
526
- value: "b",
527
- weight: 33.33,
528
- },
529
- {
530
- value: "c",
531
- weight: 33.34,
532
- },
533
- ],
534
- // parsed rollouts from YAML
535
- [
536
- {
537
- key: "1",
538
- segments: "*",
539
- percentage: 90,
540
- },
541
- ],
542
- // existing feature from previous release
543
- {
544
- variations: [
545
- {
546
- value: "a",
547
- weight: 50,
548
- },
549
- {
550
- value: "b",
551
- weight: 50,
552
- },
553
- ],
554
- traffic: [
555
- {
556
- key: "1",
557
- percentage: 80000,
558
- allocation: [
559
- {
560
- variation: "a",
561
- range: [0, 40000],
562
- },
563
- {
564
- variation: "b",
565
- range: [40000, 80000],
566
- },
567
- ],
568
- },
569
- ],
570
- });
571
- expect(result).toEqual([
572
- {
573
- key: "1",
574
- segments: "*",
575
- percentage: 90000,
576
- allocation: [
577
- {
578
- variation: "a",
579
- range: [0, 29997],
580
- },
581
- {
582
- variation: "b",
583
- range: [29997, 59994],
584
- },
585
- {
586
- variation: "c",
587
- range: [59994, 90000],
588
- },
589
- ],
590
- },
591
- ]);
592
- });
593
- it("should allocate against previous known allocation, increasing from 80% to 100%, with new added variation, totalling 4 variations", function () {
594
- const result = (0, traffic_1.getTraffic)(
595
- // parsed variations from YAML
596
- [
597
- {
598
- value: "a",
599
- weight: 25,
600
- },
601
- {
602
- value: "b",
603
- weight: 25,
604
- },
605
- {
606
- value: "c",
607
- weight: 25,
608
- },
609
- {
610
- value: "d",
611
- weight: 25,
612
- },
613
- ],
614
- // parsed rollouts from YAML
615
- [
616
- {
617
- key: "1",
618
- segments: "*",
619
- percentage: 100,
620
- },
621
- ],
622
- // existing feature from previous release
623
- {
624
- variations: [
625
- {
626
- value: "a",
627
- weight: 50,
628
- },
629
- {
630
- value: "b",
631
- weight: 50,
632
- },
633
- ],
634
- traffic: [
635
- {
636
- key: "1",
637
- percentage: 80000,
638
- allocation: [
639
- {
640
- variation: "a",
641
- range: [0, 40000],
642
- },
643
- {
644
- variation: "b",
645
- range: [40000, 80000],
646
- },
647
- ],
648
- },
649
- ],
650
- });
651
- expect(result).toEqual([
652
- {
653
- key: "1",
654
- segments: "*",
655
- percentage: 100000,
656
- allocation: [
657
- {
658
- variation: "a",
659
- range: [0, 25000],
660
- },
661
- {
662
- variation: "b",
663
- range: [25000, 50000],
664
- },
665
- {
666
- variation: "c",
667
- range: [50000, 75000],
668
- },
669
- {
670
- variation: "d",
671
- range: [75000, 100000],
672
- },
673
- ],
674
- },
675
- ]);
676
- });
677
- it("should allocate against previous known allocation, staying at same 100%, removing variations from 4 to 2", function () {
678
- const result = (0, traffic_1.getTraffic)(
679
- // parsed variations from YAML
680
- [
681
- {
682
- value: "a",
683
- weight: 50,
684
- },
685
- {
686
- value: "b",
687
- weight: 50,
688
- },
689
- ],
690
- // parsed rollouts from YAML
691
- [
692
- {
693
- key: "1",
694
- segments: "*",
695
- percentage: 100,
696
- },
697
- ],
698
- // existing feature from previous release
699
- {
700
- variations: [
701
- {
702
- value: "a",
703
- weight: 25,
704
- },
705
- {
706
- value: "b",
707
- weight: 25,
708
- },
709
- {
710
- value: "c",
711
- weight: 25,
712
- },
713
- {
714
- value: "d",
715
- weight: 25,
716
- },
717
- ],
718
- traffic: [
719
- {
720
- key: "1",
721
- percentage: 100000,
722
- allocation: [
723
- {
724
- variation: "a",
725
- range: [0, 25000],
726
- },
727
- {
728
- variation: "b",
729
- range: [25000, 50000],
730
- },
731
- {
732
- variation: "c",
733
- range: [50000, 75000],
734
- },
735
- {
736
- variation: "d",
737
- range: [75000, 100000],
738
- },
739
- ],
740
- },
741
- ],
742
- });
743
- expect(result).toEqual([
744
- {
745
- key: "1",
746
- segments: "*",
747
- percentage: 100000,
748
- allocation: [
749
- {
750
- variation: "a",
751
- range: [0, 50000],
752
- },
753
- {
754
- variation: "b",
755
- range: [50000, 100000],
756
- },
757
- ],
758
- },
759
- ]);
760
- });
761
- it("should allocate against previous known allocation, decreasing from 100% to 80%, removing variations from 4 to 2", function () {
762
- const result = (0, traffic_1.getTraffic)(
763
- // parsed variations from YAML
764
- [
765
- {
766
- value: "a",
767
- weight: 50,
768
- },
769
- {
770
- value: "b",
771
- weight: 50,
772
- },
773
- ],
774
- // parsed rollouts from YAML
775
- [
776
- {
777
- key: "1",
778
- segments: "*",
779
- percentage: 80,
780
- },
781
- ],
782
- // existing feature from previous release
783
- {
784
- variations: [
785
- {
786
- value: "a",
787
- weight: 25,
788
- },
789
- {
790
- value: "b",
791
- weight: 25,
792
- },
793
- {
794
- value: "c",
795
- weight: 25,
796
- },
797
- {
798
- value: "d",
799
- weight: 25,
800
- },
801
- ],
802
- traffic: [
803
- {
804
- key: "1",
805
- percentage: 100000,
806
- allocation: [
807
- {
808
- variation: "a",
809
- range: [0, 25000],
810
- },
811
- {
812
- variation: "b",
813
- range: [25000, 50000],
814
- },
815
- {
816
- variation: "c",
817
- range: [50000, 75000],
818
- },
819
- {
820
- variation: "d",
821
- range: [75000, 100000],
822
- },
823
- ],
824
- },
825
- ],
826
- });
827
- expect(result).toEqual([
828
- {
829
- key: "1",
830
- segments: "*",
831
- percentage: 80000,
832
- allocation: [
833
- {
834
- variation: "a",
835
- range: [0, 40000],
836
- },
837
- {
838
- variation: "b",
839
- range: [40000, 80000],
840
- },
841
- ],
842
- },
843
- ]);
844
- });
845
- it("should include variableOverrides from parsed rule in traffic", function () {
846
- const variableOverrides = {
847
- config: [
848
- {
849
- segments: "mobile",
850
- value: {
851
- "layout.width": 900,
852
- },
853
- },
854
- ],
855
- };
856
- const result = (0, traffic_1.getTraffic)([
857
- {
858
- value: "control",
859
- weight: 100,
860
- },
861
- ], [
862
- {
863
- key: "1",
864
- segments: "*",
865
- percentage: 100,
866
- variableOverrides,
867
- },
868
- ], undefined);
869
- expect(result[0].variableOverrides).toEqual(variableOverrides);
870
- });
871
- });
872
- //# sourceMappingURL=traffic.spec.js.map