Read through Frontend's wiki pages to get started.
Read through Vuex Guideline to understand how our state management is organized.
Needed to install vue-cli plugins
and using vue ui
$ npm install -g @vue/cli
npm update --save/--save-dev -f
There are 3 .env
files required for testing
, development
, and production
:
- .env.test.local
- .env.development.local
- .env.production.local
Config files available in our slack channel
$ npm install
-
Install
IntelliJ Stylelint Plugin
:- Go to: Preferences > Plugins
- Go to
Marketplace
tab - On search bar, type
stylelint
and press enter - Select and Install
IntelliJ Stylelint Plugin
-
Enable stylelint:
- Go to: Preferences > Languages & Frameworks > Style Sheets > Stylelint
- Click on
enable
box - Click on
Process JS files
box
-
Ensure
.stylelintrc.json
is defined.
- Go to: Preferences > Languages & Frameworks > JavaScript > Code Quality Tools > Eslint
- Click on
Automatic ESLint Configuration
- Preferences > Editor > Code Style > HTML
- Go to
Other
tabs - Under
Do not indent children of
: addstyle
andscript
- Preferences > Editor > Code Style > Other File Types
- Set tab size to 2
- Set indent to 2
npm run serve
** To make RPC's to work within the app in dev mode, you need to also run services in Docker Container (below)
Make sure you have Docker Desktop installed.
Installing Docker Desktop comes with docker-compose
.
The following commands will start local docker containers for:
- postgres db
- hwsc-app-gateway-svc
- hwsc-user-svc
- TODO add more later
Starting at root of hwsc-frontend
, run the following:
$ cd docker
$ docker-compose up
You can usually stop your containers successfully with ctrl + c
.
Sometimes that command will prematurely abort and won't stop all containers.
In that case follow up with $ docker-compose stop
.
Or just use $ docker-compose stop
.
npm run build
- Built files used to deploy in a dev server remotely
npm run build:dev
- TODO: Point to a local
docker-compose
for unit testing in a CI/CD pipeline
npm run build:test
npm run test
To extend lint rules refer to this vue guide and eslint guide
npm run lint
npm run lint:css
npm run test:e2e
After you run this command, jest will create a coverage
directory in root of hwsc-frontend
.
You can view code coverage results in the browser by clicking on index.html and opening in browser.
npm run test:unit
After you run this command, jest will create a coverage
directory in root of hwsc-frontend
.
You can view code coverage results in the browser by clicking on index.html and opening in browser.
npm run test:unit
After globally installing @vue/cli
package, you can launch Vue UI
which
will open up a browser control panel to:
- View project plugins/dependencies in depth
- Make changes on eslint configuration
- Run, build, test, lint the project
- In command line:
$ vue ui
- Import this project folder
sourceMap
is enabled in tsconfig.json
, so you can debug using browser dev tools