parameters: (path)
return_statement: return config
docstring: Create a config for a parsed package.json. Returns None if it is not a
      Nuclide package.
  
      No code in this library should parse a package.json file directly. Instead,
      it should operate on a package config that is created by this method.
      Because we may read extra properties in package.json, such as "customDeps",
      it is critical that all scripts operate on a normalized package config
      rather than a raw package.json.
docstring_summary: Create a config for a parsed package.json. Returns None if it is not a
      Nuclide package.
docstring_tokens: Create a config for a parsed package . json . Returns None if it is not a Nuclide package .
function: def create_config_for_package(path):
      """Create a config for a parsed package.json. Returns None if it is not a
      Nuclide package.
  
      No code in this library should parse a package.json file directly. Instead,
      it should operate on a package config that is created by this method.
      Because we may read extra properties in package.json, such as "customDeps",
      it is critical that all scripts operate on a normalized package config
      rather than a raw package.json.
      """
      pkg = utils.json_load(path)
      nuclide_config = pkg.get("nuclide", {})
  
      config = {}
  
      # Standard package.json fields
      config["name"] = pkg["name"]
      config["repository"] = pkg.get("repository")
      config["version"] = pkg.get("version")
      config["description"] = pkg.get("description")
      config["license"] = pkg.get("license")
      config["main"] = pkg.get("main")
      config["author"] = pkg.get("author", "")
      config["dependencies"] = pkg.get("dependencies", {})
      config["optionalDependencies"] = pkg.get("optionalDependencies", {})
      config["devDependencies"] = pkg.get("devDependencies", {})
      config["providedServices"] = pkg.get("providedServices", {})
      config["consumedServices"] = pkg.get("consumedServices", {})
      # Both spellings are acceptable:
      config["bundleDependencies"] = pkg.get("bundleDependencies", {})
      config["bundledDependencies"] = pkg.get("bundledDependencies", {})
      config["scripts"] = pkg.get("scripts", {})
      config["private"] = pkg.get("private", False)
      config["engines"] = pkg.get("engines")
  
      # Custom Nuclide fields
      config["packageRootAbsolutePath"] = os.path.dirname(path)
      config["packageType"] = nuclide_config.get("packageType")
      config["isNodePackage"] = nuclide_config.get("packageType") == "Node"
      config["testRunner"] = nuclide_config.get("testRunner")
      config["testsCannotBeRunInParallel"] = nuclide_config.get(
          "testsCannotBeRunInParallel", False
      )
      config["excludeTestsFromContinuousIntegration"] = nuclide_config.get(
          "excludeTestsFromContinuousIntegration", False
      )
      config["atomTestRunner"] = pkg.get("atomTestRunner")
      config["_atomModuleCache"] = pkg.get("_atomModuleCache")
      config["_rawPkg"] = pkg
  
      return config
function_tokens: def create_config_for_package ( path ) : pkg = utils . json_load ( path ) nuclide_config = pkg . get ( "nuclide" , { } ) config = { } # Standard package.json fields config [ "name" ] = pkg [ "name" ] config [ "repository" ] = pkg . get ( "repository" ) config [ "version" ] = pkg . get ( "version" ) config [ "description" ] = pkg . get ( "description" ) config [ "license" ] = pkg . get ( "license" ) config [ "main" ] = pkg . get ( "main" ) config [ "author" ] = pkg . get ( "author" , "" ) config [ "dependencies" ] = pkg . get ( "dependencies" , { } ) config [ "optionalDependencies" ] = pkg . get ( "optionalDependencies" , { } ) config [ "devDependencies" ] = pkg . get ( "devDependencies" , { } ) config [ "providedServices" ] = pkg . get ( "providedServices" , { } ) config [ "consumedServices" ] = pkg . get ( "consumedServices" , { } ) # Both spellings are acceptable: config [ "bundleDependencies" ] = pkg . get ( "bundleDependencies" , { } ) config [ "bundledDependencies" ] = pkg . get ( "bundledDependencies" , { } ) config [ "scripts" ] = pkg . get ( "scripts" , { } ) config [ "private" ] = pkg . get ( "private" , False ) config [ "engines" ] = pkg . get ( "engines" ) # Custom Nuclide fields config [ "packageRootAbsolutePath" ] = os . path . dirname ( path ) config [ "packageType" ] = nuclide_config . get ( "packageType" ) config [ "isNodePackage" ] = nuclide_config . get ( "packageType" ) == "Node" config [ "testRunner" ] = nuclide_config . get ( "testRunner" ) config [ "testsCannotBeRunInParallel" ] = nuclide_config . get ( "testsCannotBeRunInParallel" , False ) config [ "excludeTestsFromContinuousIntegration" ] = nuclide_config . get ( "excludeTestsFromContinuousIntegration" , False ) config [ "atomTestRunner" ] = pkg . get ( "atomTestRunner" ) config [ "_atomModuleCache" ] = pkg . get ( "_atomModuleCache" ) config [ "_rawPkg" ] = pkg return config