@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
@@ -0,0 +1,4 @@
1
+ import type { NodePlopAPI } from 'plop';
2
+ declare const _default: (plop: NodePlopAPI) => void;
3
+ export default _default;
4
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/plops/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAOlB,WAAW;AAAjC,wBA+BE"}
@@ -0,0 +1,4 @@
1
+ import type { NodePlopAPI } from 'plop';
2
+ declare const _default: (plop: NodePlopAPI) => void;
3
+ export default _default;
4
+ //# sourceMappingURL=middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/plops/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAOlB,WAAW;AAAjC,wBA+BE"}
@@ -0,0 +1,4 @@
1
+ import type { NodePlopAPI } from 'plop';
2
+ declare const _default: (plop: NodePlopAPI) => void;
3
+ export default _default;
4
+ //# sourceMappingURL=migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/plops/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAKlB,WAAW;AAAjC,wBA0BE"}
@@ -0,0 +1,4 @@
1
+ import type { NodePlopAPI } from 'plop';
2
+ declare const _default: (plop: NodePlopAPI) => void;
3
+ export default _default;
4
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/plops/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAOlB,WAAW;AAAjC,wBA+BE"}
@@ -0,0 +1,4 @@
1
+ import type { PromptQuestion } from 'node-plop';
2
+ declare const questions: Array<PromptQuestion>;
3
+ export default questions;
4
+ //# sourceMappingURL=bootstrap-api-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap-api-prompts.d.ts","sourceRoot":"","sources":["../../../src/plops/prompts/bootstrap-api-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,cAAc,CAOpC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { PromptQuestion } from 'node-plop';
2
+ declare const questions: Array<PromptQuestion>;
3
+ export default questions;
4
+ //# sourceMappingURL=ct-names-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ct-names-prompts.d.ts","sourceRoot":"","sources":["../../../src/plops/prompts/ct-names-prompts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAQhD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,cAAc,CAqCpC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DynamicPromptsFunction } from 'node-plop';
2
+ declare const getAttributesPrompts: DynamicPromptsFunction;
3
+ export default getAttributesPrompts;
4
+ //# sourceMappingURL=get-attributes-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-attributes-prompts.d.ts","sourceRoot":"","sources":["../../../src/plops/prompts/get-attributes-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAkCxD,QAAA,MAAM,oBAAoB,EAAE,sBAyE3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { PromptQuestion } from 'node-plop';
2
+ declare const _default: (action: string, basePath: string, { rootFolder }?: {
3
+ rootFolder?: boolean | undefined;
4
+ }) => Array<PromptQuestion>;
5
+ export default _default;
6
+ //# sourceMappingURL=get-destination-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-destination-prompts.d.ts","sourceRoot":"","sources":["../../../src/plops/prompts/get-destination-prompts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;iCAGtC,MAAM,YACJ,MAAM;;MAEf,MAAM,cAAc,CAAC;AAJxB,wBA6EE"}
@@ -0,0 +1,4 @@
1
+ import type { PromptQuestion } from 'node-plop';
2
+ declare const questions: Array<PromptQuestion>;
3
+ export default questions;
4
+ //# sourceMappingURL=kind-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kind-prompts.d.ts","sourceRoot":"","sources":["../../../src/plops/prompts/kind-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,cAAc,CAYpC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { NodePlopAPI } from 'plop';
2
+ declare const _default: (plop: NodePlopAPI) => void;
3
+ export default _default;
4
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/plops/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAMlB,WAAW;AAAjC,wBA8BE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (destination: string) => "api/{{ id }}" | "api/{{ api }}" | "plugins/{{ plugin }}/server" | "./";
2
+ export default _default;
3
+ //# sourceMappingURL=get-file-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file-path.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/get-file-path.ts"],"names":[],"mappings":"sCAA6B,MAAM;AAAnC,wBAcE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (date?: Date) => string;
2
+ export default _default;
3
+ //# sourceMappingURL=get-formatted-date.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-formatted-date.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/get-formatted-date.ts"],"names":[],"mappings":"gCAAsB,IAAI;AAA1B,wBAKE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (input: string) => true | "You must provide an input" | "Please use only letters, '-', '_', and no spaces";
2
+ export default _default;
3
+ //# sourceMappingURL=validate-attribute-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-attribute-input.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/validate-attribute-input.ts"],"names":[],"mappings":"gCAAuB,MAAM;AAA7B,wBAQE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (input: string) => true | "You must provide an input" | "Please use only letters and number, '-' or '_' and no spaces";
2
+ export default _default;
3
+ //# sourceMappingURL=validate-file-name-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-file-name-input.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/validate-file-name-input.ts"],"names":[],"mappings":"gCAAuB,MAAM;AAA7B,wBAQE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (input: string) => true | "You must provide an input" | "Please use only letters, '-' and no spaces";
2
+ export default _default;
3
+ //# sourceMappingURL=validate-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-input.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/validate-input.ts"],"names":[],"mappings":"gCAAuB,MAAM;AAA7B,wBAQE"}
@@ -8,7 +8,6 @@
8
8
  "displayName": "{{ displayName }}"
