How to use the @vue/cli-shared-utils.log 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 KuangPF / vue-cli-analysis / packages / @vue / cli / lib / Creator.js View on Github external
await run('git', ['config', 'user.name', 'test'])
        await run('git', ['config', 'user.email', 'test@test.com'])
      }
      const msg = typeof cliOptions.git === 'string' ? cliOptions.git : 'init'
      try {
        await run('git', ['commit', '-m', msg])
      } catch (e) {
        gitCommitFailed = true
      }
    }

    // log instructions
    stopSpinner()
    log()
    log(`๐ŸŽ‰  Successfully created project ${chalk.yellow(name)}.`)
    log(
      `๐Ÿ‘‰  Get started with the following commands:\n\n` +
      (this.context === process.cwd() ? `` : chalk.cyan(` ${chalk.gray('$')} cd ${name}\n`)) +
      chalk.cyan(` ${chalk.gray('$')} ${packageManager === 'yarn' ? 'yarn serve' : 'npm run serve'}`)
    )
    log()
    this.emit('creation', { event: 'done' })

    if (gitCommitFailed) {
      warn(
        `Skipped git commit due to missing username and email in git config.\n` +
        `You will need to perform the initial commit yourself.\n`
      )
    }

    generator.printExitLogs()
  }
github vuejs / vue-cli / packages / @vue / cli / lib / Creator.js View on Github external
await run('git', ['config', 'user.email', 'test@test.com'])
      }
      const msg = typeof cliOptions.git === 'string' ? cliOptions.git : 'init'
      try {
        await run('git', ['commit', '-m', msg])
      } catch (e) {
        gitCommitFailed = true
      }
    }

    // log instructions
    stopSpinner()
    log()
    log(`๐ŸŽ‰  Successfully created project ${chalk.yellow(name)}.`)
    if (!cliOptions.skipGetStarted) {
      log(
        `๐Ÿ‘‰  Get started with the following commands:\n\n` +
        (this.context === process.cwd() ? `` : chalk.cyan(` ${chalk.gray('$')} cd ${name}\n`)) +
        chalk.cyan(` ${chalk.gray('$')} ${packageManager === 'yarn' ? 'yarn serve' : packageManager === 'pnpm' ? 'pnpm run serve' : 'npm run serve'}`)
      )
    }
    log()
    this.emit('creation', { event: 'done' })

    if (gitCommitFailed) {
      warn(
        `Skipped git commit due to missing username and email in git config.\n` +
        `You will need to perform the initial commit yourself.\n`
      )
    }

    generator.printExitLogs()
github Alexays / Epiboard / vue.config.js View on Github external
const getLangs = () => {
  const langs = {};
  log('Retrieve main langs...');
  let langsPath = glob.sync('./src/i18n/*.json');
  for (let i = 0; i < langsPath.length; i += 1) {
    const lang = langsPath[i].replace('./src/i18n/', '').replace('.json', '');
    langs[lang] = require(langsPath[i]); // eslint-disable-line
  }
  log('Retrieve and filter cards langs...');
  const langsName = Object.keys(langs);
  langsPath = glob.sync('./src/cards/*/langs/*.json')
    .filter((f) => {
      const splitted = f.split('/');
      return cardsKeys.indexOf(splitted[3]) > -1
        && langsName.indexOf(splitted[5].replace('.json', '')) > -1;
    });
  for (let i = 0; i < langsPath.length; i += 1) {
    const splitted = langsPath[i].split('/');
    const cardName = splitted[3];
github vuejs / vue-cli / packages / @vue / cli / lib / Creator.js View on Github external
} 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 {
        log(`you don't seem to have any saved preset.`)
        log(`run vue-cli in manual mode to create a preset.`)
      }
      exit(1)
    }
    return preset
  }
