timothymiller / t4-app

A powerful cross-platform UI toolkit for building actually native iOS, Android, macOS, Windows, Linux, and Progressive Web Apps with React (Native).
https://t4stack.com
MIT License
1.34k stars 71 forks source link

Added `cross-env` for environment variable support in Windows #35

Closed lakeesiv closed 12 months ago

lakeesiv commented 1 year ago

Windows does not support settings environment varaibles like this

"dev": "TAMAGUI_TARGET=native expo start -c"

You will get this error

'TAMAGUI_TARGET' is not recognized as an internal or external command,
operable program or batch file.

To fix this we use cross-env installed in the root of the turborepo and adapt all the setting of environment variables to

"dev": "cross-env TAMAGUI_TARGET=native expo start -c"
timothymiller commented 1 year ago

Seems like a good idea. I'm smashed with work right now, so I will keep this open until someone can review it.

xerxiastudios commented 1 year ago

I checked it with the fix. In Windows metro server seems to open but on scanning the QR code, the bundle doesn't get downloaded to expo go app. Error : Invalid app ID.

Screenshot 2023-07-26 121614

timothymiller commented 1 year ago

I checked it with the fix. In Windows metro server seems to open but on scanning the QR code, the bundle doesn't get downloaded to expo go app. Error : Invalid app ID.

Screenshot 2023-07-26 121614

This issue is unrelated. It's been fixed in a recent PR

xerxiastudios commented 1 year ago

I tested it in windows. Had to add cross-env script in next-package.json file also. Then everything is working in windows.

lakeesiv commented 1 year ago

Let me reupdate it with the latest commits

lakeesiv commented 1 year ago

Updated to latest commits

lakeesiv commented 1 year ago

@xerxiastudios can you check to see if it is all working now. I'm currently away from my windows system

xerxiastudios commented 1 year ago

@lakeesiv next and expo working. haven't checked api workings since I am not using that currently.

timothymiller commented 1 year ago

What type of setup do you need to do in Windows to run this?

This is for outside of WSL, right?

xerxiastudios commented 1 year ago

yes outside wsl, in powershell

timothymiller commented 1 year ago

Let's get the merge conflicts resolved and it's good to merge.

May you also add some documentation in the docs app letting Windows devs know they can develop in powershell as well as WSL?

lakeesiv commented 1 year ago

Let's get the merge conflicts resolved and it's good to merge.

May you also add some documentation in the docs app letting Windows devs know they can develop in powershell as well as WSL?

I don't think it is necessary tbh, as I would normally expect any template to work out of the box for all systems, I don't think we need to exactly specify that you can use native or WSL as the docs does not make any reccomendation.

I think most people who would work with the mobile app will use native windows instead of WSL as I've found WSL tricky to link to android studio etc.

If you really want we could maybe put something in the FAQ? @timothymiller I'm not exactly sure where in the docs this is supposed to go

timothymiller commented 1 year ago

I think it would be good to call out.

Just resolve the conflicts and I'll get this merged.

The docs can come in a later PR.

Have a good weekend!