Install the JavaScript Tool Manager Volta:
curl https://get.volta.sh | bash
Volta gets installed in $HOME/.volta/
, and it adds to $HOME/.bashrc
the following lines:
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
Therefore, it will be necessary to close and open again the terminal or run:
source $HOME/.bashrc
Once this is done, anytime that we run node
or yarn
within nectar's directory, volta will kick in and read the package.json
file, which can contain this definition:
"volta": {
"node": "14.16.1",
"yarn": "1.22.10"
}
Therefore, volta will automatically download/enable the node and yarn version specified in package.json
.
Install the project dependencies:
yarn install --pure-lockfile
Start the development server:
yarn dev
Run tests:
yarn test
Run storybook:
yarn storybook
To run cypress, start the production server in one terminal:
yarn start
And without closing it, open a new terminal and run cypress:
yarn cypress:run
Build the application:
yarn build
And start production server:
yarn start
Build the docker image:
docker build -t nectar .
Start the production server inside a container:
docker run -it --rm --name nectar -p 8000:8000 -p 6006:6006 nectar yarn start
Create a container mounting the current directory in the /app/
and start a bash
shell to run any desired commands:
docker run -it --rm --name nectar -p 8000:8000 -p 6006:6006 -v $PWD:/app/ nectar bash