cpsc455-bugstorm / TravelersTea

A Trip Planning App that tailors travel itineraries based on user preferences and providing detailed information about destinations; making travel planning less daunting and more enjoyable.
https://travelerstea-906d.onrender.com
MIT License
6 stars 2 forks source link

Use yarn workspace and add GitHub action for formatting pulls on main #36

Closed NLmeng closed 11 months ago

NLmeng commented 11 months ago

close #35 close #32

NLmeng commented 11 months ago
Screenshot 2023-05-26 at 1 05 52 PM

with this new set up, you only have to do yarn install in root and using the scripts, you can start, test, lint/format from root as well. common eslint and prettier rules are moved to root, the rules that are specific to client and server will stay the same. husky and lint-staged will run from root and cascade to every staged files. if that is not enough, GitHub will also try to reformat your code when you open a pull request.

to test this, someone should checkout to this branch, delete their current node modules (everywhere that is found within the project), and yarn install from root. if you have .husky in client and/or server, you need to delete those and make sure the .husky is located at root with the following content (in (root)/.husky/pre-commit):

Screenshot 2023-05-26 at 1 22 17 PM

afterward, (for now) you can do yarn start:client to view the frontend. yarn lint to check any linting errors/warnings. yarn format to format your codes. you can also test pre-commit, by committing some badly-styled codes. (now) you can do yarn start to start both client and server.

Graywing13 commented 11 months ago

yarn install works nicely too 🏕️

NLmeng commented 11 months ago

you can and SHOULD delete .husky under client and server. the only .husky needed is in root. after you do yarn install in root once, the husky pre-commit should work. i think just doing yarn install in root once will work normally, but if you want to be safe, you can delete all previous node modules and then do the yarn install in root (though i think it would be fine skipping the deleting of node modules)

vee-16 commented 11 months ago

I meant let's remove .husky from both /server and /client from the remote repo too, what do you think?

NLmeng commented 11 months ago

https://github.com/cpsc455-bugstorm/TravelersTea/tree/lymeng/restructurePackage there is no .husky in client and server on the repo. im pretty sure it persists from your local changes

vee-16 commented 11 months ago

Yeah you're right, just fetched a fresh copy, the rest of it lgtm

vee-16 commented 11 months ago

Since grading is completed, shall we link the changes in this PR to #21 ? And should we update the README or make a separate installation doc?

NLmeng commented 11 months ago

i think this pr is already big enough. i personally would prefer it be done in another pr.