Introducing RaveJS. Rave eliminates configuration, machinery, and complexity. Stop configuring and tweaking file watchers, minifiers, and transpilers just to get to a runnable app. Instead, go from zero to "hello world" in 30 seconds. In the next 30 seconds, easily add capabilities and frameworks to your application simply by installing *Rave Extensions* and *Rave Starter* packages from npm and Bower, the leading JavaScript package managers. Finally, install additional *Rave Extension* packages to apply your favorite build, deploy, and testing patterns.
https://github.com/RaveJS
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
// Time how long tasks take. Can help when optimizing build times require('time-grunt')(grunt);
// Define the configuration for all the tasks grunt.initConfig({
// Project settings xd: { app: 'app', dist: 'dist' }, // Set bower task's targetDir to use app directory bower: { options: { targetDir: '<%= xd.app %>/lib' }, // Provide install target install: {} }, // Watches files for changes and runs tasks based on the changed files watch: { files: ['<%= xd.app %>/**/*', '*.js', '.jshintrc'], tasks: ['build'], livereload: { options: { livereload: '<%= connect.options.livereload %>' }, files: ['<%= xd.app %>/**/*', '*.js', '.jshintrc'] } }, protractor: { options: {
//configFile: "test/protractor.conf.js", // Default config file keepAlive: true, // If false, the grunt process stops when the test fails. noColor: false, // If true, protractor will not use colors in its output. args: { specs: [ './test/e2e/**/*.spec.js' ], baseUrl: 'http://localhost:8000', chromeDriver: 'node_modules/protractor/selenium/chromedriver' } }, run: { } }, // The actual grunt server settings connect: { options: { port: 8000, // Set to '0.0.0.0' to access the server from outside. hostname: '0.0.0.0', livereload: 35729 }, livereload: { options: { open: true, base: [ '.tmp', '<%= xd.app %>' ], middleware: function (connect, options) {
if (!Array.isArray(options.base)) { options.base = [options.base]; } var middlewares = [require('grunt-connect-proxy/lib/utils').proxyRequest];
// Make sure code styles are up to par and there are no obvious mistakes jshint: { options: { jshintrc: '.jshintrc', reporter: require('jshint-stylish') }, all: [ 'Gruntfile.js', '<%= xd.app %>/scripts/{,**/}*.js' ], test: { options: { jshintrc: 'test/.jshintrc' },
// Reads HTML for usemin blocks to enable smart builds that automatically // concat, minify and revision files. Creates configurations in memory so // additional tasks can operate on them useminPrepare: { html: '<%= xd.app %>/index.html', options: { dest: '<%= xd.dist %>' } },
// Performs rewrites based on rev and the useminPrepare configuration usemin: { html: ['<%= xd.dist %>/{,*/}*.html'], css: ['<%= xd.dist %>/styles/{,*/}*.css'], options: { assetsDirs: ['<%= xd.dist %>', '<%= xd.dist %>/images'] } },
htmlmin: { dist: { options: { collapseWhitespace: true, collapseBooleanAttributes: true, removeCommentsFromCDATA: true, removeOptionalTags: true }, files: [ { expand: true, cwd: '<%= xd.dist %>', src: ['*.html', 'views/{,*/}*.html'], dest: '<%= xd.dist %>' } ] } }, // Allow the use of non-minsafe AngularJS files. Automatically makes it // minsafe compatible so Uglify does not destroy the ng references// ngmin: {// dist: {// files: [// {// expand: true,// cwd: '.tmp/concat/js',// src: '*.js',// dest: '.tmp/concat/js'// }// ]// }
// }, // Copies remaining files to places other tasks can use copy: { dist: { files: [ { expand: true, dot: true, cwd: '<%= xd.app %>', dest: '<%= xd.dist %>', src: [ '*.{ico,png,txt}', '*.html', 'views/{,*/}*.html', 'lib/**/*', 'scripts/**/*', 'fonts/*', 'images/*' ] } ] }, styles: { expand: true, cwd: '<%= xd.app %>/styles', dest: '.tmp/styles/', src: '{,*/}*.css' }, testfiles: { files: [ { src: 'test/people.txt', dest: '/tmp/xd-tests/people.txt' } ] } }, // Run some tasks in parallel to speed up the build process concurrent: { server: [ 'copy:styles' ], test: [ 'copy:styles' ], dist: [ // TODO: copy:styles copies .css files into .tmp // TODO: hence probably not to include copy:styles in here. // 'copy:styles'
// Continuous Integration mode // if true, it capture browsers, run tests and exit singleRun: true,
// Uncomment the following lines if you are using grunt's server to run the tests proxies: { '/': 'http://localhost:8000/' }, // // URL root prevent conflicts with the site root urlRoot: '/_karma_/' });};module.exports = function (config) { 'use strict'; config.set({ // base path, that will be used to resolve files and exclude basePath: '',
// testing framework to use (jasmine/mocha/qunit/...) frameworks: ['jasmine'],
// list of files / patterns to load in the browser files: [ 'app/lib/angular/angular.js', 'app/lib/angular-mocks/angular-mocks.js', 'app/lib/angular-resource/angular-resource.js', 'app/lib/angular-cookies/angular-cookies.js', 'app/lib/angular-sanitize/angular-sanitize.js', 'app/lib/angular-route/angular-route.js', 'app/lib/angular-ui-router/angular-ui-router.js', 'app/lib/angular-growl/angular-growl.js', 'app/lib/angular-promise-tracker/promise-tracker.js', 'app/lib/angular-busy/angular-busy.js', 'app/scripts/*.js', 'app/scripts/**/*.js', 'test/spec/**/*.js', 'test/test-main.js' ],
// list of files / patterns to exclude
exclude: [],
// web server port port: 7070,
// level of logging // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes autoWatch: true,