A React webapp scaffolding tool with best practice enforcement, automated testing, and more.
Scaffolding for automation of basic tooling and tasks typically required by React projects, including:
- CommonJS module bundling via Browserify
- ES2015+ (ES6+) syntax support and transpilation via Babel
- Code quality assessment & style enforcement via ESLint
- Stylus CSS preprocessing & automatic vendor prefix management via Autoprefixer
- Unit testing via the Jest framework and Jasmine2 test runner
npm i -g generator-enigma
The build script will automatically try to install Yeoman for you if it isn't installed already. Alternatively, you can do this yourself via
npm i -g yo
To set up a new app, create a folder, enter it and run
The generator will ask a few questions and insert the prebuilt skeleton for a typical React-based webapp. Then you're rolling!
Once you've set up your app, check out the targets available in
package.json. The conveniences available at
npm run <target>:
build: Compiles your application JS (with sourcemapping -- good for debugging) to
public/assets/bundle.jsand style files (with sourcemapping) to
release: Compiles and minifies your application JS (without sourcemapping) to
public/assets/bundle.min.jsand style files (without sourcemapping) to
public/assets/style.min.css- the intent is you should be able to copy the contents of
public/to a server and have it work without modification
start: Compiles your app and boots up a livereload server -- just make changes to your files (JS, Stylus/CSS, etc.)
test: Runs your unit tests. (will automatically include any file inside of folders named
coverage: Runs your unit tests and creates an LCOV coverage report in the
lint: Checks your project for JS code style, according to the rules in
Jest supports a broad spectrum of matchers and test-writing styles, so check out their documentation to customize things to your liking!
This module adheres to Semantic Versioning.