Best JavaScript code snippet using storybook-root
gulpfile2.js
Source:gulpfile2.js
1'use strict';2var gulp = require('gulp');3var source = require('vinyl-source-stream');4var gutil = require('gulp-util');5var browserify = require('browserify');6var source = require('vinyl-source-stream');7var buffer = require('vinyl-buffer');8var uglify = require('gulp-uglifyjs');9var uglify2 = require('gulp-uglify');10var sourcemaps = require('gulp-sourcemaps'); 11var reactify = require('reactify');12var babelify = require('babelify');13var watchify = require('watchify');14var notify = require('gulp-notify');15var sass = require('gulp-sass');16var concat = require('gulp-concat');17var babel = require('gulp-babel');18var es2015 = require('babel-preset-es2015');19var plumber = require('gulp-plumber'); 20var sassGlob = require('gulp-sass-glob');21var cleanCSS = require('gulp-clean-css');22var imagemin = require('gulp-imagemin');23var autoprefixer = require('gulp-autoprefixer');24var postcss = require('gulp-postcss');25// gulp watch watching for radaris26// gulp watch --c1 watching for people-background-check.com27// gulp watch --c2 watching for backgroundcheck.run28// gulp watch --c3 watching for phoneowner.us29// gulp watch --c4 watching for phoneid.us30// gulp watch --c5 watching for newenglandfacts.com31// gulp watch --licenses watching for licensefiles.com32// gulp watch --wellnut watching for ??33var basePath = '/rd/rd/www/';34if (process.argv[3] == '--c1') {35 basePath = '/rd/rdc/people-background-check.com/www/';36}37if (process.argv[3] == '--c2') {38 basePath = '/rd/rdc/backgroundcheck.run/www/';39}40if (process.argv[3] == '--c3') {41 basePath = '/rd/phone/phoneowner.us/www/';42}43if (process.argv[3] == '--c4') {44 basePath = '/rd/phone/phoneid.us/www/';45}46if (process.argv[3] == '--c5') {47 basePath = '/rd/rdc/newenglandfacts.com/www/';48}49if (process.argv[3] == '--licenses') {50 basePath = '/rd/license/licensefiles.com/www/';51}52if (process.argv[3] == '--wellnut') {53 basePath = '/rd/wellnut/www/';54}55// Paths56var sassPath = basePath + 'css/sass/',57 cssPath = basePath + 'css/',58 jsPath = basePath + 'js/',59 rawImagePath = basePath + 'images/',60 imagePath = basePath + 'img/';61gulp.task('images', function() {62 gulp.src(imagePath +'**')63 .pipe(imagemin())64 .pipe(gulp.dest(imagePath))65});66// gulp.task('aaa', () =>67// gulp.src(cssPath + '*.css')68// .pipe(sourcemaps.init())69// .pipe(autoprefixer())70// .pipe(concat('main.css'))71// .pipe(sourcemaps.write('.'))72// .pipe(gulp.dest(cssPath))73// );74gulp.task('sass', function () {75 return gulp76 .src(sassPath + '**/*.scss')77 //.pipe(sourcemaps.init())78 //.pipe(sassGlob())79 .pipe(sass({outputStyle: 'compressed', includePaths: [sassPath], errLogToConsole: true}).on('error', sass.logError))80 // .pipe(postcss([require('postcss-flexbugs-fixes')]))81 // .pipe(autoprefixer({82 // browsers: ['last 2 versions', 'ie >= 9', 'and_chr >= 2.3']83 // }))84 // .pipe(sourcemaps.write())85 .pipe(autoprefixer())86 //.pipe(sourcemaps.write('.'))87 .pipe(gulp.dest(cssPath));88});89// to compile scripts for people-background-check.com run gulp scripts --c190gulp.task('es2015', function () {91 return gulp.src([92 jsPath + 'raw/foundation/foundation.core.js',93 jsPath + 'raw/foundation/foundation.util.*.js',94 jsPath + 'raw/foundation/foundation.tooltip.js',95 jsPath + 'raw/foundation/foundation.dropdown.js',96 jsPath + 'raw/foundation/foundation.dropdownMenu.js',97 jsPath + 'raw/foundation/foundation.responsiveMenu.js',98 jsPath + 'raw/foundation/foundation.responsiveToggle.js',99 jsPath + 'raw/foundation/foundation.reveal.js',100 ])101 .pipe(sourcemaps.init())102 .pipe(babel({103 presets: [es2015]104 }))105 .pipe(concat('foundation.js'))106 .pipe(gulp.dest(jsPath));107});108gulp.task('foundation', function() {109 return browserify([110 jsPath + 'raw/foundation.js',111 ]) //sourceFile 112 .bundle()113 .pipe(source('foundation.js')) //destFile114 .pipe(buffer())115 // .pipe(babel({116 // presets: ['es2015'],117 // "compact" : true118 // }))119 // .pipe(sourcemaps.init({loadMaps: true}))120 // .pipe(uglify())121 .pipe(gulp.dest(jsPath)); //destFolder122});123gulp.task('bootstrap', function() {124 return browserify([125 jsPath + 'bundle.js',126 ]) //sourceFile 127 .bundle()128 .pipe(source('bootstrap.min.js')) //destFile129 .pipe(buffer())130 .pipe(uglify())131 .pipe(gulp.dest(jsPath)); //destFolder132});133gulp.task('scriptsRadaris', function() {134 return gulp.src([135 jsPath + 'bootstrap.min.js',136 jsPath + 'typeahead.js',137 jsPath + 'view.more.js',138 jsPath + 'rdf.js',139 jsPath + 'radar.js',140 jsPath + 'nlp.js',141 jsPath + 'voting.js',142 jsPath + 'fact.js',143 jsPath + 'jquery-run.js',144 jsPath + 'jquery-ahm.js',145 jsPath + 'scrolltotop.js',146 jsPath + 'social-likes.min.js',147 jsPath + 'search.js',148 jsPath + 'jquery.rating.pack.js',149 jsPath + 'jquery.scrollto.js',150 jsPath + 'offcanvas.js',151 jsPath + 'filterAgeRadaris.js',152 jsPath + 'jquery.clearInput.js',153 jsPath + 'tabsmentions.js',154 ])155 .pipe(sourcemaps.init({loadMaps: true}))156 .pipe(concat('rd.min.js'))157 .pipe(uglify2())158 .pipe(sourcemaps.write('./'))159 .pipe(gulp.dest(jsPath));160});161gulp.task('scriptsClones', function () {162 gulp.start('es2015');163 return gulp.src([164 jsPath + 'raw/jquery-ahm.js',165 jsPath + 'raw/jquery-run.js',166 jsPath + 'foundation.js',167 jsPath + 'raw/typeahead.js',168 jsPath + 'raw/rdcf.js',169 jsPath + 'raw/social-likes.min.js',170 ])171 .pipe(concat('main.js'))172 .pipe(uglify2().on('error', function(e){173 console.log(e);174 }))175 .pipe(gulp.dest(jsPath));176});177gulp.task('watch', function(event) {178 console.log(sassPath);179 gulp.watch(sassPath + '**', function() {180 setTimeout(function () { 181 gulp.start('sass');182 }, 1000); // this timeout fix problem with sftp file transfer183 });...
light7.js
Source:light7.js
1'use strict';2const gulp = require('gulp');3const config = require('./config');4const lazypipe = require('lazypipe');5const concat = require("gulp-concat");6const rename = require("gulp-rename");7const uglify = require("gulp-uglify");8const header = require("gulp-header");9const less = require('gulp-less');10const cssmin = require('gulp-cssmin');11const csscomb = require('gulp-csscomb');12const autoprefixer = require('gulp-autoprefixer');13const bannerLight7 = [14 '/*!',15 ' * =====================================================',16 ' * light7 - http://light7.org/',17 ' *',18 ' * =====================================================',19 ' */'20].join('\n') + '\n';21const packnameLight7 = 'light7';22const dist = config.dist, jsPath = `${config.jsSourcePath}/light7`, lessPath = `${config.lessSourcePath}/light7`;23// èæ¬æ·»å header24const jsTransformLight7 = lazypipe()25 .pipe(header, bannerLight7)26 .pipe(gulp.dest, `${config.jsPath}`);27// èæ¬å缩éå½å28const jsMinLight7 = lazypipe()29 .pipe(uglify, {30 compress: {31 warnings: false32 },33 mangle: true,34 preserveComments: false35 })36 .pipe(rename, { suffix: '.min' })37 .pipe(gulp.dest, `${config.jsPath}`);38function compressLight7() {39 // light7.js40 gulp.src([41 `${jsPath}/intro.js`,42 `${jsPath}/device.js`,43 `${jsPath}/util.js`,44 `${jsPath}/detect.js`,45 `${jsPath}/zepto-adapter.js`,46 `${jsPath}/fastclick.js`,47 `${jsPath}/template7.js`,48 `${jsPath}/page.js`,49 `${jsPath}/tabs.js`,50 `${jsPath}/bar-tab.js`,51 `${jsPath}/modal.js`,52 `${jsPath}/calendar.js`,53 `${jsPath}/picker.js`,54 `${jsPath}/datetime-picker.js`,55 `${jsPath}/pull-to-refresh-js-scroll.js`,56 `${jsPath}/pull-to-refresh.js`,57 `${jsPath}/infinite-scroll.js`,58 `${jsPath}/notification.js`,59 `${jsPath}/index.js`,60 `${jsPath}/searchbar.js`,61 `${jsPath}/panels.js`,62 `${jsPath}/router.js`,63 `${jsPath}/init.js`64 ])65 .pipe(concat(`${packnameLight7}.js`))66 .pipe(jsTransformLight7())67 .pipe(jsMinLight7());68 console.log('light7 å缩å®æ¯');69}70function compressLight7Swiper() {71 // light7-swiper.js72 gulp.src([73 `${jsPath}/swiper.js`,74 `${jsPath}/swiper-init.js`,75 `${jsPath}/photo-browser.js`76 ])77 .pipe(concat(`${packnameLight7}-swiper.js`))78 .pipe(jsTransformLight7())79 .pipe(jsMinLight7());80 console.log('light7-swiper å缩å®æ¯');81}82function compressLight7Other() {83 gulp.src([84 `${jsPath}/city-data.js`,85 `${jsPath}/city-picker.js`86 ])87 .pipe(concat(`${packnameLight7}-city-picker.js`))88 .pipe(jsTransformLight7())89 .pipe(jsMinLight7());90 console.log('light7-city-picker å缩å®æ¯');91 gulp.src([92 `${jsPath}/i18n/cn.js`93 ])94 .pipe(concat(`/i18n/cn.js`))95 .pipe(jsTransformLight7())96 .pipe(jsMinLight7());97 console.log('i18n/cn.js å缩å®æ¯');98}99// ç¼è¯ less æ件100const lessCompile = lazypipe()101 .pipe(less)102 .pipe(autoprefixer, {103 browsers: config.autoprefixerBrowsers104 })105 .pipe(header, bannerLight7)106 .pipe(gulp.dest, `${config.cssPath}`);107// css å缩108const lessMinify = lazypipe()109 .pipe(csscomb)110 .pipe(cssmin)111 .pipe(rename, { suffix: '.min' })112 .pipe(gulp.dest, `${config.cssPath}`);113function buildLess() {114 gulp.src(`${lessPath}/light7.less`)115 .pipe(lessCompile())116 .pipe(lessMinify());117 gulp.src(`${lessPath}/light7-swiper.less`)118 .pipe(lessCompile())119 .pipe(lessMinify());120 console.log('light7 lessæ件ç¼è¯å®æ');121}122module.exports = {123 buildJS() {124 compressLight7();125 compressLight7Swiper();126 compressLight7Other();127 },128 buildCSS() {129 buildLess();130 },131 run() {132 this.buildJS();133 this.buildCSS();134 },135 watch() {136 gulp.watch([`${jsPath}/*.js`, `${jsPath}/i18n/*.js`], () => {137 this.buildJS();138 });139 gulp.watch([`${lessPath}/*.less`], () => {140 this.buildCSS();141 });142 },...
gulpfile.js
Source:gulpfile.js
1//Install gulp: npm install --save-dev gulp2//Install Plumber: npm install --save-dev gulp-plumber3//Install Order: npm install --save-dev gulp-order4//Install JS Uglify: npm install --save-dev gulp-uglify5//Install Concat: npm install --save-dev gulp-concat6//Install SASS: npm install --save-dev gulp-sass7//Install AutoPrefixer: npm install --save-dev gulp-autoprefixer8//Install SVG sprite generator: npm install --save-dev gulp-svg-sprite9var gulp = require('gulp');10var plumber = require('gulp-plumber');11var order = require('gulp-order');12var uglify = require('gulp-uglify');13var concat = require('gulp-concat');14var sass = require('gulp-sass');15var svgSprite = require('gulp-svg-sprite');16var autoprefixer = require('gulp-autoprefixer');17var jsPath = 'html/js';18var jsSrc = [19 jsPath+'/libs/*.js',20 jsPath+'/utilities/*.js',21 jsPath+'/components/*.js'22 ];23var cssPath = 'html/css/main';24var cssSrc = cssPath+'/main.scss';25gulp.task('concat', function(){26 return gulp.src(jsSrc)27 .pipe(plumber())28 .pipe(order([29 // jsPath+'/libs/jquery-2.2.2.min.js',30 jsPath+'/libs/jquery.validate.min.js',31 jsPath+'/libs/component-history.js',32 jsPath+'/libs/jquery.unveil.js',33 jsPath+'/libs/modernizr-custom.js',34 jsPath+'/libs/owl.carousel.min.js',35 jsPath+'/libs/svg4everybody.min.js',36 jsPath+'/utilities/*.js',37 jsPath+'/components/*.js'38 ], { base: './' }))39 .pipe(concat('main.js'))40 .pipe(gulp.dest('html/js/main'));41});42gulp.task('compress', ['concat'], function(){43 return gulp.src(jsPath+'/main/main.js')44 .pipe(plumber())45 .pipe(uglify())46 .pipe(gulp.dest(jsPath+'/main'));47});48gulp.task('sass', function(){49 gulp.src(cssSrc)50 .pipe(plumber())51 .pipe(sass({52 outputStyle: 'compressed',53 errLogToConsole: true54 }).on('error', sass.logError))55 .pipe(autoprefixer())56 .pipe(gulp.dest(cssPath))57});58gulp.task('watch', function(){59 gulp.watch(jsSrc, ['concat', 'compress']);60 gulp.watch(cssSrc, ['sass']);61});62gulp.task('default', ['watch']);63var svgSpriteConfig = {64 mode: {65 symbol: {66 dest: '',67 sprite: 'icons.svg'68 }69 }70};71gulp.task('icons', function () {72 return gulp.src('./html/img/icons-minified/*.svg')73 .pipe(svgSprite(svgSpriteConfig))74 .pipe(gulp.dest('html/img'));...
Using AI Code Generation
1import { jsPath } from 'storybook-root';2import { cssPath } from 'storybook-root';3import { imgPath } from 'storybook-root';4import { fontPath } from 'storybook-root';5import { audioPath } from 'storybook-root';6import { videoPath } from 'storybook-root';7import { assetPath } from 'storybook-root';8import { srcPath } from 'storybook-root';9import { distPath } from 'storybook-root';10import { buildPath } from 'storybook-root';11import { nodeModulesPath } from 'storybook-root';12import { storybookRootPath } from 'storybook-root';13import { storybookConfigPath } from 'storybook-root';14import { storybookStoriesPath } from 'storybook-root';15import { storybookAddonsPath } from 'storybook-root';16import { storybookConfigPath } from 'storybook-root';17import { storybookDistPath } from 'storybook-root';
Using AI Code Generation
1var storybook = require("storybook-root");2storybook.jsPath("test.js");3var storybook = require("storybook-root");4storybook.cssPath("test.js");5var storybook = require("storybook-root");6storybook.htmlPath("test.js");7var storybook = require("storybook-root");8storybook.templatePath("test.js");9var storybook = require("storybook-root");10storybook.imagePath("test.js");11var storybook = require("storybook-root");12storybook.fontPath("test.js");13var storybook = require("storybook-root");14storybook.audioPath("test.js");15var storybook = require("storybook-root");16storybook.videoPath("test.js");17var storybook = require("storybook-root");18storybook.downloadPath("test.js");19var storybook = require("storybook-root");20storybook.publicPath("test.js");21var storybook = require("storybook-root");22storybook.configPath("test.js");23var storybook = require("storybook-root");24storybook.config("test.js");25var storybook = require("storybook-root");26storybook.configDir("test.js");27var storybook = require("storybook-root");28storybook.configFile("test.js");29var storybook = require("storybook-root");30storybook.configDirFile("test.js");
Using AI Code Generation
1import { jsxPath } from 'storybook-root';2jsxPath('src/components/ComponentA');3import { jsxPath } from 'storybook-root';4jsxPath('src/components/ComponentA');5import { jsxPath } from 'storybook-root';6jsxPath('src/components/ComponentA');7import { jsxPath } from 'storybook-root';8jsxPath('src/components/ComponentA');9import { jsxPath } from 'storybook-root';10jsxPath('src/components/ComponentA');11import { jsxPath } from 'storybook-root';12jsxPath('src/components/ComponentA');13import { jsxPath } from 'storybook-root';14jsxPath('src/components/ComponentA');15import { jsxPath } from 'storybook-root';16jsxPath('src/components/ComponentA');17import { jsxPath } from 'storybook-root';18jsxPath('src/components/ComponentA');19import { jsxPath } from 'storybook-root';20jsxPath('src/components/ComponentA');21import { jsxPath } from 'storybook-root';22jsxPath('src/components/ComponentA');23import { jsxPath } from 'storybook-root';24jsxPath('src/components/ComponentA');25import { jsxPath } from 'storybook-root';26jsxPath('src/components/ComponentA');27import { jsxPath } from 'storybook-root';28jsxPath('src/components/ComponentA');29import { jsxPath } from 'storybook-root';30jsxPath('src/components/ComponentA');
Using AI Code Generation
1const jsPath = require('storybook-root').jsPath;2const path = require('path');3const jsPath = jsPath('src/components');4const jsPath = jsPath('src/components', 'index.js');5const jsPath = jsPath('src/components', 'index.js', 'src');6const jsPath = jsPath('src/components', 'index.js', 'src', 'components');7const jsPath = require('storybook-root').jsPath;8const path = require('path');9const jsPath = jsPath();10const jsPath = jsPath('index.js');11const jsPath = jsPath('index.js', 'src');12const jsPath = jsPath('index.js', 'src', 'components');13const jsPath = require('storybook-root').jsPath;14const path = require('path');15const jsPath = jsPath();16const jsPath = jsPath('src');17const jsPath = jsPath('src', 'components');18const jsPath = require('storybook-root').jsPath;19const path = require('path');20const jsPath = jsPath();21const jsPath = jsPath('src');22const jsPath = require('storybook-root').jsPath;23const path = require('path');24const jsPath = jsPath();25const jsPath = require('storybook-root').jsPath;26const path = require('path');27const jsPath = jsPath('src/components');28const jsPath = jsPath('src/components', 'index.js');29const jsPath = jsPath('src/components', 'index.js', 'src');30const jsPath = jsPath('src/components', 'index.js', 'src', 'components');31const jsPath = require('storybook-root').jsPath;32const path = require('path');33const jsPath = jsPath();34const jsPath = jsPath('index.js');35const jsPath = jsPath('index.js', 'src');36const jsPath = jsPath('
Using AI Code Generation
1const path = require('path');2const jsPath = require('storybook-root')('js');3console.log(jsPath('index.js'));4const path = require('path');5const jsPath = require('storybook-root')('js');6console.log(jsPath('index.js'));7const path = require('path');8const cssPath = require('storybook-root')('css');9console.log(cssPath('index.css'));10const path = require('path');11const cssPath = require('storybook-root')('css');12console.log(cssPath('index.css'));13const path = require('path');14const imgPath = require('storybook-root')('img');15console.log(imgPath('logo.png'));16const path = require('path');17const imgPath = require('storybook-root')('img');18console.log(imgPath('logo.png'));19const path = require('path');20const fontPath = require('storybook-root')('font');21console.log(fontPath('font.ttf'));22const path = require('path');23const fontPath = require('storybook-root')('font');24console.log(fontPath('font.ttf'));25const path = require('path');26const htmlPath = require('storybook-root')('html');27console.log(htmlPath('index.html'));28const path = require('path');29const htmlPath = require('storybook-root')('html');30console.log(htmlPath('index.html'));
Using AI Code Generation
1const storybookRoot = require("storybook-root");2const path = require("path");3const jsPath = storybookRoot.jsPath;4const somePath = jsPath("some/path");5console.log(somePath);6const somePath = jsPath("some/path", "another/path");7console.log(somePath);8const somePath = jsPath("some/path", "another/path", "yet/another/path");9console.log(somePath);10const somePath = jsPath("some/path", "another/path", "yet/another/path", "and/yet/another/path");11console.log(somePath);12const somePath = jsPath("some/path", "another/path", "yet/another/path", "and/yet/another/path", "and/another/path");13console.log(somePath);14const somePath = jsPath("some/path", "another/path", "yet/another/path", "and/yet/another/path", "and/another/path", "and/another/path");15console.log(somePath);16const somePath = jsPath("some/path", "another/path", "yet/another/path", "and/yet/another/path", "and/another/path", "and/another/path", "and/another/path");17console.log(somePath);18const somePath = jsPath("some/path", "another/path", "yet/another/path", "and/yet/another/path",
Using AI Code Generation
1import { jsPath } from 'storybook-root';2const path = jsPath('src/components');3import { cssPath } from 'storybook-root';4const path = cssPath('src/components');5import { rootPath } from 'storybook-root';6const path = rootPath();7import { srcPath } from 'storybook-root';8const path = srcPath();9import { storybookPath } from 'storybook-root';10const path = storybookPath();11import { storybookConfigPath } from 'storybook-root';12const path = storybookConfigPath();13import { storybookRootPath } from 'storybook-root';14const path = storybookRootPath();15import { storybookAddonsPath } from 'storybook-root';16const path = storybookAddonsPath();17import { storybookWebpackPath } from 'storybook-root';18const path = storybookWebpackPath();
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!