Skip to content

Commit e147d36

Browse files
committed
Added grunt, npm and bower dependencies and a super readme file :)
1 parent f04239d commit e147d36

File tree

13 files changed

+2897
-3391
lines changed

13 files changed

+2897
-3391
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
components

Gruntfile.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
module.exports = function(grunt) {
2+
'use strict';
3+
4+
// Project configuration.
5+
grunt.initConfig({
6+
// Metadata.
7+
pkg: grunt.file.readJSON('package.json'),
8+
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
9+
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
10+
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
11+
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
12+
' Licensed <%= pkg.license %> */\n',
13+
14+
// Task configuration.
15+
concat: {
16+
options: {
17+
banner: '<%= banner %>',
18+
stripBanners: true
19+
},
20+
dist: {
21+
src: ['src/**/*.js'],
22+
dest: 'dist/<%= pkg.name %>.js'
23+
}
24+
},
25+
uglify: {
26+
options: {
27+
banner: '<%= banner %>'
28+
},
29+
dist: {
30+
src: '<%= concat.dist.dest %>',
31+
dest: 'dist/<%= pkg.name %>.min.js'
32+
}
33+
},
34+
jshint: {
35+
options: {
36+
curly: true,
37+
eqeqeq: true,
38+
immed: true,
39+
latedef: true,
40+
newcap: true,
41+
noarg: true,
42+
sub: true,
43+
undef: true,
44+
unused: true,
45+
boss: true,
46+
eqnull: true,
47+
browser: true,
48+
globals: {
49+
jQuery: true,
50+
module: true,
51+
console: true
52+
}
53+
},
54+
gruntfile: {
55+
src: 'Gruntfile.js'
56+
}
57+
// lib_test: {
58+
// src: [
59+
// 'lib/**/*.js',
60+
// 'test/**/*.js'
61+
// ]
62+
// }
63+
},
64+
// For jasmine usage, see: http://pivotal.github.io/jasmine/
65+
// For grunt's jasmine, see: https://github.com/gruntjs/grunt-contrib-jasmine
66+
jasmine: {
67+
customTemplate: {
68+
src: 'src/**/*.js',
69+
options: {
70+
specs: 'spec/*Spec.js',
71+
helpers: 'spec/*Helper.js'
72+
// template: 'custom.tmpl'
73+
}
74+
}
75+
},
76+
watch: {
77+
gruntfile: {
78+
files: '<%= jshint.gruntfile.src %>',
79+
tasks: ['jshint:gruntfile']
80+
},
81+
test: {
82+
files: '<%= concat.dist.src %>',
83+
tasks: ['test']
84+
}
85+
// lib_test: {
86+
// files: '<%= jshint.libTest.src %>',
87+
// tasks: ['jshint:libTest']
88+
// }
89+
}
90+
});
91+
92+
// These plugins provide necessary tasks.
93+
grunt.loadNpmTasks('grunt-contrib-concat');
94+
grunt.loadNpmTasks('grunt-contrib-uglify');
95+
grunt.loadNpmTasks('grunt-contrib-jshint');
96+
grunt.loadNpmTasks('grunt-contrib-watch');
97+
grunt.loadNpmTasks('grunt-contrib-jasmine');
98+
99+
// Default task.
100+
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
101+
102+
grunt.registerTask('debug', function() {
103+
grunt.log.write(grunt.file.readJSON('package.json').name);
104+
});
105+
106+
// Distribute
107+
grunt.registerTask('test', ['jasmine', 'concat', 'uglify']);
108+
109+
};

ReadMe.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Web State Machine
2+
3+
This repositoty is the home of the libraries used by WebMole to manage the Web State Machine.
4+
5+
6+
## Usage
7+
8+
Include javascript files from `src` folder and create required objects within your code. You are invited to see it's usage in the µ-crawler and/or the WebMole Chrome Plugin.
9+
10+
11+
## Development
12+
13+
First, install dependences with [npm](https://npmjs.org/) and [bower](http://bower.io/)
14+
15+
npm install
16+
bower install
17+
18+
You can use [grunt](http://gruntjs.com/) to develop and test with [jasmine](http://pivotal.github.io/jasmine/) on each file save
19+
20+
grunt watch
21+
22+
See `gruntfile.js` for more details.

SpecRunner.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<head>
55
<title>Jasmine Spec Runner</title>
66

7-
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.3.1/jasmine_favicon.png">
8-
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.1/jasmine.css">
9-
<script type="text/javascript" src="lib/jasmine-1.3.1/jasmine.js"></script>
10-
<script type="text/javascript" src="lib/jasmine-1.3.1/jasmine-html.js"></script>
7+
<link rel="shortcut icon" type="image/png" href="components/jasmine/lib/jasmine-core/jasmine_favicon.png">
8+
<link rel="stylesheet" type="text/css" href="components/jasmine/lib/jasmine-core/jasmine.css">
9+
<script type="text/javascript" src="components/jasmine/lib/jasmine-core/jasmine.js"></script>
10+
<script type="text/javascript" src="components/jasmine/lib/jasmine-core/jasmine-html.js"></script>
1111

1212
<!-- include source files here... -->
1313
<script type="text/javascript" src="src/Dom.js"></script>

bower.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "Web-State-Machine",
3+
"version": "0.0.1",
4+
"ignore": [
5+
"**/.*",
6+
"node_modules",
7+
"bower_components",
8+
"test",
9+
"tests"
10+
],
11+
"dependencies": {
12+
"jasmine": "git://github.com/pivotal/jasmine.git#~1.3.1"
13+
}
14+
}

0 commit comments

Comments
 (0)