@featurevisor/core 2.17.0 → 2.18.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 +798 -764
- package/coverage/coverage-final.json +5 -5
- 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 +1 -1
- package/coverage/lcov-report/builder/mutateVariables.ts.html +1 -1
- package/coverage/lcov-report/builder/mutator.ts.html +18 -18
- 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/index.ts.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 +1 -1
- package/coverage/lcov-report/datasource/filesystemAdapter.ts.html +1 -1
- 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 +18 -18
- 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 +365 -188
- package/coverage/lcov-report/linter/groupSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/index.html +34 -34
- package/coverage/lcov-report/linter/lintProject.ts.html +1 -1
- package/coverage/lcov-report/linter/mutationNotation.ts.html +99 -66
- package/coverage/lcov-report/linter/printError.ts.html +1 -1
- package/coverage/lcov-report/linter/schema.ts.html +170 -80
- package/coverage/lcov-report/linter/segmentSchema.ts.html +1 -1
- package/coverage/lcov-report/linter/testSchema.ts.html +1 -1
- 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 +1 -1
- 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 +1653 -1567
- package/json-schema/attribute.json +25 -9
- package/json-schema/feature.json +319 -238
- package/json-schema/segment.json +76 -45
- package/lib/generate-code/typescript.js +63 -20
- package/lib/generate-code/typescript.js.map +1 -1
- package/lib/linter/featureSchema.d.ts +9 -0
- package/lib/linter/featureSchema.js +38 -8
- package/lib/linter/featureSchema.js.map +1 -1
- package/lib/linter/featureSchema.spec.js +93 -0
- package/lib/linter/featureSchema.spec.js.map +1 -1
- package/lib/linter/mutationNotation.js +21 -11
- package/lib/linter/mutationNotation.js.map +1 -1
- package/lib/linter/mutationNotation.spec.js +18 -0
- package/lib/linter/mutationNotation.spec.js.map +1 -1
- package/lib/linter/schema.d.ts +1 -0
- package/lib/linter/schema.js +13 -0
- package/lib/linter/schema.js.map +1 -1
- package/lib/linter/schema.spec.js +51 -0
- package/lib/linter/schema.spec.js.map +1 -1
- package/package.json +5 -5
- package/src/generate-code/typescript.ts +87 -20
- package/src/linter/featureSchema.spec.ts +118 -0
- package/src/linter/featureSchema.ts +65 -6
- package/src/linter/mutationNotation.spec.ts +23 -0
- package/src/linter/mutationNotation.ts +18 -7
- package/src/linter/schema.spec.ts +72 -0
- package/src/linter/schema.ts +30 -0
package/src/linter/schema.ts
CHANGED
|
@@ -35,6 +35,7 @@ type SchemaLike = {
|
|
|
35
35
|
uniqueItems?: boolean;
|
|
36
36
|
items?: unknown;
|
|
37
37
|
properties?: Record<string, unknown>;
|
|
38
|
+
additionalProperties?: unknown;
|
|
38
39
|
oneOf?: unknown[];
|
|
39
40
|
};
|
|
40
41
|
|
|
@@ -74,6 +75,13 @@ export function refineEnumMatchesType(
|
|
|
74
75
|
);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
78
|
+
if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
|
|
79
|
+
refineEnumMatchesType(
|
|
80
|
+
schema.additionalProperties as SchemaLike,
|
|
81
|
+
[...pathPrefix, "additionalProperties"],
|
|
82
|
+
ctx,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
77
85
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
78
86
|
schema.oneOf.forEach((branch, i) => {
|
|
79
87
|
if (branch && typeof branch === "object") {
|
|
@@ -157,6 +165,13 @@ export function refineMinimumMaximum(
|
|
|
157
165
|
);
|
|
158
166
|
}
|
|
159
167
|
}
|
|
168
|
+
if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
|
|
169
|
+
refineMinimumMaximum(
|
|
170
|
+
schema.additionalProperties as SchemaLike,
|
|
171
|
+
[...pathPrefix, "additionalProperties"],
|
|
172
|
+
ctx,
|
|
173
|
+
);
|
|
174
|
+
}
|
|
160
175
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
161
176
|
schema.oneOf.forEach((branch, i) => {
|
|
162
177
|
if (branch && typeof branch === "object") {
|
|
@@ -277,6 +292,13 @@ export function refineStringLengthPattern(
|
|
|
277
292
|
);
|
|
278
293
|
}
|
|
279
294
|
}
|
|
295
|
+
if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
|
|
296
|
+
refineStringLengthPattern(
|
|
297
|
+
schema.additionalProperties as SchemaLike,
|
|
298
|
+
[...pathPrefix, "additionalProperties"],
|
|
299
|
+
ctx,
|
|
300
|
+
);
|
|
301
|
+
}
|
|
280
302
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
281
303
|
schema.oneOf.forEach((branch, i) => {
|
|
282
304
|
if (branch && typeof branch === "object") {
|
|
@@ -376,6 +398,13 @@ export function refineArrayItems(
|
|
|
376
398
|
refineArrayItems(schema.properties[k] as SchemaLike, [...pathPrefix, "properties", k], ctx);
|
|
377
399
|
}
|
|
378
400
|
}
|
|
401
|
+
if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
|
|
402
|
+
refineArrayItems(
|
|
403
|
+
schema.additionalProperties as SchemaLike,
|
|
404
|
+
[...pathPrefix, "additionalProperties"],
|
|
405
|
+
ctx,
|
|
406
|
+
);
|
|
407
|
+
}
|
|
379
408
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
380
409
|
schema.oneOf.forEach((branch, i) => {
|
|
381
410
|
if (branch && typeof branch === "object") {
|
|
@@ -428,6 +457,7 @@ export function getSchemaZodSchema(schemaKeys: SchemaKey[] = []) {
|
|
|
428
457
|
uniqueItems: z.boolean().optional(),
|
|
429
458
|
required: z.array(z.string()).optional(),
|
|
430
459
|
properties: z.record(z.string(), schemaZodSchema).optional(),
|
|
460
|
+
additionalProperties: schemaZodSchema.optional(),
|
|
431
461
|
// Annotations: default?: Value; examples?: Value[];
|
|
432
462
|
|
|
433
463
|
schema: z
|