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: {
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/.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.
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/controllers/:filename': {
|
2019-05-29 16:54:47 +02:00
|
|
|
template: 'controller.template',
|
2017-02-14 01:18:07 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
// every generated controller.
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/services/:filename': {
|
2019-05-29 16:54:47 +02:00
|
|
|
template: 'service.template',
|
2017-02-14 01:18:07 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
// Generate routes.
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/config/routes.json': {
|
2019-05-29 16:54:47 +02:00
|
|
|
jsonfile: routesJSON,
|
2017-06-08 17:16:20 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
// Main package.
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/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.
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/.editorconfig': {
|
2019-05-29 16:54:47 +02:00
|
|
|
copy: 'editorconfig',
|
2019-05-15 17:22:24 +02:00
|
|
|
},
|
|
|
|
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/.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.
|
2020-03-19 18:29:30 +01:00
|
|
|
'plugins/:name/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
|
|
|
};
|