Commit e7dfccd8 authored by Joeri de Gooijer's avatar Joeri de Gooijer

ESSENTIALS-998 swich from bower to npm for dependency management

parent 9a86be14
......@@ -13,21 +13,16 @@ suggestions for improvements.
* Java 8
* Maven 3.x
* Git (http://git-scm.com)
* NodeJS (http://nodejs.org/) 0.10+
* NodeJS (http://nodejs.org/) 5.x.x
* Node Package Manager (http://npmjs.org)
* Grunt (http://gruntjs.org)
* Bower (http://bower.io)
Grunt and Bower can be installed with Node Package Manager:
Grunt can be installed with Node Package Manager:
```shell
sudo npm install -g grunt-cli bower
sudo npm install -g grunt-cli
```
If Bower fails to download zipped dependencies, make sure it uses decompress-zip >= 0.0.4.
(e.g. check the file /usr/lib/node_modules/bower/node_modules/decompress-zip/package.json,
and reinstall Bower if decompress-zip is too old).
## Windows specific preparation instructions
You can automate the installation of NodeJS and NPM using [Chocolatey package manager]
......@@ -38,12 +33,11 @@ The package for Node.js can be installed using (this will also install NPM):
C:\> choco install nodejs.install
__Note:__ Due to a [bug] (http://jira.codehaus.org/browse/MEXEC-137) in the exec-maven-plugin the Maven build of the
API module will fail as the exec-maven-plugin is unable to find the __grunt__ and __bower__ commands. To fix this, do
API module will fail as the exec-maven-plugin is unable to find the __grunt__ command. To fix this, do
the following:
* open folder `C:\Users\USER\AppData\Roaming\npm`
* copy __grunt.cmd__ to __grunt.bat__
* copy __bower.cmd__ to __bower.bat__
More information can be found [here] (http://stackoverflow.com/questions/22393785/exec-maven-plugin-says-cannot-run-specified-program-even-though-it-is-on-the-pa/22395703#22395703).
......@@ -107,7 +101,7 @@ mvn -P cargo.run -Drepo.path=storage
The following URLs are available from this project:
* CMS at http://localhost:8080/cms
* Website at http://localhost:8080/site
* Website at http://localhost:8080/site
* Essentials dashboard at http://localhost:8080/essentials
Logs are located in `target/tomcat8x/logs`
......
{
"directory": "target/bower_components"
}
\ No newline at end of file
/*
* Copyright 2015 Hippo B.V. (http://www.onehippo.com)
* Copyright 2015-2016 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -14,78 +14,62 @@
* limitations under the License.
*/
module.exports = function (grunt) {
'use strict';
function readDeclutterConfig () {
return grunt.file.readJSON('declutter.config.json');
}
function readDeclutteredComponentFiles () {
var declutterConfig = readDeclutterConfig(),
components = Object.keys(declutterConfig),
declutteredFiles = [];
components.forEach(function (component) {
var componentRules = declutterConfig[component];
componentRules.forEach(function (rule) {
declutteredFiles.push(component + '/' + rule);
});
});
return declutteredFiles;
}
module.exports = function gruntTasks(grunt) {
'use strict';
// display execution time of each task
require('time-grunt')(grunt);
require('time-grunt')(grunt);
// load all grunt tasks automatically
require('load-grunt-tasks')(grunt);
require('load-grunt-tasks')(grunt);
// project configuration
grunt.initConfig({
build: require('./build.config.js'),
grunt.initConfig({
build: require('./build.config.js'),
// clean target (distribution) folder
clean: {
target: {
src: '<%= build.dashboardtarget %>'
}
},
clean: {
target: {
src: '<%= build.dashboardtarget %>',
},
},
jshint: {
files: 'src/main/webapp/js/*.js'
},
jshint: {
files: 'src/main/webapp/js/*.js',
},
// copy files to target folder
copy: {
components: {
files: [
{
expand: true,
cwd: '<%= build.bower %>',
dest: '<%= build.dashboardtarget %>',
src: readDeclutteredComponentFiles()
}
]
}
},
// only use a sub-set of files in Bower components
declutter: {
options: {
rules: readDeclutterConfig()
},
files: [
'<%= build.bower %>/*'
]
}
});
copy: {
components: {
files: [
{
expand: true,
cwd: '<%= build.npmDir %>',
dest: '<%= build.dashboardtarget %>',
src: [
'angular/angular.js',
'angular-ui-bootstrap/ui-bootstrap-tpls.js',
'angular-chosen-localytics/dist/angular-chosen.js',
'angular-sanitize/angular-sanitize.min.js',
'angular-tablesort/src/angular-tablesort.js',
'angular-ui-router/release/angular-ui-router.js',
'angular-ui-tree/dist/angular-ui-tree.min.css',
'chosen-npm/public/chosen.jquery.js',
'google-code-prettify/src/prettify.js',
'hippo-theme/dist/**',
'jquery/dist/jquery.js',
'angular-animate/angular-animate.js',
'angular-aria/angular-aria.min.js',
],
},
],
},
},
});
grunt.registerTask('build', 'Build everything', [
'clean:target',
'jshint',
'declutter',
'copy:components'
]);
};
\ No newline at end of file
grunt.registerTask('build', 'Build everything', [
'clean:target',
'jshint',
'copy:components',
]);
};
{
"name": "hippo-essentials-dashboard",
"private": true,
"dependencies": {
"angular": "1.4.8",
"angular-sanitize": "1.4.8",
"angular-ui-router": "0.2.15",
"angular-bootstrap": "0.14.3",
"hippo-theme": "./target/dependency/hippo-theme.zip",
"jquery": "2.1.4"
},
"devDependencies": {
"angular-mocks": "1.4.8",
"jasmine-jquery": "2.0.3"
}
}
/*
* Copyright 2015 Hippo B.V. (http://www.onehippo.com)
* Copyright 2015-2016 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -15,6 +15,6 @@
*/
module.exports = {
bower: 'target/bower_components',
npmDir: 'node_modules',
dashboardtarget: 'target/dashboard/components'
};
{
"angular": [
"angular.js"
],
"angular-bootstrap": [
"ui-bootstrap-tpls.js"
],
"angular-chosen-localytics": [
"chosen.js"
],
"angular-mocks": [],
"angular-sanitize": [
"angular-sanitize.min.js"
],
"angular-tablesort": [
"src/angular-tablesort.js"
],
"angular-ui-router": [
"release/angular-ui-router.js"
],
"angular-ui-tree": [
"dist/angular-ui-tree.min.css"
],
"chosen": [
"chosen.jquery.js"
],
"es5-shim": [],
"google-code-prettify": [
"src/prettify.js"
],
"hippo-theme": [
"dist/**"
],
"jasmine-jquery": [],
"jasmine": [],
"jquery": [
"dist/jquery.js"
],
"angular-animate": [
"angular-animate.js"
],
"angular-aria": [
"angular-aria.min.js"
]
}
This diff is collapsed.
{
"private": true,
"dependencies": {
"angular": "1.4.8",
"angular-sanitize": "1.4.8",
"angular-ui-router": "0.2.15",
"angular-ui-bootstrap": "0.14.3",
"hippo-theme": "./target/dependency/hippo-theme.tar.gz",
"jquery": "2.1.4"
},
"devDependencies": {
"angular-mocks": "1.4.8",
"jasmine-jquery": "2.0.5",
"grunt": "0.4.5",
"grunt-contrib-clean": "0.7.0",
"grunt-contrib-copy": "0.8.2",
"grunt-contrib-jshint": "0.12.0",
"grunt-declutter-task": "https://github.com/onehippo/grunt-declutter-task/tarball/v0.1.0",
"load-grunt-tasks": "3.4.0",
"time-grunt": "1.3.0"
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2014-2015 Hippo B.V. (http://www.onehippo.com)
Copyright 2014-2016 Hippo B.V. (http://www.onehippo.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......@@ -45,7 +45,7 @@
<artifactId>hippo-theme</artifactId>
<version>${hippo.frontend.theme.version}</version>
<classifier>distribution</classifier>
<type>zip</type>
<type>tar.gz</type>
<scope>provided</scope>
</dependency>
......@@ -89,15 +89,6 @@
<commandlineArgs>install</commandlineArgs>
</configuration>
</execution>
<execution>
<id>bower-install</id>
<phase>process-resources</phase>
<goals><goal>exec</goal></goals>
<configuration>
<executable>bower</executable>
<commandlineArgs>install --no-color</commandlineArgs>
</configuration>
</execution>
<execution>
<id>grunt-build</id>
<phase>process-resources</phase>
......
......@@ -42,7 +42,7 @@ components/angular-sanitize/*
THE SOFTWARE.
------------------------------------------------------------------------------------------------------------------------
components/angular-bootstrap/*
components/angular-ui-bootstrap/*
The MIT License
......@@ -141,7 +141,7 @@ components/angular-ui-tree/**
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------------------------------------------------
components/chosen/**
components/chosen-npm/public/**
Chosen
......
<%@ page language="java" contentType="text/html; charset=UTF-8" session="false" pageEncoding="UTF-8" %>
<%--
Copyright 2014-2015 Hippo B.V. (http://www.onehippo.com)
Copyright 2014-2016 Hippo B.V. (http://www.onehippo.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......@@ -26,9 +26,9 @@
</script>
<script src="${pageContext.request.contextPath}/components/jquery/dist/jquery.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/angular/angular.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/chosen/chosen.jquery.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/angular-chosen-localytics/chosen.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/angular-bootstrap/ui-bootstrap-tpls.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/chosen-npm/public/chosen.jquery.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/angular-chosen-localytics/dist/angular-chosen.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/angular-ui-bootstrap/ui-bootstrap-tpls.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/angular-ui-router/release/angular-ui-router.js?v=${project.version}"></script>
<script src="${pageContext.request.contextPath}/components/angular-sanitize/angular-sanitize.min.js?v=${project.version}"></script>
......
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-cms7-release</artifactId>
<version>11.0.0</version>
<version>11.0.1-SNAPSHOT</version>
</parent>
<name>Hippo Essentials</name>
......@@ -229,7 +229,6 @@
<exclude>archetype/**</exclude>
<exclude>**/*.md</exclude>
<exclude>*/.idea/**</exclude>
<exclude>*/.bowerrc/**</exclude>
<exclude>*/.npmrc/**</exclude>
<exclude>**/*.svg</exclude>
<exclude>**/*.woff</exclude>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment