@featurevisor/core 1.5.1 → 1.7.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 +22 -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/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/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/linter/attributeSchema.d.ts +17 -2
- package/lib/linter/attributeSchema.js +13 -11
- package/lib/linter/attributeSchema.js.map +1 -1
- package/lib/linter/checkPercentageExceedingSlot.d.ts +3 -0
- package/lib/linter/checkPercentageExceedingSlot.js +86 -0
- package/lib/linter/checkPercentageExceedingSlot.js.map +1 -0
- package/lib/linter/conditionSchema.d.ts +2 -2
- package/lib/linter/conditionSchema.js +112 -57
- package/lib/linter/conditionSchema.js.map +1 -1
- package/lib/linter/featureSchema.d.ts +229 -2
- package/lib/linter/featureSchema.js +195 -139
- package/lib/linter/featureSchema.js.map +1 -1
- package/lib/linter/groupSchema.d.ts +32 -2
- package/lib/linter/groupSchema.js +28 -97
- package/lib/linter/groupSchema.js.map +1 -1
- package/lib/linter/lintProject.d.ts +5 -1
- package/lib/linter/lintProject.js +213 -139
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/linter/printError.d.ts +2 -0
- package/lib/linter/printError.js +20 -0
- package/lib/linter/printError.js.map +1 -0
- package/lib/linter/segmentSchema.d.ts +14 -2
- package/lib/linter/segmentSchema.js +12 -10
- package/lib/linter/segmentSchema.js.map +1 -1
- package/lib/linter/testSchema.d.ts +90 -2
- package/lib/linter/testSchema.js +49 -38
- package/lib/linter/testSchema.js.map +1 -1
- package/lib/tester/cliFormat.d.ts +1 -0
- package/lib/tester/cliFormat.js +2 -1
- package/lib/tester/cliFormat.js.map +1 -1
- package/package.json +4 -4
- package/src/linter/attributeSchema.ts +11 -9
- package/src/linter/checkPercentageExceedingSlot.ts +41 -0
- package/src/linter/conditionSchema.ts +120 -97
- package/src/linter/featureSchema.ts +241 -177
- package/src/linter/groupSchema.ts +38 -54
- package/src/linter/lintProject.ts +233 -110
- package/src/linter/printError.ts +21 -0
- package/src/linter/segmentSchema.ts +10 -8
- package/src/linter/testSchema.ts +67 -50
- package/src/tester/cliFormat.ts +1 -0
- package/lib/linter/printJoiError.d.ts +0 -2
- package/lib/linter/printJoiError.js +0 -14
- package/lib/linter/printJoiError.js.map +0 -1
- package/src/linter/printJoiError.ts +0 -11
|
@@ -38,7 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.lintProject = void 0;
|
|
40
40
|
// for use in node only
|
|
41
|
-
var
|
|
41
|
+
var path = require("path");
|
|
42
42
|
var attributeSchema_1 = require("./attributeSchema");
|
|
43
43
|
var conditionSchema_1 = require("./conditionSchema");
|
|
44
44
|
var segmentSchema_1 = require("./segmentSchema");
|
|
@@ -46,214 +46,288 @@ var groupSchema_1 = require("./groupSchema");
|
|
|
46
46
|
var featureSchema_1 = require("./featureSchema");
|
|
47
47
|
var testSchema_1 = require("./testSchema");
|
|
48
48
|
var checkCircularDependency_1 = require("./checkCircularDependency");
|
|
49
|
-
var
|
|
50
|
-
|
|
49
|
+
var checkPercentageExceedingSlot_1 = require("./checkPercentageExceedingSlot");
|
|
50
|
+
var printError_1 = require("./printError");
|
|
51
|
+
var cliFormat_1 = require("../tester/cliFormat");
|
|
52
|
+
function lintProject(deps, options) {
|
|
53
|
+
if (options === void 0) { options = {}; }
|
|
51
54
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
|
|
55
|
+
function getFullPathFromKey(type, key, relative) {
|
|
56
|
+
if (relative === void 0) { relative = false; }
|
|
57
|
+
var fileName = "".concat(key, ".").concat(datasource.getExtension());
|
|
58
|
+
var fullPath = "";
|
|
59
|
+
if (type === "attribute") {
|
|
60
|
+
fullPath = path.join(projectConfig.attributesDirectoryPath, fileName);
|
|
61
|
+
}
|
|
62
|
+
else if (type === "segment") {
|
|
63
|
+
fullPath = path.join(projectConfig.segmentsDirectoryPath, fileName);
|
|
64
|
+
}
|
|
65
|
+
else if (type === "feature") {
|
|
66
|
+
fullPath = path.join(projectConfig.featuresDirectoryPath, fileName);
|
|
67
|
+
}
|
|
68
|
+
else if (type === "group") {
|
|
69
|
+
fullPath = path.join(projectConfig.groupsDirectoryPath, fileName);
|
|
70
|
+
}
|
|
71
|
+
else if (type === "test") {
|
|
72
|
+
fullPath = path.join(projectConfig.testsDirectoryPath, fileName);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
throw new Error("Unknown type: ".concat(type));
|
|
76
|
+
}
|
|
77
|
+
if (relative) {
|
|
78
|
+
fullPath = path.relative(process.cwd(), fullPath);
|
|
79
|
+
}
|
|
80
|
+
return fullPath;
|
|
81
|
+
}
|
|
82
|
+
var projectConfig, datasource, hasError, keyPattern, attributes, attributeZodSchema, filteredKeys, _i, filteredKeys_1, key, fullPath, parsed, result, e_1, segments, conditionsZodSchema, segmentZodSchema, filteredKeys, _a, filteredKeys_2, key, fullPath, parsed, result, e_2, features, featureZodSchema, filteredKeys, _b, filteredKeys_3, key, fullPath, parsed, result, e_3, e_4, groups, groupZodSchema, filteredKeys, _c, filteredKeys_4, key, fullPath, parsed, result, e_5, e_6, tests, testsZodSchema, filteredKeys, _d, filteredKeys_5, key, fullPath, parsed, result, e_7;
|
|
53
83
|
return __generator(this, function (_e) {
|
|
54
84
|
switch (_e.label) {
|
|
55
85
|
case 0:
|
|
56
86
|
projectConfig = deps.projectConfig, datasource = deps.datasource;
|
|
57
87
|
hasError = false;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
88
|
+
keyPattern = options.keyPattern ? new RegExp(options.keyPattern) : null;
|
|
89
|
+
if (keyPattern) {
|
|
90
|
+
console.log("");
|
|
91
|
+
console.log("Linting only keys matching pattern: ".concat(keyPattern));
|
|
92
|
+
console.log("");
|
|
93
|
+
}
|
|
61
94
|
return [4 /*yield*/, datasource.listAttributes()];
|
|
62
95
|
case 1:
|
|
63
96
|
attributes = _e.sent();
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
97
|
+
attributeZodSchema = (0, attributeSchema_1.getAttributeZodSchema)();
|
|
98
|
+
if (!(!options.entityType || options.entityType === "attribute")) return [3 /*break*/, 7];
|
|
99
|
+
filteredKeys = !keyPattern
|
|
100
|
+
? attributes
|
|
101
|
+
: attributes.filter(function (key) { return keyPattern.test(key); });
|
|
102
|
+
if (filteredKeys.length > 0) {
|
|
103
|
+
console.log("Linting ".concat(filteredKeys.length, " attributes...\n"));
|
|
104
|
+
}
|
|
105
|
+
_i = 0, filteredKeys_1 = filteredKeys;
|
|
67
106
|
_e.label = 2;
|
|
68
107
|
case 2:
|
|
69
|
-
if (!(_i <
|
|
70
|
-
key =
|
|
108
|
+
if (!(_i < filteredKeys_1.length)) return [3 /*break*/, 7];
|
|
109
|
+
key = filteredKeys_1[_i];
|
|
110
|
+
fullPath = getFullPathFromKey("attribute", key);
|
|
71
111
|
_e.label = 3;
|
|
72
112
|
case 3:
|
|
73
|
-
_e.trys.push([3,
|
|
113
|
+
_e.trys.push([3, 5, , 6]);
|
|
74
114
|
return [4 /*yield*/, datasource.readAttribute(key)];
|
|
75
115
|
case 4:
|
|
76
116
|
parsed = _e.sent();
|
|
77
|
-
|
|
78
|
-
|
|
117
|
+
result = attributeZodSchema.safeParse(parsed);
|
|
118
|
+
if (!result.success) {
|
|
119
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
120
|
+
if ("error" in result) {
|
|
121
|
+
(0, printError_1.printZodError)(result.error);
|
|
122
|
+
}
|
|
123
|
+
hasError = true;
|
|
124
|
+
}
|
|
125
|
+
return [3 /*break*/, 6];
|
|
79
126
|
case 5:
|
|
80
|
-
_e.sent();
|
|
81
|
-
return [3 /*break*/, 7];
|
|
82
|
-
case 6:
|
|
83
127
|
e_1 = _e.sent();
|
|
84
|
-
console.log(
|
|
128
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
85
129
|
console.log("");
|
|
86
|
-
|
|
87
|
-
(0, printJoiError_1.printJoiError)(e_1);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
console.log(e_1);
|
|
91
|
-
}
|
|
130
|
+
console.log(e_1);
|
|
92
131
|
hasError = true;
|
|
93
|
-
return [3 /*break*/,
|
|
94
|
-
case
|
|
132
|
+
return [3 /*break*/, 6];
|
|
133
|
+
case 6:
|
|
95
134
|
_i++;
|
|
96
135
|
return [3 /*break*/, 2];
|
|
97
|
-
case
|
|
98
|
-
case
|
|
136
|
+
case 7: return [4 /*yield*/, datasource.listSegments()];
|
|
137
|
+
case 8:
|
|
99
138
|
segments = _e.sent();
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
139
|
+
conditionsZodSchema = (0, conditionSchema_1.getConditionsZodSchema)(projectConfig, attributes);
|
|
140
|
+
segmentZodSchema = (0, segmentSchema_1.getSegmentZodSchema)(projectConfig, conditionsZodSchema);
|
|
141
|
+
if (!(!options.entityType || options.entityType === "segment")) return [3 /*break*/, 14];
|
|
142
|
+
filteredKeys = !keyPattern ? segments : segments.filter(function (key) { return keyPattern.test(key); });
|
|
143
|
+
if (filteredKeys.length > 0) {
|
|
144
|
+
console.log("Linting ".concat(filteredKeys.length, " segments...\n"));
|
|
145
|
+
}
|
|
146
|
+
_a = 0, filteredKeys_2 = filteredKeys;
|
|
147
|
+
_e.label = 9;
|
|
148
|
+
case 9:
|
|
149
|
+
if (!(_a < filteredKeys_2.length)) return [3 /*break*/, 14];
|
|
150
|
+
key = filteredKeys_2[_a];
|
|
151
|
+
fullPath = getFullPathFromKey("segment", key);
|
|
104
152
|
_e.label = 10;
|
|
105
153
|
case 10:
|
|
106
|
-
|
|
107
|
-
key = segments_1[_a];
|
|
108
|
-
_e.label = 11;
|
|
109
|
-
case 11:
|
|
110
|
-
_e.trys.push([11, 14, , 15]);
|
|
154
|
+
_e.trys.push([10, 12, , 13]);
|
|
111
155
|
return [4 /*yield*/, datasource.readSegment(key)];
|
|
112
|
-
case
|
|
156
|
+
case 11:
|
|
113
157
|
parsed = _e.sent();
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
158
|
+
result = segmentZodSchema.safeParse(parsed);
|
|
159
|
+
if (!result.success) {
|
|
160
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
161
|
+
if ("error" in result) {
|
|
162
|
+
(0, printError_1.printZodError)(result.error);
|
|
163
|
+
}
|
|
164
|
+
hasError = true;
|
|
165
|
+
}
|
|
166
|
+
return [3 /*break*/, 13];
|
|
167
|
+
case 12:
|
|
120
168
|
e_2 = _e.sent();
|
|
121
|
-
console.log(
|
|
169
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
122
170
|
console.log("");
|
|
123
|
-
|
|
124
|
-
(0, printJoiError_1.printJoiError)(e_2);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
console.log(e_2);
|
|
128
|
-
}
|
|
171
|
+
console.log(e_2);
|
|
129
172
|
hasError = true;
|
|
130
|
-
return [3 /*break*/,
|
|
131
|
-
case
|
|
173
|
+
return [3 /*break*/, 13];
|
|
174
|
+
case 13:
|
|
132
175
|
_a++;
|
|
133
|
-
return [3 /*break*/,
|
|
134
|
-
case
|
|
135
|
-
case
|
|
176
|
+
return [3 /*break*/, 9];
|
|
177
|
+
case 14: return [4 /*yield*/, datasource.listFeatures()];
|
|
178
|
+
case 15:
|
|
136
179
|
features = _e.sent();
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
180
|
+
featureZodSchema = (0, featureSchema_1.getFeatureZodSchema)(projectConfig, conditionsZodSchema, attributes, segments, features);
|
|
181
|
+
if (!(!options.entityType || options.entityType === "feature")) return [3 /*break*/, 25];
|
|
182
|
+
filteredKeys = !keyPattern ? features : features.filter(function (key) { return keyPattern.test(key); });
|
|
183
|
+
if (filteredKeys.length > 0) {
|
|
184
|
+
console.log("Linting ".concat(filteredKeys.length, " features...\n"));
|
|
185
|
+
}
|
|
186
|
+
_b = 0, filteredKeys_3 = filteredKeys;
|
|
187
|
+
_e.label = 16;
|
|
188
|
+
case 16:
|
|
189
|
+
if (!(_b < filteredKeys_3.length)) return [3 /*break*/, 25];
|
|
190
|
+
key = filteredKeys_3[_b];
|
|
191
|
+
fullPath = getFullPathFromKey("feature", key);
|
|
144
192
|
parsed = void 0;
|
|
145
|
-
_e.label =
|
|
146
|
-
case
|
|
147
|
-
_e.trys.push([
|
|
193
|
+
_e.label = 17;
|
|
194
|
+
case 17:
|
|
195
|
+
_e.trys.push([17, 19, , 20]);
|
|
148
196
|
return [4 /*yield*/, datasource.readFeature(key)];
|
|
149
|
-
case
|
|
197
|
+
case 18:
|
|
150
198
|
parsed = _e.sent();
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
199
|
+
result = featureZodSchema.safeParse(parsed);
|
|
200
|
+
if (!result.success) {
|
|
201
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
202
|
+
if ("error" in result) {
|
|
203
|
+
(0, printError_1.printZodError)(result.error);
|
|
204
|
+
}
|
|
205
|
+
hasError = true;
|
|
206
|
+
}
|
|
207
|
+
return [3 /*break*/, 20];
|
|
208
|
+
case 19:
|
|
157
209
|
e_3 = _e.sent();
|
|
158
|
-
console.log(
|
|
210
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
159
211
|
console.log("");
|
|
160
|
-
|
|
161
|
-
(0, printJoiError_1.printJoiError)(e_3);
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
console.log(e_3);
|
|
165
|
-
}
|
|
212
|
+
console.log(e_3);
|
|
166
213
|
hasError = true;
|
|
167
|
-
return [3 /*break*/,
|
|
168
|
-
case
|
|
169
|
-
if (!(parsed && parsed.required)) return [3 /*break*/,
|
|
170
|
-
_e.label =
|
|
171
|
-
case
|
|
172
|
-
_e.trys.push([
|
|
214
|
+
return [3 /*break*/, 20];
|
|
215
|
+
case 20:
|
|
216
|
+
if (!(parsed && parsed.required)) return [3 /*break*/, 24];
|
|
217
|
+
_e.label = 21;
|
|
218
|
+
case 21:
|
|
219
|
+
_e.trys.push([21, 23, , 24]);
|
|
173
220
|
return [4 /*yield*/, (0, checkCircularDependency_1.checkForCircularDependencyInRequired)(datasource, key, parsed.required)];
|
|
174
|
-
case
|
|
221
|
+
case 22:
|
|
175
222
|
_e.sent();
|
|
176
|
-
return [3 /*break*/,
|
|
177
|
-
case
|
|
223
|
+
return [3 /*break*/, 24];
|
|
224
|
+
case 23:
|
|
178
225
|
e_4 = _e.sent();
|
|
179
|
-
console.log(
|
|
180
|
-
console.log("
|
|
226
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
227
|
+
console.log(cliFormat_1.CLI_FORMAT_RED, " => Error: ".concat(e_4.message));
|
|
181
228
|
hasError = true;
|
|
182
|
-
return [3 /*break*/,
|
|
183
|
-
case
|
|
229
|
+
return [3 /*break*/, 24];
|
|
230
|
+
case 24:
|
|
184
231
|
_b++;
|
|
185
|
-
return [3 /*break*/,
|
|
186
|
-
case
|
|
187
|
-
case
|
|
232
|
+
return [3 /*break*/, 16];
|
|
233
|
+
case 25: return [4 /*yield*/, datasource.listGroups()];
|
|
234
|
+
case 26:
|
|
188
235
|
groups = _e.sent();
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
236
|
+
groupZodSchema = (0, groupSchema_1.getGroupZodSchema)(projectConfig, datasource, features);
|
|
237
|
+
if (!(!options.entityType || options.entityType === "group")) return [3 /*break*/, 36];
|
|
238
|
+
filteredKeys = !keyPattern ? groups : groups.filter(function (key) { return keyPattern.test(key); });
|
|
239
|
+
if (filteredKeys.length > 0) {
|
|
240
|
+
console.log("Linting ".concat(filteredKeys.length, " groups...\n"));
|
|
241
|
+
}
|
|
242
|
+
_c = 0, filteredKeys_4 = filteredKeys;
|
|
243
|
+
_e.label = 27;
|
|
244
|
+
case 27:
|
|
245
|
+
if (!(_c < filteredKeys_4.length)) return [3 /*break*/, 36];
|
|
246
|
+
key = filteredKeys_4[_c];
|
|
247
|
+
fullPath = getFullPathFromKey("group", key);
|
|
248
|
+
parsed = void 0;
|
|
249
|
+
_e.label = 28;
|
|
250
|
+
case 28:
|
|
251
|
+
_e.trys.push([28, 30, , 31]);
|
|
252
|
+
return [4 /*yield*/, datasource.readGroup(key)];
|
|
253
|
+
case 29:
|
|
254
|
+
parsed = _e.sent();
|
|
255
|
+
result = groupZodSchema.safeParse(parsed);
|
|
256
|
+
if (!result.success) {
|
|
257
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
258
|
+
if ("error" in result) {
|
|
259
|
+
(0, printError_1.printZodError)(result.error);
|
|
260
|
+
}
|
|
261
|
+
hasError = true;
|
|
262
|
+
}
|
|
263
|
+
return [3 /*break*/, 31];
|
|
193
264
|
case 30:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
265
|
+
e_5 = _e.sent();
|
|
266
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
267
|
+
console.log("");
|
|
268
|
+
console.log(e_5);
|
|
269
|
+
hasError = true;
|
|
270
|
+
return [3 /*break*/, 31];
|
|
197
271
|
case 31:
|
|
198
|
-
|
|
199
|
-
|
|
272
|
+
if (!parsed) return [3 /*break*/, 35];
|
|
273
|
+
_e.label = 32;
|
|
200
274
|
case 32:
|
|
201
|
-
|
|
202
|
-
return [4 /*yield*/,
|
|
275
|
+
_e.trys.push([32, 34, , 35]);
|
|
276
|
+
return [4 /*yield*/, (0, checkPercentageExceedingSlot_1.checkForFeatureExceedingGroupSlotPercentage)(datasource, parsed, features)];
|
|
203
277
|
case 33:
|
|
204
278
|
_e.sent();
|
|
205
279
|
return [3 /*break*/, 35];
|
|
206
280
|
case 34:
|
|
207
|
-
|
|
208
|
-
console.log(
|
|
209
|
-
console.log("");
|
|
210
|
-
if (e_5 instanceof Joi.ValidationError) {
|
|
211
|
-
(0, printJoiError_1.printJoiError)(e_5);
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
console.log(e_5);
|
|
215
|
-
}
|
|
281
|
+
e_6 = _e.sent();
|
|
282
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
283
|
+
console.log(cliFormat_1.CLI_FORMAT_RED, " => Error: ".concat(e_6.message));
|
|
216
284
|
hasError = true;
|
|
217
285
|
return [3 /*break*/, 35];
|
|
218
286
|
case 35:
|
|
219
287
|
_c++;
|
|
220
|
-
return [3 /*break*/,
|
|
288
|
+
return [3 /*break*/, 27];
|
|
221
289
|
case 36: return [4 /*yield*/, datasource.listTests()];
|
|
222
290
|
case 37:
|
|
223
291
|
tests = _e.sent();
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
292
|
+
testsZodSchema = (0, testSchema_1.getTestsZodSchema)(projectConfig, features, segments);
|
|
293
|
+
if (!(!options.entityType || options.entityType === "test")) return [3 /*break*/, 43];
|
|
294
|
+
filteredKeys = !keyPattern ? tests : tests.filter(function (key) { return keyPattern.test(key); });
|
|
295
|
+
if (filteredKeys.length > 0) {
|
|
296
|
+
console.log("Linting ".concat(filteredKeys.length, " tests...\n"));
|
|
297
|
+
}
|
|
298
|
+
_d = 0, filteredKeys_5 = filteredKeys;
|
|
227
299
|
_e.label = 38;
|
|
228
300
|
case 38:
|
|
229
|
-
if (!(_d <
|
|
230
|
-
key =
|
|
301
|
+
if (!(_d < filteredKeys_5.length)) return [3 /*break*/, 43];
|
|
302
|
+
key = filteredKeys_5[_d];
|
|
303
|
+
fullPath = getFullPathFromKey("test", key);
|
|
231
304
|
_e.label = 39;
|
|
232
305
|
case 39:
|
|
233
|
-
_e.trys.push([39,
|
|
306
|
+
_e.trys.push([39, 41, , 42]);
|
|
234
307
|
return [4 /*yield*/, datasource.readTest(key)];
|
|
235
308
|
case 40:
|
|
236
309
|
parsed = _e.sent();
|
|
237
|
-
|
|
310
|
+
result = testsZodSchema.safeParse(parsed);
|
|
311
|
+
if (!result.success) {
|
|
312
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
313
|
+
if ("error" in result) {
|
|
314
|
+
(0, printError_1.printZodError)(result.error);
|
|
315
|
+
process.exit(1);
|
|
316
|
+
}
|
|
317
|
+
hasError = true;
|
|
318
|
+
}
|
|
319
|
+
return [3 /*break*/, 42];
|
|
238
320
|
case 41:
|
|
239
|
-
_e.sent();
|
|
240
|
-
|
|
241
|
-
case 42:
|
|
242
|
-
e_6 = _e.sent();
|
|
243
|
-
console.log(" =>", key);
|
|
321
|
+
e_7 = _e.sent();
|
|
322
|
+
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath);
|
|
244
323
|
console.log("");
|
|
245
|
-
|
|
246
|
-
(0, printJoiError_1.printJoiError)(e_6);
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
console.log(e_6);
|
|
250
|
-
}
|
|
324
|
+
console.log(e_7);
|
|
251
325
|
hasError = true;
|
|
252
|
-
return [3 /*break*/,
|
|
253
|
-
case
|
|
326
|
+
return [3 /*break*/, 42];
|
|
327
|
+
case 42:
|
|
254
328
|
_d++;
|
|
255
329
|
return [3 /*break*/, 38];
|
|
256
|
-
case
|
|
330
|
+
case 43: return [2 /*return*/, hasError];
|
|
257
331
|
}
|
|
258
332
|
});
|
|
259
333
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lintProject.js","sourceRoot":"","sources":["../../src/linter/lintProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"lintProject.js","sourceRoot":"","sources":["../../src/linter/lintProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAuB;AACvB,2BAA6B;AAE7B,qDAA0D;AAC1D,qDAA2D;AAC3D,iDAAsD;AACtD,6CAAkD;AAClD,iDAAsD;AACtD,2CAAiD;AAEjD,qEAAiF;AACjF,+EAA6F;AAC7F,2CAA6C;AAE7C,iDAA2E;AAO3E,SAAsB,WAAW,CAC/B,IAAkB,EAClB,OAAgC;IAAhC,wBAAA,EAAA,YAAgC;;QAMhC,SAAS,kBAAkB,CAAC,IAAY,EAAE,GAAW,EAAE,QAAgB;YAAhB,yBAAA,EAAA,gBAAgB;YACrE,IAAM,QAAQ,GAAG,UAAG,GAAG,cAAI,UAAU,CAAC,YAAY,EAAE,CAAE,CAAC;YACvD,IAAI,QAAQ,GAAG,EAAE,CAAC;YAElB,IAAI,IAAI,KAAK,WAAW,EAAE;gBACxB,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;aACvE;iBAAM,IAAI,IAAI,KAAK,SAAS,EAAE;gBAC7B,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,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;oBAEf,QAAQ,GAAG,IAAI,CAAC;;;oBAxBF,IAAY,CAAA;;yBA6BhC,sBAAO,QAAQ,EAAC;;;;CACjB;AAnRD,kCAmRC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printZodError = void 0;
|
|
4
|
+
var cliFormat_1 = require("../tester/cliFormat");
|
|
5
|
+
function printZodError(e) {
|
|
6
|
+
var issues = e.issues;
|
|
7
|
+
issues.forEach(function (issue) {
|
|
8
|
+
console.error(cliFormat_1.CLI_FORMAT_RED, " => Error: ".concat(issue.message));
|
|
9
|
+
console.error(" Path:", issue.path.join("."));
|
|
10
|
+
var receivedValue = issue.received;
|
|
11
|
+
if (typeof receivedValue !== "undefined" && receivedValue !== "undefined") {
|
|
12
|
+
console.error(" Value:", receivedValue);
|
|
13
|
+
}
|
|
14
|
+
if (issues.length > 1) {
|
|
15
|
+
console.error("");
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.printZodError = printZodError;
|
|
20
|
+
//# sourceMappingURL=printError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printError.js","sourceRoot":"","sources":["../../src/linter/printError.ts"],"names":[],"mappings":";;;AAEA,iDAAqD;AAErD,SAAgB,aAAa,CAAC,CAAW;IAC/B,IAAA,MAAM,GAAK,CAAC,OAAN,CAAO;IAErB,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK;QACnB,OAAO,CAAC,KAAK,CAAC,0BAAc,EAAE,sBAAe,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC;QAC9D,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAElD,IAAM,aAAa,GAAI,KAAa,CAAC,QAAQ,CAAC;QAC9C,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,aAAa,KAAK,WAAW,EAAE;YACzE,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;SAC7C;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACrB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;SACnB;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAhBD,sCAgBC"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import { ProjectConfig } from "../config";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function getSegmentZodSchema(projectConfig: ProjectConfig, conditionsZodSchema: any): z.ZodObject<{
|
|
4
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
description: z.ZodString;
|
|
6
|
+
conditions: any;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
archived?: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
conditions?: any;
|
|
11
|
+
}, {
|
|
12
|
+
archived?: boolean;
|
|
13
|
+
description?: string;
|
|
14
|
+
conditions?: any;
|
|
15
|
+
}>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
exports.getSegmentZodSchema = void 0;
|
|
4
|
+
var zod_1 = require("zod");
|
|
5
|
+
function getSegmentZodSchema(projectConfig, conditionsZodSchema) {
|
|
6
|
+
var segmentZodSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
archived: zod_1.z.boolean().optional(),
|
|
9
|
+
description: zod_1.z.string(),
|
|
10
|
+
conditions: conditionsZodSchema,
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
return segmentZodSchema;
|
|
12
14
|
}
|
|
13
|
-
exports.
|
|
15
|
+
exports.getSegmentZodSchema = getSegmentZodSchema;
|
|
14
16
|
//# sourceMappingURL=segmentSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentSchema.js","sourceRoot":"","sources":["../../src/linter/segmentSchema.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"segmentSchema.js","sourceRoot":"","sources":["../../src/linter/segmentSchema.ts"],"names":[],"mappings":";;;AAAA,2BAAwB;AAIxB,SAAgB,mBAAmB,CAAC,aAA4B,EAAE,mBAAmB;IACnF,IAAM,gBAAgB,GAAG,OAAC;SACvB,MAAM,CAAC;QACN,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAChC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;QACvB,UAAU,EAAE,mBAAmB;KAChC,CAAC;SACD,MAAM,EAAE,CAAC;IAEZ,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAVD,kDAUC"}
|