Contributions are always welcome! Please read below on how to setup your local environment for development and testing.
Before you start any work or send a Pull Request, please open an issue to discuss the solution/addition/fix with the project maintainers. This way everyone's on the same page when it comes to PR review time; there should be no surprises.
By the time the work is done and the PR is sent, the discussion will be focused on the code, not the idea behind the code.
- Source code is written in ES6 syntax.
- ES6 is converted to ES5 for greater browser support via Babel.
- Source code is in
src/app
. - Each product shares code from the
src/app/components
directory. - Products are bundled together via webpack.
- Bundles are built and set in place in their respective
dist/
directories vianpm
scripts. - Browser extension
zip
file is generated automatically. - Tests are run via Karma and Jasmine, packed via webpack, compiled via Babel, and run in Headless Chrome.
- Clone the repo:
git clone git@github.com:svinkle/togglific .git
cd togglific/
- Run
npm install
to get all the dependancies - Run
npm start
and start coding!
-
npm start
: Use when developing. This runswebpack -d
in debug mode which outputs more information within each bundle. This also watches for changes in any of the files. When changes are found, the bundle is rebuilt. -
npm run build
: Builds each of the products and places their respective scripts and related files within thedist/
directory, ready for deployment. Bundle scripts are minimized viawebpack -p
flag. -
npm test
: Runs the test suite.
Run npm test
to test from the command line.
Tests should be run before committing code, but will also be automatically run on git push
via Travis.
Browser extensions can be loaded from the local file system. This is useful for testing changes before deploying to browser vendor add-on repositories.
- Go to
chrome://extensions/
- ✅ Developer mode
- Click "Load unpacked extension…"
- Navigate to the
dist/browser-extension
directory and click "Select" - Test!
- Go to
about:debugging
- ✅ Enable add-on debugging
- Click "Load Temporary Add-on"
- Navigate to the
dist/browser-extension/manifest.json
file and click "Open" - Test!
- Go to
about:flags
- ✅ Enable extension developer features
- Click "More (…)"
- Click "Extensions"
- Click "Load extension"
- Navigate to the
dist/browser-extension/
directory and click "Select Folder" - Test!