Repository: couchdb-fauxton Updated Branches: refs/heads/master 57883a2b4 -> 5559ed2c2
use require on the cli makes it composable, so we can have different targets PR: #599 PR-URL: https://github.com/apache/couchdb-fauxton/pull/599 Reviewed-By: Benjamin Keen <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/5559ed2c Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/5559ed2c Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/5559ed2c Branch: refs/heads/master Commit: 5559ed2c2f26b5d7f8359f87146ff8d1bef603ae Parents: 57883a2 Author: Robert Kowalski <[email protected]> Authored: Thu Jan 7 16:32:12 2016 +0100 Committer: Robert Kowalski <[email protected]> Committed: Mon Jan 11 13:29:59 2016 +0100 ---------------------------------------------------------------------- Gruntfile.js | 29 ++++++----------------------- package.json | 4 +++- readme.md | 7 +++++++ 3 files changed, 16 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5559ed2c/Gruntfile.js ---------------------------------------------------------------------- diff --git a/Gruntfile.js b/Gruntfile.js index cdc6de3..f4cd384 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -187,27 +187,6 @@ module.exports = function (grunt) { } }, - requirejs: { - compile: { - options: { - baseUrl: 'app', - // Include the main configuration file. - mainConfigFile: "app/config.js", - - // Output file. - out: 'dist/tmp-out/require.js', - - // Root application module. - name: "config", - - // Do not wrap everything in an IIFE. - wrap: false, - optimize: "none", - findNestedDependencies: true - } - } - }, - // Copy build artifacts and library code into the distribution // see - http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically copy: { @@ -333,6 +312,10 @@ module.exports = function (grunt) { command: '' // populated dynamically }, + requirejs: { + command: 'npm run build:requirejs:production' + }, + phantomjs: { command: 'node ./node_modules/phantomjs/bin/phantomjs --debug=false ' + '--ssl-protocol=sslv2 --web-security=false --ignore-ssl-errors=true ' + @@ -358,6 +341,7 @@ 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" }, @@ -450,7 +434,6 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-couchapp'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-exec'); - grunt.loadNpmTasks('grunt-contrib-requirejs'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-jst'); @@ -478,7 +461,7 @@ module.exports = function (grunt) { // minify code and css, ready for release. grunt.registerTask('jsx', ['shell:build-jsx']); - grunt.registerTask('build', ['shell:build-less-release', 'jst', 'requirejs', 'concat:requirejs', 'shell:uglify', + grunt.registerTask('build', ['shell:build-less-release', 'jst', 'shell:requirejs', 'concat:requirejs', 'shell:uglify', 'shell:css-compress', 'md5:requireJS', 'md5:css', 'template:release']); /* http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5559ed2c/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index 84d9966..1bcecac 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-jst": "~0.5.0", - "grunt-contrib-requirejs": "~0.4.1", "grunt-couchapp": "~0.2.1", "grunt-exec": "~0.4.0", "grunt-init": "~0.2.0", @@ -41,18 +40,21 @@ "optimist": "^0.6.1", "react-tools": "^0.12.0", "request": "^2.54.0", + "requirejs": "^2.1.22", "send": "~0.1.1", "uglify-js": "^2.6.1", "underscore": "~1.4.2", "url": "~0.7.9", "urls": "~0.0.3" }, + "scripts": { "stylecheck": "eslint --ext=js,jsx .", "build:less:debug": "mkdirp ./dist/debug/css && node ./build-helper/less.js dist/debug/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", "test": "grunt test", "couchdebug": "grunt couchdebug", "couchdb": "grunt couchdb", http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5559ed2c/readme.md ---------------------------------------------------------------------- diff --git a/readme.md b/readme.md index 18650a2..8b82874 100644 --- a/readme.md +++ b/readme.md @@ -66,6 +66,13 @@ To deploy to your local [CouchDB instance](http://localhost:5984/fauxton/_design grunt couchapp_deploy +### Build pipeline overview + +During a release build we are creating a folder called `dist/tmp-out`. +It contains all files that are just intermediate results for the final +release artifact. Once everything is finished the files are copied from +`tmp-out` to their final destination, `dist/release` where they are +part of the deployable release artifact. ### (Optional) To avoid a npm global install # Development mode, non minified files
