Skip to content

Releases: vuejs/vue-cli

v2.6.0

20 Dec 19:08
Compare
Choose a tag to compare

New

  • In meta.js, the default field for a prompt can now be a function which will receive the answers data as the argument, which enables usage like the following:

    module.exports = {
      prompts: {
        library: {
          type: 'string',
          required: true,
          message: 'Library name for browser usage',
          default (answers) {
            if (answers.name) {
              return kebabToCamel(answers.name)
            } else {
              return ''
            }
          }
        }
      }
    }

v2.5.0

05 Nov 19:40
Compare
Choose a tag to compare

New

  • skipInterpolation option in meta.json: accepts a glob pattern to skip files from being render by handlebars. Useful for skipping files, especially Vue components with {{ }} in templates.

v2.1.0

09 May 16:12
Compare
Choose a tag to compare

New

v2.0.0

09 Apr 01:31
Compare
Choose a tag to compare

Note: although there are many changes, vue-cli@2.x is largely compatible with 1.x templates. Special thanks to @zigomir for the contribution.

Changes

  • Use prompts instead of schema for user prompts in meta.json.
  • vue-cli no longer auto-scan template files to look for prompt variables. Now it is required to explicitly list prompts in meta.json.
  • User prompts now uses Inquirer.js, so prompts should follow Inquirer.js' question object format.
  • For official templates, vue-cli will first check if the template has a dist branch, if there is one, it will use the dist branch by default.

New

  • A prompt can be made conditional by adding a when field, which is a JavaScript expression evaluated in the context of existing prompt answer data. Example:

    {
      "prompts": {
        "lint": {
          "type": "confirm",
          "message": "Use a linter?"
        },
        "lintConfig": {
          "when": "lint",
          "type": "list",
          "message": "Pick a lint config",
          "choices": [
            "standard",
            "airbnb",
            "none"
          ]
        }
      }
    }
  • Conditional files by using the filters field in meta.json. filters should be an object hash containing file filtering rules. For each entry, the key is a minimatch glob pattern and the value is a JavaScript expression evaluated in the context of prompt answers data. Example:

    {
      "filters": {
        "test/**/*": "needTests"
      }
    }

    Files under test will only be generated if the user answered yes to the prompt for needTests.

    Note that the dot option for minimatch is set to true so glob patterns would also match dotfiles by default.

v1.3.0

14 Jan 22:35
Compare
Choose a tag to compare
  • Now supports pulling templates from private repos using git clone as long as you have SSH keys properly set up. (@flipxfx)

v1.2.0

13 Jan 18:05
Compare
Choose a tag to compare
  • Now also supports using templates from Bitbucket urls using bitbucket:username/repo. (@flipxfx)

v1.1.0

29 Dec 18:28
Compare
Choose a tag to compare
  • Added support for using a local file system template. (@zigomir)