1.0.14 • Published 6 years ago
@spduk/jsdoc-autogen v1.0.14
jsdoc-autogen
Inspired by: Elixir Doctests & ExDoc
Idea
The idea is to have docs that will be automatically generated for your JavaScript code, with code examples that also double as tests within the source code.
Solution
I have no idea how to do this but my idea is basically this while using jest & being able to work on non-exported functions
- Parse @example for the input/output
 - Use Rewire to call functions without exporting them
 - Place @example input/output into test using rewire exported function
 - Generate docs with JSDoc example if test passes
 - Maybe it works? 🥴
 
⭐️ Features
- Webpack 4
 - Babel 7
 - UMD exports, so your library works everywhere.
 - Jest unit testing
 - Daily dependabot dependency updates
 
📦 Getting Started
git clone https://github.com/hodgef/js-library-boilerplate-basic.git myLibrary
npm install💎 Customization
Before shipping, make sure to:
- Edit 
LICENSEfile - Edit 
package.jsoninformation (These will be used to generate the headers for your built files) - Edit 
library: "MyLibrary"with your library's export name in./webpack.config.js 
🚀 Deployment
npm publish- Your users can include your library as usual
 
npm
import MyLibrary from 'my-library';
let libraryInstance = new MyLibrary();
...self-host/cdn
<script src="build/index.js"></script>
let MyLibrary = window.MyLibrary.default;
let libraryInstance = new MyLibrary();
...1.0.14
6 years ago