This is a CLI for Head App Template. It is not required, but it facilitates work and project management.
npm i git+https://github.com/ringpublishing/hat-cli.git --global
This command creates folder with provided name with empty hat-boilerplate inside.
hat-cli create {project_name}
hat-cli create newProjectFolder
Make sure that such a folder newProjectFolder
does not exist beforehand.
After this you should run npm i
and npm run dev
from project folder.
From project folder:
hat-cli setup
then follow the configurator to create/edit profiles for project.
There is possibility to change variant by request header x-websites-config-variant
When developing any HAT package eg.hat-server
by using hat-boilderplate
, you should use npm link
On hat-server
repository:
npm link
On hat-boilderplate
repository:
npm link "hat-server"
- After linking repositories, there could be issues with
next
/react
framework because there are a couple of library instances. To resolve these issues you have to:- delete
next
andreact
from HAT package eg.hat-server
repositorynode_modules
folder. - do soft link from
hat-server
tohat-boilderplate
.- For windows powershell:
cd {your_path}\hat-server\node_modules New-Item -ItemType SymbolicLink -Target "{your_path}\hat-boilerplate\node_modules\react" -Path "react" New-Item -ItemType SymbolicLink -Target "{your_path}\hat-boilerplate\node_modules\next" -Path "next"
- For windows powershell:
- delete