@strapi/generators 0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71 → 0.0.0-next.f4ec69568d980c6fee91ce2ee0f41c138347aa81

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 (152) hide show
  1. package/LICENSE +18 -3
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +58 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +34 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/plopfile.d.ts +4 -0
  9. package/dist/plopfile.d.ts.map +1 -0
  10. package/dist/plopfile.js +586 -0
  11. package/dist/plopfile.js.map +1 -0
  12. package/dist/plopfile.mjs +582 -0
  13. package/dist/plopfile.mjs.map +1 -0
  14. package/dist/plops/api.d.ts +4 -0
  15. package/dist/plops/api.d.ts.map +1 -0
  16. package/dist/plops/content-type.d.ts +4 -0
  17. package/dist/plops/content-type.d.ts.map +1 -0
  18. package/dist/plops/controller.d.ts +4 -0
  19. package/dist/plops/controller.d.ts.map +1 -0
  20. package/dist/plops/middleware.d.ts +4 -0
  21. package/dist/plops/middleware.d.ts.map +1 -0
  22. package/dist/plops/migration.d.ts +4 -0
  23. package/dist/plops/migration.d.ts.map +1 -0
  24. package/dist/plops/policy.d.ts +4 -0
  25. package/dist/plops/policy.d.ts.map +1 -0
  26. package/dist/plops/prompts/bootstrap-api-prompts.d.ts +4 -0
  27. package/dist/plops/prompts/bootstrap-api-prompts.d.ts.map +1 -0
  28. package/dist/plops/prompts/ct-names-prompts.d.ts +4 -0
  29. package/dist/plops/prompts/ct-names-prompts.d.ts.map +1 -0
  30. package/dist/plops/prompts/get-attributes-prompts.d.ts +4 -0
  31. package/dist/plops/prompts/get-attributes-prompts.d.ts.map +1 -0
  32. package/dist/plops/prompts/get-destination-prompts.d.ts +6 -0
  33. package/dist/plops/prompts/get-destination-prompts.d.ts.map +1 -0
  34. package/dist/plops/prompts/kind-prompts.d.ts +4 -0
  35. package/dist/plops/prompts/kind-prompts.d.ts.map +1 -0
  36. package/dist/plops/service.d.ts +4 -0
  37. package/dist/plops/service.d.ts.map +1 -0
  38. package/dist/plops/utils/get-file-path.d.ts +3 -0
  39. package/dist/plops/utils/get-file-path.d.ts.map +1 -0
  40. package/dist/plops/utils/get-formatted-date.d.ts +3 -0
  41. package/dist/plops/utils/get-formatted-date.d.ts.map +1 -0
  42. package/dist/plops/utils/validate-attribute-input.d.ts +3 -0
  43. package/dist/plops/utils/validate-attribute-input.d.ts.map +1 -0
  44. package/dist/plops/utils/validate-file-name-input.d.ts +3 -0
  45. package/dist/plops/utils/validate-file-name-input.d.ts.map +1 -0
  46. package/dist/plops/utils/validate-input.d.ts +3 -0
  47. package/dist/plops/utils/validate-input.d.ts.map +1 -0
  48. package/{lib → dist}/templates/js/content-type.schema.json.hbs +0 -1
  49. package/{lib → dist}/templates/ts/content-type.schema.json.hbs +0 -1
  50. package/{lib → dist}/templates/ts/middleware.ts.hbs +2 -2
  51. package/package.json +29 -9
  52. package/.eslintignore +0 -3
  53. package/.eslintrc.js +0 -4
  54. package/lib/files/js/plugin/admin/src/components/Initializer/index.js +0 -26
  55. package/lib/files/js/plugin/admin/src/components/PluginIcon/index.js +0 -12
  56. package/lib/files/js/plugin/admin/src/index.js +0 -63
  57. package/lib/files/js/plugin/admin/src/pages/App/index.js +0 -25
  58. package/lib/files/js/plugin/admin/src/pages/HomePage/index.js +0 -20
  59. package/lib/files/js/plugin/admin/src/pluginId.js +0 -5
  60. package/lib/files/js/plugin/admin/src/translations/en.json +0 -1
  61. package/lib/files/js/plugin/admin/src/translations/fr.json +0 -1
  62. package/lib/files/js/plugin/admin/src/utils/getTrad.js +0 -5
  63. package/lib/files/js/plugin/server/bootstrap.js +0 -5
  64. package/lib/files/js/plugin/server/config/index.js +0 -6
  65. package/lib/files/js/plugin/server/content-types/index.js +0 -3
  66. package/lib/files/js/plugin/server/controllers/index.js +0 -7
  67. package/lib/files/js/plugin/server/controllers/my-controller.js.hbs +0 -10
  68. package/lib/files/js/plugin/server/destroy.js +0 -5
  69. package/lib/files/js/plugin/server/index.js +0 -25
  70. package/lib/files/js/plugin/server/middlewares/index.js +0 -3
  71. package/lib/files/js/plugin/server/policies/index.js +0 -3
  72. package/lib/files/js/plugin/server/register.js +0 -5
  73. package/lib/files/js/plugin/server/routes/index.js +0 -10
  74. package/lib/files/js/plugin/server/services/index.js +0 -7
  75. package/lib/files/js/plugin/server/services/my-service.js +0 -7
  76. package/lib/files/js/plugin/strapi-admin.js +0 -3
  77. package/lib/files/js/plugin/strapi-server.js +0 -3
  78. package/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx +0 -24
  79. package/lib/files/ts/plugin/admin/src/components/PluginIcon/index.tsx +0 -12
  80. package/lib/files/ts/plugin/admin/src/index.tsx +0 -67
  81. package/lib/files/ts/plugin/admin/src/pages/App/index.tsx +0 -25
  82. package/lib/files/ts/plugin/admin/src/pages/HomePage/index.tsx +0 -19
  83. package/lib/files/ts/plugin/admin/src/pluginId.ts +0 -5
  84. package/lib/files/ts/plugin/admin/src/translations/en.json +0 -1
  85. package/lib/files/ts/plugin/admin/src/translations/fr.json +0 -1
  86. package/lib/files/ts/plugin/admin/src/utils/getTrad.ts +0 -5
  87. package/lib/files/ts/plugin/custom.d.ts +0 -5
  88. package/lib/files/ts/plugin/server/bootstrap.ts +0 -5
  89. package/lib/files/ts/plugin/server/config/index.ts +0 -4
  90. package/lib/files/ts/plugin/server/content-types/index.ts +0 -1
  91. package/lib/files/ts/plugin/server/controllers/index.ts +0 -5
  92. package/lib/files/ts/plugin/server/controllers/my-controller.ts.hbs +0 -10
  93. package/lib/files/ts/plugin/server/destroy.ts +0 -5
  94. package/lib/files/ts/plugin/server/index.ts +0 -23
  95. package/lib/files/ts/plugin/server/middlewares/index.ts +0 -1
  96. package/lib/files/ts/plugin/server/policies/index.ts +0 -1
  97. package/lib/files/ts/plugin/server/register.ts +0 -5
  98. package/lib/files/ts/plugin/server/routes/index.ts +0 -10
  99. package/lib/files/ts/plugin/server/services/index.ts +0 -5
  100. package/lib/files/ts/plugin/server/services/my-service.ts +0 -7
  101. package/lib/files/ts/plugin/strapi-admin.js +0 -3
  102. package/lib/files/ts/plugin/strapi-server.js +0 -3
  103. package/lib/files/ts/plugin/tsconfig.json +0 -20
  104. package/lib/files/ts/plugin/tsconfig.server.json +0 -25
  105. package/lib/index.js +0 -37
  106. package/lib/plopfile.js +0 -28
  107. package/lib/plops/__tests__/content-type.test.js +0 -179
  108. package/lib/plops/api.js +0 -82
  109. package/lib/plops/content-type.js +0 -148
  110. package/lib/plops/controller.js +0 -36
  111. package/lib/plops/middleware.js +0 -36
  112. package/lib/plops/migration.js +0 -33
  113. package/lib/plops/plugin.js +0 -91
  114. package/lib/plops/policy.js +0 -36
  115. package/lib/plops/prompts/bootstrap-api-prompts.js +0 -10
  116. package/lib/plops/prompts/ct-names-prompts.js +0 -44
  117. package/lib/plops/prompts/draft-and-publish-prompts.js +0 -10
  118. package/lib/plops/prompts/get-attributes-prompts.js +0 -105
  119. package/lib/plops/prompts/get-destination-prompts.js +0 -79
  120. package/lib/plops/prompts/kind-prompts.js +0 -17
  121. package/lib/plops/service.js +0 -34
  122. package/lib/plops/utils/__tests__/get-file-path.test.js +0 -25
  123. package/lib/plops/utils/get-file-path.js +0 -17
  124. package/lib/plops/utils/get-formatted-date.js +0 -8
  125. package/lib/plops/utils/validate-attribute-input.js +0 -11
  126. package/lib/plops/utils/validate-file-name-input.js +0 -11
  127. package/lib/plops/utils/validate-input.js +0 -11
  128. package/lib/templates/js/README.md.hbs +0 -3
  129. package/lib/templates/js/plugin-package.json.hbs +0 -42
  130. package/lib/templates/ts/README.md.hbs +0 -3
  131. package/lib/templates/ts/plugin-package.json.hbs +0 -51
  132. /package/{lib → dist}/templates/js/collection-type-routes.js.hbs +0 -0
  133. /package/{lib → dist}/templates/js/controller.js.hbs +0 -0
  134. /package/{lib → dist}/templates/js/core-controller.js.hbs +0 -0
  135. /package/{lib → dist}/templates/js/core-router.js.hbs +0 -0
  136. /package/{lib → dist}/templates/js/core-service.js.hbs +0 -0
  137. /package/{lib → dist}/templates/js/middleware.js.hbs +0 -0
  138. /package/{lib → dist}/templates/js/migration.js.hbs +0 -0
  139. /package/{lib → dist}/templates/js/policy.js.hbs +0 -0
  140. /package/{lib → dist}/templates/js/service.js.hbs +0 -0
  141. /package/{lib → dist}/templates/js/single-route.js.hbs +0 -0
  142. /package/{lib → dist}/templates/js/single-type-routes.js.hbs +0 -0
  143. /package/{lib → dist}/templates/ts/collection-type-routes.ts.hbs +0 -0
  144. /package/{lib → dist}/templates/ts/controller.ts.hbs +0 -0
  145. /package/{lib → dist}/templates/ts/core-controller.ts.hbs +0 -0
  146. /package/{lib → dist}/templates/ts/core-router.ts.hbs +0 -0
  147. /package/{lib → dist}/templates/ts/core-service.ts.hbs +0 -0
  148. /package/{lib → dist}/templates/ts/migration.ts.hbs +0 -0
  149. /package/{lib → dist}/templates/ts/policy.ts.hbs +0 -0
  150. /package/{lib → dist}/templates/ts/service.ts.hbs +0 -0
  151. /package/{lib → dist}/templates/ts/single-route.ts.hbs +0 -0
  152. /package/{lib → dist}/templates/ts/single-type-routes.ts.hbs +0 -0
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- const getFilePath = require('../get-file-path');
4
-
5
- describe('Get-File-Path util', () => {
6
- test('with destination set as api', () => {
7
- const filePath = getFilePath('api');
8
- expect(filePath).toBe(`api/{{ api }}`);
9
- });
10
-
11
- test('with destination set as plugin', () => {
12
- const filePath = getFilePath('plugin');
13
- expect(filePath).toBe(`plugins/{{ plugin }}/server`);
14
- });
15
-
16
- test('with destination set as root', () => {
17
- const filePath = getFilePath('root');
18
- expect(filePath).toBe(`./`);
19
- });
20
-
21
- test('with empty destination string', () => {
22
- const filePath = getFilePath('');
23
- expect(filePath).toBe(`api/{{ id }}`);
24
- });
25
- });
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = (destination) => {
4
- if (destination === 'api') {
5
- return `api/{{ api }}`;
6
- }
7
-
8
- if (destination === 'plugin') {
9
- return `plugins/{{ plugin }}/server`;
10
- }
11
-
12
- if (destination === 'root') {
13
- return './';
14
- }
15
-
16
- return `api/{{ id }}`;
17
- };
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = (date = new Date()) => {
4
- return new Date(date.getTime() - date.getTimezoneOffset() * 60000)
5
- .toJSON()
6
- .replace(/[-:]/g, '.')
7
- .replace(/\....Z/, '');
8
- };
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = (input) => {
4
- const regex = /^[A-Za-z-|_]+$/g;
5
-
6
- if (!input) {
7
- return 'You must provide an input';
8
- }
9
-
10
- return regex.test(input) || "Please use only letters, '-', '_', and no spaces";
11
- };
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = (input) => {
4
- const regex = /^[A-Za-z-_0-9]+$/g;
5
-
6
- if (!input) {
7
- return 'You must provide an input';
8
- }
9
-
10
- return regex.test(input) || "Please use only letters and number, '-' or '_' and no spaces";
11
- };
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = (input) => {
4
- const regex = /^[A-Za-z-]+$/g;
5
-
6
- if (!input) {
7
- return 'You must provide an input';
8
- }
9
-
10
- return regex.test(input) || "Please use only letters, '-' and no spaces";
11
- };
@@ -1,3 +0,0 @@
1
- # Strapi plugin {{ pluginName }}
2
-
3
- A quick description of {{ pluginName }}.
@@ -1,42 +0,0 @@
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 {{titleCase pluginName }} plugin",
8
- "kind": "plugin",
9
- "displayName": "{{titleCase pluginName }}"
10
- },
11
- "dependencies": {
12
- "@strapi/design-system": "^1.6.3",
13
- "@strapi/helper-plugin": "^4.6.0",
14
- "@strapi/icons": "^1.6.3",
15
- "prop-types": "^15.7.2"
16
- },
17
- "devDependencies": {
18
- "react": "^17.0.2",
19
- "react-dom": "^17.0.2",
20
- "react-router-dom": "^5.3.4",
21
- "styled-components": "^5.3.6"
22
- },
23
- "peerDependencies": {
24
- "react": "^17.0.2",
25
- "react-dom": "^17.0.2",
26
- "react-router-dom": "^5.3.4",
27
- "styled-components": "^5.3.6"
28
- },
29
- "author": {
30
- "name": "A Strapi developer"
31
- },
32
- "maintainers": [
33
- {
34
- "name": "A Strapi developer"
35
- }
36
- ],
37
- "engines": {
38
- "node": ">=14.19.1 <=18.x.x",
39
- "npm": ">=6.0.0"
40
- },
41
- "license": "MIT"
42
- }
@@ -1,3 +0,0 @@
1
- # Strapi plugin {{ pluginName }}
2
-
3
- A quick description of {{ pluginName }}.
@@ -1,51 +0,0 @@
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": "4.6.3"
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
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes