The relevant address

Varlet official document Varlet-Cli official document Varlet Github

Writing in the front

Everybody is good! Long time no see! The theme is to bring you a tool to help you quickly start component library development, can greatly reduce the threshold of component library development, improve the quality, first to see the demo……

Varlet-cli provides debugging environment, component library code compilation, document site packaging, unit testing, code inspection, code publishing, update log generation and a series of functions. To help you focus all of your development efforts on the components themselves, varlet-UI has been upgraded to the latest version of Varlet-CLI, and the experience has been significantly improved.

Quick start

Yarn Global add @varlet/cli varlet-cli gen Folder name CD Folder name yarn yarn devCopy the code

The gen command provides presets for both. Vue files and TSX component library development styles. After selecting these, you will have a Vue3 component library project.

The command associated

Start the development server

varlet-cli dev
Copy the code

Building a document site

varlet-cli build
Copy the code

Build the component library code

varlet-cli compile
Copy the code

Perform all unit tests

varlet-cli test
Copy the code

Perform unit tests in Watch mode

varlet-cli test -w
Copy the code

Check the code

varlet-cli lint
Copy the code

Quickly create a component folder

varlet-cli create <componentName>
Copy the code

Generate a project template

varlet-cli gen <projectName>
Copy the code

The commands related to code publishing and update logs are integrated into the project template. If you are interested, you can view them by yourself. For more usage and configuration details, see the official documentation of Varlet-Cli here

Just have a chat

The original Varlet-CLI was only used internally, and we didn’t have any idea of exposing it to the outside world. Until the release of Varlet-UI, many members of the community asked me, “What is your component library document made of?” I wanted to use it to write technical documentation (although I was full of black lines and thought that the component library itself was not good enough and everyone was focusing on documentation…). . After a month, I was transferred to a new position, responsible for front-end architecture, and had the idea to privatize the component library. Now that we have the experience, we should redesign him so that he can cover more cases. I found that the effect is not bad in practice, so I completed the document to meet with you. Because I often go diving for gold, I found that many friends in the community are also very interested in the development of component library. I hope that Varlet-CLI can also become a stepping stone for everyone to get started with the development of component library.

Write in the last

In the process of using, you can go to the issue list to put forward your problem, and we can solve the issue quickly. At the same time, welcome to become our contributors to send us a pull request, finally, the last star Varlet, open source is not easy, all rely on encouragement.