-
Notifications
You must be signed in to change notification settings - Fork 0
Framework Development and Release Workflows
In this document, we'll cover:
This guide details the development and release workflows put in place to help manage changes to the framework over time.
- The http://id-responsi.cms-devl.bu.edu sandbox should be used for all new feature development and bug fixes.
- The http://id-presents.cms-devl.bu.edu sandbox should always use the current stable release of Responsive Framework, consistent with production.
- Always run
git pull
in your local Framework and Foundation repositories when beginning development. - All development for both the Framework and Foundation files should occur in the
develop
branch, or in specialized topic branches that get merged intodevelop
. - New releases are created by merging changes from the
develop
branch into themain
branch and generating a new version tag (e.g. 1.2.3). - Releases follow semantic versioning conventions.
Different versions of Foundation are used in different versions of the Framework, child themes, and Responsive Child Stater. When starting development, determine which version of Foundation you need to update. See: https://github.com/bu-ist/responsive-foundation/wiki/Responsive-Foundation-Versions
All new development for Foundation and Framework occur in the develop
branches, or in specialized topic branches that are merged into develop
. These changes should get pushed via SFTP to the Responsi development sandbox:
- URL: http://id-responsi.cms-devl.bu.edu
- Remote Server: ist-wp-app-devl01.bu.edu
- Remote Path: /var/www/sandboxes/id-responsi/current/wp-content/themes/responsive-framework-2x
All other environments, including http://id-presents.cms-devl.bu.edu, should use the latest stable tagged release of Responsive Framework. This should always be kept in sync with production so that child theme developers are working off of the latest Framework release.
Core framework development follows a similar workflow to child themes, but adds a bit of special sauce to support modifying Foundation source files in parallel.
- Clone both the Framework ( 2x or 3x ) and Foundation repositories.
- Determine the branch to checkout:
- Checkout the
develop
branch in each repository if working on the latest version. - If working on an update to an older release of Foundation such as 3x, or 4x the
develop
branch is no longer appropriate as it is farther ahead. Instead you'll need to create a branch from a previous release, such as from a tag. This will require usinggit
on the command line asTower
does not appear to have a way of creating that.
- Determine the version of
node
that must be used. Usenvm
(Node Version Manager) to switch node to the correct version in both repos. The version of node used differs for different versions of Responsive Framework and Responsive Foundation. It is critical that both repositories are using the same version of node fornpm link
to function as the symlinks created are stored globally for each version when usingnvm
. - Link the Foundation and Framework repositories together using
npm link
. See: NPM Link Guide - Run the
grunt
command to automatically re-generate static assets as you work.
Note that these steps assume that you have installed Node, and Grunt and Bower as detailed in the Getting Started guide.
First clone the Framework repository using Tower or by using the following commands in your Terminal:
$ cd path/to/your/themes
$ git clone [email protected]:bu-ist/responsive-framework.git
$ cd responsive-framework
$ git checkout develop
If you receive an error message complaining about public keys while cloning check to make sure you've set up SSH keys correctly for your Github account.
Next, install development dependencies using Node Package Manager:
$ npm install
In some older child themes, you may also need to run bower install
here to install the Responsive Foundation package. This step is skipped for core framework development, as we need to work in a clone of the Foundation repository in order to commit changes to it.
In order to make changes to the Foundation files, you first need a local clone of the repository. You can do this by cloning the repo using Tower, or by using the following commands:
$ cd path/to/your/themes
$ git clone [email protected]:bu-ist/responsive-foundation.git
$ cd responsive-foundation
$ git checkout develop
To make changes to the Foundation files immediately visible while working on the Framework, you need to link the repositories together. NPM has a handy shortcut for this.
NPM can be used to establish a link between the Framework and Foundation repositories during development.
Starting in the Foundation repository:
$ cd path/to/responsive-foundation
$ npm link
This will let NPM know that you intend to create a link to the Foundation repository. To actually create the link, change in to the Responsive Framework theme directory:
$ cd path/to/responsive-framework
$ npm link responsive-foundation
This will create a symlink to the Foundation repository in the node_modules
directory where NPM would normally install it.
You can now run the grunt
command on your responsive-framework folder and begin development.
Why do we run
grunt
on responsive-framework if we're making changes in responsive-foundation? By itself, all Foundation is is just a set of CSS. Just like CSS without HTML is sort of useless, Foundation without Framework isn't very helpful, because without Framework there is no WordPress theme to see your CSS changes on. That's why no matter whether you're making changes to Framework or Foundation, you always have to rungrunt
on Framework, and you'll always need to commit and push both Foundation and Framework if you make a change to Foundation.
For child theme development, the Foundation files are referenced by tagged release in package.json
and pulled in via NPM for development. This ensures that everyone that clones a child theme is working off the same version of Foundation.
In some older themes, this is achieved with Bower instead, and follows the same setup, except using bower.json.
For Framework development we establish that relationship manually using two separate repositories. Always run git pull
(or pull using Tower) in both your Framework and Foundation working copies to ensure they are up-to-date before beginning development.
If you don't your compiled output may differ from others. While this should be caught during the release process, it's always best to make sure your local repositories are up-to-date before starting development.
The other important thing to remember is that with Git commits are local; no one can see your commits until you have explicitly published them to the remote repository (Github) using git push
.
Updates to Foundation and Framework files should happen in the following order:
- Add and commit source file changes in Foundation. Run
git push
, or push in Tower, to publish these changes remotely. - Add and commit theme changes in Framework. Run
git push
, or push in Tower, to publish these changes remotely.
The key point being -- you should never commit Framework changes that include assets generated with a version of Foundation that is not published remotely.
Every change to the Responsive Framework and Foundation must be tagged prior to production release. NOTE: ALL changes should be in develop.
- Ensure that the
develop
branches for both the Foundation and Framework repositories are up to date by runninggit pull
. - Increment the version number in
package.json
and rungrunt version
to propagate the new version to project files (functions.php
, andstyle.scss
). - Recompile all static assets using
grunt build
. - Document all changes introduced in the new version in CHANGELOG.md.
- Commit changes
- Create a new tag as you push as
Version bump to [version]
. - Merge changes from
develop
tomain
. (In Tower, be onmain
branch and dragdevelop
ontomain
.)
In a case of a hotfix (merging changes from main
into develop
), aka when you need to push a fix into main
without taking any of the changes currently in develop
, and then merging the fix back into develop
:
- Ensure that the
main
branches for both the Foundation and Framework repositories are up to date by runninggit pull
. - Increment the version number in
package.json
and rungrunt version
to propagate the new version to project files (functions.php
, andstyle.scss
). - Recompile all static assets using
grunt build
. - Document all changes introduced in the new version in CHANGELOG.md.
- Create a new tag as you commit as
Version bump to [version]
. - Merge updates from
main
back todevelop
. - Push changes.
See "Creating a new release" for more information.
Get started
Configuration
Build child themes
- Customizing CSS in a child theme
- Overriding templates in a child theme
- Code patterns
- Code reviews
- Pulling in Foundation Updates
- Merging and Creating a Pull Request
Sass
Javascript
PHP
- Coding Standards
- PHP Constants
- Temp PHP Code Patterns
- PHP Snippets
- How to Use Hooks
- Action Hooks
- Using Action Hooks To Output Markup
- Filter Hooks
Shortcodes
Templates
GitHub
Tasks
Contribute to the framework
- Framework Development and Release Workflows
- Documentation Template
- Testing your changes
- Creating a new release
- Migration Guide
- Needs Documentation
Code Examples
- Adding Content Container Classes
- Adding News Templates
- Adding Script Dependencies
- Changing Available Layouts and Default Layout
- Displaying a Fancy Gallery
- Loading a Custom Build of Modernizr
- Loading Modernizr in the Footer
- Using Action Hooks To Output Markup
- Understanding get_template_part
BU Developer Resources