调用服务获取基于统计的自动打包配置
@param  {[type]} module      [description]
@param  {[type]} projectPath [description]
@param  {[type]} settings    [description]
@return {[type]}             [description]
558809
function getLogPackResult(module,projectPath,settings){
    var api = settings['api'] || "http://solar.baidu.com/autopack";
    
    //api参数，模块为必须字段
    var params = settings['params'] || {};
    api += "?module=" + module; //模块信息

    //兼容百度之前配置
    if(api.indexOf("solar.baidu") > -1){
        params['svn'] = params['svn'] || module;
        params['fid'] = params['fid'] || settings['fid'];
        params['return'] = "json";
    }

    fis.util.map(params,function(key,val){
        api += "&" + key + "=" + String(val);
    })

    var packConf = {};

    //通过api同步(编译不支持异步)获取打包配置
    var json = {
        'status' : 'error' 
    }; 
    var confFile = projectPath + "/pack.json";  
    try{
        var response  = request(api);
        var body      = response['body'];
        json          = JSON.parse(body);
    }catch(e){
        json['msg'] = e;
    }
    if(json['status'] == "success"){
        //兼容处理
        if(json['data'] &&　json['data']['_default']){
            json['data'] = json['data']['_default'];
        }
        packConf = json['data'];
       
        if(json['msg'] !=""){
            fis.log.notice(json['msg']); 
        }
        fis.log.notice("[AutoPack] get AutoPack result success");                                  
    }else{
        //获取自动打包失败，沿用上次打包结果
        fis.log.warning("[Autopack] get pack conf error! ".red + json['msg'] ); 

        if(fis.util.exists(confFile)){
            packConf = fis.util.readJSON(confFile);  
        }                
    }
    return packConf;
}
216860
function addSettings(cacheModule){
    cacheModule.nameSpace = settings.nameSpace;
    cacheModule.verbose = settings.verbose;
    return cacheModule;
  }
381073
function findProvidesModule(directories, opts = {}) {
  const options = Object.assign({}, defaultOpts, opts);

  const modulesMap = {};

  const walk = dir => {
    const stat = fs.lstatSync(dir);

    if (stat.isDirectory()) {
      fs.readdirSync(dir).forEach(file => {
        if (options.blacklist.indexOf(file) >= 0) {
          return;
        }
        walk(path.join(dir, file));
      });
      return;
    }

    if (stat.isFile()) {
      const jsFileName = getJSFileName(dir);
      if (!jsFileName) {
        return;
      }

      const fileName = getPlatformFileName(jsFileName, options.platforms);

      const moduleName = getProvidedModuleName(dir);
      if (!moduleName) {
        return;
      }

      // Throw when duplicated modules are provided from a different
      // fileName
      if (modulesMap[moduleName] && modulesMap[moduleName] !== fileName) {
        throw new Error('Duplicate haste module found');
      }
      modulesMap[moduleName] = fileName;
    }
  };

  directories.forEach(walk);

  return modulesMap;
}
509395
def _find_v1_settings(self, settings):
        

        if 'module_name' in settings:
            modname = settings['module_name']
        if 'modules' not in settings or len(settings['modules']) == 0:
            raise DataError("No modules defined in module_settings.json file")
        elif len(settings['modules']) > 1:
            raise DataError("Multiple modules defined in module_settings.json file",
                            modules=[x for x in settings['modules']])
        else:
            modname = list(settings['modules'])[0]

        if modname not in settings['modules']:
            raise DataError("Module name does not correspond with an entry in the modules directory",
                            name=modname, modules=[x for x in settings['modules']])

        release_info = self._load_release_info(settings)
        modsettings = settings['modules'][modname]
        architectures = settings.get('architectures', {})

        target_defs = settings.get('module_targets', {})
        targets = target_defs.get(modname, [])

        return TileInfo(modname, modsettings, architectures, targets, release_info)
