@featurevisor/core 0.52.0 → 0.53.0

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 (63) hide show
  1. package/.eslintcache +1 -1
  2. package/CHANGELOG.md +19 -0
  3. package/coverage/clover.xml +2 -2
  4. package/coverage/lcov-report/index.html +1 -1
  5. package/coverage/lcov-report/lib/builder/allocator.js.html +1 -1
  6. package/coverage/lcov-report/lib/builder/index.html +1 -1
  7. package/coverage/lcov-report/lib/builder/traffic.js.html +1 -1
  8. package/coverage/lcov-report/src/builder/allocator.ts.html +1 -1
  9. package/coverage/lcov-report/src/builder/index.html +1 -1
  10. package/coverage/lcov-report/src/builder/traffic.ts.html +1 -1
  11. package/lib/find-duplicate-segments/findDuplicateSegments.d.ts +3 -0
  12. package/lib/find-duplicate-segments/findDuplicateSegments.js +27 -0
  13. package/lib/find-duplicate-segments/findDuplicateSegments.js.map +1 -0
  14. package/lib/find-duplicate-segments/index.d.ts +2 -0
  15. package/lib/find-duplicate-segments/index.js +19 -0
  16. package/lib/find-duplicate-segments/index.js.map +1 -0
  17. package/lib/index.d.ts +1 -0
  18. package/lib/index.js +1 -0
  19. package/lib/index.js.map +1 -1
  20. package/lib/site/exportSite.d.ts +2 -0
  21. package/lib/site/exportSite.js +34 -0
  22. package/lib/site/exportSite.js.map +1 -0
  23. package/lib/site/generateHistory.d.ts +3 -0
  24. package/lib/site/generateHistory.js +76 -0
  25. package/lib/site/generateHistory.js.map +1 -0
  26. package/lib/site/generateSiteSearchIndex.d.ts +4 -0
  27. package/lib/site/generateSiteSearchIndex.js +141 -0
  28. package/lib/site/generateSiteSearchIndex.js.map +1 -0
  29. package/lib/site/getLastModifiedFromHistory.d.ts +2 -0
  30. package/lib/site/getLastModifiedFromHistory.js +19 -0
  31. package/lib/site/getLastModifiedFromHistory.js.map +1 -0
  32. package/lib/site/getOwnerAndRepoFromUrl.d.ts +4 -0
  33. package/lib/site/getOwnerAndRepoFromUrl.js +21 -0
  34. package/lib/site/getOwnerAndRepoFromUrl.js.map +1 -0
  35. package/lib/site/getRelativePaths.d.ts +6 -0
  36. package/lib/site/getRelativePaths.js +16 -0
  37. package/lib/site/getRelativePaths.js.map +1 -0
  38. package/lib/site/getRepoDetails.d.ts +8 -0
  39. package/lib/site/getRepoDetails.js +49 -0
  40. package/lib/site/getRepoDetails.js.map +1 -0
  41. package/lib/site/index.d.ts +2 -0
  42. package/lib/site/index.js +19 -0
  43. package/lib/site/index.js.map +1 -0
  44. package/lib/site/serveSite.d.ts +2 -0
  45. package/lib/site/serveSite.js +55 -0
  46. package/lib/site/serveSite.js.map +1 -0
  47. package/package.json +5 -5
  48. package/src/find-duplicate-segments/findDuplicateSegments.ts +33 -0
  49. package/src/find-duplicate-segments/index.ts +21 -0
  50. package/src/index.ts +1 -0
  51. package/src/site/exportSite.ts +53 -0
  52. package/src/site/generateHistory.ts +101 -0
  53. package/src/site/generateSiteSearchIndex.ts +203 -0
  54. package/src/site/getLastModifiedFromHistory.ts +21 -0
  55. package/src/site/getOwnerAndRepoFromUrl.ts +17 -0
  56. package/src/site/getRelativePaths.ts +24 -0
  57. package/src/site/getRepoDetails.ts +62 -0
  58. package/src/site/index.ts +2 -0
  59. package/src/site/serveSite.ts +60 -0
  60. package/lib/site.d.ts +0 -16
  61. package/lib/site.js +0 -368
  62. package/lib/site.js.map +0 -1
  63. package/src/site.ts +0 -515
