Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Hide @types/yargs types from types #2907

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/aws-cdk/lib/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs = require('fs-extra');
import os = require('os');
import fs_path = require('path');
import yargs = require('yargs');
import { Tag } from './api/cxapp/stacks';
import { debug, warning } from './logging';
import util = require('./util');
Expand All @@ -14,6 +13,8 @@ export const USER_DEFAULTS = '~/.cdk.json';

const CONTEXT_KEY = 'context';

export type Arguments = { readonly [name: string]: unknown };

/**
* All sources of settings combined
*/
Expand All @@ -33,7 +34,7 @@ export class Configuration {
private projectContext: Settings;
private loaded = false;

constructor(commandLineArguments?: yargs.Arguments) {
constructor(commandLineArguments?: Arguments) {
this.commandLineArguments = commandLineArguments
? Settings.fromCommandLineArguments(commandLineArguments)
: new Settings();
Expand Down Expand Up @@ -191,7 +192,7 @@ export class Settings {
* @param argv the received CLI arguments.
* @returns a new Settings object.
*/
public static fromCommandLineArguments(argv: yargs.Arguments): Settings {
public static fromCommandLineArguments(argv: Arguments): Settings {
const context = this.parseStringContextListToObject(argv);
const tags = this.parseStringTagsListToObject(argv);

Expand Down Expand Up @@ -220,7 +221,7 @@ export class Settings {
return ret;
}

private static parseStringContextListToObject(argv: yargs.Arguments): any {
private static parseStringContextListToObject(argv: Arguments): any {
const context: any = {};

for (const assignment of ((argv as any).context || [])) {
Expand All @@ -238,7 +239,7 @@ export class Settings {
return context;
}

private static parseStringTagsListToObject(argv: yargs.Arguments): Tag[] {
private static parseStringTagsListToObject(argv: Arguments): Tag[] {
const tags: Tag[] = [];

for (const assignment of ((argv as any).tags || [])) {
Expand Down