rename prompts files

This commit is contained in:
Dieter Stinglhamber 2021-11-10 14:19:53 +01:00
parent efbd9fcf42
commit 15d8392f24
9 changed files with 23 additions and 14 deletions

View File

@ -3,11 +3,11 @@
const { join } = require('path');
const fs = require('fs-extra');
const validateInput = require('./utils/validate-input');
const getCtNamesPrompts = require('./prompts/get-ct-names-prompts');
const getKindPrompts = require('./prompts/get-kind-prompts');
const getDraftAndPublishPrompts = require('./prompts/get-draft-and-publish-prompts');
const ctNamesPrompts = require('./prompts/ct-names-prompts');
const kindPrompts = require('./prompts/kind-prompts');
const draftAndPublishPrompts = require('./prompts/draft-and-publish-prompts');
const getAttributesPrompts = require('./prompts/get-attributes-prompts');
const getDefaultRoutesPrompts = require('./prompts/get-default-routes-prompts');
const defaultRoutesPrompts = require('./prompts/default-routes-prompts');
module.exports = plop => {
// API generator
@ -64,10 +64,10 @@ module.exports = plop => {
return {
...api,
...(await inquirer.prompt([
...getCtNamesPrompts,
...getKindPrompts,
...getDraftAndPublishPrompts,
...getDefaultRoutesPrompts,
...ctNamesPrompts,
...kindPrompts,
...draftAndPublishPrompts,
...defaultRoutesPrompts,
])),
attributes: await getAttributesPrompts(inquirer),
};

View File

@ -4,9 +4,9 @@ const slugify = require('@sindresorhus/slugify');
const getDestinationPrompts = require('./prompts/get-destination-prompts');
const getFilePath = require('./utils/get-file-path');
const getCtNamesPrompts = require('./prompts/get-ct-names-prompts');
const getKindPrompts = require('./prompts/get-kind-prompts');
const getDraftAndPublishPrompts = require('./prompts/get-draft-and-publish-prompts');
const ctNamesPrompts = require('./prompts/ct-names-prompts');
const kindPrompts = require('./prompts/kind-prompts');
const draftAndPublishPrompts = require('./prompts/draft-and-publish-prompts');
const getAttributesPrompts = require('./prompts/get-attributes-prompts');
module.exports = plop => {
@ -15,10 +15,10 @@ module.exports = plop => {
description: 'Generate a content type for an API',
async prompts(inquirer) {
const config = await inquirer.prompt([
...getCtNamesPrompts,
...getKindPrompts,
...ctNamesPrompts,
...kindPrompts,
...getDestinationPrompts('model', plop.getDestBasePath()),
...getDraftAndPublishPrompts,
...draftAndPublishPrompts,
]);
const attributes = await getAttributesPrompts(inquirer);

View File

@ -6,6 +6,7 @@ module.exports = {
handler: '{{id}}.find',
config: {
policies: [],
middlewares: [],
},
},
{
@ -14,6 +15,7 @@ module.exports = {
handler: '{{id}}.findOne',
config: {
policies: [],
middlewares: [],
},
},
{
@ -22,6 +24,7 @@ module.exports = {
handler: '{{id}}.create',
config: {
policies: [],
middlewares: [],
},
},
{
@ -30,6 +33,7 @@ module.exports = {
handler: '{{id}}.update',
config: {
policies: [],
middlewares: [],
},
},
{
@ -38,6 +42,7 @@ module.exports = {
handler: '{{id}}.delete',
config: {
policies: [],
middlewares: [],
},
},
],

View File

@ -6,6 +6,7 @@ module.exports = {
// handler: '{{id}}.exampleAction',
// config: {
// policies: [],
// middlewares: [],
// },
// },
],

View File

@ -6,6 +6,7 @@ module.exports = {
handler: '{{id}}.find',
config: {
policies: [],
middlewares: [],
},
},
{
@ -14,6 +15,7 @@ module.exports = {
handler: '{{id}}.update',
config: {
policies: [],
middlewares: [],
},
},
{
@ -22,6 +24,7 @@ module.exports = {
handler: '{{id}}.delete',
config: {
policies: [],
middlewares: [],
},
},
],