jspm-config
Advanced tools
Comparing version 0.1.6 to 0.2.0
@@ -14,5 +14,13 @@ export interface Options { | ||
} | ||
export declare type Browser = string | Overrides; | ||
export interface Overrides { | ||
[dependency: string]: string; | ||
} | ||
export interface JspmPackageJson { | ||
name: string; | ||
main: string; | ||
version?: string; | ||
typings?: string; | ||
browser?: Browser; | ||
browserTypings?: Browser; | ||
directories?: { | ||
@@ -19,0 +27,0 @@ baseURL: string; |
@@ -107,15 +107,20 @@ "use strict"; | ||
function extractJspmPackageJson(packageJson) { | ||
var result = pick(packageJson, [ | ||
'name', | ||
'version', | ||
'main', | ||
'browser', | ||
'typings', | ||
'browserTypings', | ||
'directories', | ||
'configFiles', | ||
'dependencies', | ||
'peerDependencies', | ||
'devDependencies' | ||
]); | ||
if (packageJson.jspm === true) { | ||
return pick(packageJson, [ | ||
'name', | ||
'main', | ||
'directories', | ||
'configFiles', | ||
'dependencies', | ||
'peerDependencies', | ||
'devDependencies' | ||
]); | ||
return result; | ||
} | ||
else if (typeof packageJson.jspm === 'object') { | ||
return packageJson.jspm; | ||
return extend(result, packageJson.jspm); | ||
} | ||
@@ -122,0 +127,0 @@ else { |
import Promise = require('any-promise'); | ||
import { Options, DependencyBranch, DependencyTree } from './interfaces'; | ||
import { Options, DependencyBranch, DependencyTree, JspmPackageJson } from './interfaces'; | ||
export declare function resolveAll(options: Options): Promise<DependencyBranch>; | ||
export declare function resolveByPackageJson(pjson: JspmPackageJson, options: Options): DependencyBranch; | ||
export declare function resolve(moduleName: string, options: Options): Promise<DependencyTree>; |
@@ -7,10 +7,12 @@ "use strict"; | ||
.then(function (pjson) { | ||
return readProjectConfig_1.readJspmConfigs(pjson, options); | ||
}) | ||
.then(function (configs) { | ||
var dependencyInfo = getDependencyInfo(configs); | ||
return readMap(dependencyInfo.map, dependencyInfo.paths, dependencyInfo.packages); | ||
return resolveByPackageJson(pjson, options); | ||
}); | ||
} | ||
exports.resolveAll = resolveAll; | ||
function resolveByPackageJson(pjson, options) { | ||
var configs = readProjectConfig_1.readJspmConfigs(pjson, options); | ||
var dependencyInfo = getDependencyInfo(configs); | ||
return readMap(dependencyInfo.map, dependencyInfo.paths, dependencyInfo.packages); | ||
} | ||
exports.resolveByPackageJson = resolveByPackageJson; | ||
function resolve(moduleName, options) { | ||
@@ -17,0 +19,0 @@ return readProjectConfig_1.readJspmPackageJson(options) |
{ | ||
"name": "jspm-config", | ||
"version": "0.1.6", | ||
"version": "0.2.0", | ||
"description": "Read jspm config and such", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# jspm config | ||
[![Build Status](https://travis-ci.org/unional/jspm-config.svg?branch=master)](https://travis-ci.org/unional/jspm-config) | ||
[![NPM version][npm-image]][npm-url] | ||
[![Travis status][travis-image]][travis-url] | ||
## Roadmap | ||
- [ ] `resolve()` | ||
- [x] `resolve()` and `resolveAll()` | ||
- for `typings i jspm:<pkg>` | ||
@@ -26,1 +27,6 @@ - [ ] `discoverTypings()` or `configSystemJS()` or `configJspm()` | ||
[SystemJS Resolution Specification](https://github.com/systemjs/systemjs/blob/599d89cbe9f4fb39a39f6c52b619cbd1f1da6ffc/docs/resolution-algorithm.md#resolution-specification) | ||
[npm-image]: https://img.shields.io/npm/v/jspm-config.svg?style=flat | ||
[npm-url]: https://npmjs.org/package/jspm-config | ||
[travis-image]: https://travis-ci.org/unional/jspm-config.svg?branch=master | ||
[travis-url]: https://travis-ci.org/unional/jspm-config |
Sorry, the diff of this file is not supported yet
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
34700
387
32