-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 079a4ea
Showing
18 changed files
with
430 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "app/components" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/app/components/ | ||
/app/css/ | ||
/app/js/ | ||
/build/ | ||
/dist/ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
|
||
install: | ||
- node_modules/protractor/bin/webdriver-manager update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
module.exports = function(grunt) { | ||
grunt.initConfig({ | ||
less: { | ||
dev: { | ||
options: { | ||
cleancss: true | ||
}, | ||
files: { | ||
"app/css/style.css": [ | ||
"app/less/style.less" | ||
] | ||
} | ||
} | ||
}, | ||
concat: { | ||
dev: { | ||
files: { | ||
"app/js/script.js": [ | ||
"app/components/angular/angular.js", | ||
"app/components/angular-route/angular-route.js", | ||
"app/scripts/**/*.js" | ||
] | ||
} | ||
} | ||
}, | ||
connect: { | ||
test: { | ||
options: { | ||
port: 8000, | ||
hostname: "*", | ||
base: "dist" | ||
} | ||
} | ||
}, | ||
uglify: { | ||
dist: { | ||
options: { | ||
mangle: true, | ||
compress: { | ||
drop_console: true | ||
} | ||
}, | ||
files: { | ||
"dist/js/script.js": [ | ||
"app/js/script.js" | ||
] | ||
} | ||
} | ||
}, | ||
copy: { | ||
dist: { | ||
files: [ | ||
{ expand: true, cwd: "app/css/", src: ["style.css"], dest: "dist/css/" }, | ||
{ expand: true, cwd: "app/", src: ["index.html"], dest: "dist/" }, | ||
{ expand: true, cwd: "app/views/", src: ["**/*"], dest: "dist/views/" } | ||
] | ||
} | ||
}, | ||
jshint: { | ||
test: { | ||
options: { | ||
browser: true, | ||
camelcase: true, | ||
curly: true, | ||
eqeqeq: true, | ||
es3: true, | ||
forin: true, | ||
freeze: true, | ||
immed: true, | ||
indent: 4, | ||
latedef: true, | ||
maxlen: 120, | ||
newcap: true, | ||
noarg: true, | ||
noempty: true, | ||
nomen: true, | ||
nonbsp: false, | ||
nonew: true, | ||
plusplus: false, | ||
quotmark: true, | ||
undef: true, | ||
strict: false, | ||
trailing: true, | ||
unused: true, | ||
|
||
globals: { | ||
"$": true, | ||
angular: true, | ||
jQuery: true, | ||
}, | ||
}, | ||
files: { | ||
src: ["app/scripts/**/*.js"] | ||
} | ||
} | ||
}, | ||
karma: { | ||
test: { | ||
configFile: "karma.conf.js", | ||
singleRun: true | ||
} | ||
}, | ||
protractor: { | ||
test: { | ||
options: { | ||
configFile: "protractor.conf.js", | ||
} | ||
} | ||
}, | ||
bower: { | ||
dev: { | ||
options: { | ||
targetDir: "app/components", | ||
cleanTargetDir: true | ||
} | ||
} | ||
} | ||
}); | ||
|
||
// Load tasks | ||
grunt.loadNpmTasks("grunt-bower-task"); | ||
grunt.loadNpmTasks("grunt-contrib-less"); | ||
grunt.loadNpmTasks("grunt-contrib-concat"); | ||
grunt.loadNpmTasks("grunt-contrib-connect"); | ||
grunt.loadNpmTasks("grunt-contrib-uglify"); | ||
grunt.loadNpmTasks("grunt-contrib-copy"); | ||
grunt.loadNpmTasks("grunt-contrib-jshint"); | ||
grunt.loadNpmTasks("grunt-karma"); | ||
grunt.loadNpmTasks("grunt-protractor-runner"); | ||
|
||
// Custom tasks | ||
grunt.registerTask("default", []); | ||
|
||
grunt.registerTask("dev", [ | ||
"bower:dev", | ||
"less:dev", | ||
"concat:dev" | ||
]); | ||
grunt.registerTask("dist", [ | ||
"dev", | ||
"uglify:dist", | ||
"copy:dist" | ||
]); | ||
grunt.registerTask("test", [ | ||
"dist", | ||
"jshint:test", | ||
"karma:test", | ||
"connect:test", | ||
"protractor:test" | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Review Assist - Angular.js frontend | ||
|
||
An example frontend interfacing with Review Assist's REST API. | ||
|
||
## Installation | ||
|
||
* Clone the repository | ||
* `npm install` | ||
* `node_modules/.bin/bower install` | ||
* `node_modules/.bin/grunt dist` | ||
|
||
The built files will be available in the `dist` directory. | ||
|
||
## Running | ||
|
||
### Development | ||
|
||
``` | ||
node_modules/.bin/grunt dev | ||
``` | ||
|
||
Your webserver should serve the files from the `app` directory. | ||
|
||
### Dist | ||
|
||
``` | ||
node_modules/.bin/grunt dist | ||
``` | ||
|
||
Your webserver should serve the files from the `dist` directory. | ||
|
||
## Tests | ||
|
||
In order to be able to run the e2e tests, you need to have Java installed (required to run Selenium). Also, you should run this command ONCE in order to download Selenium: | ||
|
||
``` | ||
node_modules/.bin/webdriver-manager update | ||
``` | ||
|
||
After that's done, all you need to do is run the test script: | ||
|
||
``` | ||
npm test | ||
``` | ||
|
||
The above command will build the project and run all the unit and e2e tests. If instead you prefer to run the unit/e2e tests separately, have a look at the available Grunt tasks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="ra"> | ||
<head> | ||
<title>Review Assist</title> | ||
</head> | ||
<body> | ||
<div ng-view></div> | ||
<script src="/js/script.js"></script> | ||
</body> | ||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
angular.module("ra", ["ngRoute"]); | ||
|
||
angular.module("ra").config([ | ||
"$routeProvider", | ||
"$locationProvider", | ||
function( | ||
$routeProvider, | ||
$locationProvider | ||
) { | ||
$routeProvider | ||
.when("/", { | ||
templateUrl: "/views/ra/index.html", | ||
controller: "IndexCtrl" | ||
}) | ||
.when("/404", { | ||
templateUrl: "/views/ra/404.html", | ||
controller: "PageCtrl" | ||
}) | ||
.otherwise({ | ||
redirectTo: "/404" | ||
}); | ||
|
||
$locationProvider.html5Mode(true); | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
angular.module("ra").controller("IndexCtrl", [ | ||
function() | ||
{} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
angular.module("ra").controller("PageCtrl", [ | ||
function() | ||
{} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>404</h1> | ||
<p>What do Batman's parents and this page have in common?</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>Hello, world!</h1> | ||
<p>Lorem ipsum dolor ist amet consectetur adipiscing elit.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "review-assist", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/dzielne-misie/review-assist", | ||
"authors": [ | ||
"Dominik Marczuk <[email protected]>" | ||
], | ||
"description": "Build artifacts and diff aggregator for making code reviews easier and more pleasant.", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"angular": "~1.2.20", | ||
"angular-route": "~1.2.20", | ||
"bootstrap": "~3.2.0" | ||
}, | ||
"devDependencies": { | ||
"angular-mocks": "~1.2.21" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// Karma configuration | ||
// Generated on Wed Jul 09 2014 14:10:11 GMT+0200 (CEST) | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
|
||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['jasmine'], | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
'app/components/angular/angular.js', | ||
'app/components/angular-route/angular-route.js', | ||
'app/components/angular-mocks/angular-mocks.js', | ||
'app/scripts/**/*.js', | ||
'test/spec/**/*.js' | ||
], | ||
|
||
|
||
// list of files to exclude | ||
exclude: [ | ||
|
||
], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
// source files, that you wanna generate coverage for | ||
// do not include tests or libraries | ||
// (these files will be instrumented by Istanbul) | ||
'app/scripts/**/*.js': ['coverage'] | ||
}, | ||
|
||
// optionally, configure the reporter | ||
coverageReporter: { | ||
type : 'html', | ||
dir : 'build/coverage/js/' | ||
}, | ||
|
||
junitReporter: { | ||
outputFile: 'build/test-results.xml' | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: [ | ||
'progress', | ||
'coverage', | ||
'junit' | ||
], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['PhantomJS'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false | ||
}); | ||
}; |
Oops, something went wrong.