infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more! 9 years of continuous development and counting.
MIT License
17.77k stars 1.41k forks source link

Generators do not work with expo navigation #2853

Closed Jacob-CZ closed 1 day ago

Jacob-CZ commented 4 days ago

Describe the bug

The generators, for screens do not work at all but thats understandable, but the components and stores are very inconvenient.

Ignite version

10.0.0

Additional info

non relevant

frankcalise commented 4 days ago

Hi @Jacob-CZ, thanks for the report. I have a couple of follow up questions to better understand your issue:

  1. By expo navigation do you mean expo-router?
  2. What was your Ignite new command that you used to generate your project?
  3. What was the generator command you used to generate a new component?
  4. Can you provide more detail around "do no work" - for example, does it error out? does it not generate what you expect?

Thank you

Jacob-CZ commented 4 days ago

Oh yeah im so sorry i forgot to explain, do not work means it puts it in the wrong folder. And i thing the stores are not added to the index export. The commant is the one from the docs using the @latest. Because the new expo router stuff is in src/app and not just app

frankcalise commented 3 days ago

@Jacob-CZ understood thanks for bringing that up. it seems something broke between 10.0.0 and 10.0.4, will look into that!

For now though, you can update the files inside of projectDir/ignite/templates and look for the destinationDir at the top of the files. Update them from app/ to src/ where it makes sense. Then re-run your generator commands and it should work.

For screens, due to the nature of expo-router, you'll want to use this extra cli switch (since you can't define just one destinationDir in the generator template): https://docs.infinite.red/ignite-cli/concept/Generators/#--dir

Here's an example in one of our test files: https://github.com/infinitered/ignite/blob/master/test/vanilla/ignite-generate.test.ts#L435

infinitered-circleci commented 1 day ago

:tada: This issue has been resolved in version 10.0.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: