       metadata = grunt.file.readJSON(metadataPath)
       continue unless metadata?.engines?.atom?
 
+      moduleCache = metadata._atomModuleCache ? {}
+
       rm metadataPath
+      _.remove(moduleCache.extensions?['.json'] ? [], 'package.json')
 
       for property in ['_from', '_id', 'dist', 'readme', 'readmeFilename']
         delete metadata[property]

path = require 'path'
CSON = require 'season'
fs = require 'fs-plus'

module.exports = (grunt) ->
  {spawn, rm} = require('./task-helpers')(grunt)


      packages[metadata.name] = pack

      for extension, paths of moduleCache.extensions
        if paths.length is 0
          delete metadata._atomModuleCache?.extensions[extension]

    metadata = grunt.file.readJSON(path.join(appDir, 'package.json'))
    metadata._atomPackages = packages