github KuangPF / vue-cli-analysis / packages / @vue / cli / lib / Creator.js View on Github external
'@vue/cli-plugin-eslint': [Object]
          },
          bare: undefined
        },
        '@vue/cli-plugin-babel': {},
        '@vue/cli-plugin-eslint': { config: 'standard', _isPreset: true, lintOn: ['save'] }
      } */
    const plugins = []
    for (const id of Object.keys(rawPlugins)) {
      // loadModule('@vue/cli-service/generator', '/Users/../vue-cli/demo')
      const apply = loadModule(`${id}/generator`, this.context) || (() => {})
      let options = rawPlugins[id] || {}
      if (options.prompts) {
        const prompts = loadModule(`${id}/prompts`, this.context)
        if (prompts) { //
          log()
          log(`${chalk.cyan(options._isPreset ? `Preset options:` : id)}`)
          options = await inquirer.prompt(prompts)
        }
      }
      plugins.push({ id, apply, options })
    }
    return plugins
  }
github vuejs / vue-cli / packages / @vue / cli / lib / Creator.js View on Github external
async resolvePlugins (rawPlugins) {
    // ensure cli-service is invoked first
    rawPlugins = sortObject(rawPlugins, ['@vue/cli-service'], true)
    const plugins = []
    for (const id of Object.keys(rawPlugins)) {
      const apply = loadModule(`${id}/generator`, this.context) || (() => {})
      let options = rawPlugins[id] || {}
      if (options.prompts) {
        const prompts = loadModule(`${id}/prompts`, this.context)
        if (prompts) {
          log()
          log(`${chalk.cyan(options._isPreset ? `Preset options:` : id)}`)
          options = await inquirer.prompt(prompts)
        }
      }
      plugins.push({ id, apply, options })
    }
    return plugins
  }
github KuangPF / vue-cli-analysis / packages / @vue / cli / lib / ui.js View on Github external
// Optimize express
  const nodeEnv = process.env.NODE_ENV
  process.env.NODE_ENV = 'production'

  // Dev mode
  if (options.dev) {
    process.env.VUE_APP_CLI_UI_DEV = true
  }

  if (!process.env.VUE_CLI_IPC) {
    // Prevent IPC id conflicts
    process.env.VUE_CLI_IPC = `vue-cli-${shortid()}`
  }

  if (!options.quiet) log(`๐Ÿš€  Starting GUI...`)

  const opts = {
    host,
    port,
    graphqlPath: '/graphql',
    subscriptionsPath: '/graphql', // ่ฎข้˜…
    enableMocks: false,
    enableEngine: false,
    cors: '*',
    timeout: 1000000,
    quiet: true,
    paths: {
      typeDefs: require.resolve('@vue/cli-ui/apollo-server/type-defs.js'), // schema
      resolvers: require.resolve('@vue/cli-ui/apollo-server/resolvers.js'), // resolvers
      context: require.resolve('@vue/cli-ui/apollo-server/context.js'), // ๅฏไปฅๅ‘ resolvers ๆณจๅ…ฅไธŠไธ‹ๆ–‡ๅฏน่ฑก
      pubsub: require.resolve('@vue/cli-ui/apollo-server/pubsub.js'), // ่ฎข้˜…
github nklayman / vue-cli-plugin-electron-builder / index.js View on Github external
bundle.run((err, stats) => {
            stopSpinner(false)
            if (err) {
              throw err
            }
            if (stats.hasErrors()) {
              error(`Build failed with errors.`)
              process.exit(1)
            }
            const targetDirShort = path.relative(api.service.context, outputDir)
            log(formatStats(stats, targetDirShort, api))
            launchElectron()
          })
        } else {
github vuchan / vue-mfe / packages / vue-cli-plugin-mfe / index.js View on Github external
async (args) => {
      normalizeKey(args, defaults, shared)

      try {
        log()
        log('publish application start...')
        log()
        await publishCMD(args)
        log()
        log('published application successfully!')
        log()
      } catch (err) {
        stopSpinner(false)
        log(chalk.red(err))

        throw err
      }
    }
  )
github vuchan / vue-mfe / packages / vue-cli-plugin-mfe / index.js View on Github external
async (args) => {
      normalizeKey(args, defaults, shared)

      try {
        log()
        log('publish application start...')
        log()
        await publishCMD(args)
        log()
        log('published application successfully!')
        log()
      } catch (err) {
        stopSpinner(false)
        log(chalk.red(err))

        throw err
      }
    }
  )