How to use the @vue/cli-shared-utils.stopSpinner function in @vue/cli-shared-utils

To help you get started, we’ve selected a few @vue/cli-shared-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github max-team / Mars / packages / mars-cli / lib / build.js View on Github external
build(...args).catch(err => {
        stopSpinner(false); // do not persist
        error(err);
        if (!process.env.VUE_CLI_TEST) {
            process.exit(1);
        }
    });
github vuejs / vue-cli / packages / @vue / cli / lib / Creator.js View on Github external
async resolvePreset (name, clone) {
    let preset
    const savedPresets = loadOptions().presets || {}

    if (name in savedPresets) {
      preset = savedPresets[name]
    } else if (name.endsWith('.json') || /^\./.test(name) || path.isAbsolute(name)) {
      preset = await loadLocalPreset(path.resolve(name))
    } else if (name.includes('/')) {
      logWithSpinner(`Fetching remote preset ${chalk.cyan(name)}...`)
      this.emit('creation', { event: 'fetch-remote-preset' })
      try {
        preset = await loadRemotePreset(name, clone)
        stopSpinner()
      } catch (e) {
        stopSpinner()
        error(`Failed fetching remote preset ${chalk.cyan(name)}:`)
        throw e
      }
    }

    // use default preset if user has not overwritten it
    if (name === 'default' && !preset) {
      preset = defaults.presets.default
    }
    if (!preset) {
      error(`preset "${name}" not found.`)
      const presets = Object.keys(savedPresets)
      if (presets.length) {
        log()
        log(`available presets:\n${presets.join(`\n`)}`)
      } else {
github KuangPF / vue-cli-analysis / packages / @vue / cli / lib / invoke.js View on Github external
JSON.stringify(newDevDeps) !== JSON.stringify(pkg.devDependencies)

  if (!isTestOrDebug && depsChanged) {
    log(`πŸ“¦  Installing additional dependencies...`)
    log()
    const packageManager =
      loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : 'npm')
    await installDeps(context, packageManager, plugin.options && plugin.options.registry)
  }

  if (createCompleteCbs.length) {
    logWithSpinner('βš“', `Running completion hooks...`)
    for (const cb of createCompleteCbs) {
      await cb()
    }
    stopSpinner()
    log()
  }

  log(`${chalk.green('βœ”')}  Successfully invoked generator for plugin: ${chalk.cyan(plugin.id)}`)
  // εˆ—ε‡Ίε“ͺδΊ›ζ–‡δ»Άε‘η”ŸδΊ†ζ”Ήε˜
  if (!process.env.VUE_CLI_TEST && hasProjectGit(context)) {
    const { stdout } = await execa('git', [
      'ls-files',
      '--exclude-standard',
      '--modified',
      '--others'
    ], {
      cwd: context
    })
    if (stdout.trim()) {
      log(`   The following files have been updated / added:\n`)
github dcloudio / uni-app / packages / vue-cli-plugin-uni / commands / build.js View on Github external
webpack(webpackConfigs, (err, stats) => {
      if (!runByHBuilderX && !runByAliIde) {
        stopSpinner(false)
      }
      if (err) {
        return reject(err)
      }

      if (stats.hasErrors()) {
        /* eslint-disable prefer-promise-reject-errors */
        return reject(`Build failed with errors.`)
      }

      if (!args.silent && process.env.UNI_PLATFORM !== 'app-plus') {
        const targetDirShort = path.relative(
          api.service.context,
          process.env.UNI_OUTPUT_DIR
        )
github vuejs / vue-cli / packages / @vue / cli / lib / invoke.js View on Github external
if (!isTestOrDebug && depsChanged) {
    log(`πŸ“¦  Installing additional dependencies...`)
    log()
    const pm = new PackageManager({ context })
    await pm.install()
  }

  if (afterInvokeCbs.length || afterAnyInvokeCbs.length) {
    logWithSpinner('βš“', `Running completion hooks...`)
    for (const cb of afterInvokeCbs) {
      await cb()
    }
    for (const cb of afterAnyInvokeCbs) {
      await cb()
    }
    stopSpinner()
    log()
  }

  log(`${chalk.green('βœ”')}  Successfully invoked generator for plugin: ${chalk.cyan(plugin.id)}`)
  if (!process.env.VUE_CLI_TEST && hasProjectGit(context)) {
    const { stdout } = await execa('git', [
      'ls-files',
      '--exclude-standard',
      '--modified',
      '--others'
    ], {
      cwd: context
    })
    if (stdout.trim()) {
      log(`   The following files have been updated / added:\n`)
      log(
github vuchan / vue-mfe / packages / vue-cli-plugin-mfe / index.js View on Github external
if (!packagePath) {
          throw new Error(
            "Cannot found any file matches the RegExp '/^w(-?w?)*@(d.?){3}-?d{13}.tar(.gz)?$/'"
          )
        }

        log()
        log('upload package start...')
        log()
        await uploadCMD(args, path.join(dist, packagePath), moduleName)
        log()
        log('uploaded package successfully!')
        log()
      } catch (err) {
        stopSpinner(false)
        log(chalk.red(err))

        throw err
      }
    }
  )
github vuchan / vue-mfe / packages / vue-cli-plugin-mfe / commands / build.js View on Github external
webpack(api.resolveWebpackConfig(), (err, stats) => {
          stopSpinner(false)

          if (err) {
            return reject(err)
          }

          if (stats.hasErrors()) {
            return reject('Build failed with errors.')
          }

          if (!args.silent) {
            const targetDirShort = path.relative(api.service.context, targetDir)
            log(formatStats(stats, targetDirShort, api))

            if (args.target === 'app' && !isLegacyBuild) {
              if (!args.watch) {
                done(
github vuchan / vue-mfe / packages / vue-cli-plugin-mfe / commands / publish.js View on Github external
.on('error', (error) => {
        stopSpinner(false)
        log(chalk.red(`Publish module ${chalk.cyan(name)} failed`))
        log(chalk.red(error))

        reject(error)
      })
      .on('complete', (res, body) => {
github multiplegeorges / vue-cli-plugin-s3-deploy / src / deployer.js View on Github external
Items: invalidationItems
        }
      }
    }

    try {
      logWithSpinner(`Invalidating CloudFront distribution: ${this.config.options.cloudfrontId}`)

      let data = await cloudfront.createInvalidation(params).promise()

      info(`Invalidation ID: ${data['Invalidation']['Id']}`)
      info(`Status: ${data['Invalidation']['Status']}`)
      info(`Call Reference: ${data['Invalidation']['InvalidationBatch']['CallerReference']}`)
      info(`See your AWS console for on-going status on this invalidation.`)

      stopSpinner()
    } catch (err) {
      stopSpinner(false)

      error('Cloudfront Error!!')
      error(`Code: ${err.code}`)
      error(`Message: ${err.message}`)
      error(`AWS Request ID: ${err.requestId}`)

      throw new Error('Cloudfront invalidation failed!')
    }
  }
}