@featurevisor/core 1.35.3 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +0 -6
- package/coverage/clover.xml +321 -237
- package/coverage/coverage-final.json +8 -8
- package/coverage/lcov-report/index.html +77 -47
- package/coverage/lcov-report/lib/builder/allocator.js.html +14 -14
- package/coverage/lcov-report/lib/builder/index.html +16 -16
- package/coverage/lcov-report/lib/builder/revision.js.html +3 -3
- package/coverage/lcov-report/lib/builder/traffic.js.html +88 -64
- package/coverage/lcov-report/lib/list/index.html +116 -0
- package/coverage/lcov-report/lib/{tester → list}/matrix.js.html +90 -66
- package/coverage/lcov-report/lib/tester/helpers.js.html +295 -0
- package/coverage/lcov-report/lib/tester/index.html +20 -35
- package/coverage/lcov-report/src/builder/allocator.ts.html +2 -2
- package/coverage/lcov-report/src/builder/index.html +15 -15
- package/coverage/lcov-report/src/builder/revision.ts.html +1 -1
- package/coverage/lcov-report/src/builder/traffic.ts.html +96 -24
- package/coverage/lcov-report/src/list/index.html +116 -0
- package/coverage/lcov-report/src/{tester → list}/matrix.ts.html +87 -21
- package/coverage/lcov-report/src/tester/helpers.ts.html +313 -0
- package/coverage/lcov-report/src/tester/index.html +20 -35
- package/coverage/lcov.info +592 -436
- package/lib/assess-distribution/index.d.ts +1 -1
- package/lib/assess-distribution/index.js +102 -162
- package/lib/assess-distribution/index.js.map +1 -1
- package/lib/benchmark/index.js +87 -143
- package/lib/benchmark/index.js.map +1 -1
- package/lib/builder/allocator.d.ts +1 -1
- package/lib/builder/allocator.js +12 -12
- package/lib/builder/allocator.js.map +1 -1
- package/lib/builder/allocator.spec.js +22 -22
- package/lib/builder/allocator.spec.js.map +1 -1
- package/lib/builder/buildDatafile.d.ts +4 -3
- package/lib/builder/buildDatafile.js +311 -388
- package/lib/builder/buildDatafile.js.map +1 -1
- package/lib/builder/buildProject.d.ts +2 -1
- package/lib/builder/buildProject.js +96 -183
- package/lib/builder/buildProject.js.map +1 -1
- package/lib/builder/convertToV1.d.ts +10 -0
- package/lib/builder/convertToV1.js +119 -0
- package/lib/builder/convertToV1.js.map +1 -0
- package/lib/builder/getFeatureRanges.d.ts +1 -1
- package/lib/builder/getFeatureRanges.js +32 -105
- package/lib/builder/getFeatureRanges.js.map +1 -1
- package/lib/builder/hashes.d.ts +4 -0
- package/lib/builder/hashes.js +70 -0
- package/lib/builder/hashes.js.map +1 -0
- package/lib/builder/revision.js +2 -2
- package/lib/builder/revision.js.map +1 -1
- package/lib/builder/revision.spec.js +1 -1
- package/lib/builder/revision.spec.js.map +1 -1
- package/lib/builder/traffic.d.ts +1 -1
- package/lib/builder/traffic.js +57 -49
- package/lib/builder/traffic.js.map +1 -1
- package/lib/builder/traffic.spec.js +14 -14
- package/lib/builder/traffic.spec.js.map +1 -1
- package/lib/cli/cli.js +60 -129
- package/lib/cli/cli.js.map +1 -1
- package/lib/cli/plugins.js +14 -16
- package/lib/cli/plugins.js.map +1 -1
- package/lib/config/parsers.js +1 -1
- package/lib/config/parsers.js.map +1 -1
- package/lib/config/projectConfig.d.ts +8 -6
- package/lib/config/projectConfig.js +31 -72
- package/lib/config/projectConfig.js.map +1 -1
- package/lib/datasource/adapter.d.ts +1 -1
- package/lib/datasource/adapter.js +2 -5
- package/lib/datasource/adapter.js.map +1 -1
- package/lib/datasource/datasource.d.ts +2 -1
- package/lib/datasource/datasource.js +107 -148
- package/lib/datasource/datasource.js.map +1 -1
- package/lib/datasource/filesystemAdapter.d.ts +1 -1
- package/lib/datasource/filesystemAdapter.js +224 -360
- package/lib/datasource/filesystemAdapter.js.map +1 -1
- package/lib/evaluate/index.d.ts +1 -1
- package/lib/evaluate/index.js +120 -188
- package/lib/evaluate/index.js.map +1 -1
- package/lib/find-duplicate-segments/findDuplicateSegments.d.ts +1 -1
- package/lib/find-duplicate-segments/findDuplicateSegments.js +40 -128
- package/lib/find-duplicate-segments/findDuplicateSegments.js.map +1 -1
- package/lib/find-duplicate-segments/index.js +27 -82
- package/lib/find-duplicate-segments/index.js.map +1 -1
- package/lib/find-usage/index.d.ts +7 -5
- package/lib/find-usage/index.js +333 -507
- package/lib/find-usage/index.js.map +1 -1
- package/lib/generate-code/index.js +36 -91
- package/lib/generate-code/index.js.map +1 -1
- package/lib/generate-code/typescript.js +117 -157
- package/lib/generate-code/typescript.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/info/index.js +45 -133
- package/lib/info/index.js.map +1 -1
- package/lib/init/index.d.ts +1 -1
- package/lib/init/index.js +16 -64
- package/lib/init/index.js.map +1 -1
- package/lib/linter/attributeSchema.d.ts +21 -6
- package/lib/linter/attributeSchema.js +18 -4
- package/lib/linter/attributeSchema.js.map +1 -1
- package/lib/linter/checkCircularDependency.d.ts +1 -1
- package/lib/linter/checkCircularDependency.js +22 -80
- package/lib/linter/checkCircularDependency.js.map +1 -1
- package/lib/linter/checkPercentageExceedingSlot.d.ts +1 -1
- package/lib/linter/checkPercentageExceedingSlot.js +36 -76
- package/lib/linter/checkPercentageExceedingSlot.js.map +1 -1
- package/lib/linter/conditionSchema.d.ts +1 -1
- package/lib/linter/conditionSchema.js +89 -41
- package/lib/linter/conditionSchema.js.map +1 -1
- package/lib/linter/featureSchema.d.ts +345 -197
- package/lib/linter/featureSchema.js +313 -172
- package/lib/linter/featureSchema.js.map +1 -1
- package/lib/linter/groupSchema.js +6 -6
- package/lib/linter/groupSchema.js.map +1 -1
- package/lib/linter/lintProject.js +306 -480
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/linter/printError.js +7 -7
- package/lib/linter/printError.js.map +1 -1
- package/lib/linter/segmentSchema.js +2 -2
- package/lib/linter/segmentSchema.js.map +1 -1
- package/lib/linter/testSchema.d.ts +155 -3
- package/lib/linter/testSchema.js +47 -17
- package/lib/linter/testSchema.js.map +1 -1
- package/lib/list/index.d.ts +1 -0
- package/lib/list/index.js +349 -517
- package/lib/list/index.js.map +1 -1
- package/lib/{tester → list}/matrix.d.ts +1 -1
- package/lib/{tester → list}/matrix.js +50 -42
- package/lib/list/matrix.js.map +1 -0
- package/lib/{tester → list}/matrix.spec.js +7 -7
- package/lib/list/matrix.spec.js.map +1 -0
- package/lib/site/exportSite.js +25 -71
- package/lib/site/exportSite.js.map +1 -1
- package/lib/site/generateHistory.d.ts +1 -1
- package/lib/site/generateHistory.js +26 -82
- package/lib/site/generateHistory.js.map +1 -1
- package/lib/site/generateSiteSearchIndex.d.ts +1 -1
- package/lib/site/generateSiteSearchIndex.js +182 -259
- package/lib/site/generateSiteSearchIndex.js.map +1 -1
- package/lib/site/getLastModifiedFromHistory.d.ts +1 -1
- package/lib/site/getLastModifiedFromHistory.js +2 -2
- package/lib/site/getLastModifiedFromHistory.js.map +1 -1
- package/lib/site/getOwnerAndRepoFromUrl.js +6 -6
- package/lib/site/getOwnerAndRepoFromUrl.js.map +1 -1
- package/lib/site/getRelativePaths.js +7 -7
- package/lib/site/getRelativePaths.js.map +1 -1
- package/lib/site/getRepoDetails.js +20 -20
- package/lib/site/getRepoDetails.js.map +1 -1
- package/lib/site/index.js +25 -73
- package/lib/site/index.js.map +1 -1
- package/lib/site/serveSite.js +10 -10
- package/lib/site/serveSite.js.map +1 -1
- package/lib/tester/helpers.d.ts +2 -0
- package/lib/tester/helpers.js +71 -0
- package/lib/tester/helpers.js.map +1 -0
- package/lib/tester/helpers.spec.js +115 -0
- package/lib/tester/helpers.spec.js.map +1 -0
- package/lib/tester/index.d.ts +0 -1
- package/lib/tester/index.js +0 -1
- package/lib/tester/index.js.map +1 -1
- package/lib/tester/prettyDuration.js +11 -11
- package/lib/tester/prettyDuration.js.map +1 -1
- package/lib/tester/printTestResult.d.ts +1 -1
- package/lib/tester/printTestResult.js +35 -15
- package/lib/tester/printTestResult.js.map +1 -1
- package/lib/tester/testFeature.d.ts +4 -2
- package/lib/tester/testFeature.js +264 -226
- package/lib/tester/testFeature.js.map +1 -1
- package/lib/tester/testProject.d.ts +3 -7
- package/lib/tester/testProject.js +145 -246
- package/lib/tester/testProject.js.map +1 -1
- package/lib/tester/testSegment.d.ts +5 -2
- package/lib/tester/testSegment.js +65 -102
- package/lib/tester/testSegment.js.map +1 -1
- package/lib/utils/extractKeys.d.ts +2 -1
- package/lib/utils/extractKeys.js +57 -12
- package/lib/utils/extractKeys.js.map +1 -1
- package/lib/utils/git.d.ts +1 -1
- package/lib/utils/git.js +23 -23
- package/lib/utils/git.js.map +1 -1
- package/lib/utils/pretty.js +2 -4
- package/lib/utils/pretty.js.map +1 -1
- package/package.json +5 -6
- package/src/assess-distribution/index.ts +3 -2
- package/src/benchmark/index.ts +3 -3
- package/src/builder/allocator.spec.ts +1 -1
- package/src/builder/allocator.ts +1 -1
- package/src/builder/buildDatafile.ts +161 -124
- package/src/builder/buildProject.ts +6 -3
- package/src/builder/convertToV1.ts +166 -0
- package/src/builder/getFeatureRanges.ts +1 -1
- package/src/builder/hashes.ts +109 -0
- package/src/builder/traffic.ts +40 -16
- package/src/cli/cli.ts +1 -1
- package/src/cli/plugins.ts +0 -2
- package/src/config/projectConfig.ts +13 -10
- package/src/datasource/adapter.ts +1 -1
- package/src/datasource/datasource.ts +23 -2
- package/src/datasource/filesystemAdapter.ts +11 -12
- package/src/evaluate/index.ts +7 -6
- package/src/find-duplicate-segments/findDuplicateSegments.ts +1 -1
- package/src/find-usage/index.ts +111 -44
- package/src/generate-code/index.ts +1 -3
- package/src/generate-code/typescript.ts +7 -29
- package/src/index.ts +0 -1
- package/src/info/index.ts +2 -2
- package/src/init/index.ts +2 -2
- package/src/linter/attributeSchema.ts +18 -2
- package/src/linter/checkCircularDependency.ts +1 -1
- package/src/linter/checkPercentageExceedingSlot.ts +28 -8
- package/src/linter/conditionSchema.ts +66 -10
- package/src/linter/featureSchema.ts +312 -116
- package/src/linter/lintProject.ts +9 -4
- package/src/linter/testSchema.ts +42 -3
- package/src/list/index.ts +18 -30
- package/src/{tester → list}/matrix.ts +33 -11
- package/src/site/exportSite.ts +2 -4
- package/src/site/generateHistory.ts +1 -1
- package/src/site/generateSiteSearchIndex.ts +58 -50
- package/src/site/getLastModifiedFromHistory.ts +1 -1
- package/src/tester/helpers.spec.ts +149 -0
- package/src/tester/helpers.ts +76 -0
- package/src/tester/index.ts +0 -1
- package/src/tester/printTestResult.ts +25 -3
- package/src/tester/testFeature.ts +270 -124
- package/src/tester/testProject.ts +28 -49
- package/src/tester/testSegment.ts +48 -40
- package/src/utils/extractKeys.ts +58 -1
- package/src/utils/git.ts +1 -1
- package/tsconfig.cjs.json +1 -0
- package/coverage/lcov-report/lib/tester/checkIfObjectsAreEqual.js.html +0 -151
- package/coverage/lcov-report/src/tester/checkIfObjectsAreEqual.ts.html +0 -157
- package/lib/restore/index.d.ts +0 -4
- package/lib/restore/index.js +0 -91
- package/lib/restore/index.js.map +0 -1
- package/lib/tester/checkIfArraysAreEqual.d.ts +0 -1
- package/lib/tester/checkIfArraysAreEqual.js +0 -18
- package/lib/tester/checkIfArraysAreEqual.js.map +0 -1
- package/lib/tester/checkIfObjectsAreEqual.d.ts +0 -1
- package/lib/tester/checkIfObjectsAreEqual.js +0 -23
- package/lib/tester/checkIfObjectsAreEqual.js.map +0 -1
- package/lib/tester/checkIfObjectsAreEqual.spec.js +0 -26
- package/lib/tester/checkIfObjectsAreEqual.spec.js.map +0 -1
- package/lib/tester/matrix.js.map +0 -1
- package/lib/tester/matrix.spec.js.map +0 -1
- package/src/restore/index.ts +0 -42
- package/src/tester/checkIfArraysAreEqual.ts +0 -16
- package/src/tester/checkIfObjectsAreEqual.spec.ts +0 -31
- package/src/tester/checkIfObjectsAreEqual.ts +0 -24
- /package/lib/{tester → list}/matrix.spec.d.ts +0 -0
- /package/lib/tester/{checkIfObjectsAreEqual.spec.d.ts → helpers.spec.d.ts} +0 -0
- /package/src/{tester → list}/matrix.spec.ts +0 -0
|
@@ -1,272 +1,195 @@
|
|
|
1
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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
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;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
3
|
exports.generateSiteSearchIndex = generateSiteSearchIndex;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function generateSiteSearchIndex(deps, fullHistory, repoDetails) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (v.overrides) {
|
|
109
|
-
v.overrides.forEach(function (o) {
|
|
110
|
-
if (o.conditions) {
|
|
111
|
-
(0, utils_1.extractAttributeKeysFromConditions)(o.conditions).forEach(function (attributeKey) {
|
|
112
|
-
if (!attributesUsedInFeatures[attributeKey]) {
|
|
113
|
-
attributesUsedInFeatures[attributeKey] = new Set();
|
|
114
|
-
}
|
|
115
|
-
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
if (o.segments && o.segments !== "*") {
|
|
119
|
-
(0, utils_1.extractSegmentKeysFromGroupSegments)(o.segments).forEach(function (segmentKey) {
|
|
120
|
-
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
121
|
-
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
122
|
-
}
|
|
123
|
-
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
// with environments
|
|
132
|
-
if (parsed.environments) {
|
|
133
|
-
Object.keys(parsed.environments).forEach(function (environmentKey) {
|
|
134
|
-
var env = parsed.environments[environmentKey];
|
|
135
|
-
env.rules.forEach(function (rule) {
|
|
136
|
-
if (rule.segments && rule.segments !== "*") {
|
|
137
|
-
(0, utils_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach(function (segmentKey) {
|
|
138
|
-
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
139
|
-
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
140
|
-
}
|
|
141
|
-
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
if (env.force) {
|
|
146
|
-
env.force.forEach(function (force) {
|
|
147
|
-
if (force.segments && force.segments !== "*") {
|
|
148
|
-
(0, utils_1.extractSegmentKeysFromGroupSegments)(force.segments).forEach(function (segmentKey) {
|
|
149
|
-
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
150
|
-
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
151
|
-
}
|
|
152
|
-
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (force.conditions) {
|
|
156
|
-
(0, utils_1.extractAttributeKeysFromConditions)(force.conditions).forEach(function (attributeKey) {
|
|
157
|
-
if (!attributesUsedInFeatures[attributeKey]) {
|
|
158
|
-
attributesUsedInFeatures[attributeKey] = new Set();
|
|
159
|
-
}
|
|
160
|
-
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
// no environments
|
|
168
|
-
if (parsed.rules) {
|
|
169
|
-
parsed.rules.forEach(function (rule) {
|
|
170
|
-
if (rule.segments && rule.segments !== "*") {
|
|
171
|
-
(0, utils_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach(function (segmentKey) {
|
|
172
|
-
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
173
|
-
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
174
|
-
}
|
|
175
|
-
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
});
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const getRelativePaths_1 = require("./getRelativePaths");
|
|
6
|
+
const getLastModifiedFromHistory_1 = require("./getLastModifiedFromHistory");
|
|
7
|
+
async function generateSiteSearchIndex(deps, fullHistory, repoDetails) {
|
|
8
|
+
const { rootDirectoryPath, projectConfig, datasource } = deps;
|
|
9
|
+
const result = {
|
|
10
|
+
links: undefined,
|
|
11
|
+
projectConfig: {
|
|
12
|
+
tags: projectConfig.tags,
|
|
13
|
+
environments: projectConfig.environments,
|
|
14
|
+
},
|
|
15
|
+
entities: {
|
|
16
|
+
attributes: [],
|
|
17
|
+
segments: [],
|
|
18
|
+
features: [],
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Links
|
|
23
|
+
*/
|
|
24
|
+
if (repoDetails) {
|
|
25
|
+
const { relativeAttributesPath, relativeSegmentsPath, relativeFeaturesPath } = (0, getRelativePaths_1.getRelativePaths)(rootDirectoryPath, projectConfig);
|
|
26
|
+
let prefix = "";
|
|
27
|
+
if (repoDetails.topLevelPath !== rootDirectoryPath) {
|
|
28
|
+
prefix = rootDirectoryPath.replace(repoDetails.topLevelPath + "/", "") + "/";
|
|
29
|
+
}
|
|
30
|
+
result.links = {
|
|
31
|
+
attribute: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeAttributesPath + "/{{key}}." + datasource.getExtension()),
|
|
32
|
+
segment: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeSegmentsPath + "/{{key}}." + datasource.getExtension()),
|
|
33
|
+
feature: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeFeaturesPath + "/{{key}}." + datasource.getExtension()),
|
|
34
|
+
commit: repoDetails.commitUrl,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Entities
|
|
39
|
+
*/
|
|
40
|
+
// usage
|
|
41
|
+
const attributesUsedInFeatures = {};
|
|
42
|
+
const attributesUsedInSegments = {};
|
|
43
|
+
const segmentsUsedInFeatures = {};
|
|
44
|
+
// features
|
|
45
|
+
const featureFiles = await datasource.listFeatures();
|
|
46
|
+
for (const entityName of featureFiles) {
|
|
47
|
+
const parsed = await datasource.readFeature(entityName);
|
|
48
|
+
if (Array.isArray(parsed.variations)) {
|
|
49
|
+
parsed.variations.forEach((variation) => {
|
|
50
|
+
if (!variation.variableOverrides) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
Object.keys(variation.variableOverrides).forEach((variableKey) => {
|
|
54
|
+
const overrides = variation.variableOverrides?.[variableKey];
|
|
55
|
+
if (overrides) {
|
|
56
|
+
overrides.forEach((o) => {
|
|
57
|
+
if (o.conditions) {
|
|
58
|
+
(0, utils_1.extractAttributeKeysFromConditions)(o.conditions).forEach((attributeKey) => {
|
|
59
|
+
if (!attributesUsedInFeatures[attributeKey]) {
|
|
60
|
+
attributesUsedInFeatures[attributeKey] = new Set();
|
|
179
61
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
if (force.conditions) {
|
|
191
|
-
(0, utils_1.extractAttributeKeysFromConditions)(force.conditions).forEach(function (attributeKey) {
|
|
192
|
-
if (!attributesUsedInFeatures[attributeKey]) {
|
|
193
|
-
attributesUsedInFeatures[attributeKey] = new Set();
|
|
194
|
-
}
|
|
195
|
-
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
});
|
|
62
|
+
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (o.segments && o.segments !== "*") {
|
|
66
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(o.segments).forEach((segmentKey) => {
|
|
67
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
68
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
199
69
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
70
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// rules
|
|
79
|
+
if (parsed.rules) {
|
|
80
|
+
if (!Array.isArray(parsed.rules)) {
|
|
81
|
+
// with environments
|
|
82
|
+
Object.keys(parsed.rules).forEach((environmentKey) => {
|
|
83
|
+
const rules = parsed.rules?.[environmentKey];
|
|
84
|
+
rules.forEach((rule) => {
|
|
85
|
+
if (rule.segments && rule.segments !== "*") {
|
|
86
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach((segmentKey) => {
|
|
87
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
88
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
89
|
+
}
|
|
90
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// no environments
|
|
98
|
+
parsed.rules.forEach((rule) => {
|
|
99
|
+
if (rule.segments && rule.segments !== "*") {
|
|
100
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach((segmentKey) => {
|
|
101
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
102
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
203
103
|
}
|
|
104
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
204
105
|
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// force
|
|
111
|
+
if (parsed.force) {
|
|
112
|
+
if (!Array.isArray(parsed.force)) {
|
|
113
|
+
// with environments
|
|
114
|
+
Object.keys(parsed.force).forEach((environmentKey) => {
|
|
115
|
+
parsed.force?.[environmentKey].forEach((force) => {
|
|
116
|
+
if (force.segments && force.segments !== "*") {
|
|
117
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(force.segments).forEach((segmentKey) => {
|
|
118
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
119
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
120
|
+
}
|
|
121
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (force.conditions) {
|
|
125
|
+
(0, utils_1.extractAttributeKeysFromConditions)(force.conditions).forEach((attributeKey) => {
|
|
126
|
+
if (!attributesUsedInFeatures[attributeKey]) {
|
|
127
|
+
attributesUsedInFeatures[attributeKey] = new Set();
|
|
128
|
+
}
|
|
129
|
+
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// no environments
|
|
137
|
+
parsed.force.forEach((force) => {
|
|
138
|
+
if (force.segments && force.segments !== "*") {
|
|
139
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(force.segments).forEach((segmentKey) => {
|
|
140
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
141
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
142
|
+
}
|
|
143
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (force.conditions) {
|
|
147
|
+
(0, utils_1.extractAttributeKeysFromConditions)(force.conditions).forEach((attributeKey) => {
|
|
148
|
+
if (!attributesUsedInFeatures[attributeKey]) {
|
|
149
|
+
attributesUsedInFeatures[attributeKey] = new Set();
|
|
236
150
|
}
|
|
151
|
+
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
237
152
|
});
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
case 12:
|
|
257
|
-
if (!(_c < attributeFiles_1.length)) return [3 /*break*/, 15];
|
|
258
|
-
entityName = attributeFiles_1[_c];
|
|
259
|
-
return [4 /*yield*/, datasource.readAttribute(entityName)];
|
|
260
|
-
case 13:
|
|
261
|
-
parsed = _d.sent();
|
|
262
|
-
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] || []) }));
|
|
263
|
-
_d.label = 14;
|
|
264
|
-
case 14:
|
|
265
|
-
_c++;
|
|
266
|
-
return [3 /*break*/, 12];
|
|
267
|
-
case 15: return [2 /*return*/, result];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// push
|
|
158
|
+
result.entities.features.push({
|
|
159
|
+
...parsed,
|
|
160
|
+
key: entityName,
|
|
161
|
+
lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "feature", entityName),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// segments
|
|
165
|
+
const segmentFiles = await datasource.listSegments();
|
|
166
|
+
for (const entityName of segmentFiles) {
|
|
167
|
+
const parsed = await datasource.readSegment(entityName);
|
|
168
|
+
(0, utils_1.extractAttributeKeysFromConditions)(parsed.conditions).forEach((attributeKey) => {
|
|
169
|
+
if (!attributesUsedInSegments[attributeKey]) {
|
|
170
|
+
attributesUsedInSegments[attributeKey] = new Set();
|
|
268
171
|
}
|
|
172
|
+
attributesUsedInSegments[attributeKey].add(entityName);
|
|
269
173
|
});
|
|
270
|
-
|
|
174
|
+
result.entities.segments.push({
|
|
175
|
+
...parsed,
|
|
176
|
+
key: entityName,
|
|
177
|
+
lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "segment", entityName),
|
|
178
|
+
usedInFeatures: Array.from(segmentsUsedInFeatures[entityName] || []),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
// attributes
|
|
182
|
+
const attributeFiles = await datasource.listAttributes();
|
|
183
|
+
for (const entityName of attributeFiles) {
|
|
184
|
+
const parsed = await datasource.readAttribute(entityName);
|
|
185
|
+
result.entities.attributes.push({
|
|
186
|
+
...parsed,
|
|
187
|
+
key: entityName,
|
|
188
|
+
lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "attribute", entityName),
|
|
189
|
+
usedInFeatures: Array.from(attributesUsedInFeatures[entityName] || []),
|
|
190
|
+
usedInSegments: Array.from(attributesUsedInSegments[entityName] || []),
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
271
194
|
}
|
|
272
195
|
//# sourceMappingURL=generateSiteSearchIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSiteSearchIndex.js","sourceRoot":"","sources":["../../src/site/generateSiteSearchIndex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC5B,GAAG,MAAM;YACT,GAAG,EAAE,UAAU;YACf,YAAY,EAAE,IAAA,uDAA0B,EAAC,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC;YAC5E,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;SACrE,CAAC,CAAC;IACL,CAAC;IAED,aAAa;IACb,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC;IACzD,KAAK,MAAM,UAAU,IAAI,cAAc,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAE1D,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC;YAC9B,GAAG,MAAM;YACT,GAAG,EAAE,UAAU;YACf,YAAY,EAAE,IAAA,uDAA0B,EAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC;YAC9E,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YACtE,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;SACvE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HistoryEntry, LastModified } from "@featurevisor/types";
|
|
1
|
+
import type { HistoryEntry, LastModified } from "@featurevisor/types";
|
|
2
2
|
export declare function getLastModifiedFromHistory(fullHistory: HistoryEntry[], type: any, key: any): LastModified | undefined;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLastModifiedFromHistory = getLastModifiedFromHistory;
|
|
4
4
|
function getLastModifiedFromHistory(fullHistory, type, key) {
|
|
5
|
-
|
|
6
|
-
return entry.entities.find(
|
|
5
|
+
const lastModified = fullHistory.find((entry) => {
|
|
6
|
+
return entry.entities.find((entity) => {
|
|
7
7
|
return entity.type === type && entity.key === key;
|
|
8
8
|
});
|
|
9
9
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLastModifiedFromHistory.js","sourceRoot":"","sources":["../../src/site/getLastModifiedFromHistory.ts"],"names":[],"mappings":";;AAEA,gEAkBC;AAlBD,SAAgB,0BAA0B,CACxC,WAA2B,EAC3B,IAAI,EACJ,GAAG;IAEH,
|
|
1
|
+
{"version":3,"file":"getLastModifiedFromHistory.js","sourceRoot":"","sources":["../../src/site/getLastModifiedFromHistory.ts"],"names":[],"mappings":";;AAEA,gEAkBC;AAlBD,SAAgB,0BAA0B,CACxC,WAA2B,EAC3B,IAAI,EACJ,GAAG;IAEH,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACpC,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO;YACL,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,SAAS,EAAE,YAAY,CAAC,SAAS;YACjC,MAAM,EAAE,YAAY,CAAC,MAAM;SAC5B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOwnerAndRepoFromUrl = getOwnerAndRepoFromUrl;
|
|
4
4
|
function getOwnerAndRepoFromUrl(url) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
let owner;
|
|
6
|
+
let repo;
|
|
7
7
|
if (url.startsWith("https://")) {
|
|
8
|
-
|
|
8
|
+
const parts = url.split("/");
|
|
9
9
|
repo = parts.pop().replace(".git", "");
|
|
10
10
|
owner = parts.pop();
|
|
11
11
|
}
|
|
12
12
|
else if (url.startsWith("git@")) {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const urlParts = url.split(":");
|
|
14
|
+
const parts = urlParts[1].split("/");
|
|
15
15
|
repo = parts.pop().replace(".git", "");
|
|
16
16
|
owner = parts.pop();
|
|
17
17
|
}
|
|
18
|
-
return { owner
|
|
18
|
+
return { owner, repo };
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=getOwnerAndRepoFromUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOwnerAndRepoFromUrl.js","sourceRoot":"","sources":["../../src/site/getOwnerAndRepoFromUrl.ts"],"names":[],"mappings":";;AAAA,wDAgBC;AAhBD,SAAgB,sBAAsB,CAAC,GAAW;IAChD,IAAI,KAAK,CAAC;IACV,IAAI,IAAI,CAAC;IAET,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,
|
|
1
|
+
{"version":3,"file":"getOwnerAndRepoFromUrl.js","sourceRoot":"","sources":["../../src/site/getOwnerAndRepoFromUrl.ts"],"names":[],"mappings":";;AAAA,wDAgBC;AAhBD,SAAgB,sBAAsB,CAAC,GAAW;IAChD,IAAI,KAAK,CAAC;IACV,IAAI,IAAI,CAAC;IAET,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,GAAI,KAAK,CAAC,GAAG,EAAa,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACnD,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;IACtB,CAAC;SAAM,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,GAAI,KAAK,CAAC,GAAG,EAAa,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACnD,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRelativePaths = getRelativePaths;
|
|
4
|
-
|
|
4
|
+
const path = require("path");
|
|
5
5
|
function getRelativePaths(rootDirectoryPath, projectConfig) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const relativeFeaturesPath = path.relative(rootDirectoryPath, projectConfig.featuresDirectoryPath);
|
|
7
|
+
const relativeSegmentsPath = path.relative(rootDirectoryPath, projectConfig.segmentsDirectoryPath);
|
|
8
|
+
const relativeAttributesPath = path.relative(rootDirectoryPath, projectConfig.attributesDirectoryPath);
|
|
9
9
|
return {
|
|
10
|
-
relativeFeaturesPath
|
|
11
|
-
relativeSegmentsPath
|
|
12
|
-
relativeAttributesPath
|
|
10
|
+
relativeFeaturesPath,
|
|
11
|
+
relativeSegmentsPath,
|
|
12
|
+
relativeAttributesPath,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=getRelativePaths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRelativePaths.js","sourceRoot":"","sources":["../../src/site/getRelativePaths.ts"],"names":[],"mappings":";;AAIA,4CAmBC;AAvBD,
|
|
1
|
+
{"version":3,"file":"getRelativePaths.js","sourceRoot":"","sources":["../../src/site/getRelativePaths.ts"],"names":[],"mappings":";;AAIA,4CAmBC;AAvBD,6BAA6B;AAI7B,SAAgB,gBAAgB,CAAC,iBAAiB,EAAE,aAA4B;IAC9E,MAAM,oBAAoB,GAAG,IAAI,CAAC,QAAQ,CACxC,iBAAiB,EACjB,aAAa,CAAC,qBAAqB,CACpC,CAAC;IACF,MAAM,oBAAoB,GAAG,IAAI,CAAC,QAAQ,CACxC,iBAAiB,EACjB,aAAa,CAAC,qBAAqB,CACpC,CAAC;IACF,MAAM,sBAAsB,GAAG,IAAI,CAAC,QAAQ,CAC1C,iBAAiB,EACjB,aAAa,CAAC,uBAAuB,CACtC,CAAC;IAEF,OAAO;QACL,oBAAoB;QACpB,oBAAoB;QACpB,sBAAsB;KACvB,CAAC;AACJ,CAAC"}
|