Example #1
0
  makeBox: function () {
    var destDir = this.destinationPath(this.appname);
    nfs.mkdirSync(destDir);
    this.data.site_folder = this.data.hostname;
    this.data.db_name = this.data.hostname.replace(/[-\.]/g, '_');
    this.data.appname = this.appname;
    var tsFilter = filter(['**/*.json'], {restore: true});

    this.registerTransformStream(tsFilter);
    this.registerTransformStream(beautify({
      indentSize: 2
    }));
    this.registerTransformStream(tsFilter.restore);
    this.fs.copyTpl(
      this.templatePath('box/**/*'),
      this.destinationPath(this.appname),
      this.data
    );
    this.fs.copyTpl(
      this.templatePath('box/www/.hosts'),
      this.destinationPath(this.appname + '/www/.hosts'),
      this.data);
    this.sourceRoot(this.sourceRoot() + '/../../templates');
    this.fs.copyTpl(
      this.templatePath('shared'),
      this.destinationPath(this.appname + '/www/' + this.data.hostname),
      this.data);
  }
Example #2
0
gulp.task('parallel', function (cb) {

    console.log("Building parallel modules..".yellow);

    // Clean the output
    gulp.src('./dist/' + distfolder, {read: false})
        .pipe(clean());
    gulp.src('./dist/*.*', {read: false})
        .pipe(clean());

    // Build the Answers Module Loader
    gulp.src('./src/answermodule/**/*.*')
        .pipe(concat('answermodule.js'))
        .pipe(header(fs.readFileSync('./config/config.js')))
        .pipe(header('(function() {'))
        .pipe(footer('})()'))
        .pipe(beautify())
        .pipe(gulp.dest('./dist/' + fixturesfolder));

    var modules = ["foreseecxreplay", "foreseetrigger", "webcollage", "youtube"];
    for (var modl in modules) {
        buildDiscreteModule(modules[modl]);
    }

    // Copy assets and start the web server
    gulp.src('./assets/*.*')
        .pipe(gulp.dest('./dist/' + fixturesfolder))
        .pipe(ws.go(3131, './dist', true));

    cb();
});
Example #3
0
  writing() {
    this.registerTransformStream(beautify({
      indentSize: 2
    }));

    moduleBuilder.createMongoModelFile(this);
  }
