Skip to report

A types module every converter now imports

Trace Valibot’s Standard JSON Schema interface into the converter it reuses, and the extracted types module that converters, functions and utilities all moved onto.

open-circle/valibot #1372 · PR by fabian-hiller · Merged

open-circle/valibot 0a235e22..df48dd9d

base and head as given

  • Standard JSON Schema conversion entered the package.
  • JSON Schema conversion types moved into a dedicated type layer.
  • Conversion functions now depend on the dedicated type layer.
files changed
22
in a component
14
lines in components
446
components
6
public routes changed
0
schema statements
0
new dependencies
0
excluded by role
8
Based on 12 of 15 eligible changed files

Standard JSON Schema conversion

Added
Before
Standard conversion did not exist
After
Standard conversion exposes input/output

Schemas can now expose a Standard JSON Schema interface that generates input or output schemas for draft-07, draft-2020-12, and OpenAPI 3.0. Existing conversion options can be passed through the interface.

In favour

  • In favour: Reuses the existing converter for standard input and output generation

The model found nothing to weigh against this.

Files changed in 6 components. Dependencies shown: 5 new, 4 removed, 3 unchanged
unchanged · 3new · 5removed · 41 component added

5 new dependencies between components — Schema Functions → Schema Types · Schema Converters → Schema Types · Schema Utilities → Schema Types · Vitest Tests → Schema Types · JSON Schema Source → Schema Types

4 dependencies no longer there — Schema Converters → JSON Schema Source · Schema Functions → JSON Schema Source · Schema Utilities → JSON Schema Source · Vitest Tests → JSON Schema Source

What else could behave differently

6 components · 19 files

These components import changed code, directly or through other files. A traced dependency is a place to review, not a confirmed runtime failure.

Reached 3

ComponentSymbolCited atFilesReached by
Schema Typespackages/to-json-schema/src/types/Added packages/to-json-schema/src/types/schema.ts:30-8021 direct · 1 at two steps
Trace path

Shortest component path from the changed symbol:

  1. Schema Types

Later steps follow file imports; they do not prove this symbol is called.

Schema Functionspackages/to-json-schema/src/functions/Signature changed 1 of 7 changed symbols reaching itpackages/to-json-schema/src/converters/convertSchema/convertSchema.ts:139-65773 direct · 3 at two steps · 1 at three steps
Trace path

Shortest component path from the changed symbol:

  1. Schema Converters
  2. Schema Functions

Later steps follow file imports; they do not prove this symbol is called.

Schema Converterspackages/to-json-schema/src/converters/Signature changed 1 of 4 changed symbols reaching itpackages/to-json-schema/src/converters/convertAction/convertAction.ts:115-41152 direct · 2 at two steps · 1 at three steps
Trace path

Shortest component path from the changed symbol:

  1. Schema Converters

Later steps follow file imports; they do not prove this symbol is called.

Held back 1

ComponentFilesReached byResolution
packages/to-json-schema/src/1none direct · 1 at three stepsprecise

Ranked lower 2

ComponentFilesReached by
packages/to-json-schema/src/utils/21 direct · 1 at two steps
packages/to-json-schema/src/vitest/21 direct · 1 at two steps

Statements 3

The added JsonSchema type reached 2 files in Schema Types. 11
packages/to-json-schema/src/types/schema.ts:30-80
convertSchema's signature changed and reached 7 files in Schema Functions. 331
packages/to-json-schema/src/converters/convertSchema/convertSchema.ts:139-657
convertAction's signature changed and reached 5 files in Schema Converters. 221
packages/to-json-schema/src/converters/convertAction/convertAction.ts:115-411

5 reached files belong to no component — tests, docs and config.

Routes, schema, dependencies

No public URL, no migration and no new package.

Inspect components, files and symbols

Component

JSON Schema SourceModified
packages/to-json-schema/src/

2 files · 22 lines

exports

The source surface no longer exported ConversionConfig, ConversionContext, JSONSchema7, OverrideActionContext, OverrideRefContext, or OverrideSchemaContext.
2 files were split between the source root and Schema Types, and Git tracked both as renames.
Schema TypesAdded
packages/to-json-schema/src/types/

