Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Kill defaultAmbientSource feature
Browse files Browse the repository at this point in the history
Seems to be a source of confusion and a reason people never learn how it works, hence more logged issues.
  • Loading branch information
blakeembrey committed May 15, 2016
1 parent cf58016 commit cec52d4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/interfaces/rc.ts
Expand Up @@ -50,8 +50,4 @@ export interface RcConfig {
* Override the default installation source (E.g. when doing `typings install debug`) (default: `npm`).
*/
defaultSource?: string
/**
* Override the default ambient installation source (E.g. when doing `typings install node -A`) (default: `dt`).
*/
defaultAmbientSource?: string
}
8 changes: 0 additions & 8 deletions src/utils/parse.spec.ts
Expand Up @@ -332,14 +332,6 @@ test('parse', t => {
t.end()
})

t.test('expand registry with default ambient source', t => {
const actual = expandRegistry('node', { ambient: true })
const expected = 'registry:dt/node'

t.deepEqual(actual, expected)
t.end()
})

t.test('unknown scheme', t => {
t.throws(() => parseDependency('random:fake/dep'), /Unknown dependency: /)
t.end()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/parse.ts
Expand Up @@ -271,7 +271,7 @@ export function expandRegistry (raw: string, options: { ambient?: boolean }) {
}

const indexOf = raw.indexOf('~')
let source = options.ambient ? rc.defaultAmbientSource : rc.defaultSource
let source = rc.defaultSource
let name: string

if (indexOf === -1) {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/rc.ts
Expand Up @@ -6,8 +6,7 @@ import { RcConfig } from '../interfaces'
export const DEFAULTS = {
userAgent: `${PROJECT_NAME}/{typingsVersion} node/{nodeVersion} {platform} {arch}`,
registryURL: REGISTRY_URL,
defaultSource: 'npm',
defaultAmbientSource: 'dt'
defaultSource: 'npm'
}

export default extend(DEFAULTS, rc(PROJECT_NAME)) as RcConfig

0 comments on commit cec52d4

Please sign in to comment.