ChicoState / PantryNode

MIT License
2 stars 34 forks source link

Backend Hot Reloading #155

Closed briswells closed 1 year ago

briswells commented 1 year ago

Currently only the front end is setup for hot reloads when files are edited. Backend should be setup similarly so there is no need to restart containers whenever a backend file is changed.

AbhinavReddy-Dev commented 1 year ago

Need to use nodemon for that to work, it will modify the docker-compose and package.json files. I'm trying to do it in my local but I'm getting an error saying that it can find the files in the directory, but the nodemon works.

AbhinavReddy-Dev commented 1 year ago

Need to use nodemon for that to work, it will modify the docker-compose and package.json files. I'm trying to do it in my local but I'm getting an error saying that it can find the files in the directory, but the nodemon works.

There are lots of inconsistencies with the file extensions and the imports in those files, need to change all the files to be either .js or .ts. This will help to some extent solve the nodemon issue.

briswells commented 1 year ago

Need to use nodemon for that to work, it will modify the docker-compose and package.json files. I'm trying to do it in my local but I'm getting an error saying that it can find the files in the directory, but the nodemon works.

There are lots of inconsistencies with the file extensions and the imports in those files, need to change all the files to be either .js or .ts. This will help to some extent solve the nodemon issue.

Yeah, I ran into that yesterday got tired and gave up. I am unsure if the linter will let us convert all the JS files to TS, I'll take a look later.

AbhinavReddy-Dev commented 1 year ago

Need to use nodemon for that to work, it will modify the docker-compose and package.json files. I'm trying to do it in my local but I'm getting an error saying that it can find the files in the directory, but the nodemon works.

There are lots of inconsistencies with the file extensions and the imports in those files, need to change all the files to be either .js or .ts. This will help to some extent solve the nodemon issue.

Yeah, I ran into that yesterday got tired and gave up. I am unsure if the linter will let us convert all the JS files to TS, I'll take a look later.

Same, spent half day working on it and then it didn't seem to work unless we make major changes to file extensions. We can maybe, just rename the .js to .ts and see if it asks for any further changes when running.

briswells commented 1 year ago

Need to use nodemon for that to work, it will modify the docker-compose and package.json files. I'm trying to do it in my local but I'm getting an error saying that it can find the files in the directory, but the nodemon works.

There are lots of inconsistencies with the file extensions and the imports in those files, need to change all the files to be either .js or .ts. This will help to some extent solve the nodemon issue.

Yeah, I ran into that yesterday got tired and gave up. I am unsure if the linter will let us convert all the JS files to TS, I'll take a look later.

Same, spent half day working on it and then it didn't seem to work unless we make major changes to file extensions. We can maybe, just rename the .js to .ts and see if it asks for any further changes when running.

Did you run into any issue with npm running out of space when adding a library to the backend while testing?

briswells commented 1 year ago

Looks like we can just use ts-node-dev and it works without needing to change a bunch of files types. I'll submit a PR soon with the changes.