Giter Site home page Giter Site logo

vuelibseed's Introduction

A Vue3 UI library template

中文文档

Help you quickly create a component library.

  • 🚀 dev with Vite
  • ✈️ build with esbuild
  • 🚁 generate types with ts-morph

Docs

Feature

  • 🌈 Speedy dev & build
  • 🎆 Customize friendly
  • 📝 More beautiful doc, support Chinese and English. Support Dark Mode by vueuse
  • 🍭 Rich scripts, inspired by esbuild-plugin-vue & vue-dts-gen
  • 😋 Type friendly
  • 🚚 ESM & CJS product

How to use

Generate a repository by vue-components-lib-seed

Checklist

  • Replace all my-lib words with your libary name. Just search my-lib and replace them in VScode
    • .gitignore
    • package.json
    • vite.config.ts
    • .vitepress
    • scripts ...

Install

yarn

Dev

Benefited from vite-plugin-pages, the src/pages/index.vue is the entry page for development. You can visit /[component-name]/demo to check component, like http://localhost:3000/#/button/demo.

yarn dev

Build

yarn build

Test

yarn test

Generate entry point

The entry file is the input option for rollup.

yarn gen-entry

Generate Component

A component's name is required for this command.

yarn gen [component\'s name]

Generate dts

npx esno ./scripts/gen-dts.ts

Release

This command will add git tag、generate changelog. You can test your lib with argument --dry

yarn release [--dry]

Build Docs

❗ Noted: you should run yarn build:lib before run this command. Because the docs need the build bundle.

Docs dev

yarn docs:dev

Docs build

yarn docs:build

Docs deploy

Here is a git action. When you push the code to the master branch, the document will be automatically deployed on gh-pages branch. Then you can set the Github Pages's source on the gh-pages branch.

Use demo code in doc

Take button as an example.

In button.md, insert the following code

<demo-wrapper
  src="src/packages/button/demo"
/>

There is a global component Demos to display all demos. This is currently the only way to show demo. More info.

Custom doc style

You can add the class in frontmatter, then the <Content> would inherit the class. Of course, the windicss can be used here.

---
class: 'custom-class'
---

Recommended IDE Setup

VSCode + Volar.

If Using <script setup>

<script setup> is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use Volar instead of Vetur (and disable Vetur).

Credits

Thanks


eeeeelle
✍️release-script

vuelibseed's People

Contributors

asialiugf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.