Skip to content

Commit

Permalink
1.3.0 Release (#63)
Browse files Browse the repository at this point in the history
**New Features**
* Added a Windows packaged build, you can now run View on Windows
* Improved performance by minifying builds by default and turning off page change animations
* You can now specify which port View runs on
* Introduced developer mode, which allows you to develop with unminified build objects, just ```npm run start-dev```
  • Loading branch information
JoshEllinger committed Aug 5, 2016
1 parent d5b5ca5 commit 8097f11
Show file tree
Hide file tree
Showing 23 changed files with 296 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -13,3 +13,5 @@ FUSION_CONFIG.js
FUSION_CONFIG.*.js
!FUSION_CONFIG.sample.js
.jira-prefix
.project
installer/Output
9 changes: 8 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,13 @@
# CHANGELOG

## 1.2.0 - Cersei's Iron Tiara
## 1.3.0 - Pikachu's Invisible Tiara
**New Features**
* Added a Windows packaged build, you can now run View on Windows
* Improved performance by minifying builds by default and turning off page change animations
* You can now specify which port View runs on
* Introduced developer mode, which allows you to develop with unminified build objects, just ```npm run start-dev```

## 1.2.0 - Cersei's Iron Tiara - June 30, 2016
**New Features**
* Now support range facet type
* Add multi select faceting, meaning you can facet on multiple items within a single query
Expand Down
5 changes: 4 additions & 1 deletion FUSION_CONFIG.sample.js
Expand Up @@ -21,10 +21,13 @@ appConfig = { //eslint-disable-line
* To use https set the https server key and certificate. And set use_https to true.
*/
host: 'http://localhost',
port:'8764',
port: '8764',

proxy_allow_self_signed_cert: false, // Only turn on if you have a self signed proxy in front of fusion.

// The port from which View will be served. defaults to 3000.
server_port: 3000,

// Serve View via https.
// use_https: true,
// https: {
Expand Down
33 changes: 13 additions & 20 deletions README.md
Expand Up @@ -3,7 +3,7 @@

You can also use View as the basis for developing a more sophisticated Web interface, using Foundation for Apps: http://foundation.zurb.com/apps/docs/

If you need help setting up Fusion, see https://doc.lucidworks.com/.
If you need help setting up Fusion, see https://doc.lucidworks.com/. To ask questions about View, see the [Lucidworks View Q&A](https://support.lucidworks.com/hc/en-us/community/topics/200922728-Lucidworks-View-Q-A) site.

## Requirements

Expand Down Expand Up @@ -74,6 +74,14 @@ To run the compiling process once, without watching any files, use the `build` c
```bash
npm run build
```
this command creates a built version of View which can be copied from the build folder to another folder/machine and served on your own webserver.

For development purposes, you can develop without a minified build by using the command
```bash
npm run start-dev
```

this command runs a node server, with minimized packages, and works similarly to the `npm start` command.

## Unit testing

Expand Down Expand Up @@ -102,29 +110,14 @@ Templates for various UI components are located in client/assets/components.

Search results from different document types can use different templates. The `client/assets/components/document` directory contains templates for some common document types, plus default templates for all others. Data types correspond to Connectors in Fusion. See [Customizing Documents](docs/Customizing_Documents.md) for details about working with these.

## View on Windows

Download the latest view installer from <https://lucidworks.com/products/view> and run it **as an administrator**.

## What's Next

For more details about configuring and customizing View, see the [docs](docs/) directory.

## Contributions

View is open source! Pull requests welcome. This is a great way to give back to the community and help others build a better search app.

## Building the the tar.gz dist

```
npm install
bower install
gulp build
gulp cook
gulp package
```

Or if you don't have node on your path, you can do something like:

~/Downloads/node-v5.2.0-linux-x64/bin/npm install
~/Downloads/node-v5.2.0-linux-x64/bin/node bower install
~/Downloads/node-v5.2.0-linux-x64/bin/node node_modules/gulp/bin/gulp.js build --buildTarget=linux
~/Downloads/node-v5.2.0-linux-x64/bin/node node_modules/gulp/bin/gulp.js cook --buildTarget=linux
~/Downloads/node-v5.2.0-linux-x64/bin/node node_modules/gulp/bin/gulp.js package --buildTarget=linux

2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "lucidworks-view",
"version": "1.2.0",
"version": "1.3.0",
"authors": [
"Lucidworks"
],
Expand Down
4 changes: 2 additions & 2 deletions client/assets/js/services/LocalParamService.js
Expand Up @@ -37,9 +37,9 @@
//extract the current fq key
var curFilterKey = str.substring(0, _.indexOf(str, ':'));
//extract the current fq values applied
var curFilterValue = str.substring(_.indexOf(str, '(')+1, _.indexOf(str, ')'));
var curFilterValue = str.substring(_.indexOf(str, '(')+1, _.lastIndexOf(str, ')'));
//extract the values of the new filter value which will be joined to the existing filter value with an OR
var newValue = values.substring(_.indexOf(values, '(')+1, _.indexOf(values, ')'));
var newValue = values.substring(_.indexOf(values, '(')+1, _.lastIndexOf(values, ')'));
var qbFilterVal = '(' + QueryBuilderProvider.arrayJoinString(curFilterValue, newValue, ' OR ') + ')';
return QueryBuilderProvider.arrayJoinString(curFilterKey, qbFilterVal, ':');
}
Expand Down
2 changes: 0 additions & 2 deletions client/templates/home.html
@@ -1,8 +1,6 @@
---
name: home
url: /search?query
animationIn: slideInRight
animationOut: slideOutLeft
controller: HomeController as hc
---
<zf-offcanvas position="left"></zf-offcanvas>
Expand Down
2 changes: 0 additions & 2 deletions client/templates/login.html
@@ -1,8 +1,6 @@
---
name: login
url: /login
animationIn: slideInLeft
animationOut: slideOutRight
controller: LoginController as vm
---
<div class="grid-frame vertical">
Expand Down
9 changes: 9 additions & 0 deletions docs/Packaging.md
@@ -0,0 +1,9 @@
## Building the the packaging

```
npm install
bower install
gulp build
gulp cook
gulp package --buildTarget=MACHINE_VARIANT
```
4 changes: 2 additions & 2 deletions gulp/build.js
Expand Up @@ -73,10 +73,10 @@ gulp.task('uglify:app', function() {
sourcemapsWrite = $.if(!global.isProduction, $.sourcemaps.write('.'));

return gulp.src(global.paths.appJS, { base: 'client' })
.pipe(sourcemapsInit)
.pipe(uglify)
.pipe($.plumber())
.pipe(sourcemapsInit)
.pipe($.ngAnnotate())
.pipe(uglify)
.pipe($.directiveReplace({root: 'client'}))
.pipe($.concat('app.js'))
.pipe(sourcemapsWrite)
Expand Down
111 changes: 74 additions & 37 deletions gulp/package.js
Expand Up @@ -9,6 +9,7 @@ var sequence = require('run-sequence');
var child_process = require('child_process');

var nodeversion = 'v5.2.0';
var isWindows = (argv.buildTarget === 'win64') || (argv.buildTarget === 'win32');

var fileLocations = {
bower: ['bower_components/*/**'],
Expand All @@ -21,6 +22,7 @@ var fileLocations = {
docs: ['docs/**/*'],
gulp: ['gulp/**/*', '!gulp/package.js'],
tests: ['tests/**/*'],
win64: ['win64/**/*'],
main_components: [
'.bowerrc',
'.eslintrc',
Expand All @@ -44,14 +46,14 @@ gulp.task('cook', function(cb) {
//Tarballs
gulp.task('package', function(cb){
if(!argv.buildTarget && !(argv.buildname && argv.os && argv.platform && argv.extension)){
console.log('\nTo use package you need to use a valid buildTarget parameter.\n Ex: gulp package --buildTarget=mac\n Possible build targets: {mac, linux, linux32, sunos, sunos32}\n\nOR all of these parameters:\nbuildname, buildTarget, os, platform, extension\n Ex: gulp build --buildname=mac --os=darwin --platform=x64 --extension=tar.gz\n');
console.log('\nTo use package you need to use a valid buildTarget parameter.\n Ex: gulp package --buildTarget=mac\n Possible build targets: {mac, linux, linux32, win64, win32, sunos, sunos32}\n\nOR all of these parameters:\nbuildname, buildTarget, os, platform, extension\n Ex: gulp build --buildname=mac --os=darwin --platform=x64 --extension=tar.gz\n');
cb();
} else {
sequence('package:bashCommands', cb);
}
});

gulp.task('move:app', ['move:bower', 'move:node_modules', 'move:client', 'move:docs', 'move:gulp', 'move:tests'], function(cb){
gulp.task('move:app', ['move:bower', 'move:node_modules', 'move:client', 'move:docs', 'move:gulp', 'move:tests', 'move:win64'], function(cb){
gulp.src(fileLocations.main_components)
.pipe(gulp.dest('tmp/lucidworks-view'));
cb();
Expand Down Expand Up @@ -85,25 +87,55 @@ gulp.task('move:tests', function(cb){
cb();
});

gulp.task('move:win64', function(cb) {
gulp.src(fileLocations.win64)
.pipe(gulp.dest('tmp/lucidworks-view/win64'));
cb();
});

gulp.task('package:bashCommands', function(cb){
var shellCommands = [
'mkdir -p tmp/node',
'mkdir -p tmp/node/'+packageName(getOsTarget()),
'mkdir -p tmp/lucidworks-view/lib/nodejs',
'curl -o tmp/node/'+packageName(getOsTarget())+'.'+getOsTarget().extension+' '+buildUrl(getOsTarget()),
'tar -xzf tmp/node/'+packageName(getOsTarget())+'.'+getOsTarget().extension+' -C tmp/lucidworks-view/lib/nodejs --strip-components=1',
'mkdir -p packages',
'mkdir -p packages/'+getVersion(),
'chmod +x tmp/lucidworks-view/lib/nodejs/bin/npm',
'chmod +x tmp/lucidworks-view/lib/nodejs/bin/node',
'chmod +x tmp/lucidworks-view/lib/nodejs/lib/node_modules/npm/bin/npm',
'cd tmp/; tar -cpzf ../packages/'+getVersion()+'/lucidworks-view-'+getOsTarget().os+'-'+getOsTarget().platform+'-'+getVersion()+'.tar.gz lucidworks-view/.'
];
var version = getVersion();
var osTarget = getOsTarget();
var tarOptions = ' --exclude=win64 lucidworks-view/';
var nodeDir = 'tmp/lucidworks-view/lib/nodejs/';
var nodeDownloadDest = 'tmp/node/';
var nodePackageUrl = getNodePackageUrl(osTarget);
var nodePackageName = nodePackageUrl.split('/').pop();
var nodePackageDir = nodePackageName.replace('.' + osTarget.extension, '');
var nodeFilePath = nodeDownloadDest + nodePackageName;
var shellCommands = [ 'mkdir -p packages/' + version ];

var unpackCommandMap = {
'tar.gz': 'tar -xzf ' + nodeFilePath + ' -C ' + nodeDir + ' --strip-components=1',
'zip': ['unzip -qo', nodeFilePath, '-d', nodeDir].join(' ')
};

shellCommands.push.apply(shellCommands, [
'mkdir -p ' + nodeDownloadDest,
'rm -r ' + nodeDir + '; mkdir -p ' + nodeDir,
'curl -o ' + nodeFilePath + ' ' + nodePackageUrl,
unpackCommandMap[osTarget.extension]
]);

if (isWindows) {
tarOptions = ' --exclude=lucidworks-view' + tarOptions + ' -C lucidworks-view/win64 . -C .. .';
shellCommands.push(['cd ' + nodeDir, 'mv ' + nodePackageDir + '/* .', 'rm -r ' + nodePackageDir, 'cd -'].join(';'));
} else {
shellCommands.push.apply(shellCommands, [
'chmod +x ' + nodeDir + 'bin/npm',
'chmod +x ' + nodeDir + 'bin/node',
'chmod +x ' + nodeDir + 'lib/node_modules/npm/bin/npm'
]);
}

shellCommands.push('cd tmp; tar -cpzf ../packages/' + version + '/lucidworks-view-'+ osTarget.os + '-' + osTarget.platform + '-' + version + '.tar.gz' + tarOptions);

for(var index = 0; index < shellCommands.length; index++){
var command = shellCommands[index];
console.log(command);
console.log(child_process.execSync(command).toString('utf8'));
}

cb();
});

Expand All @@ -115,14 +147,15 @@ function getVersion(){
return packageJson.version;
}

// Url with format - https://nodejs.org/dist/v5.8.0/node-v5.8.0-darwin-x64.tar.gz
function getNodePackageUrl(target) {
var url = target.nodeInstallerUrl;

function buildUrl(target){
//Format https://nodejs.org/dist/v5.8.0/node-v5.8.0-darwin-x64.tar.gz
return 'http://nodejs.org/dist/'+target.nodeVersion+'/'+packageName(target)+'.'+target.extension;
return url || ('http://nodejs.org/dist/' + target.nodeVersion + '/' + packageName(target) + '.' + target.extension);
}

function packageName(target){
return 'node-'+target.nodeVersion+'-'+target.os+'-'+target.platform;
return 'node-' + target.nodeVersion + '-' + target.os + '-' + target.platform;
}

function getOsTarget(){
Expand All @@ -148,6 +181,25 @@ function getOsTarget(){
platform: 'x86',
extension: 'tar.gz'
},

win32: {
name: 'win32',
nodeVersion: 'v6.2.1',
nodeInstallerUrl: 'https://nodejs.org/dist/v6.2.1/node-v6.2.1-win-x86.zip',
os: 'windows',
platform: 'x86',
extension: 'zip'
},

win64: {
name: 'win64',
nodeVersion: 'v6.2.1',
nodeInstallerUrl: 'https://nodejs.org/dist/v6.2.1/node-v6.2.1-win-x64.zip',
os: 'windows',
platform: 'x64',
extension: 'zip'
},

sunos: {
name: 'sunos',
nodeVersion: nodeversion,
Expand All @@ -163,31 +215,16 @@ function getOsTarget(){
extension: 'tar.gz'
}
};

var os_target = argv.buildTarget ? buildTargets[argv.buildTarget] : {};

// individual overrides.
os_target.name = argv.buildname ? argv.buildname: os_target.name;
os_target.nodeVersion = argv.nodeVersion ? argv.nodeVersion: os_target.nodeVersion;
os_target.nodeInstallerUrl = argv.nodeInstallerUrl || os_target.nodeInstallerUrl;
os_target.os = argv.os ? argv.os: os_target.os;
os_target.platform = argv.platform ? argv.platform: os_target.platform;
os_target.extension = argv.extension ? argv.extension: os_target.extension;
return os_target;
}

/**
* If an expresion is true run a callback and log errors to console.
* @param {boolean} expression Result of an expression
* @param {Function} cb Callback to fire
* @param {array|false} parameters An array of parameters to pass through to the callback
* @return {Function} Function to fire
*/
function ifExpression(expression, cb, parameters){
if(Array.isArray(parameters)){
return $.if(expression, cb.apply(null, parameters).on('error', function (e) {
console.log(e);
}));
}
return $.if(expression, cb().on('error', function (e) {
console.log(e);
}));
return os_target;
}
9 changes: 8 additions & 1 deletion gulp/serve.js
Expand Up @@ -42,9 +42,16 @@ gulp.task('browsersync', ['build'], function() {
}
}

var serverPort = 3000;
if(fusionConfig.server_port && fusionConfig.server_port !== false){
serverPort = fusionConfig.server_port;
}

browserSync.init({
server: browserSyncConfig,
ghostMode: false
ghostMode: false,
ui: false,
port: serverPort
});

// gulp.watch("app/scss/*.scss", ['sass']);
Expand Down
7 changes: 4 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "lucidworks-view",
"version": "1.2.0",
"version": "1.3.0",
"description": "Lucidworks View: Create custom user experiences for your Fusion-powered apps.",
"repository": {
"type": "git",
Expand All @@ -26,7 +26,8 @@
"changelog": "https://github.com/lucidworks/lucidworks-view/blob/master/CHANGELOG.md",
"homepage": "https://lucidworks.com/products/view",
"scripts": {
"start": "./node_modules/gulp/bin/gulp.js",
"start": "./node_modules/gulp/bin/gulp.js --production",
"start-dev": "./node_modules/gulp/bin/gulp.js",
"build": "./node_modules/gulp/bin/gulp.js build --production",
"test": "./node_modules/karma/bin/karma start karma.conf.js"
},
Expand Down Expand Up @@ -74,4 +75,4 @@
"yargs": "^3.15.0"
},
"engine": "node >=5.2.0"
}
}

0 comments on commit 8097f11

Please sign in to comment.