A quick overview of our build system used to test and compile our source code into documentation, CSS, and JS.
To use our Gruntfile and run our documentation locally, you'll need a copy of Figuration's source files, Node.js, and Grunt. Follow these steps and you should be ready to rock:
- Download and install Node.js, which we use to manage our dependencies.
- Install the Grunt command line tools,
npm install -g grunt-cli.
- Navigate to the root
/figurationdirectory and run
npm installto install our local dependencies listed in package.json.
When completed, you'll be able to run the various Grunt commands provided from the command line.
Our Gruntfile includes the following commands and tasks:
||Runs stylelint, eslint and QUnit tests headlessly in Karma.|
||Builds and runs the documentation so it can be viewed locally.|
In order to reduce potential issues with browser rounding, our build process has increased the Sass rounding precision to 6 (by default it's 5).
Figuration uses Autoprefixer (included in our Gruntfile and build process) to automatically add vendor prefixes to some CSS properties at build time. Doing so saves us time and code by allowing us to write key parts of our CSS a single time while eliminating the need for vendor mixins.
We maintain the list of browsers supported through Autoprefixer in a separate file within our GitHub repository. See our
.browserslistrc for details.
Also included in our Gruntfile and build process is postcss-flexbugs-fixes to work around some browser issues for flexbox layout. More information about these issues can be found over at the Flexbugs repository.
postcss-calc is used to reduce
calc() references whenever possible.
Running our documentation with Eleventy, a static site generator that provides us with: templating, Markdown-based files, and more. Here's how to get it started:
- Run through the tooling setup above to install all necessary development dependencies.
- From the root
npm run docs-servein the command line.
http://localhost:9001in your browser, and enjoy.
Learn more about using Eleventy by reading their documentation.
Should you encounter problems with installing dependencies or running Grunt commands or npm scripts, uninstall all previous dependency versions (global and local). Then, rerun