Skip to content

Features

Cphayim edited this page Feb 26, 2022 · 2 revisions
  • Create Project
  • CLI Config
  • Other

Create Project

Creating projects via boilerplate is still the main feature of this tool, but unlike v0.x, the new version will support three different ways of creating:

  • Package
  • HTTP
  • Git

Package Mode

The first concept introduced is boilerplate-package, which is an npm package for wrapping boilerplate, which looks roughly like this:

boilerplate-package
  β”œβ”€β”€ boilerplate/ 		# real boilerplate
  β”œβ”€β”€ vrn-boilerplate.json	# the boilerplate description and configuration file
  └── index.js			# install script

A boilerplate-package is responsible for managing its own boilerplate separately, and can provide it with some unique and custom installation options and procedures (via hooks)

Afterwards, a manifest-package collects information about all available boilerplate-packages.

See the vrn-boilerplate repository for more details here, it should probably be under the next branch now, but I believe it will be back in the mainline soon

Now we go back to cli and in package mode, first we inspect and install the latest version of manifest-package via dynamic dependency management, get all available boilerplate-package information from manifest-package, then install the user-selected boilerplate-package, and finally start the install script on boilerplate-package to complete the creation

HTTP Mode

This is similar to the v0.x installation, in http mode, first we request all available boilerplate information from the specified manifest-url, then download the specified zip package (.tgz or .zip) according to the boilerplate selected by the user, unzip it and finish the creation

Git Mode

The git mode provides a git clone installation that clones from a user-specified Git repository and completes the creation

This mode supports favorites, where you can set an alias for your Git repository and use it to create it next time

Unlike the previous two modes, the git mode does not support creating packages under Monorepo

CLI Config

config is used to manage the global configuration of cli, through which the user can interactively view and edit the settings

  • packageManager: the package manager to use, default is npm, optional npm | yarn | pnpm
  • npmRegistry: the npm source to use, default is taobao source, built-in npm and taobao, customizable
  • checkUpdateEnabled: if or not the version update check is enabled, default is enabled, check period is one day
Clone this wiki locally