Skip to content

v0.9.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 12 May 20:36
44f2811
  • Rename bare-ts CLI to bare

  • Forbid use-before-definition

    In the last BARE draft, use-before-definition are disallowed.
    As a consequence, recursive types are also disallowed.

    The following schema is now rejected:

    type Y X
    type X u8
    

    This schema and recursive types are still allowed under the
    option --legacy.

  • Rename --legacy-syntax to --legacy

  • Annotate your schema with doc-comments

    @bare-ts/tool is now able to recognize a doc-comment and to document
    the generated code with them.

    A BARE doc-comment consists in two comment marks ##.
    Doc-comments can only document:

    • type definitions
    • enum values
    • struct fields

    The following schema documents these three kinds of object:

    type Gender enum {
        ## Be inclusive :)
        FLUID
        MALE
        ## One is not born, but becomes a woman
        ##                  -- Simone de Beauvoir
        FEMALE
    }
    
    ## A Person with:
    ## - a name
    ## - a gender
    type Person {
        ## person's name
        name: str
        ## person's gender
        gender: optional<Gender>
    }
    

    Note that this syntax is not part of the BARE specification.
    Thus, this is not portable between distinct implementations.

  • Add BARE code generator

    @bare-ts/tools is now able to output BARE schemas.

    This gives a basic way to format a schema.
    Note that comments (except doc comments) are stripped out.

    bare-ts compile schema.bare -o schema.bare
    bare-ts compile schema.bare --generator 'bare'
    
  • Remove options --main and --no-main

    The previous version introduced automatic promotion of root type aliases
    as main type aliases. Root type aliases are type aliases that are not
    referred by a type in the schema. Main type aliases are types used
    to decode and encode messages.

    For the sake of simplicity, main type aliases and root types aliases
    are now identical.

    In the following schema, Post is the only root/main type alias.

    type Person struct { name: str }
    type Post struct { author: Person }
    
  • Forbid root types that resolve to void

    The following schema is now invalid:

    type Root void
    

    This is not part of the BARE specification.

  • Do not emit read/write for types resolving to void