Skip to content

Releases: MrLeebo/prisma-ast

v0.12.0

22 Mar 14:54
Compare
Choose a tag to compare
  • feat: Allow @Map() and other attributes on enums 230ad5b

prisma-ast will now parse attributes on enums

enum Role {
  USER         @map("usr")
  ADMIN        @map("adm")
  ORGANIZATION @map("org") // deprecated

  @@map("roles")
}

and you can add attributes using PrismaSchemaBuilder

builder.enum("Role").enumerator("GUEST").attribute("map", ['"gst"'])

which produces the following output

enum Role {
  USER         @map("usr")
  ADMIN        @map("adm")
  ORGANIZATION @map("org") // deprecated
  GUEST        @map("gst")

  @@map("roles")
}

v0.11.0...v0.12.0

v0.11.0

09 Mar 06:55
Compare
Choose a tag to compare

BREAKING CHANGE

In the internal parser, { type: "fieldAttribute" } and { type: "blockAttribute" } have been made into separate nodes. Previously, the same node { type: "attribute" } was reused for both. This makes it easier for the parser to distinguish which kind of node it's getting because schemas can have block attributes intermixed with their field attributes.

This is only a breaking change if you're accessing the internal AST to access attributes. Higher level abstractions, such as produceSchema / PrismaSchemaBuilder are not impacted by this.

  • Fix printing when block attributes are mixed in with fields 2e30232

v0.10.1...v0.11.0

v0.10.1

25 Feb 14:38
Compare
Choose a tag to compare
  • Add generator.assignments as a valid "findBy" source b69da60
  • Fix mismatch token on kebab case, fixes #36 5c9c838

v0.10.0...v0.10.1

v0.10.0

10 Feb 03:01
Compare
Choose a tag to compare
  • feat: add finder methods to builder 4865f0c

v0.9.1...v0.10.0

v0.9.1

07 Feb 15:51
Compare
Choose a tag to compare
  • fix: add produceSchema to package to resolve #32 40a1347
  • docs: move code samples to a separate document 4ca243c

v0.9.0...v0.9.1

v0.9.0 - Added support for composite types

01 Feb 05:34
Compare
Choose a tag to compare

Adds composite types to the parser, printer, and Schema Builder

model Gallery {
  photos Photo[]
}

type Photo {
  width Int
  height Int
  url String
}

The schema node is { type: "type" } and the builder method is builder.type("Photo")

v0.8.1...v0.9.0

v0.8.1

01 Feb 04:31
Compare
Choose a tag to compare
  • fix: resolves #28 by preventing comments from breaking into the next line 866167d

v0.8.0...v0.8.1

v0.8.0

21 Nov 15:42
Compare
Choose a tag to compare

v0.7.0...v0.8.0

v0.7.0

19 Jul 15:10
Compare
Choose a tag to compare

This release adds optional location tracking stats, making it possible to use prisma-ast for linters, github workflows, IDE plugins, and the like.

  • Add config option to enable location tracking in prisma-ast (#25) 035abad
  • Replace tsdx with dts-cli and update typescript version (#24) 620cfa1
  • Narrow the allowed types for the .then() function's type param f71ff18

v0.6.0...v0.7.0

v0.6.0

07 Jun 05:21
Compare
Choose a tag to compare

BREAKING CHANGES

  • Add support for experimental views (#19) 3412065
    builder.modelAttribute() has been renamed to builder.blockAttribute() to reflect the fact that it can be used for models and views.

v0.5.2...v0.6.0