Closed francistogram closed 4 months ago
Fixed in 2.1.0
Hey @ymc9 seems like I'm still running into the same issue on v2.1.1
Looking at the test in the commit seems like it only tests for the name used as a field on a model vs an enum value that either
Oh, my apologies. You're right, the support was only added for model fields not enum fields ... Will make one more fix later today. Please also let me know if you're interested in making a PR 😄 @francistogram
Happy to make a PR if ya don't mind pointing me on where to get started!
Happy to make a PR if ya don't mind pointing me on where to get started!
Awesome! You can make a fork and create a PR based off the "dev" branch.
I believe the only change needed is this line here: https://github.com/zenstackhq/zenstack/blob/fea8ec71eac83e880112d64057355e8d2979bd18/packages/language/src/zmodel.langium#L212C10-L212C19
name=RegularID
to name=RegularIDWithTypeName
.
If you run pnpm build
, a few other files (like ast.ts
) will be auto-updated and should be included in the change.
If you want to test it out locally, you can pnpm build
in the language
package, and copy over the content of "dist" folder into your node_modules.
Let me know if you run into any hurdle.
I've made the change and was able to build it'
I am a little stuck with testing it locally
If you want to test it out locally, you can pnpm build in the language package, and copy over the content of "dist" folder into your node_modules.
Was initially thinking maybe I'd copy over the changed files e.g. ast.ts
but that file doesn't seem to exist in the node_modules
, closest thing I found was ast-utils.js
Any pointers here on what I might be missing?
Good to know the progress @francistogram ! The npm package corresponding to the "language" pnpm package is actually "@zenstackhq/language". You should be able to find "ast.js" at "node_modules/@zenstackhq/language".
Ah the @
explains why I hadn't seen it in the folder 🤦♂️
Almost there I think, unclear to me if this is an issue related with my change or with my schema.zmodel
as this is my first time setting up zenstack (this issue was preventing me from migrating easily)
These are some of the lines it's complaining about it you see any issues here?
I went ahead and put up a PR in case this helps in debugging if I did anything wrong
https://github.com/zenstackhq/zenstack/pull/1457
Thanks for the help here too!
Ah the
@
explains why I hadn't seen it in the folder 🤦♂️Almost there I think, unclear to me if this is an issue related with my change or with my
schema.zmodel
as this is my first time setting up zenstack (this issue was preventing me from migrating easily)These are some of the lines it's complaining about it you see any issues here?
I went ahead and put up a PR in case this helps in debugging if I did anything wrong
1457
Thanks for the help here too!
Hey @francistogram , the change looks cool to me. I've merged it. And then I found I overlooked that reference expressions also need to respect reserved type names, otherwise enum fields cannot be properly resolved. I've pushed an extra fix.
Will publish a patch release today. Thank you for the work!
The change is live in v2.1.2 now!
I have an enum with values from Webflow's API with all of the possible types
this worked in
prisma.schema
but withschema.zmodel
I get this errorSeems like a bug cause there's no reason I shouldn't be able to have an enum named "DateTime" and it works in Prisma directly