diff --git a/.gitignore b/.gitignore index 300d0b30a..786199608 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,10 @@ bower_components # Optional REPL history .node_repl_history + +#Build output +dist/js +dist/css +dist/bower.json +dist/README.md +dist/LICENSE \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c8d6fd4fd..139bc40a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,17 @@ language: node_js node_js: - "4" script: - - grunt verify - - grunt coveralls \ No newline at end of file +- grunt verify +- grunt coveralls +after_success: +- grunt build +before_deploy: "cd dist" +deploy: + provider: npm + skip_cleanup: true + email: igniteui@infragistics.com + api_key: + secure: JeRvlOs2mLvzJHqtpVLvEtTVrZZqB4kufmz7+4RNk9XgzcSwXVbp5ZCpdYkZy/2HypJTjyryN98FuqCQo4cnmnkVS2phiejA9b9YVl3uFtCeFxGJJ4st/98UT3f7OrDgqFIh4v+MtzIS76+Erv2YmV8RBtEgoOpfCpuO5aBpi3oJR49iw8TN2dZwfyvUtb2ytMfzyR1q7xsl+Q0qYzwhX00BxVxGY6UkKF1VaRjsfGYrfC4FkpAT4u5mD+KtUMwRHGpMyQm1LYusS99+ugwOloq4gFArham/J/06tLwCXXjW/xhVH4HyQRiMZE649rl7TI/j88vZrGUKw16SQT+K/0+3sw4/BtwwlEjNiD1UIr97lRL7oFTZp/NYBs1PgNHd+xYGLnWA34NuUWlo9pviUz5U/mVaRVPZ5u1oLKHjPYX2VElE/GgqjQuj08il8rtRr7UHP0O5y0MPJ+t1WgWnivc0ISs+AHe+edLPoGAMHiK7vEcsM10y8z7Lfx7BbuWLFfv2eoWeruO1B0kEP+jeuognOBcyjSD/zKMfmosW/L+muhHCCPI1yDSmtutq24HVzktq0ggF9i5g4jTpH9kORBGKOirXuMP1Hf412IvzeQ71LK4A9W9z+mKje+9ygqrPDrbyYaclDiCrwOrAi3IGrpoi5F5ACdY13ObZpKG71RA= + on: + tags: true + repo: IgniteUI/ignite-ui diff --git a/Gruntfile.js b/Gruntfile.js index 90b7590d3..645fb014e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,6 @@ -var config = { +var buildVersion = require("./package.json").version, + year = new Date().getFullYear(), + config = { scripts: "src/js/**/*.js", scriptsDir: "src/js", modulesDir: "src/js/modules", @@ -59,19 +61,55 @@ module.exports = function (grunt) { clean: { jshint: ["jshint"], jscs: ["jscs"], - tests: ["qunit", "coverage", "instrumentedFiles"] + tests: ["qunit", "coverage", "instrumentedFiles"], + build: ["dist/js/**/*", "dist/css/**/*", "dist/bower.json"] }, coveralls: { // LCOV coverage file (can be string, glob or array) - src: './coverage/reportLCOV/*.info', - // Options relevant to all targets - options: { - // When true, grunt-coveralls will only print a warning rather than - // an error, to prevent CI builds from failing unnecessarily (e.g. if - // coveralls.io is down). Optional, defaults to false. - force: false + src: './coverage/reportLCOV/*.info' + }, + copy: { + js: { + expand: true, + cwd: './src/', + src: 'js/**/*.js', + dest: './dist/', + options: { + process: function (content, srcpath) { + return content.replace("", buildVersion).replace("", year); + } + }, + }, + css: { + expand: true, + cwd: './src/', + src: 'css/**', + dest: './dist/', + }, + resources: { + src: ['bower.json', "README.md", "LICENSE"], + dest: './dist/' } - } + }, + cssmin: { + all: { + files: [{ + expand: true, + cwd: 'dist/css/', + src: ['**/*.css', '!**/*.min.css'], + dest: 'dist/css' + }] + }, + structure: { + options: { + rebase: true + }, + files: [{ + 'dist/css/structure/infragistics.css': ['dist/css/structure/modules/*.css'] + }] + } + }, + uglify: require('./build/config/all/combined-files.js') }); grunt.loadNpmTasks("grunt-contrib-clean"); @@ -79,6 +117,9 @@ module.exports = function (grunt) { grunt.loadNpmTasks("grunt-jscs"); grunt.loadNpmTasks("grunt-qunit-istanbul"); grunt.loadNpmTasks("grunt-coveralls"); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.task.registerTask("hint", "A sample task to run JSHINT", function(control) { var config; @@ -162,4 +203,11 @@ module.exports = function (grunt) { grunt.task.run("hint", "jscs", "test"); } }); + + grunt.task.registerTask("build", "Combine output files and prepare output", function() { + grunt.task.run("clean:build"); + grunt.task.run("copy"); + grunt.task.run("uglify"); + grunt.task.run("cssmin"); + }); }; \ No newline at end of file diff --git a/build/config/all/combined-files.js b/build/config/all/combined-files.js new file mode 100644 index 000000000..825e6486d --- /dev/null +++ b/build/config/all/combined-files.js @@ -0,0 +1,66 @@ +var locales = ["bg", "de", "en", "es", "fr", "ja", "ru"], newFiles = {}, i; + +module.exports = { + "options": { + + // use the general "keep some" regexp + "preserveComments": /(?:^!|@(?:license|preserve|cc_on))/, + "compress": false, + "mangle": false + }, + "combine": { + "files": { + "./dist/js/infragistics.core-lite.js": [ + "./dist/js/i18n/infragistics-en.js", + "./dist/js/modules/infragistics.util.js", + "./dist/js/modules/infragistics.dataSource.js", + "./dist/js/modules/infragistics.templating.js", + "./dist/js/modules/infragistics.ui.shared.js", + "./dist/js/modules/infragistics.ui.scroll.js" + ], + "./dist/js/infragistics.lob-lite.js": [ + "./dist/js/modules/infragistics.ui.combo.js", + "./dist/js/modules/infragistics.ui.dialog.js", + "./dist/js/modules/infragistics.ui.popover.js", + "./dist/js/modules/infragistics.ui.notifier.js", + "./dist/js/modules/infragistics.ui.editors.js", + "./dist/js/modules/infragistics.ui.tree.js", + "./dist/js/modules/infragistics.ui.layoutmanager.js", + "./dist/js/modules/infragistics.ui.splitter.js", + "./dist/js/modules/infragistics.ui.splitbutton.js", + "./dist/js/modules/infragistics.ui.rating.js", + "./dist/js/modules/infragistics.ui.toolbarbutton.js", + "./dist/js/modules/infragistics.ui.colorpicker.js", + "./dist/js/modules/infragistics.ui.colorpickersplitbutton.js", + "./dist/js/modules/infragistics.ui.toolbar.js", + "./dist/js/modules/infragistics.ui.tilemanager.js", + "./dist/js/modules/infragistics.ui.upload.js", + "./dist/js/modules/infragistics.ui.validator.js", + "./dist/js/modules/infragistics.ui.htmleditor.js", + "./dist/js/modules/infragistics.ui.videoplayer.js", + "./dist/js/modules/infragistics.ui.zoombar.js" + ] + } + }, + "all": { + files: [{ + expand: true, + cwd: 'dist/', + src: ['**/*.js', '**/*-lite.js'], + dest: 'dist/' + } + ] + } +}; + +/** + * Prepare bundles for each localization + */ +for (var i = 0; i < locales.length; i++) { + newFiles["./dist/js/i18n/infragistics-" + locales[i] + ".js"] = "./dist/js/modules/i18n/*-en.js"; +} +// keep order +for (var key in module.exports.combine.files) { + newFiles[key] = module.exports.combine.files[key]; +} +module.exports.combine.files = newFiles; \ No newline at end of file diff --git a/dist/package.json b/dist/package.json new file mode 100644 index 000000000..d57c2d248 --- /dev/null +++ b/dist/package.json @@ -0,0 +1,25 @@ +{ + "name": "ignite-ui", + "version": "0.0.2-alpha.0", + "description": "Ignite UI by Infragistics", + "homepage": "http://www.igniteui.com/", + "repository": { + "type": "git", + "url": "https://github.com/IgniteUI/ignite-ui.git" + }, + "keywords": [ + "igniteui", + "ignite ui", + "infragistics", + "jquery controls", + "jquery widgets" + ], + "bugs": { + "url": "https://github.com/IgniteUI/ignite-ui/issues" + }, + "license": "Apache-2.0", + "peerDependencies": { + "jquery": "^2.2.4", + "jquery-ui": "^1.10.5" + } +} diff --git a/package.json b/package.json index d1b2bb555..e953feb99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,20 @@ { "name": "ignite-ui", "version": "0.0.1", + "description": "Ignite UI by Infragistics", + "homepage": "http://www.igniteui.com/", + "repository": { + "type": "git", + "url": "https://github.com/IgniteUI/ignite-ui.git" + }, + "keywords": [ + "igniteui", + "ignite ui", + "infragistics", + "jquery controls", + "jquery widgets" + ], + "license": "Apache-2.0", "scripts": { "preinstall": "npm install -g bower", "postinstall" : "npm install -g grunt-cli && bower install" @@ -9,7 +23,10 @@ "devDependencies": { "grunt": "^0.4.5", "grunt-contrib-clean": "^1.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-cssmin": "^1.0.1", "grunt-contrib-jshint": "^1.0.0", + "grunt-contrib-uglify": "^1.0.1", "grunt-coveralls": "^1.0.1", "grunt-jscs": "^3.0.1", "grunt-qunit-istanbul": "^0.6.0"