How to use targetDir method in storybook-root

Best JavaScript code snippet using storybook-root

TaskInitialize.test.ts

Source:TaskInitialize.test.ts Github

copy

Full Screen

1import * as Path from 'path';2import { createExperimentPaths } from '../../lib/cli/CliHelpers';3import type { ExperimentHandler } from '../../lib/experiment/ExperimentHandler';4import type { NpmInstaller } from '../../lib/npm/NpmInstaller';5import type { ExperimentLoader } from '../../lib/task/ExperimentLoader';6import type { ITaskContext } from '../../lib/task/ITaskContext';7import { TaskInitialize } from '../../lib/task/TaskInitialize';8import { TestLogger } from '../TestLogger';9let files: Record<string, string> = {};10let filesOut: Record<string, string> = {};11let filesDeleted: Record<string, boolean> = {};12let dirsOut: Record<string, boolean> = {};13jest.mock('fs-extra', () => ({14 ...jest.requireActual('fs-extra'),15 async writeFile(filePath: string, contents: string) {16 filesOut[filePath] = contents;17 },18 async remove(filePath: string) {19 filesDeleted[filePath] = true;20 },21 async mkdir(dirPath: string) {22 dirsOut[dirPath] = true;23 },24 async pathExists(filePath: string) {25 return filePath in files;26 },27 async copyFile(source: string, dest: string) {28 filesOut[dest] = source;29 },30 async createFile(dest: string) {31 filesOut[dest] = 'TRUE';32 },33}));34let experimentLoader: ExperimentLoader;35jest.mock('../../lib/task/ExperimentLoader', () => ({36 ExperimentLoader: {37 ...jest.requireActual('../../lib/task/ExperimentLoader').ExperimentLoader,38 build: jest.fn(() => experimentLoader),39 getDefaultExperimentIri: () => 'IRI',40 requireCombinationsExperiment: () => true,41 getExperimentName: () => 'EXP-NAME',42 },43}));44let taskGenerateCombinations: any;45jest.mock('../../lib/task/TaskGenerateCombinations', () => ({46 TaskGenerateCombinations: jest.fn().mockImplementation(() => ({47 generate: taskGenerateCombinations,48 })),49}));50describe('TaskInitialize', () => {51 let context: ITaskContext;52 let npmInstaller: NpmInstaller;53 let task: TaskInitialize;54 let handler: ExperimentHandler<any>;55 beforeEach(() => {56 context = {57 cwd: 'CWD',58 experimentPaths: createExperimentPaths('CWD'),59 experimentName: 'EXP',60 mainModulePath: 'MMP',61 verbose: true,62 closeExperiment: jest.fn(),63 cleanupHandlers: [],64 logger: <any> new TestLogger(),65 docker: <any> {},66 };67 npmInstaller = {68 install: jest.fn(),69 };70 task = new TaskInitialize(71 context,72 'TYPE',73 'NAME',74 'TARGETDIR',75 false,76 false,77 npmInstaller,78 );79 handler = <any> {80 experimentClassName: 'TYPE',81 getHookNames: jest.fn(() => [ 'hook1', 'hook2' ]),82 getDefaultParams: jest.fn(() => ({ param1: 'value1' })),83 init: jest.fn(),84 };85 experimentLoader = <any> {86 discoverExperimentHandlers: jest.fn(() => ({87 TYPE: {88 handler,89 contexts: [ 'context1', 'context2' ],90 },91 })),92 instantiateExperiments: jest.fn((path: any) => {93 return {94 experiments: [{ CONFIG: path }],95 };96 }),97 };98 taskGenerateCombinations = jest.fn();99 files = {};100 filesOut = {};101 filesDeleted = {};102 dirsOut = {};103 });104 describe('init', () => {105 it('initializes a valid experiment', async() => {106 expect(await task.init()).toEqual({107 experimentDirectory: Path.join('CWD', 'TARGETDIR'),108 hookNames: [ 'hook1', 'hook2' ],109 });110 expect(handler.init)111 .toHaveBeenCalledWith(createExperimentPaths(Path.join('CWD', 'TARGETDIR')), { CONFIG: 'EXP-NAME' });112 expect(dirsOut).toEqual({113 [Path.join('CWD', 'TARGETDIR')]: true,114 [Path.join('CWD', 'TARGETDIR', 'generated')]: true,115 [Path.join('CWD', 'TARGETDIR', 'input')]: true,116 [Path.join('CWD', 'TARGETDIR', 'output')]: true,117 });118 expect(filesOut).toEqual({119 [Path.join('CWD', 'TARGETDIR', '.gitignore')]:120 Path.join(__dirname, '..', '..', 'lib', 'templates', '.gitignore'),121 [Path.join('CWD', 'TARGETDIR', 'README.md')]:122 Path.join(__dirname, '..', '..', 'lib', 'templates', 'README.md'),123 [Path.join('CWD', 'TARGETDIR', 'generated', '.keep')]: 'TRUE',124 [Path.join('CWD', 'TARGETDIR', 'output', '.keep')]: 'TRUE',125 [Path.join('CWD', 'TARGETDIR', 'jbr-experiment.json')]: `{126 "@context": [127 "https://linkedsoftwaredependencies.org/bundles/npm/jbr/^2.0.0/components/context.jsonld",128 "context1",129 "context2"130 ],131 "@id": "IRI",132 "@type": "TYPE",133 "param1": "value1",134 "hook1": {135 "@id": "IRI:hook1",136 "@type": "HookNonConfigured"137 },138 "hook2": {139 "@id": "IRI:hook2",140 "@type": "HookNonConfigured"141 }142}`,143 [Path.join('CWD', 'TARGETDIR', 'package.json')]: `{144 "private": true,145 "name": "NAME",146 "dependencies": {147 "cross-env": "^7.0.3"148 },149 "scripts": {150 "jbr": "cross-env NODE_OPTIONS=--max-old-space-size=8192 jbr",151 "validate": "jbr validate"152 }153}`,154 });155 });156 it('should throw if the destination already exists', async() => {157 files[Path.join('CWD', 'TARGETDIR')] = `TRUE`;158 await expect(task.init()).rejects.toThrow('The target directory already exists: \'CWD/TARGETDIR\'');159 });160 it('should not throw if the destination already exists and forceReInit is true', async() => {161 task = new TaskInitialize(162 context,163 'TYPE',164 'NAME',165 'TARGETDIR',166 true,167 false,168 npmInstaller,169 );170 files[Path.join('CWD', 'TARGETDIR')] = `TRUE`;171 await expect(task.init()).resolves.toBeTruthy();172 expect(filesDeleted).toEqual({173 [Path.join('CWD', 'TARGETDIR')]: true,174 });175 });176 it('should throw when initializing an unknown experiment type', async() => {177 task = new TaskInitialize(178 context,179 'TYPEUNKNOWN',180 'NAME',181 'TARGETDIR',182 false,183 false,184 npmInstaller,185 );186 await expect(task.init()).rejects.toThrow(`Invalid experiment type 'TYPEUNKNOWN'. Must be one of 'TYPE'`);187 });188 });189 it('initializes a valid experiment with npm install', async() => {190 task = new TaskInitialize(191 context,192 'TYPE',193 'NAME',194 'TARGETDIR',195 false,196 false,197 npmInstaller,198 );199 expect(await task.init()).toBeTruthy();200 expect(npmInstaller.install)201 .toHaveBeenCalledWith('CWD/TARGETDIR', [ 'jbr', '@jbr-experiment/TYPE' ], 'jbr-experiment');202 });203 it('initializes a valid combinations-based experiment', async() => {204 task = new TaskInitialize(205 context,206 'TYPE',207 'NAME',208 'TARGETDIR',209 false,210 true,211 npmInstaller,212 );213 expect(await task.init()).toEqual({214 experimentDirectory: Path.join('CWD', 'TARGETDIR'),215 hookNames: [ 'hook1', 'hook2' ],216 });217 expect(taskGenerateCombinations).toHaveBeenCalled();218 expect(handler.init)219 .toHaveBeenCalledWith(createExperimentPaths(Path.join('CWD', 'TARGETDIR')), { CONFIG: 'EXP-NAME' });220 expect(dirsOut).toEqual({221 [Path.join('CWD', 'TARGETDIR')]: true,222 [Path.join('CWD', 'TARGETDIR', 'generated')]: true,223 [Path.join('CWD', 'TARGETDIR', 'input')]: true,224 [Path.join('CWD', 'TARGETDIR', 'output')]: true,225 });226 expect(filesOut).toEqual({227 [Path.join('CWD', 'TARGETDIR', '.gitignore')]:228 Path.join(__dirname, '..', '..', 'lib', 'templates', '.gitignore'),229 [Path.join('CWD', 'TARGETDIR', 'README.md')]:230 Path.join(__dirname, '..', '..', 'lib', 'templates', 'README.md'),231 [Path.join('CWD', 'TARGETDIR', 'generated', '.keep')]: 'TRUE',232 [Path.join('CWD', 'TARGETDIR', 'output', '.keep')]: 'TRUE',233 [Path.join('CWD', 'TARGETDIR', 'jbr-combinations.json')]: `{234 "@context": [235 "https://linkedsoftwaredependencies.org/bundles/npm/jbr/^2.0.0/components/context.jsonld"236 ],237 "@id": "IRI-combinations",238 "@type": "FullFactorialCombinationProvider",239 "commonGenerated": false,240 "factors": {}241}`,242 [Path.join('CWD', 'TARGETDIR', 'jbr-experiment.json.template')]: `{243 "@context": [244 "https://linkedsoftwaredependencies.org/bundles/npm/jbr/^2.0.0/components/context.jsonld",245 "context1",246 "context2"247 ],248 "@id": "IRI",249 "@type": "TYPE",250 "param1": "value1",251 "hook1": {252 "@id": "IRI:hook1",253 "@type": "HookNonConfigured"254 },255 "hook2": {256 "@id": "IRI:hook2",257 "@type": "HookNonConfigured"258 }259}`,260 [Path.join('CWD', 'TARGETDIR', 'package.json')]: `{261 "private": true,262 "name": "NAME",263 "dependencies": {264 "cross-env": "^7.0.3"265 },266 "scripts": {267 "jbr": "cross-env NODE_OPTIONS=--max-old-space-size=8192 jbr",268 "validate": "jbr validate"269 }270}`,271 });272 });...

Full Screen

Full Screen

Gruntfile.js

Source:Gruntfile.js Github

copy

Full Screen

1/*global module:false*/2module.exports = function(grunt) {3 var shellOpts = {4 stdout: true,5 failOnError: true6 };7 // Project configuration.8 grunt.initConfig({9 pkg: grunt.file.readJSON('package.json'),10 options: {11 targetDir: "v<%= pkg.version %>"12 },13 meta: {14 banner: '/*! KMC Live Analytics - v<%= pkg.version %> - ' +15 '<%= grunt.template.today("yyyy-mm-dd") %>\n' +16 '* https://github.com/kaltura/LiveAnalytics\n' +17 '* Copyright (c) <%= grunt.template.today("yyyy") %> ' +18 'Atar Shadmi; Licensed GNU */\n'19 },20 concat: {21 options: {22 banner: '<%= meta.banner %>'23 },24 dist: {25 src: [26 'app/js/app.js',27 'app/js/controllers.js', 28 'app/js/directiveControllers.js', 29 'app/js/RGraphController.js',30 'app/js/OLMapController.js',31 'app/js/directives.js',32 'app/js/filters.js', 33 'app/js/services.js',34 'app/locale/en_US.js'35 ],36 dest: '<%= options.targetDir %>/js/livea.js'37 },38 libs: {39 src: [40 'app/lib/kaltura/KHoverDetail.js',41 'app/lib/kaltura/KTime_Local.js'42 ],43 dest: '<%= options.targetDir %>/js/libs.js'44 }45 },46 uglify: {47 options: {48 banner: '<%= meta.banner %>'49 },50 dist: {51 files: {52 '<%= options.targetDir %>/js/livea.min.js': ['<%= concat.dist.dest %>']53 }54 }55 },56 cssmin: {57 combine: {58 files: {59 '<%= options.targetDir %>/css/vendor.css': [60 'app/lib/bootstrap/bootstrap-3.1.1-dist/css/bootstrap.css',61 'app/lib/jquery-ui/jquery-ui-1.10.4/themes/base/jquery-ui.css',62 'app/lib/rickshaw/css/rickshaw.css',63 'app/lib/OpenLayers-2.13.1/theme/default/style.css'64 ]65 }66 }67 },68 copy: {69 vendor : {70 files: [71 // jquery + ui72 {73 src: 'app/lib/jquery/jquery-1.10.2.min.js',74 dest: '<%= options.targetDir %>/js/jquery.min.js'75 },76 {77 src: 'app/lib/jquery-ui/jquery-ui-1.10.4/ui/minified/jquery-ui.min.js',78 dest: '<%= options.targetDir %>/js/jquery-ui.min.js'79 },80 { // jquery ui images81 expand: true,82 cwd: 'app/lib/jquery-ui/jquery-ui-1.10.4/themes/base/minified/images',83 src: '*',84 dest: '<%= options.targetDir %>/css/images'85 },86 // bootstrap87 {88 src: 'app/lib/bootstrap/bootstrap-3.1.1-dist/js/bootstrap.min.js',89 dest: '<%= options.targetDir %>/js/bootstrap.min.js'90 },91 {92 src: 'app/lib/bootstrap/paginator/bootstrap-paginator.js',93 dest: '<%= options.targetDir %>/js/bootstrap-paginator.js'94 },95 {96 src: 'app/lib/bootbox/bootbox.min.js',97 dest: '<%= options.targetDir %>/js/bootbox.min.js'98 },99 { // bootstrap fonts100 expand: true,101 cwd: 'app/lib/bootstrap/bootstrap-3.1.1-dist/fonts',102 src: '*',103 dest: '<%= options.targetDir %>/fonts'104 },105 // angular106 {107 src: 'app/lib/angular/angular.min.js',108 dest: '<%= options.targetDir %>/js/angular.min.js'109 },110 {111 src: 'app/lib/angular/angular-resource.min.js',112 dest: '<%= options.targetDir %>/js/angular-resource.min.js'113 },114 {115 src: 'app/lib/angular/angular-route.min.js',116 dest: '<%= options.targetDir %>/js/angular-route.min.js'117 },118 {119 src: 'app/lib/angular-translate-2.2.0/angular-translate.min.js',120 dest: '<%= options.targetDir %>/js/angular-translate.min.js'121 },122 {123 src: 'app/lib/angular-translate-2.2.0/angular-translate-loader-static-files.min.js',124 dest: '<%= options.targetDir %>/js/angular-translate-loader-static-files.min.js'125 },126 { // angualr map files127 src: 'app/lib/angular/angular-route.min.js.map',128 dest: '<%= options.targetDir %>/js/angular-route.min.js.map'129 },130 { // angualr map files131 src: 'app/lib/angular/angular-resource.min.js.map',132 dest: '<%= options.targetDir %>/js/angular-resource.min.js.map'133 },134 { // angualr map files135 src: 'app/lib/angular/angular.min.js.map',136 dest: '<%= options.targetDir %>/js/angular.min.js.map'137 },138 // open layers139 {140 src: 'app/lib/OpenLayers-2.13.1/OpenLayers.js',141 dest: '<%= options.targetDir %>/js/OpenLayers.js'142 },143 { // open layers images144 expand: true,145 cwd: 'app/lib/OpenLayers-2.13.1/theme/default/img',146 src: '*',147 dest: '<%= options.targetDir %>/css/images/ol'148 },149 // rickshaw150 {151 src: 'app/lib/rickshaw/d3.v3.js',152 dest: '<%= options.targetDir %>/js/d3.v3.js'153 },154 {155 src: 'app/lib/rickshaw/d3.layout.min.js',156 dest: '<%= options.targetDir %>/js/d3.layout.min.js'157 },158 {159 src: 'app/lib/rickshaw/rickshaw.js',160 dest: '<%= options.targetDir %>/js/rickshaw.js'161 }162 ]163 },164 main: {165 files: [166 { // main files167 expand: true,168 cwd: 'app/dist_src',169 src: '**',170 dest: '<%= options.targetDir %>/'171 },172 { // partials173 expand: true,174 cwd: 'app/partials/',175 src: '**',176 dest: '<%= options.targetDir %>/partials/'177 },178 { // locale179 expand: true,180 cwd: 'app/locale/',181 src: '**',182 dest: '<%= options.targetDir %>/locale/'183 },184 // js app + vendor are created directly in place185 { // css - app (vendor is created directly in place)186 src: 'app/css/app.css',187 dest: '<%= options.targetDir %>/css/app.css'188 },189 { // deployment190 expand: true,191 cwd: 'deploy/files',192 src: '**',193 dest: '<%= options.targetDir %>/deploy/files'194 },195 196 ]197 }198 },199 clean: {200 build: ["<%= options.targetDir %>", "<%= options.targetDir %>/js", "<%= options.targetDir %>/css"],201 before: ['<%= options.targetDir %>/**'],202 after: ['app/js/livea.tmp.js']203 },204 'string-replace': {205 deploy: {206 files: {207 '<%= options.targetDir %>/deploy/config.ini': 'deploy/config.ini'208 },209 options: {210 replacements: [{211 pattern: '{VERSION}',212 replacement: '<%= pkg.version %>'213 }]214 }215 }216 }217 218 219 });220 // Add grunt plugins221 grunt.loadNpmTasks('grunt-contrib-clean');222 grunt.loadNpmTasks('grunt-contrib-cssmin');223 grunt.loadNpmTasks('grunt-contrib-concat');224 grunt.loadNpmTasks('grunt-contrib-uglify');225 grunt.loadNpmTasks('grunt-contrib-copy');226 grunt.loadNpmTasks('grunt-contrib-clean');227 grunt.loadNpmTasks('grunt-string-replace');228 // Default task.229 grunt.registerTask('default', ['clean:before', 'string-replace:deploy', 'copy:main', 'copy:vendor', 'concat:dist', 'uglify:dist', 'concat:libs', 'cssmin:combine'/*, 'clean:after'*/]);...

Full Screen

Full Screen

gulpfile.js

Source:gulpfile.js Github

copy

Full Screen

1var autoprefixer = require('gulp-autoprefixer');2var bower = require('gulp-bower');3var filter = require('gulp-filter');4var fs = require('fs');5var gulp = require('gulp');6var gulpIf = require('gulp-if');7var header = require('gulp-header');8var htmlmin = require('gulp-htmlmin');9var htmlhint = require('gulp-htmlhint');10var iconfont = require('gulp-iconfont');11var iconfontCss = require('gulp-iconfont-css');12var inject = require('gulp-inject');13var jade = require('gulp-jade');14var log = require('fancy-log');15var minifycss = require('gulp-minify-css');16var minifyhtml = require('gulp-minify-html');17var path = require('path');18var pkg = require('./package.json');19var pxtorem = require('gulp-pxtorem');20var rename = require('gulp-rename');21var run = require('run-sequence');22var sass = require('gulp-sass');23var using = require('gulp-using');24var util = require('gulp-util');25var rimraf = require('gulp-rimraf');26var replace = require('gulp-replace');27var transform = require('gulp-transform');28var cfg = {29 baseDir: path.dirname(process.cwd()),30 docsDir: './docs',31 sourceDir: './src',32 targetDir: './build',33 distDir: './dist',34 fontName: 'cui-font',35 isVerbose: false,36 banner: [37 '/*! ',38 ' * ' + pkg.name + ' - ' + pkg.description,39 ' * @version ' + pkg.version,40 ' * @home ' + pkg.homepage,41 ' * @license ' + pkg.license,42 ' */',43 ' '].join('\n')44 };45 /*46 * Pre-Build Task47 */48 gulp.task('pre', ['clean'], function() {49 run(['pkg:views', 'pkg:docs']);50 });51 /*52 * Build Task53 */54 gulp.task('default', function() {55 run(['compile:fonts', 'pkg:images', 'pkg:bower', 'pkg:changelog', 'pkg:broadcast'], 'replace:version', 'pkg:examples', 'pkg:inject');56 });57 /*58 * Distribution Task59 * Copies the built files into the dist/ folder60 */61 gulp.task('dist', ['clean:dist'], function() {62 run(['pkg:copydist']);63 });64 /*65 * Task: clean66 * Removes the build folder67 */68 gulp.task('clean', function() {69 return gulp.src(cfg.targetDir)70 .pipe(rimraf({ read: false, force: true }));71 });72 /*73 * Task: clean:dist74 * Removes the dist folder75 */76 gulp.task('clean:dist', function() {77 return gulp.src(cfg.distDir)78 .pipe(rimraf({ read: false, force: true }));79 });80 /*81 * Task: replace:version82 */83 gulp.task('replace:version', function() {84 return gulp.src(cfg.targetDir + '/**/*.html')85 .pipe(replace("{{VERSION}}", pkg.version))86 .pipe(gulp.dest(cfg.targetDir + '/'));87 });88 /*89 * Task: iconfont90 */91 gulp.task('iconfont', function() {92 return gulp.src(cfg.sourceDir + '/icons/*.svg')93 .pipe(gulpIf(cfg.isVerbose, using()))94 .pipe(iconfontCss({95 fontName: cfg.fontName,96 path: 'src/icons/template/_icons.scss',97 targetPath: '../../../../src/scss/base/_' + cfg.fontName + '.scss',98 fontPath: cfg.sourceDir + '/fonts/'99 }))100 .pipe(iconfont({101 fontName: cfg.fontName,102 formats: ['ttf','eot','woff','woff2','svg'],103 normalize: true104 }))105 .pipe(gulp.dest(cfg.targetDir + '/docs/assets/fonts/'));106 });107 /*108 * Task: compile:fonts109 */110 gulp.task('compile:fonts', function() {111 return gulp.src([cfg.sourceDir + '/fonts/**/*'])112 .pipe(gulp.dest(cfg.targetDir + '/fonts/'))113 .pipe(gulp.dest(cfg.targetDir + '/docs/assets/fonts/'));114 });115 /*116 * Task: compile:sass117 */118 gulp.task('compile:sass', function() {119 return gulp.src(cfg.sourceDir + '/scss/**/*.scss')120 .pipe(sass({ cache: false }))121 .pipe(pxtorem({ rootValue: 10 }))122 .pipe(autoprefixer())123 .pipe(header(cfg.banner))124 .pipe(gulp.dest(cfg.targetDir + '/css'))125 .pipe(gulp.dest(cfg.targetDir + '/docs/assets/css'))126 .pipe(minifycss())127 .pipe(rename({ extname: '.min.css' }))128 .pipe(gulp.dest(cfg.targetDir + '/css'))129 .pipe(gulp.dest(cfg.targetDir + '/docs/assets/css'));130 });131 /*132 * Task: pkg:bower133 */134 gulp.task('pkg:bower', function() {135 if (fs.existsSync(cfg.baseDir + '/bower.json')) {136 return bower({137 directory: cfg.targetDir + '/js/bower_components',138 cwd: cfg.baseDir139 });140 }141 });142 /*143 * Task: pkg:images144 */145 gulp.task('pkg:images', function() {146 gulp.src([147 cfg.sourceDir + '/img/**/*.gif',148 cfg.sourceDir + '/img/**/*.jpg',149 cfg.sourceDir + '/img/**/*.png',150 cfg.sourceDir + '/img/**/*.svg'151 ])152 .pipe(gulpIf(cfg.isVerbose, using()))153 .pipe(gulp.dest(cfg.targetDir + '/img'))154 .pipe(gulp.dest(cfg.targetDir + '/docs/assets/img'));155 });156 /*157 * Task: pkg:docs158 */159 gulp.task('pkg:docs', function(done) {160 run('iconfont', 'compile:fonts', 'compile:sass', done);161 });162 /*163 * Task: pkg:views164 */165 gulp.task('pkg:views', function() {166 var filterCmd, htmlFilter, jadeFilter;167 htmlFilter = filter('**/*.html', {168 restore: true169 });170 filterCmd = ['**/*.jade'];171 if (cfg.skipJadeFiles) {172 filterCmd = filterCmd.concat(_.map(cfg.skipJadeFiles, function(item) {173 return '!' + item;174 }));175 }176 jadeFilter = filter(filterCmd, {177 restore: true178 });179 return gulp.src([cfg.sourceDir + '/**/*.html'])180 .pipe(gulpIf(cfg.isVerbose, using()))181 .pipe(htmlFilter)182 .pipe(htmlhint.reporter())183 .pipe(minifyhtml())184 .pipe(htmlFilter.restore)185 .pipe(jadeFilter)186 .pipe(jadeFilter.restore)187 .pipe(gulp.dest(cfg.targetDir));188 });189 /*190 * Task: pkg:examples191 */192 gulp.task('pkg:examples', function() {193 gulp.src(cfg.targetDir + '/docs/public/examples/*.html')194 .on('end', function() { log('\n' + cfg.banner); })195 .pipe(gulp.dest(cfg.targetDir + '/docs/assets'));196 });197 /*198 * Task: pkg:changelog199 */200 gulp.task('pkg:changelog', function() {201 gulp.src('./changelog.md')202 .pipe(gulp.dest(cfg.targetDir + '/docs'));203 });204 /*205 * Task: pkg:broadcast206 */207 gulp.task('pkg:broadcast', function() {208 gulp.src('./broadcast.json')209 .pipe(gulp.dest(cfg.targetDir + '/docs'));210 });211 /*212 * Task: pkg:copydist213 */214 gulp.task('pkg:copydist', function() {215 gulp.src(cfg.targetDir + '/docs/assets/css/*.css')216 .pipe(gulp.dest(cfg.distDir + '/css'));217 gulp.src(cfg.targetDir + '/docs/assets/fonts/**/*')218 .pipe(gulp.dest(cfg.distDir + '/fonts'));219 gulp.src(cfg.targetDir + '/docs/assets/img/**/*')220 .pipe(gulp.dest(cfg.distDir + '/img'));221 });222 /*223 * Task: pkg:inject224 */225 gulp.task('pkg:inject', function() {226 gulp.src(cfg.targetDir + '/docs/section-changelog.html')227 .pipe(inject(gulp.src(cfg.docsDir + '/public/partials/changelog.html'), {228 starttag: '<!-- inject:changelog -->',229 transform: function(filePath, file) {230 return file.contents.toString('utf8')231 }232 }))233 .pipe(gulp.dest(cfg.targetDir + '/docs'));234 gulp.src(cfg.targetDir + '/docs/section-downloads.html')235 .pipe(inject(gulp.src(cfg.docsDir + '/public/partials/downloads.html'), {236 starttag: '<!-- inject:downloads -->',237 transform: function(filePath, file) {238 return file.contents.toString('utf8')239 }240 }))241 .pipe(gulp.dest(cfg.targetDir + '/docs'));...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const root = require('storybook-root');2const path = require('path');3module.exports = {4 stories: [path.join(root(), 'stories/**/*.stories.js')],5 {6 options: {7 },8 },9};10{11 "dependencies": {12 },13 "scripts": {14 },15 "devDependencies": {

Full Screen

Using AI Code Generation

copy

Full Screen

1const storybookRoot = require('storybook-root');2const targetDir = storybookRoot.targetDir();3const storybookRoot = require('storybook-root');4storybookRoot.storybookRoot();5const storybookRoot = require('storybook-root');6storybookRoot.storybookRoot({7});8### storybookRoot(options)9MIT © [Sarath](

Full Screen

Using AI Code Generation

copy

Full Screen

1import { targetDir } from 'storybook-root-decorator';2export default {3 decorators: [targetDir('src/MyComponent')],4}5### `targetDir()` with arguments6import { targetDir } from 'storybook-root-decorator';7export default {8 decorators: [targetDir('src/MyComponent', 'storybook')],9}10A working example can be found at [storybook-root-decorator-example](

Full Screen

Using AI Code Generation

copy

Full Screen

1const path = require('path');2const { targetDir } = require('storybook-root');3const target = targetDir();4console.log(target);5const path = require('path');6const { targetDir } = require('storybook-root');7const target = targetDir();8console.log(target);9const path = require('path');10const { targetDir } = require('storybook-root');11const target = targetDir();12console.log(target);13const path = require('path');14const { targetDir } = require('storybook-root');15const target = targetDir();16console.log(target);17const path = require('path');18const { targetDir } = require('storybook-root');19const target = targetDir();20console.log(target);21const path = require('path');22const { targetDir } = require('storybook-root');23const target = targetDir();24console.log(target);25const path = require('path');26const { targetDir } = require('storybook-root');27const target = targetDir();28console.log(target);29const path = require('path');30const { targetDir } = require('storybook-root');31const target = targetDir();32console.log(target);33const path = require('path');34const { targetDir } = require('storybook-root');35const target = targetDir();36console.log(target);37const path = require('path');38const { targetDir } = require('storybook-root');39const target = targetDir();40console.log(target);41const path = require('path');42const { targetDir } = require('storybook-root');43const target = targetDir();44console.log(target);

Full Screen

Using AI Code Generation

copy

Full Screen

1var path = require('path');2var storybookRootRequire = require('storybook-root-require');3var targetDir = storybookRootRequire.targetDir;4var myPath = targetDir('src');5console.log(myPath);6var storybookRootRequire = require('storybook-root-require');7var rootRequire = storybookRootRequire.rootRequire;8var test = rootRequire('test');9console.log(test);10var storybookRootRequire = require('storybook-root-require');11var rootRequire = storybookRootRequire.rootRequire;12var test = rootRequire('test');13console.log(test);14var storybookRootRequire = require('storybook-root-require');15var rootRequire = storybookRootRequire.rootRequire;16var test = rootRequire('test');17console.log(test);18var storybookRootRequire = require('storybook-root-require');19var rootRequire = storybookRootRequire.rootRequire;20var test = rootRequire('test');21console.log(test);22var storybookRootRequire = require('storybook-root-require');23var rootRequire = storybookRootRequire.rootRequire;24var test = rootRequire('test');25console.log(test);26var storybookRootRequire = require('storybook-root-require');27var rootRequire = storybookRootRequire.rootRequire;28var test = rootRequire('test');29console.log(test);30var storybookRootRequire = require('storybook-root-require');31var rootRequire = storybookRootRequire.rootRequire;32var test = rootRequire('test');33console.log(test);34var storybookRootRequire = require('storybook-root

Full Screen

Using AI Code Generation

copy

Full Screen

1import { targetDir } from 'storybook-root-decorator'2import { configure } from '@storybook/react'3const req = require.context('../src', true, /.stories.js$/)4function loadStories() {5 req.keys().forEach(filename => req(filename))6}7configure(loadStories, module)8import { targetDir } from 'storybook-root-decorator'9targetDir(__dirname)10import { targetDir } from 'storybook-root-decorator'11targetDir(__dirname)12import { targetDir } from 'storybook-root-decorator'13targetDir(__dirname)14import { targetDir } from 'storybook-root-decorator'15targetDir(__dirname)16import { targetDir } from 'storybook-root-decorator'17targetDir(__dirname)18import { targetDir } from 'storybook-root-decorator'19targetDir(__dirname)20import { targetDir } from 'storybook-root-decorator'21targetDir(__dirname)22import { targetDir } from 'storybook-root-decorator'23targetDir(__dirname)24import { targetDir } from 'storybook-root-decorator'25targetDir(__dirname)

Full Screen

Using AI Code Generation

copy

Full Screen

1var targetDir = require('storybook-root').targetDir;2console.log(targetDir);3var targetDir = require('storybook-root').targetDir;4console.log(targetDir);5var targetDir = require('storybook-root').targetDir;6console.log(targetDir);7var targetDir = require('storybook-root').targetDir;8console.log(targetDir);9var targetDir = require('storybook-root').targetDir;10console.log(targetDir);11var targetDir = require('storybook-root').targetDir;12console.log(targetDir);13var targetDir = require('storybook-root').targetDir;14console.log(targetDir);15var targetDir = require('storybook-root').targetDir;16console.log(targetDir);17var targetDir = require('storybook-root').targetDir;18console.log(targetDir);19var targetDir = require('storybook-root').targetDir;20console.log(targetDir);

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 storybook-root 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