Skip to content

Latest commit

 

History

History
76 lines (50 loc) · 2.51 KB

CONTRIBUTING.md

File metadata and controls

76 lines (50 loc) · 2.51 KB

Contributing to Twitter Bootstrap Toggle Buttons

Before you publish a new release/tag, be sure to update the dist files according to the following description.

Table of Contents

  1. Prepare All Files
    1. TwbsToggleButtons.js
    2. CHANGELOG.md
  2. Generate Dist Files
    1. Compile Assets With Google Closure Compiler

Prepare All Files

⚠️ The changes in the following tow files are obligatory!

TwbsToggleButtons.js

Change the release version to the next tag in the header comment of file PROJECT_DIR/src/js/TwbsToggleButtons.js.

This line is necessary to display the release tag in the compiled dist files.

Example: Change

/** @preserve Twitter Bootstrap Toogle Buttons 0.0.3

to

/** @preserve Twitter Bootstrap Toogle Buttons 0.0.4

CHANGELOG.md

Change [Unreleased] to the next release tag and add all changes in file PROJECT_DIR/CHANGELOG.md.

The format is based on Keep a Changelog.

## [0.0.2] - 2017-05-11

### Added

* Added new Event `twbsToggleButtons:activate` to get new activated button **after** the toggle/cklick.

Add a new [Unreleased] section in the top.

Generate Dist Files

The dist files are a collection of all packed and minified assets (javascript an d css files).

You can build these files on many different ways, i.e. using gruntjs, webpack, etc. But As long as there are only two depended javascript files, it is totally sufficient to create the dist files with the help of the Google Closure Compiler.

Compile Assets With Google Closure Compiler

The Google Closure Compiler requires the Java Runtime Edition to run locally on your system.

Install Java and download the closure compiler into the PROJECT_DIR/bin directory.

⚠️ All files within the PROJECT_DIR/bin directory will be ignored by the PROJECT_DIR/.gitignore file and thus not be added to the repository.

Run the closure compiler and add both javascript files.

java -jar bin/closure-compiler-v20190709.jar \
  --js src/js/TwbsToggleButtons.js \
  --js src/js/jquery.twbs-toggle-buttons.js \
  --js_output_file dist/jquery.twbs-toggle-buttons.min.js