Welcome to the official repository for the Derek Kent for Maryland District 32 Delegate campaign web site.
This site is targeted at developers who would like to contribute to the campaign with code. If you are looking for the campaign web site, you can click the logo above. If you'd like to volunteer to improve the site, you can read on to learn how to setup your development environment. You can also take a look through the list of open Issues and read CONTRIBUTING.md for more information.
- Node.js v8.11.1+
- Ruby v2.2.3 (for testing)
- Gulp v4.0.0
- JSPM v0.17.0-beta.47
- SCSS-Lint v0.51 (for testing)
All Mac installation instructions assume you already have Homebrew installed.
brew install node
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs build-essential
sudo ln -s /usr/bin/nodejs /usr/bin/node
Newer versions of macOS use System Integrity Protection, which prevents modification of certain System directories, even as root. This also prevents installation of Gems to the System copy of Ruby; therefore, you will need to install a separate copy of Ruby for development.
brew install rbenv ruby-build
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby
rbenv install 2.2.3
rbenv global 2.2.3
ruby -v
# Install Ruby Dependencies
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# Install Ruby
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
rbenv install 2.2.3
rbenv global 2.2.3
ruby -v
# Tell Rubygems to not install documentation for each package locally, then install Bundler
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
gem install scss_lint
npm install -g gulp-cli
Note: On macOS, you must have Xcode 9.0.1+ installed along with the associated Command Line Tools (Xcode will prompt you to install these when you launch it if they are not installed).
npm install -g jspm
Note: If you have not previously used JSPM, you may be prompted to set up your GitHub credentials. It is recommended you do this in order to prevent being rate limited by GitHub. You can generate an access token in your GitHub account settings for JSPM, rather than providing your login credentials.
If you are not prompted, you can manually bring it up with:
jspm registry config github
git clone [email protected]:DerekKent/derekkent.com.git
cd derekkent.com
npm install
To build the site for development and load it in your default web browser with BrowserSync, run:
gulp dev
That will create a new dev
directory from which the site is served. Changes should be made to files in the src
directory. Gulp will automatically watch for changes in src
, perform any compilation and transpilation necessary, and update the result in dev
.
You can also run individual tasks. Enter gulp --tasks
to see the full list.
To build the site for production, run:
gulp dist
To run the linters and unit tests locally, enter:
npm test
You can also just run the linters (gulp lint
) or unit tests (gulp build --test && gulp ava
) individually.
If you have nyc
installed globally (npm i -g nyc
), you can also get code coverage (gulp build --test && nyc gulp ava
).