If you are not familiar with Git and Github
- IMPORTANT Install Node.js 14 (not 15)
- Watch the Git and Github lesson
- Finish githowto
- Learn how to use GitHub Pages
- Read about Markdown.
- Create a repo following this workflow
Learn Useful GIT commands
Learn Terminal commands
To avoid permissions issues DO NOT place your projects folder on desktop
There should be NO SPACES in the path. e.g. C:\Users\Your Name\projects
.
It is better to put repositories into D:\projects
or C:\Users\YourName\projects
.
-
Open the project on Github and Fork the repo.
-
Clone the forked repo
git clone the-link-from-github
Show the details
-
Open the project in IDE
- run
code project-folder-name
- or just run VSCode and open the project folder
- run
-
Open the Terminal in your IDE
Show the details
- Use the shortcut
ctrl + `
- Check if you are inside the project (The project name is the last part in the terminal)
- Check if you use Git Bash (Windows) of zsh (macOS)
- Use the shortcut
-
Run
npm install
(or justnpm i
). -
Run
npm start
to check if it works.Show the details
- At this point you should see the starting markup of the page at
http://localhost:8080/
opened in your Google Chrome - Add some text to
src/index.html
. The change should be immediately updated in the browser. - If the page is not updated automatically press
ctrl + r
(cmd + r
for macOS)
If the page is empty after you added some text
If the page is opened at the other port (not :8080)
- If you see the other port
- It means you already have another terminal running
npm start
command (maybe it is another project) - Stop the
npm start
command in current terminal by pressingctrl + c
(all operating systems) - Close the other terminal running
npm start
- Run the command again for your current project
- The URL should be now
http://localhost:8080/
- If the URL is still wrong, just restart the computer
- At this point you should see the starting markup of the page at
-
Open one more terminal for the next steps.
-
Create the
develop
branch (rungit checkout -b develop
) -
Open
readme.md
file and replace a text<your_account>
with your Github username in theDEMO LINK
andTEST REPORT LINK
-
Implement the task described in
readme.md
.- You should write the code in
index.html
and other files insidesrc
folder.
- You should write the code in
-
Run
npm run lint
to check the code style.This error means you need to fix CRLF
- run
git config --global core.autocrlf false
- and fix the CRLF in all the files you changed
How to fix autoformatting in VSCode
- Here is the documentation
- Run
Alt + Shift + F
to format the document
- run
-
To check if your solution matches all the expectations you can run
npm test
- If test results are not opened in a browser, check if you fixed all the code style errors (
npm run lint
) - If you can't run tests for some weird reason just use a screenshot from
backstop_data/bitmaps_reference/Entire_document.png
to ensure your page looks as expected.
- If test results are not opened in a browser, check if you fixed all the code style errors (
-
Save your changes
git commit -am 'some message'
- If you created some new files you should add them before running commit
git add path/to/new_file1 path/to/new_file2
.
fatal: unable to auto detect email address
- it means you forgot to configure you GIT name and email
- See the commands above the error message and run them one by one with your email and name
- If you created some new files you should add them before running commit
-
Send your code to Github by running
git push origin develop
-
Run
npm run deploy
to publish your site to GitHub pages.- Open
Setting
tab of your repo on Github and choosePages
section from panel on the left - There should be a link to your public page (the same as
DEMO LINK
in yourreadme.md
) - Wait until it becomes green (refresh a page if needed)
- Open the page and check if you see the all the latest changes
- If the page is not updated yet, just add
?any-random-text
after the URL in the Browser and pressEnter
to reload the page discarding cached data (if any)
- Open
-
Create a Pull Request (PR) from your branch
develop
to branchmaster
of original repo. -
Copy
DEMO LINK
andTEST REPORT LINK
fromreadme.md
to the PR description. -
Check your work using checklist (look for it in the root directory of the project) before submitting it for review.
-
To update you PR repeat steps 10-15 (no need to create the PR one more time).
If you need an ADDITIONAL CODE REVIEW, click on re-request button at the PR page.
If you use linux please make sure you adjusted writing permissions to let scripts work without
sudo
. Correct permissions mean you don't see errors likepermission denied
after running commands in terminal.
npm install
installs the project dependencies and runspostinstall
- which create reference files for pixel perfect and tests
npm start
runs the server required for development and testsnpm test
runs linter and testsnpm run lint
runs linter (code style check)npm run test:only
runs pixel perfect tests
npm run deploy
publishes the page and test report togh-pages