From cec52d4cb0849a7a203a5eab67127c6094c6c2d1 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Sun, 15 May 2016 09:36:27 -0700 Subject: [PATCH] Kill `defaultAmbientSource` feature Seems to be a source of confusion and a reason people never learn how it works, hence more logged issues. --- src/interfaces/rc.ts | 4 ---- src/utils/parse.spec.ts | 8 -------- src/utils/parse.ts | 2 +- src/utils/rc.ts | 3 +-- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/interfaces/rc.ts b/src/interfaces/rc.ts index 923705f..b4d923f 100644 --- a/src/interfaces/rc.ts +++ b/src/interfaces/rc.ts @@ -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 } diff --git a/src/utils/parse.spec.ts b/src/utils/parse.spec.ts index ba24ede..c6755b1 100644 --- a/src/utils/parse.spec.ts +++ b/src/utils/parse.spec.ts @@ -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() diff --git a/src/utils/parse.ts b/src/utils/parse.ts index 466ff07..a952ca5 100644 --- a/src/utils/parse.ts +++ b/src/utils/parse.ts @@ -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) { diff --git a/src/utils/rc.ts b/src/utils/rc.ts index 97c8b40..06564f7 100644 --- a/src/utils/rc.ts +++ b/src/utils/rc.ts @@ -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