     @deactivateResources()
     @deactivateConfig()
     @mainModule?.deactivate?() if @mainActivated
+    @trigger('deactivated')
 
   deactivateConfig: ->
     @mainModule?.deactivateConfig?()

  loadStylesheets: ->
    @stylesheets = @getStylesheetPaths().map (stylesheetPath) -> [stylesheetPath, loadStylesheet(stylesheetPath)]

  getStylesheetPaths: ->
    stylesheetDirPath = path.join(@path, 'stylesheets')
    if @metadata.stylesheets
      @metadata.stylesheets.map (name) -> fsUtils.resolve(stylesheetDirPath, name, ['css', 'less', ''])
    else

_ = require 'underscore'
$ = require 'jquery'
CSON = require 'season'
EventEmitter = require 'event-emitter'

### Internal: Loads and resolves packages. ###

module.exports =
class AtomPackage extends Package
  _.extend @prototype, EventEmitter

  metadata: null
  keymaps: null
  stylesheets: null
