diff options
author | Garren Smith <garren.smith@gmail.com> | 2014-03-27 11:04:49 +0200 |
---|---|---|
committer | Garren Smith <garren.smith@gmail.com> | 2014-03-27 11:12:15 +0200 |
commit | 27cc89cb7c306f72c2746b5ea3736bd94f17cebf (patch) | |
tree | 5ff859ef89fb5e059f9acff15698bc8ea3dacb02 | |
parent | c84a71cb9b3d8fd20fe7b8df0a320152e035d6e2 (diff) | |
download | couchdb-27cc89cb7c306f72c2746b5ea3736bd94f17cebf.tar.gz |
Fix Fauxton dependancie issues
I've modified nv.d3 to be an amd module. This isn't pretty but it's the
best fix, otherwise we cannot use this library.
I've also added a new config in settings.json.default for couchapp
deployment as the current release config doesn't work with a couchapp
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/fauxton/Gruntfile.js | 8 | ||||
-rw-r--r-- | src/fauxton/app/config.js | 5 | ||||
-rw-r--r-- | src/fauxton/assets/js/libs/d3.global.js | 18 | ||||
-rwxr-xr-x | src/fauxton/assets/js/libs/nv.d3.js | 7 | ||||
-rw-r--r-- | src/fauxton/settings.json.default | 16 |
6 files changed, 25 insertions, 30 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index ccf6ccd10..e1007f962 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -251,7 +251,6 @@ FAUXTON_FILES = \ fauxton/assets/js/libs/backbone.js \ fauxton/assets/js/libs/bootstrap.js \ fauxton/assets/js/libs/d3.js \ - fauxton/assets/js/libs/d3.global.js \ fauxton/assets/js/libs/jquery.js \ fauxton/assets/js/libs/lodash.js \ fauxton/assets/js/libs/nv.d3.js \ diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js index 49c082e99..29111ebac 100644 --- a/src/fauxton/Gruntfile.js +++ b/src/fauxton/Gruntfile.js @@ -349,11 +349,6 @@ module.exports = function(grunt) { } }, gen_initialize: templateSettings, - /*gen_initialize: { - "default": { - src: "settings.json" - } - },*/ mkcouchdb: couch_config, rmcouchdb: couch_config, @@ -448,6 +443,7 @@ module.exports = function(grunt) { grunt.registerTask('watchRun', ['clean:watch', 'dependencies', 'jshint']); // build a release grunt.registerTask('release', ['clean' ,'dependencies', "gen_initialize:release", 'jshint', 'build', 'minify', 'copy:dist', 'copy:ace']); + grunt.registerTask('couchapp_release', ['clean' ,'dependencies', "gen_initialize:couchapp", 'jshint', 'build', 'minify', 'copy:dist', 'copy:ace']); /* * Install into CouchDB in either debug, release, or couchapp mode @@ -457,7 +453,7 @@ module.exports = function(grunt) { // make a minimized install that is server by mochiweb under _utils grunt.registerTask('couchdb', ['release', 'copy:couchdb']); // make an install that can be deployed as a couchapp - grunt.registerTask('couchapp_setup', ['release']); + grunt.registerTask('couchapp_setup', ['couchapp_release']); // install fauxton as couchapp grunt.registerTask('couchapp_install', ['rmcouchdb:fauxton', 'mkcouchdb:fauxton', 'couchapp:fauxton']); // setup and install fauxton as couchapp diff --git a/src/fauxton/app/config.js b/src/fauxton/app/config.js index 3ed1c317f..4a2f1368a 100644 --- a/src/fauxton/app/config.js +++ b/src/fauxton/app/config.js @@ -30,8 +30,7 @@ require.config({ spin: "../assets/js/libs/spin.min", d3: "../assets/js/libs/d3", "nv.d3": "../assets/js/libs/nv.d3", - "ace":"../assets/js/libs/ace", - "d3.global": "../assets/js/libs/d3.global" + "ace":"../assets/js/libs/ace" }, baseUrl: '/', @@ -55,8 +54,6 @@ require.config({ exports: "Bootstrap" }, - "nv.d3": ["d3.global"], - "plugins/prettify": [], "plugins/beautify": [], diff --git a/src/fauxton/assets/js/libs/d3.global.js b/src/fauxton/assets/js/libs/d3.global.js deleted file mode 100644 index 9f38d04ec..000000000 --- a/src/fauxton/assets/js/libs/d3.global.js +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -// Set the require.js configuration for your application. - -define("d3.global", ["d3"], function(_) { - //get that global back - d3 = _; -}); diff --git a/src/fauxton/assets/js/libs/nv.d3.js b/src/fauxton/assets/js/libs/nv.d3.js index 4ddf4002c..409dc65e7 100755 --- a/src/fauxton/assets/js/libs/nv.d3.js +++ b/src/fauxton/assets/js/libs/nv.d3.js @@ -1,3 +1,5 @@ +//this is a hacky fix because nv.d3 doesn't support requirejs +define("nvd3", ["d3"], function (d3) { (function(){ var nv = window.nv || {}; @@ -14366,4 +14368,7 @@ nv.models.stackedAreaChart = function() { return chart; } -})();
\ No newline at end of file +})(); + +return window.nv; +}); diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default index 1bc88f649..eedf2f188 100644 --- a/src/fauxton/settings.json.default +++ b/src/fauxton/settings.json.default @@ -46,7 +46,23 @@ "host": "../..", "version": "1.0" } + }, + "couchapp": { + "src": "assets/index.underscore", + "dest": "dist/debug/index.html", + "variables": { + "requirejs": "./js/require.js", + "css": "./css/index.css", + "base": null, + "cachebuster": "?v1.0" + }, + "app": { + "root": "/", + "host": "../../..", + "version": "1.0" + } } + }, "couch_config": { |