Bower → npm, update build workflow.

master
Artem Sapegin 2016-01-09 21:33:02 +01:00
parent 665dd191f5
commit 378bc28ea3
13 changed files with 91 additions and 119 deletions

View File

@ -7,18 +7,18 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
cmpnt: grunt.file.readJSON('../bower.json'),
banner: '/*! Social Likes v<%= cmpnt.version %> by Artem Sapegin - ' +
pkg: require('./package.json'),
banner: '/*! Social Likes v<%= pkg.version %> by Artem Sapegin - ' +
'http://sapegin.github.com/social-likes - Licensed MIT */\n',
jshint: {
options: {
jshintrc: '.jshintrc'
jshintrc: 'src/.jshintrc'
},
files: ['social-likes.js']
files: ['src/social-likes.js']
},
jscs: {
options: {
config: ".jscs.json"
config: "src/.jscs.json"
},
files: ['<%= jshint.files %>']
},
@ -27,8 +27,8 @@ module.exports = function(grunt) {
banner: '<%= banner %>'
},
dist: {
src: 'social-likes.js',
dest: '../social-likes.min.js'
src: 'src/social-likes.js',
dest: 'dist/social-likes.min.js'
}
},
stylus: {
@ -40,9 +40,9 @@ module.exports = function(grunt) {
},
compile: {
files: {
'../social-likes_flat.css': 'styles/flat/index.styl',
'../social-likes_classic.css': 'styles/classic/index.styl',
'../social-likes_birman.css': 'styles/birman/index.styl'
'dist/social-likes_flat.css': 'src/styles/flat/index.styl',
'dist/social-likes_classic.css': 'src/styles/classic/index.styl',
'dist/social-likes_birman.css': 'src/styles/birman/index.styl'
}
},
contrib: {
@ -50,8 +50,8 @@ module.exports = function(grunt) {
compress: false
},
files: {
'../contrib/css/github.css': '../contrib/styles/github.styl',
'../contrib/css/livejournal.css': '../contrib/styles/livejournal.styl'
'contrib/css/github.css': 'contrib/styles/github.styl',
'contrib/css/livejournal.css': 'contrib/styles/livejournal.styl'
}
}
},
@ -62,19 +62,19 @@ module.exports = function(grunt) {
dist: {
expand: true,
flatten: true,
src: '../*.css',
dest: '../'
src: 'dist/*.css',
dest: 'dist'
}
},
webfont: {
flat: {
src: 'styles/flat/icons/*.svg',
dest: 'styles/flat/font',
src: 'src/styles/flat/icons/*.svg',
dest: 'src/styles/flat/font',
options: {
font: 'social-likes',
types: 'woff',
embed: 'woff',
template: 'styles/flat/webfont.styl',
template: 'src/styles/flat/webfont.styl',
stylesheet: 'styl',
hashes: false,
htmlDemo: false,
@ -90,9 +90,9 @@ module.exports = function(grunt) {
files: [
{
expand: true,
cwd: 'styles/classic/icons_src/',
cwd: 'src/styles/classic/icons_src/',
src: '*.png',
dest: 'styles/classic/icons/'
dest: 'src/styles/classic/icons/'
}
]
},
@ -100,9 +100,9 @@ module.exports = function(grunt) {
files: [
{
expand: true,
cwd: 'styles/birman/icons_src/',
cwd: 'src/styles/birman/icons_src/',
src: '*.png',
dest: 'styles/birman/icons/'
dest: 'src/styles/birman/icons/'
}
]
}
@ -115,7 +115,7 @@ module.exports = function(grunt) {
options: {
atBegin: true
},
files: 'styles/**',
files: 'src/styles/**',
tasks: ['stylus:compile']
}
}

View File

@ -1,24 +0,0 @@
{
"name": "social-likes",
"version": "3.0.15",
"license": "MIT",
"main": [
"./src/social-likes.js",
"./social-likes_classic.css",
"./social-likes_flat.css",
"./social-likes_birman.css"
],
"ignore": [
"contrib/icons",
"contrib/styles",
"src/styles",
"src/Gruntfile.js",
"src/package.json",
"src/update-gh-pages.sh",
"src/.jscs.json",
"src/.jshintrc"
],
"dependencies": {
"jquery": ">=1.8"
}
}

2
dist/social-likes.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

50
package.json Normal file
View File

@ -0,0 +1,50 @@
{
"name": "social-likes",
"version": "3.0.15",
"description": "Beautiful social “like” buttons with counters for jQuery",
"homepage": "https://github.com/sapegin/social-likes",
"author": {
"name": "Artem Sapegin",
"url": "http://sapegin.me/"
},
"repository": {
"type": "git",
"url": "git://github.com/sapegin/social-likes.git"
},
"bugs": {
"url": "https://github.com/sapegin/social-likes/issues"
},
"license": "MIT",
"main": "src/social-likes.js",
"files": [
"src",
"dist",
"contrib"
],
"engines": {
"node": ">=0.12.0"
},
"dependencies": {
"jquery": ">=1.8"
},
"devDependencies": {
"autoprefixer-stylus": "0.3.0",
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-imagemin": "~0.8.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-stylus": "~0.20.0",
"grunt-contrib-uglify": "~0.6.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-csso": "~0.6.3",
"grunt-jscs-checker": "~0.7.1",
"grunt-webfont": "~0.4.8",
"load-grunt-tasks": "~0.6.0"
},
"scripts": {
"build": "grunt",
"test": "grunt",
"replace-version": "grunt replace:version",
"build-gh-pages": "scripts/update-gh-pages.sh"
}
}

15
scripts/update-gh-pages.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
echo "Updating Social Likes on gh-pages…"
cp ../dist/social-likes_flat.css ../../social-likes_gh-pages/src/
cp ../dist/social-likes_classic.css ../../social-likes_gh-pages/src/
cp ../dist/social-likes_birman.css ../../social-likes_gh-pages/src/
cp ../dist/social-likes.min.js ../../social-likes_gh-pages/src/
cp ../package.json ../../social-likes_gh-pages/src/
cp ../src/social-likes.js ../../social-likes_gh-pages/src/
pushd ../../social-likes_gh-pages/
npm run replace-version
git commit -m "Update Social Likes." src index.html ru/index.html
git push
popd

View File

@ -1,35 +0,0 @@
{
"name": "social-likes",
"title": "Social Likes",
"description": "Beautiful “like” buttons with counters for popular social networks.",
"keywords": [
"like",
"button",
"social",
"network",
"facebook",
"twitter",
"google",
"livejournal"
],
"version": "3.0.14",
"author": {
"name": "Artem Sapegin",
"email": "artem@sapegin.ru",
"url": "http://sapegin.me"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/sapegin/social-likes/blob/master/license.md"
}
],
"bugs": "https://github.com/sapegin/social-likes/issues",
"homepage": "http://sapegin.github.com/social-likes/",
"docs": "https://github.com/sapegin/social-likes/blob/master/Readme.md",
"download": "http://sapegin.github.com/social-likes/",
"demo": "http://sapegin.github.com/social-likes/",
"dependencies": {
"jquery": ">=1.7"
}
}

2
social-likes.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,18 +0,0 @@
{
"name": "social-likes",
"version": "0.0.0",
"private": true,
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-uglify": "~0.6.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-stylus": "~0.20.0",
"grunt-csso": "~0.6.3",
"grunt-webfont": "~0.4.8",
"autoprefixer-stylus": "0.3.0",
"grunt-jscs-checker": "~0.7.1",
"load-grunt-tasks": "~0.6.0",
"grunt-contrib-imagemin": "~0.8.1"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,16 +0,0 @@
#!/bin/bash
echo "Updating Social Likes on gh-pages…"
grunt build
cp ../social-likes_flat.css ../../social-likes_gh-pages/src/
cp ../social-likes_classic.css ../../social-likes_gh-pages/src/
cp ../social-likes_birman.css ../../social-likes_gh-pages/src/
cp ../social-likes.min.js ../../social-likes_gh-pages/src/
cp ../bower.json ../../social-likes_gh-pages/src/
cp social-likes.js ../../social-likes_gh-pages/src/
pushd ../../social-likes_gh-pages/
grunt replace:version
git commit -m "Update Social Likes." src index.html ru/index.html
git push
popd