Skip to content

Commit

Permalink
chore: update dependencies and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ph1p committed Sep 20, 2021
1 parent 1452e46 commit 8e83013
Show file tree
Hide file tree
Showing 11 changed files with 1,267 additions and 1,275 deletions.
850 changes: 412 additions & 438 deletions example/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"vuepress": "^1.8.2"
},
"devDependencies": {
"@babel/cli": "^7.14.8",
"@babel/core": "^7.15.0",
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/preset-env": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"@babel/preset-typescript": "^7.15.0",
"concurrently": "^6.2.1",
"jsdoc-babel": "^0.5.0",
"jsdoc-to-markdown": "^7.0.1",
"typescript": "^4.4.2"
"typescript": "^4.4.3"
}
}
1,586 changes: 793 additions & 793 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"prepublishOnly": "npm i && npm run build",
"prepare": "husky install",
"version": "conventional-changelog -p karma -i CHANGELOG.md -s -r 0 && git add .",
"docs": "npx vuepress-jsdoc --source=./dist --partials=./example/partials/*.hbs --readme ./README.md --exclude=\"**/*.d.ts,**/interfaces.*,**/constants.*,**/cmds.*\"",
"docs:dev": "npm run docs && npx vuepress dev documentation",
"docs": "./bin/vuepress-jsdoc.js --source=./dist --partials=./example/partials/*.hbs --readme ./README.md --exclude=\"**/*.d.ts,**/interfaces.*,**/constants.*\"",
"docs:dev": "npx concurrently --kill-others \"npm run dev\" \"npm run docs && npx vuepress dev documentation\"",
"docs:build": "npm run build && npm run docs && npx vuepress build documentation"
},
"keywords": [
Expand Down Expand Up @@ -81,34 +81,34 @@
"dependencies": {
"chalk": "^4.1.2",
"chokidar": "^3.5.2",
"commander": "^8.1.0",
"commander": "^8.2.0",
"del": "^6.0.0",
"front-matter": "^4.0.2",
"jsdoc-to-markdown": "^7.0.1",
"micromatch": "^4.0.4",
"mkdirp": "^1.0.4",
"vue-docgen-cli": "^4.41.1"
"vue-docgen-cli": "^4.41.2"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@types/jsdoc-to-markdown": "^7.0.1",
"@types/micromatch": "^4.0.2",
"@types/mkdirp": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"babel-jest": "^27.1.0",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"babel-jest": "^27.2.0",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jest": "^24.4.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
"husky": "^7.0.2",
"jest": "^27.1.0",
"jest": "^27.2.0",
"lint-staged": "^11.1.2",
"memfs": "^3.2.3",
"memfs": "^3.3.0",
"ts-jest": "^27.0.5",
"typescript": "^4.4.2"
"typescript": "^4.4.3"
},
"lint-staged": {
"src/**/*.{css,scss,json}": [
Expand Down
12 changes: 12 additions & 0 deletions src/cmds.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
/*
* @vuepress
* ---
* headline: cmds.ts
* ---
*/
import { program } from 'commander';

import { generate } from '.';

/**
* This method builds the cli interface and is necessary because
* we need the version from the package.json here. We do not import
* this here, because otherwise the folder structure in the dist folder would get mixed up.
* @param {string} version a version string
*/
export default (version: string) => {
program.version(version).description('a CLI Tool to generate markdown files for vuepress');

Expand Down
20 changes: 13 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { generateVueSidebar } from './lib/vue-sidebar';

/**
* Create the sidebar
* @param options {object}
* @param {object} options
* @returns {Promise}
*/
const createVuepressSidebar = options =>
Expand All @@ -37,8 +37,8 @@ const createVuepressSidebar = options =>

/**
* Parse file
* @param file {DirectoryFile}
* @param argv {CLIArguments}
* @param {DirectoryFile} file
* @param {CLIArguments} argv
* @returns {Promise}
*/
const parseDirectoryFile = async (file: DirectoryFile, argv: CLIArguments) => {
Expand All @@ -59,6 +59,12 @@ const parseDirectoryFile = async (file: DirectoryFile, argv: CLIArguments) => {
}
};

/**
* Create the readme file. First page when entering the documentation.
* @param {CLIArguments} argv
* @param {string} deletedPaths
* @returns {void}
*/
const createReadmeFile = async (argv: CLIArguments, deletedPaths?: string[]) => {
const { srcFolder, codeFolder, docsFolder, title, readme } = parseArguments(argv);

Expand All @@ -83,7 +89,7 @@ const createReadmeFile = async (argv: CLIArguments, deletedPaths?: string[]) =>

/**
* Parse all CLI arguments
* @param argv {CLIArguments}
* @param {CLIArguments} argv
* @returns {object} all arguments
*/
const parseArguments = (argv: CLIArguments) => {
Expand Down Expand Up @@ -189,7 +195,7 @@ export const generate = async (argv: CLIArguments) => {

/**
* Watch files in source folder
* @param argv {CLIArguments}
* @param {CLIArguments} argv
*/
const watchFiles = (argv: CLIArguments) => {
const { exclude, srcFolder, codeFolder, docsFolder, title } = parseArguments(argv);
Expand Down Expand Up @@ -234,8 +240,8 @@ const watchFiles = (argv: CLIArguments) => {

/**
* The vuepress plugins
* @param argv {CLIArguments}
* @param ctx {object}
* @param {CLIArguments} argv
* @param {object} ctx
* @returns {object}
*/
const plugin = (argv: CLIArguments, ctx) => ({
Expand Down
6 changes: 3 additions & 3 deletions src/lib/comment-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DirectoryFile } from '../interfaces';

/**
* Search in file for @vuepress comment
* @param fileContent {string} content of given file
* @param {string} fileContent content of given file
* @returns {object} object of found frontmatter data
*/
export const parseComment = (fileContent: string) => {
Expand Down Expand Up @@ -46,8 +46,8 @@ export const parseComment = (fileContent: string) => {

/**
* Helper function to get header as structured markdown
* @param content {string} file content
* @param file {object} file object
* @param {string} content file content
* @param {object} file file object
* @returns {string} markdown header
*/
export const parseVuepressFileHeader = (content: string, file: DirectoryFile) => {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/list-folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { DirectoryFile, FileTree } from '../interfaces';

/**
* Recursively traverse folders and return exluded files, a file list and a file tree.
* @param srcPath {string} path to source dir
* @param exclude {array} exluded file patter list
* @param mainPath {string} path to hold source dir
* @param tree {object} tree array
* @param {string} srcPath path to source dir
* @param {array} exclude exluded file patter list
* @param {string} mainPath path to hold source dir
* @param {object} tree tree array
* @returns {object} paths array, tree, excluded array
*/
export const listFolder = async (srcPath: string, exclude: string[] = [], mainPath?: string, tree: FileTree[] = []) => {
Expand Down
10 changes: 5 additions & 5 deletions src/lib/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ export const parseFile = async (

/**
* Parse a vue file
* @param file {DirectoryFile}
* @param srcFolder {string}
* @param destFolder {string}
* @param {DirectoryFile} file
* @param {string} srcFolder
* @param {string} destFolder
* @returns {object} file data
*/
export const parseVueFile = async (
Expand Down Expand Up @@ -153,8 +153,8 @@ export const parseVueFile = async (

/**
* Write content on disk
* @param parseData {ParseReturn | null}
* @param dest {string}
* @param {ParseReturn | null} parseData
* @param {string} dest
* @returns {Promise | null} null or type with some data of the saved file
*/
export const writeContentToFile = async (parseData: ParseReturn | null, dest: string) => {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
*/
/**
* Get extension of file
* @param path {string}
* @param {string} path
* @returns {string} extension of file
*/
export const getExtension = (path: string) => path.substring(path.length, path.lastIndexOf('.'));

/**
* Check if extension ist correct
* @param path {string}
* @param extensions {string[]}
* @param {string} path
* @param {string[]} extensions
* @returns {boolean}
*/
export const checkExtension = (path: string, extensions: string[]) => extensions.indexOf(getExtension(path)) >= 0;

/**
* Get filename without extension
* @param path {string}
* @param {string} path
* @returns {string} filename
*/
export const getFilename = (path: string) =>
Expand Down
12 changes: 6 additions & 6 deletions src/lib/vue-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { FileTree } from '../interfaces';

/**
* Runs through the given tree structure and creates a vuepress config
* @param data Informations to build config
* @param data.fileTree {array} tree strcture
* @param data.codeFolder {string}./code/ folder
* @param data.srcFolder {string} ./src/ folder
* @param data.docsFolder {string} ./documentation/ folder
* @param data.title {string} title string
* @param {object} data Informations to build config
* @param {array} data.fileTree tree strcture
* @param {string} data.codeFolder ./code/ folder
* @param {string} data.srcFolder ./src/ folder
* @param {string} data.docsFolder ./documentation/ folder
* @param {string} data.title title string
* @returns {object} returns the vuepress menu strcture
*/
export const generateVueSidebar = ({
Expand Down

0 comments on commit 8e83013

Please sign in to comment.