package/.eslintcache CHANGED
@@ -1 +1 @@
1
- [{"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.spec.ts":"1","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.ts":"2","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildDatafile.ts":"3","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildProject.ts":"4","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/getFeatureRanges.ts":"5","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/index.ts":"6","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.spec.ts":"7","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.ts":"8","/home/runner/work/featurevisor/featurevisor/packages/core/src/config.ts":"9","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts":"10","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts":"11","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/parsers.ts":"12","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/index.ts":"13","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/typescript.ts":"14","/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts":"15","/home/runner/work/featurevisor/featurevisor/packages/core/src/init.ts":"16","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/attributeSchema.ts":"17","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkCircularDependency.ts":"18","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/conditionSchema.ts":"19","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/featureSchema.ts":"20","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/groupSchema.ts":"21","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/index.ts":"22","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/lintProject.ts":"23","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/printJoiError.ts":"24","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/segmentSchema.ts":"25","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/testSchema.ts":"26","/home/runner/work/featurevisor/featurevisor/packages/core/src/restore.ts":"27","/home/runner/work/featurevisor/featurevisor/packages/core/src/site.ts":"28","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester.ts":"29","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils.ts":"30"},{"size":3214,"mtime":1697119636636,"results":"31","hashOfConfig":"32"},{"size":1014,"mtime":1697119636636,"results":"33","hashOfConfig":"32"},{"size":8223,"mtime":1697119636636,"results":"34","hashOfConfig":"32"},{"size":2854,"mtime":1697119636640,"results":"35","hashOfConfig":"32"},{"size":1728,"mtime":1697119636640,"results":"36","hashOfConfig":"32"},{"size":65,"mtime":1697119636640,"results":"37","hashOfConfig":"32"},{"size":12889,"mtime":1697119636640,"results":"38","hashOfConfig":"32"},{"size":4799,"mtime":1697119636640,"results":"39","hashOfConfig":"32"},{"size":2966,"mtime":1697119636640,"results":"40","hashOfConfig":"32"},{"size":5523,"mtime":1697119636640,"results":"41","hashOfConfig":"32"},{"size":57,"mtime":1697119636640,"results":"42","hashOfConfig":"32"},{"size":646,"mtime":1697119636640,"results":"43","hashOfConfig":"32"},{"size":1619,"mtime":1697119636640,"results":"44","hashOfConfig":"32"},{"size":5875,"mtime":1697119636640,"results":"45","hashOfConfig":"32"},{"size":213,"mtime":1697119636640,"results":"46","hashOfConfig":"32"},{"size":1308,"mtime":1697119636640,"results":"47","hashOfConfig":"32"},{"size":341,"mtime":1697119636640,"results":"48","hashOfConfig":"32"},{"size":1106,"mtime":1697119636640,"results":"49","hashOfConfig":"32"},{"size":3003,"mtime":1697119636640,"results":"50","hashOfConfig":"32"},{"size":5782,"mtime":1697119636640,"results":"51","hashOfConfig":"32"},{"size":2092,"mtime":1697119636640,"results":"52","hashOfConfig":"32"},{"size":31,"mtime":1697119636640,"results":"53","hashOfConfig":"32"},{"size":4594,"mtime":1697119636640,"results":"54","hashOfConfig":"32"},{"size":323,"mtime":1697119636640,"results":"55","hashOfConfig":"32"},{"size":368,"mtime":1697119636640,"results":"56","hashOfConfig":"32"},{"size":1248,"mtime":1697119636640,"results":"57","hashOfConfig":"32"},{"size":604,"mtime":1697119636640,"results":"58","hashOfConfig":"32"},{"size":14669,"mtime":1697119636640,"results":"59","hashOfConfig":"32"},{"size":6412,"mtime":1697119636640,"results":"60","hashOfConfig":"32"},{"size":2108,"mtime":1697119636640,"results":"61","hashOfConfig":"32"},{"filePath":"62","messages":"63","suppressedMessages":"64","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"u5hm5o",{"filePath":"65","messages":"66","suppressedMessages":"67","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","suppressedMessages":"70","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","suppressedMessages":"73","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","suppressedMessages":"106","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"107","messages":"108","suppressedMessages":"109","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","suppressedMessages":"112","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","suppressedMessages":"115","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","suppressedMessages":"118","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","suppressedMessages":"121","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","suppressedMessages":"124","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"125","messages":"126","suppressedMessages":"127","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","suppressedMessages":"130","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"131","messages":"132","suppressedMessages":"133","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","suppressedMessages":"136","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"137","messages":"138","suppressedMessages":"139","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","suppressedMessages":"142","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"143","messages":"144","suppressedMessages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","suppressedMessages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"149","messages":"150","suppressedMessages":"151","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildDatafile.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildProject.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/getFeatureRanges.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/config.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/parsers.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/typescript.ts",[],["152"],"/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/init.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/attributeSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkCircularDependency.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/conditionSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/featureSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/groupSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/lintProject.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/printJoiError.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/segmentSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/testSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/restore.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils.ts",[],[],{"ruleId":"153","severity":2,"message":"154","line":41,"column":10,"nodeType":"155","messageId":"156","endLine":41,"endColumn":38,"suppressions":"157"},"@typescript-eslint/no-unused-vars","'getFeaturevisorTypeFromValue' is defined but never used.","Identifier","unusedVar",["158"],{"kind":"159","justification":"160"},"directive",""]
1
+ [{"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.spec.ts":"1","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.ts":"2","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildDatafile.ts":"3","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildProject.ts":"4","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/getFeatureRanges.ts":"5","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/index.ts":"6","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.spec.ts":"7","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.ts":"8","/home/runner/work/featurevisor/featurevisor/packages/core/src/config.ts":"9","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts":"10","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts":"11","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/parsers.ts":"12","/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/findDuplicateSegments.ts":"13","/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/index.ts":"14","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/index.ts":"15","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/typescript.ts":"16","/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts":"17","/home/runner/work/featurevisor/featurevisor/packages/core/src/init.ts":"18","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/attributeSchema.ts":"19","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkCircularDependency.ts":"20","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/conditionSchema.ts":"21","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/featureSchema.ts":"22","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/groupSchema.ts":"23","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/index.ts":"24","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/lintProject.ts":"25","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/printJoiError.ts":"26","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/segmentSchema.ts":"27","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/testSchema.ts":"28","/home/runner/work/featurevisor/featurevisor/packages/core/src/restore.ts":"29","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/exportSite.ts":"30","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateHistory.ts":"31","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateSiteSearchIndex.ts":"32","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getLastModifiedFromHistory.ts":"33","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getOwnerAndRepoFromUrl.ts":"34","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRelativePaths.ts":"35","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRepoDetails.ts":"36","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/index.ts":"37","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/serveSite.ts":"38","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester.ts":"39","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils.ts":"40"},{"size":3214,"mtime":1697226266839,"results":"41","hashOfConfig":"42"},{"size":1014,"mtime":1697226266839,"results":"43","hashOfConfig":"42"},{"size":8223,"mtime":1697226266839,"results":"44","hashOfConfig":"42"},{"size":2854,"mtime":1697226266839,"results":"45","hashOfConfig":"42"},{"size":1728,"mtime":1697226266839,"results":"46","hashOfConfig":"42"},{"size":65,"mtime":1697226266839,"results":"47","hashOfConfig":"42"},{"size":12889,"mtime":1697226266839,"results":"48","hashOfConfig":"42"},{"size":4799,"mtime":1697226266839,"results":"49","hashOfConfig":"42"},{"size":2966,"mtime":1697226266839,"results":"50","hashOfConfig":"42"},{"size":5523,"mtime":1697226266839,"results":"51","hashOfConfig":"42"},{"size":57,"mtime":1697226266839,"results":"52","hashOfConfig":"42"},{"size":646,"mtime":1697226266839,"results":"53","hashOfConfig":"42"},{"size":906,"mtime":1697226266839,"results":"54","hashOfConfig":"42"},{"size":618,"mtime":1697226266839,"results":"55","hashOfConfig":"42"},{"size":1619,"mtime":1697226266839,"results":"56","hashOfConfig":"42"},{"size":5875,"mtime":1697226266839,"results":"57","hashOfConfig":"42"},{"size":256,"mtime":1697226266839,"results":"58","hashOfConfig":"42"},{"size":1308,"mtime":1697226266839,"results":"59","hashOfConfig":"42"},{"size":341,"mtime":1697226266839,"results":"60","hashOfConfig":"42"},{"size":1106,"mtime":1697226266839,"results":"61","hashOfConfig":"42"},{"size":3003,"mtime":1697226266839,"results":"62","hashOfConfig":"42"},{"size":5782,"mtime":1697226266839,"results":"63","hashOfConfig":"42"},{"size":2092,"mtime":1697226266839,"results":"64","hashOfConfig":"42"},{"size":31,"mtime":1697226266839,"results":"65","hashOfConfig":"42"},{"size":4594,"mtime":1697226266839,"results":"66","hashOfConfig":"42"},{"size":323,"mtime":1697226266839,"results":"67","hashOfConfig":"42"},{"size":368,"mtime":1697226266839,"results":"68","hashOfConfig":"42"},{"size":1248,"mtime":1697226266839,"results":"69","hashOfConfig":"42"},{"size":604,"mtime":1697226266839,"results":"70","hashOfConfig":"42"},{"size":1740,"mtime":1697226266839,"results":"71","hashOfConfig":"42"},{"size":2808,"mtime":1697226266839,"results":"72","hashOfConfig":"42"},{"size":6199,"mtime":1697226266839,"results":"73","hashOfConfig":"42"},{"size":516,"mtime":1697226266839,"results":"74","hashOfConfig":"42"},{"size":496,"mtime":1697226266839,"results":"75","hashOfConfig":"42"},{"size":607,"mtime":1697226266839,"results":"76","hashOfConfig":"42"},{"size":1560,"mtime":1697226266839,"results":"77","hashOfConfig":"42"},{"size":59,"mtime":1697226266839,"results":"78","hashOfConfig":"42"},{"size":1697,"mtime":1697226266839,"results":"79","hashOfConfig":"42"},{"size":6412,"mtime":1697226266839,"results":"80","hashOfConfig":"42"},{"size":2108,"mtime":1697226266839,"results":"81","hashOfConfig":"42"},{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"u5hm5o",{"filePath":"85","messages":"86","suppressedMessages":"87","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","suppressedMessages":"90","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"91","messages":"92","suppressedMessages":"93","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","suppressedMessages":"96","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","suppressedMessages":"99","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","suppressedMessages":"102","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"103","messages":"104","suppressedMessages":"105","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","suppressedMessages":"108","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"109","messages":"110","suppressedMessages":"111","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","suppressedMessages":"114","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"115","messages":"116","suppressedMessages":"117","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","suppressedMessages":"120","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"121","messages":"122","suppressedMessages":"123","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","suppressedMessages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"127","messages":"128","suppressedMessages":"129","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","suppressedMessages":"132","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"133","messages":"134","suppressedMessages":"135","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","suppressedMessages":"138","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"139","messages":"140","suppressedMessages":"141","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","suppressedMessages":"144","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"145","messages":"146","suppressedMessages":"147","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","suppressedMessages":"150","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"151","messages":"152","suppressedMessages":"153","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","suppressedMessages":"156","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"157","messages":"158","suppressedMessages":"159","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"160","messages":"161","suppressedMessages":"162","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"163","messages":"164","suppressedMessages":"165","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"166","messages":"167","suppressedMessages":"168","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"169","messages":"170","suppressedMessages":"171","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"172","messages":"173","suppressedMessages":"174","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"175","messages":"176","suppressedMessages":"177","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"178","messages":"179","suppressedMessages":"180","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"181","messages":"182","suppressedMessages":"183","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"184","messages":"185","suppressedMessages":"186","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"187","messages":"188","suppressedMessages":"189","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"190","messages":"191","suppressedMessages":"192","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"193","messages":"194","suppressedMessages":"195","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"196","messages":"197","suppressedMessages":"198","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"199","messages":"200","suppressedMessages":"201","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/allocator.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildDatafile.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/buildProject.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/getFeatureRanges.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/config.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/parsers.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/findDuplicateSegments.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/typescript.ts",[],["202"],"/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/init.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/attributeSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkCircularDependency.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/conditionSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/featureSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/groupSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/lintProject.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/printJoiError.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/segmentSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/testSchema.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/restore.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/exportSite.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateHistory.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateSiteSearchIndex.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getLastModifiedFromHistory.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getOwnerAndRepoFromUrl.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRelativePaths.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRepoDetails.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/site/serveSite.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils.ts",[],[],{"ruleId":"203","severity":2,"message":"204","line":41,"column":10,"nodeType":"205","messageId":"206","endLine":41,"endColumn":38,"suppressions":"207"},"@typescript-eslint/no-unused-vars","'getFeaturevisorTypeFromValue' is defined but never used.","Identifier","unusedVar",["208"],{"kind":"209","justification":"210"},"directive",""]
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.53.0](https://github.com/featurevisor/featurevisor/compare/v0.52.1...v0.53.0) (2023-10-13)
7
+
8
+
9
+ ### Features
10
+
11
+ * find duplicate segments from CLI ([#172](https://github.com/featurevisor/featurevisor/issues/172)) ([ac7fa9f](https://github.com/featurevisor/featurevisor/commit/ac7fa9fa66350c82d2f8208364563fa67d309e85))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.52.1](https://github.com/featurevisor/featurevisor/compare/v0.52.0...v0.52.1) (2023-10-12)
18
+
19
+ **Note:** Version bump only for package @featurevisor/core
20
+
21
+
22
+
23
+
24
+
6
25
  # [0.52.0](https://github.com/featurevisor/featurevisor/compare/v0.51.2...v0.52.0) (2023-10-12)
7
26
 
8
27
 
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1697119827269" clover="3.2.0">
3
- <project timestamp="1697119827269" name="All files">
2
+ <coverage generated="1697226483832" clover="3.2.0">
3
+ <project timestamp="1697226483833" name="All files">
4
4
  <metrics statements="173" coveredstatements="165" conditionals="86" coveredconditionals="70" methods="28" coveredmethods="28" elements="287" coveredelements="263" complexity="0" loc="173" ncloc="173" packages="2" files="4" classes="4"/>
5
5
  <package name="lib.builder">
6
6
  <metrics statements="90" coveredstatements="86" conditionals="48" coveredconditionals="39" methods="14" coveredmethods="14"/>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2023-10-12T14:10:27.247Z
119
+ at 2023-10-13T19:48:03.812Z
120
120
  </div>
121
121
  <script src="prettify.js"></script>
122
122
  <script>
@@ -175,7 +175,7 @@ exports.getUpdatedAvailableRangesAfterFilling = getUpdatedAvailableRangesAfterFi
175
175
  <div class='footer quiet pad2 space-top1 center small'>
176
176
  Code coverage generated by
177
177
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
178
- at 2023-10-12T14:10:27.247Z
178
+ at 2023-10-13T19:48:03.812Z
179
179
  </div>
180
180
  <script src="../../prettify.js"></script>
181
181
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2023-10-12T14:10:27.247Z
119
+ at 2023-10-13T19:48:03.812Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -442,7 +442,7 @@ exports.getTraffic = getTraffic;
442
442
  <div class='footer quiet pad2 space-top1 center small'>
443
443
  Code coverage generated by
444
444
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
445
- at 2023-10-12T14:10:27.247Z
445
+ at 2023-10-13T19:48:03.812Z
446
446
  </div>
447
447
  <script src="../../prettify.js"></script>
448
448
  <script>
@@ -193,7 +193,7 @@ export function getUpdatedAvailableRangesAfterFilling(
193
193
  <div class='footer quiet pad2 space-top1 center small'>
194
194
  Code coverage generated by
195
195
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
196
- at 2023-10-12T14:10:27.247Z
196
+ at 2023-10-13T19:48:03.812Z
197
197
  </div>
198
198
  <script src="../../prettify.js"></script>
199
199
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2023-10-12T14:10:27.247Z
119
+ at 2023-10-13T19:48:03.812Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -553,7 +553,7 @@ export function getTraffic(
553
553
  <div class='footer quiet pad2 space-top1 center small'>
554
554
  Code coverage generated by
555
555
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
556
- at 2023-10-12T14:10:27.247Z
556
+ at 2023-10-13T19:48:03.812Z
557
557
  </div>
558
558
  <script src="../../prettify.js"></script>
559
559
  <script>
@@ -0,0 +1,3 @@
1
+ import { SegmentKey } from "@featurevisor/types";
2
+ import { Datasource } from "../datasource";
3
+ export declare function findDuplicateSegments(datasource: Datasource): SegmentKey[][];
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findDuplicateSegments = void 0;
4
+ var crypto = require("crypto");
5
+ function findDuplicateSegments(datasource) {
6
+ var segmentsWithHash = datasource.listSegments().map(function (segmentKey) {
7
+ var segment = datasource.readSegment(segmentKey);
8
+ var conditions = JSON.stringify(segment.conditions);
9
+ var hash = crypto.createHash("sha256").update(conditions).digest("hex");
10
+ return {
11
+ segmentKey: segmentKey,
12
+ hash: hash,
13
+ };
14
+ });
15
+ var groupedSegments = segmentsWithHash.reduce(function (acc, _a) {
16
+ var segmentKey = _a.segmentKey, hash = _a.hash;
17
+ if (!acc[hash]) {
18
+ acc[hash] = [];
19
+ }
20
+ acc[hash].push(segmentKey);
21
+ return acc;
22
+ }, {});
23
+ var result = Object.values(groupedSegments).filter(function (segmentKeys) { return segmentKeys.length > 1; });
24
+ return result;
25
+ }
26
+ exports.findDuplicateSegments = findDuplicateSegments;
27
+ //# sourceMappingURL=findDuplicateSegments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findDuplicateSegments.js","sourceRoot":"","sources":["../../src/find-duplicate-segments/findDuplicateSegments.ts"],"names":[],"mappings":";;;AAAA,+BAAiC;AAMjC,SAAgB,qBAAqB,CAAC,UAAsB;IAC1D,IAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,UAAC,UAAU;QAChE,IAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACnD,IAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACtD,IAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE1E,OAAO;YACL,UAAU,YAAA;YACV,IAAI,MAAA;SACL,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAM,eAAe,GAAqC,gBAAgB,CAAC,MAAM,CAC/E,UAAC,GAAG,EAAE,EAAoB;YAAlB,UAAU,gBAAA,EAAE,IAAI,UAAA;QACtB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACd,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SAChB;QACD,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3B,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;IAEF,IAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,UAAC,WAAW,IAAK,OAAA,WAAW,CAAC,MAAM,GAAG,CAAC,EAAtB,CAAsB,CAAC,CAAC;IAE9F,OAAO,MAAM,CAAC;AAChB,CAAC;AA1BD,sDA0BC"}
@@ -0,0 +1,2 @@
1
+ import { ProjectConfig } from "../config";
2
+ export declare function findDuplicateSegmentsInProject(rootDirectoryPath: any, projectConfig: ProjectConfig): void;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findDuplicateSegmentsInProject = void 0;
4
+ var datasource_1 = require("../datasource");
5
+ var findDuplicateSegments_1 = require("./findDuplicateSegments");
6
+ function findDuplicateSegmentsInProject(rootDirectoryPath, projectConfig) {
7
+ var datasource = new datasource_1.Datasource(projectConfig);
8
+ var duplicates = (0, findDuplicateSegments_1.findDuplicateSegments)(datasource);
9
+ if (duplicates.length === 0) {
10
+ console.log("No duplicate segments found");
11
+ return;
12
+ }
13
+ console.log("Found ".concat(duplicates.length, " duplicates:\n"));
14
+ duplicates.forEach(function (segmentKeys) {
15
+ console.log(" - ".concat(segmentKeys.join(", ")));
16
+ });
17
+ }
18
+ exports.findDuplicateSegmentsInProject = findDuplicateSegmentsInProject;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/find-duplicate-segments/index.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAG3C,iEAAgE;AAEhE,SAAgB,8BAA8B,CAAC,iBAAiB,EAAE,aAA4B;IAC5F,IAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,aAAa,CAAC,CAAC;IAEjD,IAAM,UAAU,GAAG,IAAA,6CAAqB,EAAC,UAAU,CAAC,CAAC;IAErD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO;KACR;IAED,OAAO,CAAC,GAAG,CAAC,gBAAS,UAAU,CAAC,MAAM,mBAAgB,CAAC,CAAC;IAExD,UAAU,CAAC,OAAO,CAAC,UAAC,WAAW;QAC7B,OAAO,CAAC,GAAG,CAAC,cAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC;AAfD,wEAeC"}
package/lib/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from "./init";
6
6
  export * from "./site";
7
7
  export * from "./generate-code";
8
8
  export * from "./restore";
9
+ export * from "./find-duplicate-segments";
package/lib/index.js CHANGED
@@ -22,4 +22,5 @@ __exportStar(require("./init"), exports);
22
22
  __exportStar(require("./site"), exports);
23
23
  __exportStar(require("./generate-code"), exports);
24
24
  __exportStar(require("./restore"), exports);
25
+ __exportStar(require("./find-duplicate-segments"), exports);
25
26
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B;AAC1B,4DAA0C"}
@@ -0,0 +1,2 @@
1
+ import { ProjectConfig } from "../config";
2
+ export declare function exportSite(rootDirectoryPath: string, projectConfig: ProjectConfig): boolean;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exportSite = void 0;
4
+ var fs = require("fs");
5
+ var path = require("path");
6
+ var mkdirp = require("mkdirp");
7
+ var generateHistory_1 = require("./generateHistory");
8
+ var getRepoDetails_1 = require("./getRepoDetails");
9
+ var generateSiteSearchIndex_1 = require("./generateSiteSearchIndex");
10
+ function exportSite(rootDirectoryPath, projectConfig) {
11
+ var hasError = false;
12
+ mkdirp.sync(projectConfig.siteExportDirectoryPath);
13
+ var sitePackagePath = path.dirname(require.resolve("@featurevisor/site/package.json"));
14
+ // copy site dist
15
+ var siteDistPath = path.join(sitePackagePath, "dist");
16
+ fs.cpSync(siteDistPath, projectConfig.siteExportDirectoryPath, { recursive: true });
17
+ var sitePublicPath = path.join(sitePackagePath, "public");
18
+ fs.cpSync(sitePublicPath, projectConfig.siteExportDirectoryPath, { recursive: true });
19
+ console.log("Site dist copied to:", projectConfig.siteExportDirectoryPath);
20
+ // generate history
21
+ var fullHistory = (0, generateHistory_1.generateHistory)(rootDirectoryPath, projectConfig);
22
+ // site search index
23
+ var repoDetails = (0, getRepoDetails_1.getRepoDetails)();
24
+ var searchIndex = (0, generateSiteSearchIndex_1.generateSiteSearchIndex)(rootDirectoryPath, projectConfig, fullHistory, repoDetails);
25
+ var searchIndexFilePath = path.join(projectConfig.siteExportDirectoryPath, "search-index.json");
26
+ fs.writeFileSync(searchIndexFilePath, JSON.stringify(searchIndex));
27
+ console.log("Site search index written at: ".concat(searchIndexFilePath));
28
+ // copy datafiles
29
+ fs.cpSync(projectConfig.outputDirectoryPath, path.join(projectConfig.siteExportDirectoryPath, "datafiles"), { recursive: true });
30
+ // @TODO: replace placeoholders in index.html
31
+ return hasError;
32
+ }
33
+ exports.exportSite = exportSite;
34
+ //# sourceMappingURL=exportSite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exportSite.js","sourceRoot":"","sources":["../../src/site/exportSite.ts"],"names":[],"mappings":";;;AAAA,uBAAyB;AACzB,2BAA6B;AAE7B,+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CAAC,GAAG,CAAC,wCAAiC,mBAAmB,CAAE,CAAC,CAAC;IAEpE,iBAAiB;IACjB,EAAE,CAAC,MAAM,CACP,aAAa,CAAC,mBAAmB,EACjC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,uBAAuB,EAAE,WAAW,CAAC,EAC7D,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;IAEF,6CAA6C;IAE7C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAzCD,gCAyCC"}
@@ -0,0 +1,3 @@
1
+ import { HistoryEntry } from "@featurevisor/types";
2
+ import { ProjectConfig } from "../config";
3
+ export declare function generateHistory(rootDirectoryPath: any, projectConfig: ProjectConfig): HistoryEntry[];
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateHistory = void 0;
4
+ var path = require("path");
5
+ var fs = require("fs");
6
+ var child_process_1 = require("child_process");
7
+ var getRelativePaths_1 = require("./getRelativePaths");
8
+ function generateHistory(rootDirectoryPath, projectConfig) {
9
+ try {
10
+ // raw history
11
+ var rawHistoryFilePath = path.join(projectConfig.siteExportDirectoryPath, "history-raw.txt");
12
+ var _a = (0, getRelativePaths_1.getRelativePaths)(rootDirectoryPath, projectConfig), relativeFeaturesPath = _a.relativeFeaturesPath, relativeSegmentsPath_1 = _a.relativeSegmentsPath, relativeAttributesPath_1 = _a.relativeAttributesPath;
13
+ var separator_1 = "|";
14
+ var cmd = "git log --name-only --pretty=format:\"%h".concat(separator_1, "%an").concat(separator_1, "%aI\" --no-merges --relative -- ").concat(relativeFeaturesPath, " ").concat(relativeSegmentsPath_1, " ").concat(relativeAttributesPath_1, " > ").concat(rawHistoryFilePath);
15
+ (0, child_process_1.execSync)(cmd);
16
+ console.log("History (raw) generated at: ".concat(rawHistoryFilePath));
17
+ // structured history
18
+ var rawHistory = fs.readFileSync(rawHistoryFilePath, "utf8");
19
+ var fullHistory_1 = [];
20
+ var entry_1 = {
21
+ commit: "",
22
+ author: "",
23
+ timestamp: "",
24
+ entities: [],
25
+ };
26
+ rawHistory.split("\n").forEach(function (line, index) {
27
+ if (index === 0 && line.length === 0) {
28
+ // no history found
29
+ return;
30
+ }
31
+ if (index > 0 && line.length === 0) {
32
+ // commit finished
33
+ fullHistory_1.push(entry_1);
34
+ return;
35
+ }
36
+ if (line.indexOf(separator_1) > -1) {
37
+ // commit line
38
+ var parts = line.split("|");
39
+ entry_1 = {
40
+ commit: parts[0],
41
+ author: parts[1],
42
+ timestamp: parts[2],
43
+ entities: [],
44
+ };
45
+ }
46
+ else {
47
+ // file line
48
+ var lineSplit = line.split(path.sep);
49
+ var fileName = lineSplit.pop();
50
+ var relativeDir = lineSplit.join(path.sep);
51
+ var key = fileName.replace("." + projectConfig.parser, "");
52
+ var type = "feature";
53
+ if (relativeDir === relativeSegmentsPath_1) {
54
+ type = "segment";
55
+ }
56
+ else if (relativeDir === relativeAttributesPath_1) {
57
+ type = "attribute";
58
+ }
59
+ entry_1.entities.push({
60
+ type: type,
61
+ key: key,
62
+ });
63
+ }
64
+ });
65
+ var fullHistoryFilePath = path.join(projectConfig.siteExportDirectoryPath, "history-full.json");
66
+ fs.writeFileSync(fullHistoryFilePath, JSON.stringify(fullHistory_1));
67
+ console.log("History (full) generated at: ".concat(fullHistoryFilePath));
68
+ return fullHistory_1;
69
+ }
70
+ catch (error) {
71
+ console.error("Error when generating history from git: ".concat(error.status, "\n").concat(error.stderr.toString()));
72
+ return [];
73
+ }
74
+ }
75
+ exports.generateHistory = generateHistory;
76
+ //# sourceMappingURL=generateHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateHistory.js","sourceRoot":"","sources":["../../src/site/generateHistory.ts"],"names":[],"mappings":";;;AAAA,2BAA6B;AAC7B,uBAAyB;AACzB,+CAAyC;AAMzC,uDAAsD;AAEtD,SAAgB,eAAe,CAAC,iBAAiB,EAAE,aAA4B;IAC7E,IAAI;QACF,cAAc;QACd,IAAM,kBAAkB,GAAG,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AM,eAAK,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAE,CACtF,CAAC;QAEF,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AA1FD,0CA0FC"}
@@ -0,0 +1,4 @@
1
+ import { HistoryEntry, SearchIndex } from "@featurevisor/types";
2
+ import { ProjectConfig } from "../config";
3
+ import { RepoDetails } from "./getRepoDetails";
4
+ export declare function generateSiteSearchIndex(rootDirectoryPath: string, projectConfig: ProjectConfig, fullHistory: HistoryEntry[], repoDetails: RepoDetails | undefined): SearchIndex;
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.generateSiteSearchIndex = void 0;
15
+ var datasource_1 = require("../datasource");
16
+ var utils_1 = require("../utils");
17
+ var getRelativePaths_1 = require("./getRelativePaths");
18
+ var getLastModifiedFromHistory_1 = require("./getLastModifiedFromHistory");
19
+ function generateSiteSearchIndex(rootDirectoryPath, projectConfig, fullHistory, repoDetails) {
20
+ var result = {
21
+ links: undefined,
22
+ entities: {
23
+ attributes: [],
24
+ segments: [],
25
+ features: [],
26
+ },
27
+ };
28
+ var datasource = new datasource_1.Datasource(projectConfig);
29
+ /**
30
+ * Links
31
+ */
32
+ if (repoDetails) {
33
+ var _a = (0, getRelativePaths_1.getRelativePaths)(rootDirectoryPath, projectConfig), relativeAttributesPath = _a.relativeAttributesPath, relativeSegmentsPath = _a.relativeSegmentsPath, relativeFeaturesPath = _a.relativeFeaturesPath;
34
+ var prefix = "";
35
+ if (repoDetails.topLevelPath !== rootDirectoryPath) {
36
+ prefix = rootDirectoryPath.replace(repoDetails.topLevelPath + "/", "") + "/";
37
+ }
38
+ result.links = {
39
+ attribute: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeAttributesPath + "/{{key}}." + datasource.getExtension()),
40
+ segment: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeSegmentsPath + "/{{key}}." + datasource.getExtension()),
41
+ feature: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeFeaturesPath + "/{{key}}." + datasource.getExtension()),
42
+ commit: repoDetails.commitUrl,
43
+ };
44
+ }
45
+ /**
46
+ * Entities
47
+ */
48
+ // usage
49
+ var attributesUsedInFeatures = {};
50
+ var attributesUsedInSegments = {};
51
+ var segmentsUsedInFeatures = {};
52
+ // features
53
+ var featureFiles = datasource.listFeatures();
54
+ featureFiles.forEach(function (entityName) {
55
+ var parsed = datasource.readFeature(entityName);
56
+ if (Array.isArray(parsed.variations)) {
57
+ parsed.variations.forEach(function (variation) {
58
+ if (!variation.variables) {
59
+ return;
60
+ }
61
+ variation.variables.forEach(function (v) {
62
+ if (v.overrides) {
63
+ v.overrides.forEach(function (o) {
64
+ if (o.conditions) {
65
+ (0, utils_1.extractAttributeKeysFromConditions)(o.conditions).forEach(function (attributeKey) {
66
+ if (!attributesUsedInFeatures[attributeKey]) {
67
+ attributesUsedInFeatures[attributeKey] = new Set();
68
+ }
69
+ attributesUsedInFeatures[attributeKey].add(entityName);
70
+ });
71
+ }
72
+ if (o.segments && o.segments !== "*") {
73
+ (0, utils_1.extractSegmentKeysFromGroupSegments)(o.segments).forEach(function (segmentKey) {
74
+ if (!segmentsUsedInFeatures[segmentKey]) {
75
+ segmentsUsedInFeatures[segmentKey] = new Set();
76
+ }
77
+ segmentsUsedInFeatures[segmentKey].add(entityName);
78
+ });
79
+ }
80
+ });
81
+ }
82
+ });
83
+ });
84
+ }
85
+ Object.keys(parsed.environments).forEach(function (environmentKey) {
86
+ var env = parsed.environments[environmentKey];
87
+ env.rules.forEach(function (rule) {
88
+ if (rule.segments && rule.segments !== "*") {
89
+ (0, utils_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach(function (segmentKey) {
90
+ if (!segmentsUsedInFeatures[segmentKey]) {
91
+ segmentsUsedInFeatures[segmentKey] = new Set();
92
+ }
93
+ segmentsUsedInFeatures[segmentKey].add(entityName);
94
+ });
95
+ }
96
+ });
97
+ if (env.force) {
98
+ env.force.forEach(function (force) {
99
+ if (force.segments && force.segments !== "*") {
100
+ (0, utils_1.extractSegmentKeysFromGroupSegments)(force.segments).forEach(function (segmentKey) {
101
+ if (!segmentsUsedInFeatures[segmentKey]) {
102
+ segmentsUsedInFeatures[segmentKey] = new Set();
103
+ }
104
+ segmentsUsedInFeatures[segmentKey].add(entityName);
105
+ });
106
+ }
107
+ if (force.conditions) {
108
+ (0, utils_1.extractAttributeKeysFromConditions)(force.conditions).forEach(function (attributeKey) {
109
+ if (!attributesUsedInFeatures[attributeKey]) {
110
+ attributesUsedInFeatures[attributeKey] = new Set();
111
+ }
112
+ attributesUsedInFeatures[attributeKey].add(entityName);
113
+ });
114
+ }
115
+ });
116
+ }
117
+ });
118
+ result.entities.features.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "feature", entityName) }));
119
+ });
120
+ // segments
121
+ var segmentFiles = datasource.listSegments();
122
+ segmentFiles.forEach(function (entityName) {
123
+ var parsed = datasource.readSegment(entityName);
124
+ (0, utils_1.extractAttributeKeysFromConditions)(parsed.conditions).forEach(function (attributeKey) {
125
+ if (!attributesUsedInSegments[attributeKey]) {
126
+ attributesUsedInSegments[attributeKey] = new Set();
127
+ }
128
+ attributesUsedInSegments[attributeKey].add(entityName);
129
+ });
130
+ result.entities.segments.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "segment", entityName), usedInFeatures: Array.from(segmentsUsedInFeatures[entityName] || []) }));
131
+ });
132
+ // attributes
133
+ var attributeFiles = datasource.listAttributes();
134
+ attributeFiles.forEach(function (entityName) {
135
+ var parsed = datasource.readAttribute(entityName);
136
+ result.entities.attributes.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "attribute", entityName), usedInFeatures: Array.from(attributesUsedInFeatures[entityName] || []), usedInSegments: Array.from(attributesUsedInSegments[entityName] || []) }));
137
+ });
138
+ return result;
139
+ }
140
+ exports.generateSiteSearchIndex = generateSiteSearchIndex;
141
+ //# sourceMappingURL=generateSiteSearchIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateSiteSearchIndex.js","sourceRoot":"","sources":["../../src/site/generateSiteSearchIndex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,4CAA2C;AAE3C,kCAAmG;AAEnG,uDAAsD;AACtD,2EAA0E;AAG1E,SAAgB,uBAAuB,CACrC,iBAAyB,EACzB,aAA4B,EAC5B,WAA2B,EAC3B,WAAoC;IAEpC,IAAM,MAAM,GAAgB;QAC1B,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE;YACR,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;SACb;KACF,CAAC;IACF,IAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,aAAa,CAAC,CAAC;IAEjD;;OAEG;IACH,IAAI,WAAW,EAAE;QACT,IAAA,KAAyE,IAAA,mCAAgB,EAC7F,iBAAiB,EACjB,aAAa,CACd,EAHO,sBAAsB,4BAAA,EAAE,oBAAoB,0BAAA,EAAE,oBAAoB,0BAGzE,CAAC;QAEF,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,WAAW,CAAC,YAAY,KAAK,iBAAiB,EAAE;YAClD,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,GAAG,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC;SAC9E;QAED,MAAM,CAAC,KAAK,GAAG;YACb,SAA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,0 +1,2 @@
1
+ import { HistoryEntry, LastModified } from "@featurevisor/types";
2
+ export declare function getLastModifiedFromHistory(fullHistory: HistoryEntry[], type: any, key: any): LastModified | undefined;