See trello card https://trello.com/c/XBgS4I0n
An Important Note on Semantic Versioning
This library attempts to follow the SemVer specification. Before deploying, be sure to update the library version in package.json
. This library will deploy to a semantically versioned path in the specified S3 bucket, so breaking changes will not affect previously deployed versions.
- Install Node.js
- Run
npm install
, which will install all necessary support libraries for testing building, and exporting - Copy
config/aws-config.json.example
toconfig/aws-config.json
and fill in with appropriate values.
If you don't have actual values for the config params, the example values may be left or changed simply to""
, and thegrunt aws
task simply won't complete.
- Follow the Environment Setup steps above
- Run
grunt
to build the libraries. If all tests pass, normal and minified libraries will be in the/build
directory.
- Follow the Environment Setup steps above
- Run
grunt test
- Follow the Environment Setup steps above
- Update the semantic version in
package.json
- Run
grunt deploy:production
. If all tests pass, normal and minified libraries will be uploaded to the S3 bucket specified inconfig/aws-config.json
along a semantically versioned path, and a matching CloudFront invalidation will be created.
To implement this script on a live site, load the script either synchronously or asynchronously using the following:
<script src="//my-cloudfront-dist-id.cloudfront.net/libs/flip-flop-spike/0.1.0b/flip-flop-spike.min.js"></script>
<script>
(function() {
var params = {
/* ... */
};
window.FFS = new FlipFlopSpike(params);
})();
</script>