diff --git a/packages/cli/package.json b/packages/cli/package.json index a70dc7b45..04605a7a8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -51,6 +51,7 @@ "make-plural": "^4.1.1", "messageformat-parser": "^2.0.0", "mkdirp": "^0.5.1", + "ora": "^3.0.0", "ramda": "^0.25.0", "typescript": "^2.9.2" }, diff --git a/packages/cli/src/api/extract.js b/packages/cli/src/api/extract.js index 514eaec1c..067e37b01 100644 --- a/packages/cli/src/api/extract.js +++ b/packages/cli/src/api/extract.js @@ -2,6 +2,7 @@ import fs from "fs" import path from "path" import chalk from "chalk" +import ora from "ora" import R from "ramda" import * as extractors from "./extractors" @@ -40,11 +41,15 @@ export function extract( const extracted = R.values(extractors).some((ext: ExtractorType) => { if (!ext.match(srcFilename)) return false + + let spinner + if (verbose) spinner = ora().start(srcFilename) + ext.extract(srcFilename, targetPath, options.babelOptions) + if (verbose && spinner) spinner.succeed() + return true }) - - if (extracted && verbose) console.log(chalk.green(srcFilename)) }) } diff --git a/yarn.lock b/yarn.lock index 3bf55c960..17b8b4666 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4497,6 +4497,17 @@ ora@^2.1.0: strip-ansi "^4.0.0" wcwidth "^1.0.1" +ora@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-3.0.0.tgz#8179e3525b9aafd99242d63cc206fd64732741d0" + dependencies: + chalk "^2.3.1" + cli-cursor "^2.1.0" + cli-spinners "^1.1.0" + log-symbols "^2.2.0" + strip-ansi "^4.0.0" + wcwidth "^1.0.1" + os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"