Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

Commit 31dcee3

Browse files
author
Moritz Meyer
committed
Add simple grunt setup (jshint, uglify)
1 parent f5af8d9 commit 31dcee3

File tree

5 files changed

+83
-4
lines changed

5 files changed

+83
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
bower_components/
22
.idea/
3+
node_modules

Gruntfile.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports = function(grunt) {
2+
3+
// Project configuration.
4+
grunt.initConfig({
5+
pkg: grunt.file.readJSON('package.json'),
6+
uglify: {
7+
options: {
8+
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
9+
},
10+
build: {
11+
src: 'src/angular-intro.js',
12+
dest: 'build/angular-intro.min.js'
13+
}
14+
},
15+
jshint: {
16+
lib: {
17+
options: {},
18+
src: ['lib/*.js']
19+
},
20+
},
21+
watch: {
22+
scripts: {
23+
files: 'lib/*.js',
24+
tasks: ['jshint', 'uglify'],
25+
options: {
26+
interrupt: true
27+
},
28+
},
29+
gruntfile: {
30+
files: 'Gruntfile.js'
31+
}
32+
},
33+
});
34+
35+
// Load all grunt tasks
36+
require('load-grunt-tasks')(grunt);
37+
38+
// Default task(s).
39+
grunt.registerTask('default', ['jshint', 'uglify']);
40+
};

build/angular-intro.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "angular-intro.js",
3+
"version": "0.1.0",
4+
"description": "Angular directive to wrap intro.js",
5+
"main": "angular-intro.js",
6+
"directories": {
7+
"example": "example",
8+
"lib": "lib"
9+
},
10+
"scripts": {
11+
"test": "grunt test"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git://github.com/mendhak/angular-intro.js.git"
16+
},
17+
"keywords": [
18+
"angular",
19+
"intro.js",
20+
"angular-intro"
21+
],
22+
"author": "mendhak",
23+
"license": "MIT",
24+
"bugs": {
25+
"url": "https://github.com/mendhak/angular-intro.js/issues"
26+
},
27+
"homepage": "https://github.com/mendhak/angular-intro.js",
28+
"devDependencies": {
29+
"grunt": "~0.4.4",
30+
"grunt-contrib-jshint": "~0.9.2",
31+
"grunt-contrib-uglify": "~0.4.0",
32+
"load-grunt-tasks": "~0.4.0",
33+
"grunt-contrib-watch": "~0.6.1"
34+
}
35+
}

angular-intro.js renamed to src/angular-intro.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ ngIntroDirective.directive('ngIntroOptions', ['$timeout', '$parse', function ($t
1313

1414
scope[attrs.ngIntroMethod] = function(step) {
1515

16+
var intro;
17+
1618
if(typeof(step) === 'string') {
17-
var intro = introJs(step);
19+
intro = introJs(step);
1820
} else {
19-
var intro = introJs();
21+
intro = introJs();
2022
}
2123

2224
intro.setOptions(scope.$eval(attrs.ngIntroOptions));
@@ -54,5 +56,5 @@ ngIntroDirective.directive('ngIntroOptions', ['$timeout', '$parse', function ($t
5456
});
5557
}
5658
}
57-
}
59+
};
5860
}]);

0 commit comments

Comments
 (0)