LunatiqueCoder / luna

Luna - a React Native + Next.js template. Built with TypeScript :heart:
https://luna-gamma.vercel.app/
MIT License
264 stars 17 forks source link

fix(paths): use directory-relative paths #29

Closed mikehardy closed 2 years ago

mikehardy commented 2 years ago

If this template is used to init a project, then the app directory itself is moved, the components inside app lose their ability to resolve and lint:types no longer works

If I use directory-relative paths, everything appears fine

Related: https://github.com/invertase/react-native-firebase-authentication-example/pull/3

This was the only change I needed in this template when layering that one on top

LunatiqueCoder commented 2 years ago

While I really liked the absolute modules, I always found them problematic for mobile+web with React Native. :( So removing them for good sounds like a good idea. Thank you, Mike!

mikehardy commented 2 years ago

I actually have a small follow on question - what are all the package.json files in the sub-directories for? those don't seem necessary or useful?

and the src/react-app-env.d.ts file ? that seems like it should be in types if needed?

I'm iterating on this really rapidly now for both the react-native-firebase auth example template and 3 different work projects (all using this one) so this is a period of rapid polishing/cleaning as they all go through their initial phases of development - once the basic scaffolding is up and clean in all of them I'll be really quiet probably :)

LunatiqueCoder commented 2 years ago

I actually have a small follow on question - what are all the package.json files in the sub-directories for? those don't seem necessary or useful?

Feel free to use them however you want or remove them (from Luna as well). Here's why and how I used them:

and the src/react-app-env.d.ts file ? that seems like it should be in types if needed?

That's useful for react-scripts. Should stay where it is in order to avoid errors. You can head to this blog post for more info: https://www.newline.co/@dmitryrogozhny/how-to-start-new-react-application-with-create-react-app-and-typescript--4298e606#create-react-app-types-declaration-file

I'm iterating on this really rapidly now for both the react-native-firebase auth example template and 3 different work projects (all using this one) so this is a period of rapid polishing/cleaning as they all go through their initial phases of development - once the basic scaffolding is up and clean in all of them I'll be really quiet probably :)

Yeah, I'm already on one of my vacations 🥳 That's why I'm a bit quiet, but I'm definitely keeping an eye on Github when I can. I'm very happy that we're helping each other and I'm really wishing you Happy Holidays in case we don't keep in touch. 🍾

mikehardy commented 2 years ago

Happy vacation time :-) - and thanks for posting that up, I had no idea what that stuff was but now I have plenty more to learn ;-). Cheers!