Example #4
0
gulp.task('beautify', function () {
  var beautify = require('gulp-beautify');

  return gulp.src(jsFiles)
    .pipe(beautify({indentSize: 2, keepArrayIndentation: true}))
    .pipe(gulp.dest('./src/files/assets/js/'));
});
Example #5
0
gulp.task('beautify', function () {
  var beautify = require('gulp-beautify');

  gulp.src(paths.scripts)
    .pipe(beautify())
    .pipe(gulp.dest(paths.scriptsRoot));
});
var copySupportFilesInFolder = function(folder) {
    return gulp
        .src(paths.src + folder + '*')
        .pipe(beautify(beauty))
        .pipe(gulp.dest(paths.dist.dev + folder))
        .pipe(uglify())
        .pipe(gulp.dest(paths.dist.prod + folder))
};
Example #7
0
gulp.task('js-ng-app', ['tmpls'], function () {
    return gulp.src(['src/**/*module.js', '!src/lib/**', '!src/app.js'])
    .pipe(add.append(['src/**/*.js', '!src/**/*module.js', '!src/lib/**', '!src/app.js']))
    .pipe(concat('ng.js'))
    .pipe(_if(isProduction, uglify(), beautify()))
    .pipe(rename({suffix: '.min'}))
    .pipe(gulp.dest('dest/assets/js'));
});
Example #8
0
gulp.task('beautifyScripts', function() {
  return gulp.src('./src/js/**/*.js')
    .pipe(jsbeautify({
      indent_size: 2,
      end_with_newline: true
    }))
    .pipe(gulp.dest('./src/js/'));
});
Example #9
0
gulp.task('js-ng-app', ['tmpls'], function () {
    return gulp.src(config.paths.src.js)
    .pipe(angularFilesort())
    .pipe(concat('custom.js'))
    .pipe(_if(isProd, uglify(), beautify()))
    .pipe(rename({suffix: '.min'}))
    .pipe(gulp.dest(config.paths.dest.js));
});
Example #10
0
var buildDiscreteModule = function(modulename) {

    console.log(("Building " + modulename + "...").yellow);
    gulp.src('./src/modules/' + modulename + '/**/*.*')
        .pipe(concat(modulename + '.js'))
        .pipe(beautify())
        .pipe(gulp.dest('./dist/' + distfolder));
};
gulp.task('scripts', ['clean:scripts'], function() {
    return gulp
        .src(config.scripts)
        .pipe(cache(config.jsCache))
        .pipe(ngAnnotate())
        .pipe(wrapper(config.wrapper))
        .pipe(beautify({indentSize: config.indentSize}))
        .pipe(gulp.dest(config.build));
});
gulp.task('rebuild-scripts', function() {
    return gulp
        .src(config.scripts)
        .pipe(cache('jsscripts'))
        .pipe(ngAnnotate())
        .pipe(wrapper(config.wrapper))
        .pipe(beautify({indentSize: config.indentSize}))
        .pipe(gulp.dest(config.build));
});
Example #13
0
gulp.task('js-lib', function () {
  return gulp.src(['src/app.js'])
    .pipe(browserify({
        debug: true,
        insertGlobals: true
    }))
    .pipe(_if(isProduction, uglify(), beautify()))
    .pipe(rename('libs.min.js'))
    .pipe(gulp.dest('dest/assets/js'));
});
Example #14
0
gulp.task('js-lib', function () {
  return gulp.src(config.paths.src.appjs)
    .pipe(browserify({
        debug: true,
        insertGlobals: true
    }))
    .pipe(_if(isProd, uglify(), beautify()))
    .pipe(rename('libs.min.js'))
    .pipe(gulp.dest(config.paths.dest.js));
});
Example #15
0
gulp.task('beautify:javascript', function() {
    gulp.src(js, {
            base: './'
        })
        .pipe(beautify({
            indentSize: 4,
            keepFunctionIndentation: true
        }))
        .pipe(gulp.dest('./'));
});
gulp.task('beautify', function() {
  console.log('Beautifying source with indent level 3');
  return gulp
    .src(['!browser/**/*bundle.js', '!examples/**/*bundle.js', 'browser/**/*.js','common/**/*.js','examples/**/*.js', 'device/**/*.js','thing/*.js','index.js', '!node_modules/**/*.js', '!examples/**/node_modules/**/*.js', '!browser/**/*bundle.js', '!examples/browser/**/*bundle.js'])
    .pipe(beautify({'indent_size':3, 'indent_char': ' ', 'end_with_newline': true}))
//
// Replace the files in-place with the beautified versions.
//
    .pipe(gulp.dest( function(vinylFile) { console.log('Beautifying \''+vinylFile.path+'\'...'); return vinylFile.base; }));
});
Example #17
0
gulp.task('build'  , function ( ) {
  return gulp.src (src + '/_class.js')
             .pipe(jshint())
             .pipe(jshint.reporter('default'))
             .pipe(beautify({ indentSize: 2 }))
             .pipe(gulp.dest(dist))
             .pipe(uglify())
             .pipe(rename({ suffix: '.min' }))
             .pipe(gulp.dest(dist));
});
Example #18
0
gulp.task('js:ckeditor:beautify', function() {
	var beautify = require('gulp-beautify');
	return gulp.src(cfg.paths.static + 'ckeditor/ckeditor.js')
		.pipe(beautify({
			'indentSize': 2
		}))
		.pipe(rename('ckeditor.beautify.js'))
		.pipe(eol('\n', true))
		.pipe(gulp.dest(cfg.paths.static + 'ckeditor/'));
});
Example #19
0
gulp.task('build-bower', function () {
  gulp.src('src/dot-object.js')
    .pipe(hf.header('src/header.tpl'))
    .pipe(hf.footer('src/footer.tpl'))
    .pipe(beautify({indentSize: 2}))
    .pipe(gulp.dest(DEST))
    .pipe(uglify())
    .pipe(rename({extname: '.min.js'}))
    .pipe(gulp.dest(DEST))
})
Example #20
0
gulp.task('scripts', function() {
	return gulp.src("./src/javascript/**/*.js")
	.pipe(concat('jsBundle.js'))
	.pipe(beautify({indentSize: 4, indentChar : ' '}))
	.pipe(gulp.dest("./dist/js/"))
	.pipe(rename({suffix: ".min"}))
	.pipe(ngAnnotate())
	.pipe(uglify())
	.pipe(gulp.dest('./dist/js/'))
	.pipe(notify({message:"Minified JS, And Bundled."}));
});
Example #21
0
gulp.task('scripts', function() {
  return gulp.src(paths.scripts)
    .pipe(plumber())
    .pipe(cached('scripts'))
    .pipe(gulpif(source_maps, sourcemaps.init()))
    .pipe(babel({
        plugins: ['transform-es2015-modules-amd']
    }))
    .pipe(gulpif(dev_mode, beautify(), uglify()))
    .pipe(gulpif(source_maps, sourcemaps.write('../maps/')))
    .pipe(gulp.dest('../static/scripts/'));
});
Example #22
0
gulp.task("combine", function() {
    gulp.src(["./src/conduit.js"])
        .pipe(header(banner, { pkg : pkg }))
        .pipe(fileImports())
        .pipe(hintNot())
        .pipe(beautify({ indentSize: 4, preserveNewlines: false }))
        .pipe(rename("conduitjs.js"))
        .pipe(gulp.dest("./lib/"))
        .pipe(uglify({ compress: { negate_iife: false }}))
        .pipe(header(banner, { pkg : pkg }))
        .pipe(rename("conduitjs.min.js"))
        .pipe(gulp.dest("./lib/"));
});
Example #23
0
gulp.task('umd', function() {
  return gulp.src('./src/core/*.js')
    .pipe(umd({
      exports: function(file) {
          return 'lend';
        },
        namespace: function(file) {
          return 'lend';
        }
    }))
    .pipe(beautify({indentSize: 4}))
    .pipe(gulp.dest('build'));
});
Example #24
0
gulp.task('build', function () {
    gulp.src('src/*.js')
        .pipe(depsOrder())
        .pipe(concat('build.js', {newLine: '\n\n'}))
        .pipe(insert.wrap(prepend, append))
        .pipe(header(banner, { pkg : pkg }))
        .pipe(beautify())
        .pipe(gulp.dest('dest'))
        .pipe(uglify())
        .pipe(header(banner, { pkg : pkg }))
        .pipe(rename('build.min.js'))
        .pipe(gulp.dest('dest'))
        .on('error', gutil.log);
});
Example #25
0
gulp.task('build', function () {
  gulp.src([
    'script/start.js',
    'script/util.js',
    'script/loader.js',
    'script/auto_statistics.js',
    'script/end.js'
  ]).pipe(concat('loader.js'))
    .pipe(beautify({ indentSize: 2 }))
    .pipe(gulp.dest('dist'))
    .pipe(uglify())
    .pipe(rename('loader.min.js'))
    .pipe(gulp.dest('dist'));
});
Example #26
0
gulp.task('build', function() {

    gulp.src(sources)
        .pipe(replace({
            patterns: [
                {
                    match: new RegExp(
                        '(\\/)(.)(.)(\\s+)(.)(\\s+)(.)(\\s+)' +
                        '((?:[a-z][a-z]+))(\\s+)((?:[a-z][a-z]+))(.)' +
                        '(\\s+)(\\d+)([-+]\\d+)(\\s+)(.)(\\s+)' +
                        '((?:[a-z][a-z]+))(.)(\\s+)' +
                        '((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s"]*))' +
                        '(\\s+)(.)(\\s+)((?:[a-z][a-z]+))(.)(\\s+)' +
                        '([\\w-+]+(?:\\.[\\w-+]+)*@(?:[\\w-]+\\.)+[a-zA-Z]{2,7})' +
                        '(\\s+)(.)(.)'
                        ,["i"]),
                    replacement: ''
                }
            ]
        }))
        .pipe(sourcemaps.init())
        .pipe(concat('whitestorm.js'))
        .pipe(babel({
            presets: ['es2015']
        }))
        .pipe(beautify())
        .pipe(insert.prepend(author_comment))
        .pipe(gulp.dest('./build/'));

    gulp.src(sources_test)
        .pipe(concat("whitestorm.test.js"))
        .pipe(babel({
            presets: ['es2015']
        }))
        .pipe(insert.prepend(lib_includes))
        .pipe(uglify())
        .pipe(insert.prepend(author_comment))
        .pipe(gulp.dest("./build/"));

    gulp.src(sources)
        .pipe(concat('whitestorm.min.js'))
        .pipe(babel({
            presets: ['es2015']
        }))
        .pipe(uglify())
        .pipe(insert.prepend(author_comment))
        .pipe(gulp.dest('./build/'));

});
Example #27
0
 return function() {
   return pipe(
     src(file, opt),
     gulpif(/\.css$/, plugin.cssParser(options)), // 这里不替换 debug
     gulpif(/\.css$/, cssmin()),
     gulpif(/\.css$/, plugin.css2jsParser(opt)),
     gulpif(/\.tpl$/, plugin.tplParser(opt)),
     gulpif(/\.json$/, plugin.jsonParser(opt)),
     gulpif(/\.handlebars$/, plugin.handlebarsParser(opt)),
     gulpif(/\.js$/, plugin.jsParser(opt)),
     concat(),
     beautify({indentSize: 2}),
     gulp.dest(dest)
   );
 };
