@yaoxfly/cli v1.0.7
@yaoxfly/cli
Clean and minimalist project scaffolding integratesvue3 project templates,vitepress project templates, etc., right out of the box.
Compatibility note: The scaffolding uses
Viteinternally by default,ViterequiresNode.jsversion14.18+,16+. However, some templates rely on a higher version ofNodeto function properly, so be careful to upgrade your version of 'Node' when your package manager warns you. node version switch
Use npx
No sense download template, no need to install @yaoxfly/cli.
npx @yaoxfly/cli@latest create [Project name]If the
npmimage downloads slowly, please switch other image such astaobaoimage, you can usenrmmanagement, or other ways, image switch.
Creation project
You can also download and then use, the current way can provide more comprehensive features, global download.
npm i @yaoxfly/cli -guse
yx-cli create [Project name]Add template
Add custom templates, such as your own GitHub or Gitee (code cloud) project address
yx-cli addFormat of the template address
You can use the following shorthand
GitHub - github:owner/name or owner/name
GitLab - gitlab:owner/name
Bitbucket - bitbucket:owner/name1.The default is
masterbranching, but you can specify branching andtag, such asowner/name#my-branch. 2.You can also specify a custom source, such asgitlab:custom.com: owner/name. Custom source default ishttpsorgit@, you can customize the protocol.
Direct - direct:url
This method skips the above shorthand and passes the full url.
direct:https://gitlab.com/flippidippi/download-git-repo-fixture.gitGitee(code cloud), private library address can be used in this way.
Deleting a template
yx-cli deleteViewing the Template list
yx-cli listimage switch
Use nrm
Global download
npm i nrm@1.0.0 -gA lower version of
nodeand a higher version ofnrmmay not be available.
Viewing the image list
nrm lsUsing Taobao image
nrm use taobaoUse npm
Set Taobao image
npm config set registry https://registry.npmmirror.com/
registry.npm.taobao.org, which was abandoned on May 31, 2022, needs to be replaced with a newregistry.npmmirror.comsource.
Check whether the configuration is successful
npm config get registry View the current configuration of npm
npm config list Set up an npm image
npm config set registry https://registry.npmjs.org/Use .npmrc
In the root directory, create .npmrc and write the following
registry= https://registry.npmmirror.com/node version switch
Use nvm to manage your node version
Download the vmm-setup. zip version and install it as prompted.
To download node
This describes only windows systems.
When node is installed using the nvm command line, nvm will not install npm when the node version is8or higher.
Download the corresponding version zip file from the nodejs download website and decompress it to the root directory of the nvm installation directory. Change the name of the decompressed folder to v version number
For example, the folder name after decompression is changed from node-v16.13.1-win-x64 to v16.13.1.
View the downloaded version of node
nvm listUse the corresponding version
nvm use [Version number]