codecontrol v0.1.4
Codecontrol
The Prebuilt Build System
A simple, out-of-the-box and quick build system.
Install
To install codecontrol run the following the command
$ npm install -g codecontrol
or if you are yarn
$ yarn global add codecontrol
Usage
In an effort to increase simplicity, Codecontrol does not support a config file. Everything is preconfigured for your convenience. Currently, codecontrol uses a webpack style folder structure and it uses h5bp for its boilerplate.
Codecontrol has only 2 commands.
1) codecontrol -n <dirname>
This is codecontrol's command for generating a new project. It only has 1 option you to set the folder name. To be generated.
If the folder already exists. codecontrol will use the folder name codecontrol-gen
instead.
- Generates a webpack style folder structure.
- Copies HTML5 Boilerplate To the
src/
folder. - Generates
package.json
and installscodecontrol
2) codecontrol -d
codecontrol -d
is codecontrol's development function. What it does is it copies the src/
folder to the dist/
applying a few optimizations to certain files. It repeats this process if the src/
file are modified. It also starts a live server that watches the dist
and updates the browser if a change occurs.
JS Files
codecontrol
searches for js files and applies certain optimizations to them. Below is the list in the order in which they are applied.
babelify
runs your code throughbabel
which ensures that your code is compatible with older browsers. ( see compatible browsers)babelify
is installed with the preset-env preset and the preset-react preset which allows babel to modify code as needed, it also allows to use jsx.- The code is then run through
browserify
which bundles any imported or required modules into a single file. - This bundled code is then minified using
terser
and is written to thedist/
folder. - After it is done writing the file, the source files in the
src/
folder are linted usingstandard
. If any errors are found standard will attempt to fix them.
CSS Files
codecontrol
searches for css files and applies certain optimizations to them. Below is the list in the order in which they are applied.
autoprefixer
applies vendor-prefixes like-moz
to your code to make it compatible with older browsers. ( see compatible browsers)postcss-preset-env
is like babel for css and makes it compatible with older browsers.- Your styles are then minified (uglified) with
cssnano
and are written to thedist/
folder - After it is done writing the file, the source files in the
src/
folder are linted usingstylelint
. If any errors are found stylelint will attempt to fix them.
Warnings and other infomation.
- While Linting, If any errors are found the linter will attempt to fix them. This will change source files \
- All packages are run using their default config. \
- Codecontrol will copy the file structure from the
src/
folder to thedist/
folder.
Future modifications.
These are modifications that might arrive in a future version of codecontrol.
- Replacing
terser
and its runnerminify-stream
withbabel-preset-minify
- Replace
browser-sync
with another live-server implementation - Add
html-minifier
to minify html files.