• Stars
    star
    122
  • Rank 291,219 (Top 6 %)
  • Language
    JavaScript
  • Created over 7 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React inspired style guide generator for Vue.js

πŸ™€ [20/09/2017] Project discontinued πŸ™€

For purpose of having a demo of your Vuejs components please take a look at following projects that do really great job and are really handy for you dev workflow with Vuejs: storybook for vuejs and vue-styleguidist.

Vue js components styleguide generator πŸ“š

dependencies status

Initially started after reading this vue.js feature request. Now only basic proof of concept is available which can load folder with .vue files, parse it and extract basic props of it.

Target is to have some tool with at least some of the React version capabilities.

Idea is to have what vue-play does but in automated way - with one task run, plus READMEs, etc.

Generate single html file containing all components listed with details and search out from your .vue project files.

Questions & bugs

  • General questions please ping me on twitter @legkoletat.
  • Bugs and inconsistencies please create an issue . Please concider to adding more information on what is the codebase you're running the generator against, what errors (with code, if applicable) you got. To keep issues list clean and relevant issues with no feedback/details/activity will be closed within 3 days.

1. Examples

Running on large components collections

Output UI demo

resulting output

2. Setup

  1. npm install vue-styleguide-generator --save-dev

  2. add to you package.json in script section - for example like this "build-components": "node ./node_modules/vue-styleguide-generator/" and then run npm run build-components from the root folder of the project.

πŸƒ You can also manually (or using Gulp/Grunt) run node ./node_modules/vue-styleguide-generator/

3. Usage

βœ… Works only for Vue 2.x projects.

CLI options

Name Type Description Default
--src String Source dir, will be recursively scanned src
--dest String Destination output dir, file index.html will be placed there components-preview
--exclude RegExp File mask to exclude certain type of files /^./
--locale String Output locale language en
--verbose String Output all details while processing false
--all String Do not ignore any components false
--o String Open browser preview after generating false

E.g.: node ./node_modules/vue-styleguide-generator/ --src components --dest preview will read components from PROJECT_ROOT/components folder and provide a html page into PROJECT_ROOT/preview folder

To see all parser error run with DEBUG: DEBUG=app node ./node_modules/vue-styleguide-generator/

How the components are iterated

If you want to see more information about the component - add a .md file in the same directory. While retrieving the files the following assumptions are made:

  • if there are files with the same name in one folder (e.g. /scr/partials/TabBar.vue and /scr/partials/TabBar.md) it's assumed to be one component;
  • if there are only two files in the folder and one is .vue and another is .md (e.g. /scr/TabBar/codez.vue and /scr/partials/readers.md) it's assumed to be one component;
  • If there are >1 .vue files in the folder and .md file that does not have the same name as one of the .vue files - this .md file is ignored
  • Components with no props, no computed and no methods defined are considered to be a simple wrappers and not outputed

Found a bug or have a proposal - please create an issue or tweet me @legkoletat!

Todos

  • improve parsing technique and/or configuration to deal with variety of components organisation approaches
  • syntax highlighting
  • align parsing and display with vue-js-component-style-guide
  • core: move the demo-page to use Vue so that components can be generated from its declaration
  • ui: output extra component parameters (computable, data)
  • various use cases testing, added vuikit and Keen-UI links

Contributions are welcome πŸ‘!

Especially on following:

Bugs and problems

  • window object may not be patched fully so some component's code execution may fail
  • 'vue-template-compiler' must be the same as the version of 'vue' you're using in your codebase. Now set to 2.1.10. may have to manually put to other version that's used in your project.'

Changelog

0.9.11

Now as from 0.9.11 also your .js files referenced from .vue files are supported.

0.9.15

Added -o option to open the browser. Refactoring the template. Added pt-br translation by israelss.

0.9.18

UI improvements (UX of the search block, 'Copy' component code).

License

MIT

More Repositories

1

vue-masonry

πŸ’  Vue.js directive for masonry blocks layouting βœ…
JavaScript
673
star
2

vuejs-sound-player

▢️ 🎹 🎡 HTML5 <audio> tag sound player UI for Vue.js - supports single, loop, pause/stop modes etc
JavaScript
178
star
3

emoji-vue

Add emoji keyboard to your vuejs project
JavaScript
137
star
4

vue-terminal-ui

πŸ–₯Terminal UI emulator VueJS component
JavaScript
55
star
5

vue.js-v2-crud-application

Vue.js demo app
HTML
54
star
6

tailor-vue-demo

Using frontend microservices with zalando/tailor and Vue.js as frontend fw
JavaScript
39
star
7

vuejs-content-scroll-progress

Top bar indicating amount of content scrolled
HTML
25
star
8

vue-lorem-ipsum

Lorem ipsum text generator component for vue.js
Vue
15
star
9

vue-preload

Plugin SSR Vue adding <link rel="preload" capabilities
JavaScript
15
star
10

svelte-pwa-chat

SvelteJS + websockets app
HTML
8
star
11

svelte-pwa-chat-backend

Java
6
star
12

ng2-web-cryptography

Module implementing Web Cryptography API for Angular 2
TypeScript
6
star
13

vue-ya-metrica

Yandex.Metrica component for Vue.js
JavaScript
6
star
14

vue-image-colorpicker

Image colours picker (dropper) - using Vue.js
JavaScript
3
star
15

sveltejsnews

[ARCHIVED]
HTML
3
star
16

nest-vs-next-vs-nuxt-vs-sapper

JavaScript
2
star
17

otus-chrome-extension

JavaScript
2
star
18

single-spa-hyperapp

Plugin to include your Hyperapp into single-spa based webpage
JavaScript
2
star
19

vue2-pdfjs-viewer

PDF preview component for Vue.js based on PDF.js
JavaScript
2
star
20

node-express-vite-eureka-kibana

JavaScript
2
star
21

vue3-workshop-demo-2021

Demo files for 'Vue3 practical development' workshop. Find PDF with slides via link below:
JavaScript
2
star
22

vue-starters-directory

List of available starter kits for Vue projects
Vue
2
star
23

svelte-chat-live

HTML
1
star
24

qr-app

JavaScript
1
star
25

quasar-vite-tailwind-storybook

Vue
1
star
26

commonjs-es6-modules-webpack-jest

demo repo to showcase commonjs vs es6 modules; jest; webpack; babel
JavaScript
1
star
27

textarea-moderated

JavaScript
1
star
28

otus-docker-demo

Vue
1
star
29

conf-talks

🎦 πŸ“ˆ Slides, videos and textual content for my meetup and conferences presentations
1
star
30

vue-masonry-plugin-demo

JavaScript
1
star
31

vue-material-url-shortener-example

vue-material demo
JavaScript
1
star
32

cards-game-app

Svelte --> Azure
JavaScript
1
star
33

first-image-search-load

Simple module that loads the first image from Google image search on query
JavaScript
1
star
34

vuejs-3-workshop

1
star
35

otus-vue3-demo-composition-api

CSS
1
star