text: // Generated by LiveScript 1.2.0
  (function(){
    var FileIO, Installer, Enricher, Normalizer, GlobalConfig, gconf, util, BaseAdapter;
    FileIO = require('../../util/file-io');
    Installer = require('../config/installer');
    Enricher = require('../config/enricher');
    Normalizer = require('../config/normalizer');
    GlobalConfig = require('../../global-config');
    gconf = new GlobalConfig;
    util = require('util');
    module.exports = BaseAdapter = (function(){
      BaseAdapter.displayName = 'BaseAdapter';
      var prototype = BaseAdapter.prototype, constructor = BaseAdapter;
      importAll$(prototype, arguments[0]);
      function BaseAdapter(options){
        this.options = options != null
          ? options
          : {};
        this.registryUri = this.options.registry || this.defaultRegistryUri();
        this.localRegistryPath = this.options.local || this.defaultComponentsDir();
        this.validate();
        this;
      }
      prototype.defaultComponentsDir = function(){
        return gconf.location('components.dir') || './xlibs/components/';
      };
      prototype.defaultRegistryUri = function(){
        return "https://raw.githubusercontent.com/kristianmandrup/libraries/master/registry";
      };
      prototype.validate = function(){};
      prototype.enricher = function(config){
        return this._enricher || (this._enricher = new Enricher(config, this.options));
      };
      prototype.enrich = function(config){
        return this.config = this.enricher(config).enrich();
      };
      prototype.normalizer = function(config){
        return this._normalizer || (this._normalizer = new Normalizer(config, this.options));
      };
      prototype.normalize = function(config){
        return this.config = this.normalizer(config).normalize();
      };
      prototype.enrichAndNormalize = function(name){
        var this$ = this;
        return this.readConfig(name).then(function(res){
          return this$.normalize(res);
        });
      };
      prototype.install = function(name){
        return this.installer().install(name, {
          source: this.enrichedConfig(name),
          target: this.targetConfig(name)
        });
      };
      prototype.enrichedConfig = function(name){
        return this.enrichAndNormalize();
      };
      prototype.installer = function(type){
        type || (type = this.installerType);
        return this._installer || (this._installer = new Installer(type));
      };
      prototype.list = function(){
        return this._list || (this._list = this.index().registry);
      };
      prototype.has = function(name){
        return this.list().indexOf(name) > -1;
      };
      prototype.configFile = function(name){
        return [this.registryUri, name + ".json"].join('/');
      };
      prototype.targetConfig = function(name){
        return [this.localRegistryPath, name + ".json"].join('/');
      };
      prototype.error = function(msg){
        return console.error(msg);
      };
      return BaseAdapter;
    }(FileIO));
    function importAll$(obj, src){
      for (var key in src) obj[key] = src[key];
      return obj;
    }
  }).call(this);
  