From f490dbf85dd5e5560a1a05dce47e01eabe239edb Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Sun, 9 Apr 2017 09:26:20 +0200 Subject: [PATCH 01/21] Added support for asciidoc and custom handlebar templates --- src/lib/command.js | 4 ++- src/react-doc-generator.js | 33 +++++++++++++++++-- src/template-asciidoc.handlebars | 29 ++++++++++++++++ ...andlebars => template-markdown.handlebars} | 0 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 src/template-asciidoc.handlebars rename src/{template.handlebars => template-markdown.handlebars} (100%) diff --git a/src/lib/command.js b/src/lib/command.js index 92206c9..5b5c365 100644 --- a/src/lib/command.js +++ b/src/lib/command.js @@ -14,8 +14,10 @@ export default (function Command () { .option('-x, --extensions ', 'Include only these file extensions. Default: js,jsx', list, ['js', 'jsx']) .option('-i, --ignore ', 'Folders to ignore. Default: node_modules,__tests__,__mocks__', list, ['node_modules', '__tests__', '__mocks__']) .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, []) + .option('-f, --format ', 'Output format (markdown|asciiddoc) [markdown]') .option('-t, --title [value]', 'Document title. Default: \'Components\'', 'Components') - .option('-o, --output ', 'Markdown file to write. Default: \'DOCUMENTATION.MD\'', 'DOCUMENTATION.MD') + .option('-o, --output ', 'Markdown file to write. Default: \'DOCUMENTATION.MD\'') + .option('--handlebar-template [path]', 'Handlebar output template') .parse(process.argv); diff --git a/src/react-doc-generator.js b/src/react-doc-generator.js index 9039199..d8a903e 100644 --- a/src/react-doc-generator.js +++ b/src/react-doc-generator.js @@ -22,24 +22,51 @@ Handlebars.registerHelper('inc', (value, options) => { return parseInt(value, 10) + 1; }); +function getOutputConfig() { + const result = { + outputFile: Command.output || 'DOCUMENTATION.TXT', + template: null, + format: Command.format || 'markdown' + }; + + if(['markdown', 'asciidoc'].indexOf(result.format) === -1){ + throw 'Invalid format: ' + result.format + ', expected one of (asciidoc|markdown)'; + } + + result.template = Command.handlebarTemplate || path.join(__dirname, 'template-' + result.format + '.handlebars'); + + if(!Command.output && !Command.handlebarTemplate){ + if(result.format == 'asciidoc') { + result.outputFile = 'DOCUMENTATION.ADOC'; + } else if (result.format == 'markdown') { + result.outputFile = 'DOCUMENTATION.MD'; + } + } + + return result; +} + console.log(Colors.white(`\n\nREACT DOC GENERATOR v${pkg.version}`)); console.log(Colors.white(`by Marcin Borkowski `)); - -const output = fs.createWriteStream(Command.output); const templateData = { files: [], version: pkg.version, documentTitle: Command.title }; -const template = Handlebars.compile(`${fs.readFileSync(path.join(__dirname, 'template.handlebars'))}`); if (Command.args.length !== 1) { console.log(`${Colors.red('Please specify as the first argument!')}`); Command.help(); } else { + + let outputConfig = getOutputConfig(); + + const output = fs.createWriteStream(outputConfig.outputFile); + const template = Handlebars.compile(`${fs.readFileSync(outputConfig.template)}`); + readFiles( Command.args[0], { diff --git a/src/template-asciidoc.handlebars b/src/template-asciidoc.handlebars new file mode 100644 index 0000000..651ecb3 --- /dev/null +++ b/src/template-asciidoc.handlebars @@ -0,0 +1,29 @@ +{{#if documentTitle}} += {{documentTitle}} +{{/if}} + +:numbered: + +{{#each files}} + +== File: *{{filename}}* + +{{#each components}} +=== {{title}} + +{{{description}}} + +{{#if props}} +[options="header"] +|=== +|Property | Type | Required | Default value | Description +{{#each props}} +|{{@key}}|{{type.name}}|{{#if required}}yes{{else}}no{{/if}}|{{defaultValue.value}}|{{description}} +{{/each}} + +|=== +{{/if}} + +{{/each}} + +{{/each}} diff --git a/src/template.handlebars b/src/template-markdown.handlebars similarity index 100% rename from src/template.handlebars rename to src/template-markdown.handlebars From 2c3f86ac9a5f377c2e5eac70e67c25d3b5a0ce3a Mon Sep 17 00:00:00 2001 From: Frode Carlsen Date: Thu, 27 Apr 2017 14:28:52 +0200 Subject: [PATCH 02/21] Rename to react-asciidoc-generator as react-doc-generator is not responsive --- README.md | 58 ++++++++++++++----- package.json | 20 ++++--- src/lib/command.js | 6 +- ...nerator.js => react-asciidoc-generator.js} | 6 +- 4 files changed, 59 insertions(+), 31 deletions(-) rename src/{react-doc-generator.js => react-asciidoc-generator.js} (96%) diff --git a/README.md b/README.md index 9abb3ff..ffda845 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,44 @@ # React DOC Generator -[![npm version](https://img.shields.io/npm/v/react-doc-generator.svg?style=flat-square)](https://www.npmjs.com/package/react-doc-generator) -[![dependency status](https://img.shields.io/david/marborkowski/react-doc-generator.svg?style=flat-square)](https://david-dm.org/marborkowski/react-doc-generator) -[![build status](https://img.shields.io/travis/marborkowski/react-doc-generator.svg?style=flat-square)](https://travis-ci.org/marborkowski/react-doc-generator) +[![npm version](https://img.shields.io/npm/v/react-asciidoc-generator.svg?style=flat-square)](https://www.npmjs.com/package/react-asciidoc-generator) +[![dependency status](https://img.shields.io/david/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://david-dm.org/frode-carlsen/react-asciidoc-generator) +[![build status](https://img.shields.io/travis/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://travis-ci.org/frode-carlsen/react-asciidoc-generator) -Generate simple React components documentation in [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). +Generate simple React components documentation in either +* [Asciidoc] (http://asciidoctor.org/docs/). +* [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). +* Any custom handlebar template ## Installation -`$ npm install -save-dev react-doc-generator` +`$ npm install -save-dev react-asciidoc-generator` ## Usage -Check every option runnig `react-doc-generator` with `--help` or `-h`: +Check every option running `react-asciidoc-generator` with `--help` or `-h`: ``` -$ react-doc-generator --help +$ react-asciidoc-generator --help -Usage: react-doc-generator [options] +Usage: react-asciidoc-generator [options] Options: -h, --help output usage information -V, --version output the version number -x, --extensions Include only these file extensions. Default: js,jsx + -f, --format Output format (asciiddoc|asciidoc) [asciidoc] -i, --ignore Folders to ignore. Default: node_modules,__tests__,__mocks__ -e, --exclude-patterns Filename patterns to exclude. Default: [] -t, --title [value]> Document title. Default: 'Components' - -o, --output Markdown file to write. Default: 'README.MD' + -o, --output Output file to write. Default (asciidoc): 'DOCUMENTATION.ADOC'. Default (markdown): 'DOCUMENTATION.MD' + --handlebar-template [path] Custom handlebar output template. Alternative to --format. ``` ### By the command line Example: -`$ react-doc-generator src -o DOCUMENTATION.md` +`$ react-asciidoc-generator src -o DOCUMENTATION.adoc ### NPM script @@ -44,7 +49,7 @@ In your `package.json` put: { // ... "scripts": { - "doc": "react-doc-generator ./app/components/custom -o DOCUMENTATION.md" + "doc": "react-asciidoc-generator ./app/components/custom -o DOCUMENTATION.ADOC" } // ... } @@ -94,22 +99,43 @@ export class MyComponent extends React.Component { } ``` -Because [**react-doc-generator**](https://github.com/marborkowski/react-doc-generator) uses [**react-docgen**](https://github.com/reactjs/react-docgen) library, you can [follow other examples here](https://github.com/reactjs/react-docgen). +Because [**react-asciidoc-generator**](https://github.com/frode-carlsen/react-asciidoc-generator) uses [**react-docgen**](https://github.com/reactjs/react-docgen) library, you can [follow other examples here](https://github.com/reactjs/react-docgen). ## Demo - * [Example output](https://github.com/marborkowski/react-doc-generator/blob/master/demo/DOCUMENTATION.md) + * [Example output](https://github.com/frode-carlsen/react-asciidoc-generator/blob/master/demo/DOCUMENTATION.adoc) ## Terminal This is an example of what you'll see in your terminal. -![Terminal](https://raw.githubusercontent.com/marborkowski/react-doc-generator/master/demo/terminal.png) +![Terminal](https://raw.githubusercontent.com/frode-carlsen/react-asciidoc-generator/master/demo/terminal.png) -### License +### Licenses MIT License -Copyright (c) 2017 Marcin Borkowski () +Copyright (c) 2017 Frode Carlsen +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. + + +MIT License +Copyright (c) 2017 Marcin Borkowski () 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 diff --git a/package.json b/package.json index 2fd408c..2b87592 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "react-doc-generator", + "name": "react-asciidoc-generator", "version": "1.2.5", - "description": "Generate a simple React Component documentation in Markdown.", + "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { - "react-doc-generator": "dist/react-doc-generator.js" + "react-asciidoc-generator": "dist/react-asciidoc-generator.js" }, "scripts": { "lint": "eslint src", @@ -16,14 +16,20 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/marborkowski/react-doc-generator.git" + "url": "git+https://github.com/frode-carlsen/react-asciidoc-generator.git" }, - "author": "Marcin Borkowski", + "author": "Frode Carlsen", + "contributors": [ + { + "name": "Marcin Borkowski", + "url": "https://github.com/marborkowski/react-doc-generator" + } + ] "license": "MIT", "bugs": { - "url": "https://github.com/marborkowski/react-doc-generator/issues" + "url": "https://github.com/frode-carlsen/react-asciidoc-generator/issues" }, - "homepage": "https://github.com/marborkowski/react-doc-generator#readme", + "homepage": "https://github.com/frode-carlsen/react-asciidoc-generator#readme", "keywords": [ "react", "react-docgen", diff --git a/src/lib/command.js b/src/lib/command.js index 5b5c365..0e3d5fa 100644 --- a/src/lib/command.js +++ b/src/lib/command.js @@ -14,10 +14,10 @@ export default (function Command () { .option('-x, --extensions ', 'Include only these file extensions. Default: js,jsx', list, ['js', 'jsx']) .option('-i, --ignore ', 'Folders to ignore. Default: node_modules,__tests__,__mocks__', list, ['node_modules', '__tests__', '__mocks__']) .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, []) - .option('-f, --format ', 'Output format (markdown|asciiddoc) [markdown]') + .option('-f, --format ', 'Output format (markdown|asciiddoc) [asciidoc]') .option('-t, --title [value]', 'Document title. Default: \'Components\'', 'Components') - .option('-o, --output ', 'Markdown file to write. Default: \'DOCUMENTATION.MD\'') - .option('--handlebar-template [path]', 'Handlebar output template') + .option('-o, --output ', 'Output file to write. Default (asciidoc): \'DOCUMENTATION.ADOC\'') + .option('--handlebar-template [path]', 'Custom handlebar output template. Alternative to --format.') .parse(process.argv); diff --git a/src/react-doc-generator.js b/src/react-asciidoc-generator.js similarity index 96% rename from src/react-doc-generator.js rename to src/react-asciidoc-generator.js index d8a903e..3cf6946 100644 --- a/src/react-doc-generator.js +++ b/src/react-asciidoc-generator.js @@ -26,7 +26,7 @@ function getOutputConfig() { const result = { outputFile: Command.output || 'DOCUMENTATION.TXT', template: null, - format: Command.format || 'markdown' + format: Command.format || 'asciidoc' }; if(['markdown', 'asciidoc'].indexOf(result.format) === -1){ @@ -46,10 +46,6 @@ function getOutputConfig() { return result; } -console.log(Colors.white(`\n\nREACT DOC GENERATOR v${pkg.version}`)); -console.log(Colors.white(`by Marcin Borkowski `)); - - const templateData = { files: [], version: pkg.version, From cd05aa3cfb0a8a8b034717722fb230d13e2a0d77 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 14:35:59 +0200 Subject: [PATCH 03/21] .gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 1e80f67..3a35276 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,8 @@ jspm_packages # Optional REPL history .node_repl_history + +#Other +/cmd +/node +pom.xml From 5874cc82f4286cd85abaf02aa2547c5b54c31eb6 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 14:55:39 +0200 Subject: [PATCH 04/21] small change package.json --- package.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2b87592..515b74e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "lint": "eslint src", - "transpile": "babel src -D -d dist --ignore '__tests__, __mocks__'", + "transpile": "babel src -D -d dist --ignore '__tests__,__mocks__'", "watch": "babel src -D -d dist --ignore '__tests__,__mocks__' --watch", "pretest": "npm run transpile", "preversion": "npm run lint", @@ -20,11 +20,8 @@ }, "author": "Frode Carlsen", "contributors": [ - { - "name": "Marcin Borkowski", - "url": "https://github.com/marborkowski/react-doc-generator" - } - ] + "Marcin Borkowski (https://github.com/marborkowski/react-doc-generator)" + ], "license": "MIT", "bugs": { "url": "https://github.com/frode-carlsen/react-asciidoc-generator/issues" From b19b50ed86f5eee6903820014147e8e2c055cb95 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 15:07:53 +0200 Subject: [PATCH 05/21] fix babel ignore --- .babelrc | 6 ++++++ package.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..bab8a16 --- /dev/null +++ b/.babelrc @@ -0,0 +1,6 @@ +{ + "ignore": [ + "__tests__", + "__mocks__" + ] +} diff --git a/package.json b/package.json index 515b74e..7f4da9c 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ }, "scripts": { "lint": "eslint src", - "transpile": "babel src -D -d dist --ignore '__tests__,__mocks__'", - "watch": "babel src -D -d dist --ignore '__tests__,__mocks__' --watch", + "transpile": "babel src -D -d dist", + "watch": "babel src -D -d dist --watch", "pretest": "npm run transpile", "preversion": "npm run lint", "test": "jest" From 6bc0b337bf2ba3f0dd8729ce7919128daff7b6bb Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 15:09:59 +0200 Subject: [PATCH 06/21] Fix .npmignore --- .gitignore | 3 ++- .npmignore | 3 ++- hello.handlebars | 31 +++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 hello.handlebars diff --git a/.gitignore b/.gitignore index 3a35276..9c7cdc3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -# react-doc-generator +# react-asciidoc-generator dist +node # Logs logs diff --git a/.npmignore b/.npmignore index bc9b631..9951865 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,4 @@ -# react-doc-generator +# react-asciidoc-generator # Logs demo logs @@ -30,6 +30,7 @@ build/Release # Dependency directories node_modules +node jspm_packages # Optional npm cache directory diff --git a/hello.handlebars b/hello.handlebars new file mode 100644 index 0000000..b12d791 --- /dev/null +++ b/hello.handlebars @@ -0,0 +1,31 @@ +{{#if documentTitle}} += {{documentTitle}} +{{/if}} + +HELLO + +:numbered: + +{{#each files}} + +== File: *{{filename}}* + +{{#each components}} +=== {{title}} + +{{{description}}} + +{{#if props}} +[options="header"] +|=== +|Property | Type | Required | Default value | Description +{{#each props}} +|{{@key}}|{{type.name}}|{{#if required}}yes{{else}}no{{/if}}|{{defaultValue.value}}|{{description}} +{{/each}} + +|=== +{{/if}} + +{{/each}} + +{{/each}} From 5d78a4b8e91504a912380b00b5100c74fbce6396 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 15:13:23 +0200 Subject: [PATCH 07/21] added npm prepubish --- hello.handlebars | 31 ------------------------------- package.json | 2 ++ 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 hello.handlebars diff --git a/hello.handlebars b/hello.handlebars deleted file mode 100644 index b12d791..0000000 --- a/hello.handlebars +++ /dev/null @@ -1,31 +0,0 @@ -{{#if documentTitle}} -= {{documentTitle}} -{{/if}} - -HELLO - -:numbered: - -{{#each files}} - -== File: *{{filename}}* - -{{#each components}} -=== {{title}} - -{{{description}}} - -{{#if props}} -[options="header"] -|=== -|Property | Type | Required | Default value | Description -{{#each props}} -|{{@key}}|{{type.name}}|{{#if required}}yes{{else}}no{{/if}}|{{defaultValue.value}}|{{description}} -{{/each}} - -|=== -{{/if}} - -{{/each}} - -{{/each}} diff --git a/package.json b/package.json index 7f4da9c..9e4e8e8 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,11 @@ "scripts": { "lint": "eslint src", "transpile": "babel src -D -d dist", + "build": "npm run transpile", "watch": "babel src -D -d dist --watch", "pretest": "npm run transpile", "preversion": "npm run lint", + "prepublish": "npm run transpile", "test": "jest" }, "repository": { From 1a285afb748edccdfacb914d0dd90412481d18c3 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 15:24:20 +0200 Subject: [PATCH 08/21] changed prepublish npm script --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9e4e8e8..7a1b462 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,11 @@ "scripts": { "lint": "eslint src", "transpile": "babel src -D -d dist", - "build": "npm run transpile", + "build": "babel src -D -d dist", "watch": "babel src -D -d dist --watch", "pretest": "npm run transpile", "preversion": "npm run lint", - "prepublish": "npm run transpile", + "prepublish": "babel src -D -d dist", "test": "jest" }, "repository": { From 839950b671969671e886a4f67d5bfe3ef9237fd7 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 15:44:12 +0200 Subject: [PATCH 09/21] updated version no, license and acknowledgemen info --- LICENSE | 22 +++++++++++++++++++ README.md | 4 ++++ package.json | 2 +- ...st.js => react-asciidoc-generator.test.js} | 0 4 files changed, 27 insertions(+), 1 deletion(-) rename src/__tests__/{react-doc-generator.test.js => react-asciidoc-generator.test.js} (100%) diff --git a/LICENSE b/LICENSE index 924d61e..af05be8 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,25 @@ 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. + +MIT License + +Copyright (c) 2017 Frode Carlsen + +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. diff --git a/README.md b/README.md index ffda845..6135000 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,10 @@ This is an example of what you'll see in your terminal. ![Terminal](https://raw.githubusercontent.com/frode-carlsen/react-asciidoc-generator/master/demo/terminal.png) +### Acknowledgemens + +Forked from original module 'react-doc-generator' by Marcin Borowski (https://github.com/marborkowski/react-doc-generator) + ### Licenses MIT License diff --git a/package.json b/package.json index 7a1b462..7e7efc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.2.5", + "version": "1.5.0", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { diff --git a/src/__tests__/react-doc-generator.test.js b/src/__tests__/react-asciidoc-generator.test.js similarity index 100% rename from src/__tests__/react-doc-generator.test.js rename to src/__tests__/react-asciidoc-generator.test.js From 2fd55b483a18c949c0cced591e753cfb477c0e42 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 18:23:21 +0200 Subject: [PATCH 10/21] added es2016 presets --- .babelrc | 3 ++- package.json | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.babelrc b/.babelrc index bab8a16..07e0334 100644 --- a/.babelrc +++ b/.babelrc @@ -2,5 +2,6 @@ "ignore": [ "__tests__", "__mocks__" - ] + ], + "presets": [ "es2015", "es2016" ] } diff --git a/package.json b/package.json index 7e7efc1..56358e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.0", + "version": "1.5.1", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { @@ -22,7 +22,7 @@ }, "author": "Frode Carlsen", "contributors": [ - "Marcin Borkowski (https://github.com/marborkowski/react-doc-generator)" + "Marcin Borkowski (https://github.com/marborkowski/react-doc-generator)" ], "license": "MIT", "bugs": { @@ -63,6 +63,8 @@ "babel-eslint": "^7.1.1", "babel-jest": "^19.0.0", "babel-preset-env": "^1.2.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-es2016": "^6.24.1", "eslint": "^3.17.0", "eslint-config-react-app": "^0.5.2", "eslint-plugin-flowtype": "^2.30.0", From 015b86261c1a4b78b75b650d4c4abbb1d2b36e40 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 18:55:24 +0200 Subject: [PATCH 11/21] regexp exclude pattern --- package.json | 2 +- src/react-asciidoc-generator.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 56358e7..626f48c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.1", + "version": "1.5.2", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { diff --git a/src/react-asciidoc-generator.js b/src/react-asciidoc-generator.js index 3cf6946..2faa16e 100644 --- a/src/react-asciidoc-generator.js +++ b/src/react-asciidoc-generator.js @@ -67,8 +67,8 @@ if (Command.args.length !== 1) { Command.args[0], { match: new RegExp('\\.(?:' + Command.extensions.join('|') + ')$'), - exclude: Command.excludePatterns, - excludeDir: Command.ignore, + exclude: new RegExp('\\.(?:' + Command.excludePatterns.join('|') + ')$'), + excludeDir: new RegExp('\\.(?:' + Command.ignore.join('|') + ')$'), }, (err, content, filename, next) => { if (err) { From 1b976fc50b785f6d684efc9ba56ed4cf95461aed Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 19:00:01 +0200 Subject: [PATCH 12/21] regexp exclude pattern --- package.json | 2 +- src/lib/command.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 626f48c..cfa620b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.2", + "version": "1.5.3", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { diff --git a/src/lib/command.js b/src/lib/command.js index 0e3d5fa..85b36d6 100644 --- a/src/lib/command.js +++ b/src/lib/command.js @@ -13,7 +13,7 @@ export default (function Command () { .usage(` [options]`) .option('-x, --extensions ', 'Include only these file extensions. Default: js,jsx', list, ['js', 'jsx']) .option('-i, --ignore ', 'Folders to ignore. Default: node_modules,__tests__,__mocks__', list, ['node_modules', '__tests__', '__mocks__']) - .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, []) + .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, ['.*.spec.jsx', '.*.spec.js' ]) .option('-f, --format ', 'Output format (markdown|asciiddoc) [asciidoc]') .option('-t, --title [value]', 'Document title. Default: \'Components\'', 'Components') .option('-o, --output ', 'Output file to write. Default (asciidoc): \'DOCUMENTATION.ADOC\'') From cecaeb298dac030d49605f10c7b40c2446d3f2dd Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Thu, 27 Apr 2017 19:02:34 +0200 Subject: [PATCH 13/21] changing filename pattern --- package.json | 2 +- src/lib/command.js | 2 +- src/react-asciidoc-generator.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cfa620b..35b7a9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.3", + "version": "1.5.4", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { diff --git a/src/lib/command.js b/src/lib/command.js index 85b36d6..650ecc9 100644 --- a/src/lib/command.js +++ b/src/lib/command.js @@ -13,7 +13,7 @@ export default (function Command () { .usage(` [options]`) .option('-x, --extensions ', 'Include only these file extensions. Default: js,jsx', list, ['js', 'jsx']) .option('-i, --ignore ', 'Folders to ignore. Default: node_modules,__tests__,__mocks__', list, ['node_modules', '__tests__', '__mocks__']) - .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, ['.*.spec.jsx', '.*.spec.js' ]) + .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, ['*.spec.jsx', '*.spec.js' ]) .option('-f, --format ', 'Output format (markdown|asciiddoc) [asciidoc]') .option('-t, --title [value]', 'Document title. Default: \'Components\'', 'Components') .option('-o, --output ', 'Output file to write. Default (asciidoc): \'DOCUMENTATION.ADOC\'') diff --git a/src/react-asciidoc-generator.js b/src/react-asciidoc-generator.js index 2faa16e..3cf6946 100644 --- a/src/react-asciidoc-generator.js +++ b/src/react-asciidoc-generator.js @@ -67,8 +67,8 @@ if (Command.args.length !== 1) { Command.args[0], { match: new RegExp('\\.(?:' + Command.extensions.join('|') + ')$'), - exclude: new RegExp('\\.(?:' + Command.excludePatterns.join('|') + ')$'), - excludeDir: new RegExp('\\.(?:' + Command.ignore.join('|') + ')$'), + exclude: Command.excludePatterns, + excludeDir: Command.ignore, }, (err, content, filename, next) => { if (err) { From de974a93aae11489cabf84c1953b8bb618c7f658 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Fri, 28 Apr 2017 07:29:22 +0200 Subject: [PATCH 14/21] working exclude pattern using regexp --- DOCUMENTATION.ADOC | 4 ++ README.md | 31 ++-------- package.json | 2 +- src/react-asciidoc-generator.js | 100 ++++++++++++++++---------------- 4 files changed, 62 insertions(+), 75 deletions(-) create mode 100644 DOCUMENTATION.ADOC diff --git a/DOCUMENTATION.ADOC b/DOCUMENTATION.ADOC new file mode 100644 index 0000000..0bc87ed --- /dev/null +++ b/DOCUMENTATION.ADOC @@ -0,0 +1,4 @@ += Components + +:numbered: + diff --git a/README.md b/README.md index 6135000..9d3531e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # React DOC Generator [![npm version](https://img.shields.io/npm/v/react-asciidoc-generator.svg?style=flat-square)](https://www.npmjs.com/package/react-asciidoc-generator) -[![dependency status](https://img.shields.io/david/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://david-dm.org/frode-carlsen/react-asciidoc-generator) -[![build status](https://img.shields.io/travis/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://travis-ci.org/frode-carlsen/react-asciidoc-generator) +[![dependency status](https://img.shields.io/david/zarbear/react-asciidoc-generator.svg?style=flat-square)](https://david-dm.org/zarbear/react-asciidoc-generator) +[![build status](https://img.shields.io/travis/zarbear/react-asciidoc-generator.svg?style=flat-square)](https://travis-ci.org/zarbear/react-asciidoc-generator) + +This is a fork of [react-doc-generator](https://github.com/frode-carlsen/react-doc-generator) to provide additional features for asciidoc or custom templates. Generate simple React components documentation in either -* [Asciidoc] (http://asciidoctor.org/docs/). +* [Asciidoc](http://asciidoctor.org/docs/). * [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). * Any custom handlebar template @@ -28,7 +30,7 @@ Options: -x, --extensions Include only these file extensions. Default: js,jsx -f, --format Output format (asciiddoc|asciidoc) [asciidoc] -i, --ignore Folders to ignore. Default: node_modules,__tests__,__mocks__ - -e, --exclude-patterns Filename patterns to exclude. Default: [] + -e, --exclude-patterns Filename patterns to exclude (may be comma-separated list of regexp). Default: '*.spec.jsx','*.spec.js' -t, --title [value]> Document title. Default: 'Components' -o, --output Output file to write. Default (asciidoc): 'DOCUMENTATION.ADOC'. Default (markdown): 'DOCUMENTATION.MD' --handlebar-template [path] Custom handlebar output template. Alternative to --format. @@ -117,27 +119,6 @@ Forked from original module 'react-doc-generator' by Marcin Borowski (https://gi ### Licenses -MIT License -Copyright (c) 2017 Frode Carlsen -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. - - MIT License Copyright (c) 2017 Marcin Borkowski () Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/package.json b/package.json index 35b7a9c..f261065 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.4", + "version": "1.5.5", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { diff --git a/src/react-asciidoc-generator.js b/src/react-asciidoc-generator.js index 3cf6946..332027a 100644 --- a/src/react-asciidoc-generator.js +++ b/src/react-asciidoc-generator.js @@ -63,65 +63,67 @@ if (Command.args.length !== 1) { const output = fs.createWriteStream(outputConfig.outputFile); const template = Handlebars.compile(`${fs.readFileSync(outputConfig.template)}`); + const excludeFilePatterns = new RegExp('(?:' + Command.excludePatterns.join('|') + ')$'); readFiles( Command.args[0], { match: new RegExp('\\.(?:' + Command.extensions.join('|') + ')$'), - exclude: Command.excludePatterns, excludeDir: Command.ignore, }, (err, content, filename, next) => { if (err) { throw err; } - - try { - let components = parse(content, resolver.findAllExportedComponentDefinitions); - components = components.map(component => { - if (component.description && !component.displayName) { - component.title = component.description.match(/^(.*)$/m)[0]; - if (component.description.split('\n').length > 1) { - component.description = component.description.replace(/[\w\W]+?\n+?/, ''); - component.description = component.description.replace(/(\n)/gm, ' \n'); - } else { - component.description = null; - } - } else { - component.title = component.displayName; - } - - if (component.description) { - component.description = `${component.description} \n\n`; - } - - // validate default values - if (component.props) { - Object.keys(component.props).forEach(key => { - let obj = component.props[key]; - if (obj.defaultValue) { - if ((/[^\w\s.&:\-+*,!@%$]+/igm).test(obj.defaultValue.value)) { - obj.defaultValue.value = ''; - } - } - }); - } - - return component; - }); - templateData.files.push({ filename, components }); - table.push([ - filename, - components.length, - Colors.green(`OK.`) - ]); - } catch (e) { - table.push([ - filename, - 0, - Colors.red(`You have to export at least one valid React Class!`) - ]); - } - + + if(!filename.match(excludeFilePatterns)) { + + try { + let components = parse(content, resolver.findAllExportedComponentDefinitions); + components = components.map(component => { + if (component.description && !component.displayName) { + component.title = component.description.match(/^(.*)$/m)[0]; + if (component.description.split('\n').length > 1) { + component.description = component.description.replace(/[\w\W]+?\n+?/, ''); + component.description = component.description.replace(/(\n)/gm, ' \n'); + } else { + component.description = null; + } + } else { + component.title = component.displayName; + } + + if (component.description) { + component.description = `${component.description} \n\n`; + } + + // validate default values + if (component.props) { + Object.keys(component.props).forEach(key => { + let obj = component.props[key]; + if (obj.defaultValue) { + if ((/[^\w\s.&:\-+*,!@%$]+/igm).test(obj.defaultValue.value)) { + obj.defaultValue.value = ''; + } + } + }); + } + + return component; + }); + templateData.files.push({ filename, components }); + table.push([ + filename, + components.length, + Colors.green(`OK.`) + ]); + } catch (e) { + table.push([ + filename, + 0, + Colors.red(`You have to export at least one valid React Class!`) + ]); + } + } next(); }, err => { From 92e210a499e335d6212f3c13efcbe5942b32074e Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Fri, 28 Apr 2017 07:38:44 +0200 Subject: [PATCH 15/21] excluding .spec.jsx and .spec.js by default --- DOCUMENTATION.ADOC | 67 ++++++++++++++++++++++++++++++++- README.md | 2 +- src/lib/command.js | 2 +- src/react-asciidoc-generator.js | 2 +- 4 files changed, 68 insertions(+), 5 deletions(-) diff --git a/DOCUMENTATION.ADOC b/DOCUMENTATION.ADOC index 0bc87ed..45c5d73 100644 --- a/DOCUMENTATION.ADOC +++ b/DOCUMENTATION.ADOC @@ -1,4 +1,67 @@ -= Components += Components + +:numbered: + + +== File: *..\react-doc-generator-test\test\ExampleComponent.js* + +=== General component description. + +fdgdfgdf gfdgfdg fdgfdgdfg +gdfgfdgdfg dfgdfgfdg dfg df getDefaultPropsg fdgfd +gfdgfdgdfgfdg. + + +Example: +```html + +``` -:numbered: + + +[options="header"] +|=== +|Property | Type | Required | Default value | Description +|foo|number|no|42|Description of prop "foo". +|bar|custom|no|21|Description of prop "bar" (a custom validation function). +|baz|union|no|| + +|=== + + + +== File: *..\react-doc-generator-test\test\inside\OtherExampleComponent.js* + +=== General component description. + + + +[options="header"] +|=== +|Property | Type | Required | Default value | Description +|foo|number|no|10000099999|Description of prop "foo". +|bar|custom|no||Description of prop "bar" (a custom validation function). +|baz|union|no|| +|onExit|func|no|<See the source code>| + +|=== + +=== DUPA + +General another component description. +Blah blah blah... +fdfdfsdf +fdsfsd + + +[options="header"] +|=== +|Property | Type | Required | Default value | Description +|foo|number|no||Description of prop "foo". +|bar|custom|no||Description of prop "bar" (a custom validation function). +|baz|union|no|| + +|=== + + diff --git a/README.md b/README.md index 9d3531e..a95dff1 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Options: -x, --extensions Include only these file extensions. Default: js,jsx -f, --format Output format (asciiddoc|asciidoc) [asciidoc] -i, --ignore Folders to ignore. Default: node_modules,__tests__,__mocks__ - -e, --exclude-patterns Filename patterns to exclude (may be comma-separated list of regexp). Default: '*.spec.jsx','*.spec.js' + -e, --exclude-patterns Filename patterns to exclude (may be comma-separated list of regexp). Default: '.*\.spec.(jsx|js)' -t, --title [value]> Document title. Default: 'Components' -o, --output Output file to write. Default (asciidoc): 'DOCUMENTATION.ADOC'. Default (markdown): 'DOCUMENTATION.MD' --handlebar-template [path] Custom handlebar output template. Alternative to --format. diff --git a/src/lib/command.js b/src/lib/command.js index 650ecc9..c1b0eca 100644 --- a/src/lib/command.js +++ b/src/lib/command.js @@ -13,7 +13,7 @@ export default (function Command () { .usage(` [options]`) .option('-x, --extensions ', 'Include only these file extensions. Default: js,jsx', list, ['js', 'jsx']) .option('-i, --ignore ', 'Folders to ignore. Default: node_modules,__tests__,__mocks__', list, ['node_modules', '__tests__', '__mocks__']) - .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, ['*.spec.jsx', '*.spec.js' ]) + .option('-e, --exclude-patterns ', 'Filename patterns to exclude. Default: []', list, ['.*\.spec.(jsx|js)' ]) .option('-f, --format ', 'Output format (markdown|asciiddoc) [asciidoc]') .option('-t, --title [value]', 'Document title. Default: \'Components\'', 'Components') .option('-o, --output ', 'Output file to write. Default (asciidoc): \'DOCUMENTATION.ADOC\'') diff --git a/src/react-asciidoc-generator.js b/src/react-asciidoc-generator.js index 332027a..c1bd3ff 100644 --- a/src/react-asciidoc-generator.js +++ b/src/react-asciidoc-generator.js @@ -63,7 +63,7 @@ if (Command.args.length !== 1) { const output = fs.createWriteStream(outputConfig.outputFile); const template = Handlebars.compile(`${fs.readFileSync(outputConfig.template)}`); - const excludeFilePatterns = new RegExp('(?:' + Command.excludePatterns.join('|') + ')$'); + const excludeFilePatterns = new RegExp('^.*(?:' + Command.excludePatterns.join('|') + ')$'); readFiles( Command.args[0], { From 99fb73d70a686879810c812e44cf0a65954ea386 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Fri, 28 Apr 2017 07:39:20 +0200 Subject: [PATCH 16/21] updated version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f261065..a3f06ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.5", + "version": "1.5.6", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { From 6a278eb6692b032d85d9556a9da95dc634c11511 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Wed, 3 May 2017 21:01:43 +0200 Subject: [PATCH 17/21] normalize paths (exclude rootDir from output names) --- doc.adoc | 67 +++++++++++++++++++++++++++++++++ src/react-asciidoc-generator.js | 11 +++--- 2 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 doc.adoc diff --git a/doc.adoc b/doc.adoc new file mode 100644 index 0000000..79e07d4 --- /dev/null +++ b/doc.adoc @@ -0,0 +1,67 @@ += Components + +:numbered: + + +== File: ** + +=== General component description. + +fdgdfgdf gfdgfdg fdgfdgdfg +gdfgfdgdfg dfgdfgfdg dfg df getDefaultPropsg fdgfd +gfdgfdgdfgfdg. + + +Example: +```html + +``` + + + +[options="header"] +|=== +|Property | Type | Required | Default value | Description +|foo|number|no|42|Description of prop "foo". +|bar|custom|no|21|Description of prop "bar" (a custom validation function). +|baz|union|no|| + +|=== + + + +== File: ** + +=== General component description. + + + +[options="header"] +|=== +|Property | Type | Required | Default value | Description +|foo|number|no|10000099999|Description of prop "foo". +|bar|custom|no||Description of prop "bar" (a custom validation function). +|baz|union|no|| +|onExit|func|no|<See the source code>| + +|=== + +=== DUPA + +General another component description. +Blah blah blah... +fdfdfsdf +fdsfsd + + + +[options="header"] +|=== +|Property | Type | Required | Default value | Description +|foo|number|no||Description of prop "foo". +|bar|custom|no||Description of prop "bar" (a custom validation function). +|baz|union|no|| + +|=== + + diff --git a/src/react-asciidoc-generator.js b/src/react-asciidoc-generator.js index c1bd3ff..35676f8 100644 --- a/src/react-asciidoc-generator.js +++ b/src/react-asciidoc-generator.js @@ -64,8 +64,9 @@ if (Command.args.length !== 1) { const template = Handlebars.compile(`${fs.readFileSync(outputConfig.template)}`); const excludeFilePatterns = new RegExp('^.*(?:' + Command.excludePatterns.join('|') + ')$'); + const rootDir = path.normalize(Command.args[0]); readFiles( - Command.args[0], + rootDir, { match: new RegExp('\\.(?:' + Command.extensions.join('|') + ')$'), excludeDir: Command.ignore, @@ -76,7 +77,7 @@ if (Command.args.length !== 1) { } if(!filename.match(excludeFilePatterns)) { - + var abbrevFilename = filename.replace(rootDir, ''); try { let components = parse(content, resolver.findAllExportedComponentDefinitions); components = components.map(component => { @@ -110,15 +111,15 @@ if (Command.args.length !== 1) { return component; }); - templateData.files.push({ filename, components }); + templateData.files.push({ abbrevFilename, components }); table.push([ - filename, + abbrevFilename, components.length, Colors.green(`OK.`) ]); } catch (e) { table.push([ - filename, + abbrevFilename, 0, Colors.red(`You have to export at least one valid React Class!`) ]); From 4c7af792d3d149d71e0fcd094c62535bb5d49255 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Wed, 3 May 2017 21:02:08 +0200 Subject: [PATCH 18/21] updated version to 1.5.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3f06ad..045100a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.6", + "version": "1.5.7", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { From 24721949bd49b55a463993a3c2b98281abd70008 Mon Sep 17 00:00:00 2001 From: frode carlsen Date: Wed, 3 May 2017 21:04:49 +0200 Subject: [PATCH 19/21] updated README and version to 1.5.8 --- README.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a95dff1..6a4bf40 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # React DOC Generator [![npm version](https://img.shields.io/npm/v/react-asciidoc-generator.svg?style=flat-square)](https://www.npmjs.com/package/react-asciidoc-generator) -[![dependency status](https://img.shields.io/david/zarbear/react-asciidoc-generator.svg?style=flat-square)](https://david-dm.org/zarbear/react-asciidoc-generator) -[![build status](https://img.shields.io/travis/zarbear/react-asciidoc-generator.svg?style=flat-square)](https://travis-ci.org/zarbear/react-asciidoc-generator) +[![dependency status](https://img.shields.io/david/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://david-dm.org/frode-carlsen/react-asciidoc-generator) +[![build status](https://img.shields.io/travis/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://travis-ci.org/frode-carlsen/react-asciidoc-generator) This is a fork of [react-doc-generator](https://github.com/frode-carlsen/react-doc-generator) to provide additional features for asciidoc or custom templates. diff --git a/package.json b/package.json index 045100a..a3233ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-asciidoc-generator", - "version": "1.5.7", + "version": "1.5.8", "description": "Generate a simple React Component documentation in Asciidoc, Markdown, or custom template", "main": "dist/index.js", "bin": { From 1dc5a92a31337a63048728f51065fc1c73496a07 Mon Sep 17 00:00:00 2001 From: Frode Carlsen Date: Thu, 19 Apr 2018 16:25:39 +0200 Subject: [PATCH 20/21] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6a4bf40..600b281 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![npm version](https://img.shields.io/npm/v/react-asciidoc-generator.svg?style=flat-square)](https://www.npmjs.com/package/react-asciidoc-generator) [![dependency status](https://img.shields.io/david/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://david-dm.org/frode-carlsen/react-asciidoc-generator) [![build status](https://img.shields.io/travis/frode-carlsen/react-asciidoc-generator.svg?style=flat-square)](https://travis-ci.org/frode-carlsen/react-asciidoc-generator) +[![Known Vulnerabilities](https://snyk.io/test/github/frode-carlsen/react-asciidoc-generator/badge.svg?targetFile=package.json)](https://snyk.io/test/github/frode-carlsen/react-asciidoc-generator?targetFile=package.json) This is a fork of [react-doc-generator](https://github.com/frode-carlsen/react-doc-generator) to provide additional features for asciidoc or custom templates. From 2091aecae5ccf9d72ab90f47235d6f3663645a81 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Fri, 3 Aug 2018 15:25:07 +0000 Subject: [PATCH 21/21] fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/npm:react-dom:20180802 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3233ba..45986f8 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "node-dir": "^0.1.16", "react": "^15.4.2", "react-docgen": "^2.13.0", - "react-dom": "^15.4.2" + "react-dom": "^16.0.1" }, "devDependencies": { "babel-cli": "^6.23.0",