Before you can build this project, you must install and configure your machine.
We use Node.js to run a development web server and build the project. Depending on your system, you can install Node either from source or as a pre-packaged bundle.
After installing Node, you should be able to run the following command to install development tools (like Bower and BrowserSync. You will only need to run this command when dependencies change in package.json.
npm install
For non OS X users
npm install --no-optional
We use Bower for our third-party client libraries. Install the Bower-controlled apps with:
bower install
We use Gulp as our build system. Install the Gulp command-line tool globally with:
npm install -g gulp
Run the following command terminal to create a blissful development experience where your browser auto-refreshes when files change on your hard drive.
gulp
Run following command to inject vendors if needed
gulp inject:vendor
Bower is used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
specifying a newer version in bower.json
. You can also run bower update
and bower install
to manage dependencies.
Add the -h
flag on any command to see how you can use it. For example, bower update -h
.
Copy the example configuration file to .env
:
cp .env.example .env
Then edit that file to contain the URL of the API instance you wish to use.
gulp serve
gulp build
Unit tests are run by Karma and written with Jasmine.
gulp test
More details on unit testing here: https://github.com/inventory/client/wiki/Unit-Tests-(Karma---Jasmine)
npm install --TYFY_ENV='local'
gulp itest
or
gulp itest --suite = account
where `account` is suite name. Test Suites can be configured in `protractor.config.js`
- Test/compare locale files - compares locale
directory
withen
default locale directory and check if there are missing keys. Below command will report all missing keys in terminal.
gulp locale:test
Note - This task is recommended to execute before you push any change.
- Update missing keys. Below command will add missing keys in locale file with key value -
VALUE_FOR_KEY_MISSING
gulp locale:update
- Create new locale directory that will clone files from default locale directory
en
and update value of each key toVALUE_FOR_KEY_MISSING
gulp locale:create --name="en1"
Also, need to add newly created locale in src/app/components/language/language.constants.js
file.
.constant('TFY_LOCALE', {
locales: ['en', 'es','nl','pt','vi','zh','en1'],
mapping: {
'en-*': 'en',
'es-*': 'es',
'nl-*': 'nl',
'pt-*': 'pt',
'zh-*': 'zh',
'en1-*': 'en1'
}
})
- add language to
locale compare script
- go to
gulp/locale.js
- go to line number 3 -
const localesDirs = ['es', 'nl', 'pt-br', 'pt', 'vi', 'zh'];
- add language key in an array
const localesDirs = ['es', 'nl', 'pt-br', 'pt', 'vi', 'zh', 'en1'];
- go to
- File
/src/test/protractor.config.js
. All protractor, jasmine2 and testcases configurations. /src/test/e2e
: Test suites and helper files- Write commonly used helper function in
/src/test/e2e/helper.js
- Write custom hook in
/src/test/e2e/customHooks.js
- Write custom hook in
/src/test/e2e/customHooks.js
-
E2E StyleGuide http://www.protractortest.org/#/style-guide
-
Protractor configurations https://github.com/angular/protractor/blob/master/lib/config.ts
- Post-build Actions
- Publish Test Report XML: build/reports/e2e/*.xml`
- When update to latest Node version
Node Sass does not yet support your current environment (macOS 10.12.1, Node 7.0.0)
npm cache clean --force npm rebuild node-sass
- Quill does not contains dist files when installed with Bower ?
bower install quill=https://github.com/quilljs/quill/releases/download/v1.3.5/quill.tar.gz --save