couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject [39/50] [abbrv] couchdb commit: updated refs/heads/1.6.x to d2ac597
Date Tue, 01 Apr 2014 17:42:21 GMT
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/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/27cc89cb
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/27cc89cb
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/27cc89cb

Branch: refs/heads/1.6.x
Commit: 27cc89cb7c306f72c2746b5ea3736bd94f17cebf
Parents: c84a71c
Author: Garren Smith <garren.smith@gmail.com>
Authored: Thu Mar 27 11:04:49 2014 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Thu Mar 27 11:12:15 2014 +0200

----------------------------------------------------------------------
 src/Makefile.am                         |  1 -
 src/fauxton/Gruntfile.js                |  8 ++------
 src/fauxton/app/config.js               |  5 +----
 src/fauxton/assets/js/libs/d3.global.js | 18 ------------------
 src/fauxton/assets/js/libs/nv.d3.js     |  7 ++++++-
 src/fauxton/settings.json.default       | 16 ++++++++++++++++
 6 files changed, 25 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/27cc89cb/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index ccf6ccd..e1007f9 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 \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/27cc89cb/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 49c082e..29111eb 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

http://git-wip-us.apache.org/repos/asf/couchdb/blob/27cc89cb/src/fauxton/app/config.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/config.js b/src/fauxton/app/config.js
index 3ed1c31..4a2f136 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": [],
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/27cc89cb/src/fauxton/assets/js/libs/d3.global.js
----------------------------------------------------------------------
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 9f38d04..0000000
--- 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 = _;
-});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/27cc89cb/src/fauxton/assets/js/libs/nv.d3.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/nv.d3.js b/src/fauxton/assets/js/libs/nv.d3.js
index 4ddf400..409dc65 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;
+});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/27cc89cb/src/fauxton/settings.json.default
----------------------------------------------------------------------
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index 1bc88f6..eedf2f1 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": {


Mime
View raw message