How to use configFilePath method in storybook-root

Best JavaScript code snippet using storybook-root

CCArmatureDataManager.js

Source:CCArmatureDataManager.js Github

copy

Full Screen

1/****************************************************************************2 Copyright (c) 2011-2012 cocos2d-x.org3 Copyright (c) 2013-2014 Chukong Technologies Inc.4 http://www.cocos2d-x.org5 Permission is hereby granted, free of charge, to any person obtaining a copy6 of this software and associated documentation files (the "Software"), to deal7 in the Software without restriction, including without limitation the rights8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell9 copies of the Software, and to permit persons to whom the Software is10 furnished to do so, subject to the following conditions:11 The above copyright notice and this permission notice shall be included in12 all copies or substantial portions of the Software.13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE16 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER17 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,18 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN19 THE SOFTWARE.20 ****************************************************************************/21/**22 * RelativeData uses to save plist files, armature files, animations and textures for armature data manager.23 * @constructor24 */25ccs.RelativeData = function(){26 this.plistFiles=[];27 this.armatures=[];28 this.animations=[];29 this.textures=[];30};31/**32 * ccs.armatureDataManager is a singleton object which format and manage armature configuration and armature animation33 * @class34 * @name ccs.armatureDataManager35 */36ccs.armatureDataManager = /** @lends ccs.armatureDataManager# */{37 _animationDatas: {},38 _armatureDatas: {},39 _textureDatas: {},40 _autoLoadSpriteFile: false,41 _relativeDatas: {},42 s_sharedArmatureDataManager: null,43 /**44 * Removes armature cache data by configFilePath45 * @param {String} configFilePath46 */47 removeArmatureFileInfo:function(configFilePath){48 var data = this.getRelativeData(configFilePath);49 if(data){50 var i, obj;51 for (i = 0; i < data.armatures.length; i++) {52 obj = data.armatures[i];53 this.removeArmatureData(obj);54 }55 for ( i = 0; i < data.animations.length; i++) {56 obj = data.animations[i];57 this.removeAnimationData(obj);58 }59 for ( i = 0; i < data.textures.length; i++) {60 obj = data.textures[i];61 this.removeTextureData(obj);62 }63 for ( i = 0; i < data.plistFiles.length; i++) {64 obj = data.plistFiles[i];65 cc.spriteFrameCache.removeSpriteFramesFromFile(obj);66 }67 delete this._relativeDatas[configFilePath];68 ccs.dataReaderHelper.removeConfigFile(configFilePath);69 }70 },71 /**72 * Adds armature data73 * @param {string} id The id of the armature data74 * @param {ccs.ArmatureData} armatureData75 */76 addArmatureData:function (id, armatureData, configFilePath) {77 var data = this.getRelativeData(configFilePath);78 if (data){79 data.armatures.push(id);80 }81 this._armatureDatas[id] = armatureData;82 },83 /**84 * Gets armatureData by id85 * @param {String} id86 * @return {ccs.ArmatureData}87 */88 getArmatureData:function (id) {89 var armatureData = null;90 if (this._armatureDatas) {91 armatureData = this._armatureDatas[id];92 }93 return armatureData;94 },95 /**96 * Removes armature data from armature data manager.97 * @param {string} id98 */99 removeArmatureData:function(id){100 if (this._armatureDatas[id])101 delete this._armatureDatas[id];102 },103 /**104 * Adds animation data to armature data manager.105 * @param {String} id106 * @param {ccs.AnimationData} animationData107 */108 addAnimationData:function (id, animationData, configFilePath) {109 var data = this.getRelativeData(configFilePath);110 if(data)111 data.animations.push(id);112 this._animationDatas[id] = animationData;113 },114 /**115 * Gets animationData by id116 * @param {String} id117 * @return {ccs.AnimationData}118 */119 getAnimationData:function (id) {120 var animationData = null;121 if (this._animationDatas[id]) {122 animationData = this._animationDatas[id];123 }124 return animationData;125 },126 /**127 * Removes animation data128 * @param {string} id129 */130 removeAnimationData:function(id){131 if (this._animationDatas[id])132 delete this._animationDatas[id];133 },134 /**135 * Adds texture data to Armature data manager.136 * @param {String} id137 * @param {ccs.TextureData} textureData138 */139 addTextureData:function (id, textureData, configFilePath) {140 var data = this.getRelativeData(configFilePath);141 if (data) {142 data.textures.push(id);143 }144 this._textureDatas[id] = textureData;145 },146 /**147 * Gets textureData by id148 * @param {String} id149 * @return {ccs.TextureData}150 */151 getTextureData:function (id) {152 var textureData = null;153 if (this._textureDatas) {154 textureData = this._textureDatas[id];155 }156 return textureData;157 },158 /**159 * Removes texture data by id160 * @param {string} id161 */162 removeTextureData:function(id){163 if (this._textureDatas[id])164 delete this._textureDatas[id];165 },166 /**167 * Adds ArmatureFileInfo, it is managed by CCArmatureDataManager.168 * @param {String} imagePath169 * @param {String} plistPath170 * @param {String} configFilePath171 * @example172 * //example1173 * ccs.armatureDataManager.addArmatureFileInfo("res/test.json");174 * //example2175 * ccs.armatureDataManager.addArmatureFileInfo("res/test.png","res/test.plist","res/test.json");176 */177 addArmatureFileInfo:function (/*imagePath, plistPath, configFilePath*/) {178 var imagePath, plistPath, configFilePath;179 switch(arguments.length){180 case 1:181 configFilePath = arguments[0];182 this.addRelativeData(configFilePath);183 this._autoLoadSpriteFile = true;184 ccs.dataReaderHelper.addDataFromFile(configFilePath);185 break;186 case 3:187 imagePath = arguments[0];188 plistPath = arguments[1];189 configFilePath = arguments[2];190 this.addRelativeData(configFilePath);191 this._autoLoadSpriteFile = false;192 ccs.dataReaderHelper.addDataFromFile(configFilePath);193 this.addSpriteFrameFromFile(plistPath, imagePath);194 }195 },196 /**197 * Adds ArmatureFileInfo, it is managed by CCArmatureDataManager.198 * @param {String} imagePath199 * @param {String} plistPath200 * @param {String} configFilePath201 * @param {Function} selector202 * @param {Object} target203 */204 addArmatureFileInfoAsync:function (/*imagePath, plistPath, configFilePath, selector, target*/) {205 var imagePath, plistPath, configFilePath, target, selector;206 switch(arguments.length){207 case 3:208 configFilePath = arguments[0];209 target = arguments[2];210 selector = arguments[1];211 this.addRelativeData(configFilePath);212 this._autoLoadSpriteFile = true;213 ccs.dataReaderHelper.addDataFromFileAsync("", "", configFilePath, selector,target);214 break;215 case 5:216 imagePath = arguments[0];217 plistPath = arguments[1];218 configFilePath = arguments[2];219 target = arguments[4];220 selector = arguments[3];221 this.addRelativeData(configFilePath);222 this._autoLoadSpriteFile = false;223 ccs.dataReaderHelper.addDataFromFileAsync(imagePath, plistPath, configFilePath, selector, target);224 this.addSpriteFrameFromFile(plistPath, imagePath);225 }226 },227 /**228 * Add sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name229 * @param {String} plistPath230 * @param {String} imagePath231 * @param {String} configFilePath232 */233 addSpriteFrameFromFile:function (plistPath, imagePath, configFilePath) {234 var data = this.getRelativeData(configFilePath);235 if(data)236 data.plistFiles.push(plistPath);237 ccs.spriteFrameCacheHelper.addSpriteFrameFromFile(plistPath, imagePath);238 },239 /**240 * Returns whether or not need auto load sprite file241 * @returns {boolean}242 */243 isAutoLoadSpriteFile:function(){244 return this._autoLoadSpriteFile;245 },246 /**247 * Returns armature Data of Armature data manager.248 * @return {Object}249 */250 getArmatureDatas:function () {251 return this._armatureDatas;252 },253 /**254 * Returns animation data of Armature data manager.255 * @return {Object}256 */257 getAnimationDatas:function () {258 return this._animationDatas;259 },260 /**261 * Returns texture data of Armature data manager.262 * @return {Object}263 */264 getTextureDatas:function () {265 return this._textureDatas;266 },267 /**268 * Adds Relative data of Armature data manager.269 * @param {String} configFilePath270 */271 addRelativeData: function (configFilePath) {272 if (!this._relativeDatas[configFilePath])273 this._relativeDatas[configFilePath] = new ccs.RelativeData();274 },275 /**276 * Gets RelativeData of Armature data manager.277 * @param {String} configFilePath278 * @returns {ccs.RelativeData}279 */280 getRelativeData: function (configFilePath) {281 return this._relativeDatas[configFilePath];282 },283 /**284 * Clear data285 */286 clear: function() {287 this._animationDatas = {};288 this._armatureDatas = {};289 this._textureDatas = {};290 ccs.spriteFrameCacheHelper.clear();291 ccs.dataReaderHelper.clear();292 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const configFilePath = require('storybook-root').configFilePath;2const config = configFilePath('config.js');3const configDirPath = require('storybook-root').configDirPath;4const config = configDirPath('config');5const storybookDirPath = require('storybook-root').storybookDirPath;6const config = storybookDirPath('config');7const storybookFilePath = require('storybook-root').storybookFilePath;8const config = storybookFilePath('config');9const storybookFilePath = require('storybook-root').storybookFilePath;10const config = storybookFilePath('config');11const storybookFilePath = require('storybook-root').storybookFilePath;12const config = storybookFilePath('config');13const storybookFilePath = require('storybook-root').storybookFilePath;14const config = storybookFilePath('config');15const storybookFilePath = require('storybook-root').storybookFilePath;16const config = storybookFilePath('config');17const storybookFilePath = require('storybook-root').storybookFilePath;18const config = storybookFilePath('config');19const storybookFilePath = require('storybook-root').storybookFilePath;20const config = storybookFilePath('config');21const storybookFilePath = require('storybook-root').storybookFilePath;22const config = storybookFilePath('config');23const storybookFilePath = require('storybook-root').storybookFilePath;24const config = storybookFilePath('config');25const storybookFilePath = require('storybook-root').storybookFilePath;26const config = storybookFilePath('config');27const storybookFilePath = require('storybook-root').storybookFilePath;28const config = storybookFilePath('config');

Full Screen

Using AI Code Generation

copy

Full Screen

1const storybookRoot = require('storybook-root');2const path = require('path');3const configFilePath = storybookRoot.configFilePath();4const configDirPath = path.dirname(configFilePath);5console.log('configFilePath', configFilePath);6console.log('configDirPath', configDirPath);7const storybookRoot = require('storybook-root');8const path = require('path');9const configDirPath = storybookRoot.configDirPath();10const configFilePath = path.join(configDirPath, 'config.js');11console.log('configDirPath', configDirPath);12console.log('configFilePath', configFilePath);13const storybookRoot = require('storybook-root');14const path = require('path');15const configDirPath = storybookRoot.configDirPath();16const configFilePath = path.join(configDirPath, 'config.js');17console.log('configDirPath', configDirPath);18console.log('configFilePath', configFilePath);19const storybookRoot = require('storybook-root');20const path = require('path');21const configDirPath = storybookRoot.configDirPath();22const configFilePath = path.join(configDirPath, 'config.js');23console.log('configDirPath', configDirPath);24console.log('configFilePath', configFilePath);25const storybookRoot = require('storybook-root');26const path = require('path');

Full Screen

Using AI Code Generation

copy

Full Screen

1const configFilePath = require('storybook-root').configFilePath;2const storybookConfigPath = configFilePath();3console.log('storybookConfigPath', storybookConfigPath);4const configFilePath = require('storybook-root').configFilePath;5const storybookConfigPath = configFilePath();6console.log('storybookConfigPath', storybookConfigPath);7const configFilePath = require('storybook-root').configFilePath;8const storybookConfigPath = configFilePath();9console.log('storybookConfigPath', storybookConfigPath);10const configFilePath = require('storybook-root').configFilePath;11const storybookConfigPath = configFilePath();12console.log('storybookConfigPath', storybookConfigPath);13const configFilePath = require('storybook-root').configFilePath;14const storybookConfigPath = configFilePath();15console.log('storybookConfigPath', storybookConfigPath);16const configFilePath = require('storybook-root').configFilePath;17const storybookConfigPath = configFilePath();18console.log('storybookConfigPath', storybookConfigPath);19const configFilePath = require('storybook-root').configFilePath;20const storybookConfigPath = configFilePath();21console.log('storybookConfigPath', storybookConfigPath);22const configFilePath = require('storybook-root').configFilePath;23const storybookConfigPath = configFilePath();24console.log('storybookConfigPath', storybookConfigPath);25const configFilePath = require('storybook-root').configFilePath;26const storybookConfigPath = configFilePath();27console.log('storybookConfigPath', storybookConfigPath);28const configFilePath = require('storybook-root').configFilePath;29const storybookConfigPath = configFilePath();30console.log('storybookConfigPath', storybookConfigPath);31const configFilePath = require('storybook-root').configFilePath;32const storybookConfigPath = configFilePath();33console.log('storybookConfigPath', storybookConfigPath);

Full Screen

Using AI Code Generation

copy

Full Screen

1const configFilePath = require('storybook-root').configFilePath;2console.log(configFilePath);3const configDir = require('storybook-root').configDir;4console.log(configDir);5const storiesGlob = require('storybook-root').storiesGlob;6console.log(storiesGlob);7const storiesDir = require('storybook-root').storiesDir;8console.log(storiesDir);9const stories = require('storybook-root').stories;10console.log(stories);11const storybookRoot = require('storybook-root').storybookRoot;12console.log(storybookRoot);13const storybookDir = require('storybook-root').storybookDir;14console.log(storybookDir);15const storybookConfigDir = require('storybook-root').storybookConfigDir;16console.log(storybookConfigDir);17const storybookConfigFilePath = require('storybook-root').storybookConfigFilePath;18console.log(storybookConfigFilePath);19const storybookStoriesDir = require('storybook-root').storybookStoriesDir;20console.log(storybookStoriesDir);

Full Screen

Using AI Code Generation

copy

Full Screen

1const rootDirs = require('storybook-root-dirs');2const path = require('path');3const storybookConfigPath = rootDirs.configFilePath('storybook');4console.log(storybookConfigPath);5const rootDirs = require('storybook-root-dirs');6const path = require('path');7const storybookRootDir = rootDirs.storybookRootDir();8console.log(storybookRootDir);9const rootDirs = require('storybook-root-dirs');10const path = require('path');11const projectRootDir = rootDirs.projectRootDir();12console.log(projectRootDir);13const rootDirs = require('storybook-root-dirs');14const path = require('path');15const srcDir = rootDirs.srcDir();16console.log(srcDir);17const rootDirs = require('storybook-root-dirs');18const path = require('path');19const testDir = rootDirs.testDir();20console.log(testDir);21const rootDirs = require('storybook-root-dirs');22const path = require('path');23const storybookDir = rootDirs.storybookDir();24console.log(storybookDir);25const rootDirs = require('storybook-root-dirs');26const path = require('path');27const storybookConfigDir = rootDirs.storybookConfigDir();28console.log(storybookConfigDir);29const rootDirs = require('storybook-root-dirs');

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