Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function vueBindingsEsm() {
const babelrc = Object.assign({}, corePkg.babel);
babelrc.babelrc = babelrc.presets[0][1].modules = false;
babelrc.plugins = [
'external-helpers',
'transform-runtime',
];
// ES Modules (transpiled ES source codes)
return mergeStream(
gulp.src([
'src/**/*.js',
'!src/*.js',
])
.pipe($.babel(babelrc))
.pipe(gulp.dest('esm/')),
// Compile Vue components
gulp.src([
'src/**/*.vue',
])
.pipe($.vueCompiler({
babel: babelrc,
newExtension: 'js',
}))
.pipe(gulp.dest('esm/'))
export const buildAdminCss = function buildAdminCss() {
const copyStream = merge(
gulp.src(upath.joinSafe(nodeModulesPath, 'semantic-ui-css/themes/**/*'))
.pipe(gulp.dest(upath.joinSafe(adminRootPath, 'css/themes'))),
);
const cssStream = gulp.src(paths.admin.css, { base: './' })
.pipe(gulpif(options.sourcemaps, sourcemaps.init()))
.pipe(concat('css-files.css'));
const sassStream = gulp.src(paths.admin.sass, { base: './' })
.pipe(gulpif(options.sourcemaps, sourcemaps.init()))
.pipe(sass())
.pipe(concat('sass-files.scss'));
return merge(
copyStream,
merge(cssStream, sassStream)
.pipe($.sass({ sourceComments: true, includePaths: ['www/static/css/common', 'node_modules'] }).on('error', $.sass.logError))
.pipe($.autoprefixer({browsers: AUTOPREFIXER_BROWSERS.slice(0, 1)}))
.pipe($.concat(dist))
.pipe(gulp.dest('.tmp'))
.pipe($.sourcemaps.write('.', {includeContent: true, sourceRoot: '/static/css/admin'}))
.pipe(gulp.dest(webDist))
.pipe($.size({title: 'web styles'}))
: src
.pipe($.sass({ outputStyle: 'compressed', includePaths: ['www/static/css/common', 'node_modules'] }).on('error', $.sass.logError))
.pipe($.autoprefixer({browsers: AUTOPREFIXER_BROWSERS}))
.pipe($.concat(dist))
.pipe(gulp.dest(webDist))
.pipe($.size({title: 'web styles'}));
}
return merge(
compile(gulp.src(['www/static/css/admin/**/*.{css,scss}']), 'admin.css'),
compile(gulp.src(['www/static/css/web/**/*.{css,scss}']), 'web.css')
);
});
gulp.task('zip', () =>
merge(
globby.sync(['dist/*', '!dist/zip']).map(dir =>
gulp.src(path.join(dir, '**/*'))
.pipe(zip(`${path.basename(dir)}.zip`))
.pipe(gulp.dest('dist/zip'))
)
)
);
gulp.task('css-build-variables-and-mixins-package', function() {
return mergeStream(
gulp.src(['src/pivotal-ui/components/pui-variables.scss', 'src/pivotal-ui/components/mixins.scss']),
gulp.src(['PUI_VARIABLES_AND_MIXINS_README.md'])
.pipe(plugins.rename({basename: 'README'})),
plugins.file('package.json', JSON.stringify({
name: 'pui-css-variables-and-mixins',
version: require('../package.json').version,
repository: {
type: 'git',
url: 'https://github.com/pivotal-cf/pivotal-ui.git'
},
keywords: [
'pivotal ui',
'pivotal ui modularized'
],
author: 'Pivotal Software, Inc',
bugs: {
const publisher = awspublish.create(awsConf.keys);
const unrevisionedHeaders = {
...awsConf.headers,
'Cache-Control': 'max-age=0;smax-age=0;must-revalidate;'
};
const versioned = gulp.src(['./build/**/*', '!./build/index.html'])
.pipe(awspublish.gzip({ ext: '' }))
.pipe(parallelize(publisher.publish(awsConf.headers), 100));
const unversioned = gulp.src('./build/index.html')
.pipe(awspublish.gzip({ ext: '' }))
.pipe(parallelize(publisher.publish(unrevisionedHeaders), 100));
return merge(versioned, unversioned)
.pipe(publisher.sync())
.pipe(awspublish.reporter())
.pipe(gulpif(!!awsConf.keys.distribution, invalidate(awsConf.keys)));
});
function banners(done) {
const year = new Date().getFullYear();
const fullDate = new Date().toLocaleDateString('en-US');
const opts = {pkgJson, year, fullDate};
if (isProdBuild() && generateBanners) {
return merge(
gulp.src(settings.destinations.prod.app + '**/*.js')
.pipe(gulpBanner(banner, opts))
.pipe(gulp.dest(settings.destinations.prod.app)),
gulp.src(settings.destinations.prod.styles + '**/*.css')
.pipe(gulpBanner(banner, opts))
.pipe(gulp.dest(settings.destinations.prod.styles)),
gulp.src(settings.destinations.prod.libs + '*.js')
.pipe(gulpBanner(banner, opts))
.pipe(gulp.dest(settings.destinations.prod.libs)),
gulp.src(settings.destinations.prod.libs + '*.css')
.pipe(gulpBanner(banner, opts))
.pipe(gulp.dest(settings.destinations.prod.libs))
);
}
done();
}
gulp.task('sprite:inline-svg', () => {
var folders = getFolders(paths.srcImg + 'sprite-svg');
var tasks = folders.map((folder) => {
return gulp.src(path.join(paths.srcImg + 'sprite-svg', folder, '/*.svg'))
.pipe(svgSprite({
dest: './',
mode: { symbol: { dest: './' } }
}))
.pipe(rename({
basename: 'symbol',
dirname: './',
prefix: 'sprite-' + folder + '.'
}))
.pipe(gulp.dest(paths.destImg));
});
return merge(tasks);
});
}
];
const scriptsStreams = scriptsfiles.map((file) => {
return gulp
.src([file.dest+'*.js', '!'+file.dest+'*.esm.js', '!'+file.dest+'*.min.js'])
.pipe(rename(function(file) {
if (file.basename == paths.scripts.main) {
file.basename += '.min';
}
}))
.pipe(uglify())
.pipe(gulp.dest(file.dest));
});
return merge(scriptsStreams);
}
.pipe($.frontMatter({
property: 'page',
remove: true
}))
.pipe($.marked())
.pipe((() => {
return through.obj((file, enc, cb) => {
file.page.component = component;
cb(null, file);
});
})())
.pipe(applyTemplate())
.pipe(gulp.dest(path.join('dist', 'components', component)));
});
return mergeStream(tasks);
});