@featurevisor/core 0.53.1 → 0.53.3
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 +1 -1
- package/CHANGELOG.md +16 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/lib/builder/allocator.js.html +1 -1
- package/coverage/lcov-report/lib/builder/index.html +1 -1
- package/coverage/lcov-report/lib/builder/traffic.js.html +1 -1
- package/coverage/lcov-report/src/builder/allocator.ts.html +1 -1
- package/coverage/lcov-report/src/builder/index.html +1 -1
- package/coverage/lcov-report/src/builder/traffic.ts.html +1 -1
- package/lib/builder/buildDatafile.d.ts +1 -1
- package/lib/builder/buildDatafile.js +241 -168
- package/lib/builder/buildDatafile.js.map +1 -1
- package/lib/builder/buildProject.d.ts +1 -1
- package/lib/builder/buildProject.js +99 -40
- package/lib/builder/buildProject.js.map +1 -1
- package/lib/builder/getFeatureRanges.d.ts +1 -1
- package/lib/builder/getFeatureRanges.js +92 -31
- package/lib/builder/getFeatureRanges.js.map +1 -1
- package/lib/datasource/datasource.d.ts +16 -16
- package/lib/datasource/datasource.js +123 -67
- package/lib/datasource/datasource.js.map +1 -1
- package/lib/find-duplicate-segments/findDuplicateSegments.d.ts +1 -1
- package/lib/find-duplicate-segments/findDuplicateSegments.js +75 -18
- package/lib/find-duplicate-segments/findDuplicateSegments.js.map +1 -1
- package/lib/find-duplicate-segments/index.d.ts +1 -1
- package/lib/find-duplicate-segments/index.js +56 -9
- package/lib/find-duplicate-segments/index.js.map +1 -1
- package/lib/generate-code/index.d.ts +1 -1
- package/lib/generate-code/index.js +67 -23
- package/lib/generate-code/index.js.map +1 -1
- package/lib/generate-code/typescript.d.ts +1 -1
- package/lib/generate-code/typescript.js +139 -72
- package/lib/generate-code/typescript.js.map +1 -1
- package/lib/linter/checkCircularDependency.d.ts +1 -1
- package/lib/linter/checkCircularDependency.js +78 -22
- package/lib/linter/checkCircularDependency.js.map +1 -1
- package/lib/linter/groupSchema.js +79 -28
- package/lib/linter/groupSchema.js.map +1 -1
- package/lib/linter/lintProject.js +122 -101
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/restore.d.ts +1 -1
- package/lib/restore.js +53 -11
- package/lib/restore.js.map +1 -1
- package/lib/site/exportSite.d.ts +1 -1
- package/lib/site/exportSite.js +64 -21
- package/lib/site/exportSite.js.map +1 -1
- package/lib/site/generateSiteSearchIndex.d.ts +1 -1
- package/lib/site/generateSiteSearchIndex.js +203 -111
- package/lib/site/generateSiteSearchIndex.js.map +1 -1
- package/lib/tester/cliFormat.d.ts +3 -0
- package/lib/tester/cliFormat.js +7 -0
- package/lib/tester/cliFormat.js.map +1 -0
- package/lib/tester/testFeature.d.ts +1 -1
- package/lib/tester/testFeature.js +128 -59
- package/lib/tester/testFeature.js.map +1 -1
- package/lib/tester/testProject.d.ts +1 -1
- package/lib/tester/testProject.js +106 -39
- package/lib/tester/testProject.js.map +1 -1
- package/lib/tester/testSegment.d.ts +1 -1
- package/lib/tester/testSegment.js +70 -21
- package/lib/tester/testSegment.js.map +1 -1
- package/package.json +2 -2
- package/src/builder/buildDatafile.ts +9 -9
- package/src/builder/buildProject.ts +2 -2
- package/src/builder/getFeatureRanges.ts +4 -4
- package/src/datasource/datasource.ts +22 -69
- package/src/find-duplicate-segments/findDuplicateSegments.ts +9 -6
- package/src/find-duplicate-segments/index.ts +5 -2
- package/src/generate-code/index.ts +2 -2
- package/src/generate-code/typescript.ts +42 -25
- package/src/linter/checkCircularDependency.ts +4 -4
- package/src/linter/groupSchema.ts +3 -3
- package/src/linter/lintProject.ts +39 -39
- package/src/restore.ts +1 -1
- package/src/site/exportSite.ts +2 -2
- package/src/site/generateSiteSearchIndex.ts +14 -14
- package/src/tester/cliFormat.ts +4 -0
- package/src/tester/testFeature.ts +17 -11
- package/src/tester/testProject.ts +20 -7
- package/src/tester/testSegment.ts +9 -7
package/lib/restore.js
CHANGED
|
@@ -1,21 +1,63 @@
|
|
|
1
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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.restoreProject = void 0;
|
|
4
40
|
var path = require("path");
|
|
5
41
|
var child_process_1 = require("child_process");
|
|
6
42
|
function restoreProject(rootDirectoryPath, projectConfig) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
43
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
+
var relativeStateDirPath, cmd;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
relativeStateDirPath = path.relative(rootDirectoryPath, projectConfig.stateDirectoryPath);
|
|
47
|
+
cmd = "git checkout -- ".concat(relativeStateDirPath).concat(path.sep);
|
|
48
|
+
try {
|
|
49
|
+
(0, child_process_1.execSync)(cmd, {
|
|
50
|
+
cwd: rootDirectoryPath,
|
|
51
|
+
});
|
|
52
|
+
console.log("State files restored successfully.");
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
console.log("error:", e.message);
|
|
56
|
+
throw new Error("Failed to restore state files.");
|
|
57
|
+
}
|
|
58
|
+
return [2 /*return*/];
|
|
12
59
|
});
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
console.log("error:", e.message);
|
|
17
|
-
throw new Error("Failed to restore state files.");
|
|
18
|
-
}
|
|
60
|
+
});
|
|
19
61
|
}
|
|
20
62
|
exports.restoreProject = restoreProject;
|
|
21
63
|
//# sourceMappingURL=restore.js.map
|
package/lib/restore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore.js","sourceRoot":"","sources":["../src/restore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"restore.js","sourceRoot":"","sources":["../src/restore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA6B;AAC7B,+CAAyC;AAIzC,SAAsB,cAAc,CAAC,iBAAiB,EAAE,aAA4B;;;;YAC5E,oBAAoB,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;YAC1F,GAAG,GAAG,0BAAmB,oBAAoB,SAAG,IAAI,CAAC,GAAG,CAAE,CAAC;YAEjE,IAAI;gBACF,IAAA,wBAAQ,EAAC,GAAG,EAAE;oBACZ,GAAG,EAAE,iBAAiB;iBACvB,CAAC,CAAC;gBAEH,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;aACnD;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;gBAEjC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;aACnD;;;;CACF;AAfD,wCAeC"}
|
package/lib/site/exportSite.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ProjectConfig } from "../config";
|
|
2
|
-
export declare function exportSite(rootDirectoryPath: string, projectConfig: ProjectConfig): boolean
|
|
2
|
+
export declare function exportSite(rootDirectoryPath: string, projectConfig: ProjectConfig): Promise<boolean>;
|
package/lib/site/exportSite.js
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.exportSite = void 0;
|
|
4
40
|
var fs = require("fs");
|
|
@@ -8,27 +44,34 @@ var generateHistory_1 = require("./generateHistory");
|
|
|
8
44
|
var getRepoDetails_1 = require("./getRepoDetails");
|
|
9
45
|
var generateSiteSearchIndex_1 = require("./generateSiteSearchIndex");
|
|
10
46
|
function exportSite(rootDirectoryPath, projectConfig) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
+
var hasError, sitePackagePath, siteDistPath, sitePublicPath, fullHistory, repoDetails, searchIndex, searchIndexFilePath;
|
|
49
|
+
return __generator(this, function (_a) {
|
|
50
|
+
switch (_a.label) {
|
|
51
|
+
case 0:
|
|
52
|
+
hasError = false;
|
|
53
|
+
mkdirp.sync(projectConfig.siteExportDirectoryPath);
|
|
54
|
+
sitePackagePath = path.dirname(require.resolve("@featurevisor/site/package.json"));
|
|
55
|
+
siteDistPath = path.join(sitePackagePath, "dist");
|
|
56
|
+
fs.cpSync(siteDistPath, projectConfig.siteExportDirectoryPath, { recursive: true });
|
|
57
|
+
sitePublicPath = path.join(sitePackagePath, "public");
|
|
58
|
+
fs.cpSync(sitePublicPath, projectConfig.siteExportDirectoryPath, { recursive: true });
|
|
59
|
+
console.log("Site dist copied to:", projectConfig.siteExportDirectoryPath);
|
|
60
|
+
fullHistory = (0, generateHistory_1.generateHistory)(rootDirectoryPath, projectConfig);
|
|
61
|
+
repoDetails = (0, getRepoDetails_1.getRepoDetails)();
|
|
62
|
+
return [4 /*yield*/, (0, generateSiteSearchIndex_1.generateSiteSearchIndex)(rootDirectoryPath, projectConfig, fullHistory, repoDetails)];
|
|
63
|
+
case 1:
|
|
64
|
+
searchIndex = _a.sent();
|
|
65
|
+
searchIndexFilePath = path.join(projectConfig.siteExportDirectoryPath, "search-index.json");
|
|
66
|
+
fs.writeFileSync(searchIndexFilePath, JSON.stringify(searchIndex));
|
|
67
|
+
console.log("Site search index written at: ".concat(searchIndexFilePath));
|
|
68
|
+
// copy datafiles
|
|
69
|
+
fs.cpSync(projectConfig.outputDirectoryPath, path.join(projectConfig.siteExportDirectoryPath, "datafiles"), { recursive: true });
|
|
70
|
+
// @TODO: replace placeoholders in index.html
|
|
71
|
+
return [2 /*return*/, hasError];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
32
75
|
}
|
|
33
76
|
exports.exportSite = exportSite;
|
|
34
77
|
//# sourceMappingURL=exportSite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportSite.js","sourceRoot":"","sources":["../../src/site/exportSite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exportSite.js","sourceRoot":"","sources":["../../src/site/exportSite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB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AiC,mBAAmB,CAAE,CAAC,CAAC;oBAEpE,iBAAiB;oBACjB,EAAE,CAAC,MAAM,CACP,aAAa,CAAC,mBAAmB,EACjC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,uBAAuB,EAAE,WAAW,CAAC,EAC7D,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;oBAEF,6CAA6C;oBAE7C,sBAAO,QAAQ,EAAC;;;;CACjB;AAzCD,gCAyCC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HistoryEntry, SearchIndex } from "@featurevisor/types";
|
|
2
2
|
import { ProjectConfig } from "../config";
|
|
3
3
|
import { RepoDetails } from "./getRepoDetails";
|
|
4
|
-
export declare function generateSiteSearchIndex(rootDirectoryPath: string, projectConfig: ProjectConfig, fullHistory: HistoryEntry[], repoDetails: RepoDetails | undefined): SearchIndex
|
|
4
|
+
export declare function generateSiteSearchIndex(rootDirectoryPath: string, projectConfig: ProjectConfig, fullHistory: HistoryEntry[], repoDetails: RepoDetails | undefined): Promise<SearchIndex>;
|
|
@@ -10,6 +10,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
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;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "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
|
+
};
|
|
13
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
50
|
exports.generateSiteSearchIndex = void 0;
|
|
15
51
|
var datasource_1 = require("../datasource");
|
|
@@ -17,125 +53,181 @@ var utils_1 = require("../utils");
|
|
|
17
53
|
var getRelativePaths_1 = require("./getRelativePaths");
|
|
18
54
|
var getLastModifiedFromHistory_1 = require("./getLastModifiedFromHistory");
|
|
19
55
|
function generateSiteSearchIndex(rootDirectoryPath, projectConfig, fullHistory, repoDetails) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
commit: repoDetails.commitUrl,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Entities
|
|
47
|
-
*/
|
|
48
|
-
// usage
|
|
49
|
-
var attributesUsedInFeatures = {};
|
|
50
|
-
var attributesUsedInSegments = {};
|
|
51
|
-
var segmentsUsedInFeatures = {};
|
|
52
|
-
// features
|
|
53
|
-
var featureFiles = datasource.listFeatures();
|
|
54
|
-
featureFiles.forEach(function (entityName) {
|
|
55
|
-
var parsed = datasource.readFeature(entityName);
|
|
56
|
-
if (Array.isArray(parsed.variations)) {
|
|
57
|
-
parsed.variations.forEach(function (variation) {
|
|
58
|
-
if (!variation.variables) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
variation.variables.forEach(function (v) {
|
|
62
|
-
if (v.overrides) {
|
|
63
|
-
v.overrides.forEach(function (o) {
|
|
64
|
-
if (o.conditions) {
|
|
65
|
-
(0, utils_1.extractAttributeKeysFromConditions)(o.conditions).forEach(function (attributeKey) {
|
|
66
|
-
if (!attributesUsedInFeatures[attributeKey]) {
|
|
67
|
-
attributesUsedInFeatures[attributeKey] = new Set();
|
|
68
|
-
}
|
|
69
|
-
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
if (o.segments && o.segments !== "*") {
|
|
73
|
-
(0, utils_1.extractSegmentKeysFromGroupSegments)(o.segments).forEach(function (segmentKey) {
|
|
74
|
-
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
75
|
-
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
76
|
-
}
|
|
77
|
-
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
Object.keys(parsed.environments).forEach(function (environmentKey) {
|
|
86
|
-
var env = parsed.environments[environmentKey];
|
|
87
|
-
env.rules.forEach(function (rule) {
|
|
88
|
-
if (rule.segments && rule.segments !== "*") {
|
|
89
|
-
(0, utils_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach(function (segmentKey) {
|
|
90
|
-
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
91
|
-
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
var result, datasource, _a, relativeAttributesPath, relativeSegmentsPath, relativeFeaturesPath, prefix, attributesUsedInFeatures, attributesUsedInSegments, segmentsUsedInFeatures, featureFiles, _loop_1, _i, featureFiles_1, entityName, segmentFiles, _loop_2, _b, segmentFiles_1, entityName, attributeFiles, _c, attributeFiles_1, entityName, parsed;
|
|
58
|
+
return __generator(this, function (_d) {
|
|
59
|
+
switch (_d.label) {
|
|
60
|
+
case 0:
|
|
61
|
+
result = {
|
|
62
|
+
links: undefined,
|
|
63
|
+
entities: {
|
|
64
|
+
attributes: [],
|
|
65
|
+
segments: [],
|
|
66
|
+
features: [],
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
datasource = new datasource_1.Datasource(projectConfig);
|
|
70
|
+
/**
|
|
71
|
+
* Links
|
|
72
|
+
*/
|
|
73
|
+
if (repoDetails) {
|
|
74
|
+
_a = (0, getRelativePaths_1.getRelativePaths)(rootDirectoryPath, projectConfig), relativeAttributesPath = _a.relativeAttributesPath, relativeSegmentsPath = _a.relativeSegmentsPath, relativeFeaturesPath = _a.relativeFeaturesPath;
|
|
75
|
+
prefix = "";
|
|
76
|
+
if (repoDetails.topLevelPath !== rootDirectoryPath) {
|
|
77
|
+
prefix = rootDirectoryPath.replace(repoDetails.topLevelPath + "/", "") + "/";
|
|
92
78
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
79
|
+
result.links = {
|
|
80
|
+
attribute: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeAttributesPath + "/{{key}}." + datasource.getExtension()),
|
|
81
|
+
segment: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeSegmentsPath + "/{{key}}." + datasource.getExtension()),
|
|
82
|
+
feature: repoDetails.blobUrl.replace("{{blobPath}}", prefix + relativeFeaturesPath + "/{{key}}." + datasource.getExtension()),
|
|
83
|
+
commit: repoDetails.commitUrl,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
attributesUsedInFeatures = {};
|
|
87
|
+
attributesUsedInSegments = {};
|
|
88
|
+
segmentsUsedInFeatures = {};
|
|
89
|
+
return [4 /*yield*/, datasource.listFeatures()];
|
|
90
|
+
case 1:
|
|
91
|
+
featureFiles = _d.sent();
|
|
92
|
+
_loop_1 = function (entityName) {
|
|
93
|
+
var parsed;
|
|
94
|
+
return __generator(this, function (_e) {
|
|
95
|
+
switch (_e.label) {
|
|
96
|
+
case 0: return [4 /*yield*/, datasource.readFeature(entityName)];
|
|
97
|
+
case 1:
|
|
98
|
+
parsed = _e.sent();
|
|
99
|
+
if (Array.isArray(parsed.variations)) {
|
|
100
|
+
parsed.variations.forEach(function (variation) {
|
|
101
|
+
if (!variation.variables) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
variation.variables.forEach(function (v) {
|
|
105
|
+
if (v.overrides) {
|
|
106
|
+
v.overrides.forEach(function (o) {
|
|
107
|
+
if (o.conditions) {
|
|
108
|
+
(0, utils_1.extractAttributeKeysFromConditions)(o.conditions).forEach(function (attributeKey) {
|
|
109
|
+
if (!attributesUsedInFeatures[attributeKey]) {
|
|
110
|
+
attributesUsedInFeatures[attributeKey] = new Set();
|
|
111
|
+
}
|
|
112
|
+
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (o.segments && o.segments !== "*") {
|
|
116
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(o.segments).forEach(function (segmentKey) {
|
|
117
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
118
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
119
|
+
}
|
|
120
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
Object.keys(parsed.environments).forEach(function (environmentKey) {
|
|
129
|
+
var env = parsed.environments[environmentKey];
|
|
130
|
+
env.rules.forEach(function (rule) {
|
|
131
|
+
if (rule.segments && rule.segments !== "*") {
|
|
132
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(rule.segments).forEach(function (segmentKey) {
|
|
133
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
134
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
135
|
+
}
|
|
136
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
if (env.force) {
|
|
141
|
+
env.force.forEach(function (force) {
|
|
142
|
+
if (force.segments && force.segments !== "*") {
|
|
143
|
+
(0, utils_1.extractSegmentKeysFromGroupSegments)(force.segments).forEach(function (segmentKey) {
|
|
144
|
+
if (!segmentsUsedInFeatures[segmentKey]) {
|
|
145
|
+
segmentsUsedInFeatures[segmentKey] = new Set();
|
|
146
|
+
}
|
|
147
|
+
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (force.conditions) {
|
|
151
|
+
(0, utils_1.extractAttributeKeysFromConditions)(force.conditions).forEach(function (attributeKey) {
|
|
152
|
+
if (!attributesUsedInFeatures[attributeKey]) {
|
|
153
|
+
attributesUsedInFeatures[attributeKey] = new Set();
|
|
154
|
+
}
|
|
155
|
+
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
result.entities.features.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "feature", entityName) }));
|
|
162
|
+
return [2 /*return*/];
|
|
103
163
|
}
|
|
104
|
-
segmentsUsedInFeatures[segmentKey].add(entityName);
|
|
105
164
|
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
165
|
+
};
|
|
166
|
+
_i = 0, featureFiles_1 = featureFiles;
|
|
167
|
+
_d.label = 2;
|
|
168
|
+
case 2:
|
|
169
|
+
if (!(_i < featureFiles_1.length)) return [3 /*break*/, 5];
|
|
170
|
+
entityName = featureFiles_1[_i];
|
|
171
|
+
return [5 /*yield**/, _loop_1(entityName)];
|
|
172
|
+
case 3:
|
|
173
|
+
_d.sent();
|
|
174
|
+
_d.label = 4;
|
|
175
|
+
case 4:
|
|
176
|
+
_i++;
|
|
177
|
+
return [3 /*break*/, 2];
|
|
178
|
+
case 5: return [4 /*yield*/, datasource.listSegments()];
|
|
179
|
+
case 6:
|
|
180
|
+
segmentFiles = _d.sent();
|
|
181
|
+
_loop_2 = function (entityName) {
|
|
182
|
+
var parsed;
|
|
183
|
+
return __generator(this, function (_f) {
|
|
184
|
+
switch (_f.label) {
|
|
185
|
+
case 0: return [4 /*yield*/, datasource.readSegment(entityName)];
|
|
186
|
+
case 1:
|
|
187
|
+
parsed = _f.sent();
|
|
188
|
+
(0, utils_1.extractAttributeKeysFromConditions)(parsed.conditions).forEach(function (attributeKey) {
|
|
189
|
+
if (!attributesUsedInSegments[attributeKey]) {
|
|
190
|
+
attributesUsedInSegments[attributeKey] = new Set();
|
|
191
|
+
}
|
|
192
|
+
attributesUsedInSegments[attributeKey].add(entityName);
|
|
193
|
+
});
|
|
194
|
+
result.entities.segments.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "segment", entityName), usedInFeatures: Array.from(segmentsUsedInFeatures[entityName] || []) }));
|
|
195
|
+
return [2 /*return*/];
|
|
111
196
|
}
|
|
112
|
-
attributesUsedInFeatures[attributeKey].add(entityName);
|
|
113
197
|
});
|
|
114
|
-
}
|
|
115
|
-
|
|
198
|
+
};
|
|
199
|
+
_b = 0, segmentFiles_1 = segmentFiles;
|
|
200
|
+
_d.label = 7;
|
|
201
|
+
case 7:
|
|
202
|
+
if (!(_b < segmentFiles_1.length)) return [3 /*break*/, 10];
|
|
203
|
+
entityName = segmentFiles_1[_b];
|
|
204
|
+
return [5 /*yield**/, _loop_2(entityName)];
|
|
205
|
+
case 8:
|
|
206
|
+
_d.sent();
|
|
207
|
+
_d.label = 9;
|
|
208
|
+
case 9:
|
|
209
|
+
_b++;
|
|
210
|
+
return [3 /*break*/, 7];
|
|
211
|
+
case 10: return [4 /*yield*/, datasource.listAttributes()];
|
|
212
|
+
case 11:
|
|
213
|
+
attributeFiles = _d.sent();
|
|
214
|
+
_c = 0, attributeFiles_1 = attributeFiles;
|
|
215
|
+
_d.label = 12;
|
|
216
|
+
case 12:
|
|
217
|
+
if (!(_c < attributeFiles_1.length)) return [3 /*break*/, 15];
|
|
218
|
+
entityName = attributeFiles_1[_c];
|
|
219
|
+
return [4 /*yield*/, datasource.readAttribute(entityName)];
|
|
220
|
+
case 13:
|
|
221
|
+
parsed = _d.sent();
|
|
222
|
+
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] || []) }));
|
|
223
|
+
_d.label = 14;
|
|
224
|
+
case 14:
|
|
225
|
+
_c++;
|
|
226
|
+
return [3 /*break*/, 12];
|
|
227
|
+
case 15: return [2 /*return*/, result];
|
|
116
228
|
}
|
|
117
229
|
});
|
|
118
|
-
result.entities.features.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "feature", entityName) }));
|
|
119
|
-
});
|
|
120
|
-
// segments
|
|
121
|
-
var segmentFiles = datasource.listSegments();
|
|
122
|
-
segmentFiles.forEach(function (entityName) {
|
|
123
|
-
var parsed = datasource.readSegment(entityName);
|
|
124
|
-
(0, utils_1.extractAttributeKeysFromConditions)(parsed.conditions).forEach(function (attributeKey) {
|
|
125
|
-
if (!attributesUsedInSegments[attributeKey]) {
|
|
126
|
-
attributesUsedInSegments[attributeKey] = new Set();
|
|
127
|
-
}
|
|
128
|
-
attributesUsedInSegments[attributeKey].add(entityName);
|
|
129
|
-
});
|
|
130
|
-
result.entities.segments.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "segment", entityName), usedInFeatures: Array.from(segmentsUsedInFeatures[entityName] || []) }));
|
|
131
|
-
});
|
|
132
|
-
// attributes
|
|
133
|
-
var attributeFiles = datasource.listAttributes();
|
|
134
|
-
attributeFiles.forEach(function (entityName) {
|
|
135
|
-
var parsed = datasource.readAttribute(entityName);
|
|
136
|
-
result.entities.attributes.push(__assign(__assign({}, parsed), { key: entityName, lastModified: (0, getLastModifiedFromHistory_1.getLastModifiedFromHistory)(fullHistory, "attribute", entityName), usedInFeatures: Array.from(attributesUsedInFeatures[entityName] || []), usedInSegments: Array.from(attributesUsedInSegments[entityName] || []) }));
|
|
137
230
|
});
|
|
138
|
-
return result;
|
|
139
231
|
}
|
|
140
232
|
exports.generateSiteSearchIndex = generateSiteSearchIndex;
|
|
141
233
|
//# sourceMappingURL=generateSiteSearchIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSiteSearchIndex.js","sourceRoot":"","sources":["../../src/site/generateSiteSearchIndex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateSiteSearchIndex.js","sourceRoot":"","sources":["../../src/site/generateSiteSearchIndex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,4CAA2C;AAE3C,kCAAmG;AAEnG,uDAAsD;AACtD,2EAA0E;AAG1E,SAAsB,uBAAuB,CAC3C,iBAAyB,EACzB,aAA4B,EAC5B,WAA2B,EAC3B,WAAoC;;;;;;oBAE9B,MAAM,GAAgB;wBAC1B,KAAK,EAAE,SAAS;wBAChB,QAAQ,EAAE;4BACR,UAAU,EAAE,EAAE;4BACd,QAAQ,EAAE,EAAE;4BACZ,QAAQ,EAAE,EAAE;yBACb;qBACF,CAAC;oBACI,UAAU,GAAG,IAAI,uBAAU,CAAC,aAAa,CAAC,CAAC;oBAEjD;;uBAEG;oBACH,IAAI,WAAW,EAAE;wBACT,KAAyE,IAAA,mCAAgB,EAC7F,iBAAiB,EACjB,aAAa,CACd,EAHO,sBAAsB,4BAAA,EAAE,oBAAoB,0BAAA,EAAE,oBAAoB,0BAAA,CAGxE;wBAEE,MAAM,GAAG,EAAE,CAAC;wBAChB,I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EzD,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,uBAC1B,MAAM,KACT,GAAG,EAAE,UAAU,EACf,YAAY,EAAE,IAAA,uDAA0B,EAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,EAC9E,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EACtE,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,IACtE,CAAC;;;oBAToB,IAAc,CAAA;;yBAYvC,sBAAO,MAAM,EAAC;;;;CACf;AAzLD,0DAyLC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLI_FORMAT_BOLD = exports.CLI_FORMAT_GREEN = exports.CLI_FORMAT_RED = void 0;
|
|
4
|
+
exports.CLI_FORMAT_RED = "\x1b[31m%s\x1b[0m";
|
|
5
|
+
exports.CLI_FORMAT_GREEN = "\x1b[32m%s\x1b[0m";
|
|
6
|
+
exports.CLI_FORMAT_BOLD = "\x1b[1m%s\x1b[0m";
|
|
7
|
+
//# sourceMappingURL=cliFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliFormat.js","sourceRoot":"","sources":["../../src/tester/cliFormat.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,mBAAmB,CAAC;AACrC,QAAA,gBAAgB,GAAG,mBAAmB,CAAC;AAEvC,QAAA,eAAe,GAAG,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TestFeature } from "@featurevisor/types";
|
|
2
2
|
import { Datasource } from "../datasource";
|
|
3
3
|
import { ProjectConfig } from "../config";
|
|
4
|
-
export declare function testFeature(datasource: Datasource, projectConfig: ProjectConfig, test: TestFeature): boolean
|
|
4
|
+
export declare function testFeature(datasource: Datasource, projectConfig: ProjectConfig, test: TestFeature): Promise<boolean>;
|