| 
									
										
										
										
											2017-02-14 01:18:07 +01:00
										 |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Module dependencies | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Node.js core.
 | 
					
						
							|  |  |  | const path = require('path'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Local dependencies.
 | 
					
						
							| 
									
										
										
										
											2017-06-08 17:16:20 +01:00
										 |  |  | const packageJSON = require('../json/package.json.js'); | 
					
						
							| 
									
										
										
										
											2017-02-14 01:18:07 +01:00
										 |  |  | const routesJSON = require('../json/routes.json.js'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Generate a core API | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = { | 
					
						
							| 
									
										
										
										
											2017-12-22 17:36:27 +01:00
										 |  |  |   templatesDirectory: path.resolve(__dirname, '..', 'templates'), | 
					
						
							| 
									
										
										
										
											2017-02-14 01:18:07 +01:00
										 |  |  |   before: require('./before'), | 
					
						
							|  |  |  |   targets: { | 
					
						
							| 
									
										
										
										
											2017-12-22 17:36:27 +01:00
										 |  |  |     'plugins/:humanizeId/.gitignore': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       copy: 'gitignore', | 
					
						
							| 
									
										
										
										
											2017-12-22 17:36:27 +01:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2017-02-14 01:18:07 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Use the default `controller` file as a template for
 | 
					
						
							|  |  |  |     // every generated controller.
 | 
					
						
							|  |  |  |     'plugins/:humanizeId/controllers/:filename': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       template: 'controller.template', | 
					
						
							| 
									
										
										
										
											2017-02-14 01:18:07 +01:00
										 |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // every generated controller.
 | 
					
						
							|  |  |  |     'plugins/:humanizeId/services/:filename': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       template: 'service.template', | 
					
						
							| 
									
										
										
										
											2017-02-14 01:18:07 +01:00
										 |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Generate routes.
 | 
					
						
							|  |  |  |     'plugins/:humanizeId/config/routes.json': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       jsonfile: routesJSON, | 
					
						
							| 
									
										
										
										
											2017-06-08 17:16:20 +01:00
										 |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Main package.
 | 
					
						
							|  |  |  |     'plugins/:humanizeId/package.json': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       jsonfile: packageJSON, | 
					
						
							| 
									
										
										
										
											2017-06-08 17:16:20 +01:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2019-05-15 17:22:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Copy dot files.
 | 
					
						
							|  |  |  |     'plugins/:humanizeId/.editorconfig': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       copy: 'editorconfig', | 
					
						
							| 
									
										
										
										
											2019-05-15 17:22:24 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     'plugins/:humanizeId/.gitattributes': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       copy: 'gitattributes', | 
					
						
							| 
									
										
										
										
											2019-05-15 17:22:24 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Copy Markdown files with some information.
 | 
					
						
							|  |  |  |     'plugins/:humanizeId/README.md': { | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |       template: 'README.md', | 
					
						
							| 
									
										
										
										
											2019-05-15 17:22:24 +02:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2019-05-29 16:54:47 +02:00
										 |  |  |   }, | 
					
						
							| 
									
										
										
										
											2017-02-14 01:18:07 +01:00
										 |  |  | }; |