hub.common.tooling
How to use hub.common.tooling
version 2.8.0+
, and all available gulp tasks.
#
Package DetailsThis package includes a common set of gulp build tools
for Hub v1 and HubCommon. For a quick start and usage instructions, head over to HubBoilerplate.
#
Dependencies- node >=
8.11.4
||^10.0
||12.0
- hubcommon >=
5.8.0
#
Supports- typescript 2.x
- browsers:
That means we support:
- the last 2 versions for each browser OR
- more than 1% browsers versions selected by global usage statistics OR
- browsers without official support or updates for 24 months.
#
Uses- gulp 4.x
- Handlerbars 4.7
- @iqmetrix/hub-dev-server 2.5
- Babel 7.x with:
#
InstallationTo use this package, you need to install the @iqmetrix/hub.common.tooling as a dev dependency:
and have the .npmrc file configured.
#
hub-scriptshub-scripts
are cli tool for hub.common.tooling
, introduced in version 2.5.0.
#
Upgrading to hub.common.tooling 2.0This new version of the hub.common.tooling
helps developers to update their Hub v1 apps to newer versions of HubCommon and Hub.Common.Tooling. See upgrading guide to upgrade to tooling 2.x.x
.
#
Add the necessary scriptsAdd the following into your package.json
And then, you can run
#
CLI optionshelp
: Shows the help menuversion
: Shows the current version. Alias: -vstart
: Start your application in dev mode- Additional Options:
--no-shell
: Executes START script without the Shell in dev mode--prod
: Executes START script in prod mode (what you will see in INT)
- Additional Options:
serve
: Serve your application fromdevTemp
folder (no pre-build, normmally used to run tests)serve --prod
: Serve your application frombuild
folder (no pre-build, normmally used to run tests)build
: Build your application for production using RequireJStask
: Execute one of the avaliable GULP tasks- Avaliable tasks:
--lint
: Parse the code using ESLINT--handlebars
: Re-generate the template.js file using HandleBars--pug
: Convert all jade template files into pug files--bump
: Bump your application. The default is a minor version. Can use --bump:major or --bump:patch
- Avaliable tasks:
#
Gulp tasksTo run these commands, you need to have gulp@4
installed globally
#
gulp and gulp -n- Run the hub v1 app without the shell on
http:localhost:3000
- Run the
hub-dev-server
(using hub v2 shell) onhttp:localhost:9000/#dev
- Run the app under port
9000
without the shell.
gulp bump#
Bump the version number and generate the correct tag.
followed by
By default
gulp bump
increments the minor version.
gulp serve#
Creates a dev server instance at http://localhost:9000
OR
- runs on port 3000
- runs on port 9000
gulp buildRequireJs#
Optimize and process files for build. Creates build info and cleans build folder.
gulp toPug#
Rename all jade
templates to pug
templates.
gulp eslint#
Formats your javascript files using the default ESLint formatter
gulp gitRename#
Rename files to follow lowerCamelCase
where the first letter of the entire word is lowercase, but subsequent first letters are uppercase.
gulp proxy#
Runs a webserver (with LiveReload) and creates a proxy middleware
gulp stripBom#
Strip UTF-8 byte order mark (BOM) from a string. The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use.
#
Deploy#
Testing before deployBefore you can deploy your upgraded app you need to make sure it works and nothing is missing:
- To test if your deploy will work, you just need to run the following command
npm run prod
- Make sure to note how the app works and looks before you deploy the new version.
- Check if all UI components are still in place
- Check if all user flows still work (saving, deleting, routing, etc.)
- It is your responsibility to make sure the app has been tested. You can always reach out for help from iQ employees that know and/or use the app
#
Updating your TeamCity deployWe already added a new step in the Hub Building Template called 2. The right version of GULP
and it will also be present in the build phase of your app. Follow the below steps if you are using the tooling version 2.0.0+
- Open your
Project
settings - Open your
Build
phase settings - Navigate to the menu
Build Steps
- Click to edit the step
2. Right version of GULP
- Replace the
install gulp@3 -g
withinstall gulp@4 -g
- Save the settings and run your build
#
Azure DevOps PipelinesStarting on Hub.Common.Tooling
2.5.0+ and HubCommon
5.6.5+ you can build your apps using Azure Pipelins intead of TeamCity. Check the releavant Build And Release documentation