denoland / deno_std

The Deno Standard Library
https://jsr.io/@std
MIT License
2.83k stars 581 forks source link

BREAKING(yaml): make `Schema` and `Type` private and stop supporting user-defined schemas #5175

Closed kt3k closed 4 days ago

kt3k commented 5 days ago

What's changed

Type and Schema classes have been made private, and user-defined schemas are no longer supported.

Motivation

Type and Schema expose too many implementation details to be part of the public API.

Migration

If you use one of the pre-defined schemas, you can specify them by its name.

- import { EXTENDED_SCHEMA, parse } from "@std/yaml";
+ import { parse } from "@std/yaml";

- parse(yamlText, { schema: EXTENDED_SCHEMA });
+ parse(yamlText, { schema: "extended" });

If you require a user-defined schema, use npm:js-yaml , which is what @std/yaml was initially based on. It still supports user-defined schemas.


Closes #5117

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.87%. Comparing base (dc3154c) to head (d710783).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5175 +/- ## ========================================== - Coverage 93.94% 93.87% -0.07% ========================================== Files 469 468 -1 Lines 37894 37873 -21 Branches 5447 5442 -5 ========================================== - Hits 35598 35554 -44 - Misses 2253 2277 +24 + Partials 43 42 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.