@featurevisor/core 1.12.0 → 1.13.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.
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/revision.spec.ts":"7","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/revision.ts":"8","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.spec.ts":"9","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.ts":"10","/home/runner/work/featurevisor/featurevisor/packages/core/src/config/index.ts":"11","/home/runner/work/featurevisor/featurevisor/packages/core/src/config/parsers.ts":"12","/home/runner/work/featurevisor/featurevisor/packages/core/src/config/projectConfig.ts":"13","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/adapter.ts":"14","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts":"15","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/filesystemAdapter.ts":"16","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts":"17","/home/runner/work/featurevisor/featurevisor/packages/core/src/dependencies.ts":"18","/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/findDuplicateSegments.ts":"19","/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/index.ts":"20","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/index.ts":"21","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/typescript.ts":"22","/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts":"23","/home/runner/work/featurevisor/featurevisor/packages/core/src/init/index.ts":"24","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/attributeSchema.ts":"25","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkCircularDependency.ts":"26","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkPercentageExceedingSlot.ts":"27","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/conditionSchema.ts":"28","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/featureSchema.ts":"29","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/groupSchema.ts":"30","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/index.ts":"31","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/lintProject.ts":"32","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/printError.ts":"33","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/segmentSchema.ts":"34","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/testSchema.ts":"35","/home/runner/work/featurevisor/featurevisor/packages/core/src/restore/index.ts":"36","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/exportSite.ts":"37","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateHistory.ts":"38","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateSiteSearchIndex.ts":"39","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getLastModifiedFromHistory.ts":"40","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getOwnerAndRepoFromUrl.ts":"41","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRelativePaths.ts":"42","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRepoDetails.ts":"43","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/index.ts":"44","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/serveSite.ts":"45","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfArraysAreEqual.ts":"46","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.spec.ts":"47","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.ts":"48","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/cliFormat.ts":"49","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/index.ts":"50","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.spec.ts":"51","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.ts":"52","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/prettyDuration.ts":"53","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/printTestResult.ts":"54","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testFeature.ts":"55","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testProject.ts":"56","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testSegment.ts":"57","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/extractKeys.ts":"58","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/git.ts":"59","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/index.ts":"60"},{"size":3214,"mtime":1711219091496,"results":"61","hashOfConfig":"62"},{"size":1014,"mtime":1711219091496,"results":"63","hashOfConfig":"62"},{"size":10477,"mtime":1711219091496,"results":"64","hashOfConfig":"62"},{"size":2673,"mtime":1711219091496,"results":"65","hashOfConfig":"62"},{"size":1755,"mtime":1711219091496,"results":"66","hashOfConfig":"62"},{"size":65,"mtime":1711219091496,"results":"67","hashOfConfig":"62"},{"size":688,"mtime":1711219091496,"results":"68","hashOfConfig":"62"},{"size":760,"mtime":1711219091496,"results":"69","hashOfConfig":"62"},{"size":12889,"mtime":1711219091496,"results":"70","hashOfConfig":"62"},{"size":4894,"mtime":1711219091496,"results":"71","hashOfConfig":"62"},{"size":60,"mtime":1711219091496,"results":"72","hashOfConfig":"62"},{"size":1035,"mtime":1711219091496,"results":"73","hashOfConfig":"62"},{"size":3555,"mtime":1711219091496,"results":"74","hashOfConfig":"62"},{"size":1423,"mtime":1711219091496,"results":"75","hashOfConfig":"62"},{"size":5208,"mtime":1711219091496,"results":"76","hashOfConfig":"62"},{"size":10198,"mtime":1711219091496,"results":"77","hashOfConfig":"62"},{"size":94,"mtime":1711219091496,"results":"78","hashOfConfig":"62"},{"size":279,"mtime":1711219091496,"results":"79","hashOfConfig":"62"},{"size":1033,"mtime":1711219091496,"results":"80","hashOfConfig":"62"},{"size":540,"mtime":1711219091496,"results":"81","hashOfConfig":"62"},{"size":1476,"mtime":1711219091496,"results":"82","hashOfConfig":"62"},{"size":6250,"mtime":1711219091496,"results":"83","hashOfConfig":"62"},{"size":318,"mtime":1711219091496,"results":"84","hashOfConfig":"62"},{"size":1308,"mtime":1711219091496,"results":"85","hashOfConfig":"62"},{"size":359,"mtime":1711219091496,"results":"86","hashOfConfig":"62"},{"size":1119,"mtime":1711219091496,"results":"87","hashOfConfig":"62"},{"size":1464,"mtime":1711219091496,"results":"88","hashOfConfig":"62"},{"size":4007,"mtime":1711219091496,"results":"89","hashOfConfig":"62"},{"size":7758,"mtime":1711219091496,"results":"90","hashOfConfig":"62"},{"size":1221,"mtime":1711219091496,"results":"91","hashOfConfig":"62"},{"size":31,"mtime":1711219091496,"results":"92","hashOfConfig":"62"},{"size":9986,"mtime":1711219091496,"results":"93","hashOfConfig":"62"},{"size":982,"mtime":1711219091496,"results":"94","hashOfConfig":"62"},{"size":364,"mtime":1711219091496,"results":"95","hashOfConfig":"62"},{"size":2432,"mtime":1711219091496,"results":"96","hashOfConfig":"62"},{"size":641,"mtime":1711219091496,"results":"97","hashOfConfig":"62"},{"size":1481,"mtime":1711219091496,"results":"98","hashOfConfig":"62"},{"size":1178,"mtime":1711219091496,"results":"99","hashOfConfig":"62"},{"size":6187,"mtime":1711219091496,"results":"100","hashOfConfig":"62"},{"size":516,"mtime":1711219091496,"results":"101","hashOfConfig":"62"},{"size":496,"mtime":1711219091496,"results":"102","hashOfConfig":"62"},{"size":607,"mtime":1711219091496,"results":"103","hashOfConfig":"62"},{"size":1560,"mtime":1711219091496,"results":"104","hashOfConfig":"62"},{"size":59,"mtime":1711219091496,"results":"105","hashOfConfig":"62"},{"size":1681,"mtime":1711219091496,"results":"106","hashOfConfig":"62"},{"size":298,"mtime":1711219091496,"results":"107","hashOfConfig":"62"},{"size":932,"mtime":1711219091496,"results":"108","hashOfConfig":"62"},{"size":468,"mtime":1711219091496,"results":"109","hashOfConfig":"62"},{"size":212,"mtime":1711219091496,"results":"110","hashOfConfig":"62"},{"size":62,"mtime":1711219091496,"results":"111","hashOfConfig":"62"},{"size":1188,"mtime":1711219091496,"results":"112","hashOfConfig":"62"},{"size":5021,"mtime":1711219091496,"results":"113","hashOfConfig":"62"},{"size":516,"mtime":1711219091496,"results":"114","hashOfConfig":"62"},{"size":1691,"mtime":1711219091496,"results":"115","hashOfConfig":"62"},{"size":6968,"mtime":1711219091496,"results":"116","hashOfConfig":"62"},{"size":5702,"mtime":1711219091496,"results":"117","hashOfConfig":"62"},{"size":2328,"mtime":1711219091496,"results":"118","hashOfConfig":"62"},{"size":1993,"mtime":1711219091496,"results":"119","hashOfConfig":"62"},{"size":3641,"mtime":1711219091500,"results":"120","hashOfConfig":"62"},{"size":54,"mtime":1711219091500,"results":"121","hashOfConfig":"62"},{"filePath":"122","messages":"123","suppressedMessages":"124","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"2syfed",{"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},{"filePath":"152","messages":"153","suppressedMessages":"154","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"155","messages":"156","suppressedMessages":"157","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","suppressedMessages":"160","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","suppressedMessages":"163","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","suppressedMessages":"166","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"167","messages":"168","suppressedMessages":"169","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","suppressedMessages":"172","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"173","messages":"174","suppressedMessages":"175","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"176","messages":"177","suppressedMessages":"178","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"179","messages":"180","suppressedMessages":"181","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"182","messages":"183","suppressedMessages":"184","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"185","messages":"186","suppressedMessages":"187","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"188","messages":"189","suppressedMessages":"190","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"191","messages":"192","suppressedMessages":"193","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"194","messages":"195","suppressedMessages":"196","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"197","messages":"198","suppressedMessages":"199","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"200","messages":"201","suppressedMessages":"202","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"203","messages":"204","suppressedMessages":"205","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"206","messages":"207","suppressedMessages":"208","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"209","messages":"210","suppressedMessages":"211","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"212","messages":"213","suppressedMessages":"214","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"215","messages":"216","suppressedMessages":"217","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"218","messages":"219","suppressedMessages":"220","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"221","messages":"222","suppressedMessages":"223","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"224","messages":"225","suppressedMessages":"226","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"227","messages":"228","suppressedMessages":"229","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"230","messages":"231","suppressedMessages":"232","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"233","messages":"234","suppressedMessages":"235","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"236","messages":"237","suppressedMessages":"238","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"239","messages":"240","suppressedMessages":"241","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"242","messages":"243","suppressedMessages":"244","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"245","messages":"246","suppressedMessages":"247","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"248","messages":"249","suppressedMessages":"250","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"251","messages":"252","suppressedMessages":"253","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"254","messages":"255","suppressedMessages":"256","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"257","messages":"258","suppressedMessages":"259","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"260","messages":"261","suppressedMessages":"262","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"263","messages":"264","suppressedMessages":"265","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"266","messages":"267","suppressedMessages":"268","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"269","messages":"270","suppressedMessages":"271","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"272","messages":"273","suppressedMessages":"274","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"275","messages":"276","suppressedMessages":"277","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"278","messages":"279","suppressedMessages":"280","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"281","messages":"282","suppressedMessages":"283","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"284","messages":"285","suppressedMessages":"286","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"287","messages":"288","suppressedMessages":"289","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"290","messages":"291","suppressedMessages":"292","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"293","messages":"294","suppressedMessages":"295","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"296","messages":"297","suppressedMessages":"298","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"299","messages":"300","suppressedMessages":"301","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/revision.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/revision.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/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/config/parsers.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/config/projectConfig.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/adapter.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/filesystemAdapter.ts",[],["302","303"],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/dependencies.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",[],["304"],"/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/init/index.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/checkPercentageExceedingSlot.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/printError.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/index.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/checkIfArraysAreEqual.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/cliFormat.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/prettyDuration.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/printTestResult.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testFeature.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testProject.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testSegment.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/extractKeys.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/git.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/index.ts",[],[],{"ruleId":"305","severity":2,"message":"306","line":22,"column":7,"nodeType":"307","messageId":"308","endLine":22,"endColumn":18,"suppressions":"309"},{"ruleId":"310","severity":2,"message":"311","line":22,"column":21,"nodeType":"312","messageId":"313","endLine":22,"endColumn":81,"fix":"314","suppressions":"315"},{"ruleId":"305","severity":2,"message":"316","line":51,"column":10,"nodeType":"307","messageId":"308","endLine":51,"endColumn":38,"suppressions":"317"},"@typescript-eslint/no-unused-vars","'commitRegex' is assigned a value but never used.","Identifier","unusedVar",["318"],"no-regex-spaces","Spaces are hard to count. Use {3}.","Literal","multipleSpaces",{"range":"319","text":"320"},["321"],"'getFeaturevisorTypeFromValue' is defined but never used.",["322"],{"kind":"323","justification":"324"},[515,518]," {3}",{"kind":"323","justification":"324"},{"kind":"323","justification":"324"},"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/revision.spec.ts":"7","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/revision.ts":"8","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.spec.ts":"9","/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/traffic.ts":"10","/home/runner/work/featurevisor/featurevisor/packages/core/src/config/index.ts":"11","/home/runner/work/featurevisor/featurevisor/packages/core/src/config/parsers.ts":"12","/home/runner/work/featurevisor/featurevisor/packages/core/src/config/projectConfig.ts":"13","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/adapter.ts":"14","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts":"15","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/filesystemAdapter.ts":"16","/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts":"17","/home/runner/work/featurevisor/featurevisor/packages/core/src/dependencies.ts":"18","/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/findDuplicateSegments.ts":"19","/home/runner/work/featurevisor/featurevisor/packages/core/src/find-duplicate-segments/index.ts":"20","/home/runner/work/featurevisor/featurevisor/packages/core/src/find-usage/index.ts":"21","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/index.ts":"22","/home/runner/work/featurevisor/featurevisor/packages/core/src/generate-code/typescript.ts":"23","/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts":"24","/home/runner/work/featurevisor/featurevisor/packages/core/src/init/index.ts":"25","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/attributeSchema.ts":"26","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkCircularDependency.ts":"27","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/checkPercentageExceedingSlot.ts":"28","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/conditionSchema.ts":"29","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/featureSchema.ts":"30","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/groupSchema.ts":"31","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/index.ts":"32","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/lintProject.ts":"33","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/printError.ts":"34","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/segmentSchema.ts":"35","/home/runner/work/featurevisor/featurevisor/packages/core/src/linter/testSchema.ts":"36","/home/runner/work/featurevisor/featurevisor/packages/core/src/restore/index.ts":"37","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/exportSite.ts":"38","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateHistory.ts":"39","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/generateSiteSearchIndex.ts":"40","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getLastModifiedFromHistory.ts":"41","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getOwnerAndRepoFromUrl.ts":"42","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRelativePaths.ts":"43","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/getRepoDetails.ts":"44","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/index.ts":"45","/home/runner/work/featurevisor/featurevisor/packages/core/src/site/serveSite.ts":"46","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfArraysAreEqual.ts":"47","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.spec.ts":"48","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.ts":"49","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/cliFormat.ts":"50","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/index.ts":"51","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.spec.ts":"52","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.ts":"53","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/prettyDuration.ts":"54","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/printTestResult.ts":"55","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testFeature.ts":"56","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testProject.ts":"57","/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testSegment.ts":"58","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/extractKeys.ts":"59","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/git.ts":"60","/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/index.ts":"61"},{"size":3214,"mtime":1711561830018,"results":"62","hashOfConfig":"63"},{"size":1014,"mtime":1711561830018,"results":"64","hashOfConfig":"63"},{"size":10477,"mtime":1711561830018,"results":"65","hashOfConfig":"63"},{"size":2673,"mtime":1711561830018,"results":"66","hashOfConfig":"63"},{"size":1755,"mtime":1711561830018,"results":"67","hashOfConfig":"63"},{"size":65,"mtime":1711561830018,"results":"68","hashOfConfig":"63"},{"size":688,"mtime":1711561830018,"results":"69","hashOfConfig":"63"},{"size":760,"mtime":1711561830018,"results":"70","hashOfConfig":"63"},{"size":12889,"mtime":1711561830018,"results":"71","hashOfConfig":"63"},{"size":4894,"mtime":1711561830018,"results":"72","hashOfConfig":"63"},{"size":60,"mtime":1711561830018,"results":"73","hashOfConfig":"63"},{"size":1035,"mtime":1711561830018,"results":"74","hashOfConfig":"63"},{"size":3555,"mtime":1711561830018,"results":"75","hashOfConfig":"63"},{"size":1423,"mtime":1711561830018,"results":"76","hashOfConfig":"63"},{"size":5208,"mtime":1711561830018,"results":"77","hashOfConfig":"63"},{"size":10198,"mtime":1711561830018,"results":"78","hashOfConfig":"63"},{"size":94,"mtime":1711561830018,"results":"79","hashOfConfig":"63"},{"size":279,"mtime":1711561830018,"results":"80","hashOfConfig":"63"},{"size":1033,"mtime":1711561830018,"results":"81","hashOfConfig":"63"},{"size":540,"mtime":1711561830018,"results":"82","hashOfConfig":"63"},{"size":9681,"mtime":1711561830018,"results":"83","hashOfConfig":"63"},{"size":1476,"mtime":1711561830018,"results":"84","hashOfConfig":"63"},{"size":6250,"mtime":1711561830018,"results":"85","hashOfConfig":"63"},{"size":348,"mtime":1711561830018,"results":"86","hashOfConfig":"63"},{"size":1308,"mtime":1711561830018,"results":"87","hashOfConfig":"63"},{"size":359,"mtime":1711561830018,"results":"88","hashOfConfig":"63"},{"size":1119,"mtime":1711561830018,"results":"89","hashOfConfig":"63"},{"size":1464,"mtime":1711561830022,"results":"90","hashOfConfig":"63"},{"size":4007,"mtime":1711561830022,"results":"91","hashOfConfig":"63"},{"size":7758,"mtime":1711561830022,"results":"92","hashOfConfig":"63"},{"size":1221,"mtime":1711561830022,"results":"93","hashOfConfig":"63"},{"size":31,"mtime":1711561830022,"results":"94","hashOfConfig":"63"},{"size":9986,"mtime":1711561830022,"results":"95","hashOfConfig":"63"},{"size":982,"mtime":1711561830022,"results":"96","hashOfConfig":"63"},{"size":364,"mtime":1711561830022,"results":"97","hashOfConfig":"63"},{"size":2432,"mtime":1711561830022,"results":"98","hashOfConfig":"63"},{"size":641,"mtime":1711561830022,"results":"99","hashOfConfig":"63"},{"size":1481,"mtime":1711561830022,"results":"100","hashOfConfig":"63"},{"size":1178,"mtime":1711561830022,"results":"101","hashOfConfig":"63"},{"size":6187,"mtime":1711561830022,"results":"102","hashOfConfig":"63"},{"size":516,"mtime":1711561830022,"results":"103","hashOfConfig":"63"},{"size":496,"mtime":1711561830022,"results":"104","hashOfConfig":"63"},{"size":607,"mtime":1711561830022,"results":"105","hashOfConfig":"63"},{"size":1560,"mtime":1711561830022,"results":"106","hashOfConfig":"63"},{"size":59,"mtime":1711561830022,"results":"107","hashOfConfig":"63"},{"size":1681,"mtime":1711561830022,"results":"108","hashOfConfig":"63"},{"size":298,"mtime":1711561830022,"results":"109","hashOfConfig":"63"},{"size":932,"mtime":1711561830022,"results":"110","hashOfConfig":"63"},{"size":468,"mtime":1711561830022,"results":"111","hashOfConfig":"63"},{"size":212,"mtime":1711561830022,"results":"112","hashOfConfig":"63"},{"size":62,"mtime":1711561830022,"results":"113","hashOfConfig":"63"},{"size":1188,"mtime":1711561830022,"results":"114","hashOfConfig":"63"},{"size":5021,"mtime":1711561830022,"results":"115","hashOfConfig":"63"},{"size":516,"mtime":1711561830022,"results":"116","hashOfConfig":"63"},{"size":1691,"mtime":1711561830022,"results":"117","hashOfConfig":"63"},{"size":6968,"mtime":1711561830022,"results":"118","hashOfConfig":"63"},{"size":5702,"mtime":1711561830022,"results":"119","hashOfConfig":"63"},{"size":2328,"mtime":1711561830022,"results":"120","hashOfConfig":"63"},{"size":1993,"mtime":1711561830022,"results":"121","hashOfConfig":"63"},{"size":3641,"mtime":1711561830022,"results":"122","hashOfConfig":"63"},{"size":54,"mtime":1711561830022,"results":"123","hashOfConfig":"63"},{"filePath":"124","messages":"125","suppressedMessages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"2syfed",{"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},{"filePath":"202","messages":"203","suppressedMessages":"204","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"205","messages":"206","suppressedMessages":"207","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"208","messages":"209","suppressedMessages":"210","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"211","messages":"212","suppressedMessages":"213","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"214","messages":"215","suppressedMessages":"216","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"217","messages":"218","suppressedMessages":"219","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"220","messages":"221","suppressedMessages":"222","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"223","messages":"224","suppressedMessages":"225","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"226","messages":"227","suppressedMessages":"228","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"229","messages":"230","suppressedMessages":"231","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"232","messages":"233","suppressedMessages":"234","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"235","messages":"236","suppressedMessages":"237","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"238","messages":"239","suppressedMessages":"240","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"241","messages":"242","suppressedMessages":"243","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"244","messages":"245","suppressedMessages":"246","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"247","messages":"248","suppressedMessages":"249","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"250","messages":"251","suppressedMessages":"252","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"253","messages":"254","suppressedMessages":"255","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"256","messages":"257","suppressedMessages":"258","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"259","messages":"260","suppressedMessages":"261","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"262","messages":"263","suppressedMessages":"264","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"265","messages":"266","suppressedMessages":"267","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"268","messages":"269","suppressedMessages":"270","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"271","messages":"272","suppressedMessages":"273","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"274","messages":"275","suppressedMessages":"276","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"277","messages":"278","suppressedMessages":"279","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"280","messages":"281","suppressedMessages":"282","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"283","messages":"284","suppressedMessages":"285","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"286","messages":"287","suppressedMessages":"288","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"289","messages":"290","suppressedMessages":"291","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"292","messages":"293","suppressedMessages":"294","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"295","messages":"296","suppressedMessages":"297","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"298","messages":"299","suppressedMessages":"300","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"301","messages":"302","suppressedMessages":"303","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"304","messages":"305","suppressedMessages":"306","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/revision.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/builder/revision.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/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/config/parsers.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/config/projectConfig.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/adapter.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/datasource.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/filesystemAdapter.ts",[],["307","308"],"/home/runner/work/featurevisor/featurevisor/packages/core/src/datasource/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/dependencies.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/find-usage/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",[],["309"],"/home/runner/work/featurevisor/featurevisor/packages/core/src/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/init/index.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/checkPercentageExceedingSlot.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/printError.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/index.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/checkIfArraysAreEqual.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/checkIfObjectsAreEqual.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/cliFormat.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/matrix.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/prettyDuration.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/printTestResult.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testFeature.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testProject.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/tester/testSegment.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/extractKeys.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/git.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/core/src/utils/index.ts",[],[],{"ruleId":"310","severity":2,"message":"311","line":22,"column":7,"nodeType":"312","messageId":"313","endLine":22,"endColumn":18,"suppressions":"314"},{"ruleId":"315","severity":2,"message":"316","line":22,"column":21,"nodeType":"317","messageId":"318","endLine":22,"endColumn":81,"fix":"319","suppressions":"320"},{"ruleId":"310","severity":2,"message":"321","line":51,"column":10,"nodeType":"312","messageId":"313","endLine":51,"endColumn":38,"suppressions":"322"},"@typescript-eslint/no-unused-vars","'commitRegex' is assigned a value but never used.","Identifier","unusedVar",["323"],"no-regex-spaces","Spaces are hard to count. Use {3}.","Literal","multipleSpaces",{"range":"324","text":"325"},["326"],"'getFeaturevisorTypeFromValue' is defined but never used.",["327"],{"kind":"328","justification":"329"},[515,518]," {3}",{"kind":"328","justification":"329"},{"kind":"328","justification":"329"},"directive",""]
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
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
+ ## [1.13.1](https://github.com/featurevisor/featurevisor/compare/v1.13.0...v1.13.1) (2024-03-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * internal improvements for finding usage ([#290](https://github.com/featurevisor/featurevisor/issues/290)) ([070d7ec](https://github.com/featurevisor/featurevisor/commit/070d7eced9c20cbfdd4839345234dbafda39c1e3))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.13.0](https://github.com/featurevisor/featurevisor/compare/v1.12.0...v1.13.0) (2024-03-26)
18
+
19
+
20
+ ### Features
21
+
22
+ * find usage of segments and attributes ([#289](https://github.com/featurevisor/featurevisor/issues/289)) ([c1319b3](https://github.com/featurevisor/featurevisor/commit/c1319b32d46ae7bbb03eb7b7e5dd19e37f2be51d))
23
+
24
+
25
+
26
+
27
+
6
28
  # [1.12.0](https://github.com/featurevisor/featurevisor/compare/v1.11.1...v1.12.0) (2024-03-23)
7
29
 
8
30
 
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1711219227898" clover="3.2.0">
3
- <project timestamp="1711219227898" name="All files">
2
+ <coverage generated="1711561969668" clover="3.2.0">
3
+ <project timestamp="1711561969668" name="All files">
4
4
  <metrics statements="377" coveredstatements="256" conditionals="190" coveredconditionals="119" methods="54" coveredmethods="37" elements="621" coveredelements="412" complexity="0" loc="377" ncloc="377" packages="4" files="10" classes="10"/>
5
5
  <package name="lib.builder">
6
6
  <metrics statements="104" coveredstatements="98" conditionals="58" coveredconditionals="48" methods="15" coveredmethods="15"/>
@@ -146,7 +146,7 @@
146
146
  <div class='footer quiet pad2 space-top1 center small'>
147
147
  Code coverage generated by
148
148
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
149
- at 2024-03-23T18:40:27.861Z
149
+ at 2024-03-27T17:52:49.611Z
150
150
  </div>
151
151
  <script src="prettify.js"></script>
152
152
  <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 2024-03-23T18:40:27.861Z
178
+ at 2024-03-27T17:52:49.611Z
179
179
  </div>
180
180
  <script src="../../prettify.js"></script>
181
181
  <script>
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2024-03-23T18:40:27.861Z
134
+ at 2024-03-27T17:52:49.611Z
135
135
  </div>
136
136
  <script src="../../prettify.js"></script>
137
137
  <script>
@@ -136,7 +136,7 @@ exports.getNextRevision = getNextRevision;
136
136
  <div class='footer quiet pad2 space-top1 center small'>
137
137
  Code coverage generated by
138
138
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
139
- at 2024-03-23T18:40:27.861Z
139
+ at 2024-03-27T17:52:49.611Z
140
140
  </div>
141
141
  <script src="../../prettify.js"></script>
142
142
  <script>
@@ -454,7 +454,7 @@ exports.getTraffic = getTraffic;
454
454
  <div class='footer quiet pad2 space-top1 center small'>
455
455
  Code coverage generated by
456
456
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
457
- at 2024-03-23T18:40:27.861Z
457
+ at 2024-03-27T17:52:49.611Z
458
458
  </div>
459
459
  <script src="../../prettify.js"></script>
460
460
  <script>
@@ -139,7 +139,7 @@ exports.checkIfObjectsAreEqual = checkIfObjectsAreEqual;
139
139
  <div class='footer quiet pad2 space-top1 center small'>
140
140
  Code coverage generated by
141
141
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
142
- at 2024-03-23T18:40:27.861Z
142
+ at 2024-03-27T17:52:49.611Z
143
143
  </div>
144
144
  <script src="../../prettify.js"></script>
145
145
  <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 2024-03-23T18:40:27.861Z
119
+ at 2024-03-27T17:52:49.611Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -472,7 +472,7 @@ exports.getSegmentAssertionsFromMatrix = getSegmentAssertionsFromMatrix;
472
472
  <div class='footer quiet pad2 space-top1 center small'>
473
473
  Code coverage generated by
474
474
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
475
- at 2024-03-23T18:40:27.861Z
475
+ at 2024-03-27T17:52:49.611Z
476
476
  </div>
477
477
  <script src="../../prettify.js"></script>
478
478
  <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 2024-03-23T18:40:27.861Z
196
+ at 2024-03-27T17:52:49.611Z
197
197
  </div>
198
198
  <script src="../../prettify.js"></script>
199
199
  <script>
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2024-03-23T18:40:27.861Z
134
+ at 2024-03-27T17:52:49.611Z
135
135
  </div>
136
136
  <script src="../../prettify.js"></script>
137
137
  <script>
@@ -136,7 +136,7 @@
136
136
  <div class='footer quiet pad2 space-top1 center small'>
137
137
  Code coverage generated by
138
138
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
139
- at 2024-03-23T18:40:27.861Z
139
+ at 2024-03-27T17:52:49.611Z
140
140
  </div>
141
141
  <script src="../../prettify.js"></script>
142
142
  <script>
@@ -565,7 +565,7 @@ export function getTraffic(
565
565
  <div class='footer quiet pad2 space-top1 center small'>
566
566
  Code coverage generated by
567
567
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
568
- at 2024-03-23T18:40:27.861Z
568
+ at 2024-03-27T17:52:49.611Z
569
569
  </div>
570
570
  <script src="../../prettify.js"></script>
571
571
  <script>
@@ -142,7 +142,7 @@
142
142
  <div class='footer quiet pad2 space-top1 center small'>
143
143
  Code coverage generated by
144
144
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
145
- at 2024-03-23T18:40:27.861Z
145
+ at 2024-03-27T17:52:49.611Z
146
146
  </div>
147
147
  <script src="../../prettify.js"></script>
148
148
  <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 2024-03-23T18:40:27.861Z
119
+ at 2024-03-27T17:52:49.611Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -625,7 +625,7 @@ export function <span class="fstat-no" title="function not covered" >getSegmentA
625
625
  <div class='footer quiet pad2 space-top1 center small'>
626
626
  Code coverage generated by
627
627
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
628
- at 2024-03-23T18:40:27.861Z
628
+ at 2024-03-27T17:52:49.611Z
629
629
  </div>
630
630
  <script src="../../prettify.js"></script>
631
631
  <script>
@@ -0,0 +1,31 @@
1
+ import { FeatureKey, SegmentKey, AttributeKey } from "@featurevisor/types";
2
+ import { Dependencies } from "../dependencies";
3
+ export interface UsageInFeatures {
4
+ [featureKey: string]: {
5
+ features: Set<FeatureKey>;
6
+ segments: Set<SegmentKey>;
7
+ attributes: Set<AttributeKey>;
8
+ };
9
+ }
10
+ export declare function findAllUsageInFeatures(deps: Dependencies): Promise<UsageInFeatures>;
11
+ export interface UsageInSegments {
12
+ [segmentKey: string]: {
13
+ attributes: Set<AttributeKey>;
14
+ };
15
+ }
16
+ export declare function findAllUsageInSegments(deps: Dependencies): Promise<UsageInSegments>;
17
+ export declare function findSegmentUsage(deps: Dependencies, segmentKey: SegmentKey): Promise<Set<FeatureKey>>;
18
+ export interface AttributeUsage {
19
+ features: Set<FeatureKey>;
20
+ segments: Set<SegmentKey>;
21
+ }
22
+ export declare function findAttributeUsage(deps: Dependencies, attributeKey: AttributeKey): Promise<AttributeUsage>;
23
+ export declare function findUnusedSegments(deps: Dependencies): Promise<Set<SegmentKey>>;
24
+ export declare function findUnusedAttributes(deps: Dependencies): Promise<Set<AttributeKey>>;
25
+ export interface FindUsageOptions {
26
+ segment?: string;
27
+ attribute?: string;
28
+ unusedSegments?: boolean;
29
+ unusedAttributes?: boolean;
30
+ }
31
+ export declare function findUsageInProject(deps: Dependencies, options: FindUsageOptions): Promise<void>;
@@ -0,0 +1,407 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.findUsageInProject = exports.findUnusedAttributes = exports.findUnusedSegments = exports.findAttributeUsage = exports.findSegmentUsage = exports.findAllUsageInSegments = exports.findAllUsageInFeatures = void 0;
40
+ var extractKeys_1 = require("../utils/extractKeys");
41
+ function findAllUsageInFeatures(deps) {
42
+ return __awaiter(this, void 0, void 0, function () {
43
+ var datasource, projectConfig, usageInFeatures, featureKeys, _loop_1, _i, featureKeys_1, featureKey;
44
+ return __generator(this, function (_a) {
45
+ switch (_a.label) {
46
+ case 0:
47
+ datasource = deps.datasource, projectConfig = deps.projectConfig;
48
+ usageInFeatures = {};
49
+ return [4 /*yield*/, datasource.listFeatures()];
50
+ case 1:
51
+ featureKeys = _a.sent();
52
+ _loop_1 = function (featureKey) {
53
+ var feature;
54
+ return __generator(this, function (_b) {
55
+ switch (_b.label) {
56
+ case 0: return [4 /*yield*/, datasource.readFeature(featureKey)];
57
+ case 1:
58
+ feature = _b.sent();
59
+ usageInFeatures[featureKey] = {
60
+ features: new Set(),
61
+ segments: new Set(),
62
+ attributes: new Set(),
63
+ };
64
+ // required
65
+ if (feature.required) {
66
+ feature.required.forEach(function (required) {
67
+ if (typeof required === "string") {
68
+ usageInFeatures[featureKey].features.add(required);
69
+ }
70
+ else if (typeof required === "object" && required.key) {
71
+ usageInFeatures[featureKey].features.add(required.key);
72
+ }
73
+ });
74
+ }
75
+ // bucketBy
76
+ if (feature.bucketBy) {
77
+ if (typeof feature.bucketBy === "string") {
78
+ usageInFeatures[featureKey].attributes.add(feature.bucketBy);
79
+ }
80
+ else if (Array.isArray(feature.bucketBy)) {
81
+ feature.bucketBy.forEach(function (b) { return usageInFeatures[featureKey].attributes.add(b); });
82
+ }
83
+ else if (typeof feature.bucketBy === "object" && feature.bucketBy.or) {
84
+ feature.bucketBy.or.forEach(function (b) { return usageInFeatures[featureKey].attributes.add(b); });
85
+ }
86
+ }
87
+ // variable overrides inside variations
88
+ projectConfig.environments.forEach(function (environment) {
89
+ var _a, _b;
90
+ if (feature.variations) {
91
+ feature.variations.forEach(function (variation) {
92
+ if (variation.variables) {
93
+ variation.variables.forEach(function (variable) {
94
+ if (variable.overrides) {
95
+ variable.overrides.forEach(function (override) {
96
+ if (override.segments) {
97
+ (0, extractKeys_1.extractSegmentKeysFromGroupSegments)(override.segments).forEach(function (segmentKey) {
98
+ return usageInFeatures[featureKey].segments.add(segmentKey);
99
+ });
100
+ }
101
+ if (override.conditions) {
102
+ (0, extractKeys_1.extractAttributeKeysFromConditions)(override.conditions).forEach(function (attributeKey) { return usageInFeatures[featureKey].attributes.add(attributeKey); });
103
+ }
104
+ });
105
+ }
106
+ });
107
+ }
108
+ });
109
+ }
110
+ // force
111
+ if (feature.environments[environment].force) {
112
+ (_a = feature.environments[environment].force) === null || _a === void 0 ? void 0 : _a.forEach(function (force) {
113
+ if (force.segments) {
114
+ (0, extractKeys_1.extractSegmentKeysFromGroupSegments)(force.segments).forEach(function (segmentKey) {
115
+ return usageInFeatures[featureKey].segments.add(segmentKey);
116
+ });
117
+ }
118
+ if (force.conditions) {
119
+ (0, extractKeys_1.extractAttributeKeysFromConditions)(force.conditions).forEach(function (attributeKey) {
120
+ return usageInFeatures[featureKey].attributes.add(attributeKey);
121
+ });
122
+ }
123
+ });
124
+ }
125
+ // rules
126
+ if (feature.environments[environment].rules) {
127
+ (_b = feature.environments[environment].rules) === null || _b === void 0 ? void 0 : _b.forEach(function (rule) {
128
+ (0, extractKeys_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach(function (segmentKey) {
129
+ return usageInFeatures[featureKey].segments.add(segmentKey);
130
+ });
131
+ });
132
+ }
133
+ });
134
+ return [2 /*return*/];
135
+ }
136
+ });
137
+ };
138
+ _i = 0, featureKeys_1 = featureKeys;
139
+ _a.label = 2;
140
+ case 2:
141
+ if (!(_i < featureKeys_1.length)) return [3 /*break*/, 5];
142
+ featureKey = featureKeys_1[_i];
143
+ return [5 /*yield**/, _loop_1(featureKey)];
144
+ case 3:
145
+ _a.sent();
146
+ _a.label = 4;
147
+ case 4:
148
+ _i++;
149
+ return [3 /*break*/, 2];
150
+ case 5: return [2 /*return*/, usageInFeatures];
151
+ }
152
+ });
153
+ });
154
+ }
155
+ exports.findAllUsageInFeatures = findAllUsageInFeatures;
156
+ function findAllUsageInSegments(deps) {
157
+ return __awaiter(this, void 0, void 0, function () {
158
+ var datasource, usageInSegments, segmentKeys, _loop_2, _i, segmentKeys_1, segmentKey;
159
+ return __generator(this, function (_a) {
160
+ switch (_a.label) {
161
+ case 0:
162
+ datasource = deps.datasource;
163
+ usageInSegments = {};
164
+ return [4 /*yield*/, datasource.listSegments()];
165
+ case 1:
166
+ segmentKeys = _a.sent();
167
+ _loop_2 = function (segmentKey) {
168
+ var segment;
169
+ return __generator(this, function (_b) {
170
+ switch (_b.label) {
171
+ case 0: return [4 /*yield*/, datasource.readSegment(segmentKey)];
172
+ case 1:
173
+ segment = _b.sent();
174
+ usageInSegments[segmentKey] = {
175
+ attributes: new Set(),
176
+ };
177
+ (0, extractKeys_1.extractAttributeKeysFromConditions)(segment.conditions).forEach(function (attributeKey) {
178
+ usageInSegments[segmentKey].attributes.add(attributeKey);
179
+ });
180
+ return [2 /*return*/];
181
+ }
182
+ });
183
+ };
184
+ _i = 0, segmentKeys_1 = segmentKeys;
185
+ _a.label = 2;
186
+ case 2:
187
+ if (!(_i < segmentKeys_1.length)) return [3 /*break*/, 5];
188
+ segmentKey = segmentKeys_1[_i];
189
+ return [5 /*yield**/, _loop_2(segmentKey)];
190
+ case 3:
191
+ _a.sent();
192
+ _a.label = 4;
193
+ case 4:
194
+ _i++;
195
+ return [3 /*break*/, 2];
196
+ case 5: return [2 /*return*/, usageInSegments];
197
+ }
198
+ });
199
+ });
200
+ }
201
+ exports.findAllUsageInSegments = findAllUsageInSegments;
202
+ function findSegmentUsage(deps, segmentKey) {
203
+ return __awaiter(this, void 0, void 0, function () {
204
+ var usedInFeatures, usageInFeatures, featureKey;
205
+ return __generator(this, function (_a) {
206
+ switch (_a.label) {
207
+ case 0:
208
+ usedInFeatures = new Set();
209
+ return [4 /*yield*/, findAllUsageInFeatures(deps)];
210
+ case 1:
211
+ usageInFeatures = _a.sent();
212
+ for (featureKey in usageInFeatures) {
213
+ if (usageInFeatures[featureKey].segments.has(segmentKey)) {
214
+ usedInFeatures.add(featureKey);
215
+ }
216
+ }
217
+ return [2 /*return*/, usedInFeatures];
218
+ }
219
+ });
220
+ });
221
+ }
222
+ exports.findSegmentUsage = findSegmentUsage;
223
+ function findAttributeUsage(deps, attributeKey) {
224
+ return __awaiter(this, void 0, void 0, function () {
225
+ var usedIn, usageInFeatures, usageInSegments, featureKey, segmentKey;
226
+ return __generator(this, function (_a) {
227
+ switch (_a.label) {
228
+ case 0:
229
+ usedIn = {
230
+ features: new Set(),
231
+ segments: new Set(),
232
+ };
233
+ return [4 /*yield*/, findAllUsageInFeatures(deps)];
234
+ case 1:
235
+ usageInFeatures = _a.sent();
236
+ return [4 /*yield*/, findAllUsageInSegments(deps)];
237
+ case 2:
238
+ usageInSegments = _a.sent();
239
+ for (featureKey in usageInFeatures) {
240
+ if (usageInFeatures[featureKey].attributes.has(attributeKey)) {
241
+ usedIn.features.add(featureKey);
242
+ }
243
+ }
244
+ for (segmentKey in usageInSegments) {
245
+ if (usageInSegments[segmentKey].attributes.has(attributeKey)) {
246
+ usedIn.segments.add(segmentKey);
247
+ }
248
+ }
249
+ return [2 /*return*/, usedIn];
250
+ }
251
+ });
252
+ });
253
+ }
254
+ exports.findAttributeUsage = findAttributeUsage;
255
+ function findUnusedSegments(deps) {
256
+ return __awaiter(this, void 0, void 0, function () {
257
+ var datasource, unusedSegments, allSegmentKeys, usageInFeatures, usedSegmentKeys, featureKey;
258
+ return __generator(this, function (_a) {
259
+ switch (_a.label) {
260
+ case 0:
261
+ datasource = deps.datasource;
262
+ unusedSegments = new Set();
263
+ return [4 /*yield*/, datasource.listSegments()];
264
+ case 1:
265
+ allSegmentKeys = _a.sent();
266
+ return [4 /*yield*/, findAllUsageInFeatures(deps)];
267
+ case 2:
268
+ usageInFeatures = _a.sent();
269
+ usedSegmentKeys = new Set();
270
+ for (featureKey in usageInFeatures) {
271
+ usageInFeatures[featureKey].segments.forEach(function (segmentKey) {
272
+ usedSegmentKeys.add(segmentKey);
273
+ });
274
+ }
275
+ allSegmentKeys.forEach(function (segmentKey) {
276
+ if (!usedSegmentKeys.has(segmentKey)) {
277
+ unusedSegments.add(segmentKey);
278
+ }
279
+ });
280
+ return [2 /*return*/, unusedSegments];
281
+ }
282
+ });
283
+ });
284
+ }
285
+ exports.findUnusedSegments = findUnusedSegments;
286
+ function findUnusedAttributes(deps) {
287
+ return __awaiter(this, void 0, void 0, function () {
288
+ var datasource, unusedAttributes, allAttributeKeys, usageInFeatures, usageInSegments, usedAttributeKeys, featureKey, segmentKey;
289
+ return __generator(this, function (_a) {
290
+ switch (_a.label) {
291
+ case 0:
292
+ datasource = deps.datasource;
293
+ unusedAttributes = new Set();
294
+ return [4 /*yield*/, datasource.listAttributes()];
295
+ case 1:
296
+ allAttributeKeys = _a.sent();
297
+ return [4 /*yield*/, findAllUsageInFeatures(deps)];
298
+ case 2:
299
+ usageInFeatures = _a.sent();
300
+ return [4 /*yield*/, findAllUsageInSegments(deps)];
301
+ case 3:
302
+ usageInSegments = _a.sent();
303
+ usedAttributeKeys = new Set();
304
+ for (featureKey in usageInFeatures) {
305
+ usageInFeatures[featureKey].attributes.forEach(function (attributeKey) {
306
+ usedAttributeKeys.add(attributeKey);
307
+ });
308
+ }
309
+ for (segmentKey in usageInSegments) {
310
+ usageInSegments[segmentKey].attributes.forEach(function (attributeKey) {
311
+ usedAttributeKeys.add(attributeKey);
312
+ });
313
+ }
314
+ allAttributeKeys.forEach(function (attributeKey) {
315
+ if (!usedAttributeKeys.has(attributeKey)) {
316
+ unusedAttributes.add(attributeKey);
317
+ }
318
+ });
319
+ return [2 /*return*/, unusedAttributes];
320
+ }
321
+ });
322
+ });
323
+ }
324
+ exports.findUnusedAttributes = findUnusedAttributes;
325
+ function findUsageInProject(deps, options) {
326
+ return __awaiter(this, void 0, void 0, function () {
327
+ var usedInFeatures, usedIn, unusedSegments, unusedAttributes;
328
+ return __generator(this, function (_a) {
329
+ switch (_a.label) {
330
+ case 0:
331
+ console.log("");
332
+ if (!options.segment) return [3 /*break*/, 2];
333
+ return [4 /*yield*/, findSegmentUsage(deps, options.segment)];
334
+ case 1:
335
+ usedInFeatures = _a.sent();
336
+ if (usedInFeatures.size === 0) {
337
+ console.log("Segment \"".concat(options.segment, "\" is not used in any features."));
338
+ }
339
+ else {
340
+ console.log("Segment \"".concat(options.segment, "\" is used in the following features:\n"));
341
+ usedInFeatures.forEach(function (featureKey) {
342
+ console.log(" - ".concat(featureKey));
343
+ });
344
+ }
345
+ return [2 /*return*/];
346
+ case 2:
347
+ if (!options.attribute) return [3 /*break*/, 4];
348
+ return [4 /*yield*/, findAttributeUsage(deps, options.attribute)];
349
+ case 3:
350
+ usedIn = _a.sent();
351
+ if (usedIn.features.size === 0 && usedIn.segments.size === 0) {
352
+ console.log("Attribute \"".concat(options.attribute, "\" is not used in any features or segments."));
353
+ return [2 /*return*/];
354
+ }
355
+ if (usedIn.features.size > 0) {
356
+ console.log("Attribute \"".concat(options.attribute, "\" is used in the following features:\n"));
357
+ usedIn.features.forEach(function (featureKey) {
358
+ console.log(" - ".concat(featureKey));
359
+ });
360
+ console.log("");
361
+ }
362
+ if (usedIn.segments.size > 0) {
363
+ console.log("Attribute \"".concat(options.attribute, "\" is used in the following segments:\n"));
364
+ usedIn.segments.forEach(function (segmentKey) {
365
+ console.log(" - ".concat(segmentKey));
366
+ });
367
+ }
368
+ return [2 /*return*/];
369
+ case 4:
370
+ if (!options.unusedSegments) return [3 /*break*/, 6];
371
+ return [4 /*yield*/, findUnusedSegments(deps)];
372
+ case 5:
373
+ unusedSegments = _a.sent();
374
+ if (unusedSegments.size === 0) {
375
+ console.log("No unused segments found.");
376
+ }
377
+ else {
378
+ console.log("Unused segments:\n");
379
+ unusedSegments.forEach(function (segmentKey) {
380
+ console.log(" - ".concat(segmentKey));
381
+ });
382
+ }
383
+ return [2 /*return*/];
384
+ case 6:
385
+ if (!options.unusedAttributes) return [3 /*break*/, 8];
386
+ return [4 /*yield*/, findUnusedAttributes(deps)];
387
+ case 7:
388
+ unusedAttributes = _a.sent();
389
+ if (unusedAttributes.size === 0) {
390
+ console.log("No unused attributes found.");
391
+ }
392
+ else {
393
+ console.log("Unused attributes:\n");
394
+ unusedAttributes.forEach(function (attributeKey) {
395
+ console.log(" - ".concat(attributeKey));
396
+ });
397
+ }
398
+ return [2 /*return*/];
399
+ case 8:
400
+ console.log("Please specify a segment or attribute.");
401
+ return [2 /*return*/];
402
+ }
403
+ });
404
+ });
405
+ }
406
+ exports.findUsageInProject = findUsageInProject;
407
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/find-usage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,oDAG8B;AAU9B,SAAsB,sBAAsB,CAAC,IAAkB;;;;;;oBACrD,UAAU,GAAoB,IAAI,WAAxB,EAAE,aAAa,GAAK,IAAI,cAAT,CAAU;oBACrC,eAAe,GAAoB,EAAE,CAAC;oBAExB,qBAAM,UAAU,CAAC,YAAY,EAAE,EAAA;;oBAA7C,WAAW,GAAG,SAA+B;wCAExC,UAAU;;;;wCACH,qBAAM,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,EAAA;;oCAAlD,OAAO,GAAG,SAAwC;oCACxD,eAAe,CAAC,UAAU,CAAC,GAAG;wCAC5B,QAAQ,EAAE,IAAI,GAAG,EAAc;wCAC/B,QAA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AG,CAAC,cAAO,UAAU,CAAE,CAAC,CAAC;wBACnC,CAAC,CAAC,CAAC;qBACJ;oBAED,sBAAO;;yBAIL,OAAO,CAAC,cAAc,EAAtB,wBAAsB;oBACD,qBAAM,kBAAkB,CAAC,IAAI,CAAC,EAAA;;oBAA/C,cAAc,GAAG,SAA8B;oBAErD,IAAI,cAAc,CAAC,IAAI,KAAK,CAAC,EAAE;wBAC7B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;qBAC1C;yBAAM;wBACL,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;wBAElC,cAAc,CAAC,OAAO,CAAC,UAAC,UAAU;4BAChC,OAAO,CAAC,GAAG,CAAC,cAAO,UAAU,CAAE,CAAC,CAAC;wBACnC,CAAC,CAAC,CAAC;qBACJ;oBAED,sBAAO;;yBAIL,OAAO,CAAC,gBAAgB,EAAxB,wBAAwB;oBACD,qBAAM,oBAAoB,CAAC,IAAI,CAAC,EAAA;;oBAAnD,gBAAgB,GAAG,SAAgC;oBAEzD,IAAI,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAE;wBAC/B,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;qBAC5C;yBAAM;wBACL,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;wBAEpC,gBAAgB,CAAC,OAAO,CAAC,UAAC,YAAY;4BACpC,OAAO,CAAC,GAAG,CAAC,cAAO,YAAY,CAAE,CAAC,CAAC;wBACrC,CAAC,CAAC,CAAC;qBACJ;oBAED,sBAAO;;oBAGT,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;;;;;CACvD;AAtFD,gDAsFC"}
package/lib/index.d.ts CHANGED
@@ -7,5 +7,6 @@ export * from "./site";
7
7
  export * from "./generate-code";
8
8
  export * from "./restore";
9
9
  export * from "./find-duplicate-segments";
10
+ export * from "./find-usage";
10
11
  export * from "./dependencies";
11
12
  export * from "./datasource";
package/lib/index.js CHANGED
@@ -23,6 +23,7 @@ __exportStar(require("./site"), exports);
23
23
  __exportStar(require("./generate-code"), exports);
24
24
  __exportStar(require("./restore"), exports);
25
25
  __exportStar(require("./find-duplicate-segments"), exports);
26
+ __exportStar(require("./find-usage"), exports);
26
27
  __exportStar(require("./dependencies"), exports);
27
28
  __exportStar(require("./datasource"), exports);
28
29
  //# 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;AAC1B,4DAA0C;AAC1C,iDAA+B;AAC/B,+CAA6B"}
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;AAC1C,+CAA6B;AAC7B,iDAA+B;AAC/B,+CAA6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featurevisor/core",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
4
4
  "description": "Core package of Featurevisor for Node.js usage",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -57,5 +57,5 @@
57
57
  "@types/js-yaml": "^4.0.5",
58
58
  "@types/tar": "^6.1.4"
59
59
  },
60
- "gitHead": "399f2ddc2575ce783f175dab4bd5c761666bd7b4"
60
+ "gitHead": "806b52ab8a519b05f31362f48cdb134d5a794976"
61
61
  }
@@ -0,0 +1,334 @@
1
+ import { Condition, FeatureKey, SegmentKey, AttributeKey } from "@featurevisor/types";
2
+
3
+ import { Dependencies } from "../dependencies";
4
+ import {
5
+ extractAttributeKeysFromConditions,
6
+ extractSegmentKeysFromGroupSegments,
7
+ } from "../utils/extractKeys";
8
+
9
+ export interface UsageInFeatures {
10
+ [featureKey: string]: {
11
+ features: Set<FeatureKey>;
12
+ segments: Set<SegmentKey>;
13
+ attributes: Set<AttributeKey>;
14
+ };
15
+ }
16
+
17
+ export async function findAllUsageInFeatures(deps: Dependencies): Promise<UsageInFeatures> {
18
+ const { datasource, projectConfig } = deps;
19
+ const usageInFeatures: UsageInFeatures = {};
20
+
21
+ const featureKeys = await datasource.listFeatures();
22
+
23
+ for (const featureKey of featureKeys) {
24
+ const feature = await datasource.readFeature(featureKey);
25
+ usageInFeatures[featureKey] = {
26
+ features: new Set<FeatureKey>(),
27
+ segments: new Set<SegmentKey>(),
28
+ attributes: new Set<AttributeKey>(),
29
+ };
30
+
31
+ // required
32
+ if (feature.required) {
33
+ feature.required.forEach((required) => {
34
+ if (typeof required === "string") {
35
+ usageInFeatures[featureKey].features.add(required);
36
+ } else if (typeof required === "object" && required.key) {
37
+ usageInFeatures[featureKey].features.add(required.key);
38
+ }
39
+ });
40
+ }
41
+
42
+ // bucketBy
43
+ if (feature.bucketBy) {
44
+ if (typeof feature.bucketBy === "string") {
45
+ usageInFeatures[featureKey].attributes.add(feature.bucketBy);
46
+ } else if (Array.isArray(feature.bucketBy)) {
47
+ feature.bucketBy.forEach((b) => usageInFeatures[featureKey].attributes.add(b));
48
+ } else if (typeof feature.bucketBy === "object" && feature.bucketBy.or) {
49
+ feature.bucketBy.or.forEach((b) => usageInFeatures[featureKey].attributes.add(b));
50
+ }
51
+ }
52
+
53
+ // variable overrides inside variations
54
+ projectConfig.environments.forEach((environment) => {
55
+ if (feature.variations) {
56
+ feature.variations.forEach((variation) => {
57
+ if (variation.variables) {
58
+ variation.variables.forEach((variable) => {
59
+ if (variable.overrides) {
60
+ variable.overrides.forEach((override) => {
61
+ if (override.segments) {
62
+ extractSegmentKeysFromGroupSegments(override.segments).forEach((segmentKey) =>
63
+ usageInFeatures[featureKey].segments.add(segmentKey),
64
+ );
65
+ }
66
+
67
+ if (override.conditions) {
68
+ extractAttributeKeysFromConditions(override.conditions).forEach(
69
+ (attributeKey) => usageInFeatures[featureKey].attributes.add(attributeKey),
70
+ );
71
+ }
72
+ });
73
+ }
74
+ });
75
+ }
76
+ });
77
+ }
78
+
79
+ // force
80
+ if (feature.environments[environment].force) {
81
+ feature.environments[environment].force?.forEach((force) => {
82
+ if (force.segments) {
83
+ extractSegmentKeysFromGroupSegments(force.segments).forEach((segmentKey) =>
84
+ usageInFeatures[featureKey].segments.add(segmentKey),
85
+ );
86
+ }
87
+
88
+ if (force.conditions) {
89
+ extractAttributeKeysFromConditions(force.conditions).forEach((attributeKey) =>
90
+ usageInFeatures[featureKey].attributes.add(attributeKey),
91
+ );
92
+ }
93
+ });
94
+ }
95
+
96
+ // rules
97
+ if (feature.environments[environment].rules) {
98
+ feature.environments[environment].rules?.forEach((rule) => {
99
+ extractSegmentKeysFromGroupSegments(rule.segments).forEach((segmentKey) =>
100
+ usageInFeatures[featureKey].segments.add(segmentKey),
101
+ );
102
+ });
103
+ }
104
+ });
105
+ }
106
+
107
+ return usageInFeatures;
108
+ }
109
+
110
+ export interface UsageInSegments {
111
+ [segmentKey: string]: {
112
+ attributes: Set<AttributeKey>;
113
+ };
114
+ }
115
+
116
+ export async function findAllUsageInSegments(deps: Dependencies): Promise<UsageInSegments> {
117
+ const { datasource } = deps;
118
+ const usageInSegments: UsageInSegments = {};
119
+
120
+ const segmentKeys = await datasource.listSegments();
121
+
122
+ for (const segmentKey of segmentKeys) {
123
+ const segment = await datasource.readSegment(segmentKey);
124
+ usageInSegments[segmentKey] = {
125
+ attributes: new Set<AttributeKey>(),
126
+ };
127
+
128
+ extractAttributeKeysFromConditions(segment.conditions as Condition | Condition[]).forEach(
129
+ (attributeKey) => {
130
+ usageInSegments[segmentKey].attributes.add(attributeKey);
131
+ },
132
+ );
133
+ }
134
+
135
+ return usageInSegments;
136
+ }
137
+
138
+ export async function findSegmentUsage(
139
+ deps: Dependencies,
140
+ segmentKey: SegmentKey,
141
+ ): Promise<Set<FeatureKey>> {
142
+ const usedInFeatures = new Set<FeatureKey>();
143
+
144
+ const usageInFeatures = await findAllUsageInFeatures(deps);
145
+
146
+ for (const featureKey in usageInFeatures) {
147
+ if (usageInFeatures[featureKey].segments.has(segmentKey)) {
148
+ usedInFeatures.add(featureKey);
149
+ }
150
+ }
151
+
152
+ return usedInFeatures;
153
+ }
154
+
155
+ export interface AttributeUsage {
156
+ features: Set<FeatureKey>;
157
+ segments: Set<SegmentKey>;
158
+ }
159
+
160
+ export async function findAttributeUsage(
161
+ deps: Dependencies,
162
+ attributeKey: AttributeKey,
163
+ ): Promise<AttributeUsage> {
164
+ const usedIn: AttributeUsage = {
165
+ features: new Set<FeatureKey>(),
166
+ segments: new Set<SegmentKey>(),
167
+ };
168
+
169
+ const usageInFeatures = await findAllUsageInFeatures(deps);
170
+ const usageInSegments = await findAllUsageInSegments(deps);
171
+
172
+ for (const featureKey in usageInFeatures) {
173
+ if (usageInFeatures[featureKey].attributes.has(attributeKey)) {
174
+ usedIn.features.add(featureKey);
175
+ }
176
+ }
177
+
178
+ for (const segmentKey in usageInSegments) {
179
+ if (usageInSegments[segmentKey].attributes.has(attributeKey)) {
180
+ usedIn.segments.add(segmentKey);
181
+ }
182
+ }
183
+
184
+ return usedIn;
185
+ }
186
+
187
+ export async function findUnusedSegments(deps: Dependencies): Promise<Set<SegmentKey>> {
188
+ const { datasource } = deps;
189
+ const unusedSegments = new Set<SegmentKey>();
190
+
191
+ const allSegmentKeys = await datasource.listSegments();
192
+ const usageInFeatures = await findAllUsageInFeatures(deps);
193
+ const usedSegmentKeys = new Set<SegmentKey>();
194
+
195
+ for (const featureKey in usageInFeatures) {
196
+ usageInFeatures[featureKey].segments.forEach((segmentKey) => {
197
+ usedSegmentKeys.add(segmentKey);
198
+ });
199
+ }
200
+
201
+ allSegmentKeys.forEach((segmentKey) => {
202
+ if (!usedSegmentKeys.has(segmentKey)) {
203
+ unusedSegments.add(segmentKey);
204
+ }
205
+ });
206
+
207
+ return unusedSegments;
208
+ }
209
+
210
+ export async function findUnusedAttributes(deps: Dependencies): Promise<Set<AttributeKey>> {
211
+ const { datasource } = deps;
212
+ const unusedAttributes = new Set<AttributeKey>();
213
+
214
+ const allAttributeKeys = await datasource.listAttributes();
215
+ const usageInFeatures = await findAllUsageInFeatures(deps);
216
+ const usageInSegments = await findAllUsageInSegments(deps);
217
+ const usedAttributeKeys = new Set<AttributeKey>();
218
+
219
+ for (const featureKey in usageInFeatures) {
220
+ usageInFeatures[featureKey].attributes.forEach((attributeKey) => {
221
+ usedAttributeKeys.add(attributeKey);
222
+ });
223
+ }
224
+
225
+ for (const segmentKey in usageInSegments) {
226
+ usageInSegments[segmentKey].attributes.forEach((attributeKey) => {
227
+ usedAttributeKeys.add(attributeKey);
228
+ });
229
+ }
230
+
231
+ allAttributeKeys.forEach((attributeKey) => {
232
+ if (!usedAttributeKeys.has(attributeKey)) {
233
+ unusedAttributes.add(attributeKey);
234
+ }
235
+ });
236
+
237
+ return unusedAttributes;
238
+ }
239
+
240
+ export interface FindUsageOptions {
241
+ segment?: string;
242
+ attribute?: string;
243
+
244
+ unusedSegments?: boolean;
245
+ unusedAttributes?: boolean;
246
+ }
247
+
248
+ export async function findUsageInProject(deps: Dependencies, options: FindUsageOptions) {
249
+ console.log("");
250
+
251
+ // segment
252
+ if (options.segment) {
253
+ const usedInFeatures = await findSegmentUsage(deps, options.segment);
254
+
255
+ if (usedInFeatures.size === 0) {
256
+ console.log(`Segment "${options.segment}" is not used in any features.`);
257
+ } else {
258
+ console.log(`Segment "${options.segment}" is used in the following features:\n`);
259
+
260
+ usedInFeatures.forEach((featureKey) => {
261
+ console.log(` - ${featureKey}`);
262
+ });
263
+ }
264
+
265
+ return;
266
+ }
267
+
268
+ // attribute
269
+ if (options.attribute) {
270
+ const usedIn = await findAttributeUsage(deps, options.attribute);
271
+
272
+ if (usedIn.features.size === 0 && usedIn.segments.size === 0) {
273
+ console.log(`Attribute "${options.attribute}" is not used in any features or segments.`);
274
+
275
+ return;
276
+ }
277
+
278
+ if (usedIn.features.size > 0) {
279
+ console.log(`Attribute "${options.attribute}" is used in the following features:\n`);
280
+
281
+ usedIn.features.forEach((featureKey) => {
282
+ console.log(` - ${featureKey}`);
283
+ });
284
+
285
+ console.log("");
286
+ }
287
+
288
+ if (usedIn.segments.size > 0) {
289
+ console.log(`Attribute "${options.attribute}" is used in the following segments:\n`);
290
+
291
+ usedIn.segments.forEach((segmentKey) => {
292
+ console.log(` - ${segmentKey}`);
293
+ });
294
+ }
295
+
296
+ return;
297
+ }
298
+
299
+ // unused segments
300
+ if (options.unusedSegments) {
301
+ const unusedSegments = await findUnusedSegments(deps);
302
+
303
+ if (unusedSegments.size === 0) {
304
+ console.log("No unused segments found.");
305
+ } else {
306
+ console.log("Unused segments:\n");
307
+
308
+ unusedSegments.forEach((segmentKey) => {
309
+ console.log(` - ${segmentKey}`);
310
+ });
311
+ }
312
+
313
+ return;
314
+ }
315
+
316
+ // unused attributes
317
+ if (options.unusedAttributes) {
318
+ const unusedAttributes = await findUnusedAttributes(deps);
319
+
320
+ if (unusedAttributes.size === 0) {
321
+ console.log("No unused attributes found.");
322
+ } else {
323
+ console.log("Unused attributes:\n");
324
+
325
+ unusedAttributes.forEach((attributeKey) => {
326
+ console.log(` - ${attributeKey}`);
327
+ });
328
+ }
329
+
330
+ return;
331
+ }
332
+
333
+ console.log("Please specify a segment or attribute.");
334
+ }
package/src/index.ts CHANGED
@@ -7,5 +7,6 @@ export * from "./site";
7
7
  export * from "./generate-code";
8
8
  export * from "./restore";
9
9
  export * from "./find-duplicate-segments";
10
+ export * from "./find-usage";
10
11
  export * from "./dependencies";
11
12
  export * from "./datasource";