mirror of
				https://github.com/HabitRPG/habitica.git
				synced 2025-10-31 05:05:07 +01:00 
			
		
		
		
	* remove sample forms from apidoc * add explicit path to config for apidoc * bring all apidoc files into apidoc folder
		
			
				
	
	
		
			27 lines
		
	
	
		
			746 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			746 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import gulp from 'gulp';
 | |
| import clean from 'rimraf';
 | |
| import apidoc from 'apidoc';
 | |
| 
 | |
| const APIDOC_DEST_PATH = './apidoc/html';
 | |
| const APIDOC_SRC_PATH = './website/server';
 | |
| const APIDOC_CONFIG_PATH = './apidoc/apidoc.json';
 | |
| gulp.task('apidoc:clean', done => {
 | |
|   clean(APIDOC_DEST_PATH, done);
 | |
| });
 | |
| 
 | |
| gulp.task('apidoc', gulp.series('apidoc:clean', done => {
 | |
|   const result = apidoc.createDoc({
 | |
|     src: APIDOC_SRC_PATH,
 | |
|     dest: APIDOC_DEST_PATH,
 | |
|     config: APIDOC_CONFIG_PATH,
 | |
|   });
 | |
| 
 | |
|   if (result === false) {
 | |
|     done(new Error('There was a problem generating apiDoc documentation.'));
 | |
|   } else {
 | |
|     done();
 | |
|   }
 | |
| }));
 | |
| 
 | |
| gulp.task('apidoc:watch', gulp.series('apidoc', done => gulp.watch(`${APIDOC_SRC_PATH}/**/*.js`, gulp.series('apidoc', done))));
 |