@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.
Files changed (73) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/coverage/clover.xml +798 -764
  3. package/coverage/coverage-final.json +5 -5
  4. package/coverage/lcov-report/builder/allocator.ts.html +1 -1
  5. package/coverage/lcov-report/builder/buildScopedConditions.ts.html +1 -1
  6. package/coverage/lcov-report/builder/buildScopedDatafile.ts.html +1 -1
  7. package/coverage/lcov-report/builder/buildScopedSegments.ts.html +1 -1
  8. package/coverage/lcov-report/builder/index.html +1 -1
  9. package/coverage/lcov-report/builder/mutateVariables.ts.html +1 -1
  10. package/coverage/lcov-report/builder/mutator.ts.html +18 -18
  11. package/coverage/lcov-report/builder/revision.ts.html +1 -1
  12. package/coverage/lcov-report/builder/traffic.ts.html +1 -1
  13. package/coverage/lcov-report/config/index.html +1 -1
  14. package/coverage/lcov-report/config/index.ts.html +1 -1
  15. package/coverage/lcov-report/config/projectConfig.ts.html +1 -1
  16. package/coverage/lcov-report/datasource/adapter.ts.html +1 -1
  17. package/coverage/lcov-report/datasource/datasource.ts.html +1 -1
  18. package/coverage/lcov-report/datasource/filesystemAdapter.ts.html +1 -1
  19. package/coverage/lcov-report/datasource/index.html +1 -1
  20. package/coverage/lcov-report/datasource/index.ts.html +1 -1
  21. package/coverage/lcov-report/index.html +18 -18
  22. package/coverage/lcov-report/linter/attributeSchema.ts.html +1 -1
  23. package/coverage/lcov-report/linter/checkCircularDependency.ts.html +1 -1
  24. package/coverage/lcov-report/linter/checkPercentageExceedingSlot.ts.html +1 -1
  25. package/coverage/lcov-report/linter/conditionSchema.ts.html +7 -7
  26. package/coverage/lcov-report/linter/featureSchema.ts.html +365 -188
  27. package/coverage/lcov-report/linter/groupSchema.ts.html +1 -1
  28. package/coverage/lcov-report/linter/index.html +34 -34
  29. package/coverage/lcov-report/linter/lintProject.ts.html +1 -1
  30. package/coverage/lcov-report/linter/mutationNotation.ts.html +99 -66
  31. package/coverage/lcov-report/linter/printError.ts.html +1 -1
  32. package/coverage/lcov-report/linter/schema.ts.html +170 -80
  33. package/coverage/lcov-report/linter/segmentSchema.ts.html +1 -1
  34. package/coverage/lcov-report/linter/testSchema.ts.html +1 -1
  35. package/coverage/lcov-report/list/index.html +1 -1
  36. package/coverage/lcov-report/list/matrix.ts.html +1 -1
  37. package/coverage/lcov-report/parsers/index.html +1 -1
  38. package/coverage/lcov-report/parsers/index.ts.html +1 -1
  39. package/coverage/lcov-report/parsers/json.ts.html +1 -1
  40. package/coverage/lcov-report/parsers/yml.ts.html +1 -1
  41. package/coverage/lcov-report/tester/cliFormat.ts.html +1 -1
  42. package/coverage/lcov-report/tester/helpers.ts.html +1 -1
  43. package/coverage/lcov-report/tester/index.html +1 -1
  44. package/coverage/lcov-report/utils/git.ts.html +1 -1
  45. package/coverage/lcov-report/utils/index.html +1 -1
  46. package/coverage/lcov.info +1653 -1567
  47. package/json-schema/attribute.json +25 -9
  48. package/json-schema/feature.json +319 -238
  49. package/json-schema/segment.json +76 -45
  50. package/lib/generate-code/typescript.js +63 -20
  51. package/lib/generate-code/typescript.js.map +1 -1
  52. package/lib/linter/featureSchema.d.ts +9 -0
  53. package/lib/linter/featureSchema.js +38 -8
  54. package/lib/linter/featureSchema.js.map +1 -1
  55. package/lib/linter/featureSchema.spec.js +93 -0
  56. package/lib/linter/featureSchema.spec.js.map +1 -1
  57. package/lib/linter/mutationNotation.js +21 -11
  58. package/lib/linter/mutationNotation.js.map +1 -1
  59. package/lib/linter/mutationNotation.spec.js +18 -0
  60. package/lib/linter/mutationNotation.spec.js.map +1 -1
  61. package/lib/linter/schema.d.ts +1 -0
  62. package/lib/linter/schema.js +13 -0
  63. package/lib/linter/schema.js.map +1 -1
  64. package/lib/linter/schema.spec.js +51 -0
  65. package/lib/linter/schema.spec.js.map +1 -1
  66. package/package.json +5 -5
  67. package/src/generate-code/typescript.ts +87 -20
  68. package/src/linter/featureSchema.spec.ts +118 -0
  69. package/src/linter/featureSchema.ts +65 -6
  70. package/src/linter/mutationNotation.spec.ts +23 -0
  71. package/src/linter/mutationNotation.ts +18 -7
  72. package/src/linter/schema.spec.ts +72 -0
  73. package/src/linter/schema.ts +30 -0
@@ -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