4 files · 168 lines

5 dependents

Schema Types added ConversionConfig, ConversionContext, JSONSchema7, JsonSchema, OverrideActionContext, OverrideRefContext, OverrideSchemaContext, and StandardJsonSchema exports.
Schema ConvertersModified
packages/to-json-schema/src/converters/

2 files · 174 lines

1 dependent

Schema FunctionsModified
packages/to-json-schema/src/functions/

5 files · 78 lines

1 dependent

Schema Functions added the toStandardJsonSchema export.
Schema UtilitiesModified
packages/to-json-schema/src/utils/

1 file · 2 lines

1 dependent

Vitest TestsModified
packages/to-json-schema/src/vitest/

1 file · 2 lines

File

JSON Schema Sourcepackages/to-json-schema/src/
packages/to-json-schema/src/index.ts

+1 −3

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/schema.ts

+88 −0

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/standard.ts

+59 −0

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/config.ts

+11 −7

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/index.ts

+3 −0

Schema Converterspackages/to-json-schema/src/converters/
packages/to-json-schema/src/converters/convertSchema/convertSchema.ts

+135 −32

Schema Converterspackages/to-json-schema/src/converters/
packages/to-json-schema/src/converters/convertAction/convertAction.ts

+3 −4

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toStandardJsonSchema/toStandardJsonSchema.ts

+47 −0

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toJsonSchema/toJsonSchema.ts

+16 −4

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts

+6 −3

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/index.ts

+1 −0

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toStandardJsonSchema/index.ts

+1 −0

Schema Utilitiespackages/to-json-schema/src/utils/
packages/to-json-schema/src/utils/handleError.ts

+1 −1

Vitest Testspackages/to-json-schema/src/vitest/
packages/to-json-schema/src/vitest/createContext.ts

+1 −1

Function

imports what changeddownstream of it, one mark per step

Diff

JSON Schema Sourcepackages/to-json-schema/src/
packages/to-json-schema/src/index.ts

1–1

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/schema.ts

1–88

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/standard.ts

1–59

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/config.ts

1–1, 2–2, 11–11 and 6 more spans

Schema Typespackages/to-json-schema/src/types/
packages/to-json-schema/src/types/index.ts

1–3

Schema Converterspackages/to-json-schema/src/converters/
packages/to-json-schema/src/converters/convertSchema/convertSchema.ts

1–1, 2–6, 140–140 and 11 more spans

Schema Converterspackages/to-json-schema/src/converters/
packages/to-json-schema/src/converters/convertAction/convertAction.ts

1–1, 2–2, 116–116 and 1 more span

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toStandardJsonSchema/toStandardJsonSchema.ts

1–47

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toJsonSchema/toJsonSchema.ts

1–1, 4–8, 21–21 and 2 more spans

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts

1–1, 3–7, 25–25

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/index.ts

3–3

Schema Functionspackages/to-json-schema/src/functions/
packages/to-json-schema/src/functions/toStandardJsonSchema/index.ts

1–1

Schema Utilitiespackages/to-json-schema/src/utils/
packages/to-json-schema/src/utils/handleError.ts

1–1

Vitest Testspackages/to-json-schema/src/vitest/
packages/to-json-schema/src/vitest/createContext.ts

1–1

Analysis scope

3170 → 6
  1. 3,170
    files at head
  2. 315
    components
  3. 6
    changed by this change

Where the new files landed

5 new files
New fileBelongs toUsed byCallsServes
packages/to-json-schema/src/types/3 new files
Schema Typesnew territory
JSON Schema SourceSchema ConvertersSchema FunctionsSchema UtilitiesVitest Tests
library/src/
packages/to-json-schema/src/functions/2 new files
Schema Functionsbase frame
its own component only
library/src/Schema Types

1 added file carries no component — 1 test.

6components changed
0reached, not changed
1components added/removed
7dependencies added between components
5dependencies removed between components
1files moved to another path

22 files changed, 16 claims stated. 6 components reached in total.

naming: “model

narrative: “model

analyzer 0.2.0, config v1.9.0-phase8

Every line above is derived from 0a235e22..df48dd9d and nothing else.