jspm-config
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -27,3 +27,3 @@ export interface Options { | ||
baseURL: string; | ||
packages: string; | ||
packages?: string; | ||
}; | ||
@@ -62,3 +62,3 @@ configFiles?: ConfigFiles; | ||
jspmConfigs: Configs; | ||
dependenciesJson: DependenciesJson; | ||
dependenciesJson?: DependenciesJson; | ||
} | ||
@@ -65,0 +65,0 @@ export interface PathMap { |
@@ -34,6 +34,20 @@ "use strict"; | ||
function readDependenciesJson(jspmPackageJson, options) { | ||
var packages = jspmPackageJson.directories ? | ||
jspmPackageJson.directories.packages : | ||
constants_1.JSPM_PACKAGE_JSON_DEFAULT.directories.packages; | ||
return fs_1.readJson(path.join(options.cwd, packages, '.dependencies.json')).catch(function (err) { | ||
var packages; | ||
if (jspmPackageJson.directories) { | ||
if (jspmPackageJson.directories.packages) { | ||
packages = jspmPackageJson.directories.packages; | ||
} | ||
else if (jspmPackageJson.directories.baseURL) { | ||
packages = path.join(jspmPackageJson.directories.baseURL, constants_1.JSPM_PACKAGE_JSON_DEFAULT.directories.packages); | ||
} | ||
else { | ||
packages = constants_1.JSPM_PACKAGE_JSON_DEFAULT.directories.packages; | ||
} | ||
} | ||
else { | ||
packages = constants_1.JSPM_PACKAGE_JSON_DEFAULT.directories.packages; | ||
} | ||
var filePath = path.join(options.cwd, packages, '.dependencies.json'); | ||
console.log(filePath); | ||
return fs_1.readJson(filePath).catch(function (err) { | ||
if (err.code === 'ENOENT') { | ||
@@ -54,5 +68,3 @@ return; | ||
function readJspmConfigs(jspmPackageJson, options) { | ||
var baseURL = jspmPackageJson.directories ? | ||
jspmPackageJson.directories.baseURL : | ||
constants_1.JSPM_PACKAGE_JSON_DEFAULT.directories.baseURL; | ||
var baseURL = jspmPackageJson.directories && jspmPackageJson.directories.baseURL || constants_1.JSPM_PACKAGE_JSON_DEFAULT.directories.baseURL; | ||
var configFiles = extend(constants_1.JSPM_PACKAGE_JSON_DEFAULT.configFiles, jspmPackageJson.configFiles); | ||
@@ -59,0 +71,0 @@ var cwd = options.cwd; |
{ | ||
"name": "jspm-config", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Read jspm config and such", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42672
480