64106
function resolveModulePath(relativeToFile, modulePath) {
  if (!isLocalModule(modulePath)) {
    return modulePath;
  }

  const alias = getModuleResolverAlias();
  const matched = _.find(_.keys(alias), k => _.startsWith(modulePath, k));

  let res = null;
  if (matched) {
    const resolveTo = alias[matched];
    const relativePath = modulePath.replace(new RegExp(`^${matched}`), '').replace(/^\//, '');
    res = paths.map(resolveTo, relativePath);
    // res = utils.joinPath(utils.getProjectRoot(), resolveTo, relativePath);
  } else {
    res = paths.join(path.dirname(relativeToFile), modulePath);
  }

  let relPath = res.replace(paths.getProjectRoot(), '').replace(/^\/?/, '');
  if (vio.dirExists(relPath)) {
    // if import from a folder, then resolve to index.js
    relPath = paths.join(relPath, 'index');
  }
  return relPath;
}
68252
def settings_module(self):
        """"""
        settings_module = parse_conf_data(
            os.environ.get(
                self.ENVVAR_FOR_DYNACONF, self.SETTINGS_FILE_FOR_DYNACONF
            ),
            tomlfy=True,
        )
        if settings_module != getattr(self, "SETTINGS_MODULE", None):
            self.set("SETTINGS_MODULE", settings_module)
        return self.SETTINGS_MODULE
164680
function SettingsFile(app, options) {
  if (!app) {
    throw new TypeError('SettingsFile must accept an app name');
  }
  else if (typeof app !== 'string') {
    throw new TypeError('SettingsFile app name must be a string');
  }

  debug('initialize new settings file for app: %s', app);
  this._app = app;
  this._path = nachosHome('data', app + '.json');
  debug('resolved path is %s', this._path);
  this._options = defaults(options, {
    globalDefaults: {},
    instanceDefaults: {}
  });
}
728515
public function outputModule($module, $args = array(), $moduleSettings = array(), $echo = true)
    {
        if (!isset($args['id'])) {
            $args['id'] = 'no-id';
        }

        if (!is_object($module)) {
            return false;
        }

        $class = \Modularity\ModuleManager::$classes[$module->post_type];
        $module = new $class($module, $args);
        $module = $this->fillMissingParams($module, $moduleSettings);

        if (!$echo || !isset($moduleSettings['cache_ttl'])) {
            $moduleSettings['cache_ttl'] = 0;
        }

        $cache = new \Modularity\Helper\Cache($module->ID, array($module, $args['id']), $moduleSettings['cache_ttl']);

        if (empty($moduleSettings['cache_ttl']) || $cache->start()) {
            $moduleMarkup = $this->getModuleMarkup($module, $args);

            if (isset($module->columnWidth) && !empty($module->columnWidth)) {
                $moduleMarkup .= apply_filters('Modularity/Display/AfterModule', '</div>', $args, $module->post_type, $module->ID);
            } elseif (isset($this->options[$args['id']]['after_module']) && !empty($this->options[$args['id']]['after_module'])) {
                $moduleMarkup .= apply_filters('Modularity/Display/AfterModule', '</div>', $args, $module->post_type, $module->ID);
            } elseif (isset($args['after_widget'])) {
                $moduleMarkup .= apply_filters('Modularity/Display/AfterModule', $args['after_widget'], $args, $module->post_type, $module->ID);
            }

            $moduleMarkup = apply_filters('Modularity/Display/Markup', $moduleMarkup, $module);
            $moduleMarkup = apply_filters('Modularity/Display/' . $module->post_type . '/Markup', $moduleMarkup, $module);

            if (!$echo) {
                return $moduleMarkup;
            }

            echo $moduleMarkup;

            if (!empty($moduleSettings['cache_ttl'])) {
                $cache->stop();
            }
        }

        return true;
    }
804801
function importProjectConfig(req, res, next) {
  var options = req.connectionOptions;

  var projectConfigToImport = req.body || [];

  if (!_.isArray(projectConfigToImport)) {
    return next("Expected An Array Of Project Config Values");
  }

  forms.importAppConfig(options, projectConfigToImport, formsResultHandlers(constants.resultTypes.formProjects, req, next));
}
500622
function projectConfigAddPaths(config) {
	config.paths.src[TASK_NAME]  = config.dirs.src  + '/images/';
	config.paths.dest[TASK_NAME] = config.dirs.dest + '/images/';

	return config;
}
530901
function Module( type, name, dir){
  this.name = name;
  this.type = type;
  
  
  var _modulePath  = format('%s/%s', dir, type)
    , _view         = format('%s/%s.%s', _modulePath, 'html', 'hbs')
    , _model        = format('%s/%s.%s', _modulePath, type, 'peb')
    , _controller   = format('%s/%s.%s', _modulePath, type, 'js')
  ;
  
  
  /**
   * Load view 
   */
  this.loadView( _view);
  

  /**
   * Load model 
   */
  this.loadModel( _model);
  

  /**
   * Load controller 
   */
  if( !this.loadController( _controller) 
  &&  !this.view){
    console.error( 'unable to load module `%s` with name `%s` from `%s`', type, name, _modulePath);
  }
  
  
  /**
   *
   */
  if( this.controller){
    if( this.controller.helpers){
      
    }
  }
  
  return this;
}
83029
function (module) {
        "use strict";
    
        var getResource = function (hostType, resource) {
    
            var host;
            var modulePath, filePath;
    
            if (resource.substr(0, 1) === '/') {
                resource = resource.substr(1);
            }
    
            if (hostType === 'module') {
    
                if (module.library) {
                    host = beyond.hosts.libraries[module.library.name].js;
                    library = module.library.name;
                }
                else {
                    host = beyond.hosts.application.js;
                    library = undefined;
                }
    
                modulePath = module.path;
                filePath = resource;
    
            }
            else if (hostType === 'application') {
    
                host = beyond.hosts.application.js;
                return host + resource;
    
            }
            else {
    
                var library = hostType;
                host = beyond.hosts.libraries[library];
    
                if (!host) {
                    console.warn('invalid css host on module "' + module.ID + '", resource "' + resource + '"' +
                        ', library "' + library + '" is not defined');
                    return;
                }
    
                if (resource.substr(0, 7) === 'static/') {
                    modulePath = 'main';
                    filePath = resource.substr(7);
                }
                else {
                    var overwrite = resource.split('/static/');
                    modulePath = overwrite[0];
                    filePath = overwrite[1];
                }
    
            }
    
            var overwrites = beyond.overwrites;
            var overwrited;
            if (library) {
                overwrited = overwrites[library];
            }
    
            if (!overwrited || !overwrited[modulePath] ||
                overwrited[modulePath].indexOf(filePath) === -1) {
    
                return host + modulePath + '/static/' + filePath;
            }
    
            return beyond.hosts.application.js +
                'custom/' + library + '/' +
                modulePath + '/static/' + filePath;
    
        };
    
        var setHosts = function (styles) {
    
            // find variables
            var variable;
    
            var replace = {};
    
            var regexp = /#host\.(.*?)#(.*?)[\)\s]/g;
            variable = regexp.exec(styles);
    
            var resource;
            while (variable) {
    
                // hostType can be 'application', 'module', libraryName
                var hostType = variable[1];
                resource = variable[2];
                resource = getResource(hostType, resource);
    
                var original = variable[0];
                if (original.substr(original.length - 1) === ')')
                    original = original.substr(0, original.length - 1);
    
                replace[original] = resource;
                variable = regexp.exec(styles);
    
            }
    
            // replace #host.* variables with their values
            for (var original in replace) {
    
                resource = replace[original];
    
                while (styles.indexOf(original) !== -1)
                    styles = styles.replace(original, resource);
    
            }
    
            return styles;
    
        };
    
        this.process = function (styles) {
    
            // find and replace #host...
            styles = setHosts(styles);
            return styles;
    
        };
    
    }
1308851
function findProjectRoot(startPath) {
    log.trace("findProjectRoot startPath = %s", startPath);
    if(isDiskRoot()) {
      if(hasPackageJson()) {
        return startPath;
      } else {
        throw new Error("Cannot find project root");
      }
    } else if(hasPackageJson()) {
      return startPath;
    } else {
      return findProjectRoot(PATH.resolve(startPath+PATH.sep+".."));
    }

    function hasPackageJson() {
      return fs.existsSync(startPath+PATH.sep+"package.json");
    }

    function isDiskRoot() {
      return startPath.match(/^([A-Z]:\\\\|\/)$/);
    }
  }
535475
function getProjectModule(context) {
    const projectRoot = getProjectRoot(context);
    const projectPath = path.join(projectRoot, "platforms", "ios");

    try {
      // pre 5.0 cordova structure
      return context
        .requireCordovaModule("cordova-lib/src/plugman/platforms")
        .ios.parseProjectFile(projectPath);
    } catch (e) {
      try {
        // pre 7.0 cordova structure
        return context
          .requireCordovaModule("cordova-lib/src/plugman/platforms/ios")
          .parseProjectFile(projectPath);
      } catch (e) {
        // post 7.0 cordova structure
        return getProjectModuleGlob(context);
      }
    }
  }
138459
function (filePath)
		{
			if (typeof arguments[1]=='function')
				var cb = arguments[1];

			if (typeof arguments[2]=='function')
				var cb = arguments[2];

			var binary = typeof arguments[1]=='boolean' ? arguments[1] : false,
				realPath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath,
				cmd = !cb ? 'readFileSync' : 'readFile';

			try {
				var _cb = cb ? function (err,file) {
					cb&&cb(!err ? ((binary===true) ? file : file.toString()) : false);
				} : null,
				file = fs[cmd](realPath,_cb);
			} catch (e)
			{
				if (_cb)
					cb&&cb(false);
				else
					return false;
			}
			return (file ? (binary===true) ? file : file.toString() : false);
		}
439800
function fixDemoModuleTs(module, demoFolder) {
    // @NgModule()里必须包含一个exports，用于将组件暴露给上级组件
    var comp = findExportsComponent(module.code);
    if (!comp) {
        console.error('ERROR: need a "exports" property in the module code, ' +
                    'and the value of which should contains only one component!');
        console.error(`       module path=${demoFolder}`);
        process.exit(1);
    }

    // 删除 JigsawDemoDescriptionModule 相关的东西
    module.code = module.code.replace(/import\s*{\s*JigsawDemoDescriptionModule\s*}\s*from.*\r?\n/, '');
    module.code = module.code.replace(/\bJigsawDemoDescriptionModule\b\s*,?/g, '');
}
352028
function create(modulePath, moduleStack, options) {

        // the 'FromPlugin' suffix is used when a project wants to override a plugin module
        if (modulePath === /.*FromPlugin/) {
            modulePath = modulePath.substring(0, modulePath.length - 10);
        }
        modulePath = modulePath.toLowerCase();

        // first check the cache to see if we already loaded it
        if (this.cache[modulePath]) {
            return this.cache[modulePath];
        }

        // if module not in server modules, return null
        var flapjack = this.serverModules[modulePath];
        if (!flapjack) {
            return null;
        }

        // switch to server if exists
        flapjack = flapjack.server ? flapjack.server : flapjack;

        // if flapjack is not a function, just return it (i.e. its just a normal require()
        if (!_.isFunction(flapjack)) {
            this.cache[modulePath] = flapjack;
            return flapjack;
        }

        this.cache[modulePath] = this.injector.injectFlapjack(flapjack, moduleStack, options);
        return this.cache[modulePath];
    }