Skip to content

Commit

Permalink
adds version & min file
Browse files Browse the repository at this point in the history
  • Loading branch information
yowainwright committed Nov 2, 2016
1 parent e5de92b commit af88a11
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
7 changes: 7 additions & 0 deletions dist/shave.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
const gulp = require('gulp');
const head = require('gulp-header');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const qunit = require('node-qunit-phantomjs');

const pkg = require('./package.json');
const banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @author <%= pkg.author %>',
' * @license <%= pkg.license %> */',
''].join('\n');

gulp.task('test', function() {
qunit('tests/index.html');
});

gulp.task('default', ['test']);
gulp.task('minify', function() {
gulp.src('dist/shave.js')
.pipe(uglify())
.pipe(head(banner, { pkg }))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('dist/'));
});

gulp.task('default', ['minify', 'test']);
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "shave",
"version": "0.1.7",
"version": "0.1.8",
"description": "Shave is a javascript plugin that truncates multi-line text within a html element based on set max height",
"main": "dist/shave.js",
"files": [
"files": [
"dist"
],
"scripts": {
"test": "gulp test",
"postpublish": "git tag $npm_package_version && git push origin --tags"
"postpublish": "git tag $npm_package_version && git push origin --tags"
},
"repository": {
"type": "git",
Expand All @@ -18,17 +18,17 @@
"ellipsis",
"truncate",
"truncation",
"truncated",
"semantic",
"js",
"content",
"truncated",
"semantic",
"js",
"content",
"shorten",
"javascript",
"text",
"shave",
"trim"
"shave",
"trim"
],
"author": "Jeff Wainwright <[email protected]> (jeffr.in)",
"author": "Jeff Wainwright <[email protected]> (jeffry.in)",
"license": "ISC",
"bugs": {
"url": "https://github.com/dollarshaveclub/shave/issues"
Expand All @@ -43,6 +43,9 @@
"eslint": "^3.4.0",
"eslint-config-airbnb": "6.1.0",
"gulp": "^3.9.1",
"gulp-header": "^1.8.8",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^2.0.0",
"node-qunit-phantomjs": "^1.4.0",
"qunit": "^0.9.1",
"rollup": "^0.34.13",
Expand Down
2 changes: 1 addition & 1 deletion tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@
</p>
<script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qunit/2.0.1/qunit.js"></script>
<script src="../dist/shave.js"></script><script src="tests.js"></script>
<script src="../dist/shave.min.js"></script><script src="tests.js"></script>
</body></html>

0 comments on commit af88a11

Please sign in to comment.