https://github.com/shivadharmi/vue2-library-template
About A template for creating a vue2 library which is production ready with all the required configurations.
https://github.com/shivadharmi/vue2-library-template
frontend library module typescript vite vitest vue vue2 vuejs
Last synced: 3 months ago
JSON representation
About A template for creating a vue2 library which is production ready with all the required configurations.
- Host: GitHub
- URL: https://github.com/shivadharmi/vue2-library-template
- Owner: shivadharmi
- License: mit
- Created: 2023-03-19T08:17:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-19T08:26:05.000Z (over 3 years ago)
- Last Synced: 2025-03-14T20:16:49.551Z (over 1 year ago)
- Topics: frontend, library, module, typescript, vite, vitest, vue, vue2, vuejs
- Language: TypeScript
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Vue2-Library-Template
## _Configured for all kinds of environments [prod, dev and local]_
## Features
- Built with typescript support
- Built with [vite.dev] (Next Generation Frontend Tooling)
- Exports types automatically as .d.ts files using [vite-plugin-dts]
- Configured with [vitest] for unit testing
- Test components by importing them into index.ts file and running the command ```yarn run dev```
- No need to create separate project to test the library
## Tech
Vue2-Library-Template uses a number of open source packages to create a production ready vue library:
- [Typescript] - TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
- [Vue.js] - An approachable, performant and versatile framework for building web user interfaces.
- [vite.dev] - Next Generation Frontend Tooling
- [Eslint] - ESLint statically analyzes your code to quickly find problems. It is built into most text editors and you can run ESLint as part of your continuous integration pipeline.
- [Prettier] - An opinionated code formatter
- [Husky] - Husky improves your commits and more 🐶 woof!
- And many other plugins
And of course Vue2-Library-Template itself is open source with a [public repository][VLT] on GitHub.
## Installation
Requires [Node.js](https://nodejs.org/) v10+ to run.
Install the dependencies and devDependencies and start the server.
HTTPS:
```sh
git clone https://github.com/ssrbloginsoft/vue2-library-template.git
```
SSH:
```sh
git clone git@github.com:ssrbloginsoft/vue2-library-template.git
```
#### _Install_
```sh
npm i
or
yarn install
```
#### _Build_
```sh
yarn run build
```
#### _Test_
```sh
yarn run test:unit
```
#### _Development_
Run development server to test the component changes by importing it in ```App.vue```. No need to create another project to test the changes.
```sh
yarn run dev
```
For running linter:
```sh
yarn run lint
```
#### _Creating a component_
Create a new component in components folder with ```.vue``` extension and export the component in ```main.ts```:
```ts
export { default as ImageComponent } from "@components/ImageComponent.vue";
```
By running the build command a dist folder will be generated
_Exporting types:_
```ts
export type { User } from "./types";
```
## License
MIT
**Free Software, Hell Yeah!**
[VLT]:
[vite.dev]:
[vite-plugin-dts]:
[vitest]:
[Vue.js]:
[Eslint]:
[Prettier]:
[Typescript]:
[Husky]: