Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit d3820b5

Browse files
committed
feat(Building system): Refactored building system
1 parent e8fb80c commit d3820b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2644
-2829
lines changed

.csslintrc

Lines changed: 0 additions & 21 deletions
This file was deleted.

.npmignore

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
.git
2-
.gitignore
3-
CVS
4-
.svn
5-
.hg
6-
.lock-wscript
7-
.wafpickle-N
8-
*.swp
9-
.DS_Store
10-
._*
11-
npm-debug.log
12-
CNAME
1+
.travis.yml
2+
deploy_dir
3+
deploy_key.enc
4+
deploy.sh

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: node_js
2+
node_js:
3+
- node
4+
script: bash ./deploy.sh
5+
env:
6+
global:
7+
- ENCRYPTION_LABEL: 7eff3d64f9a7
8+
- COMMIT_AUTHOR_EMAIL: metodiev.martin@gmail.com
9+
branches:
10+
only:
11+
- "/v\\d+\\.\\d+\\.\\d+/"
12+
deploy:
13+
provider: npm
14+
email: metodiev.martin@gmail.com
15+
api_key: # …bfc3f83a
16+
secure: FfqRKDPevN4+0bJcnb95QP1/GEvuIjEvYNrFZgpY/KBJn4h20JHuz2j24YDJuUKao2miX0jqebwWv+ubetNgCIMw/FaLubfdq8P7MPPWJ8wXkJAKgBPWK/htDDz/c8bXuFKEOPfDKIkuOzMUuBexOxQ2Isai2K1r1o06R+rjMFs+F0AsnZ1NgBGabbGyv+LU+9HN+ibgwuwa2lJgVvYYPOKsDk9qCS0rRKvk9Nrmx6+pICGYB18qOTihZFqePPRXSjqCvG3i7UJcpQ2EwKnZ601et4I2ZFa9LKp3O/mVsIAmhuiLTVxhfSicaGX0NTKiAc5euiCn5fEbu9vS5ADir14Q3Mtr0b8xzeo8cDZVC3aChuFOyP61e5S7BAVYTrGSoCjUnmZGEYKcfQxlLiZeeaccrykclevPtDvhhgeLA1+5EYbA1AuQu3vLOwiWT9q+dogZ2eZFVRyCa+QYk+cuU4fOm9o9u7c2WFJn7uJe2VwEJE/9+gvzin1maoRRHsBqghEmV1XwQuhlcsKvJmUvnFtxx39ty8ixmoSf4M5Zz9WZDmpdoxA20tzZGm6pDisbYXR++w4GN2Si6yi96JoAZ9IqBw6apFXBRER4r5vqVHvvgX2lYVkqMq5Ik/9iLkaT1yyOK0TCYEsBDV5+JZBbTXiclIhHCoscD8lZf1hlBNM=
17+
on:
18+
tags: true
19+
all_branches: true

Gruntfile.js

Lines changed: 38 additions & 245 deletions
Original file line numberDiff line numberDiff line change
@@ -1,248 +1,41 @@
11
module.exports = function(grunt) {
2-
3-
'use strict';
4-
5-
/* CONFIGURATION */
6-
grunt.initConfig({
7-
// Metadata
8-
pkg: grunt.file.readJSON('package.json'),
9-
10-
11-
// Code convention
12-
jshint: {
13-
options: {
14-
jshintrc: '.jshintrc'
15-
},
16-
17-
plugin: {
18-
src: ['src/js/**/*.js']
19-
},
20-
21-
demo: {
22-
src: ['demo_components/js/src/**/*.js']
23-
}
24-
},
25-
26-
csslint: {
27-
options: {
28-
csslintrc: '.csslintrc'
29-
},
30-
31-
plugin: {
32-
src: ['src/css/<%= pkg.name.toLowerCase() %>.css']
33-
},
34-
35-
demo: {
36-
src: ['demo_components/css/demo.min.css']
37-
}
38-
},
39-
40-
41-
// Cleaning task configuration
42-
clean: {
43-
plugin_js: ['dist/js'],
44-
plugin_css: ['dist/css']
45-
},
46-
47-
48-
// JS tasks configuration
49-
concat: {
50-
options: {
51-
stripBanners: false
52-
},
53-
54-
plugin: {
55-
src: ['src/js/jquery.<%= pkg.name.toLowerCase() %>.js'],
56-
dest: 'dist/js/jquery.<%= pkg.name.toLowerCase() %>.js'
57-
}
58-
},
59-
60-
uglify: {
61-
options: {
62-
sourceMap: true,
63-
preserveComments: 'some'
64-
},
65-
66-
plugin: {
67-
src: 'dist/js/jquery.<%= pkg.name.toLowerCase() %>.js',
68-
dest: 'dist/js/jquery.<%= pkg.name.toLowerCase() %>.min.js'
69-
},
70-
71-
demo: {
72-
src: 'demo_components/js/src/demo.js',
73-
dest: 'demo_components/js/demo.min.js'
74-
}
75-
},
76-
77-
78-
// CSS tasks configuration
79-
less: {
80-
plugin_src: {
81-
options: { compress: false },
82-
files: {
83-
'src/css/<%= pkg.name.toLowerCase() %>.css': 'src/css/less/<%= pkg.name.toLowerCase() %>.less'
84-
}
85-
},
86-
87-
plugin_dist: {
88-
options: { compress: false },
89-
files: {
90-
'dist/css/<%= pkg.name.toLowerCase() %>.css': 'src/css/less/<%= pkg.name.toLowerCase() %>.less'
91-
}
92-
},
93-
94-
demo: {
95-
options: {
96-
compress: true,
97-
sourceMap: true,
98-
sourceMapURL: 'demo.min.css.map',
99-
sourceMapBasepath: 'demo_components/css/src'
100-
},
101-
files: {
102-
'demo_components/css/demo.min.css': 'demo_components/css/src/demo.less'
103-
}
104-
}
105-
},
106-
107-
cssmin: {
108-
options: {
109-
sourceMap: true,
110-
keepSpecialComments: '*'
111-
},
112-
113-
plugin: {
114-
files: {
115-
'dist/css/<%= pkg.name.toLowerCase() %>.min.css': ['dist/css/<%= pkg.name.toLowerCase() %>.css']
116-
}
117-
}
118-
},
119-
120-
121-
// Release tasks configuration
122-
bump: {
123-
options: {
124-
files: [
125-
'package.json',
126-
'bower.json',
127-
'<%= pkg.name.toLowerCase() %>.jquery.json'
128-
],
129-
updateConfigs: ['pkg'],
130-
commit: true,
131-
commitMessage: 'Release v%VERSION%',
132-
commitFiles: ['-a'],
133-
createTag: true,
134-
tagName: 'v%VERSION%',
135-
tagMessage: 'Version %VERSION%',
136-
push: true,
137-
pushTo: 'origin',
138-
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
139-
globalReplace: false,
140-
prereleaseName: false,
141-
regExp: false
142-
}
143-
},
144-
145-
replace: {
146-
readme: {
147-
src: [
148-
'README.md',
149-
'src/js/jquery.<%= pkg.name.toLowerCase() %>.js',
150-
'src/css/less/<%= pkg.name.toLowerCase() %>.less'
151-
],
152-
overwrite: true,
153-
replacements: [{
154-
from: /\d+\.\d+\.\d+/,
155-
to: '<%= pkg.version %>'
156-
}]
157-
}
158-
},
159-
160-
161-
// Listening task configuration
162-
watch: {
163-
js_plugin: {
164-
files: ['src/js/**/*.js'],
165-
tasks: ['js:plugin']
166-
},
167-
168-
css_plugin: {
169-
files: ['src/css/less/**/*.less'],
170-
tasks: ['css:plugin']
171-
},
172-
173-
js_demo: {
174-
files: ['demo_components/js/src/**/*.js'],
175-
tasks: ['js:demo']
176-
},
177-
178-
css_demo: {
179-
files: ['demo_components/css/src/**/*.less'],
180-
tasks: ['css:demo']
181-
}
182-
}
183-
});
184-
185-
186-
187-
/* LOADING TASKS */
188-
grunt.loadNpmTasks('grunt-contrib-clean');
189-
190-
grunt.loadNpmTasks('grunt-contrib-jshint');
191-
grunt.loadNpmTasks('grunt-contrib-csslint');
192-
193-
grunt.loadNpmTasks('grunt-contrib-concat');
194-
grunt.loadNpmTasks('grunt-contrib-uglify');
195-
196-
grunt.loadNpmTasks('grunt-contrib-less');
197-
grunt.loadNpmTasks('grunt-contrib-cssmin');
198-
199-
grunt.loadNpmTasks('grunt-bump');
200-
grunt.loadNpmTasks('grunt-text-replace');
201-
202-
grunt.loadNpmTasks('grunt-contrib-watch');
203-
204-
205-
206-
/* REGISTERING TASKS */
207-
// Build task (default)
208-
grunt.registerTask('default', ['build']);
209-
210-
grunt.registerTask('build', 'Running all tasks...', function() {
211-
grunt.task.run('js:plugin', 'css:plugin', 'js:demo', 'css:demo');
212-
});
213-
214-
215-
// Plugin tasks
216-
grunt.registerTask('js:plugin', 'Running only JS plugin tasks...', function() {
217-
grunt.task.run('jshint:plugin', 'clean:plugin_js', 'concat:plugin', 'uglify:plugin');
218-
});
219-
220-
grunt.registerTask('css:plugin', 'Running only CSS plugin tasks...', function() {
221-
grunt.task.run('less:plugin_src', 'csslint:plugin', 'clean:plugin_css', 'less:plugin_dist', 'cssmin:plugin');
222-
});
223-
224-
225-
// Demo tasks
226-
grunt.registerTask('js:demo', 'Running only JS demo tasks...', function() {
227-
grunt.task.run('jshint:demo', 'uglify:demo');
228-
});
229-
230-
grunt.registerTask('css:demo', 'Running only CSS demo tasks...', function() {
231-
grunt.task.run('less:demo', 'csslint:demo');
232-
});
233-
234-
235-
// Release tasks
236-
grunt.registerTask('release:patch', 'Running patch release tasks...', function() {
237-
grunt.task.run('bump-only:patch', 'replace', 'build', 'bump-commit');
238-
});
239-
240-
grunt.registerTask('release:minor', 'Running minor release tasks...', function() {
241-
grunt.task.run('bump-only:minor', 'replace', 'build', 'bump-commit');
242-
});
243-
244-
grunt.registerTask('release:major', 'Running major release tasks...', function() {
245-
grunt.task.run('bump-only:major', 'replace', 'build', 'bump-commit');
246-
});
2+
var path = require('path'),
3+
pkg = grunt.file.readJSON('package.json'),
4+
settings = grunt.file.readJSON('configs/settings.json'),
5+
env = grunt.option('target') || 'dev',
6+
prod = env === 'prod';
7+
8+
grunt.pluginData = {
9+
pkg: pkg,
10+
settings: settings,
11+
prod: prod,
12+
env: env,
13+
14+
envPath: !prod ?
15+
'assets/page/' :
16+
'http://assets.martinmetodiev.com/',
17+
18+
banner: '/*! \n' +
19+
' <%= pkg.title %> v<%= pkg.version %>\n' +
20+
' <%= pkg.homepage%>\n' +
21+
'\n' +
22+
' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
23+
' Licensed under the <%= pkg.license %> license.\n' +
24+
'*/\n',
25+
26+
domain: pkg.name.toLowerCase() + '.martinmetodiev.com'
27+
};
28+
29+
require('time-grunt')(grunt);
30+
31+
require('load-grunt-config')(grunt, {
32+
configPath: path.join(process.cwd(), 'configs/grunt'),
33+
data: grunt.pluginData
34+
});
35+
36+
grunt.registerTask('build', function() {
37+
grunt.task.run(['concurrent:build']);
38+
grunt.task.run(['concurrent:' + env]);
39+
});
24740

24841
};

LICENSE-MIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015 Martin Metodiev
1+
Copyright (c) 2017 Martin Metodiev
22

33
Permission is hereby granted, free of charge, to any person
44
obtaining a copy of this software and associated documentation

0 commit comments

Comments
 (0)