💄 Group exported methods

This commit is contained in:
Kevin Sawicki
2014-10-08 08:37:57 -07:00
committed by Kevin Sawicki
parent 36ff22e30a
commit 26df31aa1f
2 changed files with 18 additions and 16 deletions

View File

@@ -73,22 +73,6 @@ loadFolderCompatibility = (modulePath, rootPath, rootMetadata, moduleCache) ->
undefined
exports.create = (modulePath) ->
metadataPath = path.join(modulePath, 'package.json')
metadata = JSON.parse(fs.readFileSync(metadataPath))
moduleCache =
version: 1
dependencies: []
folders: []
loadDependencies(modulePath, modulePath, metadata, moduleCache)
loadFolderCompatibility(modulePath, modulePath, metadata, moduleCache)
metadata._atomModuleCache = moduleCache
fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2))
undefined
satisfies = (version, rawRange) ->
unless parsedRange = cache.ranges[rawRange]
parsedRange = new semver.Range(rawRange)
@@ -136,6 +120,22 @@ if debug
global.requireTime += Date.now() - startTime
exports
exports.create = (modulePath) ->
metadataPath = path.join(modulePath, 'package.json')
metadata = JSON.parse(fs.readFileSync(metadataPath))
moduleCache =
version: 1
dependencies: []
folders: []
loadDependencies(modulePath, modulePath, metadata, moduleCache)
loadFolderCompatibility(modulePath, modulePath, metadata, moduleCache)
metadata._atomModuleCache = moduleCache
fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2))
undefined
registered = false
exports.register = ->
return if registered

View File

@@ -10,6 +10,7 @@ Q = require 'q'
{deprecate} = require 'grim'
$ = null # Defer require in case this is in the window-less browser process
ModuleCache = require './module-cache'
ScopedProperties = require './scoped-properties'
# Loads and activates a package's main module and resources such as
@@ -47,6 +48,7 @@ class Package
@emitter = new Emitter
@metadata ?= Package.loadMetadata(@path)
@name = @metadata?.name ? path.basename(@path)
ModuleCache.add(@path, @metadata)
@reset()
###