Skip to content

Instantly share code, notes, and snippets.

@Tusko
Created August 16, 2023 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tusko/f997914dace60f93194d8d6ebf02b335 to your computer and use it in GitHub Desktop.
Save Tusko/f997914dace60f93194d8d6ebf02b335 to your computer and use it in GitHub Desktop.
readme.md

Dev docs

Project setup

nvm use  # Switch node version to supported version *
yarn     # Install dependencies

* install nvm autoload Read more


Before you start add .env.local.

- or -

Copy/paste and rename .env.example, and check documentation.

Also check urls in vue.config.js for devServer.proxy

Ask the team members if there are any problems.


Run devServer with hot-reload

yarn serve

Run production preview (without hot-reload)

yarn preview

Run production build

yarn build

Run tests

yarn test:unit            # run all unit tests

yarn test:unit:w          # run tests in watch mode

yarn test:unit <pattern>  # run matched unit tests

Code tests coverage

yarn test:unit --coverage # run all unit tests & collect coverage from all files described in jest.config.js

yarn test:unit:w --coverage # ^^ with hot-reload

yarn test:unit <pattern> --coverage --collectCoverageFrom <pattern>**/*.{vue,js} # run unit tests & collect coverage by pattern

# Example
yarn test:unit ./src/uikit/buttons --coverage --collectCoverageFrom ./src/uikit/buttons/**/*.{vue,js}

For serving coverage files you can open them in browser or use serve or some another package for serving static files

npx serve ./coverage/lcov-report -c ../../serve.json

# or if installed serve globally
serve ./coverage/lcov-report -c ../../serve.json

Lints and fixes files

yarn lint   # show errors & warns

yarn lint:q # show only errors

Issues

If you get error Cannot read property 'range' of null try to update eslint globally

npm install -g eslint

Addons

# outputs old UI components usage & components unused at all
node -r esm ./scripts/components.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment