Skip to content

Commit

Permalink
deps(dev): grunt-jsdoc-to-markdown@6.0.0
Browse files Browse the repository at this point in the history
Also fix the fixdocs task to only deal with Unix line endings and fix README.hbs
  • Loading branch information
nwoltman committed Mar 30, 2023
1 parent 70c4a9d commit 47d5aec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
8 changes: 3 additions & 5 deletions jsdoc2md/README.hbs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions tasks/fixdocs.js
Original file line number Diff line number Diff line change
@@ -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><code>/g, '</code> &#124; <code>') // 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');
});
Expand Down

0 comments on commit 47d5aec

Please sign in to comment.