Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split project / Monorepo #147

Open
tkvw opened this issue Jun 25, 2019 · 6 comments
Open

Split project / Monorepo #147

tkvw opened this issue Jun 25, 2019 · 6 comments
Milestone

Comments

@tkvw
Copy link

tkvw commented Jun 25, 2019

I really like your solution, is it possible to split the project in a @warthog/core and @warthog/server package? I like to use it inside nestjs and don't need all the dependencies from the server requirements. Also, this would allow @warthog/nestjs?

@tkvw
Copy link
Author

tkvw commented Jun 25, 2019

Something like: https://github.com/tkvw/warthog/tree/monorepo

@tkvw tkvw changed the title Split project Split project / Monorepo Jun 25, 2019
@goldcaddy77
Copy link
Owner

Interesting idea. A few questions:

  • Which pieces of Nest.js do you want that warthog doesn’t provide?
  • What specific parts of Warthog would you be using? Ultimately we’d need a way to gather metadata from your project to add any of the auto-generation pieces
  • Would you be ok if there was a reliance on TypeORM? I wasn’t planning on supporting other ORMs for a while

@tkvw
Copy link
Author

tkvw commented Jun 25, 2019

  • Which pieces of Nest.js do you want that warthog doesn’t provide?
  • Maturity, nice separation of concerns, lots of tests, high involvement, good docs. For me there's no added value to have another DI framework.
  • What specific parts of Warthog would you be using? Ultimately we’d need a way to gather metadata from your project to add any of the auto-generation pieces
  • Generation of graphql types! Base resolvers. I come from rest, these are my first days of GraphQL. Because of the static schema, I thought: this is going to be a lot of repeat yourself code; this should be generated. Using a search criteria I came upon prisma, which I realized was just another orm, but with all the nice database features abstracted away. But I liked their idea of the static graphql types for filtering. In the github issues I saw a post from you mentioning this project, so that's why I am bothering you now 😄
  • Would you be ok if there was a reliance on TypeORM? I wasn’t planning on supporting other ORMs for a while
  • Yeah, that's the key part of warthog I like. I totally agree with your opinionated view. The decorators you've created to use in the Model, just feel right and there's not much value to generating types which are not bound to an orm. Not entirely sure it should be a peerDependency though.

@vadistic
Copy link

vadistic commented Sep 27, 2019

@tkvw As Proof of Concept I extracted some warthog logic and packed it as NestJS module: https://github.com/vadistic/nestjs-warthog

It works quite nice - see tests, but I have one big shizzle. Relations.

  1. Without relations inputs and with them base services typings are half useless, because I wanted them for public api inputs.

  2. I could add prisma-like {create: {}, connect: {})` logic, but then the result would be some sort of prisma1 clone build on top of TypeOrm. IS there any added value in this?

I would be really glad to hear what you think about it. I'm not convinced, but worst case scenario I think I can cut out few PR's from this endevour^^

EDIT:
Let me clarify my motivation a bit. It's not some shameless project plug. I'm on NestJS bandwagon, but I really like warthogs prisma-like approach. Esspecially since prisma2 moved away from this.

I could help refactor to monorepo and create nestJS module (or just encourage doing it?), but firstly I wanted to see if there's a point in this and after creating this limited demo I'm not so sure anymore. Waiting for some opinions :)

@thiagozf
Copy link

This would also allow Warthog to be used with something like apollo-server-lambda :)

thiagozf added a commit to thiagozf/warthog that referenced this issue Jan 1, 2020
Split Warthog core and cli into packages.

closes goldcaddy77#147
thiagozf added a commit to thiagozf/warthog that referenced this issue Jan 8, 2020
Split Warthog core and cli into packages.

closes goldcaddy77#147
goldcaddy77 pushed a commit that referenced this issue Jan 20, 2020
Split Warthog core and cli into packages.

closes #147
@goldcaddy77 goldcaddy77 added this to the V3 milestone Mar 21, 2020
@goldcaddy77
Copy link
Owner

Hey all, note that I'm planning on adopting a monorepo in V3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants