Skip to content

Commit 62193c6

Browse files
committed
Merge pull request #45 from paulcpederson/master
1.1.3
2 parents 7bf3ac1 + 8896c30 commit 62193c6

Some content is hidden

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

97 files changed

+1999
-6986
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
.DS_Store
12
.grunt
23
.sass-cache
34
node_modules
45
bower_components
6+
user.js
7+
dist/
8+
docs/build
9+
angular-dimple.zip
10+
docs/source/assets/js/lib

CHANGELOG.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
# Angular-Dimple Changelog
22

3-
# v1.1.2
3+
## v1.1.3
4+
* rebuild site
5+
* add `color` attribute on graph.js
6+
7+
## v1.1.2
48
* add default width (100%)
59
* add default height (100%)
610
* add default margin (60, 60, 20, 40)
711

8-
# v1.1.1
12+
## v1.1.1
913
* add time formats and such
1014

11-
# v1.1.0
15+
## v1.1.0
1216
* add functionality inside ng-repeat
1317
* graphs update live when scope changes
1418
* add ring charts
1519

16-
# v1.0.2
20+
## v1.0.2
1721
* add bower dependencies
1822

19-
# v1.0.1
23+
## v1.0.1
2024
* add bower manifest
2125
* add changelog
2226
* add label attribute to scatter-plots
2327

24-
# v1.0.0
28+
## v1.0.0
2529
* support for graph, axis, and legend
2630
* support for bar, stacked, bar, area, stacked area, line, and scatter-plots
2731
* full documentation
2832

29-
# v0.0.1
33+
## v0.0.1
3034
* alpha release

Gruntfile.js

Lines changed: 178 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,218 @@
1+
// ┌─────────────┐
2+
// │ Gruntfile │
3+
// └─────────────┘
4+
// Grunt wraps several tasks to ease development
5+
// runs acetate, deploys the site, and tags new releases
6+
7+
// To draft a release, add GitHub credentials to user.js
8+
var fs = require('fs');
9+
var user = function(){};
10+
11+
if (fs.existsSync('./user.js')) {
12+
user = require('./user.js');
13+
}
14+
15+
// Gets current version description from CHANGELOG.md
16+
function findVersion(log) {
17+
var newVersion = log.split('## v')[1];
18+
var description = newVersion.substring(5,newVersion.length);
19+
return description;
20+
}
21+
122
module.exports = function(grunt) {
23+
var pkg = grunt.file.readJSON('package.json');
24+
var name = pkg.name;
25+
var repo = pkg.repository.split('github.com/')[1];
26+
var currentVersion = 'v' + pkg.version;
27+
var log = grunt.file.read('CHANGELOG.md');
28+
var description = findVersion(log);
29+
30+
// Javascript banner
31+
var banner = '/*! ' + name + ' - <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
32+
'* https://github.com/' + repo + '\n' +
33+
'* Licensed ISC */\n';
34+
35+
require('load-grunt-tasks')(grunt);
236

3-
// Project configuration.
437
grunt.initConfig({
538
pkg: grunt.file.readJSON('package.json'),
6-
'gh-pages': {
7-
options: {
8-
base: 'site',
9-
repo: 'https://github.com/esripdx/angular-dimple.git'
10-
},
11-
src: '**/*'
12-
},
13-
'watch': {
14-
source: {
15-
files: ['./source/**/*'],
16-
tasks: ['concat', 'uglify', 'jshint'],
17-
options: {
18-
nospawn: true
19-
}
39+
40+
// Build documentation site
41+
'acetate': {
42+
build: {
43+
config: 'acetate.conf.js'
2044
},
21-
examples: {
22-
files: ['./site/js/*.js'],
23-
tasks: ['jshint'],
45+
watch: {
46+
config: 'acetate.conf.js',
2447
options: {
25-
nospawn: true
48+
watch: true,
49+
server: true
2650
}
27-
},
51+
}
52+
},
53+
54+
// Watch sass, images, and javascript
55+
'watch': {
2856
sass: {
29-
files: ['./site/scss/**/*'],
30-
tasks: ['compass'],
31-
options: {
32-
nospawn: true
33-
}
57+
files: ['docs/source/assets/css/**/*'],
58+
tasks: ['sass']
3459
},
35-
docs: {
36-
files: ['documentation/**'],
37-
tasks: ['markdown'],
38-
options: {
39-
nospawn: true
40-
}
60+
img: {
61+
files: ['docs/source/assets/img/**/*'],
62+
tasks: ['newer:imagemin']
63+
},
64+
js: {
65+
files: ['docs/source/assets/js/**/*', 'lib/**.*'],
66+
tasks: ['lib', 'jshint:docs', 'copy:docs']
4167
}
4268
},
43-
'compass': {
44-
dev: {
69+
70+
// Build site sass
71+
'sass': {
72+
expanded: {
4573
options: {
46-
sassDir: 'site/scss',
47-
cssDir: 'site/css'
74+
style: 'expanded',
75+
sourcemap: 'none',
76+
loadPath: 'bower_components'
77+
},
78+
files: {
79+
'docs/build/assets/css/style.css': 'docs/source/assets/css/style.scss'
4880
}
4981
}
5082
},
83+
84+
// Optimize images
85+
'imagemin': {
86+
doc: {
87+
files: [{
88+
expand: true,
89+
cwd: 'docs/source/assets/img',
90+
src: ['**/*.{png,jpg,svg}'],
91+
dest: 'docs/build/assets/img/'
92+
}]
93+
}
94+
},
95+
96+
// Check js for errors
5197
'jshint': {
52-
files: [
53-
'./source/**/*.js',
54-
'./site/js/*.js'
98+
lib: [
99+
'lib/**/*.js'
100+
],
101+
docs: [
102+
'docs/source/assets/js/**.js'
55103
]
56104
},
105+
106+
// Concatenate lib
57107
'concat': {
58108
options: {
59109
stripBanners: true,
60-
banner: '/*! Angular-Dimple - <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
61-
'* https://github.com/esripdx/angular-dimple\n' +
62-
'* Licensed ISC */\n'
110+
banner: banner
63111
},
64112
dist: {
65-
src: ['source/*.js'],
66-
dest: 'dist/angular-dimple.js'
67-
},
68-
examples: {
69-
src: ['source/*.js'],
70-
dest: 'site/js/lib/angular-dimple.js'
71-
},
113+
src: ['lib/*.js'],
114+
dest: 'dist/' + name + '.js'
115+
}
72116
},
117+
118+
// Minified version of lib
73119
'uglify': {
74120
dist: {
75-
files: {
76-
'dist/angular-dimple.min.js': ['source/*.js']
77-
}
78-
},
79-
examples: {
80-
files: {
81-
'site/js/lib/angular-dimple.min.js': ['source/*.js']
82-
}
121+
src: ['lib/*.js'],
122+
dest: 'dist/' + name + '.min.js'
83123
}
84124
},
85-
'connect': {
86-
'static': {
87-
options: {
88-
base: 'site/',
89-
hostname: 'localhost',
90-
port: 8001
91-
}
125+
126+
// Copy files
127+
'copy': {
128+
dist: {
129+
expand: true,
130+
cwd: 'dist/',
131+
src: ['*'],
132+
dest: 'docs/source/assets/js/lib/'
133+
},
134+
docs: {
135+
expand: true,
136+
cwd: 'docs/source/assets/js/',
137+
src: ['**/*'],
138+
dest: 'docs/build/assets/js/'
139+
},
140+
data: {
141+
expand: true,
142+
cwd: 'docs/source/data',
143+
src: ['*'],
144+
dest: 'docs/build/data/'
92145
}
93146
},
94-
'markdown': {
95-
all: {
96-
files: [
97-
{
98-
expand: true,
99-
src: 'documentation/index.md',
100-
dest: 'site/',
101-
ext: '.html'
102-
}
103-
],
147+
148+
// Make a zip file of the dist folder
149+
'compress': {
150+
main: {
104151
options: {
105-
template: 'documentation/layout.html',
106-
markdownOptions: {
107-
gfm: true,
108-
highlight: 'manual'
109-
}
110-
}
111-
},
112-
partials: {
152+
archive: repo + '.zip'
153+
},
113154
files: [
114155
{
115-
expand: true,
116-
src: 'documentation/partials/*.md',
117-
dest: 'site/',
118-
ext: '.html'
119-
}
120-
],
121-
options: {
122-
template: 'documentation/blank.html',
123-
markdownOptions: {
124-
gfm: true,
125-
highlight: 'manual'
126-
}
156+
src: ['dist/**'],
157+
dest: './'
158+
},
159+
]
160+
}
161+
},
162+
163+
// This task runs right after npm install
164+
'concurrent': {
165+
prepublish: [
166+
'sass',
167+
'uglify',
168+
'copy',
169+
'concat:dist',
170+
'newer:imagemin'
171+
]
172+
},
173+
174+
// Release a new version on GitHub
175+
'github-release': {
176+
options: {
177+
repository: repo,
178+
auth: user(),
179+
release: {
180+
tag_name: currentVersion,
181+
name: currentVersion,
182+
body: description,
183+
prerelease: true
127184
}
185+
},
186+
files: {
187+
src: name + '.zip'
128188
}
189+
},
190+
191+
// Deploy the docs site to gh-pages
192+
'gh-pages': {
193+
options: {
194+
base: 'build',
195+
repo: 'https://github.com/' + repo + '.git'
196+
},
197+
src: ['**']
129198
}
130199
});
131200

132-
grunt.loadNpmTasks('grunt-contrib-jshint');
133-
grunt.loadNpmTasks('grunt-contrib-watch');
134-
grunt.loadNpmTasks('grunt-contrib-compass');
135-
grunt.loadNpmTasks('grunt-contrib-connect');
136-
grunt.loadNpmTasks('grunt-contrib-uglify');
137-
grunt.loadNpmTasks('grunt-contrib-concat');
138-
grunt.loadNpmTasks('grunt-gh-pages');
139-
grunt.loadNpmTasks('grunt-markdown');
140-
141-
grunt.registerTask('test', ['jshint']);
142-
grunt.registerTask('build', ['test', 'concat', 'uglify', 'markdown', 'compass']);
143-
grunt.registerTask('develop', ['connect', 'build', 'watch']);
144-
grunt.registerTask('deploy', ['build', 'gh-pages']);
145-
grunt.registerTask('default', ['develop']);
201+
// Build a dist folder with all assets
202+
grunt.registerTask('prepublish', [
203+
'concurrent:prepublish'
204+
]);
205+
206+
grunt.registerTask('lib', ['jshint:lib', 'concat:dist', 'uglify:dist']);
207+
grunt.registerTask('deploy', ['lib', 'acetate:build', 'sass', 'newer:imagemin', 'gh-pages']);
208+
209+
// Release a new version of the framework
210+
grunt.registerTask('release', [
211+
'prepublish',
212+
'compress',
213+
'github-release'
214+
]);
215+
216+
grunt.registerTask('default', ['lib', 'jshint:docs', 'copy', 'newer:imagemin', 'sass', 'acetate:watch', 'watch']);
146217

147218
};

acetate.conf.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = function (acetate) {
2+
acetate.global('config', {
3+
environment: 'dev'
4+
});
5+
6+
acetate.layout('**/*', 'layouts/_layout:content');
7+
acetate.layout('posts/**/*', 'layouts/_post:post');
8+
9+
acetate.options.src = 'docs/source';
10+
acetate.options.dest = 'docs/build';
11+
};

0 commit comments

Comments
 (0)