Skip to content

Latest commit

 

History

History
75 lines (51 loc) · 3.9 KB

CONTRIBUTING.md

File metadata and controls

75 lines (51 loc) · 3.9 KB

FAQs

  • Q: Why is the cypress test failing?
  • A: If you made any major UI changes it may cause the test to fail. You may have to change the tests slightly(For help with making tests go to How to Make Tests). Otherwise there should be a video and a picture in the cypress/videos or cypress/screenshots directories. If you can not get the cypress test to pass just create a pull request, and I will look at it and get the test to pass.
  • Q: Where are the types for the database?
  • A: There is an interface for every table in the database located in the same file as the database connector.
  • Q: What do all the # in the imports mean?
  • A: The # is a special character that tells the typescript compiler to look in the root of the project for the file. This is used to make the imports shorter and easier to read. There are also other shortcuts like #Modules which is the modules folder. To see a list of all the shortcuts look at the package.json file in the root of the project.

Typescript

I am very slowly converting this project to typescript. I am almost done now there are very few js files left. If you create a new file make it typescript and if you want to you can convert js files to typescript.

Todos before making a pull request

  • Run npm run format to format everything with prettier.
  • Run npm run lint and fix all errors and new warnings.
  • Made sure that all database changes have update code in startup.ts.
  • Made sure to test your changes whith cypress by running npm test and when it is done stopping the server with ctr-c. If this fails and you don't know why look in the cypress section, or just create the pull request anyway and leave this unchecked.
  • If you added any features it would be great if you tested them with cypress(Not required).
  • If you added another league did you follow all the steps in the leagues.md How to add another league.
  • Did you make sure to have all text in the correct format as mentioned in translating.md

How to run development enviroment

There are 2 ways to run the development enviroment Native and Docker.

Other Notes

  • All sql syntax should be written for sqlite. Note that some mysql syntax is automatically translated to sqlite.

Native

This is the reccommended way.

  1. Download this entire repository to your computer with
git clone https://github.com/lukasdotcom/fantasy-manager
  1. Install node v18 or greater if you have not yet. To check you version run the command below which should give you some version number just make sure the major version is greater than or equal to 18. The recommended version is 20.
node -v
  1. Now copy the contents of .env.sample which is in the development folder. Make a new file in the top folder in the repository called .env.local and paste the contents of .env.sample in there.
  2. Now you should be able to run the command below to start up the development instance.
npm run dev

Docker

  1. First install docker and docker-compose or docker desktop
  2. Download this entire repository to your computer with
git clone https://github.com/lukasdotcom/fantasy-manager
  1. Copy the docker-compose file in the development folder to the top folder of the repository.
  2. Edit the volume and replace /locationToWhereThisGithubIsDownloaded with wherever this repository got downloaded to.
  3. Then run docker-compose up

Cypress

How to Make Tests

  1. First run npm run start:test to start a testing server.
  2. Secondly run npm run cypress:open to open cypress itself.
  3. The tests will be located in the cypress/e2e folder.
  4. If you want to load custom data into the db on the player values and points put the data into the sample folder and load it like shown in the invite2.js file in the cypress/e2e direcotory.