Repository: Kocal/jsdoc-vuejs
Branch: master
Commit: e73bd4f74bfd
Files: 59
Total size: 93.3 KB
Directory structure:
gitextract_1cmywy0n/
├── .eslintrc.json
├── .github/
│ ├── FUNDING.yml
│ └── workflows/
│ ├── ci.yml
│ └── release.yml
├── .gitignore
├── .releaserc
├── LICENSE
├── README.md
├── UPGRADE.md
├── __tests__/
│ ├── core/
│ │ ├── __fixtures__/
│ │ │ ├── Component.vue
│ │ │ └── methods/
│ │ │ ├── Component/
│ │ │ │ └── Component.js
│ │ │ ├── Component.vue
│ │ │ ├── ComponentWithExportDefaultInTemplate.vue
│ │ │ ├── ComponentWithSpaces.vue
│ │ │ └── ScriptBeforeTemplate.vue
│ │ ├── __snapshots__/
│ │ │ └── vueScriptExtractor.js.snap
│ │ ├── getTemplatePath.test.js
│ │ ├── renderer.test.js
│ │ ├── seekExportDefaultLine.js
│ │ └── vueScriptExtractor.js
│ └── stubs/
│ └── jsdoc/
│ └── lib/
│ └── jsdoc/
│ └── util/
│ └── templateHelper.js
├── config.js
├── cypress/
│ ├── fixtures/
│ │ └── example.json
│ ├── integration/
│ │ └── templates/
│ │ ├── default.spec.js
│ │ ├── docstrap.spec.js
│ │ ├── minami.spec.js
│ │ └── tui.spec.js
│ ├── plugins/
│ │ └── index.js
│ └── support/
│ ├── commands.js
│ └── index.js
├── cypress.json
├── example/
│ ├── .jsdoc-docstrap.js
│ ├── .jsdoc-minami.js
│ ├── .jsdoc-tui.js
│ ├── .jsdoc.js
│ ├── README.md
│ ├── package.json
│ └── src/
│ ├── Counter.vue
│ ├── better-components/
│ │ └── BetterCounter.vue
│ └── js/
│ ├── CounterJS.js
│ ├── NotVueComponent.js
│ └── NotVueComponent2.js
├── index.js
├── jest.config.js
├── lib/
│ ├── core/
│ │ ├── getTemplatePath.js
│ │ ├── issers.js
│ │ ├── renderer.js
│ │ ├── seekExportDefaultLine.js
│ │ └── vueScriptExtractor.js
│ ├── tags/
│ │ ├── vue-computed.js
│ │ ├── vue-data.js
│ │ ├── vue-event.js
│ │ └── vue-prop.js
│ └── templates/
│ ├── default.ejs
│ ├── docstrap.ejs
│ ├── minami.ejs
│ ├── tui.ejs
│ └── utils/
│ └── renderType.js
└── package.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .eslintrc.json
================================================
{
"extends": [
"airbnb-base"
],
"env": {
"es6": true,
"node": true,
"jest": true,
"cypress/globals": true
},
"plugins": [
"cypress"
],
"settings": {
"import/core-modules": [
"jsdoc/env"
]
},
"rules": {
"no-param-reassign": ["error", {
"props": true,
"ignorePropertyModificationsFor": [
"doclet", // _isVueFile, ...
"e" // for e.doclet
]
}],
"no-underscore-dangle": ["error", {
"allow": [
"_isVueDoc",
"_vueProps",
"_vueData",
"_vueComputed",
"_vueEvent"
]
}]
}
}
================================================
FILE: .github/FUNDING.yml
================================================
github: Kocal
custom: paypal.me/HAlliaume
================================================
FILE: .github/workflows/ci.yml
================================================
name: Node CI
on:
pull_request:
branches:
- '*'
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [10.x, 12.x, 14.x]
include:
- os: windows-latest
node: 12.x
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
if: matrix.os == 'windows-latest'
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore yarn cache (if available)
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: |
cd example
yarn install --frozen-lockfile
yarn docs
yarn docs:docstrap
yarn docs:minami
yarn docs:tui
cd ..
- run: yarn lint
- run: yarn test -i && npx codecov
================================================
FILE: .github/workflows/release.yml
================================================
name: Release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: yarn install --frozen-lockfile
- run: yarn semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
example/docs*
cypress/screenshots/
cypress/videos/
================================================
FILE: .releaserc
================================================
{
"extends": "@kocal/semantic-release-preset"
}
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Hugo Alliaume
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
JSDoc for VueJS
===============
[](https://badge.fury.io/js/jsdoc-vuejs)
[](https://travis-ci.org/Kocal/jsdoc-vuejs)
[](https://ci.appveyor.com/project/Kocal/jsdoc-vuejs)
[](https://codecov.io/gh/Kocal/jsdoc-vuejs)
[](https://www.codacy.com/app/kocal/jsdoc-vuejs?utm_source=github.com&utm_medium=referral&utm_content=Kocal/jsdoc-vuejs&utm_campaign=Badge_Grade)
A JSDoc plugin for listing props, data, computed data, and methods from `.vue` files.
:warning: This branch is for Vue 3. If you still use Vue 2, please see [`3.x` branch](https://github.com/Kocal/jsdoc-vuejs/tree/3.x).
---
## Requirements
- Node 10+
- Vue 3
## Installation
```bash
$ npm install --save-dev jsdoc jsdoc-vuejs
```
You also need to install `@vue/compiler-sfc` that match your Vue version:
```bash
$ npm install --save-dev @vue/compiler-sfc
```
## Usage
Your should update your JSDoc configuration to enable JSDoc-VueJS:
```json
{
"plugins": [
"node_modules/jsdoc-vuejs"
],
"source": {
"includePattern": "\\.(vue|js)$"
}
}
```
Update your .vue files with one of the following tags:
- `@vue-prop`
- `@vue-data`
- `@vue-computed`
- `@vue-event`
All of those tags work the same way than [`@param` tag](http://usejsdoc.org/tags-param.html).
```vue
Hello world!
```
## Supported templates
The rendering engine has been rewritten in v2, it can supports every JSDoc templates that exists.
Actually, it supports 4 templates:
- Default
- [Docstrap](https://github.com/docstrap/docstrap)
- [Minami](https://github.com/nijikokun/minami)
- [Tui](https://github.com/nhnent/tui.jsdoc-template)
If you use a template that is not supported, it will use the default one as a fallback.
Feel free to open an issue/pull request if your template is not supported!
Default

Docstrap

Minami

Tui

## Testing
### Install Dependencies
```bash
$ git clone https://github.com/Kocal/jsdoc-vuejs
$ cd jsdoc-vuejs
$ yarn install
# For testing the example docs
$ cd example
$ yarn install
```
#### Generate documentations
```bash
$ cd example
# Generate docs for every renderer
$ yarn docs:all
# or one by one
$ yarn docs # default jsdoc template
$ yarn docs:docstrap
$ yarn docs:minami
$ yarn docs:tui
```
### Unit
```bash
$ yarn test
```
### E2E
Before running integration tests with [Cypress](https://cypress.io),
you should generate documentation with all renderers:
```bash
$ cd example
$ yarn docs:all
```
And then run Cypress:
```bash
$ cd ..
$ yarn cypress run
```
## License
MIT.
================================================
FILE: UPGRADE.md
================================================
## Upgrade from 1.x to 2.x
### Configuration
You MUST remove `jsdoc-vuejs` configuration key inside JSDoc config file,
because it is not used anymore.
**Before:**
```json
{
"plugins": [
"node_modules/jsdoc-vuejs"
],
"source": {
"includePattern": "\\.(vue|js)$"
},
"jsdoc-vuejs": {
"followImports": true // enable/disable require/import function
}
}
```
**After:**
```json
{
"plugins": [
"node_modules/jsdoc-vuejs"
],
"source": {
"includePattern": "\\.(vue|js)$"
}
}
```
### Usage
You SHOULD NOT use `@vue` tag anymore.
Instead, you should use `@vue-prop`, `@vue-data`, and `@vue-computed` like this:
```vue