Example #28
0
gulp.task('beautify', function() {
    return gulp.src(routes.scripts.js)
        .pipe(beautify({indentSize: 4}))
        .pipe(plumber({
            errorHandler: notify.onError({
                title: "Error: Beautify failed.",
                message:"<%= error.message %>"
            })
        }))
        .pipe(gulp.dest(routes.scripts.base))
        .pipe(notify({
            title: 'JS Beautified!',
            message: 'beautify task completed.'
        }));
});
Example #29
0
gulp.task('copy-templates', function () {
    gulp.src(src.template)
        .pipe(htmlMinify({ empty: true }))
        .pipe(templateCache({
            module: packageName + '.templates',
            standalone: true,
            transformUrl: function (url) {
                return url.replace(/\.tpl\.html$/, '.html');
            }
        }))
        .pipe(beautify({ indentSize: 2 }))
        .pipe(gulp.dest(dist.template))
        .pipe(uglify())
        .pipe(rename({ suffix: '.min' }))
        .pipe(gulp.dest(dist.template));
});
Example #30
0
        .pipe(sn.waitForCallback(function() {

            var basefile = fs.readFileSync('./dist/answermodule.js', 'utf-8');

            gulp.src('./dist/answermodule.js', {read: false})
                .pipe(clean());

            // Build the Answers Module Loader
            gulp.src('./src/modules/**/*.*')
                .pipe(concat('answermodule.js'))
                .pipe(header(basefile))
                .pipe(header('(function() {'))
                .pipe(footer('})()'))
                .pipe(beautify())
                .pipe(gulp.dest('./dist/' + fixturesfolder))
                .pipe(ws.go(3131, './dist', true));
        }))