vuepress-commander

1.0.1-alpha.4 • Public • Published

Vuepress-Commander

npm version npm downloads Circle CI Codecov Standard JS License

vuepress-commander makes it easier to create and deploy posts in the vuepress using cli.

Introduction

The cli in vuepress is cumbersome. To compensate for this, we created a vuepress-commander. vuepress-commander now solves the task of creating new posts each time. You can also easily distribute build results to github.

Features :

  • Create a new post using the new command.
  • You have integrated with the basic command in vuepress. Run local server with serve command and build with generate.
  • Use the deploy command to distribute to git.

Infos

install

npm

npm install -g vuepress-commander

yarn

yarn add global vuepress-commander

Command List

The vuepress-commander runs with the vpc command. Try using the --help command.

vpc --help
vpc v1.0.0

Usage:
  $ vpc <command> [options]

Commands:
  new <post-name>    Create a new post.
  serve              Runs the local server.
  generate           Builds as a static page.
  clean [clean-dir]  Delete the build result.
  deploy             Deploy the build results to the git.

For more info, run any command with the `--help` flag:
  $ vpc new --help
  $ vpc serve --help
  $ vpc generate --help
  $ vpc clean --help
  $ vpc deploy --help

Options:
  -h, --help     Display this message
  -v, --version  Display version number

vpc new

The new command generates a new post. <post-name> parameter must be specified.

vpc new <post-name>

--folder, -f [folder]

Please specify the folder where the new post will be created. The default route is docs.

  • Default: docs
vpc new <post-name> --folder src    // creating in docs/src

vpc serve

Run the Local Server. vpc serve is the same as vuepress dev.

vpc serve

vpc generate

Build as a static page. vpc generate is the same as vuepress build.

vpc generate

vpc clean

Delete Build Results. The default path is .vuepress/dist.

vpc clean

[clean-dir]

  • Default: .vuepress/dist
vpc clean docs/dist     //  Delete 'docs/dist'

vpc deploy

Distribute built deliverables to github.

⚠️To deploy to github, the basic settings for git must be applied.

⚠️In the pre-release version, the remote name is origin and the branch name is master.

e.g

git init
git remote add origin master <repository-url>
vpc deploy

configuration

The vuepress-commander can specify options for the command through the settings file. Create the vpc.config.js file in the top-level path. Define all options in vpc.config.js.

Try it now.

vpc.config.js

module.exports = {
  basePath: 'docs',
  git: 'https://github.com/<user-name>/<repository>.git',
  dest: '.vuepress/dist'
}

basePath

basePath is the default path for all options that require routing.

  • Type: String
  • Default: docs

git

The git repository address required for the deploy command.

⚠️In the pre-release version, the remote name is origin and the branch name is master.

  • Type: String
  • Default: void 0

dest

The path where the results will be stored at build.

  • Type: String
  • Default: .vuepress/dist

Help-Me

Do you have any other ideas? Please help me.

License

MIT License Copyright (c) Dev.DY

Package Sidebar

Install

npm i vuepress-commander

Weekly Downloads

1

Version

1.0.1-alpha.4

License

MIT

Unpacked Size

14.5 kB

Total Files

8

Last publish

Collaborators

  • kdydesign