diff --git a/lib/bootstrap.ts b/lib/bootstrap.ts index be6f999e1d..3818707466 100644 --- a/lib/bootstrap.ts +++ b/lib/bootstrap.ts @@ -144,3 +144,4 @@ $injector.requirePublic("extensibilityService", "./services/extensibility-servic $injector.require("nodeModulesDependenciesBuilder", "./tools/node-modules/node-modules-dependencies-builder"); $injector.require("subscriptionService", "./services/subscription-service"); +$injector.require("terminalSpinnerService", "./services/terminal-spinner-service"); diff --git a/lib/commands/post-install.ts b/lib/commands/post-install.ts index 53d1c5f9a4..80db0dfc9b 100644 --- a/lib/commands/post-install.ts +++ b/lib/commands/post-install.ts @@ -10,7 +10,7 @@ export class PostInstallCliCommand extends PostInstallCommand { $doctorService: IDoctorService, $analyticsService: IAnalyticsService, $logger: ILogger) { - super($fs, $staticConfig, $commandsService, $helpService, $settingsService, $doctorService, $analyticsService, $logger); + super($fs, $staticConfig, $commandsService, $helpService, $settingsService, $analyticsService, $logger); } public async execute(args: string[]): Promise { diff --git a/lib/common b/lib/common index 6ec3a807b3..68f737df29 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 6ec3a807b3d18399366f50d186266b9610c210d8 +Subproject commit 68f737df297b58bf80f74de0172cf2ac0a1273b8 diff --git a/lib/definitions/terminal-spinner-service.d.ts b/lib/definitions/terminal-spinner-service.d.ts new file mode 100644 index 0000000000..c249fd8b32 --- /dev/null +++ b/lib/definitions/terminal-spinner-service.d.ts @@ -0,0 +1,97 @@ +interface ITerminalSpinnerService { + createSpinner(spinnerOptions?: ITerminalSpinnerOptions): ITerminalSpinner; + execute(spinnerOptions: ITerminalSpinnerOptions, action: () => Promise): Promise; +} + +type SpinnerName = + 'dots' + | 'dots2' + | 'dots3' + | 'dots4' + | 'dots5' + | 'dots6' + | 'dots7' + | 'dots8' + | 'dots9' + | 'dots10' + | 'dots11' + | 'dots12' + | 'line' + | 'line2' + | 'pipe' + | 'simpleDots' + | 'simpleDotsScrolling' + | 'star' + | 'star2' + | 'flip' + | 'hamburger' + | 'growVertical' + | 'growHorizontal' + | 'balloon' + | 'balloon2' + | 'noise' + | 'bounce' + | 'boxBounce' + | 'boxBounce2' + | 'triangle' + | 'arc' + | 'circle' + | 'squareCorners' + | 'circleQuarters' + | 'circleHalves' + | 'squish' + | 'toggle' + | 'toggle2' + | 'toggle3' + | 'toggle4' + | 'toggle5' + | 'toggle6' + | 'toggle7' + | 'toggle8' + | 'toggle9' + | 'toggle10' + | 'toggle11' + | 'toggle12' + | 'toggle13' + | 'arrow' + | 'arrow2' + | 'arrow3' + | 'bouncingBar' + | 'bouncingBall' + | 'smiley' + | 'monkey' + | 'hearts' + | 'clock' + | 'earth' + | 'moon' + | 'runner' + | 'pong' + | 'shark' + | 'dqpb'; + +interface Spinner { + interval?: number; + frames: string[]; +} + +interface ITerminalSpinner { + text: string; + start(text?: string): ITerminalSpinner; + stop(): ITerminalSpinner; + succeed(text?: string): ITerminalSpinner; + fail(text?: string): ITerminalSpinner; + warn(text?: string): ITerminalSpinner; + info(text?: string): ITerminalSpinner; + clear(): ITerminalSpinner; + render(): ITerminalSpinner; + frame(): ITerminalSpinner; +} + +interface ITerminalSpinnerOptions { + text?: string; + spinner?: SpinnerName | Spinner; + color?: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray'; + interval?: number; + stream?: NodeJS.WritableStream; + enabled?: boolean; +} \ No newline at end of file diff --git a/lib/services/doctor-service.ts b/lib/services/doctor-service.ts index c232c4c299..36679d0e03 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -17,10 +17,15 @@ class DoctorService implements IDoctorService { private $childProcess: IChildProcess, private $opener: IOpener, private $prompter: IPrompter, + private $terminalSpinnerService: ITerminalSpinnerService, private $versionsService: IVersionsService) { } public async printWarnings(configOptions?: { trackResult: boolean }): Promise { - const warnings = await doctor.getWarnings(); + const infos = await this.$terminalSpinnerService.execute({ + text: `Getting environment information ${EOL}` + }, () => doctor.getInfos()); + + const warnings = infos.filter(info => info.type === constants.WARNING_TYPE_NAME); const hasWarnings = warnings.length > 0; const hasAndroidWarnings = warnings.filter(warning => _.includes(warning.platforms, constants.ANDROID_PLATFORM_NAME)).length > 0; @@ -32,20 +37,11 @@ class DoctorService implements IDoctorService { await this.$analyticsService.track("DoctorEnvironmentSetup", hasWarnings ? "incorrect" : "correct"); } - if (hasWarnings) { - warnings.map(warning => { - this.$logger.warn(warning.warning); - this.$logger.out(warning.additionalInformation); - }); + this.printInfosCore(infos); + if (hasWarnings) { this.$logger.info("There seem to be issues with your configuration."); - if (this.$hostInfo.isDarwin) { - await this.promptForHelp(DoctorService.DarwinSetupDocsLink, DoctorService.DarwinSetupScriptLocation, []); - } else if (this.$hostInfo.isWindows) { - await this.promptForHelp(DoctorService.WindowsSetupDocsLink, DoctorService.WindowsSetupScriptExecutable, DoctorService.WindowsSetupScriptArguments); - } else { - await this.promptForDocs(DoctorService.LinuxSetupDocsLink); - } + await this.promptForHelp(); } try { @@ -63,7 +59,7 @@ class DoctorService implements IDoctorService { } } - private async promptForHelp(link: string, commandName: string, commandArguments: string[]): Promise { + private async promptForHelpCore(link: string, commandName: string, commandArguments: string[]): Promise { await this.promptForDocs(link); if (await this.$prompter.confirm("Do you want to run the setup script?", () => helpers.isInteractive())) { @@ -71,6 +67,16 @@ class DoctorService implements IDoctorService { } } + private async promptForHelp(): Promise { + if (this.$hostInfo.isDarwin) { + await this.promptForHelpCore(DoctorService.DarwinSetupDocsLink, DoctorService.DarwinSetupScriptLocation, []); + } else if (this.$hostInfo.isWindows) { + await this.promptForHelpCore(DoctorService.WindowsSetupDocsLink, DoctorService.WindowsSetupScriptExecutable, DoctorService.WindowsSetupScriptArguments); + } else { + await this.promptForDocs(DoctorService.LinuxSetupDocsLink); + } + } + private printPackageManagerTip() { if (this.$hostInfo.isWindows) { this.$logger.out("TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies." + EOL); @@ -78,5 +84,21 @@ class DoctorService implements IDoctorService { this.$logger.out("TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies." + EOL); } } + + private printInfosCore(infos: NativeScriptDoctor.IInfo[]): void { + infos.filter(info => info.type === constants.INFO_TYPE_NAME) + .map(info => { + const spinner = this.$terminalSpinnerService.createSpinner(); + spinner.text = info.message; + spinner.succeed(); + }); + + infos.filter(info => info.type === constants.WARNING_TYPE_NAME) + .map(info => { + const spinner = this.$terminalSpinnerService.createSpinner(); + spinner.text = `${info.message.yellow} ${EOL} ${info.additionalInformation} ${EOL}`; + spinner.fail(); + }); + } } $injector.register("doctorService", DoctorService); diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index f74fd180e8..7e3786518e 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -24,7 +24,6 @@ export class PlatformService extends EventEmitter implements IPlatformService { constructor(private $devicesService: Mobile.IDevicesService, private $preparePlatformNativeService: IPreparePlatformService, private $preparePlatformJSService: IPreparePlatformService, - private $progressIndicator: IProgressIndicator, private $errors: IErrors, private $fs: IFileSystem, private $logger: ILogger, @@ -40,7 +39,8 @@ export class PlatformService extends EventEmitter implements IPlatformService { private $npm: INodePackageManager, private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, private $projectChangesService: IProjectChangesService, - private $analyticsService: IAnalyticsService) { + private $analyticsService: IAnalyticsService, + private $terminalSpinnerService: ITerminalSpinnerService) { super(); } @@ -115,7 +115,7 @@ export class PlatformService extends EventEmitter implements IPlatformService { npmOptions["version"] = version; } - const spinner = this.$progressIndicator.getSpinner("Installing " + packageToInstall); + const spinner = this.$terminalSpinnerService.createSpinner(); const projectDir = projectData.projectDir; const platformPath = path.join(projectData.platformsDir, platform); diff --git a/lib/services/terminal-spinner-service.ts b/lib/services/terminal-spinner-service.ts new file mode 100644 index 0000000000..0ebfcd12da --- /dev/null +++ b/lib/services/terminal-spinner-service.ts @@ -0,0 +1,27 @@ +import * as ora from 'ora'; + +export class TerminalSpinnerService implements ITerminalSpinnerService { + public createSpinner(spinnerOptions: ITerminalSpinnerOptions = {}): ITerminalSpinner { + spinnerOptions.stream = spinnerOptions.stream || process.stdout; + return new ora(spinnerOptions); + } + + public async execute(spinnerOptions: ITerminalSpinnerOptions, action: () => Promise): Promise { + const spinner = this.createSpinner(spinnerOptions); + + spinner.start(); + + let result: T = null; + try { + result = await action(); + } catch (err) { + spinner.fail(); + return null; + } + + spinner.succeed(); + + return result; + } +} +$injector.register('terminalSpinnerService', TerminalSpinnerService); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 07e3713819..f2d268775c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -46,8 +46,15 @@ "@types/node": { "version": "6.0.61", "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.61.tgz", - "integrity": "sha1-7qF0itmd7K8xm1cQFwGGMZdKxvA=", - "dev": true + "integrity": "sha1-7qF0itmd7K8xm1cQFwGGMZdKxvA=" + }, + "@types/ora": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/ora/-/ora-1.3.2.tgz", + "integrity": "sha512-YZjIN90YKxkQjmDZHr1CQP1Z20qUU3TLC10k+SnDqoRv0CNUxREwaaDc3aCRNcOfjCjktdoP2Z8Cxqf4wHjO2w==", + "requires": { + "@types/node": "6.0.61" + } }, "@types/qr-image": { "version": "3.2.0", @@ -580,17 +587,6 @@ "integrity": "sha1-vos2rvzN6LPKeqLWr8B6NyQsDS0=", "dev": true }, - "cli-color": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-0.3.2.tgz", - "integrity": "sha1-dfpfcowwjMSsWUsF4GzF2A2szYY=", - "requires": { - "d": "0.1.1", - "es5-ext": "0.10.24", - "memoizee": "0.3.10", - "timers-ext": "0.1.2" - } - }, "cli-cursor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", @@ -600,6 +596,11 @@ "restore-cursor": "1.0.1" } }, + "cli-spinners": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.1.0.tgz", + "integrity": "sha1-8YR7FohE2RemceudFH499JfJDQY=" + }, "cli-table": { "version": "https://github.com/telerik/cli-table/tarball/v0.3.1.2", "integrity": "sha1-B+E8MRgVTFOJPTvnp+CNmQ6G2Fk=", @@ -641,14 +642,6 @@ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=" }, - "clui": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/clui/-/clui-0.3.1.tgz", - "integrity": "sha1-AT0ILOht2/BguG05J/iauMM79CM=", - "requires": { - "cli-color": "0.3.2" - } - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -665,6 +658,19 @@ "integrity": "sha1-EpOLz5vhlI+gBvkuDEyegXBRCMA=", "dev": true }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "colors": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", @@ -757,14 +763,6 @@ "array-find-index": "1.0.2" } }, - "d": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", - "integrity": "sha1-2hhMU10Y2O57oqoim5FACfrhEwk=", - "requires": { - "es5-ext": "0.10.24" - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -928,6 +926,7 @@ "version": "0.10.24", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.24.tgz", "integrity": "sha1-pVh3yZJLwMjZvTwsvhdJWsFwmxQ=", + "dev": true, "requires": { "es6-iterator": "2.0.1", "es6-symbol": "3.1.1" @@ -937,6 +936,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.24", @@ -947,6 +947,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, "requires": { "es5-ext": "0.10.24" } @@ -1012,6 +1013,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.24" @@ -1021,44 +1023,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, "requires": { "es5-ext": "0.10.24" } } } }, - "es6-weak-map": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.4.tgz", - "integrity": "sha1-cGzvnpmqI2undmwjnIueKG6n0ig=", - "requires": { - "d": "0.1.1", - "es5-ext": "0.10.24", - "es6-iterator": "0.1.3", - "es6-symbol": "2.0.1" - }, - "dependencies": { - "es6-iterator": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz", - "integrity": "sha1-1vWLjE/EE8JJtLqhl2j45NfIlE4=", - "requires": { - "d": "0.1.1", - "es5-ext": "0.10.24", - "es6-symbol": "2.0.1" - } - }, - "es6-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz", - "integrity": "sha1-dhtcZ8/U8dGK+yNPaR1nhoLLO/M=", - "requires": { - "d": "0.1.1", - "es5-ext": "0.10.24" - } - } - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1294,6 +1265,7 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.24" @@ -1303,6 +1275,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, "requires": { "es5-ext": "0.10.24" } @@ -3579,6 +3552,47 @@ "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=" }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "requires": { + "chalk": "2.3.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "log4js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/log4js/-/log4js-1.0.1.tgz", @@ -3611,14 +3625,6 @@ "signal-exit": "3.0.2" } }, - "lru-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", - "requires": { - "es5-ext": "0.10.24" - } - }, "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", @@ -3694,20 +3700,6 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, - "memoizee": { - "version": "0.3.10", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.3.10.tgz", - "integrity": "sha1-TsoNiu057J0Bf0xcLy9kMvQuXI8=", - "requires": { - "d": "0.1.1", - "es5-ext": "0.10.24", - "es6-weak-map": "0.1.4", - "event-emitter": "0.3.5", - "lru-queue": "0.1.0", - "next-tick": "0.2.2", - "timers-ext": "0.1.2" - } - }, "meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -3767,6 +3759,11 @@ "mime-db": "1.27.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, "minimatch": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", @@ -3869,9 +3866,9 @@ "integrity": "sha512-8eRaxn8u/4wN8tGkhlc2cgwwvOLMLUMUn4IYTexMgWd+LyUDfeXVkk2ygQR0hvIHbJQXgHujia3ieUUDwNGkEA==" }, "nativescript-doctor": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/nativescript-doctor/-/nativescript-doctor-0.9.0.tgz", - "integrity": "sha512-arRPSnFK0Aa3qAcmFOGyGjU0PBKIiVHmhsKAL7cZsh2nOfiC/vNdxp8NDD9/T7semKLUBQqyBJ0lhbmIeyBnGQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/nativescript-doctor/-/nativescript-doctor-0.10.0.tgz", + "integrity": "sha512-bfIc/z0Z/4ud38hhlJ4bdKUKX4bNt44+QYbLcrd678wnht987B5QfJ/zFa33M9PwQP1xiRzoZpOdFmd0UCQ2AQ==", "requires": { "osenv": "0.1.3", "semver": "5.3.0", @@ -3899,11 +3896,6 @@ "integrity": "sha1-dDmFMW49tFkoG1hxaehFc1oFQ58=", "dev": true }, - "next-tick": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-0.2.2.tgz", - "integrity": "sha1-ddpKkn7liH45BliABltzNkE7MQ0=" - }, "nise": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/nise/-/nise-1.2.0.tgz", @@ -4070,6 +4062,90 @@ "wordwrap": "1.0.0" } }, + "ora": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-2.0.0.tgz", + "integrity": "sha512-g+IR0nMUXq1k4nE3gkENbN4wkF0XsVZFyxznTF6CdmwQ9qeTGONGpSR9LM5//1l0TVvJoJF3MkMtJp6slUsWFg==", + "requires": { + "chalk": "2.3.2", + "cli-cursor": "2.1.0", + "cli-spinners": "1.1.0", + "log-symbols": "2.2.0", + "strip-ansi": "4.0.0", + "wcwidth": "1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "requires": { + "restore-cursor": "2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "1.2.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -4808,8 +4884,7 @@ "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-plist": { "version": "0.2.1", @@ -5249,22 +5324,6 @@ } } }, - "timers-ext": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.2.tgz", - "integrity": "sha1-YcxHp2wavTGV8UUn+XjViulMUgQ=", - "requires": { - "es5-ext": "0.10.24", - "next-tick": "1.0.0" - }, - "dependencies": { - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" - } - } - }, "tiny-lr": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-0.2.1.tgz", diff --git a/package.json b/package.json index 62591717c5..1f70e34ca8 100644 --- a/package.json +++ b/package.json @@ -30,13 +30,13 @@ "mobile" ], "dependencies": { + "@types/ora": "1.3.2", "bplist-parser": "0.1.0", "bufferpack": "0.0.6", "byline": "4.2.1", "chalk": "1.1.0", "chokidar": "1.7.0", "cli-table": "https://github.com/telerik/cli-table/tarball/v0.3.1.2", - "clui": "0.3.1", "colors": "1.1.2", "email-validator": "1.0.4", "esprima": "2.7.0", @@ -56,8 +56,9 @@ "minimatch": "3.0.2", "mkdirp": "0.5.1", "mute-stream": "0.0.5", - "nativescript-doctor": "0.9.0", + "nativescript-doctor": "0.10.0", "open": "0.0.5", + "ora": "2.0.0", "osenv": "0.1.3", "pbxproj-dom": "1.0.11", "plist": "1.1.0", diff --git a/test/npm-support.ts b/test/npm-support.ts index 4ff58fab7c..9f814dbc84 100644 --- a/test/npm-support.ts +++ b/test/npm-support.ts @@ -89,8 +89,8 @@ function createTestInjector(): IInjector { testInjector.register("nodeModulesDependenciesBuilder", NodeModulesDependenciesBuilder); testInjector.register("settingsService", SettingsService); testInjector.register("devicePathProvider", {}); - testInjector.register("progressIndicator", { - getSpinner: (msg: string) => ({ + testInjector.register("terminalSpinnerService", { + createSpinner: (msg: string) => ({ start: (): void => undefined, stop: (): void => undefined, message: (): void => undefined diff --git a/test/platform-commands.ts b/test/platform-commands.ts index 3e31d2aafa..fd0bf7a9d7 100644 --- a/test/platform-commands.ts +++ b/test/platform-commands.ts @@ -153,8 +153,8 @@ function createTestInjector() { showCommandLineHelp: async (): Promise => (undefined) }); testInjector.register("settingsService", SettingsService); - testInjector.register("progressIndicator", { - getSpinner: (msg: string) => ({ + testInjector.register("terminalSpinnerService", { + createSpinner: (msg: string) => ({ start: (): void => undefined, stop: (): void => undefined, message: (): void => undefined diff --git a/test/platform-service.ts b/test/platform-service.ts index 1886838596..2f4c4c3291 100644 --- a/test/platform-service.ts +++ b/test/platform-service.ts @@ -96,8 +96,8 @@ function createTestInjector() { showCommandLineHelp: async (): Promise => (undefined) }); testInjector.register("settingsService", SettingsService); - testInjector.register("progressIndicator", { - getSpinner: (msg: string) => ({ + testInjector.register("terminalSpinnerService", { + createSpinner: (msg: string) => ({ start: (): void => undefined, stop: (): void => undefined, message: (): void => undefined