@strapi/generators 4.10.0-beta.1 → 4.10.1-experimental.0

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.
Files changed (144) hide show
  1. package/dist/files/js/plugin/admin/src/components/Initializer/index.js +26 -0
  2. package/dist/files/js/plugin/admin/src/components/PluginIcon/index.js +12 -0
  3. package/dist/files/js/plugin/admin/src/index.js +63 -0
  4. package/dist/files/js/plugin/admin/src/pages/App/index.js +25 -0
  5. package/dist/files/js/plugin/admin/src/pages/HomePage/index.js +20 -0
  6. package/dist/files/js/plugin/admin/src/pluginId.js +5 -0
  7. package/dist/files/js/plugin/admin/src/translations/en.json +1 -0
  8. package/dist/files/js/plugin/admin/src/translations/fr.json +1 -0
  9. package/dist/files/js/plugin/admin/src/utils/getTrad.js +5 -0
  10. package/dist/files/js/plugin/server/bootstrap.js +5 -0
  11. package/dist/files/js/plugin/server/config/index.js +6 -0
  12. package/dist/files/js/plugin/server/content-types/index.js +3 -0
  13. package/dist/files/js/plugin/server/controllers/index.js +7 -0
  14. package/dist/files/js/plugin/server/controllers/my-controller.js.hbs +10 -0
  15. package/dist/files/js/plugin/server/destroy.js +5 -0
  16. package/dist/files/js/plugin/server/index.js +25 -0
  17. package/dist/files/js/plugin/server/middlewares/index.js +3 -0
  18. package/dist/files/js/plugin/server/policies/index.js +3 -0
  19. package/dist/files/js/plugin/server/register.js +5 -0
  20. package/dist/files/js/plugin/server/routes/index.js +10 -0
  21. package/dist/files/js/plugin/server/services/index.js +7 -0
  22. package/dist/files/js/plugin/server/services/my-service.js +7 -0
  23. package/dist/files/js/plugin/strapi-admin.js +3 -0
  24. package/dist/files/js/plugin/strapi-server.js +3 -0
  25. package/dist/files/ts/plugin/admin/src/components/Initializer/index.tsx +24 -0
  26. package/dist/files/ts/plugin/admin/src/components/PluginIcon/index.tsx +12 -0
  27. package/dist/files/ts/plugin/admin/src/index.tsx +67 -0
  28. package/dist/files/ts/plugin/admin/src/pages/App/index.tsx +25 -0
  29. package/dist/files/ts/plugin/admin/src/pages/HomePage/index.tsx +19 -0
  30. package/dist/files/ts/plugin/admin/src/pluginId.ts +5 -0
  31. package/dist/files/ts/plugin/admin/src/translations/en.json +1 -0
  32. package/dist/files/ts/plugin/admin/src/translations/fr.json +1 -0
  33. package/dist/files/ts/plugin/admin/src/utils/getTrad.ts +5 -0
  34. package/dist/files/ts/plugin/custom.d.ts +5 -0
  35. package/dist/files/ts/plugin/server/bootstrap.ts +5 -0
  36. package/dist/files/ts/plugin/server/config/index.ts +4 -0
  37. package/dist/files/ts/plugin/server/content-types/index.ts +1 -0
  38. package/dist/files/ts/plugin/server/controllers/index.ts +5 -0
  39. package/dist/files/ts/plugin/server/controllers/my-controller.ts.hbs +10 -0
  40. package/dist/files/ts/plugin/server/destroy.ts +5 -0
  41. package/dist/files/ts/plugin/server/index.ts +23 -0
  42. package/dist/files/ts/plugin/server/middlewares/index.ts +1 -0
  43. package/dist/files/ts/plugin/server/policies/index.ts +1 -0
  44. package/dist/files/ts/plugin/server/register.ts +5 -0
  45. package/dist/files/ts/plugin/server/routes/index.ts +10 -0
  46. package/dist/files/ts/plugin/server/services/index.ts +5 -0
  47. package/dist/files/ts/plugin/server/services/my-service.ts +7 -0
  48. package/dist/files/ts/plugin/strapi-admin.js +3 -0
  49. package/dist/files/ts/plugin/strapi-server.js +3 -0
  50. package/dist/files/ts/plugin/tsconfig.json +20 -0
  51. package/dist/files/ts/plugin/tsconfig.server.json +25 -0
  52. package/dist/index.d.ts +5 -0
  53. package/dist/index.js +32 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/plopfile.d.ts +3 -0
  56. package/dist/plopfile.js +29 -0
  57. package/dist/plopfile.js.map +1 -0
  58. package/dist/plops/api.d.ts +3 -0
  59. package/dist/plops/api.js +79 -0
  60. package/dist/plops/api.js.map +1 -0
  61. package/dist/plops/content-type.d.ts +3 -0
  62. package/dist/plops/content-type.js +135 -0
  63. package/dist/plops/content-type.js.map +1 -0
  64. package/dist/plops/controller.d.ts +3 -0
  65. package/dist/plops/controller.js +40 -0
  66. package/dist/plops/controller.js.map +1 -0
  67. package/dist/plops/middleware.d.ts +3 -0
  68. package/dist/plops/middleware.js +40 -0
  69. package/dist/plops/middleware.js.map +1 -0
  70. package/dist/plops/migration.d.ts +3 -0
  71. package/dist/plops/migration.js +35 -0
  72. package/dist/plops/migration.js.map +1 -0
  73. package/dist/plops/plugin.d.ts +3 -0
  74. package/dist/plops/plugin.js +84 -0
  75. package/dist/plops/plugin.js.map +1 -0
  76. package/dist/plops/policy.d.ts +3 -0
  77. package/dist/plops/policy.js +40 -0
  78. package/dist/plops/policy.js.map +1 -0
  79. package/dist/plops/prompts/bootstrap-api-prompts.d.ts +3 -0
  80. package/dist/plops/prompts/bootstrap-api-prompts.js +12 -0
  81. package/dist/plops/prompts/bootstrap-api-prompts.js.map +1 -0
  82. package/dist/plops/prompts/ct-names-prompts.d.ts +3 -0
  83. package/dist/plops/prompts/ct-names-prompts.js +45 -0
  84. package/dist/plops/prompts/ct-names-prompts.js.map +1 -0
  85. package/dist/plops/prompts/draft-and-publish-prompts.d.ts +3 -0
  86. package/dist/plops/prompts/draft-and-publish-prompts.js +12 -0
  87. package/dist/plops/prompts/draft-and-publish-prompts.js.map +1 -0
  88. package/dist/plops/prompts/get-attributes-prompts.d.ts +3 -0
  89. package/dist/plops/prompts/get-attributes-prompts.js +95 -0
  90. package/dist/plops/prompts/get-attributes-prompts.js.map +1 -0
  91. package/dist/plops/prompts/get-destination-prompts.d.ts +5 -0
  92. package/dist/plops/prompts/get-destination-prompts.js +72 -0
  93. package/dist/plops/prompts/get-destination-prompts.js.map +1 -0
  94. package/dist/plops/prompts/kind-prompts.d.ts +3 -0
  95. package/dist/plops/prompts/kind-prompts.js +21 -0
  96. package/dist/plops/prompts/kind-prompts.js.map +1 -0
  97. package/dist/plops/service.d.ts +3 -0
  98. package/dist/plops/service.js +38 -0
  99. package/dist/plops/service.js.map +1 -0
  100. package/dist/plops/utils/get-file-path.d.ts +2 -0
  101. package/dist/plops/utils/get-file-path.js +15 -0
  102. package/dist/plops/utils/get-file-path.js.map +1 -0
  103. package/dist/plops/utils/get-formatted-date.d.ts +2 -0
  104. package/dist/plops/utils/get-formatted-date.js +9 -0
  105. package/dist/plops/utils/get-formatted-date.js.map +1 -0
  106. package/dist/plops/utils/validate-attribute-input.d.ts +2 -0
  107. package/dist/plops/utils/validate-attribute-input.js +10 -0
  108. package/dist/plops/utils/validate-attribute-input.js.map +1 -0
  109. package/dist/plops/utils/validate-file-name-input.d.ts +2 -0
  110. package/dist/plops/utils/validate-file-name-input.js +10 -0
  111. package/dist/plops/utils/validate-file-name-input.js.map +1 -0
  112. package/dist/plops/utils/validate-input.d.ts +2 -0
  113. package/dist/plops/utils/validate-input.js +10 -0
  114. package/dist/plops/utils/validate-input.js.map +1 -0
  115. package/dist/templates/js/README.md.hbs +3 -0
  116. package/dist/templates/js/collection-type-routes.js.hbs +49 -0
  117. package/dist/templates/js/content-type.schema.json.hbs +15 -0
  118. package/dist/templates/js/controller.js.hbs +15 -0
  119. package/dist/templates/js/core-controller.js.hbs +9 -0
  120. package/dist/templates/js/core-router.js.hbs +9 -0
  121. package/dist/templates/js/core-service.js.hbs +9 -0
  122. package/dist/templates/js/middleware.js.hbs +14 -0
  123. package/dist/templates/js/migration.js.hbs +15 -0
  124. package/dist/templates/js/plugin-package.json.hbs +42 -0
  125. package/dist/templates/js/policy.js.hbs +18 -0
  126. package/dist/templates/js/service.js.hbs +7 -0
  127. package/dist/templates/js/single-route.js.hbs +13 -0
  128. package/dist/templates/js/single-type-routes.js.hbs +33 -0
  129. package/dist/templates/ts/README.md.hbs +3 -0
  130. package/dist/templates/ts/collection-type-routes.ts.hbs +49 -0
  131. package/dist/templates/ts/content-type.schema.json.hbs +15 -0
  132. package/dist/templates/ts/controller.ts.hbs +13 -0
  133. package/dist/templates/ts/core-controller.ts.hbs +7 -0
  134. package/dist/templates/ts/core-router.ts.hbs +7 -0
  135. package/dist/templates/ts/core-service.ts.hbs +7 -0
  136. package/dist/templates/ts/middleware.ts.hbs +14 -0
  137. package/dist/templates/ts/migration.ts.hbs +11 -0
  138. package/dist/templates/ts/plugin-package.json.hbs +51 -0
  139. package/dist/templates/ts/policy.ts.hbs +16 -0
  140. package/dist/templates/ts/service.ts.hbs +5 -0
  141. package/dist/templates/ts/single-route.ts.hbs +13 -0
  142. package/dist/templates/ts/single-type-routes.ts.hbs +31 -0
  143. package/lib/templates/ts/plugin-package.json.hbs +1 -1
  144. package/package.json +4 -4
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * `{{ id }}` policy
5
+ */
6
+
7
+ module.exports = (policyContext, config, { strapi }) => {
8
+ // Add your own logic here.
9
+ strapi.log.info('In {{ id }} policy.');
10
+
11
+ const canDoSomething = true;
12
+
13
+ if (canDoSomething) {
14
+ return true;
15
+ }
16
+
17
+ return false;
18
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * {{ id }} service
5
+ */
6
+
7
+ module.exports = () => ({});
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ routes: [
3
+ // {
4
+ // method: 'GET',
5
+ // path: '/{{ id }}',
6
+ // handler: '{{ id }}.exampleAction',
7
+ // config: {
8
+ // policies: [],
9
+ // middlewares: [],
10
+ // },
11
+ // },
12
+ ],
13
+ };
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ routes: [
5
+ {
6
+ method: 'GET',
7
+ path: '/{{ id }}',
8
+ handler: '{{ id }}.find',
9
+ config: {
10
+ policies: [],
11
+ middlewares: [],
12
+ },
13
+ },
14
+ {
15
+ method: 'PUT',
16
+ path: '/{{ id }}',
17
+ handler: '{{ id }}.update',
18
+ config: {
19
+ policies: [],
20
+ middlewares: [],
21
+ },
22
+ },
23
+ {
24
+ method: 'DELETE',
25
+ path: '/{{ id }}',
26
+ handler: '{{ id }}.delete',
27
+ config: {
28
+ policies: [],
29
+ middlewares: [],
30
+ },
31
+ },
32
+ ],
33
+ };
@@ -0,0 +1,3 @@
1
+ # Strapi plugin {{ pluginName }}
2
+
3
+ A quick description of {{ pluginName }}.
@@ -0,0 +1,49 @@
1
+ export default {
2
+ routes: [
3
+ {
4
+ method: 'GET',
5
+ path: '/{{ pluralize id }}',
6
+ handler: '{{ id }}.find',
7
+ config: {
8
+ policies: [],
9
+ middlewares: [],
10
+ },
11
+ },
12
+ {
13
+ method: 'GET',
14
+ path: '/{{ pluralize id }}/:id',
15
+ handler: '{{ id }}.findOne',
16
+ config: {
17
+ policies: [],
18
+ middlewares: [],
19
+ },
20
+ },
21
+ {
22
+ method: 'POST',
23
+ path: '/{{ pluralize id }}',
24
+ handler: '{{ id }}.create',
25
+ config: {
26
+ policies: [],
27
+ middlewares: [],
28
+ },
29
+ },
30
+ {
31
+ method: 'PUT',
32
+ path: '/{{ pluralize id }}/:id',
33
+ handler: '{{ id }}.update',
34
+ config: {
35
+ policies: [],
36
+ middlewares: [],
37
+ },
38
+ },
39
+ {
40
+ method: 'DELETE',
41
+ path: '/{{ pluralize id }}/:id',
42
+ handler: '{{ id }}.delete',
43
+ config: {
44
+ policies: [],
45
+ middlewares: [],
46
+ },
47
+ },
48
+ ],
49
+ };
@@ -0,0 +1,15 @@
1
+
2
+ {
3
+ "kind": "{{kind}}",
4
+ "collectionName": "{{ collectionName }}",
5
+ "info": {
6
+ "singularName": "{{ singularName }}",
7
+ "pluralName": "{{ pluralName }}",
8
+ "displayName": "{{ displayName }}"
9
+ },
10
+ "options": {
11
+ "draftAndPublish": {{ useDraftAndPublish }},
12
+ "comment": ""
13
+ },
14
+ "attributes": {}
15
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A set of functions called "actions" for `{{ id }}`
3
+ */
4
+
5
+ export default {
6
+ // exampleAction: async (ctx, next) => {
7
+ // try {
8
+ // ctx.body = 'ok';
9
+ // } catch (err) {
10
+ // ctx.body = err;
11
+ // }
12
+ // }
13
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * {{ id }} controller
3
+ */
4
+
5
+ import { factories } from '@strapi/strapi'
6
+
7
+ export default factories.createCoreController('{{ uid }}');
@@ -0,0 +1,7 @@
1
+ /**
2
+ * {{ id }} router
3
+ */
4
+
5
+ import { factories } from '@strapi/strapi';
6
+
7
+ export default factories.createCoreRouter('{{ uid }}');
@@ -0,0 +1,7 @@
1
+ /**
2
+ * {{ id }} service
3
+ */
4
+
5
+ import { factories } from '@strapi/strapi';
6
+
7
+ export default factories.createCoreService('{{ uid }}');
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `{{ name }}` middleware
3
+ */
4
+
5
+ import { Strapi } from '@strapi/strapi';
6
+
7
+ export default (config, { strapi }: { strapi: Strapi }) => {
8
+ // Add your own logic here.
9
+ return async (ctx, next) => {
10
+ strapi.log.info('In {{ name }} middleware.');
11
+
12
+ await next();
13
+ };
14
+ };
@@ -0,0 +1,11 @@
1
+ import type { Knex } from 'knex';
2
+
3
+ /**
4
+ * Migration `{{ name }}`
5
+ */
6
+
7
+ export default {
8
+ up: async (knex: Knex) => {
9
+
10
+ },
11
+ };
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "{{ pluginName }}",
3
+ "version": "0.0.0",
4
+ "description": "This is the description of the plugin.",
5
+ "strapi": {
6
+ "name": "{{ pluginName }}",
7
+ "description": "Description of {{ pluginName }} plugin",
8
+ "kind": "plugin"
9
+ },
10
+ "dependencies": {
11
+ "@strapi/design-system": "^1.6.3",
12
+ "@strapi/helper-plugin": "^4.6.0",
13
+ "@strapi/icons": "^1.6.3",
14
+ "prop-types": "^15.7.2"
15
+ },
16
+ "devDependencies": {
17
+ "@strapi/typescript-utils": "^4.6.0",
18
+ "@types/react": "^17.0.53",
19
+ "@types/react-dom": "^17.0.18",
20
+ "@types/react-router-dom": "^5.3.3",
21
+ "@types/styled-components": "^5.1.26",
22
+ "react": "^17.0.2",
23
+ "react-dom": "^17.0.2",
24
+ "react-router-dom": "^5.3.4",
25
+ "styled-components": "^5.3.6",
26
+ "typescript": "5.0.4"
27
+ },
28
+ "peerDependencies": {
29
+ "react": "^17.0.2",
30
+ "react-dom": "^17.0.2",
31
+ "react-router-dom": "^5.3.4",
32
+ "styled-components": "^5.3.6"
33
+ },
34
+ "author": {
35
+ "name": "A Strapi developer"
36
+ },
37
+ "maintainers": [
38
+ {
39
+ "name": "A Strapi developer"
40
+ }
41
+ ],
42
+ "engines": {
43
+ "node": ">=14.19.1 <=18.x.x",
44
+ "npm": ">=6.0.0"
45
+ },
46
+ "scripts": {
47
+ "develop": "tsc -p tsconfig.server.json -w",
48
+ "build": "tsc -p tsconfig.server.json"
49
+ },
50
+ "license": "MIT"
51
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * {{ id }} policy
3
+ */
4
+
5
+ export default (policyContext, config, { strapi }) => {
6
+ // Add your own logic here.
7
+ strapi.log.info('In {{ id }} policy.');
8
+
9
+ const canDoSomething = true;
10
+
11
+ if (canDoSomething) {
12
+ return true;
13
+ }
14
+
15
+ return false;
16
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * {{ id }} service
3
+ */
4
+
5
+ export default () => ({});
@@ -0,0 +1,13 @@
1
+ export default {
2
+ routes: [
3
+ // {
4
+ // method: 'GET',
5
+ // path: '/{{ id }}',
6
+ // handler: '{{ id }}.exampleAction',
7
+ // config: {
8
+ // policies: [],
9
+ // middlewares: [],
10
+ // },
11
+ // },
12
+ ],
13
+ };
@@ -0,0 +1,31 @@
1
+ export default {
2
+ routes: [
3
+ {
4
+ method: 'GET',
5
+ path: '/{{ id }}',
6
+ handler: '{{ id }}.find',
7
+ config: {
8
+ policies: [],
9
+ middlewares: [],
10
+ },
11
+ },
12
+ {
13
+ method: 'PUT',
14
+ path: '/{{ id }}',
15
+ handler: '{{ id }}.update',
16
+ config: {
17
+ policies: [],
18
+ middlewares: [],
19
+ },
20
+ },
21
+ {
22
+ method: 'DELETE',
23
+ path: '/{{ id }}',
24
+ handler: '{{ id }}.delete',
25
+ config: {
26
+ policies: [],
27
+ middlewares: [],
28
+ },
29
+ },
30
+ ],
31
+ };
@@ -23,7 +23,7 @@
23
23
  "react-dom": "^17.0.2",
24
24
  "react-router-dom": "^5.3.4",
25
25
  "styled-components": "^5.3.6",
26
- "typescript": "4.6.3"
26
+ "typescript": "5.0.4"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^17.0.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/generators",
3
- "version": "4.10.0-beta.1",
3
+ "version": "4.10.1-experimental.0",
4
4
  "description": "Interactive API generator.",
5
5
  "keywords": [
6
6
  "strapi",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@sindresorhus/slugify": "1.1.0",
36
- "@strapi/typescript-utils": "4.10.0-beta.1",
37
- "@strapi/utils": "4.10.0-beta.1",
36
+ "@strapi/typescript-utils": "4.10.1-experimental.0",
37
+ "@strapi/utils": "4.10.1-experimental.0",
38
38
  "chalk": "4.1.2",
39
39
  "fs-extra": "10.0.0",
40
40
  "node-plop": "0.26.3",
@@ -45,5 +45,5 @@
45
45
  "node": ">=14.19.1 <=18.x.x",
46
46
  "npm": ">=6.0.0"
47
47
  },
48
- "gitHead": "95d581b31bee464af42e5d8db408fa578d8532c7"
48
+ "gitHead": "ce60415a0779e850da2c2edd80799f98918c000c"
49
49
  }