@featurevisor/core 2.13.0 → 2.14.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/CHANGELOG.md +11 -0
- package/coverage/clover.xml +906 -557
- package/coverage/coverage-final.json +11 -8
- package/coverage/lcov-report/builder/allocator.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedConditions.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedDatafile.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedSegments.ts.html +1 -1
- package/coverage/lcov-report/builder/index.html +38 -8
- package/coverage/lcov-report/builder/mutateVariables.ts.html +400 -0
- package/coverage/lcov-report/builder/mutator.ts.html +796 -0
- package/coverage/lcov-report/builder/revision.ts.html +1 -1
- package/coverage/lcov-report/builder/traffic.ts.html +1 -1
- package/coverage/lcov-report/config/index.html +1 -1
- package/coverage/lcov-report/config/projectConfig.ts.html +1 -1
- package/coverage/lcov-report/datasource/adapter.ts.html +1 -1
- package/coverage/lcov-report/datasource/datasource.ts.html +4 -4
- package/coverage/lcov-report/datasource/filesystemAdapter.ts.html +23 -23
- package/coverage/lcov-report/datasource/index.html +1 -1
- package/coverage/lcov-report/datasource/index.ts.html +1 -1
- package/coverage/lcov-report/index.html +28 -28
- package/coverage/lcov-report/linter/attributeSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/checkCircularDependency.ts.html +1 -1
- package/coverage/lcov-report/linter/checkPercentageExceedingSlot.ts.html +1 -1
- package/coverage/lcov-report/linter/conditionSchema.ts.html +7 -7
- package/coverage/lcov-report/linter/featureSchema.ts.html +789 -318
- package/coverage/lcov-report/linter/groupSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/index.html +34 -19
- package/coverage/lcov-report/linter/lintProject.ts.html +25 -25
- package/coverage/lcov-report/linter/mutationNotation.ts.html +1309 -0
- package/coverage/lcov-report/linter/printError.ts.html +1 -1
- package/coverage/lcov-report/linter/schema.ts.html +69 -69
- package/coverage/lcov-report/linter/segmentSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/testSchema.ts.html +5 -5
- package/coverage/lcov-report/list/index.html +1 -1
- package/coverage/lcov-report/list/matrix.ts.html +1 -1
- package/coverage/lcov-report/parsers/index.html +1 -1
- package/coverage/lcov-report/parsers/index.ts.html +1 -1
- package/coverage/lcov-report/parsers/json.ts.html +1 -1
- package/coverage/lcov-report/parsers/yml.ts.html +2 -2
- package/coverage/lcov-report/tester/cliFormat.ts.html +1 -1
- package/coverage/lcov-report/tester/helpers.ts.html +1 -1
- package/coverage/lcov-report/tester/index.html +1 -1
- package/coverage/lcov-report/utils/git.ts.html +1 -1
- package/coverage/lcov-report/utils/index.html +1 -1
- package/coverage/lcov.info +1839 -1120
- package/lib/builder/buildDatafile.js +8 -3
- package/lib/builder/buildDatafile.js.map +1 -1
- package/lib/builder/mutateVariables.d.ts +14 -0
- package/lib/builder/mutateVariables.js +90 -0
- package/lib/builder/mutateVariables.js.map +1 -0
- package/lib/builder/mutateVariables.spec.d.ts +1 -0
- package/lib/builder/mutateVariables.spec.js +1045 -0
- package/lib/builder/mutateVariables.spec.js.map +1 -0
- package/lib/builder/mutator.d.ts +20 -0
- package/lib/builder/mutator.js +223 -0
- package/lib/builder/mutator.js.map +1 -0
- package/lib/builder/mutator.spec.d.ts +1 -0
- package/lib/builder/mutator.spec.js +368 -0
- package/lib/builder/mutator.spec.js.map +1 -0
- package/lib/linter/featureSchema.d.ts +7 -7
- package/lib/linter/featureSchema.js +138 -62
- package/lib/linter/featureSchema.js.map +1 -1
- package/lib/linter/featureSchema.spec.js +150 -0
- package/lib/linter/featureSchema.spec.js.map +1 -1
- package/lib/linter/mutationNotation.d.ts +47 -0
- package/lib/linter/mutationNotation.js +381 -0
- package/lib/linter/mutationNotation.js.map +1 -0
- package/lib/linter/mutationNotation.spec.d.ts +1 -0
- package/lib/linter/mutationNotation.spec.js +549 -0
- package/lib/linter/mutationNotation.spec.js.map +1 -0
- package/package.json +2 -2
- package/src/builder/buildDatafile.ts +29 -3
- package/src/builder/mutateVariables.spec.ts +1134 -0
- package/src/builder/mutateVariables.ts +105 -0
- package/src/builder/mutator.spec.ts +413 -0
- package/src/builder/mutator.ts +237 -0
- package/src/linter/featureSchema.spec.ts +182 -0
- package/src/linter/featureSchema.ts +254 -97
- package/src/linter/mutationNotation.spec.ts +642 -0
- package/src/linter/mutationNotation.ts +408 -0
|
@@ -30,6 +30,10 @@ import { generateHashForDatafile, generateHashForFeature, getSegmentHashes } fro
|
|
|
30
30
|
import { getTraffic } from "./traffic";
|
|
31
31
|
import { getFeatureRanges } from "./getFeatureRanges";
|
|
32
32
|
import { convertToV1 } from "./convertToV1";
|
|
33
|
+
import {
|
|
34
|
+
resolveMutationsForMultipleVariables,
|
|
35
|
+
resolveMutationsForSingleVariable,
|
|
36
|
+
} from "./mutateVariables";
|
|
33
37
|
|
|
34
38
|
export interface CustomDatafileOptions {
|
|
35
39
|
featureKey?: string;
|
|
@@ -210,7 +214,10 @@ export async function buildDatafile(
|
|
|
210
214
|
const mappedVariation: any = {
|
|
211
215
|
value: variation.value,
|
|
212
216
|
weight: variation.weight, // @NOTE: added so state files can maintain weight info, but datafiles don't need this. find a way to remove it from datafiles later
|
|
213
|
-
variables:
|
|
217
|
+
variables: resolveMutationsForMultipleVariables(
|
|
218
|
+
parsedFeature.variablesSchema,
|
|
219
|
+
variation.variables,
|
|
220
|
+
),
|
|
214
221
|
variableOverrides: variation.variableOverrides,
|
|
215
222
|
};
|
|
216
223
|
|
|
@@ -235,7 +242,11 @@ export async function buildDatafile(
|
|
|
235
242
|
projectConfig.stringify && typeof override.conditions !== "string"
|
|
236
243
|
? JSON.stringify(override.conditions)
|
|
237
244
|
: override.conditions,
|
|
238
|
-
value:
|
|
245
|
+
value: resolveMutationsForSingleVariable(
|
|
246
|
+
parsedFeature.variablesSchema,
|
|
247
|
+
variableKey,
|
|
248
|
+
override.value,
|
|
249
|
+
),
|
|
239
250
|
};
|
|
240
251
|
}
|
|
241
252
|
|
|
@@ -252,7 +263,11 @@ export async function buildDatafile(
|
|
|
252
263
|
projectConfig.stringify && typeof override.segments !== "string"
|
|
253
264
|
? JSON.stringify(override.segments)
|
|
254
265
|
: override.segments,
|
|
255
|
-
value:
|
|
266
|
+
value: resolveMutationsForSingleVariable(
|
|
267
|
+
parsedFeature.variablesSchema,
|
|
268
|
+
variableKey,
|
|
269
|
+
override.value,
|
|
270
|
+
),
|
|
256
271
|
};
|
|
257
272
|
}
|
|
258
273
|
|
|
@@ -272,6 +287,10 @@ export async function buildDatafile(
|
|
|
272
287
|
).map((t: Traffic) => {
|
|
273
288
|
return {
|
|
274
289
|
...t,
|
|
290
|
+
variables: resolveMutationsForMultipleVariables(
|
|
291
|
+
parsedFeature.variablesSchema,
|
|
292
|
+
t.variables,
|
|
293
|
+
),
|
|
275
294
|
segments:
|
|
276
295
|
typeof t.segments !== "string" && projectConfig.stringify
|
|
277
296
|
? JSON.stringify(t.segments)
|
|
@@ -352,6 +371,13 @@ export async function buildDatafile(
|
|
|
352
371
|
: f.conditions;
|
|
353
372
|
}
|
|
354
373
|
|
|
374
|
+
if (f.variables) {
|
|
375
|
+
f.variables = resolveMutationsForMultipleVariables(
|
|
376
|
+
parsedFeature.variablesSchema,
|
|
377
|
+
f.variables,
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
355
381
|
return f;
|
|
356
382
|
});
|
|
357
383
|
}
|