mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
create apidoc task in grunt, update package.json version
This commit is contained in:
11
package.json
11
package.json
@@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "habitrpg",
|
"name": "habitrpg",
|
||||||
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
||||||
"version": "0.0.0-152",
|
"version": "3.0.0-alpha",
|
||||||
"main": "./website/src/index.js",
|
"main": "./website/src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"accepts": "^1.3.0",
|
"accepts": "^1.3.0",
|
||||||
"amazon-payments": "0.0.4",
|
"amazon-payments": "0.0.4",
|
||||||
"amplitude": "^2.0.3",
|
"amplitude": "^2.0.3",
|
||||||
|
"apidoc": "^0.13.1",
|
||||||
"async": "^1.5.0",
|
"async": "^1.5.0",
|
||||||
"aws-sdk": "^2.0.25",
|
"aws-sdk": "^2.0.25",
|
||||||
"babel-core": "^5.8.34",
|
"babel-core": "^5.8.34",
|
||||||
@@ -117,6 +118,7 @@
|
|||||||
"mongodb": "^2.0.46",
|
"mongodb": "^2.0.46",
|
||||||
"mongoskin": "~0.6.1",
|
"mongoskin": "~0.6.1",
|
||||||
"nock": "^2.17.0",
|
"nock": "^2.17.0",
|
||||||
|
"phantomjs": "^1.9.18",
|
||||||
"protractor": "~2.5.1",
|
"protractor": "~2.5.1",
|
||||||
"rewire": "^2.3.3",
|
"rewire": "^2.3.3",
|
||||||
"rimraf": "^2.4.3",
|
"rimraf": "^2.4.3",
|
||||||
@@ -128,5 +130,12 @@
|
|||||||
"uuid": "^2.0.1",
|
"uuid": "^2.0.1",
|
||||||
"vinyl-source-stream": "^1.0.0",
|
"vinyl-source-stream": "^1.0.0",
|
||||||
"vinyl-transform": "^1.0.0"
|
"vinyl-transform": "^1.0.0"
|
||||||
|
},
|
||||||
|
"apidoc": {
|
||||||
|
"name": "habitica",
|
||||||
|
"title": "Habitica",
|
||||||
|
"version": "3.0.0",
|
||||||
|
"url": "https://habitica.com/api/v3",
|
||||||
|
"sampleUrl": "https://habitica.com/api/v3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
tasks/gulp-apidoc.js
Normal file
22
tasks/gulp-apidoc.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import gulp from 'gulp';
|
||||||
|
import clean from 'rimraf';
|
||||||
|
import apidoc from 'apidoc';
|
||||||
|
|
||||||
|
const APIDOC_DEST_PATH = './website/public/apidoc';
|
||||||
|
const APIDOC_SRC_PATH = './website/src';
|
||||||
|
gulp.task('apidoc:clean', (done) => {
|
||||||
|
clean(APIDOC_DEST_PATH, done);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('apidoc', ['apidoc:clean'], (done) => {
|
||||||
|
let result = apidoc.createDoc({
|
||||||
|
src: APIDOC_SRC_PATH,
|
||||||
|
dest: APIDOC_DEST_PATH,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result === false) {
|
||||||
|
done(new Error('There was a problem generating apiDoc documentation.'))
|
||||||
|
} else {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// An example file to show how a controller should be structured
|
|
||||||
let api = {};
|
let api = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @api {get} /example/:id Request Example information
|
* @api {get} /example/:id Request Example information
|
||||||
|
* @apiVersion 3.0.0
|
||||||
* @apiName GetExample
|
* @apiName GetExample
|
||||||
* @apiGroup Example
|
* @apiGroup Example
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user