Hylozoic / hylo

2 stars 0 forks source link

How to transition local dev setups to the new repo #13

Open thomasgwatson opened 1 month ago

thomasgwatson commented 1 month ago

As of 15 OCT 2024:

We are ready to switch to monorepo usage now with the following caveats and instructions:

Using it:
There are a few workspace level scripts shortcut scripts there for convienance:
Adding code going forward
thomasgwatson commented 1 week ago

Getting tests working on the backend...

ok, so steps so far.

Now running "test": "mocha -r test/setup/core -r @babel/register --exit", as the test command. The test/setup/core file was setting the NODE_ENV to test anyway, so seems redundant to have some reference to NODE_ENV in the command itself.

Maybe its there for a reason but can't see any comments to suggest why

The next problem was .load() was failing on dotenv references... updated the dotenv dependences and .load() is gone now, instead you use .config().

Now the warning that the test database needs to have test in its name; which is great because you don't want running tests to nuke your databases :slightly_smiling_face:

Previously we had a .env.test file that defined the test db to point at (amongst other things)

That hadn't been pulled across from my prior node repo, so I pulled that across.

But its still throwing the same error. So the setup isn't picking up the test env file. I assume it did previously, so now I just need to figure out how to get it to grab .env.test instead of .env when its testing

KevinTriplett commented 1 week ago

Thanks Tom! I'll be back home starting this coming week, and will pick up where you are, hopefully. It may be good to schedule a call with you so we can work together. Will let you know if I need that. Ta!

lorenjohnson commented 1 week ago

This may be of some help. It is the start and some decent progress on getting CircleCI to "do the right thing" with the monorepo, i.e. it will run tests on a branch for any of the effected projects (web, mobile, or backend). So if there are only changes in the branch for mobile, only mobile tests run.

I THINK I'd gotten the backend tests were running in this setup, but need to confirm. However this worked out, it was at least successful running in Yarn Berry.

https://github.com/Hylozoic/hylo/pull/25