9
9
  },
10
10
  "options": {
11
- "draftAndPublish": {{ useDraftAndPublish }},
12
11
  "comment": ""
13
12
  },
14
13
  "attributes": {}
@@ -8,7 +8,6 @@
8
8
  "displayName": "{{ displayName }}"
9
9
  },
10
10
  "options": {
11
- "draftAndPublish": {{ useDraftAndPublish }},
12
11
  "comment": ""
13
12
  },
14
13
  "attributes": {}
@@ -2,9 +2,9 @@
2
2
  * `{{ name }}` middleware
3
3
  */
4
4
 
5
- import { Strapi } from '@strapi/strapi';
5
+ import type { Core } from '@strapi/strapi';
6
6
 
7
- export default (config, { strapi }: { strapi: Strapi }) => {
7
+ export default (config, { strapi }: { strapi: Core.Strapi }) => {
8
8
  // Add your own logic here.
9
9
  return async (ctx, next) => {
10
10
  strapi.log.info('In {{ name }} middleware.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/generators",
3
- "version": "0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71",
3
+ "version": "0.0.0-next.f4ec69568d980c6fee91ce2ee0f41c138347aa81",
4
4
  "description": "Interactive API generator.",
5
5
  "keywords": [
6
6
  "strapi",
@@ -27,23 +27,43 @@
27
27
  "url": "https://strapi.io"
28
28
  }
29
29
  ],
30
- "main": "lib/index.js",
30
+ "main": "./dist/index.js",
31
+ "module": "./dist/index.mjs",
32
+ "source": "./src/index.ts",
33
+ "types": "./dist/index.d.ts",
34
+ "files": [
35
+ "dist/"
36
+ ],
31
37
  "scripts": {
32
- "lint": "run -T eslint ."
38
+ "build": "pack-up build && run copy-files",
39
+ "clean": "run -T rimraf ./dist",
40
+ "copy-files": "copyfiles -u 1 -a 'src/templates/**/*' 'src/files/**/*' dist",
41
+ "lint": "run -T eslint .",
42
+ "test:ts": "run -T tsc --noEmit",
43
+ "test:unit": "run -T jest",
44
+ "test:unit:watch": "run -T jest --watch",
45
+ "watch": "pack-up watch"
33
46
  },
34
47
  "dependencies": {
35
48
  "@sindresorhus/slugify": "1.1.0",
36
- "@strapi/typescript-utils": "0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71",
37
- "@strapi/utils": "0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71",
49
+ "@strapi/typescript-utils": "0.0.0-next.f4ec69568d980c6fee91ce2ee0f41c138347aa81",
50
+ "@strapi/utils": "0.0.0-next.f4ec69568d980c6fee91ce2ee0f41c138347aa81",
38
51
  "chalk": "4.1.2",
39
- "fs-extra": "10.0.0",
52
+ "copyfiles": "2.4.1",
53
+ "fs-extra": "11.2.0",
40
54
  "node-plop": "0.26.3",
41
- "plop": "2.7.6",
55
+ "plop": "4.0.1",
42
56
  "pluralize": "8.0.0"
43
57
  },
58
+ "devDependencies": {
59
+ "@strapi/pack-up": "5.0.0",
60
+ "@types/fs-extra": "11.0.4",
61
+ "eslint-config-custom": "0.0.0-next.f4ec69568d980c6fee91ce2ee0f41c138347aa81",
62
+ "tsconfig": "0.0.0-next.f4ec69568d980c6fee91ce2ee0f41c138347aa81"
63
+ },
44
64
  "engines": {
45
- "node": ">=14.19.1 <=18.x.x",
65
+ "node": ">=18.0.0 <=22.x.x",
46
66
  "npm": ">=6.0.0"
47
67
  },
48
- "gitHead": "f45143c5e2a8a9d85691d0abf79a3f42024a0c71"
68
+ "gitHead": "f4ec69568d980c6fee91ce2ee0f41c138347aa81"
49
69
  }
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- node_modules/
2
- .eslintrc.js
3
- lib/files/
package/.eslintrc.js DELETED
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ['custom/back'],
4
- };
@@ -1,26 +0,0 @@
1
- /**
2
- *
3
- * Initializer
4
- *
5
- */
6
-
7
- import { useEffect, useRef } from 'react';
8
- import PropTypes from 'prop-types';
9
- import pluginId from '../../pluginId';
10
-
11
- const Initializer = ({ setPlugin }) => {
12
- const ref = useRef();
13
- ref.current = setPlugin;
14
-
15
- useEffect(() => {
16
- ref.current(pluginId);
17
- }, []);
18
-
19
- return null;
20
- };
21
-
22
- Initializer.propTypes = {
23
- setPlugin: PropTypes.func.isRequired,
24
- };
25
-
26
- export default Initializer;
@@ -1,12 +0,0 @@
1
- /**
2
- *
3
- * PluginIcon
4
- *
5
- */
6
-
7
- import React from 'react';
8
- import { Puzzle } from '@strapi/icons';
9
-
10
- const PluginIcon = () => <Puzzle />;
11
-
12
- export default PluginIcon;
@@ -1,63 +0,0 @@
1
- import { prefixPluginTranslations } from '@strapi/helper-plugin';
2
- import pluginPkg from '../../package.json';
3
- import pluginId from './pluginId';
4
- import Initializer from './components/Initializer';
5
- import PluginIcon from './components/PluginIcon';
6
-
7
- const name = pluginPkg.strapi.name;
8
-
9
- export default {
10
- register(app) {
11
- app.addMenuLink({
12
- to: `/plugins/${pluginId}`,
13
- icon: PluginIcon,
14
- intlLabel: {
15
- id: `${pluginId}.plugin.name`,
16
- defaultMessage: name,
17
- },
18
- Component: async () => {
19
- const component = await import(/* webpackChunkName: "[request]" */ './pages/App');
20
-
21
- return component;
22
- },
23
- permissions: [
24
- // Uncomment to set the permissions of the plugin here
25
- // {
26
- // action: '', // the action name should be plugin::plugin-name.actionType
27
- // subject: null,
28
- // },
29
- ],
30
- });
31
- app.registerPlugin({
32
- id: pluginId,
33
- initializer: Initializer,
34
- isReady: false,
35
- name,
36
- });
37
- },
38
-
39
- bootstrap(app) {},
40
- async registerTrads({ locales }) {
41
- const importedTrads = await Promise.all(
42
- locales.map((locale) => {
43
- return import(
44
- /* webpackChunkName: "translation-[request]" */ `./translations/${locale}.json`
45
- )
46
- .then(({ default: data }) => {
47
- return {
48
- data: prefixPluginTranslations(data, pluginId),
49
- locale,
50
- };
51
- })
52
- .catch(() => {
53
- return {
54
- data: {},
55
- locale,
56
- };
57
- });
58
- })
59
- );
60
-
61
- return Promise.resolve(importedTrads);
62
- },
63
- };
@@ -1,25 +0,0 @@
1
- /**
2
- *
3
- * This component is the skeleton around the actual pages, and should only
4
- * contain code that should be seen on all pages. (e.g. navigation bar)
5
- *
6
- */
7
-
8
- import React from 'react';
9
- import { Switch, Route } from 'react-router-dom';
10
- import { AnErrorOccurred } from '@strapi/helper-plugin';
11
- import pluginId from '../../pluginId';
12
- import HomePage from '../HomePage';
13
-
14
- const App = () => {
15
- return (
16
- <div>
17
- <Switch>
18
- <Route path={`/plugins/${pluginId}`} component={HomePage} exact />
19
- <Route component={AnErrorOccurred} />
20
- </Switch>
21
- </div>
22
- );
23
- };
24
-
25
- export default App;
@@ -1,20 +0,0 @@
1
- /*
2
- *
3
- * HomePage
4
- *
5
- */
6
-
7
- import React from 'react';
8
- // import PropTypes from 'prop-types';
9
- import pluginId from '../../pluginId';
10
-
11
- const HomePage = () => {
12
- return (
13
- <div>
14
- <h1>{pluginId}&apos;s HomePage</h1>
15
- <p>Happy coding</p>
16
- </div>
17
- );
18
- };
19
-
20
- export default HomePage;
@@ -1,5 +0,0 @@
1
- import pluginPkg from '../../package.json';
2
-
3
- const pluginId = pluginPkg.name.replace(/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i, '');
4
-
5
- export default pluginId;
@@ -1,5 +0,0 @@
1
- import pluginId from '../pluginId';
2
-
3
- const getTrad = (id) => `${pluginId}.${id}`;
4
-
5
- export default getTrad;
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = ({ strapi }) => {
4
- // bootstrap phase
5
- };
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- default: {},
5
- validator() {},
6
- };
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {};
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- const myController = require('./my-controller');
4
-
5
- module.exports = {
6
- myController,
7
- };
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = ({ strapi }) => ({
4
- index(ctx) {
5
- ctx.body = strapi
6
- .plugin('{{ pluginName }}')
7
- .service('myService')
8
- .getWelcomeMessage();
9
- },
10
- });
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = ({ strapi }) => {
4
- // destroy phase
5
- };
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- const register = require('./register');
4
- const bootstrap = require('./bootstrap');
5
- const destroy = require('./destroy');
6
- const config = require('./config');
7
- const contentTypes = require('./content-types');
8
- const controllers = require('./controllers');
9
- const routes = require('./routes');
10
- const middlewares = require('./middlewares');
11
- const policies = require('./policies');
12
- const services = require('./services');
13
-
14
- module.exports = {
15
- register,
16
- bootstrap,
17
- destroy,
18
- config,
19
- controllers,
20
- routes,
21
- services,
22
- contentTypes,
23
- policies,
24
- middlewares,
25
- };
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {};
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {};
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = ({ strapi }) => {
4
- // registeration phase
5
- };
@@ -1,10 +0,0 @@
1
- module.exports = [
2
- {
3
- method: 'GET',
4
- path: '/',
5
- handler: 'myController.index',
6
- config: {
7
- policies: [],
8
- },
9
- },
10
- ];
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- const myService = require('./my-service');
4
-
5
- module.exports = {
6
- myService,
7
- };
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = ({ strapi }) => ({
4
- getWelcomeMessage() {
5
- return 'Welcome to Strapi 🚀';
6
- },
7
- });
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = require('./admin/src').default;
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = require('./server');
@@ -1,24 +0,0 @@
1
- /**
2
- *
3
- * Initializer
4
- *
5
- */
6
-
7
- import { useEffect, useRef } from 'react';
8
- import pluginId from '../../pluginId';
9
-
10
- type InitializerProps = {
11
- setPlugin: (id: string) => void;
12
- };
13
-
14
- const Initializer = ({ setPlugin }: InitializerProps) => {
15
- const ref = useRef(setPlugin);
16
-
17
- useEffect(() => {
18
- ref.current(pluginId);
19
- }, []);
20
-
21
- return null;
22
- };
23
-
24
- export default Initializer;
@@ -1,12 +0,0 @@
1
- /**
2
- *
3
- * PluginIcon
4
- *
5
- */
6
-
7
- import React from 'react';
8
- import { Puzzle } from '@strapi/icons';
9
-
10
- const PluginIcon = () => <Puzzle />;
11
-
12
- export default PluginIcon;