couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [2/2] git commit: improve couchserver task to work with new template config
Date Sat, 16 Mar 2013 12:26:50 GMT
Updated Branches:
  refs/heads/fauxton 57164b918 -> e1a8ab520


improve couchserver task to work with new template config


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e1a8ab52
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e1a8ab52
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e1a8ab52

Branch: refs/heads/fauxton
Commit: e1a8ab5202e8a4ba31e6a58e33e3ddfb8a8645f1
Parents: d2040ab
Author: Garren Smith <garren.smith@gmail.com>
Authored: Sat Mar 16 14:25:49 2013 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Sat Mar 16 14:25:49 2013 +0200

----------------------------------------------------------------------
 src/fauxton/grunt.js             |  107 +--------------------------------
 src/fauxton/tasks/couchserver.js |    9 +--
 2 files changed, 3 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e1a8ab52/src/fauxton/grunt.js
----------------------------------------------------------------------
diff --git a/src/fauxton/grunt.js b/src/fauxton/grunt.js
index fa612b9..875316b 100644
--- a/src/fauxton/grunt.js
+++ b/src/fauxton/grunt.js
@@ -138,112 +138,7 @@ module.exports = function(grunt) {
       ]
     },
 
-    // Create static html files from templates, for managing change of script
-    // or css name.
-    template: {
-      couchdb:{
-        src: 'assets/index.underscore',
-        dest: '../../share/www/fauxton/index.html',
-        variables: {
-          assets_root: '/_utils/fauxton/',
-          requirejs: 'require.min.js',
-          base: '/_utils/fauxton/'
-        }
-      },
-      couchdebug:{
-        src: 'assets/index.underscore',
-        dest: '../../share/www/fauxton/index.html',
-        variables: {
-          assets_root: '/_utils/fauxton/',
-          requirejs: 'require.js',
-          base: '/_utils/fauxton/'
-        }
-      },
-      release: {
-        src: 'assets/index.underscore',
-        dest: 'dist/release/index.html',
-        variables: {
-          assets_root: '/',
-          requirejs: 'require.min.js',
-          base: '/'
-        }
-      },
-      debug: {
-        src: 'assets/index.underscore',
-        dest: 'dist/debug/index.html',
-        variables: {
-          assets_root: '/',
-          requirejs: 'require.js',
-          base: '/'
-        }
-      },
-      couchapp: {
-        src: 'assets/index.underscore',
-        dest: 'dist/debug/index.html',
-        variables: {
-          assets_root: '/fauxton/_design/fauxton/',
-          requirejs: 'require.js',
-          base: '/fauxton/_design/fauxton/index.html'
-        }
-      }
-    },
     template: templateSettings,
-    template: {
-      couchdb:{
-        src: 'assets/index.underscore',
-        dest: '../../share/www/fauxton/index.html',
-        variables: {
-          assets_root: '/_utils/fauxton/',
-          requirejs: 'require.min.js',
-          base: '/_utils/fauxton/'
-        }
-      },
-      couchdebug:{
-        src: 'assets/index.underscore',
-        dest: '../../share/www/fauxton/index.html',
-        variables: {
-          assets_root: '/_utils/fauxton/',
-          requirejs: 'require.js',
-          base: '/_utils/fauxton/'
-        }
-      },
-      release: {
-        src: 'assets/index.underscore',
-        dest: 'dist/release/index.html',
-        variables: {
-          assets_root: '/',
-          requirejs: 'require.min.js',
-          base: '/'
-        }
-      },
-      debug: {
-        src: 'assets/index.underscore',
-        dest: 'dist/debug/index.html',
-        variables: {
-          assets_root: '/',
-          requirejs: 'require.js',
-          base: '/'
-        }
-      },
-      server: {
-        src: 'assets/index.underscore',
-        dest: 'dist/debug/index.html',
-        variables: {
-          assets_root: '/assets/',
-          requirejs: 'require.js',
-          base: '/'
-        }
-      },
-      couchapp: {
-        src: 'assets/index.underscore',
-        dest: 'dist/debug/index.html',
-        variables: {
-          assets_root: '/fauxton/_design/fauxton/',
-          requirejs: 'require.js',
-          base: '/fauxton/_design/fauxton/index.html'
-        }
-      }
-    },
 
     // The concatenate task is used here to merge the almond require/define
     // shim and the templates into the application code.  It's named
@@ -402,7 +297,7 @@ module.exports = function(grunt) {
   grunt.registerTask("minify", "min mincss");
   // deafult task - push to CouchDB
   grunt.registerTask("default", "test dependencies build release install");
-  grunt.registerTask("dev", "debug template:server couchserver");
+  grunt.registerTask("dev", "debug template couchserver");
   // make a debug install
   grunt.registerTask("debug", "test dependencies build template copy:debug concat:debug");
   // make an install that is server by mochiweb under _utils

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e1a8ab52/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index 9680c00..2d36afa 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -23,14 +23,9 @@ module.exports = function (grunt) {
     // inform grunt that this task is async
     var done = this.async();
 
-    // images don't have the full path, so have to have own route for them
-    app.get('/img/*', function (req, res) {
-      res.sendfile(path.join(dist_dir,req.url));
-    });
-
     // serve any javascript or css files from here
-    app.get('/assets/*', function (req, res) {
-      res.sendfile(req.url.replace('/assets/',dist_dir));
+    app.get(/\.css$|\.js$|img/, function (req, res) {
+      res.sendfile(path.join(dist_dir,req.url));
     });
 
     // serve main index file from here


Mime
View raw message