Closed NLmeng closed 11 months ago
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):
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.
yarn install
works nicely too 🏕️
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)
I meant let's remove .husky
from both /server
and /client
from the remote repo too, what do you think?
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
Yeah you're right, just fetched a fresh copy, the rest of it lgtm
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?
i think this pr is already big enough. i personally would prefer it be done in another pr.
close #35 close #32