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

Commit 4948a96

Browse files
committed
initial commit
0 parents  commit 4948a96

31 files changed

+2636
-0
lines changed

Gruntfile.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = function(grunt) {
2+
'use strict';
3+
4+
var matchdep = require('matchdep'),
5+
config = {
6+
pkg: grunt.file.readJSON('package.json')
7+
};
8+
9+
/**
10+
* @description
11+
* Concatenate all .js files in path to a single object.
12+
*
13+
* Original source: http://www.thomasboyt.com/2013/09/01/maintainable-grunt.html
14+
*
15+
* @param {string} path Base path to the config files
16+
* @returns {object}
17+
*/
18+
function loadTaskOptions(path) {
19+
var glob = require('glob'),
20+
taskOptions = {},
21+
key;
22+
23+
glob.sync('*', {
24+
cwd: path
25+
}).forEach(function(option) {
26+
key = option.replace(/\.js$/, '');
27+
taskOptions[key] = require(path + option);
28+
});
29+
30+
return taskOptions;
31+
}
32+
33+
// Extend config with task options definitions
34+
grunt.util._.extend(config, loadTaskOptions('./build-conf/options/'));
35+
36+
grunt.initConfig(config);
37+
38+
// Load all tasks from the dependencies in package.json
39+
matchdep.filterDev('grunt-*').forEach(grunt.loadNpmTasks);
40+
41+
// Load custom tasks from ./grunt/*.js
42+
grunt.loadTasks('build-conf/');
43+
};

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 maales
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
angular-swagger-ui
2+
==================
3+
4+
Angular implementation of Swagger UI: http://swagger.io/
5+
6+
#### WARNING
7+
> only Swagger 2.0 is supported
8+
9+
> application/xml is not supported
10+
11+
> authentication is not implemented, please use 'transform-try-it' directive's param to customize API calls
12+
13+
##bower
14+
15+
`bower install angular-swagger-ui --save`
16+

bower.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "angular-swagger-ui",
3+
"license": "MIT",
4+
"version": "1.0.0",
5+
"description": "Angular implementation of Swagger UI",
6+
"homepage": "https://github.com/maales/angular-swagger-ui",
7+
"keywords": [
8+
"angular",
9+
"bootstrap",
10+
"swagger",
11+
"swagger-ui"
12+
],
13+
"authors": [
14+
"maales"
15+
],
16+
"ignore": [
17+
"**/.*"
18+
],
19+
"dependencies": {
20+
"angular": "~1.3",
21+
"bootstrap": "~3.3"
22+
}
23+
}

build-conf/.jshintrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"node": true,
3+
"browser": true,
4+
"esnext": true,
5+
"bitwise": true,
6+
"camelcase": true,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": true,
12+
"newcap": true,
13+
"noarg": true,
14+
"quotmark": "single",
15+
"regexp": true,
16+
"undef": true,
17+
"unused": true,
18+
"strict": true,
19+
"trailing": true,
20+
"smarttabs": true,
21+
"globals": {
22+
"angular": true
23+
}
24+
}

build-conf/dev.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// grunt dev -> launch tools (watch)
3+
//
4+
module.exports = function(grunt) {
5+
grunt.registerTask('dev', '', function(target) {
6+
var tasks = [ 'less:dev' ];
7+
if (target === 'server') {
8+
tasks.push('connect:dev');
9+
}
10+
tasks.push('watch');
11+
grunt.task.run(tasks);
12+
});
13+
};

build-conf/options/clean.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// Use to clean files/directories
3+
//
4+
module.exports = {
5+
predist: {
6+
files: [{
7+
dot: true,
8+
src: [
9+
'dist/{,*/}*',
10+
'!dist/index.html'
11+
]
12+
}]
13+
},
14+
postdist: {
15+
files: [{
16+
dot: true,
17+
src: [
18+
'dist/scripts/templates.js'
19+
]
20+
}]
21+
}
22+
23+
}

build-conf/options/concat.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// Use to concat templates with code
3+
//
4+
module.exports = {
5+
dist: {
6+
src: ['dist/scripts/{,*/}*.js'],
7+
dest: 'dist/scripts/swagger-ui.js'
8+
}
9+
}

build-conf/options/connect.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// Launch web server thanks to NodeJS
3+
//
4+
5+
module.exports = {
6+
options: {
7+
// Change this to '0.0.0.0' to access the server from outside.
8+
hostname: '127.0.0.1',
9+
livereload: 35729
10+
},
11+
//
12+
// Define a web server to test development
13+
//
14+
dev: {
15+
options: {
16+
port: 9000,
17+
open: true,
18+
base: 'src',
19+
middleware: function(connect, options, middlewares) {
20+
// configure & add middlewares:
21+
middlewares.unshift(
22+
connect().use('/bower_components', connect.static('./bower_components')),
23+
connect.static('src')
24+
);
25+
return middlewares;
26+
}
27+
}
28+
},
29+
//
30+
// Define a web server to test production
31+
//
32+
dist: {
33+
options: {
34+
port: 9001,
35+
open: true,
36+
livereload: false,
37+
base: 'dist'
38+
}
39+
}
40+
}

build-conf/options/copy.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// Copy files
3+
//
4+
module.exports = {
5+
dist: {
6+
files: [{
7+
expand: true,
8+
dot: true,
9+
cwd: 'src',
10+
dest: 'dist',
11+
src: [
12+
'scripts/{,*/}*.js',
13+
'!scripts/swagger-ui-templates.js',
14+
'less/swagger-ui.less'
15+
]
16+
}]
17+
}
18+
}

0 commit comments

Comments
 (0)