Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import gulp from 'gulp';
import fs from 'fs-extra';
import runSequence from 'run-sequence';
import conventionalRecommendedBump from 'conventional-recommended-bump';
import changelog from 'conventional-changelog';
import conventionalGithubReleaser from 'conventional-github-releaser';
import githubRemoveAllReleases from 'github-remove-all-releases';
import gulpLoadPlugins from 'gulp-load-plugins';
import paths from '../paths';
const $ = gulpLoadPlugins();
gulp.task('bump', () => {
// We hardcode the version change type to 'patch' but it may be a good idea to
// use minimist (https://www.npmjs.com/package/minimist) to determine with a
// command argument whether you are doing a 'major', 'minor' or a 'patch' change.
// return gulp.src(['./bower.json', './package.json'])
// .pipe(bump({type: "patch"}).on('error', gutil.log))
// .pipe(gulp.dest('./'));
conventionalRecommendedBump({
preset: 'angular'
}, (err, releaseAs) => {
console.log('releaseAs', releaseAs);
console.log('err', err);
gulp.src(paths.package)
// generated on 2016-02-11 using generator-gulp-webapp 1.1.1
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import browserSync from 'browser-sync';
import del from 'del';
import {stream as wiredep} from 'wiredep';
import proxy from 'proxy-middleware';
import rename from 'gulp-rename';
import run from 'gulp-run';
import url from 'url';
const $ = gulpLoadPlugins();
const reload = browserSync.reload;
gulp.task('styles', () => {
return gulp.src('app/styles/*.scss')
.pipe($.plumber())
.pipe($.sourcemaps.init())
.pipe($.sass.sync({
outputStyle: 'expanded',
precision: 10,
includePaths: ['.']
}).on('error', $.sass.logError))
.pipe($.autoprefixer({browsers: ['> 1%', 'last 2 versions', 'Firefox ESR']}))
.pipe($.sourcemaps.write())
.pipe(gulp.dest('.tmp/styles'))
.pipe(reload({stream: true}));
});
// generated on 2016-07-11 using generator-chrome-extension 0.5.6
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import del from 'del';
import runSequence from 'run-sequence';
import { stream as wiredep } from 'wiredep';
import rollup from 'rollup-stream';
import zip from 'gulp-zip';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import npm from 'rollup-plugin-node-resolve';
import source from 'vinyl-source-stream';
import json from 'rollup-plugin-json';
const $ = gulpLoadPlugins();
gulp.task('extras', () => {
return gulp.src([
'app/*.*',
'app/_locales/**',
'!app/scripts.babel',
'!app/*.json',
'!app/*.html',
], {
base: 'app',
dot: true
}).pipe(gulp.dest('dist'));
});
gulp.task('vendor', () => {
return gulp.src([
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import browserSyncLib from 'browser-sync';
import minimist from 'minimist';
import wrench from 'wrench';
import runSequence from 'run-sequence';
import { readFileSync } from 'fs';
import { load as _load } from "js-yaml";
runSequence.options.ignoreUndefinedTasks = true;
const load = _load(readFileSync("./k-task/config.yml"));
const loadSEO = JSON.parse(readFileSync("./seo.json"));
const loadCC = JSON.parse(readFileSync("./concat.json"));
const loadGEN = JSON.parse(readFileSync("./include.json"));
// Global
const plugins = gulpLoadPlugins({ lazy: true });
// Create karma server
import { Server as KarmaServer } from 'karma';
// Create a new browserSync
const defaultNotification = function (err) {
return {
subtitle: err.plugin,
message: err.message,
sound: 'Funk',
onLast: true,
};
};
load.config.concat = loadCC.concat
// generated on 2016-02-20 using generator-chrome-extension 0.5.3
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import del from 'del';
import runSequence from 'run-sequence';
import {
stream as wiredep
}
from 'wiredep';
import webpack from 'webpack-stream';
const $ = gulpLoadPlugins();
gulp.task('extras', () => {
return gulp.src([
'app/*.*',
'app/_locales/**',
'!app/scripts.babel',
'!app/*.json',
'!app/*.html',
], {
base: 'app',
dot: true
}).pipe(gulp.dest('dist'));
});
function lint(files, options) {
return () => {
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import paths from '../paths';
const $ = gulpLoadPlugins();
// // Optimize images
// gulp.task('images', () => {
// return gulp.src(paths.images)
// // .pipe($.cache($.imagemin({
// // progressive: true,
// // interlaced: true
// // })))
// .pipe(gulp.dest(paths.outputImages))
// .pipe($.size({title: 'images'}));
// });
gulp.task('images', () => {
return gulp.src(paths.images)
.pipe($.if($.if.isFile, $.cache($.imagemin({
progressive: true,
interlaced: true,
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import reporter from 'postcss-reporter';
import stylelint from 'stylelint';
import less from 'postcss-less';
const $ = gulpLoadPlugins();
/**
* Run styles through `stylelint`
* @return {stream}
*/
export default function linter() {
return gulp.src('./src/less/**/*.less')
.pipe($.postcss(
[
stylelint(),
reporter({ clearMessages: true }),
],
{
syntax: less,
},
))
import gulp from 'gulp';
import config from '../toolbox.json';
import loadPlugins from 'gulp-load-plugins';
const $ = loadPlugins();
const name = config.iconsFontName;
/*
* Build icons font and stylesheets
*/
const icons = () => {
return gulp.src(`${config.src}icons/**/*.svg`)
.pipe($.iconfont({
fontName: name,
appendCodepoints: true,
normalize: true,
fontHeight: 1001,
}))
.on('glyphs', (glyphs) => {
gulp.src('node_modules/toolbox-utils/templates/_icons.scss')
import persistify from 'persistify';
import runSequence from 'run-sequence';
import source from 'vinyl-source-stream';
import basename from 'basename';
import readJsonSync from 'read-json-sync';
const appify = (s, browserifyArgs = {}, babelArgs = {}) => browserify(browserifyArgs)
.transform('babelify', Object.assign(babelArgs, readJsonSync('.babelrc')))
.bundle()
.pipe(source(s)).pipe(buffer())
.pipe($.babel({
babelrc: false,
presets: ['es2015', 'stage-0']
}));
const $ = gulpLoadPlugins();
const reload = browserSync.reload;
const dist = 'Server/web';
const src = 'src';
const plugins = `${src}/plugins`;
const extensions = './extensions';
const vendors = 'bower_components';
const PRODUCTION = typeof $.util.env.production !== 'undefined' ? true : false;
const DEVEL = !PRODUCTION;
const PREPROCESSOR_CONTEXT = {
context: {
CONTEXT: PRODUCTION ? 'PRODUCTION' : 'DEVELOPMENT'
}
};
const externalJsSources = [
import path from 'path'
import gulp from 'gulp'
import gulpLoadPlugins from 'gulp-load-plugins'
import config from '../../config'
import common from '../common'
import detectConflict from '../utils/detectConflict'
const $ = gulpLoadPlugins()
const isDev = config.get('mode') !== 'production'
export default function templates() {
return gulp
.src(config.get('srcPaths.pages'), {
base: path.join(config.get('srcDir'), config.get('dir.pages'))
})
.pipe(
$.data(file => ({
site: config.getProperties().site,
page: {
path: path
.join(
'/',
config.get('site.basePath'),
file.relative.replace(/\.[^.]+$/, '.html')