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

Provide workflow instructions for how to develop / test your custom generator #292

Open
JoeRoddy opened this issue Jan 12, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@JoeRoddy
Copy link

Hi! Awesome project btw!

Is your feature request related to a problem? Please describe.

Spent about an hour digging through the source code to get a feel for how everything is working. Would be convenient to have explicit directions on how to make changes to the generator and test the updates. I'm now able to make changes and test them in the /usage directory, but tbh I'm still not sure if I'm technically using it correctly.

I feel like the documentation of the usage of the generated codebase is somewhat lacking.

Describe the solution you'd like

Documentation on the correct workflow for making changes to your generator and testing them. Right now my workflow is:

  1. Make changes to /packages/generator/src/generator.ts
  2. cd /packages/generator && npm run prepack
  3. cd /packages/usage && npx prisma migrate

Not sure if there's an easier way, but that's what I arrived at via trial and error.

Could also provide a QOL script in the base directory's package.json:
"generate": "cd packages/generator && npm run prepack && cd ../usage && npx prisma generate"

Thanks again for your time making this great project!

@JoeRoddy JoeRoddy added the enhancement New feature or request label Jan 12, 2023
@YassinEldeeb
Copy link
Owner

Hey, I thought the blog I've written does a much better job doing that. check it out https://dev.to/yassineldeeb/create-prisma-generator-2mdg and let me know what do you think?

@emab
Copy link

emab commented Feb 12, 2023

I think the bits I missed out after the initial npx command then running pnpm install was the command mentioned in step 2 (build the generator!).

Fairly obvious now that I think about it but I couldn't work out why pnpm prisma generate in /usage wasn't doing anything for longer than I care to admin 😆

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

No branches or pull requests

3 participants