@featurevisor/core 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -1
- package/CHANGELOG.md +11 -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/revision.js.html +1 -1
- package/coverage/lcov-report/lib/builder/traffic.js.html +1 -1
- package/coverage/lcov-report/lib/tester/checkIfObjectsAreEqual.js.html +1 -1
- package/coverage/lcov-report/lib/tester/index.html +1 -1
- package/coverage/lcov-report/lib/tester/matrix.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/revision.ts.html +1 -1
- package/coverage/lcov-report/src/builder/traffic.ts.html +1 -1
- package/coverage/lcov-report/src/tester/checkIfObjectsAreEqual.ts.html +1 -1
- package/coverage/lcov-report/src/tester/index.html +1 -1
- package/coverage/lcov-report/src/tester/matrix.ts.html +1 -1
- package/lib/assess-distribution/index.d.ts +2 -0
- package/lib/assess-distribution/index.js +37 -1
- package/lib/assess-distribution/index.js.map +1 -1
- package/lib/benchmark/index.d.ts +2 -0
- package/lib/benchmark/index.js +43 -1
- package/lib/benchmark/index.js.map +1 -1
- package/lib/builder/buildProject.d.ts +2 -0
- package/lib/builder/buildProject.js +48 -1
- package/lib/builder/buildProject.js.map +1 -1
- package/lib/cli/cli.d.ts +26 -0
- package/lib/cli/cli.js +133 -0
- package/lib/cli/cli.js.map +1 -0
- package/lib/cli/index.d.ts +2 -0
- package/lib/cli/index.js +19 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/plugins.d.ts +4 -0
- package/lib/cli/plugins.js +37 -0
- package/lib/cli/plugins.js.map +1 -0
- package/lib/config/projectConfig.d.ts +3 -0
- package/lib/config/projectConfig.js +69 -1
- package/lib/config/projectConfig.js.map +1 -1
- package/lib/evaluate/index.d.ts +2 -0
- package/lib/evaluate/index.js +35 -1
- package/lib/evaluate/index.js.map +1 -1
- package/lib/find-duplicate-segments/index.d.ts +2 -0
- package/lib/find-duplicate-segments/index.js +34 -1
- package/lib/find-duplicate-segments/index.js.map +1 -1
- package/lib/find-usage/index.d.ts +2 -0
- package/lib/find-usage/index.js +50 -1
- package/lib/find-usage/index.js.map +1 -1
- package/lib/generate-code/index.d.ts +2 -0
- package/lib/generate-code/index.js +31 -1
- package/lib/generate-code/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/info/index.d.ts +2 -0
- package/lib/info/index.js +28 -1
- package/lib/info/index.js.map +1 -1
- package/lib/init/index.d.ts +2 -0
- package/lib/init/index.js +65 -1
- package/lib/init/index.js.map +1 -1
- package/lib/linter/lintProject.d.ts +2 -0
- package/lib/linter/lintProject.js +56 -1
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/restore/index.d.ts +2 -0
- package/lib/restore/index.js +28 -1
- package/lib/restore/index.js.map +1 -1
- package/lib/site/index.d.ts +2 -2
- package/lib/site/index.js +86 -14
- package/lib/site/index.js.map +1 -1
- package/lib/tester/testProject.d.ts +2 -0
- package/lib/tester/testProject.js +52 -1
- package/lib/tester/testProject.js.map +1 -1
- package/package.json +3 -2
- package/src/assess-distribution/index.ts +32 -0
- package/src/benchmark/index.ts +40 -0
- package/src/builder/buildProject.ts +42 -0
- package/src/cli/cli.ts +105 -0
- package/src/cli/index.ts +2 -0
- package/src/cli/plugins.ts +38 -0
- package/src/config/projectConfig.ts +28 -0
- package/src/evaluate/index.ts +30 -0
- package/src/find-duplicate-segments/index.ts +28 -0
- package/src/find-usage/index.ts +44 -0
- package/src/generate-code/index.ts +25 -0
- package/src/index.ts +1 -0
- package/src/info/index.ts +19 -0
- package/src/init/index.ts +21 -0
- package/src/linter/lintProject.ts +51 -0
- package/src/restore/index.ts +19 -0
- package/src/site/index.ts +46 -2
- package/src/tester/testProject.ts +46 -0
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.buildProject = void 0;
|
|
39
|
+
exports.buildPlugin = exports.buildProject = void 0;
|
|
40
40
|
var config_1 = require("../config");
|
|
41
41
|
var revision_1 = require("./revision");
|
|
42
42
|
var buildDatafile_1 = require("./buildDatafile");
|
|
@@ -132,4 +132,51 @@ function buildProject(deps, cliOptions) {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
exports.buildProject = buildProject;
|
|
135
|
+
exports.buildPlugin = {
|
|
136
|
+
command: "build",
|
|
137
|
+
handler: function (_a) {
|
|
138
|
+
var rootDirectoryPath = _a.rootDirectoryPath, projectConfig = _a.projectConfig, datasource = _a.datasource, parsed = _a.parsed;
|
|
139
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
140
|
+
return __generator(this, function (_b) {
|
|
141
|
+
switch (_b.label) {
|
|
142
|
+
case 0: return [4 /*yield*/, buildProject({
|
|
143
|
+
rootDirectoryPath: rootDirectoryPath,
|
|
144
|
+
projectConfig: projectConfig,
|
|
145
|
+
datasource: datasource,
|
|
146
|
+
options: parsed,
|
|
147
|
+
}, parsed)];
|
|
148
|
+
case 1:
|
|
149
|
+
_b.sent();
|
|
150
|
+
return [2 /*return*/];
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
examples: [
|
|
156
|
+
{
|
|
157
|
+
command: "build",
|
|
158
|
+
description: "build datafiles for all environments and tags",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
command: "build --revision=123",
|
|
162
|
+
description: "build datafiles starting with revision value as 123",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
command: "build --environment=production",
|
|
166
|
+
description: "build datafiles for production environment",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
command: "build --print --environment=production --feature=featureKey",
|
|
170
|
+
description: "print datafile for a feature in production environment",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
command: "build --print --environment=production --pretty",
|
|
174
|
+
description: "print datafile with pretty print",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
command: "build --no-state-files",
|
|
178
|
+
description: "build datafiles without writing state files",
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
};
|
|
135
182
|
//# sourceMappingURL=buildProject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildProject.js","sourceRoot":"","sources":["../../src/builder/buildProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAA2C;AAE3C,uCAA6C;AAC7C,iDAAmE;
|
|
1
|
+
{"version":3,"file":"buildProject.js","sourceRoot":"","sources":["../../src/builder/buildProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAA2C;AAE3C,uCAA6C;AAC7C,iDAAmE;AAenE,SAAsB,YAAY,CAAC,IAAkB,EAAE,UAAgC;IAAhC,2BAAA,EAAA,eAAgC;;;;;;oBAC7E,aAAa,GAAiB,IAAI,cAArB,EAAE,UAAU,GAAK,IAAI,WAAT,CAAU;yBAYvC,CAAA,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,KAAK,CAAA,EAA1C,wBAA0C;oBACpB,qBAAM,IAAA,iCAAiB,EAAC;4BAC9C,UAAU,EAAE,UAAU,CAAC,OAAO;4BAC9B,WAAW,EAAE,UAAU,CAAC,WAAW;4BACnC,aAAa,eAAA;4BACb,UAAU,YAAA;4BACV,QAAQ,EAAE,UAAU,CAAC,QAAQ;yBAC9B,CAAC,EAAA;;oBANI,eAAe,GAAG,SAMtB;oBAEF,IAAI,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AChD;QACD;YACE,OAAO,EAAE,wBAAwB;YACjC,WAAW,EAAE,6CAA6C;SAC3D;KACF;CACF,CAAC"}
|
package/lib/cli/cli.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ProjectConfig } from "../config";
|
|
2
|
+
import { Datasource } from "../datasource";
|
|
3
|
+
export interface ParsedOptions {
|
|
4
|
+
_: string[];
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginHandlerOptions {
|
|
8
|
+
rootDirectoryPath: string;
|
|
9
|
+
projectConfig: ProjectConfig;
|
|
10
|
+
datasource: Datasource;
|
|
11
|
+
parsed: ParsedOptions;
|
|
12
|
+
}
|
|
13
|
+
export interface Plugin {
|
|
14
|
+
command: string;
|
|
15
|
+
handler: (options: PluginHandlerOptions) => Promise<void | boolean>;
|
|
16
|
+
examples: {
|
|
17
|
+
command: string;
|
|
18
|
+
description: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export interface RunnerOptions {
|
|
22
|
+
rootDirectoryPath: string;
|
|
23
|
+
projectConfig?: ProjectConfig;
|
|
24
|
+
datasource?: Datasource;
|
|
25
|
+
}
|
|
26
|
+
export declare function runCLI(runnerOptions: RunnerOptions): Promise<void>;
|
package/lib/cli/cli.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.runCLI = void 0;
|
|
49
|
+
var plugins_1 = require("./plugins");
|
|
50
|
+
function runCLI(runnerOptions) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
+
function registerPlugin(plugin) {
|
|
53
|
+
var subcommand = plugin.command.split(" ")[0];
|
|
54
|
+
if (registeredSubcommands.includes(subcommand)) {
|
|
55
|
+
console.warn("Plugin \"".concat(subcommand, "\" already registered. Skipping."));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
y = y.command({
|
|
59
|
+
command: plugin.command,
|
|
60
|
+
handler: function (parsed) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
+
var result, error_1;
|
|
63
|
+
return __generator(this, function (_a) {
|
|
64
|
+
switch (_a.label) {
|
|
65
|
+
case 0:
|
|
66
|
+
_a.trys.push([0, 2, , 3]);
|
|
67
|
+
return [4 /*yield*/, plugin.handler({
|
|
68
|
+
rootDirectoryPath: rootDirectoryPath,
|
|
69
|
+
projectConfig: projectConfig,
|
|
70
|
+
datasource: datasource,
|
|
71
|
+
parsed: parsed,
|
|
72
|
+
})];
|
|
73
|
+
case 1:
|
|
74
|
+
result = _a.sent();
|
|
75
|
+
if (result === false) {
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
return [3 /*break*/, 3];
|
|
79
|
+
case 2:
|
|
80
|
+
error_1 = _a.sent();
|
|
81
|
+
console.error(error_1);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
return [3 /*break*/, 3];
|
|
84
|
+
case 3: return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
for (var _i = 0, _a = plugin.examples; _i < _a.length; _i++) {
|
|
91
|
+
var example = _a[_i];
|
|
92
|
+
y = y.example("$0 ".concat(example.command), example.description);
|
|
93
|
+
}
|
|
94
|
+
registeredSubcommands.push(subcommand);
|
|
95
|
+
}
|
|
96
|
+
var yargs, y, registeredSubcommands, rootDirectoryPath, projectConfig, datasource, _i, nonProjectPlugins_1, plugin, _a, _b, plugin, _c, commonPlugins_1, plugin;
|
|
97
|
+
return __generator(this, function (_d) {
|
|
98
|
+
yargs = require("yargs");
|
|
99
|
+
y = yargs(process.argv.slice(2)).usage("Usage: <command> [options]");
|
|
100
|
+
registeredSubcommands = [];
|
|
101
|
+
rootDirectoryPath = runnerOptions.rootDirectoryPath, projectConfig = runnerOptions.projectConfig, datasource = runnerOptions.datasource;
|
|
102
|
+
// non project-based plugins
|
|
103
|
+
if (!projectConfig) {
|
|
104
|
+
for (_i = 0, nonProjectPlugins_1 = plugins_1.nonProjectPlugins; _i < nonProjectPlugins_1.length; _i++) {
|
|
105
|
+
plugin = nonProjectPlugins_1[_i];
|
|
106
|
+
registerPlugin(plugin);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// project-based plugins
|
|
110
|
+
if (projectConfig) {
|
|
111
|
+
for (_a = 0, _b = __spreadArray(__spreadArray([], plugins_1.projectBasedPlugins, true), (projectConfig.plugins || []), true); _a < _b.length; _a++) {
|
|
112
|
+
plugin = _b[_a];
|
|
113
|
+
registerPlugin(plugin);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// common plugins
|
|
117
|
+
for (_c = 0, commonPlugins_1 = plugins_1.commonPlugins; _c < commonPlugins_1.length; _c++) {
|
|
118
|
+
plugin = commonPlugins_1[_c];
|
|
119
|
+
registerPlugin(plugin);
|
|
120
|
+
}
|
|
121
|
+
// show help if no command is provided
|
|
122
|
+
y.command({
|
|
123
|
+
command: "*",
|
|
124
|
+
handler: function () {
|
|
125
|
+
y.showHelp();
|
|
126
|
+
},
|
|
127
|
+
}).argv;
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
exports.runCLI = runCLI;
|
|
133
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,qCAAkF;AA+BlF,SAAsB,MAAM,CAAC,aAA4B;;QAQvD,SAAS,cAAc,CAAC,MAAc;YACpC,IAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAEhD,IAAI,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;gBAC9C,OAAO,CAAC,IAAI,CAAC,mBAAW,UAAU,qCAAiC,CAAC,CAAC;gBACrE,OAAO;aACR;YAED,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;gBACZ,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,OAAO,EAAE,UAAgB,MAAqB;;;;;;;oCAE3B,qBAAM,MAAM,CAAC,OAAO,CAAC;4CAClC,iBAAiB,mBAAA;4CACjB,aAAa,eAAA;4CACb,UAAU,YAAA;4CACV,MAAM,QAAA;yCACiB,CAAC,EAAA;;oCALpB,MAAM,GAAG,SAKW;oCAE1B,IAAI,MAAM,KAAK,KAAK,EAAE;wCACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qCACjB;;;;oCAED,OAAO,C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CAAC,MAAM,CAAC,CAAC;aACxB;YAED,sCAAsC;YACtC,CAAC,CAAC,OAAO,CAAC;gBACR,OAAO,EAAE,GAAG;gBACZ,OAAO;oBACL,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACf,CAAC;aACF,CAAC,CAAC,IAAI,CAAC;;;;CACT;AAtED,wBAsEC"}
|
package/lib/cli/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cli"), exports);
|
|
18
|
+
__exportStar(require("./plugins"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,4CAA0B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commonPlugins = exports.projectBasedPlugins = exports.nonProjectPlugins = void 0;
|
|
4
|
+
var init_1 = require("../init");
|
|
5
|
+
var linter_1 = require("../linter");
|
|
6
|
+
var builder_1 = require("../builder");
|
|
7
|
+
var restore_1 = require("../restore");
|
|
8
|
+
var tester_1 = require("../tester");
|
|
9
|
+
var generate_code_1 = require("../generate-code");
|
|
10
|
+
var find_duplicate_segments_1 = require("../find-duplicate-segments");
|
|
11
|
+
var find_usage_1 = require("../find-usage");
|
|
12
|
+
var benchmark_1 = require("../benchmark");
|
|
13
|
+
var config_1 = require("../config");
|
|
14
|
+
var evaluate_1 = require("../evaluate");
|
|
15
|
+
var assess_distribution_1 = require("../assess-distribution");
|
|
16
|
+
var info_1 = require("../info");
|
|
17
|
+
var site_1 = require("../site");
|
|
18
|
+
// that do not require an existing project
|
|
19
|
+
exports.nonProjectPlugins = [init_1.initPlugin];
|
|
20
|
+
// that require an existing Featurevisor project
|
|
21
|
+
exports.projectBasedPlugins = [
|
|
22
|
+
linter_1.lintPlugin,
|
|
23
|
+
builder_1.buildPlugin,
|
|
24
|
+
restore_1.restorePlugin,
|
|
25
|
+
tester_1.testPlugin,
|
|
26
|
+
generate_code_1.generateCodePlugin,
|
|
27
|
+
find_duplicate_segments_1.findDuplicateSegmentsPlugin,
|
|
28
|
+
find_usage_1.findUsagePlugin,
|
|
29
|
+
benchmark_1.benchmarkPlugin,
|
|
30
|
+
config_1.configPlugin,
|
|
31
|
+
evaluate_1.evaluatePlugin,
|
|
32
|
+
assess_distribution_1.assessDistributionPlugin,
|
|
33
|
+
info_1.infoPlugin,
|
|
34
|
+
site_1.sitePlugin,
|
|
35
|
+
];
|
|
36
|
+
exports.commonPlugins = [];
|
|
37
|
+
//# sourceMappingURL=plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/cli/plugins.ts"],"names":[],"mappings":";;;AAEA,gCAAqC;AACrC,oCAAuC;AACvC,sCAAyC;AACzC,sCAA2C;AAC3C,oCAAuC;AACvC,kDAAsD;AACtD,sEAAyE;AACzE,4CAAgD;AAChD,0CAA+C;AAC/C,oCAAyC;AACzC,wCAA6C;AAC7C,8DAAkE;AAClE,gCAAqC;AACrC,gCAAqC;AAErC,0CAA0C;AAC7B,QAAA,iBAAiB,GAAa,CAAC,iBAAU,CAAC,CAAC;AAExD,gDAAgD;AACnC,QAAA,mBAAmB,GAAa;IAC3C,mBAAU;IACV,qBAAW;IACX,uBAAa;IACb,mBAAU;IACV,kCAAkB;IAClB,qDAA2B;IAC3B,4BAAe;IACf,2BAAe;IACf,qBAAY;IACZ,yBAAc;IACd,8CAAwB;IACxB,iBAAU;IACV,iBAAU;CACX,CAAC;AAEW,QAAA,aAAa,GAAa,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BucketBy } from "@featurevisor/types";
|
|
2
2
|
import { Parser } from "./parsers";
|
|
3
|
+
import type { Plugin } from "../cli";
|
|
3
4
|
export declare const FEATURES_DIRECTORY_NAME = "features";
|
|
4
5
|
export declare const SEGMENTS_DIRECTORY_NAME = "segments";
|
|
5
6
|
export declare const ATTRIBUTES_DIRECTORY_NAME = "attributes";
|
|
@@ -35,6 +36,7 @@ export interface ProjectConfig {
|
|
|
35
36
|
siteExportDirectoryPath: string;
|
|
36
37
|
enforceCatchAllRule?: boolean;
|
|
37
38
|
adapter: any;
|
|
39
|
+
plugins: Plugin[];
|
|
38
40
|
}
|
|
39
41
|
export declare function getProjectConfig(rootDirectoryPath: string): ProjectConfig;
|
|
40
42
|
export interface ShowProjectConfigOptions {
|
|
@@ -42,3 +44,4 @@ export interface ShowProjectConfigOptions {
|
|
|
42
44
|
pretty?: boolean;
|
|
43
45
|
}
|
|
44
46
|
export declare function showProjectConfig(projectConfig: ProjectConfig, options?: ShowProjectConfigOptions): void;
|
|
47
|
+
export declare const configPlugin: Plugin;
|
|
@@ -1,6 +1,42 @@
|
|
|
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
|
-
exports.showProjectConfig = exports.getProjectConfig = exports.SCHEMA_VERSION = exports.DEFAULT_PARSER = exports.DEFAULT_PRETTY_DATAFILE = exports.DEFAULT_PRETTY_STATE = exports.DEFAULT_BUCKET_BY_ATTRIBUTE = exports.DEFAULT_TAGS = exports.DEFAULT_ENVIRONMENTS = exports.ROOT_DIR_PLACEHOLDER = exports.CONFIG_MODULE_NAME = exports.SITE_EXPORT_DIRECTORY_NAME = exports.OUTPUT_DIRECTORY_NAME = exports.STATE_DIRECTORY_NAME = exports.TESTS_DIRECTORY_NAME = exports.GROUPS_DIRECTORY_NAME = exports.ATTRIBUTES_DIRECTORY_NAME = exports.SEGMENTS_DIRECTORY_NAME = exports.FEATURES_DIRECTORY_NAME = void 0;
|
|
39
|
+
exports.configPlugin = exports.showProjectConfig = exports.getProjectConfig = exports.SCHEMA_VERSION = exports.DEFAULT_PARSER = exports.DEFAULT_PRETTY_DATAFILE = exports.DEFAULT_PRETTY_STATE = exports.DEFAULT_BUCKET_BY_ATTRIBUTE = exports.DEFAULT_TAGS = exports.DEFAULT_ENVIRONMENTS = exports.ROOT_DIR_PLACEHOLDER = exports.CONFIG_MODULE_NAME = exports.SITE_EXPORT_DIRECTORY_NAME = exports.OUTPUT_DIRECTORY_NAME = exports.STATE_DIRECTORY_NAME = exports.TESTS_DIRECTORY_NAME = exports.GROUPS_DIRECTORY_NAME = exports.ATTRIBUTES_DIRECTORY_NAME = exports.SEGMENTS_DIRECTORY_NAME = exports.FEATURES_DIRECTORY_NAME = void 0;
|
|
4
40
|
var path = require("path");
|
|
5
41
|
var parsers_1 = require("./parsers");
|
|
6
42
|
var filesystemAdapter_1 = require("../datasource/filesystemAdapter");
|
|
@@ -41,6 +77,7 @@ function getProjectConfig(rootDirectoryPath) {
|
|
|
41
77
|
outputDirectoryPath: path.join(rootDirectoryPath, exports.OUTPUT_DIRECTORY_NAME),
|
|
42
78
|
siteExportDirectoryPath: path.join(rootDirectoryPath, exports.SITE_EXPORT_DIRECTORY_NAME),
|
|
43
79
|
enforceCatchAllRule: false,
|
|
80
|
+
plugins: [],
|
|
44
81
|
};
|
|
45
82
|
var configModulePath = path.join(rootDirectoryPath, exports.CONFIG_MODULE_NAME);
|
|
46
83
|
var customConfig = require(configModulePath);
|
|
@@ -82,4 +119,35 @@ function showProjectConfig(projectConfig, options) {
|
|
|
82
119
|
}
|
|
83
120
|
}
|
|
84
121
|
exports.showProjectConfig = showProjectConfig;
|
|
122
|
+
exports.configPlugin = {
|
|
123
|
+
command: "config",
|
|
124
|
+
handler: function (_a) {
|
|
125
|
+
var rootDirectoryPath = _a.rootDirectoryPath, parsed = _a.parsed;
|
|
126
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
127
|
+
var projectConfig;
|
|
128
|
+
return __generator(this, function (_b) {
|
|
129
|
+
projectConfig = getProjectConfig(rootDirectoryPath);
|
|
130
|
+
showProjectConfig(projectConfig, {
|
|
131
|
+
print: parsed.print,
|
|
132
|
+
pretty: parsed.pretty,
|
|
133
|
+
});
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
examples: [
|
|
139
|
+
{
|
|
140
|
+
command: "config",
|
|
141
|
+
description: "show the project configuration",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
command: "config --print",
|
|
145
|
+
description: "show the project configuration as JSON",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
command: "config --print --pretty",
|
|
149
|
+
description: "show the project configuration (as pretty JSON)",
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
};
|
|
85
153
|
//# sourceMappingURL=projectConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectConfig.js","sourceRoot":"","sources":["../../src/config/projectConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projectConfig.js","sourceRoot":"","sources":["../../src/config/projectConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA6B;AAI7B,qCAA4C;AAC5C,qEAAoE;AAGvD,QAAA,uBAAuB,GAAG,UAAU,CAAC;AACrC,QAAA,uBAAuB,GAAG,UAAU,CAAC;AACrC,QAAA,yBAAyB,GAAG,YAAY,CAAC;AACzC,QAAA,qBAAqB,GAAG,QAAQ,CAAC;AACjC,QAAA,oBAAoB,GAAG,OAAO,CAAC;AAC/B,QAAA,oBAAoB,GAAG,eAAe,CAAC;AACvC,QAAA,qBAAqB,GAAG,MAAM,CAAC;AAC/B,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEnC,QAAA,kBAAkB,GAAG,wBAAwB,CAAC;AAC9C,QAAA,oBAAoB,GAAG,WAAW,CAAC;AAEnC,QAAA,oBAAoB,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACjD,QAAA,YAAY,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,QAAA,2BAA2B,GAAG,QAAQ,CAAC;AAEvC,QAAA,oBAAoB,GAAG,KAAK,CAAC;AAC7B,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAEhC,QAAA,cAAc,GAAW,KAAK,CAAC;AAE/B,QAAA,cAAc,GAAG,GAAG,CAAC;AAuBlC,6FAA6F;AAC7F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
|
package/lib/evaluate/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LogLevel, LogMessage, LogDetails } from "@featurevisor/sdk";
|
|
2
2
|
import { Dependencies } from "../dependencies";
|
|
3
|
+
import { Plugin } from "../cli";
|
|
3
4
|
export interface EvaluateOptions {
|
|
4
5
|
environment: string;
|
|
5
6
|
feature: string;
|
|
@@ -14,3 +15,4 @@ export interface Log {
|
|
|
14
15
|
details?: LogDetails;
|
|
15
16
|
}
|
|
16
17
|
export declare function evaluateFeature(deps: Dependencies, options: EvaluateOptions): Promise<void>;
|
|
18
|
+
export declare const evaluatePlugin: Plugin;
|
package/lib/evaluate/index.js
CHANGED
|
@@ -45,7 +45,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
45
45
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.evaluateFeature = void 0;
|
|
48
|
+
exports.evaluatePlugin = exports.evaluateFeature = void 0;
|
|
49
49
|
var sdk_1 = require("@featurevisor/sdk");
|
|
50
50
|
var config_1 = require("../config");
|
|
51
51
|
var builder_1 = require("../builder");
|
|
@@ -186,4 +186,38 @@ function evaluateFeature(deps, options) {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
exports.evaluateFeature = evaluateFeature;
|
|
189
|
+
exports.evaluatePlugin = {
|
|
190
|
+
command: "evaluate",
|
|
191
|
+
handler: function (_a) {
|
|
192
|
+
var rootDirectoryPath = _a.rootDirectoryPath, projectConfig = _a.projectConfig, datasource = _a.datasource, parsed = _a.parsed;
|
|
193
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
194
|
+
return __generator(this, function (_b) {
|
|
195
|
+
switch (_b.label) {
|
|
196
|
+
case 0: return [4 /*yield*/, evaluateFeature({
|
|
197
|
+
rootDirectoryPath: rootDirectoryPath,
|
|
198
|
+
projectConfig: projectConfig,
|
|
199
|
+
datasource: datasource,
|
|
200
|
+
options: parsed,
|
|
201
|
+
}, {
|
|
202
|
+
environment: parsed.environment,
|
|
203
|
+
feature: parsed.feature,
|
|
204
|
+
context: parsed.context ? JSON.parse(parsed.context) : {},
|
|
205
|
+
print: parsed.print,
|
|
206
|
+
pretty: parsed.pretty,
|
|
207
|
+
verbose: parsed.verbose,
|
|
208
|
+
})];
|
|
209
|
+
case 1:
|
|
210
|
+
_b.sent();
|
|
211
|
+
return [2 /*return*/];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
},
|
|
216
|
+
examples: [
|
|
217
|
+
{
|
|
218
|
+
command: 'evaluate --environment=production --feature=my_feature --context=\'{"userId": "123"}\'',
|
|
219
|
+
description: "evaluate a feature against provided context",
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
};
|
|
189
223
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/evaluate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAO2B;AAG3B,oCAA2C;AAC3C,sCAA2C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/evaluate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAO2B;AAG3B,oCAA2C;AAC3C,sCAA2C;AAG3C,SAAS,sBAAsB,CAAC,UAAsB;IACpD,IAAM,UAAU,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAErE,KAA2B,UAA0B,EAA1B,KAAA,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,EAAE;QAA5C,IAAA,WAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;QACpB,IA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AC/B;qBACF;yBAAM;wBACL,WAAW,CAAC,WAAW,CAAC,CAAC;wBAEzB,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;qBACtC;;;;;CACF;AA/HD,0CA+HC;AAEY,QAAA,cAAc,GAAW;IACpC,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,UAAO,EAAwD;YAAtD,iBAAiB,uBAAA,EAAE,aAAa,mBAAA,EAAE,UAAU,gBAAA,EAAE,MAAM,YAAA;;;;4BACpE,qBAAM,eAAe,CACnB;4BACE,iBAAiB,mBAAA;4BACjB,aAAa,eAAA;4BACb,UAAU,YAAA;4BACV,OAAO,EAAE,MAAM;yBAChB,EACD;4BACE,WAAW,EAAE,MAAM,CAAC,WAAW;4BAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;4BACvB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;4BACzD,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,MAAM,EAAE,MAAM,CAAC,MAAM;4BACrB,OAAO,EAAE,MAAM,CAAC,OAAO;yBACxB,CACF,EAAA;;wBAfD,SAeC,CAAC;;;;;KACH;IACD,QAAQ,EAAE;QACR;YACE,OAAO,EACL,wFAAwF;YAC1F,WAAW,EAAE,6CAA6C;SAC3D;KACF;CACF,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { DuplicateSegmentsOptions } from "./findDuplicateSegments";
|
|
2
2
|
import { Dependencies } from "../dependencies";
|
|
3
|
+
import { Plugin } from "../cli";
|
|
3
4
|
export declare function findDuplicateSegmentsInProject(deps: Dependencies, options?: DuplicateSegmentsOptions): Promise<void>;
|
|
5
|
+
export declare const findDuplicateSegmentsPlugin: Plugin;
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.findDuplicateSegmentsInProject = void 0;
|
|
39
|
+
exports.findDuplicateSegmentsPlugin = exports.findDuplicateSegmentsInProject = void 0;
|
|
40
40
|
var findDuplicateSegments_1 = require("./findDuplicateSegments");
|
|
41
41
|
function findDuplicateSegmentsInProject(deps, options) {
|
|
42
42
|
if (options === void 0) { options = {}; }
|
|
@@ -69,4 +69,37 @@ function findDuplicateSegmentsInProject(deps, options) {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
exports.findDuplicateSegmentsInProject = findDuplicateSegmentsInProject;
|
|
72
|
+
exports.findDuplicateSegmentsPlugin = {
|
|
73
|
+
command: "find-duplicate-segments",
|
|
74
|
+
handler: function (_a) {
|
|
75
|
+
var rootDirectoryPath = _a.rootDirectoryPath, projectConfig = _a.projectConfig, datasource = _a.datasource, parsed = _a.parsed;
|
|
76
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
77
|
+
return __generator(this, function (_b) {
|
|
78
|
+
switch (_b.label) {
|
|
79
|
+
case 0: return [4 /*yield*/, findDuplicateSegmentsInProject({
|
|
80
|
+
rootDirectoryPath: rootDirectoryPath,
|
|
81
|
+
projectConfig: projectConfig,
|
|
82
|
+
datasource: datasource,
|
|
83
|
+
options: parsed,
|
|
84
|
+
}, {
|
|
85
|
+
authors: parsed.authors,
|
|
86
|
+
})];
|
|
87
|
+
case 1:
|
|
88
|
+
_b.sent();
|
|
89
|
+
return [2 /*return*/];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
examples: [
|
|
95
|
+
{
|
|
96
|
+
command: "find-duplicate-segments",
|
|
97
|
+
description: "Find duplicate segments in the project",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
command: "find-duplicate-segments --authors",
|
|
101
|
+
description: "Find duplicate segments in the project and list authors",
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
72
105
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/find-duplicate-segments/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAA0F;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/find-duplicate-segments/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAA0F;AAI1F,SAAsB,8BAA8B,CAClD,IAAkB,EAClB,OAAsC;IAAtC,wBAAA,EAAA,YAAsC;;;;;wBAEnB,qBAAM,IAAA,6CAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,EAAA;;oBAAvD,UAAU,GAAG,SAA0C;oBAE7D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;oBAEhB,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;wBAC3B,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;wBAC3C,sBAAO;qBACR;oBAED,OAAO,CAAC,GAAG,CAAC,gBAAS,UAAU,CAAC,MAAM,qBAAkB,CAAC,CAAC;oBAE1D,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK;wBACvB,IAAI,OAAO,CAAC,OAAO,EAAE;4BACnB,OAAO,CAAC,GAAG,CAAC,wBAAiB,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;4BAC1D,OAAO,CAAC,GAAG,CAAC,wBAAiB,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;4BAC1E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;yBACjB;6BAAM;4BACL,OAAO,CAAC,GAAG,CAAC,cAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;yBACjD;oBACH,CAAC,CAAC,CAAC;;;;;CACJ;AAxBD,wEAwBC;AAEY,QAAA,2BAA2B,GAAW;IACjD,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,UAAO,EAAwD;YAAtD,iBAAiB,uBAAA,EAAE,aAAa,mBAAA,EAAE,UAAU,gBAAA,EAAE,MAAM,YAAA;;;;4BACpE,qBAAM,8BAA8B,CAClC;4BACE,iBAAiB,mBAAA;4BACjB,aAAa,eAAA;4BACb,UAAU,YAAA;4BACV,OAAO,EAAE,MAAM;yBAChB,EACD;4BACE,OAAO,EAAE,MAAM,CAAC,OAAO;yBACxB,CACF,EAAA;;wBAVD,SAUC,CAAC;;;;;KACH;IACD,QAAQ,EAAE;QACR;YACE,OAAO,EAAE,yBAAyB;YAClC,WAAW,EAAE,wCAAwC;SACtD;QACD;YACE,OAAO,EAAE,mCAAmC;YAC5C,WAAW,EAAE,yDAAyD;SACvE;KACF;CACF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FeatureKey, SegmentKey, AttributeKey } from "@featurevisor/types";
|
|
2
2
|
import { Dependencies } from "../dependencies";
|
|
3
|
+
import { Plugin } from "../cli";
|
|
3
4
|
export interface UsageInFeatures {
|
|
4
5
|
[featureKey: string]: {
|
|
5
6
|
features: Set<FeatureKey>;
|
|
@@ -30,3 +31,4 @@ export interface FindUsageOptions {
|
|
|
30
31
|
authors?: boolean;
|
|
31
32
|
}
|
|
32
33
|
export declare function findUsageInProject(deps: Dependencies, options: FindUsageOptions): Promise<void>;
|
|
34
|
+
export declare const findUsagePlugin: Plugin;
|