@egis/build-tools
## for MacOS users: ```shell # install 'native' (not Apple-supplied) Python to be able to install 'glue' tool: brew install python
Last updated 5 months ago by egis-moshe .
Commercial · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @egis/build-tools 
SYNC missed versions from official npm registry.

See CODESTYLE

Naming Conventions / Directory Layout

build/ 		# compiled and concatenanted classes
dist/ 		# compiled JS classes
src/ 		#  ES6 and Handlebars templates
style/main.scss 		# which imports other SASS and/or CSS files
resource/	# Copied as is to build directory
lib-export.js	# the entrypoint ala index.js

Build Pipeline

  • All web dependencies are downloaded and concatenated into build/dependencies.js and build/dependencies.css
  • ES6 files are compiled and concatenanted into build/app.js where 'app.js' is the mainFile in package.json (inferred from package's name by default)
  • CSS/LESS/SASS are compliled and concatened into build/app.css
  • In production mode all source is minified and source maps generated.

Handlebars Templates

A Handlebar template is any file ending in .hbs it is available in the TEMPLATES global without the extension.
A Handlebar partial is any file begining with _ and ending in .hbs and is automatically registered

Build steps:

  • export your NPM_TOKEN
  • Run npm install -g "yarn@^1.5.1"
  • Run yarn setup to install and build all required dependencies

Dev lifecycle commands:

  • Run yarn setup to install dependencies of client project if its package.json is updated upstream
  • Run yarn add my-package to add a dependency to build-tools
  • Run yarn add --dev my-package to add a build-time dependency to client project if needed
  • Run yarn add my-package to add a web dependency to client project if needed. Note that EgisUI's dependencies are included everywhere.
  • Run yarn upgrade my-package to upgrade a dependency in build-tools or client project.
  • Run yarn dev to build files suitable for wathcing and startup a watch server
  • Run yarn build to build a package suitable for production
  • Run yarn test to run karma test suites

Customizing builds using dependencies.json and package.json

dependencies.json

All package.json dependencies are considered web dependencies. Their main files are concatenanted together in package name order. The deps' files that get concatenated can be overriden in dependencies.json as follows:

    "overrides": {
        "perfect-scrollbar": {
          "main": [
            "dist/css/perfect-scrollbar.css",
            "dist/js/perfect-scrollbar.js",
            "dist/js/perfect-scrollbar.jquery.js"
          ]
        }
    }

To exclude certain large libraries from concatenantion list in exclude, the main files will be concated together and placed in build/<libray name>

   "standalone": ["handsontable", "codemirror"]

To exclude libraries that have already been packaged elsewhere:

"excludes": ["jquery"]

To copy entire directories from dependencies:

"directories": {
    "fontawesome": "fonts/*",
    "bootstrap": "fonts/*"
  },

To create a plugin package:

"plugin": "PortalApp",

This will create a .zip instead of a .war and place all the compiled .js file in to a subdirectory System/plugins/{plugin}

Browsersync

For frontend development env our browsersync integration may be helpful. It:

  • injects CSS changes immediately
  • auto-reloads page in browsers if JS files are changed - including your mobile device's browser
  • supports running multiple modules in dev mode in parallel

In each build-tools project:

yarn dev

And then after 1 or more yarn dev servers are running:

yarn browsersync

If your files are being served from anything other then localhost e.g. 192.168.99.100:

cd /path/to/EgisUI
yarn dev

# in another terminal window/tab
cd /path/to/build-tools
yarn browsersync --proxied-host=192.168.99.100

This also allows to run a library (EgisUI, eSign, etc) or Portal plugin locally in dev mode in context of remote host, e.g. UAT:

cd /path/to/MyPlugin
yarn dev

# in another terminal window/tab
cd /path/to/build-tools
yarn browsersync --proxied-host=sandbox.some.com --proxied-port=80 --plugin=MyPlugin

Note the --plugin parameter above - you need to specify it by its directory name to make browsersync handle it. This is because we only want one plugin to work at any given time.

For SSL mode, just specify https protocol:

yarn browsersync -- --proxied-host=https://testbox.papertrail.co.za

Caveats

  • URLs with default pages other than index.html, e.g. http://papertrail.lvh.me:3001/web/eSign/?3760 don't work, so you'll get "page not found" if you try to use Sign action. Specify http://papertrail.lvh.me:3001/web/eSign/sign.html?3760 manually then, that will work.

E2E tests

We use Webdriver.io with Mocha for e2e tests.

Results at CI

If the e2e tests are failing you can check their output for 'failing' substring to see which specs are failing. Also build artifacts can give a hint on it - the failing tests will usually have screenshot for 6 retries like here. Note that EgisUI runs its main dependencies' (Portal, eSign, etc) e2e specs at CI, to make sure the EgisUI changes doesn't break them. This can be seen in e2e tests output like here.

Running locally

The best way to run e2e tests locally is via Docker container for PT, see its installation steps here. This will make sure you have the same PT configuration as CI does. After installing and running docker container for PT start webdriver-manager:

npm install -g webdriver-manager # needed once
# in a separate terminal window/tab
webdriver-manager update # this is needed at first installation and later after browsers update their versions
webdriver-manager start

Then load project's e2e fixtures and update the container apps:

cd MY_EGIS_DIR/eSign # or EgisUI, etc
export PT_API="http://192.168.99.100:8080" # put your docker's host and port here
cd e2e && ./fixtures.sh && cd ..
docker cp eSign.war my-pt:/opt/Papertrail/webapps # correct war filename for different project
docker cp ../EgisUI/EgisUI.war my-pt:/opt/Papertrail/webapps # if you want to test the project with your latest EgisUI build

Run the tests:

# Put your docker's host and port here, spec file(s) mask and the spec name(s) substring.
yarn test:e2e --baseUrl="http://192.168.99.100:8080" --specFiles="./wdio/**/Guide*Spec.js" --mochaOpts.grep="too early" --maxBrowserInstances=1 --mochaOpts.retries=1 

Semantic-release

You can see locally which version is going to be published when your PR is merged with these steps:

# push egis/master to you-fork/master:
git checkout master
git fetch egis
git reset --hard egis/master
git push orgin +master

# switch back to your PR branch. Put your actual branch name here.
git checkout my-branch

# if not yet, create Github access token having push access to master, see https://github.com/semantic-release/github/blob/master/README.md#github-authentication
export GH_TOKEN=...

# Replace `repository.url` key in package.json to point to your fork temporarily: "git@github.com:my-gitusername/build-tools.git"

# Run semantic-release to find out the version number: 
BRANCH=my-branch yarn simple-semantic-release-pre

# Revert the `repository.url` change:
git checkout -- package.json

This applies both to build-tools and to any semantic-release enabled project of EgisUI family (EgisUI, Portal, eSign, etc).

Current Tags

  • 9.1.1-pre.1                                ...           artembeta (2 months ago)
  • 2.2.13-pre.6                                ...           artembeta1 (2 years ago)
  • 3.0.2-pre.6                                ...           artembeta2 (a year ago)
  • 9.1.1                                ...           latest (2 months ago)
  • 3.0.2-pre.3                                ...           pre (a year ago)
  • 3.1.12-pre.1                                ...           zloyagbeta (a year ago)

296 Versions

  • 9.1.1                                ...           2 months ago
  • 9.1.1-pre.1                                ...           2 months ago
  • 9.1.0                                ...           3 months ago
  • 9.0.1-pre.2                                ...           3 months ago
  • 9.0.1-pre.1                                ...           3 months ago
  • 9.0.0                                ...           3 months ago
  • 8.0.1                                ...           3 months ago
  • 9.0.0-pre.1                                ...           3 months ago
  • 8.1.0-pre.1                                ...           3 months ago
  • 8.0.0                                ...           4 months ago
  • 8.0.0-pre.7                                ...           4 months ago
  • 7.0.3                                ...           5 months ago
  • 7.0.3-pre.1                                ...           5 months ago
  • 7.0.2                                ...           5 months ago
  • 7.0.1                                ...           5 months ago
  • 8.0.0-pre.6                                ...           5 months ago
  • 8.0.0-pre.5                                ...           5 months ago
  • 8.0.0-pre.4                                ...           5 months ago
  • 8.0.0-pre.3                                ...           5 months ago
  • 8.0.0-pre.2                                ...           6 months ago
  • 8.0.0-pre.1                                ...           6 months ago
  • 7.0.1-pre.1                                ...           6 months ago
  • 7.0.1-pre.1s                                ...           6 months ago
  • 7.0.0-pre.3                                ...           6 months ago
  • 7.0.0                                ...           6 months ago
  • 7.0.0-pre.2                                ...           6 months ago
  • 7.0.0-pre.1                                ...           6 months ago
  • 6.1.2                                ...           7 months ago
  • 6.1.2-pre.5                                ...           7 months ago
  • 6.1.2-pre.3                                ...           7 months ago
  • 6.1.2-pre.2                                ...           7 months ago
  • 6.1.2-pre.1                                ...           7 months ago
  • 6.1.1                                ...           7 months ago
  • 6.1.0                                ...           7 months ago
  • 6.1.0-pre.6                                ...           7 months ago
  • 6.1.0-pre.5                                ...           7 months ago
  • 6.1.0-pre.4                                ...           7 months ago
  • 6.1.0-pre.3                                ...           7 months ago
  • 6.1.0-pre.2                                ...           7 months ago
  • 6.1.0-pre.1                                ...           7 months ago
  • 6.0.1                                ...           7 months ago
  • 6.0.1-pre.6                                ...           7 months ago
  • 6.0.1-pre.5                                ...           7 months ago
  • 6.0.1-pre.4                                ...           7 months ago
  • 6.0.1-pre.3                                ...           7 months ago
  • 6.0.1-pre.2                                ...           8 months ago
  • 6.0.1-pre.1                                ...           8 months ago
  • 5.0.1                                ...           8 months ago
  • 6.0.0                                ...           8 months ago
  • 6.0.0-pre.12                                ...           8 months ago
  • 6.0.0-pre.11                                ...           8 months ago
  • 6.0.0-pre.10                                ...           8 months ago
  • 6.0.0-pre.9                                ...           8 months ago
  • 6.0.0-pre.8                                ...           8 months ago
  • 6.0.0-pre.7                                ...           8 months ago
  • 6.0.0-pre.6                                ...           8 months ago
  • 6.0.0-pre.5                                ...           8 months ago
  • 6.0.0-pre.4                                ...           8 months ago
  • 6.0.0-pre.3                                ...           8 months ago
  • 6.0.0-pre.2                                ...           8 months ago
  • 6.0.0-pre.1                                ...           8 months ago
  • 5.0.1-pre.1                                ...           8 months ago
  • 5.0.0                                ...           8 months ago
  • 5.0.0-pre.3                                ...           8 months ago
  • 5.0.0-pre.2                                ...           8 months ago
  • 5.0.0-pre.1                                ...           9 months ago
  • 3.1.12                                ...           9 months ago
  • 4.0.1-pre.4                                ...           9 months ago
  • 4.0.1-pre.3                                ...           9 months ago
  • 4.0.1-pre.2                                ...           10 months ago
  • 4.0.1-pre.1                                ...           10 months ago
  • 4.0.0                                ...           10 months ago
  • 4.0.0-pre.3                                ...           10 months ago
  • 4.0.0-pre.2                                ...           10 months ago
  • 4.0.0-pre.1                                ...           10 months ago
  • 3.1.12-pre.1                                ...           a year ago
  • 3.1.11                                ...           a year ago
  • 3.1.10                                ...           a year ago
  • 3.1.11-pre.1                                ...           a year ago
  • 3.1.10-pre.1                                ...           a year ago
  • 3.1.9                                ...           a year ago
  • 3.1.8                                ...           a year ago
  • 3.1.8-pre.2                                ...           a year ago
  • 3.1.8-pre.1                                ...           a year ago
  • 3.1.7                                ...           a year ago
  • 3.1.6                                ...           a year ago
  • 3.1.6-pre.1                                ...           a year ago
  • 3.1.5                                ...           a year ago
  • 3.1.4                                ...           a year ago
  • 3.1.3                                ...           a year ago
  • 3.1.3-pre.2                                ...           a year ago
  • 3.1.3-pre.1                                ...           a year ago
  • 3.1.2                                ...           a year ago
  • 3.1.1                                ...           a year ago
  • 3.1.0                                ...           a year ago
  • 3.0.8                                ...           a year ago
  • 3.0.8-pre.1                                ...           a year ago
  • 3.0.7                                ...           a year ago
  • 3.0.7-pre.1                                ...           a year ago
  • 3.0.6                                ...           a year ago
  • 3.0.5                                ...           a year ago
  • 3.0.4                                ...           a year ago
  • 3.0.3                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.2-pre.6                                ...           a year ago
  • 3.0.2-pre.5                                ...           a year ago
  • 3.0.2-pre.4                                ...           a year ago
  • 3.0.2-pre.3                                ...           a year ago
  • 3.0.2-pre.2                                ...           a year ago
  • 3.0.2-pre.1                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           2 years ago
  • 2.2.14                                ...           2 years ago
  • 2.2.13                                ...           2 years ago
  • 3.0.0-pre.5                                ...           2 years ago
  • 3.0.0-pre.4                                ...           2 years ago
  • 3.0.0-pre.3                                ...           2 years ago
  • 3.0.0-pre.2                                ...           2 years ago
  • 3.0.0-pre.1                                ...           2 years ago
  • 2.3.1-pre.1                                ...           2 years ago
  • 2.3.0-pre.2                                ...           2 years ago
  • 2.3.0-pre.1                                ...           2 years ago
  • 2.2.1-2.pre.1                                ...           2 years ago
  • 2.2.1-3.pre.9                                ...           2 years ago
  • 2.2.1-3.pre.8                                ...           2 years ago
  • 2.2.1-3.pre.7                                ...           2 years ago
  • 2.2.13-artem.pre.2                                ...           2 years ago
  • 2.2.13-artem.pre.1                                ...           2 years ago
  • 2.2.13-pre.6                                ...           2 years ago
  • 2.2.13-pre.5                                ...           2 years ago
  • 2.2.13-pre.4                                ...           2 years ago
  • 2.2.13-pre.3                                ...           2 years ago
  • 2.2.13-pre.2                                ...           2 years ago
  • 2.2.13-pre.1                                ...           2 years ago
  • 2.2.12                                ...           2 years ago
  • 2.2.11                                ...           2 years ago
  • 2.2.10                                ...           2 years ago
  • 2.2.10-pre.9                                ...           2 years ago
  • 2.2.10-pre.8                                ...           2 years ago
  • 2.2.10-pre.7                                ...           2 years ago
  • 2.2.10-pre.6                                ...           2 years ago
  • 2.2.10-pre.5                                ...           2 years ago
  • 2.2.10-pre.4                                ...           2 years ago
  • 2.2.10-pre.3                                ...           2 years ago
  • 2.2.10-pre.2                                ...           2 years ago
  • 2.2.10-pre.1                                ...           2 years ago
  • 2.2.9                                ...           2 years ago
  • 2.2.9-pre.1                                ...           2 years ago
  • 2.2.8                                ...           2 years ago
  • 2.2.8-pre.3                                ...           2 years ago
  • 2.2.8-pre.2                                ...           2 years ago
  • 2.2.8-pre.1                                ...           2 years ago
  • 2.2.7                                ...           2 years ago
  • 2.2.6                                ...           2 years ago
  • 2.2.5                                ...           2 years ago
  • 2.2.5-pre.4                                ...           2 years ago
  • 2.2.5-pre.3                                ...           2 years ago
  • 2.2.5-pre.2                                ...           2 years ago
  • 2.2.5-pre.1                                ...           2 years ago
  • 2.2.4                                ...           2 years ago
  • 2.2.4-pre.11                                ...           2 years ago
  • 2.2.4-pre.10                                ...           2 years ago
  • 2.2.4-pre.9                                ...           2 years ago
  • 2.2.4-pre.8                                ...           2 years ago
  • 2.2.4-pre.7                                ...           2 years ago
  • 2.2.4-pre.6                                ...           2 years ago
  • 2.2.4-pre.5                                ...           2 years ago
  • 2.2.4-pre.4                                ...           2 years ago
  • 2.2.4-pre.3                                ...           2 years ago
  • 2.2.4-pre.2                                ...           2 years ago
  • 2.2.4-pre.1                                ...           2 years ago
  • 2.2.3                                ...           2 years ago
  • 2.2.2                                ...           2 years ago
  • 2.2.1                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.9-pre.2                                ...           2 years ago
  • 2.0.9-pre.1                                ...           2 years ago
  • 2.0.8                                ...           2 years ago
  • 2.0.8-pre.1                                ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.7-pre.2                                ...           2 years ago
  • 2.0.7-pre.1                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           2 years ago
  • 2.0.5-pre.1                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 2.0.0-pre.2                                ...           2 years ago
  • 2.0.0-pre.1                                ...           2 years ago
  • 1.5.14                                ...           2 years ago
  • 1.6.0-pre.1                                ...           2 years ago
  • 1.5.13                                ...           2 years ago
  • 1.5.13-pre.1                                ...           2 years ago
  • 1.5.12                                ...           2 years ago
  • 1.5.12-pre4                                ...           2 years ago
  • 1.5.12-pre3                                ...           2 years ago
  • 1.5.12-pre2                                ...           2 years ago
  • 1.5.12-pre                                ...           2 years ago
  • 1.5.11                                ...           2 years ago
  • 1.6.0-pre2                                ...           2 years ago
  • 1.6.0-pre1                                ...           2 years ago
  • 1.6.2-pre                                ...           2 years ago
  • 1.6.1-pre                                ...           2 years ago
  • 1.6.0-pre                                ...           2 years ago
  • 1.5.9                                ...           2 years ago
  • 1.5.10                                ...           2 years ago
  • 1.5.8                                ...           2 years ago
  • 1.5.7                                ...           2 years ago
  • 1.5.6                                ...           2 years ago
  • 1.5.5                                ...           2 years ago
  • 1.5.4                                ...           2 years ago
  • 1.5.3                                ...           2 years ago
  • 1.5.2                                ...           2 years ago
  • 1.5.1                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.5                                ...           2 years ago
  • 1.4.4                                ...           2 years ago
  • 1.4.3                                ...           2 years ago
  • 1.4.2                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.12                                ...           3 years ago
  • 1.3.11                                ...           3 years ago
  • 1.3.10                                ...           3 years ago
  • 1.3.9                                ...           3 years ago
  • 1.3.8                                ...           3 years ago
  • 1.3.7                                ...           3 years ago
  • 1.3.6                                ...           3 years ago
  • 1.3.5                                ...           3 years ago
  • 1.3.4                                ...           3 years ago
  • 1.3.3                                ...           3 years ago
  • 1.3.2                                ...           3 years ago
  • 1.3.1                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.12                                ...           3 years ago
  • 1.2.11                                ...           3 years ago
  • 1.2.10                                ...           3 years ago
  • 1.2.9                                ...           3 years ago
  • 1.2.8                                ...           3 years ago
  • 1.2.7                                ...           3 years ago
  • 1.2.6                                ...           3 years ago
  • 1.2.5                                ...           3 years ago
  • 1.2.4                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.29                                ...           3 years ago
  • 1.1.28                                ...           3 years ago
  • 1.1.27                                ...           3 years ago
  • 1.1.26                                ...           3 years ago
  • 1.1.25                                ...           3 years ago
  • 1.1.24                                ...           3 years ago
  • 1.1.23                                ...           3 years ago
  • 1.1.22                                ...           3 years ago
  • 1.1.21                                ...           3 years ago
  • 1.1.20                                ...           3 years ago
  • 1.1.19                                ...           3 years ago
  • 1.1.18                                ...           3 years ago
  • 1.1.17                                ...           3 years ago
  • 1.1.16                                ...           3 years ago
  • 1.1.15                                ...           3 years ago
  • 1.1.14                                ...           3 years ago
  • 1.1.13                                ...           4 years ago
  • 1.1.12                                ...           4 years ago
  • 1.1.11                                ...           4 years ago
  • 1.1.10                                ...           4 years ago
  • 1.1.9                                ...           4 years ago
  • 1.1.8                                ...           4 years ago
  • 1.1.7                                ...           4 years ago
  • 1.1.6                                ...           4 years ago
  • 1.1.5                                ...           4 years ago
  • 1.1.4                                ...           4 years ago
  • 1.1.3                                ...           4 years ago
  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.12                                ...           4 years ago
  • 1.0.11                                ...           4 years ago
  • 1.0.10                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 0.0.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 29
Dependencies (121)
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |