couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [1/3] fauxton commit: updated refs/heads/master to fa6a30e
Date Wed, 13 Jan 2016 12:08:14 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 8a7a0f9d2 -> fa6a30e30


build production system with dashboard.assets

PR: #601
PR-URL: https://github.com/apache/couchdb-fauxton/pull/601
Reviewed-By: Benjamin Keen <ben.keen@gmail.com>


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

Branch: refs/heads/master
Commit: fa6a30e30f9d52c59189e0758b3d7a8d61963fd3
Parents: f25abf1
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Tue Jan 12 16:39:09 2016 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Wed Jan 13 13:09:54 2016 +0100

----------------------------------------------------------------------
 Gruntfile.js    | 50 ++++++++++++++++++++------------------------------
 package.json    |  8 ++++----
 tasks/helper.js | 25 -------------------------
 3 files changed, 24 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fa6a30e3/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index b8eb734..b42a8e5 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -189,42 +189,39 @@ module.exports = function (grunt) {
         files: [
           // this gets built in the template task
           {src: "dist/release/index.html", dest: "../../share/www/index.html"},
-          {src: ["**"], dest: "../../share/www/js/", cwd:'dist/release/js/',  expand: true},
-          {src: ["**"], dest: "../../share/www/img/", cwd:'dist/release/img/', expand: true},
-          {src: ["**"], dest: "../../share/www/fonts/", cwd:'dist/release/fonts/', expand:
true},
-          {src: ["**"], dest: "../../share/www/css/", cwd:"dist/release/css/", expand: true}
+          {src: ["**"], dest: "../../share/www/js/", cwd: 'dist/release/dashboard.assets/js/',
 expand: true},
+          {src: ["**"], dest: "../../share/www/img/", cwd: 'dist/release/dashboard.assets/img/',
expand: true},
+          {src: ["**"], dest: "../../share/www/fonts/", cwd: 'dist/release/dashboard.assets/fonts/',
expand: true},
+          {src: ["**"], dest: "../../share/www/css/", cwd: "dist/release/dashboard.assets/css/",
expand: true}
         ]
       },
       couchdebug: {
         files: [
           // this gets built in the template task
           {src: "dist/debug/index.html", dest: "../../share/www/index.html"},
-          {src: ["**"], dest: "../../share/www/js/", cwd:"dist/debug/js/",  expand: true},
-          {src: ["**"], dest: "../../share/www/img/", cwd:"dist/debug/img/", expand: true},
-          {src: ["**"], dest: "../../share/www/fonts/", cwd:"dist/debug/fonts/", expand:
true},
-          {src: ["**"], dest: "../../share/www/css/", cwd:"dist/debug/css/", expand: true}
+          {src: ["**"], dest: "../../share/www/js/", cwd: "dist/debug/dashboard.assets/js/",
 expand: true},
+          {src: ["**"], dest: "../../share/www/img/", cwd: "dist/debug/dashboard.assets/img/",
expand: true},
+          {src: ["**"], dest: "../../share/www/fonts/", cwd: "dist/debug/dashboard.assets/fonts/",
expand: true},
+          {src: ["**"], dest: "../../share/www/css/", cwd: "dist/debug/dashboard.assets/css/",
expand: true}
         ]
       },
       ace: {
         files: [
-          {src: "assets/js/libs/ace/worker-json.js", dest: "dist/release/js/ace/worker-json.js"},
-          {src: "assets/js/libs/ace/mode-json.js", dest: "dist/release/js/ace/mode-json.js"},
-          {src: "assets/js/libs/ace/theme-idle_fingers.js", dest: "dist/release/js/ace/theme-idle_fingers.js"},
-          {src: "assets/js/libs/ace/theme-dawn.js", dest: "dist/release/js/ace/theme-dawn.js"},
-          {src: "assets/js/libs/ace/mode-javascript.js", dest: "dist/release/js/ace/mode-javascript.js"},
-          {src: "assets/js/libs/ace/worker-javascript.js", dest: "dist/release/js/ace/worker-javascript.js"},
+          {src: "assets/js/libs/ace/worker-json.js", dest: "dist/release/dashboard.assets/js/ace/worker-json.js"},
+          {src: "assets/js/libs/ace/mode-json.js", dest: "dist/release/dashboard.assets/js/ace/mode-json.js"},
+          {src: "assets/js/libs/ace/theme-idle_fingers.js", dest: "dist/release/dashboard.assets/js/ace/theme-idle_fingers.js"},
+          {src: "assets/js/libs/ace/theme-dawn.js", dest: "dist/release/dashboard.assets/js/ace/theme-dawn.js"},
+          {src: "assets/js/libs/ace/mode-javascript.js", dest: "dist/release/dashboard.assets/js/ace/mode-javascript.js"},
+          {src: "assets/js/libs/ace/worker-javascript.js", dest: "dist/release/dashboard.assets/js/ace/worker-javascript.js"},
         ]
       },
 
-      addonDependencies: {
-        files: initHelper.getAddonDependencies()
-      },
-
       dist:{
         files:[
           {src: 'dist/debug/index.html', dest: 'dist/release/index.html'},
-          {src: assets.img, dest: 'dist/release/img/', flatten: true, expand: true},
-          {src: assets.fonts, dest: 'dist/release/fonts/', flatten: true, expand: true},
+          {src: assets.img, dest: 'dist/release/dashboard.assets/img/', flatten: true, expand:
true},
+          {src: ['assets/js/**/*.swf'], dest: 'dist/release/dashboard.assets/', flatten:
true, expand: true, filter: 'isFile'},
+          {src: ['*.eot', '*.woff', '*.svg', '*.ttf'], cwd: './assets/fonts', dest: 'dist/release/dashboard.assets/fonts/',
filter: 'isFile', flatten: true, expand: true},
           {src: './favicon.ico', dest: "dist/release/favicon.ico"}
         ]
       },
@@ -338,32 +335,25 @@ module.exports = function (grunt) {
     },
 
     // these rename the already-bundled, minified requireJS and CSS files to include their
hash
-    // XXX use tmp-out
     md5: {
       requireJS: {
-        files: { "dist/release/js/" : "dist/release/js/require.js" },
+        files: { 'dist/release/dashboard.assets/js/': 'dist/tmp-out/require.js' },
         options: {
           afterEach: function (fileChanges) {
             // replace the REQUIREJS_FILE placeholder with the actual filename
             var newFilename = fileChanges.newPath.match(/[^\/]+$/)[0];
             config.template.release.variables.requirejs = config.template.release.variables.requirejs.replace(/REQUIREJS_FILE/,
newFilename);
-
-            // remove the original requireJS file, we don't need it anymore
-            fs.unlinkSync(fileChanges.oldPath);
           }
         }
       },
 
       css: {
-        files: { "dist/release/css/": 'dist/release/css/index.css' },
+        files: { 'dist/release/dashboard.assets/css/': 'dist/tmp-out/index.css' },
         options: {
           afterEach: function (fileChanges) {
             // replace the CSS_FILE placeholder with the actual filename
             var newFilename = fileChanges.newPath.match(/[^\/]+$/)[0];
             config.template.release.variables.css = config.template.release.variables.css.replace(/CSS_FILE/,
newFilename);
-
-            // remove the original CSS file
-            fs.unlinkSync(fileChanges.oldPath);
           }
         }
       }
@@ -478,7 +468,7 @@ module.exports = function (grunt) {
 
   // build a release
   grunt.registerTask('release_commons_prefix', ['clean', 'dependencies']);
-  grunt.registerTask('release_commons_suffix', ['shell:stylecheck', 'shell:build-jsx', 'build',
'copy:dist', 'copy:ace', 'copy:addonDependencies']);
+  grunt.registerTask('release_commons_suffix', ['shell:stylecheck', 'shell:build-jsx', 'build',
'copy:dist', 'copy:ace']);
 
   grunt.registerTask('release', ['release_commons_prefix', 'gen_initialize:release', 'release_commons_suffix']);
   grunt.registerTask('couchapp_release', ['release_commons_prefix', 'gen_initialize:couchapp',
'release_commons_suffix']);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fa6a30e3/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1134eb9..c63b5d6 100644
--- a/package.json
+++ b/package.json
@@ -51,10 +51,10 @@
   "scripts": {
     "stylecheck": "eslint --ext=js,jsx .",
     "build:less:debug": "mkdirp ./dist/debug/dashboard.assets/css && node ./build-helper/less.js
dist/debug/dashboard.assets/css/index.css",
-    "build:less:release": "mkdirp ./dist/tmp-out && node ./build-helper/less.js dist/tmp-out/index.css",
-    "build:css-compress": "mkdirp ./dist/release/css/ && cleancss --skip-rebase -o
dist/release/css/index.css dist/tmp-out/index.css",
-    "build:uglify": "mkdirp ./dist/release/js/ && uglifyjs --mangle --compress=warnings=false
--screw-ie8 -o dist/release/js/require.js dist/tmp-out/require.js",
-    "build:requirejs:production": "mkdirp ./dist/tmp-out && r.js -o out=dist/tmp-out/require.js
baseUrl=app mainConfigFile=app/config.js name=config optimize=none wrap=false findNestedDependencies=true",
+    "build:less:release": "mkdirp ./dist/tmp-out && node ./build-helper/less.js dist/tmp-out/index-max.css",
+    "build:css-compress": "mkdirp ./dist/release/dashboard.assets/css/ && cleancss
--skip-rebase -o dist/tmp-out/index.css dist/tmp-out/index-max.css",
+    "build:uglify": "mkdirp ./dist/release/dashboard.assets/js/ && uglifyjs --mangle
--compress=warnings=false --screw-ie8 -o dist/tmp-out/require.js dist/tmp-out/require.js",
+    "build:requirejs:production": "mkdirp ./dist/tmp-out && r.js -o out=dist/tmp-out/require-max.js
baseUrl=app mainConfigFile=app/config.js name=config optimize=none wrap=false findNestedDependencies=true",
     "test": "grunt test",
     "couchdebug": "grunt couchdebug",
     "couchdb": "grunt couchdb",

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/fa6a30e3/tasks/helper.js
----------------------------------------------------------------------
diff --git a/tasks/helper.js b/tasks/helper.js
index 56e6170..a6551a6 100644
--- a/tasks/helper.js
+++ b/tasks/helper.js
@@ -57,31 +57,6 @@ exports.init = function (grunt) {
       }, defaults);
     },
 
-    // examines all loaded addons and returns any files in their /dependencies subfolder.
These are copied over to
-    // /js/[addonName]/ for bundled (prod) releases so their paths are known for referencing
at runtime
-    getAddonDependencies: function () {
-      var files = [];
-
-      _.each(this.readSettingsFile().deps, function (addon) {
-        var addonFolder = (addon.path) ? addon.path : './app/addons/' + addon.name;
-        var addonDepsFolder = addonFolder + '/dependencies';
-
-        // ignore addons that don't contain a /dependencies subfolder
-        if (!fs.existsSync(addonDepsFolder)) {
-          return false;
-        }
-
-        _.each(fs.readdirSync(addonDepsFolder), function (file) {
-          files.push({
-            src: addonDepsFolder + '/' + file,
-            dest: 'dist/release/js/' + addon.name + '/' + file
-          });
-        });
-      });
-
-      return files;
-    },
-
     check_selenium: {
       command: 'test -s ./test/nightwatch_tests/selenium/selenium-server-standalone-2.45.0.jar
|| ' +
         'curl -o ./test/nightwatch_tests/selenium/selenium-server-standalone-2.45.0.jar '
+


Mime
View raw message