Closed mchisolm0 closed 1 month ago
If the decision is not to change the generator, we will want to discuss adding instructions to the recipe to get the screen generator working again.
Yeah it is too fixed of an implementation right now - sort of discussed here: https://github.com/infinitered/ignite/issues/2443
@mchisolm0 can you give me an example with current directory structure and what you are looking to create?
@frankcalise Here is the current directory structure after implementing expo-router.
When I have used the generator to create a model, it works except it creates the app/models
directory and adds the generated models to it. I then move them to the right place and update imports.
When I tried to do similarly with the screen generator, it just fails. Here is what I think is the most relevant part of the error. Error: file not found app/screens/index.ts at /Users/matthewchisolm/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/toolbox/patching-tools.js:184:23
I did also read through the suggestion for plop and the README for the project. I agree if that was implemented, I think it would address this issue. I am happy to help with that if the team decides to go that route and wants the help.
@mchisolm0 yeah I was looking into the current implementation, perhaps we can just override the hardcoded subdir with a parameter to not do a full rewrite via Plop (which is not in the cards for us at the moment).
The screen generator doesn't really apply with expo-router, since they don't all live in a single directory anymore with the src/app
dir present and file-based routing. However, with a path param we could stub out a screen file and then in the command pass the proper path, such as src/app/(app)/(tabs)/my-new-tab.tsx
for example
FYI we're starting to build a roadmap for these changes, stay tuned @mchisolm0
@mchisolm0 this is available with npx ignite-cli@next
Addressed in #2726.
:tada: This issue has been resolved in version 10.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
When the generator is run, it references certain paths which are different after converting to Expo Router (link).
Relevant frontmatter in the ejs file
When I brought it up, modifying the generator to allow for changing the paths used was brought up.
Is that something you are wanting to consider? If so, I'm happy to help. Otherwise, we can close this issue.