Skip to content

Commit beb83a8

Browse files
committed
workflow
1 parent 9a59406 commit beb83a8

File tree

12 files changed

+1811
-34
lines changed

12 files changed

+1811
-34
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ _site/
33
node_modules
44
npm-debug.log
55
dist/
6+
.tmp/

Gruntfile.js

+61-11
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,33 @@ module.exports = function(grunt){
55
// -- Init Configuration ---------------------------------------
66
grunt.initConfig({
77

8+
application:{
9+
dev: {
10+
csspath:"/assets/css/",
11+
jspath:"/assets/js/",
12+
imgpath:"/assets/img/",
13+
14+
},
15+
dist:{
16+
csspath:"/assets/css/",
17+
jspath:"/assets/js/",
18+
imgpath:"/assets/img/",
19+
}
20+
},
821
uglify:{
922
options: {
1023
compress: false,
1124
report: true,
1225
banner: '/* Minified on <%= grunt.template.date() %>*/\n'
1326
},
14-
app: {
27+
dev: {
28+
files: {
29+
'.tmp/public/assets/js/core.min.js': [
30+
'public/assets/js/core.js'
31+
]
32+
}
33+
},
34+
dist: {
1535
files: {
1636
'dist/public/assets/js/core.min.js': [
1737
'public/assets/js/core.js'
@@ -23,7 +43,15 @@ module.exports = function(grunt){
2343
options: {
2444
banner: '/* Minified on <%= grunt.template.date() %>*/\n'
2545
},
26-
app: {
46+
dev: {
47+
files: {
48+
'.tmp/public/assets/css/core.min.css': [
49+
'public/assets/css/normalize.css',
50+
'public/assets/css/core.css'
51+
]
52+
}
53+
},
54+
dist: {
2755
files: {
2856
'dist/public/assets/css/core.min.css': [
2957
'public/assets/css/normalize.css',
@@ -33,22 +61,42 @@ module.exports = function(grunt){
3361
}
3462
},
3563
copy: {
36-
main: {
64+
dist: {
65+
files: [
66+
// includes files within path and its sub-directories
67+
{expand: true, src: ['public/**', '!**/*[.css|.js]'], dest: 'dist/'}
68+
],
69+
},
70+
dev: {
3771
files: [
3872
// includes files within path and its sub-directories
39-
{expand: true, src: ['public/**'], dest: 'dist/'}
73+
{expand: true, src: ['public/**', '!**/*[.css|.js]'], dest: '.tmp/'}
4074
],
4175
},
4276
},
77+
clean: {
78+
dev: [".tmp/"],
79+
dist: ["dist/"]
80+
},
4381
connect: {
44-
server: {
45-
options: 9001,
46-
keepalive: true
82+
dev: {
83+
options: {
84+
port: 9001,
85+
base: ['.tmp/public']
86+
}
87+
},
88+
dist: {
89+
options: {
90+
port: 9002,
91+
base: ['dist/public/'],
92+
keepalive:true
93+
}
4794
}
4895
},
4996
watch: {
5097
assets: {
51-
files: ['**/*.js', '**/*.html', '**/*.css'],
98+
files: ['public/assets/css/*.css', 'public/assets/js/*.js', 'templates/**/*.html', 'i18n/**/*.json', 'i18n/**/*.html'],
99+
tasks:['build'],
52100
options: {
53101
livereload: true
54102
}
@@ -74,10 +122,12 @@ module.exports = function(grunt){
74122
grunt.loadNpmTasks('grunt-contrib-watch');
75123
grunt.loadNpmTasks('grunt-contrib-copy');
76124
grunt.loadNpmTasks('grunt-contrib-imagemin');
125+
grunt.loadNpmTasks('grunt-contrib-clean');
77126

78127
// -- Register Task ---------------------------------------------
79-
grunt.registerTask('default', ['i18n', 'uglify', 'cssmin']);
80-
grunt.registerTask('server', ['connect', 'watch']);
81-
grunt.registerTask('dist', ['i18n', 'copy', 'cssmin', 'uglify', 'imagemin']);
128+
grunt.registerTask('server', ['clean:dev' ,'i18n', 'copy:dev','cssmin:dev', 'uglify:dev','connect:dev', 'watch']);
129+
grunt.registerTask('dist', ['clean:dist', 'i18n', 'copy:dist', 'cssmin:dist', 'uglify:dist', 'imagemin']);
130+
grunt.registerTask('build', ['clean:dev', 'i18n', 'copy:dev', 'cssmin:dev', 'uglify:dev']);
131+
grunt.registerTask('serverdist', ['connect:dist']);
82132

83133
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"homepage": "http://jstherightway.org",
1919
"devDependencies": {
2020
"grunt": "^0.4.4",
21+
"grunt-contrib-clean": "^0.6.0",
2122
"grunt-contrib-connect": "^0.9.0",
2223
"grunt-contrib-copy": "^0.8.0",
2324
"grunt-contrib-cssmin": "^0.9.0",

public/assets/css/core.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ html {
77
body {
88
margin: 0;
99
padding: 0;
10-
}
10+
}
1111

1212
.wrapper {
1313
width: 80%;
@@ -56,7 +56,7 @@ header small {
5656
box-shadow: 0px 2px rgba(0, 0, 0, 0.04);
5757
}
5858

59-
.social {
59+
.social {
6060
text-align: center;
6161
width: 100%;
6262
height: 105px;

public/assets/css/core.min.css

-3
This file was deleted.

public/assets/js/core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var App = (function( window, document, $ ) {
3939
// Getting and appending users of github
4040
getGithubUsers: function() {
4141
var i=0, length = userIsDone = users.length,
42-
str='';
42+
str='';
4343

4444
// Callback function
4545
function cb( result ) {

public/assets/js/core.min.js

-2
This file was deleted.

public/en-us/index.html

+573-2
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)