How to use globs method in stryker-parent

Best JavaScript code snippet using stryker-parent

internal.js

Source:internal.js Github

copy

Full Screen

1/*******************************2 Internal Task Collection3*******************************/4/* These tasks create packaged files from **dist** components5 Not intended to be called directly by a user because6 these do not build fresh from **src**7*/8module.exports = function(gulp) {9 var10 // node dependencies11 fs = require('fs'),12 chmod = require('gulp-chmod'),13 concat = require('gulp-concat'),14 concatCSS = require('gulp-concat-css'),15 clone = require('gulp-clone'),16 dedupe = require('gulp-dedupe'),17 gulpif = require('gulp-if'),18 header = require('gulp-header'),19 less = require('gulp-less'),20 minifyCSS = require('gulp-clean-css'),21 plumber = require('gulp-plumber'),22 print = require('gulp-print'),23 rename = require('gulp-rename'),24 replace = require('gulp-replace'),25 uglify = require('gulp-uglify'),26 // user config27 config = require('./../config/user'),28 docsConfig = require('./../config/docs'),29 // install config30 tasks = require('./../config/tasks'),31 release = require('./../config/project/release'),32 // shorthand33 globs = config.globs,34 assets = config.paths.assets,35 output = config.paths.output,36 banner = tasks.banner,37 filenames = tasks.filenames,38 log = tasks.log,39 settings = tasks.settings40 ;41 /*--------------42 Packaged43 ---------------*/44 gulp.task('package uncompressed css', function() {45 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignored + '.css')46 .pipe(plumber())47 .pipe(dedupe())48 .pipe(replace(assets.uncompressed, assets.packaged))49 .pipe(concatCSS(filenames.concatenatedCSS, settings.concatCSS))50 .pipe(gulpif(config.hasPermission, chmod(config.permission)))51 .pipe(header(banner, settings.header))52 .pipe(gulp.dest(output.packaged))53 .pipe(print(log.created))54 ;55 });56 gulp.task('package compressed css', function() {57 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignored + '.css')58 .pipe(plumber())59 .pipe(dedupe())60 .pipe(replace(assets.uncompressed, assets.packaged))61 .pipe(concatCSS(filenames.concatenatedMinifiedCSS, settings.concatCSS))62 .pipe(gulpif(config.hasPermission, chmod(config.permission)))63 .pipe(minifyCSS(settings.concatMinify))64 .pipe(header(banner, settings.header))65 .pipe(gulp.dest(output.packaged))66 .pipe(print(log.created))67 ;68 });69 gulp.task('package uncompressed js', function() {70 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignored + '.js')71 .pipe(plumber())72 .pipe(dedupe())73 .pipe(replace(assets.uncompressed, assets.packaged))74 .pipe(concat(filenames.concatenatedJS))75 .pipe(header(banner, settings.header))76 .pipe(gulpif(config.hasPermission, chmod(config.permission)))77 .pipe(gulp.dest(output.packaged))78 .pipe(print(log.created))79 ;80 });81 gulp.task('package compressed js', function() {82 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignored + '.js')83 .pipe(plumber())84 .pipe(dedupe())85 .pipe(replace(assets.uncompressed, assets.packaged))86 .pipe(concat(filenames.concatenatedMinifiedJS))87 .pipe(uglify(settings.concatUglify))88 .pipe(header(banner, settings.header))89 .pipe(gulpif(config.hasPermission, chmod(config.permission)))90 .pipe(gulp.dest(output.packaged))91 .pipe(print(log.created))92 ;93 });94 /*--------------95 RTL96 ---------------*/97 if(config.rtl) {98 gulp.task('package uncompressed rtl css', function () {99 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignoredRTL + '.rtl.css')100 .pipe(dedupe())101 .pipe(replace(assets.uncompressed, assets.packaged))102 .pipe(concatCSS(filenames.concatenatedRTLCSS, settings.concatCSS))103 .pipe(gulpif(config.hasPermission, chmod(config.permission)))104 .pipe(header(banner, settings.header))105 .pipe(gulp.dest(output.packaged))106 .pipe(print(log.created))107 ;108 });109 gulp.task('package compressed rtl css', function () {110 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignoredRTL + '.rtl.css')111 .pipe(dedupe())112 .pipe(replace(assets.uncompressed, assets.packaged))113 .pipe(concatCSS(filenames.concatenatedMinifiedRTLCSS, settings.concatCSS))114 .pipe(gulpif(config.hasPermission, chmod(config.permission)))115 .pipe(minifyCSS(settings.concatMinify))116 .pipe(header(banner, settings.header))117 .pipe(gulp.dest(output.packaged))118 .pipe(print(log.created))119 ;120 });121 gulp.task('package uncompressed docs css', function() {122 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignored + '.css')123 .pipe(dedupe())124 .pipe(plumber())125 .pipe(replace(assets.uncompressed, assets.packaged))126 .pipe(concatCSS(filenames.concatenatedCSS, settings.concatCSS))127 .pipe(gulpif(config.hasPermission, chmod(config.permission)))128 .pipe(gulp.dest(output.packaged))129 .pipe(print(log.created))130 ;131 });132 gulp.task('package compressed docs css', function() {133 return gulp.src(output.uncompressed + '/**/' + globs.components + globs.ignored + '.css')134 .pipe(dedupe())135 .pipe(plumber())136 .pipe(replace(assets.uncompressed, assets.packaged))137 .pipe(concatCSS(filenames.concatenatedMinifiedCSS, settings.concatCSS))138 .pipe(minifyCSS(settings.concatMinify))139 .pipe(header(banner, settings.header))140 .pipe(gulpif(config.hasPermission, chmod(config.permission)))141 .pipe(gulp.dest(output.packaged))142 .pipe(print(log.created))143 ;144 });145 }146 /*--------------147 Docs148 ---------------*/149 var150 docsOutput = docsConfig.paths.output151 ;152 gulp.task('package uncompressed docs css', function() {153 return gulp.src(docsOutput.uncompressed + '/**/' + globs.components + globs.ignored + '.css')154 .pipe(dedupe())155 .pipe(plumber())156 .pipe(replace(assets.uncompressed, assets.packaged))157 .pipe(concatCSS(filenames.concatenatedCSS, settings.concatCSS))158 .pipe(gulpif(config.hasPermission, chmod(config.permission)))159 .pipe(gulp.dest(docsOutput.packaged))160 .pipe(print(log.created))161 ;162 });163 gulp.task('package compressed docs css', function() {164 return gulp.src(docsOutput.uncompressed + '/**/' + globs.components + globs.ignored + '.css')165 .pipe(dedupe())166 .pipe(plumber())167 .pipe(replace(assets.uncompressed, assets.packaged))168 .pipe(concatCSS(filenames.concatenatedMinifiedCSS, settings.concatCSS))169 .pipe(minifyCSS(settings.concatMinify))170 .pipe(header(banner, settings.header))171 .pipe(gulpif(config.hasPermission, chmod(config.permission)))172 .pipe(gulp.dest(docsOutput.packaged))173 .pipe(print(log.created))174 ;175 });176 gulp.task('package uncompressed docs js', function() {177 return gulp.src(docsOutput.uncompressed + '/**/' + globs.components + globs.ignored + '.js')178 .pipe(dedupe())179 .pipe(plumber())180 .pipe(replace(assets.uncompressed, assets.packaged))181 .pipe(concat(filenames.concatenatedJS))182 .pipe(header(banner, settings.header))183 .pipe(gulpif(config.hasPermission, chmod(config.permission)))184 .pipe(gulp.dest(docsOutput.packaged))185 .pipe(print(log.created))186 ;187 });188 gulp.task('package compressed docs js', function() {189 return gulp.src(docsOutput.uncompressed + '/**/' + globs.components + globs.ignored + '.js')190 .pipe(dedupe())191 .pipe(plumber())192 .pipe(replace(assets.uncompressed, assets.packaged))193 .pipe(concat(filenames.concatenatedMinifiedJS))194 .pipe(uglify(settings.concatUglify))195 .pipe(header(banner, settings.header))196 .pipe(gulpif(config.hasPermission, chmod(config.permission)))197 .pipe(gulp.dest(docsOutput.packaged))198 .pipe(print(log.created))199 ;200 });...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

1'use strict';2const assign = require('object-assign');3const path = require('path');4const PluginError = require('plugin-error');5const fancyLog = require('fancy-log');6const colors = require('ansi-colors');7const chokidar = require('chokidar');8const Duplex = require('readable-stream').Duplex;9const vinyl = require('vinyl-file');10const File = require('vinyl');11const anymatch = require('anymatch');12const globParent = require('glob-parent');13const normalize = require('normalize-path');14function normalizeGlobs(globs) {15 if (!globs) {16 throw new PluginError('gulp-watch', 'glob argument required');17 }18 if (typeof globs === 'string') {19 globs = [globs];20 }21 if (!Array.isArray(globs)) {22 throw new PluginError('gulp-watch', 'glob should be String or Array, not ' + (typeof globs));23 }24 return globs;25}26function watch(globs, options, cb) {27 const originalGlobs = globs;28 globs = normalizeGlobs(globs);29 if (typeof options === 'function') {30 cb = options;31 options = {};32 }33 options = assign({}, watch._defaultOptions, options);34 cb = cb || function () {};35 function resolveFilepath(filepath) {36 if (path.isAbsolute(filepath)) {37 return path.normalize(filepath);38 }39 return path.resolve(options.cwd || process.cwd(), filepath);40 }41 function resolveGlob(glob) {42 let mod = '';43 if (glob[0] === '!') {44 mod = glob[0];45 glob = glob.slice(1);46 }47 return mod + normalize(resolveFilepath(glob));48 }49 globs = globs.map(glob => resolveGlob(glob));50 const baseForced = Boolean(options.base);51 const outputStream = new Duplex({objectMode: true, allowHalfOpen: true});52 outputStream._write = function (file, enc, done) {53 cb(file);54 this.push(file);55 done();56 };57 outputStream._read = function () { };58 const watcher = chokidar.watch(globs, options);59 options.events.forEach(ev => {60 watcher.on(ev, processEvent.bind(undefined, ev));61 });62 ['add', 'change', 'unlink', 'addDir', 'unlinkDir', 'error', 'ready', 'raw']63 .forEach(ev => {64 watcher.on(ev, outputStream.emit.bind(outputStream, ev));65 });66 outputStream.add = function (newGlobs) {67 newGlobs = normalizeGlobs(newGlobs)68 .map(glob => resolveGlob(glob));69 watcher.add(newGlobs);70 globs.push(...newGlobs);71 };72 outputStream.unwatch = watcher.unwatch.bind(watcher);73 outputStream.close = function () {74 watcher.close();75 this.emit('end');76 };77 function processEvent(event, filepath) {78 filepath = resolveFilepath(filepath);79 const fileOptions = assign({}, options);80 let glob;81 let currentFilepath = filepath;82 while (!(glob = globs[anymatch(globs, currentFilepath, true)]) && currentFilepath !== (currentFilepath = path.dirname(currentFilepath))) {} // eslint-disable-line no-empty83 if (!glob) {84 fancyLog.info(85 colors.cyan('[gulp-watch]'),86 colors.yellow('Watched unexpected path. This is likely a bug. Please open this link to report the issue:\n') +87 'https://github.com/floatdrop/gulp-watch/issues/new?title=' +88 encodeURIComponent('Watched unexpected filepath') + '&body=' +89 encodeURIComponent('Node.js version: `' + process.version + ' ' + process.platform + ' ' + process.arch + '`\ngulp-watch version: `' + require('./package.json').version + '`\nGlobs: `' + JSON.stringify(originalGlobs) + '`\nFilepath: `' + filepath + '`\nEvent: `' + event + '`\nProcess CWD: `' + process.cwd() + '`\nOptions:\n```js\n' + JSON.stringify(options, null, 2) + '\n```')90 );91 return;92 }93 if (!baseForced) {94 fileOptions.base = path.normalize(globParent(glob));95 }96 // Do not stat deleted files97 if (event === 'unlink' || event === 'unlinkDir') {98 fileOptions.path = filepath;99 write(event, null, new File(fileOptions));100 return;101 }102 // Workaround for early read103 setTimeout(() => {104 vinyl.read(filepath, fileOptions).then(file => {105 write(event, null, file);106 });107 }, options.readDelay);108 }109 function write(event, err, file) {110 if (err) {111 outputStream.emit('error', err);112 return;113 }114 if (options.verbose) {115 log(event, file);116 }117 file.event = event;118 outputStream.push(file);119 cb(file);120 }121 function log(event, file) {122 event = event[event.length - 1] === 'e' ? event + 'd' : event + 'ed';123 const message = [colors.magenta(file.relative), 'was', event];124 if (options.name) {125 message.unshift(colors.cyan(options.name) + ' saw');126 }127 fancyLog.info.apply(null, message);128 }129 return outputStream;130}131// This is not part of the public API as that would lead to global state (singleton) pollution,132// and allow unexpected interference between unrelated modules that make use of gulp-watch.133// This can be useful for unit tests and root application configuration, though.134// Avoid modifying gulp-watch's default options inside a library/reusable package, please.135watch._defaultOptions = {136 events: ['add', 'change', 'unlink'],137 ignoreInitial: true,138 readDelay: 10139};...

Full Screen

Full Screen

mixinBeautify.js

Source:mixinBeautify.js Github

copy

Full Screen

1'use strict';2var filter = require('gulp-filter');3var tap = require('gulp-tap');4var beautify_js = require('js-beautify').js;5var beautify_css = require('js-beautify').css;6var beautify_html = require('js-beautify').html;7var utils = {};8require('./mixinFile').extend(utils);9var beautifyConfig = utils.mixins.readJsonFile('../.jsbeautifyrc', __dirname);10/**11 * Beautify a json stream12 * @param {Array} globs An optional array of globs13 */14var beautifyJson = function(globs) {15 globs = [].concat(globs || ['**/*.json']);16 var extensionFilter = filter(globs, {17 restore: true18 });19 var config = beautifyConfig.js;20 config.indent_size = 2;21 config.max_preserve_newlines = 1;22 this.registerTransformStream([23 extensionFilter,24 tap(function(file, t) {25 var contents = file.contents.toString();26 contents = beautify_js(contents, config);27 file.contents = new Buffer(contents);28 }),29 //prettifyJs(config),30 extensionFilter.restore31 ]);32};33/**34 * Beautify a javascript stream35 * @param {Array} globs An optional array of globs36 */37var beautifyJs = function(globs) {38 globs = [].concat(globs || ['**/*.js']);39 var extensionFilter = filter(globs, {40 restore: true41 });42 var config = beautifyConfig.js;43 config.indent_size = 4;44 config.max_preserve_newlines = 2;45 this.registerTransformStream([46 extensionFilter,47 //prettifyJs(config),48 tap(function(file, t) {49 var contents = file.contents.toString();50 contents = beautify_js(contents, config);51 file.contents = new Buffer(contents);52 }),53 extensionFilter.restore54 ]);55};56/**57 * Beautify a typescript stream58 * @param {Array} globs An optional array of globs59 */60var beautifyTs = function(globs) {61 globs = [].concat(globs || ['**/*.ts']);62 var extensionFilter = filter(globs, {63 restore: true64 });65 var config = beautifyConfig.js;66 config.indent_size = 4;67 config.max_preserve_newlines = 2;68 this.registerTransformStream([69 extensionFilter,70 tap(function(file, t) {71 var contents = file.contents.toString();72 contents = beautify_js(contents, config);73 file.contents = new Buffer(contents);74 }),75 extensionFilter.restore76 ]);77};78/**79 * Beautify an html stream80 * @param {Array} globs An optional array of globs81 */82var beautifyHtml = function(globs) {83 globs = [].concat(globs || ['**/*.html']);84 var extensionFilter = filter(globs, {85 restore: true86 });87 var config = beautifyConfig.html;88 config.max_preserve_newlines = 1;89 this.registerTransformStream([90 extensionFilter,91 tap(function(file, t) {92 var contents = file.contents.toString();93 contents = beautify_html(contents, config);94 file.contents = new Buffer(contents);95 }),96 extensionFilter.restore97 ]);98};99/**100 * Beautify an css stream101 * @param {Array} globs An optional array of globs102 */103var beautifyCss = function(globs) {104 globs = [].concat(globs || ['**/*.css', '**/*.scss', '**/*.sass']);105 var extensionFilter = filter(globs, {106 restore: true107 });108 var config = beautifyConfig.css;109 config.max_preserve_newlines = 1;110 this.registerTransformStream([111 extensionFilter,112 tap(function(file, t) {113 var contents = file.contents.toString();114 contents = beautify_css(contents, config);115 file.contents = new Buffer(contents);116 }),117 extensionFilter.restore118 ]);119};120/**121 * The exported object122 * To apply the mixin execute: this.mixins.extend(generator);123 * @type {Object}124 */125module.exports = {126 extend: function(generator) {127 var mixins = generator.mixins = generator.mixins || {};128 mixins.beautifyJson = beautifyJson.bind(generator);129 mixins.beautifyJs = beautifyJs.bind(generator);130 mixins.beautifyTs = beautifyTs.bind(generator);131 mixins.beautifyHtml = beautifyHtml.bind(generator);132 mixins.beautifyCss = beautifyCss.bind(generator);133 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1module.exports = {2 globs: function() {3 return ['test.js'];4 }5};6{7 "scripts": {8 },9 "repository": {

Full Screen

Using AI Code Generation

copy

Full Screen

1const strykerGlob = require('stryker-parent/globs');2const strykerGlob = require('stryker/globs');3const strykerGlob = require('stryker-api/globs');4const strykerGlob = require('stryker-parent/globs');5const strykerGlob = require('stryker/globs');6const strykerGlob = require('stryker-api/globs');7const strykerGlob = require('stryker-parent/globs');8const strykerGlob = require('stryker/globs');9const strykerGlob = require('stryker-api/globs');10const strykerGlob = require('stryker-parent/globs');11const strykerGlob = require('stryker/globs');12const strykerGlob = require('stryker-api/globs');13const strykerGlob = require('stryker-parent/globs');14const strykerGlob = require('stryker/globs');

Full Screen

Using AI Code Generation

copy

Full Screen

1const { glob } = require('stryker-parent');2const files = glob('src/**/*.js');3console.log(files);4const { glob } = require('stryker-parent');5module.exports = function(config) {6 config.set({7 mutate: glob('src/**/*.js')8 });9};10{11 "scripts": {12 },13 "devDependencies": {14 }15}

Full Screen

Using AI Code Generation

copy

Full Screen

1const strykerParent = require('stryker-parent');2const glob = strykerParent.glob;3const files = glob('src/**/*.js');4console.log(files);5const stryker = require('stryker');6const glob = stryker.glob;7const files = glob('src/**/*.js');8console.log(files);

Full Screen

Using AI Code Generation

copy

Full Screen

1const glob = require('glob');2const path = require('path');3const fs = require('fs');4const child_process = require('child_process');5const { exec } = child_process;6const { promisify } = require('util');7const execPromise = promisify(exec);8const { StrykerOptions, ConfigReader } = require('@stryker-mutator/api/core');9const { Logger } = require('@stryker-mutator/api/logging');10const { tokens, commonTokens } = require('@stryker-mutator/api/plugin');11const { StrykerError } = require('@stryker-mutator/util');12const { globAsync } = require('@stryker-mutator/util');13const { normalizeWhitespaces } = require('@stryker-mutator/util');14const { determineTestFramework } = require('@stryker-mutator/util');15const { determineTestRunner } = require('@stryker-mutator/util');16const { determineTestSelector } = require('@stryker-mutator/util');17const { determineTranspilers } = require('@stryker-mutator/util');18const { determineReporters } = require('@stryker-mutator/util');19const { determineMutator } = require('@stryker-mutator/util');20const { determineCoverageAnalysis } = require('@stryker-mutator/util');21const { determineThresholds } = require('@stryker-mutator/util');22const { determineLogLevel } = require('@stryker-mutator/util');23const { determineTimeoutFactor } = require('@stryker-mutator/util');24const { determineTimeoutMs } = require('@stryker-mutator/util');25const { determineMaxConcurrentTestRunners } = require('@stryker-mutator/util');26const { determinePlugins } = require('@stryker-mutator/util');27const { determinePort } = require('@stryker-mutator/util');28const { determineTempDirName } = require('@stryker-mutator/util');29const { determineDashboard } = require('@stryker-mutator/util');30const { determineDashboardReport } = require('@stryker-mutator/util');31const { determineCoverageAnalysis } = require('@stryker-mutator/util');32const { determineThresholds } = require('@stryker-mutator/util');33const { determineLogLevel } = require('@stryker-mutator/util');34const { determineTimeoutFactor } = require('@stryker-mutator/util');35const { determine

Full Screen

Using AI Code Generation

copy

Full Screen

1const globs = require('stryker-parent').globs;2const glob = globs('test/**/*.js');3console.log(glob);4const globs = require('stryker-parent').globs;5const glob = globs('src/**/*.js');6console.log(glob);7const globs = require('stryker-parent').globs;8const glob = globs('test/**/*.js');9console.log(glob);10const globs = require('stryker-parent').globs;11const glob = globs('src/**/*.js');12console.log(glob);

Full Screen

Using AI Code Generation

copy

Full Screen

1const { globs } = require('stryker-parent');2module.exports = function(config) {3 config.set({4 mutate: globs('src/**/*.js'),5 })6}

Full Screen

Using AI Code Generation

copy

Full Screen

1var parent = require('stryker-parent');2var glob = require('glob');3var files = glob.sync('**/*.js', {cwd: parent.getTestDir()});4console.log('Files found: ' + files.length);5var parent = require('stryker-parent');6module.exports = function(config) {7 config.set({8 files: parent.getTestDir() + '/test.js'9 });10};11[2017-03-24 15:21:14.040] [INFO] SandboxPool - Creating 4 test runners (based on CPU count)

Full Screen

Using AI Code Generation

copy

Full Screen

1var parents = require('stryker-parents');2var glob = require('glob');3var path = require('path');4var files = glob.sync('test/**/*.js');5var parents = parents(files, 'test');6console.log(parents);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stryker-parent automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful