Some personalized scaffolding tools I am using to automate my workflow.
This is an experiment / proof of concept. One day it may grow into a generalized tool for scaffolding modules, apps, components, etc. Feel free to fork or post issues if you want to discuss.
Install the module globally to access all the bins.
npm install @mattdesl/quick-stub -gNow any of the scripts can be run from the command-line. Run them inside a module folder with a package.json file. Example:
# make a module
mkdir my-module
cd my-module
npm init
# add a test and install its dependencies
quick-test tests/index.jsThe above installs tape and faucet and writes the following:
var myModule = require('../')
var test = require('tape')
test('your package description', function(t) {
t.end()
})It also adds the following to your package.json:
"scripts": {
"test": "node test/index.js | faucet"
}All scripts listed below. As you can see they are highly personalized to my workflow.
Installs tape and faucet as dependencies, stubs out a test file, and adds a test script to your package.json.
Usage:
quick-test [entry] [opt]
[entry] the file to write, default test.js
-f force overwrite (no prompt)Examples:
quick-test
quick-test tests/index.jsInstalls browserify and uglify-js, then adds a "build" script to your package.json that looks like this:
"scripts": {
"build": "browserify index.js | uglifyjs -cm > bundle.js"
}
Options:
quick-build [entry] [opt]
[entry] the entry to build, default index.js
--outfile, -o the outfile, default bundle.js
Adds a bin field to your package.json and stubs out a simple bin/index.js file with the following:
#!/usr/bin/env node
Options:
quick-bin [filename] [opt]
[filename] the file name, default index.js
--minimist, -m include minimist dependency + code
--dir the directory, default 'bin'
With --minimist the file includes arg parsing.
Stubs out a simple HTML5 template at the given file, or defaults to index.html.
quick-html [entry]
[entry] the output file, default index.htmlAdd budo to your package.json.
quick-budo test.js --prodThe above command installs budo, garnish, babelify, errorify and adds the following script:
"start": "budo test.js -t babelify -p errorify | garnish"
Create a folder with a script, css and template file.
quick-component ./src/components/my-compOptions:
quick-component [path] [opts]
[path] the folder that will be created
--css, -c the name for the style file (default style.css)
--script, -s the name for the script file (default index.js)
--template, -t the name for the template file (default template.html)
MIT, see LICENSE.md for details.