Simpler deps

This commit is contained in:
Nicolas Le Goff
2015-02-05 18:49:33 +01:00
parent 949bf06cac
commit 5da553756c
3 changed files with 26 additions and 42 deletions

View File

@@ -42,22 +42,19 @@ module.exports = function(grunt) {
dist: { dist: {
options: { options: {
components: { components: {
"jquery.ui": ["npm", {"../../node_modules/.bin/grunt": "build"}], "bootstrap": ["npm", {"make": "bootstrap"}]
"jquery-mobile": ["npm", {"../../node_modules/.bin/grunt": "dist"}],
"bootstrap": ["npm", {"make": "bootstrap"}],
"autobahnjs": [{"make":"build"}]
} }
} }
} }
}, },
copy: { copy: {
"autobahnjs": { "autobahn": {
"expand": true, "expand": true,
"src": [ "src": [
"<%= path.bower %>/autobahnjs/build/autobahn.js", "<%= path.bower %>/autobahn/autobahn.js",
"<%= path.bower %>/autobahnjs/LICENSE" "<%= path.bower %>/autobahn/LICENSE"
], ],
"dest": "<%= path.asset %>/autobahnjs/", "dest": "<%= path.asset %>/autobahn/",
"flatten": true "flatten": true
}, },
"backbone": { "backbone": {
@@ -106,12 +103,6 @@ module.exports = function(grunt) {
"dest": "<%= path.asset %>/chai/", "dest": "<%= path.asset %>/chai/",
"flatten": true "flatten": true
}, },
"deps-when": {
"expand": true,
"cwd": "<%= path.bower %>/autobahnjs",
"src": "../when/when.js",
"dest": "<%= path.bower %>/autobahnjs/when"
},
"font-awesome": { "font-awesome": {
"expand": true, "expand": true,
"cwd": "<%= path.bower %>/font-awesome", "cwd": "<%= path.bower %>/font-awesome",
@@ -181,12 +172,13 @@ module.exports = function(grunt) {
}, },
"jquery-mobile": { "jquery-mobile": {
"expand": true, "expand": true,
"cwd": "<%= path.bower %>/jquery-mobile/dist", "cwd": "<%= path.bower %>/jquery-mobile-bower/",
"src": [ "src": [
"images/*", "images/*",
"jquery.mobile.css", "css/jquery.mobile-1.3.2.css",
"jquery.mobile.js" "js/jquery.mobile-1.3.2.js"
], ],
"flatten": true,
"dest": "<%= path.asset %>/jquery-mobile/" "dest": "<%= path.asset %>/jquery-mobile/"
}, },
"jquery.cookie": { "jquery.cookie": {
@@ -199,18 +191,17 @@ module.exports = function(grunt) {
}, },
"jquery-ui": { "jquery-ui": {
"expand": true, "expand": true,
"cwd": "<%= path.bower %>/jquery.ui", "cwd": "<%= path.bower %>/jquery-ui",
"src": [ "src": [
"dist/i18n/*", "ui/i18n/*",
"dist/images/*", "ui/*",
"themes/base/*", "themes/base/*",
"themes/base/images/*", "themes/base/images/*",
"dist/jquery-ui.css",
"dist/jquery-ui.js",
"MIT-LICENSE.txt" "MIT-LICENSE.txt"
], ],
"rename": function(dest, src) { "rename": function(dest, src) {
return dest + src.replace("dist", ""); var dest = dest + src.replace("ui/", "/");
return dest.replace("themes/base/", "/")
}, },
"dest": "<%= path.asset %>/jquery.ui/" "dest": "<%= path.asset %>/jquery.ui/"
}, },
@@ -310,12 +301,13 @@ module.exports = function(grunt) {
}, },
"tinymce": { "tinymce": {
"expand": true, "expand": true,
"cwd": "<%= path.bower %>/tinymce/js/tinymce", "cwd": "<%= path.bower %>/tinymce/",
"src": [ "src": [
"plugins/**", "plugins/**",
"skins/**", "skins/**",
"themes/**", "themes/**",
"tinymce.js", "*.js",
"changelog.txt",
"license.txt" "license.txt"
], ],
"dest": "<%= path.asset %>/tinymce" "dest": "<%= path.asset %>/tinymce"
@@ -404,15 +396,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-bower-postinst"); grunt.loadNpmTasks("grunt-bower-postinst");
grunt.loadNpmTasks('grunt-mocha-phantomjs'); grunt.loadNpmTasks('grunt-mocha-phantomjs');
// This task is here to copy bower module into an other bower module
// Because bower removes .git folder you can not use git submodule update
// So fetch them with bower and copy them to appropriate path
grunt.registerTask("copy-deps", [
"copy:deps-when"
]);
grunt.registerTask("copy-assets", [ grunt.registerTask("copy-assets", [
"copy:autobahnjs", "copy:autobahn",
"copy:backbone", "copy:backbone",
"copy:blueimp", "copy:blueimp",
"copy:bootstrap", "copy:bootstrap",
@@ -449,10 +434,9 @@ module.exports = function(grunt) {
grunt.registerTask("install-assets", [ grunt.registerTask("install-assets", [
"clean:assets", "clean:assets",
"bower", "bower",
"copy-deps",
"bower_postinst", "bower_postinst",
"copy-assets", "copy-assets",
"clean:bower" //"clean:bower"
]); ]);
grunt.registerTask('test', ["shell:generate_js_fixtures", "qunit", "mocha_phantomjs"]); grunt.registerTask('test', ["shell:generate_js_fixtures", "qunit", "mocha_phantomjs"]);
}; };

View File

@@ -4,8 +4,8 @@
"dependencies": { "dependencies": {
"bootstrap": "2.3.2", "bootstrap": "2.3.2",
"jquery": "~1.8.3", "jquery": "~1.8.3",
"jquery.ui": "~1.10.0", "jquery-ui": "~1.10.0",
"jquery-mobile": "~1.3.0", "jquery-mobile-bower": "~1.3.0",
"underscore": "~1.4.4", "underscore": "~1.4.4",
"font-awesome": "~3.0.2", "font-awesome": "~3.0.2",
"modernizr": "~2.6.2", "modernizr": "~2.6.2",
@@ -25,7 +25,7 @@
"tinymce": "~4.0", "tinymce": "~4.0",
"jquery-galleria": "1.2.9", "jquery-galleria": "1.2.9",
"jquery.cookie": "~1.4", "jquery.cookie": "~1.4",
"autobahnjs": "~0.8.0", "autobahn": "~0.9.0",
"when": "~2.7.0", "when": "~2.7.0",
"web-socket-js": "~1.0.1", "web-socket-js": "~1.0.1",
"jquery.treeview": "1.4.1" "jquery.treeview": "1.4.1"

View File

@@ -6,9 +6,9 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="initial-scale=1"> <meta name="viewport" content="initial-scale=1">
<title>{{ app['conf'].get(['registry', 'general', 'title']) }} - {{ module_name }} </title> <title>{{ app['conf'].get(['registry', 'general', 'title']) }} - {{ module_name }} </title>
<link rel="stylesheet" href="{{ path('minifier', { 'f' : 'assets/jquery-mobile/jquery.mobile.css' }) }}" /> <link rel="stylesheet" href="{{ path('minifier', { 'f' : 'assets/jquery-mobile/jquery.mobile-1.3.2.css' }) }}" />
<script src="{{ path('minifier', { 'f' : 'assets/jquery/jquery.js' }) }}"></script> <script src="{{ path('minifier', { 'f' : 'assets/jquery/jquery.js' }) }}"></script>
<script src="{{ path('minifier', { 'f' : 'assets/jquery-mobile/jquery.mobile.js' }) }}"></script> <script src="{{ path('minifier', { 'f' : 'assets/jquery-mobile/jquery.mobile-1.3.2.js' }) }}"></script>
<style type="text/css"> <style type="text/css">
html,body, div[data-role ="page"] { html,body, div[data-role ="page"] {
height: 100%; height: 100%;