-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Development & Test Environments
Table of Contents
Install VS Code, Dev Containers, and Docker.
Next, fork this repository and then open VS Code to clone your repo in container volume. Wait a few minutes for Docker to create the container, and once everything is ready, you can start the Jekyll server in the VS Code terminal:
./tools/run.shIf your changes involve JavaScript, please read the following sections.
For inline JS (code between <script> and </script>) or JS / JSON file containing Front Matter,
if you want to add comments to it, please use {%- comment -%} and {%- endcomment -%} instead of two slashes // (e.g. {%- comment -%} code comment message {%- endcomment -%} ). This is because in a production environment, jekyll-compress-html compresses HTML files, but does not recognize // correctly and thus breaking the HTML structure as a result.
If you changed the files in the _javascript/ directory,
then you need to rebuild the JS. During the development, real-time debugging can be performed through the following
commands:
Firstly, start a Jekyll server:
./tools/run.shAnd then open a new terminal sessioin and run:
npm run watch:jsWhen you are finished developing, press ctrl + C to end the npm process above, and then run the
npm run build:js command. The new compressed JS files will be exported to assets/js/dist/.
This project has CI turned on. In order for your pull request to pass the test, please read the following.
Before you create a git commit, please complete the following setup.
If you run npm i once, commitlint and husky is already installed.
And then enable husky for the repo:
husky installSome Git GUI (such as Sourcetree, Gitnuro, etc.) may not be able to search your system's node.js execution path correctly, and may break with a message: npx: command not found!. In this case, you need to set up a configuration file ~/.huskyrc:
If you have a single version of node.js, execute the following command in the terminal.
echo "export PATH=\"$(dirname $(which node)):\$PATH\"" > ~/.huskyrcIf you installed node.js via nvm, create the file ~/.huskyrc and fill in the following:
# This loads nvm.sh, sets the correct PATH before running hook, and ensures the project version of Node
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# If you have an .nvmrc file, we use the relevant node version
if [ -f ".nvmrc" ]; then
nvm use
fiSee also: https://typicode.github.io/husky/troubleshooting.html#command-not-found
bash ./tools/test.shnpm testThe
hotfixbranch naming format ishotfix/<MAJOR>.<MINOR>.<PATCH>, e.g.hotfix/3.2.1.
-
Create a new
hotfixbranch from theproductionbranch (on GitHub). -
Commit the patch to the
hotfixbranch by:- Branch from
hotfixand then commit patches to the newpatchbranch. - Create a PR for the
patchbranch on GitHub, then squash merge into into thehotfixbranch.
- Branch from
-
When hot-fixes is done, create a PR for the
hotfixbranch and merge it into theproductionbranch (using the--no-ffoption).