@strapi/generators 4.0.0-next.11 → 4.0.0-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -25,9 +25,9 @@ const generate = async (generatorName, options, { dir = process.cwd() } = {}) =>
25
25
 
26
26
  const generator = plop.getGenerator(generatorName);
27
27
  await generator.runActions(options, {
28
- onSuccess: () => {},
29
- onFailure: () => {},
30
- onComment: () => {},
28
+ onSuccess() {},
29
+ onFailure() {},
30
+ onComment() {},
31
31
  });
32
32
  };
33
33
 
package/lib/plops/api.js CHANGED
@@ -25,7 +25,7 @@ module.exports = plop => {
25
25
  type: 'list',
26
26
  name: 'plugin',
27
27
  message: 'Plugin name',
28
- choices: async () => {
28
+ async choices() {
29
29
  const pluginsPath = join(plop.getDestBasePath(), 'plugins');
30
30
  const exists = await fs.pathExists(pluginsPath);
31
31
 
@@ -60,7 +60,7 @@ module.exports = plop => {
60
60
  message: 'Use draft and publish?',
61
61
  },
62
62
  ],
63
- actions: answers => {
63
+ actions(answers) {
64
64
  let filePath;
65
65
  if (answers.isPluginApi && answers.plugin) {
66
66
  filePath = `plugins/{{plugin}}`;
@@ -17,7 +17,7 @@ module.exports = plop => {
17
17
  },
18
18
  ...getDestinationPrompts('controller', plop.getDestBasePath()),
19
19
  ],
20
- actions: answers => {
20
+ actions(answers) {
21
21
  const filePath = getFilePath(answers.destination);
22
22
 
23
23
  return [
@@ -106,7 +106,7 @@ module.exports = plop => {
106
106
  // Model generator
107
107
  plop.setGenerator('model', {
108
108
  description: 'Generate a model for an API',
109
- prompts: async inquirer => {
109
+ async prompts(inquirer) {
110
110
  const config = await promptConfigQuestions(plop, inquirer);
111
111
 
112
112
  if (!config.addAttributes) {
@@ -135,7 +135,7 @@ module.exports = plop => {
135
135
  attributes,
136
136
  };
137
137
  },
138
- actions: answers => {
138
+ actions(answers) {
139
139
  const attributes = answers.attributes.reduce((object, answer) => {
140
140
  const val = { type: answer.attributeType };
141
141
 
@@ -162,7 +162,7 @@ module.exports = plop => {
162
162
  {
163
163
  type: 'modify',
164
164
  path: `${filePath}/content-types/{{id}}/schema.json`,
165
- transform: template => {
165
+ transform(template) {
166
166
  const parsedTemplate = JSON.parse(template);
167
167
  parsedTemplate.attributes = attributes;
168
168
  return JSON.stringify(parsedTemplate, null, 2);
@@ -11,7 +11,7 @@ module.exports = plop => {
11
11
  message: 'Plugin name',
12
12
  },
13
13
  ],
14
- actions: () => {
14
+ actions() {
15
15
  return [
16
16
  {
17
17
  type: 'addMany',
@@ -14,7 +14,7 @@ module.exports = plop => {
14
14
  },
15
15
  ...getDestinationPrompts('policy', plop.getDestBasePath()),
16
16
  ],
17
- actions: answers => {
17
+ actions(answers) {
18
18
  let filePath;
19
19
  if (answers.destination === 'api') {
20
20
  filePath = `api/{{api}}`;
@@ -15,7 +15,7 @@ module.exports = plop => {
15
15
  },
16
16
  ...getDestinationPrompts('service', plop.getDestBasePath()),
17
17
  ],
18
- actions: answers => {
18
+ actions(answers) {
19
19
  const filePath = getFilePath(answers.destination);
20
20
  return [
21
21
  {
@@ -22,7 +22,7 @@ module.exports = (action, basePath) => {
22
22
  type: 'list',
23
23
  message: 'Which API is this for?',
24
24
  name: 'api',
25
- choices: async () => {
25
+ async choices() {
26
26
  const apiPath = join(basePath, 'api');
27
27
  const exists = await fs.pathExists(apiPath);
28
28
 
@@ -45,7 +45,7 @@ module.exports = (action, basePath) => {
45
45
  type: 'list',
46
46
  message: 'Which plugin is this for?',
47
47
  name: 'plugin',
48
- choices: async () => {
48
+ async choices() {
49
49
  const pluginsPath = join(basePath, 'plugins');
50
50
  const exists = await fs.pathExists(pluginsPath);
51
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/generators",
3
- "version": "4.0.0-next.11",
3
+ "version": "4.0.0-next.15",
4
4
  "description": "Interactive API generator.",
5
5
  "keywords": [
6
6
  "strapi",
@@ -38,5 +38,5 @@
38
38
  "node": ">=12.x.x <=16.x.x",
39
39
  "npm": ">=6.0.0"
40
40
  },
41
- "gitHead": "3d8950e29d465a0917db9bbd0e034e5227506716"
41
+ "gitHead": "3d2740ae0d80d9ed61d1429a92756bbe39fa97be"
42
42
  }