Validate, package and deploy your Qlik Sense Visualization Extension projects with ease.
sense-go automates typical repetitive tasks when developing a Visualization extension for Qlik Sense, such as:
Technically speaking sense-go is just a collection of configurable gulp tasks which can be easily re-used and extended.
Install sense-go as a global node.js package
$ npm install -g sense-go
There are basically three different approaches to use sense-go.
1) CLI with default configuration
2) CLI with custom configuration
.sense-go.yml file in the root folder of your project, then run
sense-go in the CLI.
The easiest way to start with your custom configuration is to copy the default configuration file and start modifying it. But keep in mind, following the conventions , you should only need to adapt a few of the default configurations.
3) Programmatic usage
If you want to add custom gulp tasks, this is the way to go.
sense-go.jsin the root of your project based on the following skeleton:
'use strict';var senseGo = ;var gulp = senseGogulp; // Get the reference to the gulp instance used in sense-gosenseGo;
**Note: sense-go is using the beta of Gulp 4 **
The entire concept follows conventions (or best practices) being used when setting up a project:
| PROJECT-ROOT |-- build <= all builds, including source code or zipped files |-- dev <= target for the development build |-- release <= target for the release build |-- docs <= documentation files, then used by verb |-- src <= all source files |-- lib |-- css <= see below * |-- less <= less files | .sense-go.yml <= sense-go configuration file (OPTIONAL) | .verb.md <= verbs readme template | package.json
* If using less files is preferred for a project, I keep this folder empty, otherwise all the .css files will be place here
sense-go works best if you follow these conventions, but everything is configurable, it's just a bit more work to get sense-go running.
The workflow of the pre-configured tasks can be summarized as follows:
It is important to mention that you can by 100% re-define the workflow and also all default settings, but the idea of sense-go is really to get something up and running across different projects with as little configuration and development work as possible. So choose custom configurations wisely.
Behind the scenes the following happens:
In your sense-go.js pass in a custom configuration object to
senseGo.init as follows:
'use strict';const SenseGo = ;const senseGo = ;var customConfig =deployment:toLocal:enabled: true// customConfig will be used to overwrite existing settings from the default-settings.// Any setting not being defined in your custom configuration will be taken from the default settings.senseGo;
'use strict';const SenseGo = ;const senseGo = ;var customConfig = senseGo;senseGo;
'use strict';const SenseGo = ;const senseGo = ;const gulp = senseGogulp; // Get the reference to the gulp instance used in sense-gosenseGo;
There are three categories of tasks:
Cleaning and deleting folders.
deployment.toLocal.enabled === false.
.tmpdirectory which are not supposed to be deployed to the extension directory.
Copy files to a specific directory.
srcfolder to the
Import files to the deployment.
The main use-case behind the
import:fromLocal task is to be able to import "external" files from external dependencies (e.g. node_modules or bower) into the .tmp directory to use them in the solution.
Define the file you want to import in your
.sense-go.yml file as follows:
import: fromLocal: enabled: true files: - ["./node_modules/d3/d3.min.js", "./.tmp/lib/external/d3/d3.min.js"] - ["./node_modules/moment/min/moment.min.js", "./.tmp/lib/external/moment/moment.min.js"]
Import one or more files from a remote sever (with SSH enabled) to your local projects.
Define the sources and targets in your
.sense-go.local.yml file as follows:
Example (Import just one file):
import: fromSsh: enabled: true host: "192.168.10.20" port: 22 user: "<username>" pwd: "password" src: "/remote/path/to/your/file" dest: "./tmp/whatever"
Example (Import a collection of files):
import: fromSsh: enabled: true host: "192.168.10.20" port: 22 user: "<username>" pwd: "password" files: - src: "/remote/path/to/your/file" dest: "./tmp/whatever" - src: "/remote/path/to/your/2nd/file" dest: "./tmp/whatever"
Replaces string patterns in text files across the project.
Using data from package.json
All keys from your package.json file are available out of the box if you use the prefix
with the following package.json
"name": "my-extension""version": "0.1.12"
Extension my-extension version 0112
Builtin patterns The following patterns are available out of the box:
@@timestamp- Defaults to new Date().getTime()
Adding replacement patterns Add new replacements patterns in your .sense-go.yml file:
replacements: custom: test1: bla bla custom2: var1: true var2: "Whatever comes here"
bla bla true Whatever comes here
Converts .less files to .css files.
All less tasks automatically autoprefix (using gulp-autoprefixer)
/src/less/main.less, resolves all its dependencies and creates
.lessfile from the source directory to a corresponding .css file in the .tmp directory.
General uglify options
uglify*- All options directly passed to
uglify.preserveComments- (Default: 'license')
Further options can be passed according to the gulp-uglify documentation.
uglifyTmp.src- Included source files. (Default:
uglifyTmp.srcExcluded- Excluded source files (Default:
Several minification tasks
Create a wbfolder.wbl file to be used in Dev Hub - Extension Editor.
wbfolder.enabled- Whether the task is enabled or not, defaults to
wbfolder.cwd- Working directory, defaults to
wbfolder.src- Source mask, defaults to
wbfolder.dest- wbfolder.wbl file destination, defaults to
wbfolder.wbl file is only necessary if you want to allow users to open your visualization extension in Qlik Dev Hub.
wbfolder.wbl is NOT required and necessary to run your visualization extension in Qlik Sense.
Create .zip files based on the building strategy
Bumps the version in your package.json file
$ sense-go bump:version --newversion=0.1.0$ sense-go b:v --nv=0.1.0
Possible command line parameters
--commit="Your commit message"
Based on gulp tasks provided by sense-go you can then create your task chains. Some are already predefined:
You can add additional tasks on top of sense-go, mixing your very own tasks with sense-go tasks, etc.
Use your own gulpfile.js (be aware that sense-go uses gulp 4.0 beta):
'use strict';var senseGo = ;var gulp = senseGogulp;var path = ;var customConfig = senseGo;senseGo;
sense-go build in the CLI.
sense-go is heavily relying on existing gulp plugins. A big thank you to the authors of these plugins!!
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. The process for contributing is outlined below:
I cannot guarantee that I will merge all PRs but I will evaluate them all.
Copyright © 2017, Stefan Walther.
This file was generated by verb-generate-readme, v0.6.0, on August 11, 2017.