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 Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/0783241c Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/0783241c Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/0783241c Branch: refs/heads/import-master Commit: 0783241c63dcc6d26fd762b5527d323fc666dd06 Parents: 0087fab Author: Garren Smith <garren.sm...@gmail.com> Authored: Thu Mar 27 11:04:49 2014 +0200 Committer: Garren Smith <garren.sm...@gmail.com> Committed: Thu Mar 27 11:12:15 2014 +0200 ---------------------------------------------------------------------- Gruntfile.js | 8 ++------ app/config.js | 5 +---- assets/js/libs/d3.global.js | 18 ------------------ assets/js/libs/nv.d3.js | 7 ++++++- settings.json.default | 16 ++++++++++++++++ 5 files changed, 25 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0783241c/Gruntfile.js ---------------------------------------------------------------------- diff --git a/Gruntfile.js b/Gruntfile.js index 49c082e..29111eb 100644 --- a/Gruntfile.js +++ b/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 http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0783241c/app/config.js ---------------------------------------------------------------------- diff --git a/app/config.js b/app/config.js index 3ed1c31..4a2f136 100644 --- a/app/config.js +++ b/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": [], http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0783241c/assets/js/libs/d3.global.js ---------------------------------------------------------------------- diff --git a/assets/js/libs/d3.global.js b/assets/js/libs/d3.global.js deleted file mode 100644 index 9f38d04..0000000 --- a/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 = _; -}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0783241c/assets/js/libs/nv.d3.js ---------------------------------------------------------------------- diff --git a/assets/js/libs/nv.d3.js b/assets/js/libs/nv.d3.js index 4ddf400..409dc65 100755 --- a/assets/js/libs/nv.d3.js +++ b/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; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0783241c/settings.json.default ---------------------------------------------------------------------- diff --git a/settings.json.default b/settings.json.default index 1bc88f6..eedf2f1 100644 --- a/settings.json.default +++ b/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": {