From 47d5aec6da06751833814072f65fc6fb62bb3595 Mon Sep 17 00:00:00 2001 From: Nathan Woltman Date: Thu, 30 Mar 2023 02:02:07 -0400 Subject: [PATCH] deps(dev): grunt-jsdoc-to-markdown@6.0.0 Also fix the fixdocs task to only deal with Unix line endings and fix README.hbs --- README.md | 4 ++-- jsdoc2md/README.hbs | 8 +++----- package.json | 2 +- tasks/fixdocs.js | 6 +++--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cc24aac..f9bbb3d 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ const userTable = db.defineTable('user', { const User = { async insertAndSelectExample() { - const result = await userTable.insert({email: 'newuser@email.com', name: 'newuser'}) - const rows = await userTable.select('*', 'WHERE `id` = ?', [result.insertId])) + const result = await userTable.insert({email: 'newuser@email.com', name: 'newuser'}); + const rows = await userTable.select('*', 'WHERE `id` = ?', [result.insertId]); console.log(rows); // [ { id: 1, email: 'newuser@email.com', name: 'newuser' } ] return rows[0]; } diff --git a/jsdoc2md/README.hbs b/jsdoc2md/README.hbs index 2138115..b4554f5 100644 --- a/jsdoc2md/README.hbs +++ b/jsdoc2md/README.hbs @@ -1,10 +1,8 @@ # mysql-plus [![NPM Version](https://img.shields.io/npm/v/mysql-plus.svg)](https://www.npmjs.com/package/mysql-plus) -[![Build Status](https://travis-ci.org/nwoltman/node-mysql-plus.svg?branch=master)](https://travis-ci.org/nwoltman/node-mysql-plus) +[![Build Status](https://img.shields.io/github/actions/workflow/status/nwoltman/node-mysql-plus/ci.yml?branch=master)](https://github.com/nwoltman/node-mysql-plus/actions/workflows/ci.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/nwoltman/node-mysql-plus/badge.svg?branch=master)](https://coveralls.io/github/nwoltman/node-mysql-plus?branch=master) -[![dependencies Status](https://david-dm.org/nwoltman/node-mysql-plus/status.svg)](https://david-dm.org/nwoltman/node-mysql-plus) -[![devDependencies Status](https://david-dm.org/nwoltman/node-mysql-plus/dev-status.svg)](https://david-dm.org/nwoltman/node-mysql-plus?type=dev) A MySQL client for Node.js that makes defining tables easy and automatically migrates table schemas. @@ -66,8 +64,8 @@ const userTable = db.defineTable('user', { const User = { async insertAndSelectExample() { - const result = await userTable.insert({email: 'newuser@email.com', name: 'newuser'}) - const rows = await userTable.select('*', 'WHERE `id` = ?', [result.insertId])) + const result = await userTable.insert({email: 'newuser@email.com', name: 'newuser'}); + const rows = await userTable.select('*', 'WHERE `id` = ?', [result.insertId]); console.log(rows); // [ { id: 1, email: 'newuser@email.com', name: 'newuser' } ] return rows[0]; } diff --git a/package.json b/package.json index ea04a46..e74908f 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "grunt": "^1.6.1", "grunt-env": "^1.0.1", "grunt-eslint": "^24.0.1", - "grunt-jsdoc-to-markdown": "^5.0.0", + "grunt-jsdoc-to-markdown": "^6.0.0", "grunt-mocha-istanbul": "^5.0.2", "grunt-mocha-test": "^0.13.3", "istanbul": "^0.4.5", diff --git a/tasks/fixdocs.js b/tasks/fixdocs.js index b60d473..9aa4317 100644 --- a/tasks/fixdocs.js +++ b/tasks/fixdocs.js @@ -1,15 +1,15 @@ 'use strict'; const fs = require('fs'); -const os = require('os'); module.exports = function(grunt) { grunt.registerTask('fixdocs', 'Fixes any problems with the generated documentation', () => { const docs = fs.readFileSync('README.md', 'utf8') - .replace(/\r\n|\r|\n/g, os.EOL) + .replace(/\r\n|\r|\n/g, '\n') .replace(/\| --- /g, '|:--- ') .replace(/<\/code>/g, ' | ') // Add ' | ' between multiple types - .replace(new RegExp(' ' + os.EOL + '(?=\\*\\*Example\\*\\*)', 'g'), os.EOL + os.EOL); + .replace(/ {2}\n(?=\*\*Example\*\*)/g, '\n\n') + .replace(/\s*?\n/g, '\n'); fs.writeFileSync('README.md', docs); grunt.log.ok('Fixed docs'); });